summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorka <kai.ahrens@oracle.com>2011-03-28 22:51:37 +0200
committerka <kai.ahrens@oracle.com>2011-03-28 22:51:37 +0200
commit138363131b880ce647e0e6daf6a6d10d57792ae9 (patch)
tree1e30d55acc722e6a94a58e691c186af224d02c91
parent9a4bc0380097f979f2c16c8a23fa7f29ffbc2db0 (diff)
parent9919bf5722c55c40d8a371c8fb9ae25759a2fdad (diff)
ka102: rebased to DEV300_m104
-rw-r--r--starmath/prj/build.lst2
-rw-r--r--sw/AllLangResTarget_sw.mk1
-rwxr-xr-xsw/JunitTest_sw_complex.mk17
-rw-r--r--sw/Module_sw.mk6
-rw-r--r--sw/inc/IDocumentLayoutAccess.hxx10
-rw-r--r--sw/inc/access.hrc15
-rw-r--r--sw/inc/authfld.hxx4
-rw-r--r--sw/inc/calbck.hxx260
-rw-r--r--sw/inc/colwd.hxx2
-rw-r--r--sw/inc/crsrsh.hxx5
-rw-r--r--sw/inc/dcontact.hxx42
-rw-r--r--sw/inc/doc.hxx25
-rw-r--r--sw/inc/docsh.hxx2
-rw-r--r--sw/inc/docufld.hxx12
-rw-r--r--sw/inc/editsh.hxx9
-rw-r--r--sw/inc/expfld.hxx9
-rw-r--r--sw/inc/fchrfmt.hxx5
-rw-r--r--sw/inc/fesh.hxx5
-rw-r--r--sw/inc/fldbas.hxx2
-rw-r--r--sw/inc/fmtcol.hxx9
-rw-r--r--sw/inc/fmtfld.hxx8
-rw-r--r--sw/inc/fmthdft.hxx13
-rwxr-xr-xsw/inc/fmtmeta.hxx31
-rw-r--r--sw/inc/fmtpdsc.hxx9
-rw-r--r--sw/inc/format.hxx7
-rw-r--r--sw/inc/frmfmt.hxx10
-rw-r--r--sw/inc/ftninfo.hxx13
-rw-r--r--sw/inc/lineinfo.hxx7
-rw-r--r--sw/inc/ndhints.hxx10
-rw-r--r--sw/inc/ndnotxt.hxx2
-rw-r--r--sw/inc/ndtxt.hxx15
-rw-r--r--sw/inc/node.hxx23
-rw-r--r--sw/inc/numrule.hxx24
-rw-r--r--sw/inc/pagedesc.hxx4
-rw-r--r--sw/inc/paratr.hxx9
-rw-r--r--sw/inc/poolfmt.hrc9
-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.hxx26
-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.hxx7
-rw-r--r--sw/inc/unodraw.hxx6
-rw-r--r--sw/inc/unofield.hxx31
-rw-r--r--sw/inc/unoflatpara.hxx3
-rw-r--r--sw/inc/unoframe.hxx15
-rw-r--r--sw/inc/unomap.hxx6
-rw-r--r--sw/inc/unoport.hxx17
-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.hxx18
-rw-r--r--sw/inc/viewsh.hxx14
-rw-r--r--sw/prj/build.lst2
-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.cxx16
-rw-r--r--sw/source/core/access/accnotextframe.cxx8
-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.hxx6
-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.cxx502
-rw-r--r--sw/source/core/attr/cellatr.cxx11
-rw-r--r--sw/source/core/attr/format.cxx54
-rw-r--r--sw/source/core/crsr/bookmrk.cxx6
-rw-r--r--sw/source/core/crsr/callnk.cxx10
-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/findattr.cxx31
-rw-r--r--sw/source/core/crsr/pam.cxx12
-rwxr-xr-x[-rw-r--r--]sw/source/core/crsr/swcrsr.cxx50
-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.cxx174
-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.cxx26
-rw-r--r--sw/source/core/doc/docdesc.cxx196
-rw-r--r--sw/source/core/doc/docdraw.cxx78
-rw-r--r--sw/source/core/doc/docedt.cxx31
-rw-r--r--sw/source/core/doc/docfld.cxx77
-rw-r--r--sw/source/core/doc/docfly.cxx68
-rw-r--r--sw/source/core/doc/docfmt.cxx110
-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.cxx145
-rw-r--r--sw/source/core/doc/docnew.cxx30
-rw-r--r--sw/source/core/doc/docnum.cxx29
-rw-r--r--sw/source/core/doc/docredln.cxx10
-rw-r--r--sw/source/core/doc/doctxm.cxx89
-rw-r--r--sw/source/core/doc/fmtcol.cxx29
-rw-r--r--sw/source/core/doc/ftnidx.cxx7
-rw-r--r--sw/source/core/doc/htmltbl.cxx26
-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.cxx78
-rw-r--r--sw/source/core/docnode/ndtbl1.cxx20
-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.cxx152
-rw-r--r--sw/source/core/docnode/swbaslnk.cxx41
-rw-r--r--sw/source/core/draw/dcontact.cxx189
-rw-r--r--sw/source/core/draw/dflyobj.cxx36
-rw-r--r--sw/source/core/draw/dpage.cxx2
-rw-r--r--sw/source/core/draw/dview.cxx35
-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.cxx12
-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.cxx93
-rw-r--r--sw/source/core/fields/cellfml.cxx18
-rw-r--r--sw/source/core/fields/dbfld.cxx66
-rw-r--r--sw/source/core/fields/ddefld.cxx16
-rw-r--r--sw/source/core/fields/ddetbl.cxx22
-rw-r--r--sw/source/core/fields/docufld.cxx116
-rw-r--r--sw/source/core/fields/expfld.cxx45
-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.cxx68
-rw-r--r--sw/source/core/fields/tblcalc.cxx17
-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.cxx162
-rw-r--r--sw/source/core/frmedt/fetab.cxx2
-rw-r--r--sw/source/core/frmedt/fews.cxx186
-rw-r--r--sw/source/core/frmedt/tblsel.cxx141
-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/anchoredobjectposition.hxx60
-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.hxx21
-rw-r--r--sw/source/core/inc/flyfrms.hxx18
-rw-r--r--sw/source/core/inc/frame.hxx83
-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.hxx5
-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.cxx30
-rw-r--r--sw/source/core/layout/colfrm.cxx22
-rw-r--r--sw/source/core/layout/findfrm.cxx28
-rw-r--r--sw/source/core/layout/flowfrm.cxx67
-rw-r--r--sw/source/core/layout/fly.cxx224
-rw-r--r--sw/source/core/layout/flycnt.cxx180
-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.cxx404
-rw-r--r--sw/source/core/layout/ftnfrm.cxx212
-rw-r--r--sw/source/core/layout/hffrm.cxx28
-rw-r--r--sw/source/core/layout/layact.cxx42
-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.cxx109
-rw-r--r--sw/source/core/layout/pagechg.cxx148
-rw-r--r--sw/source/core/layout/pagedesc.cxx29
-rw-r--r--sw/source/core/layout/paintfrm.cxx75
-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.cxx113
-rw-r--r--sw/source/core/layout/tabfrm.cxx98
-rw-r--r--sw/source/core/layout/trvlfrm.cxx19
-rw-r--r--sw/source/core/layout/wsfrm.cxx180
-rw-r--r--sw/source/core/objectpositioning/anchoredobjectposition.cxx102
-rw-r--r--sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx123
-rw-r--r--sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx20
-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.cxx248
-rw-r--r--sw/source/core/text/EnhancedPDFExportHelper.cxx64
-rw-r--r--sw/source/core/text/blink.cxx2
-rw-r--r--sw/source/core/text/frmcrsr.cxx29
-rw-r--r--sw/source/core/text/frmform.cxx26
-rw-r--r--sw/source/core/text/frmpaint.cxx11
-rw-r--r--sw/source/core/text/inftxt.cxx14
-rw-r--r--sw/source/core/text/itratr.cxx42
-rw-r--r--sw/source/core/text/itrtxt.cxx6
-rw-r--r--sw/source/core/text/porfld.cxx16
-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.cxx13
-rw-r--r--sw/source/core/text/redlnitr.cxx4
-rw-r--r--sw/source/core/text/txtdrop.cxx20
-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.cxx142
-rw-r--r--sw/source/core/text/txtftn.cxx5
-rw-r--r--sw/source/core/text/txtio.cxx5
-rw-r--r--sw/source/core/text/txttab.cxx121
-rw-r--r--sw/source/core/text/widorp.cxx10
-rw-r--r--sw/source/core/tox/tox.cxx50
-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.cxx30
-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.cxx96
-rw-r--r--sw/source/core/txtnode/fntcache.cxx9
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx136
-rw-r--r--sw/source/core/txtnode/thints.cxx50
-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.cxx75
-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.cxx171
-rw-r--r--sw/source/core/unocore/unocrsrhelper.cxx4
-rw-r--r--sw/source/core/unocore/unodraw.cxx194
-rw-r--r--sw/source/core/unocore/unofield.cxx254
-rw-r--r--sw/source/core/unocore/unoflatpara.cxx4
-rw-r--r--sw/source/core/unocore/unoframe.cxx315
-rw-r--r--sw/source/core/unocore/unoftn.cxx26
-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.cxx145
-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.cxx16
-rw-r--r--sw/source/core/unocore/unoredline.cxx72
-rw-r--r--sw/source/core/unocore/unoredlines.cxx49
-rw-r--r--sw/source/core/unocore/unorefmk.cxx30
-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.cxx569
-rw-r--r--sw/source/core/unocore/unotext.cxx75
-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.cxx103
-rw-r--r--sw/source/core/view/vnew.cxx66
-rw-r--r--sw/source/core/view/vprint.cxx26
-rw-r--r--sw/source/filter/ascii/parasc.cxx2
-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.cxx23
-rw-r--r--sw/source/filter/ww8/WW8TableInfo.cxx8
-rw-r--r--sw/source/filter/ww8/WW8TableInfo.hxx2
-rwxr-xr-x[-rw-r--r--]sw/source/filter/ww8/rtfexport.cxx17
-rwxr-xr-x[-rw-r--r--]sw/source/filter/ww8/rtfexport.hxx2
-rw-r--r--sw/source/filter/ww8/wrtw8esh.cxx2
-rwxr-xr-x[-rw-r--r--]sw/source/filter/ww8/wrtw8nds.cxx104
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx40
-rw-r--r--sw/source/filter/ww8/wrtww8.hxx11
-rw-r--r--sw/source/filter/ww8/wrtww8gr.cxx2
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx51
-rw-r--r--sw/source/filter/ww8/ww8graf2.cxx3
-rw-r--r--sw/source/filter/ww8/ww8par2.cxx5
-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/swxml.cxx17
-rw-r--r--sw/source/filter/xml/wrtxml.cxx2
-rw-r--r--sw/source/filter/xml/xmlbrshi.hxx8
-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/xmlimp.cxx18
-rw-r--r--sw/source/filter/xml/xmlimp.hxx21
-rw-r--r--sw/source/filter/xml/xmlimpit.cxx17
-rw-r--r--sw/source/filter/xml/xmlimpit.hxx17
-rw-r--r--sw/source/filter/xml/xmlitem.cxx5
-rw-r--r--sw/source/filter/xml/xmlitem.hxx2
-rw-r--r--sw/source/filter/xml/xmlitemi.cxx165
-rw-r--r--sw/source/filter/xml/xmlitemm.cxx11
-rw-r--r--sw/source/filter/xml/xmlmeta.cxx26
-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.cxx23
-rw-r--r--sw/source/ui/app/docsh.cxx64
-rw-r--r--sw/source/ui/app/docsh2.cxx173
-rw-r--r--sw/source/ui/app/docstyle.cxx4
-rw-r--r--sw/source/ui/app/swmodul1.cxx11
-rw-r--r--sw/source/ui/chrdlg/break.cxx7
-rw-r--r--sw/source/ui/chrdlg/chardlg.cxx2
-rw-r--r--sw/source/ui/chrdlg/drpcps.cxx8
-rw-r--r--sw/source/ui/chrdlg/numpara.cxx6
-rw-r--r--sw/source/ui/chrdlg/swuiccoll.cxx4
-rw-r--r--sw/source/ui/config/optpage.cxx9
-rw-r--r--sw/source/ui/config/viewopt.cxx20
-rw-r--r--sw/source/ui/dialog/SwSpellDialogChildWindow.cxx50
-rw-r--r--sw/source/ui/dialog/docstdlg.cxx18
-rw-r--r--sw/source/ui/dialog/uiregionsw.cxx10
-rw-r--r--sw/source/ui/dochdl/swdtflvr.cxx23
-rw-r--r--sw/source/ui/docvw/AnnotationWin.cxx44
-rw-r--r--sw/source/ui/docvw/PostItMgr.cxx10
-rw-r--r--sw/source/ui/docvw/access.src19
-rw-r--r--sw/source/ui/docvw/edtwin.cxx10
-rw-r--r--sw/source/ui/envelp/label1.cxx12
-rw-r--r--sw/source/ui/envelp/labprt.cxx6
-rw-r--r--sw/source/ui/envelp/labprt.hxx4
-rw-r--r--sw/source/ui/envelp/swuilabimp.hxx7
-rw-r--r--sw/source/ui/fldui/fldfunc.cxx16
-rw-r--r--sw/source/ui/fldui/fldmgr.cxx6
-rw-r--r--sw/source/ui/fldui/fldpage.cxx10
-rw-r--r--sw/source/ui/frmdlg/column.cxx43
-rw-r--r--sw/source/ui/frmdlg/column.hrc1
-rw-r--r--sw/source/ui/frmdlg/column.src12
-rw-r--r--sw/source/ui/frmdlg/frmmgr.cxx18
-rw-r--r--sw/source/ui/frmdlg/frmpage.cxx116
-rw-r--r--sw/source/ui/inc/bookmark.hxx2
-rw-r--r--sw/source/ui/inc/break.hxx2
-rw-r--r--sw/source/ui/inc/column.hxx6
-rw-r--r--sw/source/ui/inc/docstdlg.hxx17
-rw-r--r--sw/source/ui/inc/drpcps.hxx4
-rw-r--r--sw/source/ui/inc/frmmgr.hxx3
-rw-r--r--sw/source/ui/inc/frmpage.hxx15
-rw-r--r--sw/source/ui/inc/glosbib.hxx7
-rw-r--r--sw/source/ui/inc/insfnote.hxx8
-rw-r--r--sw/source/ui/inc/linenum.hxx6
-rw-r--r--sw/source/ui/inc/num.hxx4
-rw-r--r--sw/source/ui/inc/numpara.hxx2
-rw-r--r--sw/source/ui/inc/optpage.hxx2
-rw-r--r--sw/source/ui/inc/outline.hxx4
-rw-r--r--sw/source/ui/inc/pgfnote.hxx4
-rw-r--r--sw/source/ui/inc/rowht.hxx2
-rw-r--r--sw/source/ui/inc/split.hxx4
-rw-r--r--sw/source/ui/inc/srtdlg.hxx4
-rw-r--r--sw/source/ui/inc/swrenamexnameddlg.hxx2
-rw-r--r--sw/source/ui/inc/swuicnttab.hxx10
-rw-r--r--sw/source/ui/inc/swuiidxmrk.hxx2
-rw-r--r--sw/source/ui/inc/tautofmt.hxx2
-rw-r--r--sw/source/ui/inc/view.hxx1
-rw-r--r--sw/source/ui/inc/wrtsh.hxx2
-rw-r--r--sw/source/ui/index/cnttab.cxx38
-rw-r--r--sw/source/ui/index/cnttab.hrc1
-rwxr-xr-x[-rw-r--r--]sw/source/ui/index/cnttab.src10
-rw-r--r--sw/source/ui/index/idxmrk.src34
-rw-r--r--sw/source/ui/index/swuiidxmrk.cxx4
-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/misc/bookmark.cxx3
-rw-r--r--sw/source/ui/misc/docfnote.cxx11
-rw-r--r--sw/source/ui/misc/glosbib.cxx7
-rw-r--r--sw/source/ui/misc/glossary.cxx11
-rw-r--r--sw/source/ui/misc/glossary.src8
-rw-r--r--sw/source/ui/misc/impfnote.hxx8
-rw-r--r--sw/source/ui/misc/insfnote.cxx8
-rw-r--r--sw/source/ui/misc/insfnote.hrc4
-rw-r--r--sw/source/ui/misc/insfnote.src6
-rw-r--r--sw/source/ui/misc/linenum.cxx19
-rw-r--r--sw/source/ui/misc/num.cxx5
-rw-r--r--sw/source/ui/misc/outline.cxx13
-rw-r--r--sw/source/ui/misc/pgfnote.cxx12
-rw-r--r--sw/source/ui/misc/srtdlg.cxx46
-rwxr-xr-xsw/source/ui/ribbar/inputwin.cxx1
-rw-r--r--sw/source/ui/shells/drwbassh.cxx11
-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/colwd.cxx2
-rw-r--r--sw/source/ui/table/convert.cxx2
-rw-r--r--sw/source/ui/table/convert.hrc3
-rw-r--r--sw/source/ui/table/convert.src6
-rw-r--r--sw/source/ui/table/rowht.cxx2
-rw-r--r--sw/source/ui/table/tabledlg.cxx36
-rw-r--r--sw/source/ui/table/tabledlg.hrc1
-rw-r--r--sw/source/ui/table/tabledlg.src1
-rw-r--r--sw/source/ui/table/tablepg.hxx3
-rw-r--r--sw/source/ui/table/tautofmt.cxx2
-rw-r--r--sw/source/ui/uiview/pview.cxx8
-rw-r--r--sw/source/ui/uiview/srcview.cxx2
-rw-r--r--sw/source/ui/uiview/view.cxx85
-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.cxx41
-rw-r--r--sw/source/ui/uno/unomod.cxx11
-rwxr-xr-x[-rw-r--r--]sw/source/ui/uno/unotxdoc.cxx122
-rwxr-xr-x[-rw-r--r--]sw/source/ui/uno/unotxvw.cxx10
-rw-r--r--sw/source/ui/utlui/navipi.cxx10
-rw-r--r--sw/source/ui/utlui/navipi.hrc1
-rw-r--r--sw/source/ui/utlui/navipi.src13
-rw-r--r--sw/source/ui/utlui/poolfmt.src23
-rw-r--r--sw/source/ui/utlui/swrenamexnameddlg.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
476 files changed, 7188 insertions, 7926 deletions
diff --git a/starmath/prj/build.lst b/starmath/prj/build.lst
index a849b8142d..bfecbc4a7f 100644
--- a/starmath/prj/build.lst
+++ b/starmath/prj/build.lst
@@ -1,4 +1,4 @@
-sm starmath : LIBXSLT:libxslt l10n svx NULL
+sm starmath : LIBXSLT:libxslt L10N:l10n svx NULL
sm starmath usr1 - all sm_mkout NULL
sm starmath\inc nmake - all sm_inc NULL
sm starmath\prj get - all sm_prj NULL
diff --git a/sw/AllLangResTarget_sw.mk b/sw/AllLangResTarget_sw.mk
index d59ddd700a..271e7577e6 100644
--- a/sw/AllLangResTarget_sw.mk
+++ b/sw/AllLangResTarget_sw.mk
@@ -107,6 +107,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 4eb0dc4052..bbd05ffa80 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,18 @@ $(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 \
+))
+
+# CheckBookmarks currently fails on windows because the hashes are different
+ifneq ($(OS),WNT)
+$(eval $(call gb_JunitTest_add_classes,sw_complex,\
+ complex.writer.CheckBookmarks \
))
+endif
# vim: set noet sw=4 ts=4:
diff --git a/sw/Module_sw.mk b/sw/Module_sw.mk
index 138fe30b96..c6257e22fc 100644
--- a/sw/Module_sw.mk
+++ b/sw/Module_sw.mk
@@ -39,12 +39,6 @@ $(eval $(call gb_Module_add_targets,sw,\
Package_xml \
))
-ifeq ($(strip $(ENABLE_VBA)),YES)
-$(eval $(call gb_Module_add_targets,sw,\
- Library_vbaswobj \
-))
-endif
-
$(eval $(call gb_Module_add_subsequentcheck_targets,sw,\
JunitTest_sw_complex \
JunitTest_sw_unoapi \
diff --git a/sw/inc/IDocumentLayoutAccess.hxx b/sw/inc/IDocumentLayoutAccess.hxx
index 1854661525..13dda058e0 100644
--- a/sw/inc/IDocumentLayoutAccess.hxx
+++ b/sw/inc/IDocumentLayoutAccess.hxx
@@ -30,6 +30,7 @@
#include <swtypes.hxx>
+class ViewShell;
class SwRootFrm;
class SwFrmFmt;
class SfxItemSet;
@@ -44,12 +45,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/access.hrc b/sw/inc/access.hrc
index b6c6bb3008..35ca0d763c 100644
--- a/sw/inc/access.hrc
+++ b/sw/inc/access.hrc
@@ -52,7 +52,20 @@
#define STR_ACCESS_ANNOTATION_BUTTON_NAME (RC_ACCESS_BEGIN + 20)
#define STR_ACCESS_ANNOTATION_BUTTON_DESC (RC_ACCESS_BEGIN + 21)
-#define ACCESS_ACT_END STR_ACCESS_ANNOTATION_BUTTON_DESC
+//IAccessibility2 Implementation 2009-----
+#define STR_ACCESS_PREVIEW_DOC_NAME (RC_ACCESS_BEGIN + 22)
+//#define STR_ACCESS_PREVIEW_DOC_DESC (RC_ACCESS_BEGIN + 23)
+#define STR_ACCESS_PREVIEW_DOC_SUFFIX (RC_ACCESS_BEGIN + 24)
+#define STR_ACCESS_DOC_WORDPROCESSING (RC_ACCESS_BEGIN + 25)
+#define STR_ACCESS_DOC_WORDPROCESSING_READONLY (RC_ACCESS_BEGIN + 26)
+#define STR_ACCESS_COLUMN_WIDTH (RC_ACCESS_BEGIN + 27)
+#define STR_ACCESS_PAGESETUP_SPACING (RC_ACCESS_BEGIN + 28)
+#define STR_ACCESS_SW_CATEGORY (RC_ACCESS_BEGIN + 29)
+#define STR_ACCESS_TL_GLOBAL (RC_ACCESS_BEGIN + 30)
+#define STR_ACCESS_TL_CONTENT (RC_ACCESS_BEGIN + 31)
+//-----IAccessibility2 Implementation 2009
+
+#define ACCESS_ACT_END STR_ACCESS_TL_CONTENT
#if ACCESS_ACT_END > RC_ACCESS_END
#error Resource-Id Ueberlauf in #file, #line
diff --git a/sw/inc/authfld.hxx b/sw/inc/authfld.hxx
index f04f1beb21..a8965ed21d 100644
--- a/sw/inc/authfld.hxx
+++ b/sw/inc/authfld.hxx
@@ -89,13 +89,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 sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhichId ) const;
virtual sal_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 b92af4c95b..27aaaca7f4 100644
--- a/sw/inc/calbck.hxx
+++ b/sw/inc/calbck.hxx
@@ -25,143 +25,161 @@
*
************************************************************************/
-/*************************************************************
-#* Service-Klassen
- *************************************************************/
-
-/*
-#* Aendert sich ein Attribut in einem Format, so muss diese
-#* Aenderung an alle abhaengigen Formate und ueber sie an
-#* alle betroffenen Nodes propagiert werden. Dabei muss
-#* festgestellt werden, ob die Aenderung einen Effekt haben
-#* kann, oder ob das geaenderte Attribut von dem abhaengigen
-#* Format ueberdefiniert wird (so dass ohnehin der
-#* Attributwert des abhaengigen Formates den geaenderten
-#* Wert verdeckt). Weiterhin kann der betroffene Node
-#* feststellen, ob er von dem geaenderten Attribut Gebrauch
-#* macht (Beispiel: Linienabstand fuer Unterstreichung wurde
-#* geaendert, das Attribut Unterstreichung wurde aber nicht
-#* verwendet). So wird bei Aenderungen der minimale Aufwand
-#* zum Reformatieren erkannt.
- */
#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
{
- friend class SwModify;
+ // avoids making the details of the linked list and the callback method public
+ friend class SwModify;
friend class SwClientIter;
- SwClient *pLeft, *pRight; // fuer die AVL-Sortierung
- sal_Bool bModifyLocked : 1; // wird in SwModify::Modify benutzt,
- // eigentlich ein Member des SwModify
- // aber aus Platzgruenden hier.
- sal_Bool bInModify : 1; // ist in einem Modify. (Debug!!!)
- sal_Bool bInDocDTOR : 1; // Doc wird zerstoert, nicht "abmelden"
- sal_Bool bInCache : 1; // Ist im BorderAttrCache des Layout,
- // Traegt sich dann im Modify aus!
- sal_Bool bInSwFntCache : 1; // Ist im SwFont-Cache der Formatierung
+ SwClient *pLeft, *pRight; // double-linked list of other clients
+ SwModify *pRegisteredIn; // event source
-protected:
- SwModify *pRegisteredIn;
+ // 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;
+
+ // 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, abgeleitete moegens gleichtun oder nicht. Wenn sie es gleichtun
- //kann ueber die Abhaengigkeitsliste eines Modify typsicher gecastet
- //werden.
+ // 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; }
-
- // erfrage vom Client Informationen
+ // 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
// ----------
-// Klasse hat eine doppelt Verkette Liste fuer die Abhaengigen.
-
class SW_DLLPUBLIC SwModify: public SwClient
{
- friend SvStream& operator<<( SvStream& aS, SwModify & );
+// friend class SwClientIter;
- friend class SwClientIter;
- SwClient* pRoot;
+ 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;
- 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; }
- // erfrage vom Client Informationen
+ // 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;
};
// ----------
@@ -169,9 +187,7 @@ protected:
// ----------
/*
- * Sehr sinnvolle Klasse, wenn ein Objekt von mehreren Objekten
- * abhaengig ist. Diese sollte fuer jede Abhaengigkeit ein Objekt
- * der Klasse SwDepend als Member haben.
+ * Helper class for objects that need to depend on more than one SwClient
*/
class SW_DLLPUBLIC SwDepend: public SwClient
{
@@ -182,69 +198,63 @@ public:
SwDepend(SwClient *pTellHim, SwModify *pDepend);
SwClient* GetToTell() { return pToTell; }
- virtual void Modify( SfxPoolItem *pOldValue, SfxPoolItem *pNewValue );
- // erfrage vom Client Informationen
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 *); // fuer Ptr-Korrektur
- friend void SwModify::Add(SwClient *); // nur fuer ASSERT !
+ friend SwClient* SwModify::Remove(SwClient *); // for pointer adjustments
+ friend void SwModify::Add(SwClient *pDepend); // for pointer adjustments
- SwModify const& rRoot;
- SwClient *pAkt, *pDelNext;
- // fuers Updaten der aller Iteratoren beim Einfuegen/Loeschen von
- // Clients, wenn der Iterator gerade draufsteht.
- SwClientIter *pNxtIter;
+ const SwModify& rRoot;
- SwClient* mpWatchClient; // if set, SwModify::_Remove checks if this client is removed
+ // the current object in an iteration
+ SwClient* pAct;
- TypeId aSrchId; // fuer First/Next - suche diesen Type
+ // 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;
-public:
- SW_DLLPUBLIC SwClientIter( SwModify const& );
- SW_DLLPUBLIC ~SwClientIter();
+ // 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;
- const SwModify& GetModify() const { return rRoot; }
+ // iterator can be limited to return only SwClient objects of a certain type
+ TypeId aSrchId;
-#ifndef CFRONT
- SwClient* operator++(int); // zum Naechsten
- SwClient* operator--(int); // zum Vorherigen
-#endif
- SwClient* operator++(); // zum Naechsten
- SwClient* operator--(); // zum Vorherigen
+public:
+ SW_DLLPUBLIC SwClientIter( const SwModify& );
+ SW_DLLPUBLIC ~SwClientIter();
- SwClient* GoStart(); // zum Anfang
- SwClient* GoEnd(); // zum Ende
+ const SwModify& GetModify() const { return rRoot; }
- inline SwClient* GoRoot(); // wieder ab Root (==Start) anfangen
+ SwClient* operator++(int);
+ SwClient* GoStart();
+ SwClient* GoEnd();
+ // 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() // wieder ab Root anfangen
-{
- pAkt = rRoot.pRoot;
- return (pDelNext = pAkt);
-}
-
-
-
#endif
diff --git a/sw/inc/colwd.hxx b/sw/inc/colwd.hxx
index ba121cd37f..ce2b15e668 100644
--- a/sw/inc/colwd.hxx
+++ b/sw/inc/colwd.hxx
@@ -41,11 +41,11 @@ class SwTableFUNC;
class SwTableWidthDlg : public SvxStandardDialog
{
+ FixedLine aWidthFL;
FixedText aColFT;
NumericField aColEdit;
FixedText aWidthFT;
MetricField aWidthEdit;
- FixedLine aWidthFL;
OKButton aOKBtn;
CancelButton aCancelBtn;
HelpButton aHelpBtn;
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index 2c9f510d19..fcf7207a5f 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -327,6 +327,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 );
@@ -334,8 +337,6 @@ public:
SwCrsrShell( SwCrsrShell& rShell, Window *pWin );
virtual ~SwCrsrShell();
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
-
// IShellCursorSupplier
virtual SwPaM & CreateNewShellCursor();
virtual SwPaM & GetCurrentShellCursor();
diff --git a/sw/inc/dcontact.hxx b/sw/inc/dcontact.hxx
index 109ae2cc94..ccea938797 100644
--- a/sw/inc/dcontact.hxx
+++ b/sw/inc/dcontact.hxx
@@ -28,17 +28,14 @@
#define _DCONTACT_HXX
#include <svx/svdobj.hxx>
-// OD 14.05.2003 #108784#
#include <svx/svdovirt.hxx>
-// OD 2004-01-16 #110582#
#include <swtypes.hxx>
#include <fmtanchr.hxx>
#include <frmfmt.hxx>
-
-// OD 17.06.2003 #108784#
#include <list>
#include "calbck.hxx"
+#include <anchoreddrawobject.hxx>
class SfxPoolItem;
class SwFrmFmt;
@@ -50,13 +47,10 @@ class SwVirtFlyDrawObj;
class SwFmtAnchor;
class SwFlyDrawObj;
class SwRect;
-// OD 17.06.2003 #108784# - forward declaration for class <SwDrawVirtObj>
class SwDrawContact;
-// OD 2004-01-16 #110582#
struct SwPosition;
class SwIndex;
-// OD 2004-03-25 #i26791#
-#include <anchoreddrawobject.hxx>
+class SdrTextObj;
//Der Umgekehrte Weg: Sucht das Format zum angegebenen Objekt.
//Wenn das Object ein SwVirtFlyDrawObj ist so wird das Format von
@@ -212,7 +206,7 @@ public:
@author
*/
- 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
@@ -240,14 +234,9 @@ private:
// OD 2004-04-01 #i26791#
SwFlyDrawObj* mpMasterObj;
- /** method to determine new order number for new instance of <SwVirtFlyDrawObj>
-
- OD 2004-08-16 #i27030#
- 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();
@@ -265,11 +254,6 @@ public:
virtual SdrObject* GetMaster();
virtual void SetMaster( SdrObject* _pNewMaster );
- SwVirtFlyDrawObj* CreateNewRef( SwFlyFrm* pFly );
-
- // virtuelle Methoden von SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew );
-
// OD 2004-01-16 #110582# - 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.
@@ -282,7 +266,7 @@ public:
@author
*/
- virtual void GetAnchoredObjs( std::vector<SwAnchoredObject*>& _roAnchoredObjs ) const;
+ virtual void GetAnchoredObjs( std::list<SwAnchoredObject*>& _roAnchoredObjs ) const;
};
// OD 16.05.2003 #108784# - new class for re-direct methods calls at a 'virtual'
@@ -468,6 +452,11 @@ class SwDrawContact : public SwContact
SwDrawContact( const SwDrawContact& );
SwDrawContact& operator=( const SwDrawContact& );
// <--
+
+ protected:
+ // virtuelle Methoden von SwClient
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew );
+
public:
TYPEINFO();
@@ -530,9 +519,6 @@ class SwDrawContact : public SwContact
// by frame.
SdrObject* GetDrawObjectByAnchorFrm( const SwFrm& _rAnchorFrm );
- // virtuelle Methoden von SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew );
-
// virtuelle Methoden von SdrObjUserCall
virtual void Changed(const SdrObject& rObj, SdrUserCallType eType, const Rectangle& rOldBoundRect);
@@ -555,7 +541,9 @@ class SwDrawContact : public SwContact
@author
*/
- 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 495cacf85f..e5b3fd8d84 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -328,7 +328,7 @@ class SW_DLLPUBLIC SwDoc :
SwTOXTypes *pTOXTypes; // Verzeichnisse
SwDefTOXBase_Impl * pDefTOXBases; // defaults of SwTOXBase's
- SwRootFrm *pLayout; // Rootframe des spezifischen Layouts.
+ ViewShell *pCurrentView; // SwDoc should get a new member pCurrentView//swmod 071225
SdrModel *pDrawModel; // StarView Drawing
SwDocUpdtFld *pUpdtFlds; // Struktur zum Field-Update
@@ -458,7 +458,6 @@ private:
bool mbNewFldLst : 1; // TRUE: Felder-Liste neu aufbauen
bool mbCopyIsMove : 1; // TRUE: Copy ist ein verstecktes Move
bool mbVisibleLinks : 1; // TRUE: Links werden sichtbar eingefuegt
- bool mbBrowseMode : 1; // TRUE: Dokument im BrowseModus anzeigen
bool mbInReading : 1; // TRUE: Dokument wird gerade gelesen
bool mbInXMLImport : 1; // TRUE: During xml import, attribute portion building is not necessary
bool mbUpdateTOX : 1; // TRUE: nach Dokument laden die TOX Updaten
@@ -590,6 +589,8 @@ private:
bool mbProtectForm : 1;
bool mbTabAtLeftIndentForParagraphsInList; // OD 2008-06-05 #i89181# - see above
+ bool mbLastBrowseMode : 1;
+
// #i78591#
sal_uInt32 n32DummyCompatabilityOptions1;
sal_uInt32 n32DummyCompatabilityOptions2;
@@ -948,15 +949,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
*/
@@ -1158,6 +1162,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;
@@ -1326,16 +1332,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-Schnittstelle
sal_uInt16 GetPageDescCnt() const { return aPageDescs.Count(); }
const SwPageDesc& GetPageDesc( const sal_uInt16 i ) const { return *aPageDescs[i]; }
@@ -1898,7 +1901,7 @@ public:
// update all modified OLE-Objects. The modification is called over the
// StarOne - Interface --> Bug 67026
void SetOLEObjModified()
- { if( GetRootFrm() ) aOLEModifiedTimer.Start(); }
+ { if( GetCurrentViewShell() ) aOLEModifiedTimer.Start(); } //swmod 071107//swmod 071225
// -------------------- Uno - Schnittstellen ---------------------------
const SwUnoCrsrTbl& GetUnoCrsrTbl() const { return *pUnoCrsrTbl; }
diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx
index e4e7a7e172..3f34df44ed 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 0d7717395f..eacd63c30e 100644
--- a/sw/inc/docufld.hxx
+++ b/sw/inc/docufld.hxx
@@ -639,8 +639,10 @@ public:
SwRefPageSetFieldType();
virtual SwFieldType* Copy() const;
+
+protected:
// ueberlagert, weil es nichts zum Updaten gibt!
- virtual void Modify( SfxPoolItem *, SfxPoolItem * );
+ 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;
-
- // ueberlagert, um alle RefPageGet-Felder zu updaten
- 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 125a6e0dcd..08d4d63860 100644
--- a/sw/inc/editsh.hxx
+++ b/sw/inc/editsh.hxx
@@ -564,7 +564,7 @@ public:
sal_Bool HasOtherCnt() const; // gibt es Rahmen, Fussnoten, ...
/* Anwenden der ViewOptions mit Start-/EndAction */
- inline void ApplyViewOptions( const SwViewOption &rOpt );
+ virtual void ApplyViewOptions( const SwViewOption &rOpt );
// Text innerhalb der Selektion erfragen
// Returnwert liefert sal_False, wenn der selektierte Bereich
@@ -940,13 +940,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 85eeef81cb..85f86e4942 100644
--- a/sw/inc/expfld.hxx
+++ b/sw/inc/expfld.hxx
@@ -82,8 +82,8 @@ public:
// ueberlagert, weil das Get-Field nicht veraendert werden kann
// und dann auch nicht aktualisiert werden muss. Aktualisierung
// erfolgt beim Aendern von Set-Werten !
-
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew );
+protected:
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew );
};
/*--------------------------------------------------------------------
@@ -160,12 +160,14 @@ class SW_DLLPUBLIC SwSetExpFieldType : public SwValueFieldType
{
String sName;
const SwNode* pOutlChgNd;
-// sal_Unicode cDelim;
String sDelim;
sal_uInt16 nType;
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 );
@@ -183,7 +185,6 @@ public:
// ueberlagert, weil das Set-Field selbst dafuer sorgt, das
// es aktualisiert wird.
- 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 5b7f0c3867..78da02863c 100644
--- a/sw/inc/fchrfmt.hxx
+++ b/sw/inc/fchrfmt.hxx
@@ -53,6 +53,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 &);
@@ -72,8 +75,6 @@ public:
virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
- // an das SwTxtCharFmt weiterleiten (vom 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/fesh.hxx b/sw/inc/fesh.hxx
index b6061f668b..1d06ad1b7b 100644
--- a/sw/inc/fesh.hxx
+++ b/sw/inc/fesh.hxx
@@ -374,7 +374,10 @@ public:
void SetFlyPos( const Point &rAbsPos);
Point FindAnchorPos( const Point &rAbsPos, sal_Bool bMoveIt = sal_False );
// determines whether a frame or its environment is vertically formatted and right-to-left
- sal_Bool IsFrmVertical(sal_Bool bEnvironment, sal_Bool& bRightToLeft) const;
+ // --> OD 2009-08-31 #mongolianlayout#
+ // also determines, if frame or its environmane is in mongolianlayout (vertical left-to-right)
+ // - add output parameter <bVertL2R>
+ sal_Bool IsFrmVertical(const sal_Bool bEnvironment, sal_Bool& bRightToLeft, sal_Bool& bVertL2R) const;
SwFrmFmt* GetCurFrmFmt() const; //Wenn Rahmen, dann Rahmenvorlage, sonst 0
void SetFrmFmt( SwFrmFmt *pFmt, sal_Bool bKeepOrient = sal_False, Point* pDocPos = 0 ); //Wenn Rahmen, dann Rahmenvorlage setzen
diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx
index a3f0ee781d..ccd8b17228 100644
--- a/sw/inc/fldbas.hxx
+++ b/sw/inc/fldbas.hxx
@@ -288,7 +288,7 @@ public:
inline void SwFieldType::UpdateFlds() const
{
- ((SwFieldType*)this)->Modify( 0, 0 );
+ ((SwFieldType*)this)->ModifyNotification( 0, 0 );
}
/*--------------------------------------------------------------------
diff --git a/sw/inc/fmtcol.hxx b/sw/inc/fmtcol.hxx
index 867ea21a2f..305959abcf 100644
--- a/sw/inc/fmtcol.hxx
+++ b/sw/inc/fmtcol.hxx
@@ -96,10 +96,11 @@ protected:
//nOutlineLevel( NO_NUMBERING ) //<-#outline level,removed by zhaojianwei
mbAssignedToOutlineStyle(false) //<-#outline level,added by zhaojianwei
{ pNextTxtFmtColl = this; }
-public:
// zum "abfischen" von UL-/LR-/FontHeight Aenderungen
- virtual void Modify( SfxPoolItem*, SfxPoolItem* );
+ virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
+
+public:
TYPEINFO(); //Bereits in Basisklasse Client drin.
@@ -255,6 +256,7 @@ public:
void SetCondition( sal_uLong nCond, sal_uLong nSubCond );
SwTxtFmtColl* GetTxtFmtColl() const { return (SwTxtFmtColl*)GetRegisteredIn(); }
+ void RegisterToFormat( SwFmt& );
};
@@ -281,9 +283,6 @@ public:
virtual ~SwConditionTxtFmtColl();
- // zum "abfischen" von Aenderungen
-// virtual void Modify( SfxPoolItem*, SfxPoolItem* );
-
const SwCollCondition* HasCondition( const SwCollCondition& rCond ) const;
const SwFmtCollConditions& GetCondColls() const { return aCondColls; }
void InsertCondition( const SwCollCondition& rCond );
diff --git a/sw/inc/fmtfld.hxx b/sw/inc/fmtfld.hxx
index e7d78b1f68..90aabc82f3 100644
--- a/sw/inc/fmtfld.hxx
+++ b/sw/inc/fmtfld.hxx
@@ -27,6 +27,7 @@
#ifndef _FMTFLD_HXX
#define _FMTFLD_HXX
+#include <list>
#include <svl/poolitem.hxx>
#include <svl/brdcst.hxx>
#include <svl/smplhint.hxx>
@@ -37,6 +38,7 @@
class SwField;
class SwTxtFld;
class SwView;
+class SwFieldType;
// ATT_FLD ***********************************
class SW_DLLPUBLIC SwFmtFld : public SfxPoolItem, public SwClient, public SfxBroadcaster
@@ -53,6 +55,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();
@@ -68,7 +74,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 d0635971ea..4bd600cc05 100644
--- a/sw/inc/fmthdft.hxx
+++ b/sw/inc/fmthdft.hxx
@@ -34,7 +34,7 @@
class SwFrmFmt;
class IntlWrapper;
-
+class SwFmt;
//Kopfzeile, fuer Seitenformate
//Client von FrmFmt das den Header beschreibt.
@@ -61,13 +61,15 @@ 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; }
};
+
//Fusszeile, fuer Seitenformate
//Client von FrmFmt das den Footer beschreibt.
@@ -93,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 5e695c86da..fea7dd0f90 100755
--- a/sw/inc/fmtmeta.hxx
+++ b/sw/inc/fmtmeta.hxx
@@ -74,17 +74,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>
*/
@@ -99,7 +95,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;
@@ -108,6 +104,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:
@@ -119,14 +119,11 @@ public:
// SfxPoolItem
virtual int operator==( const SfxPoolItem & ) const;
virtual SfxPoolItem * Clone( SfxItemPool *pPool = 0 ) const;
-// TYPEINFO();
/// notify clients registered at m_pMeta that this meta is being (re-)moved
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 +143,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 +151,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 +161,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 c00605977d..c32200e8e7 100644
--- a/sw/inc/fmtpdsc.hxx
+++ b/sw/inc/fmtpdsc.hxx
@@ -38,6 +38,7 @@ class SwPageDesc;
class SwHistory;
class SwPaM;
class IntlWrapper;
+class SwEndNoteInfo;
//Pagedescriptor
//Client vom SwPageDesc der durch das Attribut "beschrieben" wird.
@@ -55,6 +56,9 @@ class SW_DLLPUBLIC SwFmtPageDesc : public SfxPoolItem, public SwClient
sal_uInt16 nDescNameIdx; // SW3-Reader: Stringpool-Index des Vorlagennamens
SwModify* pDefinedIn; // Verweis auf das Objekt, in dem das
// Attribut gesetzt wurde (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 );
@@ -75,8 +79,6 @@ public:
virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
virtual sal_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(); }
@@ -86,6 +88,9 @@ public:
// erfrage/setze, wo drin das Attribut verankert ist
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 a500f3708f..c00e52aa46 100644
--- a/sw/inc/format.hxx
+++ b/sw/inc/format.hxx
@@ -44,9 +44,6 @@ class SwDoc;
class SW_DLLPUBLIC SwFmt : public SwModify
{
-// friend class SwSwgReader;
-// friend class SwSwgWriter;
-
String aFmtName;
SwAttrSet aSet;
@@ -70,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(); //Bereits in Basisklasse Client drin.
@@ -80,7 +78,6 @@ public:
// fuer die Abfrage der Writer-Funktionen
sal_uInt16 Which() const { return nWhichId; }
- virtual void Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue );
// erfrage vom Format Informationen
virtual sal_Bool GetInfo( SfxPoolItem& ) const;
@@ -114,7 +111,7 @@ public:
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 859ed75a15..ee1c31c105 100644
--- a/sw/inc/frmfmt.hxx
+++ b/sw/inc/frmfmt.hxx
@@ -27,15 +27,10 @@
#ifndef _FRMFMT_HXX
#define _FRMFMT_HXX
-// --> OD 2004-08-06 #i28749#
#include <com/sun/star/text/PositionLayoutDir.hpp>
-// <--
-
#include <cppuhelper/weakref.hxx>
#include <tools/gen.hxx>
-
#include <format.hxx>
-
#include "swdllapi.h"
class SwFlyFrm;
@@ -71,6 +66,8 @@ protected:
pDrvdFrm, nFmtWhich )
{}
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNewValue );
+
public:
TYPEINFO(); //Bereits in Basisklasse Client drin.
@@ -82,8 +79,6 @@ public:
virtual Graphic MakeGraphic( ImageMap* pMap = NULL );
- virtual void Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue );
-
// returnt das IMapObject, das an dem Format (Fly), in der ImageMap
// an der Point Position definiert ist.
// rPoint - teste auf der DocPosition
@@ -146,6 +141,7 @@ public:
{ m_wXObject = xObject; }
DECL_FIXEDMEMPOOL_NEWDEL_DLL(SwFrmFmt)
+ void RegisterToFormat( SwFmt& rFmt );
};
//Das FlyFrame-Format ------------------------------
diff --git a/sw/inc/ftninfo.hxx b/sw/inc/ftninfo.hxx
index ca274c9d88..6fe3e9e154 100644
--- a/sw/inc/ftninfo.hxx
+++ b/sw/inc/ftninfo.hxx
@@ -29,9 +29,6 @@
#include <tools/string.hxx>
#include "swdllapi.h"
-//#ifndef _NUMRULE_HXX
-//#include <numrule.hxx>
-//#endif
#include <calbck.hxx>
#include <editeng/numitem.hxx>
@@ -48,13 +45,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(); } // kann 0 sein
@@ -67,8 +67,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;
@@ -80,6 +78,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 51e8fab3b1..7f0f1b9545 100644
--- a/sw/inc/lineinfo.hxx
+++ b/sw/inc/lineinfo.hxx
@@ -28,9 +28,6 @@
#define SW_LINEINFO_HXX
#include "calbck.hxx"
-//#ifndef _NUMRULE_HXX
-//#include <numrule.hxx>
-//#endif
#include <editeng/numitem.hxx>
#include "swdllapi.h"
@@ -60,6 +57,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();
@@ -100,7 +99,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 950a37c2bc..e2e3a3d1cd 100644
--- a/sw/inc/ndhints.hxx
+++ b/sw/inc/ndhints.hxx
@@ -33,7 +33,6 @@
#include "swtypes.hxx"
-//#include "numrule.hxx"
class SwTxtNode;
class SwRegHistory; // steht im RolBck.hxx
@@ -44,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 90c0da9c8e..991d4e43a2 100644
--- a/sw/inc/ndnotxt.hxx
+++ b/sw/inc/ndnotxt.hxx
@@ -63,7 +63,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 df92e03cc3..4db3ecbfc4 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -44,15 +44,11 @@
#include <vector>
#include <set>
-
+class SfxHint;
class SwNumRule;
class SwNodeNum;
-// --> OD 2008-05-06 #refactorlists#
class SwList;
-// <--
-// --> OD 2008-12-02 #i96772#
class SvxLRSpaceItem;
-// <--
namespace utl {
class TransliterationWrapper;
@@ -228,6 +224,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;
@@ -356,7 +356,7 @@ public:
const ::com::sun::star::uno::Sequence<sal_Int32>& rOffsets );
// virtuelle Methoden aus dem CntntNode
- virtual SwCntntFrm *MakeFrm();
+ virtual SwCntntFrm *MakeFrm( SwFrm* );
virtual SwCntntNode *SplitCntntNode( const SwPosition & );
virtual SwCntntNode *JoinNext();
virtual SwCntntNode *JoinPrev();
@@ -794,9 +794,6 @@ public:
TYPEINFO(); // fuer rtti
- // fuers Umhaengen der TxtFmtCollections (Outline-Nummerierung!!)
- 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 61e20549be..4d0bb8d8ec 100644
--- a/sw/inc/node.hxx
+++ b/sw/inc/node.hxx
@@ -64,6 +64,7 @@ class SwTOXBase;
class SwSectionNode;
class SwStartNode;
class SwTabFrm;
+class SwRootFrm;
class SwTable;
class SwTableNode;
class SwTableBox;
@@ -81,9 +82,8 @@ class IDocumentLineNumberAccess;
class IDocumentLinksAdministration;
class IDocumentFieldsAccess;
class IDocumentContentOperations;
-// --> OD 2007-10-31 #i83479#
class IDocumentListItems;
-// <--
+class SwOLENodes;
// --------------------
// class SwNode
@@ -397,13 +397,17 @@ protected:
// SwAttrSet (handle):
sal_uInt16 ClearItemsFromAttrSet( const std::vector<sal_uInt16>& rWhichIds );
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
+
public:
TYPEINFO(); //Bereits in Basisklasse Client drin.
- 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();
// koennen 2 Nodes zusammengefasst werden ?
@@ -417,7 +421,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;
// Gibt die tatsaechlcheGroesse des Frames zurueck bzw. ein leeres
@@ -501,11 +507,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:
// privater Constructor, weil nie kopiert werden darf !!
SwCntntNode( const SwCntntNode & rNode );
SwCntntNode & operator= ( const SwCntntNode & rNode );
-
};
@@ -525,7 +532,7 @@ public:
const SwTable& GetTable() const { return *pTable; }
SwTable& GetTable() { return *pTable; }
- SwTabFrm *MakeFrm();
+ SwTabFrm *MakeFrm( SwFrm* );
//Legt die Frms fuer den TableNode (also die TabFrms) an.
void MakeFrms( SwNodeIndex* pIdxBehind );
@@ -572,7 +579,7 @@ public:
const SwSection& GetSection() const { return *m_pSection; }
SwSection& GetSection() { return *m_pSection; }
- SwFrm *MakeFrm();
+ SwFrm *MakeFrm( SwFrm* );
//Legt die Frms fuer den SectionNode (also die SectionFrms) an.
//Im Defaultfall wird bis die Frames bis zum Ende des Bereichs angelegt,
diff --git a/sw/inc/numrule.hxx b/sw/inc/numrule.hxx
index cd9c40fcd0..13b093f648 100644
--- a/sw/inc/numrule.hxx
+++ b/sw/inc/numrule.hxx
@@ -35,23 +35,17 @@
#include "swdllapi.h"
#include <swtypes.hxx>
#include <calbck.hxx>
-#include <errhdl.hxx> // Fuer die inline-ASSERTs
-#include <error.h> // Fuer die inline-ASSERTs
+#include <errhdl.hxx>
+#include <error.h>
#include <hints.hxx>
#include <hash_map>
#include <stringhash.hxx>
-// --> OD 2008-02-21 #refactorlists#
-class SwNodeNum;
#include <SwNumberTreeTypes.hxx>
-// <--
-// --> OD 2008-02-19 #refactorlists#
#include <vector>
+
class SwTxtFmtColl;
-// <--
-// --> OD 2008-07-08 #i91400#
class IDocumentListsAccess;
-// <--
-
+class SwNodeNum;
class Font;
class SvxBrushItem;
class SvxNumRule;
@@ -72,6 +66,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& );
@@ -84,9 +81,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;
@@ -168,9 +165,6 @@ private:
String msDefaultListId;
// <--
- // forbidden and not implemented.
- SwNumRule();
-
public:
// --> OD 2008-02-08 #newlistlevelattrs#
// add parameter <eDefaultNumberFormatPositionAndSpaceMode>
diff --git a/sw/inc/pagedesc.hxx b/sw/inc/pagedesc.hxx
index 8737ded3f2..fd0167e2ae 100644
--- a/sw/inc/pagedesc.hxx
+++ b/sw/inc/pagedesc.hxx
@@ -160,6 +160,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; }
@@ -213,7 +216,6 @@ public:
void SetRegisterFmtColl( const SwTxtFmtColl* rFmt );
const SwTxtFmtColl* GetRegisterFmtColl() const;
- virtual void Modify( SfxPoolItem *pOldValue, SfxPoolItem *pNewValue );
void RegisterChange();
// erfragen und setzen der PoolFormat-Id
diff --git a/sw/inc/paratr.hxx b/sw/inc/paratr.hxx
index 7016097c48..fefe6f2927 100644
--- a/sw/inc/paratr.hxx
+++ b/sw/inc/paratr.hxx
@@ -69,6 +69,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 Methoden" vom SfxPoolItem
@@ -94,10 +98,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* );
// erfrage vom Client Informationen
virtual sal_Bool GetInfo( SfxPoolItem& ) const;
diff --git a/sw/inc/poolfmt.hrc b/sw/inc/poolfmt.hrc
index c73baa70ec..e9e48caf39 100644
--- a/sw/inc/poolfmt.hrc
+++ b/sw/inc/poolfmt.hrc
@@ -268,7 +268,14 @@
#define STR_POOLNUMRULE_BUL3 (RC_POOLNUMRULE_BEGIN+ 7)
#define STR_POOLNUMRULE_BUL4 (RC_POOLNUMRULE_BEGIN+ 8)
#define STR_POOLNUMRULE_BUL5 (RC_POOLNUMRULE_BEGIN+ 9)
-
+//IAccessibility2 Impplementaton 2009-----
+//Solution:Define column item's accessible name ID.
+#define STR_COLUMN_VALUESET_ITEM0 (RC_POOLNUMRULE_BEGIN + 10 )
+#define STR_COLUMN_VALUESET_ITEM1 (RC_POOLNUMRULE_BEGIN + 11 )
+#define STR_COLUMN_VALUESET_ITEM2 (RC_POOLNUMRULE_BEGIN + 12 )
+#define STR_COLUMN_VALUESET_ITEM3 (RC_POOLNUMRULE_BEGIN + 13 )
+#define STR_COLUMN_VALUESET_ITEM4 (RC_POOLNUMRULE_BEGIN + 14 )
+//-----IAccessibility2 Impplementaton 2009
//-----------------
// Paragraph styles
//-----------------
diff --git a/sw/inc/printdata.hxx b/sw/inc/printdata.hxx
index a2561e0c63..7b2e2469bd 100644
--- a/sw/inc/printdata.hxx
+++ b/sw/inc/printdata.hxx
@@ -45,7 +45,8 @@ class _SetGetExpFlds;
class SwViewOption;
class OutputDevice;
class SwViewOptionAdjust_Impl;
-class SwWrtShell;
+class SwPrtOptions;
+class ViewShell;
class SfxViewShell;
// forward declarations
@@ -266,9 +267,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 1f5e559f90..2345d08d68 100644
--- a/sw/inc/reffld.hxx
+++ b/sw/inc/reffld.hxx
@@ -72,13 +72,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 95e66148a2..8511c6752b 100644
--- a/sw/inc/section.hxx
+++ b/sw/inc/section.hxx
@@ -161,7 +161,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;
@@ -177,6 +176,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
@@ -193,10 +195,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)
@@ -300,6 +300,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.
@@ -311,7 +312,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 eec5b12432..af704025b9 100644
--- a/sw/inc/swcrsr.hxx
+++ b/sw/inc/swcrsr.hxx
@@ -95,11 +95,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;
@@ -139,7 +135,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)
@@ -150,7 +146,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 8953fa7bc7..f1e92dc362 100644
--- a/sw/inc/swddetbl.hxx
+++ b/sw/inc/swddetbl.hxx
@@ -42,12 +42,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 0000000000..cbdc0b5231
--- /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 779f2b5f92..04b2eb871b 100644
--- a/sw/inc/swtable.hxx
+++ b/sw/inc/swtable.hxx
@@ -27,9 +27,7 @@
#ifndef _SWTABLE_HXX
#define _SWTABLE_HXX
#include <tools/mempool.hxx>
-#ifndef _TOOLS_REF_HXX
#include <tools/ref.hxx>
-#endif
#include <svl/svarray.hxx>
#include <tblenum.hxx>
#include <swtypes.hxx>
@@ -43,6 +41,7 @@ class SwStartNode;
#include <boost/noncopyable.hpp>
#endif
+class SwFmt;
class Color;
class SwFrmFmt;
class SwTableFmt;
@@ -86,7 +85,7 @@ typedef SwTableLine* SwTableLinePtr;
class SW_DLLPUBLIC SwTable: public SwClient //Client vom FrmFmt
{
- using SwClient::IsModifyLocked;
+
protected:
SwTableLines aLines;
@@ -116,6 +115,8 @@ protected:
sal_Bool IsModifyLocked(){ return bModifyLocked;}
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew );
+
public:
enum SearchType
{
@@ -175,10 +176,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;
@@ -322,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 );
#ifdef DBG_UTIL
void CheckConsistency() const;
#endif
@@ -348,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();
@@ -364,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
@@ -402,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();
@@ -468,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 ee78d93e53..172f5f66d2 100644
--- a/sw/inc/swtblfmt.hxx
+++ b/sw/inc/swtblfmt.hxx
@@ -86,12 +86,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 3aed4219c7..189d4e2c73 100644
--- a/sw/inc/swtypes.hxx
+++ b/sw/inc/swtypes.hxx
@@ -228,6 +228,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 1a6e437b39..2ce5c7070e 100644
--- a/sw/inc/tox.hxx
+++ b/sw/inc/tox.hxx
@@ -91,6 +91,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
@@ -105,9 +109,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;
@@ -151,7 +152,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 );
};
/*--------------------------------------------------------------------
@@ -592,6 +595,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 101d2bcfea..e7e0135c8e 100644
--- a/sw/inc/txtatr.hxx
+++ b/sw/inc/txtatr.hxx
@@ -34,6 +34,11 @@
class SwTxtNode; // fuer SwTxtFld
class SwCharFmt;
+namespace sw {
+ class MetaFieldManager;
+}
+
+
// ATT_CHARFMT *********************************************
class SwTxtCharFmt : public SwTxtAttrEnd
@@ -45,9 +50,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; }
@@ -61,7 +66,7 @@ public:
class SwTxtAttrNesting : public SwTxtAttrEnd
{
-public:
+protected:
SwTxtAttrNesting( SfxPoolItem & i_rAttr,
const xub_StrLen i_nStart, const xub_StrLen i_nEnd );
virtual ~SwTxtAttrNesting();
@@ -70,16 +75,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; }
-
};
@@ -88,15 +97,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 d11752ce1d..2d53447b7c 100644
--- a/sw/inc/txtftn.hxx
+++ b/sw/inc/txtftn.hxx
@@ -33,6 +33,7 @@ class SwNodeIndex;
class SwTxtNode;
class SwNodes;
class SwDoc;
+class SwFrm;
// ATT_FTN **********************************************************
@@ -59,7 +60,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 8324114fb2..63bb87e1f3 100644
--- a/sw/inc/txtinet.hxx
+++ b/sw/inc/txtinet.hxx
@@ -42,17 +42,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 7ed27800f0..d0ea4d7f50 100644
--- a/sw/inc/txtrfmrk.hxx
+++ b/sw/inc/txtrfmrk.hxx
@@ -41,7 +41,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 29eb7452f1..38809106b2 100644
--- a/sw/inc/txttxmrk.hxx
+++ b/sw/inc/txttxmrk.hxx
@@ -41,7 +41,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 b4ab709f29..7aa2a9b7bc 100644
--- a/sw/inc/unobaseclass.hxx
+++ b/sw/inc/unobaseclass.hxx
@@ -98,7 +98,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 d1062eb817..3cc661d135 100644
--- a/sw/inc/unobookmark.hxx
+++ b/sw/inc/unobookmark.hxx
@@ -220,8 +220,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 13722ea571..710efbab67 100644
--- a/sw/inc/unochart.hxx
+++ b/sw/inc/unochart.hxx
@@ -171,6 +171,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();
@@ -197,10 +201,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 );
@@ -292,6 +292,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,
@@ -348,11 +352,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 04a348f2c8..f2cb9fed05 100644
--- a/sw/inc/unocrsr.hxx
+++ b/sw/inc/unocrsr.hxx
@@ -40,13 +40,6 @@ public:
SwUnoCrsr( const SwPosition &rPos, SwPaM* pRing = 0 );
virtual ~SwUnoCrsr();
- // @@@ semantic: no copy ctor.
- SwUnoCrsr( SwUnoCrsr& );
-private:
- // forbidden and not implemented.
- //SwUnoCrsr( const SwUnoCrsr& );
- SwUnoCrsr & operator= ( const SwUnoCrsr& );
-
protected:
virtual const SwCntntFrm* DoSetBidiLevelLeftRight(
diff --git a/sw/inc/unodraw.hxx b/sw/inc/unodraw.hxx
index 9f13047cd8..e56c050bb9 100644
--- a/sw/inc/unodraw.hxx
+++ b/sw/inc/unodraw.hxx
@@ -257,6 +257,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);
@@ -310,9 +313,6 @@ public:
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 cea1e98853..3c159f7deb 100644
--- a/sw/inc/unofield.hxx
+++ b/sw/inc/unofield.hxx
@@ -77,6 +77,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);
@@ -109,9 +112,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);
@@ -122,9 +122,6 @@ public:
sal_uInt16 GetResId() const {return nResTypeId;}
};
-/* -----------------04.12.98 12:49-------------------
- *
- * --------------------------------------------------*/
struct SwFieldProperties_Impl;
class SwXTextField : public cppu::WeakImplHelper5
<
@@ -153,6 +150,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);
@@ -198,24 +198,18 @@ 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);
+};
-/* -----------------21.12.98 10:26-------------------
- *
- * --------------------------------------------------*/
typedef
cppu::WeakImplHelper2
<
@@ -292,9 +286,6 @@ public:
virtual void Invalidate();
};
-/* -----------------21.12.98 14:49-------------------
- *
- * --------------------------------------------------*/
class SwXFieldEnumeration : public cppu::WeakImplHelper2
<
::com::sun::star::container::XEnumeration,
@@ -309,6 +300,8 @@ class SwXFieldEnumeration : public cppu::WeakImplHelper2
protected:
virtual ~SwXFieldEnumeration();
+ //SwClient
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
public:
SwXFieldEnumeration(SwDoc* pDoc);
@@ -321,8 +314,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 d12172ea63..95d95f0723 100644
--- a/sw/inc/unoflatpara.hxx
+++ b/sw/inc/unoflatpara.hxx
@@ -122,8 +122,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 557108ea0d..12317ce565 100644
--- a/sw/inc/unoframe.hxx
+++ b/sw/inc/unoframe.hxx
@@ -55,10 +55,6 @@ class SwDoc;
class SwFmt;
class SwFlyFrmFmt;
-
-/*-----------------12.02.98 11:21-------------------
-
---------------------------------------------------*/
class BaseFrameProperties_Impl;
class SwXFrame : public cppu::WeakImplHelper6
<
@@ -87,6 +83,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:
@@ -145,9 +142,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);
@@ -163,9 +157,7 @@ public:
void SetSelection(SwPaM& rCopySource);
static SW_DLLPUBLIC SdrObject *GetOrCreateSdrObject( SwFlyFrmFmt *pFmt );
};
-/*-----------------20.02.98 11:28-------------------
---------------------------------------------------*/
typedef cppu::WeakImplHelper3
<
::com::sun::star::text::XTextFrame,
@@ -244,9 +236,7 @@ public:
void * SAL_CALL operator new( size_t ) throw();
void SAL_CALL operator delete( void * ) throw();
};
-/*-----------------20.02.98 11:28-------------------
---------------------------------------------------*/
typedef cppu::WeakImplHelper2
<
::com::sun::star::text::XTextContent,
@@ -370,7 +360,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/unomap.hxx b/sw/inc/unomap.hxx
index 114b9e9438..4153778281 100644
--- a/sw/inc/unomap.hxx
+++ b/sw/inc/unomap.hxx
@@ -129,8 +129,10 @@
#define PROPERTY_MAP_PARA_AUTO_STYLE 96
#define PROPERTY_MAP_FLDTYP_DOCINFO_CUSTOM 97
#define PROPERTY_MAP_METAFIELD 98
-
-#define PROPERTY_MAP_END 99
+//IAccessibility2 Implementation 2009-----
+#define PROPERTY_MAP_ACCESSIBILITY_TEXT_ATTRIBUTE 99
+//-----IAccessibility2 Implementation 2009
+#define PROPERTY_MAP_END 100
//S&E
#define WID_WORDS 0
diff --git a/sw/inc/unoport.hxx b/sw/inc/unoport.hxx
index aa04b0de4b..7007b0410a 100644
--- a/sw/inc/unoport.hxx
+++ b/sw/inc/unoport.hxx
@@ -133,9 +133,9 @@ private:
SwFmtFld * GetFldFmt(bool bInit = false);
-protected:
+ void init(const SwUnoCrsr* pPortionCursor);
- //SfxItemPropertySet& GetPropSet() { return aPropSet; }
+protected:
void SAL_CALL SetPropertyValues_Impl(
const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames,
@@ -145,9 +145,6 @@ protected:
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);
-// ::com::sun::star::uno::Any GetPropertyValue( const SfxItemPropertyMap *pEntry,
-// SwUnoCrsr *pUnoCrsr,
-// SfxItemSet *pSet );
void GetPropertyValues( const ::rtl::OUString *pPropertyNames,
::com::sun::star::uno::Any *pValues,
sal_Int32 nLength );
@@ -161,6 +158,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 );
@@ -229,9 +229,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; }
@@ -317,9 +314,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 6eb5aa858c..d8556a98c4 100644
--- a/sw/inc/unoredline.hxx
+++ b/sw/inc/unoredline.hxx
@@ -148,9 +148,9 @@ 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 288832018f..13abf33aa2 100644
--- a/sw/inc/unoredlines.hxx
+++ b/sw/inc/unoredlines.hxx
@@ -95,9 +95,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 65fc799c07..5b3f1666c8 100644
--- a/sw/inc/unosett.hxx
+++ b/sw/inc/unosett.hxx
@@ -176,6 +176,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
@@ -223,9 +227,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 a22909d7db..1b10ef5001 100644
--- a/sw/inc/unostyle.hxx
+++ b/sw/inc/unostyle.hxx
@@ -211,6 +211,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,
@@ -286,7 +287,6 @@ public:
StartListening(*pBasePool);
}
SwDoc* GetDoc() const { return m_pDoc; }
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
};
/* -----------------------------15.12.00 14:25--------------------------------
@@ -377,10 +377,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);
@@ -400,13 +402,14 @@ 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);
};
+
/*-- 19.05.2006 11:20:02---------------------------------------------------
an automatic style
-----------------------------------------------------------------------*/
@@ -428,7 +431,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);
@@ -461,6 +463,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 f0aee6bafc..9f301283de 100644
--- a/sw/inc/unotbl.hxx
+++ b/sw/inc/unotbl.hxx
@@ -115,6 +115,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
@@ -162,9 +165,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 );
@@ -194,6 +194,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);
@@ -214,9 +217,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);
};
@@ -274,7 +274,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;
@@ -418,7 +418,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(); }
};
@@ -503,7 +503,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);
@@ -565,7 +565,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);
};
/* -----------------03.02.99 07:31-------------------
@@ -613,7 +613,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 31024deab4..6c0c4c2061 100644
--- a/sw/inc/unotext.hxx
+++ b/sw/inc/unotext.hxx
@@ -291,6 +291,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<
@@ -334,12 +340,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 98bb3416d3..7d48595e8e 100644
--- a/sw/inc/unotextmarkup.hxx
+++ b/sw/inc/unotextmarkup.hxx
@@ -65,14 +65,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 0228bd4e45..0301ba8279 100644
--- a/sw/inc/unotxdoc.hxx
+++ b/sw/inc/unotxdoc.hxx
@@ -129,8 +129,7 @@ class SfxViewFrame;
class SwPrintUIOptions;
class SwPrintData;
class SwRenderData;
-class SwWrtShell;
-
+class ViewShell;
typedef UnoActionContext* UnoActionContextPtr;
SV_DECL_PTRARR(ActionContextArr, UnoActionContextPtr, 4, 4)
@@ -596,18 +595,16 @@ public:
-----------------------------------------------------------------------*/
class SwViewOptionAdjust_Impl
{
- SwWrtShell & m_rShell;
+ ViewShell & m_rShell;
SwViewOption m_aOldViewOptions;
// SwViewOption m_aRenderViewOptions; // view options to use when rendering for PDF export or printing
// bool m_bRestoreViewOptions;
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 49eab99e71..d27ee05683 100644
--- a/sw/inc/usrfld.hxx
+++ b/sw/inc/usrfld.hxx
@@ -61,8 +61,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);
@@ -75,6 +73,9 @@ public:
virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nMId ) const;
virtual sal_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 992712667c..bdc74da4bb 100644
--- a/sw/inc/viewopt.hxx
+++ b/sw/inc/viewopt.hxx
@@ -158,10 +158,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
- // --> FME 2004-06-29 #114856# Formular view
- 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;
@@ -409,13 +408,14 @@ public:
sal_Bool IsSelectionInReadonly() const {return bSelectionInReadonly;}
void SetSelectionInReadonly(sal_Bool bSet) {bSelectionInReadonly = bSet;}
- // --> FME 2004-06-29 #114856# Formular view
- 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 a874ad77fb..c553a55edf 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -36,6 +36,7 @@
#include <ring.hxx>
#include <swrect.hxx>
#include <errhdl.hxx>
+#include <boost/shared_ptr.hpp>// swmod 080115
#include <vcl/mapmod.hxx>
#include <vcl/print.hxx>
@@ -98,7 +99,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
{
@@ -170,6 +172,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 );
@@ -277,7 +281,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?
@@ -285,6 +289,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
@@ -431,7 +439,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/prj/build.lst b/sw/prj/build.lst
index 71a6b39a26..c491c7f4e7 100644
--- a/sw/prj/build.lst
+++ b/sw/prj/build.lst
@@ -1,2 +1,2 @@
-sw sw : filter l10n connectivity OOo:writerperfect vbahelper svx stoc writerfilter LIBXSLT:libxslt NULL
+sw sw : filter L10N:l10n connectivity OOo:writerperfect vbahelper svx stoc writerfilter LIBXSLT:libxslt NULL
sw sw\prj nmake - all sw_prj NULL
diff --git a/sw/qa/complex/accessibility/makefile.mk b/sw/qa/complex/accessibility/makefile.mk
new file mode 100644
index 0000000000..06e7c6a704
--- /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 0000000000..e5b368083a
--- /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 25a11338ae..088c9aede3 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 0000000000..f5102c2c9c
--- /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 84dbad5152..75088ba295 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 b6f9a0e312..76451fec38 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 a2a122b6b2..00727e52a4 100644
--- a/sw/source/core/access/accdoc.cxx
+++ b/sw/source/core/access/accdoc.cxx
@@ -66,10 +66,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 b8f6d0def6..76a92cf5c0 100644
--- a/sw/source/core/access/accframebase.cxx
+++ b/sw/source/core/access/accframebase.cxx
@@ -216,7 +216,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() );
@@ -230,13 +230,13 @@ void SwAccessibleFrameBase::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
OUString sOldName( GetName() );
ASSERT( !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 );
ASSERT( !pNew ||
- static_cast < SwStringMsgPoolItem * >( pNew )->GetString() == rNewName,
+ static_cast < const SwStringMsgPoolItem * >( pNew )->GetString() == rNewName,
"invalid new name" );
if( sOldName != GetName() )
@@ -250,18 +250,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;
}
}
@@ -271,7 +273,7 @@ void SwAccessibleFrameBase::Dispose( sal_Bool bRecursive )
vos::OGuard aGuard(Application::GetSolarMutex());
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 a566103ee2..2b92665d95 100644
--- a/sw/source/core/access/accframebase.hxx
+++ b/sw/source/core/access/accframebase.hxx
@@ -51,6 +51,7 @@ protected:
virtual void _InvalidateFocus();
virtual ~SwAccessibleFrameBase();
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
public:
@@ -60,8 +61,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 47b4007c14..66f41e2d7e 100644
--- a/sw/source/core/access/accfrmobj.cxx
+++ b/sw/source/core/access/accfrmobj.cxx
@@ -356,7 +356,7 @@ const SwFrm* SwAccessibleChild::GetParent( const sal_Bool bInPagePreview ) const
if( bInPagePreview )
pParent = pFly->FindPageFrm();
else
- pParent = pFly->FindRootFrm();
+ pParent = pFly->getRootFrm();
}
}
else
@@ -392,7 +392,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 b49c645cb9..4ffe37aa1e 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -68,14 +68,12 @@
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <cppuhelper/implbase1.hxx>
-// OD 15.01.2003 #103492#
#include <pagepreviewlayout.hxx>
-// --> OD 2005-12-13 #i27301#
#include <pam.hxx>
#include <ndtxt.hxx>
-// <--
#include <dflyobj.hxx>
#include <prevwpage.hxx>
+#include <switerator.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::accessibility;
@@ -2722,15 +2720,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() )
- {
- ASSERT( 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 =
@@ -2758,7 +2749,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 40e9652f1e..ba0e3416b7 100644
--- a/sw/source/core/access/accnotextframe.cxx
+++ b/sw/source/core/access/accnotextframe.cxx
@@ -92,7 +92,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 ;
// --> OD 2009-07-14 #i73249#
@@ -112,9 +112,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;
@@ -168,7 +168,7 @@ void SwAccessibleNoTextFrame::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
case RES_FMT_CHG:
if( static_cast< SwFmtChg * >(pNew)->pChangedFmt == GetRegisteredIn() &&
static_cast< SwFmtChg * >(pOld)->pChangedFmt->IsFmtInDTOR() )
- pRegisteredIn->Remove( this );
+ GetRegisteredIn()->Remove( this );
break;
*/
}
diff --git a/sw/source/core/access/accnotextframe.hxx b/sw/source/core/access/accnotextframe.hxx
index dd312f3c67..4ba1673736 100644
--- a/sw/source/core/access/accnotextframe.hxx
+++ b/sw/source/core/access/accnotextframe.hxx
@@ -47,14 +47,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 ==============================================
// --> OD 2009-07-14 #i73249#
diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx
index 1a1d7312de..ec8ab7a7c7 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -2669,10 +2669,10 @@ sal_Int32 SAL_CALL SwAccessibleParagraph::getNumberOfLineWithCaret()
}
// --> OD 2010-02-19 #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 );
}
// <--
diff --git a/sw/source/core/access/accpara.hxx b/sw/source/core/access/accpara.hxx
index 35445bd06d..8ece1c505d 100644
--- a/sw/source/core/access/accpara.hxx
+++ b/sw/source/core/access/accpara.hxx
@@ -234,6 +234,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,
@@ -243,10 +245,6 @@ public:
virtual sal_Bool HasCursor(); // required by map to remember that object
- // --> OD 2010-02-19 #i108125#
- virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew);
- // <--
-
//===== XAccessibleContext ==============================================
/// Return this object's description.
diff --git a/sw/source/core/access/acctable.cxx b/sw/source/core/access/acctable.cxx
index ee3ea3efb6..c0c52ae71c 100644
--- a/sw/source/core/access/acctable.cxx
+++ b/sw/source/core/access/acctable.cxx
@@ -740,7 +740,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() );
@@ -787,13 +787,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;
}
}
@@ -1360,7 +1361,7 @@ void SwAccessibleTable::Dispose( sal_Bool bRecursive )
vos::OGuard aGuard(Application::GetSolarMutex());
if( GetRegisteredIn() )
- pRegisteredIn->Remove( this );
+ GetRegisteredInNonConst()->Remove( this );
SwAccessibleContext::Dispose( bRecursive );
}
@@ -1717,7 +1718,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 8a0acc24ba..6e92dfaac3 100644
--- a/sw/source/core/access/acctable.hxx
+++ b/sw/source/core/access/acctable.hxx
@@ -89,12 +89,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
@@ -277,13 +277,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 65aa72151c..726bc7d7c6 100644
--- a/sw/source/core/access/acctextframe.cxx
+++ b/sw/source/core/access/acctextframe.cxx
@@ -84,7 +84,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 ;
// --> OD 2009-07-14 #i73249#
@@ -103,9 +103,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 de355feeeb..04ced2936a 100644
--- a/sw/source/core/access/acctextframe.hxx
+++ b/sw/source/core/access/acctextframe.hxx
@@ -46,13 +46,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 ==============================================
// --> OD 2009-07-14 #i73249#
diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx
index 792f7dafb4..11b98a02e1 100644
--- a/sw/source/core/attr/calbck.cxx
+++ b/sw/source/core/attr/calbck.cxx
@@ -28,127 +28,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>
-
-#ifdef DBG_UTIL
-#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
-|* Ersterstellung VB 20.03.91
-|* Letzte Aenderung MA 20. Mar. 95
-*************************************************************************/
-
+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
-|* Ersterstellung VB 20.03.91
-|* Letzte Aenderung VB 20.03.91
-*************************************************************************/
-
-
-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
-|* Ersterstellung VB 20.03.91
-|* Letzte Aenderung MA 25. Jan. 94
-*************************************************************************/
+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 );
-
- ASSERT( !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
-|* Ersterstellung JP 20.11.90
-|* Letzte Aenderung VB 20.03.91
-*************************************************************************/
-
-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
-|* Ersterstellung JP 20.11.90
-|* Letzte Aenderung JP 15.04.94
-*************************************************************************/
-
-
-
+/*************************************************************************/
SwModify::~SwModify()
{
+ ASSERT( !IsModifyLocked(), "Modify destroyed but locked." );
+
if ( IsInCache() )
SwFrm::GetCache().Delete( this );
@@ -157,44 +132,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
-|* Ersterstellung JP 20.11.90
-|* Letzte Aenderung MA 20. Mar. 95
-*************************************************************************/
-
-
+/*************************************************************************/
+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())
{
@@ -208,47 +179,35 @@ void SwModify::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue )
LockModify();
-#ifndef DBG_UTIL
- bInModify = sal_True;
-#else
+ // 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;
+ 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;
}
-#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
@@ -264,48 +223,38 @@ sal_Bool SwModify::GetInfo( SfxPoolItem& rInfo ) const
;
}
- return bRet; // und weiter
+ return bRet;
}
-/*************************************************************************
-|* SwModify::Add( SwClient *pDepend )
-|*
-|* Beschreibung Dokument 1.7
-|* Ersterstellung JP 20.11.90
-|* Letzte Aenderung JP 14.09.94
-*************************************************************************/
-
-
-
+/*************************************************************************/
void SwModify::Add(SwClient *pDepend)
{
- ASSERT( !bInModify, "Client innerhalb des eigenen Modifies einfuegen?" );
+ ASSERT( !bLockClientList, "Client inserted while in Modify" );
- // nur wenn das hier noch nicht eingetragen ist einfuegen
if(pDepend->pRegisteredIn != this )
{
#ifdef DBG_UTIL
SwClientIter* pTmp = pClientIters;
while( pTmp )
{
- ASSERT( &pTmp->rRoot != pRoot,
- "Client beim angemeldeten ClientIter einfuegen?" );
+ ASSERT( &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;
@@ -313,29 +262,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
-|* Ersterstellung JP 20.11.90
-|* Letzte Aenderung JP 14.09.94
-*************************************************************************/
-
+/*************************************************************************/
-
-SwClient *SwModify::_Remove(SwClient * pDepend)
+SwClient* SwModify::Remove(SwClient * pDepend)
{
- // FME 2007-07-16 #i79641# SwXTextMarkup is allowed to be removed ...
- ASSERT( !bInModify || 0 != dynamic_cast<SwXTextMarkup*>(pDepend), "Client innerhalb des eigenen Modifies loeschen?" );
+ if ( bInDocDTOR )
+ return 0;
+
+ ASSERT( !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 )
@@ -346,40 +290,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;
-
- // --> FME 2006-02-03 #127369# Notify SwClientIter if mpWatchClient is removed
- if ( pTmp->mpWatchClient == pDepend )
- pTmp->mpWatchClient = 0;
- // <--
-
pTmp = pTmp->pNxtIter;
}
pDepend->pLeft = 0;
pDepend->pRight = 0;
}
- else {
- ASSERT( sal_False, "SwModify::Remove(): pDepend nicht gefunden");
+ else
+ {
+ ASSERT( false, "SwModify::Remove(): pDepend nicht gefunden" );
}
+
+ // disconnect client from me
pDepend->pRegisteredIn = 0;
return pDepend;
}
-
-/*************************************************************************
-|* SwModify::CheckCaching( const sal_uInt16 nWhich )
-|*
-|* Ersterstellung JP 25.06.95
-|* Letzte Aenderung JP 25.06.95
-*************************************************************************/
-
-
+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 )
{
@@ -411,19 +356,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
-|* Ersterstellung VB 20.03.91
-|* Letzte Aenderung VB 20.03.91
-*************************************************************************/
-
+/*************************************************************************/
SwDepend::SwDepend(SwClient *pTellHim, SwModify *pDepend)
: SwClient(pDepend)
@@ -431,27 +390,22 @@ SwDepend::SwDepend(SwClient *pTellHim, SwModify *pDepend)
pToTell = pTellHim;
}
-/*************************************************************************
-|*
-|* SwDepend::Modify(SwHint *, SwHint *)
-|*
-|* Beschreibung callback.doc V1.14
-|* Ersterstellung VB 20.03.91
-|* Letzte Aenderung VB 20.03.91
-|*
-*************************************************************************/
-
+/*************************************************************************/
-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;
@@ -459,14 +413,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;
@@ -475,9 +428,8 @@ SwClientIter::SwClientIter( SwModify const& rModify )
else
pClientIters = this;
- pAkt = rRoot.pRoot;
- pDelNext = pAkt;
- mpWatchClient = 0;
+ pAct = const_cast<SwClient*>(rRoot.GetDepends());
+ pDelNext = pAct;
}
@@ -486,6 +438,7 @@ SwClientIter::~SwClientIter()
{
if( pClientIters )
{
+ // reorganize list of ClientIters
if( pClientIters == this )
pClientIters = pNxtIter;
else
@@ -503,132 +456,109 @@ SwClientIter::~SwClientIter()
}
-#ifndef CFRONT
- // Postfix Operator
SwClient* SwClientIter::operator++(int)
{
-// 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->pRight;
- pDelNext = pAkt;
- }
- else
- pAkt = pDelNext;
- return pAkt;
-}
-#endif
-
-
- // 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;
}
-
-#ifndef CFRONT
- // 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;
}
-#endif
-
- // 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;
+}
diff --git a/sw/source/core/attr/cellatr.cxx b/sw/source/core/attr/cellatr.cxx
index 90862aa866..e9abeff118 100644
--- a/sw/source/core/attr/cellatr.cxx
+++ b/sw/source/core/attr/cellatr.cxx
@@ -29,9 +29,7 @@
#include "precompiled_sw.hxx"
#include <float.h>
-
#include <rtl/math.hxx>
-
#include <hintids.hxx> // fuer RES_..
#include <cellatr.hxx>
#include <calc.hxx>
@@ -41,7 +39,7 @@
#include <node.hxx>
#include <hints.hxx>
#include <rolbck.hxx>
-
+#include <switerator.hxx>
//TYPEINIT1( SwFmt, SwClient ); //rtti fuer SwFmt
@@ -112,9 +110,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;
}
@@ -124,8 +122,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 4ecbeca85b..76ec43ffc5 100644
--- a/sw/source/core/attr/format.cxx
+++ b/sw/source/core/attr/format.cxx
@@ -36,9 +36,7 @@
#include <doc.hxx>
#include <paratr.hxx> // fuer SwParaFmt - SwHyphenBug
#include <swcache.hxx>
-// --> OD 2006-11-22 #i71574#
#include <fmtcolfunc.hxx>
-// <--
TYPEINIT1( SwFmt, SwClient ); //rtti fuer SwFmt
@@ -142,16 +140,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
@@ -170,7 +168,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
{
@@ -229,7 +227,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
}
}
@@ -269,7 +267,7 @@ SwFmt::~SwFmt()
SwFmtChg aNewFmt(pParentFmt);
SwClient * pDepend = (SwClient*)GetDepends();
pParentFmt->Add(pDepend);
- pDepend->Modify(&aOldFmt, &aNewFmt);
+ pDepend->ModifyNotification(&aOldFmt, &aNewFmt);
}
}
}
@@ -277,7 +275,7 @@ SwFmt::~SwFmt()
/*************************************************************************
-|* void SwFmt::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue )
+|* void SwFmt::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue )
|*
|* Beschreibung Dokument 1.14
|* Ersterstellung JP 22.11.90
@@ -285,7 +283,7 @@ SwFmt::~SwFmt()
*************************************************************************/
-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
@@ -302,9 +300,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 );
@@ -332,7 +330,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;
@@ -353,12 +351,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;
@@ -383,7 +381,7 @@ ASSERT( RES_PARATR_DROP == nWhich, "Modify ohne Absender verschickt" );
if( bWeiter )
{
// laufe durch alle abhaengigen Formate
- SwModify::Modify( pOldValue, pNewValue );
+ NotifyClients( pOldValue, pNewValue );
}
}
@@ -431,7 +429,7 @@ sal_Bool SwFmt::SetDerivedFrom(SwFmt *pDerFrom)
SwFmtChg aOldFmt(this);
SwFmtChg aNewFmt(this);
- Modify( &aOldFmt, &aNewFmt );
+ ModifyNotification( &aOldFmt, &aNewFmt );
return sal_True;
}
@@ -476,7 +474,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;
@@ -524,7 +522,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;
@@ -561,7 +559,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;
}
@@ -595,7 +593,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();
}
@@ -644,7 +642,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 33d70e337e..0a02af3bca 100644
--- a/sw/source/core/crsr/bookmrk.cxx
+++ b/sw/source/core/crsr/bookmrk.cxx
@@ -109,7 +109,7 @@ namespace sw { namespace mark
, m_aName(rName)
{
lcl_FixPosition(*m_pPos1);
- if(aPaM.HasMark())
+ if (aPaM.HasMark() && (*aPaM.GetMark() != *aPaM.GetPoint()))
{
MarkBase::SetOtherMarkPos(*(aPaM.GetMark()));
lcl_FixPosition(*m_pPos2);
@@ -166,9 +166,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 48d825dfe9..64c966737b 100644
--- a/sw/source/core/crsr/callnk.cxx
+++ b/sw/source/core/crsr/callnk.cxx
@@ -69,7 +69,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
{
@@ -124,7 +124,7 @@ SwCallLink::~SwCallLink()
{
// nur wenn mit Left/right getravellt, dann Text-Hints pruefen
// und sich nicht der Frame geaendert hat (Spalten!)
- 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
@@ -191,7 +191,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();
@@ -208,9 +208,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 6d3d4ec8e7..86ff1e0b99 100644
--- a/sw/source/core/crsr/callnk.hxx
+++ b/sw/source/core/crsr/callnk.hxx
@@ -31,6 +31,7 @@
class SwCrsrShell;
class SwTxtNode;
+class SwRootFrm;
class SwCallLink
{
@@ -48,7 +49,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 d82dd42d1c..bb02a9d269 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -201,8 +201,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 );
@@ -230,7 +230,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;
}
@@ -322,6 +322,7 @@ if( GetWin() )
sal_uInt16 nParm = SwCrsrShell::CHKRANGE;
if ( !bIdleEnd )
nParm |= SwCrsrShell::SCROLLWIN;
+// if( !IsViewLocked() )
UpdateCrsr( nParm, bIdleEnd ); // Cursor-Aenderungen anzeigen
{
@@ -598,7 +599,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 |
@@ -644,7 +645,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();
@@ -730,10 +731,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;
}
@@ -1263,7 +1264,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 );
@@ -1400,7 +1401,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 );
ASSERT( pTblFrm, "Tabelle Crsr nicht im Content ??" );
@@ -1417,7 +1418,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 );
ASSERT( pMarkTblFrm, "Tabelle Crsr nicht im Content ??" );
if ( pMarkTblFrm )
@@ -1630,8 +1632,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 )
@@ -1639,8 +1641,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() )
@@ -1826,7 +1828,7 @@ void SwCrsrShell::RefreshBlockCursor()
ASSERT( 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() )
{
@@ -2144,13 +2146,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;
}
@@ -2160,7 +2162,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() :
@@ -2330,7 +2332,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 );
@@ -2686,7 +2688,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 )
@@ -2783,7 +2785,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() )
{
@@ -2899,7 +2901,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() ) )
{
@@ -2931,7 +2933,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();
@@ -3496,7 +3498,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;
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index b93f5a4b80..3d4b98fccc 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -72,7 +72,7 @@
#include <fmturl.hxx>
#include "txtfrm.hxx"
#include <wrong.hxx>
-
+#include <switerator.hxx>
#include <vcl/window.hxx>
#include <docufld.hxx> // OD 2008-06-19 #i90516#
@@ -93,7 +93,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();
@@ -133,7 +133,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();
@@ -277,7 +277,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
@@ -328,7 +328,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;
@@ -378,7 +378,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;
@@ -412,14 +412,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() ))
@@ -431,7 +430,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,
@@ -446,6 +445,7 @@ sal_Bool SwCrsrShell::GotoTOXMarkBase()
}
}
}
+ }
return bRet;
}
@@ -479,9 +479,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;
@@ -499,7 +498,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 );
@@ -550,8 +549,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;
@@ -564,7 +562,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.
@@ -631,18 +629,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(
@@ -727,7 +725,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 );
@@ -1112,7 +1110,7 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_SMARTTAG;
// rCntntAtPos.pFndTxtAttr = pTxtAttr;
- if( pFldRect && 0 != ( pFrm = pTxtNd->GetFrm( &aPt ) ) )
+ if( pFldRect && 0 != ( pFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt ) ) )
pFrm->GetCharRect( *pFldRect, aPos, &aTmpState );
}
}
@@ -1132,7 +1130,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 )
@@ -1230,7 +1228,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 );
}
}
@@ -1298,7 +1296,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 );
}
}
@@ -1335,7 +1333,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 );
}
}
@@ -1351,7 +1349,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 );
}
}
@@ -1382,7 +1380,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
@@ -1590,9 +1588,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;
@@ -1612,20 +1611,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;
@@ -2102,7 +2097,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 );
}
@@ -2112,19 +2107,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 4a31aafa69..05e4f8a019 100644
--- a/sw/source/core/crsr/crstrvl1.cxx
+++ b/sw/source/core/crsr/crstrvl1.cxx
@@ -95,7 +95,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/findattr.cxx b/sw/source/core/crsr/findattr.cxx
index 0869e934fa..1bf7035221 100644
--- a/sw/source/core/crsr/findattr.cxx
+++ b/sw/source/core/crsr/findattr.cxx
@@ -311,15 +311,33 @@ void SwAttrCheckArr::SetNewSet( const SwTxtNode& rTxtNd, const SwPaM& rPam )
pItem = aIter.NextItem();
}
}
+
+static bool
+lcl_IsAttributeIgnorable(xub_StrLen const nNdStart, xub_StrLen const nNdEnd,
+ _SwSrchChrAttr const& rTmp)
+{
+ // #i115528#: if there is a paragraph attribute, it has been added by the
+ // SwAttrCheckArr ctor, and nFound is 1.
+ // if the paragraph is entirely covered by hints that override the paragraph
+ // attribute, then this function must find an attribute to decrement nFound!
+ // so check for an empty search range, let attributes that start/end there
+ // cover it, and hope for the best...
+ return ((nNdEnd == nNdStart)
+ ? ((rTmp.nEnd < nNdStart) || (nNdEnd < rTmp.nStt))
+ : ((rTmp.nEnd <= nNdStart) || (nNdEnd <= rTmp.nStt)));
+}
+
int SwAttrCheckArr::SetAttrFwd( const SwTxtAttr& rAttr )
{
_SwSrchChrAttr aTmp( rAttr.GetAttr(), *rAttr.GetStart(), *rAttr.GetAnyEnd() );
- // alle die nicht im Bereich sind -> ignorieren
- if( aTmp.nEnd <= nNdStt || aTmp.nStt >= nNdEnd )
+
+ // ignore all attributes not in search range
+ if (lcl_IsAttributeIgnorable(nNdStt, nNdEnd, aTmp))
+ {
return Found();
+ }
const SfxPoolItem* pItem;
-
// --------------------------------------------------------------
// Hier wird jetzt ausdruecklich auch in Zeichenvorlagen gesucht
// --------------------------------------------------------------
@@ -473,9 +491,12 @@ int SwAttrCheckArr::SetAttrFwd( const SwTxtAttr& rAttr )
int SwAttrCheckArr::SetAttrBwd( const SwTxtAttr& rAttr )
{
_SwSrchChrAttr aTmp( rAttr.GetAttr(), *rAttr.GetStart(), *rAttr.GetAnyEnd() );
- // alle die nicht im Bereich sind -> ignorieren
- if( aTmp.nEnd < nNdStt || aTmp.nStt >= nNdEnd )
+
+ // ignore all attributes not in search range
+ if (lcl_IsAttributeIgnorable(nNdStt, nNdEnd, aTmp))
+ {
return Found();
+ }
const SfxPoolItem* pItem;
// --------------------------------------------------------------
diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index be83c57750..a9ed662932 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -640,7 +640,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;
@@ -683,7 +683,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;
@@ -711,7 +711,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;
@@ -868,7 +868,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())
) ||
@@ -905,7 +905,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() ) )
@@ -1236,7 +1236,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 5dbc7e0f9d..cc20c7b608 100644..100755
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -31,10 +31,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>
@@ -54,6 +52,7 @@
#include <scriptinfo.hxx>
#include <crstate.hxx>
#include <docsh.hxx>
+#include <viewsh.hxx>
#include <frmatr.hxx>
#include <breakit.hxx>
#include <crsskip.hxx>
@@ -350,7 +349,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 ) )
{
@@ -367,7 +366,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()
@@ -424,7 +423,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();
@@ -695,7 +694,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;
@@ -973,7 +972,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
@@ -1004,8 +1003,8 @@ sal_uLong SwCursor::FindAll( SwFindParas& rParas,
DeleteMark();
return 0;
}
+ pSav.release();
- delete pSav;
if( !( FND_IN_SELALL & eFndRngs ))
{
// es sollte nur einer gesucht werden, also fuege in dazu
@@ -1031,7 +1030,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()
@@ -1058,10 +1057,7 @@ sal_uLong SwCursor::FindAll( SwFindParas& rParas,
DeleteMark();
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();
@@ -1176,9 +1172,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
@@ -1354,20 +1350,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() )
@@ -1573,7 +1569,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();
@@ -1712,7 +1708,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() )
@@ -1781,7 +1777,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 )
{
@@ -1819,7 +1815,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() );
}
}
@@ -1828,7 +1824,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;
}
@@ -1839,7 +1835,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;
@@ -1872,7 +1868,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 )
@@ -1886,7 +1882,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 b56f8f609c..d83de38118 100644
--- a/sw/source/core/crsr/trvlfnfl.cxx
+++ b/sw/source/core/crsr/trvlfnfl.cxx
@@ -95,7 +95,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 6b23b53f2d..062ff099d6 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 0b4f68298e..0437a892bf 100644
--- a/sw/source/core/crsr/unocrsr.cxx
+++ b/sw/source/core/crsr/unocrsr.cxx
@@ -47,14 +47,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();
@@ -252,9 +244,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 d4fc5e8e95..b0f62e1805 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -454,7 +454,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();
@@ -735,11 +735,11 @@ void SwShellCrsr::FillRects()
// die neuen Rechtecke berechnen
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
}
@@ -812,7 +812,7 @@ short SwShellCrsr::MaxReplaceArived()
// eine SSelection kann erzeugt werden
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 )
@@ -829,7 +829,7 @@ short SwShellCrsr::MaxReplaceArived()
for( nActCnt = aArr[n]; nActCnt--; )
pSh->StartAction();
pSh = (ViewShell*)pSh->GetNext();
- }
+ } //swmod 071107//swmod 071225
}
else
// ansonsten aus dem Basic, und dann auf RET_YES schalten
@@ -942,7 +942,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();
@@ -978,7 +978,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();
ASSERT( pFrm, "Node nicht in einer Tabelle" );
diff --git a/sw/source/core/doc/acmplwrd.cxx b/sw/source/core/doc/acmplwrd.cxx
index bcbfe70a87..6bda643531 100644
--- a/sw/source/core/doc/acmplwrd.cxx
+++ b/sw/source/core/doc/acmplwrd.cxx
@@ -66,11 +66,12 @@ public:
SwAutoCompleteClient& operator=(const SwAutoCompleteClient& rClient);
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
const SwDoc& GetDoc(){return *pDoc;}
#ifdef DBG_UTIL
static sal_uLong GetElementCount() {return nSwAutoCompleteClientCount;}
#endif
+protected:
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
};
/* -----------------------------05.08.2002 12:48------------------------------
@@ -156,15 +157,15 @@ 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;
}
/* -----------------------------05.08.2002 12:49------------------------------
---------------------------------------------------------------------------*/
-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 0002a5ed07..ac72b8122f 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
*/
@@ -203,7 +208,7 @@ bool SwDoc::get(/*[in]*/ DocumentSettingId id) const
// <--
// COMPATIBILITY FLAGS END
- 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;
@@ -327,8 +332,8 @@ void SwDoc::set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value)
// <--
// 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:
mbHTMLMode = value;
@@ -371,7 +376,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.isValid() )
{
@@ -388,12 +393,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();
}
@@ -457,12 +464,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();
}
}
@@ -1089,9 +1098,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) )
@@ -1121,13 +1129,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;
@@ -1218,15 +1224,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;
@@ -1243,7 +1246,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;
@@ -1442,7 +1445,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;
}
}
@@ -1450,7 +1453,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)
{
@@ -1569,6 +1572,7 @@ void SwDoc::UpdatePagesForPrintingWithPostItData(
void SwDoc::CalculatePagePairsForProspectPrinting(
+ const SwRootFrm& rLayout,
/* out */ SwRenderData &rData,
const SwPrintUIOptions &rOptions,
sal_Int32 nDocPageCount )
@@ -1597,11 +1601,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();
@@ -1611,7 +1614,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?" );
@@ -1714,38 +1717,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 );
*************************************************************************/
@@ -1775,10 +1746,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())
{
@@ -1786,11 +1755,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 );
@@ -2096,46 +2064,35 @@ sal_Bool lcl_CheckSmartTagsAgain( const SwNodePtr& rpNd, void* )
void SwDoc::SpellItAgainSam( sal_Bool bInvalid, sal_Bool bOnlyWrong, sal_Bool bSmartTags )
{
- ASSERT( GetRootFrm(), "SpellAgain: Where's my RootFrm?" );
+ std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();//swmod 080307
+ ASSERT( 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
@@ -2241,9 +2198,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() ) &&
@@ -2486,14 +2442,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)
@@ -2785,21 +2738,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 c729054084..061d1c4c6a 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -1285,7 +1285,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 )
@@ -1489,7 +1489,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 cf0ad58dfc..2a7c3d40e7 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 e954252849..ba86116714 100644
--- a/sw/source/core/doc/doccorr.cxx
+++ b/sw/source/core/doc/doccorr.cxx
@@ -43,8 +43,6 @@
#include <swundo.hxx>
#include <hints.hxx>
-/* */
-
/*
* MACROS um ueber alle CrsrShells zu iterieren
*/
@@ -192,7 +190,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 );
}
}
}
@@ -212,10 +210,22 @@ void SwDoc::CorrAbs(const SwNodeIndex& rOldNode,
getIDocumentMarkAccess()->correctMarksAbsolute(rOldNode, rNewPos, nOffset);
{ // fix redlines
SwRedlineTbl& rTbl = *pRedlineTbl;
- for( sal_uInt16 n = 0; n < rTbl.Count(); ++n )
+ for (sal_uInt16 n = 0; n < rTbl.Count(); )
{
// is on position ??
- lcl_PaMCorrAbs(*rTbl[ n ], *aPam.Start(), *aPam.End(), aNewPos);
+ SwRedline *const pRedline( rTbl[ n ] );
+ bool const bChanged =
+ lcl_PaMCorrAbs(*pRedline, *aPam.Start(), *aPam.End(), aNewPos);
+ // clean up empty redlines: docredln.cxx asserts these as invalid
+ if (bChanged && (*pRedline->GetPoint() == *pRedline->GetMark())
+ && (pRedline->GetContentIdx() == NULL))
+ {
+ rTbl.DeleteAndDestroy(n);
+ }
+ else
+ {
+ ++n;
+ }
}
}
@@ -334,9 +344,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;
@@ -348,7 +358,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 1fa3d04c94..cdfbd493f6 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -70,10 +70,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;
@@ -201,6 +201,7 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged )
ASSERT( i < aPageDescs.Count(), "PageDescs ueberindiziert." );
SwPageDesc *pDesc = aPageDescs[i];
+ SwRootFrm* pTmpRoot = GetCurrentLayout();//swmod 080219
if (GetIDocumentUndoRedo().DoesUndo())
{
@@ -396,9 +397,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() );
@@ -411,16 +415,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();
@@ -443,93 +441,48 @@ 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
- {
- ASSERT( !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));
}
- }
+ }
for ( sal_uInt16 j = 0; j < aPageDescs.Count(); ++j )
{
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 );
- }
}
// #116530#
@@ -610,7 +563,7 @@ sal_uInt16 SwDoc::MakePageDesc( const String &rName, const SwPageDesc *pCpy,
pNew = new SwPageDesc( rName, GetDfltFrmFmt(), this );
//Default-Seitenformat einstellen.
lcl_DefaultPageFmt( USHRT_MAX, pNew->GetMaster(), pNew->GetLeft() );
-
+
SvxFrameDirection aFrameDirection = bRegardLanguage ?
GetDefaultFrameDirection(GetAppLanguage())
: FRMDIR_HORI_LEFT_TOP;
@@ -667,7 +620,7 @@ void SwDoc::PrtDataChanged()
ASSERT( 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;
@@ -675,16 +628,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;
@@ -695,7 +648,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 )
{
@@ -704,11 +659,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);
@@ -723,7 +678,7 @@ void SwDoc::PrtDataChanged()
PrtOLENotify( sal_True );
if ( bEndAction )
- GetRootFrm()->EndAllAction();
+ pTmpRoot->EndAllAction(); //swmod 080218
delete pWait;
}
@@ -737,18 +692,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
@@ -767,28 +722,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 )
{
@@ -844,7 +783,7 @@ void SwDoc::PrtOLENotify( sal_Bool bAll )
}
}
delete pNodes;
- GetRootFrm()->EndAllAction();
+ GetCurrentLayout()->EndAllAction(); //swmod 080218
::EndProgress( GetDocShell() );
}
}
@@ -857,31 +796,19 @@ 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.
@@ -902,11 +829,12 @@ IMPL_LINK( SwDoc, DoUpdateModifiedOLE, Timer *, )
pOLENd->SetOLESizeInvalid( sal_True );
}*/
// repaint it
- 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 b937130791..0b538c7d2c 100644
--- a/sw/source/core/doc/docdraw.cxx
+++ b/sw/source/core/doc/docdraw.cxx
@@ -65,21 +65,15 @@
#include <dflyobj.hxx>
#include <svx/svdetc.hxx>
#include <editeng/fhgtitem.hxx>
-
-// OD 26.06.2003 #108784#
#include <svx/svdpagv.hxx>
-// OD 2004-04-01 #i26791#
#include <dcontact.hxx>
#include <txtfrm.hxx>
#include <frmfmt.hxx>
#include <editeng/frmdiritem.hxx>
#include <fmtornt.hxx>
-// --> OD 2006-03-14 #i62875#
#include <svx/svditer.hxx>
-// <--
-// --> OD 2006-11-01 #130889#
#include <vector>
-// <--
+#include <switerator.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::linguistic2;
@@ -140,11 +134,12 @@ void lcl_AdjustPositioningAttr( SwDrawFrmFmt* _pFrmFmt,
{
case FRMDIR_VERT_TOP_LEFT:
{
- // vertical from left-to-right - not supported yet
+ // vertical from left-to-right - Badaa: supported now!
bVert = true;
bR2L = true;
- ASSERT( false,
- "<lcl_AdjustPositioningAttr(..)> - vertical from left-to-right not supported." );
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ //ASSERT( false, "<lcl_AdjustPositioningAttr(..)> - vertical from left-to-right not supported." );
+ //End
}
break;
case FRMDIR_VERT_TOP_RIGHT:
@@ -173,10 +168,18 @@ void lcl_AdjustPositioningAttr( SwDrawFrmFmt* _pFrmFmt,
}
// use geometry of drawing object
const SwRect aObjRect = _rSdrObj.GetSnapRect();
+
if ( bVert )
{
- nHoriRelPos = aObjRect.Top() - aAnchorPos.Y();
- nVertRelPos = aAnchorPos.X() - aObjRect.Right();
+ if ( bR2L ) {
+ //FRMDIR_VERT_TOP_LEFT
+ nHoriRelPos = aObjRect.Left() - aAnchorPos.X();
+ nVertRelPos = aObjRect.Top() - aAnchorPos.Y();
+ } else {
+ //FRMDIR_VERT_TOP_RIGHT
+ nHoriRelPos = aObjRect.Top() - aAnchorPos.Y();
+ nVertRelPos = aAnchorPos.X() - aObjRect.Right();
+ }
}
else if ( bR2L )
{
@@ -188,6 +191,7 @@ void lcl_AdjustPositioningAttr( SwDrawFrmFmt* _pFrmFmt,
nHoriRelPos = aObjRect.Left() - aAnchorPos.X();
nVertRelPos = aObjRect.Top() - aAnchorPos.Y();
}
+ //End of SCMS
}
_pFrmFmt->SetFmtAttr( SwFmtHoriOrient( nHoriRelPos, text::HoriOrientation::NONE, text::RelOrientation::FRAME ) );
@@ -553,28 +557,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 {
ASSERT( !this, "was ist das fuer ein Format?" );
@@ -659,7 +664,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" );
@@ -684,10 +690,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 );
}
}
@@ -853,14 +873,14 @@ SdrModel* SwDoc::_MakeDrawModel()
{
ASSERT( !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() )
@@ -868,7 +888,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 877fa9956a..ce1911cce6 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -219,7 +219,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();
}
}
@@ -416,7 +416,7 @@ bool lcl_SaveFtn( const SwNodeIndex& rSttNd, const SwNodeIndex& rEndNd,
}
else
{
- pSrch->DelFrms();
+ pSrch->DelFrms(0);
rFtnArr.Remove( nPos );
if( bSaveFtn )
rSaveArr.Insert( pSrch );
@@ -444,7 +444,7 @@ bool lcl_SaveFtn( const SwNodeIndex& rSttNd, const SwNodeIndex& rEndNd,
}
else
{
- pSrch->DelFrms();
+ pSrch->DelFrms(0);
rFtnArr.Remove( nPos );
if( bSaveFtn )
rSaveArr.Insert( pSrch );
@@ -846,13 +846,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() &&
@@ -1923,7 +1917,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
@@ -2153,7 +2147,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();
@@ -2521,8 +2515,6 @@ SetRedlineMode( eOld );
rPam.GetMark()->nNode = aPtNd;
rPam.GetMark()->nContent.Assign( aPtNd.GetNode().GetCntntNode(),
nPtCnt );
- if( bJoinTxt )
- rPam.Move( fnMoveBackward );
if( pUndoRpl )
{
@@ -2648,8 +2640,15 @@ bool SwDoc::DelFullPara( SwPaM& rPam )
return sal_False;
}
}
- // text::Bookmarks usw. verschieben
- CorrAbs( aRg.aStart, aRg.aEnd, *rPam.GetPoint(), sal_True );
+ // move bookmarks, redlines etc.
+ if (aRg.aStart == aRg.aEnd) // only first CorrAbs variant handles this
+ {
+ CorrAbs( aRg.aStart, *rPam.GetPoint(), 0, sal_True );
+ }
+ else
+ {
+ CorrAbs( aRg.aStart, aRg.aEnd, *rPam.GetPoint(), sal_True );
+ }
// was ist mit Fly's ??
{
diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx
index d92c5a9ef2..3976246c8b 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;
@@ -360,10 +361,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:
@@ -374,7 +375,7 @@ void SwDoc::UpdateFlds( SfxPoolItem *pNewHt, bool bCloseDB )
if( !pNewHt )
break;
default:
- (*pFldTypes)[i]->Modify( 0, pNewHt );
+ (*pFldTypes)[i]->ModifyNotification ( 0, pNewHt );
}
}
@@ -426,7 +427,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 )
@@ -444,9 +445,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();
@@ -497,6 +498,7 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt )
// setze bei allen das Value-Flag zurueck
pFld->ChgValid( sal_False );
}
+ }
break;
}
@@ -525,16 +527,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() ))
@@ -567,7 +566,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 );
@@ -603,8 +602,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
@@ -639,7 +638,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 ) )
@@ -702,10 +701,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);
@@ -1544,7 +1543,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
{
@@ -1687,9 +1686,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())
{
@@ -1701,7 +1699,6 @@ const SwDBData& SwDoc::GetDBDesc()
aDBData = (static_cast < SwDBNameInfField* > (pFld->GetFld()))->GetRealDBData();
break;
}
- pFld = (SwFmtFld*)aIter.Next();
}
}
break;
@@ -1957,7 +1954,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();
@@ -2102,10 +2099,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() )
{
@@ -2173,7 +2168,7 @@ void SwDoc::SetFixFields( bool bOnlyTimeDate, const DateTime* pNewDateTime )
// Formatierung anstossen
if( bChgd )
- pFld->Modify( 0, 0 );
+ pFld->ModifyNotification( 0, 0 );
}
}
}
@@ -2437,7 +2432,7 @@ void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode )
pFormel = 0;
// Formatierung anstossen
- ((SwFmtFld*)pFmtFld)->Modify( 0, 0 );
+ ((SwFmtFld*)pFmtFld)->ModifyNotification( 0, 0 );
}
break;
@@ -2457,7 +2452,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;
@@ -2534,7 +2529,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;
@@ -2600,7 +2595,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;
@@ -2761,7 +2756,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;
@@ -2772,7 +2767,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:
@@ -2799,7 +2794,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 e3fabf9346..8ef87ea134 100644
--- a/sw/source/core/doc/docfly.cxx
+++ b/sw/source/core/doc/docfly.cxx
@@ -65,19 +65,14 @@
#include <UndoAttribute.hxx>
#include <fmtcnct.hxx>
#include <dflyobj.hxx>
-
-// --> OD 2009-07-20 #i73249#
#include <undoflystrattr.hxx>
-// <--
+#include <switerator.hxx>
extern sal_uInt16 GetHtmlMode( const SwDocShell* );
using namespace ::com::sun::star;
-/*-----------------17.02.98 08:35-------------------
-
---------------------------------------------------*/
sal_uInt16 SwDoc::GetFlyCount( FlyCntType eType ) const
{
const SwSpzFrmFmts& rFmts = *GetSpzFrmFmts();
@@ -119,9 +114,6 @@ sal_uInt16 SwDoc::GetFlyCount( FlyCntType eType ) const
return nCount;
}
-/*-----------------17.02.98 08:35-------------------
-
---------------------------------------------------*/
// If you change this, also update SwXFrameEnumeration in unocoll.
SwFrmFmt* SwDoc::GetFlyNum( sal_uInt16 nIdx, FlyCntType eType )
{
@@ -162,21 +154,11 @@ SwFrmFmt* SwDoc::GetFlyNum( sal_uInt16 nIdx, FlyCntType eType )
return pRetFmt;
}
-/* */
-
-/***********************************************************************
-#* Class : SwDoc
-#* Methode : SetFlyFrmAnchor
-#* Beschreibung: Das Ankerattribut des FlyFrms aendert sich.
-#* Datum : MA 01. Feb. 94
-#* Update : JP 09.03.98
-#***********************************************************************/
-
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:
@@ -194,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();
}
@@ -214,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 )
@@ -527,13 +509,6 @@ void SwDoc::SetFlyFrmDescription( SwFlyFrmFmt& rFlyFrmFmt,
}
// <--
-/***************************************************************************
- * Methode : sal_Bool SwDoc::SetFrmFmtToFly( SwFlyFrm&, SwFrmFmt& )
- * Beschreibung:
- * Erstellt : OK 14.04.94 15:40
- * Aenderung : JP 23.04.98
- ***************************************************************************/
-
sal_Bool SwDoc::SetFrmFmtToFly( SwFrmFmt& rFmt, SwFrmFmt& rNewFmt,
SfxItemSet* pSet, sal_Bool bKeepOrient )
{
@@ -617,7 +592,7 @@ sal_Bool SwDoc::SetFrmFmtToFly( SwFrmFmt& rFmt, SwFrmFmt& rNewFmt,
rFmt.MakeFrms();
if( pUndo )
- rFmt.Remove( pUndo );
+ pUndo->DeRegisterFromFormat( rFmt );
SetModified();
@@ -633,21 +608,12 @@ void SwDoc::GetGrfNms( const SwFlyFrmFmt& rFmt, String* pGrfName,
pGrfNd->GetFileFilterNms( pGrfName, pFltName );
}
-/*************************************************************************
-|*
-|* SwDoc::ChgAnchor()
-|*
-|* Ersterstellung MA 10. Jan. 95
-|* Letzte Aenderung JP 08.07.98
-|*
-*************************************************************************/
-
sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
RndStdIds _eAnchorType,
const sal_Bool _bSameOnly,
const sal_Bool _bPosCorr )
{
- ASSERT( GetRootFrm(), "Ohne Layout geht gar nichts" );
+ ASSERT( GetCurrentLayout(), "Ohne Layout geht gar nichts" ); //swmod 080218
if ( !_rMrkList.GetMarkCount() ||
_rMrkList.GetMark( 0 )->GetMarkedSdrObj()->GetUpGroup() )
@@ -745,11 +711,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 );
// OD 20.06.2003 #108784# - 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();
@@ -767,7 +733,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 )
@@ -806,7 +772,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
{
@@ -893,9 +859,6 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
}
-/* -----------------23.07.98 13:56-------------------
- *
- * --------------------------------------------------*/
int SwDoc::Chainable( const SwFrmFmt &rSource, const SwFrmFmt &rDest )
{
//Die Source darf noch keinen Follow haben.
@@ -994,9 +957,7 @@ int SwDoc::Chainable( const SwFrmFmt &rSource, const SwFrmFmt &rDest )
return bAllowed ? SW_CHAIN_OK : SW_CHAIN_WRONG_AREA;
}
-/* -----------------23.07.98 13:56-------------------
- *
- * --------------------------------------------------*/
+
int SwDoc::Chain( SwFrmFmt &rSource, const SwFrmFmt &rDest )
{
int nErr = Chainable( rSource, rDest );
@@ -1027,8 +988,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 );
@@ -1040,9 +1000,7 @@ int SwDoc::Chain( SwFrmFmt &rSource, const SwFrmFmt &rDest )
}
return nErr;
}
-/* -----------------23.07.98 13:56-------------------
- *
- * --------------------------------------------------*/
+
void SwDoc::Unchain( SwFrmFmt &rFmt )
{
SwFmtChain aChain( rFmt.GetChain() );
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 96cfea55dc..89e3d4c2f2 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -493,45 +493,14 @@ void SwDoc::ResetAttrs( const SwPaM &rRg,
SwTxtNode* pTNd = aTmpStt.GetNode().GetTxtNode();
if( pTNd && pTNd->HasSwAttrSet() && pTNd->GetpSwAttrSet()->Count() )
{
- SfxItemIter aIter( *pTNd->GetpSwAttrSet() );
- const SfxPoolItem* pItem = aIter.GetCurItem();
- SfxItemSet aCharSet( GetAttrPool(), RES_CHRATR_BEGIN, RES_CHRATR_END );
-
- while( sal_True )
+ if (pHst)
{
- if( IsInRange( aCharFmtSetRange, pItem->Which() ))
- {
- pTNd->GetOrCreateSwpHints();
-
- aCharSet.Put( *pItem );
-
- if( pHst )
- {
- SwRegHistory aRegH( pTNd, *pTNd, pHst );
- pTNd->ResetAttr( pItem->Which() );
- }
- else
- pTNd->ResetAttr( pItem->Which() );
- }
- if( aIter.IsAtEnd() )
- break;
- pItem = aIter.NextItem();
+ SwRegHistory history(pTNd, *pTNd, pHst);
+ pTNd->FmtToTxtAttr(pTNd);
}
-
- if ( aCharSet.Count() )
+ else
{
- if ( pHst )
- {
- SwRegHistory history( pTNd, *pTNd, pHst );
- history.InsertItems( aCharSet, 0, pTNd->GetTxt().Len(),
- nsSetAttrMode::SETATTR_NOFORMATATTR );
- }
- else
- {
- SwTxtAttr* pNew =
- MakeTxtAttr( *this, aCharSet, 0, pTNd->GetTxt().Len() );
- pTNd->InsertHint( pNew );
- }
+ pTNd->FmtToTxtAttr(pTNd);
}
}
@@ -545,29 +514,14 @@ void SwDoc::ResetAttrs( const SwPaM &rRg,
SwTxtNode* pTNd = aTmpEnd.GetNode().GetTxtNode();
if( pTNd && pTNd->HasSwAttrSet() && pTNd->GetpSwAttrSet()->Count() )
{
- SfxItemIter aIter( *pTNd->GetpSwAttrSet() );
- const SfxPoolItem* pItem = aIter.GetCurItem();
- while( sal_True )
+ if (pHst)
{
- if( IsInRange( aCharFmtSetRange, pItem->Which() ))
- {
- SwTxtAttr* pTAttr = MakeTxtAttr( *this,
- const_cast<SfxPoolItem&>(*pItem),
- 0, pTNd->GetTxt().Len() );
- SwpHints & rHints = pTNd->GetOrCreateSwpHints();
- rHints.SwpHintsArray::Insert( pTAttr );
- if ( pHst )
- {
- SwRegHistory aRegH( pTNd, *pTNd, pHst );
- pTNd->ResetAttr( pItem->Which() );
- pHst->Add( pTAttr, aTmpEnd.GetIndex(), true );
- }
- else
- pTNd->ResetAttr( pItem->Which() );
- }
- if( aIter.IsAtEnd() )
- break;
- pItem = aIter.NextItem();
+ SwRegHistory history(pTNd, *pTNd, pHst);
+ pTNd->FmtToTxtAttr(pTNd);
+ }
+ else
+ {
+ pTNd->FmtToTxtAttr(pTNd);
}
}
}
@@ -1367,7 +1321,7 @@ void SwDoc::SetDefault( const SfxItemSet& rSet )
{
SwFmtChg aChgFmt( pDfltCharFmt );
// dann sage mal den Frames bescheid
- aCallMod.Modify( &aChgFmt, &aChgFmt );
+ aCallMod.ModifyNotification( &aChgFmt, &aChgFmt );
}
}
}
@@ -1376,7 +1330,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
@@ -2046,14 +2000,9 @@ void SwDoc::CopyFmtArr( const SvPtrarr& rSourceArr,
pDest = FindFmtByName( rDestArr, pSrc->GetName() );
pDest->SetAuto( sal_False );
-// pDest->ResetAllAttr();
-// pDest->CopyAttrs( *pSrc, sal_True ); // kopiere Attribute
-//JP 19.02.96: ist so wohl optimaler - loest ggfs. kein Modify aus!
pDest->DelDiffs( *pSrc );
- // --> OD 2009-03-23 #i94285#
- // copy existing <SwFmtPageDesc> instance, before copying attributes
-// pDest->SetFmtAttr( pSrc->GetAttrSet() ); // kopiere Attribute
- //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(
@@ -2067,8 +2016,7 @@ void SwDoc::CopyFmtArr( const SvPtrarr& rSourceArr,
{
pPageDesc = aPageDescs[ MakePageDesc( rNm ) ];
}
- pPageDesc->Add( &aPageDesc );
-// pDest->SetFmtAttr( aPageDesc );
+ aPageDesc.RegisterToPageDesc( *pPageDesc );
SwAttrSet aTmpAttrSet( pSrc->GetAttrSet() );
aTmpAttrSet.Put( aPageDesc );
pDest->SetFmtAttr( aTmpAttrSet );
@@ -2077,7 +2025,6 @@ void SwDoc::CopyFmtArr( const SvPtrarr& rSourceArr,
{
pDest->SetFmtAttr( pSrc->GetAttrSet() );
}
- // <--
pDest->SetPoolFmtId( pSrc->GetPoolFmtId() );
pDest->SetPoolHelpId( pSrc->GetPoolHelpId() );
@@ -2165,9 +2112,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;
@@ -2177,6 +2124,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() );
@@ -2240,9 +2188,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.
@@ -2251,16 +2201,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 d34a3dc6ea..eeff9d3e98 100644
--- a/sw/source/core/doc/docftn.cxx
+++ b/sw/source/core/doc/docftn.cxx
@@ -51,8 +51,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 );
@@ -108,8 +108,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 );
@@ -138,7 +138,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 )
@@ -185,7 +196,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 ;
@@ -209,7 +220,7 @@ void SwEndNoteInfo::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
}
}
else
- SwClient::Modify( pOld, pNew );
+ CheckRegistration( pOld, pNew );
}
SwFtnInfo& SwFtnInfo::operator=(const SwFtnInfo& rInfo)
@@ -257,6 +268,7 @@ SwFtnInfo::SwFtnInfo(SwTxtFmtColl *pFmt) :
void SwDoc::SetFtnInfo(const SwFtnInfo& rInfo)
{
+ SwRootFrm* pTmpRoot = GetCurrentLayout();//swmod 080219
if( !(GetFtnInfo() == rInfo) )
{
const SwFtnInfo &rOld = GetFtnInfo();
@@ -280,15 +292,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
@@ -303,14 +319,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 );
}
// --> OD 2008-01-09 #i81002#
@@ -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 );
}
// --> OD 2008-01-09 #i81002#
@@ -393,6 +414,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();
@@ -441,7 +463,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 );
}
}
}
@@ -490,8 +512,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 c05c8ca2d4..c8759c4ba0 100644
--- a/sw/source/core/doc/docglbl.cxx
+++ b/sw/source/core/doc/docglbl.cxx
@@ -54,7 +54,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>
@@ -133,9 +133,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 f5fa0eb910..5f536f9552 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -724,8 +724,8 @@ SwFlyFrmFmt* SwDoc::_MakeFlySection( const SwPosition& rAnchPos,
}
// Frames anlegen
- if( GetRootFrm() )
- pFmt->MakeFrms(); // ???
+ if( GetCurrentViewShell() )
+ pFmt->MakeFrms(); // ??? //swmod 071108//swmod 071225
if (GetIDocumentUndoRedo().DoesUndo())
{
@@ -1005,7 +1005,7 @@ SwDrawFrmFmt* SwDoc::Insert( const SwPaM &rRg,
SwDrawContact* pContact = new SwDrawContact( pFmt, &rDrawObj );
// ggfs. Frames anlegen
- if( GetRootFrm() )
+ if( GetCurrentViewShell() )
{
pFmt->MakeFrms();
// --> OD 2005-02-09 #i42319# - follow-up of #i35635#
@@ -1120,11 +1120,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() )
@@ -1312,6 +1312,17 @@ lcl_InsertLabel(SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
//Erstmal das Format zum Fly besorgen und das Layout entkoppeln.
SwFrmFmt *pOldFmt = rDoc.GetNodes()[nNdIdx]->GetFlyFmt();
ASSERT( 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(),
@@ -1449,6 +1460,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;
@@ -1917,11 +1935,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() )
{
@@ -1932,10 +1951,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::createFromAscii(
UPN_IS_GRAMMAR_AUTO ) ) >>= bIsAutoGrammar;
@@ -1943,12 +1961,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() &&
@@ -1960,25 +1986,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;
@@ -1991,7 +2017,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() )
@@ -2228,9 +2254,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();
@@ -2343,9 +2369,72 @@ 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
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index 6b8d7d10e4..4f5f902bb5 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -241,7 +241,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() ),
@@ -298,6 +298,7 @@ SwDoc::SwDoc()
mbColumnSelection( false ),
// i#78591#
mbProtectForm(false),
+ mbLastBrowseMode( false ),
n32DummyCompatabilityOptions1(0),
n32DummyCompatabilityOptions2(0),
mbStartIdleTimer(sal_False)
@@ -312,7 +313,6 @@ SwDoc::SwDoc()
mbUpdateExpFld =
mbNewDoc =
mbCopyIsMove =
- mbBrowseMode =
mbInReading =
mbInXMLImport =
mbUpdateTOX =
@@ -529,8 +529,6 @@ SwDoc::~SwDoc()
mbDtor = sal_True;
- DELETEZ( pLayout );
-
delete pRedlineTbl;
delete pUnoCrsrTbl;
delete pAutoFmtRedlnComment;
@@ -609,10 +607,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();
ASSERT( pDfltTxtFmtColl == (*pTxtFmtCollTbl)[0],
"Default-Text-Collection muss immer am Anfang stehen" );
@@ -839,7 +835,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 ));
@@ -877,10 +873,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();
// JP 27.01.98: opt.: ausgehend davon, das Standard als 2. im Array
// steht, sollte das als letztes geloescht werden, damit
@@ -891,14 +885,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.unbind();
@@ -999,7 +993,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 adfb90cfa3..ce12808bc4 100644
--- a/sw/source/core/doc/docnum.cxx
+++ b/sw/source/core/doc/docnum.cxx
@@ -59,10 +59,9 @@
#include <frmatr.hxx>
#include <SwStyleNameMapper.hxx>
#include <SwNodeNum.hxx>
-// --> OD 2008-03-13 #refactorlists#
#include <list.hxx>
#include <listfunc.hxx>
-// <--
+#include <switerator.hxx>
#include <map>
@@ -147,8 +146,6 @@ void SwDoc::PropagateOutlineRule()
// if (NO_NUMBERING != pColl->GetOutlineLevel())//#outline level,zhaojianwei
if(pColl->IsAssignedToListLevelOfOutlineStyle())//<-end,zhaojianwei
{
- SwClientIter aIter(*pColl);
-
// --> OD 2006-11-20 #i71764#
// Check only the list style, which is set at the paragraph style
const SwNumRuleItem & rCollRuleItem = pColl->GetNumRule( sal_False );
@@ -1356,33 +1353,17 @@ void SwDoc::StopNumRuleAnimations( OutputDevice* pOut )
{
for( sal_uInt16 n = GetNumRuleTbl().Count(); n; )
{
- // --> OD 2008-02-19 #refactorlists#
-// SwNumRuleInfo aUpd( GetNumRuleTbl()[ --n ]->GetName() );
-// aUpd.MakeList( *this );
-
-// for( sal_uLong nFirst = 0, nLast = aUpd.GetList().Count();
-// nFirst < nLast; ++nFirst )
-// {
-// SwTxtNode* pTNd = aUpd.GetList().GetObject( nFirst );
-// SwClientIter aIter( *pTNd );
-// for( SwFrm* pFrm = (SwFrm*)aIter.First( TYPE(SwFrm) );
-// pFrm; pFrm = (SwFrm*)aIter.Next() )
-// if( ((SwTxtFrm*)pFrm)->HasAnimation() )
-// ((SwTxtFrm*)pFrm)->StopAnimation( pOut );
-// }
SwNumRule::tTxtNodeList aTxtNodeList;
GetNumRuleTbl()[ --n ]->GetTxtNodeList( aTxtNodeList );
for ( SwNumRule::tTxtNodeList::iterator aTxtNodeIter = aTxtNodeList.begin();
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 8b2ed8af61..a95b2b0670 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -2771,8 +2771,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 ) );
}
@@ -2785,8 +2785,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 ) );
}
@@ -3283,7 +3283,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 45b725a386..01ae72a44a 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -76,6 +76,7 @@
#include <breakit.hxx>
#include <editsh.hxx>
#include <scriptinfo.hxx>
+#include <switerator.hxx>
using namespace ::com::sun::star;
@@ -258,19 +259,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() );
@@ -356,7 +358,6 @@ const SwTOXMark& SwDoc::GotoTOXMark( const SwTOXMark& rCurTOXMark,
return *pNew;
}
-/* */
const SwTOXBaseSection* SwDoc::InsertTableOf( const SwPosition& rPos,
const SwTOXBase& rTOX,
@@ -476,9 +477,7 @@ const SwTOXBase* SwDoc::GetCurTOX( const SwPosition& rPos ) const
}
return 0;
}
-/* -----------------01.09.99 16:01-------------------
- --------------------------------------------------*/
const SwAttrSet& SwDoc::GetTOXBaseAttrSet(const SwTOXBase& rTOXBase) const
{
ASSERT( rTOXBase.ISA( SwTOXBaseSection ), "no TOXBaseSection!" );
@@ -487,9 +486,7 @@ const SwAttrSet& SwDoc::GetTOXBaseAttrSet(const SwTOXBase& rTOXBase) const
ASSERT( pFmt, "invalid TOXBaseSection!" );
return pFmt->GetAttrSet();
}
-/* -----------------02.09.99 07:48-------------------
- --------------------------------------------------*/
const SwTOXBase* SwDoc::GetDefaultTOXBase( TOXTypes eTyp, sal_Bool bCreate )
{
SwTOXBase** prBase = 0;
@@ -511,9 +508,7 @@ const SwTOXBase* SwDoc::GetDefaultTOXBase( TOXTypes eTyp, sal_Bool bCreate )
}
return (*prBase);
}
-/* -----------------02.09.99 08:06-------------------
- --------------------------------------------------*/
void SwDoc::SetDefaultTOXBase(const SwTOXBase& rBase)
{
SwTOXBase** prBase = 0;
@@ -639,9 +634,7 @@ sal_uInt16 SwDoc::GetTOXTypeCount(TOXTypes eTyp) const
++nCnt;
return nCnt;
}
-/*--------------------------------------------------------------------
- --------------------------------------------------------------------*/
const SwTOXType* SwDoc::GetTOXType( TOXTypes eTyp, sal_uInt16 nId ) const
{
const SwTOXTypePtr * ppTTypes = pTOXTypes->GetData();
@@ -652,18 +645,14 @@ const SwTOXType* SwDoc::GetTOXType( TOXTypes eTyp, sal_uInt16 nId ) const
return 0;
}
-/*--------------------------------------------------------------------
- --------------------------------------------------------------------*/
const SwTOXType* SwDoc::InsertTOXType( const SwTOXType& rTyp )
{
SwTOXType * pNew = new SwTOXType( rTyp );
pTOXTypes->Insert( pNew, pTOXTypes->Count() );
return pNew;
}
-/*--------------------------------------------------------------------
- --------------------------------------------------------------------*/
String SwDoc::GetUniqueTOXBaseName( const SwTOXType& rType,
const String* pChkStr ) const
{
@@ -718,9 +707,6 @@ String SwDoc::GetUniqueTOXBaseName( const SwTOXType& rType,
return aName += String::CreateFromInt32( ++nNum );
}
-/*--------------------------------------------------------------------
-
- --------------------------------------------------------------------*/
sal_Bool SwDoc::SetTOXBaseName(const SwTOXBase& rTOXBase, const String& rName)
{
ASSERT( rTOXBase.ISA( SwTOXBaseSection ),
@@ -738,7 +724,6 @@ sal_Bool SwDoc::SetTOXBaseName(const SwTOXBase& rTOXBase, const String& rName)
return bRet;
}
-/* */
const SwTxtNode* lcl_FindChapterNode( const SwNode& rNd, sal_uInt8 nLvl = 0 )
{
@@ -809,7 +794,7 @@ sal_Bool SwTOXBaseSection::SetPosAtStartEnd( SwPosition& rPos, sal_Bool bAtStart
--------------------------------------------------------------------*/
void SwTOXBaseSection::Update(const SfxItemSet* pAttr,
- const bool _bNewTOX )
+ const bool _bNewTOX )//swmodtest 080307
{
const SwSectionNode* pSectNd;
if( !SwTOXBase::GetRegisteredIn()->GetDepends() ||
@@ -1089,8 +1074,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() );
}
@@ -1200,18 +1188,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() );
@@ -1225,7 +1212,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() ) )
@@ -1289,7 +1276,7 @@ void SwTOXBaseSection::UpdateOutline( const SwTxtNode* pOwnChapterNode )
if( pTxtNd && pTxtNd->Len() && pTxtNd->GetDepends() &&
//sal_uInt16(pTxtNd->GetTxtColl()->GetOutlineLevel()+1) <= GetLevel() && //#outline level,zhaojianwei
sal_uInt16( pTxtNd->GetAttrOutlineLevel()) <= GetLevel() && //<-end,zhaojianwei
- pTxtNd->GetFrm() &&
+ pTxtNd->getLayoutFrm( pDoc->GetCurrentLayout() ) &&
!pTxtNd->HasHiddenParaField() &&
!pTxtNd->HasHiddenCharAttribute( true ) &&
( !IsFromChapter() ||
@@ -1325,13 +1312,12 @@ void SwTOXBaseSection::UpdateTemplate( const SwTxtNode* pOwnChapterNode )
pColl->IsAssignedToListLevelOfOutlineStyle()) )//<-end,zhaojianwei
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 ) ) )
@@ -1354,9 +1340,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)
@@ -1364,7 +1349,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 ) )
@@ -1384,9 +1369,7 @@ void SwTOXBaseSection::UpdateSequence( const SwTxtNode* pOwnChapterNode )
}
}
}
-/* -----------------15.09.99 14:18-------------------
- --------------------------------------------------*/
void SwTOXBaseSection::UpdateAuthorities( const SwTOXInternational& rIntl )
{
SwDoc* pDoc = (SwDoc*)GetFmt()->GetDoc();
@@ -1394,9 +1377,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
@@ -1407,12 +1389,12 @@ void SwTOXBaseSection::UpdateAuthorities( const SwTOXInternational& rIntl )
// const SwTxtNode* pChapterCompareNode = 0;
- if( rTxtNode.GetTxt().Len() && rTxtNode.GetFrm() &&
+ if( rTxtNode.GetTxt().Len() && rTxtNode.getLayoutFrm( pDoc->GetCurrentLayout() ) &&
rTxtNode.GetNodes().IsDocNodes() /*&&
(!IsFromChapter() || pChapterCompareNode == pOwnChapterNode) */)
{
//#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())
@@ -1561,7 +1543,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,
@@ -1602,7 +1584,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 );
@@ -1743,7 +1725,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
@@ -1835,7 +1817,7 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx,
pTOXSource->pNd->IsCntntNode() )
// <--
{
- const SwCntntFrm* pFrm = pTOXSource->pNd->GetFrm();
+ const SwCntntFrm* pFrm = pTOXSource->pNd->getLayoutFrm( pDoc->GetCurrentLayout() );
if( pFrm )
{
SwChapterFieldType aFldTyp;
@@ -2010,7 +1992,7 @@ void SwTOXBaseSection::UpdatePageNum()
SwTOXSource& rTOXSource = pSortBase->aTOXSources[j];
if( rTOXSource.pNd )
{
- SwCntntFrm* pFrm = rTOXSource.pNd->GetFrm();
+ SwCntntFrm* pFrm = rTOXSource.pNd->getLayoutFrm( pDoc->GetCurrentLayout() );
ASSERT( pFrm || pDoc->IsUpdateTOX(), "TOX, no Frame found");
if( !pFrm )
continue;
@@ -2426,9 +2408,7 @@ sal_Bool SwTOXBase::IsTOXBaseInReadonly() const
}
return bRet;
}
-/* -----------------17.08.99 13:29-------------------
- --------------------------------------------------*/
const SfxItemSet* SwTOXBase::GetAttrSet() const
{
const SwTOXBaseSection *pSect = PTR_CAST(SwTOXBaseSection, this);
@@ -2459,6 +2439,3 @@ sal_Bool SwTOXBase::GetInfo( SfxPoolItem& rInfo ) const
return sal_True;
}
-/* */
-
-
diff --git a/sw/source/core/doc/fmtcol.cxx b/sw/source/core/doc/fmtcol.cxx
index 5b88e37919..2674a666ca 100644
--- a/sw/source/core/doc/fmtcol.cxx
+++ b/sw/source/core/doc/fmtcol.cxx
@@ -34,20 +34,14 @@
#include <doc.hxx> // fuer GetAttrPool
#include <errhdl.hxx>
#include <fmtcol.hxx>
-// --> OD 2006-11-22 #i71574#
#include <fmtcolfunc.hxx>
-// <--
#include <hints.hxx>
#include <calc.hxx>
#include <node.hxx>
#include <numrule.hxx>
#include <paratr.hxx>
-
-//--> #outlinelevel added by zhaojianwei
-#ifndef _SFXINTITEM_HXX
+#include <switerator.hxx>
#include <svl/intitem.hxx>
-#endif
-//<--end
TYPEINIT1( SwTxtFmtColl, SwFmtColl );
TYPEINIT1( SwGrfFmtColl, SwFmtColl );
@@ -141,7 +135,7 @@ namespace TxtFmtCollFunc
* SwTxtFmtColl TXT
*/
-void SwTxtFmtColl::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwTxtFmtColl::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
if( GetDoc()->IsInDtor() )
{
@@ -361,10 +355,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;
@@ -547,6 +541,12 @@ SwCollCondition::~SwCollCondition()
delete aSubCondition.pFldExpression;
}
+void SwCollCondition::RegisterToFormat( SwFmt& rFmt )
+{
+ rFmt.Add( this );
+}
+
+
int SwCollCondition::operator==( const SwCollCondition& rCmp ) const
{
@@ -684,9 +684,8 @@ void SwTxtFmtColl::AssignToListLevelOfOutlineStyle(const int nAssignedListLevel)
SetAttrOutlineLevel(nAssignedListLevel+1);
// --> OD 2009-03-18 #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() )
@@ -702,7 +701,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 e17aa63010..f0966518fe 100644
--- a/sw/source/core/doc/ftnidx.cxx
+++ b/sw/source/core/doc/ftnidx.cxx
@@ -220,6 +220,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.
@@ -230,7 +232,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
@@ -292,8 +293,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 e7aae5df48..9e84209417 100644
--- a/sw/source/core/doc/htmltbl.cxx
+++ b/sw/source/core/doc/htmltbl.cxx
@@ -34,12 +34,8 @@
#ifdef TEST_DELAYED_RESIZE
#include <vcl/sound.hxx>
#endif
-#ifndef _WRKWIN_HXX //autogen
#include <vcl/wrkwin.hxx>
-#endif
-#ifndef _APP_HXX //autogen
#include <vcl/svapp.hxx>
-#endif
#include <sot/storage.hxx>
#include <fmtornt.hxx>
#include <fmtfsize.hxx>
@@ -54,9 +50,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;
@@ -65,8 +62,6 @@ using namespace ::com::sun::star;
#define MAX_TABWIDTH (USHRT_MAX - 2001)
-/* */
-
class SwHTMLTableLayoutConstraints
{
sal_uInt16 nRow; // Start-Zeile
@@ -369,7 +364,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();
@@ -420,11 +415,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
{
@@ -1791,16 +1785,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 )
@@ -1837,7 +1831,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 c1b8e7f8c7..91aa3ddedd 100644
--- a/sw/source/core/doc/lineinfo.cxx
+++ b/sw/source/core/doc/lineinfo.cxx
@@ -36,19 +36,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();
}
@@ -91,7 +94,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();
@@ -139,15 +142,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 eb78171ed0..e10a569781 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -160,8 +160,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();
}
@@ -190,9 +190,9 @@ void SwNoTxtFrm::InitCtor()
*************************************************************************/
-SwCntntFrm *SwNoTxtNode::MakeFrm()
+SwCntntFrm *SwNoTxtNode::MakeFrm( SwFrm* pSib )
{
- return new SwNoTxtFrm(this);
+ return new SwNoTxtFrm(this, pSib);
}
/*************************************************************************
@@ -245,7 +245,7 @@ void lcl_ClearArea( const SwFrm &rFrm,
{
// OD 2004-04-23 #116347#
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() );
@@ -269,7 +269,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();
@@ -661,7 +661,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;
@@ -824,7 +824,7 @@ void lcl_correctlyAlignRect( SwRect& rAlignedGrfArea, const SwRect& rInArea, Out
/// OD 25.09.2002 #99739# - 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();
@@ -1066,7 +1066,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 5a01d9c9a8..c3c8735dca 100644
--- a/sw/source/core/doc/number.cxx
+++ b/sw/source/core/doc/number.cxx
@@ -209,7 +209,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();
@@ -241,7 +241,7 @@ SwNumFmt::SwNumFmt(const SvxNumberFormat& rNumFmt, SwDoc* pDoc) :
pCFmt->Add( this );
}
else if( GetRegisteredIn() )
- pRegisteredIn->Remove( this );
+ GetRegisteredInNonConst()->Remove( this );
}
/* -----------------------------22.02.01 13:42--------------------------------
@@ -323,9 +323,9 @@ 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;
}
/* -----------------------------23.02.01 09:28--------------------------------
@@ -334,7 +334,7 @@ SwNumFmt& SwNumFmt::operator=( const SwNumFmt& rNumFmt)
sal_Bool SwNumFmt::operator==( const SwNumFmt& rNumFmt) const
{
sal_Bool bRet = SvxNumberFormat::operator==(rNumFmt) &&
- pRegisteredIn == rNumFmt.pRegisteredIn;
+ GetRegisteredIn() == rNumFmt.GetRegisteredIn();
return bRet;
}
@@ -346,17 +346,18 @@ void SwNumFmt::SetCharFmt( SwCharFmt* pChFmt)
if( pChFmt )
pChFmt->Add( this );
else if( GetRegisteredIn() )
- pRegisteredIn->Remove( this );
+ GetRegisteredInNonConst()->Remove( this );
}
/* -----------------------------22.02.01 13:45--------------------------------
---------------------------------------------------------------------------*/
-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:
@@ -367,7 +368,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 );
}
/* -----------------------------23.02.01 11:08--------------------------------
@@ -381,11 +382,18 @@ 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 );
+}
+
/* -----------------------------22.02.01 16:05--------------------------------
---------------------------------------------------------------------------*/
diff --git a/sw/source/core/doc/poolfmt.cxx b/sw/source/core/doc/poolfmt.cxx
index b54c1fea5b..ee78a53540 100644
--- a/sw/source/core/doc/poolfmt.cxx
+++ b/sw/source/core/doc/poolfmt.cxx
@@ -1291,7 +1291,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 11bbede0bc..6f03134f87 100644
--- a/sw/source/core/doc/swserv.cxx
+++ b/sw/source/core/doc/swserv.cxx
@@ -341,7 +341,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 0c1c604bb5..01cb4c95a7 100644..100755
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -336,7 +336,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)
@@ -424,7 +424,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 03ddeba5c7..5226c0a00e 100644
--- a/sw/source/core/doc/tblrwcl.cxx
+++ b/sw/source/core/doc/tblrwcl.cxx
@@ -62,6 +62,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;
@@ -211,20 +212,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] ) \
{ \
ASSERT( pFrm->GetUpper()->IsTabFrm(), \
"Table layout does not match table structure" ) \
} \
- } while ( 0 != ( pLast = aIter++ ) ); \
} \
} \
}
@@ -530,11 +525,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;
}
@@ -630,7 +624,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 )
{
@@ -751,7 +745,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 );
@@ -3759,8 +3753,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 cbfc834925..a218ef4ffb 100644
--- a/sw/source/core/doc/visiturl.cxx
+++ b/sw/source/core/doc/visiturl.cxx
@@ -54,7 +54,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();
@@ -92,7 +92,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 ec09c92dbe..fb67708d32 100644
--- a/sw/source/core/docnode/ndcopy.cxx
+++ b/sw/source/core/docnode/ndcopy.cxx
@@ -452,7 +452,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 44438f8657..44e5601097 100644
--- a/sw/source/core/docnode/ndsect.cxx
+++ b/sw/source/core/docnode/ndsect.cxx
@@ -28,7 +28,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
@@ -786,7 +786,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;
}
@@ -796,7 +796,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);
}
}
}
@@ -921,7 +921,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 )
{
@@ -1066,22 +1066,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 )
{
@@ -1094,10 +1080,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
@@ -1107,7 +1093,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() )
{
@@ -1129,7 +1115,7 @@ void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx )
while( 0 != (pFrm = aNode2Layout.NextFrm()) )
{
ASSERT( pFrm->IsSctFrm(), "Depend von Section keine Section." );
- pNew = rIdx.GetNode().GetCntntNode()->MakeFrm();
+ pNew = rIdx.GetNode().GetCntntNode()->MakeFrm( pFrm );
SwSectionNode* pS = rIdx.GetNode().FindSectionNode();
// --> OD 2008-06-23 #156927#
@@ -1152,7 +1138,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 );
// OD 14.11.2002 #104684# - prepare <Init()> of new section frame.
bInitNewSect = true;
SwLayoutFrm* pUp = pSct;
@@ -1169,7 +1155,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() )
{
@@ -1196,7 +1182,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() )
{
@@ -1338,7 +1324,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
@@ -1393,7 +1379,7 @@ void SwSectionNode::NodesArrChgd()
if( !rNds.IsDocNodes() )
{
SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, pFmt );
- pFmt->Modify( &aMsgHint, &aMsgHint );
+ pFmt->ModifyNotification( &aMsgHint, &aMsgHint );
}
pFmt->LockModify();
@@ -1420,12 +1406,9 @@ void SwSectionNode::NodesArrChgd()
{
ASSERT( 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 8cf42490b6..26e40ad8c6 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -30,14 +30,11 @@
#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>
#include <editeng/boxitem.hxx>
-// OD 06.08.2003 #i17174#
#include <editeng/shaditem.hxx>
#include <fmtfsize.hxx>
#include <fmtornt.hxx>
@@ -91,17 +88,13 @@
#include "docsh.hxx"
#include <tabcol.hxx>
#include <unochart.hxx>
-
#include <node.hxx>
#include <ndtxt.hxx>
-
#include <map>
#include <algorithm>
-// --> OD 2005-12-05 #i27138#
#include <rootfrm.hxx>
-// <--
#include <fldupde.hxx>
-
+#include <switerator.hxx>
#ifndef DBG_UTIL
#define CHECK_TABLE(t)
@@ -500,7 +493,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 );
@@ -796,7 +789,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) )
{
@@ -962,7 +955,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();
@@ -1154,10 +1147,6 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector<SwNodeRange> >
bool const bUndo(GetIDocumentUndoRedo().DoesUndo());
if (bUndo)
{
-// GetIDocumentUndoRedo().StartUndo( UNDO_TEXTTOTABLE );
-// pUndo = new SwUndoTxtToTbl( aOriginal, rInsTblOpts, cCh, eAdjust, pTAFmt );
-// GetIDocumentUndoRedo().AppendUndo(pUndo);
-
// das Splitten vom TextNode nicht in die Undohistory aufnehmen
GetIDocumentUndoRedo().DoUndo(false);
}
@@ -1209,8 +1198,6 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector<SwNodeRange> >
pLineFmt->SetFmtAttr( SwFmtFillOrder( ATT_LEFT_TO_RIGHT ));
// die Tabelle bekommt USHRT_MAX als default SSize
pTableFmt->SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE, USHRT_MAX ));
-// if( !(rInsTblOpts.mnInsMode & tabopts::SPLIT_LAYOUT) )
-// pTableFmt->SetAttr( SwFmtLayoutSplit( sal_False ));
/* #106283# If the first node in the selection is a context node and if it
has an item FRAMEDIR set (no default) propagate the item to the
@@ -1233,13 +1220,7 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector<SwNodeRange> >
SwTable * pNdTbl = &pTblNd->GetTable();
ASSERT( pNdTbl, "kein Tabellen-Node angelegt." )
- pTableFmt->Add( pNdTbl ); // das Frame-Format setzen
-
-// const sal_uInt16 nRowsToRepeat =
-// tabopts::HEADLINE == (rInsTblOpts.mnInsMode & tabopts::HEADLINE) ?
-// rInsTblOpts.mnRowsToRepeat :
-// 0;
-// pNdTbl->SetRowsToRepeat( nRowsToRepeat );
+ pNdTbl->RegisterToFormat( *pTableFmt );
sal_Bool bUseBoxFmt = sal_False;
if( !pBoxFmt->GetDepends() )
@@ -1249,28 +1230,11 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector<SwNodeRange> >
bUseBoxFmt = sal_True;
pTableFmt->SetFmtAttr( pBoxFmt->GetFrmSize() );
delete pBoxFmt;
-// eAdjust = HORI_NONE;
}
- //Orientation am Fmt der Table setzen
-// pTableFmt->SetAttr( SwFmtHoriOrient( 0, eAdjust ) );
-// pTableFmt->Add( pNdTbl ); // das Frame-Format setzen
-
-
sal_uLong nIdx = pTblNd->GetIndex();
aNode2Layout.RestoreUpperFrms( GetNodes(), nIdx, nIdx + 1 );
- {
-// SwPaM& rTmp = (SwPaM&)rRange; // Point immer an den Anfang
-// rTmp.DeleteMark();
-// rTmp.GetPoint()->nNode = *pTblNd;
-// SwCntntNode* pCNd = GetNodes().GoNext( &rTmp.GetPoint()->nNode );
-// rTmp.GetPoint()->nContent.Assign( pCNd, 0 );
- }
-
-// if( pUndo )
-// GetIDocumentUndoRedo().EndUndo( UNDO_TEXTTOTABLE );
-
SetModified();
SetFieldsDirty( true, NULL, 0 );
return pNdTbl;
@@ -2472,14 +2436,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
@@ -2501,7 +2465,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
@@ -2528,7 +2492,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 );
// --> OD 2005-12-01 #i27138#
// notify accessibility paragraphs objects about changed
@@ -2536,7 +2500,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() )
{
@@ -2558,14 +2522,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() )
@@ -2576,7 +2538,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() )
{
@@ -2591,7 +2553,7 @@ void SwTableNode::DelFrms()
bAgain = sal_True;
}
}
- pLast = bAgain ? aIter.GoStart() : aIter++;
+ pFrm = bAgain ? aIter.First() : aIter.Next();
}
}
@@ -2631,7 +2593,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() );
@@ -2856,7 +2818,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() );
@@ -3065,7 +3027,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();
}
@@ -3592,7 +3554,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 e4d74a333a..7b6d4587a9 100644
--- a/sw/source/core/docnode/ndtbl1.cxx
+++ b/sw/source/core/docnode/ndtbl1.cxx
@@ -28,7 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include "hintids.hxx"
#include <editeng/lrspitem.hxx>
#include <editeng/boxitem.hxx>
@@ -56,9 +55,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 +123,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;
@@ -458,12 +458,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 );
@@ -795,7 +795,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(
@@ -891,7 +891,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(
@@ -1150,7 +1150,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 1eceb548a2..d47f3bc4da 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -28,12 +28,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <hintids.hxx>
-
-// --> OD 2005-02-21 #i42921#
#include <editeng/frmdiritem.hxx>
-// <--
#include <editeng/protitem.hxx>
#include <com/sun/star/i18n/CharacterIteratorMode.hdl>
#include <fmtcntnt.hxx>
@@ -71,13 +67,11 @@
#include <crsskip.hxx>
#include <SwStyleNameMapper.hxx>
#include <scriptinfo.hxx>
-// --> OD 2005-12-05 #i27138#
#include <rootfrm.hxx>
-// <--
#include <istyleaccess.hxx>
-// --> OD 2007-10-31 #i83479#
#include <IDocumentListItems.hxx>
-// <--
+#include <switerator.hxx>
+#include "ndole.hxx"
using namespace ::com::sun::star::i18n;
@@ -449,15 +443,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();
@@ -494,7 +489,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().
@@ -563,7 +558,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();
@@ -787,10 +782,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 )
{
@@ -862,8 +856,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() )
@@ -1060,7 +1054,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 ;
@@ -1072,7 +1066,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() )
{
@@ -1139,7 +1133,7 @@ void SwCntntNode::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue )
break;
}
- SwModify::Modify( pOldValue, pNewValue );
+ NotifyClients( pOldValue, pNewValue );
}
sal_Bool SwCntntNode::InvalidateNumRule()
@@ -1157,12 +1151,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 );
}
@@ -1170,7 +1162,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();
@@ -1181,7 +1173,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();
@@ -1219,8 +1211,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 );
}
}
@@ -1353,7 +1343,7 @@ void SwCntntNode::MakeFrms( SwCntntNode& rNode )
while( 0 != (pUpper = aNode2Layout.UpperFrm( pFrm, rNode )) )
{
- pNew = rNode.MakeFrm();
+ pNew = rNode.MakeFrm( pUpper );
pNew->Paste( pUpper, pFrm );
// --> OD 2005-12-01 #i27138#
// notify accessibility paragraphs objects about changed
@@ -1362,7 +1352,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() )
{
@@ -1387,60 +1377,7 @@ void SwCntntNode::DelFrms()
if( !GetDepends() )
return;
- SwClientIter aIter( *this );
- SwCntntFrm *pFrm;
-
- for( pFrm = (SwCntntFrm*)aIter.First( TYPE(SwCntntFrm)); pFrm;
- pFrm = (SwCntntFrm*)aIter.Next() )
- {
- // --> OD 2005-12-01 #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();
- ASSERT( pFtn, "You promised a FtnFrm?" );
- SwCntntFrm* pCFrm;
- if( !pFtn->GetFollow() && !pFtn->GetMaster() &&
- 0 != ( pCFrm = pFtn->GetRefFromAttr()) && pCFrm->IsFollow() )
- {
- ASSERT( 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 );
@@ -1511,7 +1448,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;
}
@@ -1549,7 +1486,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;
@@ -1625,7 +1562,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;
@@ -1675,7 +1612,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 );
@@ -1716,7 +1653,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
@@ -1755,7 +1692,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 );
@@ -1895,7 +1832,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() )
{
@@ -2049,7 +1986,7 @@ short SwCntntNode::GetTextDirection( const SwPosition& rPos,
// --> OD 2007-01-10 #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 )
@@ -2075,6 +2012,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 e7c3f476ca..be749cc7d2 100644
--- a/sw/source/core/docnode/node2lay.cxx
+++ b/sw/source/core/docnode/node2lay.cxx
@@ -28,8 +28,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>
@@ -42,14 +42,14 @@
#include "section.hxx"
#include "node2lay.hxx"
-
/* -----------------25.02.99 10:31-------------------
* 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
@@ -77,6 +77,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 )
{
@@ -88,7 +153,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;
@@ -96,7 +161,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
@@ -109,7 +174,6 @@ SwNode2LayImpl::SwNode2LayImpl( const SwNode& rNode, sal_uLong nIdx, sal_Bool bS
}
if( pNd )
{
- SwModify *pMod;
if( pNd->IsCntntNode() )
pMod = (SwModify*)pNd->GetCntntNode();
else
@@ -117,10 +181,13 @@ SwNode2LayImpl::SwNode2LayImpl( const SwNode& rNode, sal_uLong nIdx, sal_Bool bS
ASSERT( 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;
+ }
}
/* -----------------25.02.99 10:41-------------------
@@ -141,11 +208,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 );
@@ -188,7 +255,7 @@ SwFrm* SwNode2LayImpl::NextFrm()
}
return pRet;
}
- pRet = (SwFrm*)pIter->Next();
+ pRet = pIter->Next();
}
return NULL;
}
@@ -215,6 +282,7 @@ void SwNode2LayImpl::SaveUpperFrms()
}
delete pIter;
pIter = NULL;
+ pMod = 0;
}
SwLayoutFrm* SwNode2LayImpl::UpperFrm( SwFrm* &rpFrm, const SwNode &rNode )
@@ -255,7 +323,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();
@@ -299,7 +367,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;
}
@@ -314,7 +382,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 );
ASSERT( pNew->IsTabFrm(), "Table exspected" );
pNew->Paste( pUp, pNxt );
((SwTabFrm*)pNew)->RegistFlys();
@@ -358,9 +426,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 3bc9597585..bf8c41e391 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -373,7 +373,7 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz,
SwPtrMsgPoolItem aMsgHint( nDelMsg,
(void*)&pAttr->GetAttr() );
rNds.GetDoc()->GetUnoCallBack()->
- Modify( &aMsgHint, &aMsgHint );
+ ModifyNotification( &aMsgHint, &aMsgHint );
}
}
}
@@ -402,7 +402,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:
@@ -671,7 +671,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 )
@@ -1532,79 +1532,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()
@@ -2407,7 +2334,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 0ea01f75f6..df06c2bdc5 100644
--- a/sw/source/core/docnode/section.cxx
+++ b/sw/source/core/docnode/section.cxx
@@ -29,7 +29,6 @@
#include "precompiled_sw.hxx"
#include <stdlib.h>
-
#include <hintids.hxx>
#include <svl/intitem.hxx>
#include <svl/stritem.hxx>
@@ -38,7 +37,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,11 +63,11 @@
#include <fmtftntx.hxx>
#include <ftnidx.hxx>
#include <doctxm.hxx>
-// --> FME 2004-06-22 #114856# 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;
@@ -251,7 +249,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
{
@@ -270,7 +268,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
@@ -335,7 +333,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();
@@ -352,7 +350,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();
}
@@ -437,7 +435,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;
@@ -486,7 +484,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
@@ -510,7 +508,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;
@@ -542,6 +540,10 @@ void SwSection::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
bUpdateFtn = true;
}
break;
+
+ default:
+ CheckRegistration( pOld, pNew );
+ break;
}
if( bRemake )
@@ -556,7 +558,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 )
@@ -699,19 +700,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 );
@@ -725,14 +716,7 @@ SwSectionFmt::~SwSectionFmt()
SwSection * SwSectionFmt::GetSection() const
{
- if( GetDepends() )
- {
- SwClientIter aIter( *(SwSectionFmt*)this );
- return (SwSectionPtr)aIter.First( TYPE(SwSection) );
- }
-
- ASSERT( sal_False, "keine Section als Client." )
- return 0;
+ return SwIterator<SwSection,SwSectionFmt>::FirstElement( *this );
}
extern void lcl_DeleteFtn( SwSectionNode *pNd, sal_uLong nStt, sal_uLong nEnd );
@@ -745,34 +729,19 @@ void SwSectionFmt::DelFrms()
if( pIdx && &GetDoc()->GetNodes() == &pIdx->GetNodes() &&
0 != (pSectNd = pIdx->GetNode().GetSectionNode() ))
{
- SwClientIter aIter( *this );
- SwClient *pLast = aIter.GoStart();
- // --> OD 2007-08-14 #147431#
- // 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();
sal_uLong nStart = pSectNd->GetIndex()+1;
lcl_DeleteFtn( pSectNd, nStart, nEnde );
@@ -789,7 +758,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 );
}
}
}
@@ -809,18 +778,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;
@@ -835,7 +793,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 );
}
@@ -844,7 +802,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 );
}
@@ -853,16 +811,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 );
}
@@ -882,12 +838,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 ;
@@ -900,12 +851,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
@@ -957,17 +903,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;
@@ -1026,15 +971,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() );
@@ -1084,8 +1028,8 @@ void SwSectionFmt::UpdateParent() // Parent wurde veraendert
// <--
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) ) )
@@ -1114,7 +1058,7 @@ void SwSectionFmt::UpdateParent() // Parent wurde veraendert
if (!pProtect->IsCntntProtected() !=
!pSection->IsProtectFlag())
{
- pLast->Modify( (SfxPoolItem*)pProtect,
+ pLast->ModifyNotification( (SfxPoolItem*)pProtect,
(SfxPoolItem*)pProtect );
}
@@ -1122,7 +1066,7 @@ void SwSectionFmt::UpdateParent() // Parent wurde veraendert
if (!pEditInReadonly->GetValue() !=
!pSection->IsEditInReadonlyFlag())
{
- pLast->Modify( (SfxPoolItem*)pEditInReadonly,
+ pLast->ModifyNotification( (SfxPoolItem*)pEditInReadonly,
(SfxPoolItem*)pEditInReadonly );
}
// <--
@@ -1132,7 +1076,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 b14c7fd078..fc9d116e92 100644
--- a/sw/source/core/docnode/swbaslnk.cxx
+++ b/sw/source/core/docnode/swbaslnk.cxx
@@ -80,7 +80,7 @@ void lcl_CallModify( SwGrfNode& rGrfNd, SfxPoolItem& rItem )
// them havent't a loaded Graphic. - #86501#
rGrfNd.LockModify();
- SwClientIter aIter( rGrfNd );
+ SwClientIter aIter( rGrfNd ); // TODO
for( int n = 0; n < 2; ++n )
{
SwClient * pLast = aIter.GoStart();
@@ -88,7 +88,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++ ));
}
}
@@ -218,7 +218,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;
}
}
@@ -283,7 +283,7 @@ void SwBaseLink::DataChanged( const String& rMimeType,
}
else
{
- pCntntNode->Modify( &aMsgHint, &aMsgHint );
+ pCntntNode->ModifyNotification( &aMsgHint, &aMsgHint );
}
@@ -409,30 +409,9 @@ sal_Bool SwBaseLink::SwapIn( sal_Bool bWaitForData, sal_Bool bNativFormat )
}
#endif
- // --> OD 2005-04-11 #i46300# - deactivate fix for issues i9861 and i33293
-// TestBalloonInputStream* pTBIS = 0;
-// if(!m_xInputStreamToLoadFrom.is()) {
-// if ( !pCntntNode->IsGrfNode() ||
-// static_cast<SwGrfNode*>(pCntntNode)->GetGrfObj().GetType()
-// != GRAPHIC_DEFAULT )
-// {
-// pTBIS = new TestBalloonInputStream();
-// m_xInputStreamToLoadFrom = pTBIS;
-// }
-// }
- // <--
-
if( GetObj() )
{
- // --> OD 2005-04-11 #i46300# - deactivate fix for issues i9861 and i33293
-// GetObj()->setStreamToLoadFrom(m_xInputStreamToLoadFrom,m_bIsReadOnly);
- // <--
String aMimeType( SotExchange::GetFormatMimeType( GetContentType() ));
-
-//!! ??? what have we here to do ????
-//!! if( bNativFormat )
-//!! aData.SetAspect( aData.GetAspect() | ASPECT_ICON );
-
uno::Any aValue;
GetObj()->GetData( aValue, aMimeType, !IsSynchron() && bWaitForData );
@@ -460,18 +439,6 @@ sal_Bool SwBaseLink::SwapIn( sal_Bool bWaitForData, sal_Bool bNativFormat )
bRes = Update();
bSwapIn = sal_False;
-
- // --> OD 2005-04-11 #i46300# - deactivate fix for issues i9861 and i33293
-// if ( pTBIS && pTBIS->isTouched() )
-// {
-// // --> OD 2005-04-11 #i46300# - determine correct URL for the graphic
-// String sGrfNm;
-// GetLinkManager()->GetDisplayNames( this, 0, &sGrfNm, 0, 0 );
-// (m_pReReadThread = new ReReadThread(
-// this, sGrfNm, bWaitForData, bNativFormat))->create();
-// // <--
-// }
- // <--
return bRes;
}
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index 16d20c1de2..998968fa65 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -33,6 +33,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>
@@ -71,7 +72,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;
@@ -309,13 +310,13 @@ void SwContact::_MoveObjToLayer( const bool _bToVisible,
return;
}
- if ( !pRegisteredIn )
+ if ( !GetRegisteredIn() )
{
ASSERT( false, "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 )
{
ASSERT( false, "SwDrawContact::_MoveObjToLayer(..) - no writer document!" );
@@ -408,7 +409,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() )
@@ -438,7 +439,7 @@ sal_uInt32 SwContact::GetMaxOrdNum() const
{
sal_uInt32 nMaxOrdNum( 0L );
- std::vector< SwAnchoredObject* > aObjs;
+ std::list< SwAnchoredObject* > aObjs;
GetAnchoredObjs( aObjs );
while ( !aObjs.empty() )
@@ -545,88 +546,6 @@ void SwFlyDrawContact::SetMaster( SdrObject* _pNewMaster )
/*************************************************************************
|*
-|* SwFlyDrawContact::CreateNewRef()
-|*
-|* Ersterstellung MA 14. Dec. 94
-|* Letzte Aenderung MA 24. Apr. 95
-|*
-|*************************************************************************/
-
-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()
|*
|* Ersterstellung OK 08.11.94 10:21
@@ -634,7 +553,7 @@ sal_uInt32 SwFlyDrawContact::_GetOrdNumForNewRef( const SwFlyFrm* _pFlyFrm )
|*
|*************************************************************************/
-void SwFlyDrawContact::Modify( SfxPoolItem *, SfxPoolItem * )
+void SwFlyDrawContact::Modify( const SfxPoolItem*, const SfxPoolItem * )
{
}
@@ -716,17 +635,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 );
}
/*************************************************************************
@@ -769,7 +681,7 @@ SwDrawContact::SwDrawContact( SwFrmFmt* pToRegisterIn, SdrObject* pObj ) :
meEventTypeOfCurrentUserCall( SDRUSERCALL_MOVEONLY )
// <--
{
- // clear vector containing 'virtual' drawing objects.
+ // clear list containing 'virtual' drawing objects.
maDrawVirtObjs.clear();
// --> OD 2004-09-22 #i33909# - assure, that drawing object is inserted
@@ -818,6 +730,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
{
@@ -1207,9 +1158,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;
}
@@ -1225,7 +1175,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;
@@ -1239,13 +1190,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();
}
// --> OD 2006-01-18 #129959#
@@ -1405,7 +1356,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());
@@ -1621,7 +1572,7 @@ namespace
|*
|*************************************************************************/
-void SwDrawContact::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
+void SwDrawContact::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
{
// OD 10.10.2003 #112299#
ASSERT( !mbDisconnectInProgress,
@@ -1834,7 +1785,7 @@ void SwDrawContact::DisconnectFromLayout( bool _bMoveMasterToInvisibleLayer )
// 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() );
// OD 21.08.2003 #i18447# - in order to consider group object correct
// use new method <SwDrawContact::MoveObjToInvisibleLayer(..)>
@@ -1855,7 +1806,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() );
}
}
@@ -1947,13 +1898,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;
- }
// OD 16.05.2003 #108784# - remove 'virtual' drawing objects from writer
// layout and from drawing page, and remove 'master' drawing object from
@@ -1970,6 +1918,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 )
@@ -2008,8 +1960,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
{
@@ -2041,11 +1992,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
@@ -2215,7 +2164,7 @@ void SwDrawContact::ChangeMasterObject( SdrObject *pNewMaster )
@author
*/
-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 05fe38f414..7495a1523d 100644
--- a/sw/source/core/draw/dflyobj.cxx
+++ b/sw/source/core/draw/dflyobj.cxx
@@ -54,6 +54,7 @@
#include "ndnotxt.hxx"
#include "grfatr.hxx"
#include "pagefrm.hxx"
+#include "rootfrm.hxx"
using namespace ::com::sun::star;
@@ -474,7 +475,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,
@@ -679,8 +680,19 @@ void __EXPORT SwVirtFlyDrawObj::NbcMove(const Size& rSiz)
long lYDiff = aNewPos.Y() - aOldPos.Y();
if( GetFlyFrm()->GetAnchorFrm()->IsVertical() )
{
- lXDiff -= rVert.GetPos();
- lYDiff += rHori.GetPos();
+ //lXDiff -= rVert.GetPos();
+ //lYDiff += rHori.GetPos();
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( GetFlyFrm()->GetAnchorFrm()->IsVertLR() )
+ {
+ lXDiff += rVert.GetPos();
+ lXDiff = -lXDiff;
+ }
+ else
+ {
+ lXDiff -= rVert.GetPos();
+ lYDiff += rHori.GetPos();
+ }
}
else
{
@@ -791,7 +803,9 @@ void __EXPORT SwVirtFlyDrawObj::NbcResize(const Point& rRef,
const sal_Bool bRTL = pTmpFrm->IsRightToLeft();
- const Point aNewPos( bVertX || bRTL ?
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ const bool bVertL2RX = pTmpFrm->IsVertLR();
+ const Point aNewPos( ( bVertX && !bVertL2RX ) || bRTL ?
aOutRect.Right() + 1 :
aOutRect.Left(),
aOutRect.Top() );
@@ -830,9 +844,9 @@ void __EXPORT 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();
@@ -856,10 +870,9 @@ void __EXPORT SwVirtFlyDrawObj::NbcResize(const Point& rRef,
}
//Position kann auch veraendert sein!
- const Point aOldPos( bVertX || bRTL ?
+ const Point aOldPos( ( bVertX && !bVertL2RX ) || bRTL ?
GetFlyFrm()->Frm().TopRight() :
GetFlyFrm()->Frm().Pos() );
-
if ( aNewPos != aOldPos )
{
//Kann sich durch das ChgSize veraendert haben!
@@ -867,7 +880,12 @@ void __EXPORT SwVirtFlyDrawObj::NbcResize(const Point& rRef,
{
if( aOutRect.TopRight() != aNewPos )
{
- SwTwips nDeltaX = aNewPos.X() - aOutRect.Right();
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ SwTwips nDeltaX;
+ if ( bVertL2RX )
+ nDeltaX = aNewPos.X() - aOutRect.Left();
+ else
+ nDeltaX = aNewPos.X() - aOutRect.Right();
SwTwips nDeltaY = aNewPos.Y() - aOutRect.Top();
MoveRect( aOutRect, Size( nDeltaX, nDeltaY ) );
}
diff --git a/sw/source/core/draw/dpage.cxx b/sw/source/core/draw/dpage.cxx
index 8c2124b822..c17df6b6ac 100644
--- a/sw/source/core/draw/dpage.cxx
+++ b/sw/source/core/draw/dpage.cxx
@@ -118,7 +118,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 d057d169ec..838d0d2731 100644
--- a/sw/source/core/draw/dview.cxx
+++ b/sw/source/core/draw/dview.cxx
@@ -279,8 +279,9 @@ void SwDrawView::AddCustomHdl()
}
// add anchor handle:
- aHdl.AddHdl( new SwSdrHdl( aPos, pAnch->IsVertical() ||
- pAnch->IsRightToLeft() ) );
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ aHdl.AddHdl( new SwSdrHdl( aPos, ( pAnch->IsVertical() && !pAnch->IsVertLR() ) ||
+ pAnch->IsRightToLeft() ) );
}
/*************************************************************************
@@ -446,7 +447,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() );
ASSERT( pContact,
@@ -829,9 +830,10 @@ const SwFrm* SwDrawView::CalcAnchor()
aMyRect = pObj->GetSnapRect();
}
- const sal_Bool bTopRight = pAnch && ( pAnch->IsVertical() ||
- pAnch->IsRightToLeft() );
-
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ const sal_Bool bTopRight = pAnch && ( ( pAnch->IsVertical() &&
+ !pAnch->IsVertLR() ) ||
+ pAnch->IsRightToLeft() );
const Point aMyPt = bTopRight ? aMyRect.TopRight() : aMyRect.TopLeft();
Point aPt;
@@ -1084,8 +1086,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);
// OD 18.06.2003 #108784# - replace marked <SwDrawVirtObj>-objects by its
// reference objects.
@@ -1106,19 +1109,7 @@ void SwDrawView::DeleteMarked()
::FrameNotify( Imp().GetShell(), FLY_DRAG_END );
}
pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, NULL);
- if( pDoc->GetRootFrm() )
- pDoc->GetRootFrm()->EndAllAction();
-}
-
-/********
-JP 02.10.98: sollte als Fix fuer 57153 gelten, hatte aber Nebenwirkungen,
- wie Bug 57475
-const SdrMarkList& SwDrawView::GetMarkedObjectList() const
-{
- FlushComeBackTimer();
- return FmFormView::GetMarkedObjectList();
+ if( pTmpRoot )
+ pTmpRoot->EndAllAction(); //swmod 080218
}
-*************/
-
-
diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx
index 9d78929b98..582c2fe405 100644..100755
--- a/sw/source/core/edit/acorrect.cxx
+++ b/sw/source/core/edit/acorrect.cxx
@@ -157,6 +157,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 )
{
@@ -204,14 +208,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 446a450503..66f4d40b72 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -270,7 +270,7 @@ const sal_Unicode* StrChr( const sal_Unicode* pSrc, sal_Unicode c )
SwTxtFrm* SwAutoFormat::GetFrm( const SwTxtNode& rTxtNd ) const
{
// besorge mal den Frame
- const SwCntntFrm *pFrm = rTxtNd.GetFrm();
+ const SwCntntFrm *pFrm = rTxtNd.getLayoutFrm( pEditShell->GetLayout() );
ASSERT( pFrm, "zum Autoformat muss das Layout vorhanden sein" );
if( aFlags.bAFmtByInput && !pFrm->IsValid() )
{
@@ -1542,6 +1542,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 f3d7aa3332..420cc601fa 100644
--- a/sw/source/core/edit/edattr.cxx
+++ b/sw/source/core/edit/edattr.cxx
@@ -360,7 +360,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 0dd9725ded..0a03d36423 100644
--- a/sw/source/core/edit/eddel.cxx
+++ b/sw/source/core/edit/eddel.cxx
@@ -90,7 +90,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 33eef0cbee..d14f4d7cec 100644
--- a/sw/source/core/edit/edfld.cxx
+++ b/sw/source/core/edit/edfld.cxx
@@ -45,7 +45,8 @@
#include <dbmgr.hxx>
#include <swddetbl.hxx>
#include <hints.hxx>
-
+#include <switerator.hxx>
+#include <fieldhint.hxx>
/*--------------------------------------------------------------------
Beschreibung: Feldtypen zu einer ResId zaehlen
@@ -200,45 +201,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();
@@ -578,13 +547,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 db11a49d2d..6547c8a765 100644
--- a/sw/source/core/edit/edfldexp.cxx
+++ b/sw/source/core/edit/edfldexp.cxx
@@ -29,9 +29,7 @@
#include "precompiled_sw.hxx"
#include <editsh.hxx>
#include <dbfld.hxx>
-#ifndef _DBMGR_HXX
#include <dbmgr.hxx>
-#endif
#include <com/sun/star/container/XNameAccess.hpp>
#include <comphelper/processfactory.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -42,13 +40,11 @@
#include <fmtfld.hxx>
#include <edimp.hxx>
#include <flddat.hxx>
+#include <switerator.hxx>
using namespace com::sun::star;
using ::rtl::OUString;
-/* -----------------28.11.2002 17:53-----------------
- *
- * --------------------------------------------------*/
sal_Bool SwEditShell::IsFieldDataSourceAvailable(String& rUsedDataSource) const
{
const SwFldTypes * pFldTypes = GetDoc()->GetFldTypes();
@@ -70,8 +66,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())
@@ -88,7 +84,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 c08b48836e..7566dd74a4 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;
@@ -423,10 +423,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();
}
@@ -439,10 +438,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();
}
@@ -481,7 +479,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 );
@@ -739,7 +737,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();
}
@@ -813,14 +811,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() ) );
@@ -834,6 +831,7 @@ sal_uInt16 SwEditShell::GetINetAttrs( SwGetINetAttrs& rArr )
}
}
}
+ }
return rArr.Count();
}
@@ -906,7 +904,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() )
@@ -974,7 +972,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
@@ -1002,7 +1000,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;
@@ -1196,3 +1194,11 @@ void SwEditShell::CountWords( SwDocStat& rStat ) const
FOREACHPAM_END()
}
+void SwEditShell::ApplyViewOptions( const SwViewOption &rOpt )
+{
+ SwCrsrShell::StartAction();
+ ViewShell::ApplyViewOptions( rOpt );
+ SwEditShell::EndAction();
+}
+
+
diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx
index ba550a5e1a..564806e211 100644
--- a/sw/source/core/edit/edlingu.cxx
+++ b/sw/source/core/edit/edlingu.cxx
@@ -64,7 +64,7 @@
#include <docary.hxx> // SwRedlineTbl
#include <docsh.hxx>
#include <txatbase.hxx>
-
+#include <txtfrm.hxx>
using namespace ::svx;
using namespace ::com::sun::star;
@@ -74,8 +74,6 @@ using namespace ::com::sun::star::linguistic2;
#define C2U(cChar) rtl::OUString::createFromAscii(cChar)
-extern void repaintTextFrames( SwModify& rModify );
-
/*************************************************************************
* class SwLinguIter
*************************************************************************/
@@ -1097,7 +1095,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;
@@ -1241,7 +1239,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;
@@ -1966,7 +1964,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 c792beea27..abf04c7b04 100644
--- a/sw/source/core/edit/edsect.cxx
+++ b/sw/source/core/edit/edsect.cxx
@@ -103,7 +103,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 10f6f0d403..66d143c17c 100644
--- a/sw/source/core/edit/edtox.cxx
+++ b/sw/source/core/edit/edtox.cxx
@@ -348,13 +348,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 94d49b6204..974141b5e5 100644
--- a/sw/source/core/edit/edundo.cxx
+++ b/sw/source/core/edit/edundo.cxx
@@ -238,10 +238,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 d88ccdb14b..7bcbf12a75 100644
--- a/sw/source/core/fields/authfld.cxx
+++ b/sw/source/core/fields/authfld.cxx
@@ -40,9 +40,7 @@
#include <editeng/langitem.hxx>
#include <swtypes.hxx>
#include <tools/resid.hxx>
-#ifndef _COMCORE_HRC
#include <comcore.hrc>
-#endif
#include <authfld.hxx>
#include <expfld.hxx>
#include <pam.hxx>
@@ -54,11 +52,9 @@
#include <txtfld.hxx>
#include <ndtxt.hxx>
#include <doc.hxx>
-#ifndef _UNOFLDMID_H
#include <unofldmid.h>
-#endif
#include <unoprnms.hxx>
-
+#include <switerator.hxx>
#include <unomid.h>
using namespace ::com::sun::star::uno;
@@ -77,9 +73,6 @@ SV_DECL_PTRARR_DEL( SortKeyArr, TOXSortKeyPtr, 5, 5 )
SV_IMPL_PTRARR( SortKeyArr, TOXSortKeyPtr )
-/* -----------------16.09.99 11:53-------------------
-
- --------------------------------------------------*/
SwAuthEntry::SwAuthEntry(const SwAuthEntry& rCopy)
: nRefCount(0)
{
@@ -95,10 +88,6 @@ sal_Bool SwAuthEntry::operator==(const SwAuthEntry& rComp)
return sal_True;
}
// --------------------------------------------------------
-
-/* -----------------14.09.99 16:15-------------------
-
- --------------------------------------------------*/
SwAuthorityFieldType::SwAuthorityFieldType(SwDoc* pDoc)
: SwFieldType( RES_AUTHORITY ),
m_pDoc(pDoc),
@@ -129,9 +118,6 @@ SwAuthorityFieldType::SwAuthorityFieldType( const SwAuthorityFieldType& rFType)
m_pSortKeyArr->Insert((*rFType.m_pSortKeyArr)[i], i);
}
-/* -----------------17.09.99 13:52-------------------
-
- --------------------------------------------------*/
SwAuthorityFieldType::~SwAuthorityFieldType()
{
// DBG_ASSERT(!m_pDataArr->Count(), "Array is not empty");
@@ -140,16 +126,12 @@ SwAuthorityFieldType::~SwAuthorityFieldType()
delete m_pSequArr;
delete m_pDataArr;
}
-/*-- 14.09.99 16:22:09---------------------------------------------------
- -----------------------------------------------------------------------*/
SwFieldType* SwAuthorityFieldType::Copy() const
{
return new SwAuthorityFieldType(m_pDoc);
}
-/* -----------------17.09.99 13:43-------------------
- --------------------------------------------------*/
void SwAuthorityFieldType::RemoveField(long nHandle)
{
#ifdef DBG_UTIL
@@ -178,9 +160,7 @@ void SwAuthorityFieldType::RemoveField(long nHandle)
DBG_ASSERT(bRemoved, "Field unknown" );
#endif
}
-/* -----------------17.09.99 13:43-------------------
- --------------------------------------------------*/
long SwAuthorityFieldType::AddField(const String& rFieldContents)
{
long nRet = 0;
@@ -210,9 +190,7 @@ long SwAuthorityFieldType::AddField(const String& rFieldContents)
}
return nRet;
}
-/* -----------------17.09.99 14:18-------------------
- --------------------------------------------------*/
sal_Bool SwAuthorityFieldType::AddField(long nHandle)
{
sal_Bool bRet = sal_False;
@@ -232,9 +210,7 @@ sal_Bool SwAuthorityFieldType::AddField(long nHandle)
DBG_ASSERT(bRet, "::AddField(long) failed");
return bRet;
}
-/* -----------------17.09.99 14:52-------------------
- --------------------------------------------------*/
const SwAuthEntry* SwAuthorityFieldType::GetEntryByHandle(long nHandle) const
{
const SwAuthEntry* pRet = 0;
@@ -251,9 +227,7 @@ const SwAuthEntry* SwAuthorityFieldType::GetEntryByHandle(long nHandle) const
ASSERT( pRet, "invalid Handle" );
return pRet;
}
-/* -----------------21.09.99 13:34-------------------
- --------------------------------------------------*/
void SwAuthorityFieldType::GetAllEntryIdentifiers(
SvStringsDtor& rToFill )const
{
@@ -264,9 +238,7 @@ void SwAuthorityFieldType::GetAllEntryIdentifiers(
AUTH_FIELD_IDENTIFIER )), rToFill.Count() );
}
}
-/* -----------------21.09.99 13:34-------------------
- --------------------------------------------------*/
const SwAuthEntry* SwAuthorityFieldType::GetEntryByIdentifier(
const String& rIdentifier)const
{
@@ -282,9 +254,7 @@ const SwAuthEntry* SwAuthorityFieldType::GetEntryByIdentifier(
}
return pRet;
}
-/* -----------------------------21.12.99 13:20--------------------------------
- ---------------------------------------------------------------------------*/
bool SwAuthorityFieldType::ChangeEntryContent(const SwAuthEntry* pNewEntry)
{
bool bChanged = false;
@@ -303,9 +273,9 @@ bool SwAuthorityFieldType::ChangeEntryContent(const SwAuthEntry* pNewEntry)
}
return bChanged;
}
-/*-- 11.10.99 08:49:22---------------------------------------------------
- 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 )
{
@@ -327,9 +297,6 @@ sal_uInt16 SwAuthorityFieldType::AppendField( const SwAuthEntry& rInsert )
return nRet;
}
-/*-- 11.10.99 08:49:24---------------------------------------------------
-
- -----------------------------------------------------------------------*/
long SwAuthorityFieldType::GetHandle(sal_uInt16 nPos)
{
long nRet = 0;
@@ -340,9 +307,7 @@ long SwAuthorityFieldType::GetHandle(sal_uInt16 nPos)
}
return nRet;
}
-/* -----------------19.10.99 13:46-------------------
- --------------------------------------------------*/
sal_uInt16 SwAuthorityFieldType::GetSequencePos(long nHandle)
{
//find the field in a sorted array of handles,
@@ -354,12 +319,11 @@ sal_uInt16 SwAuthorityFieldType::GetSequencePos(long nHandle)
if(!m_pSequArr->Count())
{
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())
@@ -373,7 +337,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 );
@@ -381,7 +345,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,
@@ -439,9 +403,7 @@ sal_uInt16 SwAuthorityFieldType::GetSequencePos(long nHandle)
ASSERT(bCurrentFieldWithoutTextNode || nRet, "Handle not found")
return nRet;
}
-/* -----------------------------15.11.00 17:33--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwAuthorityFieldType::QueryValue( Any& rVal, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
@@ -496,9 +458,7 @@ sal_Bool SwAuthorityFieldType::QueryValue( Any& rVal, sal_uInt16 nWhichId ) c
}
return sal_True;
}
-/* -----------------------------15.11.00 17:33--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwAuthorityFieldType::PutValue( const Any& rAny, sal_uInt16 nWhichId )
{
sal_Bool bRet = sal_True;
@@ -571,25 +531,19 @@ sal_Bool SwAuthorityFieldType::PutValue( const Any& rAny, sal_uInt16 nWhichId
}
return bRet;
}
-/* -----------------19.10.99 13:25-------------------
- --------------------------------------------------*/
-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 );
}
-/* -----------------20.10.99 13:38-------------------
- --------------------------------------------------*/
sal_uInt16 SwAuthorityFieldType::GetSortKeyCount() const
{
return m_pSortKeyArr->Count();
}
-/* -----------------20.10.99 13:38-------------------
- --------------------------------------------------*/
const SwTOXSortKey* SwAuthorityFieldType::GetSortKey(sal_uInt16 nIdx) const
{
SwTOXSortKey* pRet = 0;
@@ -598,9 +552,7 @@ const SwTOXSortKey* SwAuthorityFieldType::GetSortKey(sal_uInt16 nIdx) const
DBG_ASSERT(pRet, "Sort key not found");
return pRet;
}
-/* -----------------20.10.99 13:38-------------------
- --------------------------------------------------*/
void SwAuthorityFieldType::SetSortKeys(sal_uInt16 nKeyCount, SwTOXSortKey aKeys[])
{
m_pSortKeyArr->DeleteAndDestroy(0, m_pSortKeyArr->Count());
@@ -610,9 +562,6 @@ void SwAuthorityFieldType::SetSortKeys(sal_uInt16 nKeyCount, SwTOXSortKey aKeys[
m_pSortKeyArr->Insert(new SwTOXSortKey(aKeys[i]), nArrIdx++);
}
-/* -----------------14.09.99 16:15-------------------
-
- --------------------------------------------------*/
SwAuthorityField::SwAuthorityField( SwAuthorityFieldType* pInitType,
const String& rFieldContents )
: SwField(pInitType),
@@ -620,9 +569,7 @@ SwAuthorityField::SwAuthorityField( SwAuthorityFieldType* pInitType,
{
m_nHandle = pInitType->AddField( rFieldContents );
}
-/* -----------------17.09.99 14:24-------------------
- --------------------------------------------------*/
SwAuthorityField::SwAuthorityField( SwAuthorityFieldType* pInitType,
long nSetHandle )
: SwField( pInitType ),
@@ -631,16 +578,12 @@ SwAuthorityField::SwAuthorityField( SwAuthorityFieldType* pInitType,
{
pInitType->AddField( m_nHandle );
}
-/* -----------------15.09.99 15:00-------------------
- --------------------------------------------------*/
SwAuthorityField::~SwAuthorityField()
{
((SwAuthorityFieldType* )GetTyp())->RemoveField(m_nHandle);
}
-/*-- 14.09.99 16:20:59---------------------------------------------------
- -----------------------------------------------------------------------*/
String SwAuthorityField::Expand() const
{
SwAuthorityFieldType* pAuthType = (SwAuthorityFieldType*)GetTyp();
@@ -666,45 +609,33 @@ String SwAuthorityField::Expand() const
sRet += pAuthType->GetSuffix();
return sRet;
}
-/*-- 14.09.99 16:21:00---------------------------------------------------
- -----------------------------------------------------------------------*/
SwField* SwAuthorityField::Copy() const
{
SwAuthorityFieldType* pAuthType = (SwAuthorityFieldType*)GetTyp();
return new SwAuthorityField(pAuthType, m_nHandle);
}
-/* -----------------21.09.99 12:55-------------------
- --------------------------------------------------*/
const String& SwAuthorityField::GetFieldText(ToxAuthorityField eField) const
{
SwAuthorityFieldType* pAuthType = (SwAuthorityFieldType*)GetTyp();
const SwAuthEntry* pEntry = pAuthType->GetEntryByHandle( m_nHandle );
return pEntry->GetAuthorField( eField );
}
-/* -----------------21.09.99 14:57-------------------
- --------------------------------------------------*/
void SwAuthorityField::SetPar1(const String& rStr)
{
SwAuthorityFieldType* pInitType = (SwAuthorityFieldType* )GetTyp();
pInitType->RemoveField(m_nHandle);
m_nHandle = pInitType->AddField(rStr);
}
-/* -----------------11.10.99 09:43-------------------
- --------------------------------------------------*/
String SwAuthorityField::GetDescription() const
{
return SW_RES(STR_AUTHORITY_ENTRY);
}
-
-/* -----------------------------15.11.00 17:33--------------------------------
-
- ---------------------------------------------------------------------------*/
const char* aFieldNames[] =
{
"Identifier",
@@ -739,9 +670,7 @@ const char* aFieldNames[] =
"Custom5",
"ISBN"
};
-/* -----------------------------16.11.00 12:27--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwAuthorityField::QueryValue( Any& rAny, sal_uInt16 /*nWhichId*/ ) const
{
if(!GetTyp())
@@ -763,9 +692,7 @@ sal_Bool SwAuthorityField::QueryValue( Any& rAny, sal_uInt16 /*nWhichId*/ ) c
rAny <<= aRet;
return sal_False;
}
-/* -----------------------------15.11.00 17:33--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int16 lcl_Find(const OUString& rFieldName)
{
for(sal_Int16 i = 0; i < AUTH_FIELD_END; i++)
@@ -809,9 +736,7 @@ sal_Bool SwAuthorityField::PutValue( const Any& rAny, sal_uInt16 /*nWhichId*/
return sal_False;
}
-/* -----------------11.10.99 09:43-------------------
- --------------------------------------------------*/
SwFieldType* SwAuthorityField::ChgTyp( SwFieldType* pFldTyp )
{
SwAuthorityFieldType* pSrcTyp = (SwAuthorityFieldType*)GetTyp(),
diff --git a/sw/source/core/fields/cellfml.cxx b/sw/source/core/fields/cellfml.cxx
index b79fa353f1..e1f1d96f9b 100644
--- a/sw/source/core/fields/cellfml.cxx
+++ b/sw/source/core/fields/cellfml.cxx
@@ -720,29 +720,13 @@ const SwTable* SwTableFormula::FindTable( SwDoc& rDoc, const String& rNm ) const
return pRet;
}
-/* */
-
const SwFrm* lcl_GetBoxFrm( const SwTableBox& rBox )
{
-/*
-
- // oder besser ueber die Box den Frame suchen
-
- SwClientIter aIter( *pBox->GetFrmFmt() );
- sal_uLong nMinPos = ULONG_MAX;
- const SwFrm* pFnd = 0;
- for( SwFrm* pF = (SwFrm*)aIter.First( TYPE( SwCellFrm )); pF;
- pF = (SwFrm*)aIter.Next() )
- {
- if( pF->Frm().Y() <
- }
-*/
-
SwNodeIndex aIdx( *rBox.GetSttNd() );
SwCntntNode* pCNd = aIdx.GetNodes().GoNext( &aIdx );
ASSERT( 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 b21c15d983..bf507fe190 100644
--- a/sw/source/core/fields/dbfld.cxx
+++ b/sw/source/core/fields/dbfld.cxx
@@ -48,7 +48,7 @@
#include <expfld.hxx>
#include <txtatr.hxx>
#include <unofldmid.h>
-
+#include <switerator.hxx>
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star;
@@ -123,9 +123,6 @@ void SwDBFieldType::ReleaseRef()
}
}
-/* -----------------24.02.99 14:51-------------------
- *
- * --------------------------------------------------*/
sal_Bool SwDBFieldType::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
@@ -147,9 +144,7 @@ sal_Bool SwDBFieldType::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
}
return sal_True;
}
-/* -----------------24.02.99 14:51-------------------
- *
- * --------------------------------------------------*/
+
sal_Bool SwDBFieldType::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
switch( nWhichId )
@@ -167,8 +162,8 @@ sal_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?
@@ -179,7 +174,7 @@ sal_Bool SwDBFieldType::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
pDBField->ClearInitialized();
pDBField->InitContent();
}
- pFld = (SwFmtFld*)aIter.Next();
+ pFld = aIter.Next();
}
}
}
@@ -411,9 +406,7 @@ void SwDBField::SetSubType(sal_uInt16 nType)
nSubType = nType;
}
-/*-----------------06.03.98 16:15-------------------
---------------------------------------------------*/
sal_Bool SwDBField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
@@ -445,9 +438,7 @@ sal_Bool SwDBField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
return sal_True;
}
-/*-----------------06.03.98 16:15-------------------
---------------------------------------------------*/
sal_Bool SwDBField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
switch( nWhichId )
@@ -472,8 +463,8 @@ sal_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();
@@ -483,7 +474,7 @@ sal_Bool SwDBField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
pTxtFld->NotifyContentChange(*pFld);
break;
}
- pFld = (SwFmtFld*)aIter.Next();
+ pFld = aIter.Next();
}
}
}
@@ -551,9 +542,6 @@ String SwDBNameInfField::GetFieldName() const
return lcl_DBTrennConv(sStr);
}
-/*-----------------06.03.98 16:55-------------------
-
---------------------------------------------------*/
sal_Bool SwDBNameInfField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
@@ -578,9 +566,7 @@ sal_Bool SwDBNameInfField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) con
}
return sal_True;
}
-/*-----------------06.03.98 16:55-------------------
---------------------------------------------------*/
sal_Bool SwDBNameInfField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
switch( nWhichId )
@@ -612,16 +598,12 @@ sal_Bool SwDBNameInfField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
}
return sal_True;
}
-/* -----------------4/10/2003 15:03------------------
- --------------------------------------------------*/
sal_uInt16 SwDBNameInfField::GetSubType() const
{
return nSubType;
}
-/* -----------------4/10/2003 15:03------------------
- --------------------------------------------------*/
void SwDBNameInfField::SetSubType(sal_uInt16 nType)
{
nSubType = nType;
@@ -696,9 +678,7 @@ void SwDBNextSetField::SetPar1(const String& rStr)
{
aCond = rStr;
}
-/*-----------------06.03.98 16:16-------------------
---------------------------------------------------*/
sal_Bool SwDBNextSetField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
sal_Bool bRet = sal_True;
@@ -712,9 +692,7 @@ sal_Bool SwDBNextSetField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) con
}
return bRet;
}
-/*-----------------06.03.98 16:16-------------------
---------------------------------------------------*/
sal_Bool SwDBNextSetField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
sal_Bool bRet = sal_True;
@@ -730,21 +708,6 @@ sal_Bool SwDBNextSetField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
}
/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-/*
-String SwDBNextSetField::GetPar2() const
-{
- return GetDBName();
-}
-
-void SwDBNextSetField::SetPar2(const String& rStr)
-{
- GetDBName() = rStr;
-}
-*/
-
-/*--------------------------------------------------------------------
Beschreibung: Datensatz mit bestimmter ID
--------------------------------------------------------------------*/
@@ -832,9 +795,7 @@ void SwDBNumSetField::SetPar2(const String& rStr)
{
aPar2 = rStr;
}
-/*-----------------06.03.98 16:16-------------------
---------------------------------------------------*/
sal_Bool SwDBNumSetField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
sal_Bool bRet = sal_True;
@@ -851,9 +812,7 @@ sal_Bool SwDBNumSetField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) cons
}
return bRet;
}
-/*-----------------06.03.98 16:16-------------------
---------------------------------------------------*/
sal_Bool SwDBNumSetField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
sal_Bool bRet = sal_True;
@@ -933,16 +892,12 @@ SwField* SwDBNameField::Copy() const
return pTmp;
}
-/*-----------------06.03.98 16:16-------------------
---------------------------------------------------*/
sal_Bool SwDBNameField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
return SwDBNameInfField::QueryValue(rAny, nWhichId );
}
-/*-----------------06.03.98 16:16-------------------
---------------------------------------------------*/
sal_Bool SwDBNameField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
return SwDBNameInfField::PutValue(rAny, nWhichId );
@@ -984,7 +939,6 @@ String SwDBSetNumberField::Expand() const
return aEmptyStr;
else
return FormatNumber((sal_uInt16)nNumber, GetFormat());
- //return(nNumber == 0 ? aEmptyStr : FormatNumber(nNumber, GetFormat()));
}
//------------------------------------------------------------------------------
@@ -1012,9 +966,7 @@ SwField* SwDBSetNumberField::Copy() const
pTmp->SetSubType(GetSubType());
return pTmp;
}
-/*-----------------06.03.98 16:15-------------------
---------------------------------------------------*/
sal_Bool SwDBSetNumberField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
sal_Bool bRet = sal_True;
@@ -1031,9 +983,7 @@ sal_Bool SwDBSetNumberField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) c
}
return bRet;
}
-/*-----------------06.03.98 16:15-------------------
---------------------------------------------------*/
sal_Bool SwDBSetNumberField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
sal_Bool bRet = sal_True;
diff --git a/sw/source/core/fields/ddefld.cxx b/sw/source/core/fields/ddefld.cxx
index ab503bffb0..0b8d269101 100644
--- a/sw/source/core/fields/ddefld.cxx
+++ b/sw/source/core/fields/ddefld.cxx
@@ -40,9 +40,7 @@
#include <swtable.hxx>
#include <swbaslnk.hxx>
#include <swddetbl.hxx>
-#ifndef _UNOFLDMID_H
#include <unofldmid.h>
-#endif
#include <hints.hxx>
using rtl::OUString;
@@ -124,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 {
@@ -139,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++ ));
@@ -186,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 {
@@ -213,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 {
@@ -319,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
@@ -401,8 +399,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 00a5b08ac7..f940c6d465 100644
--- a/sw/source/core/fields/ddetbl.cxx
+++ b/sw/source/core/fields/ddetbl.cxx
@@ -39,7 +39,7 @@
#include <ndindex.hxx>
#include <fldupde.hxx>
#include <swtblfmt.hxx>
-
+#include <fieldhint.hxx>
TYPEINIT1( SwDDETable, SwTable );
@@ -62,10 +62,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)
@@ -91,7 +93,7 @@ __EXPORT 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();
@@ -99,6 +101,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()
{
ASSERT( GetFrmFmt(), "Kein FrameFormat" );
@@ -176,7 +186,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 a6557e8144..f01af4519d 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 ))
{
@@ -249,9 +247,6 @@ sal_uInt16 SwPageNumberField::GetSubType() const
return nSubType;
}
-/*-----------------05.03.98 10:25-------------------
-
---------------------------------------------------*/
sal_Bool SwPageNumberField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
@@ -282,9 +277,7 @@ sal_Bool SwPageNumberField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) co
}
return sal_True;
}
-/*-----------------05.03.98 10:25-------------------
---------------------------------------------------*/
sal_Bool SwPageNumberField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
sal_Bool bRet = sal_True;
@@ -383,9 +376,6 @@ SwField* SwAuthorField::Copy() const
return pTmp;
}
-/*-----------------05.03.98 11:15-------------------
-
---------------------------------------------------*/
sal_Bool SwAuthorField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
sal_Bool bVal;
@@ -410,9 +400,7 @@ sal_Bool SwAuthorField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
}
return sal_True;
}
-/*-----------------05.03.98 11:15-------------------
---------------------------------------------------*/
sal_Bool SwAuthorField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
switch( nWhichId )
@@ -529,9 +517,6 @@ SwField* SwFileNameField::Copy() const
return pTmp;
}
-/*-----------------05.03.98 08:59-------------------
-
---------------------------------------------------*/
sal_Bool SwFileNameField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
@@ -571,9 +556,7 @@ sal_Bool SwFileNameField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) cons
}
return sal_True;
}
-/*-----------------05.03.98 09:01-------------------
---------------------------------------------------*/
sal_Bool SwFileNameField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
switch( nWhichId )
@@ -705,9 +688,6 @@ SwField* SwTemplNameField::Copy() const
return pTmp;
}
-/*-----------------05.03.98 08:59-------------------
-
---------------------------------------------------*/
sal_Bool SwTemplNameField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch ( nWhichId )
@@ -733,9 +713,7 @@ sal_Bool SwTemplNameField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) con
}
return sal_True;
}
-/*-----------------05.03.98 09:01-------------------
---------------------------------------------------*/
sal_Bool SwTemplNameField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
switch ( nWhichId )
@@ -796,8 +774,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;
@@ -860,9 +838,6 @@ void SwDocStatField::ChangeExpansion( const SwFrm* pFrm )
pFrm->FindPageFrm()->GetPageDesc()->GetNumType().GetNumberingType() );
}
-/*-----------------05.03.98 11:38-------------------
-
---------------------------------------------------*/
sal_Bool SwDocStatField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch ( nWhichId )
@@ -875,9 +850,7 @@ sal_Bool SwDocStatField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
}
return sal_True;
}
-/*-----------------05.03.98 11:38-------------------
---------------------------------------------------*/
sal_Bool SwDocStatField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
sal_Bool bRet = sal_False;
@@ -912,9 +885,7 @@ SwDocInfoFieldType::SwDocInfoFieldType(SwDoc* pDc)
{
}
-/* ---------------------------------------------------------------------------
-
- ---------------------------------------------------------------------------*/
+// ---------------------------------------------------------------------------
SwFieldType* SwDocInfoFieldType::Copy() const
{
SwDocInfoFieldType* pTyp = new SwDocInfoFieldType(GetDoc());
@@ -934,9 +905,7 @@ 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
{
@@ -1084,9 +1053,7 @@ 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)
{
@@ -1101,9 +1068,8 @@ SwDocInfoField::SwDocInfoField(SwDocInfoFieldType* pTyp, sal_uInt16 nSub, const
aContent = rValue;
}
-/* ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
template<class T>
double lcl_TimeToDouble( const T& rTime )
{
@@ -1743,9 +1709,7 @@ SwField* SwHiddenParaField::Copy() const
return pFld;
}
-/*-----------------05.03.98 13:25-------------------
---------------------------------------------------*/
sal_Bool SwHiddenParaField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch ( nWhichId )
@@ -1765,9 +1729,7 @@ sal_Bool SwHiddenParaField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) co
}
return sal_True;
}
-/*-----------------05.03.98 13:25-------------------
---------------------------------------------------*/
sal_Bool SwHiddenParaField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
switch ( nWhichId )
@@ -1908,9 +1870,6 @@ sal_uInt32 SwPostItField::GetNumberOfParagraphs() const
return (mpText) ? mpText->Count() : 1;
}
-/*-----------------05.03.98 13:42-------------------
-
---------------------------------------------------*/
sal_Bool SwPostItField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
@@ -1971,10 +1930,6 @@ sal_Bool SwPostItField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
return sal_True;
}
-
-/*-----------------05.03.98 13:42-------------------
-
---------------------------------------------------*/
sal_Bool SwPostItField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
switch( nWhichId )
@@ -2116,9 +2071,6 @@ void SwExtUserField::SetSubType(sal_uInt16 nSub)
nType = nSub;
}
-/*-----------------05.03.98 14:14-------------------
-
---------------------------------------------------*/
sal_Bool SwExtUserField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
@@ -2144,9 +2096,7 @@ sal_Bool SwExtUserField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
}
return sal_True;
}
-/*-----------------05.03.98 14:14-------------------
---------------------------------------------------*/
sal_Bool SwExtUserField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
switch( nWhichId )
@@ -2194,7 +2144,7 @@ SwFieldType* SwRefPageSetFieldType::Copy() const
---------------------------------------------------------------------------*/
// ueberlagert, weil es nichts zum Updaten gibt!
-void SwRefPageSetFieldType::Modify( SfxPoolItem *, SfxPoolItem * )
+void SwRefPageSetFieldType::Modify( const SfxPoolItem*, const SfxPoolItem * )
{
}
@@ -2236,9 +2186,6 @@ void SwRefPageSetField::SetPar2(const String& rStr)
SetOffset( (short) rStr.ToInt32() );
}
-/*-----------------05.03.98 14:52-------------------
-
---------------------------------------------------*/
sal_Bool SwRefPageSetField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
@@ -2254,9 +2201,7 @@ sal_Bool SwRefPageSetField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) co
}
return sal_True;
}
-/*-----------------05.03.98 14:52-------------------
---------------------------------------------------*/
sal_Bool SwRefPageSetField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
switch( nWhichId )
@@ -2292,7 +2237,7 @@ SwFieldType* SwRefPageGetFieldType::Copy() const
/* ---------------------------------------------------------------------------
---------------------------------------------------------------------------*/
-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() )
@@ -2301,30 +2246,26 @@ 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 )
{
@@ -2332,7 +2273,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;
@@ -2364,7 +2305,7 @@ sal_uInt16 SwRefPageGetFieldType::MakeSetList( _SetGetExpFlds& rTmpLst )
if( !rTmpLst.Insert( pNew ))
delete pNew;
}
- } while( aIter++ );
+ }
return rTmpLst.Count();
}
@@ -2397,8 +2338,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() -
@@ -2416,7 +2357,7 @@ void SwRefPageGetFieldType::UpdateField( SwTxtFld* pTxtFld,
}
}
// dann die Formatierung anstossen
- ((SwFmtFld&)pTxtFld->GetFld()).Modify( 0, 0 );
+ ((SwFmtFld&)pTxtFld->GetFld()).ModifyNotification( 0, 0 );
}
/*--------------------------------------------------------------------
@@ -2491,7 +2432,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
@@ -2507,9 +2448,7 @@ void SwRefPageGetField::ChangeExpansion( const SwFrm* pFrm,
pGetFld->SetText( FormatNumber( nPageNum, nTmpFmt ) );
}
}
-/*-----------------05.03.98 14:52-------------------
---------------------------------------------------*/
sal_Bool SwRefPageGetField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
@@ -2525,9 +2464,7 @@ sal_Bool SwRefPageGetField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) co
}
return sal_True;
}
-/*-----------------05.03.98 14:52-------------------
---------------------------------------------------*/
sal_Bool SwRefPageGetField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
switch( nWhichId )
@@ -2643,9 +2580,6 @@ void SwJumpEditField::SetPar2(const String& rStr)
sHelp = rStr;
}
-/*-----------------05.03.98 15:00-------------------
-
---------------------------------------------------*/
sal_Bool SwJumpEditField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
@@ -2677,9 +2611,7 @@ sal_Bool SwJumpEditField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) cons
}
return sal_True;
}
-/*-----------------05.03.98 15:00-------------------
---------------------------------------------------*/
sal_Bool SwJumpEditField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
switch( nWhichId )
diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx
index dfef916e33..9404cc9a36 100644
--- a/sw/source/core/fields/expfld.cxx
+++ b/sw/source/core/fields/expfld.cxx
@@ -63,6 +63,7 @@
#include <SwStyleNameMapper.hxx>
#include <unofldmid.h>
#include <numrule.hxx>
+#include <switerator.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::text;
@@ -284,10 +285,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
}
@@ -425,9 +426,6 @@ void SwGetExpField::SetLanguage(sal_uInt16 nLng)
SwValueField::SetLanguage(nLng);
}
-/*-----------------07.03.98 16:08-------------------
-
---------------------------------------------------*/
sal_Bool SwGetExpField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
@@ -464,9 +462,7 @@ sal_Bool SwGetExpField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
}
return sal_True;
}
-/*-----------------07.03.98 16:08-------------------
---------------------------------------------------*/
sal_Bool SwGetExpField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
sal_Int32 nTmp = 0;
@@ -507,10 +503,6 @@ sal_Bool SwGetExpField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
return sal_True;
}
-/*-----------------JP: 17.06.93 -------------------
- Set-Expression-Type
- --------------------------------------------------*/
-
SwSetExpFieldType::SwSetExpFieldType( SwDoc* pDc, const String& rName, sal_uInt16 nTyp )
: SwValueFieldType( pDc, RES_SETEXPFLD ),
sName( rName ),
@@ -538,16 +530,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 );
}
@@ -572,10 +563,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() )
@@ -610,10 +600,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() )
@@ -657,9 +646,6 @@ void SwSetExpFieldType::SetChapter( SwSetExpField& rFld, const SwNode& rNd )
}
}
-/* -----------------24.03.99 09:44-------------------
- *
- * --------------------------------------------------*/
sal_Bool SwSetExpFieldType::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
@@ -909,7 +895,7 @@ void SwGetExpField::SetValue( const double& rAny )
sExpand = ((SwValueFieldType*)GetTyp())->ExpandValue( rAny, GetFormat(),
GetLanguage());
}
-/* -----------------14.07.99 12:21-------------------
+/* -------------------------------------------------
Description: Find the index of the reference text
following the current field
--------------------------------------------------*/
@@ -1060,9 +1046,6 @@ String SwInputField::Expand() const
return sRet;
}
-/*-----------------06.03.98 11:12-------------------
-
---------------------------------------------------*/
sal_Bool SwInputField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
@@ -1084,9 +1067,7 @@ sal_Bool SwInputField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
}
return sal_True;
}
-/*-----------------06.03.98 11:12-------------------
---------------------------------------------------*/
sal_Bool SwInputField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
switch( nWhichId )
@@ -1170,9 +1151,7 @@ void SwInputField::SetSubType(sal_uInt16 nSub)
{
nSubType = nSub;
}
-/*-----------------05.03.98 17:22-------------------
---------------------------------------------------*/
sal_Bool SwSetExpField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
@@ -1237,9 +1216,7 @@ sal_Bool SwSetExpField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
}
return sal_True;
}
-/*-----------------05.03.98 17:22-------------------
---------------------------------------------------*/
sal_Bool SwSetExpField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
sal_Int32 nTmp32 = 0;
diff --git a/sw/source/core/fields/fldlst.cxx b/sw/source/core/fields/fldlst.cxx
index 7ce67cb4b5..9a458196e2 100644
--- a/sw/source/core/fields/fldlst.cxx
+++ b/sw/source/core/fields/fldlst.cxx
@@ -28,7 +28,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>
@@ -63,10 +63,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();
@@ -161,9 +159,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 dfa750630a..3fb83e187f 100644
--- a/sw/source/core/fields/postithelper.cxx
+++ b/sw/source/core/fields/postithelper.cxx
@@ -47,7 +47,7 @@
#include <redline.hxx>
#include <scriptinfo.hxx>
#include <editeng/charhiddenitem.hxx>
-
+#include <switerator.hxx>
namespace {
@@ -93,9 +93,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 ff5bcde06a..11d0034730 100644
--- a/sw/source/core/fields/reffld.cxx
+++ b/sw/source/core/fields/reffld.cxx
@@ -57,9 +57,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>
@@ -70,6 +68,7 @@
#include <comcore.hrc>
#include <numrule.hxx>
#include <SwNodeNum.hxx>
+#include <switerator.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::text;
@@ -105,8 +104,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();
@@ -392,7 +391,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();
@@ -414,7 +413,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;
@@ -577,9 +576,6 @@ String SwGetRefField::GetPar2() const
return Expand();
}
-/*-----------------06.03.98 13:34-------------------
-
---------------------------------------------------*/
sal_Bool SwGetRefField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
@@ -651,9 +647,7 @@ sal_Bool SwGetRefField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
}
return sal_True;
}
-/*-----------------06.03.98 13:34-------------------
---------------------------------------------------*/
sal_Bool SwGetRefField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
String sTmp;
@@ -728,9 +722,7 @@ sal_Bool SwGetRefField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
}
return sal_True;
}
-/* -----------------------------11.01.2002 12:50------------------------------
- ---------------------------------------------------------------------------*/
void SwGetRefField::ConvertProgrammaticToUIName()
{
if(GetTyp() && REF_SEQUENCEFLD == nSubType)
@@ -762,10 +754,6 @@ void SwGetRefField::ConvertProgrammaticToUIName()
}
}
}
-/*-----------------JP: 18.06.93 -------------------
- Get-Referenz-Type
- --------------------------------------------------*/
-
SwGetRefFieldType::SwGetRefFieldType( SwDoc* pDc )
: SwFieldType( RES_GETREFFLD ), pDoc( pDc )
@@ -778,14 +766,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
@@ -805,7 +792,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,
@@ -836,9 +823,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() )
@@ -949,22 +935,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() )
@@ -1010,12 +994,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 );
@@ -1053,11 +1036,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 08689d25c7..602c28bc5e 100644
--- a/sw/source/core/fields/tblcalc.cxx
+++ b/sw/source/core/fields/tblcalc.cxx
@@ -28,7 +28,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
@@ -39,7 +39,6 @@
#include <docfld.hxx> // fuer _SetGetExpFld
#include <unofldmid.h>
-
using namespace ::com::sun::star;
using ::rtl::OUString;
@@ -104,15 +103,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;
}
@@ -187,9 +181,6 @@ void SwTblField::SetPar2(const String& rStr)
}
-/*-----------------04.03.98 10:33-------------------
-
---------------------------------------------------*/
sal_Bool SwTblField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
sal_Bool bRet = sal_True;
@@ -221,9 +212,7 @@ sal_Bool SwTblField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
}
return bRet;
}
-/*-----------------04.03.98 10:33-------------------
---------------------------------------------------*/
sal_Bool SwTblField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
sal_Bool bRet = sal_True;
diff --git a/sw/source/core/fields/usrfld.cxx b/sw/source/core/fields/usrfld.cxx
index d6ea9519cc..28ec8b9a17 100644
--- a/sw/source/core/fields/usrfld.cxx
+++ b/sw/source/core/fields/usrfld.cxx
@@ -232,12 +232,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 7ca08d4939..93ece79e7b 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -268,7 +268,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 518e982751..ddf594bc3e 100644
--- a/sw/source/core/frmedt/fedesc.cxx
+++ b/sw/source/core/frmedt/fedesc.cxx
@@ -240,14 +240,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 767ce95427..9b5b153177 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -115,7 +115,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 );
@@ -178,9 +178,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() )
@@ -297,7 +297,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;
}
@@ -361,7 +361,7 @@ const SwFrmFmt* SwFEShell::IsFlyInFly()
// OD 01.07.2003 #108784# - determine text frame by left-top-corner
// of object
//pTxtFrm = aPos.nNode.GetNode().GetCntntNode()->GetFrm( 0, 0, sal_False );
- 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();
@@ -492,7 +492,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 )
@@ -943,8 +943,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 );
@@ -1012,7 +1012,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 )
@@ -1780,7 +1780,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;
@@ -1899,6 +1899,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 ce1c42d4bc..f40804bf53 100644
--- a/sw/source/core/frmedt/feflyole.cxx
+++ b/sw/source/core/frmedt/feflyole.cxx
@@ -80,7 +80,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 2b1ba69092..adf0d7e5f2 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -49,7 +49,6 @@
#include <editeng/protitem.hxx>
#include <svx/svdpage.hxx>
#include <svx/svdpagv.hxx>
-
#include <IDocumentSettingAccess.hxx>
#include <cmdid.h>
#include <poolfmt.hrc> // fuer InitFldTypes
@@ -87,12 +86,10 @@
#include "txtfrm.hxx"
#include "txatbase.hxx"
#include "mdiexp.hxx" // fuer Update der Statuszeile bei drag
-// OD 2004-05-24 #i28701#
#include <sortedobjs.hxx>
-// --> OD 2006-03-06 #125892#
#include <HandleAnchorNodeChg.hxx>
-// <--
#include <basegfx/polygon/b2dpolygon.hxx>
+#include <switerator.hxx>
#define SCROLLVAL 75
@@ -109,7 +106,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;
@@ -144,10 +141,6 @@ extern sal_Bool bNoInterrupt; // in swapp.cxx
/*************************************************************************
|*
|* SwFEShell::SelectObj()
-|*
-|* Ersterstellung MA 16. Nov. 92
-|* Letzte Aenderung MA 22. Oct. 96
-|*
*************************************************************************/
sal_Bool SwFEShell::SelectObj( const Point& rPt, sal_uInt8 nFlag, SdrObject *pObj )
@@ -270,9 +263,6 @@ sal_Bool SwFEShell::SelectObj( const Point& rPt, sal_uInt8 nFlag, SdrObject *pOb
|*
|* sal_Bool SwFEShell::MoveAnchor( sal_uInt16 nDir )
|*
-|* Created AMA 05/28/2002
-|* Last modify AMA 05/30/2002
-|*
|* Description: MoveAnchor( nDir ) looked for an another Anchor for
|* the selected drawing object (or fly frame) in the given direction.
|* An object "as character" doesn't moves anyway.
@@ -544,9 +534,6 @@ sal_Bool SwFEShell::MoveAnchor( sal_uInt16 nDir )
|*
|* SwFEShell::GetSelFrmType()
|*
-|* Ersterstellung MA 12. Jan. 93
-|* Letzte Aenderung JP 19.03.96
-|*
*************************************************************************/
const SdrMarkList* SwFEShell::_GetMarkList() const
@@ -602,7 +589,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;
}
@@ -611,9 +598,6 @@ bool SwFEShell::IsSelContainsControl() const
|*
|* SwFEShell::Scroll()
|*
-|* Ersterstellung MA 20. Dec. 94
-|* Letzte Aenderung MA 27. Jul. 95
-|*
*************************************************************************/
void SwFEShell::ScrollTo( const Point &rPt )
@@ -632,9 +616,6 @@ void SwFEShell::ScrollTo( const Point &rPt )
|*
|* SwFEShell::SetDragMode()
|*
-|* Ersterstellung MA 30. Jan. 95
-|* Letzte Aenderung MA 30. Jan. 95
-|*
*************************************************************************/
void SwFEShell::SetDragMode( sal_uInt16 eDragMode )
@@ -647,9 +628,6 @@ void SwFEShell::SetDragMode( sal_uInt16 eDragMode )
|*
|* SwFEShell::BeginDrag()
|*
-|* Ersterstellung MS 10.06.92
-|* Letzte Aenderung MA 13. Mar. 96
-|*
*************************************************************************/
long SwFEShell::BeginDrag( const Point* pPt, sal_Bool )
@@ -669,9 +647,6 @@ long SwFEShell::BeginDrag( const Point* pPt, sal_Bool )
|*
|* SwFEShell::Drag()
|*
-|* Ersterstellung MS 10.06.92
-|* Letzte Aenderung MA 13. Mar. 96
-|*
*************************************************************************/
long SwFEShell::Drag( const Point *pPt, sal_Bool )
@@ -692,9 +667,6 @@ long SwFEShell::Drag( const Point *pPt, sal_Bool )
|*
|* SwFEShell::EndDrag()
|*
-|* Ersterstellung MS 10.06.92
-|* Letzte Aenderung MA 13. Mar. 96
-|*
*************************************************************************/
long SwFEShell::EndDrag( const Point *, sal_Bool )
@@ -721,7 +693,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 );
@@ -745,9 +717,6 @@ long SwFEShell::EndDrag( const Point *, sal_Bool )
|*
|* SwFEShell::BreakDrag()
|*
-|* Ersterstellung OM 02. Okt. 95
-|* Letzte Aenderung OM 02. Okt. 95
-|*
*************************************************************************/
void SwFEShell::BreakDrag()
@@ -764,9 +733,6 @@ void SwFEShell::BreakDrag()
|*
|* Beschreibung Wenn ein Fly selektiert ist, zieht er den Crsr in
|* den ersten CntntFrm
-|* Ersterstellung MA 11. Dec. 92
-|* Letzte Aenderung MA 07. Oct. 96
-|*
*************************************************************************/
const SwFrmFmt* SwFEShell::SelFlyGrabCrsr()
@@ -778,8 +744,6 @@ const SwFrmFmt* SwFEShell::SelFlyGrabCrsr()
if( pFly )
{
- // --> OD 2004-06-11 #i28701# - no format here
-// pFly->GetAnchorFrm()->Calc();
SwCntntFrm *pCFrm = pFly->ContainsCntnt();
if ( pCFrm )
{
@@ -812,9 +776,6 @@ const SwFrmFmt* SwFEShell::SelFlyGrabCrsr()
|*
|* Beschreibung Selektion nach oben/unten (Z-Order)
|*
-|* Ersterstellung MA 05. Nov. 92
-|* Letzte Aenderung MA 03. Jun. 96
-|*
*************************************************************************/
void lcl_NotifyNeighbours( const SdrMarkList *pLst )
@@ -944,9 +905,6 @@ void SwFEShell::SelectionToBottom( sal_Bool bBottom )
|*
|* Beschreibung Objekt ueber/unter dem Dokument?
|* 2 Controls, 1 Heaven, 0 Hell, -1 Uneindeutig
-|* Ersterstellung MA 20. Dec. 94
-|* Letzte Aenderung MA 20. Dec. 94
-|*
*************************************************************************/
short SwFEShell::GetLayerId() const
@@ -958,6 +916,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() )
@@ -977,8 +937,6 @@ short SwFEShell::GetLayerId() const
|* SwFEShell::SelectionToHeaven(), SelectionToHell()
|*
|* Beschreibung Objekt ueber/unter dem Dokument
-|* Ersterstellung MA 20. Dec. 94
-|* Letzte Aenderung AMA 04. Jun. 98
|*
*************************************************************************/
// OD 25.06.2003 #108784#
@@ -995,6 +953,8 @@ void SwFEShell::ChangeOpaque( SdrLayerID nLayerId )
for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i )
{
SdrObject* pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
+ if( !pObj )
+ continue;
// OD 21.08.2003 #i18447# - no change of layer for controls
// or group objects containing controls.
// --> OD 2010-09-14 #i113730#
@@ -1036,9 +996,6 @@ void SwFEShell::SelectionToHell()
|*
|* SwFEShell::IsObjSelected(), IsFrmSelected()
|*
-|* Ersterstellung MA 16. Nov. 92
-|* Letzte Aenderung MA 17. Jan. 95
-|*
*************************************************************************/
sal_uInt16 SwFEShell::IsObjSelected() const
@@ -1071,9 +1028,6 @@ sal_Bool SwFEShell::IsObjSelected( const SdrObject& rObj ) const
|*
|* SwFEShell::EndTextEdit()
|*
-|* Ersterstellung MA 19. Feb. 96
-|* Letzte Aenderung MA 19. Feb. 96
-|*
*************************************************************************/
void SwFEShell::EndTextEdit()
@@ -1132,9 +1086,6 @@ void SwFEShell::EndTextEdit()
|*
|* SwFEShell::IsInsideSelectedObj()
|*
-|* Ersterstellung MA 16. Nov. 92
-|* Letzte Aenderung MA 08. Nov. 96
-|*
*************************************************************************/
int SwFEShell::IsInsideSelectedObj( const Point &rPt )
@@ -1156,9 +1107,6 @@ int SwFEShell::IsInsideSelectedObj( const Point &rPt )
|*
|* SwFEShell::IsObjSelectable()
|*
-|* Ersterstellung MA 16. Nov. 92
-|* Letzte Aenderung MA 02. Feb. 95
-|*
*************************************************************************/
bool SwFEShell::IsObjSelectable( const Point& rPt )
@@ -1290,11 +1238,9 @@ sal_Bool SwFEShell::ShouldObjectBeSelected(const Point& rPt)
|*
|* Beschreibung Wenn ein Obj selektiert ist, gehen wir von dessen
|* TopLeft aus, andernfalls von der Mitte des aktuellen CharRects.
-|* Ersterstellung MA 01. Jun. 95
-|* Letzte Aenderung MA 30. Apr. 96
|*
*************************************************************************/
-/* -----------------23.09.98 10:29-------------------
+/* ------------------------------------
* Beinhaltet das Objekt ein Control oder Gruppen,
* die nur aus Controls bestehen
* --------------------------------------------------*/
@@ -1541,9 +1487,6 @@ sal_Bool SwFEShell::GotoObj( sal_Bool bNext, sal_uInt16 /*GOTOOBJ_...*/ eType )
|*
|* SwFEShell::BeginCreate()
|*
-|* Ersterstellung MA 20. Dec. 94
-|* Letzte Aenderung MA 21. Mar. 95
-|*
*************************************************************************/
sal_Bool SwFEShell::BeginCreate( sal_uInt16 /*SdrObjKind ?*/ eSdrObjectKind, const Point &rPos )
@@ -1592,9 +1535,6 @@ sal_Bool SwFEShell::BeginCreate( sal_uInt16 /*SdrObjKind ?*/ eSdrObjectKind, sa
|*
|* SwFEShell::MoveCreate()
|*
-|* Ersterstellung MA 20. Dec. 94
-|* Letzte Aenderung MA 24. Jan. 95
-|*
*************************************************************************/
void SwFEShell::MoveCreate( const Point &rPos )
@@ -1612,14 +1552,11 @@ void SwFEShell::MoveCreate( const Point &rPos )
|*
|* SwFEShell::EndCreate(), ImpEndCreate()
|*
-|* Ersterstellung MA 20. Dec. 94
-|* Letzte Aenderung MA 14. Oct. 96
-|*
*************************************************************************/
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
ASSERT( Imp()->HasDrawView(), "EndCreate without DrawView?" );
@@ -1655,7 +1592,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();
@@ -1697,12 +1634,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 );
@@ -1744,13 +1681,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 )
{
@@ -1783,7 +1720,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?
@@ -1992,9 +1929,6 @@ sal_Bool SwFEShell::ImpEndCreate()
|*
|* SwFEShell::BreakCreate()
|*
-|* Ersterstellung MA 20. Dec. 94
-|* Letzte Aenderung MA 09. Jan. 95
-|*
*************************************************************************/
void SwFEShell::BreakCreate()
@@ -2008,9 +1942,6 @@ void SwFEShell::BreakCreate()
|*
|* SwFEShell::IsDrawCreate()
|*
-|* Ersterstellung OM 16. Mar. 95
-|* Letzte Aenderung OM 16. Mar. 95
-|*
*************************************************************************/
sal_Bool SwFEShell::IsDrawCreate() const
@@ -2022,9 +1953,6 @@ sal_Bool SwFEShell::IsDrawCreate() const
|*
|* SwFEShell::BeginMark()
|*
-|* Ersterstellung OM 07. Feb. 95
-|* Letzte Aenderung OM 07. Feb. 95
-|*
*************************************************************************/
sal_Bool SwFEShell::BeginMark( const Point &rPos )
@@ -2049,9 +1977,6 @@ sal_Bool SwFEShell::BeginMark( const Point &rPos )
|*
|* SwFEShell::MoveMark()
|*
-|* Ersterstellung OM 07. Feb. 95
-|* Letzte Aenderung OM 07. Feb. 95
-|*
*************************************************************************/
void SwFEShell::MoveMark( const Point &rPos )
@@ -2077,9 +2002,6 @@ void SwFEShell::MoveMark( const Point &rPos )
|*
|* SwFEShell::EndMark()
|*
-|* Ersterstellung OM 07. Feb. 95
-|* Letzte Aenderung MA 08. Feb. 95
-|*
*************************************************************************/
sal_Bool SwFEShell::EndMark()
@@ -2145,9 +2067,6 @@ sal_Bool SwFEShell::EndMark()
|*
|* SwFEShell::BreakSelect()
|*
-|* Ersterstellung OM 07. Feb. 95
-|* Letzte Aenderung OM 07. Feb. 95
-|*
*************************************************************************/
void SwFEShell::BreakMark()
@@ -2160,9 +2079,6 @@ void SwFEShell::BreakMark()
|*
|* SwFEShell::GetAnchorId()
|*
-|* Ersterstellung MA 30. Jan. 95
-|* Letzte Aenderung MA 30. Jan. 95
-|*
*************************************************************************/
short SwFEShell::GetAnchorId() const
@@ -2199,9 +2115,6 @@ short SwFEShell::GetAnchorId() const
|*
|* SwFEShell::ChgAnchor()
|*
-|* Ersterstellung MA 10. Jan. 95
-|* Letzte Aenderung MA 30. May. 96
-|*
*************************************************************************/
void SwFEShell::ChgAnchor( int eAnchorId, sal_Bool bSameOnly, sal_Bool bPosCorr )
@@ -2226,9 +2139,6 @@ void SwFEShell::ChgAnchor( int eAnchorId, sal_Bool bSameOnly, sal_Bool bPosCorr
|*
|* SwFEShell::DelSelectedObj()
|*
-|* Ersterstellung MA 03. Nov. 92
-|* Letzte Aenderung MA 14. Nov. 95
-|*
*************************************************************************/
void SwFEShell::DelSelectedObj()
@@ -2249,8 +2159,6 @@ void SwFEShell::DelSelectedObj()
|*
|* Beschreibung Fuer die Statuszeile zum Erfragen der aktuellen
|* Verhaeltnisse
-|* Ersterstellung MA 25. Apr. 95
-|* Letzte Aenderung MA 25. Apr. 95
|*
*************************************************************************/
@@ -2308,9 +2216,6 @@ Point SwFEShell::GetObjAbsPos() const
|*
|* SwFEShell::IsGroupSelected()
|*
-|* Ersterstellung MA 30. Jan. 95
-|* Letzte Aenderung MA 30. May. 96
-|*
*************************************************************************/
sal_Bool SwFEShell::IsGroupSelected()
@@ -2421,8 +2326,6 @@ bool SwFEShell::IsGroupAllowed() const
|*
|* Beschreibung Die Gruppe bekommt den Anker und das Contactobjekt
|* des ersten in der Selektion
-|* Ersterstellung MA 30. Jan. 95
-|* Letzte Aenderung MA 23. Apr. 95
|*
*************************************************************************/
@@ -2446,8 +2349,6 @@ void SwFEShell::GroupSelection()
|*
|* Beschreibung Die Einzelobjekte bekommen eine Kopie vom Anker und
|* Contactobjekt der Gruppe.
-|* Ersterstellung MA 30. Jan. 95
-|* Letzte Aenderung MA 01. Feb. 95
|*
*************************************************************************/
@@ -2469,9 +2370,6 @@ void SwFEShell::UnGroupSelection()
|*
|* SwFEShell::MirrorSelection()
|*
-|* Ersterstellung MA 06. Aug. 95
-|* Letzte Aenderung MA 06. Aug. 95
-|*
*************************************************************************/
void SwFEShell::MirrorSelection( sal_Bool bHorizontal )
@@ -2503,14 +2401,12 @@ static sal_uInt8 __READONLY_DATA aChkArr[ 4 ] = {
{
SET_CURR_SHELL( this );
- SwClientIter aIter( *(SwModify*)pFlyFmt );
- SwFlyFrm* pFrm = (SwFlyFrm*)aIter.First( TYPE( SwFlyFrm ));
+ SwFlyFrm* pFrm = SwIterator<SwFlyFrm,SwFmt>::FirstElement( *pFlyFmt );
if( pFrm )
{
- ASSERT( 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() );
}
@@ -2809,9 +2705,7 @@ int SwFEShell::Chainable( SwRect &rRect, const SwFrmFmt &rSource,
}
return SW_CHAIN_NOT_FOUND;
}
-/* -----------------------------09.08.2002 07:40------------------------------
- ---------------------------------------------------------------------------*/
int SwFEShell::Chain( SwFrmFmt &rSource, const SwFrmFmt &rDest )
{
return GetDoc()->Chain(rSource, rDest);
@@ -2920,30 +2814,20 @@ 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;
}
-/* -----------------------------2002/06/24 15:07------------------------------
- ---------------------------------------------------------------------------*/
void SwFEShell::CreateDefaultShape( sal_uInt16 /*SdrObjKind ?*/ eSdrObjectKind, const Rectangle& rRect,
sal_uInt16 nSlotId)
{
@@ -3230,9 +3114,7 @@ bool SwFEShell::IsShapeDefaultHoriTextDirR2L() const
return bRet;
}
-/* -----------------20.03.2003 14:35-----------------
- --------------------------------------------------*/
Point SwFEShell::GetRelativePagePosition(const Point& rDocPos)
{
Point aRet(-1, -1);
diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx
index 36db99ad4d..36ec159eae 100644
--- a/sw/source/core/frmedt/fetab.cxx
+++ b/sw/source/core/frmedt/fetab.cxx
@@ -1167,7 +1167,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 e5cf0e206a..0f136c91aa 100644
--- a/sw/source/core/frmedt/fews.cxx
+++ b/sw/source/core/frmedt/fews.cxx
@@ -124,10 +124,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 )
@@ -264,7 +271,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 );
@@ -423,7 +430,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();
@@ -434,7 +441,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;
}
@@ -521,6 +528,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 );
}
}
@@ -772,8 +780,11 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
_bMirror = _bMirror && !pPage->OnRightPage();
Point aPos;
- sal_Bool bVertic = sal_False;
+ bool bVertic = false;
sal_Bool bRTL = sal_False;
+ // --> OD 2009-09-01 #mongolianlayout#
+ bool bVerticalL2R = false;
+ // <--
if ((FLY_AT_PAGE == _nAnchorId) || (FLY_AT_FLY == _nAnchorId)) // LAYER_IMPL
{
@@ -798,9 +809,14 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
else
aPos = (pFrm->Frm().*fnRect->fnGetPos)();
- if( bVert )
+ // --> OD 2009-09-01 #mongolianlayout#
+ if( bVert || bVertL2R )
+ // <--
{
- bVertic = sal_True;
+ // --> OD 2009-09-01 #mongolianlayout#
+ bVertic = bVert ? true : false;
+ bVerticalL2R = bVertL2R ? true : false;
+ // <--
_bMirror = false; // no mirroring in vertical environment
switch ( _eHoriRelOrient )
{
@@ -849,8 +865,9 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
default:break;
}
}
- // --> OD 2006-12-12 #i67221# - proposed patch
- if( bVert )
+ // --> OD 2009-09-01 #mongolianlayout#
+ if ( bVert && !bVertL2R )
+ // <--
{
switch ( _eVertRelOrient )
{
@@ -862,6 +879,20 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
break;
}
}
+ // --> OD 2009-09-01 #mongolianlayout#
+ else if ( bVertL2R )
+ {
+ switch ( _eVertRelOrient )
+ {
+ case text::RelOrientation::PRINT_AREA:
+ case text::RelOrientation::PAGE_PRINT_AREA:
+ {
+ aPos.X() += pFrm->GetLeftMargin();
+ }
+ break;
+ }
+ }
+ // <--
else
{
switch ( _eVertRelOrient )
@@ -926,10 +957,17 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
// to page areas.
if ( _eVertRelOrient == text::RelOrientation::PAGE_FRAME || _eVertRelOrient == text::RelOrientation::PAGE_PRINT_AREA )
{
- if ( bVert )
+ // --> OD 2009-09-01 #mongolianlayout#
+ if ( bVert && !bVertL2R )
+ // <--
{
aPos.X() = aVertEnvironRect.Right();
}
+ // --> OD 2009-09-01 #mongolianlayout#
+ else if ( bVertL2R )
+ {
+ aPos.X() = aVertEnvironRect.Left();
+ }
else
{
aPos.Y() = aVertEnvironRect.Top();
@@ -946,7 +984,9 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
// to page areas.
if ( _eVertRelOrient == text::RelOrientation::PAGE_FRAME || _eVertRelOrient == text::RelOrientation::PAGE_PRINT_AREA )
{
- if ( bVert )
+ // --> OD 2009-09-01 #mongolianlayout#
+ if ( bVert && !bVertL2R )
+ // <--
{
aPos.X() = aVertEnvironRect.Right();
if ( _eVertRelOrient == text::RelOrientation::PAGE_PRINT_AREA )
@@ -954,6 +994,16 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
aPos.X() -= rVertEnvironLayFrm.GetRightMargin();
}
}
+ // --> OD 2009-09-01 #mongolianlayout#
+ else if ( bVertL2R )
+ {
+ aPos.X() = aVertEnvironRect.Left();
+ if ( _eVertRelOrient == text::RelOrientation::PAGE_PRINT_AREA )
+ {
+ aPos.X() += rVertEnvironLayFrm.GetLeftMargin();
+ }
+ }
+ // <--
else
{
aPos.Y() = aVertEnvironRect.Top();
@@ -1013,10 +1063,12 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
pTxtFrm->GetTopOfLine( nTop, aDefaultCntntPos );
}
}
- if ( bVert )
+ // --> OD 2009-09-01 #mongolianlayout#
+ if ( bVert || bVertL2R )
{
aPos.X() = nTop;
}
+ // <--
else
{
aPos.Y() = nTop;
@@ -1043,10 +1095,12 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
pTxtFrm->GetAutoPos( aChRect, aDefaultCntntPos );
}
nLeft = (aChRect.*fnRect->fnGetLeft)();
- if ( bVert )
+ // --> OD 2009-09-01 #mongolianlayout#
+ if ( bVert || bVertL2R )
{
aPos.Y() = nLeft;
}
+ // <--
else
{
aPos.X() = nLeft;
@@ -1054,7 +1108,9 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
}
// <--
- if ( bVert )
+ // --> OD 2009-09-01 #mongolianlayout#
+ if ( bVert || bVertL2R )
+ // <--
{
_orRect = SwRect( aVertEnvironRect.Left(),
aHoriEnvironRect.Top(),
@@ -1088,7 +1144,9 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
}
// bei zeichengebundenen lieber nur 90% der Hoehe ausnutzen
{
- if( bVert )
+ // --> OD 2009-09-01 #mongolianlayout#
+ if( bVert || bVertL2R )
+ // <--
_orRect.Width( (_orRect.Width()*9)/10 );
else
_orRect.Height( (_orRect.Height()*9)/10 );
@@ -1098,26 +1156,51 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
const SwTwips nBaseOfstForFly = ( pFrm->IsTxtFrm() && pFly ) ?
((SwTxtFrm*)pFrm)->GetBaseOfstForFly( !bWrapThrough ) :
0;
- if( bVert )
+ // --> OD 2009-09-01 #mongolianlayout#
+ if( bVert || bVertL2R )
+ // <--
{
- bVertic = sal_True;
+ // --> OD 2009-09-01 #mongolianlayout#
+ bVertic = bVert ? true : false;
+ bVerticalL2R = bVertL2R ? true : false;
+ // <--
_bMirror = false;
switch ( _eHoriRelOrient )
{
- case text::RelOrientation::FRAME_RIGHT: aPos.Y() += pFrm->Prt().Height();
- aPos += (pFrm->Prt().*fnRect->fnGetPos)();
- break;
- case text::RelOrientation::PRINT_AREA: aPos += (pFrm->Prt().*fnRect->fnGetPos)();
- aPos.Y() += nBaseOfstForFly;
- break;
- case text::RelOrientation::PAGE_RIGHT: aPos.Y() = pPage->Frm().Top()
- + pPage->Prt().Bottom(); break;
- case text::RelOrientation::PAGE_PRINT_AREA: aPos.Y() = pPage->Frm().Top()
- + pPage->Prt().Top(); break;
+ case text::RelOrientation::FRAME_RIGHT:
+ {
+ aPos.Y() += pFrm->Prt().Height();
+ aPos += (pFrm->Prt().*fnRect->fnGetPos)();
+ break;
+ }
+ case text::RelOrientation::PRINT_AREA:
+ {
+ aPos += (pFrm->Prt().*fnRect->fnGetPos)();
+ aPos.Y() += nBaseOfstForFly;
+ break;
+ }
+ case text::RelOrientation::PAGE_RIGHT:
+ {
+ aPos.Y() = pPage->Frm().Top() + pPage->Prt().Bottom();
+ break;
+ }
+ case text::RelOrientation::PAGE_PRINT_AREA:
+ {
+ aPos.Y() = pPage->Frm().Top() + pPage->Prt().Top();
+ break;
+ }
case text::RelOrientation::PAGE_LEFT:
- case text::RelOrientation::PAGE_FRAME: aPos.Y() = pPage->Frm().Top(); break;
- case text::RelOrientation::FRAME: aPos.Y() += nBaseOfstForFly; break;
+ case text::RelOrientation::PAGE_FRAME:
+ {
+ aPos.Y() = pPage->Frm().Top();
+ break;
+ }
+ case text::RelOrientation::FRAME:
+ {
+ aPos.Y() += nBaseOfstForFly;
+ break;
+ }
default: break;
}
}
@@ -1175,19 +1258,27 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
{
switch ( _eHoriRelOrient )
{
- case text::RelOrientation::FRAME_RIGHT: aPos.X() += pFrm->Prt().Width();
- aPos += pFrm->Prt().Pos();
- break;
- case text::RelOrientation::PRINT_AREA: aPos += pFrm->Prt().Pos();
- aPos.X() += nBaseOfstForFly;
- break;
- case text::RelOrientation::PAGE_RIGHT: aPos.X() = pPage->Frm().Left()
- + pPage->Prt().Right(); break;
- case text::RelOrientation::PAGE_PRINT_AREA: aPos.X() = pPage->Frm().Left()
- + pPage->Prt().Left(); break;
+ case text::RelOrientation::FRAME_RIGHT:
+ aPos.X() += pFrm->Prt().Width();
+ aPos += pFrm->Prt().Pos();
+ break;
+ case text::RelOrientation::PRINT_AREA:
+ aPos += pFrm->Prt().Pos();
+ aPos.X() += nBaseOfstForFly;
+ break;
+ case text::RelOrientation::PAGE_RIGHT:
+ aPos.X() = pPage->Frm().Left() + pPage->Prt().Right();
+ break;
+ case text::RelOrientation::PAGE_PRINT_AREA:
+ aPos.X() = pPage->Frm().Left() + pPage->Prt().Left();
+ break;
case text::RelOrientation::PAGE_LEFT:
- case text::RelOrientation::PAGE_FRAME: aPos.X() = pPage->Frm().Left(); break;
- case text::RelOrientation::FRAME: aPos.X() += nBaseOfstForFly; break;
+ case text::RelOrientation::PAGE_FRAME:
+ aPos.X() = pPage->Frm().Left();
+ break;
+ case text::RelOrientation::FRAME:
+ aPos.X() += nBaseOfstForFly;
+ break;
default: break;
}
}
@@ -1195,8 +1286,12 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
}
if( !_opRef )
{
- if( bVertic )
+ if( bVertic && !bVerticalL2R )
_orRect.Pos( aPos.X() - _orRect.Width() - _orRect.Left(), _orRect.Top() - aPos.Y() );
+ // --> OD 2009-09-01 #mongolianlayout#
+ else if( bVerticalL2R )
+ _orRect.Pos( _orRect.Left() - aPos.X(), _orRect.Top() - aPos.Y() );
+ // <--
else if ( bRTL )
_orRect.Pos( - ( _orRect.Right() - aPos.X() ), _orRect.Top() - aPos.Y() );
else
@@ -1239,10 +1334,13 @@ Size SwFEShell::GetGraphicDefaultSize() const
/* -----------------------------12.08.2002 12:51------------------------------
---------------------------------------------------------------------------*/
-sal_Bool SwFEShell::IsFrmVertical(sal_Bool bEnvironment, sal_Bool& bRTL) const
+// --> OD 2009-08-31 #mongolianlayou#
+// add output parameter <bVertL2R>
+sal_Bool SwFEShell::IsFrmVertical(const sal_Bool bEnvironment, sal_Bool& bRTL, sal_Bool& bVertL2R) const
{
sal_Bool bVert = sal_False;
bRTL = sal_False;
+ bVertL2R = sal_False;
if ( Imp()->HasDrawView() )
{
@@ -1284,10 +1382,12 @@ sal_Bool SwFEShell::IsFrmVertical(sal_Bool bEnvironment, sal_Bool& bRTL) const
bVert = pRef->IsVertical();
bRTL = pRef->IsRightToLeft();
+ bVertL2R = pRef->IsVertLR();
}
return bVert;
}
+// <--
void SwFEShell::MoveObjectIfActive( svt::EmbeddedObjectRef&, const Point& )
{
diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx
index f5e88eb9d7..1882a55d60 100644
--- a/sw/source/core/frmedt/tblsel.cxx
+++ b/sw/source/core/frmedt/tblsel.cxx
@@ -54,9 +54,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
@@ -196,7 +196,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() )
@@ -291,10 +291,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 );
}
@@ -503,10 +503,10 @@ sal_Bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd,
// OD 07.11.2003 #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;
ASSERT( pStart, "ohne Frame geht gar nichts" );
aIdx = rEndNd;
@@ -515,12 +515,12 @@ sal_Bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd,
pCNd = aIdx.GetNodes().GoNextSection( &aIdx, sal_False, sal_False );
// OD 07.11.2003 #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;
ASSERT( pEnd, "ohne Frame geht gar nichts" );
@@ -775,9 +775,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;
@@ -1015,9 +1015,12 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
// das die 1. Headline mit drin ist.
// Point aPt( rShell.GetCharRect().Pos() );
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;
@@ -1531,9 +1534,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 );
@@ -1608,31 +1613,6 @@ SwTwips lcl_CalcWish( const SwLayoutFrm *pCell, long nWish,
return nRet;
}
-/* MA: 20. Sep. 93 wird nicht mehr gebraucht.
-static const SwLayoutFrm *GetPrevCell( const SwLayoutFrm *pCell )
-{
- const SwLayoutFrm *pLay = pCell->GetPrevLayoutLeaf();
- if ( pLay && pLay->IsLayoutFrm() && !pLay->IsTab() )
- {
- //GetPrevLayoutLeaf() liefert ggf. auch die Umgebung einer Tab zurueck
- //(naehmlich genau dann, wenn die Zelle noch Vorgaenger hat).
- const SwFrm *pFrm = pLay->Lower();
- while ( pFrm->GetNext() )
- pFrm = pFrm->GetNext();
- pLay = pFrm->IsTabFrm() ? (SwLayoutFrm*)pFrm : 0;
- }
- if ( pLay && pLay->IsTabFrm() )
- {
- //GetPrevLayoutLeaf() liefert ggf. auch Tabellen zurueck die letzte
- //Zelle dieser Tabelle ist das das gesuchte Blatt.
- pLay = ((SwTabFrm*)pLay)->FindLastCntnt()->GetUpper();
- while ( !pLay->IsCellFrm() )
- pLay = pLay->GetUpper();
- }
- return pLay;
-}
-*/
-
void lcl_FindStartEndRow( const SwLayoutFrm *&rpStart,
const SwLayoutFrm *&rpEnd,
const int bChkProtected )
@@ -2088,9 +2068,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() )
@@ -2149,7 +2132,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;
@@ -2307,14 +2290,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() ?
@@ -2402,7 +2381,6 @@ void _FndBox::DelFrms( SwTable &rTable )
delete pFrm;
}
}
- } while( 0 != ( pLast = aIter++ ));
}
}
}
@@ -2436,8 +2414,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();
@@ -2471,13 +2448,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;
@@ -2485,19 +2461,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 )
@@ -2545,32 +2521,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 )
@@ -2601,16 +2576,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:
@@ -2621,13 +2596,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 :
@@ -2650,8 +2625,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() )
{
@@ -2702,9 +2676,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 3a16a5b622..5eb5ff15c7 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -213,10 +213,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.
@@ -310,7 +310,7 @@ sal_Bool SwGrfNode::ReRead(
if( bReadGrf && bNewGrf )
{
SwMsgPoolItem aMsgHint( RES_UPDATE_ATTR );
- Modify( &aMsgHint, &aMsgHint );
+ ModifyNotification( &aMsgHint, &aMsgHint );
}
return bReadGrf;
@@ -438,7 +438,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() ) {
@@ -488,7 +488,7 @@ short SwGrfNode::SwapIn( sal_Bool bWaitForData )
if( 1 == nRet )
{
SwMsgPoolItem aMsg( RES_GRAPHIC_SWAPIN );
- Modify( &aMsg, &aMsg );
+ ModifyNotification( &aMsg, &aMsg );
}
}
else
@@ -597,7 +597,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;
@@ -1176,7 +1176,7 @@ void SwGrfNode::ApplyInputStream(
mbIsStreamReadOnly = bIsStreamReadOnly;
mbLinkedInputStreamReady = true;
SwMsgPoolItem aMsgHint( RES_LINKED_GRAPHIC_STREAM_ARRIVED );
- Modify( &aMsgHint, &aMsgHint );
+ ModifyNotification( &aMsgHint, &aMsgHint );
}
}
}
@@ -1188,7 +1188,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 84423605b5..849603e2b5 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 41e89dcdd5..35abb46f7c 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 851d3d37e1..1221d7bccd 100644..100755
--- a/sw/source/core/inc/acorrect.hxx
+++ b/sw/source/core/inc/acorrect.hxx
@@ -68,6 +68,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/anchoredobjectposition.hxx b/sw/source/core/inc/anchoredobjectposition.hxx
index 9dc6a46096..506479081c 100644
--- a/sw/source/core/inc/anchoredobjectposition.hxx
+++ b/sw/source/core/inc/anchoredobjectposition.hxx
@@ -83,12 +83,14 @@ namespace objectpositioning
void _GetInfoAboutObj();
// --> OD 2006-03-15 #i62875#
- SwTwips _ImplAdjustVertRelPos( const SwTwips _nTopOfAnch,
- const bool _bVert,
- const SwFrm& _rPageAlignLayFrm,
- const SwTwips _nProposedRelPosY,
- const bool _bFollowTextFlow,
- const bool _bCheckBottom = true ) const;
+ // --> OD 2009-09-01 #mongolianlayout# - add parameter <bVertL2R>
+ SwTwips _ImplAdjustVertRelPos( const SwTwips nTopOfAnch,
+ const bool bVert,
+ const bool bVertL2R,
+ const SwFrm& rPageAlignLayFrm,
+ const SwTwips nProposedRelPosY,
+ const bool bFollowTextFlow,
+ const bool bCheckBottom = true ) const;
SwTwips _ImplAdjustHoriRelPos( const SwFrm& _rPageAlignLayFrm,
const SwTwips _nProposedRelPosX ) const;
// <--
@@ -170,53 +172,59 @@ namespace objectpositioning
/** adjust calculated vertical in order to keep object inside
'page' alignment layout frame.
- OD 2004-07-22 #i31805# - add parameter <_bCheckBottom>
- OD 2004-10-08 #i26945# - add parameter <_bFollowTextFlow>
+ OD 2004-07-22 #i31805# - add parameter <bCheckBottom>
+ OD 2004-10-08 #i26945# - add parameter <bFollowTextFlow>
OD 2006-03-15 #i62875# - made inline, intrinsic actions moved
to private method <_ImplAdjustVertRelPos>, which is only
called, if <mbDoNotCaptureAnchoredObj> not set.
+ OD 2009-09-01 #mongolianlayout# - add parameter <bVertL2R>
- @param _nTopOfAnch
+ @param nTopOfAnch
input parameter - 'vertical' position, at which the relative
position of the object is calculated from.
- @param _bVert
+ @param bVert
input parameter - boolean, indicating, if object is in vertical
layout.
- @param _rPageAlignLayFrm
+ @param bVertL2R
+ input parameter - boolean, indicating, if object is in mongolian
+ layout (vertical left-to-right layout).
+
+ @param rPageAlignLayFrm
input parameter - layout frame, which determines the 'page area'
the object has to be vertical positioned in.
- @param _nProposedRelPosY
+ @param nProposedRelPosY
input parameter - proposed relative vertical position, which
will be adjusted.
- @param _bFollowTextFlow
+ @param bFollowTextFlow
input parameter - value of attribute 'Follow text flow' of the
anchored object.
- @param _bCheckBottom
+ @param bCheckBottom
input parameter - boolean indicating, if bottom of anchored
object has to be checked and thus, (if needed) the proposed
relative position has to be adjusted. default value <true>
@author OD
*/
- inline SwTwips _AdjustVertRelPos( const SwTwips _nTopOfAnch,
- const bool _bVert,
- const SwFrm& _rPageAlignLayFrm,
- const SwTwips _nProposedRelPosY,
- const bool _bFollowTextFlow,
- const bool _bCheckBottom = true ) const
+ inline SwTwips _AdjustVertRelPos( const SwTwips nTopOfAnch,
+ const bool bVert,
+ const bool bVertL2R,
+ const SwFrm& rPageAlignLayFrm,
+ const SwTwips nProposedRelPosY,
+ const bool bFollowTextFlow,
+ const bool bCheckBottom = true ) const
{
return !mbDoNotCaptureAnchoredObj
- ? _ImplAdjustVertRelPos( _nTopOfAnch, _bVert,
- _rPageAlignLayFrm,
- _nProposedRelPosY,
- _bFollowTextFlow,
- _bCheckBottom )
- : _nProposedRelPosY;
+ ? _ImplAdjustVertRelPos( nTopOfAnch, bVert, bVertL2R,
+ rPageAlignLayFrm,
+ nProposedRelPosY,
+ bFollowTextFlow,
+ bCheckBottom )
+ : nProposedRelPosY;
}
// *********************************************************************
diff --git a/sw/source/core/inc/attrhint.hxx b/sw/source/core/inc/attrhint.hxx
new file mode 100644
index 0000000000..850afeed6a
--- /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 7c7ed603b3..86f1e98a2f 100644
--- a/sw/source/core/inc/bodyfrm.hxx
+++ b/sw/source/core/inc/bodyfrm.hxx
@@ -41,7 +41,7 @@ protected:
~SwBodyFrm();
#endif
public:
- SwBodyFrm( SwFrmFmt* );
+ SwBodyFrm( SwFrmFmt*, SwFrm* );
DECL_FIXEDMEMPOOL_NEWDEL(SwBodyFrm)
};
diff --git a/sw/source/core/inc/bookmrk.hxx b/sw/source/core/inc/bookmrk.hxx
index a47a0598c1..87ea20b774 100644
--- a/sw/source/core/inc/bookmrk.hxx
+++ b/sw/source/core/inc/bookmrk.hxx
@@ -50,7 +50,6 @@ namespace sw { namespace mark
{
class MarkBase
: virtual public IMark
- , private ::boost::noncopyable
{
public:
//getters
@@ -104,9 +103,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; }
@@ -115,6 +111,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 1a5b24b58f..7554271a63 100644
--- a/sw/source/core/inc/cellfrm.hxx
+++ b/sw/source/core/inc/cellfrm.hxx
@@ -41,13 +41,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 69f5e696ac..48e022ade0 100644
--- a/sw/source/core/inc/cntfrm.hxx
+++ b/sw/source/core/inc/cntfrm.hxx
@@ -53,7 +53,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& );
@@ -64,11 +64,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();
@@ -108,6 +108,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 9f14d6f016..8ee8aab777 100644
--- a/sw/source/core/inc/colfrm.hxx
+++ b/sw/source/core/inc/colfrm.hxx
@@ -33,7 +33,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 0000000000..d711b46567
--- /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 2b351de564..60c019477d 100644
--- a/sw/source/core/inc/flyfrm.hxx
+++ b/sw/source/core/inc/flyfrm.hxx
@@ -28,6 +28,7 @@
#define SW_FLYFRM_HXX
#include "layfrm.hxx"
+#include <list>
#include "frmfmt.hxx"
class SwPageFrm;
@@ -38,8 +39,10 @@ class SwVirtFlyDrawObj;
class SwSpzFrmFmts;
class SwAttrSetChg;
class PolyPolygon;
+class SwFlyDrawContact;
+class SwDrawContact;
+class SwFmt;
-// OD 2004-03-22 #i26791#
#include <anchoredobject.hxx>
//Sucht ausgehend von pOldAnch einen Anker fuer Absatzgebundene Rahmen.
@@ -58,18 +61,20 @@ class SwFlyFrm : public SwLayoutFrm, public SwAnchoredObject
{
//darf Locken. Definiert in frmtool.cxx
friend void AppendObjs ( const SwSpzFrmFmts *, sal_uLong, SwFrm *, SwPageFrm * );
- friend void AppendAllObjs( const SwSpzFrmFmts * );
friend void Notify( SwFlyFrm *, SwPageFrm *pOld, const SwRect &rOld,
const SwRect* pOldPrt );
void InitDrawObj( sal_Bool bNotify ); //Wird von den CToren gerufen.
void FinitDrawObj(); //Wird vom CTor gerufen.
- void _UpdateAttr( SfxPoolItem*, SfxPoolItem*, sal_uInt8 &,
+ void _UpdateAttr( const SfxPoolItem*, const SfxPoolItem*, sal_uInt8 &,
SwAttrSetChg *pa = 0, SwAttrSetChg *pb = 0 );
using SwLayoutFrm::CalcRel;
+ sal_uInt32 _GetOrdNumForNewRef( const SwFlyDrawContact* );
+ SwVirtFlyDrawObj* CreateNewRef( SwFlyDrawContact* );
+
protected:
SwFlyFrm *pPrevLink, // Vorgaenger/Nachfolger fuer Verkettung mit
@@ -131,7 +136,7 @@ protected:
Size CalcRel( const SwFmtFrmSize &rSz ) const;
SwTwips CalcAutoWidth() const;
- SwFlyFrm( SwFlyFrmFmt*, SwFrm *pAnchor );
+ SwFlyFrm( SwFlyFrmFmt*, SwFrm*, SwFrm *pAnchor );
/** method to assure that anchored object is registered at the correct
page frame
@@ -142,20 +147,17 @@ protected:
*/
virtual void RegisterAtCorrectPage();
- // --> OD 2006-08-10 #i68520#
virtual bool _SetObjTop( const SwTwips _nTop );
virtual bool _SetObjLeft( const SwTwips _nLeft );
- // <--
- // --> OD 2006-10-05 #i70122#
virtual const SwRect GetObjBoundRect() const;
- // <--
+ virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
+
public:
// OD 2004-03-23 #i26791#
TYPEINFO();
virtual ~SwFlyFrm();
- virtual void Modify( SfxPoolItem*, SfxPoolItem* );
// erfrage vom Client Informationen
virtual sal_Bool GetInfo( SfxPoolItem& ) const;
virtual void Paint( SwRect const&,
@@ -284,6 +286,7 @@ public:
@author OD
*/
virtual bool IsFormatPossible() const;
+ static void GetAnchoredObjects( std::list<SwAnchoredObject*>&, const SwFmt& rFmt );
// overwriting "SwFrmFmt *SwLayoutFrm::GetFmt" to provide the correct derived return type.
// (This is in order to skip on the otherwise necessary casting of the result to
diff --git a/sw/source/core/inc/flyfrms.hxx b/sw/source/core/inc/flyfrms.hxx
index b020c0b6ac..d231fd96f5 100644
--- a/sw/source/core/inc/flyfrms.hxx
+++ b/sw/source/core/inc/flyfrms.hxx
@@ -68,7 +68,7 @@ protected:
virtual void NotifyBackground( SwPageFrm *pPage,
const SwRect& rRect, PrepareHint eHint);
- SwFlyFreeFrm( SwFlyFrmFmt*, SwFrm *pAnchor );
+ SwFlyFreeFrm( SwFlyFrmFmt*, SwFrm*, SwFrm *pAnchor );
public:
// --> OD 2004-06-29 #i28701#
@@ -130,11 +130,10 @@ public:
// --> OD 2004-06-29 #i28701#
TYPEINFO();
- SwFlyLayFrm( SwFlyFrmFmt*, SwFrm *pAnchor );
+ SwFlyLayFrm( SwFlyFrmFmt*, SwFrm*, SwFrm *pAnchor );
SwFlyLayFrm( SwFlyLayFrm& );
-
- virtual void Modify( SfxPoolItem*, SfxPoolItem* );
-
+protected:
+ virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
};
//Die Flys, die an einem Cntnt haengen nicht aber im Inhalt
@@ -154,14 +153,13 @@ protected:
@author OD
*/
virtual void RegisterAtCorrectPage();
+ virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
public:
// --> OD 2004-06-29 #i28701#
TYPEINFO();
- SwFlyAtCntFrm( SwFlyFrmFmt*, SwFrm *pAnchor );
-
- virtual void Modify( SfxPoolItem*, SfxPoolItem* );
+ SwFlyAtCntFrm( SwFlyFrmFmt*, SwFrm*, SwFrm *pAnchor );
void SetAbsPos( const Point &rNew );
@@ -193,16 +191,16 @@ protected:
virtual void NotifyBackground( SwPageFrm *pPage,
const SwRect& rRect, PrepareHint eHint);
virtual void MakeAll();
+ virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
public:
// --> OD 2004-06-29 #i28701#
TYPEINFO();
- SwFlyInCntFrm( SwFlyFrmFmt*, SwFrm *pAnchor );
+ SwFlyInCntFrm( SwFlyFrmFmt*, SwFrm*, SwFrm *pAnchor );
virtual ~SwFlyInCntFrm();
virtual void Format( const SwBorderAttrs *pAttrs = 0 );
- virtual void Modify( SfxPoolItem*, SfxPoolItem* );
void SetRefPoint( const Point& rPoint, const Point &rRelAttr,
const Point &rRelPos );
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index 46a7731e50..0face03d36 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -31,6 +31,7 @@
#include "swtypes.hxx" // fuer SwTwips
#include "swrect.hxx"
#include "calbck.hxx" // fuer SwClient
+#include <svl/brdcst.hxx>
class SwLayoutFrm;
class SwRootFrm;
@@ -54,12 +55,10 @@ class SvxBrushItem;
class SwSelectionList;
struct SwPosition;
struct SwCrsrMoveState;
+class SwFmt;
class SwPrintData;
-
-// --> OD 2004-07-06 #i28701#
class SwSortedObjs;
class SwAnchoredObject;
-// <--
//Jeder FrmTyp findet sich hier in einem Bit wieder.
//Die Bits muessen so gesetzt werden, dass mit einer Maskierung festgestellt
@@ -198,8 +197,8 @@ struct SwRectFnCollection
};
typedef SwRectFnCollection* SwRectFn;
+/*
extern SwRectFn fnRectHori, fnRectVert, fnRectB2T, fnRectVL2R;
-
#define SWRECTFN( pFrm ) sal_Bool bVert = pFrm->IsVertical(); \
sal_Bool bRev = pFrm->IsReverse(); \
SwRectFn fnRect = bVert ? \
@@ -221,6 +220,36 @@ extern SwRectFn fnRectHori, fnRectVert, fnRectB2T, fnRectVL2R;
sal_Bool bNeighb = pFrm->IsNeighbourFrm(); \
SwRectFn fnRect = bVert == bNeighb ? \
fnRectHori : fnRectVert;
+*/
+
+//Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+extern SwRectFn fnRectHori, fnRectVert, fnRectB2T, fnRectVL2R, fnRectVertL2R;
+#define SWRECTFN( pFrm ) sal_Bool bVert = pFrm->IsVertical(); \
+ sal_Bool bRev = pFrm->IsReverse(); \
+ sal_Bool bVertL2R = pFrm->IsVertLR(); \
+ SwRectFn fnRect = bVert ? \
+ ( bRev ? fnRectVL2R : ( bVertL2R ? fnRectVertL2R : fnRectVert ) ): \
+ ( bRev ? fnRectB2T : fnRectHori );
+#define SWRECTFNX( pFrm ) sal_Bool bVertX = pFrm->IsVertical(); \
+ sal_Bool bRevX = pFrm->IsReverse(); \
+ sal_Bool bVertL2RX = pFrm->IsVertLR(); \
+ SwRectFn fnRectX = bVertX ? \
+ ( bRevX ? fnRectVL2R : ( bVertL2RX ? fnRectVertL2R : fnRectVert ) ): \
+ ( bRevX ? fnRectB2T : fnRectHori );
+#define SWREFRESHFN( pFrm ) { if( bVert != pFrm->IsVertical() || \
+ bRev != pFrm->IsReverse() ) \
+ bVert = pFrm->IsVertical(); \
+ bRev = pFrm->IsReverse(); \
+ bVertL2R = pFrm->IsVertLR(); \
+ fnRect = bVert ? \
+ ( bRev ? fnRectVL2R : ( bVertL2R ? fnRectVertL2R : fnRectVert ) ): \
+ ( bRev ? fnRectB2T : fnRectHori ); }
+#define SWRECTFN2( pFrm ) sal_Bool bVert = pFrm->IsVertical(); \
+ sal_Bool bVertL2R = pFrm->IsVertLR(); \
+ sal_Bool bNeighb = pFrm->IsNeighbourFrm(); \
+ SwRectFn fnRect = bVert == bNeighb ? \
+ fnRectHori : ( bVertL2R ? fnRectVertL2R : fnRectVert );
+//End of SCMS
#define POS_DIFF( aFrm1, aFrm2 ) \
( (aFrm1.*fnRect->fnGetTop)() != (aFrm2.*fnRect->fnGetTop)() || \
(aFrm1.*fnRect->fnGetLeft)() != (aFrm2.*fnRect->fnGetLeft)() )
@@ -240,7 +269,7 @@ enum MakePageType
//typedef SdrObject* SdrObjectPtr;
//SV_DECL_PTRARR(SwDrawObjs,SdrObjectPtr,1,1);
-class SwFrm: public SwClient
+class SwFrm: public SwClient, public SfxBroadcaster
{
//Der verkappte Frm
friend class SwFlowFrm;
@@ -274,6 +303,7 @@ class SwFrm: public SwClient
const sal_uInt32 mnFrmId;
// <--
+ SwRootFrm *mpRoot;
SwLayoutFrm *pUpper;
SwFrm *pNext;
SwFrm *pPrev;
@@ -344,7 +374,7 @@ class SwFrm: public SwClient
SwCntntFrm* _FindPrevCnt( const bool _bInSameFtn = false );
- void _UpdateAttrFrm( SfxPoolItem*, SfxPoolItem*, sal_uInt8 & );
+ void _UpdateAttrFrm( const SfxPoolItem*, const SfxPoolItem*, sal_uInt8 & );
SwFrm* _GetIndNext();
void SetDirFlags( sal_Bool bVert );
@@ -371,6 +401,9 @@ protected:
sal_uInt16 bInvalidVert: 1;
sal_uInt16 bDerivedVert: 1;
sal_uInt16 bVertical: 1;
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ sal_uInt16 bVertLR: 1;
+ //End of SCMS
sal_uInt16 nType: 4; //Who am I?
sal_Bool bValidPos: 1;
@@ -400,6 +433,9 @@ protected:
void ColLock() { bColLocked = sal_True; }
void ColUnlock() { bColLocked = sal_False; }
+ // Only used by SwRootFrm Ctor to get 'this' into mpRoot...
+ void setRootFrm( SwRootFrm* pRoot ) { mpRoot = pRoot; }
+
SwPageFrm *InsertPage( SwPageFrm *pSibling, sal_Bool bFtn );
void PrepareMake();
void OptPrepareMake();
@@ -419,10 +455,10 @@ protected:
virtual SwTwips ShrinkFrm( SwTwips, sal_Bool bTst = sal_False, sal_Bool bInfo = sal_False ) = 0;
virtual SwTwips GrowFrm ( SwTwips, sal_Bool bTst = sal_False, sal_Bool bInfo = sal_False ) = 0;
- SwModify *GetDep() { return pRegisteredIn; }
- const SwModify *GetDep() const { return pRegisteredIn; }
+ SwModify *GetDep() { return GetRegisteredInNonConst(); }
+ const SwModify *GetDep() const { return GetRegisteredIn(); }
- SwFrm( SwModify* );
+ SwFrm( SwModify*, SwFrm* );
void CheckDir( sal_uInt16 nDir, sal_Bool bVert, sal_Bool bOnlyBiDi, sal_Bool bBrowse );
@@ -457,6 +493,7 @@ protected:
//Schatten und Umrandung painten
void PaintShadow( const SwRect&, SwRect&, const SwBorderAttrs& ) const;
+ virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
public:
TYPEINFO(); //Bereits in Basisklasse Client drin.
@@ -562,8 +599,14 @@ public:
inline sal_Bool IsReverse() const { return bReverse; }
inline void SetReverse( sal_Bool bNew ){ bReverse = bNew ? 1 : 0; }
inline sal_Bool IsVertical() const;
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ inline sal_Bool IsVertLR() const;
+ //End of SCMS
inline sal_Bool GetVerticalFlag() const;
inline void SetVertical( sal_Bool bNew ){ bVertical = bNew ? 1 : 0; }
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ inline void SetbVertLR( sal_Bool bNew ) { bVertLR = bNew ? 1 : 0; }
+ //End of SCMS
inline void SetDerivedVert( sal_Bool bNew ){ bDerivedVert = bNew ? 1 : 0; }
inline void SetInvalidVert( sal_Bool bNew) { bInvalidVert = bNew ? 1 : 0; }
inline sal_Bool IsRightToLeft() const;
@@ -571,6 +614,7 @@ public:
inline void SetRightToLeft( sal_Bool bNew ){ bRightToLeft = bNew ? 1 : 0; }
inline void SetDerivedR2L( sal_Bool bNew ) { bDerivedR2L = bNew ? 1 : 0; }
inline void SetInvalidR2L( sal_Bool bNew ) { bInvalidR2L = bNew ? 1 : 0; }
+
void CheckDirChange();
// returns upper left frame position for LTR and
// upper right frame position for Asian / RTL frames
@@ -599,7 +643,6 @@ public:
//Fussnote einzufuegen (nicht z.B. in wiederholten TabellenHeadlines).
sal_Bool IsFtnAllowed() const;
- virtual void Modify( SfxPoolItem*, SfxPoolItem* );
virtual void Format( const SwBorderAttrs *pAttrs = 0 );
virtual void CheckDirection( sal_Bool bVert );
@@ -611,10 +654,6 @@ public:
inline sal_Bool HasFixSize() const { return bFixSize; }
inline void SetFixSize( sal_Bool bNew ) { bFixSize = bNew; }
- //Kann 0 liefern, pruefen auch ob die Shell zum richtigen Dokument
- //gehoert. Impl in frmsh.hxx
- ViewShell *GetShell() const;
-
//Prueft alle Seiten ab der Uebergebenen und korrigiert ggf.
static void CheckPageDescs( SwPageFrm *pStart, sal_Bool bNotifyFields = sal_True );
@@ -622,7 +661,7 @@ public:
SwFrm *GetNext() { return pNext; }
SwFrm *GetPrev() { return pPrev; }
SwLayoutFrm *GetUpper() { return pUpper; }
- SwRootFrm *FindRootFrm();
+ SwRootFrm *getRootFrm(){ return mpRoot; }
SwPageFrm *FindPageFrm();
SwFrm *FindColFrm();
SwFtnBossFrm *FindFtnBossFrm( sal_Bool bFootnotes = sal_False );
@@ -635,6 +674,7 @@ public:
const SwFrm *GetNext() const { return pNext; }
const SwFrm *GetPrev() const { return pPrev; }
const SwLayoutFrm *GetUpper() const { return pUpper; }
+ const SwRootFrm *getRootFrm() const { return mpRoot; }
inline SwTabFrm *FindTabFrm();
inline SwFtnFrm *FindFtnFrm();
inline SwFlyFrm *FindFlyFrm();
@@ -645,7 +685,6 @@ public:
// <--
inline SwFrm *FindPrev();
inline const SwPageFrm *FindPageFrm() const;
- inline const SwRootFrm *FindRootFrm() const;
inline const SwFtnBossFrm *FindFtnBossFrm( sal_Bool bFtn = sal_False ) const;
inline const SwFrm *FindColFrm() const;
inline const SwFrm *FindFooterOrHeader() const;
@@ -911,6 +950,8 @@ public:
bool IsInCoveredCell() const;
// FME 2007-08-30 #i81146# new loop control
+ bool KnowsFormat( const SwFmt& rFmt ) const;
+ void RegisterToFormat( SwFmt& rFmt );
void ValidateThisAndAllLowers( const sal_uInt16 nStage );
};
@@ -950,6 +991,12 @@ sal_Bool SwFrm::IsVertical() const
((SwFrm*)this)->SetDirFlags( sal_True );
return bVertical != 0;
}
+//Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+inline sal_Bool SwFrm::IsVertLR() const
+{
+ return bVertLR != 0;
+}
+//End of SCMS
sal_Bool SwFrm::GetVerticalFlag() const
{
return bVertical != 0;
@@ -1075,10 +1122,6 @@ inline const SwPageFrm *SwFrm::FindPageFrm() const
{
return ((SwFrm*)this)->FindPageFrm();
}
-inline const SwRootFrm *SwFrm::FindRootFrm() const
-{
- return ((SwFrm*)this)->FindRootFrm();
-}
inline const SwFrm *SwFrm::FindColFrm() const
{
return ((SwFrm*)this)->FindColFrm();
diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx
index 1bf58b11e0..34b4f166c3 100644
--- a/sw/source/core/inc/frmtool.hxx
+++ b/sw/source/core/inc/frmtool.hxx
@@ -37,6 +37,7 @@
class SwPageFrm;
class SwFlyFrm;
class SwCntntFrm;
+class SwRootFrm;
class SwDoc;
class SwAttrSet;
class SdrObject;
@@ -138,7 +139,7 @@ const SwFrm * MA_FASTCALL FindPage( const SwRect &rRect, const SwFrm *pPage );
// JP 07.05.98: wird von SwCntntNode::GetFrm und von SwFlyFrm::GetFrm
// gerufen
-SwFrm* GetFrmOfModify( SwModify const&, sal_uInt16 const nFrmType, const Point* = 0,
+SwFrm* GetFrmOfModify( const SwRootFrm* pLayout, SwModify const&, sal_uInt16 const nFrmType, const Point* = 0,
const SwPosition *pPos = 0,
const sal_Bool bCalcFrm = sal_False );
@@ -567,7 +568,7 @@ class SwDeletionChecker
SwDeletionChecker( const SwFrm* pFrm )
: mpFrm( pFrm ),
- mpRegIn( pFrm ? pFrm->GetRegisteredIn() : 0 )
+ mpRegIn( pFrm ? const_cast<SwFrm*>(pFrm)->GetRegisteredIn() : 0 )
{
}
diff --git a/sw/source/core/inc/ftnboss.hxx b/sw/source/core/inc/ftnboss.hxx
index df6d324bb6..98b7080fd3 100644
--- a/sw/source/core/inc/ftnboss.hxx
+++ b/sw/source/core/inc/ftnboss.hxx
@@ -70,7 +70,7 @@ protected:
void InsertFtn( SwFtnFrm * );
static void ResetFtn( const SwFtnFrm *pAssumed );
public:
- inline SwFtnBossFrm( SwFrmFmt* pFmt) : SwLayoutFrm( pFmt ) {}
+ inline SwFtnBossFrm( SwFrmFmt* pFmt, SwFrm* pSib ) : SwLayoutFrm( pFmt, pSib ) {}
SwLayoutFrm *FindBodyCont();
inline const SwLayoutFrm *FindBodyCont() const;
diff --git a/sw/source/core/inc/ftnfrm.hxx b/sw/source/core/inc/ftnfrm.hxx
index 9f7d9d1a3c..8d6e74e928 100644
--- a/sw/source/core/inc/ftnfrm.hxx
+++ b/sw/source/core/inc/ftnfrm.hxx
@@ -43,7 +43,7 @@ class SwFtnFrm;
class SwFtnContFrm: public SwLayoutFrm
{
public:
- SwFtnContFrm( SwFrmFmt* );
+ SwFtnContFrm( SwFrmFmt*, SwFrm* );
const SwFtnFrm* FindFootNote() const;
@@ -79,7 +79,7 @@ protected:
public:
- SwFtnFrm( SwFrmFmt*, SwCntntFrm*, SwTxtFtn* );
+ SwFtnFrm( SwFrmFmt*, SwFrm*, SwCntntFrm*, SwTxtFtn* );
virtual void Cut();
virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 );
diff --git a/sw/source/core/inc/hffrm.hxx b/sw/source/core/inc/hffrm.hxx
index 604335cd1d..809e7d0897 100644
--- a/sw/source/core/inc/hffrm.hxx
+++ b/sw/source/core/inc/hffrm.hxx
@@ -39,7 +39,7 @@ protected:
void FormatPrt(SwTwips & nUL, const SwBorderAttrs * pAttrs);
inline sal_Bool GetEatSpacing() const; // in hffrm.cxx
public:
- SwHeadFootFrm(SwFrmFmt * pFrm, sal_uInt16 aType);
+ SwHeadFootFrm(SwFrmFmt * pFrm, SwFrm*, sal_uInt16 aType);
virtual void Format( const SwBorderAttrs *pAttrs = 0 );
virtual SwTwips GrowFrm( SwTwips,
sal_Bool bTst = sal_False, sal_Bool bInfo = sal_False );
@@ -50,7 +50,7 @@ public:
class SwHeaderFrm: public SwHeadFootFrm
{
public:
- SwHeaderFrm( SwFrmFmt* pFrm ) : SwHeadFootFrm(pFrm, FRMC_HEADER) {};
+ SwHeaderFrm( SwFrmFmt* pFrm, SwFrm* pSib ) : SwHeadFootFrm(pFrm, pSib, FRMC_HEADER) {};
DECL_FIXEDMEMPOOL_NEWDEL(SwHeaderFrm)
};
@@ -58,7 +58,7 @@ public:
class SwFooterFrm: public SwHeadFootFrm
{
public:
- SwFooterFrm( SwFrmFmt* pFrm ) : SwHeadFootFrm(pFrm, FRMC_FOOTER) {};
+ SwFooterFrm( SwFrmFmt* pFrm, SwFrm* pSib ) : SwHeadFootFrm(pFrm, pSib, FRMC_FOOTER) {};
DECL_FIXEDMEMPOOL_NEWDEL(SwFooterFrm)
};
diff --git a/sw/source/core/inc/layfrm.hxx b/sw/source/core/inc/layfrm.hxx
index 27f3dd4d71..387e78f8f1 100644
--- a/sw/source/core/inc/layfrm.hxx
+++ b/sw/source/core/inc/layfrm.hxx
@@ -102,7 +102,7 @@ public:
const SwCrsrMoveState *pCMS = 0,
const sal_Bool bDefaultExpand = sal_True ) const;
- SwLayoutFrm( SwFrmFmt* );
+ SwLayoutFrm( SwFrmFmt*, SwFrm* );
~SwLayoutFrm();
virtual void Paint( SwRect const&,
diff --git a/sw/source/core/inc/notxtfrm.hxx b/sw/source/core/inc/notxtfrm.hxx
index d52c245036..fa1722a13f 100644
--- a/sw/source/core/inc/notxtfrm.hxx
+++ b/sw/source/core/inc/notxtfrm.hxx
@@ -51,11 +51,11 @@ class SwNoTxtFrm: public SwCntntFrm
void PaintPicture( OutputDevice*, const SwRect& ) const;
protected:
virtual void MakeAll();
+ virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
public:
- SwNoTxtFrm( SwNoTxtNode * const );
+ SwNoTxtFrm( SwNoTxtNode * const, SwFrm* );
~SwNoTxtFrm();
- virtual void Modify( SfxPoolItem*, SfxPoolItem* );
virtual void Paint( SwRect const&,
SwPrintData const*const pPrintData = NULL ) const;
virtual sal_Bool GetCharRect( SwRect &, const SwPosition&,
diff --git a/sw/source/core/inc/pagedeschint.hxx b/sw/source/core/inc/pagedeschint.hxx
new file mode 100644
index 0000000000..065857560e
--- /dev/null
+++ b/sw/source/core/inc/pagedeschint.hxx
@@ -0,0 +1,46 @@
+/*************************************************************************
+ *
+ * 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 _PAGEDESCHINT_HXX
+#define _PAGEDESCHINT_HXX
+
+#include <svl/hint.hxx>
+
+class SwPageDesc;
+
+class SwPageDescHint : public SfxHint
+{
+ SwPageDesc* pPageDesc;
+public:
+ SwPageDescHint( SwPageDesc* p )
+ : pPageDesc(p)
+ {}
+
+ SwPageDesc* GetPageDesc() const { return const_cast<SwPageDesc*>(pPageDesc); }
+};
+
+#endif
diff --git a/sw/source/core/inc/pagefrm.hxx b/sw/source/core/inc/pagefrm.hxx
index bde838b9ab..5d73c1e9d3 100644
--- a/sw/source/core/inc/pagefrm.hxx
+++ b/sw/source/core/inc/pagefrm.hxx
@@ -92,7 +92,7 @@ class SwPageFrm: public SwFtnBossFrm
static const sal_Int8 mnBorderPxWidth;
static const sal_Int8 mnShadowPxWidth;
- void _UpdateAttr( SfxPoolItem*, SfxPoolItem*, sal_uInt8 &,
+ void _UpdateAttr( const SfxPoolItem*, const SfxPoolItem*, sal_uInt8 &,
SwAttrSetChg *pa = 0, SwAttrSetChg *pb = 0 );
// Anpassen der max. Fussnotenhoehen in den einzelnen Spalten
@@ -191,11 +191,12 @@ class SwPageFrm: public SwFtnBossFrm
protected:
virtual void MakeAll();
+ virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
public:
DECL_FIXEDMEMPOOL_NEWDEL(SwPageFrm)
- SwPageFrm( SwFrmFmt*, SwPageDesc* );
+ SwPageFrm( SwFrmFmt*, SwFrm*, SwPageDesc* );
~SwPageFrm();
//public, damit die ViewShell beim Umschalten vom BrowseMode darauf
@@ -251,7 +252,6 @@ public:
virtual sal_Bool GetCrsrOfst( SwPosition *, Point&,
SwCrsrMoveState* = 0 ) const;
- virtual void Modify( SfxPoolItem*, SfxPoolItem* );
// erfrage vom Client Informationen
virtual sal_Bool GetInfo( SfxPoolItem& ) const;
diff --git a/sw/source/core/inc/prevwpage.hxx b/sw/source/core/inc/prevwpage.hxx
index 517f4494b4..d76a72de94 100644
--- a/sw/source/core/inc/prevwpage.hxx
+++ b/sw/source/core/inc/prevwpage.hxx
@@ -1,3 +1,30 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
#ifndef _PREVIEWPAGES_HXX
#define _PREVIEWPAGES_HXX
diff --git a/sw/source/core/inc/rolbck.hxx b/sw/source/core/inc/rolbck.hxx
index 4f3646a068..6c6cc658c0 100644
--- a/sw/source/core/inc/rolbck.hxx
+++ b/sw/source/core/inc/rolbck.hxx
@@ -425,6 +425,9 @@ private:
void _MakeSetWhichIds();
+protected:
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew );
+
public:
// --> OD 2008-02-27 #refactorlists# - removed <rDoc>
SwRegHistory( SwHistory* pHst );
@@ -432,8 +435,6 @@ public:
SwRegHistory( const SwNode& rNd, SwHistory* pHst );
SwRegHistory( SwModify* pRegIn, const SwNode& rNd, SwHistory* pHst );
- virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew );
-
/// @return true iff at least 1 item was inserted
bool InsertItems( const SfxItemSet& rSet,
xub_StrLen const nStart, xub_StrLen const nEnd,
diff --git a/sw/source/core/inc/rootfrm.hxx b/sw/source/core/inc/rootfrm.hxx
index 0b7d132275..dc0fec056f 100644
--- a/sw/source/core/inc/rootfrm.hxx
+++ b/sw/source/core/inc/rootfrm.hxx
@@ -166,6 +166,11 @@ public:
//MasterObjekte aus der Page entfernen (von den Ctoren gerufen).
static void RemoveMasterObjs( SdrPage *pPg );
+ void AllCheckPageDescs() const;//swmod 080226
+ void AllInvalidateAutoCompleteWords() const;//swmod 080305
+ void AllAddPaintRect() const;
+ void AllRemoveFtns() ;//swmod 080305
+ void AllInvalidateSmartTagsOrSpelling(sal_Bool bSmartTags) const;//swmod 080307
//Virtuelles Device ausgeben (z.B. wenn Animationen ins Spiel kommen)
static sal_Bool FlushVout();
//Clipping sparen, wenn im Vout eh genau das Cliprechteck ausgegeben wird
@@ -173,6 +178,7 @@ public:
SwRootFrm( SwFrmFmt*, ViewShell* );
~SwRootFrm();
+ void Init(SwFrmFmt*);
ViewShell *GetCurrShell() const { return pCurrShell; }
void DeRegisterShell( ViewShell *pSh );
diff --git a/sw/source/core/inc/rowfrm.hxx b/sw/source/core/inc/rowfrm.hxx
index 23160e7ebe..6e0fdb79c4 100644
--- a/sw/source/core/inc/rowfrm.hxx
+++ b/sw/source/core/inc/rowfrm.hxx
@@ -54,13 +54,13 @@ class SwRowFrm: public SwLayoutFrm
protected:
virtual void MakeAll();
+ virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
public:
- SwRowFrm( const SwTableLine &, bool bInsertContent = true );
+ SwRowFrm( const SwTableLine &, SwFrm*, bool bInsertContent = true );
~SwRowFrm();
virtual void Cut();
- virtual void Modify( SfxPoolItem*, SfxPoolItem* );
//Zum Anmelden der Flys nachdem eine Zeile erzeugt _und_ eingefuegt wurde.
//Muss vom Erzeuger gerufen werden, denn erst nach dem Konstruieren wird
diff --git a/sw/source/core/inc/sectfrm.hxx b/sw/source/core/inc/sectfrm.hxx
index a4086afda3..1cac5983a3 100644
--- a/sw/source/core/inc/sectfrm.hxx
+++ b/sw/source/core/inc/sectfrm.hxx
@@ -45,7 +45,7 @@ class SwSectionFrm: public SwLayoutFrm, public SwFlowFrm
{
SwSection* pSection;
- void _UpdateAttr( SfxPoolItem*, SfxPoolItem*, sal_uInt8 &,
+ void _UpdateAttr( const SfxPoolItem*, const SfxPoolItem*, sal_uInt8 &,
SwAttrSetChg *pa = 0, SwAttrSetChg *pb = 0 );
void _Cut( sal_Bool bRemove );
// Is there a FtnContainer?
@@ -59,8 +59,11 @@ protected:
virtual void MakeAll();
virtual sal_Bool ShouldBwdMoved( SwLayoutFrm *pNewUpper, sal_Bool bHead, sal_Bool &rReformat );
virtual void Format( const SwBorderAttrs *pAttrs = 0 );
+ virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
+ virtual void SwClientNotify( const SwModify&, const SfxHint& );
+
public:
- SwSectionFrm( SwSection & ); //Inhalt wird nicht erzeugt!
+ SwSectionFrm( SwSection &, SwFrm* ); //Inhalt wird nicht erzeugt!
SwSectionFrm( SwSectionFrm &, sal_Bool bMaster );//_Nur_ zum Erzeugen von Master/Follows
~SwSectionFrm();
@@ -69,7 +72,6 @@ public:
virtual void Cut();
virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 );
- virtual void Modify( SfxPoolItem*, SfxPoolItem* );
inline const SwSectionFrm *GetFollow() const;
inline SwSectionFrm *GetFollow();
diff --git a/sw/source/core/inc/tabfrm.hxx b/sw/source/core/inc/tabfrm.hxx
index aec3e75f8a..22f80a538e 100644
--- a/sw/source/core/inc/tabfrm.hxx
+++ b/sw/source/core/inc/tabfrm.hxx
@@ -102,7 +102,7 @@ class SwTabFrm: public SwLayoutFrm, public SwFlowFrm
bool Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowKeep );
bool Join();
- 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 bHead, sal_Bool &rReformat );
@@ -110,10 +110,12 @@ class SwTabFrm: public SwLayoutFrm, public SwFlowFrm
protected:
virtual void MakeAll();
virtual void Format( const SwBorderAttrs *pAttrs = 0 );
+ virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
//Aendert nur die Framesize, nicht die PrtArea-SSize
virtual SwTwips GrowFrm ( SwTwips, sal_Bool bTst = sal_False, sal_Bool bInfo = sal_False );
+
public:
- SwTabFrm( SwTable & ); //Immer nach dem erzeugen _und_ pasten das
+ SwTabFrm( SwTable &, SwFrm* ); //Immer nach dem erzeugen _und_ pasten das
//Regist Flys rufen!
SwTabFrm( SwTabFrm & ); //_Nur_ zum erzeugen von Follows
~SwTabFrm();
@@ -127,7 +129,6 @@ public:
inline SwTabFrm *GetFollow();
SwTabFrm* FindMaster( bool bFirstMaster = false ) const;
- virtual void Modify( SfxPoolItem*, SfxPoolItem* );
virtual sal_Bool GetInfo( SfxPoolItem &rHnt ) const;
virtual void Paint( SwRect const&,
SwPrintData const*const pPrintData = NULL ) const;
diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx
index bc2c2d14cf..df28ce47a9 100644
--- a/sw/source/core/inc/txtfrm.hxx
+++ b/sw/source/core/inc/txtfrm.hxx
@@ -228,6 +228,8 @@ class SwTxtFrm: public SwCntntFrm
xub_StrLen nInsertPos, xub_StrLen nActPos,
xub_StrLen &nChgStart, xub_StrLen &nChgEnd,
xub_StrLen &nInvStart, xub_StrLen &nInvEnd);
+protected:
+ virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
public:
@@ -295,7 +297,6 @@ public:
SwRect Paint();
virtual void Paint( SwRect const&,
SwPrintData const*const pPrintData = NULL ) const;
- virtual void Modify( SfxPoolItem*, SfxPoolItem* );
virtual sal_Bool GetInfo( SfxPoolItem & ) const;
//Layoutorientiertes Cursortravelling: Linker, rechter Rand,
@@ -339,7 +340,7 @@ public:
inline const SwTxtNode *GetTxtNode() const
{ return (SwTxtNode*)SwCntntFrm::GetNode(); }
- SwTxtFrm(SwTxtNode * const);
+ SwTxtFrm(SwTxtNode * const, SwFrm* );
virtual ~SwTxtFrm();
// SwCntntFrm: der "kurze Dienstweg" fuer die Frames.
@@ -611,6 +612,8 @@ public:
{
return mnHeightOfLastLine;
}
+
+ static void repaintTextFrames( const SwTxtNode& rNode );
};
/*************************************************************************
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index 00b335bcf6..d657383369 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -99,22 +99,17 @@
#include <unoframe.hxx>
#include <unotextbodyhf.hxx>
#include <SwStyleNameMapper.hxx>
-/// OD 22.08.2002 #99657#
-/// include definition of class SvxBrushItem and GraphicObject
-/// in order to determine, if background is transparent.
#include <editeng/brshitem.hxx>
#include <svtools/grfmgr.hxx>
-
#include <cmdid.h>
#include <unomid.h>
#include <comcore.hrc>
#include <svx/svdundo.hxx> // #111827#
-// OD 2004-05-24 #i28701#
#include <sortedobjs.hxx>
-// --> OD 2006-03-06 #125892#
#include <HandleAnchorNodeChg.hxx>
-// <--
#include <svl/cjkoptions.hxx>
+#include <switerator.hxx>
+#include <pagedeschint.hxx>
using namespace ::com::sun::star;
using ::rtl::OUString;
@@ -190,7 +185,7 @@ void DelHFFormat( SwClient *pToRemove, SwFrmFmt *pFmt )
{
// Klammer, weil im DTOR SwClientIter das Flag bTreeChg zurueck
// gesetzt wird. Unguenstig, wenn das Format vorher zerstoert wird.
- SwClientIter aIter( *pFmt );
+ SwClientIter aIter( *pFmt ); // TODO
SwClient *pLast = aIter.GoStart();
if( pLast )
do {
@@ -224,16 +219,12 @@ void DelHFFormat( SwClient *pToRemove, SwFrmFmt *pFmt )
if ( pNode->IsCntntNode() &&
((SwCntntNode*)pNode)->GetDepends() )
{
- SwClientIter aIter( *(SwCntntNode*)pNode );
- do
+ SwCrsrShell *pShell = SwIterator<SwCrsrShell,SwCntntNode>::FirstElement( *(SwCntntNode*)pNode );
+ if( pShell )
{
- if( aIter()->ISA( SwCrsrShell ) )
- {
- ((SwCrsrShell*)aIter())->ParkCrsr( aIdx );
+ pShell->ParkCrsr( aIdx );
aIdx = nEnd-1;
- break;
- }
- } while ( aIter++ );
+ }
}
aIdx++;
pNode = & aIdx.GetNode();
@@ -533,7 +524,7 @@ SwFmtHeader::SwFmtHeader( sal_Bool bOn )
int SwFmtHeader::operator==( const SfxPoolItem& rAttr ) const
{
ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
- return ( pRegisteredIn == ((SwFmtHeader&)rAttr).GetRegisteredIn() &&
+ return ( GetRegisteredIn() == ((SwFmtHeader&)rAttr).GetRegisteredIn() &&
bActive == ((SwFmtHeader&)rAttr).IsActive() );
}
@@ -542,6 +533,11 @@ SfxPoolItem* SwFmtHeader::Clone( SfxItemPool* ) const
return new SwFmtHeader( *this );
}
+void SwFmtHeader::RegisterToFormat( SwFmt& rFmt )
+{
+ rFmt.Add(this);
+}
+
// class SwFmtFooter
// Implementierung teilweise inline im hxx
@@ -572,10 +568,15 @@ SwFmtFooter::SwFmtFooter( sal_Bool bOn )
DelHFFormat( this, GetFooterFmt() );
}
+void SwFmtFooter::RegisterToFormat( SwFmt& rFmt )
+{
+ rFmt.Add(this);
+}
+
int SwFmtFooter::operator==( const SfxPoolItem& rAttr ) const
{
ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
- return ( pRegisteredIn == ((SwFmtFooter&)rAttr).GetRegisteredIn() &&
+ return ( GetRegisteredIn() == ((SwFmtFooter&)rAttr).GetRegisteredIn() &&
bActive == ((SwFmtFooter&)rAttr).IsActive() );
}
@@ -649,6 +650,11 @@ SwFmtPageDesc::SwFmtPageDesc( const SwPageDesc *pDesc )
SwFmtPageDesc::~SwFmtPageDesc() {}
+bool SwFmtPageDesc::KnowsPageDesc() const
+{
+ return (GetRegisteredIn() != 0);
+}
+
int SwFmtPageDesc::operator==( const SfxPoolItem& rAttr ) const
{
ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
@@ -662,7 +668,39 @@ SfxPoolItem* SwFmtPageDesc::Clone( SfxItemPool* ) const
return new SwFmtPageDesc( *this );
}
-void SwFmtPageDesc::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwFmtPageDesc::SwClientNotify( const SwModify&, const SfxHint& rHint )
+{
+ const SwPageDescHint* pHint = dynamic_cast<const SwPageDescHint*>(&rHint);
+ if ( pHint )
+ {
+ // mba: shouldn't that be broadcasted also?
+ SwFmtPageDesc aDfltDesc( pHint->GetPageDesc() );
+ SwPageDesc* pDesc = pHint->GetPageDesc();
+ const SwModify* pMod = GetDefinedIn();
+ if ( pMod )
+ {
+ if( pMod->ISA( SwCntntNode ) )
+ ((SwCntntNode*)pMod)->SetAttr( aDfltDesc );
+ else if( pMod->ISA( SwFmt ))
+ ((SwFmt*)pMod)->SetFmtAttr( aDfltDesc );
+ else
+ {
+ DBG_ERROR( "What kind of SwModify is this?" );
+ RegisterToPageDesc( *pDesc );
+ }
+ }
+ else
+ // there could be an Undo-copy
+ RegisterToPageDesc( *pDesc );
+ }
+}
+
+void SwFmtPageDesc::RegisterToPageDesc( SwPageDesc& rDesc )
+{
+ rDesc.Add( this );
+}
+
+void SwFmtPageDesc::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
if( !pDefinedIn )
return;
@@ -2438,7 +2476,7 @@ SfxPoolItem* SwHeaderAndFooterEatSpacingItem::Clone( SfxItemPool* ) const
TYPEINIT1( SwFrmFmt, SwFmt );
IMPL_FIXEDMEMPOOL_NEWDEL_DLL( SwFrmFmt, 20, 20 )
-void SwFrmFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwFrmFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
SwFmtHeader *pH = 0;
SwFmtFooter *pF = 0;
@@ -2460,13 +2498,13 @@ void SwFrmFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
if( pH && pH->IsActive() && !pH->GetHeaderFmt() )
{ //Hat er keinen, mach ich ihm einen
SwFrmFmt *pFmt = GetDoc()->MakeLayoutFmt( RND_STD_HEADER, 0 );
- pFmt->Add( pH );
+ pH->RegisterToFormat( *pFmt );
}
if( pF && pF->IsActive() && !pF->GetFooterFmt() )
{ //Hat er keinen, mach ich ihm einen
SwFrmFmt *pFmt = GetDoc()->MakeLayoutFmt( RND_STD_FOOTER, 0 );
- pFmt->Add( pF );
+ pF->RegisterToFormat( *pFmt );
}
// MIB 24.3.98: Modify der Basisklasse muss immer gerufen werden, z.B.
@@ -2480,20 +2518,22 @@ void SwFrmFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
}
}
+void SwFrmFmt::RegisterToFormat( SwFmt& rFmt )
+{
+ rFmt.Add( this );
+}
+
//Vernichtet alle Frms, die in aDepend angemeldet sind.
void SwFrmFmt::DelFrms()
{
- SwClientIter aIter( *this );
- SwClient * pLast = aIter.GoStart();
+ SwIterator<SwFrm,SwFmt> aIter( *this );
+ SwFrm * pLast = aIter.First();
if( pLast )
do {
- if ( pLast->ISA(SwFrm) )
- {
- ((SwFrm*)pLast)->Cut();
+ pLast->Cut();
delete pLast;
- }
- } while( 0 != ( pLast = aIter++ ));
+ } while( 0 != ( pLast = aIter.Next() ));
}
void SwFrmFmt::MakeFrms()
@@ -2517,7 +2557,7 @@ SwRect SwFrmFmt::FindLayoutRect( const sal_Bool bPrtArea, const Point* pPoint,
SwNode2Layout aTmp( *pSectNd, pSectNd->GetIndex() - 1 );
pFrm = aTmp.NextFrm();
- if( pFrm && pFrm->GetRegisteredIn() != this )
+ if( pFrm && !pFrm->KnowsFormat(*this) )
{
// die Section hat keinen eigenen frame::Frame, also falls
// jemand die tatsaechliche Groe?e braucht, so muss das
@@ -2539,7 +2579,7 @@ SwRect SwFrmFmt::FindLayoutRect( const sal_Bool bPrtArea, const Point* pPoint,
else
{
sal_uInt16 nFrmType = RES_FLYFRMFMT == Which() ? FRM_FLY : USHRT_MAX;
- pFrm = ::GetFrmOfModify( *(SwModify*)this, nFrmType, pPoint,
+ pFrm = ::GetFrmOfModify( 0, *(SwModify*)this, nFrmType, pPoint,
0, bCalcFrm );
}
@@ -2555,8 +2595,7 @@ SwRect SwFrmFmt::FindLayoutRect( const sal_Bool bPrtArea, const Point* pPoint,
SwContact* SwFrmFmt::FindContactObj()
{
- SwClientIter aIter( *this );
- return (SwContact*)aIter.First( TYPE( SwContact ) );
+ return SwIterator<SwContact,SwFmt>::FirstElement( *this );
}
SdrObject* SwFrmFmt::FindSdrObject()
@@ -2573,7 +2612,7 @@ SdrObject* SwFrmFmt::FindRealSdrObject()
if( RES_FLYFRMFMT == Which() )
{
Point aNullPt;
- SwFlyFrm* pFly = (SwFlyFrm*)::GetFrmOfModify( *this, FRM_FLY,
+ SwFlyFrm* pFly = (SwFlyFrm*)::GetFrmOfModify( 0, *this, FRM_FLY,
&aNullPt, 0, sal_False );
return pFly ? pFly->GetVirtDrawObj() : 0;
}
@@ -2585,12 +2624,10 @@ sal_Bool SwFrmFmt::IsLowerOf( const SwFrmFmt& rFmt ) const
{
//Auch eine Verkettung von Innen nach aussen oder von aussen
//nach innen ist nicht zulaessig.
- SwClientIter aIter( *(SwModify*)this );
- SwFlyFrm *pSFly = (SwFlyFrm*)aIter.First( TYPE(SwFlyFrm) );
+ SwFlyFrm *pSFly = SwIterator<SwFlyFrm,SwFmt>::FirstElement(*this);
if( pSFly )
{
- SwClientIter aOtherIter( (SwModify&)rFmt );
- SwFlyFrm *pAskFly = (SwFlyFrm*)aOtherIter.First( TYPE(SwFlyFrm) );
+ SwFlyFrm *pAskFly = SwIterator<SwFlyFrm,SwFmt>::FirstElement(rFmt);
if( pAskFly )
return pSFly->IsLowerOf( pAskFly );
}
@@ -2672,22 +2709,20 @@ IMPL_FIXEDMEMPOOL_NEWDEL( SwFlyFrmFmt, 10, 10 )
SwFlyFrmFmt::~SwFlyFrmFmt()
{
- SwClientIter aIter( *this );
- SwClient * pLast = aIter.GoStart();
+ SwIterator<SwFlyFrm,SwFmt> aIter( *this );
+ SwFlyFrm * pLast = aIter.First();
if( pLast )
do {
- if ( pLast->ISA( SwFlyFrm ) )
delete pLast;
+ } while( 0 != ( pLast = aIter.Next() ));
- } while( 0 != ( pLast = aIter++ ));
-
- pLast = aIter.GoStart();
- if( pLast )
+ SwIterator<SwFlyDrawContact,SwFmt> a2ndIter( *this );
+ SwFlyDrawContact* pC = a2ndIter.First();
+ if( pC )
do {
- if ( pLast->ISA( SwFlyDrawContact ) )
- delete pLast;
+ delete pC;
- } while( 0 != ( pLast = aIter++ ));
+ } while( 0 != ( pC = a2ndIter.Next() ));
}
//Erzeugen der Frms wenn das Format einen Absatzgebundenen Rahmen beschreibt.
@@ -2696,8 +2731,8 @@ SwFlyFrmFmt::~SwFlyFrmFmt()
void SwFlyFrmFmt::MakeFrms()
{
// gibts ueberhaupt ein Layout ??
- if( !GetDoc()->GetRootFrm() )
- return;
+ if( !GetDoc()->GetCurrentViewShell() )
+ return; //swmod 071108//swmod 071225
SwModify *pModify = 0;
// OD 24.07.2003 #111032# - create local copy of anchor attribute for possible changes.
@@ -2730,8 +2765,7 @@ void SwFlyFrmFmt::MakeFrms()
if ( pCNd )
// <--
{
- SwClientIter aIter( *pCNd );
- if ( aIter.First( TYPE(SwFrm) ) )
+ if( SwIterator<SwFrm,SwCntntNode>::FirstElement( *pCNd ) )
{
pModify = pCNd;
}
@@ -2759,17 +2793,15 @@ void SwFlyFrmFmt::MakeFrms()
case FLY_AT_PAGE:
{
sal_uInt16 nPgNum = aAnchorAttr.GetPageNum();
- SwPageFrm *pPage = (SwPageFrm*)GetDoc()->GetRootFrm()->Lower();
+ SwPageFrm *pPage = (SwPageFrm*)GetDoc()->GetCurrentLayout()->Lower(); //swmod 080218
if( !nPgNum && aAnchorAttr.GetCntntAnchor() )
{
SwCntntNode *pCNd =
aAnchorAttr.GetCntntAnchor()->nNode.GetNode().GetCntntNode();
- SwClientIter aIter( *pCNd );
- do
+ SwIterator<SwFrm,SwCntntNode> aIter( *pCNd );
+ for (SwFrm* pFrm = aIter.First(); pFrm; pFrm = aIter.Next() )
{
- if( aIter()->ISA( SwFrm ) )
- {
- pPage = ((SwFrm*)aIter())->FindPageFrm();
+ pPage = pFrm->FindPageFrm();
if( pPage )
{
nPgNum = pPage->GetPhyPageNum();
@@ -2780,7 +2812,6 @@ void SwFlyFrmFmt::MakeFrms()
}
break;
}
- } while ( aIter++ );
}
while ( pPage )
{
@@ -2801,10 +2832,8 @@ void SwFlyFrmFmt::MakeFrms()
if( pModify )
{
- SwClientIter aIter( *pModify );
- for( SwFrm *pFrm = (SwFrm*)aIter.First( TYPE(SwFrm) );
- pFrm;
- pFrm = (SwFrm*)aIter.Next() )
+ SwIterator<SwFrm,SwModify> aIter( *pModify );
+ for( SwFrm *pFrm = aIter.First(); pFrm; pFrm = aIter.Next() )
{
sal_Bool bAdd = !pFrm->IsCntntFrm() ||
!((SwCntntFrm*)pFrm)->IsFollow();
@@ -2853,16 +2882,16 @@ void SwFlyFrmFmt::MakeFrms()
switch( aAnchorAttr.GetAnchorId() )
{
case FLY_AT_FLY:
- pFly = new SwFlyLayFrm( this, pFrm );
+ pFly = new SwFlyLayFrm( this, pFrm, pFrm );
break;
case FLY_AT_PARA:
case FLY_AT_CHAR:
- pFly = new SwFlyAtCntFrm( this, pFrm );
+ pFly = new SwFlyAtCntFrm( this, pFrm, pFrm );
break;
case FLY_AS_CHAR:
- pFly = new SwFlyInCntFrm( this, pFrm );
+ pFly = new SwFlyInCntFrm( this, pFrm, pFrm );
break;
default:
ASSERT( !this, "Neuer Ankertyp" )
@@ -2879,7 +2908,7 @@ void SwFlyFrmFmt::MakeFrms()
SwFlyFrm* SwFlyFrmFmt::GetFrm( const Point* pPoint, const sal_Bool bCalcFrm ) const
{
- return (SwFlyFrm*)::GetFrmOfModify( *(SwModify*)this, FRM_FLY,
+ return (SwFlyFrm*)::GetFrmOfModify( 0, *(SwModify*)this, FRM_FLY,
pPoint, 0, bCalcFrm );
}
@@ -2903,8 +2932,7 @@ sal_Bool SwFlyFrmFmt::GetInfo( SfxPoolItem& rInfo ) const
{
case RES_CONTENT_VISIBLE:
{
- ((SwPtrMsgPoolItem&)rInfo).pObject =
- SwClientIter( *(SwFlyFrmFmt*)this ).First( TYPE(SwFrm) );
+ ((SwPtrMsgPoolItem&)rInfo).pObject = SwIterator<SwFrm,SwFmt>::FirstElement( *this );
}
return sal_False;
@@ -2930,7 +2958,7 @@ void SwFlyFrmFmt::SetObjTitle( const String& rTitle, bool bBroadcast )
SwStringMsgPoolItem aOld( RES_TITLE_CHANGED, pMasterObject->GetTitle() );
SwStringMsgPoolItem aNew( RES_TITLE_CHANGED, rTitle );
pMasterObject->SetTitle( rTitle );
- Modify( &aOld, &aNew );
+ ModifyNotification( &aOld, &aNew );
}
else
{
@@ -2966,7 +2994,7 @@ void SwFlyFrmFmt::SetObjDescription( const String& rDescription, bool bBroadcast
SwStringMsgPoolItem aOld( RES_DESCRIPTION_CHANGED, pMasterObject->GetDescription() );
SwStringMsgPoolItem aNew( RES_DESCRIPTION_CHANGED, rDescription );
pMasterObject->SetDescription( rDescription );
- Modify( &aOld, &aNew );
+ ModifyNotification( &aOld, &aNew );
}
else
{
@@ -3074,33 +3102,32 @@ SwHandleAnchorNodeChg::SwHandleAnchorNodeChg( SwFlyFrmFmt& _rFlyFrmFmt,
{
// determine 'old' number of anchor frames
sal_uInt32 nOldNumOfAnchFrm( 0L );
- SwClientIter aOldIter( *(aOldAnchorFmt.GetCntntAnchor()->nNode.GetNode().GetCntntNode()) );
- for( aOldIter.First( TYPE(SwFrm) ); aOldIter(); aOldIter.Next() )
+ SwIterator<SwFrm,SwCntntNode> aOldIter( *(aOldAnchorFmt.GetCntntAnchor()->nNode.GetNode().GetCntntNode()) );
+ for( SwFrm* pOld = aOldIter.First(); pOld; pOld = aOldIter.Next() )
{
++nOldNumOfAnchFrm;
}
// determine 'new' number of anchor frames
sal_uInt32 nNewNumOfAnchFrm( 0L );
- SwClientIter aNewIter( *(_rNewAnchorFmt.GetCntntAnchor()->nNode.GetNode().GetCntntNode()) );
- for( aNewIter.First( TYPE(SwFrm) ); aNewIter(); aNewIter.Next() )
+ SwIterator<SwFrm,SwCntntNode> aNewIter( *(_rNewAnchorFmt.GetCntntAnchor()->nNode.GetNode().GetCntntNode()) );
+ for( SwFrm* pNew = aNewIter.First(); pNew; pNew = aNewIter.Next() )
{
++nNewNumOfAnchFrm;
}
if ( nOldNumOfAnchFrm != nNewNumOfAnchFrm )
{
// delete existing fly frames except <_pKeepThisFlyFrm>
- SwClientIter aIter( mrFlyFrmFmt );
- SwClient* pLast = aIter.GoStart();
- if ( pLast )
+ SwIterator<SwFrm,SwFmt> aIter( mrFlyFrmFmt );
+ SwFrm* pFrm = aIter.First();
+ if ( pFrm )
{
do {
- SwFrm* pFrm( dynamic_cast<SwFrm*>(pLast) );
- if ( pFrm && pFrm != _pKeepThisFlyFrm )
+ if ( pFrm != _pKeepThisFlyFrm )
{
pFrm->Cut();
delete pFrm;
}
- } while( 0 != ( pLast = aIter++ ));
+ } while( 0 != ( pFrm = aIter.Next() ));
}
// indicate, that re-creation of fly frames necessary
mbAnchorNodeChanged = true;
@@ -3214,7 +3241,7 @@ IMapObject* SwFrmFmt::GetIMapObject( const Point& rPoint,
if( !pFly )
{
- pFly = (SwFlyFrm*) SwClientIter( *(SwFrmFmt*)this ).First( TYPE( SwFlyFrm ));
+ pFly = SwIterator<SwFlyFrm,SwFmt>::FirstElement( *this );
if( !pFly )
return 0;
}
diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx
index b07a0d6dd6..b406e18f80 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -33,6 +33,7 @@
#include "viewsh.hxx"
#include "doc.hxx"
#include "viewimp.hxx"
+#include "viewopt.hxx"
#include "swtypes.hxx"
#include "dflyobj.hxx"
#include "dcontact.hxx"
@@ -179,9 +180,9 @@ sal_Bool SwCntntFrm::ShouldBwdMoved( SwLayoutFrm *pNewUpper, sal_Bool, sal_Bool
//determine space left in new upper frame
nSpace = (aRect.*fnRectX->fnGetHeight)();
-
+ const ViewShell *pSh = pNewUpper->getRootFrm()->GetCurrShell();
if ( IsInFtn() ||
- pIDSA->get(IDocumentSettingAccess::BROWSE_MODE) ||
+ (pSh && pSh->GetViewOptions()->getBrowseMode()) ||
pNewUpper->IsCellFrm() ||
( pNewUpper->IsInSct() && ( pNewUpper->IsSctFrm() ||
( pNewUpper->IsColBodyFrm() &&
@@ -577,7 +578,13 @@ void SwFrm::MakePos()
if( bReverse )
aFrm.Pos().X() += pPrv->Frm().Width();
else
- aFrm.Pos().X() -= aFrm.Width();
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ {
+ if ( bVertL2R )
+ aFrm.Pos().X() += pPrv->Frm().Width();
+ else
+ aFrm.Pos().X() -= aFrm.Width();
+ }
}
else
aFrm.Pos().Y() += pPrv->Frm().Height();
@@ -645,13 +652,15 @@ void SwFrm::MakePos()
aFrm.Pos().X() += GetUpper()->Prt().Width()
- aFrm.Width();
}
- else if( bVert && FRM_NOTE_VERT & nMyType && !bReverse )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ else if( bVert && !bVertL2R && FRM_NOTE_VERT & nMyType && !bReverse )
aFrm.Pos().X() -= aFrm.Width() - GetUpper()->Prt().Width();
}
}
else
aFrm.Pos().X() = aFrm.Pos().Y() = 0;
- if( IsBodyFrm() && bVert && !bReverse && GetUpper() )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if( IsBodyFrm() && bVert && !bVertL2R && !bReverse && GetUpper() )
aFrm.Pos().X() += GetUpper()->Prt().Width() - aFrm.Width();
bValidPos = sal_True;
}
@@ -732,8 +741,8 @@ void SwPageFrm::MakeAll()
pAttrs = pAccess->Get();
}
//Bei der BrowseView gelten feste Einstellungen.
- ViewShell *pSh = GetShell();
- if ( pSh && GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
+ if ( pSh && pSh->GetViewOptions()->getBrowseMode() )
{
const Size aBorder = pSh->GetOut()->PixelToLogic( pSh->GetBrowseBorder() );
const long nTop = pAttrs->CalcTopLine() + aBorder.Height();
@@ -873,7 +882,8 @@ void SwLayoutFrm::MakeAll()
//uebernimmt im DTor die Benachrichtigung
const SwLayNotify aNotify( this );
sal_Bool bVert = IsVertical();
- SwRectFn fnRect = ( IsNeighbourFrm() == bVert )? fnRectHori : fnRectVert;
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ SwRectFn fnRect = ( IsNeighbourFrm() == bVert )? fnRectHori : ( IsVertLR() ? fnRectVertL2R : fnRectVert );
SwBorderAttrAccess *pAccess = 0;
const SwBorderAttrs*pAttrs = 0;
@@ -986,11 +996,11 @@ sal_Bool SwCntntFrm::MakePrtArea( const SwBorderAttrs &rAttrs )
const long nRight = ((SwBorderAttrs&)rAttrs).CalcRight( this );
(this->*fnRect->fnSetXMargins)( nLeft, nRight );
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
SwTwips nWidthArea;
if( pSh && 0!=(nWidthArea=(pSh->VisArea().*fnRect->fnGetWidth)()) &&
GetUpper()->IsPageBodyFrm() && // nicht dagegen bei BodyFrms in Columns
- pSh->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ pSh->GetViewOptions()->getBrowseMode() )
{
//Nicht ueber die Kante des sichbaren Bereiches hinausragen.
//Die Seite kann breiter sein, weil es Objekte mit "ueberbreite"
diff --git a/sw/source/core/layout/colfrm.cxx b/sw/source/core/layout/colfrm.cxx
index f53f373910..a9ccc8b879 100644
--- a/sw/source/core/layout/colfrm.cxx
+++ b/sw/source/core/layout/colfrm.cxx
@@ -45,6 +45,7 @@
#include "bodyfrm.hxx" // ColumnFrms jetzt mit BodyFrm
#include "rootfrm.hxx" // wg. RemoveFtns
#include "sectfrm.hxx" // wg. FtnAtEnd-Flag
+#include "switerator.hxx"
// ftnfrm.cxx:
void lcl_RemoveFtns( SwFtnBossFrm* pBoss, sal_Bool bPageOnly, sal_Bool bEndNotes );
@@ -58,11 +59,11 @@ void lcl_RemoveFtns( SwFtnBossFrm* pBoss, sal_Bool bPageOnly, sal_Bool bEndNotes
|* Letzte Aenderung AMA 30. Oct 98
|*
|*************************************************************************/
-SwColumnFrm::SwColumnFrm( SwFrmFmt *pFmt ):
- SwFtnBossFrm( pFmt )
+SwColumnFrm::SwColumnFrm( SwFrmFmt *pFmt, SwFrm* pSib ):
+ SwFtnBossFrm( pFmt, pSib )
{
nType = FRMC_COLUMN;
- SwBodyFrm* pColBody = new SwBodyFrm( pFmt->GetDoc()->GetDfltFrmFmt() );
+ SwBodyFrm* pColBody = new SwBodyFrm( pFmt->GetDoc()->GetDfltFrmFmt(), pSib );
pColBody->InsertBehind( this, 0 ); // ColumnFrms jetzt mit BodyFrm
SetMaxFtnHeight( LONG_MAX );
}
@@ -143,8 +144,8 @@ static sal_Bool lcl_AddColumns( SwLayoutFrm *pCont, sal_uInt16 nCount )
if ( pCont->IsBodyFrm() )
pAttrOwner = pCont->FindPageFrm();
SwLayoutFrm *pNeighbourCol = 0;
- SwClientIter aIter( *pAttrOwner->GetFmt() );
- SwLayoutFrm *pNeighbour = (SwLayoutFrm*)aIter.First( TYPE(SwLayoutFrm) );
+ SwIterator<SwLayoutFrm,SwFmt> aIter( *pAttrOwner->GetFmt() );
+ SwLayoutFrm *pNeighbour = aIter.First();
sal_uInt16 nAdd = 0;
SwFrm *pCol = pCont->Lower();
@@ -157,7 +158,7 @@ static sal_Bool lcl_AddColumns( SwLayoutFrm *pCont, sal_uInt16 nCount )
pNeighbourCol != pCont )
break;
pNeighbourCol = 0;
- pNeighbour = (SwLayoutFrm*)aIter.Next();
+ pNeighbour = aIter.Next();
}
sal_Bool bRet;
@@ -174,7 +175,7 @@ static sal_Bool lcl_AddColumns( SwLayoutFrm *pCont, sal_uInt16 nCount )
}
for ( sal_uInt16 i = 0; i < nCount; ++i )
{
- SwColumnFrm *pTmpCol = new SwColumnFrm( pNeighbourCol->GetFmt() );
+ SwColumnFrm *pTmpCol = new SwColumnFrm( pNeighbourCol->GetFmt(), pCont );
pTmpCol->SetMaxFtnHeight( nMax );
pTmpCol->InsertBefore( pCont, NULL );
pNeighbourCol = (SwLayoutFrm*)pNeighbourCol->GetNext();
@@ -186,7 +187,7 @@ static sal_Bool lcl_AddColumns( SwLayoutFrm *pCont, sal_uInt16 nCount )
for ( sal_uInt16 i = 0; i < nCount; ++i )
{
SwFrmFmt *pFmt = pDoc->MakeFrmFmt( aEmptyStr, pDoc->GetDfltFrmFmt());
- SwColumnFrm *pTmp = new SwColumnFrm( pFmt );
+ SwColumnFrm *pTmp = new SwColumnFrm( pFmt, pCont );
pTmp->SetMaxFtnHeight( nMax );
pTmp->Paste( pCont );
}
@@ -248,7 +249,7 @@ void SwLayoutFrm::ChgColumns( const SwFmtCol &rOld, const SwFmtCol &rNew,
// SaveCntnt wuerde auch den Inhalt der Fussnotencontainer aufsaugen
// und im normalen Textfluss unterbringen.
if( IsPageBodyFrm() )
- pDoc->GetRootFrm()->RemoveFtns( (SwPageFrm*)GetUpper(), sal_True, sal_False );
+ pDoc->GetCurrentLayout()->RemoveFtns( (SwPageFrm*)GetUpper(), sal_True, sal_False ); //swmod 080218
pSave = ::SaveCntnt( this );
//Wenn Spalten existieren, jetzt aber eine Spaltenanzahl von
@@ -336,7 +337,8 @@ void SwLayoutFrm::AdjustColumns( const SwFmtCol *pAttr, sal_Bool bAdjustAttribut
}
const sal_Bool bVert = IsVertical();
- SwRectFn fnRect = bVert ? fnRectVert : fnRectHori;
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ SwRectFn fnRect = bVert ? ( IsVertLR() ? fnRectVertL2R : fnRectVert ) : fnRectHori;
//Ist ein Pointer da, oder sollen wir die Attribute einstellen,
//so stellen wir auf jeden Fall die Spaltenbreiten ein. Andernfalls
diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx
index 03ffea9455..8d22e0523c 100644
--- a/sw/source/core/layout/findfrm.cxx
+++ b/sw/source/core/layout/findfrm.cxx
@@ -47,8 +47,8 @@
#include "ftnfrm.hxx"
#include "txtftn.hxx"
#include "fmtftn.hxx"
-// OD 09.01.2004 #i11859#
#include <txtfrm.hxx> // SwTxtFrm
+#include <switerator.hxx>
/*************************************************************************
|*
@@ -468,22 +468,6 @@ const SwCntntFrm* SwCntntFrm::ImplGetNextCntntFrm( bool bFwd ) const
|* Letzte Aenderung MA 05. Sep. 93
|*
|*************************************************************************/
-SwRootFrm* SwFrm::FindRootFrm()
-{
- // MIB: A layout frame is always registerd at a SwFrmFmt and a content
- // frame alyways at a SwCntntNode. For any other case we won't find
- // a root frame.
- // Casting the GetDep() result instead of the frame itself (that has
- // been done before) makes it save to use that method in constructors
- // and destructors.
- ASSERT( GetDep(), "frame is not registered any longer" );
- ASSERT( IsLayoutFrm() || IsCntntFrm(), "invalid frame type" );
- SwDoc *pDoc = IsLayoutFrm()
- ? static_cast < SwFrmFmt * >( GetDep() )->GetDoc()
- : static_cast < SwCntntNode * >( GetDep() )->GetDoc();
- return pDoc->GetRootFrm();
-}
-
SwPageFrm* SwFrm::FindPageFrm()
{
SwFrm *pRet = this;
@@ -1460,6 +1444,9 @@ void SwFrm::SetDirFlags( sal_Bool bVert )
{
bVertical = pAsk->IsVertical() ? 1 : 0;
bReverse = pAsk->IsReverse() ? 1 : 0;
+
+ bVertLR = pAsk->IsVertLR() ? 1 : 0;
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
if ( !pAsk->bInvalidVert )
bInvalidVert = sal_False;
}
@@ -1699,13 +1686,10 @@ const SwCellFrm& SwCellFrm::FindStartEndOfRowSpanCell( bool bStart, bool bCurren
GetTabBox()->FindStartOfRowSpan( *pTable, nMax ) :
GetTabBox()->FindEndOfRowSpan( *pTable, nMax );
- SwClientIter aIter( const_cast<SwFrmFmt&>( *rMasterBox.GetFrmFmt()) );
+ SwIterator<SwCellFrm,SwFmt> aIter( *rMasterBox.GetFrmFmt() );
- for ( SwClient* pLast = aIter.First( TYPE( SwFrm ) ); pLast; pLast = aIter.Next() )
+ for ( SwCellFrm* pMasterCell = aIter.First(); pMasterCell; pMasterCell = aIter.Next() )
{
- ASSERT( ((SwFrm*)pLast)->IsCellFrm(), "Non-row frame registered in table line" )
- const SwCellFrm* pMasterCell = static_cast<const SwCellFrm*>(pLast);
-
if ( pMasterCell->GetTabBox() == &rMasterBox )
{
const SwTabFrm* pMasterTable = static_cast<const SwTabFrm*>(pMasterCell->GetUpper()->GetUpper());
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx
index 18af859fe0..712ab47846 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -30,11 +30,13 @@
#include "pam.hxx"
#include "swtable.hxx"
#include "frame.hxx"
+#include "rootfrm.hxx"
#include "pagefrm.hxx"
#include "flyfrm.hxx"
#include "viewsh.hxx"
#include "doc.hxx"
#include "viewimp.hxx"
+#include "viewopt.hxx"
#include "dflyobj.hxx"
#include "frmtool.hxx"
#include "dcontact.hxx"
@@ -49,7 +51,6 @@
#include <fmtftn.hxx>
#include <editeng/pgrditem.hxx>
#include <paratr.hxx>
-
#include "ftnfrm.hxx"
#include "txtfrm.hxx"
#include "tabfrm.hxx"
@@ -61,15 +62,11 @@
#include "section.hxx"
#include "dbg_lay.hxx"
#include "lineinfo.hxx"
-// OD 2004-03-02 #106629#
#include <fmtclbl.hxx>
-// --> OD 2004-06-23 #i28701#
#include <sortedobjs.hxx>
#include <layouter.hxx>
-// <--
-// --> OD 2004-10-15 #i26945#
#include <fmtfollowtextflow.hxx>
-// <--
+#include <switerator.hxx>
sal_Bool SwFlowFrm::bMoveBwdJump = sal_False;
@@ -604,7 +601,7 @@ void SwFlowFrm::MoveSubTree( SwLayoutFrm* pParent, SwFrm* pSibling )
ASSERT( rThis.GetUpper(), "Wo kommen wir denn her?" );
//Sparsamer benachrichtigen wenn eine Action laeuft.
- ViewShell *pSh = rThis.GetShell();
+ ViewShell *pSh = rThis.getRootFrm()->GetCurrShell();
const SwViewImp *pImp = pSh ? pSh->Imp() : 0;
const sal_Bool bComplete = pImp && pImp->IsAction() && pImp->GetLayAction().IsComplete();
@@ -737,20 +734,13 @@ SwSectionFrm* SwSectionFrm::FindMaster() const
{
ASSERT( IsFollow(), "SwSectionFrm::FindMaster(): !IsFollow" );
- SwClientIter aIter( *pSection->GetFmt() );
- SwClient *pLast = aIter.GoStart();
-
- while ( pLast )
+ SwIterator<SwSectionFrm,SwFmt> aIter( *pSection->GetFmt() );
+ SwSectionFrm* pSect = aIter.First();
+ while ( pSect )
{
- if ( pLast->ISA( SwFrm ) )
- {
- ASSERT( ((SwFrm*)pLast)->IsSctFrm(),
- "Non-section frame registered in section format" )
- SwSectionFrm* pSect = (SwSectionFrm*)pLast;
if( pSect->GetFollow() == this )
return pSect;
- }
- pLast = aIter++;
+ pSect = aIter.Next();
}
ASSERT( sal_False, "Follow ist lost in Space." );
@@ -761,17 +751,10 @@ SwTabFrm* SwTabFrm::FindMaster( bool bFirstMaster ) const
{
ASSERT( IsFollow(), "SwTabFrm::FindMaster(): !IsFollow" );
- SwClientIter aIter( *GetTable()->GetFrmFmt() );
- SwClient* pLast = aIter.GoStart();
-
- while ( pLast )
+ SwIterator<SwTabFrm,SwFmt> aIter( *GetTable()->GetFrmFmt() );
+ SwTabFrm* pTab = aIter.First();
+ while ( pTab )
{
- if ( pLast->ISA( SwFrm ) )
- {
- ASSERT( ((SwFrm*)pLast)->IsTabFrm(),
- "Non-table frame registered in table format" )
- SwTabFrm* pTab = (SwTabFrm*)pLast;
-
if ( bFirstMaster )
{
//
@@ -795,8 +778,8 @@ SwTabFrm* SwTabFrm::FindMaster( bool bFirstMaster ) const
if ( pTab->GetFollow() == this )
return pTab;
}
- }
- pLast = aIter++;
+
+ pTab = aIter.Next();
}
ASSERT( sal_False, "Follow ist lost in Space." );
@@ -1042,12 +1025,13 @@ SwLayoutFrm *SwFrm::GetNextLeaf( MakePageType eMakePage )
return pLayLeaf;
SwPageFrm *pNew = pLayLeaf->FindPageFrm();
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
// #111704# The pagedesc check does not make sense for frames in fly frames
if ( pNew != FindPageFrm() && !bNewPg && !IsInFly() &&
// --> FME 2005-05-10 #i46683#
// Do not consider page descriptions in browse mode (since
// MoveBwd ignored them)
- !pNew->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ !(pSh && pSh->GetViewOptions()->getBrowseMode() ) )
// <--
{
if( WrongPageDesc( pNew ) )
@@ -1173,7 +1157,8 @@ sal_Bool SwFlowFrm::IsPrevObjMove() const
// und fuer diesen ggf. Umbrechen.
//!!!!!!!!!!!Hack!!!!!!!!!!!
- if ( rThis.GetUpper()->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ const ViewShell *pSh = rThis.getRootFrm()->GetCurrShell();
+ if( pSh && pSh->GetViewOptions()->getBrowseMode() )
return sal_False;
SwFrm *pPre = rThis.FindPrev();
@@ -1252,9 +1237,11 @@ sal_Bool SwFlowFrm::IsPrevObjMove() const
sal_Bool SwFlowFrm::IsPageBreak( sal_Bool bAct ) const
{
if ( !IsFollow() && rThis.IsInDocBody() &&
- ( !rThis.IsInTab() || ( rThis.IsTabFrm() && !rThis.GetUpper()->IsInTab() ) ) && // i66968
- !rThis.GetUpper()->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ ( !rThis.IsInTab() || ( rThis.IsTabFrm() && !rThis.GetUpper()->IsInTab() ) ) ) // i66968
{
+ const ViewShell *pSh = rThis.getRootFrm()->GetCurrShell();
+ if( pSh && pSh->GetViewOptions()->getBrowseMode() )
+ return sal_False;
const SwAttrSet *pSet = rThis.GetAttrSet();
//Vorgaenger ermitteln
@@ -2113,7 +2100,7 @@ sal_Bool SwFlowFrm::MoveFwd( sal_Bool bMakePage, sal_Bool bPageBreak, sal_Bool b
rThis.Prepare( PREP_BOSS_CHGD, 0, sal_False );
if( !bSamePage )
{
- ViewShell *pSh = rThis.GetShell();
+ ViewShell *pSh = rThis.getRootFrm()->GetCurrShell();
if ( pSh && !pSh->Imp()->IsUpdateExpFlds() )
pSh->GetDoc()->SetNewFldLst(true); //Wird von CalcLayout() hinterher erledigt!
@@ -2125,7 +2112,9 @@ sal_Bool SwFlowFrm::MoveFwd( sal_Bool bMakePage, sal_Bool bPageBreak, sal_Bool b
}
}
// OD 30.10.2002 #97265# - no <CheckPageDesc(..)> in online layout
- if ( !pNewPage->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ const ViewShell *pSh = rThis.getRootFrm()->GetCurrShell();
+
+ if ( !( pSh && pSh->GetViewOptions()->getBrowseMode() ) )
{
// --> OD 2009-12-31 #i106452#
// check page description not only in situation with sections.
@@ -2593,7 +2582,7 @@ sal_Bool SwFlowFrm::MoveBwd( sal_Bool &rbReformat )
{
//Kann sein, dass ich einen Container bekam.
SwFtnFrm *pOld = rThis.FindFtnFrm();
- SwFtnFrm *pNew = new SwFtnFrm( pOld->GetFmt(),
+ SwFtnFrm *pNew = new SwFtnFrm( pOld->GetFmt(), pOld,
pOld->GetRef(), pOld->GetAttr() );
if ( pOld->GetMaster() )
{
@@ -2674,7 +2663,7 @@ sal_Bool SwFlowFrm::MoveBwd( sal_Bool &rbReformat )
if( pNewPage != pOldPage )
{
rThis.Prepare( PREP_BOSS_CHGD, (const void*)pOldPage, sal_False );
- ViewShell *pSh = rThis.GetShell();
+ ViewShell *pSh = rThis.getRootFrm()->GetCurrShell();
if ( pSh && !pSh->Imp()->IsUpdateExpFlds() )
pSh->GetDoc()->SetNewFldLst(true); //Wird von CalcLayout() hinterher eledigt!
@@ -2684,7 +2673,7 @@ sal_Bool SwFlowFrm::MoveBwd( sal_Bool &rbReformat )
pNewPage->InvalidateWordCount();
// OD 30.10.2002 #97265# - no <CheckPageDesc(..)> in online layout
- if ( !pNewPage->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ if ( !( pSh && pSh->GetViewOptions()->getBrowseMode() ) )
{
if ( bCheckPageDescs && pNewPage->GetNext() )
{
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index 9e3a355751..7e26349598 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -50,27 +50,16 @@
#include <fmtcnct.hxx>
#include <layhelp.hxx>
#include <ndtxt.hxx>
-
-// --> OD 2010-09-14 #i113730#
#include <svx/svdogrp.hxx>
-// <--
-// OD 16.04.2003 #i13147# - for <SwFlyFrm::GetContour(..)>
#include <ndgrf.hxx>
-// OD 29.10.2003 #113049#
#include <tolayoutanchoredobjectposition.hxx>
-// OD 06.11.2003 #i22305#
#include <fmtfollowtextflow.hxx>
-// --> OD 2004-06-28 #i28701#
#include <sortedobjs.hxx>
#include <objectformatter.hxx>
-// <--
-// OD 2004-04-06 #i26791#
#include <anchoredobject.hxx>
-// --> OD 2006-01-31 #i53298#
#include <ndole.hxx>
-// <--
#include <swtable.hxx>
-
+#include <svx/svdpage.hxx>
#include "doc.hxx"
#include "viewsh.hxx"
#include "layouter.hxx"
@@ -80,6 +69,7 @@
#include "pam.hxx"
#include "frmatr.hxx"
#include "viewimp.hxx"
+#include "viewopt.hxx"
#include "errhdl.hxx"
#include "dcontact.hxx"
#include "dflyobj.hxx"
@@ -98,6 +88,7 @@
#include "sectfrm.hxx"
#include <vcl/svapp.hxx>
#include <vcl/salbtype.hxx> // FRound
+#include "switerator.hxx"
using namespace ::com::sun::star;
@@ -114,8 +105,8 @@ TYPEINIT2(SwFlyFrm,SwLayoutFrm,SwAnchoredObject);
|*
|*************************************************************************/
-SwFlyFrm::SwFlyFrm( SwFlyFrmFmt *pFmt, SwFrm *pAnch ) :
- SwLayoutFrm( pFmt ),
+SwFlyFrm::SwFlyFrm( SwFlyFrmFmt *pFmt, SwFrm* pSib, SwFrm *pAnch ) :
+ SwLayoutFrm( pFmt, pSib ),
// OD 2004-03-22 #i26791#
SwAnchoredObject(),
// OD 2004-05-27 #i26791# - moved to <SwAnchoredObject>
@@ -152,11 +143,32 @@ SwFlyFrm::SwFlyFrm( SwFlyFrmFmt *pFmt, SwFrm *pAnch ) :
bInvalidVert = 0;
bDerivedVert = 0;
bDerivedR2L = 0;
- if( FRMDIR_HORI_LEFT_TOP == nDir || FRMDIR_HORI_RIGHT_TOP == nDir
- || pFmt->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ if( FRMDIR_HORI_LEFT_TOP == nDir || FRMDIR_HORI_RIGHT_TOP == nDir )
+ {
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ bVertLR = 0;
bVertical = 0;
- else
- bVertical = 1;
+ }
+ else
+ {
+ const ViewShell *pSh = getRootFrm() ? getRootFrm()->GetCurrShell() : 0;
+ if( pSh && pSh->GetViewOptions()->getBrowseMode() )
+ {
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ bVertLR = 0;
+ bVertical = 0;
+ }
+ else
+ {
+ bVertical = 1;
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( FRMDIR_VERT_TOP_LEFT == nDir )
+ bVertLR = 1;
+ else
+ bVertLR = 0;
+ }
+ }
+
bVert = bVertical;
bInvalidR2L = 0;
if( FRMDIR_HORI_RIGHT_TOP == nDir )
@@ -291,7 +303,7 @@ SwFlyFrm::~SwFlyFrm()
// anchor will do that.
if( IsAccessibleFrm() && GetFmt() && (IsFlyInCntFrm() || !GetAnchorFrm()) )
{
- SwRootFrm *pRootFrm = FindRootFrm();
+ SwRootFrm *pRootFrm = getRootFrm();
if( pRootFrm && pRootFrm->IsAnyShellAccessible() )
{
ViewShell *pVSh = pRootFrm->GetCurrShell();
@@ -382,15 +394,81 @@ void SwFlyFrm::DeleteCnt()
|* Letzte Aenderung MA 30. Nov. 95
|*
|*************************************************************************/
+
+sal_uInt32 SwFlyFrm::_GetOrdNumForNewRef( const SwFlyDrawContact* pContact )
+{
+ sal_uInt32 nOrdNum( 0L );
+
+ // search for another Writer fly frame registered at same frame format
+ SwIterator<SwFlyFrm,SwFmt> aIter( *pContact->GetFmt() );
+ const SwFlyFrm* pFlyFrm( 0L );
+ for ( pFlyFrm = aIter.First(); pFlyFrm; pFlyFrm = aIter.Next() )
+ {
+ if ( pFlyFrm != this )
+ {
+ 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 = pContact->GetMaster()->GetOrdNumDirect();
+ // <--
+ }
+
+ return nOrdNum;
+}
+
+SwVirtFlyDrawObj* SwFlyFrm::CreateNewRef( SwFlyDrawContact *pContact )
+{
+ SwVirtFlyDrawObj *pDrawObj = new SwVirtFlyDrawObj( *pContact->GetMaster(), this );
+ pDrawObj->SetModel( pContact->GetMaster()->GetModel() );
+ pDrawObj->SetUserCall( pContact );
+
+ //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 = pContact->GetMaster()->GetPage() ) )
+ {
+ const sal_uInt32 nOrdNum = pContact->GetMaster()->GetOrdNum();
+ pPg->ReplaceObject( pDrawObj, nOrdNum );
+ }
+ // --> OD 2004-08-16 #i27030# - insert new <SwVirtFlyDrawObj> instance
+ // into drawing page with correct order number
+ else
+ {
+ pContact->GetFmt()->getIDocumentDrawModelAccess()->GetDrawModel()->GetPage( 0 )->
+ InsertObject( pDrawObj, _GetOrdNumForNewRef( pContact ) );
+ }
+ // <--
+ // --> OD 2004-12-13 #i38889# - assure, that new <SwVirtFlyDrawObj> instance
+ // is in a visible layer.
+ pContact->MoveObjToVisibleLayer( pDrawObj );
+ // <--
+ return pDrawObj;
+}
+
+
+
void SwFlyFrm::InitDrawObj( sal_Bool bNotify )
{
//ContactObject aus dem Format suchen. Wenn bereits eines existiert, so
//braucht nur eine neue Ref erzeugt werden, anderfalls ist es jetzt an
//der Zeit das Contact zu erzeugen.
- SwClientIter aIter( *GetFmt() );
- SwFlyDrawContact *pContact = (SwFlyDrawContact*)
- aIter.First( TYPE(SwFlyDrawContact) );
+
IDocumentDrawModelAccess* pIDDMA = GetFmt()->getIDocumentDrawModelAccess();
+ SwFlyDrawContact *pContact = SwIterator<SwFlyDrawContact,SwFmt>::FirstElement( *GetFmt() );
if ( !pContact )
{
// --> OD 2005-08-08 #i52858# - method name changed
@@ -400,7 +478,7 @@ void SwFlyFrm::InitDrawObj( sal_Bool bNotify )
}
ASSERT( pContact, "InitDrawObj failed" );
// OD 2004-03-22 #i26791#
- SetDrawObj( *(pContact->CreateNewRef( this )) );
+ SetDrawObj( *(CreateNewRef( pContact )) );
//Den richtigen Layer setzen.
// OD 2004-01-19 #110582#
@@ -431,7 +509,7 @@ void SwFlyFrm::FinitDrawObj()
//Bei den SdrPageViews abmelden falls das Objekt dort noch selektiert ist.
if ( !GetFmt()->GetDoc()->IsInDtor() )
{
- ViewShell *p1St = GetShell();
+ ViewShell *p1St = getRootFrm()->GetCurrShell();
if ( p1St )
{
ViewShell *pSh = p1St;
@@ -452,18 +530,19 @@ void SwFlyFrm::FinitDrawObj()
SwFlyDrawContact *pMyContact = 0;
if ( GetFmt() )
{
- SwClientIter aIter( *GetFmt() );
- aIter.GoStart();
- do {
- if ( aIter()->ISA(SwFrm) && (SwFrm*)aIter() != this )
+ bool bContinue = true;
+ SwIterator<SwFrm,SwFmt> aFrmIter( *GetFmt() );
+ for ( SwFrm* pFrm = aFrmIter.First(); pFrm; pFrm = aFrmIter.Next() )
+ if ( pFrm != this )
{
- pMyContact = 0;
+ // don't delete Contact if there is still a Frm
+ bContinue = false;
break;
}
- if( !pMyContact && aIter()->ISA(SwFlyDrawContact) )
- pMyContact = (SwFlyDrawContact*)aIter();
- aIter++;
- } while( aIter() );
+
+ if ( bContinue )
+ // no Frm left, find Contact object to destroy
+ pMyContact = SwIterator<SwFlyDrawContact,SwFmt>::FirstElement( *GetFmt() );
}
// OD, OS 2004-03-31 #116203# - clear user call of Writer fly frame 'master'
@@ -527,10 +606,13 @@ void SwFlyFrm::ChainFrames( SwFlyFrm *pMaster, SwFlyFrm *pFollow )
}
// invalidate accessible relation set (accessibility wrapper)
- ViewShell* pSh = pMaster->GetShell();
- if( pSh && pSh->GetLayout()->IsAnyShellAccessible() )
+ ViewShell* pSh = pMaster->getRootFrm()->GetCurrShell();
+ if( pSh )
+ {
+ SwRootFrm* pLayout = pMaster->getRootFrm();
+ if( pLayout && pLayout->IsAnyShellAccessible() )
pSh->Imp()->InvalidateAccessibleRelationSet( pMaster, pFollow );
-
+ }
}
void SwFlyFrm::UnchainFrames( SwFlyFrm *pMaster, SwFlyFrm *pFollow )
@@ -570,10 +652,14 @@ void SwFlyFrm::UnchainFrames( SwFlyFrm *pMaster, SwFlyFrm *pFollow )
pFollow->GetFmt()->GetDoc(), ++nIndex );
// invalidate accessible relation set (accessibility wrapper)
- ViewShell* pSh = pMaster->GetShell();
- if( pSh && pSh->GetLayout()->IsAnyShellAccessible() )
+ ViewShell* pSh = pMaster->getRootFrm()->GetCurrShell();
+ if( pSh )
+ {
+ SwRootFrm* pLayout = pMaster->getRootFrm();
+ if( pLayout && pLayout->IsAnyShellAccessible() )
pSh->Imp()->InvalidateAccessibleRelationSet( pMaster, pFollow );
}
+}
/*************************************************************************
|*
@@ -604,8 +690,8 @@ SwFlyFrm *SwFlyFrm::FindChainNeighbour( SwFrmFmt &rChain, SwFrm *pAnch )
pLay = pLay->GetUpper();
}
- SwClientIter aIter( rChain );
- SwFlyFrm *pFly = (SwFlyFrm*)aIter.First( TYPE(SwFlyFrm ) );
+ SwIterator<SwFlyFrm,SwFmt> aIter( rChain );
+ SwFlyFrm *pFly = aIter.First();
if ( pLay )
{
while ( pFly )
@@ -620,7 +706,7 @@ SwFlyFrm *SwFlyFrm::FindChainNeighbour( SwFrmFmt &rChain, SwFrm *pAnch )
else if ( pLay == pFly->FindFooterOrHeader() )
break;
}
- pFly = (SwFlyFrm*)aIter.Next();
+ pFly = aIter.Next();
}
}
else if ( pFly )
@@ -723,7 +809,7 @@ sal_Bool SwFlyFrm::FrmSizeChg( const SwFmtFrmSize &rFrmSize )
|*
|*************************************************************************/
-void SwFlyFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
+void SwFlyFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
{
sal_uInt8 nInvFlags = 0;
@@ -775,7 +861,7 @@ void SwFlyFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
if ( ( nInvFlags & 0x40 ) && Lower() && Lower()->IsNoTxtFrm() )
ClrContourCache( GetVirtDrawObj() );
SwRootFrm *pRoot;
- if ( nInvFlags & 0x20 && 0 != (pRoot = FindRootFrm()) )
+ if ( nInvFlags & 0x20 && 0 != (pRoot = getRootFrm()) )
pRoot->InvalidateBrowseWidth();
// --> OD 2004-06-28 #i28701#
if ( nInvFlags & 0x80 )
@@ -791,13 +877,13 @@ void SwFlyFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
// <--
}
-void SwFlyFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew,
+void SwFlyFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
sal_uInt8 &rInvFlags,
SwAttrSetChg *pOldSet, SwAttrSetChg *pNewSet )
{
sal_Bool bClear = sal_True;
const sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
switch( nWhich )
{
case RES_VERT_ORIENT:
@@ -849,8 +935,12 @@ void SwFlyFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew,
const SvxProtectItem *pP = (SvxProtectItem*)pNew;
GetVirtDrawObj()->SetMoveProtect( pP->IsPosProtected() );
GetVirtDrawObj()->SetResizeProtect( pP->IsSizeProtected() );
- if( pSh && pSh->GetLayout()->IsAnyShellAccessible() )
+ if( pSh )
+ {
+ SwRootFrm* pLayout = getRootFrm();
+ if( pLayout && pLayout->IsAnyShellAccessible() )
pSh->Imp()->InvalidateAccessibleEditableState( sal_True, this );
+ }
break;
}
@@ -961,8 +1051,8 @@ void SwFlyFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew,
case RES_LR_SPACE:
{
rInvFlags |= 0x41;
- if ( GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
- GetFmt()->GetDoc()->GetRootFrm()->InvalidateBrowseWidth();
+ if( pSh && pSh->GetViewOptions()->getBrowseMode() )
+ getRootFrm()->InvalidateBrowseWidth();
SwRect aNew( GetObjRectWithSpaces() );
SwRect aOld( aFrm );
if ( RES_UL_SPACE == nWhich )
@@ -1003,11 +1093,15 @@ void SwFlyFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew,
pIDDMA->GetHeavenId() :
pIDDMA->GetHellId();
GetVirtDrawObj()->SetLayer( nId );
- if( pSh && pSh->GetLayout()->IsAnyShellAccessible() )
+ if( pSh )
+ {
+ SwRootFrm* pLayout = getRootFrm();
+ if( pLayout && pLayout->IsAnyShellAccessible() )
{
pSh->Imp()->DisposeAccessibleFrm( this );
pSh->Imp()->AddAccessibleFrm( this );
}
+ }
// --> OD 2004-06-28 #i28701# - perform reorder of object lists
// at anchor frame and at page frame.
rInvFlags |= 0x80;
@@ -2198,7 +2292,7 @@ void SwFrm::RemoveFly( SwFlyFrm *pToRemove )
pToRemove->GetFmt() &&
!pToRemove->IsFlyInCntFrm() )
{
- SwRootFrm *pRootFrm = FindRootFrm();
+ SwRootFrm *pRootFrm = getRootFrm();
if( pRootFrm && pRootFrm->IsAnyShellAccessible() )
{
ViewShell *pVSh = pRootFrm->GetCurrShell();
@@ -2258,7 +2352,10 @@ void SwFrm::AppendDrawObj( SwAnchoredObject& _rNewObj )
// Assure the control objects and group objects containing controls are on the control layer
if ( ::CheckControlLayer( _rNewObj.DrawObj() ) )
{
- const IDocumentDrawModelAccess* pIDDMA = GetUpper()->GetFmt()->getIDocumentDrawModelAccess();
+ const IDocumentDrawModelAccess* pIDDMA = (IsFlyFrm())
+ ? static_cast<SwFlyFrm*>(this)->GetFmt()->
+ getIDocumentDrawModelAccess()
+ : GetUpper()->GetFmt()->getIDocumentDrawModelAccess();
const SdrLayerID aCurrentLayer(_rNewObj.DrawObj()->GetLayer());
const SdrLayerID aControlLayerID(pIDDMA->GetControlsId());
const SdrLayerID aInvisibleControlLayerID(pIDDMA->GetInvisibleControlsId());
@@ -2289,9 +2386,11 @@ void SwFrm::AppendDrawObj( SwAnchoredObject& _rNewObj )
}
// Notify accessible layout.
- ViewShell* pSh = GetShell();
- if( pSh && pSh->GetLayout()->IsAnyShellAccessible() )
+ ViewShell* pSh = getRootFrm()->GetCurrShell();
+ if( pSh )
{
+ SwRootFrm* pLayout = getRootFrm();
+ if( pLayout && pLayout->IsAnyShellAccessible() )
pSh->Imp()->AddAccessibleObj( _rNewObj.GetDrawObj() );
}
}
@@ -2299,9 +2398,11 @@ void SwFrm::AppendDrawObj( SwAnchoredObject& _rNewObj )
void SwFrm::RemoveDrawObj( SwAnchoredObject& _rToRemoveObj )
{
// Notify accessible layout.
- ViewShell* pSh = GetShell();
- if( pSh && pSh->GetLayout()->IsAnyShellAccessible() )
+ ViewShell* pSh = getRootFrm()->GetCurrShell();
+ if( pSh )
{
+ SwRootFrm* pLayout = getRootFrm();
+ if( pLayout && pLayout->IsAnyShellAccessible() )
pSh->Imp()->DisposeAccessibleObj( _rToRemoveObj.GetDrawObj() );
}
@@ -2521,10 +2622,10 @@ Size SwFlyFrm::CalcRel( const SwFmtFrmSize &rSz ) const
if( pRel ) // LAYER_IMPL
{
long nRelWidth = LONG_MAX, nRelHeight = LONG_MAX;
- const ViewShell *pSh = GetShell();
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
if ( ( pRel->IsBodyFrm() || pRel->IsPageFrm() ) &&
- GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) &&
- pSh && pSh->VisArea().HasArea() )
+ pSh && pSh->GetViewOptions()->getBrowseMode() &&
+ pSh->VisArea().HasArea() )
{
nRelWidth = pSh->GetBrowseWidth();
nRelHeight = pSh->VisArea().Height();
@@ -2853,6 +2954,13 @@ bool SwFlyFrm::IsFormatPossible() const
!IsLocked() && !IsColLocked();
}
+void SwFlyFrm::GetAnchoredObjects( std::list<SwAnchoredObject*>& aList, const SwFmt& rFmt )
+{
+ SwIterator<SwFlyFrm,SwFmt> aIter( rFmt );
+ for( SwFlyFrm* pFlyFrm = aIter.First(); pFlyFrm; pFlyFrm = aIter.Next() )
+ aList.push_back( pFlyFrm );
+}
+
const SwFlyFrmFmt * SwFlyFrm::GetFmt() const
{
return static_cast< const SwFlyFrmFmt * >( GetDep() );
diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx
index e2b9510715..7f37a898e7 100644
--- a/sw/source/core/layout/flycnt.cxx
+++ b/sw/source/core/layout/flycnt.cxx
@@ -30,7 +30,6 @@
#include <tools/bigint.hxx>
#include "pagefrm.hxx"
-#include "rootfrm.hxx"
#include "cntfrm.hxx"
#include "flyfrm.hxx"
#include "txtfrm.hxx"
@@ -85,8 +84,8 @@ using namespace ::com::sun::star;
|*
|*************************************************************************/
-SwFlyAtCntFrm::SwFlyAtCntFrm( SwFlyFrmFmt *pFmt, SwFrm *pAnch ) :
- SwFlyFreeFrm( pFmt, pAnch )
+SwFlyAtCntFrm::SwFlyAtCntFrm( SwFlyFrmFmt *pFmt, SwFrm* pSib, SwFrm *pAnch ) :
+ SwFlyFreeFrm( pFmt, pSib, pAnch )
{
bAtCnt = sal_True;
bAutoPosition = (FLY_AT_CHAR == pFmt->GetAnchor().GetAnchorId());
@@ -104,7 +103,7 @@ TYPEINIT1(SwFlyAtCntFrm,SwFlyFreeFrm);
|*
|*************************************************************************/
-void SwFlyAtCntFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
+void SwFlyAtCntFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
{
sal_uInt16 nWhich = pNew ? pNew->Which() : 0;
const SwFmtAnchor *pAnch = 0;
@@ -196,7 +195,7 @@ void SwFlyAtCntFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
if ( !pCntnt )
{
SwCntntNode *pNode = aNewIdx.GetNode().GetCntntNode();
- pCntnt = pNode->GetFrm( &pOldAnchor->Frm().Pos(), 0, sal_False );
+ pCntnt = pNode->getLayoutFrm( getRootFrm(), &pOldAnchor->Frm().Pos(), 0, sal_False );
ASSERT( pCntnt, "Neuen Anker nicht gefunden" );
}
//Flys haengen niemals an einem Follow sondern immer am
@@ -661,13 +660,20 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet,
while( pUp->IsSctFrm() )
pUp = pUp->GetUpper();
const bool bVert = pUp->IsVertical();
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ const bool bVertL2R = pUp->IsVertLR();
+
//Dem Textflus folgen.
// --> OD 2009-01-12 #i70582#
+ // --> OD 2009-03-05 - adopted for Support for Classical Mongolian Script
const SwTwips nTopForObjPos =
bVert
- ? ( pCnt->Frm().Left() +
- pCnt->Frm().Width() -
- pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() )
+ ? ( bVertL2R
+ ? ( pCnt->Frm().Left() +
+ pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() )
+ : ( pCnt->Frm().Left() +
+ pCnt->Frm().Width() -
+ pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() ) )
: ( pCnt->Frm().Top() +
pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() );
// <--
@@ -676,7 +682,13 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet,
// OD 26.09.2003 - <rPt> point is inside environment of given content frame
// --> OD 2009-01-12 #i70582#
if( bVert )
- rRet.nMain = nTopForObjPos - rPt.X();
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ {
+ if ( bVertL2R )
+ rRet.nMain = rPt.X() - nTopForObjPos;
+ else
+ rRet.nMain = nTopForObjPos - rPt.X();
+ }
else
rRet.nMain = rPt.Y() - nTopForObjPos;
// <--
@@ -701,7 +713,13 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet,
// OD 26.09.2003 - <rPt> point is in left border of environment
// --> OD 2009-01-12 #i70582#
if( bVert )
- rRet.nMain = nTopForObjPos - rPt.X();
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ {
+ if ( bVertL2R )
+ rRet.nMain = rPt.X() - nTopForObjPos;
+ else
+ rRet.nMain = nTopForObjPos - rPt.X();
+ }
else
rRet.nMain = rPt.Y() - nTopForObjPos;
// <--
@@ -712,11 +730,13 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet,
}
else
{
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
// --> OD 2009-01-12 #i70582#
rRet.nMain = bVert
- ? nTopForObjPos - (pUp->Frm().Left() + pUp->Prt().Left())
- : (pUp->Frm().Top() + pUp->Prt().Bottom()) - nTopForObjPos;
- // <--
+ ? ( bVertL2R
+ ? ( (pUp->Frm().Left() + pUp->Prt().Right()) - nTopForObjPos )
+ : ( nTopForObjPos - (pUp->Frm().Left() + pUp->Prt().Left() ) ) )
+ : ( (pUp->Frm().Top() + pUp->Prt().Bottom()) - nTopForObjPos );
const SwFrm *pPre = pCnt;
const SwFrm *pLay = pUp->GetLeaf( MAKEPAGE_NONE, sal_True, pCnt );
@@ -737,7 +757,11 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet,
{
if( pLay->IsVertical() )
{
- nFrmTop = pLay->Frm().Left() + pLay->Frm().Width();
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( pLay->IsVertLR() )
+ nFrmTop = pLay->Frm().Left();
+ else
+ nFrmTop = pLay->Frm().Left() + pLay->Frm().Width();
nPrtHeight = pLay->Prt().Width();
}
else
@@ -752,9 +776,20 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet,
pLay = pSect->GetUpper();
if( pLay->IsVertical() )
{
- nFrmTop = pSect->Frm().Left();
- nPrtHeight = pSect->Frm().Left() - pLay->Frm().Left()
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( pLay->IsVertLR() )
+ {
+ nFrmTop = pSect->Frm().Right();
+ nPrtHeight = pLay->Frm().Left() + pLay->Prt().Left()
+ + pLay->Prt().Width() - pSect->Frm().Left()
+ - pSect->Frm().Width();
+ }
+ else
+ {
+ nFrmTop = pSect->Frm().Left();
+ nPrtHeight = pSect->Frm().Left() - pLay->Frm().Left()
- pLay->Prt().Left();
+ }
}
else
{
@@ -770,8 +805,17 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet,
{
if( pLay->IsVertical() )
{
- nFrmTop = pLay->Frm().Left() + pLay->Frm().Width();
- nPrtHeight = pLay->Prt().Width();
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( pLay->IsVertLR() )
+ {
+ nFrmTop = pLay->Frm().Left();
+ nPrtHeight = pLay->Prt().Width();
+ }
+ else
+ {
+ nFrmTop = pLay->Frm().Left() + pLay->Frm().Width();
+ nPrtHeight = pLay->Prt().Width();
+ }
}
else
{
@@ -815,8 +859,17 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet,
pSect = pNxtSect;
if( pLay->IsVertical() )
{
- nFrmTop = pLay->Frm().Left() + pLay->Frm().Width();
- nPrtHeight = pLay->Prt().Width();
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( pLay->IsVertLR() )
+ {
+ nFrmTop = pLay->Frm().Left();
+ nPrtHeight = pLay->Prt().Width();
+ }
+ else
+ {
+ nFrmTop = pLay->Frm().Left() + pLay->Frm().Width();
+ nPrtHeight = pLay->Prt().Width();
+ }
}
else
{
@@ -829,9 +882,20 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet,
pLay = pSect->GetUpper();
if( pLay->IsVertical() )
{
- nFrmTop = pSect->Frm().Left();
- nPrtHeight = pSect->Frm().Left() -
- pLay->Frm().Left() - pLay->Prt().Left();
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( pLay->IsVertLR() )
+ {
+ nFrmTop = pSect->Frm().Right();
+ nPrtHeight = pLay->Frm().Left()+pLay->Prt().Left()
+ + pLay->Prt().Width() - pSect->Frm().Left()
+ - pSect->Frm().Width();
+ }
+ else
+ {
+ nFrmTop = pSect->Frm().Left();
+ nPrtHeight = pSect->Frm().Left() -
+ pLay->Frm().Left() - pLay->Prt().Left();
+ }
}
else
{
@@ -847,8 +911,17 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet,
{
if( pLay->IsVertical() )
{
- nFrmTop = pLay->Frm().Left() + pLay->Frm().Width();
- nPrtHeight = pLay->Prt().Width();
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( pLay->IsVertLR() )
+ {
+ nFrmTop = pLay->Frm().Left();
+ nPrtHeight = pLay->Prt().Width();
+ }
+ else
+ {
+ nFrmTop = pLay->Frm().Left() + pLay->Frm().Width();
+ nPrtHeight = pLay->Prt().Width();
+ }
}
else
{
@@ -863,7 +936,8 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet,
{
if ( pLay->Frm().IsInside( rPt ) )
{
- SwTwips nDiff = pLay->IsVertical() ? ( nFrmTop - rPt.X() )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ SwTwips nDiff = pLay->IsVertical() ? ( pLay->IsVertLR() ? ( rPt.X() - nFrmTop ) : ( nFrmTop - rPt.X() ) )
: ( rPt.Y() - nFrmTop );
if( bSct || pSect )
rRet.nSub += nDiff;
@@ -1219,9 +1293,8 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
SwPageFrm *pOldPage = FindPageFrm();
const SwRect aOld( GetObjRectWithSpaces() );
Point aNew( rNew );
-
- if( GetAnchorFrm()->IsVertical() || GetAnchorFrm()->IsRightToLeft() )
-
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if( ( GetAnchorFrm()->IsVertical() && !GetAnchorFrm()->IsVertLR() ) || GetAnchorFrm()->IsRightToLeft() )
aNew.X() += Frm().Width();
SwCntntFrm *pCnt = (SwCntntFrm*)::FindAnchor( GetAnchorFrm(), aNew );
if( pCnt->IsProtected() )
@@ -1229,6 +1302,8 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
SwPageFrm *pTmpPage = 0;
const bool bVert = pCnt->IsVertical();
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ const bool bVertL2R = pCnt->IsVertLR();
const sal_Bool bRTL = pCnt->IsRightToLeft();
if( ( !bVert != !GetAnchorFrm()->IsVertical() ) ||
@@ -1261,15 +1336,22 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
// --> OD 2009-01-12 #i70582#
const SwTwips nTopForObjPos =
bVert
- ? ( pCnt->Frm().Left() +
- pCnt->Frm().Width() -
- pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() )
+ ? ( bVertL2R
+ ? ( pCnt->Frm().Left() +
+ pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() )
+ : ( pCnt->Frm().Left() +
+ pCnt->Frm().Width() -
+ pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() ) )
: ( pCnt->Frm().Top() +
pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() );
- if ( bVert )
+ if( bVert )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
{
- nY = nTopForObjPos - rNew.X() - Frm().Width();
- }
+ if ( bVertL2R )
+ nY = rNew.X() - nTopForObjPos;
+ else
+ nY = nTopForObjPos - rNew.X() - Frm().Width();
+ }
else
{
nY = rNew.Y() - nTopForObjPos;
@@ -1302,8 +1384,14 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
do
{ const SwFrm *pUp = pFollow->GetUpper();
if( pUp->IsVertical() )
- nDiff += pFollow->Frm().Left() + pFollow->Frm().Width()
- - pUp->Frm().Left() - pUp->Prt().Left();
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ {
+ if ( pUp->IsVertLR() )
+ nDiff += pUp->Prt().Width() - pFollow->GetRelPos().X();
+ else
+ nDiff += pFollow->Frm().Left() + pFollow->Frm().Width()
+ - pUp->Frm().Left() - pUp->Prt().Left();
+ }
else
nDiff += pUp->Prt().Height() - pFollow->GetRelPos().Y();
pFollow = pFollow->GetFollow();
@@ -1320,14 +1408,21 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
// --> OD 2009-01-12 #i70582#
const SwTwips nTopForObjPos =
bVert
- ? ( pCnt->Frm().Left() +
- pCnt->Frm().Width() -
- pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() )
+ ? ( bVertL2R
+ ? ( pCnt->Frm().Left() +
+ pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() )
+ : ( pCnt->Frm().Left() +
+ pCnt->Frm().Width() -
+ pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() ) )
: ( pCnt->Frm().Top() +
pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() );
- if ( bVert )
+ if( bVert )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
{
- nY = nTopForObjPos - rNew.X();
+ if ( bVertL2R )
+ nY = rNew.X() - nTopForObjPos;
+ else
+ nY = nTopForObjPos - rNew.X();
}
else
{
@@ -1421,6 +1516,7 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
GetPageFrm()->MoveFly( this, pTmpPage );
const Point aRelPos = bVert ? Point( -nY, nX ) : Point( nX, nY );
+
ChgRelPos( aRelPos );
GetFmt()->GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
diff --git a/sw/source/core/layout/flyincnt.cxx b/sw/source/core/layout/flyincnt.cxx
index 39460cb1d5..7127ec1550 100644
--- a/sw/source/core/layout/flyincnt.cxx
+++ b/sw/source/core/layout/flyincnt.cxx
@@ -52,8 +52,8 @@ void DeepCalc( const SwFrm *pFrm );
|* Letzte Aenderung MA 09. Apr. 99
|*
|*************************************************************************/
-SwFlyInCntFrm::SwFlyInCntFrm( SwFlyFrmFmt *pFmt, SwFrm *pAnch ) :
- SwFlyFrm( pFmt, pAnch )
+SwFlyInCntFrm::SwFlyInCntFrm( SwFlyFrmFmt *pFmt, SwFrm* pSib, SwFrm *pAnch ) :
+ SwFlyFrm( pFmt, pSib, pAnch )
{
bInCnt = bInvalidLayout = bInvalidCntnt = sal_True;
SwTwips nRel = pFmt->GetVertOrient().GetPos();
@@ -123,7 +123,7 @@ void SwFlyInCntFrm::SetRefPoint( const Point& rPoint,
|* Letzte Aenderung MA 02. Sep. 93
|*
|*************************************************************************/
-void SwFlyInCntFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
+void SwFlyInCntFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
{
sal_Bool bCallPrepare = sal_False;
sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx
index 635e09a483..07307733f4 100644
--- a/sw/source/core/layout/flylay.cxx
+++ b/sw/source/core/layout/flylay.cxx
@@ -74,8 +74,8 @@ using namespace ::com::sun::star;
|*
|*************************************************************************/
-SwFlyFreeFrm::SwFlyFreeFrm( SwFlyFrmFmt *pFmt, SwFrm *pAnch ) :
- SwFlyFrm( pFmt, pAnch ),
+SwFlyFreeFrm::SwFlyFreeFrm( SwFlyFrmFmt *pFmt, SwFrm* pSib, SwFrm *pAnch ) :
+ SwFlyFrm( pFmt, pSib, pAnch ),
pPage( 0 ),
// --> OD 2004-11-15 #i34753#
mbNoMakePos( false ),
@@ -548,8 +548,8 @@ bool SwFlyFreeFrm::IsFormatPossible() const
|*
|*************************************************************************/
-SwFlyLayFrm::SwFlyLayFrm( SwFlyFrmFmt *pFmt, SwFrm *pAnch ) :
- SwFlyFreeFrm( pFmt, pAnch )
+SwFlyLayFrm::SwFlyLayFrm( SwFlyFrmFmt *pFmt, SwFrm* pSib, SwFrm *pAnch ) :
+ SwFlyFreeFrm( pFmt, pSib, pAnch )
{
bLayout = sal_True;
}
@@ -566,7 +566,7 @@ TYPEINIT1(SwFlyLayFrm,SwFlyFreeFrm);
|*
|*************************************************************************/
-void SwFlyLayFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
+void SwFlyLayFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
{
sal_uInt16 nWhich = pNew ? pNew->Which() : 0;
@@ -600,7 +600,7 @@ void SwFlyLayFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
if ( FLY_AT_PAGE == pAnch->GetAnchorId() )
{
sal_uInt16 nPgNum = pAnch->GetPageNum();
- SwRootFrm *pRoot = FindRootFrm();
+ SwRootFrm *pRoot = getRootFrm();
SwPageFrm *pTmpPage = (SwPageFrm*)pRoot->Lower();
for ( sal_uInt16 i = 1; (i <= nPgNum) && pTmpPage; ++i,
pTmpPage = (SwPageFrm*)pTmpPage->GetNext() )
@@ -622,7 +622,7 @@ void SwFlyLayFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
{
SwNodeIndex aIdx( pAnch->GetCntntAnchor()->nNode );
SwCntntFrm *pCntnt = GetFmt()->GetDoc()->GetNodes().GoNext( &aIdx )->
- GetCntntNode()->GetFrm( 0, 0, sal_False );
+ GetCntntNode()->getLayoutFrm( getRootFrm(), 0, 0, sal_False );
if( pCntnt )
{
SwFlyFrm *pTmp = pCntnt->FindFlyFrm();
@@ -653,7 +653,7 @@ void SwFlyLayFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
void SwPageFrm::AppendFlyToPage( SwFlyFrm *pNew )
{
if ( !pNew->GetVirtDrawObj()->IsInserted() )
- FindRootFrm()->GetDrawPage()->InsertObject(
+ getRootFrm()->GetDrawPage()->InsertObject(
(SdrObject*)pNew->GetVirtDrawObj(),
pNew->GetVirtDrawObj()->GetReferencedObj().GetOrdNumDirect() );
@@ -765,7 +765,7 @@ void SwPageFrm::AppendFlyToPage( SwFlyFrm *pNew )
void SwPageFrm::RemoveFlyFromPage( SwFlyFrm *pToRemove )
{
const sal_uInt32 nOrdNum = pToRemove->GetVirtDrawObj()->GetOrdNum();
- FindRootFrm()->GetDrawPage()->RemoveObject( nOrdNum );
+ getRootFrm()->GetDrawPage()->RemoveObject( nOrdNum );
pToRemove->GetVirtDrawObj()->ReferencedObj().SetOrdNum( nOrdNum );
if ( GetUpper() )
@@ -1036,7 +1036,7 @@ void SwPageFrm::PlaceFly( SwFlyFrm* pFly, SwFlyFrmFmt* pFmt )
AppendFly( pFly );
else
{ ASSERT( pFmt, ":-( kein Format fuer Fly uebergeben." );
- pFly = new SwFlyLayFrm( (SwFlyFrmFmt*)pFmt, this );
+ pFly = new SwFlyLayFrm( (SwFlyFrmFmt*)pFmt, this, this );
AppendFly( pFly );
::RegistFlys( this, pFly );
}
diff --git a/sw/source/core/layout/flypos.cxx b/sw/source/core/layout/flypos.cxx
index ed52e36c2a..65c8358d77 100644
--- a/sw/source/core/layout/flypos.cxx
+++ b/sw/source/core/layout/flypos.cxx
@@ -28,13 +28,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-
#include "doc.hxx"
#include "node.hxx"
#include <docary.hxx>
-
-
#include <fmtanchr.hxx>
#include "flypos.hxx"
#include "frmfmt.hxx"
@@ -43,8 +39,7 @@
#include "flyfrm.hxx"
#include "dflyobj.hxx"
#include "ndindex.hxx"
-
-
+#include "switerator.hxx"
SV_IMPL_OP_PTRARR_SORT( SwPosFlyFrms, SwPosFlyFrmPtr )
@@ -52,28 +47,33 @@ SwPosFlyFrm::SwPosFlyFrm( const SwNodeIndex& rIdx, const SwFrmFmt* pFmt,
sal_uInt16 nArrPos )
: pFrmFmt( pFmt ), pNdIdx( (SwNodeIndex*) &rIdx )
{
- sal_Bool bFnd = sal_False;
+ bool bFnd = false;
const SwFmtAnchor& rAnchor = pFmt->GetAnchor();
if (FLY_AT_PAGE == rAnchor.GetAnchorId())
{
pNdIdx = new SwNodeIndex( rIdx );
}
- else if( pFmt->GetDoc()->GetRootFrm() )
+ else if( pFmt->GetDoc()->GetCurrentViewShell() ) //swmod 071108//swmod 071225
{
- SwClientIter aIter( (SwFmt&)*pFmt );
if( RES_FLYFRMFMT == pFmt->Which() )
{
// Schauen, ob es ein SdrObject dafuer gibt
- if( aIter.First( TYPE( SwFlyFrm) ) )
- nOrdNum = ((SwFlyFrm*)aIter())->GetVirtDrawObj()->GetOrdNum(),
- bFnd = sal_True;
+ SwFlyFrm* pFly = SwIterator<SwFlyFrm,SwFmt>::FirstElement(*pFmt);
+ if( pFly )
+ {
+ nOrdNum = pFly->GetVirtDrawObj()->GetOrdNum();
+ bFnd = true;
+ }
}
else if( RES_DRAWFRMFMT == pFmt->Which() )
{
// Schauen, ob es ein SdrObject dafuer gibt
- if( aIter.First( TYPE(SwDrawContact) ) )
- nOrdNum = ((SwDrawContact*)aIter())->GetMaster()->GetOrdNum(),
- bFnd = sal_True;
+ SwDrawContact* pContact = SwIterator<SwDrawContact,SwFmt>::FirstElement(*pFmt);
+ if( pContact )
+ {
+ nOrdNum = pContact->GetMaster()->GetOrdNum();
+ bFnd = true;
+ }
}
}
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index 5cd8a19d7b..b09a59582c 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -38,10 +38,8 @@
#include <editeng/lrspitem.hxx>
#include <editeng/boxitem.hxx>
#include <sfx2/printer.hxx>
-// OD 08.01.2004 #i11859#
#include <editeng/lspcitem.hxx>
-
#include <fmtornt.hxx>
#include <fmtanchr.hxx>
#include <fmthdft.hxx>
@@ -56,6 +54,7 @@
#include "doc.hxx"
#include "fesh.hxx"
#include "viewimp.hxx"
+#include "viewopt.hxx"
#include "pam.hxx"
#include "dflyobj.hxx"
#include "dcontact.hxx"
@@ -78,18 +77,13 @@
#include "hints.hxx"
#include <layhelp.hxx>
#include <laycache.hxx>
-
#include <rootfrm.hxx>
-
#include "mdiexp.hxx"
#include "statstr.hrc"
-// OD 21.05.2003 #108789#
#include <paratr.hxx>
-// OD 2004-05-24 #i28701#
#include <sortedobjs.hxx>
-// --> OD 2005-03-04 #b6234250#
#include <objectformatter.hxx>
-// <--
+#include <switerator.hxx>
// ftnfrm.cxx:
void lcl_RemoveFtns( SwFtnBossFrm* pBoss, sal_Bool bPageOnly, sal_Bool bEndNotes );
@@ -106,14 +100,7 @@ sal_Bool StackHack::bLocked = sal_False;
-/*************************************************************************
-|*
-|* SwFrmNotify::SwFrmNotify()
-|*
-|* Ersterstellung MA 27. Nov. 92
-|* Letzte Aenderung MA 09. Apr. 97
-|*
-|*************************************************************************/
+/*************************************************************************/
SwFrmNotify::SwFrmNotify( SwFrm *pF ) :
pFrm( pF ),
@@ -121,9 +108,7 @@ SwFrmNotify::SwFrmNotify( SwFrm *pF ) :
aPrt( pF->Prt() ),
bInvaKeep( sal_False ),
bValidSize( pF->GetValidSizeFlag() ),
- // --> OD 2005-07-29 #i49383#
- mbFrmDeleted( false )
- // <--
+ mbFrmDeleted( false ) // #i49383#
{
if ( pF->IsTxtFrm() )
{
@@ -141,23 +126,15 @@ SwFrmNotify::SwFrmNotify( SwFrm *pF ) :
sal_False;
}
-/*************************************************************************
-|*
-|* SwFrmNotify::~SwFrmNotify()
-|*
-|* Ersterstellung MA 27. Nov. 92
-|* Letzte Aenderung MA 09. Apr. 97
-|*
-|*************************************************************************/
+/*************************************************************************/
SwFrmNotify::~SwFrmNotify()
{
- // --> OD 2005-07-29 #i49383#
+ // #i49383#
if ( mbFrmDeleted )
{
return;
}
- // <--
SWRECTFN( pFrm )
const sal_Bool bAbsP = POS_DIFF( aFrm, pFrm->Frm() );
@@ -217,19 +194,18 @@ SwFrmNotify::~SwFrmNotify()
pFrm->SetCompletePaint();
SwFrm* pNxt = pFrm->GetIndNext();
- // --> OD 2005-05-20 #121888# - skip empty section frames
+ // #121888# - skip empty section frames
while ( pNxt &&
pNxt->IsSctFrm() && !static_cast<SwSectionFrm*>(pNxt)->GetSection() )
{
pNxt = pNxt->GetIndNext();
}
- // <--
if ( pNxt )
pNxt->InvalidatePos();
else
{
- // OD 04.11.2002 #104100# - correct condition for setting retouche
+ // #104100# - correct condition for setting retouche
// flag for vertical layout.
if( pFrm->IsRetoucheFrm() &&
(aFrm.*fnRect->fnTopDist)( (pFrm->Frm().*fnRect->fnGetTop)() ) > 0 )
@@ -260,7 +236,7 @@ SwFrmNotify::~SwFrmNotify()
}
else
{
- // OD 13.11.2002 #97597# - consider case that *only* margins between
+ // #97597# - consider case that *only* margins between
// frame and printing area has changed. Then, frame has to be repainted,
// in order to force paint of the margin areas.
if ( !bAbsP && (bChgWidth || bChgHeight) )
@@ -275,7 +251,7 @@ SwFrmNotify::~SwFrmNotify()
{
if( pFrm->IsAccessibleFrm() )
{
- SwRootFrm *pRootFrm = pFrm->FindRootFrm();
+ SwRootFrm *pRootFrm = pFrm->getRootFrm();
if( pRootFrm && pRootFrm->IsAnyShellAccessible() &&
pRootFrm->GetCurrShell() )
{
@@ -410,7 +386,7 @@ SwFrmNotify::~SwFrmNotify()
}
else if( pFrm->IsTxtFrm() && bValidSize != pFrm->GetValidSizeFlag() )
{
- SwRootFrm *pRootFrm = pFrm->FindRootFrm();
+ SwRootFrm *pRootFrm = pFrm->getRootFrm();
if( pRootFrm && pRootFrm->IsAnyShellAccessible() &&
pRootFrm->GetCurrShell() )
{
@@ -456,15 +432,7 @@ SwFrmNotify::~SwFrmNotify()
}
}
-/*************************************************************************
-|*
-|* SwLayNotify::SwLayNotify()
-|*
-|* Ersterstellung MA 17. Nov. 92
-|* Letzte Aenderung MA 03. Jun. 93
-|*
-|*************************************************************************/
-
+/*************************************************************************/
SwLayNotify::SwLayNotify( SwLayoutFrm *pLayFrm ) :
SwFrmNotify( pLayFrm ),
@@ -472,14 +440,7 @@ SwLayNotify::SwLayNotify( SwLayoutFrm *pLayFrm ) :
{
}
-/*************************************************************************
-|*
-|* SwLayNotify::~SwLayNotify()
-|*
-|* Ersterstellung MA 17. Nov. 92
-|* Letzte Aenderung MA 13. Jun. 96
-|*
-|*************************************************************************/
+/*************************************************************************/
// OD 2004-05-11 #i28701# - local method to invalidate the position of all
// frames inclusive its floating screen objects, which are lowers of the given
@@ -607,13 +568,16 @@ SwLayNotify::~SwLayNotify()
if ( pLay->IsTabFrm() )
//Damit _nur_ der Shatten bei Groessenaenderungen gemalt wird.
((SwTabFrm*)pLay)->SetComplete();
- else if ( !pLay->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ||
+ else
+ {
+ const ViewShell *pSh = pLay->getRootFrm()->GetCurrShell();
+ if( !( pSh && pSh->GetViewOptions()->getBrowseMode() ) ||
!(pLay->GetType() & (FRM_BODY | FRM_PAGE)) )
//Damit die untergeordneten sauber retouchiert werden.
//Problembsp: Flys an den Henkeln packen und verkleinern.
//Nicht fuer Body und Page, sonst flackerts beim HTML-Laden.
pLay->SetCompletePaint();
-
+ }
}
//Lower benachrichtigen wenn sich die Position veraendert hat.
const sal_Bool bPrtPos = POS_DIFF( aPrt, pLay->Prt() );
@@ -688,14 +652,7 @@ SwLayNotify::~SwLayNotify()
((SwFlyFrm*)pLay)->AnchorFrm()->InvalidateSize();
}
-/*************************************************************************
-|*
-|* SwFlyNotify::SwFlyNotify()
-|*
-|* Ersterstellung MA 17. Nov. 92
-|* Letzte Aenderung MA 26. Aug. 93
-|*
-|*************************************************************************/
+/*************************************************************************/
SwFlyNotify::SwFlyNotify( SwFlyFrm *pFlyFrm ) :
SwLayNotify( pFlyFrm ),
@@ -707,14 +664,7 @@ SwFlyNotify::SwFlyNotify( SwFlyFrm *pFlyFrm ) :
{
}
-/*************************************************************************
-|*
-|* SwFlyNotify::~SwFlyNotify()
-|*
-|* Ersterstellung MA 17. Nov. 92
-|* Letzte Aenderung MA 09. Nov. 95
-|*
-|*************************************************************************/
+/*************************************************************************/
SwFlyNotify::~SwFlyNotify()
{
@@ -728,7 +678,7 @@ SwFlyNotify::~SwFlyNotify()
SwFlyFrm *pFly = GetFly();
if ( pFly->IsNotifyBack() )
{
- ViewShell *pSh = pFly->GetShell();
+ ViewShell *pSh = pFly->getRootFrm()->GetCurrShell();
SwViewImp *pImp = pSh ? pSh->Imp() : 0;
if ( !pImp || !pImp->IsAction() || !pImp->GetLayAction().IsAgain() )
{
@@ -823,14 +773,7 @@ SwFlyNotify::~SwFlyNotify()
}
}
-/*************************************************************************
-|*
-|* SwCntntNotify::SwCntntNotify()
-|*
-|* Ersterstellung MA 24. Nov. 92
-|* Letzte Aenderung MA 16. May. 95
-|*
-|*************************************************************************/
+/*************************************************************************/
SwCntntNotify::SwCntntNotify( SwCntntFrm *pCntntFrm ) :
SwFrmNotify( pCntntFrm ),
@@ -858,14 +801,7 @@ SwCntntNotify::SwCntntNotify( SwCntntFrm *pCntntFrm ) :
}
}
-/*************************************************************************
-|*
-|* SwCntntNotify::~SwCntntNotify()
-|*
-|* Ersterstellung MA 24. Nov. 92
-|* Letzte Aenderung MA 09. Apr. 97
-|*
-|*************************************************************************/
+/*************************************************************************/
SwCntntNotify::~SwCntntNotify()
{
@@ -945,7 +881,7 @@ SwCntntNotify::~SwCntntNotify()
{
//Aktive PlugIn's oder OLE-Objekte sollten etwas von der Veraenderung
//mitbekommen, damit sie Ihr Window entsprechend verschieben.
- ViewShell *pSh = pCnt->GetShell();
+ ViewShell *pSh = pCnt->getRootFrm()->GetCurrShell();
if ( pSh )
{
SwOLENode *pNd;
@@ -1106,17 +1042,7 @@ SwCntntNotify::~SwCntntNotify()
// <--
}
-/*************************************************************************
-|*
-|* InsertCnt
-|*
-|* Beschreibung Hilfsfunktionen, die friend von irgendwem sind, damit
-|* nicht immer gleich 'ne ganze Klasse befreundet werden
-|* muss.
-|* Ersterstellung MA 13. Apr. 93
-|* Letzte Aenderung MA 11. May. 95
-|*
-|*************************************************************************/
+/*************************************************************************/
void AppendObjs( const SwSpzFrmFmts *pTbl, sal_uLong nIndex,
SwFrm *pFrm, SwPageFrm *pPage )
@@ -1182,9 +1108,9 @@ void AppendObjs( const SwSpzFrmFmts *pTbl, sal_uLong nIndex,
{
SwFlyFrm *pFly;
if( bFlyAtFly )
- pFly = new SwFlyLayFrm( (SwFlyFrmFmt*)pFmt, pFrm );
+ pFly = new SwFlyLayFrm( (SwFlyFrmFmt*)pFmt, pFrm, pFrm );
else
- pFly = new SwFlyAtCntFrm( (SwFlyFrmFmt*)pFmt, pFrm );
+ pFly = new SwFlyAtCntFrm( (SwFlyFrmFmt*)pFmt, pFrm, pFrm );
pFly->Lock();
pFrm->AppendFly( pFly );
pFly->Unlock();
@@ -1196,18 +1122,26 @@ void AppendObjs( const SwSpzFrmFmts *pTbl, sal_uLong nIndex,
}
}
-sal_Bool MA_FASTCALL lcl_ObjConnected( SwFrmFmt *pFmt )
+bool lcl_ObjConnected( SwFrmFmt *pFmt, const SwFrm* pSib )
{
- SwClientIter aIter( *pFmt );
+ SwIterator<SwFlyFrm,SwFmt> aIter( *pFmt );
if ( RES_FLYFRMFMT == pFmt->Which() )
- return 0 != aIter.First( TYPE(SwFlyFrm) );
+ {
+ const SwRootFrm* pRoot = pSib ? pSib->getRootFrm() : 0;
+ const SwFlyFrm* pTmpFrm;
+ for( pTmpFrm = aIter.First(); pTmpFrm; pTmpFrm = aIter.Next() )
+ {
+ if(! pRoot || pRoot == pTmpFrm->getRootFrm() )
+ return true;
+ }
+ }
else
{
- SwDrawContact *pContact;
- if ( 0 != (pContact = (SwDrawContact*)aIter.First( TYPE(SwDrawContact))))
+ SwDrawContact *pContact = SwIterator<SwDrawContact,SwFmt>::FirstElement(*pFmt);
+ if ( pContact )
return pContact->GetAnchorFrm() != 0;
}
- return sal_False;
+ return false;
}
/** helper method to determine, if a <SwFrmFmt>, which has an object connected,
@@ -1219,9 +1153,6 @@ sal_Bool MA_FASTCALL lcl_ObjConnected( SwFrmFmt *pFmt )
*/
bool lcl_InHeaderOrFooter( SwFrmFmt& _rFmt )
{
- ASSERT( lcl_ObjConnected( &_rFmt ),
- "::lcl_InHeaderOrFooter(..) - <SwFrmFmt> has no connected object" );
-
bool bRetVal = false;
const SwFmtAnchor& rAnch = _rFmt.GetAnchor();
@@ -1234,7 +1165,7 @@ bool lcl_InHeaderOrFooter( SwFrmFmt& _rFmt )
return bRetVal;
}
-void AppendAllObjs( const SwSpzFrmFmts *pTbl )
+void AppendAllObjs( const SwSpzFrmFmts *pTbl, const SwFrm* pSib )
{
//Verbinden aller Objekte, die in der SpzTbl beschrieben sind mit dem
//Layout.
@@ -1262,7 +1193,7 @@ void AppendAllObjs( const SwSpzFrmFmts *pTbl )
//will ich hier nicht.
bRemove = sal_True;
}
- else if ( sal_False == (bRemove = ::lcl_ObjConnected( pFmt )) ||
+ else if ( sal_False == (bRemove = ::lcl_ObjConnected( pFmt, pSib )) ||
::lcl_InHeaderOrFooter( *pFmt ) )
{
// OD 23.06.2003 #108784# - correction: for objects in header
@@ -1272,7 +1203,7 @@ void AppendAllObjs( const SwSpzFrmFmts *pTbl )
//keine abhaengigen Existieren, andernfalls, oder wenn das
//MakeFrms keine abhaengigen erzeugt, entfernen.
pFmt->MakeFrms();
- bRemove = ::lcl_ObjConnected( pFmt );
+ bRemove = ::lcl_ObjConnected( pFmt, pSib );
}
if ( bRemove )
{
@@ -1308,9 +1239,9 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc,
SwFrm *pPrv )
{
pDoc->BlockIdling();
- SwRootFrm* pLayout = pDoc->GetRootFrm();
+ SwRootFrm* pLayout = pLay->getRootFrm();
const sal_Bool bOldCallbackActionEnabled = pLayout ? pLayout->IsCallbackActionEnabled() : sal_False;
- if(pLayout)
+ if( bOldCallbackActionEnabled )
pLayout->SetCallbackActionEnabled( sal_False );
//Bei der Erzeugung des Layouts wird bPages mit sal_True uebergeben. Dann
@@ -1390,8 +1321,8 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc,
if ( pNd->IsCntntNode() )
{
SwCntntNode* pNode = (SwCntntNode*)pNd;
- pFrm = pNode->IsTxtNode() ? new SwTxtFrm( (SwTxtNode*)pNode ) :
- pNode->MakeFrm();
+ pFrm = pNode->IsTxtNode() ? new SwTxtFrm( (SwTxtNode*)pNode, pLay ) :
+ pNode->MakeFrm( pLay );
if( pPageMaker )
pPageMaker->CheckInsert( nIndex );
@@ -1403,7 +1334,7 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc,
// and relation CONTENT_FLOWS_TO for previous paragraph will change.
if ( pFrm->IsTxtFrm() )
{
- ViewShell* pViewShell( pFrm->GetShell() );
+ ViewShell* pViewShell( pFrm->getRootFrm()->GetCurrShell() );
// no notification, if <ViewShell> is in construction
if ( pViewShell && !pViewShell->IsInConstructor() &&
pViewShell->GetLayout() &&
@@ -1443,7 +1374,7 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc,
pDoc->UpdateTblFlds( &aMsgHnt );
pTblNode->GetTable().GCLines();
- pFrm = pTblNode->MakeFrm();
+ pFrm = pTblNode->MakeFrm( pLay );
if( pPageMaker )
pPageMaker->CheckInsert( nIndex );
@@ -1455,7 +1386,7 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc,
// Relation CONTENT_FLOWS_FROM for next paragraph will change
// and relation CONTENT_FLOWS_TO for previous paragraph will change.
{
- ViewShell* pViewShell( pFrm->GetShell() );
+ ViewShell* pViewShell( pFrm->getRootFrm()->GetCurrShell() );
// no notification, if <ViewShell> is in construction
if ( pViewShell && !pViewShell->IsInConstructor() &&
pViewShell->GetLayout() &&
@@ -1493,7 +1424,7 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc,
nIndex = pNode->EndOfSectionIndex();
else
{
- pFrm = pNode->MakeFrm();
+ pFrm = pNode->MakeFrm( pLay );
pActualSection = new SwActualSection( pActualSection,
(SwSectionFrm*)pFrm, pNode );
if ( pActualSection->GetUpper() )
@@ -1532,7 +1463,7 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc,
// Relation CONTENT_FLOWS_FROM for next paragraph will change
// and relation CONTENT_FLOWS_TO for previous paragraph will change.
{
- ViewShell* pViewShell( pFrm->GetShell() );
+ ViewShell* pViewShell( pFrm->getRootFrm()->GetCurrShell() );
// no notification, if <ViewShell> is in construction
if ( pViewShell && !pViewShell->IsInConstructor() &&
pViewShell->GetLayout() &&
@@ -1604,7 +1535,7 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc,
}
// new section frame
- pFrm = pActualSection->GetSectionNode()->MakeFrm();
+ pFrm = pActualSection->GetSectionNode()->MakeFrm( pLay );
pFrm->InsertBehind( pLay, pPrv );
static_cast<SwSectionFrm*>(pFrm)->Init();
@@ -1682,7 +1613,7 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc,
if ( bPages ) //Jetzt noch die Flys verbinden lassen.
{
if ( !bDontCreateObjects )
- AppendAllObjs( pTbl );
+ AppendAllObjs( pTbl, pLayout );
bObjsDirect = sal_True;
}
@@ -1702,7 +1633,7 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc,
}
pDoc->UnblockIdling();
- if(pLayout)
+ if( bOldCallbackActionEnabled )
pLayout->SetCallbackActionEnabled( bOldCallbackActionEnabled );
}
@@ -1885,7 +1816,7 @@ void MakeFrms( SwDoc *pDoc, const SwNodeIndex &rSttIdx,
{
const SwSpzFrmFmts *pTbl = pDoc->GetSpzFrmFmts();
if( pTbl->Count() )
- AppendAllObjs( pTbl );
+ AppendAllObjs( pTbl, pUpper );
}
// Wenn nichts eingefuegt wurde, z.B. ein ausgeblendeter Bereich,
@@ -1912,7 +1843,7 @@ void MakeFrms( SwDoc *pDoc, const SwNodeIndex &rSttIdx,
if( !pSct->ContainsCntnt() )
{
pSct->DelEmpty( sal_True );
- pDoc->GetRootFrm()->RemoveFromList( pSct );
+ pUpper->getRootFrm()->RemoveFromList( pSct );
delete pSct;
}
}
@@ -1923,14 +1854,7 @@ void MakeFrms( SwDoc *pDoc, const SwNodeIndex &rSttIdx,
}
-/*************************************************************************
-|*
-|* SwBorderAttrs::Ctor, DTor
-|*
-|* Ersterstellung MA 19. May. 93
-|* Letzte Aenderung MA 25. Jan. 97
-|*
-|*************************************************************************/
+/*************************************************************************/
SwBorderAttrs::SwBorderAttrs( const SwModify *pMod, const SwFrm *pConstructor ) :
SwCacheObj( pMod ),
@@ -1983,8 +1907,6 @@ SwBorderAttrs::~SwBorderAttrs()
|* der Sicherheitsabstand wird nur einkalkuliert, wenn Umrandung und/oder
|* Schatten im Spiel sind; er soll vermeiden, dass aufgrund der
|* groben physikalischen Gegebenheiten Raender usw. uebermalt werden.
-|* Ersterstellung MA 19. May. 93
-|* Letzte Aenderung MA 08. Jul. 93
|*
|*************************************************************************/
@@ -2066,8 +1988,6 @@ long SwBorderAttrs::CalcLeft( const SwFrm *pCaller ) const
|* Es kann auch ohne Linien ein Abstand erwuenscht sein,
|* dieser wird dann nicht vom Attribut sondern hier
|* beruecksichtigt (bBorderDist, z.B. fuer Zellen).
-|* Ersterstellung MA 21. May. 93
-|* Letzte Aenderung MA 07. Jun. 99
|*
|*************************************************************************/
@@ -2107,14 +2027,7 @@ void SwBorderAttrs::_CalcRightLine()
bRightLine = sal_False;
}
-/*************************************************************************
-|*
-|* SwBorderAttrs::_IsLine()
-|*
-|* Ersterstellung MA 29. Sep. 94
-|* Letzte Aenderung MA 29. Sep. 94
-|*
-|*************************************************************************/
+/*************************************************************************/
void SwBorderAttrs::_IsLine()
{
@@ -2141,9 +2054,6 @@ void SwBorderAttrs::_IsLine()
|* 3. Die Umrandungen links und rechts vor Vorgaenger bzw. Nachfolger
|* sind identisch.
|*
-|* Ersterstellung MA 22. Mar. 95
-|* Letzte Aenderung MA 22. May. 95
-|*
|*************************************************************************/
inline int CmpLines( const SvxBorderLine *pL1, const SvxBorderLine *pL2 )
{
@@ -2309,14 +2219,7 @@ void SwBorderAttrs::_GetBottomLine( const SwFrm& _rFrm )
nGetBottomLine = nRet;
}
-/*************************************************************************
-|*
-|* SwBorderAttrAccess::CTor
-|*
-|* Ersterstellung MA 20. Mar. 95
-|* Letzte Aenderung MA 29. Nov. 95
-|*
-|*************************************************************************/
+/*************************************************************************/
SwBorderAttrAccess::SwBorderAttrAccess( SwCache &rCach, const SwFrm *pFrm ) :
SwCacheAccess( rCach, (pFrm->IsCntntFrm() ?
@@ -2329,14 +2232,7 @@ SwBorderAttrAccess::SwBorderAttrAccess( SwCache &rCach, const SwFrm *pFrm ) :
{
}
-/*************************************************************************
-|*
-|* SwBorderAttrAccess::NewObj, Get
-|*
-|* Ersterstellung MA 20. Mar. 95
-|* Letzte Aenderung MA 20. Mar. 95
-|*
-|*************************************************************************/
+/*************************************************************************/
SwCacheObj *SwBorderAttrAccess::NewObj()
{
@@ -2349,14 +2245,7 @@ SwBorderAttrs *SwBorderAttrAccess::Get()
return (SwBorderAttrs*)SwCacheAccess::Get();
}
-/*************************************************************************
-|*
-|* SwOrderIter::Ctor
-|*
-|* Ersterstellung MA 06. Jan. 95
-|* Letzte Aenderung MA 22. Nov. 95
-|*
-|*************************************************************************/
+/*************************************************************************/
SwOrderIter::SwOrderIter( const SwPageFrm *pPg, sal_Bool bFlys ) :
pPage( pPg ),
@@ -2365,14 +2254,7 @@ SwOrderIter::SwOrderIter( const SwPageFrm *pPg, sal_Bool bFlys ) :
{
}
-/*************************************************************************
-|*
-|* SwOrderIter::Top()
-|*
-|* Ersterstellung MA 06. Jan. 95
-|* Letzte Aenderung MA 22. Nov. 95
-|*
-|*************************************************************************/
+/*************************************************************************/
const SdrObject *SwOrderIter::Top()
{
@@ -2401,14 +2283,7 @@ const SdrObject *SwOrderIter::Top()
return pCurrent;
}
-/*************************************************************************
-|*
-|* SwOrderIter::Bottom()
-|*
-|* Ersterstellung MA 06. Jan. 95
-|* Letzte Aenderung MA 22. Nov. 95
-|*
-|*************************************************************************/
+/*************************************************************************/
const SdrObject *SwOrderIter::Bottom()
{
@@ -2437,14 +2312,7 @@ const SdrObject *SwOrderIter::Bottom()
return pCurrent;
}
-/*************************************************************************
-|*
-|* SwOrderIter::Next()
-|*
-|* Ersterstellung MA 06. Jan. 95
-|* Letzte Aenderung MA 22. Nov. 95
-|*
-|*************************************************************************/
+/*************************************************************************/
const SdrObject *SwOrderIter::Next()
{
@@ -2474,14 +2342,7 @@ const SdrObject *SwOrderIter::Next()
return pCurrent;
}
-/*************************************************************************
-|*
-|* SwOrderIter::Prev()
-|*
-|* Ersterstellung MA 06. Jan. 95
-|* Letzte Aenderung MA 22. Nov. 95
-|*
-|*************************************************************************/
+/*************************************************************************/
const SdrObject *SwOrderIter::Prev()
{
@@ -2511,14 +2372,7 @@ const SdrObject *SwOrderIter::Prev()
return pCurrent;
}
-/*************************************************************************
-|*
-|* SaveCntnt(), RestoreCntnt()
-|*
-|* Ersterstellung MA 10. Jun. 93
-|* Letzte Aenderung MA 07. Mar. 95
-|*
-|*************************************************************************/
+/*************************************************************************/
//Unterstruktur eines LayoutFrms fuer eine Aktion aufheben und wieder
//restaurieren.
@@ -2854,9 +2708,6 @@ void RestoreCntnt( SwFrm *pSav, SwLayoutFrm *pParent, SwFrm *pSibling, bool bGro
|* SqRt() Berechnung der Quadratwurzel, damit die math.lib
|* nicht auch noch dazugelinkt werden muss.
|*
-|* Ersterstellung OK ??
-|* Letzte Aenderung MA 09. Jan. 97
-|*
|*************************************************************************/
sal_uLong MA_FASTCALL SqRt( BigInt nX )
@@ -2875,14 +2726,7 @@ sal_uLong MA_FASTCALL SqRt( BigInt nX )
return nErg >= BigInt(SAL_MAX_UINT32) ? ULONG_MAX : (sal_uLong)nErg;
}
-/*************************************************************************
-|*
-|* InsertNewPage() Einsetzen einer neuen Seite.
-|*
-|* Ersterstellung MA 01. Jul. 93
-|* Letzte Aenderung MA 31. Jul. 95
-|*
-|*************************************************************************/
+/*************************************************************************/
SwPageFrm * MA_FASTCALL InsertNewPage( SwPageDesc &rDesc, SwFrm *pUpper,
sal_Bool bOdd, sal_Bool bInsertEmpty, sal_Bool bFtn,
@@ -2903,11 +2747,11 @@ SwPageFrm * MA_FASTCALL InsertNewPage( SwPageDesc &rDesc, SwFrm *pUpper,
{
SwPageDesc *pTmpDesc = pSibling && pSibling->GetPrev() ?
((SwPageFrm*)pSibling->GetPrev())->GetPageDesc() : &rDesc;
- pRet = new SwPageFrm( pDoc->GetEmptyPageFmt(), pTmpDesc );
+ pRet = new SwPageFrm( pDoc->GetEmptyPageFmt(), pUpper, pTmpDesc );
pRet->Paste( pUpper, pSibling );
pRet->PreparePage( bFtn );
}
- pRet = new SwPageFrm( pFmt, &rDesc );
+ pRet = new SwPageFrm( pFmt, pUpper, &rDesc );
pRet->Paste( pUpper, pSibling );
pRet->PreparePage( bFtn );
if ( pRet->GetNext() )
@@ -2922,9 +2766,6 @@ SwPageFrm * MA_FASTCALL InsertNewPage( SwPageDesc &rDesc, SwFrm *pUpper,
|* eine Layoutstruktur und melden alle FlyFrms, die einen beliebigen Frm
|* innerhalb der Struktur als Anker haben bei der Seite an.
|*
-|* Ersterstellung MA 08. Jul. 93
-|* Letzte Aenderung MA 07. Jul. 95
-|*
|*************************************************************************/
void MA_FASTCALL lcl_Regist( SwPageFrm *pPage, const SwFrm *pAnch )
@@ -2995,8 +2836,6 @@ void RegistFlys( SwPageFrm *pPage, const SwLayoutFrm *pLay )
|*
|* Beschreibung Benachrichtigt den Hintergrund je nach der
|* Veraenderung zwischen altem und neuem Rechteckt.
-|* Ersterstellung MA 18. Jun. 93
-|* Letzte Aenderung MA 06. Jun. 96
|*
|*************************************************************************/
@@ -3019,7 +2858,7 @@ void Notify( SwFlyFrm *pFly, SwPageFrm *pOld, const SwRect &rOld,
//Der Einfachheit halber wird hier bewusst jeweils ein Twip
//unnoetig invalidiert.
- ViewShell *pSh = pFly->GetShell();
+ ViewShell *pSh = pFly->getRootFrm()->GetCurrShell();
if( pSh && rOld.HasArea() )
pSh->InvalidateWindows( rOld );
@@ -3077,11 +2916,7 @@ void Notify( SwFlyFrm *pFly, SwPageFrm *pOld, const SwRect &rOld,
}
}
-/*************************************************************************
-|*
-|* NotifyBackground()
-|*
-|*************************************************************************/
+/*************************************************************************/
void lcl_CheckFlowBack( SwFrm* pFrm, const SwRect &rRect )
{
@@ -3317,7 +3152,7 @@ void Notify_Background( const SdrObject* pObj,
// --> OD 2008-01-30 #i82258# - make code robust
ViewShell* pSh = 0;
if ( bInva && pPage &&
- 0 != (pSh = pPage->GetShell()) )
+ 0 != (pSh = pPage->getRootFrm()->GetCurrShell()) )
{
pSh->InvalidateWindows( rRect );
}
@@ -3364,11 +3199,7 @@ const SwFrm* GetVirtualUpper( const SwFrm* pFrm, const Point& rPos )
return pFrm;
}
-/*************************************************************************
-|*
-|* IsLowerOf()
-|*
-|*************************************************************************/
+/*************************************************************************/
sal_Bool Is_Lower_Of( const SwFrm *pCurrFrm, const SdrObject* pObj )
{
@@ -3382,7 +3213,7 @@ sal_Bool Is_Lower_Of( const SwFrm *pCurrFrm, const SdrObject* pObj )
}
else
{
- pFrm = ( (SwDrawContact*)GetUserCall(pObj) )->GetAnchorFrm();
+ pFrm = ( (SwDrawContact*)GetUserCall(pObj) )->GetAnchorFrm(pObj);
aPos = pObj->GetCurrentBoundRect().TopLeft();
}
ASSERT( pFrm, "8-( Fly is lost in Space." );
@@ -3516,35 +3347,73 @@ const SwFrm* MA_FASTCALL FindPage( const SwRect &rRect, const SwFrm *pPage )
return pPage;
}
-SwFrm* GetFrmOfModify( SwModify const& rMod, sal_uInt16 const nFrmType,
+#include <svl/smplhint.hxx>
+class SwFrmHolder : private SfxListener
+{
+ SwFrm* pFrm;
+ bool bSet;
+ virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
+public:
+ SwFrmHolder() : pFrm(0), bSet(false) {}
+ void SetFrm( SwFrm* pHold );
+ SwFrm* GetFrm() { return pFrm; }
+ void Reset();
+ bool IsSet() { return bSet; }
+};
+
+void SwFrmHolder::SetFrm( SwFrm* pHold )
+{
+ bSet = true;
+ pFrm = pHold;
+ StartListening(*pHold);
+}
+
+void SwFrmHolder::Reset()
+{
+ if (pFrm)
+ EndListening(*pFrm);
+ bSet = false;
+ pFrm = 0;
+}
+
+void SwFrmHolder::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
+{
+ if ( rHint.IsA(TYPE(SfxSimpleHint)) )
+ {
+ if ( ( (SfxSimpleHint&) rHint ).GetId() == SFX_HINT_DYING && &rBC == pFrm )
+ pFrm = 0;
+ }
+}
+
+SwFrm* GetFrmOfModify( const SwRootFrm* pLayout, SwModify const& rMod, sal_uInt16 const nFrmType,
const Point* pPoint, const SwPosition *pPos, const sal_Bool bCalcFrm )
{
SwFrm *pMinFrm = 0, *pTmpFrm;
+ SwFrmHolder aHolder;
SwRect aCalcRect;
bool bClientIterChanged = false;
- SwClientIter aIter( rMod );
+ SwIterator<SwFrm,SwModify> aIter( rMod );
do {
pMinFrm = 0;
+ aHolder.Reset();
sal_uInt64 nMinDist = 0;
bClientIterChanged = false;
- for( pTmpFrm = (SwFrm*)aIter.First( TYPE( SwFrm )); pTmpFrm;
- pTmpFrm = (SwFrm*)aIter.Next() )
+ for( pTmpFrm = aIter.First(); pTmpFrm; pTmpFrm = aIter.Next() )
{
if( pTmpFrm->GetType() & nFrmType &&
+ ( !pLayout || pLayout == pTmpFrm->getRootFrm() ) &&
(!pTmpFrm->IsFlowFrm() ||
!SwFlowFrm::CastFlowFrm( pTmpFrm )->IsFollow() ))
{
if( pPoint )
{
- // --> FME 2006-02-03 #127369#
- // Set pointer to be watched. If a client is removed from
- // rMod (e.g., by deleting a frame), the bWatchDeleted flag
- // is set at the SwClientIter.
- const bool bWatchClientSet = pMinFrm != 0;
- aIter.SetWatchClient( pMinFrm );
- // <--
+ // watch for Frm being deleted
+ if ( pMinFrm )
+ aHolder.SetFrm( pMinFrm );
+ else
+ aHolder.Reset();
if( bCalcFrm )
{
@@ -3562,14 +3431,13 @@ SwFrm* GetFrmOfModify( SwModify const& rMod, sal_uInt16 const nFrmType,
pTmpFrm->Calc();
}
- // --> FME 2006-02-03 #127369#
- // The SwClientIter list has changed. Restart.
- // aIter.IsChanged basically checks if pTmpFrm has been
- // deleted. bWatchClientSet && aIter.GetWatchClient()
- // checks if pMinFrm has been deleted.
- // <--
- if( aIter.IsChanged() || ( bWatchClientSet && !aIter.GetWatchClient() ) )
+ // #127369#
+ // aIter.IsChanged checks if the current pTmpFrm has been deleted while
+ // it is the current iterator
+ // FrmHolder watches for deletion of the current pMinFrm
+ if( aIter.IsChanged() || ( aHolder.IsSet() && !aHolder.GetFrm() ) )
{
+ // restart iteration
bClientIterChanged = true;
break;
}
@@ -3723,15 +3591,13 @@ bool SwDeletionChecker::HasBeenDeleted()
if ( !mpFrm || !mpRegIn )
return false;
- SwClientIter aIter( const_cast<SwModify&>(*mpRegIn) );
- const SwClient* pLast = aIter.GoStart();
-
+ SwIterator<SwFrm,SwModify> aIter(*mpRegIn);
+ SwFrm* pLast = aIter.First();
while ( pLast )
{
- if ( pLast->ISA( SwFrm ) && pLast == mpFrm )
+ if ( pLast == mpFrm )
return false;
-
- pLast = aIter++;
+ pLast = aIter.Next();
}
return true;
diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx
index 588b69749b..49ad0170e6 100644
--- a/sw/source/core/layout/ftnfrm.cxx
+++ b/sw/source/core/layout/ftnfrm.cxx
@@ -48,9 +48,10 @@
#include <ndindex.hxx>
#include <sectfrm.hxx>
#include <pam.hxx>
-// --> OD 2005-05-17 #i49383#
#include <objectformatter.hxx>
-// <--
+#include "viewopt.hxx"
+#include "viewsh.hxx"
+#include <switerator.hxx>
/*************************************************************************
|*
@@ -58,9 +59,6 @@
|* Dokument, dort stehen die Fussnoten gluecklicherweise nach ihrem
|* Index sortiert.
|*
-|* Ersterstellung MA 29. Jun. 93
-|* Letzte Aenderung MA 13. Dec. 93
-|*
|*************************************************************************/
#define ENDNOTE 0x80000000
@@ -119,9 +117,6 @@ sal_Bool SwFtnFrm::operator<( const SwTxtFtn* pTxtFtn ) const
|* oder eine Seite (ohne Spalten) sein. Wenn die Seite dabei gewechselt wird
|* enthaelt pPage die neue Seite und die Funktion liefert sal_True.
|*
-|* Ersterstellung AMA 06. Nov. 98
-|* Letzte Aenderung AMA 06. Nov. 98
-|*
|*************************************************************************/
sal_Bool lcl_NextFtnBoss( SwFtnBossFrm* &rpBoss, SwPageFrm* &rpPage,
@@ -171,9 +166,6 @@ sal_Bool lcl_NextFtnBoss( SwFtnBossFrm* &rpBoss, SwPageFrm* &rpPage,
|* liefert die Spaltennummer, wenn pBoss eine Spalte ist,
|* sonst eine Null (bei Seiten).
|*
-|* Ersterstellung AMA 06. Nov. 98
-|* Letzte Aenderung AMA 06. Nov. 98
-|*
|*************************************************************************/
sal_uInt16 lcl_ColumnNum( const SwFrm* pBoss )
@@ -208,14 +200,11 @@ sal_uInt16 lcl_ColumnNum( const SwFrm* pBoss )
|*
|* SwFtnContFrm::SwFtnContFrm()
|*
-|* Ersterstellung MA 24. Feb. 93
-|* Letzte Aenderung MA 02. Mar. 93
-|*
|*************************************************************************/
-SwFtnContFrm::SwFtnContFrm( SwFrmFmt *pFmt ):
- SwLayoutFrm( pFmt )
+SwFtnContFrm::SwFtnContFrm( SwFrmFmt *pFmt, SwFrm* pSib ):
+ SwLayoutFrm( pFmt, pSib )
{
nType = FRMC_FTNCONT;
}
@@ -257,8 +246,6 @@ long lcl_Undersize( const SwFrm* pFrm )
|*
|* Beschreibung: "Formatiert" den Frame;
|* Die Fixsize wird hier nicht eingestellt.
-|* Ersterstellung MA 01. Mar. 93
-|* Letzte Aenderung MA 17. Nov. 98
|*
|*************************************************************************/
@@ -283,7 +270,14 @@ void SwFtnContFrm::Format( const SwBorderAttrs * )
if ( !bValidSize )
{
- if ( pPage->IsFtnPage() && !GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ bool bGrow = pPage->IsFtnPage();
+ if( bGrow )
+ {
+ const ViewShell *pSh = getRootFrm() ? getRootFrm()->GetCurrShell() : 0;
+ if( pSh && pSh->GetViewOptions()->getBrowseMode() )
+ bGrow = false;
+ }
+ if( bGrow )
Grow( LONG_MAX, sal_False );
else
{
@@ -340,9 +334,6 @@ void SwFtnContFrm::Format( const SwBorderAttrs * )
|*
|* SwFtnContFrm::GrowFrm(), ShrinkFrm()
|*
-|* Ersterstellung MA 24. Feb. 93
-|* Letzte Aenderung AMA 05. Nov. 98
-|*
|*************************************************************************/
SwTwips SwFtnContFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool )
@@ -379,7 +370,8 @@ SwTwips SwFtnContFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool )
return 0;
}
}
- const bool bBrowseMode = GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
+ const ViewShell *pSh = getRootFrm() ? getRootFrm()->GetCurrShell() : 0;
+ const sal_Bool bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode();
SwPageFrm *pPage = pBoss->FindPageFrm();
if ( bBrowseMode || !pPage->IsFtnPage() )
{
@@ -421,7 +413,8 @@ SwTwips SwFtnContFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool )
if ( !bTst )
{
(Frm().*fnRect->fnSetHeight)( (Frm().*fnRect->fnGetHeight)() + nDist );
- if( IsVertical() && !IsReverse() )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if( IsVertical() && !IsVertLR() && !IsReverse() )
Frm().Pos().X() -= nDist;
}
long nGrow = nDist - nAvail,
@@ -463,7 +456,8 @@ SwTwips SwFtnContFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool )
nDist -= nReal;
//Den masslosen Wunsch koennen wir leider nur in Grenzen erfuellen.
Frm().SSize().Height() -= nDist;
- if( IsVertical() && !IsReverse() )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if( IsVertical() && !IsVertLR() && !IsReverse() )
Frm().Pos().X() += nDist;
}
@@ -483,9 +477,19 @@ SwTwips SwFtnContFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool )
SwTwips SwFtnContFrm::ShrinkFrm( SwTwips nDiff, sal_Bool bTst, sal_Bool bInfo )
{
SwPageFrm *pPage = FindPageFrm();
- if ( pPage &&
- ( !pPage->IsFtnPage() ||
- GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) )
+ bool bShrink = false;
+ if ( pPage )
+ {
+ if( !pPage->IsFtnPage() )
+ bShrink = true;
+ else
+ {
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
+ if( pSh && pSh->GetViewOptions()->getBrowseMode() )
+ bShrink = true;
+ }
+ }
+ if( bShrink )
{
SwTwips nRet = SwLayoutFrm::ShrinkFrm( nDiff, bTst, bInfo );
if( IsInSct() && !bTst )
@@ -505,14 +509,11 @@ SwTwips SwFtnContFrm::ShrinkFrm( SwTwips nDiff, sal_Bool bTst, sal_Bool bInfo )
|*
|* SwFtnFrm::SwFtnFrm()
|*
-|* Ersterstellung MA 24. Feb. 93
-|* Letzte Aenderung MA 11. Oct. 93
-|*
|*************************************************************************/
-SwFtnFrm::SwFtnFrm( SwFrmFmt *pFmt, SwCntntFrm *pCnt, SwTxtFtn *pAt ):
- SwLayoutFrm( pFmt ),
+SwFtnFrm::SwFtnFrm( SwFrmFmt *pFmt, SwFrm* pSib, SwCntntFrm *pCnt, SwTxtFtn *pAt ):
+ SwLayoutFrm( pFmt, pSib ),
pFollow( 0 ),
pMaster( 0 ),
pRef( pCnt ),
@@ -529,9 +530,6 @@ SwFtnFrm::SwFtnFrm( SwFrmFmt *pFmt, SwCntntFrm *pCnt, SwTxtFtn *pAt ):
|*
|* SwFtnFrm::InvalidateNxtFtnCnts()
|*
-|* Ersterstellung MA 29. Jun. 93
-|* Letzte Aenderung MA 29. Jun. 93
-|*
|*************************************************************************/
@@ -599,9 +597,6 @@ SwTwips SwFtnFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
|*
|* SwFtnFrm::Cut()
|*
-|* Ersterstellung MA 23. Feb. 94
-|* Letzte Aenderung MA 24. Jul. 95
-|*
|*************************************************************************/
@@ -636,8 +631,8 @@ void SwFtnFrm::Cut()
if ( pPage )
{
SwLayoutFrm *pBody = pPage->FindBodyCont();
- if ( !pBody->ContainsCntnt() )
- pPage->FindRootFrm()->SetSuperfluous();
+ if( pBody && !pBody->ContainsCntnt() )
+ pPage->getRootFrm()->SetSuperfluous();
}
SwSectionFrm* pSect = pUp->FindSctFrm();
pUp->Cut();
@@ -660,9 +655,6 @@ void SwFtnFrm::Cut()
|*
|* SwFtnFrm::Paste()
|*
-|* Ersterstellung MA 23. Feb. 94
-|* Letzte Aenderung MA 23. Feb. 94
-|*
|*************************************************************************/
@@ -732,8 +724,6 @@ void SwFtnFrm::Paste( SwFrm* pParent, SwFrm* pSibling )
|* Beschreibung Liefert das naechste LayoutBlatt in den das
|* Frame gemoved werden kann.
|* Neue Seiten werden nur dann erzeugt, wenn der Parameter sal_True ist.
-|* Ersterstellung MA 16. Nov. 92
-|* Letzte Aenderung AMA 09. Nov. 98
|*
|*************************************************************************/
@@ -827,8 +817,6 @@ SwLayoutFrm *SwFrm::GetNextFtnLeaf( MakePageType eMakePage )
|*
|* Beschreibung Liefert das vorhergehende LayoutBlatt in das der
|* Frame gemoved werden kann.
-|* Ersterstellung MA 16. Nov. 92
-|* Letzte Aenderung AMA 06. Nov. 98
|*
|*************************************************************************/
@@ -960,9 +948,6 @@ SwLayoutFrm *SwFrm::GetPrevFtnLeaf( MakePageType eMakeFtn )
|*
|* SwFrm::IsFtnAllowed()
|*
-|* Ersterstellung MA 22. Mar. 94
-|* Letzte Aenderung MA 01. Dec. 94
-|*
|*************************************************************************/
@@ -985,9 +970,6 @@ sal_Bool SwFrm::IsFtnAllowed() const
|*
|* SwRootFrm::UpdateFtnNums()
|*
-|* Ersterstellung MA 02. Mar. 93
-|* Letzte Aenderung MA 09. Dec. 97
-|*
|*************************************************************************/
@@ -1010,9 +992,6 @@ void SwRootFrm::UpdateFtnNums()
|* RemoveFtns() Entfernen aller Fussnoten (nicht etwa die Referenzen)
|* und Entfernen aller Fussnotenseiten.
|*
-|* Ersterstellung MA 05. Dec. 97
-|* Letzte Aenderung AMA 06. Nov. 98
-|*
|*************************************************************************/
void lcl_RemoveFtns( SwFtnBossFrm* pBoss, sal_Bool bPageOnly, sal_Bool bEndNotes )
@@ -1106,9 +1085,6 @@ void SwRootFrm::RemoveFtns( SwPageFrm *pPage, sal_Bool bPageOnly, sal_Bool bEndN
|*
|* SetFtnPageDescs() Seitenvorlagen der Fussnotenseiten aendern
|*
-|* Ersterstellung MA 11. Dec. 97
-|* Letzte Aenderung MA 11. Dec. 97
-|*
|*************************************************************************/
void SwRootFrm::CheckFtnPageDescs( sal_Bool bEndNote )
@@ -1127,9 +1103,6 @@ void SwRootFrm::CheckFtnPageDescs( sal_Bool bEndNote )
|*
|* SwFtnBossFrm::MakeFtnCont()
|*
-|* Ersterstellung MA 25. Feb. 93
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
@@ -1146,7 +1119,7 @@ SwFtnContFrm *SwFtnBossFrm::MakeFtnCont()
}
#endif
- SwFtnContFrm *pNew = new SwFtnContFrm( GetFmt()->GetDoc()->GetDfltFrmFmt());
+ SwFtnContFrm *pNew = new SwFtnContFrm( GetFmt()->GetDoc()->GetDfltFrmFmt(), this );
SwLayoutFrm *pLay = FindBodyCont();
pNew->Paste( this, pLay->GetNext() );
return pNew;
@@ -1156,9 +1129,6 @@ SwFtnContFrm *SwFtnBossFrm::MakeFtnCont()
|*
|* SwFtnBossFrm::FindFtnCont()
|*
-|* Ersterstellung MA 25. Feb. 93
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
@@ -1188,9 +1158,6 @@ SwFtnContFrm *SwFtnBossFrm::FindFtnCont()
|*
|* SwFtnBossFrm::FindNearestFtnCont() Sucht den naechst greifbaren Fussnotencontainer.
|*
-|* Ersterstellung MA 02. Aug. 93
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
SwFtnContFrm *SwFtnBossFrm::FindNearestFtnCont( sal_Bool bDontLeave )
@@ -1223,8 +1190,6 @@ SwFtnContFrm *SwFtnBossFrm::FindNearestFtnCont( sal_Bool bDontLeave )
|* SwFtnBossFrm::FindFirstFtn()
|*
|* Beschreibung Erste Fussnote des Fussnotenbosses suchen.
-|* Ersterstellung MA 26. Feb. 93
-|* Letzte Aenderung AMA 29. Oct. 99
|*
|*************************************************************************/
@@ -1312,8 +1277,6 @@ SwFtnFrm *SwFtnBossFrm::FindFirstFtn()
|* SwFtnBossFrm::FindFirstFtn()
|*
|* Beschreibunt Erste Fussnote zum Cnt suchen.
-|* Ersterstellung MA 04. Mar. 93
-|* Letzte Aenderung AMA 28. Oct. 98
|*
|*************************************************************************/
@@ -1355,9 +1318,6 @@ const SwFtnFrm *SwFtnBossFrm::FindFirstFtn( SwCntntFrm *pCnt ) const
|*
|* SwFtnBossFrm::ResetFtn()
|*
-|* Ersterstellung MA 11. May. 95
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
@@ -1372,13 +1332,12 @@ void SwFtnBossFrm::ResetFtn( const SwFtnFrm *pCheck )
if ( !pNd )
pNd = pCheck->GetFmt()->GetDoc()->
GetNodes().GoNextSection( &aIdx, sal_True, sal_False );
- SwClientIter aIter( *pNd );
- SwClient* pLast = aIter.GoStart();
- while( pLast )
+ SwIterator<SwFrm,SwCntntNode> aIter( *pNd );
+ SwFrm* pFrm = aIter.First();
+ while( pFrm )
{
- if ( pLast->ISA(SwFrm) )
- {
- SwFrm *pFrm = (SwFrm*)pLast;
+ if( pFrm->getRootFrm() == pCheck->getRootFrm() )
+ {
SwFrm *pTmp = pFrm->GetUpper();
while ( pTmp && !pTmp->IsFtnFrm() )
pTmp = pTmp->GetUpper();
@@ -1397,7 +1356,8 @@ void SwFtnBossFrm::ResetFtn( const SwFtnFrm *pCheck )
}
}
}
- pLast = ++aIter;
+
+ pFrm = aIter.Next();
}
}
@@ -1405,9 +1365,6 @@ void SwFtnBossFrm::ResetFtn( const SwFtnFrm *pCheck )
|*
|* SwFtnBossFrm::InsertFtn()
|*
-|* Ersterstellung MA 26. Feb. 93
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
@@ -1683,9 +1640,6 @@ void SwFtnBossFrm::InsertFtn( SwFtnFrm* pNew )
|*
|* SwFtnBossFrm::AppendFtn()
|*
-|* Ersterstellung MA 25. Feb. 93
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
@@ -1830,7 +1784,7 @@ void SwFtnBossFrm::AppendFtn( SwCntntFrm *pRef, SwTxtFtn *pAttr )
}
}
- SwFtnFrm *pNew = new SwFtnFrm( pDoc->GetDfltFrmFmt(), pRef, pAttr );
+ SwFtnFrm *pNew = new SwFtnFrm( pDoc->GetDfltFrmFmt(), this, pRef, pAttr );
{
SwNodeIndex aIdx( *pAttr->GetStartNode(), 1 );
::_InsertCnt( pNew, pDoc, aIdx.GetIndex() );
@@ -1918,9 +1872,6 @@ void SwFtnBossFrm::AppendFtn( SwCntntFrm *pRef, SwTxtFtn *pAttr )
|*
|* SwFtnBossFrm::FindFtn()
|*
-|* Ersterstellung MA 25. Feb. 93
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
@@ -1935,14 +1886,12 @@ SwFtnFrm *SwFtnBossFrm::FindFtn( const SwCntntFrm *pRef, const SwTxtFtn *pAttr )
GetNodes().GoNextSection( &aIdx, sal_True, sal_False );
if ( !pNd )
return 0;
- SwClientIter aIter( *pNd );
- SwClient *pClient;
- if ( 0 != (pClient = aIter.GoStart()) )
+ SwIterator<SwFrm,SwCntntNode> aIter( *pNd );
+ SwFrm* pFrm = aIter.First();
+ if( pFrm )
do
{
- if ( pClient->IsA( TYPE(SwFrm) ) )
- {
- SwFrm *pFrm = ((SwFrm*)pClient)->GetUpper();
+ pFrm = pFrm->GetUpper();
// #i28500#, #i27243# Due to the endnode collector, there are
// SwFtnFrms, which are not in the layout. Therefore the
// bInfFtn flags are not set correctly, and a cell of FindFtnFrm
@@ -1960,8 +1909,8 @@ SwFtnFrm *SwFtnBossFrm::FindFtn( const SwCntntFrm *pRef, const SwTxtFtn *pAttr )
pFtn = pFtn->GetMaster();
return pFtn;
}
- }
- } while ( 0 != (pClient = aIter++) );
+
+ } while ( 0 != (pFrm = aIter.Next()) );
return 0;
}
@@ -1969,9 +1918,6 @@ SwFtnFrm *SwFtnBossFrm::FindFtn( const SwCntntFrm *pRef, const SwTxtFtn *pAttr )
|*
|* SwFtnBossFrm::RemoveFtn()
|*
-|* Ersterstellung MA 25. Feb. 93
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
@@ -2003,9 +1949,6 @@ void SwFtnBossFrm::RemoveFtn( const SwCntntFrm *pRef, const SwTxtFtn *pAttr,
|*
|* SwFtnBossFrm::ChangeFtnRef()
|*
-|* Ersterstellung MA 25. Feb. 93
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
@@ -2024,9 +1967,6 @@ void SwFtnBossFrm::ChangeFtnRef( const SwCntntFrm *pOld, const SwTxtFtn *pAttr,
|*
|* SwFtnBossFrm::CollectFtns()
|*
-|* Ersterstellung MA 24. Jul. 95
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
@@ -2092,9 +2032,6 @@ void SwFtnBossFrm::CollectFtns( const SwCntntFrm* _pRef,
|*
|* SwFtnBossFrm::_CollectFtns()
|*
-|* Ersterstellung MA 24. Jul. 95
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
inline void FtnInArr( SvPtrarr& rFtnArr, SwFtnFrm* pFtn )
{
@@ -2254,9 +2191,6 @@ void SwFtnBossFrm::_CollectFtns( const SwCntntFrm* _pRef,
|*
|* SwFtnBossFrm::_MoveFtns()
|*
-|* Ersterstellung MA 26. Feb. 93
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
@@ -2472,9 +2406,6 @@ void SwFtnBossFrm::_MoveFtns( SvPtrarr &rFtnArr, sal_Bool bCalc )
|*
|* SwFtnBossFrm::MoveFtns()
|*
-|* Ersterstellung BP 05. Aug. 93
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
@@ -2520,9 +2451,6 @@ void SwFtnBossFrm::MoveFtns( const SwCntntFrm *pSrc, SwCntntFrm *pDest,
|*
|* SwFtnBossFrm::RearrangeFtns()
|*
-|* Ersterstellung MA 20. Jan. 94
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
@@ -2764,9 +2692,6 @@ void SwFtnBossFrm::RearrangeFtns( const SwTwips nDeadLine, const sal_Bool bLock,
|*
|* SwPageFrm::UpdateFtnNum()
|*
-|* Ersterstellung MA 02. Mar. 93
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
void SwPageFrm::UpdateFtnNum()
@@ -2829,9 +2754,6 @@ void SwPageFrm::UpdateFtnNum()
|*
|* SwFtnBossFrm::SetFtnDeadLine()
|*
-|* Ersterstellung MA 02. Aug. 93
-|* Letzte Aenderung MA 16. Nov. 98
-|*
|*************************************************************************/
void SwFtnBossFrm::SetFtnDeadLine( const SwTwips nDeadLine )
@@ -2850,7 +2772,8 @@ void SwFtnBossFrm::SetFtnDeadLine( const SwTwips nDeadLine )
else
nMaxFtnHeight = -(pBody->Frm().*fnRect->fnBottomDist)( nDeadLine );
- if ( GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ const ViewShell *pSh = getRootFrm() ? getRootFrm()->GetCurrShell() : 0;
+ if( pSh && pSh->GetViewOptions()->getBrowseMode() )
nMaxFtnHeight += pBody->Grow( LONG_MAX, sal_True );
if ( IsInSct() )
nMaxFtnHeight += FindSctFrm()->Grow( LONG_MAX, sal_True );
@@ -2865,9 +2788,6 @@ void SwFtnBossFrm::SetFtnDeadLine( const SwTwips nDeadLine )
|*
|* SwFtnBossFrm::GetVarSpace()
|*
-|* Ersterstellung MA 03. Apr. 95
-|* Letzte Aenderung MA 16. Nov. 98
-|*
|*************************************************************************/
SwTwips SwFtnBossFrm::GetVarSpace() const
{
@@ -2932,9 +2852,12 @@ SwTwips SwFtnBossFrm::GetVarSpace() const
}
else
nRet = 0;
- if ( IsPageFrm() &&
- GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ if ( IsPageFrm() )
+ {
+ const ViewShell *pSh = getRootFrm() ? getRootFrm()->GetCurrShell() : 0;
+ if( pSh && pSh->GetViewOptions()->getBrowseMode() )
nRet += BROWSE_HEIGHT - Frm().Height();
+ }
return nRet;
}
@@ -2950,9 +2873,6 @@ SwTwips SwFtnBossFrm::GetVarSpace() const
|* gibt und die Fussnoten nicht vom Bereich eingesammelt werden, ist ein Adjust..,
|* ansonsten ein Grow/Shrink notwendig.
|*
-|* Ersterstellung AMA 09. Dec 98
-|* Letzte Aenderung AMA 09. Dec 98
-|*
|*************************************************************************/
sal_uInt8 SwFtnBossFrm::_NeighbourhoodAdjustment( const SwFrm* ) const
@@ -2988,9 +2908,6 @@ sal_uInt8 SwFtnBossFrm::_NeighbourhoodAdjustment( const SwFrm* ) const
|*
|* SwPageFrm::SetColMaxFtnHeight()
|*
-|* Ersterstellung AMA 29. Oct 98
-|* Letzte Aenderung AMA 29. Oct 98
-|*
|*************************************************************************/
void SwPageFrm::SetColMaxFtnHeight()
{
@@ -3010,9 +2927,6 @@ void SwPageFrm::SetColMaxFtnHeight()
|*
|* SwLayoutFrm::MoveLowerFtns
|*
-|* Ersterstellung MA 01. Sep. 94
-|* Letzte Aenderung MA 05. Sep. 95
-|*
|*************************************************************************/
@@ -3108,9 +3022,6 @@ sal_Bool SwLayoutFrm::MoveLowerFtns( SwCntntFrm *pStart, SwFtnBossFrm *pOldBoss,
|*
|* SwLayoutFrm::MoveFtnCntFwd()
|*
-|* Ersterstellung MA 24. Nov. 94
-|* Letzte Aenderung MA 15. Jun. 95
-|*
|*************************************************************************/
@@ -3181,7 +3092,7 @@ sal_Bool SwCntntFrm::MoveFtnCntFwd( sal_Bool bMakePage, SwFtnBossFrm *pOldBoss )
//Fussnote erzeugen.
SwFtnFrm *pOld = FindFtnFrm();
pTmpFtn = new SwFtnFrm( pOld->GetFmt()->GetDoc()->GetDfltFrmFmt(),
- pOld->GetRef(), pOld->GetAttr() );
+ pOld, pOld->GetRef(), pOld->GetAttr() );
//Verkettung der Fussnoten.
if ( pOld->GetFollow() )
{
@@ -3250,9 +3161,6 @@ sal_Bool SwCntntFrm::MoveFtnCntFwd( sal_Bool bMakePage, SwFtnBossFrm *pOldBoss )
|*
|* class SwSaveFtnHeight
|*
-|* Ersterstellung MA 19. Jan. 94
-|* Letzte Aenderung MA 19. Jan. 94
-|*
|*************************************************************************/
@@ -3315,7 +3223,7 @@ SwCntntFrm* SwFtnFrm::GetRefFromAttr()
ASSERT( pAttr, "invalid Attribute" );
SwTxtNode& rTNd = (SwTxtNode&)pAttr->GetTxtNode();
SwPosition aPos( rTNd, SwIndex( &rTNd, *pAttr->GetStart() ));
- SwCntntFrm* pCFrm = rTNd.GetFrm( 0, &aPos, sal_False );
+ SwCntntFrm* pCFrm = rTNd.getLayoutFrm( getRootFrm(), 0, &aPos, sal_False );
return pCFrm;
}
diff --git a/sw/source/core/layout/hffrm.cxx b/sw/source/core/layout/hffrm.cxx
index 9472822e2d..2bb4f721e4 100644
--- a/sw/source/core/layout/hffrm.cxx
+++ b/sw/source/core/layout/hffrm.cxx
@@ -35,7 +35,9 @@
#include <fmtcntnt.hxx>
#include <fmthdft.hxx>
#include <fmtfsize.hxx>
+#include "viewopt.hxx"
#include "hffrm.hxx"
+#include "rootfrm.hxx"
#include "txtfrm.hxx"
#include "sectfrm.hxx"
#include "flyfrm.hxx"
@@ -117,8 +119,8 @@ static void lcl_LayoutFrmEnsureMinHeight(SwLayoutFrm & rFrm,
}
}
-SwHeadFootFrm::SwHeadFootFrm( SwFrmFmt * pFmt, sal_uInt16 nTypeIn)
- : SwLayoutFrm(pFmt)
+SwHeadFootFrm::SwHeadFootFrm( SwFrmFmt * pFmt, SwFrm* pSib, sal_uInt16 nTypeIn)
+ : SwLayoutFrm( pFmt, pSib )
{
nType = nTypeIn;
SetDerivedVert( sal_False );
@@ -708,9 +710,10 @@ void SwPageFrm::PrepareHeader()
if ( !pLay )
return;
- const SwFmtHeader &rH = ((SwFrmFmt*)pRegisteredIn)->GetHeader();
+ const SwFmtHeader &rH = ((SwFrmFmt*)GetRegisteredIn())->GetHeader();
- const sal_Bool bOn = !((SwFrmFmt*)pRegisteredIn)->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
+ const sal_Bool bOn = !(pSh && pSh->GetViewOptions()->getBrowseMode());
if ( bOn && rH.IsActive() )
{ //Header einsetzen, vorher entfernen falls vorhanden.
@@ -727,7 +730,7 @@ void SwPageFrm::PrepareHeader()
delete pDel;
}
ASSERT( pLay, "Wohin mit dem Header?" );
- SwHeaderFrm *pH = new SwHeaderFrm( (SwFrmFmt*)rH.GetHeaderFmt() );
+ SwHeaderFrm *pH = new SwHeaderFrm( (SwFrmFmt*)rH.GetHeaderFmt(), this );
pH->Paste( this, pLay );
if ( GetUpper() )
::RegistFlys( this, pH );
@@ -756,11 +759,12 @@ void SwPageFrm::PrepareFooter()
if ( !pLay )
return;
- const SwFmtFooter &rF = ((SwFrmFmt*)pRegisteredIn)->GetFooter();
+ const SwFmtFooter &rF = ((SwFrmFmt*)GetRegisteredIn())->GetFooter();
while ( pLay->GetNext() )
pLay = (SwLayoutFrm*)pLay->GetNext();
- const sal_Bool bOn = !((SwFrmFmt*)pRegisteredIn)->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
+ const sal_Bool bOn = !(pSh && pSh->GetViewOptions()->getBrowseMode());
if ( bOn && rF.IsActive() )
{ //Footer einsetzen, vorher entfernen falls vorhanden.
@@ -774,7 +778,7 @@ void SwPageFrm::PrepareFooter()
pLay->Cut();
delete pLay;
}
- SwFooterFrm *pF = new SwFooterFrm( (SwFrmFmt*)rF.GetFooterFmt() );
+ SwFooterFrm *pF = new SwFooterFrm( (SwFrmFmt*)rF.GetFooterFmt(), this );
pF->Paste( this );
if ( GetUpper() )
::RegistFlys( this, pF );
@@ -782,10 +786,10 @@ void SwPageFrm::PrepareFooter()
else if ( pLay && pLay->IsFooterFrm() )
{ //Footer entfernen falls vorhanden.
::DelFlys( pLay, this );
- ViewShell *pSh;
- if ( pLay->GetPrev() && 0 != (pSh = GetShell()) &&
- pSh->VisArea().HasArea() )
- pSh->InvalidateWindows( pSh->VisArea() );
+ ViewShell *pShell;
+ if ( pLay->GetPrev() && 0 != (pShell = getRootFrm()->GetCurrShell()) &&
+ pShell->VisArea().HasArea() )
+ pShell->InvalidateWindows( pShell->VisArea() );
pLay->Cut();
delete pLay;
}
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 4004338797..8c426ad604 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -438,7 +438,8 @@ sal_Bool SwLayAction::RemoveEmptyBrowserPages()
//Beim umschalten vom normalen in den Browsermodus bleiben u.U. einige
//unangenehm lange stehen. Diese beseiten wir mal schnell.
sal_Bool bRet = sal_False;
- if ( pRoot->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ const ViewShell *pSh = pRoot->GetCurrShell();
+ if( pSh && pSh->GetViewOptions()->getBrowseMode() )
{
SwPageFrm *pPage = (SwPageFrm*)pRoot->Lower();
do
@@ -1191,7 +1192,8 @@ static const SwAnchoredObject* lcl_FindFirstInvaObj( const SwPageFrm* _pPage,
sal_Bool SwLayAction::IsShortCut( SwPageFrm *&prPage )
{
sal_Bool bRet = sal_False;
- const sal_Bool bBrowse = pRoot->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
+ const ViewShell *pSh = pRoot->GetCurrShell();
+ const sal_Bool bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode();
//Wenn die Seite nicht Gueltig ist wird sie schnell formatiert, sonst
//gibts nix als Aerger.
@@ -1440,18 +1442,13 @@ sal_Bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, sal_Bool bAddRect )
sal_Bool bNoPaint = sal_False;
if ( pLay->IsPageBodyFrm() &&
pLay->Frm().Pos() == aOldRect.Pos() &&
- pLay->Lower() &&
- pLay->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ pLay->Lower() )
{
- //HotFix: Vobis Homepage, nicht so genau hinsehen, sonst
- //rpaints
-
+ const ViewShell *pSh = pLay->getRootFrm()->GetCurrShell();
//Einschraenkungen wegen Kopf-/Fusszeilen
- if ( !( pLay->IsCompletePaint() &&
- pLay->FindPageFrm()->FindFtnCont() ) )
- {
+ if( pSh && pSh->GetViewOptions()->getBrowseMode() &&
+ !( pLay->IsCompletePaint() && pLay->FindPageFrm()->FindFtnCont() ) )
bNoPaint = sal_True;
- }
}
if ( !bNoPaint && IsPaint() && bAddRect && (pLay->IsCompletePaint() || bChanged) )
@@ -1492,8 +1489,14 @@ sal_Bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, sal_Bool bAddRect )
aPaint.Bottom( aPaint.Bottom() + nBorderWidth + nShadowWidth);
}
- if ( pLay->IsPageFrm() &&
- pLay->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ sal_Bool bPageInBrowseMode = pLay->IsPageFrm();
+ if( bPageInBrowseMode )
+ {
+ const ViewShell *pSh = pLay->getRootFrm()->GetCurrShell();
+ if( !pSh || !pSh->GetViewOptions()->getBrowseMode() )
+ bPageInBrowseMode = sal_False;
+ }
+ if( bPageInBrowseMode )
{
// NOTE: no vertical layout in online layout
//Ist die Aenderung ueberhaupt sichtbar?
@@ -1648,13 +1651,21 @@ sal_Bool SwLayAction::FormatLayoutFly( SwFlyFrm* pFly )
bChanged = aOldRect != pFly->Frm();
if ( IsPaint() && (pFly->IsCompletePaint() || bChanged) &&
- pFly->Frm().Top() > 0 && pFly->Frm().Left() > 0 )
+ pFly->Frm().Top() > 0 && pFly->Frm().Left() > 0 )
pImp->GetShell()->AddPaintRect( pFly->Frm() );
if ( bChanged )
pFly->Invalidate();
else
pFly->Validate();
+/*
+ //mba: it's unclear why we should invalidate always, so I remove it
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( IsPaint() && bAddRect && pFly->Frm().Top() > 0 && pFly->Frm().Left() > 0 )
+ pImp->GetShell()->AddPaintRect( pFly->Frm() );
+
+ pFly->Invalidate();
+*/
bAddRect = false;
pFly->ResetCompletePaint();
}
@@ -1840,7 +1851,8 @@ sal_Bool SwLayAction::FormatLayoutTab( SwTabFrm *pTab, sal_Bool bAddRect )
sal_Bool SwLayAction::FormatCntnt( const SwPageFrm *pPage )
{
const SwCntntFrm *pCntnt = pPage->ContainsCntnt();
- const sal_Bool bBrowse = pRoot->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
+ const ViewShell *pSh = pRoot->GetCurrShell();
+ const sal_Bool bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode();
while ( pCntnt && pPage->IsAnLower( pCntnt ) )
{
diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx
index 45437a3876..463eeafeff 100644
--- a/sw/source/core/layout/laycache.cxx
+++ b/sw/source/core/layout/laycache.cxx
@@ -55,6 +55,8 @@
#include <frmtool.hxx>
#include <dflyobj.hxx>
#include <dcontact.hxx>
+#include "viewopt.hxx"
+#include "viewsh.hxx"
#include <flyfrm.hxx>
// OD 2004-05-24 #i28701#
#include <sortedobjs.hxx>
@@ -186,7 +188,7 @@ sal_Bool SwLayCacheImpl::Read( SvStream& rStream )
void SwLayoutCache::Write( SvStream &rStream, const SwDoc& rDoc )
{
- if( rDoc.GetRootFrm() ) // the layout itself ..
+ if( rDoc.GetCurrentLayout() ) // the layout itself .. //swmod 080218
{
SwLayCacheIoImpl aIo( rStream, sal_True );
// We want to save the relative index, so we need the index
@@ -194,7 +196,7 @@ void SwLayoutCache::Write( SvStream &rStream, const SwDoc& rDoc )
sal_uLong nStartOfContent = rDoc.GetNodes().GetEndOfContent().
StartOfSectionNode()->GetIndex();
// The first page..
- SwPageFrm* pPage = (SwPageFrm*)rDoc.GetRootFrm()->Lower();
+ SwPageFrm* pPage = (SwPageFrm*)rDoc.GetCurrentLayout()->Lower(); //swmod 080218
aIo.OpenRec( SW_LAYCACHE_IO_REC_PAGES );
aIo.OpenFlagRec( 0, 0 );
@@ -347,13 +349,16 @@ void SwLayoutCache::Write( SvStream &rStream, const SwDoc& rDoc )
#ifdef DBG_UTIL
sal_Bool SwLayoutCache::CompareLayout( const SwDoc& rDoc ) const
{
+ if( !pImpl )
+ return sal_True;
+ const SwRootFrm *pRootFrm = rDoc.GetCurrentLayout();
sal_Bool bRet = sal_True;
- if( pImpl && rDoc.GetRootFrm() )
+ if( pRootFrm )
{
sal_uInt16 nIndex = 0;
sal_uLong nStartOfContent = rDoc.GetNodes().GetEndOfContent().
StartOfSectionNode()->GetIndex();
- SwPageFrm* pPage = (SwPageFrm*)rDoc.GetRootFrm()->Lower();
+ SwPageFrm* pPage = (SwPageFrm*)pRootFrm->Lower();
if( pPage )
pPage = (SwPageFrm*)pPage->GetNext();
while( pPage )
@@ -597,7 +602,10 @@ sal_uLong SwLayHelper::CalcPageCount()
}
if ( nNdCount < 1000 )
nPgCount = 0;// no progress bar for small documents
- if ( pDoc->get(IDocumentSettingAccess::BROWSE_MODE) )
+ ViewShell *pSh = 0;
+ if( rpLay && rpLay->getRootFrm() )
+ pSh = rpLay->getRootFrm()->GetCurrShell();
+ if( pSh && pSh->GetViewOptions()->getBrowseMode() )
nMaxParaPerPage *= 6;
}
}
@@ -892,7 +900,7 @@ sal_Bool SwLayHelper::CheckInsert( sal_uLong nNodeIndex )
{
ASSERT( pTab->GetTable()->GetTabLines()[ nRowIdx ], "Table ohne Zeilen?" );
pHeadline =
- new SwRowFrm( *pTab->GetTable()->GetTabLines()[ nRowIdx ] );
+ new SwRowFrm( *pTab->GetTable()->GetTabLines()[ nRowIdx ], pTab );
pHeadline->SetRepeatedHeadline( true );
pHeadline->InsertBefore( pFoll, 0 );
pHeadline->RegistFlys();
@@ -924,7 +932,7 @@ sal_Bool SwLayHelper::CheckInsert( sal_uLong nNodeIndex )
else
{
SwTxtFrm *pNew = new SwTxtFrm( ((SwTxtFrm*)rpFrm)->
- GetTxtNode() );
+ GetTxtNode(), rpFrm );
pNew->_SetIsFollow( sal_True );
pNew->ManipOfst( nOfst );
pNew->SetFollow( ((SwTxtFrm*)rpFrm)->GetFollow() );
diff --git a/sw/source/core/layout/movedfwdfrmsbyobjpos.cxx b/sw/source/core/layout/movedfwdfrmsbyobjpos.cxx
index d894652e01..cdbd8376b8 100644
--- a/sw/source/core/layout/movedfwdfrmsbyobjpos.cxx
+++ b/sw/source/core/layout/movedfwdfrmsbyobjpos.cxx
@@ -29,11 +29,10 @@
#include "precompiled_sw.hxx"
#include <movedfwdfrmsbyobjpos.hxx>
#include <txtfrm.hxx>
-// --> OD 2004-10-05 #i26945#
#include <rowfrm.hxx>
#include <pagefrm.hxx>
#include <ndtxt.hxx>
-// <--
+#include <switerator.hxx>
SwMovedFwdFrmsByObjPos::SwMovedFwdFrmsByObjPos()
{
@@ -86,10 +85,8 @@ bool SwMovedFwdFrmsByObjPos::DoesRowContainMovedFwdFrm( const SwRowFrm& _rRowFrm
const NodeMapEntry& rEntry = *(aIter);
if ( rEntry.second >= nPageNumOfRow )
{
- SwClientIter aFrmIter( *const_cast<SwTxtNode*>( rEntry.first ) );
- for( SwTxtFrm* pTxtFrm = (SwTxtFrm*)aFrmIter.First( TYPE(SwTxtFrm) );
- pTxtFrm;
- pTxtFrm = (SwTxtFrm*)aFrmIter.Next() )
+ SwIterator<SwTxtFrm,SwTxtNode> aFrmIter( *rEntry.first );
+ for( SwTxtFrm* pTxtFrm = aFrmIter.First(); pTxtFrm; pTxtFrm = (SwTxtFrm*)aFrmIter.Next() )
{
// --> OD 2004-12-03 #115759# - assure that found text frame
// is the first one.
diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx
index 7266c07de8..60cbd2e1fd 100644
--- a/sw/source/core/layout/newfrm.cxx
+++ b/sw/source/core/layout/newfrm.cxx
@@ -290,9 +290,67 @@ static SwRectFnCollection aVerticalRightToLeft = {
&SwRect::SetBottomAndHeight,
&SwRect::SetLeftAndWidth
};
+//Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+static SwRectFnCollection aVerticalLeftToRight = {
+ /* fnRectGet */
+ &SwRect::_Left,
+ &SwRect::_Right,
+ &SwRect::_Top,
+ &SwRect::_Bottom,
+ &SwRect::_Height,
+ &SwRect::_Width,
+ &SwRect::TopLeft,
+ &SwRect::SwappedSize,
+ /* fnRectSet */
+ &SwRect::_Left,
+ &SwRect::_Right,
+ &SwRect::_Top,
+ &SwRect::_Bottom,
+ &SwRect::_Height,
+ &SwRect::_Width,
+
+ &SwRect::SubLeft,
+ &SwRect::AddRight,
+ &SwRect::SubTop,
+ &SwRect::AddBottom,
+ &SwRect::AddHeight,
+ &SwRect::AddWidth,
+
+ &SwRect::SetPosY,
+ &SwRect::SetPosX,
+
+ &SwFrm::GetLeftMargin,
+ &SwFrm::GetRightMargin,
+ &SwFrm::GetTopMargin,
+ &SwFrm::GetBottomMargin,
+ &SwFrm::SetTopBottomMargins,
+ &SwFrm::SetLeftRightMargins,
+ &SwFrm::GetPrtLeft,
+ &SwFrm::GetPrtRight,
+ &SwFrm::GetPrtTop,
+ &SwFrm::GetPrtBottom,
+ &SwRect::GetLeftDistance,
+ &SwRect::GetRightDistance,
+ &SwRect::GetTopDistance,
+ &SwRect::GetBottomDistance,
+ &SwFrm::SetMaxRight,
+ &SwRect::OverStepRight,
+ &SwRect::SetUpperLeftCorner,
+ &SwFrm::MakeRightPos,
+ &FirstMinusSecond,
+ &FirstMinusSecond,
+ &SwIncrement,
+ &SwIncrement,
+ &SwRect::SetTopAndHeight,
+ &SwRect::SetLeftAndWidth
+};
+//End of SCMS
SwRectFn fnRectHori = &aHorizontal;
SwRectFn fnRectVert = &aVertical;
+//Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+SwRectFn fnRectVertL2R = &aVerticalLeftToRight;
+//End of SCMS
SwRectFn fnRectB2T = &aBottomToTop;
SwRectFn fnRectVL2R = &aVerticalRightToLeft;
@@ -424,7 +482,7 @@ void InitCurrShells( SwRootFrm *pRoot )
SwRootFrm::SwRootFrm( SwFrmFmt *pFmt, ViewShell * pSh ) :
SwLayoutFrm( pFmt->GetDoc()->MakeFrmFmt(
- XubString( "Root", RTL_TEXTENCODING_MS_1252 ), pFmt ) ),
+ XubString( "Root", RTL_TEXTENCODING_MS_1252 ), pFmt ), 0 ),
// --> PAGES01
maPagesArea(),
mnViewWidth( -1 ),
@@ -446,7 +504,11 @@ SwRootFrm::SwRootFrm( SwFrmFmt *pFmt, ViewShell * pSh ) :
nType = FRMC_ROOT;
bIdleFormat = bTurboAllowed = bAssertFlyPages = bIsNewLayout = sal_True;
bCheckSuperfluous = bBrowseWidthValid = sal_False;
+ setRootFrm( this );
+}
+void SwRootFrm::Init( SwFrmFmt* pFmt )
+{
InitCurrShells( this );
IDocumentTimerAccess *pTimerAccess = pFmt->getIDocumentTimerAccess();
@@ -454,14 +516,17 @@ SwRootFrm::SwRootFrm( SwFrmFmt *pFmt, ViewShell * pSh ) :
IDocumentFieldsAccess *pFieldsAccess = pFmt->getIDocumentFieldsAccess();
const IDocumentSettingAccess *pSettingAccess = pFmt->getIDocumentSettingAccess();
pTimerAccess->StopIdling();
- pLayoutAccess->SetRootFrm( this ); //Fuer das Erzeugen der Flys durch MakeFrms()
+ pLayoutAccess->SetCurrentViewShell( this->GetCurrShell() ); //Fuer das Erzeugen der Flys durch MakeFrms() //swmod 071108//swmod 071225
bCallbackActionEnabled = sal_False; //vor Verlassen auf sal_True setzen!
SdrModel *pMd = pFmt->getIDocumentDrawModelAccess()->GetDrawModel();
-
if ( pMd )
{
- pDrawPage = pMd->GetPage( 0 );
+ // Disable "multiple layout"
+ pDrawPage = pMd->GetPage(0); //pMd->AllocPage( FALSE );
+ //pMd->InsertPage( pDrawPage );
+ // end of disabling
+
pDrawPage->SetSize( Frm().SSize() );
}
@@ -551,8 +616,9 @@ SwRootFrm::~SwRootFrm()
pTurbo = 0;
if(pBlink)
pBlink->FrmDelete( this );
- ((SwFrmFmt*)pRegisteredIn)->GetDoc()->DelFrmFmt( (SwFrmFmt*)pRegisteredIn );
+ static_cast<SwFrmFmt*>(GetRegisteredInNonConst())->GetDoc()->DelFrmFmt( static_cast<SwFrmFmt*>(GetRegisteredInNonConst()) );
delete pDestroy;
+ pDestroy = 0;
//Referenzen entfernen.
for ( sal_uInt16 i = 0; i < pCurrShells->Count(); ++i )
@@ -585,5 +651,38 @@ void SwRootFrm::RemoveMasterObjs( SdrPage *pPg )
}
+void SwRootFrm::AllCheckPageDescs() const
+{
+ CheckPageDescs( (SwPageFrm*)this->Lower() );
+}
+//swmod 080226
+void SwRootFrm::AllInvalidateAutoCompleteWords() const
+{
+ SwPageFrm *pPage = (SwPageFrm*)this->Lower();
+ while ( pPage )
+ {
+ pPage->InvalidateAutoCompleteWords();
+ pPage = (SwPageFrm*)pPage->GetNext();
+ }
+}//swmod 080305
+void SwRootFrm::AllAddPaintRect() const
+{
+ GetCurrShell()->AddPaintRect( this->Frm() );
+}//swmod 080305
+void SwRootFrm::AllRemoveFtns()
+{
+ RemoveFtns();
+}
+void SwRootFrm::AllInvalidateSmartTagsOrSpelling(sal_Bool bSmartTags) const
+{
+ SwPageFrm *pPage = (SwPageFrm*)this->Lower();
+ while ( pPage )
+ {
+ if ( bSmartTags )
+ pPage->InvalidateSmartTags();
+ pPage->InvalidateSpelling();
+ pPage = (SwPageFrm*)pPage->GetNext();
+ } //swmod 080218
+}
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index 1821cf8a24..cd81919bc4 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -46,6 +46,7 @@
#include <docsh.hxx>
#include "viewimp.hxx"
+#include "viewopt.hxx"
#include "pagefrm.hxx"
#include "rootfrm.hxx"
#include "cntfrm.hxx"
@@ -73,9 +74,8 @@
#include "poolfmt.hxx"
#include <editeng/frmdiritem.hxx>
#include <swfntcch.hxx> // SwFontAccess
-// OD 2004-05-24 #i28701#
#include <sortedobjs.hxx>
-
+#include <switerator.hxx>
#include <vcl/svapp.hxx>
using namespace ::com::sun::star;
@@ -89,8 +89,8 @@ using namespace ::com::sun::star;
|* Letzte Aenderung MA 01. Aug. 93
|*
|*************************************************************************/
-SwBodyFrm::SwBodyFrm( SwFrmFmt *pFmt ):
- SwLayoutFrm( pFmt )
+SwBodyFrm::SwBodyFrm( SwFrmFmt *pFmt, SwFrm* pSib ):
+ SwLayoutFrm( pFmt, pSib )
{
nType = FRMC_BODY;
}
@@ -131,7 +131,8 @@ void SwBodyFrm::Format( const SwBorderAttrs * )
if ( nHeight < 0 )
nHeight = 0;
Frm().Height( nHeight );
- if( IsVertical() && !IsReverse() && nWidth != Frm().Width() )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if( IsVertical() && !IsVertLR() && !IsReverse() && nWidth != Frm().Width() )
Frm().Pos().X() += Frm().Width() - nWidth;
Frm().Width( nWidth );
}
@@ -196,8 +197,8 @@ void SwBodyFrm::Format( const SwBorderAttrs * )
|* Letzte Aenderung MA 08. Dec. 97
|*
|*************************************************************************/
-SwPageFrm::SwPageFrm( SwFrmFmt *pFmt, SwPageDesc *pPgDsc ) :
- SwFtnBossFrm( pFmt ),
+SwPageFrm::SwPageFrm( SwFrmFmt *pFmt, SwFrm* pSib, SwPageDesc *pPgDsc ) :
+ SwFtnBossFrm( pFmt, pSib ),
pSortedObjs( 0 ),
pDesc( pPgDsc ),
nPhyPageNum( 0 ),
@@ -221,12 +222,12 @@ SwPageFrm::SwPageFrm( SwFrmFmt *pFmt, SwPageDesc *pPgDsc ) :
bInvalidLayout = bInvalidCntnt = bInvalidSpelling = bInvalidSmartTags = bInvalidAutoCmplWrds = bInvalidWordCount = sal_True;
bInvalidFlyLayout = bInvalidFlyCntnt = bInvalidFlyInCnt = bFtnPage = bEndNotePage = sal_False;
- const bool bBrowseMode = pFmt->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
+ const bool bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode();
if ( bBrowseMode )
{
Frm().Height( 0 );
- ViewShell *pSh = GetShell();
- long nWidth = pSh ? pSh->VisArea().Width():0;
+ long nWidth = pSh->VisArea().Width();
if ( !nWidth )
nWidth = 5000L; //aendert sich sowieso
Frm().Width ( nWidth );
@@ -241,7 +242,7 @@ SwPageFrm::SwPageFrm( SwFrmFmt *pFmt, SwPageDesc *pPgDsc ) :
{
bEmptyPage = sal_False;
Calc(); //Damit die PrtArea stimmt.
- SwBodyFrm *pBodyFrm = new SwBodyFrm( pDoc->GetDfltFrmFmt() );
+ SwBodyFrm *pBodyFrm = new SwBodyFrm( pDoc->GetDfltFrmFmt(), this );
pBodyFrm->ChgSize( Prt().SSize() );
pBodyFrm->Paste( this );
pBodyFrm->Calc(); //Damit die Spalten korrekt
@@ -291,7 +292,7 @@ SwPageFrm::~SwPageFrm()
SwDoc *pDoc = GetFmt()->GetDoc();
if( pDoc && !pDoc->IsInDtor() )
{
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
if ( pSh )
{
SwViewImp *pImp = pSh->Imp();
@@ -340,17 +341,33 @@ void SwPageFrm::CheckDirection( sal_Bool bVert )
((SvxFrameDirectionItem&)GetFmt()->GetFmtAttr( RES_FRAMEDIR )).GetValue();
if( bVert )
{
- if( FRMDIR_HORI_LEFT_TOP == nDir || FRMDIR_HORI_RIGHT_TOP == nDir ||
- GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ if( FRMDIR_HORI_LEFT_TOP == nDir || FRMDIR_HORI_RIGHT_TOP == nDir )
+ {
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ bVertLR = 0;
bVertical = 0;
+ }
else
- bVertical = 1;
-/*
- if( pDesc && pDesc->GetName().GetChar(0)=='x')
- bReverse = 1;
- else
- */
- bReverse = 0;
+ {
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
+ if( pSh && pSh->GetViewOptions()->getBrowseMode() )
+ {
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ bVertLR = 0;
+ bVertical = 0;
+ }
+ else
+ {
+ bVertical = 1;
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if(FRMDIR_VERT_TOP_RIGHT == nDir)
+ bVertLR = 0;
+ else if(FRMDIR_VERT_TOP_LEFT==nDir)
+ bVertLR = 1;
+ }
+ }
+
+ bReverse = 0;
bInvalidVert = 0;
}
else
@@ -455,17 +472,15 @@ void MA_FASTCALL lcl_MakeObjs( const SwSpzFrmFmts &rTbl, SwPageFrm *pPage )
}
else
{
- SwClientIter aIter( *pFmt );
- SwClient *pTmp = aIter.First( TYPE(SwFrm) );
- SwFlyFrm *pFly;
- if ( pTmp )
+ SwIterator<SwFlyFrm,SwFmt> aIter( *pFmt );
+ SwFlyFrm *pFly = aIter.First();
+ if ( pFly)
{
- pFly = (SwFlyFrm*)pTmp;
if( pFly->GetAnchorFrm() )
pFly->AnchorFrm()->RemoveFly( pFly );
}
else
- pFly = new SwFlyLayFrm( (SwFlyFrmFmt*)pFmt, pPg );
+ pFly = new SwFlyLayFrm( (SwFlyFrmFmt*)pFmt, pPg, pPg );
pPg->AppendFly( pFly );
::RegistFlys( pPg, pFly );
}
@@ -530,9 +545,9 @@ void SwPageFrm::PreparePage( sal_Bool bFtn )
|* Letzte Aenderung MA 03. Mar. 96
|*
|*************************************************************************/
-void SwPageFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
+void SwPageFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
{
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
if ( pSh )
pSh->SetFirstVisPageInvalid();
sal_uInt8 nInvFlags = 0;
@@ -577,7 +592,7 @@ void SwPageFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
}
}
-void SwPageFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew,
+void SwPageFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
sal_uInt8 &rInvFlags,
SwAttrSetChg *pOldSet, SwAttrSetChg *pNewSet )
{
@@ -622,7 +637,8 @@ void SwPageFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew,
case RES_FRM_SIZE:
{
const SwRect aOldPageFrmRect( Frm() );
- if ( GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
+ if( pSh && pSh->GetViewOptions()->getBrowseMode() )
{
bValidSize = sal_False;
// OD 28.10.2002 #97265# - Don't call <SwPageFrm::MakeAll()>
@@ -650,8 +666,7 @@ void SwPageFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew,
static_cast<SwRootFrm*>(GetUpper())->CheckViewLayout( 0, 0 );
}
//Window aufraeumen.
- ViewShell *pSh;
- if ( 0 != (pSh = GetShell()) && pSh->GetWin() && aOldPageFrmRect.HasArea() )
+ if( pSh && pSh->GetWin() && aOldPageFrmRect.HasArea() )
{
// OD 12.02.2003 #i9719#, #105645# - consider border and shadow of
// page frame for determine 'old' rectangle - it's used for invalidating.
@@ -790,7 +805,8 @@ SwPageDesc *SwPageFrm::FindPageDesc()
SwPageDesc *pRet = 0;
//5.
- if ( GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
+ if( pSh && pSh->GetViewOptions()->getBrowseMode() )
{
SwCntntFrm *pFrm = GetUpper()->ContainsCntnt();
while ( !pFrm->IsInDocBody() )
@@ -847,10 +863,13 @@ void AdjustSizeChgNotify( SwRootFrm *pRoot )
ViewShell *pSh = pRoot->GetCurrShell();
if ( pSh )
{
- pSh->Imp()->NotifySizeChg( pRoot->Frm().SSize() );//Einmal fuer das Drawing.
do
{
- pSh->SizeChgNotify(); //Einmal fuer jede Sicht.
+ if( pRoot == pSh->GetLayout() )
+ {
+ pSh->SizeChgNotify();
+ pSh->Imp()->NotifySizeChg( pRoot->Frm().SSize() );
+ }
pSh = (ViewShell*)pSh->GetNext();
} while ( pSh != pRoot->GetCurrShell() );
}
@@ -876,7 +895,7 @@ void SwPageFrm::Cut()
// PAGES01
//AdjustRootSize( CHG_CUTPAGE, 0 );
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
if ( !IsEmptyPage() )
{
if ( GetNext() )
@@ -982,9 +1001,11 @@ void SwPageFrm::Paste( SwFrm* pParent, SwFrm* pSibling )
InvalidatePos();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
+ if ( pSh )
+ pSh->SetFirstVisPageInvalid();
// PAGES01
- if ( GetUpper() )
- static_cast<SwRootFrm*>(GetUpper())->CheckViewLayout( 0, 0 );
+ getRootFrm()->CheckViewLayout( 0, 0 );
}
/*************************************************************************
@@ -1066,7 +1087,7 @@ void SwFrm::CheckPageDescs( SwPageFrm *pStart, sal_Bool bNotifyFields )
{
ASSERT( pStart, "Keine Startpage." );
- ViewShell *pSh = pStart->GetShell();
+ ViewShell *pSh = pStart->getRootFrm()->GetCurrShell();
SwViewImp *pImp = pSh ? pSh->Imp() : 0;
if ( pImp && pImp->IsAction() && !pImp->GetLayAction().IsCheckPages() )
@@ -1157,7 +1178,7 @@ void SwFrm::CheckPageDescs( SwPageFrm *pStart, sal_Bool bNotifyFields )
{
if ( pPage->GetPrev() )
pDesc = ((SwPageFrm*)pPage->GetPrev())->GetPageDesc();
- SwPageFrm *pTmp = new SwPageFrm( pDoc->GetEmptyPageFmt(),pDesc);
+ SwPageFrm *pTmp = new SwPageFrm( pDoc->GetEmptyPageFmt(),pRoot,pDesc);
pTmp->Paste( pRoot, pPage );
pTmp->PreparePage( sal_False );
pPage = pTmp;
@@ -1316,7 +1337,7 @@ SwPageFrm *SwFrm::InsertPage( SwPageFrm *pPrevPage, sal_Bool bFtn )
if( bWishedOdd != bNextOdd )
{ pFmt = pDoc->GetEmptyPageFmt();
SwPageDesc *pTmpDesc = pPrevPage->GetPageDesc();
- SwPageFrm *pPage = new SwPageFrm( pFmt, pTmpDesc );
+ SwPageFrm *pPage = new SwPageFrm( pFmt, pRoot, pTmpDesc );
pPage->Paste( pRoot, pSibling );
pPage->PreparePage( bFtn );
//Wenn der Sibling keinen Bodytext enthaelt kann ich ihn vernichten
@@ -1336,7 +1357,7 @@ SwPageFrm *SwFrm::InsertPage( SwPageFrm *pPrevPage, sal_Bool bFtn )
}
pFmt = bWishedOdd ? pDesc->GetRightFmt() : pDesc->GetLeftFmt();
ASSERT( pFmt, "Descriptor without format." );
- SwPageFrm *pPage = new SwPageFrm( pFmt, pDesc );
+ SwPageFrm *pPage = new SwPageFrm( pFmt, pRoot, pDesc );
pPage->Paste( pRoot, pSibling );
pPage->PreparePage( bFtn );
//Wenn der Sibling keinen Bodytext enthaelt kann ich ihn vernichten
@@ -1359,7 +1380,7 @@ SwPageFrm *SwFrm::InsertPage( SwPageFrm *pPrevPage, sal_Bool bFtn )
if ( bCheckPages )
{
CheckPageDescs( pSibling, sal_False );
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
SwViewImp *pImp = pSh ? pSh->Imp() : 0;
if ( pImp && pImp->IsAction() && !pImp->GetLayAction().IsCheckPages() )
{
@@ -1376,7 +1397,7 @@ SwPageFrm *SwFrm::InsertPage( SwPageFrm *pPrevPage, sal_Bool bFtn )
//Fuer das Aktualisieren der Seitennummern-Felder gibt nDocPos
//die Seitenposition an, _ab_ der invalidiert werden soll.
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
if ( !pSh || !pSh->Imp()->IsUpdateExpFlds() )
{
SwDocPosUpdate aMsgHnt( pPrevPage->Frm().Top() );
@@ -1387,17 +1408,15 @@ SwPageFrm *SwFrm::InsertPage( SwPageFrm *pPrevPage, sal_Bool bFtn )
sw::sidebarwindows::SidebarPosition SwPageFrm::SidebarPosition() const
{
- if ( !GetShell() ||
- GetShell()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
+ if( !pSh || pSh->GetViewOptions()->getBrowseMode() )
{
- // --> OD 2010-06-03 #i111964# - provide default sidebar position
return sw::sidebarwindows::SIDEBAR_RIGHT;
- // <--
}
else
{
- const bool bLTR = GetUpper() ? static_cast<const SwRootFrm*>(GetUpper())->IsLeftToRightViewLayout() : true;
- const bool bBookMode = GetShell()->GetViewOptions()->IsViewLayoutBookMode();
+ const bool bLTR = getRootFrm()->IsLeftToRightViewLayout();
+ const bool bBookMode = pSh->GetViewOptions()->IsViewLayoutBookMode();
const bool bRightSidebar = bLTR ? (!bBookMode || OnRightPage()) : (bBookMode && !OnRightPage());
return bRightSidebar
@@ -1538,7 +1557,7 @@ void SwRootFrm::RemoveSuperfluous()
}
} while ( pPage );
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
if ( nDocPos != LONG_MAX &&
(!pSh || !pSh->Imp()->IsUpdateExpFlds()) )
{
@@ -1599,7 +1618,7 @@ void SwRootFrm::AssertFlyPages()
{
//Leerseite einfuegen, die Flys werden aber erst von
//der naechsten Seite aufgenommen!
- pPage = new SwPageFrm( pDoc->GetEmptyPageFmt(), pDesc );
+ pPage = new SwPageFrm( pDoc->GetEmptyPageFmt(), this, pDesc );
pPage->Paste( this, pSibling );
pPage->PreparePage( sal_False );
bOdd = bOdd ? sal_False : sal_True;
@@ -1607,7 +1626,7 @@ void SwRootFrm::AssertFlyPages()
}
pPage = new
SwPageFrm( (bOdd ? pDesc->GetRightFmt() :
- pDesc->GetLeftFmt()), pDesc );
+ pDesc->GetLeftFmt()), this, pDesc );
pPage->Paste( this, pSibling );
pPage->PreparePage( sal_False );
bOdd = bOdd ? sal_False : sal_True;
@@ -1672,13 +1691,13 @@ void SwRootFrm::AssertPageFlys( SwPageFrm *pPage )
//Umhaengen kann er sich selbst, indem wir ihm
//einfach ein Modify mit seinem AnkerAttr schicken.
#ifndef DBG_UTIL
- rFmt.SwModify::Modify( 0, (SwFmtAnchor*)&rAnch );
+ rFmt.NotifyClients( 0, (SwFmtAnchor*)&rAnch );
#else
const sal_uInt32 nCnt = pPage->GetSortedObjs()->Count();
- rFmt.SwModify::Modify( 0, (SwFmtAnchor*)&rAnch );
+ rFmt.NotifyClients( 0, (SwFmtAnchor*)&rAnch );
ASSERT( !pPage->GetSortedObjs() ||
nCnt != pPage->GetSortedObjs()->Count(),
- "Kann das Obj nicht umhaengen." );
+ "Object couldn't be reattached!" );
#endif
--i;
}
@@ -1758,8 +1777,8 @@ void SwRootFrm::ImplInvalidateBrowseWidth()
|*************************************************************************/
void SwRootFrm::ImplCalcBrowseWidth()
{
- ASSERT( GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE),
- "CalcBrowseWidth and not in BrowseView" );
+ ASSERT( GetCurrShell() && GetCurrShell()->GetViewOptions()->getBrowseMode(),
+ "CalcBrowseWidth and not in BrowseView" )
//Die (minimale) Breite wird von Rahmen, Tabellen und Zeichenobjekten
//bestimmt. Die Breite wird nicht anhand ihrer aktuellen Groessen bestimmt,
@@ -1776,7 +1795,7 @@ void SwRootFrm::ImplCalcBrowseWidth()
return;
bBrowseWidthValid = sal_True;
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
nBrowseWidth = pSh
? MINLAY + 2 * pSh->GetOut()->
PixelToLogic( pSh->GetBrowseBorder() ).Width()
@@ -2026,7 +2045,8 @@ void lcl_MoveAllLowerObjs( SwFrm* pFrm, const Point& rOffset )
if ( pFlyFrm->Lower()->IsNoTxtFrm() )
{
SwCntntFrm* pCntntFrm = static_cast<SwCntntFrm*>(pFlyFrm->Lower());
- ViewShell *pSh = pFlyFrm->Lower()->GetShell();
+ SwRootFrm* pRoot = pFlyFrm->Lower()->getRootFrm();
+ ViewShell *pSh = pRoot ? pRoot->GetCurrShell() : 0;
if ( pSh )
{
SwOLENode* pNode = pCntntFrm->GetNode()->GetOLENode();
@@ -2081,7 +2101,7 @@ void lcl_MoveAllLowers( SwFrm* pFrm, const Point& rOffset )
// Don't forget accessibility:
if( pFrm->IsAccessibleFrm() )
{
- SwRootFrm *pRootFrm = pFrm->FindRootFrm();
+ SwRootFrm *pRootFrm = pFrm->getRootFrm();
if( pRootFrm && pRootFrm->IsAnyShellAccessible() &&
pRootFrm->GetCurrShell() )
{
@@ -2180,7 +2200,7 @@ void SwRootFrm::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* pVi
bool bPageChanged = false;
const bool bRTL = !IsLeftToRightViewLayout();
- const SwTwips nSidebarWidth = SwPageFrm::GetSidebarBorderWidth( GetShell() );
+ const SwTwips nSidebarWidth = SwPageFrm::GetSidebarBorderWidth( GetCurrShell() );
while ( pPageFrm )
{
@@ -2420,7 +2440,7 @@ void SwRootFrm::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* pVi
::AdjustSizeChgNotify( this );
Calc();
- ViewShell* pSh = GetShell();
+ ViewShell* pSh = GetCurrShell();
if ( pSh && pSh->GetDoc()->GetDocShell() )
{
diff --git a/sw/source/core/layout/pagedesc.cxx b/sw/source/core/layout/pagedesc.cxx
index 57e9c392f3..2e3d58f416 100644
--- a/sw/source/core/layout/pagedesc.cxx
+++ b/sw/source/core/layout/pagedesc.cxx
@@ -50,6 +50,7 @@
#include <frmtool.hxx>
#include <doc.hxx> // fuer GetAttrPool
#include <poolfmt.hxx>
+#include <switerator.hxx>
/*************************************************************************
|*
@@ -257,20 +258,18 @@ void SwPageDesc::RegisterChange()
nRegHeight = 0;
{
- SwClientIter aIter( GetMaster() );
- for( SwClient* pLast = aIter.First(TYPE(SwFrm)); pLast;
- pLast = aIter.Next() )
+ SwIterator<SwFrm,SwFmt> aIter( GetMaster() );
+ for( SwFrm* pLast = aIter.First(); pLast; pLast = aIter.Next() )
{
- if( ((SwFrm*)pLast)->IsPageFrm() )
+ if( pLast->IsPageFrm() )
((SwPageFrm*)pLast)->PrepareRegisterChg();
}
}
{
- SwClientIter aIter( GetLeft() );
- for( SwClient* pLast = aIter.First(TYPE(SwFrm)); pLast;
- pLast = aIter.Next() )
+ SwIterator<SwFrm,SwFmt> aIter( GetLeft() );
+ for( SwFrm* pLast = aIter.First(); pLast; pLast = aIter.Next() )
{
- if( ((SwFrm*)pLast)->IsPageFrm() )
+ if( pLast->IsPageFrm() )
((SwPageFrm*)pLast)->PrepareRegisterChg();
}
}
@@ -288,10 +287,10 @@ void SwPageDesc::RegisterChange()
*************************************************************************/
-void SwPageDesc::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
+void SwPageDesc::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
{
const sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
- SwModify::Modify( pOld, pNew );
+ NotifyClients( pOld, pNew );
if ( (RES_ATTRSET_CHG == nWhich) || (RES_FMT_CHG == nWhich)
|| isCHRATR(nWhich) || (RES_PARATR_LINESPACING == nWhich) )
@@ -318,7 +317,7 @@ static const SwFrm* lcl_GetFrmOfNode( const SwNode& rNd )
pMod = 0;
Point aNullPt;
- return pMod ? ::GetFrmOfModify( *pMod, nFrmType, &aNullPt, 0, sal_False )
+ return pMod ? ::GetFrmOfModify( 0, *pMod, nFrmType, &aNullPt, 0, sal_False )
: 0;
}
@@ -343,14 +342,12 @@ const SwFrmFmt* SwPageDesc::GetPageFmtOfNode( const SwNode& rNd,
const SwPageDesc* pPd = bCheckForThisPgDc ? this :
((SwPageFrm*)pChkFrm)->GetPageDesc();
pRet = &pPd->GetMaster();
- ASSERT( ((SwPageFrm*)pChkFrm)->GetPageDesc() == pPd,
- "Falcher Node fuers erkennen des Seitenformats" );
+ ASSERT( ((SwPageFrm*)pChkFrm)->GetPageDesc() == pPd, "Wrong node for detection of page format!" );
// an welchem Format haengt diese Seite?
- if( pRet != pChkFrm->GetRegisteredIn() )
+ if( !pChkFrm->KnowsFormat(*pRet) )
{
pRet = &pPd->GetLeft();
- ASSERT( pRet == pChkFrm->GetRegisteredIn(),
- "Falcher Node fuers erkennen des Seitenformats" );
+ ASSERT( pChkFrm->KnowsFormat(*pRet), "Wrong node for detection of page format!" );
}
}
else
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index a85982067b..a378dff426 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -29,7 +29,7 @@
#include "precompiled_sw.hxx"
#include <com/sun/star/text/HoriOrientation.hpp>
-
+#include <hintids.hxx>
#include <vcl/sound.hxx>
#include <tools/poly.hxx>
#define _SVSTDARR_LONGS
@@ -41,14 +41,12 @@
#include <editeng/prntitem.hxx>
#include <editeng/boxitem.hxx>
#include <editeng/shaditem.hxx>
-// --> collapsing borders FME 2005-05-27 #i29550#
#include <svx/framelink.hxx>
-// <--
#include <vcl/graph.hxx>
#include <svx/svdpagv.hxx>
-
#include <hintids.hxx>
#include <tgrditem.hxx>
+#include <switerator.hxx>
#include <fmtsrnd.hxx>
#include <fmtclds.hxx>
#include <tools/shl.hxx>
@@ -83,28 +81,20 @@
#include <lineinfo.hxx>
#include <dbg_lay.hxx>
#include <accessibilityoptions.hxx>
-// OD 20.12.2002 #94627#
#include <docsh.hxx>
-// OD 28.02.2003 #b4779636#, #107692#
#include <swtable.hxx>
-// OD 02.07.2003 #108784#
#include <svx/svdogrp.hxx>
-// OD 2004-05-24 #i28701#
#include <sortedobjs.hxx>
-
-// --> FME 2004-06-08 #i12836# enhanced pdf export
#include <EnhancedPDFExportHelper.hxx>
-// <--
-
#include <ndole.hxx>
#include <svtools/chartprettypainter.hxx>
-
#include <PostItMgr.hxx>
#include <tools/color.hxx>
+#include <vcl/svapp.hxx>
+
#define COL_NOTES_SIDEPANE RGB_COLORDATA(230,230,230)
#define COL_NOTES_SIDEPANE_BORDER RGB_COLORDATA(200,200,200)
#define COL_NOTES_SIDEPANE_SCROLLAREA RGB_COLORDATA(230,230,220)
-#include <vcl/svapp.hxx>
using namespace ::com::sun::star;
@@ -1214,7 +1204,9 @@ void MA_FASTCALL lcl_CalcBorderRect( SwRect &rRect, const SwFrm *pFrm,
if ( rAttrs.IsLine() || rAttrs.IsBorderDist() ||
(bShadow && rAttrs.GetShadow().GetLocation() != SVX_SHADOW_NONE) )
{
- SwRectFn fnRect = pFrm->IsVertical() ? fnRectVert : fnRectHori;
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ SwRectFn fnRect = pFrm->IsVertical() ? ( pFrm->IsVertLR() ? fnRectVertL2R : fnRectVert ) : fnRectHori;
+
const SvxBoxItem &rBox = rAttrs.GetBox();
const sal_Bool bTop = 0 != (pFrm->*fnRect->fnGetTopMargin)();
if ( bTop )
@@ -3096,14 +3088,14 @@ void SwRootFrm::HackPrepareLongTblPaint( int nMode )
case HACK_TABLEMODE_INIT : ASSERT( !pLines, "HackPrepare: already prepared" );
pLines = new SwLineRects;
ASSERT( !pGlobalShell, "old GlobalShell lost" );
- pGlobalShell = GetShell();
+ pGlobalShell = GetCurrShell();
bTableHack = sal_True;
break;
case HACK_TABLEMODE_LOCKLINES : pLines->LockLines( sal_True ); break;
case HACK_TABLEMODE_PAINTLINES : pLines->PaintLines( GetShell()->GetOut() );
break;
case HACK_TABLEMODE_UNLOCKLINES: pLines->LockLines( sal_False ); break;
- case HACK_TABLEMODE_EXIT : pLines->PaintLines( GetShell()->GetOut() );
+ case HACK_TABLEMODE_EXIT : pLines->PaintLines( GetCurrShell()->GetOut() );
DELETEZ( pLines );
pGlobalShell = 0;
bTableHack = sal_False;
@@ -3168,14 +3160,23 @@ SwShortCut::SwShortCut( const SwFrm& rFrm, const SwRect& rRect )
}
else
{
- fnCheck = &SwRect::GetRightDistance;
- nLimit = rRect.Left();
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( rFrm.IsVertLR() )
+ {
+ fnCheck = &SwRect::GetLeftDistance;
+ nLimit = rRect.Right();
+ }
+ else
+ {
+ fnCheck = &SwRect::GetRightDistance;
+ nLimit = rRect.Left();
+ }
}
}
void SwLayoutFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
{
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
// --> FME 2004-06-24 #i16816# tagged pdf support
Frm_Info aFrmInfo( *this );
@@ -3618,8 +3619,8 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
// for painting the graphic/OLE. Thus, the clip region is
// also applied for the PDF export.
// if ( !pOut->GetConnectMetaFile() || pOut->GetOutDevType() == OUTDEV_PRINTER )
- ViewShell *pSh = GetShell();
- if ( !pOut->GetConnectMetaFile() || !pSh->GetWin() )
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
+ if ( !pOut->GetConnectMetaFile() || !pSh || !pSh->GetWin() )
// <--
{
pOut->SetClipRegion( aPoly );
@@ -4279,7 +4280,7 @@ void lcl_PaintLeftRightLine( const sal_Bool _bLeft,
// OD 29.04.2003 #107169# - paint SwAligned-rectangle
{
SwRect aPaintRect( aRect );
- ::SwAlignRect( aPaintRect, _rFrm.GetShell() );
+ ::SwAlignRect( aPaintRect, _rFrm.getRootFrm()->GetCurrShell() );
// if <SwAlignRect> reveals rectangle with no width, adjust rectangle
// to the prior left postion with width of one twip.
if ( (aPaintRect.*_rRectFn->fnGetWidth)() == 0 )
@@ -4319,7 +4320,7 @@ void lcl_PaintLeftRightLine( const sal_Bool _bLeft,
// OD 29.04.2003 #107169# - paint SwAligned-rectangle
{
SwRect aPaintRect( aRect );
- ::SwAlignRect( aPaintRect, _rFrm.GetShell() );
+ ::SwAlignRect( aPaintRect, _rFrm.getRootFrm()->GetCurrShell() );
// if <SwAlignRect> reveals rectangle with no width, adjust
// rectangle to the prior left postion with width of one twip.
if ( (aPaintRect.*_rRectFn->fnGetWidth)() == 0 )
@@ -4383,7 +4384,7 @@ void lcl_PaintTopBottomLine( const sal_Bool _bTop,
// OD 29.04.2003 #107169# - paint SwAligned-rectangle
{
SwRect aPaintRect( aRect );
- ::SwAlignRect( aPaintRect, _rFrm.GetShell() );
+ ::SwAlignRect( aPaintRect, _rFrm.getRootFrm()->GetCurrShell() );
// if <SwAlignRect> reveals rectangle with no width, adjust rectangle
// to the prior top postion with width of one twip.
if ( (aPaintRect.*_rRectFn->fnGetHeight)() == 0 )
@@ -4422,7 +4423,7 @@ void lcl_PaintTopBottomLine( const sal_Bool _bTop,
// OD 29.04.2003 #107169# - paint SwAligned-rectangle
{
SwRect aPaintRect( aRect );
- ::SwAlignRect( aPaintRect, _rFrm.GetShell() );
+ ::SwAlignRect( aPaintRect, _rFrm.getRootFrm()->GetCurrShell() );
// if <SwAlignRect> reveals rectangle with no width, adjust
// rectangle to the prior top postion with width of one twip.
if ( (aPaintRect.*_rRectFn->fnGetHeight)() == 0 )
@@ -4880,8 +4881,9 @@ void SwLayoutFrm::PaintColLines( const SwRect &rRect, const SwFmtCol &rFmtCol,
const SwFrm *pCol = Lower();
if ( !pCol || !pCol->IsColumnFrm() )
return;
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ SwRectFn fnRect = pCol->IsVertical() ? ( pCol->IsVertLR() ? fnRectVertL2R : fnRectVert ) : fnRectHori;
- SwRectFn fnRect = pCol->IsVertical() ? fnRectVert : fnRectHori;
SwRect aLineRect = Prt();
aLineRect += Frm().Pos();
@@ -5240,7 +5242,7 @@ void SwPageFrm::PaintMarginArea( const SwRect& _rOutputRect,
ViewShell* _pViewShell ) const
{
if ( _pViewShell->GetWin() &&
- !_pViewShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ !_pViewShell->GetViewOptions()->getBrowseMode() )
{
SwRect aPgPrtRect( Prt() );
aPgPrtRect.Pos() += Frm().Pos();
@@ -5728,8 +5730,7 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
{
if ( bBack || bPageFrm || !bLowerMode )
{
- const sal_Bool bBrowse = pSh->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
-
+ const sal_Bool bBrowse = pSh->GetViewOptions()->getBrowseMode();
SwRect aRect;
if ( (bPageFrm && bBrowse) ||
(IsTxtFrm() && Prt().SSize() == Frm().SSize()) )
@@ -6381,7 +6382,7 @@ void SwFrm::Retouche( const SwPageFrm * pPage, const SwRect &rRect ) const
return;
ASSERT( GetUpper(), "Retoucheversuch ohne Upper." );
- ASSERT( GetShell() && pGlobalShell->GetWin(), "Retouche auf dem Drucker?" );
+ ASSERT( getRootFrm()->GetCurrShell() && pGlobalShell->GetWin(), "Retouche auf dem Drucker?" );
SwRect aRetouche( GetUpper()->PaintArea() );
aRetouche.Top( Frm().Top() + Frm().Height() );
@@ -6393,7 +6394,7 @@ void SwFrm::Retouche( const SwPageFrm * pPage, const SwRect &rRect ) const
//zum ausstanzen.
SwRegionRects aRegion( aRetouche );
aRegion -= rRect;
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
// --> FME 2004-06-24 #i16816# tagged pdf support
SwTaggedPDFHelper aTaggedPDFHelper( 0, 0, 0, *pSh->GetOut() );
@@ -6490,7 +6491,7 @@ sal_Bool SwFrm::GetBackgroundBrush( const SvxBrushItem* & rpBrush,
sal_Bool bLowerMode ) const
{
const SwFrm *pFrm = this;
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
const SwViewOption *pOpt = pSh->GetViewOptions();
rpBrush = 0;
rpCol = NULL;
@@ -6546,7 +6547,7 @@ sal_Bool SwFrm::GetBackgroundBrush( const SvxBrushItem* & rpBrush,
{
rpBrush = &rBack;
if ( pFrm->IsPageFrm() &&
- pSh->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ pSh->GetViewOptions()->getBrowseMode() )
rOrigRect = pFrm->Frm();
else
{
@@ -6608,10 +6609,10 @@ Graphic SwFlyFrmFmt::MakeGraphic( ImageMap* pMap )
{
Graphic aRet;
//irgendeinen Fly suchen!
- SwClientIter aIter( *this );
- SwClient *pFirst = aIter.First( TYPE(SwFrm) );
+ SwIterator<SwFrm,SwFmt> aIter( *this );
+ SwFrm *pFirst = aIter.First();
ViewShell *pSh;
- if ( pFirst && 0 != ( pSh = ((SwFrm*)pFirst)->GetShell()) )
+ if ( pFirst && 0 != ( pSh = pFirst->getRootFrm()->GetCurrShell()) )
{
ViewShell *pOldGlobal = pGlobalShell;
pGlobalShell = pSh;
diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx
index 618dce408c..67517424d9 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
+#include <svl/smplhint.hxx>
#include <svl/itemiter.hxx>
#include <hints.hxx>
#include <txtftn.hxx>
@@ -54,6 +54,7 @@
#include "layouter.hxx" // SwLayouter
#include "dbg_lay.hxx"
#include "viewsh.hxx"
+#include "viewopt.hxx"
#include "viewimp.hxx"
#include <editeng/ulspitem.hxx>
#include <editeng/lrspitem.hxx>
@@ -74,8 +75,8 @@ SV_IMPL_PTRARR_SORT( SwDestroyList, SwSectionFrmPtr )
|* Letzte Aenderung AMA 26. Nov. 97
|*
|*************************************************************************/
-SwSectionFrm::SwSectionFrm( SwSection &rSect ) :
- SwLayoutFrm( rSect.GetFmt() ),
+SwSectionFrm::SwSectionFrm( SwSection &rSect, SwFrm* pSib ) :
+ SwLayoutFrm( rSect.GetFmt(), pSib ),
SwFlowFrm( (SwFrm&)*this ),
pSection( &rSect )
{
@@ -86,7 +87,7 @@ SwSectionFrm::SwSectionFrm( SwSection &rSect ) :
}
SwSectionFrm::SwSectionFrm( SwSectionFrm &rSect, sal_Bool bMaster ) :
- SwLayoutFrm( rSect.GetFmt() ),
+ SwLayoutFrm( rSect.GetFmt(), rSect.getRootFrm() ),
SwFlowFrm( (SwFrm&)*this ),
pSection( rSect.GetSection() )
{
@@ -152,9 +153,9 @@ SwSectionFrm::~SwSectionFrm()
{
if( GetFmt() && !GetFmt()->GetDoc()->IsInDtor() )
{
- SwRootFrm *pRootFrm = GetFmt()->GetDoc()->GetRootFrm();
+ SwRootFrm *pRootFrm = getRootFrm();
if( pRootFrm )
- pRootFrm->RemoveFromList( this );
+ pRootFrm->RemoveFromList( this ); //swmod 071108//swmod 071225
if( IsFollow() )
{
SwSectionFrm *pMaster = FindMaster();
@@ -202,7 +203,7 @@ void SwSectionFrm::DelEmpty( sal_Bool bRemove )
// Relation CONTENT_FLOWS_FROM for current next paragraph will change
// and relation CONTENT_FLOWS_TO for current previous paragraph will change.
{
- ViewShell* pViewShell( GetShell() );
+ ViewShell* pViewShell( getRootFrm()->GetCurrShell() );
if ( pViewShell && pViewShell->GetLayout() &&
pViewShell->GetLayout()->IsAnyShellAccessible() )
{
@@ -237,11 +238,11 @@ void SwSectionFrm::DelEmpty( sal_Bool bRemove )
{ // Wenn wir bereits halbtot waren vor diesem DelEmpty, so
// stehen wir vermutlich auch in der Liste und muessen uns
// dort austragen
- if( !pSection )
- GetFmt()->GetDoc()->GetRootFrm()->RemoveFromList( this );
+ if( !pSection && getRootFrm() )
+ getRootFrm()->RemoveFromList( this );
}
- else
- GetFmt()->GetDoc()->GetRootFrm()->InsertEmptySct( this );
+ else if( getRootFrm() )
+ getRootFrm()->InsertEmptySct( this ); //swmod 071108//swmod 071225
pSection = NULL; // damit ist allerdings eine Reanimierung quasi ausgeschlossen
}
}
@@ -398,7 +399,7 @@ void SwSectionFrm::Paste( SwFrm* pParent, SwFrm* pSibling )
}
}
pParent = pSect;
- pSect = new SwSectionFrm( *((SwSectionFrm*)pParent)->GetSection() );
+ pSect = new SwSectionFrm( *((SwSectionFrm*)pParent)->GetSection(), pParent );
// Wenn pParent in zwei Teile zerlegt wird, so muss sein Follow am
// neuen, zweiten Teil angebracht werden.
pSect->SetFollow( ((SwSectionFrm*)pParent)->GetFollow() );
@@ -558,7 +559,7 @@ sal_Bool SwSectionFrm::SplitSect( SwFrm* pFrm, sal_Bool bApres )
ASSERT( pSav, "SplitSect: What's on?" );
if( pSav ) // Robust
{ // Einen neuen SctFrm anlegen, nicht als Follow/Master
- SwSectionFrm* pNew = new SwSectionFrm( *pSect->GetSection() );
+ SwSectionFrm* pNew = new SwSectionFrm( *pSect->GetSection(), pSect );
pNew->InsertBehind( pSect->GetUpper(), pSect );
pNew->Init();
SWRECTFN( this )
@@ -752,7 +753,7 @@ void SwSectionFrm::MoveCntntAndDelete( SwSectionFrm* pDel, sal_Bool bSave )
// vom gleichen Parent abgeleitet ist.
// Dann gibt es (noch) keinen Teil unseres Parents, der den Inhalt
// aufnehmen kann,also bauen wir ihn uns.
- pPrvSct = new SwSectionFrm( *pParent->GetSection() );
+ pPrvSct = new SwSectionFrm( *pParent->GetSection(), pUp );
pPrvSct->InsertBehind( pUp, pPrv );
pPrvSct->Init();
SWRECTFN( pUp )
@@ -786,7 +787,7 @@ void SwSectionFrm::MakeAll()
return;
if( !pSection ) // Durch DelEmpty
{
- ASSERT( GetFmt()->GetDoc()->GetRootFrm()->IsInDelList( this ), "SectionFrm without Section" );
+ ASSERT( getRootFrm()->IsInDelList( this ), "SectionFrm without Section" );
if( !bValidPos )
{
if( GetUpper() )
@@ -810,7 +811,8 @@ void SwSectionFrm::MakeAll()
// OD 2004-03-15 #116561# - In online layout join the follows, if section
// can grow.
- if ( GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) &&
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
+ if( pSh && pSh->GetViewOptions()->getBrowseMode() &&
( Grow( LONG_MAX, true ) > 0 ) )
{
while( GetFollow() )
@@ -1332,8 +1334,7 @@ void SwSectionFrm::Format( const SwBorderAttrs *pAttr )
{
if( !pSection ) // Durch DelEmpty
{
- ASSERT( GetFmt()->GetDoc()->GetRootFrm()->IsInDelList( this ),
- "SectionFrm without Section" );
+ ASSERT( getRootFrm()->IsInDelList( this ), "SectionFrm without Section" );
bValidSize = bValidPos = bValidPrtArea = sal_True;
return;
}
@@ -1409,7 +1410,8 @@ void SwSectionFrm::Format( const SwBorderAttrs *pAttr )
// OD 15.10.2002 #103517# - allow grow in online layout
// Thus, set <..IsBrowseMode()> as parameter <bGrow> on calling
// method <_CheckClipping(..)>.
- _CheckClipping( GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE), bMaximize );
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
+ _CheckClipping( pSh && pSh->GetViewOptions()->getBrowseMode(), bMaximize );
bMaximize = ToMaximize( sal_False );
bValidSize = sal_True;
}
@@ -2041,9 +2043,14 @@ SwTwips SwSectionFrm::_Grow( SwTwips nDist, sal_Bool bTst )
sal_Bool bInCalcCntnt = GetUpper() && IsInFly() && FindFlyFrm()->IsLocked();
// OD 2004-03-15 #116561# - allow grow in online layout
- if ( !Lower() || !Lower()->IsColumnFrm() || !Lower()->GetNext() ||
- GetSection()->GetFmt()->GetBalancedColumns().GetValue() ||
- GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ sal_Bool bGrow = !Lower() || !Lower()->IsColumnFrm() || !Lower()->GetNext() ||
+ GetSection()->GetFmt()->GetBalancedColumns().GetValue();
+ if( !bGrow )
+ {
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
+ bGrow = pSh && pSh->GetViewOptions()->getBrowseMode();
+ }
+ if( bGrow )
{
SwTwips nGrow;
if( IsInFtn() )
@@ -2435,7 +2442,7 @@ void SwSectionFrm::CalcEndAtEndFlag()
|*
|*************************************************************************/
-void SwSectionFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
+void SwSectionFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
{
sal_uInt8 nInvFlags = 0;
@@ -2470,7 +2477,16 @@ void SwSectionFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
}
}
-void SwSectionFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew,
+void SwSectionFrm::SwClientNotify( const SwModify& rMod, const SfxHint& rHint )
+{
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING && &rMod == GetRegisteredIn() )
+ {
+ SwSectionFrm::MoveCntntAndDelete( this, sal_True );
+ }
+}
+
+void SwSectionFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
sal_uInt8 &rInvFlags,
SwAttrSetChg *pOldSet, SwAttrSetChg *pNewSet )
{
@@ -2561,7 +2577,7 @@ void SwSectionFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew,
case RES_PROTECT:
{
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
if( pSh && pSh->GetLayout()->IsAnyShellAccessible() )
pSh->Imp()->InvalidateAccessibleEditableState( sal_True, this );
}
@@ -2755,7 +2771,7 @@ void SwRootFrm::_DeleteEmptySct()
if( pUp && !pUp->Lower() )
{
if( pUp->IsPageBodyFrm() )
- pUp->FindRootFrm()->SetSuperfluous();
+ pUp->getRootFrm()->SetSuperfluous();
else if( pUp->IsFtnFrm() && !pUp->IsColLocked() &&
pUp->GetUpper() )
{
diff --git a/sw/source/core/layout/softpagebreak.cxx b/sw/source/core/layout/softpagebreak.cxx
index 090fc9dfd9..3cafaf5cb7 100644
--- a/sw/source/core/layout/softpagebreak.cxx
+++ b/sw/source/core/layout/softpagebreak.cxx
@@ -35,12 +35,12 @@
#include "frmfmt.hxx"
#include "rowfrm.hxx"
#include "tabfrm.hxx"
+#include "switerator.hxx"
void SwTxtNode::fillSoftPageBreakList( SwSoftPageBreakList& rBreak ) const
{
- SwClientIter aIter( const_cast<SwTxtNode&>(*this) );
- for( const SwTxtFrm *pFrm = (const SwTxtFrm*)aIter.First( TYPE(SwTxtFrm) );
- pFrm; pFrm = (const SwTxtFrm*)aIter.Next() )
+ SwIterator<SwTxtFrm,SwTxtNode> aIter( *this );
+ for( const SwTxtFrm *pFrm = aIter.First(); pFrm; pFrm = aIter.Next() )
{
// No soft page break in header or footer
if( pFrm->FindFooterOrHeader() || pFrm->IsInFly() )
@@ -110,13 +110,12 @@ bool SwTableLine::hasSoftPageBreak() const
// No soft page break for sub tables
if( GetUpper() || !GetFrmFmt() )
return false;
- SwClientIter aIter( *GetFrmFmt() );
- for( SwClient* pLast = aIter.First( TYPE( SwFrm ) ); pLast;
- pLast = aIter.Next() )
+ SwIterator<SwRowFrm,SwFmt> aIter( *GetFrmFmt() );
+ for( SwRowFrm* pLast = aIter.First(); pLast; pLast = aIter.Next() )
{
- if( ((SwRowFrm*)pLast)->GetTabLine() == this )
+ if( pLast->GetTabLine() == this )
{
- const SwTabFrm* pTab = static_cast<SwRowFrm*>(pLast)->FindTabFrm();
+ const SwTabFrm* pTab = pLast->FindTabFrm();
// No soft page break for
// tables with prevs, i.e. if the frame is not the first in its layout frame
// tables in footer or header
diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx
index 32113ae5c3..a77ee13f27 100644
--- a/sw/source/core/layout/ssfrm.cxx
+++ b/sw/source/core/layout/ssfrm.cxx
@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
+#include <ftnfrm.hxx>
#include <pagefrm.hxx>
#include <rootfrm.hxx>
#include <cntfrm.hxx>
@@ -53,10 +53,9 @@
#include <fmtclds.hxx>
#include <viewsh.hxx>
#include <viewimp.hxx>
-
-// OD 2004-05-24 #i28701#
#include <sortedobjs.hxx>
#include <hints.hxx>
+#include <switerator.hxx>
// No inline cause we need the function pointers
long SwFrm::GetTopMargin() const
@@ -216,7 +215,7 @@ void SwFrm::SetRightLeftMargins( long nRight, long nLeft)
const sal_uInt16 nMinVertCellHeight = 1135;
-/*-----------------11.9.2001 11:11------------------
+/*-----------------------------------
* SwFrm::CheckDirChange(..)
* checks the layout direction and
* invalidates the lower frames rekursivly, if necessary.
@@ -230,7 +229,9 @@ void SwFrm::CheckDirChange()
SetInvalidVert( sal_True );
SetInvalidR2L( sal_True );
sal_Bool bChg = bOldR2L != IsRightToLeft();
- if( ( IsVertical() != bOldVert ) || bChg || IsReverse() != bOldRev )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ sal_Bool bOldVertL2R = IsVertLR();
+ if( ( IsVertical() != bOldVert ) || bChg || IsReverse() != bOldRev || bOldVertL2R != IsVertLR() )
{
InvalidateAll();
if( IsLayoutFrm() )
@@ -315,7 +316,7 @@ void SwFrm::CheckDirChange()
}
}
-/*-----------------13.9.2002 11:11------------------
+/*-----------------------------------
* SwFrm::GetFrmAnchorPos(..)
* returns the position for anchors based on frame direction
* --------------------------------------------------*/
@@ -324,9 +325,10 @@ void SwFrm::CheckDirChange()
Point SwFrm::GetFrmAnchorPos( sal_Bool bIgnoreFlysAnchoredAtThisFrame ) const
{
Point aAnchor = Frm().Pos();
- if ( IsVertical() || IsRightToLeft() )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( ( IsVertical() && !IsVertLR() ) || IsRightToLeft() )
aAnchor.X() += Frm().Width();
-
+
if ( IsTxtFrm() )
{
SwTwips nBaseOfstForFly =
@@ -360,19 +362,15 @@ Point SwFrm::GetFrmAnchorPos( sal_Bool bIgnoreFlysAnchoredAtThisFrame ) const
|*
|* SwFrm::~SwFrm()
|*
-|* Ersterstellung MA 02. Mar. 94
-|* Letzte Aenderung MA 25. Jun. 95
-|*
|*************************************************************************/
-
SwFrm::~SwFrm()
{
// accessible objects for fly and cell frames have been already disposed
// by the destructors of the derived classes.
if( IsAccessibleFrm() && !(IsFlyFrm() || IsCellFrm()) && GetDep() )
{
- SwRootFrm *pRootFrm = FindRootFrm();
+ SwRootFrm *pRootFrm = getRootFrm();
if( pRootFrm && pRootFrm->IsAnyShellAccessible() )
{
ViewShell *pVSh = pRootFrm->GetCurrShell();
@@ -430,8 +428,6 @@ SwFrmFmt * SwLayoutFrm::GetFmt()
/*************************************************************************
|*
|* SwLayoutFrm::SetFrmFmt()
-|* Ersterstellung MA 22. Apr. 93
-|* Letzte Aenderung MA 02. Nov. 94
|*
|*************************************************************************/
@@ -443,15 +439,15 @@ void SwLayoutFrm::SetFrmFmt( SwFrmFmt *pNew )
SwFmtChg aOldFmt( GetFmt() );
pNew->Add( this );
SwFmtChg aNewFmt( pNew );
- Modify( &aOldFmt, &aNewFmt );
+ ModifyNotification( &aOldFmt, &aNewFmt );
}
}
/*************************************************************************
|* SwCntntFrm::SwCntntFrm()
|*************************************************************************/
-SwCntntFrm::SwCntntFrm( SwCntntNode * const pCntnt ) :
- SwFrm( pCntnt ),
+SwCntntFrm::SwCntntFrm( SwCntntNode * const pCntnt, SwFrm* pSib ) :
+ SwFrm( pCntnt, pSib ),
SwFlowFrm( (SwFrm&)*this )
{
}
@@ -462,11 +458,11 @@ SwCntntFrm::SwCntntFrm( SwCntntNode * const pCntnt ) :
SwCntntFrm::~SwCntntFrm()
{
SwCntntNode* pCNd;
- if( 0 != ( pCNd = PTR_CAST( SwCntntNode, pRegisteredIn )) &&
+ if( 0 != ( pCNd = PTR_CAST( SwCntntNode, GetRegisteredIn() )) &&
!pCNd->GetDoc()->IsInDtor() )
{
//Bei der Root abmelden wenn ich dort noch im Turbo stehe.
- SwRootFrm *pRoot = FindRootFrm();
+ SwRootFrm *pRoot = getRootFrm();
if( pRoot && pRoot->GetTurbo() == this )
{
pRoot->DisallowTurbo();
@@ -492,20 +488,77 @@ SwCntntFrm::~SwCntntFrm()
pTxtFtn = rFtnIdxs[ nPos ];
if( pTxtFtn->GetTxtNode().GetIndex() > nIndex )
break;
- pTxtFtn->DelFrms();
+ pTxtFtn->DelFrms( this );
++nPos;
}
}
}
}
+void SwCntntFrm::RegisterToNode( SwCntntNode& rNode )
+{
+ rNode.Add( this );
+}
+
+void SwCntntFrm::DelFrms( const SwCntntNode& rNode )
+{
+ SwIterator<SwCntntFrm,SwCntntNode> aIter( rNode );
+ for( SwCntntFrm* pFrm = aIter.First(); pFrm; pFrm = aIter.Next() )
+ {
+ // --> OD 2005-12-01 #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->getRootFrm()->GetCurrShell() );
+ 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();
+ ASSERT( pFtn, "You promised a FtnFrm?" );
+ SwCntntFrm* pCFrm;
+ if( !pFtn->GetFollow() && !pFtn->GetMaster() &&
+ 0 != ( pCFrm = pFtn->GetRefFromAttr()) && pCFrm->IsFollow() )
+ {
+ ASSERT( pCFrm->IsTxtFrm(), "NoTxtFrm has Footnote?" );
+ ((SwTxtFrm*)pCFrm->FindMaster())->Prepare( PREP_FTN_GONE );
+ }
+ }
+ pFrm->Cut();
+ delete pFrm;
+ }
+}
+
/*************************************************************************
|*
|* SwLayoutFrm::~SwLayoutFrm
|*
-|* Ersterstellung AK 28-Feb-1991
-|* Letzte Aenderung MA 11. Jan. 95
-|*
|*************************************************************************/
@@ -597,9 +650,6 @@ SwLayoutFrm::~SwLayoutFrm()
|*
|* SwFrm::PaintArea()
|*
-|* Created AMA 08/22/2000
-|* Last change AMA 08/23/2000
-|*
|* The paintarea is the area, in which the content of a frame is allowed
|* to be displayed. This region could be larger than the printarea (Prt())
|* of the upper, it includes e.g. often the margin of the page.
@@ -612,7 +662,8 @@ const SwRect SwFrm::PaintArea() const
// Cell frames may not leave their upper:
SwRect aRect = IsRowFrm() ? GetUpper()->Frm() : Frm();
const sal_Bool bVert = IsVertical();
- SwRectFn fnRect = bVert ? fnRectVert : fnRectHori;
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ SwRectFn fnRect = bVert ? ( IsVertLR() ? fnRectVertL2R : fnRectVert ) : fnRectHori;
long nRight = (aRect.*fnRect->fnGetRight)();
long nLeft = (aRect.*fnRect->fnGetLeft)();
const SwFrm* pTmp = this;
@@ -700,9 +751,6 @@ const SwRect SwFrm::PaintArea() const
|*
|* SwFrm::UnionFrm()
|*
-|* Created AMA 08/22/2000
-|* Last change AMA 08/23/2000
-|*
|* The unionframe is the framearea (Frm()) of a frame expanded by the
|* printarea, if there's a negative margin at the left or right side.
|*
@@ -711,7 +759,8 @@ const SwRect SwFrm::PaintArea() const
const SwRect SwFrm::UnionFrm( sal_Bool bBorder ) const
{
sal_Bool bVert = IsVertical();
- SwRectFn fnRect = bVert ? fnRectVert : fnRectHori;
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ SwRectFn fnRect = bVert ? ( IsVertLR() ? fnRectVertL2R : fnRectVert ) : fnRectHori;
long nLeft = (Frm().*fnRect->fnGetLeft)();
long nWidth = (Frm().*fnRect->fnGetWidth)();
long nPrtLeft = (Prt().*fnRect->fnGetLeft)();
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 9fd84a1c3b..c45f4248a5 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -40,10 +40,11 @@
#include "frmtool.hxx"
#include "frmfmt.hxx"
#include "dcontact.hxx"
+#include <anchoreddrawobject.hxx>
+#include <fmtanchr.hxx>
#include "viewopt.hxx"
#include "hints.hxx"
#include "dbg_lay.hxx"
-
#include <ftnidx.hxx>
#include <svl/itemiter.hxx>
#include <docary.hxx>
@@ -51,9 +52,7 @@
#include <editeng/ulspitem.hxx>
#include <editeng/lrspitem.hxx>
#include <editeng/brshitem.hxx>
-// --> collapsing borders FME 2005-05-27 #i29550#
#include <editeng/boxitem.hxx>
-// <--
#include <vcl/outdev.hxx>
#include <fmtlsplt.hxx>
#include <fmtrowsplt.hxx>
@@ -63,7 +62,6 @@
#include <fmtfsize.hxx>
#include <swtblfmt.hxx>
#include <ndtxt.hxx>
-
#include "tabfrm.hxx"
#include "rowfrm.hxx"
#include "cellfrm.hxx"
@@ -71,15 +69,11 @@
#include "txtfrm.hxx" //HasFtn()
#include "htmltbl.hxx"
#include "sectfrm.hxx" //SwSectionFrm
-// OD 30.09.2003 #i18732#
#include <fmtfollowtextflow.hxx>
-// --> OD 2004-06-28 #i28701#
#include <sortedobjs.hxx>
#include <objectformatter.hxx>
-// <--
-// --> OD 2004-10-05 #i26945#
#include <layouter.hxx>
-// <--
+#include <switerator.hxx>
extern void AppendObjs( const SwSpzFrmFmts *pTbl, sal_uLong nIndex,
SwFrm *pFrm, SwPageFrm *pPage );
@@ -95,8 +89,8 @@ using namespace ::com::sun::star;
|* Letzte Aenderung MA 30. May. 96
|*
|*************************************************************************/
-SwTabFrm::SwTabFrm( SwTable &rTab ):
- SwLayoutFrm( rTab.GetFrmFmt() ),
+SwTabFrm::SwTabFrm( SwTable &rTab, SwFrm* pSib ):
+ SwLayoutFrm( rTab.GetFrmFmt(), pSib ),
SwFlowFrm( (SwFrm&)*this ),
pTable( &rTab )
{
@@ -115,7 +109,7 @@ SwTabFrm::SwTabFrm( SwTable &rTab ):
SwFrm *pTmpPrev = 0;
for ( sal_uInt16 i = 0; i < rLines.Count(); ++i )
{
- SwRowFrm *pNew = new SwRowFrm( *rLines[i] );
+ SwRowFrm *pNew = new SwRowFrm( *rLines[i], this );
if( pNew->Lower() )
{
pNew->InsertBehind( this, pTmpPrev );
@@ -128,7 +122,7 @@ SwTabFrm::SwTabFrm( SwTable &rTab ):
}
SwTabFrm::SwTabFrm( SwTabFrm &rTab ) :
- SwLayoutFrm( rTab.GetFmt() ),
+ SwLayoutFrm( rTab.GetFmt(), &rTab ),
SwFlowFrm( (SwFrm&)*this ),
pTable( rTab.GetTable() )
{
@@ -217,8 +211,6 @@ void SwTabFrm::RegistFlys()
|* Some prototypes
|*************************************************************************/
void MA_FASTCALL SwInvalidateAll( SwFrm *pFrm, long nBottom );
-bool MA_FASTCALL lcl_CalcLowers( SwLayoutFrm *pLay, const SwLayoutFrm* pDontLeave,
- long nBottom, bool bSkipRowSpanCells );
void MA_FASTCALL lcl_RecalcRow( SwRowFrm& rRow, long nBottom );
sal_Bool lcl_ArrangeLowers( SwLayoutFrm *pLay, long lYStart, sal_Bool bInva );
// --> OD 2004-10-15 #i26945# - add parameter <_bOnlyRowsAndCells> to control
@@ -274,7 +266,7 @@ SwRowFrm* lcl_InsertNewFollowFlowLine( SwTabFrm& rTab, const SwFrm& rTmpRow, boo
const SwRowFrm& rRow = (SwRowFrm&)rTmpRow;
rTab.SetFollowFlowLine( sal_True );
- SwRowFrm *pFollowFlowLine = new SwRowFrm(*rRow.GetTabLine(), false );
+ SwRowFrm *pFollowFlowLine = new SwRowFrm(*rRow.GetTabLine(), &rTab, false );
pFollowFlowLine->SetRowSpanLine( bRowSpanLine );
SwFrm* pFirstRow = rTab.GetFollow()->GetFirstNonHeadlineRow();
pFollowFlowLine->InsertBefore( rTab.GetFollow(), pFirstRow );
@@ -605,7 +597,7 @@ void lcl_PreprocessRowsInCells( SwTabFrm& rTab, SwRowFrm& rLastLine,
!bTableLayoutToComplex && nMinHeight < nTmpCut ) )
{
// The line has to be split:
- SwRowFrm* pNewRow = new SwRowFrm( *pTmpLastLineRow->GetTabLine(), false );
+ SwRowFrm* pNewRow = new SwRowFrm( *pTmpLastLineRow->GetTabLine(), &rTab, false );
pNewRow->SetFollowFlowRow( true );
pNewRow->SetFollowRow( pTmpLastLineRow->GetFollowRow() );
pTmpLastLineRow->SetFollowRow( pNewRow );
@@ -1277,7 +1269,7 @@ bool SwTabFrm::Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowKee
// Insert new headlines:
bDontCreateObjects = sal_True; //frmtool
SwRowFrm* pHeadline = new SwRowFrm(
- *GetTable()->GetTabLines()[ nRowCount ] );
+ *GetTable()->GetTabLines()[ nRowCount ], this );
pHeadline->SetRepeatedHeadline( true );
bDontCreateObjects = sal_False;
pHeadline->InsertBefore( pFoll, 0 );
@@ -1541,7 +1533,7 @@ void lcl_InvalidateAllLowersPrt( SwLayoutFrm* pLayFrm )
}
// <-- collapsing
-bool MA_FASTCALL lcl_CalcLowers( SwLayoutFrm* pLay, const SwLayoutFrm* pDontLeave,
+bool SwCntntFrm::CalcLowers( SwLayoutFrm* pLay, const SwLayoutFrm* pDontLeave,
long nBottom, bool bSkipRowSpanCells )
{
if ( !pLay )
@@ -1594,7 +1586,7 @@ bool MA_FASTCALL lcl_CalcLowers( SwLayoutFrm* pLay, const SwLayoutFrm* pDontLeav
ASSERT( !pCnt->IsTxtFrm() ||
pCnt->IsValid() ||
static_cast<SwTxtFrm*>(pCnt)->IsJoinLocked(),
- "<lcl_CalcLowers(..)> - text frame invalid and not locked." );
+ "<SwCntntFrm::CalcLowers(..)> - text frame invalid and not locked." );
if ( pCnt->IsTxtFrm() && pCnt->IsValid() )
{
// --> OD 2004-11-02 #i23129#, #i36347# - pass correct page frame to
@@ -1619,7 +1611,7 @@ bool MA_FASTCALL lcl_CalcLowers( SwLayoutFrm* pLay, const SwLayoutFrm* pDontLeav
}
#if OSL_DEBUG_LEVEL > 1
- ASSERT( false, "LoopControl in lcl_CalcLowers" )
+ ASSERT( false, "LoopControl in SwCntntFrm::CalcLowers" )
#endif
}
}
@@ -1726,7 +1718,7 @@ void MA_FASTCALL lcl_RecalcRow( SwRowFrm& rRow, long nBottom )
{
// --> OD 2004-11-23 #115759# - force another format of the
// lowers, if at least one of it was invalid.
- bCheck = lcl_CalcLowers( &rRow, rRow.GetUpper(), nBottom, true );
+ bCheck = SwCntntFrm::CalcLowers( &rRow, rRow.GetUpper(), nBottom, true );
// <--
// NEW TABLES
@@ -1746,7 +1738,7 @@ void MA_FASTCALL lcl_RecalcRow( SwRowFrm& rRow, long nBottom )
SwCellFrm& rToRecalc = 0 == i ?
const_cast<SwCellFrm&>(pCellFrm->FindStartEndOfRowSpanCell( true, true )) :
*pCellFrm;
- bCheck |= lcl_CalcLowers( &rToRecalc, &rToRecalc, nBottom, false );
+ bCheck |= SwCntntFrm::CalcLowers( &rToRecalc, &rToRecalc, nBottom, false );
}
pCellFrm = static_cast<SwCellFrm*>(pCellFrm->GetNext());
@@ -2211,7 +2203,8 @@ void SwTabFrm::MakeAll()
/// OD 23.10.2002 #103517# - In online layout try to grow upper of table
/// frame, if table frame doesn't fit in its upper.
- const bool bBrowseMode = GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
+ const bool bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode();
if ( nDistanceToUpperPrtBottom < 0 && bBrowseMode )
{
if ( GetUpper()->Grow( -nDistanceToUpperPrtBottom ) )
@@ -3132,11 +3125,11 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs )
else
(this->*fnRect->fnSetXMargins)( nLeftSpacing, nRightSpacing );
- ViewShell *pSh;
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
if ( bCheckBrowseWidth &&
- GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) &&
+ pSh && pSh->GetViewOptions()->getBrowseMode() &&
GetUpper()->IsPageBodyFrm() && // nur PageBodyFrms, nicht etwa ColBodyFrms
- 0 != (pSh = GetShell()) && pSh->VisArea().Width() )
+ pSh->VisArea().Width() )
{
//Nicht ueber die Kante des sichbaren Bereiches hinausragen.
//Die Seite kann breiter sein, weil es Objekte mit "ueberbreite"
@@ -3221,7 +3214,7 @@ SwTwips SwTabFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
{
(Frm().*fnRect->fnAddBottom)( nDist );
- SwRootFrm *pRootFrm = FindRootFrm();
+ SwRootFrm *pRootFrm = getRootFrm();
if( pRootFrm && pRootFrm->IsAnyShellAccessible() &&
pRootFrm->GetCurrShell() )
{
@@ -3268,7 +3261,7 @@ SwTwips SwTabFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
|* Letzte Aenderung MA 06. Dec. 96
|*
|*************************************************************************/
-void SwTabFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
+void SwTabFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
{
sal_uInt8 nInvFlags = 0;
sal_Bool bAttrSetChg = pNew && RES_ATTRSET_CHG == pNew->Which();
@@ -3333,7 +3326,7 @@ void SwTabFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
}
}
-void SwTabFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew,
+void SwTabFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
sal_uInt8 &rInvFlags,
SwAttrSetChg *pOldSet, SwAttrSetChg *pNewSet )
{
@@ -3357,7 +3350,7 @@ void SwTabFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew,
for ( sal_uInt16 nIdx = 0; nIdx < nNewRepeat; ++nIdx )
{
bDontCreateObjects = sal_True; //frmtool
- SwRowFrm* pHeadline = new SwRowFrm( *GetTable()->GetTabLines()[ nIdx ] );
+ SwRowFrm* pHeadline = new SwRowFrm( *GetTable()->GetTabLines()[ nIdx ], this );
pHeadline->SetRepeatedHeadline( true );
bDontCreateObjects = sal_False;
pHeadline->Paste( this, pLowerRow );
@@ -3629,7 +3622,8 @@ sal_Bool SwTabFrm::ShouldBwdMoved( SwLayoutFrm *pNewUpper, sal_Bool, sal_Bool &r
nSpace = nTmpSpace;
// <--
- if ( GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
+ if( pSh && pSh->GetViewOptions()->getBrowseMode() )
nSpace += pNewUpper->Grow( LONG_MAX, sal_True );
}
}
@@ -3857,8 +3851,8 @@ void SwTabFrm::Prepare( const PrepareHint eHint, const void *, sal_Bool )
|* Letzte Aenderung MA 30. May. 96
|*
|*************************************************************************/
-SwRowFrm::SwRowFrm( const SwTableLine &rLine, bool bInsertContent ):
- SwLayoutFrm( rLine.GetFrmFmt() ),
+SwRowFrm::SwRowFrm( const SwTableLine &rLine, SwFrm* pSib, bool bInsertContent ):
+ SwLayoutFrm( rLine.GetFrmFmt(), pSib ),
pTabLine( &rLine ),
pFollowRow( 0 ),
// --> collapsing borders FME 2005-05-27 #i29550#
@@ -3879,7 +3873,7 @@ SwRowFrm::SwRowFrm( const SwTableLine &rLine, bool bInsertContent ):
SwFrm *pTmpPrev = 0;
for ( sal_uInt16 i = 0; i < rBoxes.Count(); ++i )
{
- SwCellFrm *pNew = new SwCellFrm( *rBoxes[i], bInsertContent );
+ SwCellFrm *pNew = new SwCellFrm( *rBoxes[i], this, bInsertContent );
pNew->InsertBehind( this, pTmpPrev );
pTmpPrev = pNew;
}
@@ -3917,7 +3911,7 @@ void SwRowFrm::RegistFlys( SwPageFrm *pPage )
|* Letzte Aenderung MA 12. Nov. 97
|*
|*************************************************************************/
-void SwRowFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
+void SwRowFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
{
sal_Bool bAttrSetChg = pNew && RES_ATTRSET_CHG == pNew->Which();
const SfxPoolItem *pItem = 0;
@@ -4397,13 +4391,9 @@ void SwRowFrm::Format( const SwBorderAttrs *pAttrs )
// If we found a 'previous' row, we look for the appropriate row frame:
if ( pPrevTabLine )
{
- SwClientIter aIter( *pPrevTabLine->GetFrmFmt() );
- SwClient* pLast;
- for ( pLast = aIter.First( TYPE( SwFrm ) ); pLast; pLast = aIter.Next() )
+ SwIterator<SwRowFrm,SwFmt> aIter( *pPrevTabLine->GetFrmFmt() );
+ for ( SwRowFrm* pRow = aIter.First(); pRow; pRow = aIter.Next() )
{
- ASSERT( ((SwFrm*)pLast)->IsRowFrm(),
- "Non-row frame registered in table line" )
- SwRowFrm* pRow = (SwRowFrm*)pLast;
// --> OD 2004-11-23 #115759# - do *not* take repeated
// headlines, because during split of table it can be
// invalid and thus can't provide correct border values.
@@ -4515,7 +4505,7 @@ void SwRowFrm::AdjustCells( const SwTwips nHeight, const sal_Bool bHeight )
SwFrm *pFrm = Lower();
if ( bHeight )
{
- SwRootFrm *pRootFrm = FindRootFrm();
+ SwRootFrm *pRootFrm = getRootFrm();
SWRECTFN( this )
SwRect aOldFrm;
@@ -4625,7 +4615,7 @@ void SwRowFrm::Cut()
// --> OD 2010-02-17 #i103961#
// notification for accessibility
{
- SwRootFrm *pRootFrm = FindRootFrm();
+ SwRootFrm *pRootFrm = getRootFrm();
if( pRootFrm && pRootFrm->IsAnyShellAccessible() )
{
ViewShell* pVSh = pRootFrm->GetCurrShell();
@@ -4778,7 +4768,8 @@ SwTwips SwRowFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
{
SwTwips nHeight = (Frm().*fnRect->fnGetHeight)();
(Frm().*fnRect->fnSetHeight)( nHeight - nReal );
- if( IsVertical() && !bRev )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if( IsVertical() && !IsVertLR() && !bRev )
Frm().Pos().X() += nReal;
}
@@ -4792,7 +4783,8 @@ SwTwips SwRowFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
nReal -= nTmp;
SwTwips nHeight = (Frm().*fnRect->fnGetHeight)();
(Frm().*fnRect->fnSetHeight)( nHeight + nReal );
- if( IsVertical() && !bRev )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if( IsVertical() && !IsVertLR() && !bRev )
Frm().Pos().X() -= nReal;
}
nReal = nTmp;
@@ -4875,8 +4867,8 @@ bool SwRowFrm::ShouldRowKeepWithNext() const
|* Letzte Aenderung MA 30. May. 96
|*
|*************************************************************************/
-SwCellFrm::SwCellFrm( const SwTableBox &rBox, bool bInsertContent ) :
- SwLayoutFrm( rBox.GetFrmFmt() ),
+SwCellFrm::SwCellFrm( const SwTableBox &rBox, SwFrm* pSib, bool bInsertContent ) :
+ SwLayoutFrm( rBox.GetFrmFmt(), pSib ),
pTabBox( &rBox )
{
nType = FRMC_CELL;
@@ -4898,7 +4890,7 @@ SwCellFrm::SwCellFrm( const SwTableBox &rBox, bool bInsertContent ) :
SwFrm *pTmpPrev = 0;
for ( sal_uInt16 i = 0; i < rLines.Count(); ++i )
{
- SwRowFrm *pNew = new SwRowFrm( *rLines[i], bInsertContent );
+ SwRowFrm *pNew = new SwRowFrm( *rLines[i], this, bInsertContent );
pNew->InsertBehind( this, pTmpPrev );
pTmpPrev = pNew;
}
@@ -4912,7 +4904,7 @@ SwCellFrm::~SwCellFrm()
{
// At this stage the lower frames aren't destroyed already,
// therfor we have to do a recursive dispose.
- SwRootFrm *pRootFrm = FindRootFrm();
+ SwRootFrm *pRootFrm = getRootFrm();
if( pRootFrm && pRootFrm->IsAnyShellAccessible() &&
pRootFrm->GetCurrShell() )
{
@@ -5437,7 +5429,7 @@ void SwCellFrm::Format( const SwBorderAttrs *pAttrs )
|*
|*************************************************************************/
-void SwCellFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
+void SwCellFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
{
sal_Bool bAttrSetChg = pNew && RES_ATTRSET_CHG == pNew->Which();
const SfxPoolItem *pItem = 0;
@@ -5469,7 +5461,7 @@ void SwCellFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
SFX_ITEM_SET == ((SwAttrSetChg*)pNew)->GetChgSet()->GetItemState( RES_PROTECT, sal_False ) ) ||
RES_PROTECT == pNew->Which() )
{
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
if( pSh && pSh->GetLayout()->IsAnyShellAccessible() )
pSh->Imp()->InvalidateAccessibleEditableState( sal_True, this );
}
@@ -5529,7 +5521,7 @@ void SwCellFrm::Cut()
{
// notification for accessibility
{
- SwRootFrm *pRootFrm = FindRootFrm();
+ SwRootFrm *pRootFrm = getRootFrm();
if( pRootFrm && pRootFrm->IsAnyShellAccessible() )
{
ViewShell* pVSh = pRootFrm->GetCurrShell();
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index 0a7c6eafeb..60e1d6b647 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -893,7 +893,7 @@ sal_uInt16 SwRootFrm::GetCurrPage( const SwPaM *pActualCrsr ) const
{
ASSERT( pActualCrsr, "Welche Seite soll's denn sein?" );
SwFrm const*const pActFrm = pActualCrsr->GetPoint()->nNode.GetNode().
- GetCntntNode()->GetFrm( 0,
+ GetCntntNode()->getLayoutFrm( this, 0,
pActualCrsr->GetPoint(),
sal_False );
return pActFrm->FindPageFrm()->GetPhyPageNum();
@@ -1878,8 +1878,8 @@ bool SwRootFrm::MakeTblCrsrs( SwTableCursor& rTblCrsr )
const SwCntntNode* pTmpStartNode = rTblCrsr.GetCntntNode();
const SwCntntNode* pTmpEndNode = rTblCrsr.GetCntntNode(sal_False);
- const SwFrm* pTmpStartFrm = pTmpStartNode ? pTmpStartNode->GetFrm( &aPtPt, 0, sal_False ) : 0;
- const SwFrm* pTmpEndFrm = pTmpEndNode ? pTmpEndNode->GetFrm( &aMkPt, 0, sal_False ) : 0;
+ const SwFrm* pTmpStartFrm = pTmpStartNode ? pTmpStartNode->getLayoutFrm( this, &aPtPt, 0, sal_False ) : 0;
+ const SwFrm* pTmpEndFrm = pTmpEndNode ? pTmpEndNode->getLayoutFrm( this, &aMkPt, 0, sal_False ) : 0;
const SwLayoutFrm* pStart = pTmpStartFrm ? pTmpStartFrm->GetUpper() : 0;
const SwLayoutFrm* pEnd = pTmpEndFrm ? pTmpEndFrm->GetUpper() : 0;
@@ -2015,7 +2015,7 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, sal_Bool bIsTblMode )
*pEndPos = rCrsr.GetPoint() == pStartPos ?
rCrsr.GetMark() : rCrsr.GetPoint();
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = GetCurrShell();
// --> FME 2004-06-08 #i12836# enhanced pdf
SwRegionRects aRegion( pSh && !pSh->GetViewOptions()->IsPDFExport() ?
@@ -2023,10 +2023,10 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, sal_Bool bIsTblMode )
Frm() );
// <--
if( !pStartPos->nNode.GetNode().IsCntntNode() ||
- !pStartPos->nNode.GetNode().GetCntntNode()->GetFrm() ||
+ !pStartPos->nNode.GetNode().GetCntntNode()->getLayoutFrm(this) ||
( pStartPos->nNode != pEndPos->nNode &&
( !pEndPos->nNode.GetNode().IsCntntNode() ||
- !pEndPos->nNode.GetNode().GetCntntNode()->GetFrm() ) ) )
+ !pEndPos->nNode.GetNode().GetCntntNode()->getLayoutFrm(this) ) ) )
{
/* For SelectAll we will need something like this later on...
const SwFrm* pPageFrm = GetLower();
@@ -2047,10 +2047,10 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, sal_Bool bIsTblMode )
//Erstmal die CntntFrms zum Start und End besorgen, die brauch ich auf
//jedenfall.
SwCntntFrm const* pStartFrm = pStartPos->nNode.GetNode().
- GetCntntNode()->GetFrm( &rCrsr.GetSttPos(), pStartPos );
+ GetCntntNode()->getLayoutFrm( this, &rCrsr.GetSttPos(), pStartPos );
SwCntntFrm const* pEndFrm = pEndPos->nNode.GetNode().
- GetCntntNode()->GetFrm( &rCrsr.GetEndPos(), pEndPos );
+ GetCntntNode()->getLayoutFrm( this, &rCrsr.GetEndPos(), pEndPos );
ASSERT( (pStartFrm && pEndFrm), "Keine CntntFrms gefunden." );
@@ -2564,7 +2564,8 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, sal_Bool bIsTblMode )
//At least the endframe...
bVert = pEndFrm->IsVertical();
bRev = pEndFrm->IsReverse();
- fnRect = bVert ? ( bRev ? fnRectVL2R : fnRectVert ) :
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ fnRect = bVert ? ( bRev ? fnRectVL2R : ( pEndFrm->IsVertLR() ? fnRectVertL2R : fnRectVert ) ) :
( bRev ? fnRectB2T : fnRectHori );
nTmpTwips = (aEndRect.*fnRect->fnGetTop)();
if( (aEndFrm.*fnRect->fnGetTop)() != nTmpTwips )
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index b3a9be89fa..70d58c31fc 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -43,8 +43,11 @@
#include <rootfrm.hxx>
#include <cntfrm.hxx>
#include <dcontact.hxx>
+#include <anchoreddrawobject.hxx>
+#include <fmtanchr.hxx>
#include <viewsh.hxx>
#include <viewimp.hxx>
+#include "viewopt.hxx"
#include <doc.hxx>
#include <fesh.hxx>
#include <docsh.hxx>
@@ -87,11 +90,12 @@ using namespace ::com::sun::star;
|*
|*************************************************************************/
-SwFrm::SwFrm( SwModify *pMod ) :
+SwFrm::SwFrm( SwModify *pMod, SwFrm* pSib ) :
SwClient( pMod ),
// --> OD 2006-05-10 #i65250#
mnFrmId( SwFrm::mnLastFrmId++ ),
// <--
+ mpRoot( pSib ? pSib->getRootFrm() : 0 ),
pUpper( 0 ),
pNext( 0 ),
pPrev( 0 ),
@@ -108,22 +112,24 @@ SwFrm::SwFrm( SwModify *pMod ) :
ASSERT( pMod, "Kein Frameformat uebergeben." );
bInvalidR2L = bInvalidVert = 1;
- bDerivedR2L = bDerivedVert = bRightToLeft = bVertical = bReverse = 0;
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ bDerivedR2L = bDerivedVert = bRightToLeft = bVertical = bReverse = bVertLR = 0;
+
bValidPos = bValidPrtArea = bValidSize = bValidLineNum = bRetouche =
bFixSize = bColLocked = sal_False;
bCompletePaint = bInfInvalid = sal_True;
}
+bool SwFrm::KnowsFormat( const SwFmt& rFmt ) const
+{
+ return GetRegisteredIn() == &rFmt;
+}
-ViewShell * SwFrm::GetShell() const
+void SwFrm::RegisterToFormat( SwFmt& rFmt )
{
- const SwRootFrm *pRoot;
- if ( 0 != (pRoot = FindRootFrm()) )
- return pRoot->GetCurrShell();
- return 0;
+ rFmt.Add( this );
}
-
void SwFrm::CheckDir( sal_uInt16 nDir, sal_Bool bVert, sal_Bool bOnlyBiDi, sal_Bool bBrowse )
{
if( FRMDIR_ENVIRONMENT == nDir || ( bVert && bOnlyBiDi ) )
@@ -138,9 +144,19 @@ void SwFrm::CheckDir( sal_uInt16 nDir, sal_Bool bVert, sal_Bool bOnlyBiDi, sal_B
bInvalidVert = 0;
if( FRMDIR_HORI_LEFT_TOP == nDir || FRMDIR_HORI_RIGHT_TOP == nDir
|| bBrowse )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ {
bVertical = 0;
+ bVertLR = 0;
+ }
else
+ {
bVertical = 1;
+ if(FRMDIR_VERT_TOP_RIGHT == nDir)
+ bVertLR = 0;
+ else if(FRMDIR_VERT_TOP_LEFT==nDir)
+ bVertLR = 1;
+ }
}
else
{
@@ -173,9 +189,12 @@ void SwSectionFrm::CheckDirection( sal_Bool bVert )
{
const SwFrmFmt* pFmt = GetFmt();
if( pFmt )
+ {
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
+ const sal_Bool bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode();
CheckDir(((SvxFrameDirectionItem&)pFmt->GetFmtAttr(RES_FRAMEDIR)).GetValue(),
- bVert, sal_True,
- pFmt->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) );
+ bVert, sal_True, bBrowseMode );
+ }
else
SwFrm::CheckDirection( bVert );
}
@@ -184,9 +203,12 @@ void SwFlyFrm::CheckDirection( sal_Bool bVert )
{
const SwFrmFmt* pFmt = GetFmt();
if( pFmt )
+ {
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
+ const sal_Bool bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode();
CheckDir(((SvxFrameDirectionItem&)pFmt->GetFmtAttr(RES_FRAMEDIR)).GetValue(),
- bVert, sal_False,
- pFmt->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) );
+ bVert, sal_False, bBrowseMode );
+ }
else
SwFrm::CheckDirection( bVert );
}
@@ -195,9 +217,12 @@ void SwTabFrm::CheckDirection( sal_Bool bVert )
{
const SwFrmFmt* pFmt = GetFmt();
if( pFmt )
+ {
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
+ const sal_Bool bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode();
CheckDir(((SvxFrameDirectionItem&)pFmt->GetFmtAttr(RES_FRAMEDIR)).GetValue(),
- bVert, sal_True,
- pFmt->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) );
+ bVert, sal_True, bBrowseMode );
+ }
else
SwFrm::CheckDirection( bVert );
}
@@ -213,8 +238,9 @@ void SwCellFrm::CheckDirection( sal_Bool bVert )
if( pFmt && SFX_ITEM_SET == pFmt->GetItemState( RES_FRAMEDIR, sal_True, &pItem ) )
{
const SvxFrameDirectionItem* pFrmDirItem = static_cast<const SvxFrameDirectionItem*>(pItem);
- CheckDir( pFrmDirItem->GetValue(), bVert, sal_False,
- pFmt->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) );
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
+ const sal_Bool bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode();
+ CheckDir( pFrmDirItem->GetValue(), bVert, sal_False, bBrowseMode );
}
else
SwFrm::CheckDirection( bVert );
@@ -222,20 +248,14 @@ void SwCellFrm::CheckDirection( sal_Bool bVert )
void SwTxtFrm::CheckDirection( sal_Bool bVert )
{
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
+ const sal_Bool bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode();
CheckDir( GetTxtNode()->GetSwAttrSet().GetFrmDir().GetValue(), bVert,
- sal_True,
- GetTxtNode()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) );
+ sal_True, bBrowseMode );
}
-/*************************************************************************
-|*
-|* SwFrm::Modify()
-|*
-|* Ersterstellung AK 01-Mar-1991
-|* Letzte Aenderung MA 20. Jun. 96
-|*
-|*************************************************************************/
-void SwFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
+/*************************************************************************/
+void SwFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
{
sal_uInt8 nInvFlags = 0;
@@ -284,7 +304,7 @@ void SwFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
}
}
-void SwFrm::_UpdateAttrFrm( SfxPoolItem *pOld, SfxPoolItem *pNew,
+void SwFrm::_UpdateAttrFrm( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
sal_uInt8 &rInvFlags )
{
sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
@@ -983,7 +1003,7 @@ void SwCntntFrm::Cut()
//er die Retouche uebernehmen.
//Ausserdem kann eine Leerseite entstanden sein.
else
- { SwRootFrm *pRoot = FindRootFrm();
+ { SwRootFrm *pRoot = getRootFrm();
if ( pRoot )
{
pRoot->SetSuperfluous();
@@ -1134,9 +1154,12 @@ void SwLayoutFrm::Paste( SwFrm* pParent, SwFrm* pSibling)
if ( IsHeaderFrm() || IsFooterFrm() )
fnRect = fnRectHori;
else if ( IsCellFrm() || IsColumnFrm() )
- fnRect = GetUpper()->IsVertical() ? fnRectHori : fnRectVert;
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ fnRect = GetUpper()->IsVertical() ? fnRectHori : ( GetUpper()->IsVertLR() ? fnRectVertL2R : fnRectVert );
else
- fnRect = GetUpper()->IsVertical() ? fnRectVert : fnRectHori;
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ fnRect = GetUpper()->IsVertical() ? ( GetUpper()->IsVertLR() ? fnRectVertL2R : fnRectVert ) : fnRectHori;
+
if( (Frm().*fnRect->fnGetWidth)() != (pParent->Prt().*fnRect->fnGetWidth)())
_InvalidateSize();
@@ -1392,7 +1415,8 @@ SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, sal_Bool bTst )
if ( !nDiff || !GetUpper()->IsFtnBossFrm() ) // nur innerhalb von Seiten/Spalten
return 0L;
- sal_Bool bBrowse = GetUpper()->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
+ const sal_Bool bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode();
//Der (Page)Body veraendert sich nur im BrowseMode, aber nicht wenn er
//Spalten enthaelt.
@@ -1406,16 +1430,16 @@ SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, sal_Bool bTst )
long nBrowseAdd = 0;
if ( bBrowse && GetUpper()->IsPageFrm() ) // nur (Page)BodyFrms
{
- ViewShell *pSh = GetShell();
+ ViewShell *pViewShell = getRootFrm()->GetCurrShell();
SwLayoutFrm *pUp = GetUpper();
long nChg;
const long nUpPrtBottom = pUp->Frm().Height() -
pUp->Prt().Height() - pUp->Prt().Top();
SwRect aInva( pUp->Frm() );
- if ( pSh )
+ if ( pViewShell )
{
- aInva.Pos().X() = pSh->VisArea().Left();
- aInva.Width( pSh->VisArea().Width() );
+ aInva.Pos().X() = pViewShell->VisArea().Left();
+ aInva.Width( pViewShell->VisArea().Width() );
}
if ( nDiff > 0 )
{
@@ -1425,7 +1449,7 @@ SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, sal_Bool bTst )
if ( !IsBodyFrm() )
{
SetCompletePaint();
- if ( !pSh || pSh->VisArea().Height() >= pUp->Frm().Height() )
+ if ( !pViewShell || pViewShell->VisArea().Height() >= pUp->Frm().Height() )
{
//Ersteinmal den Body verkleinern. Der waechst dann schon
//wieder.
@@ -1455,12 +1479,12 @@ SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, sal_Bool bTst )
//mindestens so gross wie die VisArea.
nChg = nDiff;
long nInvaAdd = 0;
- if ( pSh && !pUp->GetPrev() &&
- pUp->Frm().Height() + nDiff < pSh->VisArea().Height() )
+ if ( pViewShell && !pUp->GetPrev() &&
+ pUp->Frm().Height() + nDiff < pViewShell->VisArea().Height() )
{
//Das heisst aber wiederum trotzdem, das wir geeignet invalidieren
//muessen.
- nChg = pSh->VisArea().Height() - pUp->Frm().Height();
+ nChg = pViewShell->VisArea().Height() - pUp->Frm().Height();
nInvaAdd = -(nDiff - nChg);
}
@@ -1483,16 +1507,16 @@ SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, sal_Bool bTst )
if ( !bTst )
{
//Unabhaengig von nChg
- if ( pSh && aInva.HasArea() && pUp->GetUpper() )
- pSh->InvalidateWindows( aInva );
+ if ( pViewShell && aInva.HasArea() && pUp->GetUpper() )
+ pViewShell->InvalidateWindows( aInva );
}
if ( !bTst && nChg )
{
const SwRect aOldRect( pUp->Frm() );
pUp->Frm().SSize().Height() += nChg;
pUp->Prt().SSize().Height() += nChg;
- if ( pSh )
- pSh->Imp()->SetFirstVisPageInvalid();
+ if ( pViewShell )
+ pViewShell->Imp()->SetFirstVisPageInvalid();
if ( GetNext() )
GetNext()->_InvalidatePos();
@@ -1500,7 +1524,7 @@ SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, sal_Bool bTst )
//Ggf. noch ein Repaint ausloesen.
const SvxGraphicPosition ePos = pUp->GetFmt()->GetBackground().GetGraphicPos();
if ( ePos != GPOS_NONE && ePos != GPOS_TILED )
- pSh->InvalidateWindows( pUp->Frm() );
+ pViewShell->InvalidateWindows( pUp->Frm() );
if ( pUp->GetUpper() )
{
@@ -1621,7 +1645,8 @@ SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, sal_Bool bTst )
if ( !bTst )
{
(pFrm->GetNext()->Frm().*fnRect->fnSetHeight)(nAddMax-nAdd);
- if( bVert && !bRev )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if( bVert && !bVertL2R && !bRev )
pFrm->GetNext()->Frm().Pos().X() += nAdd;
pFrm->GetNext()->InvalidatePrt();
if ( pFrm->GetNext()->GetNext() )
@@ -1635,7 +1660,8 @@ SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, sal_Bool bTst )
{
SwTwips nTmp = (pFrm->Frm().*fnRect->fnGetHeight)();
(pFrm->Frm().*fnRect->fnSetHeight)( nTmp - nReal );
- if( bVert && !bRev )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if( bVert && !bVertL2R && !bRev )
pFrm->Frm().Pos().X() += nReal;
pFrm->InvalidatePrt();
if ( pFrm->GetNext() )
@@ -1889,14 +1915,16 @@ SwTwips SwCntntFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
nDist > (LONG_MAX - nFrmHeight ) )
nDist = LONG_MAX - nFrmHeight;
- const sal_Bool bBrowse = GetUpper()->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
+ const sal_Bool bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode();
const sal_uInt16 nTmpType = bBrowse ? 0x2084: 0x2004; //Row+Cell, Browse mit Body
if( !(GetUpper()->GetType() & nTmpType) && GetUpper()->HasFixSize() )
{
if ( !bTst )
{
(Frm().*fnRect->fnSetHeight)( nFrmHeight + nDist );
- if( IsVertical() && !IsReverse() )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if( IsVertical() && !IsVertLR() && !IsReverse() )
Frm().Pos().X() -= nDist;
if ( GetNext() )
{
@@ -1928,7 +1956,8 @@ SwTwips SwCntntFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
//Cntnts werden immer auf den gewuenschten Wert gebracht.
long nOld = (Frm().*fnRect->fnGetHeight)();
(Frm().*fnRect->fnSetHeight)( nOld + nDist );
- if( IsVertical() && !IsReverse() )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if( IsVertical()&& !IsVertLR() && !IsReverse() )
Frm().Pos().X() -= nDist;
if ( nOld && IsInTab() )
{
@@ -2024,7 +2053,8 @@ SwTwips SwCntntFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
else
nRstHeight = nDist;
(Frm().*fnRect->fnSetHeight)( (Frm().*fnRect->fnGetHeight)() - nDist );
- if( IsVertical() )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if( IsVertical() && !IsVertLR() )
Frm().Pos().X() += nDist;
nDist = nRstHeight;
if ( IsInTab() )
@@ -2115,7 +2145,7 @@ SwTwips SwCntntFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
|* Letzte Aenderung MA 13. Oct. 95
|*
|*************************************************************************/
-void SwCntntFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
+void SwCntntFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
{
sal_uInt8 nInvFlags = 0;
@@ -2188,7 +2218,7 @@ void SwCntntFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
}
}
-void SwCntntFrm::_UpdateAttr( SfxPoolItem* pOld, SfxPoolItem* pNew,
+void SwCntntFrm::_UpdateAttr( const SfxPoolItem* pOld, const SfxPoolItem* pNew,
sal_uInt8 &rInvFlags,
SwAttrSetChg *pOldSet, SwAttrSetChg *pNewSet )
{
@@ -2347,8 +2377,8 @@ void SwCntntFrm::_UpdateAttr( SfxPoolItem* pOld, SfxPoolItem* pNew,
|* Letzte Aenderung MA 12. May. 95
|*
|*************************************************************************/
-SwLayoutFrm::SwLayoutFrm( SwFrmFmt* pFmt ):
- SwFrm( pFmt ),
+SwLayoutFrm::SwLayoutFrm( SwFrmFmt* pFmt, SwFrm* pSib ):
+ SwFrm( pFmt, pSib ),
pLower( 0 )
{
const SwFmtFrmSize &rFmtSize = pFmt->GetFrmSize();
@@ -2411,7 +2441,8 @@ SwTwips SwLayoutFrm::InnerHeight() const
|*************************************************************************/
SwTwips SwLayoutFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
{
- const sal_Bool bBrowse = GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
+ const sal_Bool bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode();
const sal_uInt16 nTmpType = bBrowse ? 0x2084: 0x2004; //Row+Cell, Browse mit Body
if( !(GetType() & nTmpType) && HasFixSize() )
return 0;
@@ -2443,7 +2474,8 @@ SwTwips SwLayoutFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
if ( !bTst )
{
(Frm().*fnRect->fnSetHeight)( nFrmHeight + nDist );
- if( bChgPos )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if( bChgPos && !IsVertLR() )
Frm().Pos().X() -= nDist;
bMoveAccFrm = sal_True;
}
@@ -2524,7 +2556,8 @@ SwTwips SwLayoutFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
( !IsCellFrm() || static_cast<SwCellFrm*>(this)->GetLayoutRowSpan() > 1 ) )
{
(Frm().*fnRect->fnSetHeight)( nFrmHeight + nReal );
- if( bChgPos )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if( bChgPos && !IsVertLR() )
Frm().Pos().X() = nFrmPos - nReal;
bMoveAccFrm = sal_True;
}
@@ -2557,7 +2590,7 @@ SwTwips SwLayoutFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
if( bMoveAccFrm && IsAccessibleFrm() )
{
- SwRootFrm *pRootFrm = FindRootFrm();
+ SwRootFrm *pRootFrm = getRootFrm();
if( pRootFrm && pRootFrm->IsAnyShellAccessible() &&
pRootFrm->GetCurrShell() )
{
@@ -2577,7 +2610,8 @@ SwTwips SwLayoutFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
|*************************************************************************/
SwTwips SwLayoutFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
{
- const sal_Bool bBrowse = GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
+ const sal_Bool bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode();
const sal_uInt16 nTmpType = bBrowse ? 0x2084: 0x2004; //Row+Cell, Browse mit Body
if( !(GetType() & nTmpType) && HasFixSize() )
return 0;
@@ -2615,7 +2649,8 @@ SwTwips SwLayoutFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
if ( !bTst )
{
(Frm().*fnRect->fnSetHeight)( nFrmHeight - nReal );
- if( bChgPos )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if( bChgPos && !IsVertLR() )
Frm().Pos().X() += nReal;
bMoveAccFrm = sal_True;
}
@@ -2636,7 +2671,8 @@ SwTwips SwLayoutFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
{
(Frm().*fnRect->fnSetHeight)( (Frm().*fnRect->fnGetHeight)()
+ nRealDist - nReal );
- if( bChgPos )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if( bChgPos && !IsVertLR() )
Frm().Pos().X() += nRealDist - nReal;
ASSERT( !IsAccessibleFrm(), "bMoveAccFrm has to be set!" );
}
@@ -2649,7 +2685,8 @@ SwTwips SwLayoutFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
{
(Frm().*fnRect->fnSetHeight)( (Frm().*fnRect->fnGetHeight)()
+ nReal - nTmp );
- if( bChgPos )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if( bChgPos && !IsVertLR() )
Frm().Pos().X() += nTmp - nReal;
ASSERT( !IsAccessibleFrm(), "bMoveAccFrm has to be set!" );
nReal = nTmp;
@@ -2675,7 +2712,7 @@ SwTwips SwLayoutFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
if( bMoveAccFrm && IsAccessibleFrm() )
{
- SwRootFrm *pRootFrm = FindRootFrm();
+ SwRootFrm *pRootFrm = getRootFrm();
if( pRootFrm && pRootFrm->IsAnyShellAccessible() &&
pRootFrm->GetCurrShell() )
{
@@ -3169,7 +3206,8 @@ void SwLayoutFrm::Format( const SwBorderAttrs *pAttrs )
const sal_uInt16 nRight = (sal_uInt16)((SwBorderAttrs*)pAttrs)->CalcRight( this );
const sal_uInt16 nLower = pAttrs->CalcBottom();
sal_Bool bVert = IsVertical() && !IsPageFrm();
- SwRectFn fnRect = bVert ? fnRectVert : fnRectHori;
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ SwRectFn fnRect = bVert ? ( IsVertLR() ? fnRectVertL2R : fnRectVert ) : fnRectHori;
if ( !bValidPrtArea )
{
bValidPrtArea = sal_True;
@@ -3330,10 +3368,9 @@ long SwLayoutFrm::CalcRel( const SwFmtFrmSize &rSz, sal_Bool ) const
{
const SwFrm *pRel = GetUpper();
long nRel = LONG_MAX;
- const ViewShell *pSh = GetShell();
- if ( pRel->IsPageBodyFrm() &&
- GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) &&
- pSh && pSh->VisArea().Width())
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
+ const sal_Bool bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode();
+ if( pRel->IsPageBodyFrm() && pSh && bBrowseMode && pSh->VisArea().Width() )
{
nRel = pSh->GetBrowseWidth();
long nDiff = nRel - pRel->Prt().Width();
@@ -3434,7 +3471,8 @@ void SwLayoutFrm::FormatWidthCols( const SwBorderAttrs &rAttrs,
sal_Bool bEnd = sal_False;
sal_Bool bBackLock = sal_False;
- SwViewImp *pImp = GetShell() ? GetShell()->Imp() : 0;
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
+ SwViewImp *pImp = pSh ? pSh->Imp() : 0;
{
// Zugrunde liegender Algorithmus
// Es wird versucht, eine optimale Hoehe fuer die Spalten zu finden.
@@ -3949,7 +3987,7 @@ void SwRootFrm::InvalidateAllCntnt( sal_uInt8 nInv )
if( nInv & INV_PRTAREA )
{
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
if( pSh )
pSh->InvalidateWindows( Frm() );
}
diff --git a/sw/source/core/objectpositioning/anchoredobjectposition.cxx b/sw/source/core/objectpositioning/anchoredobjectposition.cxx
index 171c3fd725..5f505c12e2 100644
--- a/sw/source/core/objectpositioning/anchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/anchoredobjectposition.cxx
@@ -375,7 +375,12 @@ SwTwips SwAnchoredObjectPosition::_GetVertRelPos(
break;
case text::VertOrientation::TOP:
{
- nRelPosY += bVert ? _rLRSpacing.GetRight() : _rULSpacing.GetUpper();
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ nRelPosY += bVert
+ ? ( bVertL2R
+ ? _rLRSpacing.GetLeft()
+ : _rLRSpacing.GetRight() )
+ : _rULSpacing.GetUpper();
}
break;
case text::VertOrientation::CENTER:
@@ -385,8 +390,13 @@ SwTwips SwAnchoredObjectPosition::_GetVertRelPos(
break;
case text::VertOrientation::BOTTOM:
{
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
nRelPosY += nAlignAreaHeight -
- ( nObjHeight + ( bVert ? _rLRSpacing.GetLeft() : _rULSpacing.GetLower() ) );
+ ( nObjHeight + ( bVert
+ ? ( bVertL2R
+ ? _rLRSpacing.GetRight()
+ : _rLRSpacing.GetLeft() )
+ : _rULSpacing.GetLower() ) );
}
break;
default:
@@ -405,21 +415,23 @@ SwTwips SwAnchoredObjectPosition::_GetVertRelPos(
/** adjust calculated vertical in order to keep object inside
'page' alignment layout frame.
- OD 2004-07-01 #i28701# - parameter <_nTopOfAnch> and <_bVert> added
- OD 2004-07-22 #i31805# - add parameter <_bCheckBottom>
- OD 2004-10-08 #i26945# - add parameter <_bFollowTextFlow>
+ OD 2004-07-01 #i28701# - parameter <nTopOfAnch> and <bVert> added
+ OD 2004-07-22 #i31805# - add parameter <bCheckBottom>
+ OD 2004-10-08 #i26945# - add parameter <bFollowTextFlow>
OD 2006-03-15 #i62875# - method now private and renamed.
+ OD 2009-09-01 #mongolianlayout# - add parameter <bVertL2R>
@author OD
*/
-SwTwips SwAnchoredObjectPosition::_ImplAdjustVertRelPos( const SwTwips _nTopOfAnch,
- const bool _bVert,
- const SwFrm& _rPageAlignLayFrm,
- const SwTwips _nProposedRelPosY,
- const bool _bFollowTextFlow,
- const bool _bCheckBottom ) const
+SwTwips SwAnchoredObjectPosition::_ImplAdjustVertRelPos( const SwTwips nTopOfAnch,
+ const bool bVert,
+ const bool bVertL2R,
+ const SwFrm& rPageAlignLayFrm,
+ const SwTwips nProposedRelPosY,
+ const bool bFollowTextFlow,
+ const bool bCheckBottom ) const
{
- SwTwips nAdjustedRelPosY = _nProposedRelPosY;
+ SwTwips nAdjustedRelPosY = nProposedRelPosY;
const Size aObjSize( GetAnchoredObj().GetObjRect().SSize() );
@@ -436,57 +448,67 @@ SwTwips SwAnchoredObjectPosition::_ImplAdjustVertRelPos( const SwTwips _nTopOfAn
// --> OD 2004-10-08 #i26945# - no extension of restricted area, if
// object's attribute follow text flow is set and its inside a table
if ( GetFrmFmt().getIDocumentSettingAccess()->get(IDocumentSettingAccess::CONSIDER_WRAP_ON_OBJECT_POSITION) &&
- ( !_bFollowTextFlow ||
+ ( !bFollowTextFlow ||
!GetAnchoredObj().GetAnchorFrm()->IsInTab() ) )
{
- aPgAlignArea = _rPageAlignLayFrm.FindPageFrm()->Frm();
+ aPgAlignArea = rPageAlignLayFrm.FindPageFrm()->Frm();
}
else
{
- aPgAlignArea = _rPageAlignLayFrm.Frm();
+ aPgAlignArea = rPageAlignLayFrm.Frm();
}
}
- if ( _bVert )
+ if ( bVert )
{
- // OD 2004-07-22 #i31805# - consider value of <_bCheckBottom>
- if ( _bCheckBottom &&
- _nTopOfAnch - nAdjustedRelPosY - aObjSize.Width() <
- aPgAlignArea.Left() )
+ // --> OD 2009-09-01 #mongolianlayout#
+ if ( !bVertL2R )
+ // <--
{
- nAdjustedRelPosY = aPgAlignArea.Left() +
- _nTopOfAnch -
- aObjSize.Width();
+ if ( bCheckBottom &&
+ nTopOfAnch - nAdjustedRelPosY - aObjSize.Width() <
+ aPgAlignArea.Left() )
+ {
+ nAdjustedRelPosY = aPgAlignArea.Left() +
+ nTopOfAnch -
+ aObjSize.Width();
+ }
+ if ( nTopOfAnch - nAdjustedRelPosY > aPgAlignArea.Right() )
+ {
+ nAdjustedRelPosY = nTopOfAnch - aPgAlignArea.Right();
+ }
}
- // --> OD 2004-08-13 #i32964# - correction
- if ( _nTopOfAnch - nAdjustedRelPosY > aPgAlignArea.Right() )
+ // --> OD 2009-09-01 #mongolianlayout#
+ else
{
- nAdjustedRelPosY = _nTopOfAnch - aPgAlignArea.Right();
+ if ( bCheckBottom &&
+ nTopOfAnch + nAdjustedRelPosY + aObjSize.Width() >
+ aPgAlignArea.Right() )
+ {
+ nAdjustedRelPosY = aPgAlignArea.Right() -
+ nTopOfAnch -
+ aObjSize.Width();
+ }
+ if ( nTopOfAnch + nAdjustedRelPosY < aPgAlignArea.Left() )
+ {
+ nAdjustedRelPosY = aPgAlignArea.Left() - nTopOfAnch;
+ }
}
// <--
}
else
{
- // OD 2004-07-22 #i31805# - consider value of <_bCheckBottom>
- if ( _bCheckBottom &&
- _nTopOfAnch + nAdjustedRelPosY + aObjSize.Height() >
- // --> OD 2006-01-13 #129959#
- // Do not mix usage of <top + height> and <bottom>
-// aPgAlignArea.Bottom() )
+ if ( bCheckBottom &&
+ nTopOfAnch + nAdjustedRelPosY + aObjSize.Height() >
aPgAlignArea.Top() + aPgAlignArea.Height() )
- // <--
{
- // --> OD 2006-01-13 #129959#
- // Do not mix usage of <top + height> and <bottom>
-// nAdjustedRelPosY = aPgAlignArea.Bottom() -
nAdjustedRelPosY = aPgAlignArea.Top() + aPgAlignArea.Height() -
- // <--
- _nTopOfAnch -
+ nTopOfAnch -
aObjSize.Height();
}
- if ( _nTopOfAnch + nAdjustedRelPosY < aPgAlignArea.Top() )
+ if ( nTopOfAnch + nAdjustedRelPosY < aPgAlignArea.Top() )
{
- nAdjustedRelPosY = aPgAlignArea.Top() - _nTopOfAnch;
+ nAdjustedRelPosY = aPgAlignArea.Top() - nTopOfAnch;
}
}
diff --git a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
index 6bd92f4b4e..0edcf9a8b3 100644
--- a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
@@ -36,6 +36,9 @@
// --> OD 2004-10-15 #i26945#
#include <tabfrm.hxx>
// <--
+#include "rootfrm.hxx"
+#include "viewopt.hxx"
+#include "viewsh.hxx"
#include <frmfmt.hxx>
#include <IDocumentSettingAccess.hxx>
#include <fmtsrnd.hxx>
@@ -159,10 +162,13 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
// declare and set <bBrowse> to true, if document is in browser mode and
// object is anchored at the body, but not at frame belonging to a table.
- const bool bBrowse = GetAnchorFrm().IsInDocBody() &&
- !GetAnchorFrm().IsInTab()
- ? rFrmFmt.getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE)
- : false;
+ bool bBrowse = GetAnchorFrm().IsInDocBody() && !GetAnchorFrm().IsInTab();
+ if( bBrowse )
+ {
+ const ViewShell *pSh = GetAnchorFrm().getRootFrm()->GetCurrShell();
+ if( !pSh || !pSh->GetViewOptions()->getBrowseMode() )
+ bBrowse = false;
+ }
// determine left/right and its upper/lower spacing.
const SvxLRSpaceItem &rLR = rFrmFmt.GetLRSpace();
@@ -268,9 +274,20 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
// determine relative vertical position
SwTwips nRelPosY = nAlignAreaOffset;
- SwTwips nObjHeight = (aObjBoundRect.*fnRect->fnGetHeight)();
- SwTwips nUpperSpace = bVert ? rLR.GetRight() : rUL.GetUpper();
- SwTwips nLowerSpace = bVert ? rLR.GetLeft() : rUL.GetLower();
+ const SwTwips nObjHeight = (aObjBoundRect.*fnRect->fnGetHeight)();
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ const SwTwips nUpperSpace = bVert
+ ? ( bVertL2R
+ ? rLR.GetLeft()
+ : rLR.GetRight() )
+ : rUL.GetUpper();
+ // --> OD 2009-08-31 #monglianlayout#
+ const SwTwips nLowerSpace = bVert
+ ? ( bVertL2R
+ ? rLR.GetLeft()
+ : rLR.GetRight() )
+ : rUL.GetLower();
+ // <--
switch ( aVert.GetVertOrient() )
{
case text::VertOrientation::CHAR_BOTTOM:
@@ -279,8 +296,11 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
{
// bottom (to character anchored)
nRelPosY += nAlignAreaHeight + nUpperSpace;
- if ( bVert )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( bVert && !bVertL2R )
+ {
nRelPosY += nObjHeight;
+ }
break;
}
}
@@ -402,7 +422,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
aEnvOfObj.GetVertEnvironmentLayoutFrm(
*(pOrientFrm->GetUpper()) );
const bool bCheckBottom = !DoesObjFollowsTextFlow();
- nRelPosY = _AdjustVertRelPos( nTopOfAnch, bVert,
+ nRelPosY = _AdjustVertRelPos( nTopOfAnch, bVert, bVertL2R,
rVertEnvironLayFrm, nRelPosY,
DoesObjFollowsTextFlow(),
bCheckBottom );
@@ -584,7 +604,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
// anchored object would fit into environment layout frame, if
// anchored object has to follow the text flow.
const bool bCheckBottom = !DoesObjFollowsTextFlow();
- nRelPosY = _AdjustVertRelPos( nTopOfAnch, bVert,
+ nRelPosY = _AdjustVertRelPos( nTopOfAnch, bVert, bVertL2R,
rVertEnvironLayFrm, nRelPosY,
DoesObjFollowsTextFlow(),
bCheckBottom );
@@ -625,7 +645,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
// anchored object would fit into environment layout
// frame, if anchored object has to follow the text flow.
const bool bCheckBottom = !DoesObjFollowsTextFlow();
- nTmpRelPosY = _AdjustVertRelPos( nTopOfAnch, bVert,
+ nTmpRelPosY = _AdjustVertRelPos( nTopOfAnch, bVert, bVertL2R,
rVertEnvironLayFrm,
nTmpRelPosY,
DoesObjFollowsTextFlow(),
@@ -714,7 +734,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
// align at 'page areas', but stay inside given environment
const SwFrm& rVertEnvironLayFrm =
aEnvOfObj.GetVertEnvironmentLayoutFrm( *pUpperOfOrientFrm );
- nRelPosY = _AdjustVertRelPos( nTopOfAnch, bVert,
+ nRelPosY = _AdjustVertRelPos( nTopOfAnch, bVert, bVertL2R,
rVertEnvironLayFrm,
nRelPosY,
DoesObjFollowsTextFlow() );
@@ -735,9 +755,19 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
const SwTwips nTopOfAnch = _GetTopForObjPos( *pAnchorFrmForVertPos, fnRect, bVert );
if( bVert )
{
- GetAnchoredObj().SetObjLeft( nTopOfAnch -
- ( aRelPos.X() - nRelDiff ) -
- aObjBoundRect.Width() );
+ // --> OD 2009-08-31 #monglianlayout#
+ if ( !bVertL2R )
+ {
+ GetAnchoredObj().SetObjLeft( nTopOfAnch -
+ ( aRelPos.X() - nRelDiff ) -
+ aObjBoundRect.Width() );
+ }
+ else
+ {
+ GetAnchoredObj().SetObjLeft( nTopOfAnch +
+ ( aRelPos.X() - nRelDiff ) );
+ }
+ // <--
}
else
{
@@ -828,7 +858,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
nTmpRelPosY = aRelPos.Y() + nDist;
const SwLayoutFrm& rVertEnvironLayFrm =
aEnvOfObj.GetVertEnvironmentLayoutFrm( *pUpperOfOrientFrm );
- nTmpRelPosY = _AdjustVertRelPos( nTopOfAnch, bVert,
+ nTmpRelPosY = _AdjustVertRelPos( nTopOfAnch, bVert, bVertL2R,
rVertEnvironLayFrm,
nTmpRelPosY,
DoesObjFollowsTextFlow(),
@@ -836,9 +866,18 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
if ( bVert )
{
aRelPos.X() = nTmpRelPosY;
- GetAnchoredObj().SetObjLeft( nTopOfAnch -
- aRelPos.X() -
- aObjBoundRect.Width() );
+ // --> OD 2009-08-31 #mongolianlayout#
+ if ( !bVertL2R )
+ {
+ GetAnchoredObj().SetObjLeft( nTopOfAnch -
+ aRelPos.X() -
+ aObjBoundRect.Width() );
+ }
+ else
+ {
+ GetAnchoredObj().SetObjLeft( nTopOfAnch + aRelPos.X() );
+ }
+ // <--
}
else
{
@@ -918,9 +957,21 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
SWREFRESHFN( pUpperOfOrientFrm )
bMoveable = rAnchorTxtFrm.IsMoveable( (SwLayoutFrm*)pUpperOfOrientFrm );
if( bVertX )
- GetAnchoredObj().SetObjLeft( nTopOfAnch -
- aRelPos.X() -
- aObjBoundRect.Width() );
+ {
+ // --> OD 2009-08-31 #mongolianlayout#
+ if ( !bVertL2R )
+ {
+ GetAnchoredObj().SetObjLeft( nTopOfAnch -
+ aRelPos.X() -
+ aObjBoundRect.Width() );
+ }
+ else
+ {
+ GetAnchoredObj().SetObjLeft( nTopOfAnch +
+ aRelPos.X() );
+ }
+ // <--
+ }
else
GetAnchoredObj().SetObjTop( nTopOfAnch +
aRelPos.Y() );
@@ -972,8 +1023,19 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
// frame, the horizontal position is oriented at.
const SwTwips nTopOfAnch = _GetTopForObjPos( *pAnchorFrmForVertPos, fnRect, bVert );
if( bVert )
- GetAnchoredObj().SetObjLeft( nTopOfAnch -
- aRelPos.X() - aObjBoundRect.Width() );
+ {
+ // --> OD 2009-08-31 #mongolianlayout#
+ if ( !bVertL2R )
+ {
+ GetAnchoredObj().SetObjLeft( nTopOfAnch -
+ aRelPos.X() - aObjBoundRect.Width() );
+ }
+ else
+ {
+ GetAnchoredObj().SetObjLeft( nTopOfAnch + aRelPos.X() );
+ }
+ // <--
+ }
else
GetAnchoredObj().SetObjTop( nTopOfAnch + aRelPos.Y() );
@@ -1023,8 +1085,17 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
const SwTwips nTopOfAnch = _GetTopForObjPos( *pAnchorFrmForVertPos, fnRect, bVert );
if( bVert )
{
- GetAnchoredObj().SetObjLeft( nTopOfAnch -
- aRelPos.X() - aObjBoundRect.Width() );
+ // --> OD 2009-08-31 #mongolianlayout#
+ if ( !bVertL2R )
+ {
+ GetAnchoredObj().SetObjLeft( nTopOfAnch -
+ aRelPos.X() - aObjBoundRect.Width() );
+ }
+ else
+ {
+ GetAnchoredObj().SetObjLeft( nTopOfAnch + aRelPos.X() );
+ }
+ // <--
GetAnchoredObj().SetObjTop( rAnchorTxtFrm.Frm().Top() +
aRelPos.Y() );
}
diff --git a/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx b/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx
index 4dfadf0222..93085b55ab 100644
--- a/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx
@@ -31,15 +31,16 @@
#include <anchoredobject.hxx>
#include <frame.hxx>
#include <pagefrm.hxx>
-#ifndef _SVX_SVDOBJ_HXX
#include <svx/svdobj.hxx>
-#endif
#include <frmfmt.hxx>
#include <fmtanchr.hxx>
#include <fmtornt.hxx>
#include <fmtsrnd.hxx>
#include <IDocumentSettingAccess.hxx>
#include <frmatr.hxx>
+#include "viewsh.hxx"
+#include "viewopt.hxx"
+#include "rootfrm.hxx"
#include <editeng/lrspitem.hxx>
#include <editeng/ulspitem.hxx>
@@ -120,7 +121,11 @@ void SwToLayoutAnchoredObjectPosition::CalcPosition()
if( bVert )
{
ASSERT( !bRev, "<SwToLayoutAnchoredObjectPosition::CalcPosition()> - reverse layout set." );
- aRelPos.X() = -nRelPosY - aObjBoundRect.Width();
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( bVertL2R )
+ aRelPos.X() = nRelPosY;
+ else
+ aRelPos.X() = -nRelPosY - aObjBoundRect.Width();
maOffsetToFrmAnchorPos.X() = nVertOffsetToFrmAnchorPos;
}
else
@@ -131,8 +136,9 @@ void SwToLayoutAnchoredObjectPosition::CalcPosition()
// if in online-layout the bottom of to-page anchored object is beyond
// the page bottom, the page frame has to grow by growing its body frame.
+ const ViewShell *pSh = GetAnchorFrm().getRootFrm()->GetCurrShell();
if ( !bFlyAtFly && GetAnchorFrm().IsPageFrm() &&
- rFrmFmt.getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ pSh && pSh->GetViewOptions()->getBrowseMode() )
{
const long nAnchorBottom = GetAnchorFrm().Frm().Bottom();
const long nBottom = GetAnchorFrm().Frm().Top() +
@@ -204,8 +210,12 @@ void SwToLayoutAnchoredObjectPosition::CalcPosition()
// determine absolute 'horizontal' position, depending on layout-direction
// --> OD 2004-06-17 #i26791# - determine offset to 'horizontal' frame
// anchor position, depending on layout-direction
- if ( bVert )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ // --> OD 2009-09-04 #mongolianlayout#
+ if( bVert || bVertL2R )
+ // <--
{
+
aRelPos.Y() = nRelPosX;
maOffsetToFrmAnchorPos.Y() = nOffset;
}
diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx
index fa0e7129e8..f1d790d634 100644
--- a/sw/source/core/ole/ndole.cxx
+++ b/sw/source/core/ole/ndole.cxx
@@ -793,7 +793,7 @@ const uno::Reference < embed::XEmbeddedObject > SwOLEObj::GetOleRef()
{
//Das Teil konnte nicht geladen werden (wahrsch. Kaputt).
Rectangle aArea;
- SwFrm *pFrm = pOLENd->GetFrm();
+ SwFrm *pFrm = pOLENd->getLayoutFrm(0);
if ( pFrm )
{
Size aSz( pFrm->Frm().SSize() );
diff --git a/sw/source/core/para/paratr.cxx b/sw/source/core/para/paratr.cxx
index c87fabe7bc..28f6365a2c 100644
--- a/sw/source/core/para/paratr.cxx
+++ b/sw/source/core/para/paratr.cxx
@@ -83,7 +83,7 @@ SwFmtDrop::SwFmtDrop()
SwFmtDrop::SwFmtDrop( const SwFmtDrop &rCpy )
: SfxPoolItem( RES_PARATR_DROP ),
- SwClient( rCpy.pRegisteredIn ),
+ SwClient( rCpy.GetRegisteredInNonConst() ),
pDefinedIn( 0 ),
nDistance( rCpy.GetDistance() ),
nReadFmt( rCpy.nReadFmt ),
@@ -104,8 +104,8 @@ SwFmtDrop::~SwFmtDrop()
void SwFmtDrop::SetCharFmt( SwCharFmt *pNew )
{
//Ummelden
- if ( pRegisteredIn )
- pRegisteredIn->Remove( this );
+ if ( GetRegisteredIn() )
+ GetRegisteredInNonConst()->Remove( this );
if(pNew)
pNew->Add( this );
nReadFmt = USHRT_MAX;
@@ -113,26 +113,19 @@ void SwFmtDrop::SetCharFmt( SwCharFmt *pNew )
-void SwFmtDrop::Modify( SfxPoolItem *, SfxPoolItem * )
+void SwFmtDrop::Modify( const SfxPoolItem*, const SfxPoolItem * )
{
if( pDefinedIn )
{
if( !pDefinedIn->ISA( SwFmt ))
- pDefinedIn->Modify( this, this );
+ pDefinedIn->ModifyNotification( this, this );
else if( pDefinedIn->GetDepends() &&
!pDefinedIn->IsModifyLocked() )
{
// selbst den Abhaengigen vom Format bescheid sagen. Das
// Format selbst wuerde es nicht weitergeben, weil es ueber
// die Abpruefung nicht hinauskommt.
- SwClientIter aIter( *pDefinedIn );
- SwClient * pLast = aIter.GoStart();
- if( pLast ) // konnte zum Anfang gesprungen werden ??
- do {
- pLast->Modify( this, this );
- if( !pDefinedIn->GetDepends() ) // Baum schon Weg ??
- break;
- } while( 0 != ( pLast = aIter++ ));
+ pDefinedIn->ModifyBroadcast( this, this );
}
}
}
diff --git a/sw/source/core/table/swnewtable.cxx b/sw/source/core/table/swnewtable.cxx
index 7b13389abe..f240d8aec0 100644
--- a/sw/source/core/table/swnewtable.cxx
+++ b/sw/source/core/table/swnewtable.cxx
@@ -47,6 +47,7 @@
#include <editeng/boxitem.hxx>
#include <editeng/protitem.hxx>
#include <swtblfmt.hxx>
+#include <switerator.hxx>
#ifndef DBG_UTIL
#define CHECK_TABLE(t)
@@ -592,11 +593,9 @@ SwBoxSelection* SwTable::CollectBoxSelection( const SwPaM& rPam ) const
void lcl_InvalidateCellFrm( const SwTableBox& rBox )
{
- SwClientIter aIter( *rBox.GetFrmFmt() );
- SwClient* pLast;
- for( pLast = aIter.First( TYPE( SwFrm ) ); pLast; pLast = aIter.Next() )
+ SwIterator<SwCellFrm,SwFmt> aIter( *rBox.GetFrmFmt() );
+ for( SwCellFrm* pCell = aIter.First(); pCell; pCell = aIter.Next() )
{
- SwCellFrm *pCell = (SwCellFrm*)pLast;
if( pCell->GetTabBox() == &rBox )
{
pCell->InvalidateSize();
@@ -1412,7 +1411,7 @@ sal_Bool SwTable::NewSplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16
_FndBox aFndBox( 0, 0 );
aFndBox.SetTableLines( rBoxes, *this );
- if( bSameHeight && pDoc->GetRootFrm() )
+ if( bSameHeight && pDoc->GetCurrentViewShell() ) //swmod 071108//swmod 071225
{
SwSplitLines aRowLines;
SwSplitLines aSplitLines;
diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index 9763669883..65b77bab43 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -28,10 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-#ifdef WTC
-#define private public
-#endif
-
#include <ctype.h>
#include <float.h>
#include <hintids.hxx>
@@ -42,8 +38,6 @@
#include <editeng/colritem.hxx>
#include <sfx2/linkmgr.hxx>
#include <editeng/boxitem.hxx>
-
-
#include <fmtfsize.hxx>
#include <fmtornt.hxx>
#include <fmtpdsc.hxx>
@@ -72,6 +66,7 @@
#include <viewsh.hxx>
#include <redline.hxx>
#include <list>
+#include <switerator.hxx>
#ifndef DBG_UTIL
#define CHECK_TABLE(t)
@@ -267,9 +262,6 @@ void _InsTblBox( SwDoc* pDoc, SwTableNode* pTblNd,
|*
|* SwTable::SwTable()
|*
-|* Ersterstellung MA 09. Mar. 93
-|* Letzte Aenderung MA 05. May. 93
-|*
|*************************************************************************/
SwTable::SwTable( SwTableFmt* pFmt )
: SwClient( pFmt ),
@@ -331,14 +323,10 @@ SwTable::~SwTable()
delete pHTMLLayout;
}
-
/*************************************************************************
|*
|* SwTable::Modify()
|*
-|* Ersterstellung JP ??
-|* Letzte Aenderung MA 06. May. 93
-|*
|*************************************************************************/
inline void FmtInArr( SvPtrarr& rFmtArr, SwFmt* pBoxFmt )
{
@@ -415,7 +403,7 @@ void lcl_ModifyBoxes( SwTableBoxes &rBoxes, const long nOld,
}
}
-void SwTable::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
+void SwTable::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
{
// fange SSize Aenderungen ab, um die Lines/Boxen anzupassen
sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0 ;
@@ -432,6 +420,8 @@ void SwTable::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
pOldSize = (const SwFmtFrmSize*)pOld;
pNewSize = (const SwFmtFrmSize*)pNew;
}
+ else
+ CheckRegistration( pOld, pNew );
if( pOldSize || pNewSize )
{
@@ -443,8 +433,6 @@ void SwTable::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
AdjustWidths( pOldSize->GetWidth(), pNewSize->GetWidth() );
}
}
- else
- SwClient::Modify( pOld, pNew ); // fuers ObjectDying
}
void SwTable::AdjustWidths( const long nOld, const long nNew )
@@ -457,9 +445,6 @@ void SwTable::AdjustWidths( const long nOld, const long nNew )
|*
|* SwTable::GetTabCols()
|*
-|* Ersterstellung MA 04. May. 93
-|* Letzte Aenderung MA 30. Nov. 95
-|*
|*************************************************************************/
void lcl_RefreshHidden( SwTabCols &rToFill, sal_uInt16 nPos )
{
@@ -711,9 +696,6 @@ void SwTable::GetTabCols( SwTabCols &rToFill, const SwTableBox *pStart,
|*
|* SwTable::SetTabCols()
|*
-|* Ersterstellung MA 04. May. 93
-|* Letzte Aenderung MA 26. Aug. 98
-|*
|*************************************************************************/
//Struktur zur Parameteruebergabe
struct Parm
@@ -1407,9 +1389,6 @@ void SwTable::NewSetTabCols( Parm &rParm, const SwTabCols &rNew,
|* const SwTableBox* SwTable::GetTblBox( const Strn?ng& rName ) const
|* gebe den Pointer auf die benannte Box zurueck.
|*
-|* Ersterstellung JP 30. Jun. 93
-|* Letzte Aenderung JP 30. Jun. 93
-|*
|*************************************************************************/
sal_Bool IsValidRowName( const String& rStr )
@@ -1560,8 +1539,7 @@ SwTableBox* SwTable::GetTblBox( sal_uLong nSttIdx )
pModify = pTblNd->GetTable().GetFrmFmt();
// <--
- SwClientIter aIter( *pModify );
- SwFrm *pFrm = (SwFrm*)aIter.First( TYPE(SwFrm) );
+ SwFrm* pFrm = SwIterator<SwFrm,SwModify>::FirstElement( *pModify );
while ( pFrm && !pFrm->IsCellFrm() )
pFrm = pFrm->GetUpper();
if ( pFrm )
@@ -1595,9 +1573,6 @@ sal_Bool SwTable::IsTblComplex() const
|*
|* SwTableLine::SwTableLine()
|*
-|* Ersterstellung MA 09. Mar. 93
-|* Letzte Aenderung MA 09. Mar. 93
-|*
|*************************************************************************/
SwTableLine::SwTableLine( SwTableLineFmt *pFmt, sal_uInt16 nBoxes,
SwTableBox *pUp )
@@ -1621,55 +1596,51 @@ SwTableLine::~SwTableLine()
|*
|* SwTableLine::ClaimFrmFmt(), ChgFrmFmt()
|*
-|* Ersterstellung MA 03. May. 93
-|* Letzte Aenderung MA 07. Feb. 96
-|*
|*************************************************************************/
SwFrmFmt* SwTableLine::ClaimFrmFmt()
{
- //Wenn noch andere TableLines ausser mir selbst an dem FrmFmt haengen,
- //sehe ich mich leider gezwungen mir ein eingenes zu machen und mich
- //bei diesem anzumelden.
- SwTableLineFmt *pOld = (SwTableLineFmt*)GetFrmFmt();
- SwClientIter aIter( *pOld );
-
- SwClient* pLast;
-
- for( pLast = aIter.First( TYPE( SwTableLine )); pLast && pLast == this;
- pLast = aIter.Next() )
- ;
-
- if( pLast )
- {
- SwTableLineFmt *pNewFmt = pOld->GetDoc()->MakeTableLineFmt();
- *pNewFmt = *pOld;
-
- //Erstmal die Frms ummelden.
- for( pLast = aIter.First( TYPE( SwFrm ) ); pLast; pLast = aIter.Next() )
- if( ((SwRowFrm*)pLast)->GetTabLine() == this )
- pNewFmt->Add( pLast );
-
- //Jetzt noch mich selbst ummelden.
- pNewFmt->Add( this );
- pOld = pNewFmt;
+ // This method makes sure that this object is an exclusive SwTableLine client
+ // of an SwTableLineFmt object
+ // If other SwTableLine objects currently listen to the same SwTableLineFmt as
+ // this one, something needs to be done
+ SwTableLineFmt *pRet = (SwTableLineFmt*)GetFrmFmt();
+ SwIterator<SwTableLine,SwFmt> aIter( *pRet );
+ for( SwTableLine* pLast = aIter.First(); pLast; pLast = aIter.Next() )
+ {
+ if ( pLast != this )
+ {
+ // found another SwTableLine that is a client of the current Fmt
+ // create a new Fmt as a copy and use it for this object
+ SwTableLineFmt *pNewFmt = pRet->GetDoc()->MakeTableLineFmt();
+ *pNewFmt = *pRet;
+
+ // register SwRowFrms that know me as clients at the new Fmt
+ SwIterator<SwRowFrm,SwFmt> aFrmIter( *pRet );
+ for( SwRowFrm* pFrm = aFrmIter.First(); pFrm; pFrm = aFrmIter.Next() )
+ if( pFrm->GetTabLine() == this )
+ pFrm->RegisterToFormat( *pNewFmt );
+
+ // register myself
+ pNewFmt->Add( this );
+ pRet = pNewFmt;
+ break;
+ }
}
- return pOld;
+ return pRet;
}
void SwTableLine::ChgFrmFmt( SwTableLineFmt *pNewFmt )
{
SwFrmFmt *pOld = GetFrmFmt();
- SwClientIter aIter( *pOld );
- SwClient* pLast;
+ SwIterator<SwRowFrm,SwFmt> aIter( *pOld );
//Erstmal die Frms ummelden.
- for( pLast = aIter.First( TYPE( SwFrm ) ); pLast; pLast = aIter.Next() )
+ for( SwRowFrm* pRow = aIter.First(); pRow; pRow = aIter.Next() )
{
- SwRowFrm *pRow = (SwRowFrm*)pLast;
if( pRow->GetTabLine() == this )
{
- pNewFmt->Add( pLast );
+ pRow->RegisterToFormat( *pNewFmt );
pRow->InvalidateSize();
pRow->_InvalidatePrt();
@@ -1700,7 +1671,7 @@ void SwTableLine::ChgFrmFmt( SwTableLineFmt *pNewFmt )
//Jetzt noch mich selbst ummelden.
pNewFmt->Add( this );
- if ( !aIter.GoStart() )
+ if ( !pOld->GetDepends() )
delete pOld;
}
@@ -1708,16 +1679,15 @@ SwTwips SwTableLine::GetTableLineHeight( bool& bLayoutAvailable ) const
{
SwTwips nRet = 0;
bLayoutAvailable = false;
- SwClientIter aIter( *GetFrmFmt() );
+ SwIterator<SwRowFrm,SwFmt> aIter( *GetFrmFmt() );
// A row could appear several times in headers/footers so only one chain of master/follow tables
// will be accepted...
const SwTabFrm* pChain = NULL; // My chain
- for( SwClient* pLast = aIter.First( TYPE( SwFrm ) ); pLast;
- pLast = aIter.Next() )
+ for( SwRowFrm* pLast = aIter.First(); pLast; pLast = aIter.Next() )
{
- if( ((SwRowFrm*)pLast)->GetTabLine() == this )
+ if( pLast->GetTabLine() == this )
{
- const SwTabFrm* pTab = static_cast<SwRowFrm*>(pLast)->FindTabFrm();
+ const SwTabFrm* pTab = pLast->FindTabFrm();
bLayoutAvailable = ( pTab && pTab->IsVertical() ) ?
( 0 < pTab->Frm().Height() ) :
( 0 < pTab->Frm().Width() );
@@ -1728,15 +1698,15 @@ SwTwips SwTableLine::GetTableLineHeight( bool& bLayoutAvailable ) const
{
pChain = pTab; // defines my chain (even it is already)
if( pTab->IsVertical() )
- nRet += static_cast<SwRowFrm*>(pLast)->Frm().Width();
+ nRet += pLast->Frm().Width();
else
- nRet += static_cast<SwRowFrm*>(pLast)->Frm().Height();
+ nRet += pLast->Frm().Height();
// Optimization, if there are no master/follows in my chain, nothing more to add
if( !pTab->HasFollow() && !pTab->IsFollow() )
break;
// This is not an optimization, this is necessary to avoid double additions of
// repeating rows
- if( pTab->IsInHeadline( *static_cast<SwRowFrm*>(pLast) ) )
+ if( pTab->IsInHeadline(*pLast) )
break;
}
}
@@ -1748,9 +1718,6 @@ SwTwips SwTableLine::GetTableLineHeight( bool& bLayoutAvailable ) const
|*
|* SwTableBox::SwTableBox()
|*
-|* Ersterstellung MA 04. May. 93
-|* Letzte Aenderung MA 04. May. 93
-|*
|*************************************************************************/
SwTableBox::SwTableBox( SwTableBoxFmt* pFmt, sal_uInt16 nLines, SwTableLine *pUp )
: SwClient( 0 ),
@@ -1831,7 +1798,7 @@ SwTableBoxFmt* SwTableBox::CheckBoxFmt( SwTableBoxFmt* pFmt )
if( SFX_ITEM_SET == pFmt->GetItemState( RES_BOXATR_VALUE, sal_False ) ||
SFX_ITEM_SET == pFmt->GetItemState( RES_BOXATR_FORMULA, sal_False ) )
{
- SwClient* pOther = SwClientIter( *pFmt ).First( TYPE( SwTableBox ));
+ SwTableBox* pOther = SwIterator<SwTableBox,SwFmt>::FirstElement( *pFmt );
if( pOther )
{
SwTableBoxFmt* pNewFmt = pFmt->GetDoc()->MakeTableBoxFmt();
@@ -1852,59 +1819,54 @@ SwTableBoxFmt* SwTableBox::CheckBoxFmt( SwTableBoxFmt* pFmt )
|*
|* SwTableBox::ClaimFrmFmt(), ChgFrmFmt()
|*
-|* Ersterstellung MA 04. May. 93
-|* Letzte Aenderung MA 07. Feb. 96
-|*
|*************************************************************************/
SwFrmFmt* SwTableBox::ClaimFrmFmt()
{
- //Wenn noch andere TableBoxen ausser mir selbst an dem FrmFmt haengen,
- //sehe ich mich leider gezwungen mir ein eingenes zu machen und mich
- //bei diesem anzumelden.
- SwTableBoxFmt *pOld = (SwTableBoxFmt*)GetFrmFmt();
- SwClientIter aIter( *pOld );
- SwClient* pLast;
-
- for( pLast = aIter.First( TYPE( SwTableBox )); pLast && pLast == this;
- pLast = aIter.Next() )
- ;
-
- if( pLast )
+ // This method makes sure that this object is an exclusive SwTableBox client
+ // of an SwTableBoxFmt object
+ // If other SwTableBox objects currently listen to the same SwTableBoxFmt as
+ // this one, something needs to be done
+ SwTableBoxFmt *pRet = (SwTableBoxFmt*)GetFrmFmt();
+ SwIterator<SwTableBox,SwFmt> aIter( *pRet );
+ for( SwTableBox* pLast = aIter.First(); pLast; pLast = aIter.Next() )
{
- SwTableBoxFmt* pNewFmt = pOld->GetDoc()->MakeTableBoxFmt();
-
- pNewFmt->LockModify();
- *pNewFmt = *pOld;
-
- // Values und Formeln nie kopieren
- pNewFmt->ResetFmtAttr( RES_BOXATR_FORMULA, RES_BOXATR_VALUE );
- pNewFmt->UnlockModify();
+ if ( pLast != this )
+ {
+ // Found another SwTableBox object
+ // create a new Fmt as a copy and assign me to it
+ // don't copy values and formulas
+ SwTableBoxFmt* pNewFmt = pRet->GetDoc()->MakeTableBoxFmt();
+ pNewFmt->LockModify();
+ *pNewFmt = *pRet;
+ pNewFmt->ResetFmtAttr( RES_BOXATR_FORMULA, RES_BOXATR_VALUE );
+ pNewFmt->UnlockModify();
- //Erstmal die Frms ummelden.
- for( pLast = aIter.First( TYPE( SwFrm ) ); pLast; pLast = aIter.Next() )
- if( ((SwCellFrm*)pLast)->GetTabBox() == this )
- pNewFmt->Add( pLast );
+ // re-register SwCellFrm objects that know me
+ SwIterator<SwCellFrm,SwFmt> aFrmIter( *pRet );
+ for( SwCellFrm* pCell = aFrmIter.First(); pCell; pCell = aFrmIter.Next() )
+ if( pCell->GetTabBox() == this )
+ pCell->RegisterToFormat( *pNewFmt );
- //Jetzt noch mich selbst ummelden.
- pNewFmt->Add( this );
- pOld = pNewFmt;
+ // re-register myself
+ pNewFmt->Add( this );
+ pRet = pNewFmt;
+ break;
+ }
}
- return pOld;
+ return pRet;
}
void SwTableBox::ChgFrmFmt( SwTableBoxFmt* pNewFmt )
{
SwFrmFmt *pOld = GetFrmFmt();
- SwClientIter aIter( *pOld );
- SwClient* pLast;
+ SwIterator<SwCellFrm,SwFmt> aIter( *pOld );
//Erstmal die Frms ummelden.
- for( pLast = aIter.First( TYPE( SwFrm ) ); pLast; pLast = aIter.Next() )
+ for( SwCellFrm* pCell = aIter.First(); pCell; pCell = aIter.Next() )
{
- SwCellFrm *pCell = (SwCellFrm*)pLast;
if( pCell->GetTabBox() == this )
{
- pNewFmt->Add( pLast );
+ pCell->RegisterToFormat( *pNewFmt );
pCell->InvalidateSize();
pCell->_InvalidatePrt();
pCell->SetCompletePaint();
@@ -1929,7 +1891,7 @@ void SwTableBox::ChgFrmFmt( SwTableBoxFmt* pNewFmt )
//Jetzt noch mich selbst ummelden.
pNewFmt->Add( this );
- if( !aIter.GoStart() )
+ if( !pOld->GetDepends() )
delete pOld;
}
@@ -1939,9 +1901,6 @@ void SwTableBox::ChgFrmFmt( SwTableBoxFmt* pNewFmt )
|* gebe den Namen dieser Box zurueck. Dieser wird dynamisch bestimmt
|* und ergibt sich aus der Position in den Lines/Boxen/Tabelle
|*
-|* Ersterstellung JP 30. Jun. 93
-|* Letzte Aenderung JP 30. Jun. 93
-|*
|*************************************************************************/
void lcl_GetTblBoxColStr( sal_uInt16 nCol, String& rNm )
{
@@ -2052,8 +2011,7 @@ sal_Bool SwTable::GetInfo( SfxPoolItem& rInfo ) const
case RES_CONTENT_VISIBLE:
{
- ((SwPtrMsgPoolItem&)rInfo).pObject =
- SwClientIter( *GetFrmFmt() ).First( TYPE(SwFrm) );
+ ((SwPtrMsgPoolItem&)rInfo).pObject = SwIterator<SwFrm,SwFmt>::FirstElement( *GetFrmFmt() );
}
return sal_False;
}
@@ -2063,7 +2021,7 @@ sal_Bool SwTable::GetInfo( SfxPoolItem& rInfo ) const
SwTable * SwTable::FindTable( SwFrmFmt const*const pFmt )
{
return (pFmt)
- ? static_cast<SwTable*>(SwClientIter(*pFmt).First( TYPE(SwTable) ))
+ ? SwIterator<SwTable,SwFmt>::FirstElement(*pFmt)
: 0;
}
@@ -2302,7 +2260,7 @@ void ChgNumToText( SwTableBox& rBox, sal_uLong nFmt )
}
// zum Erkennen von Veraenderungen (haupts. TableBoxAttribute)
-void SwTableBoxFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwTableBoxFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
if( !IsModifyLocked() && !IsInDocDTOR() )
{
@@ -2354,8 +2312,8 @@ void SwTableBoxFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
SFX_ITEM_SET == GetItemState( RES_BOXATR_FORMULA, sal_False ) )
{
// die Box holen
- SwClientIter aIter( *this );
- SwTableBox* pBox = (SwTableBox*)aIter.First( TYPE( SwTableBox ) );
+ SwIterator<SwTableBox,SwFmt> aIter( *this );
+ SwTableBox* pBox = aIter.First();
if( pBox )
{
ASSERT( !aIter.Next(), "keine Box oder mehrere am Format" );
@@ -2540,21 +2498,6 @@ sal_Bool SwTableBox::HasNumCntnt( double& rNum, sal_uInt32& rFmtIndex,
rFmtIndex = 0;
bRet = pNumFmtr->IsNumberFormat( aTxt, rFmtIndex, rNum );
-
-/*
-// wie bekommt man aus dem neuen String den neuen Wert?
-// denn der Numberformater erkennt aus "123.--DM" kein Zahlenformat!
- if( !bRet && rFmtIndex && !pNumFmtr->IsTextFormat( rFmtIndex ) &&
- SFX_ITEM_SET == GetFrmFmt()->GetItemState( RES_BOXATR_VALUE,
- sal_False, &pItem ))
- {
- Color* pCol;
- String sNewTxt;
- pNumFmtr->GetOutputString( ((SwTblBoxValue*)pItem)->GetValue(),
- rFmtIndex, sNewTxt, &pCol );
- bRet = aTxt == sNewTxt;
- }
-*/
}
else
rIsEmptyTxtNd = sal_False;
@@ -2744,11 +2687,7 @@ public:
void setTable(const SwTable * pTable) {
m_pTable = pTable;
SwFrmFmt * pFrmFmt = m_pTable->GetFrmFmt();
- SwClientIter aIter(*pFrmFmt);
-
- m_pTabFrm =
- static_cast<const SwTabFrm *>(aIter.First(TYPE(SwTabFrm)));
-
+ m_pTabFrm = SwIterator<SwTabFrm,SwFmt>::FirstElement(*pFrmFmt);
if (m_pTabFrm->IsFollow())
m_pTabFrm = m_pTabFrm->FindMaster(true);
}
@@ -2882,3 +2821,26 @@ const SwTableBox * SwTableCellInfo::getTableBox() const
return pRet;
}
+
+void SwTable::RegisterToFormat( SwFmt& rFmt )
+{
+ rFmt.Add( this );
+}
+
+void SwTableLine::RegisterToFormat( SwFmt& rFmt )
+{
+ rFmt.Add( this );
+}
+
+void SwTableBox::RegisterToFormat( SwFmt& rFmt )
+{
+ rFmt.Add( this );
+}
+
+void SwTableBox::ForgetFrmFmt()
+{
+ if ( GetRegisteredIn() )
+ GetRegisteredInNonConst()->Remove(this);
+}
+
+
diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx
index 1a7409a268..84dd6b71b5 100644
--- a/sw/source/core/text/EnhancedPDFExportHelper.cxx
+++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx
@@ -81,7 +81,7 @@
#include "i18npool/mslangid.hxx"
#include <IMark.hxx>
#include <SwNodeNum.hxx>
-
+#include <switerator.hxx>
#include <stack>
#include <tools/globname.hxx>
@@ -1589,22 +1589,19 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
if ( pPDFExtOutDevData->GetIsExportNotes() )
{
SwFieldType* pType = mrSh.GetFldType( RES_POSTITFLD, aEmptyStr );
- SwClientIter aIter( *pType );
- const SwClient * pFirst = aIter.GoStart();
- while( pFirst )
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pType );
+ for( SwFmtFld* pFirst = aIter.First(); pFirst; )
{
- if( ((SwFmtFld*)pFirst)->GetTxtFld() &&
- ((SwFmtFld*)pFirst)->IsFldInDoc())
+ if( pFirst->GetTxtFld() && pFirst->IsFldInDoc() )
{
- const SwTxtNode* pTNd =
- (SwTxtNode*)((SwFmtFld*)pFirst)->GetTxtFld()->GetpTxtNode();
+ const SwTxtNode* pTNd = (SwTxtNode*)pFirst->GetTxtFld()->GetpTxtNode();
ASSERT( 0 != pTNd, "Enhanced pdf export - text node is missing" )
// 1. Check if the whole paragraph is hidden
// 2. Move to the field
// 3. Check for hidden text attribute
if ( !pTNd->IsHidden() &&
- mrSh.GotoFld( *(SwFmtFld*)pFirst ) &&
+ mrSh.GotoFld( *pFirst ) &&
!mrSh.SelectHiddenRange() )
{
// Link Rectangle
@@ -1618,7 +1615,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
vcl::PDFNote aNote;
// Use the NumberFormatter to get the date string:
- const SwPostItField* pField = (SwPostItField*)((SwFmtFld*)pFirst)->GetFld();
+ const SwPostItField* pField = (SwPostItField*)pFirst->GetFld();
SvNumberFormatter* pNumFormatter = pDoc->GetNumberFormatter();
const Date aDateDiff( pField->GetDate() -
*pNumFormatter->GetNullDate() );
@@ -1641,7 +1638,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
}
}
}
- pFirst = aIter++;
+ pFirst = aIter.Next();
mrSh.SwCrsrShell::ClearMark();
}
}
@@ -1831,22 +1828,19 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
// REFERENCES
//
SwFieldType* pType = mrSh.GetFldType( RES_GETREFFLD, aEmptyStr );
- SwClientIter aIter( *pType );
- const SwClient * pFirst = aIter.GoStart();
- while( pFirst )
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pType );
+ for( SwFmtFld* pFirst = aIter.First(); pFirst; )
{
- if( ((SwFmtFld*)pFirst)->GetTxtFld() &&
- ((SwFmtFld*)pFirst)->IsFldInDoc())
+ if( pFirst->GetTxtFld() && pFirst->IsFldInDoc() )
{
- const SwTxtNode* pTNd =
- (SwTxtNode*)((SwFmtFld*)pFirst)->GetTxtFld()->GetpTxtNode();
+ const SwTxtNode* pTNd = (SwTxtNode*)pFirst->GetTxtFld()->GetpTxtNode();
ASSERT( 0 != pTNd, "Enhanced pdf export - text node is missing" )
// 1. Check if the whole paragraph is hidden
// 2. Move to the field
// 3. Check for hidden text attribute
if ( !pTNd->IsHidden() &&
- mrSh.GotoFld( *(SwFmtFld*)pFirst ) &&
+ mrSh.GotoFld( *pFirst ) &&
!mrSh.SelectHiddenRange() )
{
// Select the field:
@@ -1862,7 +1856,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
// Destination Rectangle
const SwGetRefField* pField =
- (SwGetRefField*)((SwFmtFld*)pFirst)->GetFld();
+ (SwGetRefField*)pFirst->GetFld();
const String& rRefName = pField->GetSetRefName();
mrSh.GotoRefMark( rRefName, pField->GetSubType(), pField->GetSeqNo() );
const SwRect& rDestRect = mrSh.GetCharRect();
@@ -1915,7 +1909,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
}
}
}
- pFirst = aIter++;
+ pFirst = aIter.Next();
mrSh.SwCrsrShell::ClearMark();
}
@@ -2106,12 +2100,18 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
if ( -1 != nDestPageNum )
{
- // Destination Export
- const sal_Int32 nDestId =
- pPDFExtOutDevData->CreateDest( rDestRect.SVRect(), nDestPageNum );
+ if ( aIBeg->nLinkId != -1 )
+ {
+ // Destination Export
+ const sal_Int32 nDestId = pPDFExtOutDevData->CreateDest( rDestRect.SVRect(), nDestPageNum );
- // Connect Link and Destination:
- pPDFExtOutDevData->SetLinkDest( aIBeg->nLinkId, nDestId );
+ // Connect Link and Destination:
+ pPDFExtOutDevData->SetLinkDest( aIBeg->nLinkId, nDestId );
+ }
+ else
+ {
+ pPDFExtOutDevData->DescribeRegisteredDest( aIBeg->nDestId, rDestRect.SVRect(), nDestPageNum );
+ }
}
}
else
@@ -2175,15 +2175,10 @@ void SwEnhancedPDFExportHelper::MakeHeaderFooterLinks( vcl::PDFExtOutDevData& rP
// the offset of the link rectangle calculates as follows:
const Point aOffset = rLinkRect.Pos() + mrOut.GetMapMode().GetOrigin();
- SwClientIter aClientIter( const_cast<SwTxtNode&>(rTNd) );
- SwClient* pLast = aClientIter.GoStart();
-
- while( pLast )
- {
- if ( pLast->ISA( SwTxtFrm ) )
+ SwIterator<SwTxtFrm,SwTxtNode> aIter( rTNd );
+ for ( SwTxtFrm* pTmpFrm = aIter.First(); pTmpFrm; pTmpFrm = aIter.Next() )
{
// Add offset to current page:
- SwTxtFrm* pTmpFrm = static_cast<SwTxtFrm*>(pLast);
const SwPageFrm* pPageFrm = pTmpFrm->FindPageFrm();
SwRect aHFLinkRect( rLinkRect );
aHFLinkRect.Pos() = pPageFrm->Frm().Pos() + aOffset;
@@ -2210,8 +2205,5 @@ void SwEnhancedPDFExportHelper::MakeHeaderFooterLinks( vcl::PDFExtOutDevData& rP
}
}
}
-
- pLast = ++aClientIter;
- }
}
diff --git a/sw/source/core/text/blink.cxx b/sw/source/core/text/blink.cxx
index a008d3ce93..375e2c7f19 100644
--- a/sw/source/core/text/blink.cxx
+++ b/sw/source/core/text/blink.cxx
@@ -149,7 +149,7 @@ void SwBlink::Insert( const Point& rPoint, const SwLinePortion* pPor,
else
{
pBlinkPor->SetPos( rPoint );
- pBlinkPor->SetRootFrm( pTxtFrm->FindRootFrm() );
+ pBlinkPor->SetRootFrm( pTxtFrm->getRootFrm() );
aList.Insert( pBlinkPor );
pTxtFrm->SetBlinkPor();
if( pPor->IsLayPortion() || pPor->IsParaPortion() )
diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx
index 9618fefa2d..f90a33d9ab 100644
--- a/sw/source/core/text/frmcrsr.cxx
+++ b/sw/source/core/text/frmcrsr.cxx
@@ -34,6 +34,7 @@
#include "frmtool.hxx"
#include "viewopt.hxx"
#include "paratr.hxx"
+#include "rootfrm.hxx"
#include "pagefrm.hxx"
#include "colfrm.hxx"
#include "txttypes.hxx"
@@ -131,7 +132,7 @@ sal_Bool lcl_ChangeOffset( SwTxtFrm* pFrm, xub_StrLen nNew )
!pFly->GetNextLink() && !pFly->GetPrevLink() ) ||
( !pFly && pFrm->IsInTab() ) )
{
- ViewShell* pVsh = pFrm->GetShell();
+ ViewShell* pVsh = pFrm->getRootFrm()->GetCurrShell();
if( pVsh )
{
if( pVsh->GetNext() != pVsh ||
@@ -145,7 +146,7 @@ sal_Bool lcl_ChangeOffset( SwTxtFrm* pFrm, xub_StrLen nNew )
pFrm->SetPara( 0 );
pFrm->GetFormatted();
if( pFrm->Frm().HasArea() )
- pFrm->GetShell()->InvalidateWindows( pFrm->Frm() );
+ pFrm->getRootFrm()->GetCurrShell()->InvalidateWindows( pFrm->Frm() );
return sal_True;
}
}
@@ -222,10 +223,11 @@ sal_Bool SwTxtFrm::GetCharRect( SwRect& rOrig, const SwPosition &rPos,
SWRECTFN ( pFrm )
const SwTwips nUpperMaxY = (pTmpFrm->*fnRect->fnGetPrtBottom)();
const SwTwips nFrmMaxY = (pFrm->*fnRect->fnGetPrtBottom)();
-
+
// nMaxY is an absolute value
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
SwTwips nMaxY = bVert ?
- Max( nFrmMaxY, nUpperMaxY ) :
+ ( bVertL2R ? Min( nFrmMaxY, nUpperMaxY ) : Max( nFrmMaxY, nUpperMaxY ) ) :
Min( nFrmMaxY, nUpperMaxY );
sal_Bool bRet = sal_False;
@@ -242,8 +244,8 @@ sal_Bool SwTxtFrm::GetCharRect( SwRect& rOrig, const SwPosition &rPos,
{
if( nFirstOffset > 0 )
aPnt1.Y() += nFirstOffset;
-
- if ( aPnt1.X() < nMaxY )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( aPnt1.X() < nMaxY && !bVertL2R )
aPnt1.X() = nMaxY;
aPnt2.X() = aPnt1.X() + pFrm->Prt().Width();
aPnt2.Y() = aPnt1.Y();
@@ -396,8 +398,9 @@ sal_Bool SwTxtFrm::GetAutoPos( SwRect& rOrig, const SwPosition &rPos ) const
SwTwips nUpperMaxY = (pTmpFrm->*fnRect->fnGetPrtBottom)();
// nMaxY is in absolute value
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
SwTwips nMaxY = bVert ?
- Max( (pFrm->*fnRect->fnGetPrtBottom)(), nUpperMaxY ) :
+ ( bVertL2R ? Min( (pFrm->*fnRect->fnGetPrtBottom)(), nUpperMaxY ) : Max( (pFrm->*fnRect->fnGetPrtBottom)(), nUpperMaxY ) ) :
Min( (pFrm->*fnRect->fnGetPrtBottom)(), nUpperMaxY );
if ( pFrm->IsEmpty() || ! (pFrm->Prt().*fnRect->fnGetHeight)() )
@@ -406,8 +409,9 @@ sal_Bool SwTxtFrm::GetAutoPos( SwRect& rOrig, const SwPosition &rPos ) const
Point aPnt2;
if ( bVert )
{
- if ( aPnt1.X() < nMaxY )
+ if ( aPnt1.X() < nMaxY && !bVertL2R )
aPnt1.X() = nMaxY;
+
aPnt2.X() = aPnt1.X() + pFrm->Prt().Width();
aPnt2.Y() = aPnt1.Y();
if( aPnt2.X() < nMaxY )
@@ -923,7 +927,7 @@ sal_Bool SwTxtFrm::_UnitUp( SwPaM *pPam, const SwTwips nOffset,
xub_StrLen nOffs = GetOfst();
if( pTmpPrev )
{
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
sal_Bool bProtectedAllowed = pSh && pSh->GetViewOptions()->IsCursorInProtectedArea();
const SwTxtFrm *pPrevPrev = pTmpPrev;
// Hier werden geschuetzte Frames und Frame ohne Inhalt ausgelassen
@@ -1276,7 +1280,7 @@ sal_Bool SwTxtFrm::_UnitDown(SwPaM *pPam, const SwTwips nOffset,
if( 0 != ( pTmpFollow = GetFollow() ) )
{ // geschuetzte Follows auslassen
const SwCntntFrm* pTmp = pTmpFollow;
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
if( !pSh || !pSh->GetViewOptions()->IsCursorInProtectedArea() )
{
while( pTmpFollow && pTmpFollow->IsProtected() )
@@ -1436,7 +1440,7 @@ void SwTxtFrm::FillCrsrPos( SwFillData& rFill ) const
pColl = &pColl->GetNextTxtFmtColl();
SwAttrSet aSet( ((SwDoc*)GetTxtNode()->GetDoc())->GetAttrPool(), aTxtFmtCollSetRange );
const SwAttrSet* pSet = &pColl->GetAttrSet();
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
if( GetTxtNode()->HasSwAttrSet() )
{
aSet.Put( *GetTxtNode()->GetpSwAttrSet() );
@@ -1451,8 +1455,7 @@ void SwTxtFrm::FillCrsrPos( SwFillData& rFill ) const
pFnt->ChkMagic( pSh, pFnt->GetActual() );
}
OutputDevice* pOut = pSh->GetOut();
- if ( !GetTxtNode()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ||
- ( pSh->GetViewOptions()->IsPrtFormat() ) )
+ if( !pSh->GetViewOptions()->getBrowseMode() || pSh->GetViewOptions()->IsPrtFormat() )
pOut = GetTxtNode()->getIDocumentDeviceAccess()->getReferenceDevice( true );
pFnt->SetFntChg( sal_True );
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index 1d468339d6..869ac9be16 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -482,9 +482,17 @@ void SwTxtFrm::AdjustFrm( const SwTwips nChgHght, sal_Bool bHasToFit )
if ( IsVertical() )
{
ASSERT( ! IsSwapped(),"Swapped frame while calculating nRstHeight" );
- nRstHeight = Frm().Left() + Frm().Width() -
- ( GetUpper()->Frm().Left() + GetUpper()->Prt().Left() );
- }
+
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( IsVertLR() )
+ nRstHeight = GetUpper()->Frm().Left()
+ + GetUpper()->Prt().Left()
+ + GetUpper()->Prt().Width()
+ - Frm().Left();
+ else
+ nRstHeight = Frm().Left() + Frm().Width() -
+ ( GetUpper()->Frm().Left() + GetUpper()->Prt().Left() );
+ }
else
nRstHeight = GetUpper()->Frm().Top()
+ GetUpper()->Prt().Top()
@@ -681,7 +689,7 @@ SwCntntFrm *SwTxtFrm::JoinFrm()
// and relation CONTENT_FLOWS_TO for current previous paragraph, which
// is <this>, will change.
{
- ViewShell* pViewShell( pFoll->GetShell() );
+ ViewShell* pViewShell( pFoll->getRootFrm()->GetCurrShell() );
if ( pViewShell && pViewShell->GetLayout() &&
pViewShell->GetLayout()->IsAnyShellAccessible() )
{
@@ -708,7 +716,7 @@ SwCntntFrm *SwTxtFrm::SplitFrm( const xub_StrLen nTxtPos )
// Durch das Paste wird ein Modify() an mich verschickt.
// Damit meine Daten nicht verschwinden, locke ich mich.
SwTxtFrmLocker aLock( this );
- SwTxtFrm *pNew = (SwTxtFrm *)(GetTxtNode()->MakeFrm());
+ SwTxtFrm *pNew = (SwTxtFrm *)(GetTxtNode()->MakeFrm( this ));
pNew->bIsFollow = sal_True;
pNew->SetFollow( GetFollow() );
@@ -721,7 +729,7 @@ SwCntntFrm *SwTxtFrm::SplitFrm( const xub_StrLen nTxtPos )
// and relation CONTENT_FLOWS_TO for current previous paragraph, which
// is <this>, will change.
{
- ViewShell* pViewShell( pNew->GetShell() );
+ ViewShell* pViewShell( pNew->getRootFrm()->GetCurrShell() );
if ( pViewShell && pViewShell->GetLayout() &&
pViewShell->GetLayout()->IsAnyShellAccessible() )
{
@@ -1137,7 +1145,9 @@ void SwTxtFrm::FormatAdjust( SwTxtFormatter &rLine,
// If the frame grows (or shirks) the repaint rectangle cannot simply
// be rotated back after formatting, because we use the upper left point
// of the frame for rotation. This point changes when growing/shrinking.
- if ( IsVertical() && nChg )
+
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( IsVertical() && !IsVertLR() && nChg )
{
SwRect &rRepaint = *(pPara->GetRepaint());
rRepaint.Left( rRepaint.Left() - nChg );
@@ -1297,7 +1307,7 @@ sal_Bool SwTxtFrm::FormatLine( SwTxtFormatter &rLine, const sal_Bool bPrev )
}
SwTwips nRght = Max( nOldWidth, pNew->Width() +
pNew->GetHangingMargin() );
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
const SwViewOption *pOpt = pSh ? pSh->GetViewOptions() : 0;
if( pOpt && (pOpt->IsParagraph() || pOpt->IsLineBreak()) )
nRght += ( Max( nOldAscent, pNew->GetAscent() ) );
diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx
index 0dc6eddcb2..e86e4b7156 100644
--- a/sw/source/core/text/frmpaint.cxx
+++ b/sw/source/core/text/frmpaint.cxx
@@ -41,6 +41,7 @@
#include <fmtline.hxx>
#include <lineinfo.hxx>
#include <charfmt.hxx>
+#include "rootfrm.hxx"
#include <pagefrm.hxx>
#include <viewsh.hxx> // ViewShell
#include <viewimp.hxx> // SwViewImp
@@ -320,7 +321,7 @@ void SwTxtFrm::PaintExtraData( const SwRect &rRect ) const
{
if( IsLocked() || IsHiddenNow() || !Prt().Height() )
return;
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
SWAP_IF_NOT_SWAPPED( this )
SwRect rOldRect( rRect );
@@ -448,6 +449,10 @@ SwRect SwTxtFrm::Paint()
// d.h. als linken Rand den berechneten PaintOfst!
SwRepaint *pRepaint = GetPara()->GetRepaint();
long l;
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( IsVertLR() ) // mba: the following line was added, but we don't need it for the existing directions; kept for IsVertLR(), but should be checked
+ pRepaint->Chg( ( GetUpper()->Frm() ).Pos() + ( GetUpper()->Prt() ).Pos(), ( GetUpper()->Prt() ).SSize() );
+
if( pRepaint->GetOfst() )
pRepaint->Left( pRepaint->GetOfst() );
@@ -474,7 +479,7 @@ SwRect SwTxtFrm::Paint()
sal_Bool SwTxtFrm::PaintEmpty( const SwRect &rRect, sal_Bool bCheck ) const
{
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
if( pSh && ( pSh->GetViewOptions()->IsParagraph() || bInitFont ) )
{
bInitFont = sal_False;
@@ -597,7 +602,7 @@ void SwTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
ResetRepaint();
// --> FME 2004-06-24 #i16816# tagged pdf support
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
Num_Info aNumInfo( *this );
SwTaggedPDFHelper aTaggedPDFHelperNumbering( &aNumInfo, 0, 0, *pSh->GetOut() );
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 6fdb820d31..0c939939f7 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -299,7 +299,7 @@ void SwTxtSizeInfo::CtorInitTxtSizeInfo( SwTxtFrm *pFrame, SwFont *pNewFnt,
pFrm = pFrame;
CtorInitTxtInfo( pFrm );
const SwTxtNode *pNd = pFrm->GetTxtNode();
- pVsh = pFrm->GetShell();
+ pVsh = pFrm->getRootFrm()->GetCurrShell();
// Get the output and reference device
if ( pVsh )
@@ -311,7 +311,7 @@ void SwTxtSizeInfo::CtorInitTxtSizeInfo( SwTxtFrm *pFrame, SwFont *pNewFnt,
else
{
//Zugriff ueber StarONE, es muss keine Shell existieren oder aktiv sein.
- if ( pNd->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ if ( pNd->getIDocumentSettingAccess()->get(IDocumentSettingAccess::HTML_MODE) )
{
//in Ermangelung eines Besseren kann hier ja wohl nur noch das
//AppWin genommen werden?
@@ -661,7 +661,7 @@ void SwTxtPaintInfo::_DrawText( const XubString &rText, const SwLinePortion &rPo
if( GetFont()->IsBlink() && OnWin() && rPor.Width() )
{
// check if accessibility options allow blinking portions:
- const ViewShell* pSh = GetTxtFrm()->GetShell();
+ const ViewShell* pSh = GetTxtFrm()->getRootFrm()->GetCurrShell();
if ( pSh && ! pSh->GetAccessibilityOptions()->IsStopAnimatedText() &&
! pSh->IsPreView() )
{
@@ -710,7 +710,7 @@ void SwTxtPaintInfo::_DrawText( const XubString &rText, const SwLinePortion &rPo
const sal_Bool bTmpSmart = bSmartTag && OnWin() && !GetOpt().IsPagePreview() && SwSmartTagMgr::Get().IsSmartTagsEnabled(); // SMARTTAGS
ASSERT( GetParaPortion(), "No paragraph!");
- SwDrawTextInfo aDrawInf( pFrm->GetShell(), *pOut, pSI, rText, nStart, nLength,
+ SwDrawTextInfo aDrawInf( pFrm->getRootFrm()->GetCurrShell(), *pOut, pSI, rText, nStart, nLength,
rPor.Width(), bBullet );
aDrawInf.SetLeft( GetPaintRect().Left() );
@@ -814,7 +814,11 @@ void SwTxtPaintInfo::CalcRect( const SwLinePortion& rPor,
else
{
aPoint.A() = X();
- aPoint.B() = Y() - rPor.GetAscent();
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( GetTxtFrm()->IsVertLR() )
+ aPoint.B() = Y() - rPor.Height() + rPor.GetAscent();
+ else
+ aPoint.B() = Y() - rPor.GetAscent();
}
// Adjust x coordinate if we are inside a bidi portion
diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx
index de5e6b4f78..8c466c1761 100644
--- a/sw/source/core/text/itratr.cxx
+++ b/sw/source/core/text/itratr.cxx
@@ -33,7 +33,7 @@
#include <editeng/charscaleitem.hxx>
#include <txtatr.hxx>
#include <sfx2/printer.hxx>
-#include <editeng/lrspitem.hxx>
+#include <svx/svdobj.hxx>
#include <vcl/window.hxx>
#include <vcl/svapp.hxx>
#include <fmtanchr.hxx>
@@ -62,6 +62,8 @@
#include <breakit.hxx>
#include <com/sun/star/i18n/WordType.hpp>
#include <com/sun/star/i18n/ScriptType.hdl>
+#include <editeng/lrspitem.hxx>
+#include <switerator.hxx>
using namespace ::com::sun::star::i18n;
using namespace ::com::sun::star;
@@ -429,15 +431,13 @@ sal_Bool lcl_MinMaxString( SwMinMaxArgs& rArg, SwFont* pFnt, const XubString &rT
return bRet;
}
-sal_Bool SwTxtNode::IsSymbol( const xub_StrLen nBegin ) const
+sal_Bool SwTxtNode::IsSymbol( const xub_StrLen nBegin ) const//swmodtest 080307
{
SwScriptInfo aScriptInfo;
SwAttrIter aIter( *(SwTxtNode*)this, aScriptInfo );
aIter.Seek( nBegin );
- const SwRootFrm* pTmpRootFrm = getIDocumentLayoutAccess()->GetRootFrm();
- return aIter.GetFnt()->IsSymbol( pTmpRootFrm ?
- pTmpRootFrm->GetCurrShell() :
- 0 );
+ return aIter.GetFnt()->IsSymbol(
+ const_cast<ViewShell *>(getIDocumentLayoutAccess()->GetCurrentViewShell()) );//swmod 080311
}
class SwMinMaxNodeArgs
@@ -702,10 +702,8 @@ void SwTxtNode::GetMinMaxSize( sal_uLong nIndex, sal_uLong& rMin, sal_uLong &rMa
case CHAR_HARDHYPHEN:
{
XubString sTmp( cChar );
- const SwRootFrm* pTmpRootFrm = getIDocumentLayoutAccess()->GetRootFrm();
- SwDrawTextInfo aDrawInf( pTmpRootFrm ?
- pTmpRootFrm->GetCurrShell() :
- 0, *pOut, 0, sTmp, 0, 1, 0, sal_False );
+ SwDrawTextInfo aDrawInf( const_cast<ViewShell *>(getIDocumentLayoutAccess()->GetCurrentViewShell()),
+ *pOut, 0, sTmp, 0, 1, 0, sal_False );//swmod 080311
nAktWidth = aIter.GetFnt()->_GetTxtSize( aDrawInf ).Width();
aArg.nWordWidth += nAktWidth;
aArg.nRowWidth += nAktWidth;
@@ -839,7 +837,7 @@ sal_uInt16 SwTxtNode::GetScalingOfSelectedText( xub_StrLen nStt, xub_StrLen nEnd
else
{
//Zugriff ueber StarONE, es muss keine Shell existieren oder aktiv sein.
- if ( getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ if ( getIDocumentSettingAccess()->get(IDocumentSettingAccess::HTML_MODE) )
pOut = GetpApp()->GetDefaultDevice();
else
pOut = getIDocumentDeviceAccess()->getReferenceDevice( true );
@@ -1000,15 +998,10 @@ sal_uInt16 SwTxtNode::GetScalingOfSelectedText( xub_StrLen nStt, xub_StrLen nEnd
nWidth = Max( nWidth, nProWidth );
// search for a text frame this node belongs to
- SwClientIter aClientIter( *(SwTxtNode*)this );
- SwClient* pLastFrm = aClientIter.GoStart();
+ SwIterator<SwTxtFrm,SwTxtNode> aFrmIter( *this );
SwTxtFrm* pFrm = 0;
-
- while( pLastFrm )
+ for( SwTxtFrm* pTmpFrm = aFrmIter.First(); pTmpFrm; pTmpFrm = aFrmIter.Next() )
{
- if ( pLastFrm->ISA( SwTxtFrm ) )
- {
- SwTxtFrm* pTmpFrm = ( SwTxtFrm* )pLastFrm;
if ( pTmpFrm->GetOfst() <= nStt &&
( !pTmpFrm->GetFollow() ||
pTmpFrm->GetFollow()->GetOfst() > nStt ) )
@@ -1017,8 +1010,6 @@ sal_uInt16 SwTxtNode::GetScalingOfSelectedText( xub_StrLen nStt, xub_StrLen nEnd
break;
}
}
- pLastFrm = ++aClientIter;
- }
// search for the line containing nStt
if ( pFrm && pFrm->HasPara() )
@@ -1059,16 +1050,12 @@ sal_uInt16 SwTxtNode::GetWidthOfLeadingTabs() const
aPos.nContent += nIdx;
// Find the non-follow text frame:
- SwClientIter aClientIter( (SwTxtNode&)*this );
- SwClient* pLastFrm = aClientIter.GoStart();
-
- while( pLastFrm )
+ SwIterator<SwTxtFrm,SwTxtNode> aIter( *this );
+ for( SwTxtFrm* pFrm = aIter.First(); pFrm; pFrm = aIter.Next() )
{
// Only consider master frames:
- if ( pLastFrm->ISA(SwTxtFrm) &&
- !static_cast<SwTxtFrm*>(pLastFrm)->IsFollow() )
+ if ( !pFrm->IsFollow() )
{
- const SwTxtFrm* pFrm = static_cast<SwTxtFrm*>(pLastFrm);
SWRECTFN( pFrm )
SwRect aRect;
pFrm->GetCharRect( aRect, aPos );
@@ -1078,7 +1065,6 @@ sal_uInt16 SwTxtNode::GetWidthOfLeadingTabs() const
(aRect.*fnRect->fnGetLeft)() - (pFrm->*fnRect->fnGetPrtLeft)() );
break;
}
- pLastFrm = ++aClientIter;
}
}
diff --git a/sw/source/core/text/itrtxt.cxx b/sw/source/core/text/itrtxt.cxx
index 947f914691..1a53faf4cc 100644
--- a/sw/source/core/text/itrtxt.cxx
+++ b/sw/source/core/text/itrtxt.cxx
@@ -367,7 +367,11 @@ sal_uInt16 SwTxtCursor::AdjustBaseLine( const SwLineLayout& rLine,
case SvxParaVertAlignItem::AUTOMATIC :
if ( bAutoToCentered || GetInfo().GetTxtFrm()->IsVertical() )
{
- nOfst += ( rLine.Height() - nPorHeight ) / 2 + nPorAscent;
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if( GetInfo().GetTxtFrm()->IsVertLR() )
+ nOfst += rLine.Height() - ( rLine.Height() - nPorHeight ) / 2 - nPorAscent;
+ else
+ nOfst += ( rLine.Height() - nPorHeight ) / 2 + nPorAscent;
break;
}
case SvxParaVertAlignItem::BASELINE :
diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx
index ef03ed5c06..e813de5c01 100644
--- a/sw/source/core/text/porfld.cxx
+++ b/sw/source/core/text/porfld.cxx
@@ -31,20 +31,11 @@
#include <hintids.hxx>
-#ifndef _COM_SUN_STAR_I18N_SCRIPTTYPE_HDL_
#include <com/sun/star/i18n/ScriptType.hdl>
-#endif
-
-#ifndef _GRAPH_HXX //autogen
#include <vcl/graph.hxx>
-#endif
#include <editeng/brshitem.hxx>
-#ifndef _METRIC_HXX //autogen
#include <vcl/metric.hxx>
-#endif
-#ifndef _OUTDEV_HXX //autogen
#include <vcl/outdev.hxx>
-#endif
#include <viewopt.hxx> // SwViewOptions
#include <txtcfg.hxx>
#include <SwPortionHandler.hxx>
@@ -54,10 +45,9 @@
#include <blink.hxx> // pBlink
#include <frmtool.hxx> // DrawGraphic
#include <viewsh.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <doc.hxx>
+#include "rootfrm.hxx"
#include <breakit.hxx>
#include <porrst.hxx>
#include <porftn.hxx> // SwFtnPortion
@@ -1020,7 +1010,7 @@ void SwGrfNumPortion::Paint( const SwTxtPaintInfo &rInf ) const
pViewShell && pViewShell->GetWin() )
{
( (Graphic*) pBrush->GetGraphic() )->StopAnimation(0,nId);
- rInf.GetTxtFrm()->GetShell()->InvalidateWindows( aTmp );
+ rInf.GetTxtFrm()->getRootFrm()->GetCurrShell()->InvalidateWindows( aTmp );
}
@@ -1254,7 +1244,7 @@ sal_Bool SwCombinedPortion::Format( SwTxtFormatInfo &rInf )
}
sal_uInt16 nTop = ( nCount + 1 ) / 2; // the first character of the second line
- ViewShell *pSh = rInf.GetTxtFrm()->GetShell();
+ ViewShell *pSh = rInf.GetTxtFrm()->getRootFrm()->GetCurrShell();
SwFont aTmpFont( *rInf.GetFont() );
SwFontSave aFontSave( rInf, &aTmpFont );
nProportion = 55;
diff --git a/sw/source/core/text/porfly.cxx b/sw/source/core/text/porfly.cxx
index 6d6b20ed07..2f820aad43 100644
--- a/sw/source/core/text/porfly.cxx
+++ b/sw/source/core/text/porfly.cxx
@@ -33,6 +33,7 @@
#include "dflyobj.hxx" // SwVirtFlyDrawObj
#include "pam.hxx" // SwPosition
#include "flyfrm.hxx" // SwFlyInCntFrm
+#include "rootfrm.hxx"
#include "frmfmt.hxx" // SwFrmFmt
#include "viewsh.hxx"
@@ -254,7 +255,7 @@ void SwFlyCntPortion::Paint( const SwTxtPaintInfo &rInf ) const
if( (GetFlyFrm()->IsCompletePaint() ||
GetFlyFrm()->Frm().IsOver( aRepaintRect )) &&
SwFlyFrm::IsPaint( (SdrObject*)GetFlyFrm()->GetVirtDrawObj(),
- GetFlyFrm()->GetShell() ))
+ GetFlyFrm()->getRootFrm()->GetCurrShell() ))
{
SwRect aRect( GetFlyFrm()->Frm() );
if( !GetFlyFrm()->IsCompletePaint() )
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index ebf8c924d3..5c59184d3a 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -59,11 +59,8 @@
#include <fchrfmt.hxx>
#include <docary.hxx> // SwRedlineTbl
#include <redline.hxx> // SwRedline
-
-// --> FME 2004-06-08 #i12836# enhanced pdf export
#include <section.hxx>
-// <--
-
+#include <switerator.hxx>
#include <IDocumentRedlineAccess.hxx>
#include <IDocumentSettingAccess.hxx>
#include <IDocumentContentOperations.hxx>
@@ -2241,15 +2238,12 @@ sal_uInt16 SwScriptInfo::ThaiJustify( const XubString& rTxt, sal_Int32* pKernArr
SwScriptInfo* SwScriptInfo::GetScriptInfo( const SwTxtNode& rTNd,
sal_Bool bAllowInvalid )
{
- SwClientIter aClientIter( (SwTxtNode&)rTNd );
- SwClient* pLast = aClientIter.GoStart();
+ SwIterator<SwTxtFrm,SwTxtNode> aIter( rTNd );
SwScriptInfo* pScriptInfo = 0;
- while( pLast )
+ for( SwTxtFrm* pLast = aIter.First(); pLast; pLast = aIter.Next() )
{
- if ( pLast->ISA( SwTxtFrm ) )
- {
- pScriptInfo = (SwScriptInfo*)((SwTxtFrm*)pLast)->GetScriptInfo();
+ pScriptInfo = (SwScriptInfo*)pLast->GetScriptInfo();
if ( pScriptInfo )
{
if ( !bAllowInvalid && STRING_LEN != pScriptInfo->GetInvalidity() )
@@ -2257,8 +2251,6 @@ SwScriptInfo* SwScriptInfo::GetScriptInfo( const SwTxtNode& rTNd,
else break;
}
}
- pLast = ++aClientIter;
- }
return pScriptInfo;
}
diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx
index df493df7fc..01cf08d61d 100644
--- a/sw/source/core/text/porrst.cxx
+++ b/sw/source/core/text/porrst.cxx
@@ -53,6 +53,7 @@
#include <redlnitr.hxx> // SwRedlineItr
#include <porfly.hxx> // SwFlyPortion
#include <atrhndl.hxx>
+#include "rootfrm.hxx"
#include <IDocumentRedlineAccess.hxx>
#include <IDocumentSettingAccess.hxx>
@@ -233,7 +234,7 @@ SwTwips SwTxtFrm::EmptyHeight() const
SwFont *pFnt;
const SwTxtNode& rTxtNode = *GetTxtNode();
const IDocumentSettingAccess* pIDSA = rTxtNode.getIDocumentSettingAccess();
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
if ( rTxtNode.HasSwAttrSet() )
{
const SwAttrSet *pAttrSet = &( rTxtNode.GetSwAttrSet() );
@@ -250,8 +251,8 @@ SwTwips SwTxtFrm::EmptyHeight() const
pFnt->SetVertical( 2700 );
OutputDevice* pOut = pSh ? pSh->GetOut() : 0;
- if ( !pOut || !pIDSA->get(IDocumentSettingAccess::BROWSE_MODE) ||
- ( pSh->GetViewOptions()->IsPrtFormat() ) )
+ if ( !pOut || !pSh->GetViewOptions()->getBrowseMode() ||
+ pSh->GetViewOptions()->IsPrtFormat() )
{
pOut = rTxtNode.getIDocumentDeviceAccess()->getReferenceDevice(true);
}
@@ -393,13 +394,13 @@ sal_Bool SwTxtFrm::FillRegister( SwTwips& rRegStart, KSHORT& rRegDiff )
}
else
{
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
SwFontAccess aFontAccess( pFmt, pSh );
SwFont aFnt( *aFontAccess.Get()->GetFont() );
OutputDevice *pOut = 0;
- if( !GetTxtNode()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ||
- (pSh && pSh->GetViewOptions()->IsPrtFormat()) )
+ if( !pSh || !pSh->GetViewOptions()->getBrowseMode() ||
+ pSh->GetViewOptions()->IsPrtFormat() )
pOut = GetTxtNode()->getIDocumentDeviceAccess()->getReferenceDevice( true );
if( pSh && !pOut )
diff --git a/sw/source/core/text/redlnitr.cxx b/sw/source/core/text/redlnitr.cxx
index 26a6cdded2..08e602b392 100644
--- a/sw/source/core/text/redlnitr.cxx
+++ b/sw/source/core/text/redlnitr.cxx
@@ -64,8 +64,8 @@ using namespace ::com::sun::star;
void SwAttrIter::CtorInitAttrIter( SwTxtNode& rTxtNode, SwScriptInfo& rScrInf, SwTxtFrm* pFrm )
{
// Beim HTML-Import kann es vorkommen, dass kein Layout existiert.
- SwRootFrm* pRootFrm = rTxtNode.getIDocumentLayoutAccess()->GetRootFrm();
- pShell = pRootFrm ? pRootFrm->GetShell() : 0;
+ SwRootFrm* pRootFrm = rTxtNode.getIDocumentLayoutAccess()->GetCurrentLayout();
+ pShell = pRootFrm ? pRootFrm->GetCurrShell() : 0; //swmod 080218
pScriptInfo = &rScrInf;
diff --git a/sw/source/core/text/txtdrop.cxx b/sw/source/core/text/txtdrop.cxx
index b5b4c195ec..dafa6b0854 100644
--- a/sw/source/core/text/txtdrop.cxx
+++ b/sw/source/core/text/txtdrop.cxx
@@ -43,13 +43,12 @@
#include <txtpaint.hxx> // SwSaveClip
#include <blink.hxx> // pBlink
#include <breakit.hxx>
-#ifndef _COM_SUN_STAR_I18N_SCRIPTTYPE_HDL_
#include <com/sun/star/i18n/ScriptType.hdl>
-#endif
#include <com/sun/star/i18n/WordType.hpp>
#include <editeng/langitem.hxx>
#include <charatr.hxx>
#include <editeng/fhgtitem.hxx>
+#include <switerator.hxx>
using namespace ::com::sun::star::i18n;
using namespace ::com::sun::star;
@@ -228,21 +227,19 @@ bool SwTxtNode::GetDropSize(int& rFontHeight, int& rDropHeight, int& rDropDescen
}
// get text frame
- SwClientIter aClientIter( (SwTxtNode&)*this );
- SwClient* pLastFrm = aClientIter.GoStart();
-
- while( pLastFrm )
+ SwIterator<SwTxtFrm,SwTxtNode> aIter( *this );
+ for( SwTxtFrm* pLastFrm = aIter.First(); pLastFrm; pLastFrm = aIter.Next() )
{
// Only (master-) text frames can have a drop cap.
- if ( pLastFrm->ISA( SwTxtFrm ) && !((SwTxtFrm*)pLastFrm)->IsFollow() )
+ if ( !pLastFrm->IsFollow() )
{
- if( !((SwTxtFrm*)pLastFrm)->HasPara() )
- ((SwTxtFrm*)pLastFrm)->GetFormatted();
+ if( !pLastFrm->HasPara() )
+ pLastFrm->GetFormatted();
- if ( !((SwTxtFrm*)pLastFrm)->IsEmpty() )
+ if ( !pLastFrm->IsEmpty() )
{
- const SwParaPortion* pPara = ((SwTxtFrm*)pLastFrm)->GetPara();
+ const SwParaPortion* pPara = pLastFrm->GetPara();
ASSERT( pPara, "GetDropSize could not find the ParaPortion, I'll guess the drop cap size" )
if ( pPara )
@@ -265,7 +262,6 @@ bool SwTxtNode::GetDropSize(int& rFontHeight, int& rDropHeight, int& rDropDescen
}
break;
}
- pLastFrm = ++aClientIter;
}
if (rFontHeight==0 && rDropHeight==0 && rDropDescent==0)
diff --git a/sw/source/core/text/txtfld.cxx b/sw/source/core/text/txtfld.cxx
index 33b7e89ad0..262de79d5f 100644
--- a/sw/source/core/text/txtfld.cxx
+++ b/sw/source/core/text/txtfld.cxx
@@ -170,7 +170,7 @@ SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf,
case RES_PAGENUMBERFLD:
{
- if( !bName && pSh && !pSh->Imp()->IsUpdateExpFlds() )
+ if( !bName && pSh && pSh->GetLayout() && !pSh->Imp()->IsUpdateExpFlds() )//swmod 080122
{
SwPageNumberFieldType *pPageNr = (SwPageNumberFieldType *)pFld->GetTyp();
diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx
index 57983d2c94..3e6a6f37af 100644
--- a/sw/source/core/text/txtfly.cxx
+++ b/sw/source/core/text/txtfly.cxx
@@ -83,6 +83,7 @@
#ifdef DBG_UTIL
#include "viewopt.hxx" // SwViewOptions, nur zum Testen (Test2)
+#include "doc.hxx"
#endif
#ifdef VERT_DISTANCE
@@ -962,7 +963,7 @@ sal_Bool SwTxtFly::DrawTextOpaque( SwDrawTextInfo &rInf )
if ( bOn && nCount > 0 )
// <--
{
- MSHORT nHellId = pPage->GetShell()->getIDocumentDrawModelAccess()->GetHellId();
+ MSHORT nHellId = pPage->getRootFrm()->GetCurrShell()->getIDocumentDrawModelAccess()->GetHellId();
for( MSHORT i = 0; i < nCount; ++i )
{
// --> OD 2006-08-15 #i68520#
@@ -1067,7 +1068,7 @@ void SwTxtFly::DrawFlyRect( OutputDevice* pOut, const SwRect &rRect,
if ( bOn && nCount > 0 )
// <--
{
- MSHORT nHellId = pPage->GetShell()->getIDocumentDrawModelAccess()->GetHellId();
+ MSHORT nHellId = pPage->getRootFrm()->GetCurrShell()->getIDocumentDrawModelAccess()->GetHellId();
for( MSHORT i = 0; i < nCount; ++i )
{
// --> OD 2006-08-15 #i68520#
@@ -1106,7 +1107,7 @@ void SwTxtFly::DrawFlyRect( OutputDevice* pOut, const SwRect &rRect,
SwRect aFly( pAnchoredObjTmp->GetObjRect() );
// <--
// OD 24.01.2003 #106593#
- ::SwAlignRect( aFly, pPage->GetShell() );
+ ::SwAlignRect( aFly, pPage->getRootFrm()->GetCurrShell() );
if( aFly.Width() > 0 && aFly.Height() > 0 )
aRegion -= aFly;
}
@@ -1804,11 +1805,11 @@ const SwRect SwContourCache::ContourRect( const SwFmt* pFmt,
delete pPolyPolygon;
// UPPER_LOWER_TEST
#ifdef DBG_UTIL
- const SwRootFrm* pTmpRootFrm = pFmt->getIDocumentLayoutAccess()->GetRootFrm();
- if( pTmpRootFrm->GetCurrShell() )
+ const ViewShell* pTmpViewShell = pFmt->GetDoc()->GetCurrentViewShell();
+ if( pTmpViewShell )
{
- sal_Bool bT2 = pTmpRootFrm->GetCurrShell()->GetViewOptions()->IsTest2();
- sal_Bool bT6 = pTmpRootFrm->GetCurrShell()->GetViewOptions()->IsTest6();
+ sal_Bool bT2 = pTmpViewShell->GetViewOptions()->IsTest2();
+ sal_Bool bT6 = pTmpViewShell->GetViewOptions()->IsTest6();
if( bT2 || bT6 )
{
if( bT2 )
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index bdcfdf09f0..d97abcbe23 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -41,6 +41,7 @@
#include <swmodule.hxx>
#include <SwSmartTagMgr.hxx>
#include <doc.hxx> // GetDoc()
+#include "rootfrm.hxx"
#include <pagefrm.hxx> // InvalidateSpelling
#include <rootfrm.hxx>
#include <viewsh.hxx> // ViewShell
@@ -73,21 +74,16 @@
#include <SwGrammarMarkUp.hxx>
#include <lineinfo.hxx>
#include <SwPortionHandler.hxx>
-// OD 2004-01-15 #110582#
#include <dcontact.hxx>
-// OD 2004-05-24 #i28701#
#include <sortedobjs.hxx>
-// --> OD 2005-03-30 #???#
#include <txtflcnt.hxx> // SwTxtFlyCnt
#include <fmtflcnt.hxx> // SwFmtFlyCnt
#include <fmtcntnt.hxx> // SwFmtCntnt
-// <--
-// --> OD 2008-01-31 #newlistlevelattrs#
#include <numrule.hxx>
-// <--
#include <swtable.hxx>
#include <fldupde.hxx>
#include <IGrammarContact.hxx>
+#include <switerator.hxx>
#if OSL_DEBUG_LEVEL > 1
#include <txtpaint.hxx> // DbgRect
@@ -104,13 +100,22 @@ void SwTxtFrm::SwapWidthAndHeight()
{
const long nPrtOfstX = Prt().Pos().X();
Prt().Pos().X() = Prt().Pos().Y();
- Prt().Pos().Y() = Frm().Width() - ( nPrtOfstX + Prt().Width() );
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if( IsVertLR() )
+ Prt().Pos().Y() = nPrtOfstX;
+ else
+ Prt().Pos().Y() = Frm().Width() - ( nPrtOfstX + Prt().Width() );
+
}
else
{
const long nPrtOfstY = Prt().Pos().Y();
Prt().Pos().Y() = Prt().Pos().X();
- Prt().Pos().X() = Frm().Height() - ( nPrtOfstY + Prt().Height() );
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if( IsVertLR() )
+ Prt().Pos().X() = nPrtOfstY;
+ else
+ Prt().Pos().X() = Frm().Height() - ( nPrtOfstY + Prt().Height() );
}
const long nFrmWidth = Frm().Width();
@@ -128,16 +133,33 @@ void SwTxtFrm::SwapWidthAndHeight()
void SwTxtFrm::SwitchHorizontalToVertical( SwRect& rRect ) const
{
// calc offset inside frame
- const long nOfstX = rRect.Left() - Frm().Left();
- const long nOfstY = rRect.Top() + rRect.Height() - Frm().Top();
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ long nOfstX, nOfstY;
+ if ( IsVertLR() )
+ {
+ nOfstX = rRect.Left() - Frm().Left();
+ nOfstY = rRect.Top() - Frm().Top();
+ }
+ else
+ {
+ nOfstX = rRect.Left() - Frm().Left();
+ nOfstY = rRect.Top() + rRect.Height() - Frm().Top();
+ }
+
const long nWidth = rRect.Width();
const long nHeight = rRect.Height();
- if ( bIsSwapped )
- rRect.Left( Frm().Left() + Frm().Height() - nOfstY );
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( IsVertLR() )
+ rRect.Left(Frm().Left() + nOfstY);
else
- // frame is rotated
- rRect.Left( Frm().Left() + Frm().Width() - nOfstY );
+ {
+ if ( bIsSwapped )
+ rRect.Left( Frm().Left() + Frm().Height() - nOfstY );
+ else
+ // frame is rotated
+ rRect.Left( Frm().Left() + Frm().Width() - nOfstY );
+ }
rRect.Top( Frm().Top() + nOfstX );
rRect.Width( nHeight );
@@ -151,12 +173,17 @@ void SwTxtFrm::SwitchHorizontalToVertical( Point& rPoint ) const
// calc offset inside frame
const long nOfstX = rPoint.X() - Frm().Left();
const long nOfstY = rPoint.Y() - Frm().Top();
-
- if ( bIsSwapped )
- rPoint.X() = Frm().Left() + Frm().Height() - nOfstY;
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( IsVertLR() )
+ rPoint.X() = Frm().Left() + nOfstY;
else
- // calc rotated coords
- rPoint.X() = Frm().Left() + Frm().Width() - nOfstY;
+ {
+ if ( bIsSwapped )
+ rPoint.X() = Frm().Left() + Frm().Height() - nOfstY;
+ else
+ // calc rotated coords
+ rPoint.X() = Frm().Left() + Frm().Width() - nOfstY;
+ }
rPoint.Y() = Frm().Top() + nOfstX;
}
@@ -177,10 +204,17 @@ void SwTxtFrm::SwitchVerticalToHorizontal( SwRect& rRect ) const
long nOfstX;
// calc offset inside frame
- if ( bIsSwapped )
- nOfstX = Frm().Left() + Frm().Height() - ( rRect.Left() + rRect.Width() );
+
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( IsVertLR() )
+ nOfstX = rRect.Left() - Frm().Left();
else
- nOfstX = Frm().Left() + Frm().Width() - ( rRect.Left() + rRect.Width() );
+ {
+ if ( bIsSwapped )
+ nOfstX = Frm().Left() + Frm().Height() - ( rRect.Left() + rRect.Width() );
+ else
+ nOfstX = Frm().Left() + Frm().Width() - ( rRect.Left() + rRect.Width() );
+ }
const long nOfstY = rRect.Top() - Frm().Top();
const long nWidth = rRect.Height();
@@ -200,10 +234,17 @@ void SwTxtFrm::SwitchVerticalToHorizontal( Point& rPoint ) const
long nOfstX;
// calc offset inside frame
- if ( bIsSwapped )
- nOfstX = Frm().Left() + Frm().Height() - rPoint.X();
+
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( IsVertLR() )
+ nOfstX = rPoint.X() - Frm().Left();
else
- nOfstX = Frm().Left() + Frm().Width() - rPoint.X();
+ {
+ if ( bIsSwapped )
+ nOfstX = Frm().Left() + Frm().Height() - rPoint.X();
+ else
+ nOfstX = Frm().Left() + Frm().Width() - rPoint.X();
+ }
const long nOfstY = rPoint.Y() - Frm().Top();
@@ -353,8 +394,8 @@ void SwTxtFrm::InitCtor()
/*************************************************************************
* SwTxtFrm::SwTxtFrm()
*************************************************************************/
-SwTxtFrm::SwTxtFrm(SwTxtNode * const pNode)
- : SwCntntFrm(pNode)
+SwTxtFrm::SwTxtFrm(SwTxtNode * const pNode, SwFrm* pSib )
+ : SwCntntFrm( pNode, pSib )
{
InitCtor();
}
@@ -399,7 +440,7 @@ sal_Bool SwTxtFrm::IsHiddenNow() const
const bool bHiddenCharsHidePara = GetTxtNode()->HasHiddenCharAttribute( true );
const bool bHiddenParaField = GetTxtNode()->HasHiddenParaField();
- const ViewShell* pVsh = GetShell();
+ const ViewShell* pVsh = getRootFrm()->GetCurrShell();
if ( pVsh && ( bHiddenCharsHidePara || bHiddenParaField ) )
{
@@ -568,7 +609,7 @@ void SwTxtFrm::HideAndShowObjects()
// paragraph is visible, but can contain hidden text portion.
// first we check if objects are allowed to be hidden:
const SwTxtNode& rNode = *GetTxtNode();
- const ViewShell* pVsh = GetShell();
+ const ViewShell* pVsh = getRootFrm()->GetCurrShell();
const bool bShouldBeHidden = !pVsh || !pVsh->GetWin() ||
!pVsh->GetViewOptions()->IsShowHiddenChar();
@@ -860,7 +901,7 @@ void lcl_SetWrong( SwTxtFrm& rFrm, xub_StrLen nPos, long nCnt, bool bMove )
pTxtNode->SetSmartTagDirty( true );
}
- SwRootFrm *pRootFrm = rFrm.FindRootFrm();
+ SwRootFrm *pRootFrm = rFrm.getRootFrm();
if (pRootFrm)
{
pRootFrm->SetNeedGrammarCheck( sal_True );
@@ -904,7 +945,7 @@ void lcl_ModifyOfst( SwTxtFrm* pFrm, xub_StrLen nPos, xub_StrLen nLen )
* SwTxtFrm::Modify()
*************************************************************************/
-void SwTxtFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
+void SwTxtFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
{
const MSHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
@@ -913,7 +954,7 @@ void SwTxtFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
if( IsInRange( aFrmFmtSetRange, nWhich ) || RES_FMT_CHG == nWhich )
{
SwCntntFrm::Modify( pOld, pNew );
- if( nWhich == RES_FMT_CHG && GetShell() )
+ if( nWhich == RES_FMT_CHG && getRootFrm()->GetCurrShell() )
{
// Collection hat sich geaendert
Prepare( PREP_CLEAR );
@@ -1028,9 +1069,10 @@ void SwTxtFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
}
// --> OD 2010-02-16 #i104008#
- if ( GetShell() )
+ ViewShell* pViewSh = getRootFrm() ? getRootFrm()->GetCurrShell() : 0;
+ if ( pViewSh )
{
- GetShell()->InvalidateAccessibleParaAttrs( *this );
+ pViewSh->InvalidateAccessibleParaAttrs( *this );
}
// <--
}
@@ -1238,7 +1280,7 @@ void SwTxtFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
if( nCount )
{
- if( GetShell() )
+ if( getRootFrm()->GetCurrShell() )
{
Prepare( PREP_CLEAR );
_InvalidatePrt();
@@ -1284,9 +1326,10 @@ void SwTxtFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
}
// --> OD 2009-01-06 #i88069#
- if ( GetShell() )
+ ViewShell* pViewSh = getRootFrm() ? getRootFrm()->GetCurrShell() : 0;
+ if ( pViewSh )
{
- GetShell()->InvalidateAccessibleParaAttrs( *this );
+ pViewSh->InvalidateAccessibleParaAttrs( *this );
}
// <--
}
@@ -2269,7 +2312,7 @@ void SwTxtFrm::_CalcHeightOfLastLine( const bool _bUseFont )
const SwTwips mnOldHeightOfLastLine( mnHeightOfLastLine );
// <--
// determine output device
- ViewShell* pVsh = GetShell();
+ ViewShell* pVsh = getRootFrm()->GetCurrShell();
ASSERT( pVsh, "<SwTxtFrm::_GetHeightOfLastLineForPropLineSpacing()> - no ViewShell" );
// --> OD 2007-07-02 #i78921# - make code robust, according to provided patch
// There could be no <ViewShell> instance in the case of loading a binary
@@ -2280,7 +2323,7 @@ void SwTxtFrm::_CalcHeightOfLastLine( const bool _bUseFont )
}
OutputDevice* pOut = pVsh->GetOut();
const IDocumentSettingAccess* pIDSA = GetTxtNode()->getIDocumentSettingAccess();
- if ( !pIDSA->get(IDocumentSettingAccess::BROWSE_MODE) ||
+ if ( !pVsh->GetViewOptions()->getBrowseMode() ||
pVsh->GetViewOptions()->IsPrtFormat() )
{
pOut = GetTxtNode()->getIDocumentDeviceAccess()->getReferenceDevice( true );
@@ -2547,6 +2590,12 @@ void SwTxtFrm::ChgThisLines()
else //Paragraphs which are not counted should not manipulate the AllLines.
nThisLines = nNew;
}
+
+ //mba: invalidating is not necessary; if mongolian script has a problem, it should be fixed at the ritgh place
+ //with invalidating we probably get too much flickering
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ //Ugly. How can we hack if better?
+ //InvalidatePage();
}
@@ -2751,3 +2800,18 @@ void SwTxtFrm::CalcBaseOfstForFly()
mnFlyAnchorOfst = nRet1 - nLeft;
mnFlyAnchorOfstNoWrap = nRet2 - nLeft;
}
+
+/* repaint all text frames of the given text node */
+void SwTxtFrm::repaintTextFrames( const SwTxtNode& rNode )
+{
+ SwIterator<SwTxtFrm,SwTxtNode> aIter( rNode );
+ for( const SwTxtFrm *pFrm = aIter.First(); pFrm; pFrm = aIter.Next() )
+ {
+ SwRect aRec( pFrm->PaintArea() );
+ const SwRootFrm *pRootFrm = pFrm->getRootFrm();
+ ViewShell *pCurShell = pRootFrm ? pRootFrm->GetCurrShell() : NULL;
+ if( pCurShell )
+ pCurShell->InvalidateWindows( aRec );
+ }
+}
+
diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx
index 92911a2a5e..055f283498 100644
--- a/sw/source/core/text/txtftn.cxx
+++ b/sw/source/core/text/txtftn.cxx
@@ -30,6 +30,7 @@
#include "viewsh.hxx"
#include "doc.hxx"
#include "pagefrm.hxx"
+#include "rootfrm.hxx"
#include "ndtxt.hxx"
#include "txtatr.hxx"
#include <SwPortionHandler.hxx>
@@ -692,7 +693,7 @@ void SwTxtFrm::ConnectFtn( SwTxtFtn *pFtn, const SwTwips nDeadLine )
{
if( !pSrcFrm )
{
- SwFtnFrm *pNew = new SwFtnFrm(pDoc->GetDfltFrmFmt(),this,pFtn);
+ SwFtnFrm *pNew = new SwFtnFrm(pDoc->GetDfltFrmFmt(),this,this,pFtn);
SwNodeIndex aIdx( *pFtn->GetStartNode(), 1 );
::_InsertCnt( pNew, pDoc, aIdx.GetIndex() );
GetNode()->getIDocumentLayoutAccess()->GetLayouter()->CollectEndnote( pNew );
@@ -757,7 +758,7 @@ void SwTxtFrm::ConnectFtn( SwTxtFtn *pFtn, const SwTwips nDeadLine )
pBoss->RearrangeFtns( nDeadLine, sal_False, pFtn );
ValidateBodyFrm();
ValidateFrm();
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
if ( pSh && nHeight == (pCont->Frm().*fnRect->fnGetHeight)() )
//Damit uns nix durch die Lappen geht.
pSh->InvalidateWindows( pCont->Frm() );
diff --git a/sw/source/core/text/txtio.cxx b/sw/source/core/text/txtio.cxx
index c7f80c35b0..a911c297b5 100644
--- a/sw/source/core/text/txtio.cxx
+++ b/sw/source/core/text/txtio.cxx
@@ -36,6 +36,7 @@
#include "errhdl.hxx"
#include "txtcfg.hxx"
#include "txtfrm.hxx" // IsDbg()
+#include "rootfrm.hxx"
#include "flyfrms.hxx"
#include "inftxt.hxx"
#include "porexp.hxx"
@@ -283,8 +284,8 @@ SvStream &operator<<( SvStream &rOs, const SwpHints & ) //$ ostream
sal_Bool IsDbg( const SwTxtFrm *pFrm )
{
- if( pFrm && pFrm->GetShell() )
- return pFrm->GetShell()->GetViewOptions()->IsTest4();
+ if( pFrm && pFrm->getRootFrm()->GetCurrShell() )
+ return pFrm->getRootFrm()->GetCurrShell()->GetViewOptions()->IsTest4();
else
return sal_False;
}
diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx
index c1c8514946..9e4d10f170 100644
--- a/sw/source/core/text/txttab.cxx
+++ b/sw/source/core/text/txttab.cxx
@@ -84,7 +84,6 @@ sal_uInt16 SwLineInfo::NumberOfTabStops() const
/*************************************************************************
* SwTxtFormatter::NewTabPortion()
*************************************************************************/
-
SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf, bool bAuto ) const
{
SwTabPortion *pTabPor = 0;
@@ -140,7 +139,12 @@ SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf, bool bAuto )
nLinePos - nTabPos :
nLinePos + nTabPos;
- SwTwips nMyRight = Right();
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ SwTwips nMyRight;
+ if ( pFrm->IsVertLR() )
+ nMyRight = Left();
+ else
+ nMyRight = Right();
if ( pFrm->IsVertical() )
{
@@ -211,63 +215,74 @@ SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf, bool bAuto )
cFill = 0;
eAdj = SVX_TAB_ADJUST_LEFT;
}
- // --> OD 2008-02-07 #newlistlevelattrs#
- long nForced = 0;
- if ( !bTabsRelativeToIndent )
+
+ // --> OD #i115705# - correction and refactoring:
+ // overrule determined next tab stop position in order to apply
+ // a tab stop at the left margin under the following conditions:
+ // - the new tab portion is inside the hanging indent
+ // - a tab stop at the left margin is allowed
+ // - the determined next tab stop is a default tab stop position OR
+ // the determined next tab stop is beyond the left margin
{
- if ( bRTL )
+ long nLeftMarginTabPos = 0;
{
- Point aPoint( Left(), 0 );
- pFrm->SwitchLTRtoRTL( aPoint );
- nForced = pFrm->Frm().Right() - aPoint.X();
+ if ( !bTabsRelativeToIndent )
+ {
+ if ( bRTL )
+ {
+ Point aPoint( Left(), 0 );
+ pFrm->SwitchLTRtoRTL( aPoint );
+ nLeftMarginTabPos = pFrm->Frm().Right() - aPoint.X();
+ }
+ else
+ {
+ nLeftMarginTabPos = Left() - pFrm->Frm().Left();
+ }
+ }
+ if( pCurr->HasForcedLeftMargin() )
+ {
+ SwLinePortion* pPor = pCurr->GetPortion();
+ while( pPor && !pPor->IsFlyPortion() )
+ {
+ pPor = pPor->GetPortion();
+ }
+ if ( pPor )
+ {
+ nLeftMarginTabPos += pPor->Width();
+ }
+ }
}
- else
+ const bool bNewTabPortionInsideHangingIndent =
+ bRTL ? nCurrentAbsPos > nTabLeft - nLeftMarginTabPos
+ : nCurrentAbsPos < nTabLeft + nLeftMarginTabPos;
+ if ( bNewTabPortionInsideHangingIndent )
{
- nForced = Left() - pFrm->Frm().Left();
+ // If the paragraph is not inside a list having a list tab stop following
+ // the list label or no further tab stop found in such a paragraph or
+ // the next tab stop position does not equal the list tab stop,
+ // a tab stop at the left margin can be applied. If this condition is
+ // not hold, it is overruled by compatibility option TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST.
+ const bool bTabAtLeftMarginAllowed =
+ ( !aLineInf.IsListTabStopIncluded() ||
+ !pTabStop ||
+ nNextPos != aLineInf.GetListTabStopPosition() ) ||
+ // compatibility option TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST:
+ pFrm->GetTxtNode()->getIDocumentSettingAccess()->
+ get(IDocumentSettingAccess::TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST);
+ if ( bTabAtLeftMarginAllowed )
+ {
+ if ( !pTabStop || eAdj == SVX_TAB_ADJUST_DEFAULT ||
+ ( nNextPos > nLeftMarginTabPos ) )
+ {
+ eAdj = SVX_TAB_ADJUST_DEFAULT;
+ cFill = 0;
+ nNextPos = nLeftMarginTabPos;
+ }
+ }
}
}
- if( pCurr->HasForcedLeftMargin() )
- {
- SwLinePortion* pPor = pCurr->GetPortion();
- while( pPor && !pPor->IsFlyPortion() )
- pPor = pPor->GetPortion();
- if( pPor )
- nForced += pPor->Width();
- }
-
- // <--
- // --> OD 2009-04-03 #i100732#
- // correction of condition, when a tab stop at the left margin can
- // be applied:
- // If the paragraph is not inside a list having a list tab stop following
- // the list label or no further tab stop found in such a paragraph or
- // the next tab stop position does not equal the list tab stop,
- // a tab stop at the left margin can be applied. If this condition is
- // not hold, it is overruled by compatibility option TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST.
- const bool bTabAtLeftMargin =
- ( !aLineInf.IsListTabStopIncluded() ||
- !pTabStop ||
- nNextPos != aLineInf.GetListTabStopPosition() ) ||
- // compatibility option TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST:
- pFrm->GetTxtNode()->getIDocumentSettingAccess()->
- get(IDocumentSettingAccess::TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST);
- if ( bTabAtLeftMargin &&
- // <--
- ( ( bRTL && nCurrentAbsPos > nTabLeft - nForced ) ||
- ( !bRTL && nCurrentAbsPos < nTabLeft + nForced ) ) &&
- // --> OD 2009-07-21 #i103685#
- // adjust condition:
- // - back to pre OOo 3.0 condition, if tab stops are relative to indent
- // - further checks needed, if tab stops are not relative to indent
- ( nNextPos > 0 &&
- ( bTabsRelativeToIndent ||
- ( !pTabStop || nNextPos > nForced ) ) ) )
- // <--
- {
- eAdj = SVX_TAB_ADJUST_DEFAULT;
- cFill = 0;
- nNextPos = nForced;
- }
+ // <--
+
nNextPos += bRTL ? nLinePos - nTabLeft : nTabLeft - nLinePos;
ASSERT( nNextPos >= 0, "GetTabStop: Don't go back!" );
nNewTabPos = KSHORT(nNextPos);
diff --git a/sw/source/core/text/widorp.cxx b/sw/source/core/text/widorp.cxx
index 9869ba7583..b89f364971 100644
--- a/sw/source/core/text/widorp.cxx
+++ b/sw/source/core/text/widorp.cxx
@@ -222,9 +222,17 @@ void SwTxtFrmBreak::SetRstHeight( const SwTxtMargin &rLine )
{
// OD, FME 2004-02-27 #106629# - consider bottom margin
SWRECTFN( pFrm )
+
nRstHeight = (pFrm->*fnRect->fnGetBottomMargin)();
+
if ( bVert )
- nRstHeight += nOrigin - pFrm->SwitchHorizontalToVertical( rLine.Y() );
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ {
+ if ( pFrm->IsVertLR() )
+ nRstHeight = (*fnRect->fnYDiff)( pFrm->SwitchHorizontalToVertical( rLine.Y() ) , nOrigin );
+ else
+ nRstHeight += nOrigin - pFrm->SwitchHorizontalToVertical( rLine.Y() );
+ }
else
nRstHeight += rLine.Y() - nOrigin;
}
diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx
index 4377dfbdde..4caa9fd786 100644
--- a/sw/source/core/tox/tox.cxx
+++ b/sw/source/core/tox/tox.cxx
@@ -28,9 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-
-
#include <tools/resid.hxx>
#include <hintids.hxx>
#include <swtypes.hxx>
@@ -39,22 +36,18 @@
#include <ndtxt.hxx>
#include <txttxmrk.hxx>
#include <tox.hxx>
-#ifndef _POOLFMT_HRC
#include <poolfmt.hrc>
-#endif
#include <doc.hxx>
#include <docary.hxx>
#include <paratr.hxx>
#include <editeng/tstpitem.hxx>
#include <SwStyleNameMapper.hxx>
#include <hints.hxx> // SwPtrMsgPoolItem
-
-// -> #i21237#
#include <algorithm>
#include <functional>
+#include <switerator.hxx>
using namespace std;
-// <- #i21237#
const sal_Char* SwForm::aFormEntry = "<E>";
const sal_Char* SwForm::aFormTab = "<T>";
@@ -81,9 +74,6 @@ SV_IMPL_PTRARR(SwTOXMarks, SwTOXMark*)
TYPEINIT2( SwTOXMark, SfxPoolItem, SwClient ); // fuers rtti
-/* -----------------23.09.99 13:59-------------------
-
- --------------------------------------------------*/
struct PatternIni
{
sal_uInt16 n1;
@@ -126,14 +116,10 @@ const PatternIni aPatternIni[] =
{AUTH_FIELD_AUTHOR, AUTH_FIELD_TITLE, AUTH_FIELD_YEAR, USHRT_MAX, USHRT_MAX}, //AUTH_FIELD_CUSTOM5,
{USHRT_MAX, USHRT_MAX, USHRT_MAX, USHRT_MAX, USHRT_MAX}
};
-/* -----------------23.09.99 13:58-------------------
- --------------------------------------------------*/
-// -> #i21237#
SwFormTokens lcl_GetAuthPattern(sal_uInt16 nTypeId)
{
- SwFormTokens aRet; // #i21237#
-
+ SwFormTokens aRet;
PatternIni aIni = aPatternIni[nTypeId];
sal_uInt16 nVals[5];
@@ -199,7 +185,7 @@ SwTOXMark::SwTOXMark( const SwTOXType* pTyp )
SwTOXMark::SwTOXMark( const SwTOXMark& rCopy )
: SfxPoolItem( RES_TXTATR_TOXMARK )
- , SwModify(rCopy.pRegisteredIn)
+ , SwModify(rCopy.GetRegisteredInNonConst())
,
aPrimaryKey( rCopy.aPrimaryKey ), aSecondaryKey( rCopy.aSecondaryKey ),
aTextReading( rCopy.aTextReading ),
@@ -219,6 +205,11 @@ SwTOXMark::~SwTOXMark()
}
+void SwTOXMark::RegisterToTOXType( SwTOXType& rMark )
+{
+ rMark.Add(this);
+}
+
int SwTOXMark::operator==( const SfxPoolItem& rAttr ) const
{
ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
@@ -231,9 +222,9 @@ SfxPoolItem* SwTOXMark::Clone( SfxItemPool* ) const
return new SwTOXMark( *this );
}
-void SwTOXMark::Modify(SfxPoolItem* pOld, SfxPoolItem* pNew)
+void SwTOXMark::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
SetXTOXMark(::com::sun::star::uno::Reference<
@@ -245,7 +236,7 @@ void SwTOXMark::InvalidateTOXMark()
{
SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT,
&static_cast<SwModify&>(*this) ); // cast to base class!
- Modify(&aMsgHint, &aMsgHint);
+ NotifyClients(&aMsgHint, &aMsgHint);
}
String SwTOXMark::GetText() const
@@ -266,6 +257,18 @@ String SwTOXMark::GetText() const
return aStr;
}
+void SwTOXMark::InsertTOXMarks( SwTOXMarks& aMarks, const SwTOXType& rType )
+{
+ SwIterator<SwTOXMark,SwTOXType> aIter(rType);
+ SwTOXMark* pMark = aIter.First();
+ while( pMark )
+ {
+ if(pMark->GetTxtTOXMark())
+ aMarks.C40_INSERT(SwTOXMark, pMark, aMarks.Count());
+ pMark = aIter.Next();
+ }
+}
+
/*--------------------------------------------------------------------
Beschreibung: Typen von Verzeichnissen verwalten
--------------------------------------------------------------------*/
@@ -528,11 +531,16 @@ SwTOXBase::SwTOXBase(const SwTOXType* pTyp, const SwForm& rForm,
SwTOXBase::SwTOXBase( const SwTOXBase& rSource, SwDoc* pDoc )
- : SwClient( rSource.pRegisteredIn )
+ : SwClient( rSource.GetRegisteredInNonConst() )
{
CopyTOXBase( pDoc, rSource );
}
+void SwTOXBase::RegisterToTOXType( SwTOXType& rType )
+{
+ rType.Add( this );
+}
+
SwTOXBase& SwTOXBase::CopyTOXBase( SwDoc* pDoc, const SwTOXBase& rSource )
{
SwTOXType* pType = (SwTOXType*)rSource.GetTOXType();
diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx
index 31a87b3504..340bc1ab91 100644
--- a/sw/source/core/tox/txmsrt.cxx
+++ b/sw/source/core/tox/txmsrt.cxx
@@ -181,7 +181,7 @@ SwTOXSortTabBase::SwTOXSortTabBase( TOXSortType nTyp, const SwCntntNode* pNd,
{
// dann die "Anker" (Body) Position holen.
Point aPt;
- const SwCntntFrm* pFrm = pNd->GetFrm( &aPt, 0, sal_False );
+ const SwCntntFrm* pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), &aPt, 0, sal_False );
if( pFrm )
{
SwPosition aPos( *pNd );
diff --git a/sw/source/core/txtnode/SwGrammarContact.cxx b/sw/source/core/txtnode/SwGrammarContact.cxx
index 41b494cfbf..e1f15f83a9 100644
--- a/sw/source/core/txtnode/SwGrammarContact.cxx
+++ b/sw/source/core/txtnode/SwGrammarContact.cxx
@@ -38,9 +38,6 @@
#include <rootfrm.hxx>
#include <viewsh.hxx>
-extern void repaintTextFrames( SwModify& rModify );
-
-
/* SwGrammarContact
This class is responsible for the delayed display of grammar checks when a paragraph is edited
It's a client of the paragraph the cursor points to.
@@ -58,7 +55,7 @@ class SwGrammarContact : public IGrammarContact, public SwClient
Timer aTimer;
SwGrammarMarkUp *mpProxyList;
bool mbFinished;
- SwTxtNode* getMyTxtNode() { return (SwTxtNode*)pRegisteredIn; }
+ SwTxtNode* getMyTxtNode() { return (SwTxtNode*)GetRegisteredIn(); }
DECL_LINK( TimerRepaint, Timer * );
public:
@@ -69,9 +66,9 @@ public:
virtual void updateCursorPosition( const SwPosition& rNewPos );
virtual SwGrammarMarkUp* getGrammarCheck( SwTxtNode& rTxtNode, bool bCreate );
virtual void finishGrammarCheck( SwTxtNode& rTxtNode );
-
+protected:
// virtual function of SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
};
SwGrammarContact::SwGrammarContact() : mpProxyList(0), mbFinished( false )
@@ -85,11 +82,11 @@ IMPL_LINK( SwGrammarContact, TimerRepaint, Timer *, pTimer )
if( pTimer )
{
pTimer->Stop();
- if( pRegisteredIn )
+ if( GetRegisteredIn() )
{ //Replace the old wrong list by the proxy list and repaint all frames
getMyTxtNode()->SetGrammarCheck( mpProxyList, true );
mpProxyList = 0;
- repaintTextFrames( *pRegisteredIn );
+ SwTxtFrm::repaintTextFrames( *getMyTxtNode() );
}
}
return 0;
@@ -107,9 +104,9 @@ void SwGrammarContact::updateCursorPosition( const SwPosition& rNewPos )
if( mpProxyList )
{ // replace old list by the proxy list and repaint
getMyTxtNode()->SetGrammarCheck( mpProxyList, true );
- repaintTextFrames( *pRegisteredIn );
+ SwTxtFrm::repaintTextFrames( *getMyTxtNode() );
}
- pRegisteredIn->Remove( this ); // good bye old paragraph
+ GetRegisteredInNonConst()->Remove( this ); // good bye old paragraph
mpProxyList = 0;
}
if( pTxtNode )
@@ -158,16 +155,16 @@ SwGrammarMarkUp* SwGrammarContact::getGrammarCheck( SwTxtNode& rTxtNode, bool bC
return pRet;
}
-void SwGrammarContact::Modify( SfxPoolItem *pOld, SfxPoolItem * )
+void SwGrammarContact::Modify( const SfxPoolItem* pOld, const SfxPoolItem * )
{
if( !pOld || pOld->Which() != RES_OBJECTDYING )
return;
SwPtrMsgPoolItem *pDead = (SwPtrMsgPoolItem *)pOld;
- if( pDead->pObject == pRegisteredIn )
+ if( pDead->pObject == GetRegisteredIn() )
{ // if my current paragraph dies, I throw the proxy list away
aTimer.Stop();
- pRegisteredIn->Remove( this );
+ GetRegisteredInNonConst()->Remove( this );
delete mpProxyList;
mpProxyList = 0;
}
@@ -175,8 +172,8 @@ void SwGrammarContact::Modify( SfxPoolItem *pOld, SfxPoolItem * )
void SwGrammarContact::finishGrammarCheck( SwTxtNode& rTxtNode )
{
- if( &rTxtNode != pRegisteredIn ) // not my paragraph
- repaintTextFrames( rTxtNode ); // can be repainted directly
+ if( &rTxtNode != GetRegisteredIn() ) // not my paragraph
+ SwTxtFrm::repaintTextFrames( rTxtNode ); // can be repainted directly
else
{
if( mpProxyList )
@@ -187,7 +184,7 @@ void SwGrammarContact::finishGrammarCheck( SwTxtNode& rTxtNode )
else if( getMyTxtNode()->GetGrammarCheck() )
{ // all grammar problems seems to be gone, no delay needed
getMyTxtNode()->SetGrammarCheck( 0, true );
- repaintTextFrames( *pRegisteredIn );
+ SwTxtFrm::repaintTextFrames( *getMyTxtNode() );
}
}
}
@@ -197,21 +194,6 @@ IGrammarContact* createGrammarContact()
return new SwGrammarContact();
}
-/* repaint all text frames of the given text node */
-void repaintTextFrames( SwModify& rModify )
-{
- SwClientIter aIter( rModify );
- for( const SwTxtFrm *pFrm = (const SwTxtFrm*)aIter.First( TYPE(SwTxtFrm) );
- pFrm; pFrm = (const SwTxtFrm*)aIter.Next() )
- {
- SwRect aRec( pFrm->PaintArea() );
- const SwRootFrm *pRootFrm = pFrm->FindRootFrm();
- ViewShell *pCurShell = pRootFrm ? pRootFrm->GetCurrShell() : NULL;
- if( pCurShell )
- pCurShell->InvalidateWindows( aRec );
- }
-}
-
void finishGrammarCheck( SwTxtNode& rTxtNode )
{
IGrammarContact* pGrammarContact = getGrammarContact( rTxtNode );
diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx
index 8de07030e6..2e8ab1c12e 100644
--- a/sw/source/core/txtnode/atrfld.cxx
+++ b/sw/source/core/txtnode/atrfld.cxx
@@ -43,7 +43,7 @@
#include "calc.hxx" // Update fuer UserFields
#include "hints.hxx"
#include <IDocumentFieldsAccess.hxx>
-
+#include <fieldhint.hxx>
#include <svl/smplhint.hxx>
TYPEINIT3( SwFmtFld, SfxPoolItem, SwClient,SfxBroadcaster)
@@ -126,6 +126,12 @@ SwFmtFld::~SwFmtFld()
}
}
+void SwFmtFld::RegisterToFieldType( SwFieldType& rType )
+{
+ rType.Add(this);
+}
+
+
// #111840#
void SwFmtFld::SetFld(SwField * _pField)
{
@@ -153,7 +159,30 @@ SfxPoolItem* SwFmtFld::Clone( SfxItemPool* ) const
return new SwFmtFld( *this );
}
-void SwFmtFld::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwFmtFld::SwClientNotify( const SwModify&, const SfxHint& rHint )
+{
+ if( !pTxtAttr )
+ return;
+
+ const SwFieldHint* pHint = dynamic_cast<const SwFieldHint*>( &rHint );
+ if ( pHint )
+ {
+ // replace field content by text
+ SwPaM* pPaM = pHint->GetPaM();
+ SwDoc* pDoc = pPaM->GetDoc();
+ const SwTxtNode& rTxtNode = pTxtAttr->GetTxtNode();
+ pPaM->GetPoint()->nNode = rTxtNode;
+ pPaM->GetPoint()->nContent.Assign( (SwTxtNode*)&rTxtNode, *pTxtAttr->GetStart() );
+
+ String const aEntry( GetFld()->ExpandField( pDoc->IsClipBoard() ) );
+ pPaM->SetMark();
+ pPaM->Move( fnMoveForward );
+ pDoc->DeleteRange( *pPaM );
+ pDoc->InsertString( *pPaM, aEntry );
+ }
+}
+
+void SwFmtFld::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
if( !pTxtAttr )
return;
@@ -171,7 +200,7 @@ void SwFmtFld::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
case RES_TXTATR_FLDCHG:
// "Farbe hat sich geaendert !"
// this, this fuer "nur Painten"
- pTxtNd->Modify( this, this );
+ pTxtNd->ModifyNotification( this, this );
return;
case RES_REFMARKFLD_UPDATE:
// GetReferenz-Felder aktualisieren
@@ -185,12 +214,12 @@ void SwFmtFld::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
break;
case RES_DOCPOS_UPDATE:
// Je nach DocPos aktualisieren (SwTxtFrm::Modify())
- pTxtNd->Modify( pNew, this );
+ pTxtNd->ModifyNotification( pNew, this );
return;
case RES_ATTRSET_CHG:
case RES_FMT_CHG:
- pTxtNd->Modify( pOld, pNew );
+ pTxtNd->ModifyNotification( pOld, pNew );
return;
default:
break;
@@ -206,7 +235,7 @@ void SwFmtFld::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
case RES_DBNUMSETFLD:
case RES_DBNEXTSETFLD:
case RES_DBNAMEFLD:
- pTxtNd->Modify( 0, pNew);
+ pTxtNd->ModifyNotification( 0, pNew);
return;
}
@@ -314,7 +343,7 @@ void SwTxtFld::Expand() const
// aenderung an die Frames posten
if( m_pTxtNode->CalcHiddenParaField() )
{
- m_pTxtNode->Modify( 0, 0 );
+ m_pTxtNode->ModifyNotification( 0, 0 );
}
return;
}
@@ -323,7 +352,7 @@ void SwTxtFld::Expand() const
m_aExpand = aNewExpand;
// 0, this for formatting
- m_pTxtNode->Modify( 0, const_cast<SwFmtFld*>( &GetFld() ) );
+ m_pTxtNode->ModifyNotification( 0, const_cast<SwFmtFld*>( &GetFld() ) );
}
/*************************************************************************
@@ -393,7 +422,7 @@ void SwTxtFld::NotifyContentChange(SwFmtFld& rFmtFld)
//if not in undo section notify the change
if (m_pTxtNode && m_pTxtNode->GetNodes().IsDocNodes())
{
- m_pTxtNode->Modify(0, &rFmtFld);
+ m_pTxtNode->ModifyNotification(0, &rFmtFld);
}
}
diff --git a/sw/source/core/txtnode/atrflyin.cxx b/sw/source/core/txtnode/atrflyin.cxx
index a6ccfb3daa..15012596d6 100644
--- a/sw/source/core/txtnode/atrflyin.cxx
+++ b/sw/source/core/txtnode/atrflyin.cxx
@@ -42,9 +42,8 @@
#include "swfont.hxx"
#include "txtfrm.hxx"
#include "flyfrms.hxx"
-// --> OD 2004-11-09 #i26945#
#include <objectformatter.hxx>
-// <--
+#include <switerator.hxx>
SwFmtFlyCnt::SwFmtFlyCnt( SwFrmFmt *pFrmFmt )
: SfxPoolItem( RES_TXTATR_FLYCNT ),
@@ -232,17 +231,15 @@ SwFlyInCntFrm *SwTxtFlyCnt::_GetFlyFrm( const SwFrm *pCurrFrm )
return NULL;
}
- SwClientIter aIter( *GetFlyCnt().pFmt );
+ SwIterator<SwFlyFrm,SwFmt> aIter( *GetFlyCnt().pFmt );
ASSERT( pCurrFrm->IsTxtFrm(), "SwTxtFlyCnt::_GetFlyFrm for TxtFrms only." );
-
- if( aIter.GoStart() )
+ SwFrm* pFrm = aIter.First();
+ if ( pFrm )
{
SwTxtFrm *pFirst = (SwTxtFrm*)pCurrFrm;
while ( pFirst->IsFollow() )
pFirst = pFirst->FindMaster();
do
- { SwFrm * pFrm = PTR_CAST( SwFrm, aIter() );
- if ( pFrm )
{
SwTxtFrm *pTmp = pFirst;
do
@@ -257,8 +254,10 @@ SwFlyInCntFrm *SwTxtFlyCnt::_GetFlyFrm( const SwFrm *pCurrFrm )
}
pTmp = pTmp->GetFollow();
} while ( pTmp );
- }
- } while( aIter++ );
+
+ pFrm = aIter.Next();
+
+ } while( pFrm );
}
// Wir haben keinen passenden FlyFrm gefunden, deswegen wird ein
@@ -266,8 +265,9 @@ SwFlyInCntFrm *SwTxtFlyCnt::_GetFlyFrm( const SwFrm *pCurrFrm )
// Dabei wird eine sofortige Neuformatierung von pCurrFrm angestossen.
// Die Rekursion wird durch den Lockmechanismus in SwTxtFrm::Format()
// abgewuergt.
- SwFlyInCntFrm *pFly = new SwFlyInCntFrm( (SwFlyFrmFmt*)pFrmFmt, (SwFrm*)pCurrFrm );
- ((SwFrm*)pCurrFrm)->AppendFly( pFly );
+ SwFrm* pCurrFrame = const_cast< SwFrm* >(pCurrFrm);
+ SwFlyInCntFrm *pFly = new SwFlyInCntFrm( (SwFlyFrmFmt*)pFrmFmt, pCurrFrame, pCurrFrame );
+ pCurrFrame->AppendFly( pFly );
pFly->RegistFlys();
// 7922: Wir muessen dafuer sorgen, dass der Inhalt des FlyInCnt
diff --git a/sw/source/core/txtnode/atrftn.cxx b/sw/source/core/txtnode/atrftn.cxx
index 7445d6f767..40fcbdf1ad 100644
--- a/sw/source/core/txtnode/atrftn.cxx
+++ b/sw/source/core/txtnode/atrftn.cxx
@@ -47,15 +47,12 @@
#include <ndindex.hxx>
#include <fmtftntx.hxx>
#include <section.hxx>
+#include <switerator.hxx>
/*************************************************************************
|*
|* class SwFmtFtn
|*
-|* Beschreibung
-|* Ersterstellung JP 09.08.94
-|* Letzte Aenderung JP 08.08.94
-|*
*************************************************************************/
@@ -92,7 +89,7 @@ void SwFmtFtn::SetEndNote( bool b )
{
if ( GetTxtFtn() )
{
- GetTxtFtn()->DelFrms();
+ GetTxtFtn()->DelFrms(0);
}
m_bEndNote = b;
}
@@ -238,7 +235,7 @@ void SwTxtFtn::SetStartNode( const SwNodeIndex *pNewNode, sal_Bool bDelNode )
// Werden die Nodes nicht geloescht mussen sie bei den Seiten
// abmeldet (Frms loeschen) werden, denn sonst bleiben sie
// stehen (Undo loescht sie nicht!)
- DelFrms();
+ DelFrms( 0 );
}
DELETEZ( m_pStartNode );
@@ -272,7 +269,7 @@ void SwTxtFtn::SetNumber( const sal_uInt16 nNewNum, const XubString* pStr )
ASSERT( m_pTxtNode, "SwTxtFtn: where is my TxtNode?" );
SwNodes &rNodes = m_pTxtNode->GetDoc()->GetNodes();
- m_pTxtNode->Modify( 0, &rFtn );
+ m_pTxtNode->ModifyNotification( 0, &rFtn );
if ( m_pStartNode )
{
// must iterate over all TxtNodes because of footnotes on other pages
@@ -283,7 +280,7 @@ void SwTxtFtn::SetNumber( const sal_uInt16 nNewNum, const XubString* pStr )
{
// Es koennen ja auch Grafiken in der Fussnote stehen ...
if( ( pNd = rNodes[ nSttIdx ] )->IsTxtNode() )
- ((SwTxtNode*)pNd)->Modify( 0, &rFtn );
+ ((SwTxtNode*)pNd)->ModifyNotification( 0, &rFtn );
}
}
}
@@ -362,19 +359,21 @@ void SwTxtFtn::MakeNewTextSection( SwNodes& rNodes )
}
-void SwTxtFtn::DelFrms()
+void SwTxtFtn::DelFrms( const SwFrm* pSib )
{
// delete the FtnFrames from the pages
ASSERT( m_pTxtNode, "SwTxtFtn: where is my TxtNode?" );
if ( !m_pTxtNode )
return;
+ const SwRootFrm* pRoot = pSib ? pSib->getRootFrm() : 0;
sal_Bool bFrmFnd = sal_False;
{
- SwClientIter aIter( *m_pTxtNode );
- for( SwCntntFrm* pFnd = (SwCntntFrm*)aIter.First( TYPE( SwCntntFrm ));
- pFnd; pFnd = (SwCntntFrm*)aIter.Next() )
+ SwIterator<SwCntntFrm,SwTxtNode> aIter( *m_pTxtNode );
+ for( SwCntntFrm* pFnd = aIter.First(); pFnd; pFnd = aIter.Next() )
{
+ if( pRoot != pFnd->getRootFrm() && pRoot )
+ continue;
SwPageFrm* pPage = pFnd->FindPageFrm();
if( pPage )
{
@@ -391,10 +390,11 @@ void SwTxtFtn::DelFrms()
SwCntntNode* pCNd = m_pTxtNode->GetNodes().GoNext( &aIdx );
if( pCNd )
{
- SwClientIter aIter( *pCNd );
- for( SwCntntFrm* pFnd = (SwCntntFrm*)aIter.First( TYPE( SwCntntFrm ));
- pFnd; pFnd = (SwCntntFrm*)aIter.Next() )
+ SwIterator<SwCntntFrm,SwCntntNode> aIter( *pCNd );
+ for( SwCntntFrm* pFnd = aIter.First(); pFnd; pFnd = aIter.Next() )
{
+ if( pRoot != pFnd->getRootFrm() && pRoot )
+ continue;
SwPageFrm* pPage = pFnd->FindPageFrm();
SwFrm *pFrm = pFnd->GetUpper();
diff --git a/sw/source/core/txtnode/atrref.cxx b/sw/source/core/txtnode/atrref.cxx
index 556ad0374c..89a5c65941 100644
--- a/sw/source/core/txtnode/atrref.cxx
+++ b/sw/source/core/txtnode/atrref.cxx
@@ -77,7 +77,7 @@ SfxPoolItem* SwFmtRefMark::Clone( SfxItemPool* ) const
// Attribut fuer Inhalts-/Positions-Referenzen im Text
SwTxtRefMark::SwTxtRefMark( SwFmtRefMark& rAttr,
- xub_StrLen nStartPos, xub_StrLen* pEnd )
+ xub_StrLen const nStartPos, xub_StrLen const*const pEnd)
: SwTxtAttrEnd( rAttr, nStartPos, nStartPos )
, m_pTxtNode( 0 )
, m_pEnd( 0 )
diff --git a/sw/source/core/txtnode/atrtox.cxx b/sw/source/core/txtnode/atrtox.cxx
index 58c16c05b9..ebd274b2e2 100644
--- a/sw/source/core/txtnode/atrtox.cxx
+++ b/sw/source/core/txtnode/atrtox.cxx
@@ -36,7 +36,7 @@
#include <ndtxt.hxx>
SwTxtTOXMark::SwTxtTOXMark( SwTOXMark& rAttr,
- xub_StrLen nStartPos, xub_StrLen* pEnd )
+ xub_StrLen const nStartPos, xub_StrLen const*const pEnd)
: SwTxtAttrEnd( rAttr, nStartPos, nStartPos )
, m_pTxtNode( 0 )
, m_pEnd( 0 )
diff --git a/sw/source/core/txtnode/fmtatr2.cxx b/sw/source/core/txtnode/fmtatr2.cxx
index b839918cd9..15e9721527 100644
--- a/sw/source/core/txtnode/fmtatr2.cxx
+++ b/sw/source/core/txtnode/fmtatr2.cxx
@@ -114,10 +114,10 @@ SfxPoolItem* SwFmtCharFmt::Clone( SfxItemPool* ) const
// weiterleiten an das TextAttribut
-void SwFmtCharFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwFmtCharFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
if( pTxtAttr )
- pTxtAttr->Modify( pOld, pNew );
+ pTxtAttr->ModifyNotification( pOld, pNew );
}
@@ -613,6 +613,7 @@ SwFmtMeta::~SwFmtMeta()
{
if (m_pMeta && (m_pMeta->GetFmtMeta() == this))
{
+ NotifyChangeTxtNode(0);
m_pMeta->SetFmtMeta(0);
}
}
@@ -633,16 +634,24 @@ SfxPoolItem * SwFmtMeta::Clone( SfxItemPool * /*pPool*/ ) const
void SwFmtMeta::SetTxtAttr(SwTxtMeta * const i_pTxtAttr)
{
- ASSERT(!(m_pTxtAttr && i_pTxtAttr),
+ OSL_ENSURE(!(m_pTxtAttr && i_pTxtAttr),
"SwFmtMeta::SetTxtAttr: already has text attribute?");
- ASSERT( m_pTxtAttr || i_pTxtAttr ,
+ OSL_ENSURE( m_pTxtAttr || i_pTxtAttr ,
"SwFmtMeta::SetTxtAttr: no attribute to remove?");
m_pTxtAttr = i_pTxtAttr;
- ASSERT(m_pMeta, "inserted SwFmtMeta has no sw::Meta?");
+ OSL_ENSURE(m_pMeta, "inserted SwFmtMeta has no sw::Meta?");
// the sw::Meta must be able to find the current text attribute!
- if (i_pTxtAttr && m_pMeta)
+ if (m_pMeta)
{
- m_pMeta->SetFmtMeta(this);
+ if (i_pTxtAttr)
+ {
+ m_pMeta->SetFmtMeta(this);
+ }
+ else if (m_pMeta->GetFmtMeta() == this)
+ { // text attribute gone => de-register from text node!
+ NotifyChangeTxtNode(0);
+ m_pMeta->SetFmtMeta(0);
+ }
}
}
@@ -650,36 +659,22 @@ void SwFmtMeta::NotifyChangeTxtNode(SwTxtNode *const pTxtNode)
{
// N.B.: do not reset m_pTxtAttr here: see call in nodes.cxx,
// where the hint is not deleted!
- ASSERT(m_pMeta, "NotifyRemoval: no meta ?");
- if (m_pMeta)
- {
- if (!pTxtNode)
- {
- SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT,
- &static_cast<SwModify&>(*m_pMeta) ); // cast to base class!
- m_pMeta->Modify(&aMsgHint, &aMsgHint);
- }
- else
- { // do not call Modify, that would call SwXMeta::Modify!
- m_pMeta->NotifyChangeTxtNode();
- }
+ OSL_ENSURE(m_pMeta, "SwFmtMeta::NotifyChangeTxtNode: no Meta?");
+ if (m_pMeta && (m_pMeta->GetFmtMeta() == this))
+ { // do not call Modify, that would call SwXMeta::Modify!
+ m_pMeta->NotifyChangeTxtNode(pTxtNode);
}
}
-// UGLY: this really awful method fixes up an inconsistent state,
-// and if it is not called when copying, total chaos will undoubtedly ensue
-void SwFmtMeta::DoCopy(SwFmtMeta & rOriginalMeta)
+// this SwFmtMeta has been cloned and points at the same sw::Meta as the source
+// this method copies the sw::Meta
+void SwFmtMeta::DoCopy(::sw::MetaFieldManager & i_rTargetDocManager,
+ SwTxtNode & i_rTargetTxtNode)
{
- ASSERT(m_pMeta, "DoCopy called for SwFmtMeta with no sw::Meta?");
+ OSL_ENSURE(m_pMeta, "DoCopy called for SwFmtMeta with no sw::Meta?");
if (m_pMeta)
{
const ::boost::shared_ptr< ::sw::Meta> pOriginal( m_pMeta );
- // UGLY: original sw::Meta now points at _this_ due to being already
- // inserted via MakeTxtAttr! so fix it up to point at the original item
- // (maybe would be better to tell MakeTxtAttr that it creates a copy?)
- pOriginal->SetFmtMeta(&rOriginalMeta);
- // force pOriginal to register in original text node!
- pOriginal->NotifyChangeTxtNode();
if (RES_TXTATR_META == Which())
{
m_pMeta.reset( new ::sw::Meta(this) );
@@ -688,14 +683,13 @@ void SwFmtMeta::DoCopy(SwFmtMeta & rOriginalMeta)
{
::sw::MetaField *const pMetaField(
static_cast< ::sw::MetaField* >(pOriginal.get()));
- SwDoc * const pTargetDoc( GetTxtAttr()->GetTxtNode()->GetDoc() );
- m_pMeta = pTargetDoc->GetMetaFieldManager().makeMetaField( this,
+ m_pMeta = i_rTargetDocManager.makeMetaField( this,
pMetaField->m_nNumberFormat, pMetaField->IsFixedLanguage() );
}
+ // Meta must have a text node before calling RegisterAsCopyOf
+ m_pMeta->NotifyChangeTxtNode(& i_rTargetTxtNode);
// this cannot be done in Clone: a Clone is not necessarily a copy!
m_pMeta->RegisterAsCopyOf(*pOriginal);
- // force copy Meta to register in target text node!
- m_pMeta->NotifyChangeTxtNode();
}
}
@@ -724,35 +718,44 @@ SwTxtMeta * Meta::GetTxtAttr() const
SwTxtNode * Meta::GetTxtNode() const
{
- SwTxtMeta * const pTxtAttr( GetTxtAttr() );
- return (pTxtAttr) ? pTxtAttr->GetTxtNode() : 0;
+ return m_pTxtNode;
}
-void Meta::NotifyChangeTxtNode()
+void Meta::NotifyChangeTxtNodeImpl()
{
- SwTxtNode * const pTxtNode( GetTxtNode() );
- if (pTxtNode && (GetRegisteredIn() != pTxtNode))
+ if (m_pTxtNode && (GetRegisteredIn() != m_pTxtNode))
{
- pTxtNode->Add(this);
+ m_pTxtNode->Add(this);
}
- else if (!pTxtNode && GetRegisteredIn())
+ else if (!m_pTxtNode && GetRegisteredIn())
{
- const_cast<SwModify *>(GetRegisteredIn())->Remove(this);
+ GetRegisteredInNonConst()->Remove(this);
+ }
+}
+
+void Meta::NotifyChangeTxtNode(SwTxtNode *const pTxtNode)
+{
+ m_pTxtNode = pTxtNode;
+ NotifyChangeTxtNodeImpl();
+ if (!pTxtNode) // text node gone? invalidate UNO object!
+ {
+ SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT,
+ &static_cast<SwModify&>(*this) ); // cast to base class!
+ this->Modify(&aMsgHint, &aMsgHint);
}
}
// SwClient
-void Meta::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
+void Meta::Modify( const SfxPoolItem *pOld, const SfxPoolItem *pNew )
{
- NotifyChangeTxtNode();
- SwModify::Modify(pOld, pNew);
+ NotifyClients(pOld, pNew);
if (pOld && (RES_REMOVE_UNO_OBJECT == pOld->Which()))
{ // invalidate cached uno object
SetXMeta(uno::Reference<rdf::XMetadatable>(0));
}
}
-// sw::Metadatable
+// sfx2::Metadatable
::sfx2::IXmlIdRegistry& Meta::GetRegistry()
{
SwTxtNode * const pTxtNode( GetTxtNode() );
@@ -906,3 +909,4 @@ MetaFieldManager::getMetaFields()
} // namespace sw
+
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index 6c32f2b934..9ba290dd74 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -417,7 +417,7 @@ sal_uInt16 SwFntObj::GetFontLeading( const ViewShell *pSh, const OutputDevice& r
const IDocumentSettingAccess& rIDSA = *pSh->getIDocumentSettingAccess();
const bool bBrowse = ( pSh->GetWin() &&
- rIDSA.get(IDocumentSettingAccess::BROWSE_MODE) &&
+ pSh->GetViewOptions()->getBrowseMode() &&
!pSh->GetViewOptions()->IsPrtFormat() );
if ( !bBrowse && rIDSA.get(IDocumentSettingAccess::ADD_EXT_LEADING) )
@@ -459,7 +459,7 @@ void SwFntObj::CreateScrFont( const ViewShell& rSh, const OutputDevice& rOut )
OutputDevice* pPrt = &rSh.GetRefDev();
if( !rSh.GetWin() ||
- !rSh.getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ||
+ !rSh.GetViewOptions()->getBrowseMode() ||
rSh.GetViewOptions()->IsPrtFormat() )
{
// After CreatePrtFont pPrtFont is the font which is actually used
@@ -832,13 +832,12 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
OutputDevice& rRefDev = rInf.GetShell()->GetRefDev();
OutputDevice* pWin = rInf.GetShell()->GetWin();
- const IDocumentSettingAccess* pIDSA = rInf.GetShell()->getIDocumentSettingAccess();
// true if pOut is the printer and the printer has been used for formatting
const sal_Bool bPrt = OUTDEV_PRINTER == rInf.GetOut().GetOutDevType() &&
OUTDEV_PRINTER == rRefDev.GetOutDevType();
const sal_Bool bBrowse = ( pWin &&
- pIDSA->get(IDocumentSettingAccess::BROWSE_MODE) &&
+ rInf.GetShell()->GetViewOptions()->getBrowseMode() &&
!rInf.GetShell()->GetViewOptions()->IsPrtFormat() &&
!rInf.GetBullet() &&
( rInf.GetSpace() || !rInf.GetKern() ) &&
@@ -876,7 +875,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
const sal_Bool bNoAdjust = bPrt ||
( pWin &&
- pIDSA->get(IDocumentSettingAccess::BROWSE_MODE) &&
+ rInf.GetShell()->GetViewOptions()->getBrowseMode() &&
!rInf.GetShell()->GetViewOptions()->IsPrtFormat() );
if ( OUTDEV_PRINTER == rInf.GetOut().GetOutDevType() )
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index a5831b394f..4d0f31fa4e 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -34,9 +34,7 @@
#include <editeng/brkitem.hxx>
#include <editeng/escpitem.hxx>
#include <editeng/lrspitem.hxx>
-// --> OD 2008-01-17 #newlistlevelattrs#
#include <editeng/tstpitem.hxx>
-// <--
#include <svl/urihelper.hxx>
#ifndef _SVSTDARR_HXX
#define _SVSTDARR_ULONGS
@@ -88,17 +86,14 @@
#include <istyleaccess.hxx>
#include <SwStyleNameMapper.hxx>
#include <numrule.hxx>
-
-//--> #outlinelevel added by zhaojianwei
#include <svl/intitem.hxx>
-//<--end
#include <swtable.hxx>
#include <docsh.hxx>
#include <SwNodeNum.hxx>
-// --> OD 2008-02-25 #refactorlists#
#include <svl/intitem.hxx>
#include <list.hxx>
-// <--
+#include <switerator.hxx>
+#include <attrhint.hxx>
using namespace ::com::sun::star;
@@ -134,26 +129,12 @@ SwTxtNode *SwNodes::MakeTxtNode( const SwNodeIndex & rWhere,
// --> OD 2005-11-03 #125329#
// call method <UpdateOutlineNode(..)> only for the document nodes array
if ( IsDocNodes() )
- {
- //if ( pColl && NO_NUMBERING != pColl->GetOutlineLevel() ) //#outline level,removed by zhaojianwei
- //{
- // UpdateOutlineNode( *pNode, NO_NUMBERING, pColl->GetOutlineLevel() );
- //}
-// if ( pColl && 0 != pColl->GetAttrOutlineLevel() )//#outline level,added by zhaojianwei
-// {
-// UpdateOutlineNode( *pNode, 0, pColl->GetAttrOutlineLevel() );
-// }//<--end
-// else
- {
- UpdateOutlineNode(*pNode);
- }
- }
- // <--
+ UpdateOutlineNode(*pNode);
//Wenn es noch kein Layout gibt oder in einer versteckten Section
// stehen, brauchen wir uns um das MakeFrms nicht bemuehen.
const SwSectionNode* pSectNd;
- if( !GetDoc()->GetRootFrm() ||
+ if( !GetDoc()->GetCurrentViewShell() || //swmod 071108//swmod 071225
( 0 != (pSectNd = pNode->FindSectionNode()) &&
pSectNd->GetSection().IsHiddenFlag() ))
return pNode;
@@ -305,9 +286,9 @@ SwTxtNode::~SwTxtNode()
InitSwParaStatistics( false );
}
-SwCntntFrm *SwTxtNode::MakeFrm()
+SwCntntFrm *SwTxtNode::MakeFrm( SwFrm* pSib )
{
- SwCntntFrm *pFrm = new SwTxtFrm(this);
+ SwCntntFrm *pFrm = new SwTxtFrm( this, pSib );
return pFrm;
}
@@ -325,7 +306,7 @@ xub_StrLen SwTxtNode::Len() const
void lcl_ChangeFtnRef( SwTxtNode &rNode )
{
SwpHints *pSwpHints = rNode.GetpSwpHints();
- if( pSwpHints && rNode.GetDoc()->GetRootFrm() )
+ if( pSwpHints && rNode.GetDoc()->GetCurrentViewShell() ) //swmod 071108//swmod 071225
{
SwTxtAttr* pHt;
SwCntntFrm* pFrm = NULL;
@@ -340,8 +321,7 @@ void lcl_ChangeFtnRef( SwTxtNode &rNode )
{
if( !pFrm )
{
- SwClientIter aNew( rNode );
- pFrm = (SwCntntFrm*)aNew.First( TYPE(SwCntntFrm) );
+ pFrm = SwIterator<SwCntntFrm,SwTxtNode>::FirstElement( rNode );
if( !pFrm )
return;
}
@@ -354,11 +334,12 @@ void lcl_ChangeFtnRef( SwTxtNode &rNode )
GetNodes().GoNextSection( &aIdx, sal_True, sal_False );
if ( !pNd )
continue;
- SwClientIter aIter( *pNd );
- SwCntntFrm* pCntnt = (SwCntntFrm*)aIter.First(TYPE(SwCntntFrm));
+
+ SwIterator<SwCntntFrm,SwCntntNode> aIter( *pNd );
+ SwCntntFrm* pCntnt = aIter.First();
if( pCntnt )
{
- ASSERT( pCntnt->FindRootFrm() == pFrm->FindRootFrm(),
+ ASSERT( pCntnt->getRootFrm() == pFrm->getRootFrm(),
"lcl_ChangeFtnRef: Layout double?" );
SwFtnFrm *pFtn = pCntnt->FindFtnFrm();
if( pFtn && pFtn->GetAttr() == pAttr )
@@ -375,7 +356,7 @@ void lcl_ChangeFtnRef( SwTxtNode &rNode )
}
}
#ifdef DBG_UTIL
- while( 0 != (pCntnt = (SwCntntFrm*)aIter.Next()) )
+ while( 0 != (pCntnt = aIter.Next()) )
{
SwFtnFrm *pDbgFtn = pCntnt->FindFtnFrm();
ASSERT( !pDbgFtn || pDbgFtn->GetRef() == pFrm,
@@ -518,21 +499,12 @@ SwCntntNode *SwTxtNode::SplitCntntNode( const SwPosition &rPos )
}
- SwClientIter aIter( *this );
- SwClient* pLastFrm = aIter.GoStart();
- if( pLastFrm )
+ SwIterator<SwCntntFrm,SwTxtNode> aIter( *this );
+ for( SwCntntFrm* pFrm = aIter.First(); pFrm; pFrm = aIter.Next() )
{
- do
- { SwCntntFrm *pFrm = PTR_CAST( SwCntntFrm, pLastFrm );
- if ( pFrm )
- {
- pNode->Add( pFrm );
- if( pFrm->IsTxtFrm() && !pFrm->IsFollow() &&
- ((SwTxtFrm*)pFrm)->GetOfst() )
- ((SwTxtFrm*)pFrm)->SetOfst( 0 );
- }
- pLastFrm = aIter++;
- } while ( pLastFrm );
+ pFrm->RegisterToNode( *pNode );
+ if( pFrm->IsTxtFrm() && !pFrm->IsFollow() && ((SwTxtFrm*)pFrm)->GetOfst() )
+ ((SwTxtFrm*)pFrm)->SetOfst( 0 );
}
if ( IsInCache() )
@@ -543,24 +515,24 @@ SwCntntNode *SwTxtNode::SplitCntntNode( const SwPosition &rPos )
UnlockModify(); // Benachrichtigungen wieder freischalten
- const SwRootFrm * const pRootFrm = pNode->GetDoc()->GetRootFrm();
// If there is an accessible layout we must call modify even
// with length zero, because we have to notify about the changed
// text node.
+ const SwRootFrm *pRootFrm;
if ( (nTxtLen != nSplitPos) ||
- ( pRootFrm && pRootFrm->IsAnyShellAccessible() ) )
-
+ ( (pRootFrm = pNode->GetDoc()->GetCurrentLayout()) != 0 &&
+ pRootFrm->IsAnyShellAccessible() ) ) //swmod 080218
{
// dann sage den Frames noch, das am Ende etwas "geloescht" wurde
if( 1 == nTxtLen - nSplitPos )
{
SwDelChr aHint( nSplitPos );
- pNode->SwModify::Modify( 0, &aHint );
+ pNode->NotifyClients( 0, &aHint );
}
else
{
SwDelTxt aHint( nSplitPos, nTxtLen - nSplitPos );
- pNode->SwModify::Modify( 0, &aHint );
+ pNode->NotifyClients( 0, &aHint );
}
}
if ( HasHints() )
@@ -643,7 +615,7 @@ SwCntntNode *SwTxtNode::SplitCntntNode( const SwPosition &rPos )
if( GetDepends() && SFX_ITEM_SET == pNode->GetSwAttrSet().
GetItemState( RES_PAGEDESC, sal_True, &pItem ) )
{
- pNode->Modify( (SfxPoolItem*)pItem, (SfxPoolItem*)pItem );
+ pNode->ModifyNotification( (SfxPoolItem*)pItem, (SfxPoolItem*)pItem );
}
}
return pNode;
@@ -1435,15 +1407,10 @@ void lcl_CopyHint( const sal_uInt16 nWhich, const SwTxtAttr * const pHt,
}
case RES_TXTATR_META:
case RES_TXTATR_METAFIELD:
- ASSERT(pNewHt, "copying META should not fail! cannot call DoCopy");
- ASSERT(pDest && (CH_TXTATR_INWORD ==
+ OSL_ENSURE(pNewHt, "copying Meta should not fail!");
+ OSL_ENSURE(pDest && (CH_TXTATR_INWORD ==
pDest->GetTxt().GetChar(*pNewHt->GetStart())),
"missing CH_TXTATR?");
- if (pNewHt)
- {
- SwFmtMeta & rMeta(static_cast<SwFmtMeta&>(pNewHt->GetAttr()));
- rMeta.DoCopy( const_cast<SwFmtMeta&>(pHt->GetMeta()) );
- }
break;
}
}
@@ -1484,7 +1451,8 @@ void SwTxtNode::CopyAttr( SwTxtNode *pDest, const xub_StrLen nTxtStartIdx,
{
// attribute in the area => copy
SwTxtAttr *const pNewHt = pDest->InsertItem(
- pHt->GetAttr(), nOldPos, nOldPos );
+ pHt->GetAttr(), nOldPos, nOldPos,
+ nsSetAttrMode::SETATTR_IS_COPY);
if ( pNewHt )
{
lcl_CopyHint( nWhich, pHt, pNewHt,
@@ -1495,7 +1463,8 @@ void SwTxtNode::CopyAttr( SwTxtNode *pDest, const xub_StrLen nTxtStartIdx,
: 0 == pOtherDoc->GetRefMark(
pHt->GetRefMark().GetRefName() ) )
{
- pDest->InsertItem( pHt->GetAttr(), nOldPos, nOldPos );
+ pDest->InsertItem( pHt->GetAttr(), nOldPos, nOldPos,
+ nsSetAttrMode::SETATTR_IS_COPY);
}
}
}
@@ -1506,7 +1475,7 @@ void SwTxtNode::CopyAttr( SwTxtNode *pDest, const xub_StrLen nTxtStartIdx,
{
// Frames benachrichtigen, sonst verschwinden die Ftn-Nummern
SwUpdateAttr aHint( nOldPos, nOldPos, 0 );
- pDest->Modify( 0, &aHint );
+ pDest->ModifyNotification( 0, &aHint );
}
}
@@ -1718,9 +1687,9 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest,
if( pDest == this )
{
- // die Daten kopieren
+ // copy the hint here, but insert it later
pNewHt = MakeTxtAttr( *GetDoc(), pHt->GetAttr(),
- nAttrStt, nAttrEnd );
+ nAttrStt, nAttrEnd, COPY, pDest );
lcl_CopyHint(nWhich, pHt, pNewHt, 0, pDest);
aArr.C40_INSERT( SwTxtAttr, pNewHt, aArr.Count() );
@@ -1728,7 +1697,9 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest,
else
{
pNewHt = pDest->InsertItem( pHt->GetAttr(), nAttrStt - nDeletedDummyChars,
- nAttrEnd - nDeletedDummyChars, nsSetAttrMode::SETATTR_NOTXTATRCHR );
+ nAttrEnd - nDeletedDummyChars,
+ nsSetAttrMode::SETATTR_NOTXTATRCHR
+ | nsSetAttrMode::SETATTR_IS_COPY);
if (pNewHt)
{
lcl_CopyHint( nWhich, pHt, pNewHt, pOtherDoc, pDest );
@@ -1866,7 +1837,7 @@ void SwTxtNode::InsertText( const XubString & rStr, const SwIndex & rIdx,
if ( GetDepends() )
{
SwInsTxt aHint( aPos, nLen );
- SwModify::Modify( 0, &aHint );
+ NotifyClients( 0, &aHint );
}
// By inserting a character, the hidden flags
@@ -2208,7 +2179,8 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart,
{
const bool bSuccess( pDest->InsertHint( pNewHt,
nsSetAttrMode::SETATTR_NOTXTATRCHR
- | nsSetAttrMode::SETATTR_DONTREPLACE ) );
+ | nsSetAttrMode::SETATTR_DONTREPLACE
+ | nsSetAttrMode::SETATTR_IS_COPY) );
if (bSuccess)
{
lcl_CopyHint( nWhich, pHt, pNewHt, pOtherDoc, pDest );
@@ -2260,9 +2232,9 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart,
// Frames benachrichtigen;
SwInsTxt aInsHint( nDestStart, nLen );
- pDest->Modify( 0, &aInsHint );
+ pDest->ModifyNotification( 0, &aInsHint );
SwDelTxt aDelHint( nTxtStartIdx, nLen );
- Modify( 0, &aDelHint );
+ ModifyNotification( 0, &aDelHint );
}
@@ -2357,12 +2329,12 @@ void SwTxtNode::EraseText(const SwIndex &rIdx, const xub_StrLen nCount,
if( 1 == nCnt )
{
SwDelChr aHint( nStartIdx );
- SwModify::Modify( 0, &aHint );
+ NotifyClients( 0, &aHint );
}
else
{
SwDelTxt aHint( nStartIdx, nCnt );
- SwModify::Modify( 0, &aHint );
+ NotifyClients( 0, &aHint );
}
ASSERT(rIdx.GetIndex() == nStartIdx, "huh? start index has changed?");
@@ -2422,9 +2394,9 @@ void SwTxtNode::GCAttr()
{
//TxtFrm's reagieren auf aHint, andere auf aNew
SwUpdateAttr aHint( nMin, nMax, 0 );
- SwModify::Modify( 0, &aHint );
+ NotifyClients( 0, &aHint );
SwFmtChg aNew( GetTxtColl() );
- SwModify::Modify( 0, &aNew );
+ NotifyClients( 0, &aNew );
}
}
@@ -2578,7 +2550,7 @@ void SwTxtNode::NumRuleChgd()
// Important note:
{
SvxLRSpaceItem& rLR = (SvxLRSpaceItem&)GetSwAttrSet().GetLRSpace();
- SwModify::Modify( &rLR, &rLR );
+ NotifyClients( &rLR, &rLR );
}
}
@@ -3476,10 +3448,10 @@ void SwTxtNode::ReplaceText( const SwIndex& rStart, const xub_StrLen nDelLen,
SetIgnoreDontExpand( bOldExpFlg );
SwDelTxt aDelHint( nStartPos, nDelLen );
- SwModify::Modify( 0, &aDelHint );
+ NotifyClients( 0, &aDelHint );
SwInsTxt aHint( nStartPos, rText.Len() );
- SwModify::Modify( 0, &aHint );
+ NotifyClients( 0, &aHint );
}
// --> OD 2008-03-27 #refactorlists#
@@ -3705,7 +3677,7 @@ namespace {
}
// <--
-void SwTxtNode::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue )
+void SwTxtNode::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue )
{
bool bWasNotifiable = m_bNotifiable;
m_bNotifiable = false;
@@ -3716,7 +3688,7 @@ void SwTxtNode::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue )
// Bug25481:
// bei Nodes im Undo nie _ChgTxtCollUpdateNum rufen.
if( pOldValue && pNewValue && RES_FMT_CHG == pOldValue->Which() &&
- pRegisteredIn == ((SwFmtChg*)pNewValue)->pChangedFmt &&
+ GetRegisteredIn() == ((SwFmtChg*)pNewValue)->pChangedFmt &&
GetNodes().IsDocNodes() )
{
_ChgTxtCollUpdateNum(
@@ -5072,7 +5044,6 @@ sal_uInt16 SwTxtNode::ResetAllAttr()
}
// <--
-
// sw::Metadatable
::sfx2::IXmlIdRegistry& SwTxtNode::GetRegistry()
{
@@ -5094,6 +5065,13 @@ bool SwTxtNode::IsInContent() const
return !GetDoc()->IsInHeaderFooter( SwNodeIndex(*this) );
}
+void SwTxtNode::SwClientNotify( const SwModify& rModify, const SfxHint& rHint )
+{
+ const SwAttrHint* pHint = dynamic_cast<const SwAttrHint*>(&rHint);
+ if ( pHint && pHint->GetId() == RES_CONDTXTFMTCOLL && &rModify == GetRegisteredIn() )
+ ChkCondColl();
+}
+
#include <unoparagraph.hxx>
uno::Reference< rdf::XMetadatable >
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index 9fb5d1b3e1..f811afce9e 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -214,22 +214,20 @@ splitPolicy(const sal_uInt16 nWhichNew, const sal_uInt16 nWhichOther)
}
}
-static void
-lcl_InitINetFmt(SwTxtNode & rNode, SwTxtINetFmt * pNew)
+void SwTxtINetFmt::InitINetFmt(SwTxtNode & rNode)
{
- pNew->ChgTxtNode(&rNode);
+ ChgTxtNode(&rNode);
SwCharFmt * const pFmt(
rNode.GetDoc()->GetCharFmtFromPool(RES_POOLCHR_INET_NORMAL) );
- pFmt->Add( pNew );
+ pFmt->Add( this );
}
-static void
-lcl_InitRuby(SwTxtNode & rNode, SwTxtRuby * pNew)
+void SwTxtRuby::InitRuby(SwTxtNode & rNode)
{
- pNew->ChgTxtNode(&rNode);
+ ChgTxtNode(&rNode);
SwCharFmt * const pFmt(
rNode.GetDoc()->GetCharFmtFromPool(RES_POOLCHR_RUBYTEXT) );
- pFmt->Add( pNew );
+ pFmt->Add( this );
}
/**
@@ -245,12 +243,12 @@ MakeTxtAttrNesting(SwTxtNode & rNode, SwTxtAttrNesting & rNesting,
{
case RES_TXTATR_INETFMT:
{
- lcl_InitINetFmt(rNode, static_cast<SwTxtINetFmt*>(pNew));
+ static_cast<SwTxtINetFmt*>(pNew)->InitINetFmt(rNode);
break;
}
case RES_TXTATR_CJK_RUBY:
{
- lcl_InitRuby(rNode, static_cast<SwTxtRuby*>(pNew));
+ static_cast<SwTxtRuby*>(pNew)->InitRuby(rNode);
break;
}
default:
@@ -996,7 +994,8 @@ SwTxtAttr* MakeRedlineTxtAttr( SwDoc & rDoc, SfxPoolItem & rAttr )
// create new text attribute
SwTxtAttr* MakeTxtAttr( SwDoc & rDoc, SfxPoolItem& rAttr,
- xub_StrLen nStt, xub_StrLen nEnd )
+ xub_StrLen const nStt, xub_StrLen const nEnd,
+ CopyOrNew_t const bIsCopy, SwTxtNode *const pTxtNode)
{
if ( isCHRATR(rAttr.Which()) )
{
@@ -1077,7 +1076,8 @@ SwTxtAttr* MakeTxtAttr( SwDoc & rDoc, SfxPoolItem& rAttr,
break;
case RES_TXTATR_META:
case RES_TXTATR_METAFIELD:
- pNew = new SwTxtMeta( static_cast<SwFmtMeta&>(rNew), nStt, nEnd );
+ pNew = SwTxtMeta::CreateTxtMeta( rDoc.GetMetaFieldManager(), pTxtNode,
+ static_cast<SwFmtMeta&>(rNew), nStt, nEnd, bIsCopy );
break;
default:
ASSERT(RES_TXTATR_AUTOFMT == rNew.Which(), "unknown attribute");
@@ -1192,7 +1192,7 @@ void SwTxtNode::DestroyAttr( SwTxtAttr* pAttr )
if( nDelMsg && !pDoc->IsInDtor() && GetNodes().IsDocNodes() )
{
SwPtrMsgPoolItem aMsgHint( nDelMsg, (void*)&pAttr->GetAttr() );
- pDoc->GetUnoCallBack()->Modify( &aMsgHint, &aMsgHint );
+ pDoc->GetUnoCallBack()->ModifyNotification( &aMsgHint, &aMsgHint );
}
SwTxtAttr::Destroy( pAttr, pDoc->GetAttrPool() );
@@ -1211,7 +1211,8 @@ SwTxtNode::InsertItem( SfxPoolItem& rAttr,
ASSERT( !isCHRATR(rAttr.Which()), "AUTOSTYLES - "
"SwTxtNode::InsertItem should not be called with character attributes");
- SwTxtAttr* const pNew = MakeTxtAttr( *GetDoc(), rAttr, nStart, nEnd );
+ SwTxtAttr *const pNew = MakeTxtAttr( *GetDoc(), rAttr, nStart, nEnd,
+ (nMode & nsSetAttrMode::SETATTR_IS_COPY) ? COPY : NEW, this );
if ( pNew )
{
@@ -1518,7 +1519,7 @@ void SwTxtNode::DeleteAttribute( SwTxtAttr * const pAttr )
*pAttr->GetStart(), *pAttr->GetEnd(), pAttr->Which() );
m_pSwpHints->Delete( pAttr );
SwTxtAttr::Destroy( pAttr, GetDoc()->GetAttrPool() );
- SwModify::Modify( 0, &aHint ); // notify Frames
+ NotifyClients( 0, &aHint );
TryDeleteSwpHints();
}
@@ -1586,7 +1587,7 @@ void SwTxtNode::DeleteAttributes( const sal_uInt16 nWhich,
SwUpdateAttr aHint( nStart, *pEndIdx, nWhich );
m_pSwpHints->DeleteAtPos( nPos ); // gefunden, loeschen,
SwTxtAttr::Destroy( pTxtHt, GetDoc()->GetAttrPool() );
- SwModify::Modify( 0, &aHint ); // die Frames benachrichtigen
+ NotifyClients( 0, &aHint );
}
}
}
@@ -2100,7 +2101,7 @@ struct RemovePresentAttrs
const SwTxtAttr* const pAutoStyle(i_rAttrSpan.second);
SfxItemIter aIter(m_rAttrSet);
const SfxPoolItem* pItem(aIter.GetCurItem());
- while (true)
+ while (pItem)
{
const sal_uInt16 nWhich(pItem->Which());
if (CharFmt::IsItemIncluded(nWhich, pAutoStyle))
@@ -2142,7 +2143,8 @@ lcl_CollectHintSpans(const SwpHints& i_rHints, const sal_uInt16 nLength,
const AttrSpan_t aSpan(*pHint->GetStart(), *pHint->GetEnd());
o_rSpanMap.insert(AttrSpanMap_t::value_type(aSpan, pHint));
- if (aSpan.first != nLastEnd)
+ // < not != because there may be multiple CHARFMT at same range
+ if (nLastEnd < aSpan.first)
{
// insert dummy span covering the gap
o_rSpanMap.insert(AttrSpanMap_t::value_type(
@@ -2338,7 +2340,7 @@ void SwTxtNode::FmtToTxtAttr( SwTxtNode* pNd )
if( aNdSet.Count() )
{
SwFmtChg aTmp1( pNd->GetFmtColl() );
- pNd->SwModify::Modify( &aTmp1, &aTmp1 );
+ pNd->NotifyClients( &aTmp1, &aTmp1 );
}
}
}
@@ -2629,7 +2631,7 @@ bool SwpHints::TryInsertHint( SwTxtAttr* const pHint, SwTxtNode &rNode,
}
// <--
case RES_TXTATR_INETFMT:
- lcl_InitINetFmt(rNode, static_cast<SwTxtINetFmt*>(pHint));
+ static_cast<SwTxtINetFmt*>(pHint)->InitINetFmt(rNode);
break;
case RES_TXTATR_FIELD:
{
@@ -2682,7 +2684,7 @@ bool SwpHints::TryInsertHint( SwTxtAttr* const pHint, SwTxtNode &rNode,
{
SwFmtFld* pFmtFld = (SwFmtFld*)&((SwTxtFld*)pHint)
->GetFld();
- pFldType->Add( pFmtFld ); // ummelden
+ pFmtFld->RegisterToFieldType( *pFldType );
pFmtFld->GetFld()->ChgTyp( pFldType );
}
pFldType->SetSeqRefNo( *(SwSetExpField*)pFld );
@@ -2763,7 +2765,7 @@ bool SwpHints::TryInsertHint( SwTxtAttr* const pHint, SwTxtNode &rNode,
break;
case RES_TXTATR_CJK_RUBY:
- lcl_InitRuby(rNode, static_cast<SwTxtRuby*>(pHint));
+ static_cast<SwTxtRuby*>(pHint)->InitRuby(rNode);
break;
case RES_TXTATR_META:
@@ -2796,7 +2798,7 @@ bool SwpHints::TryInsertHint( SwTxtAttr* const pHint, SwTxtNode &rNode,
if ( rNode.GetDepends() )
{
SwUpdateAttr aHint( nHtStart, nHtStart, nWhich );
- rNode.Modify( 0, &aHint );
+ rNode.ModifyNotification( 0, &aHint );
}
return true;
}
@@ -2878,7 +2880,7 @@ bool SwpHints::TryInsertHint( SwTxtAttr* const pHint, SwTxtNode &rNode,
if ( rNode.GetDepends() )
{
SwUpdateAttr aHint( nHtStart, nHtStart == nHintEnd ? nHintEnd + 1 : nHintEnd, nWhich );
- rNode.Modify( 0, &aHint );
+ rNode.ModifyNotification( 0, &aHint );
}
#ifdef DBG_UTIL
diff --git a/sw/source/core/txtnode/txtatr2.cxx b/sw/source/core/txtnode/txtatr2.cxx
index 678a5d6c90..ae8ee14ba2 100644
--- a/sw/source/core/txtnode/txtatr2.cxx
+++ b/sw/source/core/txtnode/txtatr2.cxx
@@ -67,7 +67,7 @@ SwTxtCharFmt::~SwTxtCharFmt( )
{
}
-void SwTxtCharFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwTxtCharFmt::ModifyNotification( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
ASSERT( isCHRATR(nWhich) || (RES_OBJECTDYING == nWhich)
@@ -77,21 +77,20 @@ void SwTxtCharFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
if ( m_pTxtNode )
{
SwUpdateAttr aUpdateAttr( *GetStart(), *GetEnd(), nWhich );
- m_pTxtNode->Modify( &aUpdateAttr, &aUpdateAttr );
+ m_pTxtNode->ModifyNotification( &aUpdateAttr, &aUpdateAttr );
}
}
- // erfrage vom Modify Informationen
-sal_Bool SwTxtCharFmt::GetInfo( SfxPoolItem& rInfo ) const
+bool SwTxtCharFmt::GetInfo( SfxPoolItem& rInfo ) const
{
if ( RES_AUTOFMT_DOCNODE != rInfo.Which() || !m_pTxtNode ||
&m_pTxtNode->GetNodes() != static_cast<SwAutoFmtGetDocNode&>(rInfo).pNodes )
{
- return sal_True;
+ return true;
}
static_cast<SwAutoFmtGetDocNode&>(rInfo).pCntntNode = m_pTxtNode;
- return sal_False;
+ return false;
}
@@ -181,12 +180,12 @@ SwCharFmt* SwTxtINetFmt::GetCharFmt()
if( pRet )
pRet->Add( this );
else if( GetRegisteredIn() )
- pRegisteredIn->Remove( this );
+ GetRegisteredInNonConst()->Remove( this );
return pRet;
}
-void SwTxtINetFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwTxtINetFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
ASSERT( isCHRATR(nWhich) || (RES_OBJECTDYING == nWhich)
@@ -196,7 +195,7 @@ void SwTxtINetFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
if ( m_pTxtNode )
{
SwUpdateAttr aUpdateAttr( *GetStart(), *GetEnd(), nWhich );
- m_pTxtNode->Modify( &aUpdateAttr, &aUpdateAttr );
+ m_pTxtNode->ModifyNotification( &aUpdateAttr, &aUpdateAttr );
}
}
@@ -235,7 +234,7 @@ SwTxtRuby::~SwTxtRuby()
{
}
-void SwTxtRuby::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
+void SwTxtRuby::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
{
sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
ASSERT( isCHRATR(nWhich) || (RES_OBJECTDYING == nWhich)
@@ -245,7 +244,7 @@ void SwTxtRuby::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
if ( m_pTxtNode )
{
SwUpdateAttr aUpdateAttr( *GetStart(), *GetEnd(), nWhich );
- m_pTxtNode->Modify( &aUpdateAttr, &aUpdateAttr );
+ m_pTxtNode->ModifyNotification( &aUpdateAttr, &aUpdateAttr );
}
}
@@ -298,7 +297,7 @@ SwCharFmt* SwTxtRuby::GetCharFmt()
if( pRet )
pRet->Add( this );
else if( GetRegisteredIn() )
- pRegisteredIn->Remove( this );
+ GetRegisteredInNonConst()->Remove( this );
return pRet;
}
@@ -308,10 +307,25 @@ SwCharFmt* SwTxtRuby::GetCharFmt()
* class SwTxtMeta
*************************************************************************/
+SwTxtMeta *
+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)
+{
+ if (COPY == i_bIsCopy)
+ { // i_rAttr is already cloned, now call DoCopy to copy the sw::Meta
+ OSL_ENSURE(i_pTargetTxtNode, "cannot copy Meta without target node");
+ i_rAttr.DoCopy(i_rTargetDocManager, *i_pTargetTxtNode);
+ }
+ SwTxtMeta *const pTxtMeta(new SwTxtMeta(i_rAttr, i_nStart, i_nEnd));
+ return pTxtMeta;
+}
+
SwTxtMeta::SwTxtMeta( SwFmtMeta & i_rAttr,
const xub_StrLen i_nStart, const xub_StrLen i_nEnd )
: SwTxtAttrNesting( i_rAttr, i_nStart, i_nEnd )
- , m_pTxtNode( 0 )
{
i_rAttr.SetTxtAttr( this );
SetHasDummyChar(true);
@@ -328,7 +342,6 @@ SwTxtMeta::~SwTxtMeta()
void SwTxtMeta::ChgTxtNode(SwTxtNode * const pNode)
{
- m_pTxtNode = pNode; // before Notify!
SwFmtMeta & rFmtMeta( static_cast<SwFmtMeta &>(GetAttr()) );
if (rFmtMeta.GetTxtAttr() == this)
{
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index a52bdc1ebe..60729c64a4 100644..100755
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -617,9 +617,9 @@ void SwTxtNode::RstAttr(const SwIndex &rIdx, xub_StrLen nLen, sal_uInt16 nWhich,
}
//TxtFrm's reagieren auf aHint, andere auf aNew
SwUpdateAttr aHint( nMin, nMax, 0 );
- SwModify::Modify( 0, &aHint );
+ NotifyClients( 0, &aHint );
SwFmtChg aNew( GetFmtColl() );
- SwModify::Modify( 0, &aNew );
+ NotifyClients( 0, &aNew );
}
}
@@ -966,11 +966,11 @@ void SwTxtNode::SetLanguageAndFont( const SwPaM &rPaM,
if (pFont)
{
SvxFontItem aFontItem = (SvxFontItem&) aSet.Get( nFontWhichId );
- aFontItem.GetFamilyName() = pFont->GetName();
- aFontItem.GetFamily() = pFont->GetFamily();
- aFontItem.GetStyleName() = pFont->GetStyleName();
- aFontItem.GetPitch() = pFont->GetPitch();
- aFontItem.GetCharSet() = pFont->GetCharSet();
+ aFontItem.SetFamilyName( pFont->GetName());
+ aFontItem.SetFamily( pFont->GetFamily());
+ aFontItem.SetStyleName( pFont->GetStyleName());
+ aFontItem.SetPitch( pFont->GetPitch());
+ aFontItem.SetCharSet( pFont->GetCharSet() );
aSet.Put( aFontItem );
}
@@ -1485,7 +1485,7 @@ sal_Bool SwTxtNode::Hyphenate( SwInterHyphInfo &rHyphInf )
if( pLinguNode != this )
{
pLinguNode = this;
- pLinguFrm = (SwTxtFrm*)GetFrm( (Point*)(rHyphInf.GetCrsrPos()) );
+ pLinguFrm = (SwTxtFrm*)getLayoutFrm( GetDoc()->GetCurrentLayout(), (Point*)(rHyphInf.GetCrsrPos()) );
}
SwTxtFrm *pFrm = pLinguFrm;
if( pFrm )
@@ -1877,10 +1877,10 @@ void SwTxtNode::ReplaceTextOnly( xub_StrLen nPos, xub_StrLen nLen,
// notify the layout!
SwDelTxt aDelHint( nPos, nTLen );
- SwModify::Modify( 0, &aDelHint );
+ NotifyClients( 0, &aDelHint );
SwInsTxt aHint( nPos, nTLen );
- SwModify::Modify( 0, &aHint );
+ NotifyClients( 0, &aHint );
}
void SwTxtNode::CountWords( SwDocStat& rStat,
diff --git a/sw/source/core/undo/SwUndoPageDesc.cxx b/sw/source/core/undo/SwUndoPageDesc.cxx
index 6074fdffd0..66ee4c71d0 100644
--- a/sw/source/core/undo/SwUndoPageDesc.cxx
+++ b/sw/source/core/undo/SwUndoPageDesc.cxx
@@ -69,13 +69,7 @@ void DebugHeaderFooterContent( const SwPageDesc& rPageDesc )
SwFrmFmt* pHeaderFmt = rHead.GetHeaderFmt();
if( pHeaderFmt )
{
- SwClientIter aIter( *pHeaderFmt );
- SwClient *pLast = aIter.GoStart();
- if( pLast )
- do
- {
- ++nHeaderCount;
- } while( 0 != ( pLast = aIter++ ));
+ nHeaderCount = pHeaderFmt->GetClientCount();
const SwFmtCntnt* pCntnt = &pHeaderFmt->GetCntnt();
if( pCntnt->GetCntntIdx() )
nHeaderMaster = pCntnt->GetCntntIdx()->GetIndex();
@@ -86,13 +80,7 @@ void DebugHeaderFooterContent( const SwPageDesc& rPageDesc )
SwFrmFmt* pLeftHeaderFmt = rLeftHead.GetHeaderFmt();
if( pLeftHeaderFmt )
{
- SwClientIter aIter( *pLeftHeaderFmt );
- SwClient *pLast = aIter.GoStart();
- if( pLast )
- do
- {
- ++nLeftHeaderCount;
- } while( 0 != ( pLast = aIter++ ));
+ nLeftHeaderCount = pLeftHeaderFmt->GetClientCount();
const SwFmtCntnt* pLeftCntnt = &pLeftHeaderFmt->GetCntnt();
if( pLeftCntnt->GetCntntIdx() )
nHeaderLeft = pLeftCntnt->GetCntntIdx()->GetIndex();
@@ -105,13 +93,7 @@ void DebugHeaderFooterContent( const SwPageDesc& rPageDesc )
SwFrmFmt* pFooterFmt = rFoot.GetFooterFmt();
if( pFooterFmt )
{
- SwClientIter aIter( *pFooterFmt );
- SwClient *pLast = aIter.GoStart();
- if( pLast )
- do
- {
- ++nFooterCount;
- } while( 0 != ( pLast = aIter++ ));
+ nFooterCount = pFooterFmt->GetClientCount();
const SwFmtCntnt* pCntnt = &pFooterFmt->GetCntnt();
if( pCntnt->GetCntntIdx() )
nFooterMaster = pCntnt->GetCntntIdx()->GetIndex();
@@ -122,13 +104,7 @@ void DebugHeaderFooterContent( const SwPageDesc& rPageDesc )
SwFrmFmt* pLeftFooterFmt = rLeftFoot.GetFooterFmt();
if( pLeftFooterFmt )
{
- SwClientIter aIter( *pLeftFooterFmt );
- SwClient *pLast = aIter.GoStart();
- if( pLast )
- do
- {
- ++nLeftFooterCount;
- } while( 0 != ( pLast = aIter++ ));
+ nLeftFooterCount = pLeftFooterFmt->GetClientCount();
const SwFmtCntnt* pLeftCntnt = &pLeftFooterFmt->GetCntnt();
if( pLeftCntnt->GetCntntIdx() )
nFooterLeft = pLeftCntnt->GetCntntIdx()->GetIndex();
diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx
index 156c053b05..6a14e8900c 100644
--- a/sw/source/core/undo/rolbck.cxx
+++ b/sw/source/core/undo/rolbck.cxx
@@ -367,7 +367,7 @@ SwHistorySetTOXMark::SwHistorySetTOXMark( SwTxtTOXMark* pTxtHt, sal_uLong nNodeP
, m_nStart( *pTxtHt->GetStart() )
, m_nEnd( *pTxtHt->GetAnyEnd() )
{
- const_cast<SwModify*>(m_TOXMark.GetRegisteredIn())->Remove( &m_TOXMark );
+ m_TOXMark.DeRegister();
}
@@ -396,7 +396,7 @@ void SwHistorySetTOXMark::SetInDoc( SwDoc* pDoc, bool )
}
SwTOXMark aNew( m_TOXMark );
- pToxType->Add( &aNew );
+ aNew.RegisterToTOXType( *pToxType );
pTxtNd->InsertItem( aNew, m_nStart, m_nEnd,
nsSetAttrMode::SETATTR_NOTXTATRCHR );
@@ -942,7 +942,7 @@ void SwHistoryChangeFlyAnchor::SetInDoc( SwDoc* pDoc, bool )
aTmp.SetAnchor( &aPos );
// so the Layout does not get confused
- if ( !pCNd || !pCNd->GetFrm( 0, 0, sal_False ) )
+ if ( !pCNd || !pCNd->getLayoutFrm( pDoc->GetCurrentLayout(), 0, 0, sal_False ) )
{
m_rFmt.DelFrms();
}
@@ -1379,7 +1379,7 @@ SwRegHistory::SwRegHistory( const SwNode& rNd, SwHistory* pHst )
_MakeSetWhichIds();
}
-void SwRegHistory::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwRegHistory::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
// --> OD 2010-10-05 #i114861#
// Do not handle a "noop" modify
@@ -1397,7 +1397,7 @@ void SwRegHistory::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
{
SwHistoryHint* pNewHstr;
const SfxItemSet& rSet =
- *static_cast<SwAttrSetChg*>(pOld)->GetChgSet();
+ *static_cast<const SwAttrSetChg*>(pOld)->GetChgSet();
if ( 1 < rSet.Count() )
{
pNewHstr =
diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx
index f52ca10961..e3f2012b17 100644
--- a/sw/source/core/undo/unattr.cxx
+++ b/sw/source/core/undo/unattr.cxx
@@ -66,7 +66,7 @@
#include <redline.hxx>
#include <section.hxx>
#include <charfmt.hxx>
-
+#include <switerator.hxx>
// -----------------------------------------------------
@@ -78,49 +78,52 @@ SwUndoFmtAttrHelper::SwUndoFmtAttrHelper( SwFmt& rFmt, bool bSvDrwPt )
{
}
-void SwUndoFmtAttrHelper::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwUndoFmtAttrHelper::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
- if( pOld && pNew )
+ if( pOld )
{
- if( POOLATTR_END >= pOld->Which() )
- {
- if ( GetUndo() )
- {
- m_pUndo->PutAttr( *pOld );
- }
- else
- {
- m_pUndo.reset( new SwUndoFmtAttr( *pOld,
- *static_cast<SwFmt*>(pRegisteredIn), m_bSaveDrawPt ) );
- }
+ if ( pOld->Which() == RES_OBJECTDYING )
+ {
+ CheckRegistration( pOld, pNew );
}
- else if ( RES_ATTRSET_CHG == pOld->Which() )
+ else if ( pNew )
{
- if ( GetUndo() )
+ if( POOLATTR_END >= pOld->Which() )
{
- SfxItemIter aIter(
- *(static_cast<SwAttrSetChg*>(pOld))->GetChgSet() );
- const SfxPoolItem* pItem = aIter.GetCurItem();
- while ( pItem )
+ if ( GetUndo() )
{
- m_pUndo->PutAttr( *pItem );
- if( aIter.IsAtEnd() )
- break;
- pItem = aIter.NextItem();
+ m_pUndo->PutAttr( *pOld );
+ }
+ else
+ {
+ m_pUndo.reset( new SwUndoFmtAttr( *pOld,
+ *static_cast<SwFmt*>(GetRegisteredInNonConst()), m_bSaveDrawPt ) );
}
}
- else
+ else if ( RES_ATTRSET_CHG == pOld->Which() )
{
- m_pUndo.reset( new SwUndoFmtAttr(
- *static_cast<SwAttrSetChg*>(pOld)->GetChgSet(),
- *static_cast<SwFmt*>(pRegisteredIn), m_bSaveDrawPt ) );
+ if ( GetUndo() )
+ {
+ SfxItemIter aIter(
+ *(static_cast<const SwAttrSetChg*>(pOld))->GetChgSet() );
+ const SfxPoolItem* pItem = aIter.GetCurItem();
+ while ( pItem )
+ {
+ m_pUndo->PutAttr( *pItem );
+ if( aIter.IsAtEnd() )
+ break;
+ pItem = aIter.NextItem();
+ }
+ }
+ else
+ {
+ m_pUndo.reset( new SwUndoFmtAttr(
+ *static_cast<const SwAttrSetChg*>(pOld)->GetChgSet(),
+ *static_cast<SwFmt*>(GetRegisteredInNonConst()), m_bSaveDrawPt ) );
+ }
}
}
- else
- SwClient::Modify( pOld, pNew );
}
- else
- SwClient::Modify( pOld, pNew );
}
// -----------------------------------------------------
@@ -167,8 +170,7 @@ void SwUndoFmtAttr::Init()
static_cast<const SwFrmFmtPtr>(m_pFmt)))
{
// Table Format: save table position, table formats are volatile!
- SwTable * pTbl = static_cast<SwTable*>(
- SwClientIter( *m_pFmt ).First( TYPE( SwTable )) );
+ SwTable * pTbl = SwIterator<SwTable,SwFmt>::FirstElement( *m_pFmt );
if ( pTbl )
{
m_nNodeIndex = pTbl->GetTabSortBoxes()[ 0 ]->GetSttNd()
@@ -182,8 +184,7 @@ void SwUndoFmtAttr::Init()
}
else if ( 0 != dynamic_cast< SwTableBoxFmt* >( m_pFmt ) )
{
- SwTableBox* pTblBox = static_cast< SwTableBox* >(
- SwClientIter( *m_pFmt ).First( TYPE( SwTableBox )));
+ SwTableBox * pTblBox = SwIterator<SwTableBox,SwFmt>::FirstElement( *m_pFmt );
if ( pTblBox )
{
m_nNodeIndex = pTblBox->GetSttIdx();
@@ -515,7 +516,7 @@ bool SwUndoFmtAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext)
aNewAnchor.SetPageNum( rAnchor.GetPageNum() );
Point aDrawSavePt, aDrawOldPt;
- if( pDoc->GetRootFrm() )
+ if( pDoc->GetCurrentViewShell() ) //swmod 071108//swmod 071225
{
if( RES_DRAWFRMFMT == pFrmFmt->Which() )
{
diff --git a/sw/source/core/undo/undobj1.cxx b/sw/source/core/undo/undobj1.cxx
index 462270a15f..958952eefe 100644
--- a/sw/source/core/undo/undobj1.cxx
+++ b/sw/source/core/undo/undobj1.cxx
@@ -171,7 +171,7 @@ void SwUndoFlyBase::DelFly( SwDoc* pDoc )
// alle Uno-Objecte sollten sich jetzt abmelden
{
SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, pFrmFmt );
- pFrmFmt->Modify( &aMsgHint, &aMsgHint );
+ pFrmFmt->ModifyNotification( &aMsgHint, &aMsgHint );
}
if ( RES_DRAWFRMFMT != pFrmFmt->Which() )
@@ -341,8 +341,7 @@ void SwUndoInsLayFmt::RepeatImpl(::sw::RepeatContext & rContext)
}
else if (FLY_AT_PAGE == aAnchor.GetAnchorId())
{
- aAnchor.SetPageNum(
- pDoc->GetRootFrm()->GetCurrPage(& rContext.GetRepeatPaM()) );
+ aAnchor.SetPageNum( pDoc->GetCurrentLayout()->GetCurrPage( &rContext.GetRepeatPaM() ));
}
else {
ASSERT( sal_False, "was fuer ein Anker ist es denn nun?" );
@@ -505,6 +504,11 @@ SwUndoSetFlyFmt::~SwUndoSetFlyFmt()
delete pItemSet;
}
+void SwUndoSetFlyFmt::DeRegisterFromFormat( SwFmt& rFmt )
+{
+ rFmt.Remove(this);
+}
+
void SwUndoSetFlyFmt::GetAnchor( SwFmtAnchor& rAnchor,
sal_uLong nNode, xub_StrLen nCntnt )
{
@@ -698,7 +702,7 @@ void SwUndoSetFlyFmt::PutAttr( sal_uInt16 nWhich, const SfxPoolItem* pItem )
pItemSet->InvalidateItem( nWhich );
}
-void SwUndoSetFlyFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* )
+void SwUndoSetFlyFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* )
{
if( pOld )
{
diff --git a/sw/source/core/undo/undraw.cxx b/sw/source/core/undo/undraw.cxx
index 71d99f995e..7380c40dee 100644
--- a/sw/source/core/undo/undraw.cxx
+++ b/sw/source/core/undo/undraw.cxx
@@ -33,6 +33,7 @@
#include <rtl/string.h>
#include <rtl/memory.h>
+#include <rtl/string.h>
#include <svx/svdogrp.hxx>
#include <svx/svdundo.hxx>
#include <svx/svdpage.hxx>
@@ -63,9 +64,6 @@ struct SwUndoGroupObjImpl
SwDrawFrmFmt* pFmt;
SdrObject* pObj;
sal_uLong nNodeIdx;
-
- // OD 2004-04-15 #i26791# - keeping the anchor and the relative position
- // of drawing objects no longer needed
};
@@ -83,7 +81,7 @@ IMPL_LINK( SwDoc, AddDrawUndo, SdrUndoAction *, pUndo )
GetIDocumentUndoRedo().DoesDrawUndo())
{
const SdrMarkList* pMarkList = 0;
- ViewShell* pSh = GetRootFrm() ? GetRootFrm()->GetCurrShell() : 0;
+ ViewShell* pSh = GetCurrentViewShell();
if( pSh && pSh->HasDrawView() )
pMarkList = &pSh->GetDrawView()->GetMarkedObjectList();
@@ -131,7 +129,7 @@ String SwSdrUndo::GetComment() const
void lcl_SendRemoveToUno( SwFmt& rFmt )
{
SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, &rFmt );
- rFmt.Modify( &aMsgHint, &aMsgHint );
+ rFmt.ModifyNotification( &aMsgHint, &aMsgHint );
}
void lcl_SaveAnchor( SwFrmFmt* pFmt, sal_uLong& rNodePos )
@@ -149,15 +147,15 @@ void lcl_SaveAnchor( SwFrmFmt* pFmt, sal_uLong& rNodePos )
{
nCntntPos = rAnchor.GetCntntAnchor()->nContent.GetIndex();
- // TextAttribut zerstoeren
+ // destroy TextAttribute
SwTxtNode *pTxtNd = pFmt->GetDoc()->GetNodes()[ rNodePos ]->GetTxtNode();
- ASSERT( pTxtNd, "Kein Textnode gefunden" );
+ ASSERT( pTxtNd, "No text node found!" );
SwTxtFlyCnt* pAttr = static_cast<SwTxtFlyCnt*>(
pTxtNd->GetTxtAttrForCharAt( nCntntPos, RES_TXTATR_FLYCNT ));
- // Attribut steht noch im TextNode, loeschen
+ // attribute still in text node, delete
if( pAttr && pAttr->GetFlyCnt().GetFrmFmt() == pFmt )
{
- // Pointer auf 0, nicht loeschen
+ // just set pointer to 0, don't delete
((SwFmtFlyCnt&)pAttr->GetFlyCnt()).SetFlyFmt();
SwIndex aIdx( pTxtNd, nCntntPos );
pTxtNd->EraseText( aIdx, 1 );
@@ -220,7 +218,7 @@ SwUndoDrawGroup::~SwUndoDrawGroup()
delete pTmp->pFmt;
}
else
- delete pObjArr->pFmt; // das GroupObject-Format
+ delete pObjArr->pFmt;
delete [] pObjArr;
}
@@ -229,22 +227,22 @@ void SwUndoDrawGroup::UndoImpl(::sw::UndoRedoContext &)
{
bDelFmt = sal_False;
- // das Group-Object sichern
+ // save group object
SwDrawFrmFmt* pFmt = pObjArr->pFmt;
SwDrawContact* pDrawContact = (SwDrawContact*)pFmt->FindContactObj();
SdrObject* pObj = pDrawContact->GetMaster();
pObjArr->pObj = pObj;
- //loescht sich selbst!
+ // object will destroy itself
pDrawContact->Changed( *pObj, SDRUSERCALL_DELETE, pObj->GetLastBoundRect() );
pObj->SetUserCall( 0 );
::lcl_SaveAnchor( pFmt, pObjArr->nNodeIdx );
- // alle Uno-Objecte sollten sich jetzt abmelden
+ // notify UNO objects to decouple
::lcl_SendRemoveToUno( *pFmt );
- // aus dem Array austragen
+ // remove from array
SwDoc* pDoc = pFmt->GetDoc();
SwSpzFrmFmts& rFlyFmts = *(SwSpzFrmFmts*)pDoc->GetSpzFrmFmts();
rFlyFmts.Remove( rFlyFmts.GetPos( pFmt ));
@@ -260,19 +258,15 @@ void SwUndoDrawGroup::UndoImpl(::sw::UndoRedoContext &)
SwDrawContact *pContact = new SwDrawContact( rSave.pFmt, pObj );
pContact->ConnectToLayout();
- // --> OD 2005-03-22 #i45718# - follow-up of #i35635#
- // move object to visible layer
+ // #i45718# - follow-up of #i35635# move object to visible layer
pContact->MoveObjToVisibleLayer( pObj );
- // <--
- // --> OD 2005-05-10 #i45952# - notify that position attributes
- // are already set
+ // #i45952# - notify that position attributes are already set
ASSERT( rSave.pFmt->ISA(SwDrawFrmFmt),
"<SwUndoDrawGroup::Undo(..)> - wrong type of frame format for drawing object" );
if ( rSave.pFmt->ISA(SwDrawFrmFmt) )
{
static_cast<SwDrawFrmFmt*>(rSave.pFmt)->PosAttrSet();
}
- // <--
}
}
@@ -280,7 +274,7 @@ void SwUndoDrawGroup::RedoImpl(::sw::UndoRedoContext &)
{
bDelFmt = sal_True;
- // aus dem Array austragen
+ // remove from array
SwDoc* pDoc = pObjArr->pFmt->GetDoc();
SwSpzFrmFmts& rFlyFmts = *(SwSpzFrmFmts*)pDoc->GetSpzFrmFmts();
SdrObject* pObj;
@@ -292,38 +286,35 @@ void SwUndoDrawGroup::RedoImpl(::sw::UndoRedoContext &)
pObj = rSave.pObj;
SwDrawContact *pContact = (SwDrawContact*)GetUserCall(pObj);
- //loescht sich selbst!
+
+ // object will destroy itself
pContact->Changed( *pObj, SDRUSERCALL_DELETE, pObj->GetLastBoundRect() );
pObj->SetUserCall( 0 );
::lcl_SaveAnchor( rSave.pFmt, rSave.nNodeIdx );
- // alle Uno-Objecte sollten sich jetzt abmelden
+ // notify UNO objects to decouple
::lcl_SendRemoveToUno( *rSave.pFmt );
rFlyFmts.Remove( rFlyFmts.GetPos( rSave.pFmt ));
}
- // das Group-Object wieder einfuegen
+ // re-insert group object
::lcl_RestoreAnchor( pObjArr->pFmt, pObjArr->nNodeIdx );
rFlyFmts.Insert( pObjArr->pFmt, rFlyFmts.Count() );
SwDrawContact *pContact = new SwDrawContact( pObjArr->pFmt, pObjArr->pObj );
- // OD 2004-04-15 #i26791# - correction: connect object to layout
+ // #i26791# - correction: connect object to layout
pContact->ConnectToLayout();
- // --> OD 2005-03-22 #i45718# - follow-up of #i35635#
- // move object to visible layer
+ // #i45718# - follow-up of #i35635# move object to visible layer
pContact->MoveObjToVisibleLayer( pObjArr->pObj );
- // <--
- // --> OD 2005-05-10 #i45952# - notify that position attributes
- // are already set
+ // #i45952# - notify that position attributes are already set
ASSERT( pObjArr->pFmt->ISA(SwDrawFrmFmt),
"<SwUndoDrawGroup::Undo(..)> - wrong type of frame format for drawing object" );
if ( pObjArr->pFmt->ISA(SwDrawFrmFmt) )
{
static_cast<SwDrawFrmFmt*>(pObjArr->pFmt)->PosAttrSet();
}
- // <--
}
void SwUndoDrawGroup::AddObj( sal_uInt16 nPos, SwDrawFrmFmt* pFmt, SdrObject* pObj )
@@ -333,10 +324,10 @@ void SwUndoDrawGroup::AddObj( sal_uInt16 nPos, SwDrawFrmFmt* pFmt, SdrObject* pO
rSave.pFmt = pFmt;
::lcl_SaveAnchor( pFmt, rSave.nNodeIdx );
- // alle Uno-Objecte sollten sich jetzt abmelden
+ // notify UNO objects to decouple
::lcl_SendRemoveToUno( *pFmt );
- // aus dem Array austragen
+ // remove from array
SwSpzFrmFmts& rFlyFmts = *(SwSpzFrmFmts*)pFmt->GetDoc()->GetSpzFrmFmts();
rFlyFmts.Remove( rFlyFmts.GetPos( pFmt ));
}
@@ -362,16 +353,16 @@ SwUndoDrawUnGroup::SwUndoDrawUnGroup( SdrObjGroup* pObj )
pObjArr->pObj = pObj;
pObjArr->pFmt = pFmt;
- //loescht sich selbst!
+ // object will destroy itself
pContact->Changed( *pObj, SDRUSERCALL_DELETE, pObj->GetLastBoundRect() );
pObj->SetUserCall( 0 );
::lcl_SaveAnchor( pFmt, pObjArr->nNodeIdx );
- // alle Uno-Objecte sollten sich jetzt abmelden
+ // notify UNO objects to decouple
::lcl_SendRemoveToUno( *pFmt );
- // aus dem Array austragen
+ // remove from array
SwSpzFrmFmts& rFlyFmts = *(SwSpzFrmFmts*)pFmt->GetDoc()->GetSpzFrmFmts();
rFlyFmts.Remove( rFlyFmts.GetPos( pFmt ));
}
@@ -385,7 +376,7 @@ SwUndoDrawUnGroup::~SwUndoDrawUnGroup()
delete pTmp->pFmt;
}
else
- delete pObjArr->pFmt; // das GroupObject-Format
+ delete pObjArr->pFmt;
delete [] pObjArr;
}
@@ -402,65 +393,50 @@ void SwUndoDrawUnGroup::UndoImpl(::sw::UndoRedoContext & rContext)
{
SwUndoGroupObjImpl& rSave = *( pObjArr + n );
- // --> OD 2006-11-01 #130889# - taken over by <SwUndoDrawUnGroupConnectToLayout>
-// SwDrawContact* pContact = (SwDrawContact*)rSave.pFmt->FindContactObj();
-
-// rSave.pObj = pContact->GetMaster();
-
-// //loescht sich selbst!
-// pContact->Changed( *rSave.pObj, SDRUSERCALL_DELETE,
-// rSave.pObj->GetLastBoundRect() );
-// rSave.pObj->SetUserCall( 0 );
- // <--
-
::lcl_SaveAnchor( rSave.pFmt, rSave.nNodeIdx );
- // alle Uno-Objecte sollten sich jetzt abmelden
+ // notify UNO objects to decouple
::lcl_SendRemoveToUno( *rSave.pFmt );
rFlyFmts.Remove( rFlyFmts.GetPos( rSave.pFmt ));
}
- // das Group-Object wieder einfuegen
+ // re-insert group object
::lcl_RestoreAnchor( pObjArr->pFmt, pObjArr->nNodeIdx );
rFlyFmts.Insert( pObjArr->pFmt, rFlyFmts.Count() );
SwDrawContact *pContact = new SwDrawContact( pObjArr->pFmt, pObjArr->pObj );
pContact->ConnectToLayout();
- // --> OD 2005-03-22 #i45718# - follow-up of #i35635#
- // move object to visible layer
+ // #i45718# - follow-up of #i35635# move object to visible layer
pContact->MoveObjToVisibleLayer( pObjArr->pObj );
- // <--
- // --> OD 2005-05-10 #i45952# - notify that position attributes
- // are already set
+ // #i45952# - notify that position attributes are already set
ASSERT( pObjArr->pFmt->ISA(SwDrawFrmFmt),
"<SwUndoDrawGroup::Undo(..)> - wrong type of frame format for drawing object" );
if ( pObjArr->pFmt->ISA(SwDrawFrmFmt) )
{
static_cast<SwDrawFrmFmt*>(pObjArr->pFmt)->PosAttrSet();
}
- // <--
}
void SwUndoDrawUnGroup::RedoImpl(::sw::UndoRedoContext &)
{
bDelFmt = sal_False;
- // das Group-Object sichern
+ // save group object
SwDrawFrmFmt* pFmt = pObjArr->pFmt;
SwDrawContact* pContact = (SwDrawContact*)pFmt->FindContactObj();
- //loescht sich selbst!
+ // object will destroy itself
pContact->Changed( *pObjArr->pObj, SDRUSERCALL_DELETE,
pObjArr->pObj->GetLastBoundRect() );
pObjArr->pObj->SetUserCall( 0 );
::lcl_SaveAnchor( pFmt, pObjArr->nNodeIdx );
- // alle Uno-Objecte sollten sich jetzt abmelden
+ // notify UNO objects to decouple
::lcl_SendRemoveToUno( *pFmt );
- // aus dem Array austragen
+ // remove from array
SwDoc* pDoc = pFmt->GetDoc();
SwSpzFrmFmts& rFlyFmts = *(SwSpzFrmFmts*)pDoc->GetSpzFrmFmts();
rFlyFmts.Remove( rFlyFmts.GetPos( pFmt ));
@@ -472,25 +448,13 @@ void SwUndoDrawUnGroup::RedoImpl(::sw::UndoRedoContext &)
::lcl_RestoreAnchor( rSave.pFmt, rSave.nNodeIdx );
rFlyFmts.Insert( rSave.pFmt, rFlyFmts.Count() );
- // --> OD 2006-11-01 #130889# - taken over by <SwUndoDrawUnGroupConnectToLayout>
-// SdrObject* pObj = rSave.pObj;
-
-// SwDrawContact *pContact = new SwDrawContact( rSave.pFmt, rSave.pObj );
-// pContact->ConnectToLayout();
-// // --> OD 2005-03-22 #i45718# - follow-up of #i35635#
-// // move object to visible layer
-// pContact->MoveObjToVisibleLayer( rSave.pObj );
-// // <--
- // <--
- // --> OD 2005-05-10 #i45952# - notify that position attributes
- // are already set
+ // #i45952# - notify that position attributes are already set
ASSERT( rSave.pFmt->ISA(SwDrawFrmFmt),
"<SwUndoDrawGroup::Undo(..)> - wrong type of frame format for drawing object" );
if ( rSave.pFmt->ISA(SwDrawFrmFmt) )
{
static_cast<SwDrawFrmFmt*>(rSave.pFmt)->PosAttrSet();
}
- // <--
}
}
@@ -501,8 +465,6 @@ void SwUndoDrawUnGroup::AddObj( sal_uInt16 nPos, SwDrawFrmFmt* pFmt )
rSave.pObj = 0;
}
-//-------------------------------------
-// --> OD 2006-11-01 #130889#
SwUndoDrawUnGroupConnectToLayout::SwUndoDrawUnGroupConnectToLayout()
: SwUndo( UNDO_DRAWUNGROUP )
{
@@ -552,7 +514,6 @@ void SwUndoDrawUnGroupConnectToLayout::AddFmtAndObj( SwDrawFrmFmt* pDrawFrmFmt,
aDrawFmtsAndObjs.push_back(
std::pair< SwDrawFrmFmt*, SdrObject* >( pDrawFrmFmt, pDrawObject ) );
}
-// <--
//-------------------------------------
@@ -587,12 +548,9 @@ void SwUndoDrawDelete::UndoImpl(::sw::UndoRedoContext & rContext)
SdrObject *pObj = rSave.pObj;
SwDrawContact *pContact = new SwDrawContact( rSave.pFmt, pObj );
pContact->_Changed( *pObj, SDRUSERCALL_INSERTED, NULL );
- // --> OD 2005-03-22 #i45718# - follow-up of #i35635#
- // move object to visible layer
+ // #i45718# - follow-up of #i35635# move object to visible layer
pContact->MoveObjToVisibleLayer( pObj );
- // <--
- // --> OD 2005-05-10 #i45952# - notify that position attributes
- // are already set
+ // #i45952# - notify that position attributes are already set
ASSERT( rSave.pFmt->ISA(SwDrawFrmFmt),
"<SwUndoDrawGroup::Undo(..)> - wrong type of frame format for drawing object" );
if ( rSave.pFmt->ISA(SwDrawFrmFmt) )
@@ -614,11 +572,12 @@ void SwUndoDrawDelete::RedoImpl(::sw::UndoRedoContext & rContext)
SdrObject *pObj = rSave.pObj;
SwDrawContact *pContact = (SwDrawContact*)GetUserCall(pObj);
SwDrawFrmFmt *pFmt = (SwDrawFrmFmt*)pContact->GetFmt();
- //loescht sich selbst!
+
+ // object will destroy itself
pContact->Changed( *pObj, SDRUSERCALL_DELETE, pObj->GetLastBoundRect() );
pObj->SetUserCall( 0 );
- // alle Uno-Objecte sollten sich jetzt abmelden
+ // notify UNO objects to decouple
::lcl_SendRemoveToUno( *pFmt );
rFlyFmts.Remove( rFlyFmts.GetPos( pFmt ));
@@ -634,10 +593,10 @@ void SwUndoDrawDelete::AddObj( sal_uInt16 , SwDrawFrmFmt* pFmt,
rSave.pFmt = pFmt;
::lcl_SaveAnchor( pFmt, rSave.nNodeIdx );
- // alle Uno-Objecte sollten sich jetzt abmelden
+ // notify UNO objects to decouple
::lcl_SendRemoveToUno( *pFmt );
- // aus dem Array austragen
+ // remove from array
SwDoc* pDoc = pFmt->GetDoc();
SwSpzFrmFmts& rFlyFmts = *(SwSpzFrmFmts*)pDoc->GetSpzFrmFmts();
rFlyFmts.Remove( rFlyFmts.GetPos( pFmt ));
diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx
index fece6a38ad..13deada182 100644
--- a/sw/source/core/undo/unins.cxx
+++ b/sw/source/core/undo/unins.cxx
@@ -1008,7 +1008,7 @@ void SwUndoInsertLabel::RepeatImpl(::sw::RepeatContext & rContext)
case LTYPE_OBJECT:
{
SwFlyFrm* pFly;
- SwCntntFrm *pCnt = pCNd->GetFrm();
+ SwCntntFrm *pCnt = pCNd->getLayoutFrm( rDoc.GetCurrentLayout() );
if( pCnt && 0 != ( pFly = pCnt->FindFlyFrm() ) )
nIdx = pFly->GetFmt()->GetCntnt().GetCntntIdx()->GetIndex();
}
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index e3d3f887c3..146dc1d4ad 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -68,6 +68,7 @@
#include <fmtanchr.hxx>
#include <comcore.hrc>
#include <unochart.hxx>
+#include <switerator.hxx>
#ifndef DBG_UTIL
#define CHECK_TABLE(t)
@@ -139,7 +140,7 @@ public:
~_SaveTable();
sal_uInt16 AddFmt( SwFrmFmt* pFmt, bool bIsLine );
- void NewFrmFmt( const SwClient* pLnBx, sal_Bool bIsLine, sal_uInt16 nFmtPos,
+ void NewFrmFmt( const SwTableLine* , const SwTableBox*, sal_uInt16 nFmtPos,
SwFrmFmt* pOldFmt );
void RestoreAttr( SwTable& rTbl, sal_Bool bModifyBox = sal_False );
@@ -498,7 +499,7 @@ void SwUndoTblToTxt::UndoImpl(::sw::UndoRedoContext & rContext)
SwTableNode* pTblNd = rDoc.GetNodes().UndoTableToText( nSttNd, nEndNd, *pBoxSaves );
pTblNd->GetTable().SetTableModel( pTblSave->IsNewModel() );
SwTableFmt* pTableFmt = rDoc.MakeTblFrmFmt( sTblNm, rDoc.GetDfltFrmFmt() );
- pTableFmt->Add( &pTblNd->GetTable() ); // das Frame-Format setzen
+ pTblNd->GetTable().RegisterToFormat( *pTableFmt );
pTblNd->GetTable().SetRowsToRepeat( nHdlnRpt );
// erzeuge die alte Tabellen Struktur
@@ -990,12 +991,12 @@ void _SaveTable::RestoreAttr( SwTable& rTbl, sal_Bool bMdfyBox )
}
// zur Sicherheit alle Tableframes invalidieren
- SwClientIter aIter( *pFmt );
- for( SwClient* pLast = aIter.First( TYPE( SwFrm ) ); pLast; pLast = aIter.Next() )
- if( ((SwTabFrm*)pLast)->GetTable() == &rTbl )
+ SwIterator<SwTabFrm,SwFmt> aIter( *pFmt );
+ for( SwTabFrm* pLast = aIter.First(); pLast; pLast = aIter.Next() )
+ if( pLast->GetTable() == &rTbl )
{
- ((SwTabFrm*)pLast)->InvalidateAll();
- ((SwTabFrm*)pLast)->SetCompletePaint();
+ pLast->InvalidateAll();
+ pLast->SetCompletePaint();
}
// FrmFmts mit Defaults (0) fuellen
@@ -1127,7 +1128,7 @@ void _SaveTable::CreateNew( SwTable& rTbl, sal_Bool bCreateFrms,
}
-void _SaveTable::NewFrmFmt( const SwClient* pLnBx, sal_Bool bIsLine,
+void _SaveTable::NewFrmFmt( const SwTableLine* pTblLn, const SwTableBox* pTblBx,
sal_uInt16 nFmtPos, SwFrmFmt* pOldFmt )
{
SwDoc* pDoc = pOldFmt->GetDoc();
@@ -1135,7 +1136,7 @@ void _SaveTable::NewFrmFmt( const SwClient* pLnBx, sal_Bool bIsLine,
SwFrmFmt* pFmt = aFrmFmts[ nFmtPos ];
if( !pFmt )
{
- if( bIsLine )
+ if( pTblLn )
pFmt = pDoc->MakeTableLineFmt();
else
pFmt = pDoc->MakeTableBoxFmt();
@@ -1144,16 +1145,16 @@ void _SaveTable::NewFrmFmt( const SwClient* pLnBx, sal_Bool bIsLine,
}
//Erstmal die Frms ummelden.
- SwClientIter aIter( *pOldFmt );
- for( SwClient* pLast = aIter.First( TYPE( SwFrm ) ); pLast; pLast = aIter.Next() )
+ SwIterator<SwTabFrm,SwFmt> aIter( *pOldFmt );
+ for( SwFrm* pLast = aIter.First(); pLast; pLast = aIter.Next() )
{
- if( bIsLine ? pLnBx == ((SwRowFrm*)pLast)->GetTabLine()
- : pLnBx == ((SwCellFrm*)pLast)->GetTabBox() )
+ if( pTblLn ? ((SwRowFrm*)pLast)->GetTabLine() == pTblLn
+ : ((SwCellFrm*)pLast)->GetTabBox() == pTblBx )
{
- pFmt->Add( pLast );
- ((SwFrm*)pLast)->InvalidateAll();
- ((SwFrm*)pLast)->ReinitializeFrmSizeAttrFlags();
- if ( !bIsLine )
+ pLast->RegisterToFormat(*pFmt);
+ pLast->InvalidateAll();
+ pLast->ReinitializeFrmSizeAttrFlags();
+ if ( !pTblLn )
{
((SwCellFrm*)pLast)->SetDerivedVert( sal_False );
((SwCellFrm*)pLast)->CheckDirChange();
@@ -1162,14 +1163,17 @@ void _SaveTable::NewFrmFmt( const SwClient* pLnBx, sal_Bool bIsLine,
}
//Jetzt noch mich selbst ummelden.
- pFmt->Add( (SwClient*)pLnBx );
+ if ( pTblLn )
+ const_cast<SwTableLine*>(pTblLn)->RegisterToFormat( *pFmt );
+ else if ( pTblBx )
+ const_cast<SwTableBox*>(pTblBx)->RegisterToFormat( *pFmt );
- if( bModifyBox && !bIsLine )
+ if( bModifyBox && !pTblLn )
{
const SfxPoolItem& rOld = pOldFmt->GetFmtAttr( RES_BOXATR_FORMAT ),
& rNew = pFmt->GetFmtAttr( RES_BOXATR_FORMAT );
if( rOld != rNew )
- pFmt->Modify( (SfxPoolItem*)&rOld, (SfxPoolItem*)&rNew );
+ pFmt->ModifyNotification( (SfxPoolItem*)&rOld, (SfxPoolItem*)&rNew );
}
if( !pOldFmt->GetDepends() )
@@ -1202,7 +1206,7 @@ _SaveLine::~_SaveLine()
void _SaveLine::RestoreAttr( SwTableLine& rLine, _SaveTable& rSTbl )
{
- rSTbl.NewFrmFmt( &rLine, sal_True, nItemSet, rLine.GetFrmFmt() );
+ rSTbl.NewFrmFmt( &rLine, 0, nItemSet, rLine.GetFrmFmt() );
_SaveBox* pBx = pBox;
for( sal_uInt16 n = 0; n < rLine.GetTabBoxes().Count(); ++n, pBx = pBx->pNext )
@@ -1292,7 +1296,7 @@ _SaveBox::~_SaveBox()
void _SaveBox::RestoreAttr( SwTableBox& rBox, _SaveTable& rSTbl )
{
- rSTbl.NewFrmFmt( &rBox, sal_False, nItemSet, rBox.GetFrmFmt() );
+ rSTbl.NewFrmFmt( 0, &rBox, nItemSet, rBox.GetFrmFmt() );
if( ULONG_MAX == nSttNode ) // keine EndBox
{
@@ -1409,7 +1413,7 @@ void _SaveBox::CreateNew( SwTable& rTbl, SwTableLine& rParent, _SaveTable& rSTbl
ASSERT( pBox, "Wo ist meine TabellenBox geblieben?" );
SwFrmFmt* pOld = pBox->GetFrmFmt();
- pFmt->Add( pBox );
+ pBox->RegisterToFormat( *pFmt );
if( !pOld->GetDepends() )
delete pOld;
diff --git a/sw/source/core/unocore/unobkm.cxx b/sw/source/core/unocore/unobkm.cxx
index a9cf8b5e36..9648cfea58 100644
--- a/sw/source/core/unocore/unobkm.cxx
+++ b/sw/source/core/unocore/unobkm.cxx
@@ -90,13 +90,13 @@ public:
}
void registerInMark(SwXBookmark & rThis, ::sw::mark::IMark *const pBkmk);
-
+protected:
// SwClient
- virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew);
+ virtual void Modify( const SfxPoolItem *pOld, const SfxPoolItem *pNew);
};
-void SwXBookmark::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXBookmark::Impl::Modify(const SfxPoolItem *pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
if (!GetRegisteredIn())
@@ -595,7 +595,7 @@ uno::Type SwXFieldmarkParameters::getElementType()
return !getCoreParameters()->empty();
}
-void SwXFieldmarkParameters::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXFieldmarkParameters::Modify(const SfxPoolItem *pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
}
diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx
index a5e8087ca7..ae118711b8 100644
--- a/sw/source/core/unocore/unochart.cxx
+++ b/sw/source/core/unocore/unochart.cxx
@@ -1595,7 +1595,7 @@ uno::Sequence< OUString > SAL_CALL SwChartDataProvider::getSupportedServiceNames
}
-void SwChartDataProvider::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwChartDataProvider::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
// actually this function should be superfluous (need to check later)
ClientModify(this, pOld, pNew );
@@ -2496,7 +2496,7 @@ uno::Sequence< OUString > SAL_CALL SwChartDataSequence::getSupportedServiceNames
}
-void SwChartDataSequence::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwChartDataSequence::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew );
diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx
index 9a829427fd..668b1e5e1f 100644
--- a/sw/source/core/unocore/unocoll.cxx
+++ b/sw/source/core/unocore/unocoll.cxx
@@ -31,9 +31,7 @@
#include <swtypes.hxx>
#include <cmdid.h>
#include <hintids.hxx>
-#ifndef _SVX_SVXIDS_HRC //autogen
#include <svx/svxids.hrc>
-#endif
#include <doc.hxx>
#include <docary.hxx>
#include <fmtcol.hxx>
@@ -72,14 +70,13 @@
#include <comphelper/sequence.hxx>
#include <slist>
#include <iterator>
-
#include <unosection.hxx>
#include <unoparagraph.hxx>
#include <unobookmark.hxx>
#include <unorefmark.hxx>
#include <unometa.hxx>
#include "docsh.hxx"
-
+#include <switerator.hxx>
using ::rtl::OUString;
using namespace ::com::sun::star;
@@ -272,9 +269,6 @@ const ProvNamesId_Type __FAR_DATA aProvNamesId[] =
{ CSS_TEXT_FIELDMASTER_BIBLIOGRAPHY, SW_SERVICE_FIELDMASTER_BIBLIOGRAPHY }
};
-/* -----------------------------23.03.01 13:38--------------------------------
-
- ---------------------------------------------------------------------------*/
const SvEventDescription* lcl_GetSupportedMacroItems()
{
static const SvEventDescription aMacroDescriptionsImpl[] =
@@ -290,9 +284,6 @@ const SvEventDescription* lcl_GetSupportedMacroItems()
/******************************************************************
* SwXServiceProvider
******************************************************************/
-/*-- 13.01.99 13:31:44---------------------------------------------------
-
- -----------------------------------------------------------------------*/
OUString SwXServiceProvider::GetProviderName(sal_uInt16 nObjectType)
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -302,9 +293,7 @@ OUString SwXServiceProvider::GetProviderName(sal_uInt16 nObjectType)
sRet = C2U(aProvNamesId[nObjectType].pName);
return sRet;
}
-/* -----------------11.03.99 12:05-------------------
- *
- * --------------------------------------------------*/
+
uno::Sequence<OUString> SwXServiceProvider::GetAllServiceNames()
{
sal_uInt16 nEntries = sizeof(aProvNamesId) / sizeof(aProvNamesId[0]);
@@ -325,9 +314,6 @@ uno::Sequence<OUString> SwXServiceProvider::GetAllServiceNames()
}
-/*-- 13.01.99 13:31:45---------------------------------------------------
-
- -----------------------------------------------------------------------*/
sal_uInt16 SwXServiceProvider::GetProviderType(const OUString& rServiceName)
{
sal_uInt16 nEntries = sizeof(aProvNamesId) / sizeof(aProvNamesId[0]);
@@ -338,9 +324,7 @@ sal_uInt16 SwXServiceProvider::GetProviderType(const OUString& rServiceName)
}
return SW_SERVICE_INVALID;
}
-/* -----------------13.01.99 14:37-------------------
- *
- * --------------------------------------------------*/
+
uno::Reference< uno::XInterface > SwXServiceProvider::MakeInstance(sal_uInt16 nObjectType, SwDoc* pDoc)
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -570,8 +554,7 @@ uno::Reference< uno::XInterface > SwXServiceProvider::MakeInstance(sal_uInt16
}
else
{
- SwClientIter aIter( *pType );
- SwXFieldMaster* pMaster = (SwXFieldMaster*)aIter.First( TYPE( SwXFieldMaster ));
+ SwXFieldMaster* pMaster = SwIterator<SwXFieldMaster,SwFieldType>::FirstElement( *pType );
if(pMaster)
xRet = (cppu::OWeakObject*)pMaster;
}
@@ -625,24 +608,17 @@ uno::Reference< uno::XInterface > SwXServiceProvider::MakeInstance(sal_uInt16
******************************************************************/
//SMART_UNO_IMPLEMENTATION( SwXTextTables, UsrObject );
-/*-- 13.01.99 12:56:24---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXTextTables::SwXTextTables(SwDoc* pDc) :
SwUnoCollection(pDc)
{
}
-/*-- 13.01.99 12:56:25---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextTables::~SwXTextTables()
{
}
-/*-- 13.01.99 12:56:25---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SwXTextTables::getCount(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -651,9 +627,7 @@ sal_Int32 SwXTextTables::getCount(void) throw( uno::RuntimeException )
nRet = GetDoc()->GetTblFrmFmtCount(sal_True);
return nRet;
}
-/*-- 13.01.99 12:56:26---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SAL_CALL SwXTextTables::getByIndex(sal_Int32 nIndex)
throw( IndexOutOfBoundsException, WrappedTargetException, uno::RuntimeException )
{
@@ -675,9 +649,7 @@ uno::Any SAL_CALL SwXTextTables::getByIndex(sal_Int32 nIndex)
throw uno::RuntimeException();
return aRet;
}
-/*-- 13.01.99 12:56:26---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXTextTables::getByName(const OUString& rItemName)
throw( NoSuchElementException, WrappedTargetException, uno::RuntimeException )
{
@@ -706,9 +678,7 @@ uno::Any SwXTextTables::getByName(const OUString& rItemName)
throw uno::RuntimeException();
return aRet;
}
-/*-- 13.01.99 12:56:26---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< OUString > SwXTextTables::getElementNames(void)
throw( uno::RuntimeException )
{
@@ -729,9 +699,7 @@ uno::Sequence< OUString > SwXTextTables::getElementNames(void)
}
return aSeq;
}
-/*-- 13.01.99 12:56:27---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextTables::hasByName(const OUString& rName)
throw( uno::RuntimeException )
{
@@ -755,18 +723,14 @@ sal_Bool SwXTextTables::hasByName(const OUString& rName)
throw uno::RuntimeException();
return bRet;
}
-/*-- 13.01.99 12:56:27---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Type SAL_CALL
SwXTextTables::getElementType( )
throw(uno::RuntimeException)
{
return ::getCppuType((uno::Reference<XTextTable>*)0);
}
-/*-- 13.01.99 12:56:27---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextTables::hasElements(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -774,23 +738,17 @@ sal_Bool SwXTextTables::hasElements(void) throw( uno::RuntimeException )
throw uno::RuntimeException();
return 0 != GetDoc()->GetTblFrmFmtCount(sal_True);
}
-/* -----------------25.10.99 16:01-------------------
- --------------------------------------------------*/
OUString SwXTextTables::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXTextTables");
}
-/* -----------------25.10.99 16:01-------------------
- --------------------------------------------------*/
sal_Bool SwXTextTables::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return rServiceName == C2U("com.sun.star.text.TextTables");
}
-/* -----------------25.10.99 16:01-------------------
- --------------------------------------------------*/
uno::Sequence< OUString > SwXTextTables::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
@@ -798,14 +756,11 @@ uno::Sequence< OUString > SwXTextTables::getSupportedServiceNames(void) throw( u
pArr[0] = C2U("com.sun.star.text.TextTables");
return aRet;
}
-/*-- 13.01.99 12:56:28---------------------------------------------------
- -----------------------------------------------------------------------*/
XTextTable* SwXTextTables::GetObject( SwFrmFmt& rFmt )
{
vos::OGuard aGuard(Application::GetSolarMutex());
- SwXTextTable* pTbl = (SwXTextTable*)SwClientIter( rFmt ).
- First( TYPE( SwXTextTable ));
+ SwXTextTable* pTbl = SwIterator<SwXTextTable,SwFmt>::FirstElement( rFmt );
if( !pTbl )
pTbl = new SwXTextTable(rFmt);
return pTbl ;
@@ -846,7 +801,7 @@ namespace
template<FlyCntType T>
static uno::Any lcl_UnoWrapFrame(SwFrmFmt* pFmt)
{
- SwXFrame* pFrm = static_cast<SwXFrame*>(SwClientIter(*pFmt).First(TYPE(SwXFrame)));
+ SwXFrame* pFrm = SwIterator<SwXFrame,SwFmt>::FirstElement( *pFmt );
if(!pFrm)
pFrm = new typename UnoFrameWrap_traits<T>::core_frame_t(*pFmt);
Reference< typename UnoFrameWrap_traits<T>::uno_frame_t > xFrm =
@@ -1114,7 +1069,7 @@ sal_Bool SwXFrames::hasElements(void) throw(uno::RuntimeException)
SwXFrame* SwXFrames::GetObject(SwFrmFmt& rFmt, FlyCntType eType)
{
- SwXFrame* pFrm = (SwXFrame*)SwClientIter(rFmt).First(TYPE(SwXFrame));
+ SwXFrame* pFrm = SwIterator<SwXFrame,SwFmt>::FirstElement( rFmt );
if(pFrm) return pFrm;
switch(eType)
{
@@ -1132,23 +1087,16 @@ SwXFrame* SwXFrames::GetObject(SwFrmFmt& rFmt, FlyCntType eType)
/******************************************************************
* SwXTextFrames
******************************************************************/
-/* -----------------------------06.04.00 12:44--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SwXTextFrames::getImplementationName(void) throw( RuntimeException )
{
return C2U("SwXTextFrames");
}
-/* -----------------------------06.04.00 12:44--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXTextFrames::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return C2U("com.sun.star.text.TextFrames") == rServiceName;
}
-/* -----------------------------06.04.00 12:44--------------------------------
- ---------------------------------------------------------------------------*/
Sequence< OUString > SwXTextFrames::getSupportedServiceNames(void) throw( RuntimeException )
{
Sequence< OUString > aRet(1);
@@ -1156,16 +1104,12 @@ Sequence< OUString > SwXTextFrames::getSupportedServiceNames(void) throw( Runtim
pArray[0] = C2U("com.sun.star.text.TextFrames");
return aRet;
}
-/*-- 14.01.99 08:06:16---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextFrames::SwXTextFrames(SwDoc* _pDoc) :
SwXFrames(_pDoc, FLYCNTTYPE_FRM)
{
}
-/*-- 14.01.99 08:06:17---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextFrames::~SwXTextFrames()
{
}
@@ -1173,25 +1117,17 @@ SwXTextFrames::~SwXTextFrames()
/******************************************************************
* SwXTextGraphicObjects
******************************************************************/
-//SMART_UNO_IMPLEMENTATION( SwXTextGraphicObjects, UsrObject );
-
-/* -----------------------------06.04.00 12:44--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXTextGraphicObjects::getImplementationName(void) throw( RuntimeException )
{
return C2U("SwXTextGraphicObjects");
}
-/* -----------------------------06.04.00 12:44--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXTextGraphicObjects::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return C2U("com.sun.star.text.TextGraphicObjects") == rServiceName;
}
-/* -----------------------------06.04.00 12:44--------------------------------
- ---------------------------------------------------------------------------*/
Sequence< OUString > SwXTextGraphicObjects::getSupportedServiceNames(void) throw( RuntimeException )
{
Sequence< OUString > aRet(1);
@@ -1199,16 +1135,12 @@ Sequence< OUString > SwXTextGraphicObjects::getSupportedServiceNames(void) throw
pArray[0] = C2U("com.sun.star.text.TextGraphicObjects");
return aRet;
}
-/*-- 14.01.99 08:45:53---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextGraphicObjects::SwXTextGraphicObjects(SwDoc* _pDoc) :
SwXFrames(_pDoc, FLYCNTTYPE_GRF)
{
}
-/*-- 14.01.99 08:45:54---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextGraphicObjects::~SwXTextGraphicObjects()
{
}
@@ -1216,23 +1148,16 @@ SwXTextGraphicObjects::~SwXTextGraphicObjects()
/******************************************************************
* SwXTextEmbeddedObjects
******************************************************************/
-/* -----------------------------06.04.00 12:44--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SwXTextEmbeddedObjects::getImplementationName(void) throw( RuntimeException )
{
return C2U("SwXTextEmbeddedObjects");
}
-/* -----------------------------06.04.00 12:44--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXTextEmbeddedObjects::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return C2U("com.sun.star.text.TextEmbeddedObjects") == rServiceName;
}
-/* -----------------------------06.04.00 12:44--------------------------------
- ---------------------------------------------------------------------------*/
Sequence< OUString > SwXTextEmbeddedObjects::getSupportedServiceNames(void) throw( RuntimeException )
{
Sequence< OUString > aRet(1);
@@ -1240,16 +1165,12 @@ Sequence< OUString > SwXTextEmbeddedObjects::getSupportedServiceNames(void) thro
pArray[0] = C2U("com.sun.star.text.TextEmbeddedObjects");
return aRet;
}
-/*-- 14.01.99 08:45:13---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextEmbeddedObjects::SwXTextEmbeddedObjects(SwDoc* _pDoc) :
SwXFrames(_pDoc, FLYCNTTYPE_OLE)
{
}
-/*-- 14.01.99 08:45:31---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextEmbeddedObjects::~SwXTextEmbeddedObjects()
{
}
@@ -1258,23 +1179,16 @@ SwXTextEmbeddedObjects::~SwXTextEmbeddedObjects()
*
******************************************************************/
#define PASSWORD_STD_TIMEOUT 1000
-/* -----------------------------06.04.00 12:44--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SwXTextSections::getImplementationName(void) throw( RuntimeException )
{
return C2U("SwXTextSections");
}
-/* -----------------------------06.04.00 12:44--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXTextSections::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return C2U("com.sun.star.text.TextSections") == rServiceName;
}
-/* -----------------------------06.04.00 12:44--------------------------------
- ---------------------------------------------------------------------------*/
Sequence< OUString > SwXTextSections::getSupportedServiceNames(void) throw( RuntimeException )
{
Sequence< OUString > aRet(1);
@@ -1282,22 +1196,16 @@ Sequence< OUString > SwXTextSections::getSupportedServiceNames(void) throw( Runt
pArray[0] = C2U("com.sun.star.text.TextSections");
return aRet;
}
-/*-- 14.01.99 09:06:05---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextSections::SwXTextSections(SwDoc* _pDoc) :
SwUnoCollection(_pDoc)
{
}
-/*-- 14.01.99 09:06:05---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextSections::~SwXTextSections()
{
}
-/*-- 14.01.99 09:06:05---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SwXTextSections::getCount(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1312,9 +1220,7 @@ sal_Int32 SwXTextSections::getCount(void) throw( uno::RuntimeException )
}
return nCount;
}
-/*-- 14.01.99 09:06:06---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXTextSections::getByIndex(sal_Int32 nIndex)
throw( IndexOutOfBoundsException, WrappedTargetException, uno::RuntimeException )
{
@@ -1347,9 +1253,7 @@ uno::Any SwXTextSections::getByIndex(sal_Int32 nIndex)
throw uno::RuntimeException();
return makeAny(xRet);
}
-/*-- 14.01.99 09:06:06---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXTextSections::getByName(const OUString& Name)
throw( NoSuchElementException, WrappedTargetException, uno::RuntimeException )
{
@@ -1378,9 +1282,7 @@ uno::Any SwXTextSections::getByName(const OUString& Name)
throw uno::RuntimeException();
return aRet;
}
-/*-- 14.01.99 09:06:06---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< OUString > SwXTextSections::getElementNames(void)
throw( uno::RuntimeException )
{
@@ -1413,9 +1315,7 @@ uno::Sequence< OUString > SwXTextSections::getElementNames(void)
}
return aSeq;
}
-/*-- 14.01.99 09:06:06---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextSections::hasByName(const OUString& Name)
throw( uno::RuntimeException )
{
@@ -1443,16 +1343,12 @@ sal_Bool SwXTextSections::hasByName(const OUString& Name)
}
return bRet;
}
-/*-- 14.01.99 09:06:06---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Type SAL_CALL SwXTextSections::getElementType() throw(uno::RuntimeException)
{
return ::getCppuType((uno::Reference<XTextSection>*)0);
}
-/*-- 14.01.99 09:06:06---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextSections::hasElements(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1466,9 +1362,7 @@ sal_Bool SwXTextSections::hasElements(void) throw( uno::RuntimeException )
throw uno::RuntimeException();
return nCount > 0;
}
-/*-- 14.01.99 09:06:07---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< XTextSection > SwXTextSections::GetObject( SwSectionFmt& rFmt )
{
return SwXTextSection::CreateXTextSection(&rFmt);
@@ -1642,23 +1536,16 @@ sal_Bool SwXNumberingRulesCollection::hasElements(void) throw( uno::RuntimeExcep
return GetDoc()->GetNumRuleTbl().Count() > 0;
}
-/* -----------------------------06.04.00 12:44--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SwXFootnotes::getImplementationName(void) throw( RuntimeException )
{
return C2U("SwXFootnotes");
}
-/* -----------------------------06.04.00 12:44--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXFootnotes::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return C2U("com.sun.star.text.Footnotes") == rServiceName;
}
-/* -----------------------------06.04.00 12:44--------------------------------
- ---------------------------------------------------------------------------*/
Sequence< OUString > SwXFootnotes::getSupportedServiceNames(void) throw( RuntimeException )
{
Sequence< OUString > aRet(1);
@@ -1666,23 +1553,17 @@ Sequence< OUString > SwXFootnotes::getSupportedServiceNames(void) throw( Runtime
pArray[0] = C2U("com.sun.star.text.Footnotes");
return aRet;
}
-/*-- 14.01.99 09:03:52---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXFootnotes::SwXFootnotes(sal_Bool bEnd, SwDoc* _pDoc)
: SwUnoCollection(_pDoc)
, m_bEndnote(bEnd)
{
}
-/*-- 14.01.99 09:03:52---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXFootnotes::~SwXFootnotes()
{
}
-/*-- 14.01.99 09:03:53---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SwXFootnotes::getCount(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1701,9 +1582,7 @@ sal_Int32 SwXFootnotes::getCount(void) throw( uno::RuntimeException )
}
return nCount;
}
-/*-- 14.01.99 09:03:53---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXFootnotes::getByIndex(sal_Int32 nIndex)
throw( IndexOutOfBoundsException, WrappedTargetException, uno::RuntimeException )
{
@@ -1737,16 +1616,12 @@ uno::Any SwXFootnotes::getByIndex(sal_Int32 nIndex)
throw uno::RuntimeException();
return aRet;
}
-/*-- 14.01.99 09:03:53---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Type SAL_CALL SwXFootnotes::getElementType() throw(uno::RuntimeException)
{
return ::getCppuType((uno::Reference<XFootnote>*)0);
}
-/*-- 14.01.99 09:03:54---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXFootnotes::hasElements(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1754,9 +1629,7 @@ sal_Bool SwXFootnotes::hasElements(void) throw( uno::RuntimeException )
throw uno::RuntimeException();
return GetDoc()->GetFtnIdxs().Count() > 0;
}
-/* -----------------------------05.09.00 12:48--------------------------------
- ---------------------------------------------------------------------------*/
Reference<XFootnote> SwXFootnotes::GetObject( SwDoc& rDoc, const SwFmtFtn& rFmt )
{
return SwXFootnote::CreateXFootnote(rDoc, rFmt);
@@ -1765,23 +1638,17 @@ Reference<XFootnote> SwXFootnotes::GetObject( SwDoc& rDoc, const SwFmtFtn& rFmt
/******************************************************************
*
******************************************************************/
-/* -----------------------------06.04.00 12:44--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXReferenceMarks::getImplementationName(void) throw( RuntimeException )
{
return C2U("SwXReferenceMarks");
}
-/* -----------------------------06.04.00 12:44--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXReferenceMarks::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return C2U("com.sun.star.text.ReferenceMarks") == rServiceName;
}
-/* -----------------------------06.04.00 12:44--------------------------------
- ---------------------------------------------------------------------------*/
Sequence< OUString > SwXReferenceMarks::getSupportedServiceNames(void) throw( RuntimeException )
{
Sequence< OUString > aRet(1);
@@ -1789,22 +1656,16 @@ Sequence< OUString > SwXReferenceMarks::getSupportedServiceNames(void) throw( Ru
pArray[0] = C2U("com.sun.star.text.ReferenceMarks");
return aRet;
}
-/*-- 14.01.99 09:03:16---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXReferenceMarks::SwXReferenceMarks(SwDoc* _pDoc) :
SwUnoCollection(_pDoc)
{
}
-/*-- 14.01.99 09:03:16---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXReferenceMarks::~SwXReferenceMarks()
{
}
-/*-- 14.01.99 09:03:17---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SwXReferenceMarks::getCount(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1812,9 +1673,7 @@ sal_Int32 SwXReferenceMarks::getCount(void) throw( uno::RuntimeException )
throw uno::RuntimeException();
return GetDoc()->GetRefMarks();
}
-/*-- 14.01.99 09:03:17---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXReferenceMarks::getByIndex(sal_Int32 nIndex)
throw( IndexOutOfBoundsException, WrappedTargetException, uno::RuntimeException )
{
@@ -1836,9 +1695,7 @@ uno::Any SwXReferenceMarks::getByIndex(sal_Int32 nIndex)
throw IndexOutOfBoundsException();
return aRet;
}
-/*-- 14.01.99 09:03:17---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXReferenceMarks::getByName(const OUString& rName)
throw( NoSuchElementException, WrappedTargetException, uno::RuntimeException )
{
@@ -1859,9 +1716,7 @@ uno::Any SwXReferenceMarks::getByName(const OUString& rName)
throw uno::RuntimeException();
return aRet;
}
-/*-- 14.01.99 09:03:17---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< OUString > SwXReferenceMarks::getElementNames(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1879,9 +1734,7 @@ uno::Sequence< OUString > SwXReferenceMarks::getElementNames(void) throw( uno::R
throw uno::RuntimeException();
return aRet;
}
-/*-- 14.01.99 09:03:17---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXReferenceMarks::hasByName(const OUString& rName) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1889,16 +1742,12 @@ sal_Bool SwXReferenceMarks::hasByName(const OUString& rName) throw( uno::Runtime
throw uno::RuntimeException();
return 0 != GetDoc()->GetRefMark( rName);
}
-/*-- 14.01.99 09:03:18---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Type SAL_CALL SwXReferenceMarks::getElementType() throw(uno::RuntimeException)
{
return ::getCppuType((uno::Reference<XTextContent>*)0);
}
-/*-- 14.01.99 09:03:18---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXReferenceMarks::hasElements(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1906,9 +1755,7 @@ sal_Bool SwXReferenceMarks::hasElements(void) throw( uno::RuntimeException )
throw uno::RuntimeException();
return 0 != GetDoc()->GetRefMarks();
}
-/*-- 14.01.99 09:03:19---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXReferenceMark* SwXReferenceMarks::GetObject( SwDoc* pDoc, const SwFmtRefMark* pMark )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1919,9 +1766,7 @@ SwXReferenceMark* SwXReferenceMarks::GetObject( SwDoc* pDoc, const SwFmtRefMark*
/******************************************************************
*
******************************************************************/
-/*-----------------11.03.98 11:18-------------------
- Gueltigkeitspruefung
---------------------------------------------------*/
+
void SwUnoCollection::Invalidate()
{
bObjectValid = sal_False;
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx
index d4fc70dd3e..79d67096ae 100644
--- a/sw/source/core/unocore/unocrsrhelper.cxx
+++ b/sw/source/core/unocore/unocrsrhelper.cxx
@@ -386,7 +386,7 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
{
if( pAny )
{
- SwXTextField* pField = CreateSwXTextField(*rPam.GetDoc(),
+ SwXTextField* pField = SwXTextField::CreateSwXTextField(*rPam.GetDoc(),
pTxtAttr->GetFld());
*pAny <<= uno::Reference< XTextField >( pField );
}
@@ -783,7 +783,7 @@ void getNumberingProperty(SwPaM& rPam, PropertyState& eState, Any * pAny )
* --------------------------------------------------*/
void GetCurPageStyle(SwPaM& rPaM, String &rString)
{
- const SwPageFrm* pPage = rPaM.GetCntntNode()->GetFrm()->FindPageFrm();
+ const SwPageFrm* pPage = rPaM.GetCntntNode()->getLayoutFrm(rPaM.GetDoc()->GetCurrentLayout())->FindPageFrm();
if(pPage)
SwStyleNameMapper::FillProgName( pPage->GetPageDesc()->GetName(), rString, nsSwGetPoolIdFromName::GET_POOLID_PAGEDESC, sal_True );
}
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index 7197ef76fc..10e65dce49 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -61,7 +61,6 @@
#include <fmtornt.hxx>
#include <fmtanchr.hxx>
#include <fmtsrnd.hxx>
-// OD 2004-04-21 #i26791#
#include <fmtfollowtextflow.hxx>
#include <rootfrm.hxx>
#include <editeng/lrspitem.hxx>
@@ -87,6 +86,7 @@
#include <vcl/svapp.hxx>
#include <slist>
#include <iterator>
+#include <switerator.hxx>
using ::rtl::OUString;
using namespace ::com::sun::star;
@@ -95,9 +95,6 @@ DECLARE_STL_USTRINGACCESS_MAP( uno::Sequence< sal_Int8 > *, SwShapeImplementati
static SwShapeImplementationIdMap aImplementationIdMap;
-/* -----------------22.01.99 13:19-------------------
- *
- * --------------------------------------------------*/
class SwShapeDescriptor_Impl
{
SwFmtHoriOrient* pHOrient;
@@ -283,67 +280,50 @@ public:
class SwFmDrawPage
****************************************************************************/
-/* -----------------28.01.99 12:03-------------------
- *
- * --------------------------------------------------*/
SwFmDrawPage::SwFmDrawPage( SdrPage* pPage ) :
SvxFmDrawPage( pPage ), pPageView(0)
{
}
-/*-- 22.01.99 11:13:07---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwFmDrawPage::~SwFmDrawPage() throw ()
{
RemovePageView();
}
-/*-- 22.01.99 11:13:07---------------------------------------------------
- -----------------------------------------------------------------------*/
const SdrMarkList& SwFmDrawPage::PreGroup(const uno::Reference< drawing::XShapes > & xShapes)
{
_SelectObjectsInView( xShapes, GetPageView() );
const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
return rMarkList;
}
-/*-- 22.01.99 11:13:08---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwFmDrawPage::PreUnGroup(const uno::Reference< drawing::XShapeGroup > xShapeGroup)
{
uno::Reference< drawing::XShape > xShape( xShapeGroup, uno::UNO_QUERY);
_SelectObjectInView( xShape, GetPageView() );
}
-/*-- 22.01.99 11:13:08---------------------------------------------------
- -----------------------------------------------------------------------*/
SdrPageView* SwFmDrawPage::GetPageView()
{
if(!pPageView)
pPageView = mpView->ShowSdrPage( mpPage );
return pPageView;
}
-/*-- 22.01.99 11:13:08---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwFmDrawPage::RemovePageView()
{
if(pPageView && mpView)
mpView->HideSdrPage();
pPageView = 0;
}
-/*-- 22.01.99 11:13:09---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< uno::XInterface > SwFmDrawPage::GetInterface( SdrObject* pObj )
{
uno::Reference< XInterface > xShape;
if( pObj )
{
SwFrmFmt* pFmt = ::FindFrmFmt( pObj );
- SwXShape* pxShape = (SwXShape*)SwClientIter( *pFmt ).
- First( TYPE( SwXShape ));
+ SwXShape* pxShape = SwIterator<SwXShape,SwFmt>::FirstElement( *pFmt );
if(pxShape)
{
xShape = *(cppu::OWeakObject*)pxShape;
@@ -353,17 +333,12 @@ uno::Reference< uno::XInterface > SwFmDrawPage::GetInterface( SdrObject* pObj
}
return xShape;
}
-/*-- 22.01.99 11:13:09---------------------------------------------------
- -----------------------------------------------------------------------*/
SdrObject* SwFmDrawPage::_CreateSdrObject( const uno::Reference< drawing::XShape > & xShape ) throw ()
{
//TODO: stimmt das so - kann die Methode weg?
return SvxFmDrawPage::_CreateSdrObject( xShape );
}
-/*-- 22.01.99 11:13:09---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< drawing::XShape > SwFmDrawPage::_CreateShape( SdrObject *pObj ) const throw ()
{
@@ -508,23 +483,17 @@ uno::Reference< container::XEnumeration > SwXDrawPage::createEnumeration(void) t
return uno::Reference< container::XEnumeration >(
new SwXShapesEnumeration(this));
}
-/* -----------------------------06.04.00 13:14--------------------------------
- ---------------------------------------------------------------------------*/
rtl::OUString SwXDrawPage::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXDrawPage");
}
-/* -----------------------------06.04.00 13:14--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXDrawPage::supportsService(const rtl::OUString& rServiceName) throw( uno::RuntimeException )
{
return C2U("com.sun.star.drawing.GenericDrawPage") == rServiceName;
}
-/* -----------------------------06.04.00 13:14--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< rtl::OUString > SwXDrawPage::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< rtl::OUString > aRet(1);
@@ -532,17 +501,13 @@ uno::Sequence< rtl::OUString > SwXDrawPage::getSupportedServiceNames(void) throw
pArray[0] = C2U("com.sun.star.drawing.GenericDrawPage");
return aRet;
}
-/*-- 22.01.99 11:22:25---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXDrawPage::SwXDrawPage(SwDoc* pDc) :
pDoc(pDc),
pDrawPage(0)
{
}
-/*-- 22.01.99 11:22:25---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXDrawPage::~SwXDrawPage()
{
if(xPageAgg.is())
@@ -551,9 +516,7 @@ SwXDrawPage::~SwXDrawPage()
xPageAgg->setDelegator(xInt);
}
}
-/* -----------------------------15.06.00 15:00--------------------------------
- ---------------------------------------------------------------------------*/
uno::Any SwXDrawPage::queryInterface( const uno::Type& aType )
throw( uno::RuntimeException )
{
@@ -573,9 +536,7 @@ uno::Any SwXDrawPage::queryInterface( const uno::Type& aType )
}
return aRet;
}
-/* -----------------------------15.06.00 15:01--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< uno::Type > SwXDrawPage::getTypes() throw( uno::RuntimeException )
{
uno::Sequence< uno::Type > aPageTypes = SwXDrawPageBaseClass::getTypes();
@@ -594,9 +555,7 @@ uno::Sequence< uno::Type > SwXDrawPage::getTypes() throw( uno::RuntimeException
pPageTypes[nIndex] = ::getCppuType((uno::Reference<form::XFormsSupplier2>*)0);
return aPageTypes;
}
-/*-- 22.01.99 11:33:44---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SwXDrawPage::getCount(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -610,9 +569,7 @@ sal_Int32 SwXDrawPage::getCount(void) throw( uno::RuntimeException )
return pDrawPage->getCount();
}
}
-/*-- 22.01.99 11:33:46---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXDrawPage::getByIndex(sal_Int32 nIndex)
throw( lang::IndexOutOfBoundsException, lang::WrappedTargetException,
uno::RuntimeException )
@@ -626,16 +583,12 @@ uno::Any SwXDrawPage::getByIndex(sal_Int32 nIndex)
((SwXDrawPage*)this)->GetSvxPage();
return pDrawPage->getByIndex( nIndex );
}
-/* -----------------22.01.99 13:13-------------------
- *
- * --------------------------------------------------*/
+
uno::Type SwXDrawPage::getElementType(void) throw( uno::RuntimeException )
{
return ::getCppuType((const uno::Reference<drawing::XShape>*)0);
}
-/* -----------------22.01.99 13:13-------------------
- *
- * --------------------------------------------------*/
+
sal_Bool SwXDrawPage::hasElements(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -647,9 +600,6 @@ sal_Bool SwXDrawPage::hasElements(void) throw( uno::RuntimeException )
return ((SwXDrawPage*)this)->GetSvxPage()->hasElements();
}
-/* -----------------22.01.99 12:42-------------------
- *
- * --------------------------------------------------*/
void SwXDrawPage::add(const uno::Reference< drawing::XShape > & xShape)
throw( uno::RuntimeException )
{
@@ -791,11 +741,11 @@ void SwXDrawPage::add(const uno::Reference< drawing::XShape > & xShape)
else
throw uno::RuntimeException();
}
- else if ((aAnchor.GetAnchorId() != FLY_AT_PAGE) && pDoc->GetRootFrm())
+ else if ((aAnchor.GetAnchorId() != FLY_AT_PAGE) && pDoc->GetCurrentLayout())
{
SwCrsrMoveState aState( MV_SETONLYTEXT );
Point aTmp(MM100_TO_TWIP(aMM100Pos.X), MM100_TO_TWIP(aMM100Pos.Y));
- pDoc->GetRootFrm()->GetCrsrOfst( pPam->GetPoint(), aTmp, &aState );
+ pDoc->GetCurrentLayout()->GetCrsrOfst( pPam->GetPoint(), aTmp, &aState ); //swmod 080218
aAnchor.SetAnchor( pPam->GetPoint() );
// --> OD 2004-08-18 #i32349# - adjustment of vertical positioning
@@ -822,9 +772,7 @@ void SwXDrawPage::add(const uno::Reference< drawing::XShape > & xShape)
delete pPam;
delete pInternalPam;
}
-/* -----------------22.01.99 12:42-------------------
- *
- * --------------------------------------------------*/
+
void SwXDrawPage::remove(const uno::Reference< drawing::XShape > & xShape) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -833,9 +781,7 @@ void SwXDrawPage::remove(const uno::Reference< drawing::XShape > & xShape) throw
uno::Reference<lang::XComponent> xComp(xShape, uno::UNO_QUERY);
xComp->dispose();
}
-/* -----------------17.02.99 10:38-------------------
- *
- * --------------------------------------------------*/
+
uno::Reference< drawing::XShapeGroup > SwXDrawPage::group(const uno::Reference< drawing::XShapes > & xShapes) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -889,9 +835,7 @@ uno::Reference< drawing::XShapeGroup > SwXDrawPage::group(const uno::Reference<
}
return xRet;
}
-/* -----------------17.02.99 10:38-------------------
- *
- * --------------------------------------------------*/
+
void SwXDrawPage::ungroup(const uno::Reference< drawing::XShapeGroup > & xShapeGroup) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -915,9 +859,7 @@ void SwXDrawPage::ungroup(const uno::Reference< drawing::XShapeGroup > & xShapeG
pPage->RemovePageView();
}
}
-/* -----------------05.05.98 17:05-------------------
- *
- * --------------------------------------------------*/
+
SwFmDrawPage* SwXDrawPage::GetSvxPage()
{
if(!xPageAgg.is() && pDoc)
@@ -953,17 +895,13 @@ void SwXDrawPage::InvalidateSwDoc()
****************************************************************************/
TYPEINIT1(SwXShape, SwClient);
-/* -----------------------------10.03.00 18:02--------------------------------
- ---------------------------------------------------------------------------*/
const uno::Sequence< sal_Int8 > & SwXShape::getUnoTunnelId()
{
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
return aSeq;
}
-/* -----------------------------10.03.00 18:04--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SAL_CALL SwXShape::getSomething( const uno::Sequence< sal_Int8 >& rId )
throw(uno::RuntimeException)
{
@@ -997,9 +935,7 @@ namespace
}
}
-/* -----------------01.02.99 11:38-------------------
- *
- * --------------------------------------------------*/
+
SwXShape::SwXShape(uno::Reference< uno::XInterface > & xShape) :
m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_SHAPE)),
m_pPropertyMapEntries(aSwMapProvider.GetPropertyMapEntries(PROPERTY_MAP_TEXT_SHAPE)),
@@ -1049,9 +985,6 @@ SwXShape::SwXShape(uno::Reference< uno::XInterface > & xShape) :
}
}
-/*-- 09.04.09 15:06:13---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwXShape::AddExistingShapeToFmt( SdrObject& _rObj )
{
SdrObjListIter aIter( _rObj, IM_DEEPNOGROUPS );
@@ -1086,9 +1019,7 @@ void SwXShape::AddExistingShapeToFmt( SdrObject& _rObj )
}
}
-/*-- 22.01.99 11:42:26---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXShape::~SwXShape()
{
if (xShapeAgg.is())
@@ -1098,9 +1029,7 @@ SwXShape::~SwXShape()
}
delete pImpl;
}
-/* -----------------------------16.06.00 12:21--------------------------------
- ---------------------------------------------------------------------------*/
uno::Any SwXShape::queryInterface( const uno::Type& aType ) throw( uno::RuntimeException )
{
uno::Any aRet = SwXShapeBaseClass::queryInterface(aType);
@@ -1117,9 +1046,7 @@ uno::Any SwXShape::queryInterface( const uno::Type& aType ) throw( uno::RuntimeE
// <--
return aRet;
}
-/* -----------------------------16.06.00 12:21--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< uno::Type > SwXShape::getTypes( ) throw(uno::RuntimeException)
{
uno::Sequence< uno::Type > aRet = SwXShapeBaseClass::getTypes();
@@ -1143,9 +1070,7 @@ uno::Sequence< uno::Type > SwXShape::getTypes( ) throw(uno::RuntimeException)
}
return aRet;
}
-/* -----------------------------04.04.01 07:37--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< sal_Int8 > SwXShape::getImplementationId( ) throw(uno::RuntimeException)
{
vos::OGuard aGuard( Application::GetSolarMutex() );
@@ -1187,9 +1112,7 @@ uno::Sequence< sal_Int8 > SwXShape::getImplementationId( ) throw(uno::RuntimeEx
return *pImplementationId;
}
}
-/*-- 22.01.99 11:42:26---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SwXShape::getPropertySetInfo(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1212,9 +1135,7 @@ uno::Reference< beans::XPropertySetInfo > SwXShape::getPropertySetInfo(void) th
aRet = m_pPropSet->getPropertySetInfo();
return aRet;
}
-/*-- 22.01.99 11:42:27---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::Any& aValue)
throw( beans::UnknownPropertyException, beans::PropertyVetoException,
lang::IllegalArgumentException, lang::WrappedTargetException,
@@ -1357,7 +1278,7 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
pFmt->SetPositionLayoutDir( nPositionLayoutDir );
}
// <--
- else if( pDoc->GetRootFrm() )
+ else if( pDoc->GetCurrentLayout()) //swmod 080218
{
UnoActionContext aCtx(pDoc);
if(RES_ANCHOR == pEntry->nWID && MID_ANCHOR_ANCHORTYPE == pEntry->nMemberId)
@@ -1422,11 +1343,11 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
//if the fly has been anchored at page then it needs to be connected
//to the content position
SwPaM aPam(pDoc->GetNodes().GetEndOfContent());
- if( pDoc->GetRootFrm() )
+ if( pDoc->GetCurrentLayout() )
{
SwCrsrMoveState aState( MV_SETONLYTEXT );
Point aTmp( pObj->GetSnapRect().TopLeft() );
- pDoc->GetRootFrm()->GetCrsrOfst( aPam.GetPoint(), aTmp, &aState );
+ pDoc->GetCurrentLayout()->GetCrsrOfst( aPam.GetPoint(), aTmp, &aState );
}
else
{
@@ -1541,7 +1462,7 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
aKeepedPosition = getPosition();
}
// <--
- if( pFmt && pFmt->GetDoc()->GetRootFrm() )
+ if( pFmt && pFmt->GetDoc()->GetCurrentViewShell() ) //swmod 071108//swmod 071225
{
UnoActionContext aCtx(pFmt->GetDoc());
xPrSet->setPropertyValue(rPropertyName, aValue);
@@ -1576,9 +1497,7 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
}
}
}
-/*-- 22.01.99 11:42:27---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXShape::getPropertyValue(const rtl::OUString& rPropertyName)
throw( beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException )
@@ -1808,12 +1727,6 @@ uno::Any SwXShape::getPropertyValue(const rtl::OUString& rPropertyName)
return aRet;
}
-/** method to get property from aggregation object
-
- OD 2004-10-28 #i36248#
-
- @author OD
-*/
uno::Any SwXShape::_getPropAtAggrObj( const ::rtl::OUString& _rPropertyName )
throw( beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException )
@@ -1835,9 +1748,6 @@ uno::Any SwXShape::_getPropAtAggrObj( const ::rtl::OUString& _rPropertyName )
}
-/* -----------------------------02.11.00 09:41--------------------------------
-
- ---------------------------------------------------------------------------*/
beans::PropertyState SwXShape::getPropertyState( const rtl::OUString& rPropertyName )
throw(beans::UnknownPropertyException, uno::RuntimeException)
{
@@ -1848,9 +1758,7 @@ beans::PropertyState SwXShape::getPropertyState( const rtl::OUString& rPropertyN
uno::Sequence< beans::PropertyState > aStates = getPropertyStates(aNames);
return aStates.getConstArray()[0];
}
-/* -----------------------------02.11.00 09:41--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< beans::PropertyState > SwXShape::getPropertyStates(
const uno::Sequence< rtl::OUString >& aPropertyNames )
throw(beans::UnknownPropertyException, uno::RuntimeException)
@@ -1952,9 +1860,7 @@ uno::Sequence< beans::PropertyState > SwXShape::getPropertyStates(
throw uno::RuntimeException();
return aRet;
}
-/* -----------------------------02.11.00 09:41--------------------------------
- ---------------------------------------------------------------------------*/
void SwXShape::setPropertyToDefault( const rtl::OUString& rPropertyName )
throw(beans::UnknownPropertyException, uno::RuntimeException)
{
@@ -2016,9 +1922,7 @@ void SwXShape::setPropertyToDefault( const rtl::OUString& rPropertyName )
else
throw uno::RuntimeException();
}
-/* -----------------------------02.11.00 09:41--------------------------------
- ---------------------------------------------------------------------------*/
uno::Any SwXShape::getPropertyDefault( const rtl::OUString& rPropertyName )
throw( beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException )
@@ -2054,9 +1958,7 @@ uno::Any SwXShape::getPropertyDefault( const rtl::OUString& rPropertyName )
throw uno::RuntimeException();
return aRet;
}
-/*-- 22.01.99 11:42:27---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXShape::addPropertyChangeListener(
const rtl::OUString& _propertyName,
const uno::Reference< beans::XPropertyChangeListener > & _listener )
@@ -2071,9 +1973,7 @@ void SwXShape::addPropertyChangeListener(
if ( xShapeAgg->queryAggregation( beans::XPropertySet::static_type() ) >>= xShapeProps )
xShapeProps->addPropertyChangeListener( _propertyName, _listener );
}
-/*-- 22.01.99 11:42:27---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXShape::removePropertyChangeListener(
const rtl::OUString& _propertyName,
const uno::Reference< beans::XPropertyChangeListener > & _listener)
@@ -2088,9 +1988,7 @@ void SwXShape::removePropertyChangeListener(
if ( xShapeAgg->queryAggregation( beans::XPropertySet::static_type() ) >>= xShapeProps )
xShapeProps->removePropertyChangeListener( _propertyName, _listener );
}
-/*-- 22.01.99 11:42:28---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXShape::addVetoableChangeListener(
const rtl::OUString& /*PropertyName*/,
const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/ )
@@ -2099,9 +1997,7 @@ void SwXShape::addVetoableChangeListener(
{
DBG_WARNING("not implemented");
}
-/*-- 22.01.99 11:42:28---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXShape::removeVetoableChangeListener(
const rtl::OUString& /*PropertyName*/,
const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/)
@@ -2110,16 +2006,12 @@ void SwXShape::removeVetoableChangeListener(
{
DBG_WARNING("not implemented");
}
-/*-- 22.01.99 11:42:28---------------------------------------------------
- -----------------------------------------------------------------------*/
-void SwXShape::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXShape::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
}
-/* -----------------14.04.99 13:02-------------------
- *
- * --------------------------------------------------*/
+
void SwXShape::attach(const uno::Reference< text::XTextRange > & xTextRange)
throw( lang::IllegalArgumentException, uno::RuntimeException )
{
@@ -2187,9 +2079,7 @@ void SwXShape::attach(const uno::Reference< text::XTextRange > & xTextRange)
}
}
}
-/* -----------------14.04.99 13:02-------------------
- *
- * --------------------------------------------------*/
+
uno::Reference< text::XTextRange > SwXShape::getAnchor(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -2211,9 +2101,7 @@ uno::Reference< text::XTextRange > SwXShape::getAnchor(void) throw( uno::Runtim
aRef = pImpl->GetTextRange();
return aRef;
}
-/* -----------------14.04.99 13:02-------------------
- *
- * --------------------------------------------------*/
+
void SwXShape::dispose(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -2264,9 +2152,7 @@ void SwXShape::dispose(void) throw( uno::RuntimeException )
xComp->dispose();
}
}
-/* -----------------14.04.99 13:02-------------------
- *
- * --------------------------------------------------*/
+
void SwXShape::addEventListener(
const uno::Reference< lang::XEventListener > & aListener)
throw( uno::RuntimeException )
@@ -2276,9 +2162,7 @@ void SwXShape::addEventListener(
if(pSvxShape)
pSvxShape->addEventListener(aListener);
}
-/* -----------------14.04.99 13:02-------------------
- *
- * --------------------------------------------------*/
+
void SwXShape::removeEventListener(
const uno::Reference< lang::XEventListener > & aListener)
throw( uno::RuntimeException )
@@ -2287,16 +2171,12 @@ void SwXShape::removeEventListener(
if(pSvxShape)
pSvxShape->removeEventListener(aListener);
}
-/* -----------------03.06.99 08:53-------------------
- *
- * --------------------------------------------------*/
+
rtl::OUString SwXShape::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXShape");
}
-/* -----------------03.06.99 08:53-------------------
- *
- * --------------------------------------------------*/
+
sal_Bool SwXShape::supportsService(const rtl::OUString& rServiceName) throw( uno::RuntimeException )
{
sal_Bool bRet = sal_False;
@@ -2310,9 +2190,7 @@ sal_Bool SwXShape::supportsService(const rtl::OUString& rServiceName) throw( uno
}
return bRet;
}
-/* -----------------03.06.99 08:53-------------------
- *
- * --------------------------------------------------*/
+
uno::Sequence< rtl::OUString > SwXShape::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< rtl::OUString > aSeq;
@@ -2330,9 +2208,7 @@ uno::Sequence< rtl::OUString > SwXShape::getSupportedServiceNames(void) throw( u
}
return aSeq;
}
-/* -----------------------------15.03.00 14:54--------------------------------
- ---------------------------------------------------------------------------*/
SvxShape* SwXShape::GetSvxShape()
{
SvxShape* pSvxShape = 0;
@@ -2910,9 +2786,7 @@ void SwXShape::_AdjustPositionProperties( const awt::Point _aPosition )
return aConvertedPath;
}
-/*-- 31.05.01 09:59:19---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXGroupShape::SwXGroupShape(uno::Reference< XInterface > & xShape) :
SwXShape(xShape)
{
@@ -2922,15 +2796,11 @@ SwXGroupShape::SwXGroupShape(uno::Reference< XInterface > & xShape) :
#endif
}
-/*-- 31.05.01 09:59:19---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXGroupShape::~SwXGroupShape()
{
}
-/*-- 31.05.01 09:59:19---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXGroupShape::queryInterface( const uno::Type& rType ) throw(uno::RuntimeException)
{
uno::Any aRet;
@@ -2940,23 +2810,17 @@ uno::Any SwXGroupShape::queryInterface( const uno::Type& rType ) throw(uno::Runt
aRet = SwXShape::queryInterface(rType);
return aRet;
}
-/*-- 31.05.01 09:59:19---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXGroupShape::acquire( ) throw()
{
SwXShape::acquire();
}
-/*-- 31.05.01 09:59:19---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXGroupShape::release( ) throw()
{
SwXShape::release();
}
-/*-- 31.05.01 09:59:19---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXGroupShape::add( const uno::Reference< XShape >& xShape ) throw (uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -3015,9 +2879,7 @@ void SwXGroupShape::add( const uno::Reference< XShape >& xShape ) throw (uno::Ru
else
throw uno::RuntimeException();
}
-/*-- 31.05.01 09:59:20---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXGroupShape::remove( const uno::Reference< XShape >& xShape ) throw (uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -3032,9 +2894,7 @@ void SwXGroupShape::remove( const uno::Reference< XShape >& xShape ) throw (uno:
throw uno::RuntimeException();
xShapes->remove(xShape);
}
-/*-- 31.05.01 09:59:20---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SwXGroupShape::getCount(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -3049,9 +2909,7 @@ sal_Int32 SwXGroupShape::getCount(void) throw( uno::RuntimeException )
throw uno::RuntimeException();
return xAcc->getCount();
}
-/*-- 31.05.01 09:59:20---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXGroupShape::getByIndex(sal_Int32 nIndex)
throw( lang::IndexOutOfBoundsException, lang::WrappedTargetException,
uno::RuntimeException )
@@ -3068,9 +2926,7 @@ uno::Any SwXGroupShape::getByIndex(sal_Int32 nIndex)
throw uno::RuntimeException();
return xAcc->getByIndex(nIndex);
}
-/*-- 31.05.01 09:59:20---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Type SwXGroupShape::getElementType( ) throw(uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -3085,9 +2941,7 @@ uno::Type SwXGroupShape::getElementType( ) throw(uno::RuntimeException)
throw uno::RuntimeException();
return xAcc->getElementType();
}
-/*-- 31.05.01 09:59:22---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXGroupShape::hasElements( ) throw(uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx
index f6e1a87d21..b9ae52799f 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -93,6 +93,7 @@
#include <editeng/outliner.hxx>
#include <docsh.hxx>
#include <fmtmeta.hxx> // MetaFieldManager
+#include <switerator.hxx>
using ::rtl::OUString;
using namespace ::com::sun::star;
@@ -392,17 +393,13 @@ sal_uInt16 lcl_GetPropertyMapOfService( sal_uInt16 nServiceId )
* SwXFieldMaster
******************************************************************/
TYPEINIT1(SwXFieldMaster, SwClient);
-/* -----------------------------13.03.00 12:15--------------------------------
- ---------------------------------------------------------------------------*/
const uno::Sequence< sal_Int8 > & SwXFieldMaster::getUnoTunnelId()
{
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
return aSeq;
}
-/* -----------------------------10.03.00 18:04--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SAL_CALL SwXFieldMaster::getSomething( const uno::Sequence< sal_Int8 >& rId )
throw(uno::RuntimeException)
{
@@ -414,16 +411,12 @@ sal_Int64 SAL_CALL SwXFieldMaster::getSomething( const uno::Sequence< sal_Int8 >
}
return 0;
}
-/* -----------------------------06.04.00 13:22--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXFieldMaster::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXFieldMaster");
}
-/* -----------------------------06.04.00 13:22--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXFieldMaster::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
sal_Bool bRet = sal_False;
@@ -452,9 +445,7 @@ sal_Bool SwXFieldMaster::supportsService(const OUString& rServiceName) throw( un
}
return bRet;
}
-/* -----------------------------06.04.00 13:22--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SwXFieldMaster::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(2);
@@ -479,9 +470,7 @@ uno::Sequence< OUString > SwXFieldMaster::getSupportedServiceNames(void) throw(
}
return aRet;
}
-/*-- 14.12.98 11:08:33---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXFieldMaster::SwXFieldMaster(SwDoc* pDoc, sal_uInt16 nResId) :
aLstnrCntnr( (XPropertySet*)this),
nResTypeId(nResId),
@@ -494,9 +483,7 @@ SwXFieldMaster::SwXFieldMaster(SwDoc* pDoc, sal_uInt16 nResId) :
{
pDoc->GetPageDescFromPool(RES_POOLPAGE_STANDARD)->Add(this);
}
-/*-- 14.12.98 11:08:33---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXFieldMaster::SwXFieldMaster(SwFieldType& rType, SwDoc* pDoc) :
SwClient(&rType),
aLstnrCntnr( (XPropertySet*)this),
@@ -509,16 +496,12 @@ SwXFieldMaster::SwXFieldMaster(SwFieldType& rType, SwDoc* pDoc) :
{
}
-/*-- 14.12.98 11:08:34---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXFieldMaster::~SwXFieldMaster()
{
}
-/*-- 14.12.98 11:08:35---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SwXFieldMaster::getPropertySetInfo(void)
throw( uno::RuntimeException )
{
@@ -528,9 +511,7 @@ uno::Reference< beans::XPropertySetInfo > SwXFieldMaster::getPropertySetInfo(vo
lcl_GetPropMapIdForFieldType( nResTypeId ) )->getPropertySetInfo();
return aRef;
}
-/*-- 14.12.98 11:08:35---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFieldMaster::setPropertyValue( const OUString& rPropertyName,
const uno::Any& rValue)
throw( beans::UnknownPropertyException, beans::PropertyVetoException,
@@ -712,9 +693,7 @@ void SwXFieldMaster::setPropertyValue( const OUString& rPropertyName,
}
}
}
-/* -----------------------------30.03.01 14:40--------------------------------
- ---------------------------------------------------------------------------*/
SwFieldType* SwXFieldMaster::GetFldType(sal_Bool bDontCreate) const
{
if(!bDontCreate && RES_DBFLD == nResTypeId && m_bIsDescriptor && m_pDoc)
@@ -743,9 +722,7 @@ SwFieldType* SwXFieldMaster::GetFldType(sal_Bool bDontCreate) const
return (SwFieldType*)GetRegisteredIn();
}
-/*-- 14.12.98 11:08:36---------------------------------------------------
- -----------------------------------------------------------------------*/
typedef SwFmtFld* SwFmtFldPtr;
SV_DECL_PTRARR(SwDependentFields, SwFmtFldPtr, 5, 5)
SV_IMPL_PTRARR(SwDependentFields, SwFmtFldPtr)
@@ -772,21 +749,22 @@ uno::Any SwXFieldMaster::getPropertyValue(const OUString& rPropertyName)
else if(rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_DEPENDENT_TEXT_FIELDS)) )
{
//fill all text fields into a sequence
- SwClientIter aIter( *pType );
SwDependentFields aFldArr;
- SwFmtFldPtr pFld = (SwFmtFld*)aIter.First( TYPE( SwFmtFld ));
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pType );
+ SwFmtFldPtr pFld = aIter.First();
while(pFld)
{
if(pFld->IsFldInDoc())
aFldArr.Insert(pFld, aFldArr.Count());
- pFld = (SwFmtFld*)aIter.Next();
+ pFld = aIter.Next();
}
+
uno::Sequence<uno::Reference <text::XDependentTextField> > aRetSeq(aFldArr.Count());
uno::Reference<text::XDependentTextField>* pRetSeq = aRetSeq.getArray();
for(sal_uInt16 i = 0; i < aFldArr.Count(); i++)
{
pFld = aFldArr.GetObject(i);
- SwXTextField * pInsert = CreateSwXTextField(*GetDoc(), *pFld);
+ SwXTextField * pInsert = SwXTextField::CreateSwXTextField(*GetDoc(), *pFld);
pRetSeq[i] = uno::Reference<text::XDependentTextField>(pInsert);
}
@@ -900,38 +878,28 @@ uno::Any SwXFieldMaster::getPropertyValue(const OUString& rPropertyName)
}
return aRet;
}
-/*-- 14.12.98 11:08:36---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFieldMaster::addPropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 14.12.98 11:08:36---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFieldMaster::removePropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 14.12.98 11:08:37---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFieldMaster::addVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 14.12.98 11:08:37---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFieldMaster::removeVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 25.02.99 11:01:57---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFieldMaster::dispose(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -947,8 +915,8 @@ void SwXFieldMaster::dispose(void) throw( uno::RuntimeException )
}
// zuerst alle Felder loeschen
- SwClientIter aIter( *pFldType );
- SwFmtFld* pFld = (SwFmtFld*)aIter.First( TYPE( SwFmtFld ));
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pFldType );
+ SwFmtFld* pFld = aIter.First();
while(pFld)
{
// Feld im Undo?
@@ -961,7 +929,7 @@ void SwXFieldMaster::dispose(void) throw( uno::RuntimeException )
aPam.Move();
GetDoc()->DeleteAndJoin(aPam);
}
- pFld = (SwFmtFld*)aIter.Next();
+ pFld = aIter.Next();
}
// dann den FieldType loeschen
GetDoc()->RemoveFldType(nTypeIdx);
@@ -969,9 +937,7 @@ void SwXFieldMaster::dispose(void) throw( uno::RuntimeException )
else
throw uno::RuntimeException();
}
-/*-- 25.02.99 11:02:00---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFieldMaster::addEventListener(const uno::Reference< lang::XEventListener > & aListener)
throw( uno::RuntimeException )
{
@@ -979,9 +945,7 @@ void SwXFieldMaster::addEventListener(const uno::Reference< lang::XEventListener
throw uno::RuntimeException();
aLstnrCntnr.AddListener(aListener);
}
-/*-- 25.02.99 11:02:02---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFieldMaster::removeEventListener(const uno::Reference< lang::XEventListener > & aListener)
throw( uno::RuntimeException )
{
@@ -989,10 +953,8 @@ void SwXFieldMaster::removeEventListener(const uno::Reference< lang::XEventListe
throw uno::RuntimeException();
}
-/*-- 14.12.98 11:08:38---------------------------------------------------
- -----------------------------------------------------------------------*/
-void SwXFieldMaster::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXFieldMaster::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
if(!GetRegisteredIn())
@@ -1001,31 +963,7 @@ void SwXFieldMaster::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
m_pDoc = 0;
}
}
-/* -----------------------------06.11.00 09:44--------------------------------
-
-const Programmatic2UIName_Impl* lcl_GetFieldNameTable()
-{
- static sal_Bool bInitialized = sal_False;
- static Programmatic2UIName_Impl aFieldNames[5];
- if(!bInitialized)
- {
- bInitialized = sal_True;
- int nName = 0;
- aFieldNames[nName].sUIName = String (SW_RES(STR_POOLCOLL_LABEL_ABB ));
- aFieldNames[nName++].sProgrammaticName = String (SW_RES(STR_POCO_PRGM_LABEL_ABB));
- aFieldNames[nName].sUIName = String (SW_RES(STR_POOLCOLL_LABEL_TABLE ));
- aFieldNames[nName++].sProgrammaticName = String (SW_RES(STR_POCO_PRGM_LABEL_TABLE));
- aFieldNames[nName].sUIName = String (SW_RES(STR_POOLCOLL_LABEL_FRAME));
- aFieldNames[nName++].sProgrammaticName = String (SW_RES(STR_POCO_PRGM_LABEL_FRAME));
- aFieldNames[nName].sUIName = String (SW_RES(STR_POOLCOLL_LABEL_DRAWING ));
- aFieldNames[nName++].sProgrammaticName = String (SW_RES(STR_POCO_PRGM_LABEL_DRAWING));
- }
- return &aFieldNames[0];
-}
- ---------------------------------------------------------------------------*/
-/* -----------------------------06.11.00 10:26--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXFieldMaster::GetProgrammaticName(const SwFieldType& rType, SwDoc& rDoc)
{
OUString sRet(rType.GetName());
@@ -1043,9 +981,7 @@ OUString SwXFieldMaster::GetProgrammaticName(const SwFieldType& rType, SwDoc& rD
}
return sRet;
}
-/* -----------------------------06.11.00 14:12--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXFieldMaster::LocalizeFormula(
const SwSetExpField& rFld,
const OUString& rFormula,
@@ -1068,12 +1004,11 @@ OUString SwXFieldMaster::LocalizeFormula(
}
-SwXTextField * CreateSwXTextField(SwDoc & rDoc, SwFmtFld const& rFmt)
+SwXTextField* SwXTextField::CreateSwXTextField(SwDoc & rDoc, SwFmtFld const& rFmt)
{
- SwClientIter aIter(*rFmt.GetFld()->GetTyp());
+ SwIterator<SwXTextField,SwFieldType> aIter(*rFmt.GetFld()->GetTyp());
SwXTextField * pField = 0;
- SwXTextField * pTemp =
- static_cast<SwXTextField*>(aIter.First( TYPE(SwXTextField) ));
+ SwXTextField * pTemp = aIter.First();
while (pTemp)
{
if (pTemp->GetFldFmt() == &rFmt)
@@ -1081,7 +1016,7 @@ SwXTextField * CreateSwXTextField(SwDoc & rDoc, SwFmtFld const& rFmt)
pField = pTemp;
break;
}
- pTemp = static_cast<SwXTextField*>(aIter.Next());
+ pTemp = aIter.Next();
}
return pField ? pField : new SwXTextField( rFmt, &rDoc );
}
@@ -1136,17 +1071,13 @@ struct SwFieldProperties_Impl
};
TYPEINIT1(SwXTextField, SwClient);
-/* -----------------------------13.03.00 12:15--------------------------------
- ---------------------------------------------------------------------------*/
const uno::Sequence< sal_Int8 > & SwXTextField::getUnoTunnelId()
{
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
return aSeq;
}
-/* -----------------------------10.03.00 18:04--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SAL_CALL SwXTextField::getSomething( const uno::Sequence< sal_Int8 >& rId )
throw(uno::RuntimeException)
{
@@ -1158,9 +1089,6 @@ sal_Int64 SAL_CALL SwXTextField::getSomething( const uno::Sequence< sal_Int8 >&
}
return 0;
}
-/*-- 14.12.98 11:37:14---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXTextField::SwXTextField(sal_uInt16 nServiceId, SwDoc* pDoc) :
aLstnrCntnr( (XTextContent*)this),
@@ -1184,9 +1112,7 @@ SwXTextField::SwXTextField(sal_uInt16 nServiceId, SwDoc* pDoc) :
m_pProps->nUSHORT2 = USHRT_MAX;
}
-/*-- 14.12.98 11:37:15---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextField::SwXTextField(const SwFmtFld& rFmt, SwDoc* pDc) :
aLstnrCntnr( (XTextContent*)this),
pFmtFld(&rFmt),
@@ -1199,9 +1125,7 @@ SwXTextField::SwXTextField(const SwFmtFld& rFmt, SwDoc* pDc) :
{
pDc->GetUnoCallBack()->Add(this);
}
-/*-- 14.12.98 11:37:15---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextField::~SwXTextField()
{
if ( m_pTextObject )
@@ -1212,9 +1136,7 @@ SwXTextField::~SwXTextField()
delete m_pProps;
}
-/*-- 14.12.98 11:37:16---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextField::attachTextFieldMaster(const uno::Reference< beans::XPropertySet > & xFieldMaster)
throw( lang::IllegalArgumentException, uno::RuntimeException )
{
@@ -1237,9 +1159,7 @@ void SwXTextField::attachTextFieldMaster(const uno::Reference< beans::XPropertyS
throw lang::IllegalArgumentException();
}
-/*-- 14.12.98 11:37:16---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySet > SwXTextField::getTextFieldMaster(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1254,16 +1174,14 @@ uno::Reference< beans::XPropertySet > SwXTextField::getTextFieldMaster(void) th
throw uno::RuntimeException();
pType = pFmtFld->GetFld()->GetTyp();
}
- SwXFieldMaster* pMaster = (SwXFieldMaster*)
- SwClientIter(*pType).First(TYPE(SwXFieldMaster));
+
+ SwXFieldMaster* pMaster = SwIterator<SwXFieldMaster,SwFieldType>::FirstElement( *pType );
if(!pMaster)
pMaster = new SwXFieldMaster(*pType, GetDoc());
return pMaster;
}
-/*-- 14.12.98 11:37:16---------------------------------------------------
- -----------------------------------------------------------------------*/
OUString SwXTextField::getPresentation(sal_Bool bShowCommand) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1278,9 +1196,7 @@ OUString SwXTextField::getPresentation(sal_Bool bShowCommand) throw( uno::Runtim
: pField->ExpandField(true) );
return ret;
}
-/* -----------------18.02.99 13:39-------------------
- *
- * --------------------------------------------------*/
+
void SwXTextField::attachToRange(
const uno::Reference< text::XTextRange > & xTextRange)
throw( lang::IllegalArgumentException, uno::RuntimeException )
@@ -1854,18 +1770,14 @@ void SwXTextField::attachToRange(
else
throw lang::IllegalArgumentException();
}
-/*-- 14.12.98 11:37:18---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextField::attach(const uno::Reference< text::XTextRange > & xTextRange)
throw( lang::IllegalArgumentException, uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
attachToRange( xTextRange );
}
-/*-- 14.12.98 11:37:18---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextRange > SwXTextField::getAnchor(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1886,9 +1798,7 @@ uno::Reference< text::XTextRange > SwXTextField::getAnchor(void) throw( uno::Ru
return aRef;
}
-/*-- 14.12.98 11:37:18---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextField::dispose(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1911,26 +1821,20 @@ void SwXTextField::dispose(void) throw( uno::RuntimeException )
m_pTextObject = 0;
}
}
-/*-- 14.12.98 11:37:18---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextField::addEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException )
{
if(!GetRegisteredIn())
throw uno::RuntimeException();
aLstnrCntnr.AddListener(aListener);
}
-/*-- 14.12.98 11:37:18---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextField::removeEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException )
{
if(!GetRegisteredIn() || !aLstnrCntnr.RemoveListener(aListener))
throw uno::RuntimeException();
}
-/*-- 14.12.98 11:37:19---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SwXTextField::getPropertySetInfo(void)
throw( uno::RuntimeException )
{
@@ -1952,9 +1856,7 @@ uno::Reference< beans::XPropertySetInfo > SwXTextField::getPropertySetInfo(void
throw uno::RuntimeException();
return aRef;
}
-/*-- 14.12.98 11:37:19---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextField::setPropertyValue(const OUString& rPropertyName, const uno::Any& rValue)
throw( beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException,
lang::WrappedTargetException, uno::RuntimeException )
@@ -2115,9 +2017,7 @@ void SwXTextField::setPropertyValue(const OUString& rPropertyName, const uno::An
else
throw uno::RuntimeException();
}
-/*-- 14.12.98 11:37:19---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXTextField::getPropertyValue(const OUString& rPropertyName)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
@@ -2303,37 +2203,27 @@ uno::Any SwXTextField::getPropertyValue(const OUString& rPropertyName)
}
return aRet;
}
-/*-- 14.12.98 11:37:20---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextField::addPropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 14.12.98 11:37:20---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextField::removePropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 14.12.98 11:37:20---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextField::addVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 14.12.98 11:37:20---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextField::removeVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/* -----------------------------23.03.01 13:15--------------------------------
- ---------------------------------------------------------------------------*/
void SwXTextField::update( ) throw (uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -2384,22 +2274,17 @@ void SwXTextField::update( ) throw (uno::RuntimeException)
}
// --> FME 2004-10-06 #116480#
// Text formatting has to be triggered.
- const_cast<SwFmtFld*>(pFmtFld)->Modify( 0, 0 );
+ const_cast<SwFmtFld*>(pFmtFld)->ModifyNotification( 0, 0 );
// <--
}
else
m_bCallUpdate = sal_True;
}
-/* -----------------19.03.99 14:11-------------------
- *
- * --------------------------------------------------*/
+
OUString SwXTextField::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXTextField");
}
-/* -----------------19.03.99 14:11-------------------
- *
- * --------------------------------------------------*/
static OUString OldNameToNewName_Impl( const OUString &rOld )
{
@@ -2429,9 +2314,7 @@ sal_Bool SwXTextField::supportsService(const OUString& rServiceName) throw( uno:
rServiceName.equalsAsciiL(
RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.TextContent"));
}
-/* -----------------19.03.99 14:11-------------------
- *
- * --------------------------------------------------*/
+
uno::Sequence< OUString > SwXTextField::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
OUString sServiceName = SwXServiceProvider::GetProviderName(m_nServiceId);
@@ -2461,10 +2344,8 @@ void SwXTextField::Invalidate()
}
}
-/* -----------------14.12.98 12:00-------------------
- *
- * --------------------------------------------------*/
-void SwXTextField::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+
+void SwXTextField::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
switch( pOld ? pOld->Which() : 0 )
{
@@ -2486,9 +2367,7 @@ void SwXTextField::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
break;
}
}
-/*-- 14.12.98 11:37:21---------------------------------------------------
- -----------------------------------------------------------------------*/
const SwField* SwXTextField::GetField() const
{
if(GetRegisteredIn() && pFmtFld)
@@ -2497,29 +2376,19 @@ const SwField* SwXTextField::GetField() const
}
/******************************************************************
- *
- ******************************************************************/
-/******************************************************************
* SwXTextFieldMasters
******************************************************************/
-/* -----------------------------06.04.00 13:22--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SwXTextFieldMasters::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXTextFieldMasters");
}
-/* -----------------------------06.04.00 13:22--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXTextFieldMasters::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(
"com.sun.star.text.TextFieldMasters" ));
}
-/* -----------------------------06.04.00 13:22--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SwXTextFieldMasters::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
@@ -2527,21 +2396,17 @@ uno::Sequence< OUString > SwXTextFieldMasters::getSupportedServiceNames(void) th
pArray[0] = C2U("com.sun.star.text.TextFieldMasters");
return aRet;
}
-/*-- 21.12.98 10:37:14---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextFieldMasters::SwXTextFieldMasters(SwDoc* _pDoc) :
SwUnoCollection(_pDoc)
{
}
-/*-- 21.12.98 10:37:32---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextFieldMasters::~SwXTextFieldMasters()
{
}
-/*-- 21.12.98 10:37:33---------------------------------------------------
+/*-----------------------------------------------------------------------
Iteration ueber nicht-Standard Feldtypen
USER/SETEXP/DDE/DATABASE
Der Name ist demnach:
@@ -2613,17 +2478,14 @@ uno::Any SwXTextFieldMasters::getByName(const OUString& rName)
SwFieldType* pType = GetDoc()->GetFldType(nResId, sName, sal_True);
if(!pType)
throw container::NoSuchElementException();
- SwXFieldMaster* pMaster = (SwXFieldMaster*)
- SwClientIter(*pType).First(TYPE(SwXFieldMaster));
+ SwXFieldMaster* pMaster = SwIterator<SwXFieldMaster,SwFieldType>::FirstElement( *pType );
if(!pMaster)
pMaster = new SwXFieldMaster(*pType, GetDoc());
uno::Reference< beans::XPropertySet > aRef = pMaster;
uno::Any aRet(&aRef, ::getCppuType( static_cast<const uno::Reference<beans::XPropertySet>* >(0)));
return aRet;
}
-/*-- 06.03.2001 11:29:34,5-------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextFieldMasters::getInstanceName(
const SwFieldType& rFldType, String& rName)
{
@@ -2670,9 +2532,6 @@ sal_Bool SwXTextFieldMasters::getInstanceName(
}
-/*-- 21.12.98 10:37:33---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Sequence< OUString > SwXTextFieldMasters::getElementNames(void)
throw( uno::RuntimeException )
{
@@ -2710,9 +2569,7 @@ uno::Sequence< OUString > SwXTextFieldMasters::getElementNames(void)
return aSeq;
}
-/*-- 21.12.98 10:37:33---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextFieldMasters::hasByName(const OUString& rName) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -2729,17 +2586,13 @@ sal_Bool SwXTextFieldMasters::hasByName(const OUString& rName) throw( uno::Runti
}
return bRet;
}
-/*-- 21.12.98 10:37:34---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Type SwXTextFieldMasters::getElementType(void) throw( uno::RuntimeException )
{
return ::getCppuType(static_cast<const uno::Reference<beans::XPropertySet>*>(0));
}
-/*-- 21.12.98 10:37:34---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextFieldMasters::hasElements(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -2751,24 +2604,18 @@ sal_Bool SwXTextFieldMasters::hasElements(void) throw( uno::RuntimeException )
/******************************************************************
*
******************************************************************/
-/* -----------------------------06.04.00 13:24--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXTextFieldTypes::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXTextFieldTypes");
}
-/* -----------------------------06.04.00 13:24--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXTextFieldTypes::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(
"com.sun.star.text.TextFields" ));
}
-/* -----------------------------06.04.00 13:24--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SwXTextFieldTypes::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
@@ -2776,31 +2623,23 @@ uno::Sequence< OUString > SwXTextFieldTypes::getSupportedServiceNames(void) thro
pArray[0] = C2U("com.sun.star.text.TextFields");
return aRet;
}
-/*-- 21.12.98 10:35:15---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextFieldTypes::SwXTextFieldTypes(SwDoc* _pDoc) :
SwUnoCollection (_pDoc),
aRefreshCont ( static_cast< XEnumerationAccess * >(this) )
{
}
-/*-- 21.12.98 10:35:16---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextFieldTypes::~SwXTextFieldTypes()
{
}
-/*-- 11.07.02 14:25:00---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextFieldTypes::Invalidate()
{
SwUnoCollection::Invalidate();
aRefreshCont.Disposing();
}
-/*-- 21.12.98 10:35:17---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< container::XEnumeration > SwXTextFieldTypes::createEnumeration(void)
throw( uno::RuntimeException )
{
@@ -2810,16 +2649,12 @@ uno::Reference< container::XEnumeration > SwXTextFieldTypes::createEnumeration(
return new SwXFieldEnumeration(GetDoc());
}
-/*-- 21.12.98 10:35:17---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Type SwXTextFieldTypes::getElementType(void) throw( uno::RuntimeException )
{
return ::getCppuType(static_cast<const uno::Reference<text::XDependentTextField>*>(0));
}
-/*-- 21.12.98 10:35:17---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextFieldTypes::hasElements(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -2828,9 +2663,7 @@ sal_Bool SwXTextFieldTypes::hasElements(void) throw( uno::RuntimeException )
//es gibt sie immer
return sal_True;
}
-/* -----------------24.02.99 16:19-------------------
- *
- * --------------------------------------------------*/
+
void SwXTextFieldTypes::refresh(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -2844,9 +2677,7 @@ void SwXTextFieldTypes::refresh(void) throw( uno::RuntimeException )
// call refresh listeners
aRefreshCont.Refreshed();
}
-/* -----------------24.02.99 16:19-------------------
- *
- * --------------------------------------------------*/
+
void SwXTextFieldTypes::addRefreshListener(const uno::Reference< util::XRefreshListener > & l)
throw( uno::RuntimeException )
{
@@ -2855,9 +2686,7 @@ void SwXTextFieldTypes::addRefreshListener(const uno::Reference< util::XRefreshL
throw uno::RuntimeException();
aRefreshCont.AddListener ( reinterpret_cast < const uno::Reference < lang::XEventListener > &> ( l ));
}
-/* -----------------24.02.99 16:19-------------------
- *
- * --------------------------------------------------*/
+
void SwXTextFieldTypes::removeRefreshListener(const uno::Reference< util::XRefreshListener > & l)
throw( uno::RuntimeException )
{
@@ -2868,24 +2697,18 @@ void SwXTextFieldTypes::removeRefreshListener(const uno::Reference< util::XRefre
/******************************************************************
* SwXFieldEnumeration
******************************************************************/
-/* -----------------------------06.04.00 13:25--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXFieldEnumeration::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXFieldEnumeration");
}
-/* -----------------------------06.04.00 13:25--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXFieldEnumeration::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(
"com.sun.star.text.FieldEnumeration" ));
}
-/* -----------------------------06.04.00 13:25--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SwXFieldEnumeration::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
@@ -2893,9 +2716,7 @@ uno::Sequence< OUString > SwXFieldEnumeration::getSupportedServiceNames(void) th
pArray[0] = C2U("com.sun.star.text.FieldEnumeration");
return aRet;
}
-/* -----------------21.12.98 14:57-------------------
- *
- * --------------------------------------------------*/
+
SwXFieldEnumeration::SwXFieldEnumeration(SwDoc* pDc) :
nNextIndex(0),
pDoc(pDc)
@@ -2913,9 +2734,8 @@ SwXFieldEnumeration::SwXFieldEnumeration(SwDoc* pDc) :
for(sal_uInt16 nType = 0; nType < nCount; ++nType)
{
const SwFieldType *pCurType = pFldTypes->GetObject(nType);
-
- SwClientIter aIter( *(SwFieldType*)pCurType );
- const SwFmtFld* pCurFldFmt = (SwFmtFld*)aIter.First( TYPE( SwFmtFld ));
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pCurType );
+ const SwFmtFld* pCurFldFmt = aIter.First();
while (pCurFldFmt)
{
const SwTxtFld *pTxtFld = pCurFldFmt->GetTxtFld();
@@ -2925,7 +2745,7 @@ SwXFieldEnumeration::SwXFieldEnumeration(SwDoc* pDc) :
!pTxtFld->GetpTxtNode()->GetNodes().IsDocNodes();
if (!bSkip)
pItems[ nFillPos++ ] = new SwXTextField(*pCurFldFmt, pDoc);
- pCurFldFmt = (SwFmtFld*)aIter.Next();
+ pCurFldFmt = aIter.Next();
// enlarge sequence if necessary
if (aItems.getLength() == nFillPos)
@@ -2954,25 +2774,19 @@ SwXFieldEnumeration::SwXFieldEnumeration(SwDoc* pDc) :
// resize sequence to actual used size
aItems.realloc( nFillPos );
}
-/*-- 21.12.98 14:57:23---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXFieldEnumeration::~SwXFieldEnumeration()
{
}
-/*-- 21.12.98 14:57:42---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXFieldEnumeration::hasMoreElements(void)
throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
return nNextIndex < aItems.getLength();
}
-/*-- 21.12.98 14:57:42---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXFieldEnumeration::nextElement(void)
throw( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException )
{
@@ -2990,10 +2804,8 @@ uno::Any SwXFieldEnumeration::nextElement(void)
rxFld = 0; // free memory for item that is not longer used
return aRet;
}
-/* -----------------21.12.98 15:08-------------------
- *
- * --------------------------------------------------*/
-void SwXFieldEnumeration::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+
+void SwXFieldEnumeration::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
if(!GetRegisteredIn())
diff --git a/sw/source/core/unocore/unoflatpara.cxx b/sw/source/core/unocore/unoflatpara.cxx
index 60754344f5..98e1137950 100644
--- a/sw/source/core/unocore/unoflatpara.cxx
+++ b/sw/source/core/unocore/unoflatpara.cxx
@@ -308,7 +308,7 @@ SwXFlatParagraphIterator::~SwXFlatParagraphIterator()
}
-void SwXFlatParagraphIterator::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
+void SwXFlatParagraphIterator::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
{
ClientModify( this, pOld, pNew );
// check if document gets closed...
@@ -388,7 +388,7 @@ uno::Reference< text::XFlatParagraph > SwXFlatParagraphIterator::getNextPara()
if ( !pCurrentPage && !pStopPage )
{
pStopPage = pStartPage;
- pCurrentPage = static_cast<SwPageFrm*>(mpDoc->GetRootFrm()->Lower());
+ pCurrentPage = static_cast<SwPageFrm*>(pViewShell->GetLayout()->Lower());
}
}
}
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index 5294c0523a..9f938d9861 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -114,12 +114,10 @@
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
#include <tools/urlobj.hxx>
#include <editeng/frmdiritem.hxx>
-// DVO, OD 01.10.2003 #i18732#
#include <fmtfollowtextflow.hxx>
-// OD 2004-05-05 #i28701#
#include <fmtwrapinfluenceonobjpos.hxx>
-
#include <toolkit/helper/vclunohelper.hxx>
+#include <switerator.hxx>
// from fefly1.cxx
extern sal_Bool lcl_ChkAndSetNewAnchor( const SwFlyFrm& rFly, SfxItemSet& rSet );
@@ -154,33 +152,21 @@ public:
virtual sal_Bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrmSet, SfxItemSet& rSet, sal_Bool& rSizeFound) = 0;
};
-/* -----------------------------12.06.01 15:46--------------------------------
- ---------------------------------------------------------------------------*/
BaseFrameProperties_Impl::~BaseFrameProperties_Impl()
{
}
-/* -----------------------------12.06.01 15:43--------------------------------
- ---------------------------------------------------------------------------*/
void BaseFrameProperties_Impl::SetProperty(sal_uInt16 nWID, sal_uInt8 nMemberId, const uno::Any& rVal)
{
aAnyMap.SetValue( nWID, nMemberId, rVal );
}
-/* -----------------------------12.06.01 15:43--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool BaseFrameProperties_Impl::GetProperty(sal_uInt16 nWID, sal_uInt8 nMemberId, const uno::Any*& rpAny)
{
return aAnyMap.FillValue( nWID, nMemberId, rpAny );
}
-//void BaseFrameProperties_Impl::GetProperty( const OUString &rPropertyName, const uno::Reference < beans::XPropertySet > &rxPropertySet, uno::Any & rAny )
-//{
-// rAny = rxPropertySet->getPropertyValue( rPropertyName );
-//}
-/* -----------------29.06.98 09:55-------------------
- *
- * --------------------------------------------------*/
+
sal_Bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxItemSet& rFromSet, sal_Bool& rSizeFound)
{
sal_Bool bRet = sal_True;
@@ -528,31 +514,21 @@ sal_Bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const
return bRet;
}
-/* -----------------22.06.98 09:17-------------------
- *
- * --------------------------------------------------*/
class SwFrameProperties_Impl : public BaseFrameProperties_Impl
{
-protected:
-// SwFrameProperties_Impl(/*const :: SfxItemPropertyMap* pMap*/) :
-// BaseFrameProperties_Impl(/*pMap*/){}
public:
SwFrameProperties_Impl();
virtual ~SwFrameProperties_Impl(){}
virtual sal_Bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrmSet, SfxItemSet& rSet, sal_Bool& rSizeFound);
};
-/* -----------------22.06.98 09:17-------------------
- *
- * --------------------------------------------------*/
+
SwFrameProperties_Impl::SwFrameProperties_Impl():
BaseFrameProperties_Impl(/*aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_FRAME)*/ )
{
}
-/* -----------------22.06.98 11:27-------------------
- *
- * --------------------------------------------------*/
+
inline void lcl_FillCol ( SfxItemSet &rToSet, const :: SfxItemSet &rFromSet, const :: uno::Any *pAny)
{
if ( pAny )
@@ -612,17 +588,13 @@ public:
virtual sal_Bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrmSet, SfxItemSet& rSet, sal_Bool& rSizeFound);
};
-/* -----------------27.06.98 14:53-------------------
- *
- * --------------------------------------------------*/
+
SwGraphicProperties_Impl::SwGraphicProperties_Impl( ) :
BaseFrameProperties_Impl(/*aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_GRAPHIC)*/ )
{
}
-/* -----------------27.06.98 14:40-------------------
- *
- * --------------------------------------------------*/
+
inline void lcl_FillMirror ( SfxItemSet &rToSet, const :: SfxItemSet &rFromSet, const ::uno::Any *pHEvenMirror, const ::uno::Any *pHOddMirror, const ::uno::Any *pVMirror, sal_Bool &rRet )
{
if(pHEvenMirror || pHOddMirror || pVMirror )
@@ -709,9 +681,6 @@ sal_Bool SwGraphicProperties_Impl::AnyToItemSet(
return bRet;
}
-/* -----------------4/1/2003 13:54-------------------
-
- --------------------------------------------------*/
class SwOLEProperties_Impl : public SwFrameProperties_Impl
{
@@ -722,9 +691,6 @@ public:
virtual sal_Bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrmSet, SfxItemSet& rSet, sal_Bool& rSizeFound);
};
-/* -----------------4/1/2003 15:32-------------------
-
- --------------------------------------------------*/
sal_Bool SwOLEProperties_Impl::AnyToItemSet(
SwDoc* pDoc, SfxItemSet& rFrmSet, SfxItemSet& rSet, sal_Bool& rSizeFound)
@@ -740,17 +706,13 @@ sal_Bool SwOLEProperties_Impl::AnyToItemSet(
/******************************************************************
* SwXFrame
******************************************************************/
-/* -----------------------------10.03.00 18:02--------------------------------
- ---------------------------------------------------------------------------*/
const :: uno::Sequence< sal_Int8 > & SwXFrame::getUnoTunnelId()
{
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
return aSeq;
}
-/* -----------------------------10.03.00 18:04--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SAL_CALL SwXFrame::getSomething( const :: uno::Sequence< sal_Int8 >& rId )
throw(uno::RuntimeException)
{
@@ -762,30 +724,21 @@ sal_Int64 SAL_CALL SwXFrame::getSomething( const :: uno::Sequence< sal_Int8 >& r
}
return 0;
}
-/*-----------------24.03.98 14:49-------------------
-
---------------------------------------------------*/
TYPEINIT1(SwXFrame, SwClient);
-/* -----------------------------06.04.00 14:20--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXFrame::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXFrame");
}
-/* -----------------------------06.04.00 14:20--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXFrame::supportsService(const :: OUString& rServiceName) throw( uno::RuntimeException )
{
return !rServiceName.compareToAscii("com.sun.star.text.BaseFrame")||
!rServiceName.compareToAscii("com.sun.star.text.TextContent") ||
!rServiceName.compareToAscii("com.sun.star.document.LinkTarget");
}
-/* -----------------------------06.04.00 14:20--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SwXFrame::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(3);
@@ -797,9 +750,6 @@ uno::Sequence< OUString > SwXFrame::getSupportedServiceNames(void) throw( uno::R
}
-/*-- 14.01.99 11:31:52---------------------------------------------------
- Dieser CTor legt den Frame als Descriptor an
- -----------------------------------------------------------------------*/
SwXFrame::SwXFrame(FlyCntType eSet, const :: SfxItemPropertySet* pSet, SwDoc *pDoc) :
aLstnrCntnr( (container::XNamed*)this),
m_pPropSet(pSet),
@@ -851,9 +801,7 @@ SwXFrame::SwXFrame(FlyCntType eSet, const :: SfxItemPropertySet* pSet, SwDoc *pD
}
}
-/*-- 11.12.98 15:05:01---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXFrame::SwXFrame(SwFrmFmt& rFrmFmt, FlyCntType eSet, const :: SfxItemPropertySet* pSet) :
SwClient( &rFrmFmt ),
aLstnrCntnr( (container::XNamed*)this),
@@ -866,20 +814,13 @@ SwXFrame::SwXFrame(SwFrmFmt& rFrmFmt, FlyCntType eSet, const :: SfxItemPropertyS
{
}
-/*-- 11.12.98 15:05:02---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXFrame::~SwXFrame()
{
delete m_pCopySource;
delete pProps;
}
-/*-- 11.12.98 15:05:03---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-/*-- 11.12.98 15:05:03---------------------------------------------------
- -----------------------------------------------------------------------*/
OUString SwXFrame::getName(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -893,9 +834,7 @@ OUString SwXFrame::getName(void) throw( uno::RuntimeException )
throw uno::RuntimeException();
return sRet;
}
-/*-- 11.12.98 15:05:03---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFrame::setName(const :: OUString& rName) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -914,9 +853,7 @@ void SwXFrame::setName(const :: OUString& rName) throw( uno::RuntimeException )
else
throw uno::RuntimeException();
}
-/*-- 11.12.98 15:05:03---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SwXFrame::getPropertySetInfo(void) throw( uno::RuntimeException )
{
uno::Reference< beans::XPropertySetInfo > xRef;
@@ -945,9 +882,7 @@ uno::Reference< beans::XPropertySetInfo > SwXFrame::getPropertySetInfo(void) th
}
return xRef;
}
-/*-- 15.05.06 12:21:43---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFrame::SetSelection(SwPaM& rCopySource)
{
if(m_pCopySource)
@@ -956,9 +891,6 @@ void SwXFrame::SetSelection(SwPaM& rCopySource)
m_pCopySource->SetMark();
*m_pCopySource->GetMark() = *rCopySource.End();
}
-/*-- 11.12.98 15:05:04---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SdrObject *SwXFrame::GetOrCreateSdrObject( SwFlyFrmFmt *pFmt )
{
@@ -1471,9 +1403,7 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno::
else
throw uno::RuntimeException();
}
-/*-- 11.12.98 15:05:04---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
@@ -1707,11 +1637,9 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName)
// format document completely in order to get correct value
pFmt->GetDoc()->GetEditShell()->CalcLayout();
- SwClientIter aIter( *pFmt );
- SwClient* pC = aIter.First( TYPE( SwFrm ) );
- if (pC)
+ SwFrm* pTmpFrm = SwIterator<SwFrm,SwFmt>::FirstElement( *pFmt );
+ if ( pTmpFrm )
{
- SwFrm *pTmpFrm = static_cast< SwFrm * >(pC);
DBG_ASSERT( pTmpFrm->IsValid(), "frame not valid" );
const SwRect &rRect = pTmpFrm->Frm();
Size aMM100Size = OutputDevice::LogicToLogic(
@@ -1743,45 +1671,35 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName)
throw uno::RuntimeException();
return aAny;
}
-/*-- 11.12.98 15:05:04---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFrame::addPropertyChangeListener(const OUString& /*PropertyName*/,
const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 15:05:05---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFrame::removePropertyChangeListener(const OUString& /*PropertyName*/,
const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 15:05:05---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFrame::addVetoableChangeListener(const OUString& /*PropertyName*/,
const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 15:05:05---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFrame::removeVetoableChangeListener(
const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 12.09.00 14:04:53---------------------------------------------------
- -----------------------------------------------------------------------*/
beans::PropertyState SwXFrame::getPropertyState( const OUString& rPropertyName )
throw(beans::UnknownPropertyException, uno::RuntimeException)
{
@@ -1792,9 +1710,7 @@ beans::PropertyState SwXFrame::getPropertyState( const OUString& rPropertyName )
uno::Sequence< beans::PropertyState > aStates = getPropertyStates(aPropertyNames);
return aStates.getConstArray()[0];
}
-/*-- 12.09.00 14:04:54---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< beans::PropertyState > SwXFrame::getPropertyStates(
const uno::Sequence< OUString >& aPropertyNames )
throw(beans::UnknownPropertyException, uno::RuntimeException)
@@ -1858,9 +1774,7 @@ uno::Sequence< beans::PropertyState > SwXFrame::getPropertyStates(
throw uno::RuntimeException();
return aStates;
}
-/*-- 12.09.00 14:04:54---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFrame::setPropertyToDefault( const OUString& rPropertyName )
throw(beans::UnknownPropertyException, uno::RuntimeException)
{
@@ -1957,9 +1871,7 @@ void SwXFrame::setPropertyToDefault( const OUString& rPropertyName )
throw uno::RuntimeException();
}
-/*-- 12.09.00 14:04:55---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXFrame::getPropertyDefault( const OUString& rPropertyName )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
@@ -1985,27 +1897,21 @@ uno::Any SwXFrame::getPropertyDefault( const OUString& rPropertyName )
throw uno::RuntimeException();
return aRet;
}
-/* -----------------22.04.99 14:59-------------------
- *
- * --------------------------------------------------*/
+
void SwXFrame::addEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException )
{
if(!GetRegisteredIn())
throw uno::RuntimeException();
aLstnrCntnr.AddListener(aListener);
}
-/* -----------------22.04.99 14:59-------------------
- *
- * --------------------------------------------------*/
+
void SwXFrame::removeEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException )
{
if(!GetRegisteredIn() || !aLstnrCntnr.RemoveListener(aListener))
throw uno::RuntimeException();
}
-/*-- 11.12.98 15:05:06---------------------------------------------------
- -----------------------------------------------------------------------*/
-void SwXFrame::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
if(!GetRegisteredIn())
@@ -2017,9 +1923,7 @@ void SwXFrame::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
}
}
-/*-- 11.12.98 15:23:05---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFrame::dispose(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -2048,9 +1952,7 @@ void SwXFrame::dispose(void) throw( uno::RuntimeException )
}
}
-/*-- 11.12.98 16:02:27---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextRange > SwXFrame::getAnchor(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -2072,9 +1974,7 @@ uno::Reference< text::XTextRange > SwXFrame::getAnchor(void) throw( uno::Runtim
throw uno::RuntimeException();
return aRef;
}
-/* -----------------14.01.99 12:02-------------------
- *
- * --------------------------------------------------*/
+
void SwXFrame::ResetDescriptor()
{
bIsDescriptor = sal_False;
@@ -2082,9 +1982,7 @@ void SwXFrame::ResetDescriptor()
mxStyleFamily.clear();
DELETEZ(pProps);
}
-/* -----------------18.02.99 13:34-------------------
- *
- * --------------------------------------------------*/
+
void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRange)
throw( lang::IllegalArgumentException, uno::RuntimeException )
{
@@ -2180,6 +2078,8 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan
aFrmSet.Put( SwFmtAnchor( FLY_AT_PAGE, 1 ));
}
+ aPam.DeleteMark(); // mark position node will be deleted!
+ aIntPam.DeleteMark(); // mark position node will be deleted!
pFmt = pDoc->MakeFlyAndMove( *m_pCopySource, aFrmSet,
0,
pParentFrmFmt );
@@ -2416,9 +2316,7 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan
//setzt das Flag zurueck und loescht den Descriptor-Pointer
ResetDescriptor();
}
-/* -----------------------------04.04.01 14:27--------------------------------
- ---------------------------------------------------------------------------*/
void SwXFrame::attach(const uno::Reference< text::XTextRange > & xTextRange)
throw( lang::IllegalArgumentException, uno::RuntimeException )
{
@@ -2453,9 +2351,7 @@ void SwXFrame::attach(const uno::Reference< text::XTextRange > & xTextRange)
throw lang::IllegalArgumentException();
}
}
-/*-- 22.04.99 08:03:20---------------------------------------------------
- -----------------------------------------------------------------------*/
awt::Point SwXFrame::getPosition(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -2463,9 +2359,7 @@ awt::Point SwXFrame::getPosition(void) throw( uno::RuntimeException )
aRuntime.Message = C2U("position cannot be determined with this method");
throw aRuntime;
}
-/*-- 22.04.99 08:03:21---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFrame::setPosition(const awt::Point& /*aPosition*/) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -2473,27 +2367,21 @@ void SwXFrame::setPosition(const awt::Point& /*aPosition*/) throw( uno::RuntimeE
aRuntime.Message = C2U("position cannot be changed with this method");
throw aRuntime;
}
-/*-- 22.04.99 08:03:21---------------------------------------------------
- -----------------------------------------------------------------------*/
awt::Size SwXFrame::getSize(void) throw( uno::RuntimeException )
{
const ::uno::Any aVal = getPropertyValue(C2U("Size"));
awt::Size* pRet = (awt::Size*)aVal.getValue();
return *pRet;
}
-/*-- 22.04.99 08:03:21---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFrame::setSize(const awt::Size& aSize)
throw( beans::PropertyVetoException, uno::RuntimeException )
{
const ::uno::Any aVal(&aSize, ::getCppuType(static_cast<const awt::Size*>(0)));
setPropertyValue(C2U("Size"), aVal);
}
-/*-- 22.04.99 08:03:21---------------------------------------------------
- -----------------------------------------------------------------------*/
OUString SwXFrame::getShapeType(void) throw( uno::RuntimeException )
{
return C2U("FrameShape");
@@ -2503,46 +2391,34 @@ OUString SwXFrame::getShapeType(void) throw( uno::RuntimeException )
/******************************************************************
* SwXTextFrame
******************************************************************/
-/*-- 14.01.99 11:27:51---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextFrame::SwXTextFrame( SwDoc *_pDoc ) :
SwXText(0, CURSOR_FRAME),
SwXFrame(FLYCNTTYPE_FRM, aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_FRAME), _pDoc )
{
}
-/*-- 11.12.98 15:23:01---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextFrame::SwXTextFrame(SwFrmFmt& rFmt) :
SwXText(rFmt.GetDoc(), CURSOR_FRAME),
SwXFrame(rFmt, FLYCNTTYPE_FRM, aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_FRAME))
{
}
-/*-- 11.12.98 15:23:02---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextFrame::~SwXTextFrame()
{
}
-/* -----------------------------15.03.00 16:30--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXTextFrame::acquire( )throw()
{
SwXFrame::acquire();
}
-/* -----------------------------15.03.00 16:30--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXTextFrame::release( )throw()
{
SwXFrame::release();
}
-/* -----------------------------15.03.00 16:30--------------------------------
- ---------------------------------------------------------------------------*/
::uno::Any SAL_CALL SwXTextFrame::queryInterface( const uno::Type& aType )
throw (uno::RuntimeException)
{
@@ -2553,9 +2429,7 @@ void SAL_CALL SwXTextFrame::release( )throw()
aRet = SwXTextFrameBaseClass::queryInterface(aType);
return aRet;
}
-/* -----------------------------15.03.00 16:30--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< uno::Type > SAL_CALL SwXTextFrame::getTypes( ) throw(uno::RuntimeException)
{
uno::Sequence< uno::Type > aTextFrameTypes = SwXTextFrameBaseClass::getTypes();
@@ -2580,9 +2454,7 @@ uno::Sequence< uno::Type > SAL_CALL SwXTextFrame::getTypes( ) throw(uno::Runtim
return aTextFrameTypes;
}
-/* -----------------------------15.03.00 16:30--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< sal_Int8 > SAL_CALL SwXTextFrame::getImplementationId( ) throw(uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -2595,16 +2467,12 @@ uno::Sequence< sal_Int8 > SAL_CALL SwXTextFrame::getImplementationId( ) throw(u
}
return aId;
}
-/*-- 11.12.98 15:23:03---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XText > SwXTextFrame::getText(void) throw( uno::RuntimeException )
{
return this;
}
-/*-- 11.12.98 15:23:03---------------------------------------------------
- -----------------------------------------------------------------------*/
const SwStartNode *SwXTextFrame::GetStartNode() const
{
const SwStartNode *pSttNd = 0;
@@ -2625,9 +2493,7 @@ SwXTextFrame::CreateCursor() throw (uno::RuntimeException)
{
return createTextCursor();
}
-/*-- 11.12.98 15:23:03---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextCursor > SwXTextFrame::createTextCursor(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -2674,9 +2540,7 @@ uno::Reference< text::XTextCursor > SwXTextFrame::createTextCursor(void) throw(
throw uno::RuntimeException();
return aRef;
}
-/*-- 11.12.98 15:23:03---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextCursor > SwXTextFrame::createTextCursorByRange(const uno::Reference< text::XTextRange > & aTextPosition) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -2703,9 +2567,7 @@ uno::Reference< text::XTextCursor > SwXTextFrame::createTextCursorByRange(const
throw uno::RuntimeException();
return aRef;
}
-/*-- 11.12.98 15:23:03---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< container::XEnumeration > SwXTextFrame::createEnumeration(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -2726,77 +2588,57 @@ uno::Reference< container::XEnumeration > SwXTextFrame::createEnumeration(void)
}
return aRef;
}
-/*-- 11.12.98 15:23:04---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Type SwXTextFrame::getElementType(void) throw( uno::RuntimeException )
{
return ::getCppuType(static_cast<uno::Reference<text::XTextRange>*>(0));
}
-/*-- 11.12.98 15:23:04---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextFrame::hasElements(void) throw( uno::RuntimeException )
{
return sal_True;
}
-/*-- 11.12.98 15:23:04---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextFrame::attach(const uno::Reference< text::XTextRange > & xTextRange)
throw( lang::IllegalArgumentException, uno::RuntimeException )
{
SwXFrame::attach(xTextRange);
}
-/*-- 11.12.98 15:23:04---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextRange > SwXTextFrame::getAnchor(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
return SwXFrame::getAnchor();
}
-/*-- 11.12.98 15:23:05---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextFrame::dispose(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
SwXFrame::dispose();
}
-/*-- 11.12.98 15:23:05---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextFrame::addEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException )
{
SwXFrame::addEventListener(aListener);
}
-/*-- 11.12.98 15:23:05---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextFrame::removeEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException )
{
SwXFrame::removeEventListener(aListener);
}
-/* -----------------03.05.99 12:28-------------------
- *
- * --------------------------------------------------*/
+
OUString SwXTextFrame::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXTextFrame");
}
-/* -----------------03.05.99 12:28-------------------
- *
- * --------------------------------------------------*/
+
sal_Bool SwXTextFrame::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return COMPARE_EQUAL == rServiceName.compareToAscii("com.sun.star.text.Text")||
COMPARE_EQUAL == rServiceName.compareToAscii("com.sun.star.text.TextFrame")||
SwXFrame::supportsService(rServiceName);
}
-/* -----------------03.05.99 12:28-------------------
- *
- * --------------------------------------------------*/
+
uno::Sequence< OUString > SwXTextFrame::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence < OUString > aRet = SwXFrame::getSupportedServiceNames();
@@ -2806,16 +2648,12 @@ uno::Sequence< OUString > SwXTextFrame::getSupportedServiceNames(void) throw( un
pArray[aRet.getLength() - 1] = C2U("com.sun.star.text.Text");
return aRet;
}
-/* -----------------------------20.06.00 10:02--------------------------------
- ---------------------------------------------------------------------------*/
void * SAL_CALL SwXTextFrame::operator new( size_t t) throw()
{
return SwXTextFrameBaseClass::operator new( t);
}
-/* -----------------------------20.06.00 10:02--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXTextFrame::operator delete( void * p) throw()
{
SwXTextFrameBaseClass::operator delete(p);
@@ -2826,9 +2664,7 @@ uno::Reference<container::XNameReplace > SAL_CALL SwXTextFrame::getEvents()
{
return new SwFrameEventDescriptor( *this );
}
-/* -----------------------------10.01.01 13:27--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SAL_CALL SwXTextFrame::getSomething( const uno::Sequence< sal_Int8 >& rId )
throw(uno::RuntimeException)
{
@@ -2838,9 +2674,7 @@ sal_Int64 SAL_CALL SwXTextFrame::getSomething( const uno::Sequence< sal_Int8 >&
return nRet;
}
-/* -----------------------------19.03.2002 16:43------------------------------
- ---------------------------------------------------------------------------*/
::uno::Any SwXTextFrame::getPropertyValue(const OUString& rPropertyName)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
@@ -2860,45 +2694,33 @@ sal_Int64 SAL_CALL SwXTextFrame::getSomething( const uno::Sequence< sal_Int8 >&
/******************************************************************
* SwXTextGraphicObject
******************************************************************/
-/*-- 14.01.99 11:27:51---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextGraphicObject::SwXTextGraphicObject( SwDoc *pDoc ) :
SwXFrame(FLYCNTTYPE_GRF, aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_GRAPHIC), pDoc)
{
}
-/*-- 11.12.98 16:02:25---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextGraphicObject::SwXTextGraphicObject(SwFrmFmt& rFmt) :
SwXFrame(rFmt, FLYCNTTYPE_GRF, aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_GRAPHIC))
{
}
-/*-- 11.12.98 16:02:26---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextGraphicObject::~SwXTextGraphicObject()
{
}
-/* -----------------------------15.03.00 16:30--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXTextGraphicObject::acquire( )throw()
{
SwXFrame::acquire();
}
-/* -----------------------------15.03.00 16:30--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXTextGraphicObject::release( )throw()
{
SwXFrame::release();
}
-/* -----------------------------15.03.00 16:30--------------------------------
- ---------------------------------------------------------------------------*/
::uno::Any SAL_CALL SwXTextGraphicObject::queryInterface( const uno::Type& aType )
throw(uno::RuntimeException)
{
@@ -2907,9 +2729,7 @@ void SAL_CALL SwXTextGraphicObject::release( )throw()
aRet = SwXTextGraphicObjectBaseClass::queryInterface(aType);
return aRet;
}
-/* -----------------------------15.03.00 16:30--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< uno::Type > SAL_CALL
SwXTextGraphicObject::getTypes( ) throw(uno::RuntimeException)
{
@@ -2929,9 +2749,7 @@ uno::Sequence< uno::Type > SAL_CALL
return aGraphicTypes;
}
-/* -----------------------------15.03.00 16:30--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< sal_Int8 > SAL_CALL SwXTextGraphicObject::getImplementationId( ) throw(uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -2944,63 +2762,47 @@ uno::Sequence< sal_Int8 > SAL_CALL SwXTextGraphicObject::getImplementationId( )
}
return aId;
}
-/*-- 11.12.98 16:02:27---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextGraphicObject::attach(const uno::Reference< text::XTextRange > & xTextRange) throw( lang::IllegalArgumentException, uno::RuntimeException )
{
SwXFrame::attach(xTextRange);
}
-/*-- 11.12.98 16:02:27---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextRange > SwXTextGraphicObject::getAnchor(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
return SwXFrame::getAnchor();
}
-/*-- 11.12.98 16:02:28---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextGraphicObject::dispose(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
SwXFrame::dispose();
}
-/*-- 11.12.98 16:02:29---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextGraphicObject::addEventListener(const uno::Reference< lang::XEventListener > & aListener)
throw( uno::RuntimeException )
{
SwXFrame::addEventListener(aListener);
}
-/*-- 11.12.98 16:02:29---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextGraphicObject::removeEventListener(const uno::Reference< lang::XEventListener > & aListener)
throw( uno::RuntimeException )
{
SwXFrame::removeEventListener(aListener);
}
-/* -----------------03.05.99 12:28-------------------
- *
- * --------------------------------------------------*/
+
OUString SwXTextGraphicObject::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXTextGraphicObject");
}
-/* -----------------03.05.99 12:28-------------------
- *
- * --------------------------------------------------*/
+
sal_Bool SwXTextGraphicObject::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return COMPARE_EQUAL == rServiceName.compareToAscii("com.sun.star.text.TextGraphicObject") ||
SwXFrame::supportsService(rServiceName);
}
-/* -----------------03.05.99 12:28-------------------
- *
- * --------------------------------------------------*/
+
uno::Sequence< OUString > SwXTextGraphicObject::getSupportedServiceNames(void)
throw( uno::RuntimeException )
{
@@ -3010,23 +2812,17 @@ uno::Sequence< OUString > SwXTextGraphicObject::getSupportedServiceNames(void)
pArray[aRet.getLength() - 1] = C2U("com.sun.star.text.TextGraphicObject");
return aRet;
}
-/* -----------------------------20.06.00 10:02--------------------------------
- ---------------------------------------------------------------------------*/
void * SAL_CALL SwXTextGraphicObject::operator new( size_t t) throw()
{
return SwXTextGraphicObjectBaseClass::operator new(t);
}
-/* -----------------------------20.06.00 10:02--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXTextGraphicObject::operator delete( void * p) throw()
{
SwXTextGraphicObjectBaseClass::operator delete(p);
}
-/* -----------------------------15.12.00 12:45--------------------------------
- ---------------------------------------------------------------------------*/
uno::Reference<container::XNameReplace> SAL_CALL
SwXTextGraphicObject::getEvents()
throw(uno::RuntimeException)
@@ -3037,48 +2833,33 @@ uno::Reference<container::XNameReplace> SAL_CALL
/******************************************************************
*
******************************************************************/
-/*-- 11.12.98 16:16:53---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextEmbeddedObject::SwXTextEmbeddedObject( SwDoc *pDoc ) :
SwXFrame(FLYCNTTYPE_OLE, aSwMapProvider.GetPropertySet(PROPERTY_MAP_EMBEDDED_OBJECT), pDoc)
{
}
-/*-- 11.12.98 16:16:53---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextEmbeddedObject::SwXTextEmbeddedObject(SwFrmFmt& rFmt) :
SwXFrame(rFmt, FLYCNTTYPE_OLE, aSwMapProvider.GetPropertySet(PROPERTY_MAP_EMBEDDED_OBJECT))
{
}
-/*-- 11.12.98 16:16:54---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextEmbeddedObject::~SwXTextEmbeddedObject()
{
}
-/*-- 11.12.98 16:16:54---------------------------------------------------
- -----------------------------------------------------------------------*/
-/* -----------------------------15.03.00 16:32--------------------------------
-
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXTextEmbeddedObject::acquire()throw()
{
SwXFrame::acquire();
}
-/* -----------------------------15.03.00 16:32--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXTextEmbeddedObject::release()throw()
{
SwXFrame::release();
}
-/* -----------------------------15.03.00 16:32--------------------------------
- ---------------------------------------------------------------------------*/
::uno::Any SAL_CALL SwXTextEmbeddedObject::queryInterface( const uno::Type& aType )
throw( uno::RuntimeException)
{
@@ -3087,9 +2868,7 @@ void SAL_CALL SwXTextEmbeddedObject::release()throw()
aRet = SwXTextEmbeddedObjectBaseClass::queryInterface(aType);
return aRet;
}
-/* -----------------------------15.03.00 16:32--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< uno::Type > SAL_CALL SwXTextEmbeddedObject::getTypes( ) throw(uno::RuntimeException)
{
uno::Sequence< uno::Type > aTextEmbeddedTypes = SwXTextEmbeddedObjectBaseClass::getTypes();
@@ -3109,9 +2888,7 @@ uno::Sequence< uno::Type > SAL_CALL SwXTextEmbeddedObject::getTypes( ) throw(un
return aTextEmbeddedTypes;
}
-/* -----------------------------15.03.00 16:32--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< sal_Int8 > SAL_CALL SwXTextEmbeddedObject::getImplementationId( ) throw(uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -3124,46 +2901,33 @@ uno::Sequence< sal_Int8 > SAL_CALL SwXTextEmbeddedObject::getImplementationId(
}
return aId;
}
-/*-- 11.12.98 16:16:54---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextEmbeddedObject::attach(const uno::Reference< text::XTextRange > & xTextRange) throw( lang::IllegalArgumentException, uno::RuntimeException )
{
SwXFrame::attach(xTextRange);
}
-/*-- 11.12.98 16:16:54---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextRange > SwXTextEmbeddedObject::getAnchor(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
return SwXFrame::getAnchor();
}
-/*-- 11.12.98 16:16:54---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextEmbeddedObject::dispose(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
SwXFrame::dispose();
}
-/*-- 11.12.98 16:16:55---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextEmbeddedObject::addEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException )
{
SwXFrame::addEventListener(aListener);
}
-/*-- 11.12.98 16:16:55---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextEmbeddedObject::removeEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException )
{
SwXFrame::removeEventListener(aListener);
}
-/*-- 11.12.98 16:16:55---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< lang::XComponent > SwXTextEmbeddedObject::getEmbeddedObject(void) throw( uno::RuntimeException )
{
@@ -3191,9 +2955,7 @@ uno::Reference< lang::XComponent > SwXTextEmbeddedObject::getEmbeddedObject(voi
uno::Reference< frame::XModel > xModel( xRet, uno::UNO_QUERY);
if( xBrdcst.is() && xModel.is() )
{
- SwClientIter aIter( *pFmt );
- SwXOLEListener* pListener = (SwXOLEListener*)aIter.
- First( TYPE( SwXOLEListener ));
+ SwXOLEListener* pListener = SwIterator<SwXOLEListener,SwFmt>::FirstElement( *pFmt );
//create a new one if the OLE object doesn't have one already
if( !pListener )
{
@@ -3206,11 +2968,6 @@ uno::Reference< lang::XComponent > SwXTextEmbeddedObject::getEmbeddedObject(voi
return xRet;
}
-/* --18.05.2006 16:39---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-
-
uno::Reference< embed::XEmbeddedObject > SAL_CALL SwXTextEmbeddedObject::getExtendedControlOverEmbeddedObject()
throw( uno::RuntimeException )
{
@@ -3238,9 +2995,7 @@ uno::Reference< embed::XEmbeddedObject > SAL_CALL SwXTextEmbeddedObject::getExte
uno::Reference< frame::XModel > xModel( xComp, uno::UNO_QUERY);
if( xBrdcst.is() && xModel.is() )
{
- SwClientIter aIter( *pFmt );
- SwXOLEListener* pListener = (SwXOLEListener*)aIter.
- First( TYPE( SwXOLEListener ));
+ SwXOLEListener* pListener = SwIterator<SwXOLEListener,SwFmt>::FirstElement( *pFmt );
//create a new one if the OLE object doesn't have one already
if( !pListener )
{
@@ -3304,25 +3059,19 @@ uno::Reference< graphic::XGraphic > SAL_CALL SwXTextEmbeddedObject::getReplaceme
return uno::Reference< graphic::XGraphic >();
}
-/* -----------------03.05.99 12:28-------------------
- *
- * --------------------------------------------------*/
+
OUString SwXTextEmbeddedObject::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXTextEmbeddedObject");
}
-/* -----------------03.05.99 12:28-------------------
- *
- * --------------------------------------------------*/
+
sal_Bool SwXTextEmbeddedObject::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return COMPARE_EQUAL == rServiceName.compareToAscii("com.sun.star.text.TextEmbeddedObject")||
SwXFrame::supportsService(rServiceName);
}
-/* -----------------03.05.99 12:28-------------------
- *
- * --------------------------------------------------*/
+
uno::Sequence< OUString > SwXTextEmbeddedObject::getSupportedServiceNames(void)
throw( uno::RuntimeException )
{
@@ -3332,23 +3081,17 @@ uno::Sequence< OUString > SwXTextEmbeddedObject::getSupportedServiceNames(void)
pArray[aRet.getLength() - 1] = C2U("com.sun.star.text.TextEmbeddedObject");
return aRet;
}
-/* -----------------------------20.06.00 10:02--------------------------------
- ---------------------------------------------------------------------------*/
void * SAL_CALL SwXTextEmbeddedObject::operator new( size_t t) throw()
{
return SwXTextEmbeddedObjectBaseClass::operator new(t);
}
-/* -----------------------------20.06.00 10:02--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXTextEmbeddedObject::operator delete( void * p) throw()
{
SwXTextEmbeddedObjectBaseClass::operator delete(p);
}
-/* -----------------------------15.12.00 12:45--------------------------------
- ---------------------------------------------------------------------------*/
uno::Reference<container::XNameReplace> SAL_CALL
SwXTextEmbeddedObject::getEvents()
throw(uno::RuntimeException)
@@ -3361,17 +3104,13 @@ uno::Reference<container::XNameReplace> SAL_CALL
*
******************************************************************/
TYPEINIT1(SwXOLEListener, SwClient);
-/* -----------------------------18.01.2002 09:59------------------------------
- ---------------------------------------------------------------------------*/
SwXOLEListener::SwXOLEListener( SwFmt& rOLEFmt, uno::Reference< XModel > xOLE) :
SwClient(&rOLEFmt),
xOLEModel(xOLE)
{
}
-/* -----------------------------18.01.2002 09:59------------------------------
- ---------------------------------------------------------------------------*/
SwXOLEListener::~SwXOLEListener()
{}
@@ -3434,7 +3173,7 @@ void SwXOLEListener::disposing( const lang::EventObject& rEvent )
/* ---------------------------------------------------------------------------
---------------------------------------------------------------------------*/
-void SwXOLEListener::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwXOLEListener::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
ClientModify(this, pOld, pNew);
if(!GetRegisteredIn())
diff --git a/sw/source/core/unocore/unoftn.cxx b/sw/source/core/unocore/unoftn.cxx
index 1a23ce49df..dbd1c66e70 100644
--- a/sw/source/core/unocore/unoftn.cxx
+++ b/sw/source/core/unocore/unoftn.cxx
@@ -99,9 +99,9 @@ public:
}
void Invalidate();
-
+protected:
// SwClient
- virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew);
+ virtual void Modify( const SfxPoolItem *pOld, const SfxPoolItem *pNew);
};
@@ -122,7 +122,7 @@ void SwXFootnote::Impl::Invalidate()
/* -----------------18.01.99 09:12-------------------
*
* --------------------------------------------------*/
-void SwXFootnote::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXFootnote::Impl::Modify(const SfxPoolItem *pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
@@ -136,7 +136,7 @@ void SwXFootnote::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
{
case RES_FOOTNOTE_DELETED:
if (static_cast<const void*>(m_pFmtFtn) ==
- static_cast<SwPtrMsgPoolItem *>(pOld)->pObject)
+ static_cast<const SwPtrMsgPoolItem *>(pOld)->pObject)
{
Invalidate();
}
@@ -177,24 +177,6 @@ SwXFootnote::GetXFootnote(
// to do this properly requires the SwXFootnote to register at the
// SwFmtFtn directly, not at the unocallback
// also this function must return a uno Reference!
-#if 0
- SwClientIter aIter( rUnoCB );
- SwXFootnote::Impl * pXFootnote = static_cast<SwXFootnote::Impl*>(
- aIter.First( TYPE( SwXFootnote::Impl )));
- while (pXFootnote)
- {
- SwDoc *const pDoc = pXFootnote->m_rThis.GetDoc();
- if (pDoc)
- {
- SwFmtFtn const*const pFtn = pXFootnote->GetFootnoteFormat();
- if (pFtn == &rFootnoteFmt)
- {
- return & pXFootnote->m_rThis;
- }
- }
- pXFootnote = static_cast<SwXFootnote::Impl*>(aIter.Next());
- }
-#endif
return 0;
}
diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx
index 4d9d55a831..6039ef60d8 100644
--- a/sw/source/core/unocore/unoidx.cxx
+++ b/sw/source/core/unocore/unoidx.cxx
@@ -147,8 +147,8 @@ lcl_ReAssignTOXType(SwDoc* pDoc, SwTOXBase& rTOXBase, const OUString& rNewName)
SwTOXType aNewType(TOX_USER, rNewName);
pNewType = pDoc->InsertTOXType( aNewType );
}
- //has to be non-const-casted
- ((SwTOXType*)pNewType)->Add(&rTOXBase);
+
+ rTOXBase.RegisterToTOXType( *((SwTOXType*)pNewType) );
}
//-----------------------------------------------------------------------------
static const char cUserDefined[] = "User-Defined";
@@ -404,16 +404,16 @@ public:
? SwForm::GetFormMaxLevel(m_eTOXType)
: rSection.GetTOXForm().GetFormMax();
}
-
+protected:
// SwClient
- virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew);
+ virtual void Modify(const SfxPoolItem *pOld, const SfxPoolItem *pNew);
};
/*-- 14.12.98 09:35:07---------------------------------------------------
-----------------------------------------------------------------------*/
-void SwXDocumentIndex::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXDocumentIndex::Impl::Modify(const SfxPoolItem *pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
@@ -1247,25 +1247,13 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
case WID_INDEX_MARKS:
{
SwTOXMarks aMarks;
- SwTOXType const*const pType = pTOXBase->GetTOXType();
- SwClientIter aIter(*pType);
- SwTOXMark * pMark =
- static_cast<SwTOXMark*>(aIter.First(TYPE(SwTOXMark)));
- while( pMark )
- {
- if(pMark->GetTxtTOXMark())
- {
- aMarks.C40_INSERT(SwTOXMark, pMark, aMarks.Count());
- }
- pMark = static_cast<SwTOXMark*>(aIter.Next());
- }
- uno::Sequence< uno::Reference<text::XDocumentIndexMark> >
- aXMarks(aMarks.Count());
- uno::Reference<text::XDocumentIndexMark>* pxMarks =
- aXMarks.getArray();
+ const SwTOXType* pType = pTOXBase->GetTOXType();
+ SwTOXMark::InsertTOXMarks( aMarks, *pType );
+ uno::Sequence< uno::Reference<text::XDocumentIndexMark> > aXMarks(aMarks.Count());
+ uno::Reference<text::XDocumentIndexMark>* pxMarks = aXMarks.getArray();
for(sal_uInt16 i = 0; i < aMarks.Count(); i++)
{
- pMark = aMarks.GetObject(i);
+ SwTOXMark* pMark = aMarks.GetObject(i);
pxMarks[i] = SwXDocumentIndexMark::CreateXDocumentIndexMark(
*m_pImpl->m_pDoc,
*const_cast<SwTOXType*>(pType), *pMark);
@@ -1666,9 +1654,9 @@ public:
}
void Invalidate();
-
+protected:
// SwClient
- virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew);
+ virtual void Modify(const SfxPoolItem *pOld, const SfxPoolItem *pNew);
};
/* -----------------------------16.10.00 11:24--------------------------------
@@ -1696,7 +1684,7 @@ void SwXDocumentIndexMark::Impl::Invalidate()
/*-- 14.12.98 10:25:47---------------------------------------------------
-----------------------------------------------------------------------*/
-void SwXDocumentIndexMark::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXDocumentIndexMark::Impl::Modify(const SfxPoolItem *pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx
index 0b768add10..dd2f3e8d34 100644
--- a/sw/source/core/unocore/unoobj.cxx
+++ b/sw/source/core/unocore/unoobj.cxx
@@ -396,7 +396,7 @@ SwUnoCursorHelper::SetPageDesc(
{
throw lang::IllegalArgumentException();
}
- pPageDesc->Add( pNewDesc.get() );
+ pNewDesc.get()->RegisterToPageDesc( *pPageDesc );
bPut = sal_True;
}
if(!bPut)
@@ -827,13 +827,13 @@ public:
m_bIsDisposed = true;
m_ListenerContainer.Disposing();
}
-
+protected:
// SwClient
- virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew);
+ virtual void Modify(const SfxPoolItem *pOld, const SfxPoolItem *pNew);
};
-void SwXTextCursor::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXTextCursor::Impl::Modify(const SfxPoolItem *pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx
index 8daf93d5b5..b7514742d0 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -117,16 +117,13 @@
#include <dcontact.hxx>
#include <dflyobj.hxx>
#include <crsskip.hxx>
-// OD 2004-05-07 #i28701#
#include <vector>
-// OD 2004-05-24 #i28701#
#include <sortedobjs.hxx>
#include <sortopt.hxx>
-
#include <algorithm>
#include <iterator>
#include <boost/bind.hpp>
-
+#include <switerator.hxx>
using namespace ::com::sun::star;
using ::rtl::OUString;
@@ -213,9 +210,9 @@ void CollectFrameAtNode( SwClient& rClnt, const SwNodeIndex& rIdx,
? FLY_AT_CHAR : FLY_AT_PARA);
const SwCntntFrm* pCFrm;
const SwCntntNode* pCNd;
- if( pDoc->GetRootFrm() &&
+ if( pDoc->GetCurrentViewShell() && //swmod 071108//swmod 071225
0 != (pCNd = rIdx.GetNode().GetCntntNode()) &&
- 0 != (pCFrm = pCNd->GetFrm()) )
+ 0 != (pCFrm = pCNd->getLayoutFrm( pDoc->GetCurrentLayout())) )
{
const SwSortedObjs *pObjs = pCFrm->GetDrawObjs();
if( pObjs )
@@ -273,22 +270,19 @@ void CollectFrameAtNode( SwClient& rClnt, const SwNodeIndex& rIdx,
UnoActionContext::UnoActionContext(SwDoc *const pDoc)
: m_pDoc(pDoc)
{
- SwRootFrm *const pRootFrm = m_pDoc->GetRootFrm();
+ SwRootFrm *const pRootFrm = m_pDoc->GetCurrentLayout();
if (pRootFrm)
{
pRootFrm->StartAllAction();
}
}
-/*-----------------04.03.98 11:56-------------------
-
---------------------------------------------------*/
UnoActionContext::~UnoActionContext()
{
// Doc may already have been removed here
if (m_pDoc)
{
- SwRootFrm *const pRootFrm = m_pDoc->GetRootFrm();
+ SwRootFrm *const pRootFrm = m_pDoc->GetCurrentLayout();
if (pRootFrm)
{
pRootFrm->EndAllAction();
@@ -302,7 +296,7 @@ UnoActionContext::~UnoActionContext()
UnoActionRemoveContext::UnoActionRemoveContext(SwDoc *const pDoc)
: m_pDoc(pDoc)
{
- SwRootFrm *const pRootFrm = m_pDoc->GetRootFrm();
+ SwRootFrm *const pRootFrm = m_pDoc->GetCurrentLayout();
if (pRootFrm)
{
pRootFrm->UnoRemoveAllActions();
@@ -314,7 +308,7 @@ UnoActionRemoveContext::UnoActionRemoveContext(SwDoc *const pDoc)
* --------------------------------------------------*/
UnoActionRemoveContext::~UnoActionRemoveContext()
{
- SwRootFrm *const pRootFrm = m_pDoc->GetRootFrm();
+ SwRootFrm *const pRootFrm = m_pDoc->GetCurrentLayout();
if (pRootFrm)
{
pRootFrm->UnoRestoreAllActions();
@@ -322,10 +316,7 @@ UnoActionRemoveContext::~UnoActionRemoveContext()
}
-/*-- 10.12.98 11:52:15---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-void ClientModify(SwClient* pClient, SfxPoolItem *pOld, SfxPoolItem *pNew)
+void ClientModify(SwClient* pClient, const SfxPoolItem *pOld, const SfxPoolItem *pNew)
{
switch( pOld ? pOld->Which() : 0 )
{
@@ -345,9 +336,6 @@ void ClientModify(SwClient* pClient, SfxPoolItem *pOld, SfxPoolItem *pNew)
}
-/*-- 09.12.98 14:19:03---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwUnoCursorHelper::SetCrsrAttr(SwPaM & rPam,
const SfxItemSet& rSet,
const SetAttrMode nAttrMode, const bool bTableMode)
@@ -391,9 +379,7 @@ void SwUnoCursorHelper::SetCrsrAttr(SwPaM & rPam,
}
//<-end,zhaojianwei
}
-/*-- 09.12.98 14:19:04---------------------------------------------------
- -----------------------------------------------------------------------*/
// --> OD 2006-07-12 #i63870#
// split third parameter <bCurrentAttrOnly> into new parameters <bOnlyTxtAttr>
// and <bGetFromChrFmt> to get better control about resulting <SfxItemSet>
@@ -535,20 +521,17 @@ public:
uno::Reference< text::XTextContent > NextElement_Impl()
throw (container::NoSuchElementException, lang::WrappedTargetException,
uno::RuntimeException);
-
+protected:
// SwClient
- virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew);
+ virtual void Modify( const SfxPoolItem *pOld, const SfxPoolItem *pNew);
};
-void SwXParagraphEnumeration::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXParagraphEnumeration::Impl::Modify( const SfxPoolItem *pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
}
-/*-- 10.12.98 11:52:12---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXParagraphEnumeration::SwXParagraphEnumeration(
uno::Reference< text::XText > const& xParent,
::std::auto_ptr<SwUnoCrsr> pCursor,
@@ -558,24 +541,17 @@ SwXParagraphEnumeration::SwXParagraphEnumeration(
pStartNode, pTable) )
{
}
-/*-- 10.12.98 11:52:12---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXParagraphEnumeration::~SwXParagraphEnumeration()
{
}
-/* -----------------------------06.04.00 16:33--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SAL_CALL
SwXParagraphEnumeration::getImplementationName() throw (uno::RuntimeException)
{
return C2U("SwXParagraphEnumeration");
}
-/* -----------------------------06.04.00 16:33--------------------------------
- ---------------------------------------------------------------------------*/
static char const*const g_ServicesParagraphEnum[] =
{
"com.sun.star.text.ParagraphEnumeration",
@@ -590,9 +566,7 @@ throw (uno::RuntimeException)
return ::sw::SupportsServiceImpl(
g_nServicesParagraphEnum, g_ServicesParagraphEnum, rServiceName);
}
-/* -----------------------------06.04.00 16:33--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SAL_CALL
SwXParagraphEnumeration::getSupportedServiceNames()
throw (uno::RuntimeException)
@@ -601,9 +575,6 @@ throw (uno::RuntimeException)
g_nServicesParagraphEnum, g_ServicesParagraphEnum);
}
-/*-- 10.12.98 11:52:13---------------------------------------------------
-
- -----------------------------------------------------------------------*/
sal_Bool SAL_CALL
SwXParagraphEnumeration::hasMoreElements() throw (uno::RuntimeException)
{
@@ -611,9 +582,6 @@ SwXParagraphEnumeration::hasMoreElements() throw (uno::RuntimeException)
return (m_pImpl->m_bFirstParagraph) ? sal_True : m_pImpl->m_xNextPara.is();
}
-/*-- 14.08.03 13:10:14---------------------------------------------------
-
- -----------------------------------------------------------------------*/
//!! compare to SwShellTableCrsr::FillRects() in viscrs.cxx
static SwTableNode *
@@ -754,9 +722,7 @@ throw (container::NoSuchElementException, lang::WrappedTargetException,
return xRef;
}
-/*-- 10.12.98 11:52:14---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SAL_CALL SwXParagraphEnumeration::nextElement()
throw (container::NoSuchElementException, lang::WrappedTargetException,
uno::RuntimeException)
@@ -826,13 +792,13 @@ public:
}
const ::sw::mark::IMark * GetBookmark() const { return m_pMark; }
-
+protected:
// SwClient
- virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew);
+ virtual void Modify(const SfxPoolItem *pOld, const SfxPoolItem *pNew);
};
-void SwXTextRange::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXTextRange::Impl::Modify(const SfxPoolItem *pOld, const SfxPoolItem *pNew)
{
const bool bAlreadyRegistered = 0 != GetRegisteredIn();
ClientModify(this, pOld, pNew);
@@ -1268,8 +1234,7 @@ CreateParentXText(SwDoc & rDoc, const SwPosition& rPos)
SwFrmFmt *const pFmt = pSttNode->GetFlyFmt();
if (0 != pFmt)
{
- SwXTextFrame* pFrame( static_cast<SwXTextFrame*>(
- SwClientIter( *pFmt ).First( TYPE( SwXTextFrame ) ) ) );
+ SwXTextFrame* pFrame = SwIterator<SwXTextFrame,SwFmt>::FirstElement( *pFmt );
xParentText = pFrame ? pFrame : new SwXTextFrame( *pFmt );
}
}
@@ -1625,23 +1590,17 @@ public:
}
void MakeRanges();
-
+protected:
// SwClient
- virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew);
+ virtual void Modify( const SfxPoolItem *pOld, const SfxPoolItem *pNew);
};
-/*-- 10.12.98 13:57:02---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-void SwXTextRanges::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXTextRanges::Impl::Modify( const SfxPoolItem *pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
}
-/* -----------------10.12.98 14:25-------------------
- *
- * --------------------------------------------------*/
void SwXTextRanges::Impl::MakeRanges()
{
SwUnoCrsr *const pCursor = GetCursor();
@@ -1668,32 +1627,21 @@ const SwUnoCrsr* SwXTextRanges::GetCursor() const
return m_pImpl->GetCursor();
}
-/*-- 10.12.98 13:57:22---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXTextRanges::SwXTextRanges(SwPaM *const pPaM)
: m_pImpl( new SwXTextRanges::Impl(pPaM) )
{
}
-/*-- 10.12.98 13:57:22---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXTextRanges::~SwXTextRanges()
{
}
-/* -----------------------------13.03.00 12:15--------------------------------
-
- ---------------------------------------------------------------------------*/
const uno::Sequence< sal_Int8 > & SwXTextRanges::getUnoTunnelId()
{
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
return aSeq;
}
-/* -----------------------------10.03.00 18:04--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SAL_CALL
SwXTextRanges::getSomething(const uno::Sequence< sal_Int8 >& rId)
throw (uno::RuntimeException)
@@ -1707,17 +1655,12 @@ throw (uno::RuntimeException)
* danach wird ein Array mit uno::Reference< XTextPosition > angelegt
*
****************************************************************************/
-/* -----------------------------06.04.00 16:36--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SAL_CALL
SwXTextRanges::getImplementationName() throw (uno::RuntimeException)
{
return C2U("SwXTextRanges");
}
-/* -----------------------------06.04.00 16:36--------------------------------
- ---------------------------------------------------------------------------*/
static char const*const g_ServicesTextRanges[] =
{
"com.sun.star.text.TextRanges",
@@ -1732,9 +1675,6 @@ throw (uno::RuntimeException)
g_nServicesTextRanges, g_ServicesTextRanges, rServiceName);
}
-/* -----------------------------06.04.00 16:36--------------------------------
-
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SAL_CALL
SwXTextRanges::getSupportedServiceNames() throw (uno::RuntimeException)
{
@@ -1742,18 +1682,13 @@ SwXTextRanges::getSupportedServiceNames() throw (uno::RuntimeException)
g_nServicesTextRanges, g_ServicesTextRanges);
}
-/*-- 10.12.98 13:57:24---------------------------------------------------
-
- -----------------------------------------------------------------------*/
sal_Int32 SAL_CALL SwXTextRanges::getCount() throw (uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
return static_cast<sal_Int32>(m_pImpl->m_Ranges.size());
}
-/*-- 10.12.98 13:57:25---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SAL_CALL SwXTextRanges::getByIndex(sal_Int32 nIndex)
throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException,
uno::RuntimeException)
@@ -1770,26 +1705,18 @@ throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException,
return ret;
}
-/*-- 10.12.98 13:57:25---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Type SAL_CALL
SwXTextRanges::getElementType() throw (uno::RuntimeException)
{
return text::XTextRange::static_type();
}
-/*-- 10.12.98 13:57:26---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SAL_CALL SwXTextRanges::hasElements() throw (uno::RuntimeException)
{
// no mutex necessary: getCount() does locking
return getCount() > 0;
}
-/* -----------------11.12.98 10:07-------------------
- *
- * --------------------------------------------------*/
void SwUnoCursorHelper::SetString(SwCursor & rCursor, const OUString& rString)
{
// Start/EndAction
@@ -1846,22 +1773,18 @@ public:
return static_cast<SwUnoCrsr*>(
const_cast<SwModify*>(GetRegisteredIn()));
}
-
+protected:
// SwClient
- virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew);
+ virtual void Modify( const SfxPoolItem *pOld, const SfxPoolItem *pNew);
};
-/*-- 23.03.99 13:22:37---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-
struct InvalidFrameDepend {
bool operator() (::boost::shared_ptr<SwDepend> const & rEntry)
{ return !rEntry->GetRegisteredIn(); }
};
-void SwXParaFrameEnumeration::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXParaFrameEnumeration::Impl::Modify( const SfxPoolItem *pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
if(!GetRegisteredIn())
@@ -1879,9 +1802,6 @@ void SwXParaFrameEnumeration::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
}
}
-/* -----------------23.03.99 13:38-------------------
- *
- * --------------------------------------------------*/
static sal_Bool
lcl_CreateNextObject(SwUnoCrsr& i_rUnoCrsr,
uno::Reference<text::XTextContent> & o_rNextObject,
@@ -1896,9 +1816,7 @@ lcl_CreateNextObject(SwUnoCrsr& i_rUnoCrsr,
// the format should be valid here, otherwise the client
// would have been removed in ::Modify
// check for a shape first
- SwClientIter aIter(*pFormat);
- SwDrawContact * const pContact =
- static_cast<SwDrawContact*>( aIter.First(TYPE(SwDrawContact)) );
+ SwDrawContact* const pContact = SwIterator<SwDrawContact,SwFmt>::FirstElement( *pFormat );
if (pContact)
{
SdrObject * const pSdr = pContact->GetMaster();
@@ -1946,9 +1864,6 @@ lcl_FillFrame(SwClient & rEnum, SwUnoCrsr& rUnoCrsr,
}
}
-/*-- 23.03.99 13:22:29---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXParaFrameEnumeration::SwXParaFrameEnumeration(
const SwPaM& rPaM, const enum ParaFrameMode eParaFrameMode,
SwFrmFmt *const pFmt)
@@ -2006,16 +1921,11 @@ SwXParaFrameEnumeration::SwXParaFrameEnumeration(
lcl_FillFrame(*m_pImpl.get(), *m_pImpl->GetCursor(), m_pImpl->m_Frames);
}
}
-/*-- 23.03.99 13:22:30---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXParaFrameEnumeration::~SwXParaFrameEnumeration()
{
}
-/*-- 23.03.99 13:22:32---------------------------------------------------
-
- -----------------------------------------------------------------------*/
sal_Bool SAL_CALL
SwXParaFrameEnumeration::hasMoreElements() throw (uno::RuntimeException)
{
@@ -2029,9 +1939,7 @@ SwXParaFrameEnumeration::hasMoreElements() throw (uno::RuntimeException)
: lcl_CreateNextObject(*m_pImpl->GetCursor(),
m_pImpl->m_xNextObject, m_pImpl->m_Frames);
}
-/*-- 23.03.99 13:22:33---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SAL_CALL SwXParaFrameEnumeration::nextElement()
throw (container::NoSuchElementException,
lang::WrappedTargetException, uno::RuntimeException)
@@ -2058,18 +1966,12 @@ throw (container::NoSuchElementException,
return aRet;
}
-/* -----------------------------06.04.00 16:39--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SAL_CALL
SwXParaFrameEnumeration::getImplementationName() throw (uno::RuntimeException)
{
return C2U("SwXParaFrameEnumeration");
}
-/* -----------------------------06.04.00 16:39--------------------------------
-
- ---------------------------------------------------------------------------*/
static char const*const g_ServicesParaFrameEnum[] =
{
"com.sun.star.util.ContentEnumeration",
@@ -2085,9 +1987,6 @@ throw (uno::RuntimeException)
g_nServicesParaFrameEnum, g_ServicesParaFrameEnum, rServiceName);
}
-/* -----------------------------06.04.00 16:39--------------------------------
-
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SAL_CALL
SwXParaFrameEnumeration::getSupportedServiceNames()
throw (uno::RuntimeException)
diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx
index 5de8ca31eb..b8543aec9d 100644
--- a/sw/source/core/unocore/unoparagraph.cxx
+++ b/sw/source/core/unocore/unoparagraph.cxx
@@ -151,7 +151,7 @@ public:
return static_cast<const SwTxtNode*>(GetRegisteredIn());
}
SwTxtNode * GetTxtNode() {
- return static_cast<SwTxtNode*>(pRegisteredIn);
+ return static_cast<SwTxtNode*>(GetRegisteredInNonConst());
}
SwTxtNode & GetTxtNodeOrThrow() {
@@ -183,16 +183,16 @@ public:
const uno::Sequence< ::rtl::OUString >& rPropertyNames,
bool bDirectValuesOnly)
throw (uno::RuntimeException);
-
+protected:
// SwClient
- virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew);
+ virtual void Modify(const SfxPoolItem *pOld, const SfxPoolItem *pNew);
};
/*-- 11.12.98 08:12:58---------------------------------------------------
-----------------------------------------------------------------------*/
-void SwXParagraph::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXParagraph::Impl::Modify( const SfxPoolItem *pOld, const SfxPoolItem *pNew )
{
ClientModify(this, pOld, pNew);
if (!GetRegisteredIn())
diff --git a/sw/source/core/unocore/unoport.cxx b/sw/source/core/unocore/unoport.cxx
index 09580ead5b..e795125684 100644
--- a/sw/source/core/unocore/unoport.cxx
+++ b/sw/source/core/unocore/unoport.cxx
@@ -63,7 +63,7 @@ using ::rtl::OUString;
* SwXTextPortion
******************************************************************/
-static void init(SwXTextPortion & rPortion, const SwUnoCrsr* pPortionCursor)
+void SwXTextPortion::init(const SwUnoCrsr* pPortionCursor)
{
SwUnoCrsr* pUnoCursor =
pPortionCursor->GetDoc()->CreateUnoCrsr(*pPortionCursor->GetPoint());
@@ -72,7 +72,7 @@ static void init(SwXTextPortion & rPortion, const SwUnoCrsr* pPortionCursor)
pUnoCursor->SetMark();
*pUnoCursor->GetMark() = *pPortionCursor->GetMark();
}
- pUnoCursor->Add(& rPortion);
+ pUnoCursor->Add(this);
}
/*-- 11.12.98 09:56:55---------------------------------------------------
@@ -97,7 +97,7 @@ SwXTextPortion::SwXTextPortion(const SwUnoCrsr* pPortionCrsr,
, m_ePortionType(eType)
, m_bIsCollapsed(false)
{
- init(*this, pPortionCrsr);
+ init( pPortionCrsr);
}
/* -----------------24.03.99 16:30-------------------
@@ -119,7 +119,7 @@ SwXTextPortion::SwXTextPortion(const SwUnoCrsr* pPortionCrsr,
, m_ePortionType(PORTION_FRAME)
, m_bIsCollapsed(false)
{
- init(*this, pPortionCrsr);
+ init( pPortionCrsr);
}
/* -----------------------------19.02.01 10:52--------------------------------
@@ -142,7 +142,7 @@ SwXTextPortion::SwXTextPortion(const SwUnoCrsr* pPortionCrsr,
, m_ePortionType( bIsEnd ? PORTION_RUBY_END : PORTION_RUBY_START )
, m_bIsCollapsed(false)
{
- init(*this, pPortionCrsr);
+ init( pPortionCrsr);
if (!bIsEnd)
{
@@ -1061,7 +1061,7 @@ throw( uno::RuntimeException )
/*-- 11.12.98 09:57:01---------------------------------------------------
-----------------------------------------------------------------------*/
-void SwXTextPortion::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXTextPortion::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
if (!m_FrameDepend.GetRegisteredIn())
diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx
index 42ed7cde8e..37bf8aab70 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -155,12 +155,16 @@ namespace
++ppMark)
{
::sw::mark::IMark* const pBkmk = ppMark->get();
- bool hasOther = pBkmk->IsExpanded();
+ ::sw::mark::CrossRefBookmark *const pCrossRefMark(
+ dynamic_cast< ::sw::mark::CrossRefBookmark*>(pBkmk));
+ bool const hasOther = pBkmk->IsExpanded();
const SwPosition& rStartPos = pBkmk->GetMarkStart();
if(rStartPos.nNode == nOwnNode)
{
- const sal_uInt8 nType = hasOther ? BKM_TYPE_START : BKM_TYPE_START_END;
+ // #i109272#: cross reference marks: need special handling!
+ sal_uInt8 const nType = (hasOther || pCrossRefMark)
+ ? BKM_TYPE_START : BKM_TYPE_START_END;
rBkmArr.insert(SwXBookmarkPortion_ImplSharedPtr(
new SwXBookmarkPortion_Impl(
SwXBookmark::CreateXBookmark(rDoc, *pBkmk),
@@ -173,8 +177,10 @@ namespace
auto_ptr<SwPosition> pCrossRefEndPos;
const SwPosition* pEndPos = NULL;
if(hasOther)
+ {
pEndPos = &rEndPos;
- else if(dynamic_cast< ::sw::mark::CrossRefBookmark*>(pBkmk))
+ }
+ else if (pCrossRefMark)
{
// Crossrefbookmarks only remember the start position but have to span the whole paragraph
pCrossRefEndPos = auto_ptr<SwPosition>(new SwPosition(rEndPos));
@@ -755,7 +761,7 @@ lcl_ExportHints(
xRef = pPortion = new SwXTextPortion(
pUnoCrsr, xParent, PORTION_FIELD);
Reference<XTextField> xField =
- CreateSwXTextField(*pDoc, pAttr->GetFld());
+ SwXTextField::CreateSwXTextField(*pDoc, pAttr->GetFld());
pPortion->SetTextField(xField);
}
break;
@@ -1219,7 +1225,7 @@ lcl_CreatePortions(
/*-- 27.01.99 10:44:45---------------------------------------------------
-----------------------------------------------------------------------*/
-void SwXTextPortionEnumeration::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXTextPortionEnumeration::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
}
diff --git a/sw/source/core/unocore/unoredline.cxx b/sw/source/core/unocore/unoredline.cxx
index d29e81691f..9e6a02953d 100644
--- a/sw/source/core/unocore/unoredline.cxx
+++ b/sw/source/core/unocore/unoredline.cxx
@@ -57,24 +57,18 @@ using ::rtl::OUString;
using ::rtl::OUStringBuffer;
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
SwXRedlineText::SwXRedlineText(SwDoc* _pDoc, SwNodeIndex aIndex) :
SwXText(_pDoc, CURSOR_REDLINE),
aNodeIndex(aIndex)
{
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
const SwStartNode* SwXRedlineText::GetStartNode() const
{
return aNodeIndex.GetNode().GetStartNode();
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
uno::Any SwXRedlineText::queryInterface( const uno::Type& rType )
throw(uno::RuntimeException)
{
@@ -97,9 +91,7 @@ uno::Any SwXRedlineText::queryInterface( const uno::Type& rType )
return aRet;
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence<uno::Type> SwXRedlineText::getTypes()
throw(uno::RuntimeException)
{
@@ -113,9 +105,7 @@ uno::Sequence<uno::Type> SwXRedlineText::getTypes()
return aTypes;
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence<sal_Int8> SwXRedlineText::getImplementationId()
throw(uno::RuntimeException)
{
@@ -129,9 +119,7 @@ uno::Sequence<sal_Int8> SwXRedlineText::getImplementationId()
}
return aId;
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
uno::Reference<text::XTextCursor> SwXRedlineText::createTextCursor(void)
throw( uno::RuntimeException )
{
@@ -174,9 +162,7 @@ uno::Reference<text::XTextCursor> SwXRedlineText::createTextCursor(void)
return static_cast<text::XWordCursor*>(pXCursor);
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
uno::Reference<text::XTextCursor> SwXRedlineText::createTextCursorByRange(
const uno::Reference<text::XTextRange> & aTextRange)
throw( uno::RuntimeException )
@@ -186,9 +172,7 @@ uno::Reference<text::XTextCursor> SwXRedlineText::createTextCursorByRange(
xCursor->gotoRange(aTextRange->getEnd(), sal_True);
return xCursor;
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
uno::Reference<container::XEnumeration> SwXRedlineText::createEnumeration(void)
throw( uno::RuntimeException )
{
@@ -199,23 +183,17 @@ uno::Reference<container::XEnumeration> SwXRedlineText::createEnumeration(void)
GetDoc()->CreateUnoCrsr(*aPam.Start(), sal_False));
return new SwXParagraphEnumeration(this, pUnoCursor, CURSOR_REDLINE);
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
uno::Type SwXRedlineText::getElementType( ) throw(uno::RuntimeException)
{
return ::getCppuType((uno::Reference<text::XTextRange>*)0);
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXRedlineText::hasElements( ) throw(uno::RuntimeException)
{
return sal_True; // we always have a content index
}
-/* -----------------------------19.12.00 11:36--------------------------------
- ---------------------------------------------------------------------------*/
SwXRedlinePortion::SwXRedlinePortion( const SwRedline* pRed,
const SwUnoCrsr* pPortionCrsr,
uno::Reference< text::XText > xParent, sal_Bool bStart) :
@@ -226,15 +204,11 @@ SwXRedlinePortion::SwXRedlinePortion( const SwRedline* pRed,
{
SetCollapsed(!pRedline->HasMark());
}
-/*-- 19.12.00 11:37:24---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXRedlinePortion::~SwXRedlinePortion()
{
}
-/* -----------------------------19.12.00 11:46--------------------------------
- ---------------------------------------------------------------------------*/
static util::DateTime lcl_DateTimeToUno(const DateTime& rDT)
{
util::DateTime aRetDT;
@@ -317,9 +291,7 @@ uno::Any SwXRedlinePortion::getPropertyValue( const OUString& rPropertyName )
}
return aRet;
}
-/* -----------------------------19.12.00 15:16--------------------------------
- ---------------------------------------------------------------------------*/
void SwXRedlinePortion::Validate() throw( uno::RuntimeException )
{
SwUnoCrsr* pUnoCrsr = GetCursor();
@@ -334,9 +306,7 @@ void SwXRedlinePortion::Validate() throw( uno::RuntimeException )
if(!bFound)
throw uno::RuntimeException();
}
-/* -----------------------------21.03.00 15:39--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< sal_Int8 > SAL_CALL SwXRedlinePortion::getImplementationId( ) throw(uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -349,9 +319,7 @@ uno::Sequence< sal_Int8 > SAL_CALL SwXRedlinePortion::getImplementationId( ) th
}
return aId;
}
-/* -----------------------------11.01.01 16:39--------------------------------
- ---------------------------------------------------------------------------*/
uno::Any SwXRedlinePortion::GetPropertyValue( const OUString& rPropertyName, const SwRedline& rRedline ) throw()
{
uno::Any aRet;
@@ -391,9 +359,7 @@ uno::Any SwXRedlinePortion::GetPropertyValue( const OUString& rPropertyName, co
}
return aRet;
}
-/* -----------------------------11.01.01 11:22--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< beans::PropertyValue > SwXRedlinePortion::CreateRedlineProperties(
const SwRedline& rRedline, sal_Bool bIsStart ) throw()
{
@@ -447,9 +413,7 @@ uno::Sequence< beans::PropertyValue > SwXRedlinePortion::CreateRedlineProperties
aRet.realloc(nPropIdx);
return aRet;
}
-/*-- 11.01.01 17:06:07---------------------------------------------------
- -----------------------------------------------------------------------*/
TYPEINIT1(SwXRedline, SwClient);
SwXRedline::SwXRedline(SwRedline& rRedline, SwDoc& rDoc) :
SwXText(&rDoc, CURSOR_REDLINE),
@@ -458,24 +422,18 @@ SwXRedline::SwXRedline(SwRedline& rRedline, SwDoc& rDoc) :
{
pDoc->GetPageDescFromPool(RES_POOLPAGE_STANDARD)->Add(this);
}
-/*-- 11.01.01 17:06:08---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXRedline::~SwXRedline()
{
}
-/*-- 11.01.01 17:06:08---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SwXRedline::getPropertySetInfo( ) throw(uno::RuntimeException)
{
static uno::Reference< beans::XPropertySetInfo > xRef =
aSwMapProvider.GetPropertySet(PROPERTY_MAP_REDLINE)->getPropertySetInfo();
return xRef;
}
-/*-- 11.01.01 17:06:08---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXRedline::setPropertyValue( const OUString& rPropertyName, const uno::Any& aValue )
throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException,
lang::WrappedTargetException, uno::RuntimeException)
@@ -545,9 +503,7 @@ void SwXRedline::setPropertyValue( const OUString& rPropertyName, const uno::Any
throw lang::IllegalArgumentException();
}
}
-/*-- 11.01.01 17:06:08---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXRedline::getPropertyValue( const OUString& rPropertyName )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
@@ -617,43 +573,33 @@ uno::Any SwXRedline::getPropertyValue( const OUString& rPropertyName )
aRet = SwXRedlinePortion::GetPropertyValue(rPropertyName, *pRedline);
return aRet;
}
-/*-- 11.01.01 17:06:09---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXRedline::addPropertyChangeListener(
const OUString& /*aPropertyName*/,
const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/ )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
}
-/*-- 11.01.01 17:06:09---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXRedline::removePropertyChangeListener(
const OUString& /*aPropertyName*/, const uno::Reference< beans::XPropertyChangeListener >& /*aListener*/ )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
}
-/*-- 11.01.01 17:06:09---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXRedline::addVetoableChangeListener(
const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener >& /*aListener*/ )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
}
-/*-- 11.01.01 17:06:09---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXRedline::removeVetoableChangeListener(
const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener >& /*aListener*/ )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
}
-/*-- 11.01.01 17:06:10---------------------------------------------------
- -----------------------------------------------------------------------*/
-void SwXRedline::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXRedline::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
if(!GetRegisteredIn())
@@ -662,9 +608,7 @@ void SwXRedline::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
pRedline = 0;
}
}
-/*-- 19.12.00 11:37:25---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< container::XEnumeration > SwXRedline::createEnumeration(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -683,25 +627,19 @@ uno::Reference< container::XEnumeration > SwXRedline::createEnumeration(void) t
}
return xRet;
}
-/* -----------------------------19.12.00 12:34--------------------------------
- ---------------------------------------------------------------------------*/
uno::Type SwXRedline::getElementType( ) throw(uno::RuntimeException)
{
return ::getCppuType((uno::Reference<text::XTextRange>*)0);
}
-/* -----------------------------19.12.00 12:34--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXRedline::hasElements( ) throw(uno::RuntimeException)
{
if(!pDoc)
throw uno::RuntimeException();
return 0 != pRedline->GetContentIdx();
}
-/* -----------------------------19.12.00 15:11--------------------------------
- ---------------------------------------------------------------------------*/
uno::Reference< text::XTextCursor > SwXRedline::createTextCursor(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -737,18 +675,14 @@ uno::Reference< text::XTextCursor > SwXRedline::createTextCursor(void) throw( u
}
return xRet;
}
-/* -----------------------------19.12.00 15:11--------------------------------
- ---------------------------------------------------------------------------*/
uno::Reference< text::XTextCursor > SwXRedline::createTextCursorByRange(
const uno::Reference< text::XTextRange > & /*aTextPosition*/)
throw( uno::RuntimeException )
{
throw uno::RuntimeException();
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
uno::Any SwXRedline::queryInterface( const uno::Type& rType )
throw(uno::RuntimeException)
{
@@ -759,9 +693,7 @@ uno::Any SwXRedline::queryInterface( const uno::Type& rType )
}
return aRet;
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence<uno::Type> SwXRedline::getTypes()
throw(uno::RuntimeException)
{
@@ -775,9 +707,7 @@ uno::Sequence<uno::Type> SwXRedline::getTypes()
pTypes[nCurType++] = pBaseTypes[nType];
return aTypes;
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence<sal_Int8> SwXRedline::getImplementationId()
throw(uno::RuntimeException)
{
diff --git a/sw/source/core/unocore/unoredlines.cxx b/sw/source/core/unocore/unoredlines.cxx
index 0f87541968..f046c74a93 100644
--- a/sw/source/core/unocore/unoredlines.cxx
+++ b/sw/source/core/unocore/unoredlines.cxx
@@ -42,27 +42,20 @@
#include <doc.hxx>
#include <docary.hxx>
#include <redline.hxx>
-
+#include <switerator.hxx>
using namespace ::com::sun::star;
using ::rtl::OUString;
-/*-- 11.01.01 15:28:54---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXRedlines::SwXRedlines(SwDoc* _pDoc) :
SwUnoCollection(_pDoc)
{
}
-/*-- 11.01.01 15:28:55---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXRedlines::~SwXRedlines()
{
}
-/*-- 11.01.01 15:28:55---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SwXRedlines::getCount( ) throw(uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -71,9 +64,7 @@ sal_Int32 SwXRedlines::getCount( ) throw(uno::RuntimeException)
const SwRedlineTbl& rRedTbl = GetDoc()->GetRedlineTbl();
return rRedTbl.Count();
}
-/*-- 11.01.01 15:28:55---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXRedlines::getByIndex(sal_Int32 nIndex)
throw( lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException )
{
@@ -91,9 +82,7 @@ uno::Any SwXRedlines::getByIndex(sal_Int32 nIndex)
throw lang::IndexOutOfBoundsException();
return aRet;
}
-/*-- 11.01.01 15:28:55---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< container::XEnumeration > SwXRedlines::createEnumeration(void)
throw( uno::RuntimeException )
{
@@ -102,16 +91,12 @@ uno::Reference< container::XEnumeration > SwXRedlines::createEnumeration(void)
throw uno::RuntimeException();
return uno::Reference< container::XEnumeration >(new SwXRedlineEnumeration(*GetDoc()));
}
-/*-- 11.01.01 15:28:55---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Type SwXRedlines::getElementType( ) throw(uno::RuntimeException)
{
return ::getCppuType((uno::Reference<beans::XPropertySet>*)0);
}
-/*-- 11.01.01 15:28:56---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXRedlines::hasElements( ) throw(uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -120,76 +105,60 @@ sal_Bool SwXRedlines::hasElements( ) throw(uno::RuntimeException)
const SwRedlineTbl& rRedTbl = GetDoc()->GetRedlineTbl();
return rRedTbl.Count() > 0;
}
-/*-- 11.01.01 15:28:56---------------------------------------------------
- -----------------------------------------------------------------------*/
OUString SwXRedlines::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXRedlines");
}
-/*-- 11.01.01 15:28:56---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXRedlines::supportsService(const rtl::OUString& /*ServiceName*/)
throw( uno::RuntimeException )
{
DBG_ERROR("not implemented");
return sal_False;
}
-/*-- 11.01.01 15:28:57---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< OUString > SwXRedlines::getSupportedServiceNames(void)
throw( uno::RuntimeException )
{
DBG_ERROR("not implemented");
return uno::Sequence< OUString >();
}
-/*-- 11.01.01 15:28:57---------------------------------------------------
- -----------------------------------------------------------------------*/
beans::XPropertySet* SwXRedlines::GetObject( SwRedline& rRedline, SwDoc& rDoc )
{
SwPageDesc* pStdDesc = rDoc.GetPageDescFromPool(RES_POOLPAGE_STANDARD);
- SwClientIter aIter(*pStdDesc);
- SwXRedline* pxRedline = (SwXRedline*)aIter.First( TYPE( SwXRedline ));
+ SwIterator<SwXRedline,SwPageDesc> aIter(*pStdDesc);
+ SwXRedline* pxRedline = aIter.First();
while(pxRedline)
{
if(pxRedline->GetRedline() == &rRedline)
break;
- pxRedline = (SwXRedline*)aIter.Next();
+ pxRedline = aIter.Next();
}
if( !pxRedline )
pxRedline = new SwXRedline(rRedline, rDoc);
return pxRedline;
}
-/*-- 12.01.01 15:06:10---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXRedlineEnumeration::SwXRedlineEnumeration(SwDoc& rDoc) :
pDoc(&rDoc),
nCurrentIndex(0)
{
pDoc->GetPageDescFromPool(RES_POOLPAGE_STANDARD)->Add(this);
}
-/*-- 12.01.01 15:06:10---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXRedlineEnumeration::~SwXRedlineEnumeration()
{
}
-/*-- 12.01.01 15:06:10---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXRedlineEnumeration::hasMoreElements(void) throw( uno::RuntimeException )
{
if(!pDoc)
throw uno::RuntimeException();
return pDoc->GetRedlineTbl().Count() > nCurrentIndex;
}
-/*-- 12.01.01 15:06:10---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXRedlineEnumeration::nextElement(void)
throw( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException )
{
@@ -203,31 +172,23 @@ uno::Any SwXRedlineEnumeration::nextElement(void)
aRet <<= xRet;
return aRet;
}
-/*-- 12.01.01 15:06:10---------------------------------------------------
- -----------------------------------------------------------------------*/
rtl::OUString SwXRedlineEnumeration::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXRedlineEnumeration");
}
-/*-- 12.01.01 15:06:10---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXRedlineEnumeration::supportsService(const rtl::OUString& /*ServiceName*/) throw( uno::RuntimeException )
{
return sal_False;
}
-/*-- 12.01.01 15:06:11---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< OUString > SwXRedlineEnumeration::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
return uno::Sequence< OUString >();
}
-/*-- 12.01.01 15:06:11---------------------------------------------------
- -----------------------------------------------------------------------*/
-void SwXRedlineEnumeration::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXRedlineEnumeration::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
if(!GetRegisteredIn())
diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx
index a83710618d..f7ff5ea6a8 100644
--- a/sw/source/core/unocore/unorefmk.cxx
+++ b/sw/source/core/unocore/unorefmk.cxx
@@ -82,9 +82,9 @@ public:
bool IsValid() const { return 0 != GetRegisteredIn(); }
void InsertRefMark( SwPaM & rPam, SwXTextCursor const*const pCursor );
void Invalidate();
-
+protected:
// SwClient
- virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew);
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
};
@@ -105,7 +105,7 @@ void SwXReferenceMark::Impl::Invalidate()
/*-- 11.12.98 10:28:37---------------------------------------------------
-----------------------------------------------------------------------*/
-void SwXReferenceMark::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXReferenceMark::Impl::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
@@ -119,7 +119,7 @@ void SwXReferenceMark::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
{
case RES_REFMARK_DELETED:
if (static_cast<const void*>(m_pMarkFmt) ==
- static_cast<SwPtrMsgPoolItem *>(pOld)->pObject)
+ static_cast<const SwPtrMsgPoolItem *>(pOld)->pObject)
{
Invalidate();
}
@@ -152,20 +152,6 @@ SwXReferenceMark::GetReferenceMark(
// #i105557#: do not iterate over the registered clients: race condition
// to do this properly requires the SwXReferenceMark to register at the
// SwFmtRefMark directly, not at the unocallback
-#if 0
- SwClientIter aIter( rUnoCB );
- SwXReferenceMark::Impl * pXMark =
- static_cast<SwXReferenceMark::Impl*>(
- aIter.First( TYPE( SwXReferenceMark::Impl ) ));
- while (pXMark)
- {
- if (pXMark->m_pMarkFmt == &rMarkFmt)
- {
- return &pXMark->m_rThis;
- }
- pXMark = static_cast<SwXReferenceMark::Impl*>(aIter.Next());
- }
-#endif
return 0;
}
@@ -773,9 +759,9 @@ public:
inline const ::sw::Meta * GetMeta() const;
// only for SwXMetaField!
inline const ::sw::MetaField * GetMetaField() const;
-
+protected:
// SwClient
- virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew);
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
};
@@ -785,7 +771,7 @@ inline const ::sw::Meta * SwXMeta::Impl::GetMeta() const
}
// SwModify
-void SwXMeta::Impl::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
+void SwXMeta::Impl::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
{
m_pTextPortions.reset(); // throw away cache (SwTxtNode changed)
@@ -886,7 +872,7 @@ bool SwXMeta::SetContentRange(
SwTxtMeta const * const pTxtAttr( pMeta->GetTxtAttr() );
if (pTxtAttr)
{
- rpNode = pTxtAttr->GetTxtNode();
+ rpNode = pMeta->GetTxtNode();
if (rpNode)
{
// rStart points at the first position _within_ the meta!
diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx
index 65868d8c86..600c6e90d7 100644
--- a/sw/source/core/unocore/unosect.cxx
+++ b/sw/source/core/unocore/unosect.cxx
@@ -169,16 +169,16 @@ public:
const uno::Sequence< ::rtl::OUString >& rPropertyNames)
throw (beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException);
-
+protected:
// SwClient
- virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew);
+ virtual void Modify(const SfxPoolItem *pOld, const SfxPoolItem *pNew);
};
/*-- 10.12.98 14:42:52---------------------------------------------------
-----------------------------------------------------------------------*/
-void SwXTextSection::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXTextSection::Impl::Modify( const SfxPoolItem *pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
if (!GetRegisteredIn())
diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx
index 81741baf02..a81cad17b0 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -537,7 +537,7 @@ uno::Any SwXFootnoteProperties::getPropertyValue(const OUString& rPropertyName)
case WID_PAGE_STYLE :
{
String aString;
- if( rFtnInfo.GetPageDescDep()->GetRegisteredIn() )
+ if( rFtnInfo.KnowsPageDesc() )
{
SwStyleNameMapper::FillProgName(
rFtnInfo.GetPageDesc( *pDoc )->GetName(),
@@ -809,7 +809,7 @@ uno::Any SwXEndnoteProperties::getPropertyValue(const OUString& rPropertyName)
case WID_PAGE_STYLE :
{
String aString;
- if( rEndInfo.GetPageDescDep()->GetRegisteredIn() )
+ if( rEndInfo.KnowsPageDesc() )
{
SwStyleNameMapper::FillProgName(
rEndInfo.GetPageDesc( *pDoc )->GetName(),
@@ -1087,7 +1087,7 @@ Any SwXLineNumberingProperties::getPropertyValue(const OUString& rPropertyName)
String aString;
// return empty string if no char format is set
// otherwise it would be created here
- if(rInfo.GetRegisteredIn())
+ if(rInfo.HasCharFormat())
{
SwStyleNameMapper::FillProgName(
rInfo.GetCharFmt(*pDoc)->GetName(),
@@ -2445,7 +2445,7 @@ void SwXNumberingRules::setName(const OUString& /*rName*/) throw( RuntimeExcepti
/*-- 14.12.98 14:58:00---------------------------------------------------
-----------------------------------------------------------------------*/
-void SwXNumberingRules::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXNumberingRules::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
if(!GetRegisteredIn())
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index f97e23ab55..a2eb72c5e4 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -1478,7 +1478,7 @@ SwXStyle::~SwXStyle()
/*-- 17.12.98 08:26:51---------------------------------------------------
-----------------------------------------------------------------------*/
-void SwXStyle::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXStyle::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
if(!GetRegisteredIn())
@@ -2006,7 +2006,7 @@ void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
SwPageDesc* pPageDesc = ::GetPageDescByName_Impl(*pDoc, sDescName);
if(pPageDesc)
{
- pPageDesc->Add( pNewDesc );
+ pNewDesc->RegisterToPageDesc( *pPageDesc );
bPut = sal_True;
}
else
@@ -3890,7 +3890,7 @@ SwXAutoStyleFamily::~SwXAutoStyleFamily()
{
}
-void SwXAutoStyleFamily::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXAutoStyleFamily::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
if(!GetRegisteredIn())
@@ -4035,7 +4035,7 @@ SwXAutoStylesEnumerator::~SwXAutoStylesEnumerator()
delete pImpl;
}
-void SwXAutoStylesEnumerator::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXAutoStylesEnumerator::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
if(!GetRegisteredIn())
@@ -4091,7 +4091,7 @@ SwXAutoStyle::~SwXAutoStyle()
{
}
-void SwXAutoStyle::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXAutoStyle::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
if(!GetRegisteredIn())
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index 02166f0e48..9969c8913c 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -101,7 +101,7 @@
#include <unochart.hxx>
#include <sortopt.hxx>
#include <rtl/math.hxx>
-
+#include <switerator.hxx>
using namespace ::com::sun::star;
using ::rtl::OUString;
@@ -113,9 +113,6 @@ extern void lcl_GetTblBoxColStr( sal_uInt16 nCol, String& rNm );
#define UNO_TABLE_COLUMN_SUM 10000
-/* -----------------17.07.98 15:47-------------------
- *
- * --------------------------------------------------*/
table::BorderLine lcl_SvxLineToLine(const SvxBorderLine* pLine)
{
table::BorderLine aLine;
@@ -130,9 +127,7 @@ table::BorderLine lcl_SvxLineToLine(const SvxBorderLine* pLine)
aLine.Color = aLine.InnerLineWidth = aLine.OuterLineWidth = aLine.LineDistance = 0;
return aLine;
}
-/* -----------------17.07.98 15:52-------------------
- *
- * --------------------------------------------------*/
+
sal_Bool lcl_LineToSvxLine(const table::BorderLine& rLine, SvxBorderLine& rSvxLine)
{
rSvxLine.SetColor( Color(rLine.Color));
@@ -142,9 +137,7 @@ sal_Bool lcl_LineToSvxLine(const table::BorderLine& rLine, SvxBorderLine& rSvxLi
sal_Bool bRet = rLine.InnerLineWidth > 0 || rLine.OuterLineWidth > 0;
return bRet;
}
-/* -----------------11.12.98 14:22-------------------
- *
- * --------------------------------------------------*/
+
void lcl_SetSpecialProperty(SwFrmFmt* pFmt, const SfxItemPropertySimpleEntry* pEntry, const uno::Any& aValue)
throw (lang::IllegalArgumentException)
{
@@ -226,9 +219,6 @@ void lcl_SetSpecialProperty(SwFrmFmt* pFmt, const SfxItemPropertySimpleEntry* pE
}
}
-/* -----------------27.04.98 08:50-------------------
- *
- * --------------------------------------------------*/
uno::Any lcl_GetSpecialProperty(SwFrmFmt* pFmt, const SfxItemPropertySimpleEntry* pEntry )
{
uno::Any aRet;
@@ -326,10 +316,6 @@ uno::Any lcl_GetSpecialProperty(SwFrmFmt* pFmt, const SfxItemPropertySimpleEntry
}
return aRet;
}
-/* -----------------19.10.05 08:32-------------------
- *
- * --------------------------------------------------*/
-
// returns the position for the cell with the specified name
// (note that the indices rColumn and rRow are 0 based here)
@@ -465,10 +451,6 @@ int lcl_CompareCellRanges(
}
-/* -----------------25.06.98 08:32-------------------
- *
- * --------------------------------------------------*/
-
// returns the cell name for the cell at the specified position
// (note that the indices nColumn and nRow are 0 based here)
String lcl_GetCellName( sal_Int32 nColumn, sal_Int32 nRow )
@@ -530,9 +512,6 @@ const SwTableBox* lcl_FindCornerTableBox(const SwTableLines& rTableLines, const
return pBox;
}
-/* -----------------21.11.05 14:46-------------------
-
- --------------------------------------------------*/
// start cell should be in the upper-left corner of the range and
// end cell in the lower-right.
// I.e. from the four possible representation
@@ -570,9 +549,6 @@ void SwRangeDescriptor::Normalize()
}
-/* -----------------25.06.98 08:32-------------------
- *
- * --------------------------------------------------*/
SwXCell* lcl_CreateXCell(SwFrmFmt* pFmt, sal_Int32 nColumn, sal_Int32 nRow)
{
SwXCell* pXCell = 0;
@@ -585,9 +561,7 @@ SwXCell* lcl_CreateXCell(SwFrmFmt* pFmt, sal_Int32 nColumn, sal_Int32 nRow)
}
return pXCell;
}
-/* -----------------20.07.98 12:35-------------------
- *
- * --------------------------------------------------*/
+
void lcl_InspectLines(SwTableLines& rLines, SvStrings& rAllNames)
{
for( sal_uInt16 i = 0; i < rLines.Count(); i++ )
@@ -607,27 +581,23 @@ void lcl_InspectLines(SwTableLines& rLines, SvStrings& rAllNames)
}
}
}
-/* -----------------02.10.98 15:55-------------------
- *
- * --------------------------------------------------*/
+
void lcl_FormatTable(SwFrmFmt* pTblFmt)
{
- SwClientIter aIter( *pTblFmt );
- for( SwClient* pC = aIter.First( TYPE( SwFrm ));
- pC; pC = aIter.Next() )
+ SwIterator<SwFrm,SwFmt> aIter( *pTblFmt );
+ for( SwFrm* pFrm = aIter.First(); pFrm; pFrm = aIter.Next() )
{
- if( ((SwFrm*)pC)->IsTabFrm() )
+ // mba: no TYPEINFO for SwTabFrm
+ if( pFrm->IsTabFrm() )
{
- if(((SwFrm*)pC)->IsValid())
- ((SwFrm*)pC)->InvalidatePos();
- ((SwTabFrm*)pC)->SetONECalcLowers();
- ((SwTabFrm*)pC)->Calc();
+ if(pFrm->IsValid())
+ pFrm->InvalidatePos();
+ ((SwTabFrm*)pFrm)->SetONECalcLowers();
+ ((SwTabFrm*)pFrm)->Calc();
}
}
}
-/* -----------------20.07.98 13:15-------------------
- *
- * --------------------------------------------------*/
+
void lcl_CrsrSelect(SwPaM* pCrsr, sal_Bool bExpand)
{
if(bExpand)
@@ -639,9 +609,7 @@ void lcl_CrsrSelect(SwPaM* pCrsr, sal_Bool bExpand)
pCrsr->DeleteMark();
}
-/* -----------------17.07.98 14:36-------------------
- *
- * --------------------------------------------------*/
+
void lcl_GetTblSeparators(uno::Any& rRet, SwTable* pTable, SwTableBox* pBox, sal_Bool bRow)
{
SwTabCols aCols;
@@ -670,9 +638,7 @@ void lcl_GetTblSeparators(uno::Any& rRet, SwTable* pTable, SwTableBox* pBox, sal
rRet.setValue(&aColSeq, ::getCppuType((uno::Sequence< text::TableColumnSeparator>*)0));
}
-/* -----------------17.07.98 14:36-------------------
- *
- * --------------------------------------------------*/
+
void lcl_SetTblSeparators(const uno::Any& rVal, SwTable* pTable, SwTableBox* pBox, sal_Bool bRow, SwDoc* pDoc)
{
SwTabCols aOldCols;
@@ -716,17 +682,13 @@ void lcl_SetTblSeparators(const uno::Any& rVal, SwTable* pTable, SwTableBox* pBo
}
}
}
-/* -----------------30.04.02 08:00-------------------
- *
- * --------------------------------------------------*/
+
inline rtl::OUString lcl_getString( SwXCell &rCell )
{
// getString is a member function of the base class...
return rCell.getString();
}
-/* -----------------30.04.02 08:00-------------------
- * non UNO function call to set string in SwXCell
- * --------------------------------------------------*/
+/* non UNO function call to set string in SwXCell */
void lcl_setString( SwXCell &rCell, const rtl::OUString &rTxt,
sal_Bool bKeepNumberFmt )
{
@@ -742,9 +704,7 @@ void lcl_setString( SwXCell &rCell, const rtl::OUString &rTxt,
}
rCell.SwXText::setString(rTxt);
}
-/* -----------------30.04.02 08:00-------------------
- * non UNO function call to get value from SwXCell
- * --------------------------------------------------*/
+/* non UNO function call to get value from SwXCell */
double lcl_getValue( SwXCell &rCell )
{
double fRet;
@@ -754,9 +714,7 @@ double lcl_getValue( SwXCell &rCell )
::rtl::math::setNan( &fRet );
return fRet;
}
-/* -----------------30.04.02 08:00-------------------
- * non UNO function call to set value in SwXCell
- * --------------------------------------------------*/
+/* non UNO function call to set value in SwXCell */
void lcl_setValue( SwXCell &rCell, double nVal )
{
if(rCell.IsValid())
@@ -794,9 +752,7 @@ void lcl_setValue( SwXCell &rCell, double nVal )
* SwXCell
******************************************************************/
TYPEINIT1(SwXCell, SwClient);
-/*-- 11.12.98 10:56:23---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXCell::SwXCell(SwFrmFmt* pTblFmt, SwTableBox* pBx, sal_uInt16 nPos ) :
SwXText(pTblFmt->GetDoc(), CURSOR_TBLTEXT),
SwClient(pTblFmt),
@@ -806,9 +762,7 @@ SwXCell::SwXCell(SwFrmFmt* pTblFmt, SwTableBox* pBx, sal_uInt16 nPos ) :
nFndPos(nPos)
{
}
-/* -----------------------------09.08.00 15:59--------------------------------
- ---------------------------------------------------------------------------*/
SwXCell::SwXCell(SwFrmFmt* pTblFmt, const SwStartNode& rStartNode) :
SwXText(pTblFmt->GetDoc(), CURSOR_TBLTEXT),
SwClient(pTblFmt),
@@ -819,24 +773,17 @@ SwXCell::SwXCell(SwFrmFmt* pTblFmt, const SwStartNode& rStartNode) :
{
}
-/*-- 11.12.98 10:56:24---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXCell::~SwXCell()
{
}
-/* -----------------------------10.03.00 18:02--------------------------------
- ---------------------------------------------------------------------------*/
const uno::Sequence< sal_Int8 > & SwXCell::getUnoTunnelId()
{
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
return aSeq;
}
-/* -----------------------------10.03.00 18:04--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SAL_CALL SwXCell::getSomething( const uno::Sequence< sal_Int8 >& rId )
throw(uno::RuntimeException)
{
@@ -849,9 +796,7 @@ sal_Int64 SAL_CALL SwXCell::getSomething( const uno::Sequence< sal_Int8 >& rId )
else
return SwXText::getSomething(rId);
}
-/* -----------------------------18.05.00 10:18--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< uno::Type > SAL_CALL SwXCell::getTypes( ) throw(uno::RuntimeException)
{
static uno::Sequence< uno::Type > aRetTypes;
@@ -873,9 +818,7 @@ uno::Sequence< uno::Type > SAL_CALL SwXCell::getTypes( ) throw(uno::RuntimeExce
}
return aRetTypes;
}
-/* -----------------------------18.05.00 10:18--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< sal_Int8 > SAL_CALL SwXCell::getImplementationId( ) throw(uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -888,23 +831,17 @@ uno::Sequence< sal_Int8 > SAL_CALL SwXCell::getImplementationId( ) throw(uno::R
}
return aId;
}
-/* -----------------------------18.05.00 10:18--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXCell::acquire( ) throw()
{
SwXCellBaseClass::acquire();
}
-/* -----------------------------18.05.00 10:18--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXCell::release( ) throw()
{
SwXCellBaseClass::release();
}
-/* -----------------------------18.05.00 10:23--------------------------------
- ---------------------------------------------------------------------------*/
uno::Any SAL_CALL SwXCell::queryInterface( const uno::Type& aType )
throw (uno::RuntimeException)
{
@@ -913,9 +850,7 @@ uno::Any SAL_CALL SwXCell::queryInterface( const uno::Type& aType )
aRet = SwXText::queryInterface(aType);
return aRet;
}
-/*-- 11.12.98 10:56:24---------------------------------------------------
- -----------------------------------------------------------------------*/
const SwStartNode *SwXCell::GetStartNode() const
{
const SwStartNode *pSttNd = 0;
@@ -931,9 +866,7 @@ SwXCell::CreateCursor() throw (uno::RuntimeException)
{
return createTextCursor();
}
-/*-- 11.12.98 10:56:24---------------------------------------------------
- -----------------------------------------------------------------------*/
bool SwXCell::IsValid() const
{
// FIXME: this is now a const method, to make SwXText::IsValid invisible
@@ -955,9 +888,7 @@ bool SwXCell::IsValid() const
}
return 0 != pBox;
}
-/*-- 11.12.98 10:56:25---------------------------------------------------
- -----------------------------------------------------------------------*/
OUString SwXCell::getFormula(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -971,9 +902,7 @@ OUString SwXCell::getFormula(void) throw( uno::RuntimeException )
}
return sRet;
}
-/*-- 11.12.98 10:56:26---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCell::setFormula(const OUString& rFormula) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1004,9 +933,7 @@ void SwXCell::setFormula(const OUString& rFormula) throw( uno::RuntimeException
pMyDoc->UpdateTblFlds( &aTblUpdate );
}
}
-/*-- 11.12.98 10:56:26---------------------------------------------------
- -----------------------------------------------------------------------*/
double SwXCell::getValue(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1015,17 +942,13 @@ double SwXCell::getValue(void) throw( uno::RuntimeException )
// #i112652# a table cell may contain NaN as a value, do not filter that
return fRet;
}
-/*-- 11.12.98 10:56:26---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCell::setValue(double rValue) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
lcl_setValue( *this, rValue );
}
-/*-- 11.12.98 10:56:26---------------------------------------------------
- -----------------------------------------------------------------------*/
table::CellContentType SwXCell::getType(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1043,27 +966,21 @@ table::CellContentType SwXCell::getType(void) throw( uno::RuntimeException )
}
return nRes;
}
-/* -----------------27.04.99 12:06-------------------
- *
- * --------------------------------------------------*/
+
void SwXCell::setString(const OUString& aString) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
lcl_setString( *this, aString );
}
-/*-- 11.12.98 10:56:27---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SwXCell::getError(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
OUString sContent = getString();
return sContent.equals(ViewShell::GetShellRes()->aCalc_Error);
}
-/*-- 11.12.98 10:56:28---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextCursor > SwXCell::createTextCursor(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1087,9 +1004,7 @@ uno::Reference< text::XTextCursor > SwXCell::createTextCursor(void) throw( uno:
throw uno::RuntimeException();
return aRef;
}
-/*-- 11.12.98 10:56:28---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextCursor > SwXCell::createTextCursorByRange(const uno::Reference< text::XTextRange > & xTextPosition)
throw( uno::RuntimeException )
{
@@ -1116,17 +1031,13 @@ uno::Reference< text::XTextCursor > SwXCell::createTextCursorByRange(const uno:
throw uno::RuntimeException();
return aRef;
}
-/*-- 11.12.98 10:56:33---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SwXCell::getPropertySetInfo(void) throw( uno::RuntimeException )
{
static uno::Reference< beans::XPropertySetInfo > xRef = m_pPropSet->getPropertySetInfo();
return xRef;
}
-/*-- 11.12.98 10:56:34---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCell::setPropertyValue(const OUString& rPropertyName, const uno::Any& aValue)
throw( beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException )
{
@@ -1156,9 +1067,7 @@ void SwXCell::setPropertyValue(const OUString& rPropertyName, const uno::Any& aV
}
}
}
-/*-- 11.12.98 10:56:34---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXCell::getPropertyValue(const OUString& rPropertyName)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
@@ -1214,37 +1123,27 @@ uno::Any SwXCell::getPropertyValue(const OUString& rPropertyName)
}
return aRet;
}
-/*-- 11.12.98 10:56:35---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCell::addPropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 10:56:35---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCell::removePropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 10:56:36---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCell::addVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 10:56:36---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCell::removeVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 10:56:37---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< container::XEnumeration > SwXCell::createEnumeration(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1273,31 +1172,23 @@ uno::Reference< container::XEnumeration > SwXCell::createEnumeration(void) thro
}
return aRef;
}
-/*-- 11.12.98 10:56:38---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Type SAL_CALL SwXCell::getElementType(void) throw( uno::RuntimeException )
{
return ::getCppuType((const uno::Reference<text::XTextRange>*)0);
}
-/*-- 11.12.98 10:56:38---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXCell::hasElements(void) throw( uno::RuntimeException )
{
return sal_True;
}
-/*-- 11.12.98 10:56:37---------------------------------------------------
- -----------------------------------------------------------------------*/
-void SwXCell::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXCell::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
}
-/* -----------------12.06.98 07:54-------------------
- *
- * --------------------------------------------------*/
+
SwXCell* SwXCell::CreateXCell(SwFrmFmt* pTblFmt, SwTableBox* pBox, SwTable *pTable )
{
SwXCell* pRet = 0;
@@ -1312,15 +1203,14 @@ SwXCell* SwXCell::CreateXCell(SwFrmFmt* pTblFmt, SwTableBox* pBox, SwTable *pTab
//wenn es die Box gibt, dann wird auch eine Zelle zurueckgegeben
if(pFoundBox)
{
- SwClientIter aIter( *pTblFmt );
- SwXCell* pXCell = (SwXCell*)aIter.
- First( TYPE( SwXCell ));
+ SwIterator<SwXCell,SwFmt> aIter( *pTblFmt );
+ SwXCell* pXCell = aIter.First();
while( pXCell )
{
// gibt es eine passende Zelle bereits?
if(pXCell->GetTblBox() == pBox)
break;
- pXCell = (SwXCell*)aIter.Next();
+ pXCell = aIter.Next();
}
//sonst anlegen
if(!pXCell)
@@ -1330,9 +1220,7 @@ SwXCell* SwXCell::CreateXCell(SwFrmFmt* pTblFmt, SwTableBox* pBox, SwTable *pTab
}
return pRet;
}
-/* -----------------12.06.98 07:37-------------------
- * exitstiert die Box in der angegebenen Tabelle?
- * --------------------------------------------------*/
+/* does box exist in given table? */
SwTableBox* SwXCell::FindBox(SwTable* pTable, SwTableBox* pBox2)
{
// check if nFndPos happens to point to the right table box
@@ -1348,24 +1236,18 @@ SwTableBox* SwXCell::FindBox(SwTable* pTable, SwTableBox* pBox2)
nFndPos = USHRT_MAX;
return 0;
}
-/* -----------------------------19.04.00 15:20--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXCell::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXCell");
}
-/* -----------------------------19.04.00 15:20--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXCell::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
String sServiceName(rServiceName);
return sServiceName.EqualsAscii("com.sun.star.text.CellProperties");
}
-/* -----------------------------19.04.00 15:20--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SwXCell::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
@@ -1377,23 +1259,17 @@ uno::Sequence< OUString > SwXCell::getSupportedServiceNames(void) throw( uno::Ru
/******************************************************************
* SwXTextTableRow
******************************************************************/
-/* -----------------------------19.04.00 15:20--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXTextTableRow::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXTextTableRow");
}
-/* -----------------------------19.04.00 15:20--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXTextTableRow::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return C2U("com.sun.star.text.TextTableRow") == rServiceName;
}
-/* -----------------------------19.04.00 15:20--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SwXTextTableRow::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
@@ -1402,9 +1278,7 @@ uno::Sequence< OUString > SwXTextTableRow::getSupportedServiceNames(void) throw(
return aRet;
}
TYPEINIT1(SwXTextTableRow, SwClient);
-/*-- 11.12.98 12:04:44---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextTableRow::SwXTextTableRow(SwFrmFmt* pFmt, SwTableLine* pLn) :
SwClient(pFmt),
m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_TABLE_ROW)),
@@ -1412,24 +1286,18 @@ SwXTextTableRow::SwXTextTableRow(SwFrmFmt* pFmt, SwTableLine* pLn) :
{
}
-/*-- 11.12.98 12:04:45---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextTableRow::~SwXTextTableRow()
{
}
-/*-- 11.12.98 12:04:46---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SwXTextTableRow::getPropertySetInfo(void) throw( uno::RuntimeException )
{
static uno::Reference< beans::XPropertySetInfo > xRef = m_pPropSet->getPropertySetInfo();
return xRef;
}
-/*-- 11.12.98 12:04:46---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTableRow::setPropertyValue(const OUString& rPropertyName,
const uno::Any& aValue)
throw( beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException )
@@ -1490,9 +1358,7 @@ void SwXTextTableRow::setPropertyValue(const OUString& rPropertyName,
}
}
}
-/*-- 11.12.98 12:04:47---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXTextTableRow::getPropertyValue(const OUString& rPropertyName) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1539,44 +1405,32 @@ uno::Any SwXTextTableRow::getPropertyValue(const OUString& rPropertyName) throw(
}
return aRet;
}
-/*-- 11.12.98 12:04:47---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTableRow::addPropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 12:04:48---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTableRow::removePropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 12:04:48---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTableRow::addVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 12:04:49---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTableRow::removeVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 12:04:49---------------------------------------------------
- -----------------------------------------------------------------------*/
-void SwXTextTableRow::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXTextTableRow::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
}
-/*-- 11.12.98 12:04:50---------------------------------------------------
- -----------------------------------------------------------------------*/
SwTableLine* SwXTextTableRow::FindLine(SwTable* pTable, SwTableLine* pLine)
{
SwTableLine* pRet = 0;
@@ -1593,16 +1447,12 @@ SwTableLine* SwXTextTableRow::FindLine(SwTable* pTable, SwTableLine* pLine)
/******************************************************************
* SwXTextTableCursor
******************************************************************/
-/* -----------------------------19.04.00 15:21--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXTextTableCursor::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXTextTableCursor");
}
-/* -----------------------------19.04.00 15:21--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXTextTableCursor::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return C2U("com.sun.star.text.TextTableCursor") == rServiceName;
@@ -1615,9 +1465,7 @@ const SwDoc* SwXTextTableCursor::GetDoc() const { return GetFrmFmt()->GetDoc()
SwDoc* SwXTextTableCursor::GetDoc() { return GetFrmFmt()->GetDoc(); }
const SwUnoCrsr* SwXTextTableCursor::GetCrsr() const { return (SwUnoCrsr*)aCrsrDepend.GetRegisteredIn(); }
SwUnoCrsr* SwXTextTableCursor::GetCrsr() { return (SwUnoCrsr*)aCrsrDepend.GetRegisteredIn(); }
-/* -----------------------------19.04.00 15:21--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SwXTextTableCursor::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
@@ -1626,9 +1474,6 @@ uno::Sequence< OUString > SwXTextTableCursor::getSupportedServiceNames(void) thr
return aRet;
}
-/*-- 11.12.98 12:16:13---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXTextTableCursor::SwXTextTableCursor(SwFrmFmt* pFmt, SwTableBox* pBox) :
SwClient(pFmt),
aCrsrDepend(this, 0),
@@ -1643,9 +1488,7 @@ SwXTextTableCursor::SwXTextTableCursor(SwFrmFmt* pFmt, SwTableBox* pBox) :
SwUnoTableCrsr* pTblCrsr = dynamic_cast<SwUnoTableCrsr*>(pUnoCrsr);
pTblCrsr->MakeBoxSels();
}
-/*-- 11.12.98 12:16:14---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextTableCursor::SwXTextTableCursor(SwFrmFmt& rTableFmt, const SwTableCursor* pTableSelection) :
SwClient(&rTableFmt),
aCrsrDepend(this, 0),
@@ -1666,9 +1509,7 @@ SwXTextTableCursor::SwXTextTableCursor(SwFrmFmt& rTableFmt, const SwTableCursor*
SwUnoTableCrsr* pTblCrsr = dynamic_cast<SwUnoTableCrsr*>(pUnoCrsr);
pTblCrsr->MakeBoxSels();
}
-/*-- 11.12.98 12:16:14---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextTableCursor::~SwXTextTableCursor()
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1676,9 +1517,7 @@ SwXTextTableCursor::~SwXTextTableCursor()
if(pUnoCrsr)
delete pUnoCrsr;
}
-/*-- 11.12.98 12:16:15---------------------------------------------------
- -----------------------------------------------------------------------*/
OUString SwXTextTableCursor::getRangeName(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1718,9 +1557,7 @@ OUString SwXTextTableCursor::getRangeName(void) throw( uno::RuntimeException )
}
return aRet;
}
-/*-- 11.12.98 12:16:15---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextTableCursor::gotoCellByName(const OUString& CellName, sal_Bool Expand)
throw( uno::RuntimeException )
{
@@ -1736,9 +1573,7 @@ sal_Bool SwXTextTableCursor::gotoCellByName(const OUString& CellName, sal_Bool E
}
return bRet;
}
-/*-- 11.12.98 12:16:15---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextTableCursor::goLeft(sal_Int16 Count, sal_Bool Expand) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1752,9 +1587,7 @@ sal_Bool SwXTextTableCursor::goLeft(sal_Int16 Count, sal_Bool Expand) throw( uno
}
return bRet;
}
-/*-- 11.12.98 12:16:15---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextTableCursor::goRight(sal_Int16 Count, sal_Bool Expand) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1768,9 +1601,7 @@ sal_Bool SwXTextTableCursor::goRight(sal_Int16 Count, sal_Bool Expand) throw( un
}
return bRet;
}
-/*-- 11.12.98 12:16:16---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextTableCursor::goUp(sal_Int16 Count, sal_Bool Expand) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1784,9 +1615,7 @@ sal_Bool SwXTextTableCursor::goUp(sal_Int16 Count, sal_Bool Expand) throw( uno::
}
return bRet;
}
-/*-- 11.12.98 12:16:16---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextTableCursor::goDown(sal_Int16 Count, sal_Bool Expand) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1800,9 +1629,7 @@ sal_Bool SwXTextTableCursor::goDown(sal_Int16 Count, sal_Bool Expand) throw( uno
}
return bRet;
}
-/*-- 11.12.98 12:16:16---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTableCursor::gotoStart(sal_Bool Expand) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1814,9 +1641,7 @@ void SwXTextTableCursor::gotoStart(sal_Bool Expand) throw( uno::RuntimeException
pTblCrsr->MoveTable(fnTableCurr, fnTableStart);
}
}
-/*-- 11.12.98 12:16:16---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTableCursor::gotoEnd(sal_Bool Expand) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1828,9 +1653,7 @@ void SwXTextTableCursor::gotoEnd(sal_Bool Expand) throw( uno::RuntimeException )
pTblCrsr->MoveTable(fnTableCurr, fnTableEnd);
}
}
-/*-- 11.12.98 12:16:16---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextTableCursor::mergeRange(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1859,9 +1682,7 @@ sal_Bool SwXTextTableCursor::mergeRange(void) throw( uno::RuntimeException )
}
return bRet;
}
-/*-- 11.12.98 12:16:16---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextTableCursor::splitRange(sal_Int16 Count, sal_Bool Horizontal) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1885,17 +1706,13 @@ sal_Bool SwXTextTableCursor::splitRange(sal_Int16 Count, sal_Bool Horizontal) th
}
return bRet;
}
-/*-- 11.12.98 12:16:17---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SwXTextTableCursor::getPropertySetInfo(void) throw( uno::RuntimeException )
{
static uno::Reference< beans::XPropertySetInfo > xRef = m_pPropSet->getPropertySetInfo();
return xRef;
}
-/*-- 11.12.98 12:16:17---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTableCursor::setPropertyValue(const OUString& rPropertyName,
const uno::Any& aValue)
throw( beans::UnknownPropertyException,
@@ -1961,9 +1778,7 @@ void SwXTextTableCursor::setPropertyValue(const OUString& rPropertyName,
throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
}
}
-/*-- 11.12.98 12:16:17---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXTextTableCursor::getPropertyValue(const OUString& rPropertyName)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
@@ -2023,38 +1838,28 @@ uno::Any SwXTextTableCursor::getPropertyValue(const OUString& rPropertyName)
}
return aRet;
}
-/*-- 11.12.98 12:16:18---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTableCursor::addPropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 12:16:18---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTableCursor::removePropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 12:16:18---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTableCursor::addVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 12:16:19---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTableCursor::removeVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 12:16:19---------------------------------------------------
- -----------------------------------------------------------------------*/
-void SwXTextTableCursor::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXTextTableCursor::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
}
@@ -2078,36 +1883,25 @@ public:
void ApplyTblAttr(const SwTable& rTbl, SwDoc& rDoc);
};
-/* -----------------22.06.98 09:43-------------------
- *
- * --------------------------------------------------*/
+
SwTableProperties_Impl::SwTableProperties_Impl()
{
}
-/* -----------------22.06.98 09:51-------------------
- *
- * --------------------------------------------------*/
+
SwTableProperties_Impl::~SwTableProperties_Impl()
{
}
-/* -----------------22.06.98 09:51-------------------
- *
- * --------------------------------------------------*/
+
void SwTableProperties_Impl::SetProperty(sal_uInt16 nWhichId, sal_uInt16 nMemberId, const uno::Any& rVal)
{
aAnyMap.SetValue( nWhichId, nMemberId, rVal );
}
-/* -----------------22.06.98 09:51-------------------
- *
- * --------------------------------------------------*/
sal_Bool SwTableProperties_Impl::GetProperty(sal_uInt16 nWhichId, sal_uInt16 nMemberId, const uno::Any*& rpAny )
{
return aAnyMap.FillValue( nWhichId, nMemberId, rpAny );
}
-/* -----------------13.01.99 15:42-------------------
- *
- * --------------------------------------------------*/
+
void SwTableProperties_Impl::ApplyTblAttr(const SwTable& rTbl, SwDoc& rDoc)
{
SfxItemSet aSet(rDoc.GetAttrPool(),
@@ -2286,17 +2080,13 @@ void SwTableProperties_Impl::ApplyTblAttr(const SwTable& rTbl, SwDoc& rDoc)
rDoc.SetAttr( aSet, *rTbl.GetFrmFmt() );
}
}
-/* -----------------------------10.03.00 18:02--------------------------------
- ---------------------------------------------------------------------------*/
const uno::Sequence< sal_Int8 > & SwXTextTable::getUnoTunnelId()
{
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
return aSeq;
}
-/* -----------------------------10.03.00 18:04--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SAL_CALL SwXTextTable::getSomething( const uno::Sequence< sal_Int8 >& rId )
throw(uno::RuntimeException)
{
@@ -2308,14 +2098,10 @@ sal_Int64 SAL_CALL SwXTextTable::getSomething( const uno::Sequence< sal_Int8 >&
}
return 0;
}
-/*-- 11.12.98 12:42:43---------------------------------------------------
- -----------------------------------------------------------------------*/
TYPEINIT1(SwXTextTable, SwClient)
-/*-- 11.12.98 12:42:43---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextTable::SwXTextTable() :
aLstnrCntnr( (text::XTextTable*)this),
aChartLstnrCntnr( (text::XTextTable*)this),
@@ -2327,11 +2113,8 @@ SwXTextTable::SwXTextTable() :
bFirstRowAsLabel(sal_False),
bFirstColumnAsLabel(sal_False)
{
-
}
-/*-- 11.12.98 12:42:44---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextTable::SwXTextTable(SwFrmFmt& rFrmFmt) :
SwClient( &rFrmFmt ),
aLstnrCntnr( (text::XTextTable*)this),
@@ -2344,18 +2127,13 @@ SwXTextTable::SwXTextTable(SwFrmFmt& rFrmFmt) :
bFirstRowAsLabel(sal_False),
bFirstColumnAsLabel(sal_False)
{
-
}
-/*-- 11.12.98 12:42:44---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextTable::~SwXTextTable()
{
delete pTableProps;
}
-/*-- 11.12.98 12:42:44---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::initialize(sal_Int32 nR, sal_Int32 nC) throw( uno::RuntimeException )
{
if(!bIsDescriptor || nR <= 0 || nC <= 0 || nR >= USHRT_MAX || nC >= USHRT_MAX )
@@ -2366,17 +2144,14 @@ void SwXTextTable::initialize(sal_Int32 nR, sal_Int32 nC) throw( uno::RuntimeExc
nColumns = (sal_uInt16)nC;
}
}
-/*-- 11.12.98 12:42:45---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< table::XTableRows > SwXTextTable::getRows(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
uno::Reference< table::XTableRows > xRet;
if (SwFrmFmt* pFmt = GetFrmFmt())
{
- SwXTableRows* pRows = (SwXTableRows*)SwClientIter(*pFmt).
- First(TYPE(SwXTableRows));
+ SwXTableRows* pRows = SwIterator<SwXTableRows,SwFmt>::FirstElement(*pFmt);
if (!pRows)
pRows = new SwXTableRows(*pFmt);
xRet = pRows;
@@ -2385,17 +2160,14 @@ uno::Reference< table::XTableRows > SwXTextTable::getRows(void) throw( uno::Run
throw uno::RuntimeException();
return xRet;
}
-/*-- 11.12.98 12:42:45---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< table::XTableColumns > SwXTextTable::getColumns(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
uno::Reference< table::XTableColumns > xRet;
if (SwFrmFmt* pFmt = GetFrmFmt())
{
- SwXTableColumns* pCols = (SwXTableColumns*)SwClientIter(*pFmt).
- First(TYPE(SwXTableColumns));
+ SwXTableColumns* pCols = SwIterator<SwXTableColumns,SwFmt>::FirstElement(*pFmt);
if (!pCols)
pCols = new SwXTableColumns(*pFmt);
xRet = pCols;
@@ -2404,9 +2176,7 @@ uno::Reference< table::XTableColumns > SwXTextTable::getColumns(void) throw( un
throw uno::RuntimeException();
return xRet;
}
-/*-- 11.12.98 12:42:45---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< table::XCell > SwXTextTable::getCellByName(const OUString& CellName) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -2426,9 +2196,7 @@ uno::Reference< table::XCell > SwXTextTable::getCellByName(const OUString& Cell
throw uno::RuntimeException();
return xRet;
}
-/*-- 11.12.98 12:42:45---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< OUString > SwXTextTable::getCellNames(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -2453,9 +2221,7 @@ uno::Sequence< OUString > SwXTextTable::getCellNames(void) throw( uno::RuntimeEx
}
return uno::Sequence< OUString >();
}
-/*-- 11.12.98 12:42:45---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextTableCursor > SwXTextTable::createCursorByCellName(const OUString& CellName)
throw( uno::RuntimeException )
{
@@ -2476,9 +2242,7 @@ uno::Reference< text::XTextTableCursor > SwXTextTable::createCursorByCellName(c
throw uno::RuntimeException();
return xRet;
}
-/* -----------------18.02.99 13:36-------------------
- *
- * --------------------------------------------------*/
+
void SwXTextTable::attachToRange(const uno::Reference< text::XTextRange > & xTextRange)
throw( lang::IllegalArgumentException, uno::RuntimeException )
{
@@ -2528,18 +2292,7 @@ void SwXTextTable::attachToRange(const uno::Reference< text::XTextRange > & xTex
// hier muessen die Properties des Descriptors ausgewertet werden
pTableProps->ApplyTblAttr(*pTable, *pDoc);
SwFrmFmt* pTblFmt = pTable->GetFrmFmt();
- SwClientIter aIter( *pTblFmt );
- for( SwClient* pC = aIter.First( TYPE( SwFrm ));
- pC; pC = aIter.Next() )
- {
- if( ((SwFrm*)pC)->IsTabFrm() )
- {
- if(((SwFrm*)pC)->IsValid())
- ((SwFrm*)pC)->InvalidatePos();
- ((SwTabFrm*)pC)->SetONECalcLowers();
- ((SwTabFrm*)pC)->Calc();
- }
- }
+ lcl_FormatTable( pTblFmt );
pTblFmt->Add(this);
if(m_sTableName.Len())
@@ -2571,18 +2324,14 @@ void SwXTextTable::attachToRange(const uno::Reference< text::XTextRange > & xTex
else
throw lang::IllegalArgumentException();
}
-/*-- 11.12.98 12:42:45---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::attach(const uno::Reference< text::XTextRange > & xTextRange)
throw( lang::IllegalArgumentException, uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
attachToRange( xTextRange );
}
-/*-- 11.12.98 12:42:46---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextRange > SwXTextTable::getAnchor(void)
throw( uno::RuntimeException )
{
@@ -2593,9 +2342,7 @@ uno::Reference< text::XTextRange > SwXTextTable::getAnchor(void)
uno::Reference< text::XTextRange > xRet = new SwXTextRange(*pFmt);
return xRet;
}
-/*-- 11.12.98 12:42:46---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::dispose(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -2611,26 +2358,20 @@ void SwXTextTable::dispose(void) throw( uno::RuntimeException )
else
throw uno::RuntimeException();
}
-/*-- 11.12.98 12:42:46---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::addEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException )
{
if(!GetRegisteredIn())
throw uno::RuntimeException();
aLstnrCntnr.AddListener(aListener);
}
-/*-- 11.12.98 12:42:46---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::removeEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException )
{
if(!GetRegisteredIn() || !aLstnrCntnr.RemoveListener(aListener))
throw uno::RuntimeException();
}
-/*-- 11.12.98 12:42:46---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< table::XCell > SwXTextTable::getCellByPosition(sal_Int32 nColumn, sal_Int32 nRow)
throw( uno::RuntimeException, lang::IndexOutOfBoundsException )
{
@@ -2649,9 +2390,7 @@ uno::Reference< table::XCell > SwXTextTable::getCellByPosition(sal_Int32 nColum
return aRef;
}
-/* -----------------11.12.98 13:26-------------------
- *
- * --------------------------------------------------*/
+
uno::Reference< table::XCellRange > SwXTextTable::GetRangeByName(SwFrmFmt* pFmt, SwTable* pTable,
const String& rTLName, const String& rBRName,
SwRangeDescriptor& rDesc)
@@ -2688,9 +2427,7 @@ uno::Reference< table::XCellRange > SwXTextTable::GetRangeByName(SwFrmFmt* pFmt
}
return aRef;
}
-/*-- 11.12.98 12:42:46---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< table::XCellRange > SwXTextTable::getCellRangeByPosition(sal_Int32 nLeft, sal_Int32 nTop,
sal_Int32 nRight, sal_Int32 nBottom)
throw( uno::RuntimeException, lang::IndexOutOfBoundsException )
@@ -2723,9 +2460,7 @@ uno::Reference< table::XCellRange > SwXTextTable::getCellRangeByPosition(sal_In
throw lang::IndexOutOfBoundsException();
return aRef;
}
-/*-- 11.12.98 12:42:47---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< table::XCellRange > SwXTextTable::getCellRangeByName(const OUString& aRange)
throw( uno::RuntimeException )
{
@@ -2760,9 +2495,7 @@ uno::Reference< table::XCellRange > SwXTextTable::getCellRangeByName(const OUSt
throw uno::RuntimeException();
return aRef;
}
-/*-- 29.04.02 11:42:47---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< uno::Sequence< uno::Any > > SAL_CALL SwXTextTable::getDataArray()
throw (uno::RuntimeException)
{
@@ -2822,9 +2555,7 @@ uno::Sequence< uno::Sequence< uno::Any > > SAL_CALL SwXTextTable::getDataArray()
throw uno::RuntimeException();
return aRowSeq;
}
-/*-- 29.04.02 11:42:47---------------------------------------------------
- -----------------------------------------------------------------------*/
void SAL_CALL SwXTextTable::setDataArray(
const uno::Sequence< uno::Sequence< uno::Any > >& rArray )
throw (uno::RuntimeException)
@@ -2892,9 +2623,7 @@ void SAL_CALL SwXTextTable::setDataArray(
}
}
}
-/*-- 11.12.98 12:42:47---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< uno::Sequence< double > > SwXTextTable::getData(void)
throw( uno::RuntimeException )
{
@@ -2936,9 +2665,7 @@ uno::Sequence< uno::Sequence< double > > SwXTextTable::getData(void)
throw uno::RuntimeException();
return aRowSeq;
}
-/*-- 11.12.98 12:42:47---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::setData(const uno::Sequence< uno::Sequence< double > >& rData)
throw( uno::RuntimeException )
{
@@ -2986,9 +2713,7 @@ void SwXTextTable::setData(const uno::Sequence< uno::Sequence< double > >& rData
aChartLstnrCntnr.ChartDataChanged();
}
}
-/*-- 11.12.98 12:42:47---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< OUString > SwXTextTable::getRowDescriptions(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -3028,9 +2753,7 @@ uno::Sequence< OUString > SwXTextTable::getRowDescriptions(void) throw( uno::Run
throw uno::RuntimeException();
return aRet;
}
-/*-- 11.12.98 12:42:47---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::setRowDescriptions(const uno::Sequence< OUString >& rRowDesc) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -3065,9 +2788,7 @@ void SwXTextTable::setRowDescriptions(const uno::Sequence< OUString >& rRowDesc)
else
throw uno::RuntimeException();
}
-/*-- 11.12.98 12:42:48---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< OUString > SwXTextTable::getColumnDescriptions(void)
throw( uno::RuntimeException )
{
@@ -3108,9 +2829,7 @@ uno::Sequence< OUString > SwXTextTable::getColumnDescriptions(void)
throw uno::RuntimeException();
return aRet;
}
-/*-- 11.12.98 12:42:48---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::setColumnDescriptions(const uno::Sequence< OUString >& rColumnDesc) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -3147,9 +2866,7 @@ void SwXTextTable::setColumnDescriptions(const uno::Sequence< OUString >& rColum
else
throw uno::RuntimeException();
}
-/*-- 11.12.98 12:42:48---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::addChartDataChangeEventListener(
const uno::Reference< chart::XChartDataChangeEventListener > & aListener)
throw( uno::RuntimeException )
@@ -3158,9 +2875,7 @@ void SwXTextTable::addChartDataChangeEventListener(
throw uno::RuntimeException();
aChartLstnrCntnr.AddListener(aListener.get());
}
-/*-- 11.12.98 12:42:48---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::removeChartDataChangeEventListener(
const uno::Reference< chart::XChartDataChangeEventListener > & aListener)
throw( uno::RuntimeException )
@@ -3168,27 +2883,21 @@ void SwXTextTable::removeChartDataChangeEventListener(
if(!GetRegisteredIn() || !aChartLstnrCntnr.RemoveListener(aListener.get()))
throw uno::RuntimeException();
}
-/* -----------------08.03.99 15:33-------------------
- *
- * --------------------------------------------------*/
+
sal_Bool SwXTextTable::isNotANumber(double nNumber) throw( uno::RuntimeException )
{
// We use DBL_MIN because starcalc does (which uses it because chart
// wants it that way!)
return ( nNumber == DBL_MIN );
}
-/* -----------------08.03.99 15:34-------------------
- *
- * --------------------------------------------------*/
+
double SwXTextTable::getNotANumber(void) throw( uno::RuntimeException )
{
// We use DBL_MIN because starcalc does (which uses it because chart
// wants it that way!)
return DBL_MIN;
}
-/*-- 11.12.98 12:42:48---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< beans::PropertyValue > SwXTextTable::createSortDescriptor(void)
throw( uno::RuntimeException )
{
@@ -3196,9 +2905,7 @@ uno::Sequence< beans::PropertyValue > SwXTextTable::createSortDescriptor(void)
return SwUnoCursorHelper::CreateSortDescriptor(true);
}
-/*-- 11.12.98 12:42:49---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::sort(const uno::Sequence< beans::PropertyValue >& rDescriptor)
throw( uno::RuntimeException )
{
@@ -3220,9 +2927,7 @@ void SwXTextTable::sort(const uno::Sequence< beans::PropertyValue >& rDescriptor
pFmt->GetDoc()->SortTbl(aBoxes, aSortOpt);
}
}
-/*-- 11.12.98 12:42:49---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::autoFormat(const OUString& aName) throw( lang::IllegalArgumentException, uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -3255,17 +2960,13 @@ void SwXTextTable::autoFormat(const OUString& aName) throw( lang::IllegalArgumen
else
throw uno::RuntimeException();
}
-/*-- 11.12.98 12:42:49---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SwXTextTable::getPropertySetInfo(void) throw( uno::RuntimeException )
{
static uno::Reference< beans::XPropertySetInfo > xRef = m_pPropSet->getPropertySetInfo();
return xRef;
}
-/*-- 11.12.98 12:42:50---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::setPropertyValue(const OUString& rPropertyName,
const uno::Any& aValue)
throw( beans::UnknownPropertyException, beans::PropertyVetoException,
@@ -3327,9 +3028,9 @@ void SwXTextTable::setPropertyValue(const OUString& rPropertyName,
&& pBorder)
{
SwDoc* pDoc = pFmt->GetDoc();
- SwClientIter aIter( *pFmt );
+ SwFrm* pFrm = SwIterator<SwFrm,SwFmt>::FirstElement( *pFmt );
//Tabellen ohne Layout (unsichtbare Header/Footer )
- if(0 != aIter.First( TYPE( SwFrm )))
+ if( pFrm )
{
lcl_FormatTable(pFmt);
SwTable* pTable = SwTable::FindTable( pFmt );
@@ -3475,9 +3176,7 @@ void SwXTextTable::setPropertyValue(const OUString& rPropertyName,
else
throw uno::RuntimeException();
}
-/*-- 11.12.98 12:42:51---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXTextTable::getPropertyValue(const OUString& rPropertyName) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -3524,9 +3223,9 @@ uno::Any SwXTextTable::getPropertyValue(const OUString& rPropertyName) throw( be
case FN_UNO_TABLE_BORDER:
{
SwDoc* pDoc = pFmt->GetDoc();
- SwClientIter aIter( *pFmt );
+ SwFrm* pFrm = SwIterator<SwFrm,SwFmt>::FirstElement( *pFmt );
//Tabellen ohne Layout (unsichtbare Header/Footer )
- if(0 != aIter.First( TYPE( SwFrm )))
+ if( pFrm )
{
lcl_FormatTable(pFmt);
SwTable* pTable = SwTable::FindTable( pFmt );
@@ -3690,37 +3389,27 @@ uno::Any SwXTextTable::getPropertyValue(const OUString& rPropertyName) throw( be
throw uno::RuntimeException();
return aRet;
}
-/*-- 11.12.98 12:42:51---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::addPropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 12:42:52---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::removePropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 12:42:58---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::addVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 12:42:58---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::removeVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 12:42:58---------------------------------------------------
- -----------------------------------------------------------------------*/
OUString SwXTextTable::getName(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -3736,9 +3425,7 @@ OUString SwXTextTable::getName(void) throw( uno::RuntimeException )
sRet = m_sTableName;
return sRet;
}
-/*-- 11.12.98 12:42:59---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::setName(const OUString& rName) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -3796,9 +3483,7 @@ void SwXTextTable::setName(const OUString& rName) throw( uno::RuntimeException )
else
m_sTableName = sNewTblName;
}
-/*-----------------11.02.98 09:58-------------------
---------------------------------------------------*/
sal_uInt16 SwXTextTable::getRowCount(void)
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -3814,9 +3499,7 @@ sal_uInt16 SwXTextTable::getRowCount(void)
}
return nRet;
}
-/*-----------------11.02.98 09:58-------------------
---------------------------------------------------*/
sal_uInt16 SwXTextTable::getColumnCount(void)
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -3834,10 +3517,8 @@ sal_uInt16 SwXTextTable::getColumnCount(void)
}
return nRet;
}
-/*-- 11.12.98 12:42:59---------------------------------------------------
- -----------------------------------------------------------------------*/
-void SwXTextTable::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXTextTable::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
if(pOld && pOld->Which() == RES_REMOVE_UNO_OBJECT &&
(void*)GetRegisteredIn() == ((SwPtrMsgPoolItem *)pOld)->pObject )
@@ -3852,16 +3533,12 @@ void SwXTextTable::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
else
aChartLstnrCntnr.ChartDataChanged();
}
-/* -----------------25.10.99 15:12-------------------
- --------------------------------------------------*/
OUString SAL_CALL SwXTextTable::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXTextTable");
}
-/* -----------------25.10.99 15:12-------------------
- --------------------------------------------------*/
sal_Bool SwXTextTable::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
String sServiceName(rServiceName);
@@ -3870,9 +3547,7 @@ sal_Bool SwXTextTable::supportsService(const OUString& rServiceName) throw( uno:
sServiceName.EqualsAscii("com.sun.star.text.TextContent") ||
sServiceName.EqualsAscii("com.sun.star.text.TextSortable"));
}
-/* -----------------25.10.99 15:12-------------------
- --------------------------------------------------*/
uno::Sequence< OUString > SwXTextTable::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(4);
@@ -3887,17 +3562,13 @@ uno::Sequence< OUString > SwXTextTable::getSupportedServiceNames(void) throw( un
/******************************************************************
*
******************************************************************/
-/* -----------------------------10.03.00 18:02--------------------------------
- ---------------------------------------------------------------------------*/
const uno::Sequence< sal_Int8 > & SwXCellRange::getUnoTunnelId()
{
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
return aSeq;
}
-/* -----------------------------10.03.00 18:04--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SAL_CALL SwXCellRange::getSomething( const uno::Sequence< sal_Int8 >& rId )
throw(uno::RuntimeException)
{
@@ -3909,20 +3580,14 @@ sal_Int64 SAL_CALL SwXCellRange::getSomething( const uno::Sequence< sal_Int8 >&
}
return 0;
}
-/* -----------------28.04.98 10:29-------------------
- *
- * --------------------------------------------------*/
+
TYPEINIT1(SwXCellRange, SwClient);
-/* -----------------------------19.04.00 15:21--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXCellRange::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXCellRange");
}
-/* -----------------------------19.04.00 15:21--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXCellRange::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return
@@ -3934,9 +3599,7 @@ sal_Bool SwXCellRange::supportsService(const OUString& rServiceName) throw( uno:
rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "com.sun.star.style.ParagraphPropertiesAsian" ) ) ||
rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "com.sun.star.style.ParagraphPropertiesComplex" ) );
}
-/* -----------------------------19.04.00 15:21--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SwXCellRange::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(7);
@@ -3951,9 +3614,7 @@ uno::Sequence< OUString > SwXCellRange::getSupportedServiceNames(void) throw( un
return aRet;
}
-/*-- 11.12.98 14:27:33---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXCellRange::SwXCellRange(SwUnoCrsr* pCrsr, SwFrmFmt& rFrmFmt,
SwRangeDescriptor& rDesc)
:
@@ -3968,17 +3629,13 @@ SwXCellRange::SwXCellRange(SwUnoCrsr* pCrsr, SwFrmFmt& rFrmFmt,
{
aRgDesc.Normalize();
}
-/*-- 11.12.98 14:27:33---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXCellRange::~SwXCellRange()
{
vos::OGuard aGuard(Application::GetSolarMutex());
delete pTblCrsr;
}
-/*-- 11.12.98 14:27:34---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< table::XCell > SwXCellRange::getCellByPosition(sal_Int32 nColumn, sal_Int32 nRow)
throw( uno::RuntimeException, lang::IndexOutOfBoundsException )
{
@@ -4000,9 +3657,7 @@ uno::Reference< table::XCell > SwXCellRange::getCellByPosition(sal_Int32 nColum
throw lang::IndexOutOfBoundsException();
return aRet;
}
-/*-- 11.12.98 14:27:34---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< table::XCellRange > SwXCellRange::getCellRangeByPosition(
sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom)
throw( uno::RuntimeException, lang::IndexOutOfBoundsException )
@@ -4058,9 +3713,7 @@ uno::Reference< table::XCellRange > SwXCellRange::getCellRangeByPosition(
return aRet;
}
-/*-- 11.12.98 14:27:34---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< table::XCellRange > SwXCellRange::getCellRangeByName(const OUString& rRange)
throw( uno::RuntimeException )
{
@@ -4078,17 +3731,13 @@ uno::Reference< table::XCellRange > SwXCellRange::getCellRangeByName(const OUSt
return getCellRangeByPosition(aDesc.nLeft - aRgDesc.nLeft, aDesc.nTop - aRgDesc.nTop,
aDesc.nRight - aRgDesc.nLeft, aDesc.nBottom - aRgDesc.nTop);
}
-/*-- 11.12.98 14:27:35---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SwXCellRange::getPropertySetInfo(void) throw( uno::RuntimeException )
{
static uno::Reference< beans::XPropertySetInfo > xRef = m_pPropSet->getPropertySetInfo();
return xRef;
}
-/*-- 11.12.98 14:27:35---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCellRange::setPropertyValue(const OUString& rPropertyName,
const uno::Any& aValue) throw( beans::UnknownPropertyException,
beans::PropertyVetoException, lang::IllegalArgumentException,
@@ -4207,9 +3856,7 @@ void SwXCellRange::setPropertyValue(const OUString& rPropertyName,
throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
}
}
-/*-- 11.12.98 14:27:35---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXCellRange::getPropertyValue(const OUString& rPropertyName) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -4291,39 +3938,27 @@ uno::Any SwXCellRange::getPropertyValue(const OUString& rPropertyName) throw( be
}
return aRet;
}
-/*-- 11.12.98 14:27:35---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCellRange::addPropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 14:27:35---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCellRange::removePropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 14:27:36---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCellRange::addVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 14:27:36---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCellRange::removeVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-----------------------------------------------------------------------
-
- -----------------------------------------------------------------------*/
-
void SwXCellRange::GetDataSequence(
uno::Sequence< uno::Any > *pAnySeq, //-> first pointer != 0 is used
uno::Sequence< OUString > *pTxtSeq, //-> as output sequence
@@ -4468,9 +4103,6 @@ void SwXCellRange::GetDataSequence(
pDblSeq->realloc( nDtaCnt );
}
-/*-- 29.04.02 11:42:47---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Sequence< uno::Sequence< uno::Any > > SAL_CALL SwXCellRange::getDataArray()
throw (uno::RuntimeException)
{
@@ -4532,9 +4164,7 @@ uno::Sequence< uno::Sequence< uno::Any > > SAL_CALL SwXCellRange::getDataArray()
}
return aRowSeq;
}
-/*-- 29.04.02 11:42:47---------------------------------------------------
- -----------------------------------------------------------------------*/
void SAL_CALL SwXCellRange::setDataArray(
const uno::Sequence< uno::Sequence< uno::Any > >& rArray )
throw (uno::RuntimeException)
@@ -4600,9 +4230,7 @@ void SAL_CALL SwXCellRange::setDataArray(
}
}
}
-/*-- 11.12.98 14:27:36---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< uno::Sequence< double > > SwXCellRange::getData(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -4641,9 +4269,7 @@ uno::Sequence< uno::Sequence< double > > SwXCellRange::getData(void) throw( uno:
}
return aRowSeq;
}
-/*-- 11.12.98 14:27:37---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCellRange::setData(const uno::Sequence< uno::Sequence< double > >& rData)
throw( uno::RuntimeException )
{
@@ -4686,9 +4312,7 @@ void SwXCellRange::setData(const uno::Sequence< uno::Sequence< double > >& rData
}
}
}
-/*-- 11.12.98 14:27:37---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< OUString > SwXCellRange::getRowDescriptions(void)
throw( uno::RuntimeException )
{
@@ -4728,9 +4352,7 @@ uno::Sequence< OUString > SwXCellRange::getRowDescriptions(void)
throw uno::RuntimeException();
return aRet;
}
-/*-- 11.12.98 14:27:37---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCellRange::setRowDescriptions(const uno::Sequence< OUString >& rRowDesc)
throw( uno::RuntimeException )
{
@@ -4764,9 +4386,7 @@ void SwXCellRange::setRowDescriptions(const uno::Sequence< OUString >& rRowDesc)
}
}
}
-/*-- 11.12.98 14:27:37---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< OUString > SwXCellRange::getColumnDescriptions(void)
throw( uno::RuntimeException )
{
@@ -4806,9 +4426,7 @@ uno::Sequence< OUString > SwXCellRange::getColumnDescriptions(void)
throw uno::RuntimeException();
return aRet;
}
-/*-- 11.12.98 14:27:37---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCellRange::setColumnDescriptions(const uno::Sequence< OUString >& ColumnDesc)
throw( uno::RuntimeException )
{
@@ -4839,52 +4457,40 @@ void SwXCellRange::setColumnDescriptions(const uno::Sequence< OUString >& Column
}
}
}
-/*-- 11.12.98 14:27:38---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCellRange::addChartDataChangeEventListener(const uno::Reference< chart::XChartDataChangeEventListener > & aListener) throw( uno::RuntimeException )
{
if(!GetRegisteredIn())
throw uno::RuntimeException();
aChartLstnrCntnr.AddListener(aListener.get());
}
-/*-- 11.12.98 14:27:38---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCellRange::removeChartDataChangeEventListener(const uno::Reference< chart::XChartDataChangeEventListener > & aListener) throw( uno::RuntimeException )
{
if(!GetRegisteredIn() || !aChartLstnrCntnr.RemoveListener(aListener.get()))
throw uno::RuntimeException();
}
-/* -----------------08.03.99 15:36-------------------
- *
- * --------------------------------------------------*/
+
sal_Bool SwXCellRange::isNotANumber(double /*fNumber*/) throw( uno::RuntimeException )
{
DBG_WARNING("not implemented");
return sal_False;
}
-/* -----------------08.03.99 15:36-------------------
- *
- * --------------------------------------------------*/
+
double SwXCellRange::getNotANumber(void) throw( uno::RuntimeException )
{
DBG_WARNING("not implemented");
return 0.;
}
-/*-- 11.12.98 14:27:38---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< beans::PropertyValue > SwXCellRange::createSortDescriptor(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
return SwUnoCursorHelper::CreateSortDescriptor(true);
}
-/*-- 11.12.98 14:27:39---------------------------------------------------
- -----------------------------------------------------------------------*/
void SAL_CALL SwXCellRange::sort(const uno::Sequence< beans::PropertyValue >& rDescriptor)
throw( uno::RuntimeException )
{
@@ -4900,23 +4506,17 @@ void SAL_CALL SwXCellRange::sort(const uno::Sequence< beans::PropertyValue >& rD
pFmt->GetDoc()->SortTbl(pTableCrsr->GetBoxes(), aSortOpt);
}
}
-/* -----------------27.04.98 16:54-------------------
- *
- * --------------------------------------------------*/
+
sal_uInt16 SwXCellRange::getColumnCount(void)
{
return static_cast< sal_uInt16 >(aRgDesc.nRight - aRgDesc.nLeft + 1);
}
-/* -----------------27.04.98 16:54-------------------
- *
- * --------------------------------------------------*/
+
sal_uInt16 SwXCellRange::getRowCount(void)
{
return static_cast< sal_uInt16 >(aRgDesc.nBottom - aRgDesc.nTop + 1);
}
-/* -----------------------------05.06.01 09:19--------------------------------
- ---------------------------------------------------------------------------*/
const SwUnoCrsr* SwXCellRange::GetTblCrsr() const
{
const SwUnoCrsr* pRet = 0;
@@ -4926,10 +4526,8 @@ const SwUnoCrsr* SwXCellRange::GetTblCrsr() const
return pRet;
}
-/*-- 11.12.98 14:27:39---------------------------------------------------
- -----------------------------------------------------------------------*/
-void SwXCellRange::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXCellRange::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew );
if(!GetRegisteredIn() || !aCursorDepend.GetRegisteredIn())
@@ -4946,26 +4544,21 @@ void SwXCellRange::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
else
aChartLstnrCntnr.ChartDataChanged();
}
+
/******************************************************************
* SwXTableRows
******************************************************************/
-/* -----------------------------19.04.00 15:22--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXTableRows::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXTableRows");
}
-/* -----------------------------19.04.00 15:22--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXTableRows::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return C2U("com.sun.star.text.TableRows") == rServiceName;
}
-/* -----------------------------19.04.00 15:22--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SwXTableRows::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
@@ -4974,21 +4567,16 @@ uno::Sequence< OUString > SwXTableRows::getSupportedServiceNames(void) throw( un
return aRet;
}
TYPEINIT1(SwXTableRows, SwClient);
-/*-- 03.02.99 07:37:41---------------------------------------------------
- -----------------------------------------------------------------------*/
+
SwXTableRows::SwXTableRows(SwFrmFmt& rFrmFmt) :
SwClient(&rFrmFmt)
{
}
-/*-- 03.02.99 07:37:41---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTableRows::~SwXTableRows()
{
}
-/*-- 03.02.99 07:37:41---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SwXTableRows::getCount(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -5003,9 +4591,7 @@ sal_Int32 SwXTableRows::getCount(void) throw( uno::RuntimeException )
}
return nRet;
}
-/*-- 03.02.99 07:37:41---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXTableRows::getByIndex(sal_Int32 nIndex)
throw( lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException )
{
@@ -5020,15 +4606,14 @@ uno::Any SwXTableRows::getByIndex(sal_Int32 nIndex)
if(pTable->GetTabLines().Count() > nIndex)
{
SwTableLine* pLine = pTable->GetTabLines().GetObject((sal_uInt16)nIndex);
- SwClientIter aIter( *pFrmFmt );
- SwXTextTableRow* pXRow = (SwXTextTableRow*)aIter.
- First( TYPE( SwXTextTableRow ));
+ SwIterator<SwXTextTableRow,SwFmt> aIter( *pFrmFmt );
+ SwXTextTableRow* pXRow = aIter.First();
while( pXRow )
{
// gibt es eine passende Zelle bereits?
if(pXRow->GetTblRow() == pLine)
break;
- pXRow = (SwXTextTableRow*)aIter.Next();
+ pXRow = aIter.Next();
}
//sonst anlegen
if(!pXRow)
@@ -5042,16 +4627,12 @@ uno::Any SwXTableRows::getByIndex(sal_Int32 nIndex)
}
return aRet;
}
-/*-- 03.02.99 07:37:42---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Type SAL_CALL SwXTableRows::getElementType(void) throw( uno::RuntimeException )
{
return ::getCppuType((const uno::Reference<beans::XPropertySet>*)0);
}
-/*-- 03.02.99 07:37:42---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTableRows::hasElements(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -5061,9 +4642,7 @@ sal_Bool SwXTableRows::hasElements(void) throw( uno::RuntimeException )
//es gibt keine Tabelle ohne Zeilen
return sal_True;
}
-/*-- 03.02.99 07:37:42---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTableRows::insertByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -5117,9 +4696,7 @@ void SwXTableRows::insertByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( uno:
}
}
}
-/*-- 03.02.99 07:37:43---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTableRows::removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -5179,10 +4756,8 @@ void SwXTableRows::removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( uno:
}
}
}
-/*-- 03.02.99 07:37:43---------------------------------------------------
- -----------------------------------------------------------------------*/
-void SwXTableRows::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXTableRows::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
}
@@ -5190,23 +4765,17 @@ void SwXTableRows::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
/******************************************************************
* SwXTableColumns
******************************************************************/
-/* -----------------------------19.04.00 15:23--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXTableColumns::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXTableColumns");
}
-/* -----------------------------19.04.00 15:23--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXTableColumns::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return C2U("com.sun.star.text.TableColumns") == rServiceName;
}
-/* -----------------------------19.04.00 15:23--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SwXTableColumns::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
@@ -5215,21 +4784,16 @@ uno::Sequence< OUString > SwXTableColumns::getSupportedServiceNames(void) throw(
return aRet;
}
TYPEINIT1(SwXTableColumns, SwClient);
-/*-- 03.02.99 07:37:41---------------------------------------------------
- -----------------------------------------------------------------------*/
+
SwXTableColumns::SwXTableColumns(SwFrmFmt& rFrmFmt) :
SwClient(&rFrmFmt)
{
}
-/*-- 03.02.99 07:37:41---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTableColumns::~SwXTableColumns()
{
}
-/*-- 03.02.99 07:37:41---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SwXTableColumns::getCount(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -5249,9 +4813,7 @@ sal_Int32 SwXTableColumns::getCount(void) throw( uno::RuntimeException )
}
return nRet;
}
-/*-- 03.02.99 07:37:41---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXTableColumns::getByIndex(sal_Int32 nIndex)
throw( lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException )
{
@@ -5276,17 +4838,12 @@ uno::Any SwXTableColumns::getByIndex(sal_Int32 nIndex)
}
return uno::Any(&xRet, ::getCppuType((const uno::Reference<uno::XInterface>*)0));
}
-/*-- 03.02.99 07:37:42---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Type SAL_CALL SwXTableColumns::getElementType(void) throw( uno::RuntimeException )
{
return ::getCppuType((uno::Reference<uno::XInterface>*)0);
}
-/*-- 03.02.99 07:37:42---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTableColumns::hasElements(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -5295,9 +4852,7 @@ sal_Bool SwXTableColumns::hasElements(void) throw( uno::RuntimeException )
throw uno::RuntimeException();
return sal_True;
}
-/*-- 03.02.99 07:37:42---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTableColumns::insertByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -5350,9 +4905,7 @@ void SwXTableColumns::insertByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( u
}
}
}
-/*-- 03.02.99 07:37:43---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTableColumns::removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -5412,16 +4965,12 @@ void SwXTableColumns::removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( u
}
}
}
-/*-- 03.02.99 07:37:43---------------------------------------------------
- -----------------------------------------------------------------------*/
-void SwXTableColumns::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXTableColumns::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
}
-/* -----------------------------22.09.00 11:11--------------------------------
- ---------------------------------------------------------------------------*/
void SwChartEventListenerContainer::ChartDataChanged()
{
if(pListenerArr)
diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx
index f2cd567c0f..f7f9a1dfa7 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -1754,13 +1754,15 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
// DelFullPara is called
const uno::Reference< text::XTextRange> xInsertTextRange =
new SwXTextRange(aStartPam, this);
+ aStartPam.DeleteMark(); // mark position node may be deleted!
pNewFrame->attach( xInsertTextRange );
pNewFrame->setName(m_pImpl->m_pDoc->GetUniqueFrameName());
}
- if (!aStartPam.GetTxt().Len())
+ SwTxtNode *const pTxtNode(aStartPam.GetNode()->GetTxtNode());
+ OSL_ASSERT(pTxtNode);
+ if (!pTxtNode || !pTxtNode->Len()) // don't remove if it contains text!
{
- bool bMoved = false;
{ // has to be in a block to remove the SwIndexes before
// DelFullPara is called
SwPaM aMovePam( *aStartPam.GetNode() );
@@ -1772,14 +1774,8 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
m_pImpl->m_pDoc->SetAttr(
aNewAnchor, *pNewFrame->GetFrmFmt() );
}
- bMoved = true;
- }
- if (bMoved)
- {
- aStartPam.DeleteMark();
-// SwPaM aDelPam( *aStartPam.GetNode() );
- m_pImpl->m_pDoc->DelFullPara(aStartPam/*aDelPam*/);
}
+ m_pImpl->m_pDoc->DelFullPara(aStartPam);
}
}
catch (lang::IllegalArgumentException& rIllegal)
@@ -1857,32 +1853,6 @@ static bool lcl_SimilarPosition( const sal_Int32 nPos1, const sal_Int32 nPos2 )
return abs( nPos1 - nPos2 ) < COL_POS_FUZZY;
}
-void SwXText::copyText(
- const uno::Reference< text::XTextCopy >& xSource )
- throw ( uno::RuntimeException )
-{
- uno::Reference< lang::XUnoTunnel > xTTunnel( xSource, uno::UNO_QUERY_THROW );
- SwXText* pText = 0;
- pText = reinterpret_cast< SwXText* >(
- sal::static_int_cast< sal_IntPtr >( xTTunnel->getSomething( SwXText::getUnoTunnelId()) ));
-
- uno::Reference< text::XText > xText( xSource, uno::UNO_QUERY_THROW );
- uno::Reference< text::XTextCursor > xCursor = xText->createTextCursor( );
- xCursor->gotoEnd( sal_True );
-
- uno::Reference< lang::XUnoTunnel > xTunnel( xCursor, uno::UNO_QUERY_THROW );
-
- OTextCursorHelper* pCursor = 0;
- pCursor = reinterpret_cast< OTextCursorHelper* >(
- sal::static_int_cast< sal_IntPtr >( xTunnel->getSomething( OTextCursorHelper::getUnoTunnelId()) ));
- if ( pCursor )
- {
- SwNodeIndex rNdIndex( *GetStartNode( ), 1 );
- SwPosition rPos( rNdIndex );
- m_pImpl->m_pDoc->CopyRange( *pCursor->GetPaM( ), rPos, false );
- }
-}
-
void SwXText::Impl::ConvertCell(
const bool bFirstCell,
const uno::Sequence< uno::Reference< text::XTextRange > > & rCell,
@@ -2387,6 +2357,35 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
return xRet;
}
+
+void SAL_CALL
+SwXText::copyText(
+ const uno::Reference< text::XTextCopy >& xSource )
+throw (uno::RuntimeException)
+{
+ vos::OGuard g(Application::GetSolarMutex());
+
+ uno::Reference< text::XText > const xText(xSource, uno::UNO_QUERY_THROW);
+ uno::Reference< text::XTextCursor > const xCursor =
+ xText->createTextCursor();
+ xCursor->gotoEnd( sal_True );
+
+ uno::Reference< lang::XUnoTunnel > const xCursorTunnel(xCursor,
+ uno::UNO_QUERY_THROW);
+
+ OTextCursorHelper *const pCursor =
+ ::sw::UnoTunnelGetImplementation<OTextCursorHelper>(xCursorTunnel);
+ if (!pCursor)
+ {
+ throw uno::RuntimeException();
+ }
+
+ SwNodeIndex rNdIndex( *GetStartNode( ), 1 );
+ SwPosition rPos( rNdIndex );
+ m_pImpl->m_pDoc->CopyRange( *pCursor->GetPaM(), rPos, false );
+}
+
+
/******************************************************************
* SwXBodyText
******************************************************************/
@@ -2681,16 +2680,16 @@ public:
}
return *pFmt;
}
-
+protected:
// SwClient
- virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew);
+ virtual void Modify(const SfxPoolItem *pOld, const SfxPoolItem *pNew);
};
/*-- 11.12.98 10:14:51---------------------------------------------------
-----------------------------------------------------------------------*/
-void SwXHeadFootText::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXHeadFootText::Impl::Modify( const SfxPoolItem *pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
}
diff --git a/sw/source/core/unocore/unotextmarkup.cxx b/sw/source/core/unocore/unotextmarkup.cxx
index 4b3fdd0548..078538ca3a 100644
--- a/sw/source/core/unocore/unotextmarkup.cxx
+++ b/sw/source/core/unocore/unotextmarkup.cxx
@@ -48,7 +48,9 @@ using namespace ::com::sun::star;
SwXTextMarkup::SwXTextMarkup( SwTxtNode& rTxtNode, const ModelToViewHelper::ConversionMap* pMap )
: mpTxtNode( &rTxtNode ), mpConversionMap( pMap )
{
- mpTxtNode->Add(this);
+ // FME 2007-07-16 #i79641# SwXTextMarkup is allowed to be removed ...
+ SetIsAllowedToBeRemovedInModifyCall(true);
+ mpTxtNode->Add(this);
}
SwXTextMarkup::~SwXTextMarkup()
@@ -421,12 +423,12 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
}
-void SwXTextMarkup::Modify( SfxPoolItem* /*pOld*/, SfxPoolItem* /*pNew*/ )
+void SwXTextMarkup::Modify( const SfxPoolItem* /*pOld*/, const SfxPoolItem* /*pNew*/ )
{
// FME 2007-07-16 #i79641# In my opinion this is perfectly legal,
// therefore I remove the assertion in SwModify::_Remove()
- if ( pRegisteredIn )
- pRegisteredIn->Remove( this );
+ if ( GetRegisteredIn() )
+ GetRegisteredInNonConst()->Remove( this );
// <--
vos::OGuard aGuard(Application::GetSolarMutex());
diff --git a/sw/source/core/view/printdata.cxx b/sw/source/core/view/printdata.cxx
index 1b1dfc9189..5604ced198 100644
--- a/sw/source/core/view/printdata.cxx
+++ b/sw/source/core/view/printdata.cxx
@@ -110,13 +110,13 @@ void SwRenderData::DeletePostItData()
}
}
-bool SwRenderData::NeedNewViewOptionAdjust( const SwWrtShell& rCompare ) const
+bool SwRenderData::NeedNewViewOptionAdjust( const ViewShell& rCompare ) const
{
return m_pViewOptionAdjust ? ! m_pViewOptionAdjust->checkShell( rCompare ) : true;
}
-void SwRenderData::ViewOptionAdjustStart( SwWrtShell &rSh, const SwViewOption &rViewOptions )
+void SwRenderData::ViewOptionAdjustStart( ViewShell &rSh, const SwViewOption &rViewOptions )
{
if (m_pViewOptionAdjust)
{
diff --git a/sw/source/core/view/vdraw.cxx b/sw/source/core/view/vdraw.cxx
index f5e7a83beb..223b0205e0 100644
--- a/sw/source/core/view/vdraw.cxx
+++ b/sw/source/core/view/vdraw.cxx
@@ -272,7 +272,7 @@ sal_Bool SwViewImp::IsDragPossible( const Point &rPoint )
SdrObject *pO = rMrkList.GetMark(rMrkList.GetMarkCount()-1)->GetMarkedSdrObj();
SwRect aRect;
- if( ::CalcClipRect( pO, aRect, sal_False ) )
+ if( pO && ::CalcClipRect( pO, aRect, sal_False ) )
{
SwRect aTmp;
::CalcClipRect( pO, aTmp, sal_True );
diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx
index b6e8259c5e..bc1249ddd6 100644
--- a/sw/source/core/view/viewimp.cxx
+++ b/sw/source/core/view/viewimp.cxx
@@ -69,7 +69,7 @@ void SwViewImp::Init( const SwViewOption *pNewOpt )
{
ASSERT( pDrawView, "SwViewImp::Init without DrawView" );
//Jetzt die PageView erzeugen wenn sie noch nicht existiert.
- SwRootFrm *pRoot = pSh->getIDocumentLayoutAccess()->GetRootFrm();
+ SwRootFrm *pRoot = pSh->GetLayout(); //swmod 071108//swmod 071225
if ( !pSdrPageView )
{
IDocumentDrawModelAccess* pIDDMA = pSh->getIDocumentDrawModelAccess();
@@ -383,7 +383,7 @@ Color SwViewImp::GetRetoucheColor() const
const ViewShell &rSh = *GetShell();
if ( rSh.GetWin() )
{
- if ( rSh.getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) &&
+ if ( rSh.GetViewOptions()->getBrowseMode() &&
COL_TRANSPARENT != rSh.GetViewOptions()->GetRetoucheColor().GetColor() )
aRet = rSh.GetViewOptions()->GetRetoucheColor();
else if(rSh.GetViewOptions()->IsPagePreview() &&
@@ -413,10 +413,10 @@ void SwViewImp::UpdateAccessible()
// We require a layout and an XModel to be accessible.
IDocumentLayoutAccess* pIDLA = GetShell()->getIDocumentLayoutAccess();
Window *pWin = GetShell()->GetWin();
- ASSERT( pIDLA->GetRootFrm(), "no layout, no access" );
+ ASSERT( GetShell()->GetLayout(), "no layout, no access" ); //swmod 071108//swmod 071225
ASSERT( pWin, "no window, no access" );
- if( IsAccessible() && pIDLA->GetRootFrm() && pWin )
+ if( IsAccessible() && pIDLA->GetCurrentViewShell() && pWin ) //swmod 071108//swmod 071225
GetAccessibleMap().GetDocumentView();
}
diff --git a/sw/source/core/view/viewpg.cxx b/sw/source/core/view/viewpg.cxx
index 8a19da28ff..8095afc693 100644
--- a/sw/source/core/view/viewpg.cxx
+++ b/sw/source/core/view/viewpg.cxx
@@ -86,7 +86,6 @@ void ViewShell::AdjustOptionsForPagePreview(SwPrintData const& rPrintOptions)
return;
}
-
// print brochure
// OD 05.05.2003 #i14016# - consider empty pages on calculation of the scaling
// for a page to be printed.
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 7cb7a28e70..7f02a10030 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -268,7 +268,7 @@ void ViewShell::ImplEndAction( const sal_Bool bIdleEnd )
if ( pRegion )
{
- SwRootFrm* pLayout = GetLayout();
+ SwRootFrm* pCurrentLayout = GetLayout();
Imp()->pRegion = NULL;
@@ -333,7 +333,7 @@ void ViewShell::ImplEndAction( const sal_Bool bIdleEnd )
pOut = pVout;
if ( bPaintsFromSystem )
PaintDesktop( aRect );
- pLayout->Paint( aRect );
+ pCurrentLayout->Paint( aRect );
pOld->DrawOutDev( aRect.Pos(), aRect.SSize(),
aRect.Pos(), aRect.SSize(), *pVout );
pOut = pOld;
@@ -354,7 +354,7 @@ void ViewShell::ImplEndAction( const sal_Bool bIdleEnd )
if ( bPaintsFromSystem )
PaintDesktop( aRect );
- pLayout->Paint( aRect );
+ pCurrentLayout->Paint( aRect );
// #i75172# end DrawingLayer paint
DLPostPaint2(true);
@@ -528,13 +528,14 @@ sal_Bool ViewShell::AddPaintRect( const SwRect & rRect )
ViewShell *pSh = this;
do
{
+ if( pSh->Imp() )
+ {
if ( pSh->IsPreView() && pSh->GetWin() )
-// pSh->GetWin()->Invalidate();
::RepaintPagePreview( pSh, rRect );
else
- bRet |= pSh->Imp()->AddPaintRect( rRect );
+ bRet |= pSh->Imp()->AddPaintRect( rRect );//swmod 080111
+ }
pSh = (ViewShell*)pSh->GetNext();
-
} while ( pSh != this );
return bRet;
}
@@ -558,7 +559,6 @@ void ViewShell::InvalidateWindows( const SwRect &rRect )
if ( pSh->GetWin() )
{
if ( pSh->IsPreView() )
-// pSh->GetWin()->Invalidate();
::RepaintPagePreview( pSh, rRect );
else if ( pSh->VisArea().IsOver( rRect ) )
pSh->GetWin()->Invalidate( rRect.SVRect() );
@@ -586,7 +586,7 @@ void ViewShell::MakeVisible( const SwRect &rRect )
{
if( pWin )
{
- const SwFrm* pRoot = GetDoc()->GetRootFrm();
+ const SwFrm* pRoot = GetLayout();
int nLoopCnt = 3;
long nOldH;
do{
@@ -594,7 +594,7 @@ void ViewShell::MakeVisible( const SwRect &rRect )
StartAction();
ScrollMDI( this, rRect, USHRT_MAX, USHRT_MAX );
EndAction();
- } while( nOldH != pRoot->Frm().Height() && nLoopCnt-- );
+ } while( nOldH != pRoot->Frm().Height() && nLoopCnt-- ); //swmod 071108//swmod 071225
}
#ifdef DBG_UTIL
else
@@ -1176,13 +1176,13 @@ void ViewShell::VisPortChgd( const SwRect &rRect)
const long nXDiff = aPrevArea.Left() - VisArea().Left();
const long nYDiff = aPrevArea.Top() - VisArea().Top();
- if( !nXDiff && !getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) &&
+ if( !nXDiff && !GetViewOptions()->getBrowseMode() &&
(!Imp()->HasDrawView() || !Imp()->GetDrawView()->IsGridVisible() ) )
{
//Falls moeglich die Wiese nicht mit Scrollen.
//Also linke und rechte Kante des Scrollbereiches auf die
//Seiten begrenzen.
- const SwPageFrm *pPage = (SwPageFrm*)GetDoc()->GetRootFrm()->Lower();
+ const SwPageFrm *pPage = (SwPageFrm*)GetLayout()->Lower(); //swmod 071108//swmod 071225
if ( pPage->Frm().Top() > pOldPage->Frm().Top() )
pPage = (SwPageFrm*)pOldPage;
SwRect aBoth( VisArea() );
@@ -1652,7 +1652,7 @@ void ViewShell::PaintDesktop( const SwRect &rRect )
//Die Rechtecke neben den Seiten muessen wir leider auf jedenfall Painten,
//den diese werden spaeter beim VisPortChgd ausgespart.
sal_Bool bBorderOnly = sal_False;
- const SwRootFrm *pRoot = GetDoc()->GetRootFrm();
+ const SwRootFrm *pRoot = GetLayout();//swmod 080305
if ( rRect.Top() > pRoot->Frm().Bottom() )
{
const SwFrm *pPg = pRoot->Lower();
@@ -1674,7 +1674,7 @@ void ViewShell::PaintDesktop( const SwRect &rRect )
if ( bBorderOnly )
{
- const SwFrm *pPage = pRoot->Lower();
+ const SwFrm *pPage =pRoot->Lower(); //swmod 071108//swmod 071225
SwRect aLeft( rRect ), aRight( rRect );
while ( pPage )
{
@@ -2084,8 +2084,7 @@ sal_Int32 ViewShell::GetBrowseWidth() const
void ViewShell::CheckBrowseView( sal_Bool bBrowseChgd )
{
- if ( !bBrowseChgd &&
- !getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ if ( !bBrowseChgd && !GetViewOptions()->getBrowseMode() )
return;
SET_CURR_SHELL( this );
@@ -2153,14 +2152,15 @@ void ViewShell::CheckBrowseView( sal_Bool bBrowseChgd )
SwRootFrm *ViewShell::GetLayout() const
{
- return GetDoc()->GetRootFrm();
+ return pLayout.get(); //swmod 080116
}
+/***********************************************************************/
OutputDevice& ViewShell::GetRefDev() const
{
OutputDevice* pTmpOut = 0;
if ( GetWin() &&
- getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) &&
+ GetViewOptions()->getBrowseMode() &&
!GetViewOptions()->IsPrtFormat() )
pTmpOut = GetWin();
else if ( 0 != mpTmpRef )
@@ -2218,7 +2218,10 @@ void ViewShell::ApplyViewOptions( const SwViewOption &rOpt )
ImplApplyViewOptions( rOpt );
- //Einige Aenderungen muessen synchronisiert werden.
+ // swmod 080115
+ // With one layout per view it is not longer necessary
+ // to sync these "layout related" view options
+ // But as long as we have to disable "multiple layout"
pSh = (ViewShell*)this->GetNext();
while ( pSh != this )
{
@@ -2234,6 +2237,7 @@ void ViewShell::ApplyViewOptions( const SwViewOption &rOpt )
pSh->ImplApplyViewOptions( aOpt );
pSh = (ViewShell*)pSh->GetNext();
}
+ // End of disabled multiple window
pSh = this;
do
@@ -2272,7 +2276,7 @@ void ViewShell::ImplApplyViewOptions( const SwViewOption &rOpt )
if( pFldType && pFldType->GetDepends() )
{
SwMsgPoolItem aHnt( RES_HIDDENPARA_PRINT );
- pFldType->Modify( &aHnt, 0);
+ pFldType->ModifyNotification( &aHnt, 0);
}
bReformat = sal_True;
}
@@ -2298,12 +2302,17 @@ void ViewShell::ImplApplyViewOptions( const SwViewOption &rOpt )
// Wenn kein ReferenzDevice (Drucker) zum Formatieren benutzt wird,
// sondern der Bildschirm, muss bei Zoomfaktoraenderung neu formatiert
// werden.
- if( getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ if( pOpt->getBrowseMode() )
bReformat = sal_True;
}
- if ( getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) &&
- pOpt->IsPrtFormat() != rOpt.IsPrtFormat() )
+ bool bBrowseModeChanged = false;
+ if( pOpt->getBrowseMode() != rOpt.getBrowseMode() )
+ {
+ bBrowseModeChanged = true;
+ bReformat = sal_True;
+ }
+ else if( pOpt->getBrowseMode() && pOpt->IsPrtFormat() != rOpt.IsPrtFormat() )
bReformat = sal_True;
if ( HasDrawView() || rOpt.IsGridVisible() )
@@ -2347,6 +2356,15 @@ void ViewShell::ImplApplyViewOptions( const SwViewOption &rOpt )
pDoc->set(IDocumentSettingAccess::HTML_MODE, 0 != ::GetHtmlMode(pDoc->GetDocShell()));
+ if( bBrowseModeChanged )
+ {
+ // --> FME 2005-03-16 #i44963# Good occasion to check if page sizes in
+ // page descriptions are still set to (LONG_MAX, LONG_MAX) (html import)
+ pDoc->CheckDefaultPageFmt();
+ // <--
+ CheckBrowseView( sal_True );
+ }
+
pMyWin->Invalidate();
if ( bReformat )
{
@@ -2437,8 +2455,7 @@ void ViewShell::SetPDFExportOption(sal_Bool bSet)
{
if( bSet != pOpt->IsPDFExport() )
{
- if( bSet &&
- getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ if( bSet && pOpt->getBrowseMode() )
pOpt->SetPrtFormat( sal_True );
pOpt->SetPDFExport(bSet);
}
@@ -2509,13 +2526,11 @@ uno::Reference< ::com::sun::star::accessibility::XAccessible > ViewShell::Create
{
uno::Reference< ::com::sun::star::accessibility::XAccessible > xAcc;
- SwDoc *pMyDoc = GetDoc();
-
// We require a layout and an XModel to be accessible.
- ASSERT( pMyDoc->GetRootFrm(), "no layout, no access" );
+ ASSERT( pLayout, "no layout, no access" );
ASSERT( GetWin(), "no window, no access" );
- if( pMyDoc->GetRootFrm() && GetWin() )
+ if( pDoc->GetCurrentViewShell() && GetWin() ) //swmod 071108
xAcc = Imp()->GetAccessibleMap().GetDocumentView();
return xAcc;
@@ -2528,18 +2543,18 @@ ViewShell::CreateAccessiblePreview()
"Can't create accessible preview for non-preview ViewShell" );
// We require a layout and an XModel to be accessible.
- ASSERT( pDoc->GetRootFrm(), "no layout, no access" );
+ ASSERT( pLayout, "no layout, no access" );
ASSERT( GetWin(), "no window, no access" );
// OD 15.01.2003 #103492# - add condition <IsPreView()>
- if ( IsPreView() && pDoc->GetRootFrm() && GetWin() )
+ if ( IsPreView() && GetLayout()&& GetWin() )
{
// OD 14.01.2003 #103492# - adjustment for new method signature
return Imp()->GetAccessibleMap().GetDocumentPreview(
PagePreviewLayout()->maPrevwPages,
GetWin()->GetMapMode().GetScaleX(),
- pDoc->GetRootFrm()->GetPageByPageNum( PagePreviewLayout()->mnSelectedPageNum ),
- PagePreviewLayout()->maWinSize );
+ GetLayout()->GetPageByPageNum( PagePreviewLayout()->mnSelectedPageNum ),
+ PagePreviewLayout()->maWinSize ); //swmod 080305
}
return NULL;
}
@@ -2635,6 +2650,30 @@ void ViewShell::SetCareWin( Window* pNew )
pCareWindow = pNew;
}
+sal_uInt16 ViewShell::GetPageCount() const
+{
+ return GetLayout() ? GetLayout()->GetPageNum() : 1;
+}
+
+const Size ViewShell::GetPageSize( sal_uInt16 nPageNum, bool bSkipEmptyPages ) const
+{
+ Size aSize;
+ const SwRootFrm* pTmpRoot = GetLayout();
+ if( pTmpRoot && nPageNum )
+ {
+ const SwPageFrm* pPage = static_cast<const SwPageFrm*>
+ (pTmpRoot->Lower());
+
+ while( --nPageNum && pPage->GetNext() )
+ pPage = static_cast<const SwPageFrm*>( pPage->GetNext() );
+
+ if( !bSkipEmptyPages && pPage->IsEmptyPage() && pPage->GetNext() )
+ pPage = static_cast<const SwPageFrm*>( pPage->GetNext() );
+
+ aSize = pPage->Frm().SSize();
+ }
+ return aSize;
+}
// --> FME 2004-06-15 #i12836# enhanced pdf export
sal_Int32 ViewShell::GetPageNumAndSetOffsetForPDF( OutputDevice& rOut, const SwRect& rRect ) const
diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx
index 02aac7dc90..4da022dfe2 100644
--- a/sw/source/core/view/vnew.cxx
+++ b/sw/source/core/view/vnew.cxx
@@ -47,14 +47,11 @@
#include <ndgrf.hxx>
#include <ndindex.hxx>
#include <accessibilityoptions.hxx>
-
+#include <switerator.hxx>
/*************************************************************************
|*
|* ViewShell::Init()
-|*
-|* Letzte Aenderung MA 14. Jun. 96
-|*
|*************************************************************************/
void ViewShell::Init( const SwViewOption *pNewOpt )
@@ -110,8 +107,7 @@ void ViewShell::Init( const SwViewOption *pNewOpt )
// --> FME 2005-01-21 #i41075#
// Only setup the printer if we need one:
- const IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess();
- const bool bBrowseMode = pIDSA->get(IDocumentSettingAccess::BROWSE_MODE);
+ const bool bBrowseMode = pOpt->getBrowseMode();
if( pPDFOut )
InitPrt( pPDFOut );
// <--
@@ -134,12 +130,24 @@ void ViewShell::Init( const SwViewOption *pNewOpt )
GetWin()->SetLineColor();
}
- //Layout erzeugen wenn es noch nicht vorhanden ist.
- SwRootFrm* pRoot = GetDoc()->GetRootFrm();
- if( !pRoot )
- GetDoc()->SetRootFrm( pRoot = new SwRootFrm( pDoc->GetDfltFrmFmt(), this ) );
-
- SizeChgNotify();
+ // Create a new layout, if there is no one available
+ if( !pLayout )
+ {
+ // Here's the code which disables the usage of "multiple" layouts at the moment
+ // If the problems with controls and groups objects are solved,
+ // this code can be removed...
+ ViewShell *pCurrShell = GetDoc()->GetCurrentViewShell();
+ if( pCurrShell )
+ pLayout = pCurrShell->pLayout;
+ // end of "disable multiple layouts"
+ if( !pLayout )
+ {
+ // switched to two step construction because creating the layout in SwRootFrm needs a valid pLayout set
+ pLayout = SwRootFrmPtr(new SwRootFrm( pDoc->GetDfltFrmFmt(), this ));//swmod081016
+ pLayout->Init( pDoc->GetDfltFrmFmt() );
+ }
+ }
+ SizeChgNotify(); //swmod 071108
// --> #i31958#
// XForms mode: initialize XForms mode, based on design mode (draw view)
@@ -156,9 +164,6 @@ void ViewShell::Init( const SwViewOption *pNewOpt )
/*************************************************************************
|*
|* ViewShell::ViewShell() CTor fuer die erste Shell.
-|*
-|* Letzte Aenderung MA 29. Aug. 95
-|*
|*************************************************************************/
ViewShell::ViewShell( SwDoc& rDocument, Window *pWindow,
@@ -239,9 +244,6 @@ ViewShell::ViewShell( SwDoc& rDocument, Window *pWindow,
/*************************************************************************
|*
|* ViewShell::ViewShell() CTor fuer weitere Shells auf ein Dokument.
-|*
-|* Letzte Aenderung MA 29. Aug. 95
-|*
|*************************************************************************/
ViewShell::ViewShell( ViewShell& rShell, Window *pWindow,
@@ -276,9 +278,8 @@ ViewShell::ViewShell( ViewShell& rShell, Window *pWindow,
bPaintInProgress = bViewLocked = bInEndAction = bFrameView =
bEndActionByVirDev = sal_False;
bPreView = 0 !=( VSHELLFLAG_ISPREVIEW & nFlags );
- // OD 12.12.2002 #103492#
- if ( bPreView )
- pImp->InitPagePreviewLayout();
+ if( nFlags & VSHELLFLAG_SHARELAYOUT ) //swmod 080125
+ pLayout = rShell.pLayout;//swmod 080125
SET_CURR_SHELL( this );
@@ -289,6 +290,10 @@ ViewShell::ViewShell( ViewShell& rShell, Window *pWindow,
Init( rShell.GetViewOptions() ); //verstellt ggf. das Outdev (InitPrt())
pOut = pOutput;
+ // OD 12.12.2002 #103492#
+ if ( bPreView )
+ pImp->InitPagePreviewLayout();
+
((SwHiddenTxtFieldType*)pDoc->GetSysFldType( RES_HIDDENTXTFLD ))->
SetHiddenFlag( !pOpt->IsShowHiddenField() );
@@ -313,9 +318,6 @@ ViewShell::ViewShell( ViewShell& rShell, Window *pWindow,
|*
|* ViewShell::~ViewShell()
|*
-|* Ersterstellung MA ??
-|* Letzte Aenderung MA 10. May. 95
-|*
******************************************************************************/
ViewShell::~ViewShell()
@@ -341,9 +343,8 @@ ViewShell::~ViewShell()
{
if( pGNd->IsAnimated() )
{
- SwClientIter aIter( *pGNd );
- for( SwFrm* pFrm = (SwFrm*)aIter.First( TYPE(SwFrm) );
- pFrm; pFrm = (SwFrm*)aIter.Next() )
+ SwIterator<SwFrm,SwGrfNode> aIter( *pGNd );
+ for( SwFrm* pFrm = aIter.First(); pFrm; pFrm = aIter.Next() )
{
ASSERT( pFrm->IsNoTxtFrm(), "GraphicNode with Text?" );
((SwNoTxtFrm*)pFrm)->StopAnimation( pOut );
@@ -364,8 +365,8 @@ ViewShell::~ViewShell()
if( !pDoc->release() )
delete pDoc, pDoc = 0;
else
- pDoc->GetRootFrm()->ResetNewLayout();
- }
+ GetLayout()->ResetNewLayout();
+ }//swmod 080317
delete pOpt;
@@ -380,7 +381,12 @@ ViewShell::~ViewShell()
}
if ( pDoc )
+ {
GetLayout()->DeRegisterShell( this );
+ if(pDoc->GetCurrentViewShell()==this)
+ pDoc->SetCurrentViewShell( this->GetNext()!=this ?
+ (ViewShell*)this->GetNext() : NULL );
+ }
delete mpTmpRef;
delete pAccOptions;
@@ -388,7 +394,7 @@ ViewShell::~ViewShell()
sal_Bool ViewShell::HasDrawView() const
{
- return Imp()->HasDrawView();
+ return Imp() ? Imp()->HasDrawView() : 0;
}
void ViewShell::MakeDrawView()
diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx
index e6fa519e2b..60ea066943 100644
--- a/sw/source/core/view/vprint.cxx
+++ b/sw/source/core/view/vprint.cxx
@@ -341,13 +341,12 @@ void ViewShell::CalcPagesForPrint( sal_uInt16 nMax )
{
SET_CURR_SHELL( this );
- SwRootFrm* pLayout = GetLayout();
- // sal_uLong nStatMax = pLayout->GetPageNum();
+ SwRootFrm* pMyLayout = GetLayout();
- const SwFrm *pPage = pLayout->Lower();
- SwLayAction aAction( pLayout, Imp() );
+ const SwFrm *pPage = pMyLayout->Lower();
+ SwLayAction aAction( pMyLayout, Imp() );
- pLayout->StartAllAction();
+ pMyLayout->StartAllAction();
for ( sal_uInt16 i = 1; pPage && i <= nMax; pPage = pPage->GetNext(), ++i )
{
pPage->Calc();
@@ -365,7 +364,8 @@ void ViewShell::CalcPagesForPrint( sal_uInt16 nMax )
Imp()->SetFirstVisPageInvalid();
// SwPaintQueue::Repaint();
}
- pLayout->EndAllAction();
+
+ pMyLayout->EndAllAction();
}
/******************************************************************************/
@@ -411,7 +411,7 @@ SwDoc * ViewShell::FillPrtDoc( SwDoc *pPrtDoc, const SfxPrinter* pPrt)
SwShellTableCrsr* pShellTblCrsr = pFESh->GetTableCrsr();
const SwCntntNode* pCntntNode = pShellTblCrsr->GetNode()->GetCntntNode();
- const SwCntntFrm *pCntntFrm = pCntntNode ? pCntntNode->GetFrm( 0, pShellTblCrsr->Start() ) : 0;
+ const SwCntntFrm *pCntntFrm = pCntntNode ? pCntntNode->getLayoutFrm( GetLayout(), 0, pShellTblCrsr->Start() ) : 0;
if( pCntntFrm )
{
SwRect aCharRect;
@@ -610,10 +610,10 @@ void ViewShell::PrtOle2( SwDoc *pDoc, const SwViewOption *pOpt, const SwPrintDat
//eine, dann legen wir uns eine neue Sicht an, oder das Doc hat noch
//keine, dann erzeugen wir die erste Sicht.
ViewShell *pSh;
- if( pDoc->GetRootFrm() && pDoc->GetRootFrm()->GetCurrShell() )
- pSh = new ViewShell( *pDoc->GetRootFrm()->GetCurrShell(), 0, pOleOut );
- else
- pSh = new ViewShell( *pDoc, 0, pOpt, pOleOut );
+ if( pDoc->GetCurrentViewShell() )
+ pSh = new ViewShell( *pDoc->GetCurrentViewShell(), 0, pOleOut,VSHELLFLAG_SHARELAYOUT );//swmod 080129
+ else //swmod 071108//swmod 071225
+ pSh = new ViewShell( *pDoc, 0, pOpt, pOleOut);//swmod 080129
{
SET_CURR_SHELL( pSh );
@@ -623,11 +623,11 @@ void ViewShell::PrtOle2( SwDoc *pDoc, const SwViewOption *pOpt, const SwPrintDat
SwRect aSwRect( rRect );
pSh->aVisArea = aSwRect;
- if ( pSh->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) &&
+ if ( pSh->GetViewOptions()->getBrowseMode() &&
pSh->GetNext() == pSh )
{
pSh->CheckBrowseView( sal_False );
- pDoc->GetRootFrm()->Lower()->InvalidateSize();
+ pSh->GetLayout()->Lower()->InvalidateSize();
}
// --> FME 2005-02-10 #119474#
diff --git a/sw/source/filter/ascii/parasc.cxx b/sw/source/filter/ascii/parasc.cxx
index dd2cd6580a..6bd4ceb7f1 100644
--- a/sw/source/filter/ascii/parasc.cxx
+++ b/sw/source/filter/ascii/parasc.cxx
@@ -310,7 +310,7 @@ sal_uLong SwASCIIParser::ReadChars()
}
else if (pUseMe != &aEmpty) //Already successfully figured out type
{
- rInput.StartReadingUnicodeText();
+ rInput.StartReadingUnicodeText( currentCharSet );
bSwapUnicode = rInput.IsEndianSwap();
}
diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx
index c5d5ad7b7f..9cc1bc1380 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -57,6 +57,7 @@
#include <editeng/spltitem.hxx>
#include <editeng/orphitem.hxx>
#include <svx/xoutbmp.hxx>
+#include <svx/svdobj.hxx>
#include <editeng/langitem.hxx>
#include <editeng/frmdiritem.hxx>
#include <svtools/htmlout.hxx>
@@ -86,8 +87,6 @@
#include <txtftn.hxx>
#include <fmtftn.hxx>
// FOOTNOTES
-#include <dcontact.hxx>
-
#include "doc.hxx"
#include "swerror.h"
#include "charatr.hxx"
diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx
index 557076a73a..e58241fd28 100644
--- a/sw/source/filter/html/htmlforw.cxx
+++ b/sw/source/filter/html/htmlforw.cxx
@@ -67,12 +67,11 @@
#include "pam.hxx"
#include "doc.hxx"
#include "ndtxt.hxx"
-#include "dcontact.hxx"
#include "flypos.hxx"
#include "wrthtml.hxx"
#include "htmlfly.hxx"
#include "htmlform.hxx"
-
+#include "frmfmt.hxx"
using namespace ::com::sun::star;
using ::rtl::OUString;
diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx
index 5ddb2f8a81..3ac60d23e0 100644
--- a/sw/source/filter/html/htmltab.cxx
+++ b/sw/source/filter/html/htmltab.cxx
@@ -5128,7 +5128,7 @@ void _TblSaveStruct::MakeTable( sal_uInt16 nWidth, SwPosition& rPos, SwDoc *pDoc
SwTableNode *pTblNd = pTCntxt->GetTableNode();
ASSERT( pTblNd, "Wo ist der Tabellen-Node" );
- if( pDoc->GetRootFrm() && pTblNd )
+ if( pDoc->GetCurrentViewShell() && pTblNd ) //swmod 071108//swmod 071225
{
// Existiert schon ein Layout, dann muss an dieser Tabelle die
// BoxFrames neu erzeugt werden.
diff --git a/sw/source/filter/html/htmlvsh.hxx b/sw/source/filter/html/htmlvsh.hxx
index 82e1c1df1f..924b8852cc 100644
--- a/sw/source/filter/html/htmlvsh.hxx
+++ b/sw/source/filter/html/htmlvsh.hxx
@@ -34,7 +34,8 @@ class ViewShell;
class SwHTMLViewShellClient : public SwClient
{
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew );
+protected:
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew );
public:
@@ -45,7 +46,7 @@ public:
void Register( ViewShell *pVsh );
void DeRegister();
- /*inline*/ ViewShell *GetViewShell(); // im swhtml.cxx
+ ViewShell *GetViewShell();
};
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index 41499a1a2a..5982229807 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -926,15 +926,15 @@ if( pSttNdIdx->GetIndex()+1 == pPam->GetBound( sal_False ).nNode.GetIndex() )
#endif
}
-void SwHTMLParser::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
+void SwHTMLParser::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
{
switch( pOld ? pOld->Which() : pNew ? pNew->Which() : 0 )
{
case RES_OBJECTDYING:
- if( ((SwPtrMsgPoolItem *)pOld)->pObject == pRegisteredIn )
+ if( ((SwPtrMsgPoolItem *)pOld)->pObject == GetRegisteredIn() )
{
// dann uns selbst beenden
- pRegisteredIn->Remove( this );
+ GetRegisteredInNonConst()->Remove( this );
ReleaseRef(); // ansonsten sind wir fertig!
}
break;
diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx
index 7520d35dbd..c8661b8356 100644
--- a/sw/source/filter/html/swhtml.hxx
+++ b/sw/source/filter/html/swhtml.hxx
@@ -924,7 +924,7 @@ protected:
virtual ~SwHTMLParser();
// wird das Dok geloescht, ist auch der Parser zu loeschen
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew );
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew );
virtual void AddMetaUserDefined( ::rtl::OUString const & i_rMetaName );
diff --git a/sw/source/filter/inc/fltshell.hxx b/sw/source/filter/inc/fltshell.hxx
index 093d666d29..63adae9c9a 100644
--- a/sw/source/filter/inc/fltshell.hxx
+++ b/sw/source/filter/inc/fltshell.hxx
@@ -166,7 +166,7 @@ class SwFltAnchorClient : public SwClient
public:
SwFltAnchorClient(SwFltAnchor * pFltAnchor);
- virtual void Modify (SfxPoolItem *pOld, SfxPoolItem *pNew);
+ virtual void Modify (const SfxPoolItem *pOld, const SfxPoolItem *pNew);
};
diff --git a/sw/source/filter/rtf/rtfnum.cxx b/sw/source/filter/rtf/rtfnum.cxx
index dd262cb3d0..5671ec46bb 100644
--- a/sw/source/filter/rtf/rtfnum.cxx
+++ b/sw/source/filter/rtf/rtfnum.cxx
@@ -720,7 +720,7 @@ void SwRTFParser::RemoveUnusedNumRule( SwNumRule* pRule )
SwCharFmt* pCFmt = rNFmt.GetCharFmt();
if( pCFmt )
{
- pCFmt->Remove( &rNFmt );
+ rNFmt.ForgetCharFmt();
if( !pCFmt->GetDepends() )
pDoc->DelCharFmt( pCFmt );
}
diff --git a/sw/source/filter/rtf/rtftbl.cxx b/sw/source/filter/rtf/rtftbl.cxx
index 9f4ea9b6f2..6a051d5872 100644
--- a/sw/source/filter/rtf/rtftbl.cxx
+++ b/sw/source/filter/rtf/rtftbl.cxx
@@ -783,9 +783,9 @@ void SwRTFParser::ReadTable( int nToken )
{
SwTableBox* pBox = pNewLine->GetTabBoxes()[0];
pBoxFmt = (SwTableBoxFmt*)pBox->GetFrmFmt();
- pBoxFmt->Remove( pBox );
+ pBox->ForgetFrmFmt();
delete pBoxFmt;
- aBoxFmts[0]->Add( pBox );
+ pBox->RegisterToFormat( *aBoxFmts[0] );
SwTxtNode* pTNd = pDoc->GetNodes()[ pBox->GetSttIdx()+1 ]
->GetTxtNode();
ASSERT( pTNd, "wo ist der Textnode dieser Box?" );
diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx
index 59bbcc7ecd..b12ade7fba 100644
--- a/sw/source/filter/rtf/swparrtf.cxx
+++ b/sw/source/filter/rtf/swparrtf.cxx
@@ -1061,11 +1061,11 @@ InsertedTableClient::InsertedTableClient(SwTableNode & rNode)
SwTableNode * InsertedTableClient::GetTableNode()
{
- return dynamic_cast<SwTableNode *> (pRegisteredIn);
+ return dynamic_cast<SwTableNode *> (GetRegisteredInNonConst());
}
InsertedTablesManager::InsertedTablesManager(const SwDoc &rDoc)
- : mbHasRoot(rDoc.GetRootFrm())
+ : mbHasRoot(rDoc.GetCurrentLayout()) //swmod 080218
{
}
diff --git a/sw/source/filter/ww1/fltshell.cxx b/sw/source/filter/ww1/fltshell.cxx
index 5592d5ec8e..2fbb19d8d5 100644
--- a/sw/source/filter/ww1/fltshell.cxx
+++ b/sw/source/filter/ww1/fltshell.cxx
@@ -137,13 +137,14 @@ void SwFltStackEntry::SetEndPos(const SwPosition& rEndPos)
sal_Bool SwFltStackEntry::MakeRegion(SwDoc* pDoc, SwPaM& rRegion, sal_Bool bCheck )
{
- // wird ueberhaupt ein Bereich umspannt ??
- // - ist kein Bereich, dann nicht returnen wenn am Anfang vom Absatz
- // - Felder aussortieren, koennen keinen Bereich haben !!
- if (
- nMkNode.GetIndex() == nPtNode.GetIndex() && nMkCntnt == nPtCntnt &&
- nPtCntnt && RES_TXTATR_FIELD != pAttr->Which()
- )
+ // does this range actually contain something?
+ // empty range is allowed if at start of empty paragraph
+ // fields are special: never have range, so leave them
+ SwCntntNode *const pCntntNode(
+ SwNodeIndex(nMkNode, +1).GetNode().GetCntntNode());
+ if ((nMkNode.GetIndex() == nPtNode.GetIndex()) && (nMkCntnt == nPtCntnt)
+ && ((0 != nPtCntnt) || (pCntntNode && (0 != pCntntNode->Len())))
+ && (RES_TXTATR_FIELD != pAttr->Which()))
{
return sal_False;
}
@@ -430,7 +431,7 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos, SwFltStackEntry*
pFmt->SetFmtAttr(aAnchor);
// Damit die Frames bei Einfuegen in existierendes Doc
// erzeugt werden (erst nach Setzen des Ankers!):
- if(pDoc->GetRootFrm()
+ if(pDoc->GetCurrentViewShell() //swmod 071108//swmod 071225
&& (FLY_AT_PARA == pFmt->GetAnchor().GetAnchorId()))
{
pFmt->MakeFrms();
@@ -777,11 +778,11 @@ SwFltAnchorClient::SwFltAnchorClient(SwFltAnchor * pFltAnchor)
{
}
-void SwFltAnchorClient::Modify(SfxPoolItem *, SfxPoolItem * pNew)
+void SwFltAnchorClient::Modify(const SfxPoolItem *, const SfxPoolItem * pNew)
{
if (pNew->Which() == RES_FMT_CHG)
{
- SwFmtChg * pFmtChg = dynamic_cast<SwFmtChg *> (pNew);
+ const SwFmtChg * pFmtChg = dynamic_cast<const SwFmtChg *> (pNew);
if (pFmtChg != NULL)
{
@@ -1605,7 +1606,7 @@ void SwFltOutDoc::EndTable()
rStack.SetAttr( *pPaM->GetPoint(), 0, sal_False );
rEndStack.SetAttr( *pPaM->GetPoint(), 0, sal_False );
- if (GetDoc().GetRootFrm()){
+ if (GetDoc().GetCurrentViewShell()){ //swmod 071108//swmod 071225
SwTableNode* pTableNode = GetDoc().IsIdxInTbl(
pPaM->GetPoint()->nNode);
pTableNode->DelFrms();
diff --git a/sw/source/filter/ww8/WW8TableInfo.cxx b/sw/source/filter/ww8/WW8TableInfo.cxx
index 9f1727d3a5..609fcc6a17 100644
--- a/sw/source/filter/ww8/WW8TableInfo.cxx
+++ b/sw/source/filter/ww8/WW8TableInfo.cxx
@@ -251,8 +251,8 @@ WidthsPtr WW8TableNodeInfoInner::getWidthsOfRow()
pWidths = WidthsPtr(new Widths);
// number of cell written
sal_uInt32 nBoxes = rTabBoxes.Count();
- if ( nBoxes > 32 )
- nBoxes = 32;
+ if ( nBoxes > MAXTABLECELLS )
+ nBoxes = MAXTABLECELLS;
for (sal_uInt32 n = 0; n < nBoxes; n++)
{
@@ -282,8 +282,8 @@ RowSpansPtr WW8TableNodeInfoInner::getRowSpansOfRow()
const SwTableBoxes & rTabBoxes = pTabLine->GetTabBoxes();
sal_uInt32 nBoxes = rTabBoxes.Count();
- if (nBoxes > 32)
- nBoxes = 32;
+ if (nBoxes > MAXTABLECELLS)
+ nBoxes = MAXTABLECELLS;
for (sal_uInt32 n = 0; n < nBoxes; ++n)
{
diff --git a/sw/source/filter/ww8/WW8TableInfo.hxx b/sw/source/filter/ww8/WW8TableInfo.hxx
index 3f74d4a5fc..0afa0978f2 100644
--- a/sw/source/filter/ww8/WW8TableInfo.hxx
+++ b/sw/source/filter/ww8/WW8TableInfo.hxx
@@ -46,6 +46,8 @@ namespace ww8
{
using namespace ::std;
+const unsigned int MAXTABLECELLS = 63;
+
class WW8TableNodeInfo;
typedef boost::shared_ptr<SwRect> SwRectPtr;
typedef ::std::vector<const SwTableBox *> TableBoxVector;
diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx
index 42f0cd0b58..7352c3d33d 100644..100755
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -118,6 +118,11 @@ RtfSdrExport& RtfExport::SdrExporter() const
return *m_pSdrExport;
}
+bool RtfExport::HackIsWW8OrHigher() const
+{
+ return true;
+}
+
bool RtfExport::CollapseScriptsforWordOk( sal_uInt16 nScript, sal_uInt16 nWhich )
{
// FIXME is this actually true for rtf? - this is copied from DOCX
@@ -480,6 +485,10 @@ void RtfExport::WritePageDescTable()
}
Strm() << '}' << sNewLine;
bOutPageDescs = sal_False;
+
+ // reset table infos, otherwise the depth of the cells will be incorrect,
+ // in case the page style (header or footer) had tables
+ mpTableInfo = ww8::WW8TableInfo::Pointer_t(new ww8::WW8TableInfo());
}
void RtfExport::ExportDocument_Impl()
@@ -1243,16 +1252,19 @@ void RtfExport::WriteHeaderFooter(const SwFrmFmt& rFmt, bool bHeader, const sal_
class SwRTFWriter : public Writer
{
- public:
+ bool m_bOutOutlineOnly;
+ public:
SwRTFWriter( const String& rFilterName, const String& rBaseURL );
virtual ~SwRTFWriter();
virtual sal_uLong WriteStream();
};
-SwRTFWriter::SwRTFWriter( const String& /*rFltName*/, const String & rBaseURL )
+SwRTFWriter::SwRTFWriter( const String& rFltName, const String & rBaseURL )
{
OSL_TRACE("%s", OSL_THIS_FUNC);
SetBaseURL( rBaseURL );
+ // export outline nodes, only (send outline to clipboard/presentation)
+ m_bOutOutlineOnly = 'O' == rFltName.GetChar( 0 );
}
SwRTFWriter::~SwRTFWriter()
@@ -1262,6 +1274,7 @@ sal_uLong SwRTFWriter::WriteStream()
{
OSL_TRACE("%s", OSL_THIS_FUNC);
RtfExport aExport( NULL, pDoc, new SwPaM( *pCurPam->End(), *pCurPam->Start() ), pCurPam, this );
+ aExport.mbOutOutlineOnly = m_bOutOutlineOnly;
aExport.ExportDocument( true );
return 0;
}
diff --git a/sw/source/filter/ww8/rtfexport.hxx b/sw/source/filter/ww8/rtfexport.hxx
index b53d634b25..8047cc3214 100644..100755
--- a/sw/source/filter/ww8/rtfexport.hxx
+++ b/sw/source/filter/ww8/rtfexport.hxx
@@ -82,7 +82,7 @@ public:
virtual RtfSdrExport& SdrExporter() const;
/// Hack, unfortunately necessary at some places for now.
- virtual bool HackIsWW8OrHigher() const { return false; }
+ virtual bool HackIsWW8OrHigher() const;
/// Guess the script (asian/western).
virtual bool CollapseScriptsforWordOk( sal_uInt16 nScript, sal_uInt16 nWhich );
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index b2d6eff5fc..6b4e4f38f5 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -2079,7 +2079,7 @@ bool WinwordAnchoring::ConvertPosition( SwFmtHoriOrient& _iorHoriOri,
const SwContact* pContact = _rFrmFmt.FindContactObj();
if ( pContact )
{
- std::vector<SwAnchoredObject*> aAnchoredObjs;
+ std::list<SwAnchoredObject*> aAnchoredObjs;
pContact->GetAnchoredObjs( aAnchoredObjs );
if ( !aAnchoredObjs.empty() )
{
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 24d7a325fa..2699cae7aa 100644..100755
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -107,6 +107,7 @@
#include <ndgrf.hxx>
#include <ndole.hxx>
+
#include <cstdio>
using namespace ::com::sun::star;
@@ -178,7 +179,7 @@ MSWordAttrIter::~MSWordAttrIter()
// Mit OutAttr() werden die Attribute an der angegebenen SwPos
// ausgegeben.
-class SwAttrIter : public MSWordAttrIter
+class WW8SwAttrIter : public MSWordAttrIter
{
private:
const SwTxtNode& rNd;
@@ -209,10 +210,10 @@ private:
void IterToCurrent();
//No copying
- SwAttrIter(const SwAttrIter&);
- SwAttrIter& operator=(const SwAttrIter&);
+ WW8SwAttrIter(const WW8SwAttrIter&);
+ WW8SwAttrIter& operator=(const WW8SwAttrIter&);
public:
- SwAttrIter( MSWordExportBase& rWr, const SwTxtNode& rNd );
+ WW8SwAttrIter( MSWordExportBase& rWr, const SwTxtNode& rNd );
bool IsTxtAttr( xub_StrLen nSwPos );
bool IsRedlineAtEnd( xub_StrLen nPos ) const;
@@ -248,7 +249,7 @@ public:
}
};
-void SwAttrIter::IterToCurrent()
+void WW8SwAttrIter::IterToCurrent()
{
ASSERT(maCharRuns.begin() != maCharRuns.end(), "Impossible");
mnScript = maCharRunIter->mnScript;
@@ -256,7 +257,7 @@ void SwAttrIter::IterToCurrent()
mbCharIsRTL = maCharRunIter->mbRTL;
}
-SwAttrIter::SwAttrIter(MSWordExportBase& rWr, const SwTxtNode& rTxtNd) :
+WW8SwAttrIter::WW8SwAttrIter(MSWordExportBase& rWr, const SwTxtNode& rTxtNd) :
MSWordAttrIter(rWr),
rNd(rTxtNd),
maCharRuns(GetPseudoCharRuns(rTxtNd, 0, !rWr.HackIsWW8OrHigher())),
@@ -323,7 +324,7 @@ xub_StrLen lcl_getMinPos( xub_StrLen pos1, xub_StrLen pos2 )
return min;
}
-xub_StrLen SwAttrIter::SearchNext( xub_StrLen nStartPos )
+xub_StrLen WW8SwAttrIter::SearchNext( xub_StrLen nStartPos )
{
xub_StrLen nPos;
xub_StrLen nMinPos = STRING_MAXLEN;
@@ -456,7 +457,7 @@ xub_StrLen SwAttrIter::SearchNext( xub_StrLen nStartPos )
return nMinPos;
}
-void SwAttrIter::OutAttr( xub_StrLen nSwPos )
+void WW8SwAttrIter::OutAttr( xub_StrLen nSwPos )
{
m_rExport.AttrOutput().RTLAndCJKState( IsCharRTL(), GetScript() );
@@ -500,9 +501,7 @@ void SwAttrIter::OutAttr( xub_StrLen nSwPos )
: nSwPos == *pHt->GetStart() )
{
sal_uInt16 nWhich = pHt->GetAttr().Which();
- if (nWhich == nFontId)
- pFont = &(item_cast<SvxFontItem>(pHt->GetAttr()));
- else if( nWhich == RES_TXTATR_AUTOFMT )
+ if (nWhich == RES_TXTATR_AUTOFMT)
{
const SwFmtAutoFmt& rAutoFmt = static_cast<const SwFmtAutoFmt&>(pHt->GetAttr());
const boost::shared_ptr<SfxItemSet> pSet = rAutoFmt.GetStyleHandle();
@@ -575,14 +574,14 @@ void SwAttrIter::OutAttr( xub_StrLen nSwPos )
characters.
*/
if ( !m_rExport.HackIsWW8OrHigher() )
- aFont.GetCharSet() = GetCharSet();
+ aFont.SetCharSet( GetCharSet() );
if ( rParentFont != aFont )
m_rExport.AttrOutput().OutputItem( aFont );
}
}
-void SwAttrIter::OutFlys(xub_StrLen nSwPos)
+void WW8SwAttrIter::OutFlys(xub_StrLen nSwPos)
{
/*
#i2916#
@@ -604,7 +603,7 @@ void SwAttrIter::OutFlys(xub_StrLen nSwPos)
}
}
-bool SwAttrIter::IsTxtAttr( xub_StrLen nSwPos )
+bool WW8SwAttrIter::IsTxtAttr( xub_StrLen nSwPos )
{
// search for attrs with CH_TXTATR
if (const SwpHints* pTxtAttrs = rNd.GetpSwpHints())
@@ -620,7 +619,7 @@ bool SwAttrIter::IsTxtAttr( xub_StrLen nSwPos )
return false;
}
-bool SwAttrIter::IsDropCap( int nSwPos )
+bool WW8SwAttrIter::IsDropCap( int nSwPos )
{
// see if the current position falls on a DropCap
int nDropChars = mrSwFmtDrop.GetChars();
@@ -639,7 +638,7 @@ bool SwAttrIter::IsDropCap( int nSwPos )
return false;
}
-bool SwAttrIter::RequiresImplicitBookmark()
+bool WW8SwAttrIter::RequiresImplicitBookmark()
{
SwImplBookmarksIter bkmkIterEnd = m_rExport.maImplicitBookmarks.end();
for ( SwImplBookmarksIter aIter = m_rExport.maImplicitBookmarks.begin(); aIter != bkmkIterEnd; ++aIter )
@@ -658,7 +657,7 @@ bool SwAttrIter::RequiresImplicitBookmark()
// Attribut-Anfangposition fragen kann.
// Es koennen nur Attribute mit Ende abgefragt werden.
// Es wird mit bDeep gesucht
-const SfxPoolItem* SwAttrIter::HasTextItem( sal_uInt16 nWhich ) const
+const SfxPoolItem* WW8SwAttrIter::HasTextItem( sal_uInt16 nWhich ) const
{
const SfxPoolItem* pRet = 0;
const SwpHints* pTxtAttrs = rNd.GetpSwpHints();
@@ -691,7 +690,7 @@ void WW8Export::GetCurrentItems(WW8Bytes& rItems) const
rItems.Insert((*pO)[nI], rItems.Count());
}
-const SfxPoolItem& SwAttrIter::GetItem(sal_uInt16 nWhich) const
+const SfxPoolItem& WW8SwAttrIter::GetItem(sal_uInt16 nWhich) const
{
const SfxPoolItem* pRet = HasTextItem(nWhich);
return pRet ? *pRet : rNd.SwCntntNode::GetAttr(nWhich);
@@ -1072,7 +1071,7 @@ String BookmarkToWriter(const String &rBookmark)
INetURLObject::DECODE_UNAMBIGUOUS, RTL_TEXTENCODING_ASCII_US);
}
-void SwAttrIter::OutSwFmtRefMark(const SwFmtRefMark& rAttr, bool)
+void WW8SwAttrIter::OutSwFmtRefMark(const SwFmtRefMark& rAttr, bool)
{
if ( m_rExport.HasRefToObject( REF_SETREFATTR, &rAttr.GetRefName(), 0 ) )
m_rExport.AppendBookmark( m_rExport.GetBookmarkName( REF_SETREFATTR,
@@ -1172,7 +1171,7 @@ void AttributeOutputBase::TOXMark( const SwTxtNode& rNode, const SwTOXMark& rAtt
FieldVanish( sTxt, eType );
}
-int SwAttrIter::OutAttrWithRange(xub_StrLen nPos)
+int WW8SwAttrIter::OutAttrWithRange(xub_StrLen nPos)
{
int nRet = 0;
if ( const SwpHints* pTxtAttrs = rNd.GetpSwpHints() )
@@ -1233,7 +1232,7 @@ int SwAttrIter::OutAttrWithRange(xub_StrLen nPos)
return nRet;
}
-bool SwAttrIter::IsRedlineAtEnd( xub_StrLen nEnd ) const
+bool WW8SwAttrIter::IsRedlineAtEnd( xub_StrLen nEnd ) const
{
bool bRet = false;
// search next Redline
@@ -1255,7 +1254,7 @@ bool SwAttrIter::IsRedlineAtEnd( xub_StrLen nEnd ) const
return bRet;
}
-const SwRedlineData* SwAttrIter::GetRedline( xub_StrLen nPos )
+const SwRedlineData* WW8SwAttrIter::GetRedline( xub_StrLen nPos )
{
if( pCurRedline )
{
@@ -1450,7 +1449,7 @@ Convert characters that need to be converted, the basic replacements and the
ridicously complicated title case attribute mapping to hardcoded upper case
because word doesn't have the feature
*/
-String SwAttrIter::GetSnippet(const String &rStr, xub_StrLen nAktPos,
+String WW8SwAttrIter::GetSnippet(const String &rStr, xub_StrLen nAktPos,
xub_StrLen nLen) const
{
String aSnippet(rStr, nAktPos, nLen);
@@ -1646,26 +1645,27 @@ void WW8AttributeOutput::FormatDrop( const SwTxtNode& rNode, const SwFmtDrop &rS
m_rWW8Export.pO->Remove( 0, m_rWW8Export.pO->Count() );
}
-xub_StrLen MSWordExportBase::GetNextPos( SwAttrIter* aAttrIter, const SwTxtNode& rNode, xub_StrLen nAktPos )
+xub_StrLen MSWordExportBase::GetNextPos( WW8SwAttrIter* aAttrIter, const SwTxtNode& rNode, xub_StrLen nAktPos )
{
// Get the bookmarks for the normal run
xub_StrLen nNextPos = aAttrIter->WhereNext();
-
- GetSortedBookmarks( rNode, nAktPos, nNextPos - nAktPos );
-
xub_StrLen nNextBookmark = nNextPos;
- NearestBookmark( nNextPos, nAktPos, false );
+ if( nNextBookmark > nAktPos )//no need to search for bookmarks otherwise
+ {
+ GetSortedBookmarks( rNode, nAktPos, nNextBookmark - nAktPos );
+ NearestBookmark( nNextBookmark, nAktPos, false );
+ }
return std::min( nNextPos, nNextBookmark );
}
-void MSWordExportBase::UpdatePosition( SwAttrIter* aAttrIter, xub_StrLen nAktPos, xub_StrLen /*nEnd*/ )
+void MSWordExportBase::UpdatePosition( WW8SwAttrIter* aAttrIter, xub_StrLen nAktPos, xub_StrLen /*nEnd*/ )
{
xub_StrLen nNextPos;
- // go to next attribute if no bookmark is found of if the bookmark is behind the next attribute position
+ // go to next attribute if no bookmark is found and if the next attribute position if at the current position
bool bNextBookmark = NearestBookmark( nNextPos, nAktPos, true );
- if( !bNextBookmark || nNextPos < aAttrIter->WhereNext() )
+ if( !bNextBookmark && nAktPos >= aAttrIter->WhereNext() )
aAttrIter->NextPos();
}
@@ -1797,7 +1797,7 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
// have to remember it in nStyle
sal_uInt16 nStyle = nStyleBeforeFly;
- SwAttrIter aAttrIter( *this, rNode );
+ WW8SwAttrIter aAttrIter( *this, rNode );
rtl_TextEncoding eChrSet = aAttrIter.GetCharSet();
if ( bStartTOX )
@@ -1840,7 +1840,7 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
String aStr( rNode.GetTxt() );
xub_StrLen nAktPos = 0;
- xub_StrLen nEnd = aStr.Len();
+ xub_StrLen const nEnd = aStr.Len();
bool bRedlineAtEnd = false;
int nOpenAttrWithRange = 0;
@@ -1932,6 +1932,15 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
if ( aAttrIter.IsDropCap( nNextAttr ) )
AttrOutput().FormatDrop( rNode, aAttrIter.GetSwFmtDrop(), nStyle, pTextNodeInfo, pTextNodeInfoInner );
+ if (0 != nEnd)
+ {
+ // Output the character attributes
+ // #i51277# do this before writing flys at end of paragraph
+ AttrOutput().StartRunProperties();
+ aAttrIter.OutAttr( nAktPos );
+ AttrOutput().EndRunProperties( pRedlineData );
+ }
+
// At the end of line, output the attributes until the CR.
// Exception: footnotes at the end of line
if ( nNextAttr == nEnd )
@@ -1956,11 +1965,16 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
}
}
}
-
- // Output the character attributes
- AttrOutput().StartRunProperties();
- aAttrIter.OutAttr( nAktPos ); // nAktPos - 1 ??
- AttrOutput().EndRunProperties( pRedlineData );
+
+ if (0 == nEnd)
+ {
+ // Output the character attributes
+ // do it after WriteCR for an empty paragraph (otherwise
+ // WW8_WrFkp::Append throws SPRMs away...)
+ AttrOutput().StartRunProperties();
+ aAttrIter.OutAttr( nAktPos );
+ AttrOutput().EndRunProperties( pRedlineData );
+ }
// Exception: footnotes at the end of line
if ( nNextAttr == nEnd )
@@ -2025,8 +2039,8 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
if (pTextNodeInfoInner->isFirstInTable())
{
const SwTable * pTable = pTextNodeInfoInner->getTable();
- const SwTableFmt * pTabFmt =
- dynamic_cast<const SwTableFmt *>(pTable->GetRegisteredIn());
+
+ const SwTableFmt * pTabFmt = pTable->GetTableFmt();
if (pTabFmt != NULL)
{
if (pTabFmt->GetBreak().GetBreak() == SVX_BREAK_PAGE_BEFORE)
@@ -2240,7 +2254,7 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
// this has to be overruled.
const SwFmtPageDesc& rPageDescAtParaStyle =
ItemGet<SwFmtPageDesc>( rNode, RES_PAGEDESC );
- if( rPageDescAtParaStyle.GetRegisteredIn() )
+ if( rPageDescAtParaStyle.KnowsPageDesc() )
pTmpSet->ClearItem( RES_BREAK );
}
}
@@ -2837,8 +2851,12 @@ void MSWordExportBase::OutputContentNode( const SwCntntNode& rNode )
switch ( rNode.GetNodeType() )
{
case ND_TEXTNODE:
- OutputTextNode( *rNode.GetTxtNode() );
- break;
+ {
+ const SwTxtNode& rTextNode = *rNode.GetTxtNode();
+ if( !mbOutOutlineOnly || rTextNode.IsOutline() )
+ OutputTextNode( rTextNode );
+ }
+ break;
case ND_GRFNODE:
OutputGrfNode( *rNode.GetGrfNode() );
break;
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 9d38335e95..3f315b39a9 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -2117,7 +2117,7 @@ void WW8AttributeOutput::TableOrientation( ww8::WW8TableNodeInfoInner::Pointer_t
void WW8AttributeOutput::TableSpacing(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner)
{
const SwTable * pTable = pTableTextNodeInfoInner->getTable();
- const SwTableFmt * pTableFmt = dynamic_cast<const SwTableFmt *>(pTable->GetRegisteredIn());
+ const SwTableFmt * pTableFmt = pTable->GetTableFmt();
if (pTableFmt != NULL)
{
@@ -2166,6 +2166,8 @@ void WW8AttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t
pTableTextNodeInfoInner->getTableBoxesOfRow();
// number of cell written
sal_uInt32 nBoxes = pTableBoxes->size();
+ if (nBoxes > ww8::MAXTABLECELLS)
+ nBoxes = ww8::MAXTABLECELLS;
// sprm header
m_rWW8Export.InsUInt16( NS_sprm::LN_TDefTable );
@@ -3383,12 +3385,13 @@ sal_uLong SwWW8Writer::Write( SwPaM& rPaM, SfxMedium& rMed,
MSWordExportBase::MSWordExportBase( SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM *pOriginalPam )
: aMainStg(sMainStream), pISet(0), pUsedNumTbl(0), mpTopNodeOfHdFtPage(0),
- pBmpPal(0), pKeyMap(0), pOLEExp(0), pOCXExp(0), pOleMap(0),
+ pBmpPal(0), pOLEExp(0), pOCXExp(0), pOleMap(0),
mpTableInfo(new ww8::WW8TableInfo()), nUniqueList(0),
mnHdFtIndex(0), pAktPageDesc(0), pPapPlc(0), pChpPlc(0), pChpIter(0),
pStyles( NULL ),
bHasHdr(false), bHasFtr(false), bSubstituteBullets(true),
mbExportModeRTF( false ),
+ mbOutOutlineOnly( false ),
pDoc( pDocument ),
pCurPam( pCurrentPam ),
pOrigPam( pOriginalPam )
@@ -3398,8 +3401,6 @@ MSWordExportBase::MSWordExportBase( SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM
MSWordExportBase::~MSWordExportBase()
{
delete pBmpPal;
- if (pKeyMap)
- delete[] (NfKeywordTable*)pKeyMap;
delete pOLEExp;
delete pOCXExp;
delete pOleMap;
@@ -3883,4 +3884,35 @@ void MSWordExportBase::OutputEndNode( const SwEndNode &rNode )
#endif
}
+const NfKeywordTable & MSWordExportBase::GetNfKeywordTable()
+{
+ if (pKeyMap.get() == NULL)
+ {
+ pKeyMap.reset(new NfKeywordTable);
+ NfKeywordTable & rKeywordTable = *pKeyMap;
+ rKeywordTable[NF_KEY_D] = ::rtl::OUString::createFromAscii("d");
+ rKeywordTable[NF_KEY_DD] = ::rtl::OUString::createFromAscii("dd");
+ rKeywordTable[NF_KEY_DDD] = ::rtl::OUString::createFromAscii("ddd");
+ rKeywordTable[NF_KEY_DDDD] = ::rtl::OUString::createFromAscii("dddd");
+ rKeywordTable[NF_KEY_M] = ::rtl::OUString::createFromAscii("M");
+ rKeywordTable[NF_KEY_MM] = ::rtl::OUString::createFromAscii("MM");
+ rKeywordTable[NF_KEY_MMM] = ::rtl::OUString::createFromAscii("MMM");
+ rKeywordTable[NF_KEY_MMMM] = ::rtl::OUString::createFromAscii("MMMM");
+ rKeywordTable[NF_KEY_NN] = ::rtl::OUString::createFromAscii("ddd");
+ rKeywordTable[NF_KEY_NNN] = ::rtl::OUString::createFromAscii("dddd");
+ rKeywordTable[NF_KEY_NNNN] = ::rtl::OUString::createFromAscii("dddd");
+ rKeywordTable[NF_KEY_YY] = ::rtl::OUString::createFromAscii("yy");
+ rKeywordTable[NF_KEY_YYYY] = ::rtl::OUString::createFromAscii("yyyy");
+ rKeywordTable[NF_KEY_H] = ::rtl::OUString::createFromAscii("H");
+ rKeywordTable[NF_KEY_HH] = ::rtl::OUString::createFromAscii("HH");
+ rKeywordTable[NF_KEY_MI] = ::rtl::OUString::createFromAscii("m");
+ rKeywordTable[NF_KEY_MMI] = ::rtl::OUString::createFromAscii("mm");
+ rKeywordTable[NF_KEY_S] = ::rtl::OUString::createFromAscii("s");
+ rKeywordTable[NF_KEY_SS] = ::rtl::OUString::createFromAscii("ss");
+ rKeywordTable[NF_KEY_AMPM] = ::rtl::OUString::createFromAscii("AM/PM");
+ }
+
+ return *pKeyMap;
+}
+
/* vi:set tabstop=4 shiftwidth=4 expandtab: */
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index e846737f47..be83605310 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -58,7 +58,7 @@ namespace msfilter
class MSCodec_Std97;
}
-class SwAttrIter;
+class WW8SwAttrIter;
class AttributeOutputBase;
class DocxAttributeOutput;
class RtfAttributeOutput;
@@ -472,7 +472,7 @@ public:
WW8_WrtBookmarks* pBkmks;
WW8_WrtRedlineAuthor* pRedlAuthors;
BitmapPalette* pBmpPal;
- void* pKeyMap;
+ boost::shared_ptr<NfKeywordTable> pKeyMap;
SvxMSExportOLEObjects* pOLEExp;
SwMSConvertControls* pOCXExp;
WW8OleMaps* pOleMap;
@@ -554,6 +554,7 @@ public:
sal_uInt8 bSubstituteBullets : 1; // true: SubstituteBullet() gets called
bool mbExportModeRTF;
+ bool mbOutOutlineOnly; // export outline nodes, only (send outline to clipboard/presentation)
SwDoc *pDoc;
SwPaM *pCurPam, *pOrigPam;
@@ -751,10 +752,10 @@ protected:
virtual void ExportDocument_Impl() = 0;
/// Get the next position in the text node to output
- virtual xub_StrLen GetNextPos( SwAttrIter* pAttrIter, const SwTxtNode& rNode, xub_StrLen nAktPos );
+ virtual xub_StrLen GetNextPos( WW8SwAttrIter* pAttrIter, const SwTxtNode& rNode, xub_StrLen nAktPos );
/// Update the information for GetNextPos().
- virtual void UpdatePosition( SwAttrIter* pAttrIter, xub_StrLen nAktPos, xub_StrLen nEnd );
+ virtual void UpdatePosition( WW8SwAttrIter* pAttrIter, xub_StrLen nAktPos, xub_StrLen nEnd );
/// Output SwTxtNode
void OutputTextNode( const SwTxtNode& );
@@ -816,6 +817,8 @@ protected:
bool GetBookmarks( const SwTxtNode& rNd, xub_StrLen nStt, xub_StrLen nEnd,
IMarkVector& rArr );
+ const NfKeywordTable & GetNfKeywordTable();
+
public:
MSWordExportBase( SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM *pOriginalPam );
virtual ~MSWordExportBase();
diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx
index e647f610f1..893d704049 100644
--- a/sw/source/filter/ww8/wrtww8gr.cxx
+++ b/sw/source/filter/ww8/wrtww8gr.cxx
@@ -79,6 +79,8 @@
#include "docsh.hxx"
#include <cstdio>
+#include <stdio.h>
+
using namespace ::com::sun::star;
using namespace nsFieldFlags;
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index f0f198d0b3..31c9808232 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -326,21 +326,19 @@ void MSWordExportBase::OutputItemSet( const SfxItemSet& rSet, bool bPapFmt, bool
pISet = 0; // fuer Doppel-Attribute
}
}
-
+#include "switerator.hxx"
void MSWordExportBase::GatherChapterFields()
{
//If the header/footer contains a chapter field
- SwClientIter aIter(*pDoc->GetSysFldType(RES_CHAPTERFLD));
- const SwClient *pField = aIter.First(TYPE(SwFmtFld));
- while (pField)
+ SwFieldType* pType = pDoc->GetSysFldType( RES_CHAPTERFLD );
+ SwIterator<SwFmtFld,SwFieldType> aFmtFlds( *pType );
+ for ( SwFmtFld* pFld = aFmtFlds.First(); pFld; pFld = aFmtFlds.Next() )
{
- const SwFmtFld* pFld = (const SwFmtFld*)(pField);
if (const SwTxtFld *pTxtFld = pFld->GetTxtFld())
{
const SwTxtNode &rTxtNode = pTxtFld->GetTxtNode();
maChapterFieldLocs.push_back(rTxtNode.GetIndex());
}
- pField = aIter.Next();
}
}
@@ -439,10 +437,19 @@ void MSWordExportBase::OutputSectionBreaks( const SfxItemSet *pSet, const SwNode
//section.
bool bBreakSet = false;
+ const SwPageDesc * pPageDesc = rNd.FindPageDesc(sal_False);
+
+ if (pAktPageDesc != pPageDesc)
+ {
+ bBreakSet = true;
+ bNewPageDesc = true;
+ pAktPageDesc = pPageDesc;
+ }
+
if ( pSet && pSet->Count() )
{
- if ( SFX_ITEM_SET == pSet->GetItemState( RES_PAGEDESC, false, &pItem )
- && ( (SwFmtPageDesc*)pItem )->GetRegisteredIn() )
+ if ( SFX_ITEM_SET == pSet->GetItemState( RES_PAGEDESC, false, &pItem ) &&
+ dynamic_cast<const SwFmtPageDesc*>(pItem)->GetRegisteredIn() != NULL)
{
bBreakSet = true;
bNewPageDesc = true;
@@ -525,7 +532,7 @@ void MSWordExportBase::OutputSectionBreaks( const SfxItemSet *pSet, const SwNode
// but a pagedesc item is an implicit page break before...
const SwFmtPageDesc &rPageDesc =
ItemGet<SwFmtPageDesc>( *pNd, RES_PAGEDESC );
- if ( rPageDesc.GetRegisteredIn() )
+ if ( rPageDesc.KnowsPageDesc() )
bHackInBreak = true;
}
}
@@ -863,10 +870,10 @@ void MSWordExportBase::OutputFormat( const SwFmt& rFmt, bool bPapFmt, bool bChpF
bool MSWordExportBase::HasRefToObject( sal_uInt16 nTyp, const String* pName, sal_uInt16 nSeqNo )
{
const SwTxtNode* pNd;
- SwClientIter aIter( *pDoc->GetSysFldType( RES_GETREFFLD ) );
- for ( SwFmtFld* pFld = static_cast< SwFmtFld* >( aIter.First( TYPE( SwFmtFld ) ) );
- pFld;
- pFld = static_cast< SwFmtFld* >( aIter.Next() ) )
+
+ SwFieldType* pType = pDoc->GetSysFldType( RES_GETREFFLD );
+ SwIterator<SwFmtFld, SwFieldType> aFmtFlds( *pType );
+ for ( SwFmtFld* pFld = aFmtFlds.First(); pFld; pFld = aFmtFlds.Next() )
{
if ( pFld->GetTxtFld() && nTyp == pFld->GetFld()->GetSubType() &&
0 != ( pNd = pFld->GetTxtFld()->GetpTxtNode() ) &&
@@ -2421,19 +2428,13 @@ bool MSWordExportBase::GetNumberFmt(const SwField& rFld, String& rStr)
const SvNumberformat* pNumFmt = pNFmtr->GetEntry( nFmtIdx );
if( pNumFmt )
{
- //sal_uInt16 nLng = rFld.GetLanguage();
- LocaleDataWrapper aLocDat( pNFmtr->GetServiceManager(),
- MsLangId::convertLanguageToLocale( LANGUAGE_ENGLISH_US ) );
+ sal_uInt16 nLng = rFld.GetLanguage();
+ LocaleDataWrapper aLocDat(pNFmtr->GetServiceManager(),
+ MsLangId::convertLanguageToLocale(nLng));
- if( !pKeyMap )
- {
- pKeyMap = new NfKeywordTable;
- NfKeywordTable& rKeyMap = *(NfKeywordTable*)pKeyMap;
- pNFmtr->FillKeywordTable( rKeyMap, LANGUAGE_ENGLISH_US );
- }
-
- String sFmt(pNumFmt->GetMappedFormatstring(*(NfKeywordTable*)pKeyMap,
+ String sFmt(pNumFmt->GetMappedFormatstring(GetNfKeywordTable(),
aLocDat));
+
if (sFmt.Len())
{
sw::ms::SwapQuotesInField(sFmt);
@@ -3624,7 +3625,7 @@ void AttributeOutputBase::FormatPageDescription( const SwFmtPageDesc& rPageDesc
if ( GetExport().bStyDef && GetExport().pOutFmtNode && GetExport().pOutFmtNode->ISA( SwTxtFmtColl ) )
{
const SwTxtFmtColl* pC = (SwTxtFmtColl*)GetExport().pOutFmtNode;
- if ( (SFX_ITEM_SET != pC->GetItemState( RES_BREAK, false ) ) && rPageDesc.GetRegisteredIn() )
+ if ( (SFX_ITEM_SET != pC->GetItemState( RES_BREAK, false ) ) && rPageDesc.KnowsPageDesc() )
FormatBreak( SvxFmtBreakItem( SVX_BREAK_PAGE_BEFORE, RES_BREAK ) );
}
}
diff --git a/sw/source/filter/ww8/ww8graf2.cxx b/sw/source/filter/ww8/ww8graf2.cxx
index e9ef0bb12b..09452f3720 100644
--- a/sw/source/filter/ww8/ww8graf2.cxx
+++ b/sw/source/filter/ww8/ww8graf2.cxx
@@ -42,7 +42,6 @@
#include <sfx2/app.hxx>
#include <sfx2/docfile.hxx>
#include <sfx2/fcontnr.hxx>
-#include <dcontact.hxx>
#include <grfatr.hxx> // class SwCropGrf
#include <fmtflcnt.hxx>
#include <fmtanchr.hxx>
@@ -409,7 +408,7 @@ SwFlyFrmFmt* SwWW8ImplReader::MakeGrafNotInCntnt(const WW8PicDesc& rPD,
&aFlySet, &rGrfSet, NULL);
// Damit die Frames bei Einfuegen in existierendes Doc erzeugt werden:
- if (rDoc.GetRootFrm() &&
+ if (rDoc.GetCurrentViewShell() && //swmod 071108//swmod 071225
(FLY_AT_PARA == pFlyFmt->GetAnchor().GetAnchorId()))
{
pFlyFmt->MakeFrms();
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index d4bc6e9d24..e9f4faa148 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -2573,7 +2573,10 @@ void WW8TabDesc::CreateSwTable()
else
{
if (nPreferredWidth)
- nLeft = pIo->maSectionManager.GetTextAreaWidth() - nPreferredWidth - nOrgDxaLeft;
+ {
+ nLeft = pIo->maSectionManager.GetTextAreaWidth();
+ nLeft = nLeft - nPreferredWidth - nOrgDxaLeft;
+ }
else
nLeft = -GetMinLeft();
}
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index 4b506d6358..19f434d7f2 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -2672,7 +2672,7 @@ void lcl_toxMatchACSwitch( SwWW8ImplReader& /*rReader*/,
if( STRING_NOTFOUND != n )
{
SwTOXType* pType = (SwTOXType*)rDoc.GetTOXType( TOX_ILLUSTRATIONS, 0);
- pType->Add( &rBase );
+ rBase.RegisterToTOXType( *pType );
rBase.SetCaptionDisplay( eCaptionType );
// Read Sequence Name and store in TOXBase
String sSeqName( rParam.GetResult() );
diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.cxx b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
index 2850668b60..e47676c74e 100644
--- a/sw/source/filter/xml/XMLRedlineImportHelper.cxx
+++ b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
@@ -70,21 +70,22 @@ using ::com::sun::star::beans::XPropertySetInfo;
SwDoc* lcl_GetDocViaTunnel( Reference<XTextCursor> & rCursor )
{
Reference<XUnoTunnel> xTunnel( rCursor, UNO_QUERY);
- DBG_ASSERT( xTunnel.is(), "missing XUnoTunnel for Cursor" );
- OTextCursorHelper* pSwXCursor = reinterpret_cast< OTextCursorHelper * >(
- sal::static_int_cast< sal_IntPtr >(xTunnel->getSomething(OTextCursorHelper::getUnoTunnelId())) );
- DBG_ASSERT( NULL != pSwXCursor, "OTextCursorHelper missing" );
- return pSwXCursor->GetDoc();
+ OSL_ENSURE(xTunnel.is(), "missing XUnoTunnel for XTextCursor");
+ OTextCursorHelper *const pXCursor =
+ ::sw::UnoTunnelGetImplementation<OTextCursorHelper>(xTunnel);
+ OSL_ENSURE( pXCursor, "OTextCursorHelper missing" );
+ return (pXCursor) ? pXCursor->GetDoc() : 0;
}
SwDoc* lcl_GetDocViaTunnel( Reference<XTextRange> & rRange )
{
Reference<XUnoTunnel> xTunnel(rRange, UNO_QUERY);
- DBG_ASSERT(xTunnel.is(), "Can't tunnel XTextRange");
- SwXTextRange *pRange = reinterpret_cast< SwXTextRange *>(
- sal::static_int_cast< sal_IntPtr >(xTunnel->getSomething(SwXTextRange::getUnoTunnelId())) );
- DBG_ASSERT( NULL != pRange, "SwXTextRange missing" );
- return pRange->GetDoc();
+ OSL_ENSURE(xTunnel.is(), "missing XUnoTunnel for XTextRange");
+ SwXTextRange *const pXRange =
+ ::sw::UnoTunnelGetImplementation<SwXTextRange>(xTunnel);
+ // #i115174#: this may be a SvxUnoTextRange
+// OSL_ENSURE( pXRange, "SwXTextRange missing" );
+ return (pXRange) ? pXRange->GetDoc() : 0;
}
@@ -111,7 +112,7 @@ public:
void Set( SwNodeIndex& rIndex );
void SetAsNodeIndex( Reference<XTextRange> & rRange );
- void CopyPositionInto(SwPosition& rPos);
+ void CopyPositionInto(SwPosition& rPos, SwDoc & rDoc);
SwDoc* GetDoc();
sal_Bool IsValid();
@@ -154,6 +155,12 @@ void XTextRangeOrNodeIndexPosition::SetAsNodeIndex(
// XTextRange -> XTunnel -> SwXTextRange
SwDoc* pDoc = lcl_GetDocViaTunnel(rRange);
+ if (!pDoc)
+ {
+ OSL_TRACE("SetAsNodeIndex: no SwDoc");
+ return;
+ }
+
// SwXTextRange -> PaM
SwUnoInternalPaM aPaM(*pDoc);
#ifdef DBG_UTIL
@@ -166,14 +173,15 @@ void XTextRangeOrNodeIndexPosition::SetAsNodeIndex(
Set(aPaM.GetPoint()->nNode);
}
-void XTextRangeOrNodeIndexPosition::CopyPositionInto(SwPosition& rPos)
+void
+XTextRangeOrNodeIndexPosition::CopyPositionInto(SwPosition& rPos, SwDoc & rDoc)
{
DBG_ASSERT(IsValid(), "Can't get Position");
// create PAM from start cursor (if no node index is present)
if (NULL == pIndex)
{
- SwUnoInternalPaM aUnoPaM(*GetDoc());
+ SwUnoInternalPaM aUnoPaM(rDoc);
#ifdef DBG_UTIL
sal_Bool bSuccess =
#endif
@@ -479,6 +487,13 @@ Reference<XTextCursor> XMLRedlineImportHelper::CreateRedlineTextSection(
// get document from old cursor (via tunnel)
SwDoc* pDoc = lcl_GetDocViaTunnel(xOldCursor);
+ if (!pDoc)
+ {
+ OSL_TRACE("XMLRedlineImportHelper::CreateRedlineTextSection: "
+ "no SwDoc => cannot create section.");
+ return 0;
+ }
+
// create text section for redline
SwTxtFmtColl *pColl = pDoc->GetTxtCollFromPool
(RES_POOLCOLL_STANDARD, false );
@@ -611,11 +626,18 @@ void XMLRedlineImportHelper::InsertIntoDocument(RedlineInfo* pRedlineInfo)
// get the document (from one of the positions)
SwDoc* pDoc = pRedlineInfo->aAnchorStart.GetDoc();
+ if (!pDoc)
+ {
+ OSL_TRACE("XMLRedlineImportHelper::InsertIntoDocument: "
+ "no SwDoc => cannot insert redline.");
+ return;
+ }
+
// now create the PaM for the redline
SwPaM aPaM(pDoc->GetNodes().GetEndOfContent());
- pRedlineInfo->aAnchorStart.CopyPositionInto(*aPaM.GetPoint());
+ pRedlineInfo->aAnchorStart.CopyPositionInto(*aPaM.GetPoint(), *pDoc);
aPaM.SetMark();
- pRedlineInfo->aAnchorEnd.CopyPositionInto(*aPaM.GetPoint());
+ pRedlineInfo->aAnchorEnd.CopyPositionInto(*aPaM.GetPoint(), *pDoc);
// collapse PaM if (start == end)
if (*aPaM.GetPoint() == *aPaM.GetMark())
diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx
index ba92c69202..7a23a98e15 100644
--- a/sw/source/filter/xml/swxml.cxx
+++ b/sw/source/filter/xml/swxml.cxx
@@ -925,18 +925,19 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const String& rBaseURL, SwPaM &rPaM, con
}
}
- sal_uInt32 nWarn = 0;
- sal_uInt32 nWarn2 = 0;
// read storage streams
+
+ // #i103539#: always read meta.xml for generator
+ sal_uInt32 const nWarn = ReadThroughComponent(
+ xStorage, xModelComp, "meta.xml", "Meta.xml", xServiceFactory,
+ (bOASIS ? "com.sun.star.comp.Writer.XMLOasisMetaImporter"
+ : "com.sun.star.comp.Writer.XMLMetaImporter"),
+ aEmptyArgs, rName, sal_False );
+
+ sal_uInt32 nWarn2 = 0;
if( !(IsOrganizerMode() || IsBlockMode() || aOpt.IsFmtsOnly() ||
bInsertMode) )
{
- nWarn = ReadThroughComponent(
- xStorage, xModelComp, "meta.xml", "Meta.xml", xServiceFactory,
- (bOASIS ? "com.sun.star.comp.Writer.XMLOasisMetaImporter"
- : "com.sun.star.comp.Writer.XMLMetaImporter"),
- aEmptyArgs, rName, sal_False );
-
nWarn2 = ReadThroughComponent(
xStorage, xModelComp, "settings.xml", NULL, xServiceFactory,
(bOASIS ? "com.sun.star.comp.Writer.XMLOasisSettingsImporter"
diff --git a/sw/source/filter/xml/wrtxml.cxx b/sw/source/filter/xml/wrtxml.cxx
index ed0bed5688..7d14b2b8c1 100644
--- a/sw/source/filter/xml/wrtxml.cxx
+++ b/sw/source/filter/xml/wrtxml.cxx
@@ -469,7 +469,7 @@ pGraphicHelper = SvXMLGraphicHelper::Create( xStg,
}
}
- if( pDoc->GetRootFrm() && pDoc->GetDocStat().nPage > 1 &&
+ if( pDoc->GetCurrentViewShell() && pDoc->GetDocStat().nPage > 1 && //swmod 071108//swmod 071225
!(bOrganizerMode || bBlock || bErr) )
{
// DBG_ASSERT( !pDoc->GetDocStat().bModified,
diff --git a/sw/source/filter/xml/xmlbrshi.hxx b/sw/source/filter/xml/xmlbrshi.hxx
index 83328ca87d..994f7c578a 100644
--- a/sw/source/filter/xml/xmlbrshi.hxx
+++ b/sw/source/filter/xml/xmlbrshi.hxx
@@ -25,8 +25,12 @@
*
************************************************************************/
-#ifndef _XMLBRSHI_HXX
-#define _XMLBRSHI_HXX
+#ifndef SW_XMLBRSHI_HXX
+#define SW_XMLBRSHI_HXX
+
+#include <com/sun/star/io/XOutputStream.hpp>
+
+#include <xmloff/xmlictxt.hxx>
class SvXMLImport;
class SvXMLUnitConverter;
diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index c4412887f0..76ee7da6db 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -51,6 +51,7 @@
#include <doc.hxx>
#include <swmodule.hxx>
#include <docsh.hxx>
+#include <viewsh.hxx>
#include <docstat.hxx>
#include <swerror.h>
#include <unotext.hxx>
@@ -583,7 +584,8 @@ void SwXMLExport::SetBodyAttributes()
if( pText )
{
SwDoc *pDoc = pText->GetDoc();
- if( pDoc && pDoc->GetPageCount() > 1 )
+ if( pDoc && pDoc->GetCurrentViewShell() &&
+ pDoc->GetCurrentViewShell()->GetPageCount() > 1 )
{
sal_Bool bValue = sal_True;
rtl::OUStringBuffer sBuffer;
diff --git a/sw/source/filter/xml/xmlfmt.cxx b/sw/source/filter/xml/xmlfmt.cxx
index 432c4cfe9e..15cf68a275 100644
--- a/sw/source/filter/xml/xmlfmt.cxx
+++ b/sw/source/filter/xml/xmlfmt.cxx
@@ -700,7 +700,7 @@ void SwXMLItemSetStyleContext_Impl::ConnectPageDesc()
if( pFmtPageDesc )
{
- pPageDesc->Add( pFmtPageDesc );
+ pFmtPageDesc->RegisterToPageDesc( *pPageDesc );
pItemSet->Put( *pFmtPageDesc );
delete pFmtPageDesc;
}
@@ -1087,7 +1087,7 @@ void SwXMLImport::UpdateTxtCollConditions( SwDoc *pDoc )
if( bSendModify )
{
SwCondCollCondChg aMsg( pColl );
- pColl->Modify( &aMsg, &aMsg );
+ pColl->ModifyNotification( &aMsg, &aMsg );
}
}
}
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index ce282d4d2d..5a930513fd 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -419,23 +419,23 @@ SvXMLImportContext *SwXMLImport::CreateContext(
pContext = CreateMetaContext(rLocalName);
}
else if ( XML_NAMESPACE_OFFICE==nPrefix &&
+ IsXMLToken( rLocalName, XML_DOCUMENT_STYLES ) )
+ {
+ pContext = new SwXMLDocStylesContext_Impl( *this, nPrefix, rLocalName,
+ xAttrList );
+ }
+ else if ( XML_NAMESPACE_OFFICE==nPrefix &&
IsXMLToken( rLocalName, XML_DOCUMENT ) )
{
uno::Reference<xml::sax::XDocumentHandler> xDocBuilder(
mxServiceFactory->createInstance(::rtl::OUString::createFromAscii(
"com.sun.star.xml.dom.SAXDocumentBuilder")),
uno::UNO_QUERY_THROW);
- uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
- GetModel(), UNO_QUERY_THROW);
+ uno::Reference<document::XDocumentProperties> const xDocProps(
+ GetDocumentProperties());
// flat OpenDocument file format
pContext = new SwXMLOfficeDocContext_Impl( *this, nPrefix, rLocalName,
- xAttrList, xDPS->getDocumentProperties(), xDocBuilder);
- }
- else if ( XML_NAMESPACE_OFFICE==nPrefix &&
- IsXMLToken( rLocalName, XML_DOCUMENT_STYLES ) )
- {
- pContext = new SwXMLDocStylesContext_Impl( *this, nPrefix, rLocalName,
- xAttrList );
+ xAttrList, xDocProps, xDocBuilder);
}
// <--
else
diff --git a/sw/source/filter/xml/xmlimp.hxx b/sw/source/filter/xml/xmlimp.hxx
index e5f4c8ff0e..520d3c7a1b 100644
--- a/sw/source/filter/xml/xmlimp.hxx
+++ b/sw/source/filter/xml/xmlimp.hxx
@@ -25,14 +25,18 @@
*
************************************************************************/
-#ifndef _XMLIMP_HXX
-#define _XMLIMP_HXX
+#ifndef SW_XMLIMP_HXX
+#define SW_XMLIMP_HXX
+
+#include <com/sun/star/document/XDocumentProperties.hpp>
#include <sot/storage.hxx>
+
#include <xmloff/xmlictxt.hxx>
-#include "xmlitmap.hxx"
#include <xmloff/xmlimp.hxx>
+#include "xmlitmap.hxx"
+
class SwDoc;
class SwPaM;
class SvXMLUnitConverter;
@@ -182,6 +186,7 @@ public:
inline const SvXMLUnitConverter& GetTwipUnitConverter() const;
inline const SvXMLImportItemMapper& GetTableItemMapper() const;
+ inline SvXMLImportItemMapper& GetTableItemMapper();
SvXMLImportContext *CreateTableItemImportContext( sal_uInt16 nPrefix,
const ::rtl::OUString& rLocalName,
const ::com::sun::star::uno::Reference<
@@ -210,6 +215,11 @@ public:
// initialize XForms
virtual void initXForms();
+
+ // get the document properties, but only if they actually need importing
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::document::XDocumentProperties>
+ GetDocumentProperties() const;
};
inline const SvXMLUnitConverter& SwXMLImport::GetTwipUnitConverter() const
@@ -222,6 +232,11 @@ inline const SvXMLImportItemMapper& SwXMLImport::GetTableItemMapper() const
return *pTableItemMapper;
}
+inline SvXMLImportItemMapper& SwXMLImport::GetTableItemMapper()
+{
+ return *pTableItemMapper;
+}
+
inline void SwXMLImport::SetProgressValue( sal_Int32 nValue )
{
if ( bShowProgress )
diff --git a/sw/source/filter/xml/xmlimpit.cxx b/sw/source/filter/xml/xmlimpit.cxx
index a3d42a2784..7860205683 100644
--- a/sw/source/filter/xml/xmlimpit.cxx
+++ b/sw/source/filter/xml/xmlimpit.cxx
@@ -78,11 +78,17 @@ SvXMLImportItemMapper::~SvXMLImportItemMapper()
{
}
+void
+SvXMLImportItemMapper::setMapEntries( SvXMLItemMapEntriesRef rMapEntries )
+{
+ mrMapEntries = rMapEntries;
+}
+
/** fills the given itemset with the attributes in the given list */
void SvXMLImportItemMapper::importXML( SfxItemSet& rSet,
uno::Reference< xml::sax::XAttributeList > xAttrList,
const SvXMLUnitConverter& rUnitConverter,
- const SvXMLNamespaceMap& rNamespaceMap ) const
+ const SvXMLNamespaceMap& rNamespaceMap )
{
sal_Int16 nAttr = xAttrList->getLength();
@@ -193,7 +199,7 @@ void SvXMLImportItemMapper::importXML( SfxItemSet& rSet,
delete pUnknownItem;
}
- finished( rSet );
+ finished(rSet, rUnitConverter);
}
/** this method is called for every item that has the
@@ -204,7 +210,7 @@ SvXMLImportItemMapper::handleSpecialItem( const SvXMLItemMapEntry& /*rEntry*/,
SfxItemSet& /*rSet*/,
const OUString& /*rValue*/,
const SvXMLUnitConverter& /*rUnitConverter*/,
- const SvXMLNamespaceMap& /*rNamespaceMap*/ ) const
+ const SvXMLNamespaceMap& /*rNamespaceMap*/ )
{
DBG_ERROR( "unsuported special item in xml import" );
return sal_False;
@@ -216,13 +222,14 @@ sal_Bool SvXMLImportItemMapper::handleNoItem( const SvXMLItemMapEntry& /*rEntry*
SfxItemSet& /*rSet*/,
const OUString& /*rValue*/,
const SvXMLUnitConverter& /*rUnitConverter*/,
- const SvXMLNamespaceMap& /*rNamespaceMap*/ ) const
+ const SvXMLNamespaceMap& /*rNamespaceMap*/ )
{
DBG_ERROR( "unsuported no item in xml import" );
return sal_False;
}
-void SvXMLImportItemMapper::finished( SfxItemSet& ) const
+void
+SvXMLImportItemMapper::finished(SfxItemSet &, SvXMLUnitConverter const&) const
{
// nothing to do here
}
diff --git a/sw/source/filter/xml/xmlimpit.hxx b/sw/source/filter/xml/xmlimpit.hxx
index b852555b21..17dd9f4814 100644
--- a/sw/source/filter/xml/xmlimpit.hxx
+++ b/sw/source/filter/xml/xmlimpit.hxx
@@ -58,7 +58,7 @@ public:
void importXML( SfxItemSet& rSet,
::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > xAttrList,
const SvXMLUnitConverter& rUnitConverter,
- const SvXMLNamespaceMap& rNamespaceMap ) const;
+ const SvXMLNamespaceMap& rNamespaceMap );
/** this method is called for every item that has the
MID_SW_FLAG_SPECIAL_ITEM_IMPORT flag set */
@@ -67,7 +67,7 @@ public:
SfxItemSet& rSet,
const ::rtl::OUString& rValue,
const SvXMLUnitConverter& rUnitConverter,
- const SvXMLNamespaceMap& rNamespaceMap ) const;
+ const SvXMLNamespaceMap& rNamespaceMap );
/** this method is called for every item that has the
MID_SW_FLAG_NO_ITEM_IMPORT flag set */
@@ -75,13 +75,14 @@ public:
SfxItemSet& rSet,
const ::rtl::OUString& rValue,
const SvXMLUnitConverter& rUnitConverter,
- const SvXMLNamespaceMap& rNamespaceMap ) const;
+ const SvXMLNamespaceMap& rNamespaceMap );
/** This method is called when all attributes have benn processed. It
* may be used to remove items that are incomplete */
- virtual void finished( SfxItemSet& rSet ) const;
+ virtual void finished(SfxItemSet & rSet,
+ SvXMLUnitConverter const& rUnitConverter) const;
- inline void setMapEntries( SvXMLItemMapEntriesRef rMapEntries );
+ virtual void setMapEntries( SvXMLItemMapEntriesRef rMapEntries );
inline SvXMLItemMapEntriesRef getMapEntries() const;
@@ -94,12 +95,6 @@ public:
const SvXMLUnitConverter& rUnitConverter );
};
-inline void
-SvXMLImportItemMapper::setMapEntries( SvXMLItemMapEntriesRef rMapEntries )
-{
- mrMapEntries = rMapEntries;
-}
-
inline SvXMLItemMapEntriesRef
SvXMLImportItemMapper::getMapEntries() const
{
diff --git a/sw/source/filter/xml/xmlitem.cxx b/sw/source/filter/xml/xmlitem.cxx
index 49869ccd33..4af2149488 100644
--- a/sw/source/filter/xml/xmlitem.cxx
+++ b/sw/source/filter/xml/xmlitem.cxx
@@ -39,15 +39,14 @@ SvXMLItemSetContext::SvXMLItemSetContext( SvXMLImport& rImp, sal_uInt16 nPrfx,
const OUString& rLName,
const uno::Reference< xml::sax::XAttributeList >& xAttrList,
SfxItemSet& rISet,
- const SvXMLImportItemMapper& rIMap,
+ SvXMLImportItemMapper& rIMap,
const SvXMLUnitConverter& rUnitConverter ):
SvXMLImportContext( rImp, nPrfx, rLName ),
rItemSet( rISet ),
rIMapper( rIMap ),
rUnitConv( rUnitConverter )
-
{
- rIMapper.importXML( rItemSet, xAttrList, rUnitConv,
+ rIMap.importXML( rItemSet, xAttrList, rUnitConv,
GetImport().GetNamespaceMap() );
}
diff --git a/sw/source/filter/xml/xmlitem.hxx b/sw/source/filter/xml/xmlitem.hxx
index a09fbcaff1..1847ee49c8 100644
--- a/sw/source/filter/xml/xmlitem.hxx
+++ b/sw/source/filter/xml/xmlitem.hxx
@@ -53,7 +53,7 @@ public:
const ::rtl::OUString& rLName,
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList,
SfxItemSet& rItemSet,
- const SvXMLImportItemMapper& rIMappper,
+ SvXMLImportItemMapper& rIMap,
const SvXMLUnitConverter& rUnitConv );
virtual ~SvXMLItemSetContext();
diff --git a/sw/source/filter/xml/xmlitemi.cxx b/sw/source/filter/xml/xmlitemi.cxx
index 3a0ff6c52f..2b11661449 100644
--- a/sw/source/filter/xml/xmlitemi.cxx
+++ b/sw/source/filter/xml/xmlitemi.cxx
@@ -28,37 +28,35 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-
-#include <hintids.hxx>
#include <rtl/ustring.hxx>
+
#include <rsc/rscsfx.hxx>
-#include "xmlitmap.hxx"
-#include "xmlimpit.hxx"
-#include "xmlitem.hxx"
+
#include <xmloff/i18nmap.hxx>
#include <xmloff/xmluconv.hxx>
-#ifndef _XMLOFF_FAMILIES_HXX
#include <xmloff/families.hxx>
-#endif
-#include <svx/unomid.hxx>
+#include <xmloff/xmlnmspe.hxx>
+#include <xmloff/xmltoken.hxx>
+
#include <editeng/boxitem.hxx>
#include <editeng/fontitem.hxx>
#include <editeng/tstpitem.hxx>
#include <editeng/boxitem.hxx>
#include <editeng/brshitem.hxx>
#include <editeng/langitem.hxx>
+#include <editeng/memberids.hrc>
-#ifndef _XMLOFF_XMLTABI_HXX
-//#include <xmloff/xmltabi.hxx>
-#endif
-#include "xmlbrshi.hxx"
+#include <svx/unomid.hxx>
+
+#include <hintids.hxx>
#include <paratr.hxx>
#include <doc.hxx>
-#ifndef _UNOMID_H
#include <unomid.h>
-#endif
+#include "xmlbrshi.hxx"
#include "xmlimp.hxx"
+#include "xmlitmap.hxx"
+#include "xmlimpit.hxx"
+#include "xmlitem.hxx"
using ::rtl::OUString;
using namespace ::com::sun::star;
@@ -82,32 +80,93 @@ public:
SfxItemSet& rSet,
const OUString& rValue,
const SvXMLUnitConverter& rUnitConverter,
- const SvXMLNamespaceMap& rNamespaceMap ) const;
- virtual void finished( SfxItemSet& rSet ) const;
+ const SvXMLNamespaceMap& rNamespaceMap );
+
+ virtual sal_Bool
+ handleNoItem(SvXMLItemMapEntry const& rEntry,
+ SfxItemSet & rSet,
+ ::rtl::OUString const& rValue,
+ SvXMLUnitConverter const& rUnitConverter,
+ SvXMLNamespaceMap const& rNamespaceMap);
+
+ virtual void finished(SfxItemSet & rSet,
+ SvXMLUnitConverter const& rUnitConverter) const;
+
+ virtual void setMapEntries( SvXMLItemMapEntriesRef rMapEntries );
+
+private:
+ void Reset();
+
+ ::rtl::OUString m_FoMarginValue;
+ enum { LEFT = 0, RIGHT = 1, TOP = 2, BOTTOM = 3 };
+ bool m_bHaveMargin[4];
};
SwXMLImportTableItemMapper_Impl::SwXMLImportTableItemMapper_Impl(
SvXMLItemMapEntriesRef rMapEntries ) :
SvXMLImportItemMapper( rMapEntries, RES_UNKNOWNATR_CONTAINER)
{
+ Reset();
}
SwXMLImportTableItemMapper_Impl::~SwXMLImportTableItemMapper_Impl()
{
}
+void SwXMLImportTableItemMapper_Impl::Reset()
+{
+ m_FoMarginValue = ::rtl::OUString();
+ for (int i = 0; i < 3; ++i)
+ {
+ m_bHaveMargin[i] = false;
+ }
+}
+
+void SwXMLImportTableItemMapper_Impl::setMapEntries(
+ SvXMLItemMapEntriesRef rMapEntries )
+{
+ Reset();
+ SvXMLImportItemMapper::setMapEntries(rMapEntries);
+}
+
sal_Bool SwXMLImportTableItemMapper_Impl::handleSpecialItem(
const SvXMLItemMapEntry& rEntry,
SfxPoolItem& rItem,
SfxItemSet& rItemSet,
const OUString& rValue,
const SvXMLUnitConverter& rUnitConv,
- const SvXMLNamespaceMap& ) const
+ const SvXMLNamespaceMap& )
{
sal_Bool bRet = sal_False;
sal_uInt16 nMemberId = static_cast< sal_Int16 >(rEntry.nMemberId & MID_SW_FLAG_MASK);
switch( rItem.Which() )
{
+ case RES_LR_SPACE:
+ switch (nMemberId)
+ {
+ case MID_L_MARGIN:
+ m_bHaveMargin[LEFT] = true;
+ break;
+ case MID_R_MARGIN:
+ m_bHaveMargin[RIGHT] = true;
+ break;
+ }
+ bRet = SvXMLImportItemMapper::PutXMLValue(
+ rItem, rValue, nMemberId, rUnitConv);
+ break;
+ case RES_UL_SPACE:
+ switch (nMemberId)
+ {
+ case MID_UP_MARGIN:
+ m_bHaveMargin[TOP] = true;
+ break;
+ case MID_LO_MARGIN:
+ m_bHaveMargin[BOTTOM] = true;
+ break;
+ }
+ bRet = SvXMLImportItemMapper::PutXMLValue(
+ rItem, rValue, nMemberId, rUnitConv);
+ break;
case RES_FRM_SIZE:
switch( nMemberId )
{
@@ -125,8 +184,72 @@ sal_Bool SwXMLImportTableItemMapper_Impl::handleSpecialItem(
return bRet;
}
-void SwXMLImportTableItemMapper_Impl::finished( SfxItemSet& /*rSet*/ ) const
+
+sal_Bool SwXMLImportTableItemMapper_Impl::handleNoItem(
+ SvXMLItemMapEntry const& rEntry,
+ SfxItemSet & rSet,
+ ::rtl::OUString const& rValue,
+ SvXMLUnitConverter const& rUnitConverter,
+ SvXMLNamespaceMap const& rNamespaceMap)
+{
+ if ((XML_NAMESPACE_FO == rEntry.nNameSpace) &&
+ (xmloff::token::XML_MARGIN == rEntry.eLocalName))
+ {
+ m_FoMarginValue = rValue;
+ return true;
+ }
+ else
+ {
+ return SvXMLImportItemMapper::handleNoItem(
+ rEntry, rSet, rValue, rUnitConverter, rNamespaceMap);
+ }
+}
+
+void SwXMLImportTableItemMapper_Impl::finished(
+ SfxItemSet & rSet, SvXMLUnitConverter const& rUnitConverter) const
{
+ if (m_FoMarginValue.getLength())
+ {
+ sal_uInt16 const Ids[4][2] = {
+ { RES_LR_SPACE, MID_L_MARGIN },
+ { RES_LR_SPACE, MID_R_MARGIN },
+ { RES_UL_SPACE, MID_UP_MARGIN },
+ { RES_UL_SPACE, MID_LO_MARGIN },
+ };
+ for (int i = 0; i < 4; ++i)
+ {
+ if (m_bHaveMargin[i])
+ {
+ continue; // already read fo:margin-top etc.
+ }
+ // first get item from itemset
+ SfxPoolItem const* pItem = 0;
+ SfxItemState eState =
+ rSet.GetItemState(Ids[i][0], sal_True, &pItem);
+
+ // if not set, try the pool
+ if ((SFX_ITEM_SET != eState) && (SFX_WHICH_MAX > Ids[i][0]))
+ {
+ pItem = &rSet.GetPool()->GetDefaultItem(Ids[i][0]);
+ }
+
+ // do we have an item?
+ if (eState >= SFX_ITEM_DEFAULT && pItem)
+ {
+ SfxPoolItem *const pNewItem = pItem->Clone();
+ bool const bPut = PutXMLValue(
+ *pNewItem, m_FoMarginValue, Ids[i][1], rUnitConverter);
+ if (bPut)
+ {
+ rSet.Put(*pNewItem);
+ }
+ }
+ else
+ {
+ OSL_ENSURE(false, "could not get item");
+ }
+ }
+ }
}
// ---------------------------------------------------------------------
@@ -142,7 +265,7 @@ public:
const OUString& rLName,
const Reference< xml::sax::XAttributeList > & xAttrList,
SfxItemSet& rItemSet,
- const SvXMLImportItemMapper& rIMapper,
+ SvXMLImportItemMapper & rIMapper,
const SvXMLUnitConverter& rUnitConv );
virtual ~SwXMLItemSetContext_Impl();
@@ -159,7 +282,7 @@ SwXMLItemSetContext_Impl::SwXMLItemSetContext_Impl(
const OUString& rLName,
const Reference< xml::sax::XAttributeList > & xAttrList,
SfxItemSet& _rItemSet,
- const SvXMLImportItemMapper& _rIMapper,
+ SvXMLImportItemMapper & _rIMapper,
const SvXMLUnitConverter& _rUnitConv ) :
SvXMLItemSetContext( rImport, nPrfx, rLName, xAttrList,
_rItemSet, _rIMapper, _rUnitConv )
diff --git a/sw/source/filter/xml/xmlitemm.cxx b/sw/source/filter/xml/xmlitemm.cxx
index e82ef86449..70bf72a32b 100644
--- a/sw/source/filter/xml/xmlitemm.cxx
+++ b/sw/source/filter/xml/xmlitemm.cxx
@@ -48,6 +48,8 @@ using namespace ::xmloff::token;
{ XML_NAMESPACE_##p, XML_##l, w, MID_SW_FLAG_SPECIAL_ITEM_IMPORT|m }
#define M_E_SE( p, l, w, m ) \
{ XML_NAMESPACE_##p, XML_##l, w, MID_SW_FLAG_SPECIAL_ITEM_EXPORT|m }
+#define M_E_SIE( p, l, w, m ) \
+ { XML_NAMESPACE_##p, XML_##l, w, MID_SW_FLAG_SPECIAL_ITEM_EXPORT|MID_SW_FLAG_SPECIAL_ITEM_IMPORT|m }
#define M_END { 0, XML_TOKEN_INVALID, 0, 0 }
@@ -61,11 +63,12 @@ SvXMLItemMapEntry aXMLTableItemMap[] =
// RES_PAPER_BIN
// not required
// TODO: RES_LR_SPACE
- M_E_SE( FO, MARGIN_LEFT, RES_LR_SPACE, MID_L_MARGIN ),
- M_E_SE( FO, MARGIN_RIGHT, RES_LR_SPACE, MID_R_MARGIN ),
+ M_E_SE( FO, MARGIN, -1, MID_SW_FLAG_NO_ITEM_IMPORT),
+ M_E_SIE( FO, MARGIN_LEFT, RES_LR_SPACE, MID_L_MARGIN ),
+ M_E_SIE( FO, MARGIN_RIGHT, RES_LR_SPACE, MID_R_MARGIN ),
// RES_UL_SPACE
- MAP_ENTRY( FO, MARGIN_TOP, RES_UL_SPACE, MID_UP_MARGIN ),
- MAP_ENTRY( FO, MARGIN_BOTTOM, RES_UL_SPACE, MID_LO_MARGIN ),
+ M_E_SI( FO, MARGIN_TOP, RES_UL_SPACE, MID_UP_MARGIN ),
+ M_E_SI( FO, MARGIN_BOTTOM, RES_UL_SPACE, MID_LO_MARGIN ),
// RES_PAGEDESC
MAP_ENTRY( STYLE, PAGE_NUMBER, RES_PAGEDESC, MID_PAGEDESC_PAGENUMOFFSET),
// RES_BREAK
diff --git a/sw/source/filter/xml/xmlmeta.cxx b/sw/source/filter/xml/xmlmeta.cxx
index 225ab05390..351006c08d 100644
--- a/sw/source/filter/xml/xmlmeta.cxx
+++ b/sw/source/filter/xml/xmlmeta.cxx
@@ -57,22 +57,34 @@ using namespace ::xmloff::token;
// ---------------------------------------------------------------------
+uno::Reference<document::XDocumentProperties>
+SwXMLImport::GetDocumentProperties() const
+{
+ if (IsOrganizerMode() || IsStylesOnlyMode() ||
+ IsBlockMode() || IsInsertMode())
+ {
+ return 0;
+ }
+ uno::Reference<document::XDocumentPropertiesSupplier> const xDPS(
+ GetModel(), UNO_QUERY_THROW);
+ return xDPS->getDocumentProperties();
+}
+
SvXMLImportContext *SwXMLImport::CreateMetaContext(
const OUString& rLocalName )
{
SvXMLImportContext *pContext = 0;
- if( !(IsStylesOnlyMode() || IsInsertMode()) )
+ if (getImportFlags() & IMPORT_META)
{
- uno::Reference<xml::sax::XDocumentHandler> xDocBuilder(
+ uno::Reference<xml::sax::XDocumentHandler> const xDocBuilder(
mxServiceFactory->createInstance(::rtl::OUString::createFromAscii(
"com.sun.star.xml.dom.SAXDocumentBuilder")),
- uno::UNO_QUERY_THROW);
- uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
- GetModel(), UNO_QUERY_THROW);
+ uno::UNO_QUERY_THROW);
+ uno::Reference<document::XDocumentProperties> const xDocProps(
+ GetDocumentProperties());
pContext = new SvXMLMetaDocumentContext(*this,
- XML_NAMESPACE_OFFICE, rLocalName,
- xDPS->getDocumentProperties(), xDocBuilder);
+ XML_NAMESPACE_OFFICE, rLocalName, xDocProps, xDocBuilder);
}
if( !pContext )
diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx
index e784ead0d2..7fa1f1fb13 100644
--- a/sw/source/filter/xml/xmltbli.cxx
+++ b/sw/source/filter/xml/xmltbli.cxx
@@ -2849,7 +2849,7 @@ void SwXMLTableContext::MakeTable()
}
// ??? this is always false: root frame is only created in ViewShell::Init
- if( pTableNode->GetDoc()->GetRootFrm() )
+ if( pTableNode->GetDoc()->GetCurrentViewShell() ) //swmod 071108//swmod 071225
{
pTableNode->DelFrms();
SwNodeIndex aIdx( *pTableNode->EndOfSectionNode(), 1 );
diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx
index 383e34c503..05f33f1529 100644
--- a/sw/source/filter/xml/xmltexti.cxx
+++ b/sw/source/filter/xml/xmltexti.cxx
@@ -63,6 +63,7 @@
#include <ndole.hxx>
#include <docsh.hxx>
#include <sfx2/docfile.hxx>
+#include <switerator.hxx>
// for locking SolarMutex: svapp + mutex
#include <vcl/svapp.hxx>
@@ -320,9 +321,8 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOLEObject(
{
// check whether an object with this name already exists in the document
String aName;
- SwClientIter aIter( *(SwModify*)pDoc->GetDfltGrfFmtColl() );
- for( SwCntntNode* pNd = (SwCntntNode*)aIter.First( TYPE( SwCntntNode ) );
- pNd; pNd = (SwCntntNode*)aIter.Next() )
+ SwIterator<SwCntntNode,SwFmtColl> aIter( *pDoc->GetDfltGrfFmtColl() );
+ for( SwCntntNode* pNd = aIter.First(); pNd; pNd = aIter.Next() )
{
SwOLENode* pExistingOLENd = pNd->GetOLENode();
if( pExistingOLENd )
diff --git a/sw/source/ui/app/apphdl.cxx b/sw/source/ui/app/apphdl.cxx
index 520205976e..508397adf5 100644
--- a/sw/source/ui/app/apphdl.cxx
+++ b/sw/source/ui/app/apphdl.cxx
@@ -698,23 +698,28 @@ void SwModule::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
SwWrtShell* pWrtSh = pDocSh ? pDocSh->GetWrtShell() : 0;
switch( rEvHint.GetEventId() )
{
-/* MA 07. Mar. 96: UpdateInputFlds() nur noch bei Dokument neu.
- (Und bei Einfuegen Textbaust.)
- case SFX_EVENT_OPENDOC:
- // dann am aktuellen Dokument die Input-Fedler updaten
- if( pWrtSh )
- pWrtSh->UpdateInputFlds();
+ case SFX_EVENT_LOADFINISHED:
+ OSL_ASSERT(!pWrtSh);
+ // if it is a new document created from a template,
+ // update fixed fields
+ if (pDocSh->GetMedium())
+ {
+ SFX_ITEMSET_ARG( pDocSh->GetMedium()->GetItemSet(),
+ pTemplateItem, SfxBoolItem,
+ SID_TEMPLATE, sal_False);
+ if (pTemplateItem && pTemplateItem->GetValue())
+ {
+ pDocSh->GetDoc()->SetFixFields(false, 0);
+ }
+ }
break;
-*/
case SFX_EVENT_CREATEDOC:
- // alle FIX-Date/Time Felder auf akt. setzen
if( pWrtSh )
{
SFX_ITEMSET_ARG( pDocSh->GetMedium()->GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE, sal_False);
sal_Bool bUpdateFields = sal_True;
if( pUpdateDocItem && pUpdateDocItem->GetValue() == document::UpdateDocMode::NO_UPDATE)
bUpdateFields = sal_False;
- pWrtSh->SetFixFields();
if(bUpdateFields)
{
pWrtSh->UpdateInputFlds();
diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx
index 794b6032b7..47fe7e04c8 100644
--- a/sw/source/ui/app/docsh.cxx
+++ b/sw/source/ui/app/docsh.cxx
@@ -93,11 +93,8 @@
#include <swcli.hxx>
#include <txtftn.hxx>
#include <ftnidx.hxx>
-
-// --> FME 2004-08-05 #i20883# Digital Signatures and Encryption
#include <fldbas.hxx>
#include <docary.hxx>
-// <--
#include <swerror.h> // Fehlermeldungen
#include <helpid.h>
#include <cmdid.h>
@@ -123,7 +120,7 @@
#include <unomid.h>
#include <sfx2/Metadatable.hxx>
-
+#include <switerator.hxx>
using rtl::OUString;
using namespace ::com::sun::star;
@@ -912,32 +909,6 @@ Rectangle SwDocShell::GetVisArea( sal_uInt16 nAspect ) const
const SwRect aPageRect = pNd->FindPageFrmRect( sal_False, 0, sal_False );
return aPageRect.SVRect();
-
- // Why does this have to be that complicated? I replaced this by the
- // call of FindPageFrmRect():
- /*
- //PageDesc besorgen, vom ersten Absatz oder den default.
- const SwFmtPageDesc &rDesc = pNd->GetSwAttrSet().GetPageDesc();
- const SwPageDesc* pDesc = rDesc.GetPageDesc();
- if( !pDesc )
- pDesc = &const_cast<const SwDoc *>(pDoc)->GetPageDesc( 0 );
-
- //Das Format wird evtl. von der virtuellen Seitennummer bestimmt.
- const sal_uInt16 nPgNum = rDesc.GetNumOffset();
- const sal_Bool bOdd = nPgNum % 2 ? sal_True : sal_False;
- const SwFrmFmt *pFmt = bOdd ? pDesc->GetRightFmt() : pDesc->GetLeftFmt();
- if ( !pFmt ) //#40568#
- pFmt = bOdd ? pDesc->GetLeftFmt() : pDesc->GetRightFmt();
-
- if ( pFmt->GetFrmSize().GetWidth() == LONG_MAX )
- //Jetzt wird es aber Zeit fuer die Initialisierung
- pDoc->getPrinter( true );
-
- const SwFmtFrmSize& rFrmSz = pFmt->GetFrmSize();
- const Size aSz( rFrmSz.GetWidth(), rFrmSz.GetHeight() );
- const Point aPt( DOCUMENTBORDER, DOCUMENTBORDER );
- const Rectangle aRect( aPt, aSz );
- return aRect;*/
}
return SfxObjectShell::GetVisArea( nAspect );
}
@@ -982,17 +953,16 @@ sal_uInt16 SwDocShell::GetHiddenInformationState( sal_uInt16 nStates )
if ( GetWrtShell() )
{
SwFieldType* pType = GetWrtShell()->GetFldType( RES_POSTITFLD, aEmptyStr );
- SwClientIter aIter( *pType );
- SwClient* pFirst = aIter.GoStart();
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pType );
+ SwFmtFld* pFirst = aIter.First();
while( pFirst )
{
- if( static_cast<SwFmtFld*>(pFirst)->GetTxtFld() &&
- static_cast<SwFmtFld*>(pFirst)->IsFldInDoc() )
+ if( pFirst->GetTxtFld() && pFirst->IsFldInDoc() )
{
nState |= HIDDENINFORMATION_NOTES;
break;
}
- pFirst = ++aIter;
+ pFirst = aIter.Next();
}
}
}
@@ -1016,26 +986,17 @@ void SwDocShell::GetState(SfxItemSet& rSet)
{
switch (nWhich)
{
- // MT: MakroChosser immer enablen, weil Neu moeglich
- // case SID_BASICCHOOSER:
- // {
- // StarBASIC* pBasic = GetBasic();
- // StarBASIC* pAppBasic = SFX_APP()->GetBasic();
- // if ( !(pBasic->GetModules()->Count() ||
- // pAppBasic->GetModules()->Count()) )
- // rSet.DisableItem(nWhich);
- // }
- // break;
case SID_PRINTPREVIEW:
{
sal_Bool bDisable = IsInPlaceActive();
+ // Disable "multiple layout"
if ( !bDisable )
{
SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst(this);
while (pTmpFrm) // Preview suchen
{
if ( PTR_CAST(SwView, pTmpFrm->GetViewShell()) &&
- ((SwView*)pTmpFrm->GetViewShell())->GetWrtShell().getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE))
+ ((SwView*)pTmpFrm->GetViewShell())->GetWrtShell().GetViewOptions()->getBrowseMode() )
{
bDisable = sal_True;
break;
@@ -1043,6 +1004,7 @@ void SwDocShell::GetState(SfxItemSet& rSet)
pTmpFrm = pTmpFrm->GetNext(*pTmpFrm, this);
}
}
+ // End of disabled "multiple layout"
if ( bDisable )
rSet.DisableItem( SID_PRINTPREVIEW );
else
@@ -1244,9 +1206,8 @@ SwFEShell* SwDocShell::GetFEShell()
void SwDocShell::RemoveOLEObjects()
{
- SwClientIter aIter( *(SwModify*)pDoc->GetDfltGrfFmtColl() );
- for( SwCntntNode* pNd = (SwCntntNode*)aIter.First( TYPE( SwCntntNode ) );
- pNd; pNd = (SwCntntNode*)aIter.Next() )
+ SwIterator<SwCntntNode,SwFmtColl> aIter( *pDoc->GetDfltGrfFmtColl() );
+ for( SwCntntNode* pNd = aIter.First(); pNd; pNd = aIter.Next() )
{
SwOLENode* pOLENd = pNd->GetOLENode();
if( pOLENd && ( pOLENd->IsOLEObjectDeleted() ||
@@ -1273,9 +1234,8 @@ void SwDocShell::CalcLayoutForOLEObjects()
if( !pWrtShell )
return;
- SwClientIter aIter( *(SwModify*)pDoc->GetDfltGrfFmtColl() );
- for( SwCntntNode* pNd = (SwCntntNode*)aIter.First( TYPE( SwCntntNode ) );
- pNd; pNd = (SwCntntNode*)aIter.Next() )
+ SwIterator<SwCntntNode,SwFmtColl> aIter( *pDoc->GetDfltGrfFmtColl() );
+ for( SwCntntNode* pNd = aIter.First(); pNd; pNd = aIter.Next() )
{
SwOLENode* pOLENd = pNd->GetOLENode();
if( pOLENd && pOLENd->IsOLESizeInvalid() )
diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx
index 1e8ffbbd38..6d300d2f7d 100644
--- a/sw/source/ui/app/docsh2.cxx
+++ b/sw/source/ui/app/docsh2.cxx
@@ -158,6 +158,44 @@ SfxDocumentInfoDialog* SwDocShell::CreateDocumentInfoDialog(
return pDlg;
}
+// Disable "multiple layout"
+
+void SwDocShell::ToggleBrowserMode(sal_Bool bSet, SwView* _pView )
+{
+ GetDoc()->set(IDocumentSettingAccess::BROWSE_MODE, bSet );
+ UpdateFontList();
+ SwView* pTempView = _pView ? _pView : (SwView*)GetView();
+ if( pTempView )
+ {
+ pTempView->GetViewFrame()->GetBindings().Invalidate(FN_SHADOWCURSOR);
+ if( !GetDoc()->getPrinter( false ) )
+ pTempView->SetPrinter( GetDoc()->getPrinter( false ), SFX_PRINTER_PRINTER | SFX_PRINTER_JOBSETUP );
+ GetDoc()->CheckDefaultPageFmt();
+ SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst(this, sal_False);
+ do {
+ if( pTmpFrm != pTempView->GetViewFrame() )
+ {
+ pTmpFrm->DoClose();
+ pTmpFrm = SfxViewFrame::GetFirst(this, sal_False);
+ }
+ else
+ pTmpFrm = pTmpFrm->GetNext(*pTmpFrm, this, sal_False);
+
+ } while ( pTmpFrm );
+ const SwViewOption& rViewOptions = *pTempView->GetWrtShell().GetViewOptions();
+ pTempView->GetWrtShell().CheckBrowseView( sal_True );
+ pTempView->CheckVisArea();
+ if( bSet )
+ {
+ const SvxZoomType eType = (SvxZoomType)rViewOptions.GetZoomType();
+ if ( SVX_ZOOM_PERCENT != eType)
+ ((SwView*)GetView())->SetZoom( eType );
+ }
+ pTempView->InvalidateBorder();
+ pTempView->SetNewWindowAllowed(!bSet);
+ }
+}
+// End of disabled "multiple layout"
/// update text fields on document properties changes
void SwDocShell::DoFlushDocInfo()
@@ -684,7 +722,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
pDocSh = (SwDocShell*)SfxObjectShell::GetNext( *pDocSh, &aType ) )
{
SwDoc* pTmp = pDocSh->GetDoc();
- if ( pTmp->GetRootFrm() )
+ if ( pTmp->GetCurrentViewShell() ) //swmod 071108//swmod 071225
pTmp->InvalidateAutoCompleteFlag();
}
}
@@ -721,11 +759,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
sal_uInt16 nSlotId = 0;
if( bSet && !bFound ) // Keine gefunden, daher neue Preview anlegen
- {
- //Keine neue anlegen fuer BrowseView!
- if( !GetDoc()->get(IDocumentSettingAccess::BROWSE_MODE) )
nSlotId = SID_VIEWSHELL1;
- }
else if( bFound && !bSet )
nSlotId = bOnly ? SID_VIEWSHELL0 : SID_VIEWSHELL1;
@@ -977,6 +1011,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
//pSavePrinter darf nicht wieder geloescht werden
}
pViewFrm->GetBindings().SetState(SfxBoolItem(SID_SOURCEVIEW, nSlot == SID_VIEWSHELL2));
+ pViewFrm->GetBindings().Invalidate( SID_NEWWINDOW );
pViewFrm->GetBindings().Invalidate( SID_BROWSER_MODE );
pViewFrm->GetBindings().Invalidate( FN_PRINT_LAYOUT );
}
@@ -1143,60 +1178,6 @@ void SwDocShell::Execute(SfxRequest& rReq)
SW_MOD()->CheckSpellChanges(sal_False, sal_True, sal_True, sal_False );
break;
- case SID_BROWSER_MODE:
- case FN_PRINT_LAYOUT: //Fuer Web, genau umgekehrt zum BrowserMode
- {
- int eState = STATE_TOGGLE;
- sal_Bool bSet = sal_True;
- const SfxPoolItem* pAttr=NULL;
- if ( pArgs && SFX_ITEM_SET == pArgs->GetItemState( nWhich , sal_False, &pAttr ))
- {
- bSet = ((SfxBoolItem*)pAttr)->GetValue();
- if ( nWhich == FN_PRINT_LAYOUT )
- bSet = !bSet;
- eState = bSet ? STATE_ON : STATE_OFF;
- }
-
- if ( STATE_TOGGLE == eState )
- bSet = !GetDoc()->get(IDocumentSettingAccess::BROWSE_MODE);
-
- ToggleBrowserMode(bSet, 0);
-
- // OS: numerische Reihenfolge beachten!
- static sal_uInt16 __READONLY_DATA aInva[] =
- {
- SID_NEWWINDOW,/*5620*/
- SID_BROWSER_MODE, /*6313*/
- SID_RULER_BORDERS, SID_RULER_PAGE_POS,
- SID_ATTR_LONG_LRSPACE,
- SID_HTML_MODE,
- SID_RULER_PROTECT,
- SID_AUTOSPELL_CHECK,
- FN_RULER, /*20211*/
- FN_VIEW_GRAPHIC, /*20213*/
- FN_VIEW_BOUNDS, /**/
- FN_VIEW_FIELDS, /*20215*/
- FN_VLINEAL, /*20216*/
- FN_VSCROLLBAR, /*20217*/
- FN_HSCROLLBAR, /*20218*/
- FN_VIEW_META_CHARS, /**/
- FN_VIEW_MARKS, /**/
- FN_VIEW_FIELDNAME, /**/
- FN_VIEW_TABLEGRID, /*20227*/
- FN_PRINT_LAYOUT, /*20237*/
- FN_QRY_MERGE, /*20364*/
- 0
- };
- // the view must not exist!
- SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst( this );
- if( pTmpFrm )
- pTmpFrm->GetBindings().Invalidate( aInva );
- if ( !pAttr )
- rReq.AppendItem( SfxBoolItem( nWhich, bSet ) );
- rReq.Done();
- }
- break;
-
case SID_MAIL_PREPAREEXPORT:
{
//pWrtShell is not set in page preview
@@ -1209,7 +1190,8 @@ void SwDocShell::Execute(SfxRequest& rReq)
pWrtShell->EndAllAction();
}
break;
- case SID_MAIL_EXPORT_FINISHED:
+
+ case SID_MAIL_EXPORT_FINISHED:
{
if(pWrtShell)
pWrtShell->StartAllAction();
@@ -1781,77 +1763,6 @@ void SwDocShell::ReloadFromHtml( const String& rStreamName, SwSrcView* pSrcView
pDoc->ResetModified();
}
-/* -----------------------------14.12.99 16:52--------------------------------
-
- ---------------------------------------------------------------------------*/
-void SwDocShell::ToggleBrowserMode(sal_Bool bSet, SwView* _pView )
-{
- GetDoc()->set(IDocumentSettingAccess::BROWSE_MODE, bSet );
- UpdateFontList();
- SwView* pTempView = _pView ? _pView : (SwView*)GetView();
- if( pTempView )
- {
- SfxBindings& rBind = pTempView->GetViewFrame()->GetBindings();
- rBind.Invalidate(FN_SHADOWCURSOR);
- rBind.Invalidate(SID_BROWSER_MODE);
- rBind.Invalidate(FN_PRINT_LAYOUT);
-
- if( !GetDoc()->getPrinter( false ) )
- {
- pTempView->SetPrinter( GetDoc()->getPrinter( false ),
- SFX_PRINTER_PRINTER | SFX_PRINTER_JOBSETUP );
- }
-
- // --> FME 2005-03-16 #i44963# Good occasion to check if page sizes in
- // page descriptions are still set to (LONG_MAX, LONG_MAX) (html import)
- GetDoc()->CheckDefaultPageFmt();
- // <--
-
- // Currently there can be only one view (layout) if the document is viewed in Web layout
- // So if there are more views we are in print layout and for toggling to Web layout all other views must be closed
- SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst(this, sal_False);
- do {
- if( pTmpFrm != pTempView->GetViewFrame() )
- {
- pTmpFrm->DoClose();
- pTmpFrm = SfxViewFrame::GetFirst(this, sal_False);
- }
- else
- pTmpFrm = pTmpFrm->GetNext(*pTmpFrm, this, sal_False);
-
- } while ( pTmpFrm );
-
- const SwViewOption& rViewOptions = *pTempView->GetWrtShell().GetViewOptions();
-
- // set view columns before toggling:
- if ( bSet )
- {
- const sal_uInt16 nColumns = rViewOptions.GetViewLayoutColumns();
- const bool bBookMode = rViewOptions.IsViewLayoutBookMode();
- if ( 1 != nColumns || bBookMode )
- {
- ((SwView*)GetView())->SetViewLayout( 1, false );
- }
- }
-
- // Triggeres a formatting:
- pTempView->GetWrtShell().CheckBrowseView( sal_True );
- pTempView->CheckVisArea();
-
- if( GetDoc()->get(IDocumentSettingAccess::BROWSE_MODE) )
- {
- const SvxZoomType eType = (SvxZoomType)rViewOptions.GetZoomType();
-
- if ( SVX_ZOOM_PERCENT != eType)
- {
- ((SwView*)GetView())->SetZoom( eType );
- }
- }
- pTempView->InvalidateBorder();
- pTempView->SetNewWindowAllowed(!bSet);
- }
-}
-
sal_uLong SwDocShell::LoadStylesFromFile( const String& rURL,
SwgReaderOption& rOpt, sal_Bool bUnoCall )
{
diff --git a/sw/source/ui/app/docstyle.cxx b/sw/source/ui/app/docstyle.cxx
index 15f8d5ef47..77c1f9bc06 100644
--- a/sw/source/ui/app/docstyle.cxx
+++ b/sw/source/ui/app/docstyle.cxx
@@ -1187,14 +1187,14 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet,
if( rStyle.Len() &&
0 != ( pFindFmt = lcl_FindParaFmt( rDoc, rStyle, 0, sal_True )))
{
- pFindFmt->Add( &aCond );
+ aCond.RegisterToFormat( *pFindFmt );
((SwConditionTxtFmtColl*)pColl)->InsertCondition( aCond );
}
}
// Document auf die neue Bedingungen updaten
SwCondCollCondChg aMsg( pColl );
- pColl->Modify( &aMsg, &aMsg );
+ pColl->ModifyNotification( &aMsg, &aMsg );
}
else if( pCondItem && !pColl->GetDepends() )
{
diff --git a/sw/source/ui/app/swmodul1.cxx b/sw/source/ui/app/swmodul1.cxx
index 7787d3f8e3..22ccaed2d3 100644
--- a/sw/source/ui/app/swmodul1.cxx
+++ b/sw/source/ui/app/swmodul1.cxx
@@ -99,7 +99,7 @@ void lcl_SetUIPrefs(const SwViewOption* pPref, SwView* pView, ViewShell* pSh )
}
if(bHScrollChanged)
{
- pView->ShowHScrollbar( pNewPref->IsViewHScrollBar() || pSh->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE));
+ pView->ShowHScrollbar( pNewPref->IsViewHScrollBar() || pNewPref->getBrowseMode() );
}
//if only the position of the vertical ruler has been changed initiate an update
if(bVAlignChanged && !bHScrollChanged && !bVScrollChanged)
@@ -209,7 +209,12 @@ void SwModule::ApplyUsrPref(const SwViewOption &rUsrPref, SwView* pActView,
return;
// Weitergabe an die CORE
- const sal_Bool bReadonly = pCurrView->GetDocShell()->IsReadOnly();
+ sal_Bool bReadonly;
+ const SwDocShell* pDocSh = pCurrView->GetDocShell();
+ if (pDocSh)
+ bReadonly = pDocSh->IsReadOnly();
+ else //Use existing option if DocShell missing
+ bReadonly = pSh->GetViewOptions()->IsReadonly();
SwViewOption* pViewOpt;
if(!bViewOnly)
pViewOpt = new SwViewOption( *pPref );
@@ -653,7 +658,7 @@ void SwModule::CheckSpellChanges( sal_Bool bOnlineSpelling,
pDocSh = (SwDocShell*)SfxObjectShell::GetNext( *pDocSh, &aType ) )
{
SwDoc* pTmp = pDocSh->GetDoc();
- if ( pTmp->GetRootFrm() )
+ if ( pTmp->GetCurrentViewShell() ) //swmod 071108//swmod 071225
{
pTmp->SpellItAgainSam( bInvalid, bOnlyWrong, bSmartTags );
ViewShell* pViewShell = 0;
diff --git a/sw/source/ui/chrdlg/break.cxx b/sw/source/ui/chrdlg/break.cxx
index 266ccd2a8b..27882aee6e 100644
--- a/sw/source/ui/chrdlg/break.cxx
+++ b/sw/source/ui/chrdlg/break.cxx
@@ -160,6 +160,7 @@ SwBreakDlg::SwBreakDlg( Window *pParent, SwWrtShell &rS ) :
SvxStandardDialog( pParent,SW_RES(DLG_BREAK) ),
rSh(rS),
+ aBreakFL(this,SW_RES(FL_BREAK)),
aLineBtn(this,SW_RES(RB_LINE)),
aColumnBtn(this,SW_RES(RB_COL)),
aPageBtn(this,SW_RES(RB_PAGE)),
@@ -167,8 +168,7 @@ SwBreakDlg::SwBreakDlg( Window *pParent, SwWrtShell &rS ) :
aPageCollBox(this, SW_RES(LB_COLL)),
aPageNumBox(this, SW_RES(CB_PAGENUM)),
aPageNumEdit(this, SW_RES(ED_PAGENUM)),
- aBreakFL(this,SW_RES(FL_BREAK)),
-
+
aOkBtn(this,SW_RES(BT_OK)),
aCancelBtn(this,SW_RES(BT_CANCEL)),
aHelpBtn(this,SW_RES(BT_HELP)),
@@ -178,6 +178,9 @@ SwBreakDlg::SwBreakDlg( Window *pParent, SwWrtShell &rS ) :
bHtmlMode(0 != ::GetHtmlMode(rS.GetView().GetDocShell()))
{
+ aPageNumEdit.SetAccessibleRelationLabeledBy(&aPageNumBox);
+ aPageNumEdit.SetAccessibleName(aPageNumBox.GetText());
+
Link aLk = LINK(this,SwBreakDlg,ClickHdl);
aPageBtn.SetClickHdl( aLk );
aLineBtn.SetClickHdl( aLk );
diff --git a/sw/source/ui/chrdlg/chardlg.cxx b/sw/source/ui/chrdlg/chardlg.cxx
index 9781310d43..65786cea64 100644
--- a/sw/source/ui/chrdlg/chardlg.cxx
+++ b/sw/source/ui/chrdlg/chardlg.cxx
@@ -216,6 +216,8 @@ SwCharURLPage::SwCharURLPage( Window* pParent,
{
FreeResource();
+ aEventPB.SetAccessibleRelationMemberOf(&aURLFL);
+
const SfxPoolItem* pItem;
SfxObjectShell* pShell;
if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_HTML_MODE, sal_False, &pItem) ||
diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx
index 83a63ea159..3ce7dfd6ab 100644
--- a/sw/source/ui/chrdlg/drpcps.cxx
+++ b/sw/source/ui/chrdlg/drpcps.cxx
@@ -568,7 +568,8 @@ Page: Ctor
SwDropCapsPage::SwDropCapsPage(Window *pParent, const SfxItemSet &rSet) :
SfxTabPage(pParent, SW_RES(TP_DROPCAPS), rSet),
-
+
+ aSettingsFL (this, SW_RES(FL_SETTINGS)),
aDropCapsBox (this, SW_RES(CB_SWITCH )),
aWholeWordCB (this, SW_RES(CB_WORD )),
aSwitchText (this, SW_RES(FT_DROPCAPS )),
@@ -577,14 +578,13 @@ SwDropCapsPage::SwDropCapsPage(Window *pParent, const SfxItemSet &rSet) :
aLinesField (this, SW_RES(FLD_LINES )),
aDistanceText (this, SW_RES(TXT_DISTANCE)),
aDistanceField(this, SW_RES(FLD_DISTANCE)),
- aSettingsFL (this, SW_RES(FL_SETTINGS)),
+ aContentFL (this, SW_RES(FL_CONTENT )),
aTextText (this, SW_RES(TXT_TEXT )),
aTextEdit (this, SW_RES(EDT_TEXT )),
aTemplateText (this, SW_RES(TXT_TEMPLATE)),
aTemplateBox (this, SW_RES(BOX_TEMPLATE)),
- aContentFL (this, SW_RES(FL_CONTENT )),
-
+
pPict (new SwDropCapsPict(this, SW_RES(CNT_PICT))),
bModified(sal_False),
diff --git a/sw/source/ui/chrdlg/numpara.cxx b/sw/source/ui/chrdlg/numpara.cxx
index 4973595738..c476de9e42 100644
--- a/sw/source/ui/chrdlg/numpara.cxx
+++ b/sw/source/ui/chrdlg/numpara.cxx
@@ -69,10 +69,10 @@ SwParagraphNumTabPage::SwParagraphNumTabPage(Window* pParent,
aOutlineStartFL ( this, SW_RES( FL_OUTLINE_START )),
aOutlineLvFT ( this, SW_RES( FT_OUTLINE_LEVEL )),
aOutlineLvLB ( this, SW_RES( LB_OUTLINE_LEVEL )),
+ aNewStartFL ( this, SW_RES( FL_NEW_START ) ),
aNumberStyleFT ( this, SW_RES( FT_NUMBER_STYLE ) ),
aNumberStyleLB ( this, SW_RES( LB_NUMBER_STYLE ) ),
- aNewStartFL ( this, SW_RES( FL_NEW_START ) ),
- aNewStartCB ( this, SW_RES( CB_NEW_START ) ),
+ aNewStartCB ( this, SW_RES( CB_NEW_START ) ),
aNewStartNumberCB ( this, SW_RES( CB_NUMBER_NEW_START ) ),
aNewStartNF ( this, SW_RES( NF_NEW_START ) ),
aCountParaFL ( this, SW_RES( FL_COUNT_PARA ) ),
@@ -111,6 +111,8 @@ SwParagraphNumTabPage::SwParagraphNumTabPage(Window* pParent,
SwParagraphNumTabPage, LineCountHdl_Impl));
aRestartParaCountCB.SetClickHdl(
LINK(this, SwParagraphNumTabPage, LineCountHdl_Impl));
+ aNewStartNF.SetAccessibleName(aNewStartNumberCB.GetText());
+ aNewStartNF.SetAccessibleRelationLabeledBy(&aNewStartNumberCB);
}
/*-----------------31.01.98 08:34-------------------
diff --git a/sw/source/ui/chrdlg/swuiccoll.cxx b/sw/source/ui/chrdlg/swuiccoll.cxx
index df6edad2db..bda5c764fe 100644
--- a/sw/source/ui/chrdlg/swuiccoll.cxx
+++ b/sw/source/ui/chrdlg/swuiccoll.cxx
@@ -99,6 +99,10 @@ SwCondCollPage::SwCondCollPage(Window *pParent, const SfxItemSet &rSet)
FreeResource();
SetExchangeSupport();
+ aRemovePB.SetAccessibleRelationMemberOf(&aConditionFL);
+ aAssignPB.SetAccessibleRelationMemberOf(&aConditionFL);
+ aTbLinks.SetAccessibleRelationLabeledBy(&aConditionCB);
+
// Handler installieren
aConditionCB.SetClickHdl( LINK(this, SwCondCollPage, OnOffHdl));
aTbLinks.SetDoubleClickHdl( LINK(this, SwCondCollPage, AssignRemoveHdl ));
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index 6ab390ff90..85141566e8 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -345,11 +345,11 @@ SwAddPrinterTabPage::SwAddPrinterTabPage( Window* pParent,
aProspectCB (this, SW_RES(CB_PROSPECT)),
aProspectCB_RTL (this, SW_RES(CB_PROSPECT_RTL)),
aSeparatorRFL (this, SW_RES(FL_SEP_PRT_RIGHT)),
+ aFL3 (this, SW_RES(FL_3)),
aNoRB (this, SW_RES(RB_NO)),
aOnlyRB (this, SW_RES(RB_ONLY)),
aEndRB (this, SW_RES(RB_END)),
aEndPageRB (this, SW_RES(RB_PAGEEND)),
- aFL3 (this, SW_RES(FL_3)),
aFL4 (this, SW_RES(FL_4)),
aPrintEmptyPagesCB(this, SW_RES(CB_PRINTEMPTYPAGES)),
// aSingleJobsCB (this, SW_RES(CB_SINGLEJOBS)),
@@ -1964,6 +1964,13 @@ SwRedlineOptionsTabPage::SwRedlineOptionsTabPage( Window* pParent,
aLk = LINK(this, SwRedlineOptionsTabPage, ChangedMaskPrevHdl);
aMarkPosLB.SetSelectHdl( aLk );
aMarkColorLB.SetSelectHdl( aLk );
+//IAccessibility2 Impplementaton 2009-----
+ //solution: set different accessible name of four color box
+ aInsertColorLB.SetAccessibleName(::rtl::OUString( aInsertFT.GetDisplayText()) + ::rtl::OUString(aInsertColorFT.GetDisplayText()));
+ aDeletedColorLB.SetAccessibleName(::rtl::OUString( aDeletedFT.GetDisplayText()) + ::rtl::OUString( aDeletedColorFT.GetDisplayText()));
+ aChangedColorLB.SetAccessibleName(::rtl::OUString( aChangedFT.GetDisplayText()) + ::rtl::OUString( aChangedColorFT.GetDisplayText()));
+ aMarkColorLB.SetAccessibleName(::rtl::OUString( aMarkPosFT.GetDisplayText()) + ::rtl::OUString( aMarkColorFT.GetDisplayText()));
+//-----IAccessibility2 Impplementaton 2009
}
SwRedlineOptionsTabPage::~SwRedlineOptionsTabPage()
diff --git a/sw/source/ui/config/viewopt.cxx b/sw/source/ui/config/viewopt.cxx
index ffcbc7de29..67b0858b02 100644
--- a/sw/source/ui/config/viewopt.cxx
+++ b/sw/source/ui/config/viewopt.cxx
@@ -109,7 +109,8 @@ sal_Bool SwViewOption::IsEqualFlags( const SwViewOption &rOpt ) const
&& nPagePrevRow == rOpt.GetPagePrevRow()
&& nPagePrevCol == rOpt.GetPagePrevCol()
&& aRetoucheColor == rOpt.GetRetoucheColor()
- && bFormView == rOpt.IsFormView()
+ && mbFormView == rOpt.IsFormView()
+ && mbBrowseMode == rOpt.getBrowseMode()
&& mbViewLayoutBookMode == rOpt.mbViewLayoutBookMode
&& bShowPlaceHolderFields == rOpt.bShowPlaceHolderFields
&& bIdle == rOpt.bIdle
@@ -214,10 +215,9 @@ SwViewOption::SwViewOption() :
bStarOneSetting(sal_False),
bIsPagePreview(sal_False),
bSelectionInReadonly(sal_False),
- // --> FME 2004-06-29 #114856# Formular view
- bFormView(sal_False),
- // <--
- bBookview(sal_False),
+ mbFormView(sal_False),
+ mbBrowseMode(sal_False),
+ mbBookView(sal_False),
mbViewLayoutBookMode(sal_False),
bShowPlaceHolderFields( sal_True ),
@@ -258,7 +258,7 @@ SwViewOption::SwViewOption(const SwViewOption& rVOpt)
bReadonly = sal_False;
bSelectionInReadonly = sal_False;
// --> FME 2004-06-29 #114856# Formular view
- bFormView = rVOpt.bFormView;
+ mbFormView = rVOpt.mbFormView;
// <--
nZoom = rVOpt.nZoom ;
aSnapSize = rVOpt.aSnapSize ;
@@ -277,7 +277,8 @@ SwViewOption::SwViewOption(const SwViewOption& rVOpt)
sSymbolFont = rVOpt.sSymbolFont;
nShdwCrsrFillMode = rVOpt.nShdwCrsrFillMode;
bStarOneSetting = rVOpt.bStarOneSetting;
- bBookview = rVOpt.bBookview;
+ mbBookView = rVOpt.mbBookView;
+ mbBrowseMode = rVOpt.mbBrowseMode;
mbViewLayoutBookMode = rVOpt.mbViewLayoutBookMode;
bShowPlaceHolderFields = rVOpt.bShowPlaceHolderFields;
bIdle = rVOpt.bIdle;
@@ -299,7 +300,7 @@ SwViewOption::SwViewOption(const SwViewOption& rVOpt)
SwViewOption& SwViewOption::operator=( const SwViewOption &rVOpt )
{
// --> DVO FME 2004-06-29 #114856# Formular view
- bFormView = rVOpt.bFormView ;
+ mbFormView = rVOpt.mbFormView ;
// <--
nZoom = rVOpt.nZoom ;
aSnapSize = rVOpt.aSnapSize ;
@@ -318,7 +319,8 @@ SwViewOption& SwViewOption::operator=( const SwViewOption &rVOpt )
sSymbolFont = rVOpt.sSymbolFont;
nShdwCrsrFillMode = rVOpt.nShdwCrsrFillMode;
bStarOneSetting = rVOpt.bStarOneSetting;
- bBookview = rVOpt.bBookview;
+ mbBookView = rVOpt.mbBookView;
+ mbBrowseMode = rVOpt.mbBrowseMode;
mbViewLayoutBookMode = rVOpt.mbViewLayoutBookMode;
bShowPlaceHolderFields = rVOpt.bShowPlaceHolderFields;
bIdle = rVOpt.bIdle;
diff --git a/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx b/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx
index a05b114987..cac83ec78d 100644
--- a/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx
+++ b/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx
@@ -102,7 +102,7 @@ struct SpellState
ESelection m_aESelection;
//iterating over draw text objects
- std::vector<SdrTextObj*> m_aTextObjects;
+ std::list<SdrTextObj*> m_aTextObjects;
bool m_bTextObjectsCollected;
SpellState() :
@@ -790,58 +790,24 @@ bool SwSpellDialogChildWindow::FindNextDrawTextError_Impl(SwWrtShell& rSh)
if( pObj && pObj->ISA(SdrTextObj) )
pCurrentTextObj = static_cast<SdrTextObj*>(pObj);
}
- //at first fill the vector of drawing objects
+ //at first fill the list of drawing objects
if(!m_pSpellState->m_bTextObjectsCollected )
{
m_pSpellState->m_bTextObjectsCollected = true;
- sal_uInt16 n = 0;
- //iterate in the 'normal' array of objects
- while( n < pDoc->GetSpzFrmFmts()->Count() )
+ std::list<SdrTextObj*> aTextObjs;
+ SwDrawContact::GetTextObjectsFromFmt( aTextObjs, pDoc );
+ if(pCurrentTextObj)
{
- SwFrmFmt* pFly = (*pDoc->GetSpzFrmFmts())[ n ];
- if( pFly->IsA( TYPE(SwDrawFrmFmt) ) )
- {
- SwClientIter aIter( (SwFmt&) *pFly );
- if( aIter.First( TYPE(SwDrawContact) ) )
- {
- SdrObject* pSdrO = ((SwDrawContact*)aIter())->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() &&
- pCurrentTextObj != pSdrOElement)
- {
- m_pSpellState->m_aTextObjects.push_back((SdrTextObj*) pSdrOElement);
+ m_pSpellState->m_aTextObjects.remove(pCurrentTextObj);
+ m_pSpellState->m_aTextObjects.push_back(pCurrentTextObj);
}
}
- }
- else if( pSdrO->IsA( TYPE(SdrTextObj) ) &&
- static_cast<SdrTextObj*>( pSdrO )->HasText() &&
- pCurrentTextObj != pSdrO)
- {
- m_pSpellState->m_aTextObjects.push_back((SdrTextObj*) pSdrO);
- }
- }
- }
- }
- ++n;
- }
- if(pCurrentTextObj)
- m_pSpellState->m_aTextObjects.push_back(pCurrentTextObj);
- }
if(m_pSpellState->m_aTextObjects.size())
{
Reference< XSpellChecker1 > xSpell( GetSpellChecker() );
while(!bNextDoc && m_pSpellState->m_aTextObjects.size())
{
- std::vector<SdrTextObj*>::iterator aStart = m_pSpellState->m_aTextObjects.begin();
+ std::list<SdrTextObj*>::iterator aStart = m_pSpellState->m_aTextObjects.begin();
SdrTextObj* pTextObj = *aStart;
if(m_pSpellState->m_pStartDrawing == pTextObj)
m_pSpellState->m_bRestartDrawing = true;
diff --git a/sw/source/ui/dialog/docstdlg.cxx b/sw/source/ui/dialog/docstdlg.cxx
index a38af089e8..39fa7edafa 100644
--- a/sw/source/ui/dialog/docstdlg.cxx
+++ b/sw/source/ui/dialog/docstdlg.cxx
@@ -82,23 +82,21 @@ SfxTabPage * SwDocStatPage::Create(Window *pParent, const SfxItemSet &rSet)
SwDocStatPage::SwDocStatPage(Window *pParent, const SfxItemSet &rSet) :
SfxTabPage (pParent, SW_RES(TP_DOC_STAT), rSet),
-
+ aPageLbl (this, SW_RES( FT_PAGE )),
+ aPageNo (this, SW_RES( FT_PAGE_COUNT )),
aTableLbl (this, SW_RES( FT_TABLE )),
+ aTableNo (this, SW_RES( FT_TABLE_COUNT)),
aGrfLbl (this, SW_RES( FT_GRF )),
+ aGrfNo (this, SW_RES( FT_GRF_COUNT )),
aOLELbl (this, SW_RES( FT_OLE )),
- aPageLbl (this, SW_RES( FT_PAGE )),
+ aOLENo (this, SW_RES( FT_OLE_COUNT )),
aParaLbl (this, SW_RES( FT_PARA )),
+ aParaNo (this, SW_RES( FT_PARA_COUNT )),
aWordLbl (this, SW_RES( FT_WORD )),
+ aWordNo (this, SW_RES( FT_WORD_COUNT )),
aCharLbl (this, SW_RES( FT_CHAR )),
+ aCharNo (this, SW_RES( FT_CHAR_COUNT )),
aLineLbl (this, SW_RES( FT_LINE )),
-
- aTableNo (this, SW_RES( FT_TABLE_COUNT)),
- aGrfNo (this, SW_RES( FT_GRF_COUNT )),
- aOLENo (this, SW_RES( FT_OLE_COUNT )),
- aPageNo (this, SW_RES( FT_PAGE_COUNT )),
- aParaNo (this, SW_RES( FT_PARA_COUNT )),
- aWordNo (this, SW_RES( FT_WORD_COUNT )),
- aCharNo (this, SW_RES( FT_CHAR_COUNT )),
aLineNo (this, SW_RES( FT_LINE_COUNT )),
aUpdatePB (this, SW_RES( PB_PDATE ))
{
diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx
index 932bdcbadc..796df3f2d6 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -457,6 +457,10 @@ SwEditRegionDlg::SwEditRegionDlg( Window* pParent, SwWrtShell& rWrtSh )
aTree.Select( aTree.First() );
aTree.Show();
bDontCheckPasswd = sal_False;
+
+ aPasswdPB.SetAccessibleRelationMemberOf(&aProtectFL);
+ aPasswdPB.SetAccessibleRelationLabeledBy(&aPasswdCB);
+ aSubRegionED.SetAccessibleName(aSubRegionFT.GetText());
}
/* -----------------------------26.04.01 14:56--------------------------------
@@ -1353,6 +1357,7 @@ IMPL_LINK( SwEditRegionDlg, DDEHdl, CheckBox*, pBox )
rData.SetLinkFilePassword( aEmptyStr );
}
rData.SetType(DDE_LINK_SECTION);
+ aFileNameED.SetAccessibleName(aDDECommandFT.GetText());
}
else
{
@@ -1371,6 +1376,7 @@ IMPL_LINK( SwEditRegionDlg, DDEHdl, CheckBox*, pBox )
rData.SetLinkFilePassword( aEmptyStr );
aFileNameED.SetText(aEmptyStr);
}
+ aFileNameED.SetAccessibleName(aFileNameFT.GetText());
}
aFilePB.Enable(bFile && !bDDE);
}
@@ -1734,6 +1740,7 @@ SwInsertSectionTabPage::SwInsertSectionTabPage(
aCurName.SetModifyHdl ( LINK( this, SwInsertSectionTabPage, NameEditHdl));
aDDECB.SetClickHdl ( LINK( this, SwInsertSectionTabPage, DDEHdl ));
ChangeProtectHdl(&aProtectCB);
+ aPasswdPB.SetAccessibleRelationMemberOf(&aProtectFL);
aSubRegionED.EnableAutocomplete( sal_True, sal_True );
}
/* -----------------21.05.99 10:31-------------------
@@ -1999,6 +2006,7 @@ IMPL_LINK( SwInsertSectionTabPage, DDEHdl, CheckBox*, pBox )
aDDECommandFT.Show();
aSubRegionFT.Hide();
aSubRegionED.Hide();
+ aFileNameED.SetAccessibleName(aDDECommandFT.GetText());
}
else
{
@@ -2008,6 +2016,7 @@ IMPL_LINK( SwInsertSectionTabPage, DDEHdl, CheckBox*, pBox )
aSubRegionFT.Show();
aSubRegionED.Show();
aSubRegionED.Enable(bFile);
+ aFileNameED.SetAccessibleName(aFileNameFT.GetText());
}
return 0;
}
@@ -2375,6 +2384,7 @@ SwSectionIndentTabPage::SwSectionIndentTabPage( Window *pParent, const SfxItemSe
Link aLk = LINK(this, SwSectionIndentTabPage, IndentModifyHdl);
aBeforeMF.SetModifyHdl(aLk);
aAfterMF.SetModifyHdl(aLk);
+ aPreviewWin.SetAccessibleName(aIndentFL.GetText());
}
/*-- 13.06.2003 09:59:23---------------------------------------------------
diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx
index 9ce88fffaf..3fd11d5dfc 100644
--- a/sw/source/ui/dochdl/swdtflvr.cxx
+++ b/sw/source/ui/dochdl/swdtflvr.cxx
@@ -116,27 +116,18 @@
#include <dochdl.hrc>
#include <comcore.hrc> // #111827#
#include <sot/stg.hxx>
-
-// #108584#
#include <svx/svditer.hxx>
-
-// #108584#
#include <editeng/eeitem.hxx>
-
-// #108584#
#include <editeng/fhgtitem.hxx>
-
-// #108584#
#include <svx/svdpage.hxx>
#include <avmedia/mediawindow.hxx>
-
-// #109590#
#include <swcrsr.hxx>
#include <SwRewriter.hxx>
#include <globals.hrc>
#include <vos/mutex.hxx>
#include <vcl/svapp.hxx>
#include <swserv.hxx>
+#include <switerator.hxx>
extern sal_Bool bFrmDrag;
extern sal_Bool bDDINetAttr;
@@ -373,10 +364,8 @@ uno::Reference < embed::XEmbeddedObject > SwTransferable::FindOLEObj( sal_Int64&
uno::Reference < embed::XEmbeddedObject > xObj;
if( pClpDocFac )
{
- SwClientIter aIter( *(SwModify*)pClpDocFac->GetDoc()->
- GetDfltGrfFmtColl() );
- for( SwCntntNode* pNd = (SwCntntNode*)aIter.First( TYPE( SwCntntNode ) );
- pNd; pNd = (SwCntntNode*)aIter.Next() )
+ SwIterator<SwCntntNode,SwFmtColl> aIter( *pClpDocFac->GetDoc()->GetDfltGrfFmtColl() );
+ for( SwCntntNode* pNd = aIter.First(); pNd; pNd = aIter.Next() )
if( ND_OLENODE == pNd->GetNodeType() )
{
xObj = ((SwOLENode*)pNd)->GetOLEObj().GetOleRef();
@@ -393,10 +382,8 @@ Graphic* SwTransferable::FindOLEReplacementGraphic() const
{
if( pClpDocFac )
{
- SwClientIter aIter( *(SwModify*)pClpDocFac->GetDoc()->
- GetDfltGrfFmtColl() );
- for( SwCntntNode* pNd = (SwCntntNode*)aIter.First( TYPE( SwCntntNode ) );
- pNd; pNd = (SwCntntNode*)aIter.Next() )
+ SwIterator<SwCntntNode,SwFmtColl> aIter( *pClpDocFac->GetDoc()->GetDfltGrfFmtColl() );
+ for( SwCntntNode* pNd = aIter.First(); pNd; pNd = aIter.Next() )
if( ND_OLENODE == pNd->GetNodeType() )
{
return ((SwOLENode*)pNd)->GetGraphic();
diff --git a/sw/source/ui/docvw/AnnotationWin.cxx b/sw/source/ui/docvw/AnnotationWin.cxx
index 4675805e52..7419ee060e 100644
--- a/sw/source/ui/docvw/AnnotationWin.cxx
+++ b/sw/source/ui/docvw/AnnotationWin.cxx
@@ -111,15 +111,23 @@ void SwAnnotationWin::UpdateData()
{
if ( Engine()->IsModified() )
{
- SwTxtFld* pTxtFld = mpFmtFld->GetTxtFld();
- SwPosition aPosition( pTxtFld->GetTxtNode() );
- aPosition.nContent = *pTxtFld->GetStart();
- SwField* pOldField = mpFld->Copy();
+ IDocumentUndoRedo & rUndoRedo(
+ DocView().GetDocShell()->GetDoc()->GetIDocumentUndoRedo());
+ ::std::auto_ptr<SwField> pOldField;
+ if (rUndoRedo.DoesUndo())
+ {
+ pOldField.reset(mpFld->Copy());
+ }
mpFld->SetPar2(Engine()->GetEditEngine().GetText());
mpFld->SetTextObject(Engine()->CreateParaObject());
- DocView().GetDocShell()->GetDoc()->GetIDocumentUndoRedo().AppendUndo(
- new SwUndoFieldFromDoc(aPosition, *pOldField, *mpFld, 0, true));
- delete pOldField;
+ if (rUndoRedo.DoesUndo())
+ {
+ SwTxtFld *const pTxtFld = mpFmtFld->GetTxtFld();
+ SwPosition aPosition( pTxtFld->GetTxtNode() );
+ aPosition.nContent = *pTxtFld->GetStart();
+ rUndoRedo.AppendUndo(
+ new SwUndoFieldFromDoc(aPosition, *pOldField, *mpFld, 0, true));
+ }
// so we get a new layout of notes (anchor position is still the same and we would otherwise not get one)
Mgr().SetLayout();
// #i98686# if we have several views, all notes should update their text
@@ -242,15 +250,23 @@ void SwAnnotationWin::InitAnswer(OutlinerParaObject* pText)
// lets insert an undo step so the initial text can be easily deleted
// but do not use UpdateData() directly, would set modified state again and reentrance into Mgr
Engine()->SetModifyHdl( Link() );
- SwTxtFld* pTxtFld = mpFmtFld->GetTxtFld();
- SwPosition aPosition( pTxtFld->GetTxtNode() );
- aPosition.nContent = *pTxtFld->GetStart();
- SwField* pOldField = mpFld->Copy();
+ IDocumentUndoRedo & rUndoRedo(
+ DocView().GetDocShell()->GetDoc()->GetIDocumentUndoRedo());
+ ::std::auto_ptr<SwField> pOldField;
+ if (rUndoRedo.DoesUndo())
+ {
+ pOldField.reset(mpFld->Copy());
+ }
mpFld->SetPar2(Engine()->GetEditEngine().GetText());
mpFld->SetTextObject(Engine()->CreateParaObject());
- DocView().GetDocShell()->GetDoc()->GetIDocumentUndoRedo().AppendUndo(
- new SwUndoFieldFromDoc(aPosition, *pOldField, *mpFld, 0, true));
- delete pOldField;
+ if (rUndoRedo.DoesUndo())
+ {
+ SwTxtFld *const pTxtFld = mpFmtFld->GetTxtFld();
+ SwPosition aPosition( pTxtFld->GetTxtNode() );
+ aPosition.nContent = *pTxtFld->GetStart();
+ rUndoRedo.AppendUndo(
+ new SwUndoFieldFromDoc(aPosition, *pOldField, *mpFld, 0, true));
+ }
Engine()->SetModifyHdl( LINK( this, SwAnnotationWin, ModifyHdl ) );
Engine()->ClearModifyFlag();
Engine()->GetUndoManager().Clear();
diff --git a/sw/source/ui/docvw/PostItMgr.cxx b/sw/source/ui/docvw/PostItMgr.cxx
index f2a2afce41..ec2cef2bf1 100644
--- a/sw/source/ui/docvw/PostItMgr.cxx
+++ b/sw/source/ui/docvw/PostItMgr.cxx
@@ -83,6 +83,7 @@
#include <i18npool/lang.h>
#include "swevent.hxx"
+#include "switerator.hxx"
// distance between Anchor Y and initial note position
#define POSTIT_INITIAL_ANCHOR_DISTANCE 20
@@ -1183,17 +1184,16 @@ void SwPostItMgr::AddPostIts(bool bCheckExistance, bool bFocus)
{
bool bEmpty = mvPostItFlds.empty();
SwFieldType* pType = mpView->GetDocShell()->GetDoc()->GetFldType(RES_POSTITFLD, aEmptyStr,false);
- SwClientIter aIter( *pType );
- SwClient * pFirst = aIter.GoStart();
- while(pFirst)
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pType );
+ SwFmtFld* pSwFmtFld = aIter.First();
+ while(pSwFmtFld)
{
- SwFmtFld* pSwFmtFld = static_cast<SwFmtFld*>(pFirst);
if ( pSwFmtFld->GetTxtFld())
{
if ( pSwFmtFld->IsFldInDoc() )
InsertItem(pSwFmtFld,bCheckExistance,bFocus);
}
- pFirst = aIter++;
+ pSwFmtFld = aIter.Next();
}
// if we just added the first one we have to update the view for centering
diff --git a/sw/source/ui/docvw/access.src b/sw/source/ui/docvw/access.src
index 42081d3ab7..d455c01d0c 100644
--- a/sw/source/ui/docvw/access.src
+++ b/sw/source/ui/docvw/access.src
@@ -100,3 +100,22 @@ String STR_ACCESS_ANNOTATION_BUTTON_DESC
Text [ en-US ] = "Activate this button to open a list of actions which can be performed on this comment and other comments";
};
+//IAccessibility2 Implementation 2009-----
+String STR_ACCESS_PREVIEW_DOC_NAME
+{
+ Text [ en-US ] = "Document preview";
+};
+String STR_ACCESS_PREVIEW_DOC_SUFFIX
+{
+ Text [ en-US ] = "(Preview mode)";
+};
+String STR_ACCESS_DOC_WORDPROCESSING
+{
+ Text [ en-US ] = "%PRODUCTNAME Document";
+};
+String STR_ACCESS_DOC_WORDPROCESSING_READONLY
+{
+ Text [ en-US ] = "(read-only)";
+};
+//-----IAccessibility2 Implementation 2009
+
diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index c404f77739..520465e789 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -1208,8 +1208,8 @@ void SwEditWin::ChangeDrawing( sal_uInt8 nDir )
{
// --> FME 2005-04-26 #i47138#
// Check if object is anchored as character and move direction
- sal_Bool bDummy;
- const bool bVertAnchor = rSh.IsFrmVertical( sal_True, bDummy );
+ sal_Bool bDummy1, bDummy2;
+ const bool bVertAnchor = rSh.IsFrmVertical( sal_True, bDummy1, bDummy2 );
const bool bHoriMove = !bVertAnchor == !( nDir % 2 );
const bool bMoveAllowed =
!bHoriMove || (rSh.GetAnchorId() != FLY_AS_CHAR);
@@ -1365,11 +1365,14 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
if( ( bVertText && ( !bTblCrsr || bVertTable ) ) ||
( bTblCrsr && bVertTable ) )
{
+ // Attempt to integrate cursor travelling for mongolian layout does not work.
+ // Thus, back to previous mapping of cursor keys to direction keys.
if( KEY_UP == nKey ) nKey = KEY_LEFT;
else if( KEY_DOWN == nKey ) nKey = KEY_RIGHT;
else if( KEY_LEFT == nKey ) nKey = KEY_DOWN;
else if( KEY_RIGHT == nKey ) nKey = KEY_UP;
}
+
if ( rSh.IsInRightToLeftText() )
{
if( KEY_LEFT == nKey ) nKey = KEY_RIGHT;
@@ -1979,6 +1982,7 @@ KEYINPUT_CHECKTABLE_INSDEL:
{
#ifdef SW_CRSR_TIMER
sal_Bool bOld = rSh.ChgCrsrTimerFlag( sal_False );
+ sal_Bool bOld = rSh.ChgCrsrTimerFlag( sal_False );
#endif
if (rSh.IsFormProtected() || rSh.GetCurrentFieldmark()|| rSh.GetChar(sal_False)==CH_TXT_ATR_FORMELEMENT) {
eKeyState=KS_GotoPrevFieldMark;
@@ -3907,7 +3911,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
if( bTstShdwCrsr && bInsWin && !bIsDocReadOnly &&
!bInsFrm &&
- !rSh.getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) &&
+ !rSh.GetViewOptions()->getBrowseMode() &&
rSh.GetViewOptions()->IsShadowCursor() &&
!(rMEvt.GetModifier() + rMEvt.GetButtons()) &&
!rSh.HasSelection() && !GetConnectMetaFile() )
diff --git a/sw/source/ui/envelp/label1.cxx b/sw/source/ui/envelp/label1.cxx
index 110dc05c66..66dff1c03a 100644
--- a/sw/source/ui/envelp/label1.cxx
+++ b/sw/source/ui/envelp/label1.cxx
@@ -271,7 +271,8 @@ SwLabPage::SwLabPage(Window* pParent, const SfxItemSet& rSet) :
SfxTabPage(pParent, SW_RES(TP_LAB_LAB), rSet),
pNewDBMgr(NULL),
aItem ((const SwLabItem&) rSet.Get(FN_LABEL)),
-
+
+ aWritingFL (this, SW_RES(FL_WRITING)),
aWritingText (this, SW_RES(TXT_WRITING)),
aAddrBox (this, SW_RES(BOX_ADDR )),
aWritingEdit (this, SW_RES(EDT_WRITING)),
@@ -282,7 +283,7 @@ SwLabPage::SwLabPage(Window* pParent, const SfxItemSet& rSet) :
aInsertBT (this, SW_RES(BTN_INSERT )),
aDBFieldFT (this, SW_RES(FT_DBFIELD )),
aDBFieldLB (this, SW_RES(LB_DBFIELD )),
- aWritingFL (this, SW_RES(FL_WRITING)),
+ aFormatFL (this, SW_RES(FL_FORMAT )),
aContButton (this, SW_RES(BTN_CONT )),
aSheetButton (this, SW_RES(BTN_SHEET )),
aMakeText (this, SW_RES(TXT_MAKE )),
@@ -290,9 +291,8 @@ SwLabPage::SwLabPage(Window* pParent, const SfxItemSet& rSet) :
aTypeText (this, SW_RES(TXT_TYPE )),
aTypeBox (this, SW_RES(BOX_TYPE )),
aHiddenSortTypeBox(this, WB_SORT|WB_HIDE),
- aFormatInfo (this, SW_RES(INF_FORMAT )),
- aFormatFL (this, SW_RES(FL_FORMAT ))
-{
+ aFormatInfo (this, SW_RES(INF_FORMAT ))
+ {
WaitObject aWait( pParent );
FreeResource();
@@ -715,10 +715,10 @@ void SwVisitingCardPage::SetUserData( sal_uInt32 nCnt,
SwVisitingCardPage::SwVisitingCardPage(Window* pParent, const SfxItemSet& rSet) :
SfxTabPage(pParent, SW_RES(TP_VISITING_CARDS), rSet),
+ aContentFL(this, SW_RES( FL_CONTENT )),
aAutoTextLB(this, SW_RES( LB_AUTO_TEXT )),
aAutoTextGroupFT(this, SW_RES( FT_AUTO_TEXT_GROUP )),
aAutoTextGroupLB(this, SW_RES( LB_AUTO_TEXT_GROUP )),
- aContentFL(this, SW_RES( FL_CONTENT )),
aExampleWIN(this, SW_RES( WIN_EXAMPLE )),
sVisCardGroup(SW_RES(ST_VISCARD_GROUP)),
pExampleFrame(0)
diff --git a/sw/source/ui/envelp/labprt.cxx b/sw/source/ui/envelp/labprt.cxx
index 41315f95e5..868fd0539b 100644
--- a/sw/source/ui/envelp/labprt.cxx
+++ b/sw/source/ui/envelp/labprt.cxx
@@ -61,6 +61,7 @@ SwLabPrtPage::SwLabPrtPage(Window* pParent, const SfxItemSet& rSet) :
SfxTabPage(pParent, SW_RES(TP_LAB_PRT), rSet),
pPrinter( 0 ),
+ aFLDontKnow (this, SW_RES(FL_DONTKNOW)),
aPageButton (this, SW_RES(BTN_PAGE )),
aSingleButton (this, SW_RES(BTN_SINGLE )),
aColText (this, SW_RES(TXT_COL )),
@@ -68,10 +69,9 @@ SwLabPrtPage::SwLabPrtPage(Window* pParent, const SfxItemSet& rSet) :
aRowText (this, SW_RES(TXT_ROW )),
aRowField (this, SW_RES(FLD_ROW )),
aSynchronCB (this, SW_RES(CB_SYNCHRON)),
- aFLDontKnow (this, SW_RES(FL_DONTKNOW)),
+ aFLPrinter (this, SW_RES(FL_PRINTER )),
aPrinterInfo (this, SW_RES(INF_PRINTER)),
- aPrtSetup (this, SW_RES(BTN_PRTSETUP)),
- aFLPrinter (this, SW_RES(FL_PRINTER ))
+ aPrtSetup (this, SW_RES(BTN_PRTSETUP))
{
FreeResource();
diff --git a/sw/source/ui/envelp/labprt.hxx b/sw/source/ui/envelp/labprt.hxx
index ab11de0ed4..5bddd0ecf6 100644
--- a/sw/source/ui/envelp/labprt.hxx
+++ b/sw/source/ui/envelp/labprt.hxx
@@ -45,6 +45,7 @@ class SwLabPrtPage : public SfxTabPage
{
Printer* pPrinter; //Fuer die Schachteinstellug - leider.
+ FixedLine aFLDontKnow;
RadioButton aPageButton;
RadioButton aSingleButton;
FixedText aColText;
@@ -52,11 +53,10 @@ class SwLabPrtPage : public SfxTabPage
FixedText aRowText;
NumericField aRowField;
CheckBox aSynchronCB;
- FixedLine aFLDontKnow;
+ FixedLine aFLPrinter;
FixedInfo aPrinterInfo;
PushButton aPrtSetup;
- FixedLine aFLPrinter;
SwLabPrtPage(Window* pParent, const SfxItemSet& rSet);
~SwLabPrtPage();
diff --git a/sw/source/ui/envelp/swuilabimp.hxx b/sw/source/ui/envelp/swuilabimp.hxx
index 49e12d0017..27df317d00 100644
--- a/sw/source/ui/envelp/swuilabimp.hxx
+++ b/sw/source/ui/envelp/swuilabimp.hxx
@@ -34,6 +34,7 @@ class SwLabPage : public SfxTabPage
String sActDBName;
SwLabItem aItem;
+ FixedLine aWritingFL;
FixedText aWritingText;
CheckBox aAddrBox;
MultiLineEdit aWritingEdit;
@@ -45,8 +46,8 @@ class SwLabPage : public SfxTabPage
FixedText aDBFieldFT;
ListBox aDBFieldLB;
// PushButton aDatabaseButton;
- FixedLine aWritingFL;
+ FixedLine aFormatFL;
RadioButton aContButton;
RadioButton aSheetButton;
FixedText aMakeText;
@@ -55,7 +56,6 @@ class SwLabPage : public SfxTabPage
ListBox aTypeBox;
ListBox aHiddenSortTypeBox;
FixedInfo aFormatInfo;
- FixedLine aFormatFL;
sal_Bool m_bLabel;
@@ -102,12 +102,11 @@ public:
class SwOneExampleFrame;
class SwVisitingCardPage : public SfxTabPage
{
+ FixedLine aContentFL;
SvTreeListBox aAutoTextLB;
FixedText aAutoTextGroupFT;
ListBox aAutoTextGroupLB;
- FixedLine aContentFL;
-
Window aExampleWIN;
String sVisCardGroup;
diff --git a/sw/source/ui/fldui/fldfunc.cxx b/sw/source/ui/fldui/fldfunc.cxx
index 718c0e8cbc..04a6f56b3c 100644
--- a/sw/source/ui/fldui/fldfunc.cxx
+++ b/sw/source/ui/fldui/fldfunc.cxx
@@ -335,12 +335,16 @@ IMPL_LINK( SwFldFuncPage, TypeHdl, ListBox *, EMPTYARG )
aNameFT.SetText(SW_RESSTR(STR_MACNAME));
aValueFT.SetText(SW_RESSTR(STR_PROMPT));
aNameED.SetText(GetFldMgr().GetMacroName());
+ aNameED.SetAccessibleName(aNameFT.GetText());
+ aValueED.SetAccessibleName(aValueFT.GetText());
break;
case TYP_HIDDENPARAFLD:
aNameFT.SetText(SW_RESSTR(STR_COND));
aNameED.SetDropEnable(sal_True);
bName = sal_True;
+ aNameED.SetAccessibleName(aNameFT.GetText());
+ aValueED.SetAccessibleName(aValueFT.GetText());
break;
case TYP_HIDDENTXTFLD:
@@ -352,6 +356,8 @@ IMPL_LINK( SwFldFuncPage, TypeHdl, ListBox *, EMPTYARG )
if (!IsFldEdit() && pSh )
aValueED.SetText(pSh->GetSelTxt());
bName = bValue = sal_True;
+ aNameED.SetAccessibleName(aNameFT.GetText());
+ aValueED.SetAccessibleName(aValueFT.GetText());
}
break;
@@ -365,18 +371,24 @@ IMPL_LINK( SwFldFuncPage, TypeHdl, ListBox *, EMPTYARG )
}
bName = bValue = sal_True;
+ aNameED.SetAccessibleName(aNameFT.GetText());
+ aValueED.SetAccessibleName(aValueFT.GetText());
break;
case TYP_JUMPEDITFLD:
aNameFT.SetText(SW_RESSTR(STR_JUMPEDITFLD));
aValueFT.SetText(SW_RESSTR(STR_PROMPT));
bName = bValue = sal_True;
+ aNameED.SetAccessibleName(aNameFT.GetText());
+ aValueED.SetAccessibleName(aValueFT.GetText());
break;
case TYP_INPUTFLD:
aValueFT.SetText(SW_RESSTR(STR_PROMPT));
bValue = sal_True;
- // bShowSelection = sal_True;
+ // bShowSelection = TRUE;
+ aNameED.SetAccessibleName(aNameFT.GetText());
+ aValueED.SetAccessibleName(aValueFT.GetText());
break;
case TYP_COMBINED_CHARS:
@@ -388,6 +400,8 @@ IMPL_LINK( SwFldFuncPage, TypeHdl, ListBox *, EMPTYARG )
const sal_uInt16 nLen = aNameED.GetText().Len();
if( !nLen || nLen > MAX_COMBINED_CHARACTERS )
bInsert = sal_False;
+ aNameED.SetAccessibleName(aNameFT.GetText());
+ aValueED.SetAccessibleName(aValueFT.GetText());
}
break;
case TYP_DROPDOWN :
diff --git a/sw/source/ui/fldui/fldmgr.cxx b/sw/source/ui/fldui/fldmgr.cxx
index 72bfc42ac5..b6c70bd95d 100644
--- a/sw/source/ui/fldui/fldmgr.cxx
+++ b/sw/source/ui/fldui/fldmgr.cxx
@@ -1034,8 +1034,8 @@ sal_Bool SwFldMgr::InsertFld( const SwInsertFld_Data& rData )
sal_uInt16 nTmpPos = sCmd.SearchAndReplace( ' ', sfx2::cTokenSeperator );
sCmd.SearchAndReplace( ' ', sfx2::cTokenSeperator, nTmpPos );
- SwDDEFieldType* pTyp = (SwDDEFieldType*)pCurShell->InsertFldType(
- SwDDEFieldType( rData.sPar1, sCmd, (sal_uInt16)nFormatId ));
+ SwDDEFieldType aType( rData.sPar1, sCmd, (sal_uInt16) nFormatId );
+ SwDDEFieldType* pTyp = (SwDDEFieldType*) pCurShell->InsertFldType( aType );
pFld = new SwDDEField( pTyp );
break;
}
@@ -1405,7 +1405,7 @@ sal_Bool SwFldMgr::InsertFld( const SwInsertFld_Data& rData )
else if( bPageVar )
((SwRefPageGetFieldType*)pCurShell->GetFldType( 0, RES_REFPAGEGETFLD ))->UpdateFlds();
else if( TYP_GETREFFLD == rData.nTypeId )
- pFld->GetTyp()->Modify( 0, 0 );
+ pFld->GetTyp()->ModifyNotification( 0, 0 );
// temporaeres Feld loeschen
delete pFld;
diff --git a/sw/source/ui/fldui/fldpage.cxx b/sw/source/ui/fldui/fldpage.cxx
index b359de9d4b..a36c6c5fff 100644
--- a/sw/source/ui/fldui/fldpage.cxx
+++ b/sw/source/ui/fldui/fldpage.cxx
@@ -53,6 +53,7 @@
#include <cmdid.h>
#include <globals.hrc>
#include <sfx2/bindings.hxx>
+#include <switerator.hxx>
using namespace ::com::sun::star;
@@ -249,14 +250,13 @@ sal_Bool SwFldPage::InsertFld(sal_uInt16 nTypeId, sal_uInt16 nSubType, const Str
SwDBFieldType* pTyp = (SwDBFieldType*)pSh->InsertFldType(
SwDBFieldType(pSh->GetDoc(), sColumn, aData));
- SwClientIter aIter( *pOldTyp );
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pOldTyp );
- for( SwFmtFld* pFmtFld = (SwFmtFld*)aIter.First( TYPE(SwFmtFld) );
- pFmtFld; pFmtFld = (SwFmtFld*)aIter.Next() )
+ for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() )
{
if( pFmtFld->GetFld() == m_pCurFld)
{
- pTyp->Add(pFmtFld); // Feld auf neuen Typ umhaengen
+ pFmtFld->RegisterToFieldType(*pTyp);
pTmpFld->ChgTyp(pTyp);
break;
}
@@ -411,9 +411,7 @@ IMPL_LINK( SwFldPage, NumFormatHdl, ListBox *, EMPTYARG )
return 0;
}
-/*-- 19.12.2005 14:05:47---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwFldPage::SetWrtShell( SwWrtShell* pShell )
{
m_pWrtShell = pShell;
diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx
index 06c4349c7a..01637c5d07 100644
--- a/sw/source/ui/frmdlg/column.cxx
+++ b/sw/source/ui/frmdlg/column.cxx
@@ -68,6 +68,8 @@
#include <docary.hxx>
#include <pagedesc.hxx>
+#include "access.hrc"
+
#define FRAME_FORMAT_WIDTH 1000
// sw/inc/fmtclds.hxx
@@ -451,12 +453,13 @@ SwColumnPage::SwColumnPage(Window *pParent, const SfxItemSet &rSet)
: SfxTabPage(pParent, SW_RES(TP_COLUMN), rSet),
+ aFLGroup(this, SW_RES(FL_COLUMNS )),
aClNrLbl(this, SW_RES(FT_NUMBER )),
aCLNrEdt(this, SW_RES(ED_NUMBER )),
aDefaultVS(this, SW_RES(VS_DEFAULTS)),
aBalanceColsCB(this, SW_RES(CB_BALANCECOLS)),
- aFLGroup(this, SW_RES(FL_COLUMNS )),
+ aFLLayout(this, SW_RES(FL_LAYOUT)),
aBtnUp(this, SW_RES(BTN_DOWN)),
aColumnFT(this, SW_RES(FT_COLUMN)),
aWidthFT(this, SW_RES(FT_WIDTH)),
@@ -472,15 +475,13 @@ SwColumnPage::SwColumnPage(Window *pParent, const SfxItemSet &rSet)
aBtnDown(this, SW_RES(BTN_UP)),
aAutoWidthBox(this, SW_RES(CB_AUTO_WIDTH)),
- aFLLayout(this, SW_RES(FL_LAYOUT)),
-
+ aFLLineType(this, SW_RES(FL_LINETYPE)),
aLineTypeLbl(this, SW_RES(FT_STYLE)),
aLineTypeDLB(this, SW_RES(LB_STYLE)),
aLineHeightLbl(this, SW_RES(FT_HEIGHT)),
aLineHeightEdit(this, SW_RES(ED_HEIGHT)),
aLinePosLbl(this, SW_RES(FT_POSITION)),
aLinePosDLB(this, SW_RES(LB_POSITION)),
- aFLLineType(this, SW_RES(FL_LINETYPE)),
aVertFL(this, SW_RES(FL_VERT)),
aPropertiesFL( this, SW_RES( FL_PROPERTIES )),
@@ -505,6 +506,15 @@ SwColumnPage::SwColumnPage(Window *pParent, const SfxItemSet &rSet)
FreeResource();
SetExchangeSupport();
+ aBtnDown.SetAccessibleRelationMemberOf(&aFLLayout);
+ aEd1.SetAccessibleRelationLabeledBy(&aWidthFT);
+ aEd2.SetAccessibleRelationLabeledBy(&aWidthFT);
+ aEd3.SetAccessibleRelationLabeledBy(&aWidthFT);
+ aDistEd1.SetAccessibleRelationLabeledBy(&aDistFT);
+ aDistEd2.SetAccessibleRelationLabeledBy(&aDistFT);
+ aBtnUp.SetAccessibleRelationLabeledBy(&aColumnFT);
+ aBtnDown.SetAccessibleRelationLabeledBy(&aColumnFT);
+
aDefaultVS.SetHelpId(HID_COLUMN_VALUESET);
aDefaultVS.SetColCount( 5 );
aDefaultVS.SetStyle( aDefaultVS.GetStyle()
@@ -909,16 +919,41 @@ void SwColumnPage::SetLabels( sal_uInt16 nVis )
String sLbl( '~' );
String sLbl2( String::CreateFromInt32( nVis + 1 ));
+ String tmp1(sLbl2);
sLbl2.Insert(sLbl, sLbl2.Len() - 1);
aLbl1.SetText(sLbl2);
sLbl2 = String::CreateFromInt32( nVis + 2 );
+ String tmp2(sLbl2);
sLbl2.Insert(sLbl, sLbl2.Len() - 1);
aLbl2.SetText(sLbl2);
sLbl2 = String::CreateFromInt32( nVis + 3 );
+ String tmp3(sLbl2);
sLbl2.Insert(sLbl, sLbl2.Len() - 1);
aLbl3.SetText(sLbl2);
+ String sColumnWidth = SW_RESSTR( STR_ACCESS_COLUMN_WIDTH ) ;
+ sColumnWidth.SearchAndReplaceAscii("%1", tmp1);
+ aEd1.SetAccessibleName(sColumnWidth);
+
+ sColumnWidth = SW_RESSTR( STR_ACCESS_COLUMN_WIDTH ) ;
+ sColumnWidth.SearchAndReplaceAscii("%1", tmp2);
+ aEd2.SetAccessibleName(sColumnWidth);
+
+ sColumnWidth = SW_RESSTR( STR_ACCESS_COLUMN_WIDTH ) ;
+ sColumnWidth.SearchAndReplaceAscii("%1", tmp3);
+ aEd3.SetAccessibleName(sColumnWidth);
+
+ String sDist = SW_RESSTR( STR_ACCESS_PAGESETUP_SPACING ) ;
+ String sDist1 = sDist;
+ sDist1.SearchAndReplaceAscii("%1", tmp1);
+ sDist1.SearchAndReplaceAscii("%2", tmp2);
+ aDistEd1.SetAccessibleName(sDist1);
+
+ String sDist2 = sDist;
+ sDist2.SearchAndReplaceAscii("%1", tmp2);
+ sDist2.SearchAndReplaceAscii("%2", tmp3);
+ aDistEd2.SetAccessibleName(sDist2);
}
/*------------------------------------------------------------------------
diff --git a/sw/source/ui/frmdlg/column.hrc b/sw/source/ui/frmdlg/column.hrc
index 172674a6b3..781bd100dc 100644
--- a/sw/source/ui/frmdlg/column.hrc
+++ b/sw/source/ui/frmdlg/column.hrc
@@ -79,7 +79,6 @@
#define FT_TEXTDIRECTION 60
#define LB_TEXTDIRECTION 61
#define FL_VERT 62
-
#define LISTBOX_SELECTION 0
#define LISTBOX_SECTION 1
#define LISTBOX_SECTIONS 2
diff --git a/sw/source/ui/frmdlg/column.src b/sw/source/ui/frmdlg/column.src
index 537cf1ce9c..8734383294 100644
--- a/sw/source/ui/frmdlg/column.src
+++ b/sw/source/ui/frmdlg/column.src
@@ -30,6 +30,8 @@
#include "frmui.hrc"
#include "cmdid.h"
#include "helpid.h"
+#include "access.hrc"
+
// #define TP_COLUMN 256
TabPage TP_COLUMN
{
@@ -416,4 +418,14 @@ ModalDialog DLG_COLUMN
Text [ en-US ] = "Columns";
};
+//IAccessibility2 Impplementaton 2009-----
+String STR_ACCESS_PAGESETUP_SPACING
+{
+ Text [ en-US ] = "Spacing between %1 and %2";
+};
+String STR_ACCESS_COLUMN_WIDTH
+{
+ Text [ en-US ] = "Column %1 Width";
+};
+//-----IAccessibility2 Impplementaton 2009
diff --git a/sw/source/ui/frmdlg/frmmgr.cxx b/sw/source/ui/frmdlg/frmmgr.cxx
index 8f4bcd3305..6070a5a25e 100644
--- a/sw/source/ui/frmdlg/frmmgr.cxx
+++ b/sw/source/ui/frmdlg/frmmgr.cxx
@@ -71,7 +71,8 @@ SwFlyFrmAttrMgr::SwFlyFrmAttrMgr( sal_Bool bNew, SwWrtShell* pSh, sal_uInt8 nTyp
pOwnSh( pSh ),
bAbsPos( sal_False ),
bNewFrm( bNew ),
- bIsInVertical( sal_False )
+ bIsInVertical( sal_False ),
+ bIsInVerticalL2R( sal_False )
{
if ( bNewFrm )
{
@@ -92,7 +93,7 @@ SwFlyFrmAttrMgr::SwFlyFrmAttrMgr( sal_Bool bNew, SwWrtShell* pSh, sal_uInt8 nTyp
{
pOwnSh->GetFlyFrmAttr( aSet );
sal_Bool bRightToLeft;
- bIsInVertical = pOwnSh->IsFrmVertical(sal_True, bRightToLeft);
+ bIsInVertical = pOwnSh->IsFrmVertical(sal_True, bRightToLeft, bIsInVerticalL2R);
}
::PrepareBoxInfo( aSet, *pOwnSh );
}
@@ -102,12 +103,13 @@ SwFlyFrmAttrMgr::SwFlyFrmAttrMgr( sal_Bool bNew, SwWrtShell* pSh, const SfxItemS
pOwnSh( pSh ),
bAbsPos( sal_False ),
bNewFrm( bNew ),
- bIsInVertical(sal_False)
+ bIsInVertical(sal_False),
+ bIsInVerticalL2R(sal_False)
{
if(!bNew)
{
sal_Bool bRightToLeft;
- bIsInVertical = pSh->IsFrmVertical(sal_True, bRightToLeft);
+ bIsInVertical = pSh->IsFrmVertical(sal_True, bRightToLeft, bIsInVerticalL2R);
}
}
@@ -297,7 +299,9 @@ void SwFlyFrmAttrMgr::ValidateMetrics( SvxSwFrameValidation& rVal,
if (bOnlyPercentRefValue)
return;
- if(bIsInVertical)
+ // --> OD 2009-09-01 #mongolianlayout#
+ if ( bIsInVertical || bIsInVerticalL2R )
+ // <--
{
Point aPos(aBoundRect.Pos());
long nTmp = aPos.X();
@@ -494,7 +498,9 @@ void SwFlyFrmAttrMgr::ValidateMetrics( SvxSwFrameValidation& rVal,
rVal.nMaxVPos = -aBoundRect.Height();
}
}
- if(bIsInVertical)
+ // --> OD 2009-09-01 #mongolianlayout#
+ if ( bIsInVertical || bIsInVerticalL2R )
+ // <--
{
//restore width/height exchange
long nTmp = rVal.nWidth;
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index 7decbbb395..633e23d445 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -500,17 +500,32 @@ void lcl_InsertVectors(ListBox& rBox,
/* -----------------------------20.08.2002 16:12------------------------------
---------------------------------------------------------------------------*/
-SvxSwFramePosString::StringId lcl_ChangeResIdToVerticalOrRTL(SvxSwFramePosString::StringId eStringId, sal_Bool bVertical, sal_Bool bRTL)
+// --> OD 2009-08-31 #mongolianlayout#
+// add input parameter
+SvxSwFramePosString::StringId lcl_ChangeResIdToVerticalOrRTL(SvxSwFramePosString::StringId eStringId, sal_Bool bVertical, sal_Bool bVerticalL2R, sal_Bool bRTL)
{
//special handling of STR_FROMLEFT
- if(SwFPos::FROMLEFT == eStringId)
+ if ( SwFPos::FROMLEFT == eStringId )
+ {
+ eStringId = bVertical
+ ? ( bRTL
+ ? SwFPos::FROMBOTTOM
+ : SwFPos::FROMTOP )
+ : ( bRTL
+ ? SwFPos::FROMRIGHT
+ : SwFPos::FROMLEFT );
+ return eStringId;
+ }
+ // --> OD 2009-08-31 #mongolianlayout#
+ // special handling of STR_FROMTOP in case of mongolianlayout (vertical left-to-right)
+ if ( SwFPos::FROMTOP == eStringId &&
+ bVertical && bVerticalL2R )
{
- eStringId = bVertical ?
- bRTL ? SwFPos::FROMBOTTOM : SwFPos::FROMTOP :
- bRTL ? SwFPos::FROMRIGHT : SwFPos::FROMLEFT;
+ eStringId = SwFPos::FROMLEFT;
return eStringId;
}
- if(bVertical)
+ // <--
+ if ( bVertical )
{
//exchange horizontal strings with vertical strings and vice versa
static const StringIdPair_Impl aHoriIds[] =
@@ -535,6 +550,19 @@ SvxSwFramePosString::StringId lcl_ChangeResIdToVerticalOrRTL(SvxSwFramePosString
{SwFPos::REL_FRM_TOP, SwFPos::REL_FRM_LEFT },
{SwFPos::REL_FRM_BOTTOM, SwFPos::REL_FRM_RIGHT }
};
+ // --> OD 2009-08-31 #monglianlayout#
+ static const StringIdPair_Impl aVertL2RIds[] =
+ {
+ {SwFPos::TOP, SwFPos::LEFT },
+ {SwFPos::BOTTOM, SwFPos::RIGHT },
+ {SwFPos::CENTER_VERT, SwFPos::CENTER_HORI },
+ {SwFPos::FROMTOP, SwFPos::FROMLEFT },
+ {SwFPos::REL_PG_TOP, SwFPos::REL_PG_LEFT },
+ {SwFPos::REL_PG_BOTTOM, SwFPos::REL_PG_RIGHT } ,
+ {SwFPos::REL_FRM_TOP, SwFPos::REL_FRM_LEFT },
+ {SwFPos::REL_FRM_BOTTOM, SwFPos::REL_FRM_RIGHT }
+ };
+ // <--
sal_uInt16 nIndex;
for(nIndex = 0; nIndex < sizeof(aHoriIds) / sizeof(StringIdPair_Impl); ++nIndex)
{
@@ -547,11 +575,24 @@ SvxSwFramePosString::StringId lcl_ChangeResIdToVerticalOrRTL(SvxSwFramePosString
nIndex = 0;
for(nIndex = 0; nIndex < sizeof(aVertIds) / sizeof(StringIdPair_Impl); ++nIndex)
{
- if(aVertIds[nIndex].eHori == eStringId)
+ // --> OD 2009-08-31 #mongolianlayout#
+ if ( !bVerticalL2R )
{
- eStringId = aVertIds[nIndex].eVert;
- break;
+ if(aVertIds[nIndex].eHori == eStringId)
+ {
+ eStringId = aVertIds[nIndex].eVert;
+ break;
+ }
+ }
+ else
+ {
+ if(aVertL2RIds[nIndex].eHori == eStringId)
+ {
+ eStringId = aVertL2RIds[nIndex].eVert;
+ break;
+ }
}
+ // <--
}
}
return eStringId;
@@ -613,6 +654,7 @@ namespace
SwFrmPage::SwFrmPage ( Window *pParent, const SfxItemSet &rSet ) :
SfxTabPage (pParent, SW_RES(TP_FRM_STD), rSet),
+ aSizeFL (this, SW_RES(FL_SIZE)),
aWidthFT (this, SW_RES(FT_WIDTH)),
aWidthAutoFT (this, SW_RES(FT_WIDTH_AUTO)),
aWidthED (this, SW_RES(ED_WIDTH)),
@@ -625,16 +667,16 @@ SwFrmPage::SwFrmPage ( Window *pParent, const SfxItemSet &rSet ) :
aAutoHeightCB (this, SW_RES(CB_AUTOHEIGHT)),
aFixedRatioCB (this, SW_RES(CB_FIXEDRATIO)),
aRealSizeBT (this, SW_RES(BT_REALSIZE)),
- aSizeFL (this, SW_RES(FL_SIZE)),
- aTypeFL (this, SW_RES(FL_TYPE)),
aTypeSepFL (this, SW_RES(FL_TYPE_SEP)),
+ aTypeFL (this, SW_RES(FL_TYPE)),
aAnchorAtPageRB (this, SW_RES(RB_ANCHOR_PAGE)),
aAnchorAtParaRB (this, SW_RES(RB_ANCHOR_PARA)),
aAnchorAtCharRB (this, SW_RES(RB_ANCHOR_AT_CHAR)),
aAnchorAsCharRB (this, SW_RES(RB_ANCHOR_AS_CHAR)),
aAnchorAtFrameRB(this, SW_RES(RB_ANCHOR_FRAME)),
+ aPositionFL (this, SW_RES(FL_POSITION)),
aHorizontalFT (this, SW_RES(FT_HORIZONTAL)),
aHorizontalDLB (this, SW_RES(DLB_HORIZONTAL)),
aAtHorzPosFT (this, SW_RES(FT_AT_HORZ_POS)),
@@ -650,18 +692,21 @@ SwFrmPage::SwFrmPage ( Window *pParent, const SfxItemSet &rSet ) :
aVertRelationLB (this, SW_RES(LB_VERT_RELATION)),
// OD 19.09.2003 #i18732# - new checkbox
aFollowTextFlowCB(this, SW_RES(CB_FOLLOWTEXTFLOW)),
- aPositionFL (this, SW_RES(FL_POSITION)),
aExampleWN (this, SW_RES(WN_BSP)),
bAtHorzPosModified( sal_False ),
bAtVertPosModified( sal_False ),
-
bFormat(sal_False),
bNew(sal_True),
bNoModifyHdl(sal_True),
- bVerticalChanged(sal_False),
+ // --> OD 2009-08-31 #mongolianlayout# - no used
+// bVerticalChanged(FALSE),
+ // <--
bIsVerticalFrame(sal_False),
+ // --> OD 2009-08-31 #mongolianlayou#
+ bIsVerticalL2R(sal_False),
+ // <--
bIsInRightToLeft(sal_False),
bHtmlMode(sal_False),
nHtmlMode(0),
@@ -685,6 +730,8 @@ SwFrmPage::SwFrmPage ( Window *pParent, const SfxItemSet &rSet ) :
FreeResource();
SetExchangeSupport();
+ aRealSizeBT.SetAccessibleRelationMemberOf(&aSizeFL);
+
Link aLk = LINK(this, SwFrmPage, RangeModifyHdl);
aWidthED. SetLoseFocusHdl( aLk );
aHeightED. SetLoseFocusHdl( aLk );
@@ -811,7 +858,10 @@ void SwFrmPage::Reset( const SfxItemSet &rSet )
{
if (rAnchor.GetAnchorId() != FLY_AT_FLY && !pSh->IsFlyInFly())
aAnchorAtFrameRB.Hide();
- if(!bVerticalChanged && pSh->IsFrmVertical(sal_True, bIsInRightToLeft))
+ // --> OD 2009-08-31 #mongolianlayout#
+// if ( !bVerticalChanged && pSh->IsFrmVertical(sal_True, bIsInRightToLeft) )
+ if ( pSh->IsFrmVertical( sal_True, bIsInRightToLeft, bIsVerticalL2R ) )
+ // <--
{
String sHLabel = aHorizontalFT.GetText();
aHorizontalFT.SetText(aVerticalFT.GetText());
@@ -1271,7 +1321,7 @@ void SwFrmPage::InitPos(RndStdIds eId,
aAtHorzPosFT.Enable( bEnable );
aAtHorzPosED.Enable( bEnable );
- bEnable = nV == text::VertOrientation::NONE && !bFormat;
+ bEnable = nV == text::VertOrientation::NONE;
if ( !bEnable )
{
aAtVertPosED.SetValue( 0, FUNIT_TWIP );
@@ -1323,7 +1373,12 @@ sal_uInt16 SwFrmPage::FillPosLB(const FrmMap* _pMap,
// if (!bFormat || (pMap[i].eStrId != SwFPos::FROMLEFT && pMap[i].eStrId != SwFPos::FROMTOP))
{
SvxSwFramePosString::StringId eStrId = aMirrorPagesCB.IsChecked() ? _pMap[i].eMirrorStrId : _pMap[i].eStrId;
- eStrId = lcl_ChangeResIdToVerticalOrRTL(eStrId, bIsVerticalFrame, bIsInRightToLeft);
+ // --> OD 2009-08-31 #mongolianlayout#
+ eStrId = lcl_ChangeResIdToVerticalOrRTL( eStrId,
+ bIsVerticalFrame,
+ bIsVerticalL2R,
+ bIsInRightToLeft);
+ // <--
String sEntry(aFramePosString.GetString(eStrId));
if (_rLB.GetEntryPos(sEntry) == LISTBOX_ENTRY_NOTFOUND)
{
@@ -1387,7 +1442,13 @@ sal_uLong SwFrmPage::FillRelLB( const FrmMap* _pMap,
{
SvxSwFramePosString::StringId sStrId1 = aAsCharRelationMap[nRelPos].eStrId;
- sStrId1 = lcl_ChangeResIdToVerticalOrRTL(sStrId1, bIsVerticalFrame, bIsInRightToLeft);
+ // --> OD 2009-08-31 #mongolianlayout#
+ sStrId1 =
+ lcl_ChangeResIdToVerticalOrRTL( sStrId1,
+ bIsVerticalFrame,
+ bIsVerticalL2R,
+ bIsInRightToLeft);
+ // <--
String sEntry = aFramePosString.GetString(sStrId1);
sal_uInt16 nPos = _rLB.InsertEntry(sEntry);
_rLB.SetEntryData(nPos, &aAsCharRelationMap[nRelPos]);
@@ -1447,7 +1508,13 @@ sal_uLong SwFrmPage::FillRelLB( const FrmMap* _pMap,
{
SvxSwFramePosString::StringId eStrId1 = aMirrorPagesCB.IsChecked() ?
aRelationMap[nRelPos].eMirrorStrId : aRelationMap[nRelPos].eStrId;
- eStrId1 = lcl_ChangeResIdToVerticalOrRTL(eStrId1, bIsVerticalFrame, bIsInRightToLeft);
+ // --> OD 2009-08-31 #mongolianlayout#
+ eStrId1 =
+ lcl_ChangeResIdToVerticalOrRTL( eStrId1,
+ bIsVerticalFrame,
+ bIsVerticalL2R,
+ bIsInRightToLeft);
+ // <--
String sEntry = aFramePosString.GetString(eStrId1);
sal_uInt16 nPos = _rLB.InsertEntry(sEntry);
_rLB.SetEntryData(nPos, &aRelationMap[nRelPos]);
@@ -2354,6 +2421,8 @@ SwGrfExtPage::SwGrfExtPage(Window *pParent, const SfxItemSet &rSet) :
{
FreeResource();
+ aBrowseBT.SetAccessibleRelationMemberOf(&aConnectFL);
+
SetExchangeSupport();
aMirrorHorzBox.SetClickHdl( LINK(this, SwGrfExtPage, MirrorHdl));
aMirrorVertBox.SetClickHdl( LINK(this, SwGrfExtPage, MirrorHdl));
@@ -2865,7 +2934,8 @@ void lcl_Move(Window& rWin, sal_Int32 nDiff)
SwFrmAddPage::SwFrmAddPage(Window *pParent, const SfxItemSet &rSet ) :
SfxTabPage(pParent, SW_RES(TP_FRM_ADD), rSet),
-
+
+ aNamesFL (this, SW_RES(FL_NAME)),
aNameFT (this, SW_RES(FT_NAME)),
aNameED (this, SW_RES(ED_NAME)),
aAltNameFT (this, SW_RES(FT_ALT_NAME)),
@@ -2874,20 +2944,18 @@ SwFrmAddPage::SwFrmAddPage(Window *pParent, const SfxItemSet &rSet ) :
aPrevLB (this, SW_RES(LB_PREV)),
aNextFT (this, SW_RES(FT_NEXT)),
aNextLB (this, SW_RES(LB_NEXT)),
- aNamesFL (this, SW_RES(FL_NAME)),
+ aProtectFL (this, SW_RES(FL_PROTECT)),
aProtectContentCB (this, SW_RES(CB_PROTECT_CONTENT)),
aProtectFrameCB (this, SW_RES(CB_PROTECT_FRAME)),
aProtectSizeCB (this, SW_RES(CB_PROTECT_SIZE)),
- aProtectFL (this, SW_RES(FL_PROTECT)),
+ aExtFL (this, SW_RES(FL_EXT)),
aEditInReadonlyCB (this, SW_RES(CB_EDIT_IN_READONLY)),
aPrintFrameCB (this, SW_RES(CB_PRINT_FRAME)),
aTextFlowFT (this, SW_RES(FT_TEXTFLOW)),
aTextFlowLB (this, SW_RES(LB_TEXTFLOW)),
- aExtFL (this, SW_RES(FL_EXT)),
-
pWrtSh(0),
nDlgType(0),
diff --git a/sw/source/ui/inc/bookmark.hxx b/sw/source/ui/inc/bookmark.hxx
index 767ab14963..28257380a6 100644
--- a/sw/source/ui/inc/bookmark.hxx
+++ b/sw/source/ui/inc/bookmark.hxx
@@ -65,8 +65,8 @@ public:
class SwInsertBookmarkDlg: public SvxStandardDialog
{
- BookmarkCombo aBookmarkBox;
FixedLine aBookmarkFl;
+ BookmarkCombo aBookmarkBox;
OKButton aOkBtn;
CancelButton aCancelBtn;
PushButton aDeleteBtn;
diff --git a/sw/source/ui/inc/break.hxx b/sw/source/ui/inc/break.hxx
index b56826d223..ad20c90e05 100644
--- a/sw/source/ui/inc/break.hxx
+++ b/sw/source/ui/inc/break.hxx
@@ -50,6 +50,7 @@ class SwWrtShell;
class SwBreakDlg: public SvxStandardDialog
{
SwWrtShell &rSh;
+ FixedLine aBreakFL;
RadioButton aLineBtn;
RadioButton aColumnBtn;
RadioButton aPageBtn;
@@ -57,7 +58,6 @@ class SwBreakDlg: public SvxStandardDialog
ListBox aPageCollBox;
CheckBox aPageNumBox;
NumericField aPageNumEdit;
- FixedLine aBreakFL;
OKButton aOkBtn;
CancelButton aCancelBtn;
diff --git a/sw/source/ui/inc/column.hxx b/sw/source/ui/inc/column.hxx
index 3f3e5e834c..193bfe0ef7 100644
--- a/sw/source/ui/inc/column.hxx
+++ b/sw/source/ui/inc/column.hxx
@@ -122,13 +122,14 @@ class ColumnValueSet : public ValueSet
--------------------------------------------------------------------*/
class SwColumnPage : public SfxTabPage
{
+ FixedLine aFLGroup;
FixedText aClNrLbl;
NumericField aCLNrEdt;
ColumnValueSet aDefaultVS;
ImageList aPreColsIL;
CheckBox aBalanceColsCB;
- FixedLine aFLGroup;
+ FixedLine aFLLayout;
ImageButton aBtnUp;
FixedText aColumnFT;
FixedText aWidthFT;
@@ -144,15 +145,14 @@ class SwColumnPage : public SfxTabPage
ImageButton aBtnDown;
CheckBox aAutoWidthBox;
- FixedLine aFLLayout;
+ FixedLine aFLLineType;
FixedText aLineTypeLbl;
LineListBox aLineTypeDLB;
FixedText aLineHeightLbl;
MetricField aLineHeightEdit;
FixedText aLinePosLbl;
ListBox aLinePosDLB;
- FixedLine aFLLineType;
FixedLine aVertFL;
FixedLine aPropertiesFL;
diff --git a/sw/source/ui/inc/docstdlg.hxx b/sw/source/ui/inc/docstdlg.hxx
index da19053796..d0efa37179 100644
--- a/sw/source/ui/inc/docstdlg.hxx
+++ b/sw/source/ui/inc/docstdlg.hxx
@@ -55,22 +55,21 @@ protected:
DECL_LINK( UpdateHdl, PushButton*);
private:
- FixedText aTableLbl;
- FixedText aGrfLbl;
- FixedText aOLELbl;
FixedText aPageLbl;
- FixedText aParaLbl;
- FixedText aWordLbl;
- FixedText aCharLbl;
- FixedText aLineLbl;
-
+ FixedInfo aPageNo;
+ FixedText aTableLbl;
FixedInfo aTableNo;
+ FixedText aGrfLbl;
FixedInfo aGrfNo;
+ FixedText aOLELbl;
FixedInfo aOLENo;
- FixedInfo aPageNo;
+ FixedText aParaLbl;
FixedInfo aParaNo;
+ FixedText aWordLbl;
FixedInfo aWordNo;
+ FixedText aCharLbl;
FixedInfo aCharNo;
+ FixedText aLineLbl;
FixedInfo aLineNo;
PushButton aUpdatePB;
diff --git a/sw/source/ui/inc/drpcps.hxx b/sw/source/ui/inc/drpcps.hxx
index 663c3a8edc..62df044473 100644
--- a/sw/source/ui/inc/drpcps.hxx
+++ b/sw/source/ui/inc/drpcps.hxx
@@ -72,6 +72,7 @@ class SwDropCapsPage : public SfxTabPage
{
friend class SwDropCapsPict;
+ FixedLine aSettingsFL;
CheckBox aDropCapsBox;
CheckBox aWholeWordCB;
FixedText aSwitchText;
@@ -80,13 +81,12 @@ friend class SwDropCapsPict;
NumericField aLinesField;
FixedText aDistanceText;
MetricField aDistanceField;
- FixedLine aSettingsFL;
+ FixedLine aContentFL;
FixedText aTextText;
Edit aTextEdit;
FixedText aTemplateText;
ListBox aTemplateBox;
- FixedLine aContentFL;
SwDropCapsPict *pPict;
diff --git a/sw/source/ui/inc/frmmgr.hxx b/sw/source/ui/inc/frmmgr.hxx
index 631f57297b..372055d755 100644
--- a/sw/source/ui/inc/frmmgr.hxx
+++ b/sw/source/ui/inc/frmmgr.hxx
@@ -65,6 +65,9 @@ class SW_DLLPUBLIC SwFlyFrmAttrMgr
sal_Bool bAbsPos,
bNewFrm;
sal_Bool bIsInVertical;
+ // --> OD 2009-09-01 #mongolianlayout#
+ sal_Bool bIsInVerticalL2R;
+ // <--
// interne Verrechnung fuer Umrandung
SW_DLLPRIVATE SwTwips CalcTopSpace();
diff --git a/sw/source/ui/inc/frmpage.hxx b/sw/source/ui/inc/frmpage.hxx
index db31fed85a..5706b8a912 100644
--- a/sw/source/ui/inc/frmpage.hxx
+++ b/sw/source/ui/inc/frmpage.hxx
@@ -54,6 +54,7 @@ struct SwPosition;
class SwFrmPage: public SfxTabPage
{
// Size
+ FixedLine aSizeFL;
FixedText aWidthFT;
FixedText aWidthAutoFT;
PercentField aWidthED;
@@ -66,11 +67,10 @@ class SwFrmPage: public SfxTabPage
CheckBox aAutoHeightCB;
CheckBox aFixedRatioCB;
PushButton aRealSizeBT;
- FixedLine aSizeFL;
// Anker
- FixedLine aTypeFL;
FixedLine aTypeSepFL;
+ FixedLine aTypeFL;
RadioButton aAnchorAtPageRB;
RadioButton aAnchorAtParaRB;
RadioButton aAnchorAtCharRB;
@@ -78,6 +78,7 @@ class SwFrmPage: public SfxTabPage
RadioButton aAnchorAtFrameRB;
// Position
+ FixedLine aPositionFL;
FixedText aHorizontalFT;
ListBox aHorizontalDLB;
FixedText aAtHorzPosFT;
@@ -93,7 +94,6 @@ class SwFrmPage: public SfxTabPage
ListBox aVertRelationLB;
// OD 02.10.2003 #i18732# - check box for new option 'FollowTextFlow'
CheckBox aFollowTextFlowCB;
- FixedLine aPositionFL;
// Example
SvxSwFrameExample aExampleWN;
@@ -109,6 +109,9 @@ class SwFrmPage: public SfxTabPage
sal_Bool bNoModifyHdl;
sal_Bool bVerticalChanged; //check done whether frame is in vertical environment
sal_Bool bIsVerticalFrame; //current frame is in vertical environment - strings are exchanged
+ // --> OD 2009-08-31 #mongolianlayou#
+ sal_Bool bIsVerticalL2R;
+ // <--
sal_Bool bIsInRightToLeft; // current frame is in right-to-left environment - strings are exchanged
sal_Bool bHtmlMode;
sal_uInt16 nHtmlMode;
@@ -286,6 +289,7 @@ public:
class SwFrmAddPage : public SfxTabPage
{
+ FixedLine aNamesFL;
FixedText aNameFT;
Edit aNameED;
FixedText aAltNameFT;
@@ -294,19 +298,18 @@ class SwFrmAddPage : public SfxTabPage
ListBox aPrevLB;
FixedText aNextFT;
ListBox aNextLB;
- FixedLine aNamesFL;
+ FixedLine aProtectFL;
CheckBox aProtectContentCB;
CheckBox aProtectFrameCB;
CheckBox aProtectSizeCB;
- FixedLine aProtectFL;
+ FixedLine aExtFL;
CheckBox aEditInReadonlyCB;
CheckBox aPrintFrameCB;
FixedText aTextFlowFT;
ListBox aTextFlowLB;
- FixedLine aExtFL;
SwWrtShell* pWrtSh;
diff --git a/sw/source/ui/inc/glosbib.hxx b/sw/source/ui/inc/glosbib.hxx
index 82228bdaa5..f9dcd54ace 100644
--- a/sw/source/ui/inc/glosbib.hxx
+++ b/sw/source/ui/inc/glosbib.hxx
@@ -74,9 +74,11 @@ public:
class SwGlossaryGroupDlg : public SvxStandardDialog
{
-
+ FixedText aBibFT;
FEdit aNameED;
+ FixedText aPathFT;
ListBox aPathLB;
+ FixedText aSelectFT;
SwGlossaryGroupTLB aGroupTLB;
OKButton aOkPB;
@@ -85,9 +87,6 @@ class SwGlossaryGroupDlg : public SvxStandardDialog
PushButton aNewPB;
PushButton aDelPB;
PushButton aRenamePB;
- FixedText aBibFT;
- FixedText aPathFT;
- FixedText aSelectFT;
SvStrings* pRemovedArr;
SvStrings* pInsertedArr;
diff --git a/sw/source/ui/inc/insfnote.hxx b/sw/source/ui/inc/insfnote.hxx
index 87e429f9ff..908d2cca5e 100644
--- a/sw/source/ui/inc/insfnote.hxx
+++ b/sw/source/ui/inc/insfnote.hxx
@@ -48,18 +48,18 @@ class SwInsFootNoteDlg: public SvxStandardDialog
String aFontName;
CharSet eCharSet;
char cExtChar;
- sal_Bool bExtCharAvailable;
- sal_Bool bEdit;
+ sal_Bool bExtCharAvailable;
+ sal_Bool bEdit;
+ FixedLine aNumberFL;
RadioButton aNumberAutoBtn;
RadioButton aNumberCharBtn;
Edit aNumberCharEdit;
PushButton aNumberExtChar;
- FixedLine aNumberFL;
//Alles fuer die Auswahl Fussnote/Endnote
+ FixedLine aTypeFL;
RadioButton aFtnBtn;
RadioButton aEndNoteBtn;
- FixedLine aTypeFL;
OKButton aOkBtn;
CancelButton aCancelBtn;
diff --git a/sw/source/ui/inc/linenum.hxx b/sw/source/ui/inc/linenum.hxx
index 7b90413f5d..007d3ae0e1 100644
--- a/sw/source/ui/inc/linenum.hxx
+++ b/sw/source/ui/inc/linenum.hxx
@@ -66,6 +66,7 @@ public:
class SwLineNumberingPage : public SfxTabPage
{
CheckBox aNumberingOnCB;
+ FixedLine aDisplayFL;
FixedText aCharStyleFT;
ListBox aCharStyleLB;
FixedText aFormatFT;
@@ -77,17 +78,16 @@ class SwLineNumberingPage : public SfxTabPage
FixedText aNumIntervalFT;
NumericField aNumIntervalNF;
FixedText aNumRowsFT;
- FixedLine aDisplayFL;
+ FixedLine aDivisorFL;
FixedText aDivisorFT;
Edit aDivisorED;
FixedText aDivIntervalFT;
NumericField aDivIntervalNF;
FixedText aDivRowsFT;
- FixedLine aDivisorFL;
+ FixedLine aCountFL;
CheckBox aCountEmptyLinesCB;
CheckBox aCountFrameLinesCB;
CheckBox aRestartEachPageCB;
- FixedLine aCountFL;
SwWrtShell* pSh;
diff --git a/sw/source/ui/inc/num.hxx b/sw/source/ui/inc/num.hxx
index 5b2a1121b5..4234eff998 100644
--- a/sw/source/ui/inc/num.hxx
+++ b/sw/source/ui/inc/num.hxx
@@ -82,13 +82,13 @@ struct SwBmpItemInfo
--------------------------------------------------*/
class SwNumPositionTabPage : public SfxTabPage
{
- FixedLine aPositionFL;
- FixedLine aLevelFL;
+ FixedLine aLevelFL;
MultiListBox aLevelLB;
// --> OD 2008-02-01 #newlistlevelattrs#
// former set of controls shown for numbering rules containing list level
// attributes in SvxNumberFormat::SvxNumPositionAndSpaceMode == LABEL_WIDTH_AND_POSITION
+ FixedLine aPositionFL;
FixedText aDistBorderFT;
MetricField aDistBorderMF;
CheckBox aRelativeCB;
diff --git a/sw/source/ui/inc/numpara.hxx b/sw/source/ui/inc/numpara.hxx
index d292764ee6..2936a57077 100644
--- a/sw/source/ui/inc/numpara.hxx
+++ b/sw/source/ui/inc/numpara.hxx
@@ -48,10 +48,10 @@ class SwParagraphNumTabPage : public SfxTabPage
FixedText aOutlineLvFT;
ListBox aOutlineLvLB;
+ FixedLine aNewStartFL;
FixedText aNumberStyleFT;
ListBox aNumberStyleLB;
- FixedLine aNewStartFL;
TriStateBox aNewStartCB;
TriStateBox aNewStartNumberCB;
NumericField aNewStartNF;
diff --git a/sw/source/ui/inc/optpage.hxx b/sw/source/ui/inc/optpage.hxx
index c2aa3c574b..410b43867b 100644
--- a/sw/source/ui/inc/optpage.hxx
+++ b/sw/source/ui/inc/optpage.hxx
@@ -135,11 +135,11 @@ class SwAddPrinterTabPage : public SfxTabPage
FixedLine aSeparatorRFL;
+ FixedLine aFL3;
RadioButton aNoRB;
RadioButton aOnlyRB;
RadioButton aEndRB;
RadioButton aEndPageRB;
- FixedLine aFL3;
FixedLine aFL4;
CheckBox aPrintEmptyPagesCB;
// CheckBox aSingleJobsCB;
diff --git a/sw/source/ui/inc/outline.hxx b/sw/source/ui/inc/outline.hxx
index 644fea3f93..9c329ed5c2 100644
--- a/sw/source/ui/inc/outline.hxx
+++ b/sw/source/ui/inc/outline.hxx
@@ -104,9 +104,10 @@ class SwOutlineTabDialog : public SfxTabDialog
* --------------------------------------------------*/
class SwOutlineSettingsTabPage : public SfxTabPage
{
- ListBox aLevelLB;
FixedLine aLevelFL;
+ ListBox aLevelLB;
+ FixedLine aNumberFL;
FixedText aCollLbl;
ListBox aCollBox;
FixedText aNumberLbl;
@@ -122,7 +123,6 @@ class SwOutlineSettingsTabPage : public SfxTabPage
Edit aSuffixED;
FixedText aStartLbl;
NumericField aStartEdit;
- FixedLine aNumberFL;
NumberingPreview aPreviewWIN;
String aNoFmtName;
diff --git a/sw/source/ui/inc/pgfnote.hxx b/sw/source/ui/inc/pgfnote.hxx
index bfff36b339..30b5db07ee 100644
--- a/sw/source/ui/inc/pgfnote.hxx
+++ b/sw/source/ui/inc/pgfnote.hxx
@@ -59,13 +59,14 @@ private:
SwFootNotePage(Window *pParent, const SfxItemSet &rSet);
~SwFootNotePage();
+ FixedLine aPosHeader;
RadioButton aMaxHeightPageBtn;
RadioButton aMaxHeightBtn;
MetricField aMaxHeightEdit;
FixedText aDistLbl;
MetricField aDistEdit;
- FixedLine aPosHeader;
+ FixedLine aLineHeader;
FixedText aLinePosLbl;
ListBox aLinePosBox;
FixedText aLineTypeLbl;
@@ -74,7 +75,6 @@ private:
MetricField aLineWidthEdit;
FixedText aLineDistLbl;
MetricField aLineDistEdit;
- FixedLine aLineHeader;
DECL_LINK( HeightPage, Button * );
DECL_LINK( HeightMetric, Button * );
diff --git a/sw/source/ui/inc/rowht.hxx b/sw/source/ui/inc/rowht.hxx
index 5e6e6502bc..a9005eea53 100644
--- a/sw/source/ui/inc/rowht.hxx
+++ b/sw/source/ui/inc/rowht.hxx
@@ -49,9 +49,9 @@ class SwWrtShell;
class SwTableHeightDlg : public SvxStandardDialog
{
+ FixedLine aHeightFL;
MetricField aHeightEdit;
CheckBox aAutoHeightCB;
- FixedLine aHeightFL;
OKButton aOKBtn;
CancelButton aCancelBtn;
HelpButton aHelpBtn;
diff --git a/sw/source/ui/inc/split.hxx b/sw/source/ui/inc/split.hxx
index 2ffe470197..68f5049aed 100644
--- a/sw/source/ui/inc/split.hxx
+++ b/sw/source/ui/inc/split.hxx
@@ -49,13 +49,13 @@ class SwWrtShell;
class SwSplitTableDlg : public SvxStandardDialog
{
+ FixedLine aCountFL;
FixedText aCountLbl;
NumericField aCountEdit;
- FixedLine aCountFL;
+ FixedLine aDirFL;
ImageRadioButton aHorzBox;
ImageRadioButton aVertBox;
CheckBox aPropCB;
- FixedLine aDirFL;
OKButton aOKBtn;
CancelButton aCancelBtn;
HelpButton aHelpBtn;
diff --git a/sw/source/ui/inc/srtdlg.hxx b/sw/source/ui/inc/srtdlg.hxx
index bf3fd1341f..2ae34bd461 100644
--- a/sw/source/ui/inc/srtdlg.hxx
+++ b/sw/source/ui/inc/srtdlg.hxx
@@ -51,7 +51,7 @@ class SwSortDlg : public SvxStandardDialog
FixedText aTypLbl;
FixedText aDirLbl;
- FixedLine aDirFL;
+ FixedLine aSortFL;
CheckBox aKeyCB1;
NumericField aColEdt1;
@@ -71,7 +71,7 @@ class SwSortDlg : public SvxStandardDialog
RadioButton aSortUp3RB;
RadioButton aSortDn3RB;
- FixedLine aSortFL;
+ FixedLine aDirFL;
RadioButton aColumnRB;
RadioButton aRowRB;
diff --git a/sw/source/ui/inc/swrenamexnameddlg.hxx b/sw/source/ui/inc/swrenamexnameddlg.hxx
index b4dbfaed74..7c919c9376 100644
--- a/sw/source/ui/inc/swrenamexnameddlg.hxx
+++ b/sw/source/ui/inc/swrenamexnameddlg.hxx
@@ -50,9 +50,9 @@
* --------------------------------------------------*/
class SwRenameXNamedDlg : public ModalDialog
{
+ FixedLine aNameFL;
FixedText aNewNameFT;
NoSpaceEdit aNewNameED;
- FixedLine aNameFL;
OKButton aOk;
CancelButton aCancel;
HelpButton aHelp;
diff --git a/sw/source/ui/inc/swuicnttab.hxx b/sw/source/ui/inc/swuicnttab.hxx
index 8b54b7a0ea..213b10d856 100644
--- a/sw/source/ui/inc/swuicnttab.hxx
+++ b/sw/source/ui/inc/swuicnttab.hxx
@@ -188,6 +188,7 @@ class SwTOXSelectTabPage : public SfxTabPage
//
//index only
+ FixedLine aIdxOptionsFL;
CheckBox aCollectSameCB;
CheckBox aUseFFCB;
CheckBox aUseDashCB;
@@ -196,7 +197,6 @@ class SwTOXSelectTabPage : public SfxTabPage
CheckBox aKeyAsEntryCB;
CheckBox aFromFileCB;
MenuButton aAutoMarkPB;
- FixedLine aIdxOptionsFL; // index only
// object only
SwOLENames aFromNames;
@@ -363,6 +363,7 @@ class SwTOXEntryTabPage : public SfxTabPage
FixedText aLevelFT;
SwIdxTreeListBox aLevelLB;
+ FixedLine aEntryFL;
FixedText aTokenFT;
SwTokenWindow aTokenWIN;
PushButton aAllLevelsPB;
@@ -395,14 +396,13 @@ class SwTOXEntryTabPage : public SfxTabPage
FixedText aTabPosFT;
MetricField aTabPosMF; // tab stop position
CheckBox aAutoRightCB;
- FixedLine aEntryFL;
+ FixedLine aFormatFL;
CheckBox aRelToStyleCB; // position relative to the right margin of the para style
FixedText aMainEntryStyleFT;
ListBox aMainEntryStyleLB; // character style of main entries in indexes
CheckBox aAlphaDelimCB;
CheckBox aCommaSeparatedCB;
- FixedLine aFormatFL;
RadioButton aSortDocPosRB;
RadioButton aSortContentRB;
@@ -492,14 +492,14 @@ public:
--------------------------------------------------*/
class SwTOXStylesTabPage : public SfxTabPage
{
+ FixedLine aFormatFL;
FixedText aLevelFT2;
ListBox aLevelLB;
+ ImageButton aAssignBT;
FixedText aTemplateFT;
ListBox aParaLayLB;
PushButton aStdBT;
- ImageButton aAssignBT;
PushButton aEditStyleBT;
- FixedLine aFormatFL;
SwForm* m_pCurrentForm;
// void UpdatePattern();
diff --git a/sw/source/ui/inc/swuiidxmrk.hxx b/sw/source/ui/inc/swuiidxmrk.hxx
index 779d504a00..a6fee5ae4e 100644
--- a/sw/source/ui/inc/swuiidxmrk.hxx
+++ b/sw/source/ui/inc/swuiidxmrk.hxx
@@ -71,6 +71,7 @@ class SwIndexMarkDlg : public Window
{
friend class SwIndexMarkFloatDlg;
friend class SwIndexMarkModalDlg;
+ FixedLine aIndexFL;
FixedText aTypeFT;
ListBox aTypeDCB;
ImageButton aNewBT;
@@ -97,7 +98,6 @@ class SwIndexMarkDlg : public Window
CheckBox aSearchCaseSensitiveCB;
CheckBox aSearchCaseWordOnlyCB;
- FixedLine aIndexFL;
OKButton aOKBT;
CancelButton aCancelBT;
diff --git a/sw/source/ui/inc/tautofmt.hxx b/sw/source/ui/inc/tautofmt.hxx
index bb5df4a841..7fec212497 100644
--- a/sw/source/ui/inc/tautofmt.hxx
+++ b/sw/source/ui/inc/tautofmt.hxx
@@ -63,12 +63,12 @@ class SwAutoFormatDlg : public SfxModalDialog
{
FixedLine aFlFormat;
ListBox aLbFormat;
+ FixedLine aFlFormats;
CheckBox aBtnNumFormat;
CheckBox aBtnBorder;
CheckBox aBtnFont;
CheckBox aBtnPattern;
CheckBox aBtnAlignment;
- FixedLine aFlFormats;
OKButton aBtnOk;
CancelButton aBtnCancel;
HelpButton aBtnHelp;
diff --git a/sw/source/ui/inc/view.hxx b/sw/source/ui/inc/view.hxx
index 7ad42b5d81..f4a11ccdfd 100644
--- a/sw/source/ui/inc/view.hxx
+++ b/sw/source/ui/inc/view.hxx
@@ -494,6 +494,7 @@ public:
void SetVisArea( const Point&, sal_Bool bUpdateScrollbar = sal_True);
void CheckVisArea();
+ void RecheckBrowseMode();
static LAYOUT_NS Dialog* GetSearchDialog();
static sal_uInt16 GetMoveType();
diff --git a/sw/source/ui/inc/wrtsh.hxx b/sw/source/ui/inc/wrtsh.hxx
index f1e82a1d4c..03b5f8eb61 100644
--- a/sw/source/ui/inc/wrtsh.hxx
+++ b/sw/source/ui/inc/wrtsh.hxx
@@ -452,6 +452,8 @@ typedef sal_Bool (SwWrtShell:: *FNSimpleMove)();
// die Core erzeugt eine Selektion, das SttSelect muss gerufen werden
virtual void NewCoreSelection();
+ virtual void ApplyViewOptions( const SwViewOption &rOpt );
+
// autom. Update von Vorlagen
void AutoUpdateFrame(SwFrmFmt* pFmt, const SfxItemSet& rStyleSet);
void AutoUpdatePara(SwTxtFmtColl* pColl, const SfxItemSet& rStyleSet);
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 87ec19bca1..2ccb0a498f 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -374,6 +374,8 @@ SwMultiTOXTabDialog::SwMultiTOXTabDialog(Window* pParent, const SfxItemSet& rSet
aShowExampleCB.SetClickHdl(LINK(this, SwMultiTOXTabDialog, ShowPreviewHdl));
aShowExampleCB.Check( SW_MOD()->GetModuleConfig()->IsShowIndexPreview());
+
+ aExampleContainerWIN.SetAccessibleName(aShowExampleCB.GetText());
SetViewAlign( WINDOWALIGN_LEFT );
// SetViewWindow does not work if the dialog is visible!
@@ -807,6 +809,10 @@ SwAddStylesDlg_Impl::SwAddStylesDlg_Impl(Window* pParent,
{
FreeResource();
+ aHeaderTree.SetAccessibleRelationMemberOf(&aStylesFL);
+ aLeftPB.SetAccessibleRelationMemberOf(&aStylesFL);
+ aRightPB.SetAccessibleRelationMemberOf(&aStylesFL);
+
aLeftPB.SetModeImage( Image( SW_RES( IMG_ALL_LEFT_HC ) ), BMP_COLOR_HIGHCONTRAST );
aRightPB.SetModeImage( Image( SW_RES( IMG_ALL_RIGHT_HC ) ), BMP_COLOR_HIGHCONTRAST );
@@ -985,6 +991,7 @@ SwTOXSelectTabPage::SwTOXSelectTabPage(Window* pParent, const SfxItemSet& rAttrS
aTOXMarksCB( this, SW_RES(CB_TOXMARKS )),
+ aIdxOptionsFL( this, SW_RES(FL_IDXOPTIONS )),
aCollectSameCB( this, SW_RES(CB_COLLECTSAME )),
aUseFFCB( this, SW_RES(CB_USEFF )),
aUseDashCB( this, SW_RES(CB_USE_DASH )),
@@ -993,7 +1000,6 @@ SwTOXSelectTabPage::SwTOXSelectTabPage(Window* pParent, const SfxItemSet& rAttrS
aKeyAsEntryCB( this, SW_RES(CB_KEYASENTRY )),
aFromFileCB( this, SW_RES(CB_FROMFILE )),
aAutoMarkPB( this, SW_RES(MB_AUTOMARK )),
- aIdxOptionsFL( this, SW_RES(FL_IDXOPTIONS )),
aFromNames( SW_RES(RES_SRCTYPES )),
aFromObjCLB( this, SW_RES(CLB_FROMOBJ )),
@@ -1017,6 +1023,11 @@ SwTOXSelectTabPage::SwTOXSelectTabPage(Window* pParent, const SfxItemSet& rAttrS
bFirstCall(sal_True)
{
aBracketLB.InsertEntry(String(SW_RES(ST_NO_BRACKET)), 0);
+
+ aAddStylesPB.SetAccessibleRelationMemberOf(&aCreateFromFL);
+ aAddStylesPB.SetAccessibleRelationLabeledBy(&aAddStylesCB);
+ aAddStylesPB.SetAccessibleName(aAddStylesCB.GetText());
+
FreeResource();
pIndexEntryWrapper = new IndexEntrySupplierWrapper();
@@ -2053,6 +2064,7 @@ SwTOXEntryTabPage::SwTOXEntryTabPage(Window* pParent, const SfxItemSet& rAttrSet
SfxTabPage(pParent, SW_RES(TP_TOX_ENTRY), rAttrSet),
aLevelFT(this, SW_RES(FT_LEVEL )),
aLevelLB(this, SW_RES(LB_LEVEL )),
+ aEntryFL(this, SW_RES(FL_ENTRY )),
aTokenFT(this, SW_RES(FT_TOKEN )),
aTokenWIN(this, SW_RES(WIN_TOKEN )),
@@ -2086,14 +2098,14 @@ SwTOXEntryTabPage::SwTOXEntryTabPage(Window* pParent, const SfxItemSet& rAttrSet
aTabPosFT(this, SW_RES(FT_TABPOS )),
aTabPosMF(this, SW_RES(MF_TABPOS )),
aAutoRightCB(this, SW_RES(CB_AUTORIGHT )),
- aEntryFL(this, SW_RES(FL_ENTRY )),
+ aFormatFL(this, SW_RES(FL_FORMAT )),
+
aRelToStyleCB(this, SW_RES(CB_RELTOSTYLE )),
aMainEntryStyleFT(this, SW_RES(FT_MAIN_ENTRY_STYLE)),
aMainEntryStyleLB(this, SW_RES(LB_MAIN_ENTRY_STYLE)),
aAlphaDelimCB(this, SW_RES(CB_ALPHADELIM )),
aCommaSeparatedCB(this, SW_RES(CB_COMMASEPARATED )),
- aFormatFL(this, SW_RES(FL_FORMAT )),
aSortDocPosRB(this, SW_RES(RB_DOCPOS )),
aSortContentRB(this, SW_RES(RB_SORTCONTENT )),
@@ -2124,6 +2136,16 @@ SwTOXEntryTabPage::SwTOXEntryTabPage(Window* pParent, const SfxItemSet& rAttrSet
m_pCurrentForm(0),
bInLevelHdl(sal_False)
{
+ aEditStylePB.SetAccessibleRelationMemberOf(&aEntryFL);
+ aHyperLinkPB.SetAccessibleRelationMemberOf(&aEntryFL);
+ aPageNoPB.SetAccessibleRelationMemberOf(&aEntryFL);
+ aTabPB.SetAccessibleRelationMemberOf(&aEntryFL);
+ aEntryPB.SetAccessibleRelationMemberOf(&aEntryFL);
+ aEntryNoPB.SetAccessibleRelationMemberOf(&aEntryFL);
+ aAllLevelsPB.SetAccessibleRelationMemberOf(&aEntryFL);
+ aTokenWIN.SetAccessibleRelationMemberOf(&aEntryFL);
+ aTokenWIN.SetAccessibleRelationLabeledBy(&aTokenFT);
+
Image aSortUpHC(SW_RES(IMG_SORTUP_HC ));
aFirstSortUpRB.SetModeRadioImage(aSortUpHC,BMP_COLOR_HIGHCONTRAST);
aSecondSortUpRB.SetModeRadioImage(aSortUpHC,BMP_COLOR_HIGHCONTRAST);
@@ -3912,17 +3934,18 @@ void SwTokenWindow::GetFocus()
* --------------------------------------------------*/
SwTOXStylesTabPage::SwTOXStylesTabPage(Window* pParent, const SfxItemSet& rAttrSet ) :
SfxTabPage(pParent, SW_RES(TP_TOX_STYLES), rAttrSet),
+ aFormatFL(this, SW_RES(FL_FORMAT )),
aLevelFT2(this, SW_RES(FT_LEVEL )),
aLevelLB(this, SW_RES(LB_LEVEL )),
+ aAssignBT(this, SW_RES(BT_ASSIGN )),
aTemplateFT(this, SW_RES(FT_TEMPLATE)),
aParaLayLB(this, SW_RES(LB_PARALAY )),
aStdBT(this, SW_RES(BT_STD )),
- aAssignBT(this, SW_RES(BT_ASSIGN )),
aEditStyleBT(this, SW_RES(BT_EDIT_STYLE )),
- aFormatFL(this, SW_RES(FL_FORMAT )),
m_pCurrentForm(0)
{
FreeResource();
+
SetExchangeSupport( sal_True );
aAssignBT.SetModeImage( Image( SW_RES( IMG_ONE_LEFT_HC ) ), BMP_COLOR_HIGHCONTRAST );
@@ -3933,6 +3956,11 @@ SwTOXStylesTabPage::SwTOXStylesTabPage(Window* pParent, const SfxItemSet& rAttrS
aParaLayLB.SetSelectHdl (LINK( this, SwTOXStylesTabPage, EnableSelectHdl));
aLevelLB.SetSelectHdl (LINK( this, SwTOXStylesTabPage, EnableSelectHdl));
aParaLayLB.SetDoubleClickHdl(LINK( this, SwTOXStylesTabPage, DoubleClickHdl));
+
+ aStdBT.SetAccessibleRelationMemberOf(&aFormatFL);
+ aAssignBT.SetAccessibleRelationMemberOf(&aFormatFL);
+ aEditStyleBT.SetAccessibleRelationMemberOf(&aFormatFL);
+
}
/* -----------------25.03.99 15:17-------------------
*
diff --git a/sw/source/ui/index/cnttab.hrc b/sw/source/ui/index/cnttab.hrc
index 5b80e4342b..1025cc8a2d 100644
--- a/sw/source/ui/index/cnttab.hrc
+++ b/sw/source/ui/index/cnttab.hrc
@@ -173,6 +173,7 @@
#define STR_TOKEN_HELP_AUTHORITY (STR_BUTTON_HELP_TEXT_START + 9)
#define STR_CHARSTYLE (STR_TOKEN_HELP_AUTHORITY + 1)
+
#define TLB_STYLES 100
#define FL_STYLES 101
#define PB_OK 102
diff --git a/sw/source/ui/index/cnttab.src b/sw/source/ui/index/cnttab.src
index 4532c50658..980a15dd56 100644..100755
--- a/sw/source/ui/index/cnttab.src
+++ b/sw/source/ui/index/cnttab.src
@@ -575,8 +575,8 @@ TabPage TP_TOX_ENTRY
};
Window WIN_TOKEN
{
- Pos = MAP_APPFONT ( 70, 16 ) ;
- Size = MAP_APPFONT ( 136, 12 ) ;
+ Pos = MAP_APPFONT ( 70, 15 ) ;
+ Size = MAP_APPFONT ( 136, 14 ) ;
ImageButton WIN_LEFT_SCROLL
{
HelpID = "sw:ImageButton:TP_TOX_ENTRY:WIN_LEFT_SCROLL";
@@ -1218,6 +1218,9 @@ ModalDialog DLG_ADD_IDX_STYLES
};
MaskColor = IMAGE_MASK_COLOR ;
};
+ //IAccessibility2 Implementation 2009-----
+ QuickHelpText [ en-US ] = "Left" ;
+ //-----IAccessibility2 Implementation 2009
};
ImageButton PB_RIGHT
{
@@ -1233,6 +1236,9 @@ ModalDialog DLG_ADD_IDX_STYLES
};
MaskColor = IMAGE_MASK_COLOR ;
};
+ //IAccessibility2 Implementation 2009-----
+ QuickHelpText [ en-US ] = "Right" ;
+ //-----IAccessibility2 Implementation 2009
};
FixedLine FL_STYLES
{
diff --git a/sw/source/ui/index/idxmrk.src b/sw/source/ui/index/idxmrk.src
index e0a1a4df9c..fc38d7c6d2 100644
--- a/sw/source/ui/index/idxmrk.src
+++ b/sw/source/ui/index/idxmrk.src
@@ -287,6 +287,14 @@ ModalDialog DLG_EDIT_IDXMARK
#define COL_BUTTONS_2 (COL_BUTTONS+26)
#define WINDOW_HEIGHT 118
IDX_DIALOG_WINDOW
+ #undef IDX_WIN_WIDTH
+ #undef GB_HEIGHT
+ #undef DCB_INDEX_WIDTH
+ #undef PHONETIC_HIDDEN
+ #undef LIST_WIDTH
+ #undef COL_BUTTONS
+ #undef COL_BUTTONS_2
+ #undef WINDOW_HEIGHT
};
ModalDialog DLG_EDIT_IDXMARK_CJK
{
@@ -306,6 +314,14 @@ ModalDialog DLG_EDIT_IDXMARK_CJK
#define COL_BUTTONS_2 (COL_BUTTONS+26)
#define WINDOW_HEIGHT 118
IDX_DIALOG_WINDOW
+ #undef IDX_WIN_WIDTH
+ #undef GB_HEIGHT
+ #undef DCB_INDEX_WIDTH
+ #undef PHONETIC_HIDDEN
+ #undef LIST_WIDTH
+ #undef COL_BUTTONS
+ #undef COL_BUTTONS_2
+ #undef WINDOW_HEIGHT
};
ModelessDialog DLG_INSIDXMARK
{
@@ -328,6 +344,14 @@ ModelessDialog DLG_INSIDXMARK
#define COL_BUTTONS_2 (COL_BUTTONS+26)
#define WINDOW_HEIGHT 138
IDX_DIALOG_WINDOW
+ #undef IDX_WIN_WIDTH
+ #undef GB_HEIGHT
+ #undef DCB_INDEX_WIDTH
+ #undef PHONETIC_HIDDEN
+ #undef LIST_WIDTH
+ #undef COL_BUTTONS
+ #undef COL_BUTTONS_2
+ #undef WINDOW_HEIGHT
};
ModelessDialog DLG_INSIDXMARK_CJK
{
@@ -349,6 +373,14 @@ ModelessDialog DLG_INSIDXMARK_CJK
#define COL_BUTTONS_2 (COL_BUTTONS+26)
#define WINDOW_HEIGHT 138
IDX_DIALOG_WINDOW
+ #undef IDX_WIN_WIDTH
+ #undef GB_HEIGHT
+ #undef DCB_INDEX_WIDTH
+ #undef PHONETIC_HIDDEN
+ #undef LIST_WIDTH
+ #undef COL_BUTTONS
+ #undef COL_BUTTONS_2
+ #undef WINDOW_HEIGHT
};
ModalDialog DLG_NEW_USER_IDX
{
@@ -529,6 +561,7 @@ ModalDialog DLG_EDIT_AUTHMARK
Size = MAP_APPFONT ( 218 , 118 ) ;
#define RADIO_BUTTON_HEIGHT 0
AUTH_DIALOG_WINDOW
+ #undef RADIO_BUTTON_HEIGHT
};
ModelessDialog DLG_INSAUTHMARK
{
@@ -543,6 +576,7 @@ ModelessDialog DLG_INSAUTHMARK
Size = MAP_APPFONT ( 218 , 118 + RADIO_BUTTON_HEIGHT) ;
// Moveable = TRUE ;
AUTH_DIALOG_WINDOW
+ #undef RADIO_BUTTON_HEIGHT
};
ModalDialog DLG_CREATE_AUTH_ENTRY
{
diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx
index 674ded12f8..4559882588 100644
--- a/sw/source/ui/index/swuiidxmrk.cxx
+++ b/sw/source/ui/index/swuiidxmrk.cxx
@@ -102,6 +102,7 @@ SwIndexMarkDlg::SwIndexMarkDlg(Window *pParent,
const ResId& rResId,
sal_Int32 _nOptionsId, SwWrtShell& rWrtShell ) :
Window(pParent, rResId),
+ aIndexFL(this, SW_RES(FL_INDEX )),
aTypeFT (this, SW_RES(LBL_INDEX )),
aTypeDCB(this, SW_RES(DCB_INDEX )),
aNewBT(this, SW_RES(BT_NEW )),
@@ -128,7 +129,6 @@ SwIndexMarkDlg::SwIndexMarkDlg(Window *pParent,
aSearchCaseSensitiveCB(this, SW_RES(CB_CASESENSITIVE )),
aSearchCaseWordOnlyCB(this, SW_RES(CB_WORDONLY )),
- aIndexFL(this, SW_RES(FL_INDEX )),
aOKBT(this, SW_RES(BT_OK )),
aCancelBT(this, SW_RES(BT_CANCEL )),
@@ -154,6 +154,8 @@ SwIndexMarkDlg::SwIndexMarkDlg(Window *pParent,
pTOXMgr(0),
pSh(&rWrtShell)
{
+ aNewBT.SetAccessibleRelationMemberOf(&aIndexFL);
+
if( SvtCJKOptions().IsCJKFontEnabled() )
{
uno::Reference< lang::XMultiServiceFactory > xMSF = getProcessServiceFactory();
diff --git a/sw/source/ui/lingu/hhcwrp.cxx b/sw/source/ui/lingu/hhcwrp.cxx
index 4c88093fc1..7fa9173bfb 100644..100755
--- a/sw/source/ui/lingu/hhcwrp.cxx
+++ b/sw/source/ui/lingu/hhcwrp.cxx
@@ -560,11 +560,11 @@ void SwHHCWrapper::ReplaceUnit(
if (pTargetFont && pNewUnitLanguage)
{
SvxFontItem aFontItem = (SvxFontItem&) aSet.Get( RES_CHRATR_CJK_FONT );
- aFontItem.GetFamilyName() = pTargetFont->GetName();
- aFontItem.GetFamily() = pTargetFont->GetFamily();
- aFontItem.GetStyleName() = pTargetFont->GetStyleName();
- aFontItem.GetPitch() = pTargetFont->GetPitch();
- aFontItem.GetCharSet() = pTargetFont->GetCharSet();
+ aFontItem.SetFamilyName( pTargetFont->GetName());
+ aFontItem.SetFamily( pTargetFont->GetFamily());
+ aFontItem.SetStyleName( pTargetFont->GetStyleName());
+ aFontItem.SetPitch( pTargetFont->GetPitch());
+ aFontItem.SetCharSet( pTargetFont->GetCharSet() );
aSet.Put( aFontItem );
}
diff --git a/sw/source/ui/lingu/sdrhhcwrap.cxx b/sw/source/ui/lingu/sdrhhcwrap.cxx
index 1173774d5f..9a2a0bbe16 100644
--- a/sw/source/ui/lingu/sdrhhcwrap.cxx
+++ b/sw/source/ui/lingu/sdrhhcwrap.cxx
@@ -72,7 +72,6 @@ SdrHHCWrapper::SdrHHCWrapper( SwView* pVw,
pView( pVw ),
pTextObj( NULL ),
pOutlView( NULL ),
- pListIter( NULL ),
nOptions( nConvOptions ),
nDocIndex( 0 ),
nSourceLang( nSourceLanguage ),
@@ -146,51 +145,14 @@ sal_Bool SdrHHCWrapper::ConvertNextDocument()
sal_uInt16 n = nDocIndex;
- while( !bNextDoc && ( pListIter ||
- n < pView->GetDocShell()->GetDoc()->GetSpzFrmFmts()->Count() ) )
+ std::list<SdrTextObj*> aTextObjs;
+ SwDrawContact::GetTextObjectsFromFmt( aTextObjs, pView->GetDocShell()->GetDoc() );
+ for ( std::list<SdrTextObj*>::iterator aIt = aTextObjs.begin(); aIt != aTextObjs.end(); aIt++ )
{
- while( !pTextObj && pListIter )
- {
- if( pListIter->IsMore() )
- {
- SdrObject* pSdrO = pListIter->Next();
- if( pSdrO && pSdrO->IsA( TYPE(SdrTextObj) ) &&
- ( (SdrTextObj*) pSdrO )->HasText() )
- pTextObj = (SdrTextObj*) pSdrO;
- }
- else
- {
- delete pListIter;
- pListIter = NULL;
- }
- }
-
- if ( !pTextObj &&
- n < pView->GetDocShell()->GetDoc()->GetSpzFrmFmts()->Count() )
- {
- SwFrmFmt* pFly = (*pView->GetDocShell()->GetDoc()->GetSpzFrmFmts())[ n ];
- if( pFly->IsA( TYPE(SwDrawFrmFmt) ) )
- {
- SwClientIter aIter( (SwFmt&) *pFly );
- if( aIter.First( TYPE(SwDrawContact) ) )
- {
- SdrObject* pSdrO = ((SwDrawContact*)aIter())->GetMaster();
- if ( pSdrO )
- {
- if ( pSdrO->IsA( TYPE(SdrObjGroup) ) )
- pListIter = new SdrObjListIter( *pSdrO, IM_DEEPNOGROUPS );
- else if( pSdrO->IsA( TYPE(SdrTextObj) ) &&
- ( (SdrTextObj*) pSdrO )->HasText() )
- pTextObj = (SdrTextObj*) pSdrO;
- }
- }
- }
- ++n;
- }
+ pTextObj = (*aIt);
if ( pTextObj )
{
OutlinerParaObject* pParaObj = pTextObj->GetOutlinerParaObject();
-
if ( pParaObj )
{
SetPaperSize( pTextObj->GetLogicRect().GetSize() );
@@ -221,8 +183,11 @@ sal_Bool SdrHHCWrapper::ConvertNextDocument()
else
SetUpdateMode(sal_False);
}
+
if ( !bNextDoc )
pTextObj = NULL;
+ else
+ break;
}
}
diff --git a/sw/source/ui/lingu/sdrhhcwrap.hxx b/sw/source/ui/lingu/sdrhhcwrap.hxx
index 197587e916..b50001f26b 100644
--- a/sw/source/ui/lingu/sdrhhcwrap.hxx
+++ b/sw/source/ui/lingu/sdrhhcwrap.hxx
@@ -43,7 +43,6 @@ class SdrHHCWrapper : public SdrOutliner
SwView* pView;
SdrTextObj* pTextObj;
OutlinerView* pOutlView;
- SdrObjListIter* pListIter;
sal_Int32 nOptions;
sal_uInt16 nDocIndex;
LanguageType nSourceLang;
diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx
index 0bb5f892e3..cce6dfe5b8 100644
--- a/sw/source/ui/misc/bookmark.cxx
+++ b/sw/source/ui/misc/bookmark.cxx
@@ -152,9 +152,8 @@ void SwInsertBookmarkDlg::Apply()
SwInsertBookmarkDlg::SwInsertBookmarkDlg( Window *pParent, SwWrtShell &rS, SfxRequest& rRequest ) :
SvxStandardDialog(pParent,SW_RES(DLG_INSERT_BOOKMARK)),
-
- aBookmarkBox(this,SW_RES(CB_BOOKMARK)),
aBookmarkFl(this,SW_RES(FL_BOOKMARK)),
+ aBookmarkBox(this,SW_RES(CB_BOOKMARK)),
aOkBtn(this,SW_RES(BT_OK)),
aCancelBtn(this,SW_RES(BT_CANCEL)),
aDeleteBtn(this,SW_RES(BT_DELETE)),
diff --git a/sw/source/ui/misc/docfnote.cxx b/sw/source/ui/misc/docfnote.cxx
index 4454dbe6c8..b188f87406 100644
--- a/sw/source/ui/misc/docfnote.cxx
+++ b/sw/source/ui/misc/docfnote.cxx
@@ -110,6 +110,8 @@ IMPL_LINK( SwFootNoteOptionDlg, OkHdl, Button *, pBtn )
SwEndNoteOptionPage::SwEndNoteOptionPage( Window *pParent, sal_Bool bEN,
const SfxItemSet &rSet ) :
SfxTabPage( pParent, SW_RES(bEN ? TP_ENDNOTEOPTION : TP_FOOTNOTEOPTION), rSet ),
+ aNumFL (this, SW_RES( FL_NUM )),
+
aNumTypeFT (this, SW_RES( FT_NUMTYPE )),
aNumViewBox (this, SW_RES( LB_NUMVIEW ), INSERT_NUM_EXTENDED_TYPES),
aOffsetLbl (this, SW_RES( FT_OFFSET )),
@@ -123,25 +125,24 @@ SwEndNoteOptionPage::SwEndNoteOptionPage( Window *pParent, sal_Bool bEN,
aPosFT (this, SW_RES( FT_POS )),
aPosPageBox (this, SW_RES( RB_POS_PAGE )),
aPosChapterBox (this, SW_RES( RB_POS_CHAPTER)),
- aNumFL (this, SW_RES( FL_NUM )),
+ aTemplFL (this, SW_RES( FL_TEMPL )),
aParaTemplLbl (this, SW_RES( FT_PARA_TEMPL)),
aParaTemplBox (this, SW_RES( LB_PARA_TEMPL)),
aPageTemplLbl (this, SW_RES( FT_PAGE_TEMPL)),
aPageTemplBox (this, SW_RES( LB_PAGE_TEMPL)),
- aTemplFL (this, SW_RES( FL_TEMPL )),
+ aCharTemplFL( this, SW_RES(FL_CHAR_TEMPL)),
aFtnCharAnchorTemplLbl( this, SW_RES( FT_ANCHR_CHARFMT)),
aFtnCharAnchorTemplBox( this, SW_RES( LB_ANCHR_CHARFMT)),
aFtnCharTextTemplLbl( this, SW_RES( FT_TEXT_CHARFMT)),
aFtnCharTextTemplBox( this, SW_RES( LB_TEXT_CHARFMT)),
- aCharTemplFL( this, SW_RES(FL_CHAR_TEMPL)),
+ aContFL (this, SW_RES( FL_CONT )),
aContLbl (this, SW_RES( FT_CONT )),
aContEdit (this, SW_RES( ED_CONT )),
aContFromLbl (this, SW_RES( FT_CONT_FROM )),
aContFromEdit (this, SW_RES( ED_CONT_FROM )),
- aContFL (this, SW_RES( FL_CONT )),
aNumDoc(aNumCountBox.GetEntry(FTNNUM_DOC)),
aNumPage(aNumCountBox.GetEntry(FTNNUM_PAGE)),
@@ -156,6 +157,8 @@ SwEndNoteOptionPage::SwEndNoteOptionPage( Window *pParent, sal_Bool bEN,
aPosChapterBox.SetClickHdl(LINK(this, SwEndNoteOptionPage, PosChapterHdl));
aNumCountBox.SetSelectHdl(LINK(this, SwEndNoteOptionPage, NumCountHdl));
+ aPosPageBox.SetAccessibleRelationMemberOf(&aPosFT);
+ aPosChapterBox.SetAccessibleRelationMemberOf(&aPosFT);
}
void SwEndNoteOptionPage::Reset( const SfxItemSet& )
diff --git a/sw/source/ui/misc/glosbib.cxx b/sw/source/ui/misc/glosbib.cxx
index 4be6db07bf..750ebe2543 100644
--- a/sw/source/ui/misc/glosbib.cxx
+++ b/sw/source/ui/misc/glosbib.cxx
@@ -76,9 +76,11 @@ SwGlossaryGroupDlg::SwGlossaryGroupDlg(Window * pParent,
const SvStrings* pPathArr,
SwGlossaryHdl *pHdl) :
SvxStandardDialog(pParent, SW_RES(DLG_BIB_BASE)),
-
+ aBibFT( this, SW_RES(FT_BIB)),
aNameED( this, SW_RES(ED_NAME)),
+ aPathFT( this, SW_RES(FT_PATH)),
aPathLB( this, SW_RES(LB_PATH)),
+ aSelectFT( this, SW_RES(FT_SELECT)),
aGroupTLB( this, SW_RES(TLB_GROUPS)),
aOkPB( this, SW_RES(BT_OK)),
@@ -87,9 +89,6 @@ SwGlossaryGroupDlg::SwGlossaryGroupDlg(Window * pParent,
aNewPB( this, SW_RES(PB_NEW)),
aDelPB( this, SW_RES(PB_DELETE)),
aRenamePB( this, SW_RES(PB_RENAME)),
- aBibFT( this, SW_RES(FT_BIB)),
- aPathFT( this, SW_RES(FT_PATH)),
- aSelectFT( this, SW_RES(FT_SELECT)),
pRemovedArr(0),
pInsertedArr(0),
diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index 2203e216f4..c8b1457439 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -91,6 +91,8 @@
#include <swmodule.hxx>
#include <sfx2/filedlghelper.hxx>
+#include "access.hrc"
+
#define LONG_LENGTH 60
#define SHORT_LENGTH 30
@@ -152,11 +154,11 @@ class SwNewGlosNameDlg : public ModalDialog
NoSpaceEdit aNewShort;
OKButton aOk;
CancelButton aCancel;
- FixedLine aFL;
FixedText aONFT;
Edit aOldName;
FixedText aOSFT;
Edit aOldShort;
+ FixedLine aFL;
protected:
DECL_LINK( Modify, Edit * );
@@ -181,11 +183,12 @@ SwNewGlosNameDlg::SwNewGlosNameDlg(Window* pParent,
aNewShort(this,SW_RES( ED_NS )),
aOk (this, SW_RES( BT_OKNEW)),
aCancel (this, SW_RES( BT_CANCEL)),
- aFL (this, SW_RES( FL_NN )),
aONFT (this, SW_RES( FT_ON )),
aOldName(this, SW_RES( ED_ON )),
aOSFT (this, SW_RES( FT_OS )),
- aOldShort(this,SW_RES( ED_OS ))
+ aOldShort(this,SW_RES( ED_OS )),
+ aFL (this, SW_RES( FL_NN ))
+
{
FreeResource();
aOldName.SetText( rOldName );
@@ -298,6 +301,8 @@ SwGlossaryDlg::SwGlossaryDlg(SfxViewFrame* pViewFrame,
aCategoryBox.GetModel()->SetSortMode(SortAscending);
aCategoryBox.SetHighlightRange(); // ueber volle Breite selektieren
aCategoryBox.SetNodeDefaultImages( );
+ aCategoryBox.SetAccessibleName(SW_RES(STR_ACCESS_SW_CATEGORY));
+ aCategoryBox.SetAccessibleRelationLabeledBy(&aInsertTipCB);
Init();
}
diff --git a/sw/source/ui/misc/glossary.src b/sw/source/ui/misc/glossary.src
index 5ad32faa2f..94d56829bf 100644
--- a/sw/source/ui/misc/glossary.src
+++ b/sw/source/ui/misc/glossary.src
@@ -29,6 +29,8 @@
#include "glossary.hrc"
#include "cmdid.h"
#include "helpid.h"
+#include "access.hrc"
+
// #define DLG_GLOSSARY 256
ModalDialog DLG_GLOSSARY
{
@@ -288,6 +290,12 @@ String STR_GLOSSARY
{
Text [ en-US ] = "AutoText :" ;
};
+/*IAccessibility2 Implementation 2009-----*/
+String STR_ACCESS_SW_CATEGORY
+{
+ Text [ en-US ] = "Category" ;
+};
+/*-----IAccessibility2 Implementation 2009*/
ModalDialog DLG_RENAME_GLOS
{
OutputSize = TRUE ;
diff --git a/sw/source/ui/misc/impfnote.hxx b/sw/source/ui/misc/impfnote.hxx
index 29da9b203b..d0f9adf304 100644
--- a/sw/source/ui/misc/impfnote.hxx
+++ b/sw/source/ui/misc/impfnote.hxx
@@ -46,6 +46,7 @@ class SwWrtShell;
class SwEndNoteOptionPage : public SfxTabPage
{
+ FixedLine aNumFL;
FixedText aNumTypeFT;
SwNumberingTypeListBox aNumViewBox;
FixedText aOffsetLbl;
@@ -59,25 +60,24 @@ class SwEndNoteOptionPage : public SfxTabPage
FixedText aPosFT;
RadioButton aPosPageBox;
RadioButton aPosChapterBox;
- FixedLine aNumFL;
+ FixedLine aTemplFL;
FixedText aParaTemplLbl;
ListBox aParaTemplBox;
FixedText aPageTemplLbl;
ListBox aPageTemplBox;
- FixedLine aTemplFL;
+ FixedLine aCharTemplFL;
FixedText aFtnCharAnchorTemplLbl;
ListBox aFtnCharAnchorTemplBox;
FixedText aFtnCharTextTemplLbl;
ListBox aFtnCharTextTemplBox;
- FixedLine aCharTemplFL;
+ FixedLine aContFL;
FixedText aContLbl;
Edit aContEdit;
FixedText aContFromLbl;
Edit aContFromEdit;
- FixedLine aContFL;
String aNumDoc;
String aNumPage;
diff --git a/sw/source/ui/misc/insfnote.cxx b/sw/source/ui/misc/insfnote.cxx
index a5211af5fe..5a02e812ce 100644
--- a/sw/source/ui/misc/insfnote.cxx
+++ b/sw/source/ui/misc/insfnote.cxx
@@ -233,15 +233,15 @@ SwInsFootNoteDlg::SwInsFootNoteDlg(Window *pParent, SwWrtShell &rShell, sal_Bool
rSh(rShell),
bExtCharAvailable(sal_False),
bEdit(bEd),
+ aNumberFL (this,SW_RES(FL_NUMBER)),
aNumberAutoBtn (this,SW_RES(RB_NUMBER_AUTO)),
aNumberCharBtn (this,SW_RES(RB_NUMBER_CHAR)),
aNumberCharEdit (this,SW_RES(ED_NUMBER_CHAR)),
aNumberExtChar (this,SW_RES(BT_NUMBER_CHAR)),
- aNumberFL (this,SW_RES(FL_NUMBER)),
+ aTypeFL (this,SW_RES(FL_TYPE)),
aFtnBtn (this,SW_RES(RB_TYPE_FTN)),
aEndNoteBtn (this,SW_RES(RB_TYPE_ENDNOTE)),
- aTypeFL (this,SW_RES(FL_TYPE)),
aOkBtn (this,SW_RES(BT_OK)),
aCancelBtn (this,SW_RES(BT_CANCEL)),
@@ -249,6 +249,10 @@ SwInsFootNoteDlg::SwInsFootNoteDlg(Window *pParent, SwWrtShell &rShell, sal_Bool
aPrevBT (this,SW_RES(BT_PREV)),
aNextBT (this,SW_RES(BT_NEXT))
{
+ aNumberCharEdit.SetAccessibleName(String(SW_RES(STR_CHAR)));
+ aNumberExtChar.SetAccessibleRelationMemberOf(&aNumberFL);
+ aNumberCharEdit.SetAccessibleRelationLabeledBy(&aNumberCharBtn);
+
aNumberAutoBtn.SetClickHdl(LINK(this,SwInsFootNoteDlg,NumberAutoBtnHdl));
aNumberExtChar.SetClickHdl(LINK(this,SwInsFootNoteDlg,NumberExtCharHdl));
aNumberCharBtn.SetClickHdl(LINK(this,SwInsFootNoteDlg,NumberCharHdl));
diff --git a/sw/source/ui/misc/insfnote.hrc b/sw/source/ui/misc/insfnote.hrc
index 104693acea..c3649748f0 100644
--- a/sw/source/ui/misc/insfnote.hrc
+++ b/sw/source/ui/misc/insfnote.hrc
@@ -39,3 +39,7 @@
#define BT_HELP 102
#define BT_PREV 103
#define BT_NEXT 104
+
+//IAccessibility2 Implementation 2009-----
+#define STR_CHAR 105
+//-----IAccessibility2 Implementation 2009
diff --git a/sw/source/ui/misc/insfnote.src b/sw/source/ui/misc/insfnote.src
index c462e01188..761241619e 100644
--- a/sw/source/ui/misc/insfnote.src
+++ b/sw/source/ui/misc/insfnote.src
@@ -49,6 +49,12 @@ ModalDialog DLG_INS_FOOTNOTE
Group = TRUE ;
Left = TRUE ;
};
+ //IAccessibility2 Implementation 2009-----
+ String STR_CHAR
+ {
+ Text [ en-US ] = "Character" ;
+ };
+ //-----IAccessibility2 Implementation 2009
OKButton BT_OK
{
Pos = MAP_APPFONT ( 104 , 6 ) ;
diff --git a/sw/source/ui/misc/linenum.cxx b/sw/source/ui/misc/linenum.cxx
index 4cca0d1aa6..584b31ee34 100644
--- a/sw/source/ui/misc/linenum.cxx
+++ b/sw/source/ui/misc/linenum.cxx
@@ -105,6 +105,7 @@ SwLineNumberingPage::SwLineNumberingPage( Window* pParent,
const SfxItemSet& rSet )
: SfxTabPage(pParent, SW_RES(TP_LINENUMBERING), rSet),
aNumberingOnCB ( this, SW_RES( CB_NUMBERING_ON )),
+ aDisplayFL ( this, SW_RES( FL_DISPLAY )),
aCharStyleFT ( this, SW_RES( FT_CHAR_STYLE )),
aCharStyleLB ( this, SW_RES( LB_CHAR_STYLE )),
aFormatFT ( this, SW_RES( FT_FORMAT )),
@@ -116,19 +117,29 @@ SwLineNumberingPage::SwLineNumberingPage( Window* pParent,
aNumIntervalFT ( this, SW_RES( FT_NUM_INVERVAL )),
aNumIntervalNF ( this, SW_RES( NF_NUM_INVERVAL )),
aNumRowsFT ( this, SW_RES( FT_NUM_ROWS )),
- aDisplayFL ( this, SW_RES( FL_DISPLAY )),
+ aDivisorFL ( this, SW_RES( FL_DIVISOR )),
aDivisorFT ( this, SW_RES( FT_DIVISOR )),
aDivisorED ( this, SW_RES( ED_DIVISOR )),
aDivIntervalFT ( this, SW_RES( FT_DIV_INTERVAL )),
aDivIntervalNF ( this, SW_RES( NF_DIV_INTERVAL )),
aDivRowsFT ( this, SW_RES( FT_DIV_ROWS )),
- aDivisorFL ( this, SW_RES( FL_DIVISOR )),
+ aCountFL ( this, SW_RES( FL_COUNT )),
aCountEmptyLinesCB ( this, SW_RES( CB_COUNT_EMPTYLINES )),
aCountFrameLinesCB ( this, SW_RES( CB_COUNT_FRAMELINES )),
- aRestartEachPageCB ( this, SW_RES( CB_RESTART_PAGE )),
- aCountFL ( this, SW_RES( FL_COUNT ))
+ aRestartEachPageCB ( this, SW_RES( CB_RESTART_PAGE ))
{
+ String sIntervalName = aDivIntervalFT.GetAccessibleName();
+ sIntervalName += String::CreateFromAscii("(");
+ sIntervalName += aDivRowsFT.GetAccessibleName();
+ sIntervalName += String::CreateFromAscii(")");
+ aDivIntervalNF.SetAccessibleName(sIntervalName);
+ sIntervalName = aNumIntervalFT.GetAccessibleName();
+ sIntervalName += String::CreateFromAscii("(");
+ sIntervalName += aNumRowsFT.GetAccessibleName();
+ sIntervalName += String::CreateFromAscii(")");
+ aNumIntervalNF.SetAccessibleName(sIntervalName);
+
FreeResource();
SwLineNumberingDlg *pDlg = (SwLineNumberingDlg *)GetParent();
pSh = pDlg->GetWrtShell();
diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx
index a5fd3511fa..d9dd5f9e3e 100644
--- a/sw/source/ui/misc/num.cxx
+++ b/sw/source/ui/misc/num.cxx
@@ -101,9 +101,9 @@ static sal_Bool bLastRelative = sal_False;
SwNumPositionTabPage::SwNumPositionTabPage(Window* pParent,
const SfxItemSet& rSet) :
SfxTabPage( pParent, SW_RES( TP_NUM_POSITION ), rSet ),
- aPositionFL( this, SW_RES(FL_POSITION )),
aLevelFL( this, SW_RES(FL_LEVEL )),
aLevelLB( this, SW_RES(LB_LEVEL )),
+ aPositionFL( this, SW_RES(FL_POSITION )),
aDistBorderFT( this, SW_RES(FT_BORDERDIST )),
aDistBorderMF( this, SW_RES(MF_BORDERDIST )),
@@ -143,6 +143,9 @@ SwNumPositionTabPage::SwNumPositionTabPage(Window* pParent,
FreeResource();
SetExchangeSupport();
aPreviewWIN.SetBackground(Wallpaper(Color(COL_TRANSPARENT)));
+
+ aStandardPB.SetAccessibleRelationMemberOf(&aPositionFL);
+
aRelativeCB.Check();
aAlignLB.SetSelectHdl(LINK(this, SwNumPositionTabPage, EditModifyHdl));
diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx
index 276aadafdf..277e645bcd 100644
--- a/sw/source/ui/misc/outline.cxx
+++ b/sw/source/ui/misc/outline.cxx
@@ -88,6 +88,10 @@
#include <app.hrc>
// <--
+#ifndef _COM_SUN_STAR_ACCESSIBILITY_ACCESSIBLEROLE_HPP_
+#include <com/sun/star/accessibility/AccessibleRole.hpp>
+#endif
+
using namespace ::com::sun::star;
/* -----------------------------31.01.01 10:23--------------------------------
@@ -102,9 +106,9 @@ DBG_NAME(outlinehdl)
class SwNumNamesDlg: public ModalDialog
{
+ FixedLine aFormFL;
Edit aFormEdit;
ListBox aFormBox;
- FixedLine aFormFL;
OKButton aOKBtn;
CancelButton aCancelBtn;
HelpButton aHelpBtn;
@@ -186,9 +190,9 @@ IMPL_LINK_INLINE_END( SwNumNamesDlg, DoubleClickHdl, ListBox *, EMPTYARG )
SwNumNamesDlg::SwNumNamesDlg(Window *pParent)
: ModalDialog(pParent, SW_RES(DLG_NUM_NAMES)),
+ aFormFL(this, SW_RES(FL_FORM)),
aFormEdit(this, SW_RES(ED_FORM)),
aFormBox(this, SW_RES(LB_FORM)),
- aFormFL(this, SW_RES(FL_FORM)),
aOKBtn(this, SW_RES(BT_OK)),
aCancelBtn(this, SW_RES(BT_CANCEL)),
aHelpBtn(this, SW_RES(BT_HELP))
@@ -241,6 +245,7 @@ SwOutlineTabDialog::SwOutlineTabDialog(Window* pParent,
pUserButton->SetText(SW_RES(ST_FORM));
pUserButton->SetHelpId(HID_OUTLINE_FORM);
pUserButton->SetClickHdl(LINK(this, SwOutlineTabDialog, FormHdl));
+ pUserButton->SetAccessibleRole( com::sun::star::accessibility::AccessibleRole::BUTTON_MENU );
FreeResource();
pNumRule = new SwNumRule( *rSh.GetOutlineNumRule() );
@@ -543,8 +548,9 @@ short SwOutlineTabDialog::Ok()
* --------------------------------------------------*/
SwOutlineSettingsTabPage::SwOutlineSettingsTabPage(Window* pParent, const SfxItemSet& rSet) :
SfxTabPage(pParent, SW_RES(TP_OUTLINE_NUM), rSet),
- aLevelLB( this, SW_RES(LB_LEVEL )),
aLevelFL( this, SW_RES(FL_LEVEL )),
+ aLevelLB( this, SW_RES(LB_LEVEL )),
+ aNumberFL(this, SW_RES(FL_NUMBER)),
aCollLbl(this, SW_RES(FT_COLL)),
aCollBox(this, SW_RES(LB_COLL)),
aNumberLbl(this, SW_RES(FT_NUMBER)),
@@ -560,7 +566,6 @@ SwOutlineSettingsTabPage::SwOutlineSettingsTabPage(Window* pParent, const SfxIte
aSuffixED(this, SW_RES(ED_SUFFIX)),
aStartLbl(this, SW_RES(FT_START)),
aStartEdit(this, SW_RES(ED_START)),
- aNumberFL(this, SW_RES(FL_NUMBER)),
aPreviewWIN( this, SW_RES(WIN_PREVIEW )),
aNoFmtName(SW_RES(ST_NO_COLL)),
diff --git a/sw/source/ui/misc/pgfnote.cxx b/sw/source/ui/misc/pgfnote.cxx
index 70a807ae37..efb98d9d5c 100644
--- a/sw/source/ui/misc/pgfnote.cxx
+++ b/sw/source/ui/misc/pgfnote.cxx
@@ -156,14 +156,14 @@ IMPL_LINK( SwFootNotePage, HeightModify, MetricField *, EMPTYARG )
SwFootNotePage::SwFootNotePage(Window *pParent, const SfxItemSet &rSet) :
SfxTabPage(pParent, SW_RES(TP_FOOTNOTE_PAGE), rSet),
-
+ aPosHeader(this, SW_RES(FL_FOOTNOTE_SIZE)),
aMaxHeightPageBtn(this, SW_RES(RB_MAXHEIGHT_PAGE)),
aMaxHeightBtn(this, SW_RES(RB_MAXHEIGHT)),
aMaxHeightEdit(this, SW_RES(ED_MAXHEIGHT)),
aDistLbl(this, SW_RES(FT_DIST)),
aDistEdit(this, SW_RES(ED_DIST)),
- aPosHeader(this, SW_RES(FL_FOOTNOTE_SIZE)),
-
+
+ aLineHeader(this, SW_RES(FL_LINE)),
aLinePosLbl(this, SW_RES(FT_LINEPOS)),
aLinePosBox(this, SW_RES(DLB_LINEPOS)),
aLineTypeLbl(this, SW_RES(FT_LINETYPE)),
@@ -171,9 +171,8 @@ SwFootNotePage::SwFootNotePage(Window *pParent, const SfxItemSet &rSet) :
aLineWidthLbl(this, SW_RES(FT_LINEWIDTH)),
aLineWidthEdit(this, SW_RES(ED_LINEWIDTH)),
aLineDistLbl(this, SW_RES(FT_LINEDIST)),
- aLineDistEdit(this, SW_RES(ED_LINEDIST)),
- aLineHeader(this, SW_RES(FL_LINE))
-{
+ aLineDistEdit(this, SW_RES(ED_LINEDIST))
+ {
FreeResource();
SetExchangeSupport();
@@ -184,6 +183,7 @@ SwFootNotePage::SwFootNotePage(Window *pParent, const SfxItemSet &rSet) :
MeasurementSystem eSys = SvtSysLocale().GetLocaleData().getMeasurementSystemEnum();
long nHeightValue = MEASURE_METRIC != eSys ? 1440 : 1134;
aMaxHeightEdit.SetValue(aMaxHeightEdit.Normalize(nHeightValue),FUNIT_TWIP);;
+ aMaxHeightEdit.SetAccessibleRelationLabeledBy(&aMaxHeightBtn);
}
SwFootNotePage::~SwFootNotePage()
diff --git a/sw/source/ui/misc/srtdlg.cxx b/sw/source/ui/misc/srtdlg.cxx
index 9f844fa6cc..8f5d5ffa80 100644
--- a/sw/source/ui/misc/srtdlg.cxx
+++ b/sw/source/ui/misc/srtdlg.cxx
@@ -133,12 +133,13 @@ sal_Bool lcl_GetSelTbl( SwWrtShell &rSh, sal_uInt16& rX, sal_uInt16& rY )
SwSortDlg::SwSortDlg(Window* pParent, SwWrtShell &rShell) :
SvxStandardDialog(pParent, SW_RES(DLG_SORTING)),
+
aColLbl(this, SW_RES(FT_COL )),
aTypLbl(this, SW_RES(FT_KEYTYP)),
aDirLbl(this, SW_RES(FT_DIR )),
+ aSortFL(this, SW_RES(FL_SORT_2 )),
- aDirFL(this, SW_RES(FL_DIR )),
-
+
aKeyCB1(this, SW_RES(CB_KEY1 )),
aColEdt1(this, SW_RES(ED_KEY1 )),
aTypDLB1(this, SW_RES(DLB_KEY1 )),
@@ -156,8 +157,8 @@ SwSortDlg::SwSortDlg(Window* pParent, SwWrtShell &rShell) :
aTypDLB3(this, SW_RES(DLB_KEY3 )),
aSortUp3RB(this, SW_RES(RB_UP3 )),
aSortDn3RB(this, SW_RES(RB_DN3 )),
+ aDirFL(this, SW_RES(FL_DIR )),
- aSortFL(this, SW_RES(FL_SORT_2 )),
aColumnRB(this, SW_RES(RB_COL )),
aRowRB(this, SW_RES(RB_ROW )),
@@ -185,6 +186,19 @@ SwSortDlg::SwSortDlg(Window* pParent, SwWrtShell &rShell) :
nX( 99 ),
nY( 99 )
{
+ aColEdt1.SetAccessibleName(aColLbl.GetText());
+ aColEdt2.SetAccessibleName(aColLbl.GetText());
+ aColEdt3.SetAccessibleName(aColLbl.GetText());
+ aTypDLB1.SetAccessibleName(aTypLbl.GetText());
+ aTypDLB2.SetAccessibleName(aTypLbl.GetText());
+ aTypDLB3.SetAccessibleName(aTypLbl.GetText());
+ aSortUpRB.SetAccessibleRelationMemberOf( &aKeyCB1 );
+ aSortDnRB.SetAccessibleRelationMemberOf( &aKeyCB1 );
+ aSortUp2RB.SetAccessibleRelationMemberOf( &aKeyCB2 );
+ aSortDn2RB.SetAccessibleRelationMemberOf( &aKeyCB2 );
+ aSortUp3RB.SetAccessibleRelationMemberOf( &aKeyCB3 );
+ aSortDn3RB.SetAccessibleRelationMemberOf( &aKeyCB3 );
+
aDelimEdt.SetMaxTextLen( 1 );
if(rSh.GetSelectionType() &
(nsSelectionType::SEL_TBL|nsSelectionType::SEL_TBL_CELLS) )
@@ -262,6 +276,25 @@ SwSortDlg::SwSortDlg(Window* pParent, SwWrtShell &rShell) :
aColEdt2.SetMax(nMax);
aColEdt3.SetMax(nMax);
}
+
+ aDelimEdt.SetAccessibleRelationLabeledBy(&aDelimFreeRB);
+ aDelimPB.SetAccessibleRelationLabeledBy(&aDelimFreeRB);
+ aDelimPB.SetAccessibleRelationMemberOf(&aDelimFL);
+
+ aColEdt1.SetAccessibleRelationMemberOf(&aKeyCB1);
+ aColEdt1.SetAccessibleRelationLabeledBy(&aColLbl);
+ aTypDLB1.SetAccessibleRelationMemberOf(&aKeyCB1);
+ aTypDLB1.SetAccessibleRelationLabeledBy(&aTypLbl);
+
+ aColEdt2.SetAccessibleRelationMemberOf(&aKeyCB2);
+ aColEdt2.SetAccessibleRelationLabeledBy(&aColLbl);
+ aTypDLB2.SetAccessibleRelationMemberOf(&aKeyCB2);
+ aTypDLB2.SetAccessibleRelationLabeledBy(&aTypLbl);
+
+ aColEdt3.SetAccessibleRelationMemberOf(&aKeyCB3);
+ aColEdt3.SetAccessibleRelationLabeledBy(&aColLbl);
+ aTypDLB3.SetAccessibleRelationMemberOf(&aKeyCB3);
+ aTypDLB3.SetAccessibleRelationLabeledBy(&aTypLbl);
}
SwSortDlg::~SwSortDlg()
@@ -416,6 +449,9 @@ IMPL_LINK( SwSortDlg, CheckHdl, CheckBox *, pCheck )
aColEdt2.SetMax(nY);
aColEdt3.SetMax(nY);
+ aColEdt1.SetAccessibleName(aColTxt);
+ aColEdt2.SetAccessibleName(aColTxt);
+ aColEdt3.SetAccessibleName(aColTxt);
}
else if( pCheck == ( CheckBox* ) &aColumnRB)
{
@@ -423,6 +459,10 @@ IMPL_LINK( SwSortDlg, CheckHdl, CheckBox *, pCheck )
aColEdt1.SetMax(nX);
aColEdt2.SetMax(nX);
aColEdt3.SetMax(nX);
+
+ aColEdt1.SetAccessibleName(aRowTxt);
+ aColEdt2.SetAccessibleName(aRowTxt);
+ aColEdt3.SetAccessibleName(aRowTxt);
}
else if(!aKeyCB1.IsChecked() &&
!aKeyCB2.IsChecked() &&
diff --git a/sw/source/ui/ribbar/inputwin.cxx b/sw/source/ui/ribbar/inputwin.cxx
index 0016a4ac45..934bde75cd 100755
--- a/sw/source/ui/ribbar/inputwin.cxx
+++ b/sw/source/ui/ribbar/inputwin.cxx
@@ -165,6 +165,7 @@ void SwInputWindow::CleanupUglyHackWithUndo()
{
SW_MOD()->GetUndoOptions().SetUndoCount(0);
}
+ m_bResetUndo = false; // #i117122# once is enough :)
}
}
diff --git a/sw/source/ui/shells/drwbassh.cxx b/sw/source/ui/shells/drwbassh.cxx
index 43967174d0..644923d431 100644
--- a/sw/source/ui/shells/drwbassh.cxx
+++ b/sw/source/ui/shells/drwbassh.cxx
@@ -266,7 +266,8 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq)
aSet.Put(SfxInt16Item(SID_ATTR_TRANSFORM_ANCHOR, nAnchor));
sal_Bool bRTL;
- aSet.Put(SfxBoolItem(SID_ATTR_TRANSFORM_IN_VERTICAL_TEXT, pSh->IsFrmVertical(sal_True, bRTL)));
+ sal_Bool bVertL2R;
+ aSet.Put(SfxBoolItem(SID_ATTR_TRANSFORM_IN_VERTICAL_TEXT, pSh->IsFrmVertical(sal_True, bRTL, bVertL2R)));
aSet.Put(SfxBoolItem(SID_ATTR_TRANSFORM_IN_RTL_TEXT, bRTL));
SwFrmFmt* pFrmFmt = FindFrmFmt( pObj );
@@ -832,8 +833,12 @@ IMPL_LINK(SwDrawBaseShell, ValidatePosition, SvxSwFrameValidation*, pValidation
pValidation->bFollowTextFlow,
pValidation->bMirror, NULL, &pValidation->aPercentSize);
- sal_Bool bRTL;
- sal_Bool bIsInVertical = pSh->IsFrmVertical(sal_True, bRTL);
+ sal_Bool bIsInVertical( sal_False );
+ {
+ sal_Bool bRTL;
+ sal_Bool bVertL2R;
+ bIsInVertical = pSh->IsFrmVertical(sal_True, bRTL, bVertL2R);
+ }
if(bIsInVertical)
{
Point aPos(aBoundRect.Pos());
diff --git a/sw/source/ui/shells/textfld.cxx b/sw/source/ui/shells/textfld.cxx
index 01f20a1bc4..32e5018a7a 100644
--- a/sw/source/ui/shells/textfld.cxx
+++ b/sw/source/ui/shells/textfld.cxx
@@ -81,6 +81,7 @@
#include <app.hrc>
#include <PostItMgr.hxx>
+#include <switerator.hxx>
using namespace nsSwDocInfoSubType;
@@ -377,17 +378,16 @@ void SwTextShell::ExecField(SfxRequest &rReq)
if (pPostIt)
{
SwFieldType* pType = rSh.GetDoc()->GetFldType(RES_POSTITFLD, aEmptyStr,false);
- SwClientIter aIter( *pType );
- SwClient* pFirst = aIter.GoStart();
- while( pFirst )
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pType );
+ SwFmtFld* pSwFmtFld = aIter.First();
+ while( pSwFmtFld )
{
- SwFmtFld* pSwFmtFld = static_cast<SwFmtFld*>(pFirst);
if ( pSwFmtFld->GetFld() == pPostIt )
{
pSwFmtFld->Broadcast( SwFmtFldHint( 0, SWFMTFLD_FOCUS, &GetView() ) );
break;
}
- pFirst = aIter++;
+ pSwFmtFld = aIter.Next();
}
}
}
diff --git a/sw/source/ui/shells/textsh.cxx b/sw/source/ui/shells/textsh.cxx
index b99cc467f7..34732bf109 100644..100755
--- a/sw/source/ui/shells/textsh.cxx
+++ b/sw/source/ui/shells/textsh.cxx
@@ -1161,10 +1161,10 @@ void SwTextShell::InsertSymbol( SfxRequest& rReq )
{
bFontChanged = sal_True;
SvxFontItem aNewFontItem( aFont );
- aNewFontItem.GetFamilyName() = aNewFont.GetName();
- aNewFontItem.GetFamily() = aNewFont.GetFamily();
- aNewFontItem.GetPitch() = aNewFont.GetPitch();
- aNewFontItem.GetCharSet() = aNewFont.GetCharSet();
+ aNewFontItem.SetFamilyName( aNewFont.GetName());
+ aNewFontItem.SetFamily( aNewFont.GetFamily());
+ aNewFontItem.SetPitch( aNewFont.GetPitch());
+ aNewFontItem.SetCharSet( aNewFont.GetCharSet() );
SfxItemSet aRestoreSet( GetPool(), RES_CHRATR_FONT, RES_CHRATR_FONT,
RES_CHRATR_CJK_FONT, RES_CHRATR_CJK_FONT,
diff --git a/sw/source/ui/table/colwd.cxx b/sw/source/ui/table/colwd.cxx
index dc7ca95821..2361f50a98 100644
--- a/sw/source/ui/table/colwd.cxx
+++ b/sw/source/ui/table/colwd.cxx
@@ -76,12 +76,12 @@ IMPL_LINK_INLINE_END( SwTableWidthDlg, LoseFocusHdl, Edit *, EMPTYARG )
SwTableWidthDlg::SwTableWidthDlg(Window *pParent, SwTableFUNC &rTableFnc ) :
SvxStandardDialog( pParent, SW_RES(DLG_COL_WIDTH) ),
+ aWidthFL(this, SW_RES(FL_WIDTH)),
aColFT(this, SW_RES(FT_COL)),
aColEdit(this, SW_RES(ED_COL)),
aWidthFT(this, SW_RES(FT_WIDTH)),
aWidthEdit(this, SW_RES(ED_WIDTH)),
- aWidthFL(this, SW_RES(FL_WIDTH)),
aOKBtn(this, SW_RES(BT_OK)),
aCancelBtn(this, SW_RES(BT_CANCEL)),
aHelpBtn(this, SW_RES(BT_HELP)),
diff --git a/sw/source/ui/table/convert.cxx b/sw/source/ui/table/convert.cxx
index 9678ff6f51..1c08d7c075 100644
--- a/sw/source/ui/table/convert.cxx
+++ b/sw/source/ui/table/convert.cxx
@@ -153,6 +153,8 @@ SwConvertTableDlg::SwConvertTableDlg( SwView& rView, bool bToTable )
pTAutoFmt( 0 ),
pShell( &rView.GetWrtShell() )
{
+ aOtherEd.SetAccessibleName(String(SW_RES(STR_SYMBOL)));
+ aOtherEd.SetAccessibleRelationLabeledBy(&aOtherBtn);
FreeResource();
if(nSaveButtonState > -1)
{
diff --git a/sw/source/ui/table/convert.hrc b/sw/source/ui/table/convert.hrc
index e86906dd20..34e152c489 100644
--- a/sw/source/ui/table/convert.hrc
+++ b/sw/source/ui/table/convert.hrc
@@ -45,3 +45,6 @@
#define BT_AUTOFORMAT 102
#define BT_HELP 103
#define WIN_REPEAT_HEADER 104
+//IAccessibility2 Implementation 2009-----
+#define STR_SYMBOL 105
+//-----IAccessibility2 Implementation 2009
diff --git a/sw/source/ui/table/convert.src b/sw/source/ui/table/convert.src
index 13e9b9e860..56f8d098a1 100644
--- a/sw/source/ui/table/convert.src
+++ b/sw/source/ui/table/convert.src
@@ -191,6 +191,12 @@ ModalDialog DLG_CONV_TEXT_TABLE
Hide = TRUE ;
Text [ en-US ] = "Auto~Format..." ;
};
+ /*IAccessibility2 Implementation 2009-----*/
+ String STR_SYMBOL
+ {
+ Text [ en-US ] = "Symbol" ;
+ };
+ /*-----IAccessibility2 Implementation 2009*/
};
diff --git a/sw/source/ui/table/rowht.cxx b/sw/source/ui/table/rowht.cxx
index 9bfdbe74e5..0493123823 100644
--- a/sw/source/ui/table/rowht.cxx
+++ b/sw/source/ui/table/rowht.cxx
@@ -86,10 +86,10 @@ void SwTableHeightDlg::Apply()
SwTableHeightDlg::SwTableHeightDlg( Window *pParent, SwWrtShell &rS ) :
SvxStandardDialog(pParent, SW_RES(DLG_ROW_HEIGHT)),
+ aHeightFL(this, SW_RES(FL_HEIGHT)),
aHeightEdit(this, SW_RES(ED_HEIGHT)),
aAutoHeightCB(this, SW_RES(CB_AUTOHEIGHT)),
- aHeightFL(this, SW_RES(FL_HEIGHT)),
aOKBtn(this, SW_RES(BT_OK)),
aCancelBtn(this, SW_RES(BT_CANCEL)),
aHelpBtn( this, SW_RES( BT_HELP ) ),
diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx
index 3d8f81241c..3101aecc16 100644
--- a/sw/source/ui/table/tabledlg.cxx
+++ b/sw/source/ui/table/tabledlg.cxx
@@ -53,6 +53,8 @@
#include <fmtrowsplt.hxx>
#include <svx/htmlmode.hxx>
+#include "access.hrc"
+
#ifndef _DOCSH_HXX
#include <docsh.hxx>
#endif
@@ -824,7 +826,8 @@ SwTableColumnPage::SwTableColumnPage( Window* pParent,
aProportionalCB(this, SW_RES(CB_PROP)),
aSpaceFT(this, SW_RES(FT_SPACE)),
aSpaceED(this, SW_RES(ED_SPACE)),
-
+
+ aColFL(this, SW_RES(COL_FL_LAYOUT)),
aUpBtn(this, SW_RES(COL_BTN_UP)),
aFT1(this, SW_RES(COL_FT_1)),
aMF1(this, SW_RES(COL_MF_1)),
@@ -839,7 +842,6 @@ SwTableColumnPage::SwTableColumnPage( Window* pParent,
aFT6(this, SW_RES(COL_FT_6)),
aMF6(this, SW_RES(COL_MF_6)),
aDownBtn(this, SW_RES(COL_BTN_DOWN)),
- aColFL(this, SW_RES(COL_FL_LAYOUT)),
nTableWidth(0),
nMinWidth( MINLAY ),
@@ -852,6 +854,9 @@ SwTableColumnPage::SwTableColumnPage( Window* pParent,
FreeResource();
SetExchangeSupport();
+ aDownBtn.SetAccessibleRelationMemberOf(&aColFL);
+ aUpBtn.SetAccessibleRelationMemberOf(&aColFL);
+
pFieldArr[0] = &aMF1;
pFieldArr[1] = &aMF2;
pFieldArr[2] = &aMF3;
@@ -986,8 +991,16 @@ IMPL_LINK( SwTableColumnPage, AutoClickHdl, CheckBox *, pBox )
for( sal_uInt16 i = 0; (i < nNoOfVisibleCols ) && ( i < MET_FIELDS); i++ )
{
String sEntry('~');
- sEntry += String::CreateFromInt32( aValueTbl[i] + 1 );
+ String sIndex = String::CreateFromInt32( aValueTbl[i] + 1 );
+ sEntry += sIndex;
pTextArr[i]->SetText( sEntry );
+//IAccessibility2 Impplementaton 2009-----
+ //added by menghu for SODC_5143,12/12/2006
+ String sColumnWidth = SW_RESSTR( STR_ACCESS_COLUMN_WIDTH);
+ sColumnWidth.SearchAndReplace( DEFINE_CONST_UNICODE("%1"), sIndex );
+ pFieldArr[i]->SetAccessibleName( sColumnWidth );
+ //end of SODC_5143
+//-----IAccessibility2 Impplementaton 2009
}
aDownBtn.Enable(aValueTbl[0] > 0);
@@ -1098,12 +1111,18 @@ void SwTableColumnPage::UpdateCols( sal_uInt16 nAktPos )
if(!bModifyTable && !bProp )
{
-// Tabellenbreite bleibt, Differenz wird mit der/den
-// naechsten Zellen ausgeglichen
+// the table width is constant, the difference is balanced with the other columns
+ sal_uInt16 nLoopCount = 0;
while( nDiff )
{
if( ++nAktPos == nNoOfVisibleCols)
+ {
nAktPos = 0;
+ ++nLoopCount;
+ //#i101353# in small tables it might not be possible to balance column width
+ if( nLoopCount > 1 )
+ break;
+ }
if( nDiff < 0 )
{
SetVisibleWidth(nAktPos, GetVisibleWidth(nAktPos) -nDiff);
@@ -1458,6 +1477,13 @@ SwTextFlowPage::SwTextFlowPage( Window* pParent,
{
FreeResource();
+ aPgBrkRB.SetAccessibleRelationMemberOf(&aPgBrkCB);
+ aColBrkRB.SetAccessibleRelationMemberOf(&aPgBrkCB);
+ aPgBrkBeforeRB.SetAccessibleRelationMemberOf(&aPgBrkCB);
+ aPgBrkAfterRB.SetAccessibleRelationMemberOf(&aPgBrkCB);
+ aPageCollLB.SetAccessibleRelationLabeledBy(&aPageCollCB);
+ aPageCollLB.SetAccessibleName(aPageCollCB.GetText());
+
aPgBrkCB.SetClickHdl(LINK(this, SwTextFlowPage, PageBreakHdl_Impl));
aPgBrkBeforeRB.SetClickHdl(
LINK( this, SwTextFlowPage, PageBreakPosHdl_Impl ) );
diff --git a/sw/source/ui/table/tabledlg.hrc b/sw/source/ui/table/tabledlg.hrc
index 1640c623d9..395613dac4 100644
--- a/sw/source/ui/table/tabledlg.hrc
+++ b/sw/source/ui/table/tabledlg.hrc
@@ -108,3 +108,4 @@
#define FT_VERTORIENT 150
#define LB_VERTORIENT 151
+
diff --git a/sw/source/ui/table/tabledlg.src b/sw/source/ui/table/tabledlg.src
index b3d52ec516..8c33398ca9 100644
--- a/sw/source/ui/table/tabledlg.src
+++ b/sw/source/ui/table/tabledlg.src
@@ -786,4 +786,3 @@ InfoBox MSG_WRONG_TABLENAME
{
Message [ en-US ] = "The name of the table must not contain spaces." ;
};
-
diff --git a/sw/source/ui/table/tablepg.hxx b/sw/source/ui/table/tablepg.hxx
index ea200094c6..a95e659fe0 100644
--- a/sw/source/ui/table/tablepg.hxx
+++ b/sw/source/ui/table/tablepg.hxx
@@ -121,7 +121,7 @@ class SwTableColumnPage : public SfxTabPage
CheckBox aProportionalCB;
FixedText aSpaceFT;
MetricField aSpaceED;
-
+ FixedLine aColFL;
ImageButton aUpBtn;
FixedText aFT1;
PercentField aMF1;
@@ -136,7 +136,6 @@ class SwTableColumnPage : public SfxTabPage
FixedText aFT6;
PercentField aMF6;
ImageButton aDownBtn;
- FixedLine aColFL;
SwTableRep* pTblData;
PercentField* pFieldArr[MET_FIELDS];
diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx
index e9665532f1..88854b9a88 100644
--- a/sw/source/ui/table/tautofmt.cxx
+++ b/sw/source/ui/table/tautofmt.cxx
@@ -184,13 +184,13 @@ SwAutoFormatDlg::SwAutoFormatDlg( Window* pParent, SwWrtShell* pWrtShell,
//
aFlFormat ( this, SW_RES( FL_FORMAT ) ),
aLbFormat ( this, SW_RES( LB_FORMAT ) ),
+ aFlFormats ( this, SW_RES( FL_FORMATS ) ),
aBtnNumFormat ( this, SW_RES( BTN_NUMFORMAT ) ),
aBtnBorder ( this, SW_RES( BTN_BORDER ) ),
aBtnFont ( this, SW_RES( BTN_FONT ) ),
aBtnPattern ( this, SW_RES( BTN_PATTERN ) ),
aBtnAlignment ( this, SW_RES( BTN_ALIGNMENT ) ),
- aFlFormats ( this, SW_RES( FL_FORMATS ) ),
aBtnOk ( this, SW_RES( BTN_OK ) ),
aBtnCancel ( this, SW_RES( BTN_CANCEL ) ),
aBtnHelp ( this, SW_RES( BTN_HELP ) ),
diff --git a/sw/source/ui/uiview/pview.cxx b/sw/source/ui/uiview/pview.cxx
index a3eb75e924..c41bff7f17 100644
--- a/sw/source/ui/uiview/pview.cxx
+++ b/sw/source/ui/uiview/pview.cxx
@@ -1271,6 +1271,7 @@ void SwPagePreView::Init(const SwViewOption * pPrefs)
aOpt.SetTable( sal_True );
aOpt.SetSnap( sal_False );
aOpt.SetGridVisible( sal_False );
+
GetViewShell()->ApplyViewOptions( aOpt );
GetViewShell()->ApplyAccessiblityOptions(SW_MOD()->GetAccessibilityOptions());
@@ -1278,13 +1279,6 @@ void SwPagePreView::Init(const SwViewOption * pPrefs)
SwPrintData const aPrintOptions = *SW_MOD()->GetPrtOptions(false);
GetViewShell()->AdjustOptionsForPagePreview( aPrintOptions );
- IDocumentSettingAccess* pIDSA = pESh->getIDocumentSettingAccess();
- if( pIDSA->get(IDocumentSettingAccess::BROWSE_MODE))
- {
- pIDSA->set(IDocumentSettingAccess::BROWSE_MODE, false);
- pESh->CheckBrowseView( sal_True );
- }
-
GetViewShell()->CalcLayout();
DocSzChgd( GetViewShell()->GetDocSize() );
diff --git a/sw/source/ui/uiview/srcview.cxx b/sw/source/ui/uiview/srcview.cxx
index 880574ea65..5c468eb59f 100644
--- a/sw/source/ui/uiview/srcview.cxx
+++ b/sw/source/ui/uiview/srcview.cxx
@@ -306,7 +306,7 @@ void SwSrcView::Init()
aEditWin.SetReadonly(sal_True);
}
-// StartListening(*GetViewFrame());
+ SetNewWindowAllowed( sal_False );
StartListening(*pDocShell,sal_True);
}
diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx
index 0666533454..b1c8911c86 100644
--- a/sw/source/ui/uiview/view.cxx
+++ b/sw/source/ui/uiview/view.cxx
@@ -214,6 +214,13 @@ void SwView::GotFocus() const
const_cast< SwView* >( this )->AttrChangedNotify( pWrtShell );
}
}
+ if( GetWrtShellPtr() )
+ {
+ SwWrtShell& rWrtShell = GetWrtShell();
+ rWrtShell.GetDoc()->SetCurrentViewShell( GetWrtShellPtr() );
+ rWrtShell.GetDoc()->set( IDocumentSettingAccess::BROWSE_MODE,
+ rWrtShell.GetViewOptions()->getBrowseMode() );
+ }
}
/*--------------------------------------------------------------------
@@ -739,7 +746,6 @@ void SwView::_CheckReadonlySelection()
SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
: SfxViewShell( _pFrame, SWVIEWFLAGS ),
-
aPageStr( SW_RES( STR_PAGE )),
nNewPage(USHRT_MAX),
pNumRuleNodeFromDoc(0), // #i23726#
@@ -820,9 +826,7 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
//! get lingu options without loading lingu DLL
SvtLinguOptions aLinguOpt;
-
SvtLinguConfig().GetOptions( aLinguOpt );
-
aUsrPref.SetOnlineSpell( aLinguOpt.bIsSpellAuto );
sal_Bool bOldShellWasSrcView = sal_False;
@@ -831,46 +835,42 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
// document
SfxViewShell* pExistingSh = 0;
if ( pOldSh )
- pExistingSh = pOldSh;
- else
{
- SfxViewFrame *pF = SfxViewFrame::GetFirst( pDocSh );
- if( pF == _pFrame )
- pF = SfxViewFrame::GetNext( *pF, pDocSh );
- if( pF )
- pExistingSh = pF->GetViewShell();
- }
-
- // determine type of existing view
- if( pExistingSh &&
- pExistingSh->IsA( TYPE( SwPagePreView ) ) )
- {
- sSwViewData = ((SwPagePreView*)pExistingSh)->GetPrevSwViewData();
- sNewCrsrPos = ((SwPagePreView*)pExistingSh)->GetNewCrsrPos();
- nNewPage = ((SwPagePreView*)pExistingSh)->GetNewPage();
- bOldShellWasPagePreView = sal_True;
+ pExistingSh = pOldSh;
+ // determine type of existing view
+ if( pExistingSh->IsA( TYPE( SwPagePreView ) ) )
+ {
+ sSwViewData = ((SwPagePreView*)pExistingSh)->GetPrevSwViewData();
+ sNewCrsrPos = ((SwPagePreView*)pExistingSh)->GetNewCrsrPos();
+ nNewPage = ((SwPagePreView*)pExistingSh)->GetNewPage();
+ bOldShellWasPagePreView = sal_True;
+ }
+ else if( pExistingSh->IsA( TYPE( SwSrcView ) ) )
+ bOldShellWasSrcView = sal_True;
}
- else if( pExistingSh &&
- pExistingSh->IsA( TYPE( SwSrcView ) ) )
- bOldShellWasSrcView = sal_True;
RTL_LOGFILE_CONTEXT_TRACE( aLog, "before create WrtShell" );
if(PTR_CAST( SwView, pExistingSh))
{
pWrtShell = new SwWrtShell( *((SwView*)pExistingSh)->pWrtShell,
pEditWin, *this);
-//MA: Das kann doch nur zu einem GPF fuehren!
-// nSelectionType = ((SwView*)pOldSh)->nSelectionType;
+ }
+ else if( dynamic_cast<SwWrtShell*>( pDocSh->GetDoc()->GetCurrentViewShell() ) )
+ {
+ pWrtShell = new SwWrtShell( *(SwWrtShell*)pDocSh->GetDoc()->GetCurrentViewShell(),
+ pEditWin, *this);
}
else
{
SwDoc& rDoc = *((SwDocShell*)pDocSh)->GetDoc();
if( !bOldShellWasSrcView && pWebDShell && !bOldShellWasPagePreView )
- rDoc.set(IDocumentSettingAccess::BROWSE_MODE, true);
+ aUsrPref.setBrowseMode( sal_True );
+ else if( rDoc.IsLoaded() )
+ aUsrPref.setBrowseMode( rDoc.get(IDocumentSettingAccess::BROWSE_MODE) );
//Fuer den BrowseMode wollen wir keinen Factor uebernehmen.
- if( rDoc.get(IDocumentSettingAccess::BROWSE_MODE) && aUsrPref.GetZoomType() != SVX_ZOOM_PERCENT )
+ if( aUsrPref.getBrowseMode() && aUsrPref.GetZoomType() != SVX_ZOOM_PERCENT )
{
aUsrPref.SetZoomType( SVX_ZOOM_PERCENT );
aUsrPref.SetZoom( 100 );
@@ -975,8 +975,10 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
pWrtShell->DoUndo( 0 != SW_MOD()->GetUndoOptions().GetUndoCount() );
- const sal_Bool bBrowse = pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
+ const sal_Bool bBrowse = pWrtShell->GetViewOptions()->getBrowseMode();
+ // Disable "multiple window"
SetNewWindowAllowed(!bBrowse);
+ // End of disabled multiple window
ShowVScrollbar(aUsrPref.IsViewVScrollBar());
ShowHScrollbar(aUsrPref.IsViewHScrollBar());
@@ -1037,10 +1039,6 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
}
- /*uno::Reference< awt::XWindow > aTmpRef;
- _pFrame->GetFrame().GetFrameInterface()->setComponent( aTmpRef,
- pViewImpl->GetUNOObject_Impl());*/
-
uno::Reference< frame::XFrame > xFrame = pVFrame->GetFrame().GetFrameInterface();
uno::Reference< frame::XFrame > xBeamerFrame = xFrame->findFrame(
@@ -1064,14 +1062,8 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
if(bOldModifyFlag)
pDocSh->EnableSetModified( sal_True );
InvalidateBorder();
-
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
SwView::~SwView()
{
delete mpPostItMgr;
@@ -1119,11 +1111,6 @@ SwView::~SwView()
delete pFormatClipboard;
}
-/*--------------------------------------------------------------------
- Beschreibung: DocShell rausgrabbeln ueber das FrameWindow
- --------------------------------------------------------------------*/
-
-
SwDocShell* SwView::GetDocShell()
{
SfxObjectShell* pDocShell = GetViewFrame()->GetObjectShell();
@@ -1187,7 +1174,7 @@ void SwView::ReadUserData( const String &rUserData, sal_Bool bBrowse )
if ( rUserData.GetTokenCount() > 1 &&
//Fuer Dokumente ohne Layout nur im OnlineLayout oder beim
//Forward/Backward
- (!pWrtShell->IsNewLayout() || pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) || bBrowse) )
+ (!pWrtShell->IsNewLayout() || pWrtShell->GetViewOptions()->getBrowseMode() || bBrowse) )
{
//#i43146# go to the last editing position when opening own files
bool bIsOwnDocument = lcl_IsOwnDocument( *this );
@@ -1210,7 +1197,7 @@ void SwView::ReadUserData( const String &rUserData, sal_Bool bBrowse )
nRight = rUserData.GetToken(0, ';', nPos ).ToInt32(),
nBottom= rUserData.GetToken(0, ';', nPos ).ToInt32();
- const long nAdd = pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ? DOCUMENTBORDER : DOCUMENTBORDER*2;
+ const long nAdd = pWrtShell->GetViewOptions()->getBrowseMode() ? DOCUMENTBORDER : DOCUMENTBORDER*2;
if ( nBottom <= (pWrtShell->GetDocSize().Height()+nAdd) )
{
pWrtShell->EnableSmooth( sal_False );
@@ -1219,7 +1206,7 @@ void SwView::ReadUserData( const String &rUserData, sal_Bool bBrowse )
sal_uInt16 nOff = 0;
SvxZoomType eZoom;
- if( !pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ if( !pWrtShell->GetViewOptions()->getBrowseMode() )
eZoom = (SvxZoomType) (sal_uInt16)rUserData.GetToken(nOff, ';', nPos ).ToInt32();
else
{
@@ -1310,7 +1297,7 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue >
//#i43146# go to the last editing position when opening own files
bool bIsOwnDocument = lcl_IsOwnDocument( *this );
sal_Int32 nLength = rSequence.getLength();
- if (nLength && (!pWrtShell->IsNewLayout() || pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) || bBrowse) )
+ if (nLength && (!pWrtShell->IsNewLayout() || pWrtShell->GetViewOptions()->getBrowseMode() || bBrowse) )
{
SET_CURR_SHELL(pWrtShell);
const beans::PropertyValue *pValue = rSequence.getConstArray();
@@ -1400,7 +1387,7 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue >
if (bGotVisibleBottom)
{
Point aCrsrPos( nX, nY );
- const long nAdd = pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ? DOCUMENTBORDER : DOCUMENTBORDER*2;
+ const long nAdd = pWrtShell->GetViewOptions()->getBrowseMode() ? DOCUMENTBORDER : DOCUMENTBORDER*2;
if (nBottom <= (pWrtShell->GetDocSize().Height()+nAdd) )
{
pWrtShell->EnableSmooth( sal_False );
@@ -1408,7 +1395,7 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue >
sal_uInt16 nOff = 0;
SvxZoomType eZoom;
- if ( !pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ if ( !pWrtShell->GetViewOptions()->getBrowseMode() )
eZoom = static_cast < SvxZoomType > ( nZoomType );
else
{
diff --git a/sw/source/ui/uiview/view0.cxx b/sw/source/ui/uiview/view0.cxx
index 87ebb24116..7fa27ae688 100644
--- a/sw/source/ui/uiview/view0.cxx
+++ b/sw/source/ui/uiview/view0.cxx
@@ -49,15 +49,17 @@
#include <sfx2/bindings.hxx>
#include <uivwimp.hxx>
#include <avmedia/mediaplayer.hxx>
+//#include <swlinguconfig.hxx>
#include <swmodule.hxx>
#include <sfx2/objface.hxx>
#include <navipi.hxx>
#include <wrtsh.hxx>
-#include "doc.hxx"
+#include <edtwin.hxx>
#include "view.hxx"
#include "basesh.hxx"
#include "docsh.hxx"
+#include "doc.hxx"
#include "globals.hrc"
#include "cmdid.h" // FN_ ...
#include "globdoc.hxx"
@@ -219,6 +221,46 @@ void lcl_SetViewMetaChars( SwViewOption& rVOpt, sal_Bool bOn)
}
}
+void SwView::RecheckBrowseMode()
+{
+ // OS: numerische Reihenfolge beachten!
+ static sal_uInt16 __READONLY_DATA aInva[] =
+ {
+ //SID_NEWWINDOW,/*5620*/
+ SID_BROWSER_MODE, /*6313*/
+ SID_RULER_BORDERS, SID_RULER_PAGE_POS,
+ //SID_ATTR_LONG_LRSPACE,
+ SID_HTML_MODE,
+ SID_RULER_PROTECT,
+ //SID_AUTOSPELL_CHECK,
+ //SID_AUTOSPELL_MARKOFF,
+ FN_RULER, /*20211*/
+ FN_VIEW_GRAPHIC, /*20213*/
+ FN_VIEW_BOUNDS, /**/
+ FN_VIEW_FIELDS, /*20215*/
+ FN_VLINEAL, /*20216*/
+ FN_VSCROLLBAR, /*20217*/
+ FN_HSCROLLBAR, /*20218*/
+ FN_VIEW_META_CHARS, /**/
+ FN_VIEW_MARKS, /**/
+ //FN_VIEW_FIELDNAME, /**/
+ FN_VIEW_TABLEGRID, /*20227*/
+ FN_PRINT_LAYOUT, /*20237*/
+ FN_QRY_MERGE, /*20364*/
+ FN_SHADOWCURSOR, /**/
+ 0
+ };
+ // the view must not exist!
+ GetViewFrame()->GetBindings().Invalidate(aInva);
+ CheckVisArea();
+
+ SvxZoomType eType;
+ if( GetWrtShell().GetViewOptions()->getBrowseMode() && SVX_ZOOM_PERCENT != (eType = (SvxZoomType)
+ GetWrtShell().GetViewOptions()->GetZoomType()) )
+ SetZoom( eType );
+ InvalidateBorder();
+}
+
/*--------------------------------------------------------------------
State of view options
--------------------------------------------------------------------*/
@@ -233,7 +275,6 @@ void SwView::StateViewOptions(SfxItemSet &rSet)
while(nWhich)
{
sal_Bool bReadonly = GetDocShell()->IsReadOnly();
- sal_Bool bBrowse = pIDSA ? pIDSA->get( IDocumentSettingAccess::BROWSE_MODE ) : sal_False;
if ( bReadonly && nWhich != FN_VIEW_GRAPHIC )
{
rSet.DisableItem(nWhich);
@@ -252,6 +293,15 @@ void SwView::StateViewOptions(SfxItemSet &rSet)
aBool.SetValue( pOpt->IsViewAnyRuler());
}
break;
+ case SID_BROWSER_MODE:
+ case FN_PRINT_LAYOUT:
+ {
+ sal_Bool bState = pOpt->getBrowseMode();
+ if(FN_PRINT_LAYOUT == nWhich)
+ bState = !bState;
+ aBool.SetValue( bState );
+ }
+ break;
case FN_VIEW_BOUNDS:
aBool.SetValue( SwViewOption::IsDocBoundaries()); break;
case FN_VIEW_GRAPHIC:
@@ -291,7 +341,7 @@ void SwView::StateViewOptions(SfxItemSet &rSet)
case FN_VLINEAL:
aBool.SetValue( 0 != StatVLineal() ); break;
case FN_HSCROLLBAR:
- if(bBrowse)
+ if( pOpt->getBrowseMode() )
{
rSet.DisableItem(nWhich);
nWhich = 0;
@@ -304,7 +354,7 @@ void SwView::StateViewOptions(SfxItemSet &rSet)
aBool.SetValue( pOpt->IsOnlineSpell() );
break;
case FN_SHADOWCURSOR:
- if (pIDSA == 0 || pIDSA->get( IDocumentSettingAccess::BROWSE_MODE ))
+ if (pIDSA == 0 || pOpt->getBrowseMode() )
{
rSet.DisableItem( nWhich );
nWhich = 0;
@@ -334,6 +384,7 @@ void SwView::ExecViewOptions(SfxRequest &rReq)
int eState = STATE_TOGGLE;
sal_Bool bSet = sal_False;
+ bool bBrowseModeChanged = false;
const SfxItemSet *pArgs = rReq.GetArgs();
sal_uInt16 nSlot = rReq.GetSlot();
@@ -390,6 +441,19 @@ void SwView::ExecViewOptions(SfxRequest &rReq)
pOpt->SetCrossHair( bFlag );
break;
+ case SID_BROWSER_MODE:
+ case FN_PRINT_LAYOUT:
+ if( STATE_TOGGLE == eState )
+ bFlag = !pOpt->getBrowseMode();
+ else if( nSlot == FN_PRINT_LAYOUT )
+ bFlag = !bFlag;
+ bBrowseModeChanged = bFlag != pOpt->getBrowseMode();
+ // Disable "multiple layout"
+ GetDocShell()->ToggleBrowserMode( bFlag, this );
+
+ pOpt->setBrowseMode( bFlag );
+ break;
+
case FN_VIEW_NOTES:
if ( STATE_TOGGLE == eState )
bFlag = !pOpt->IsPostIts();
@@ -518,6 +582,11 @@ void SwView::ExecViewOptions(SfxRequest &rReq)
if( !(*rSh.GetViewOptions() == *pOpt ))
{
rSh.ApplyViewOptions( *pOpt );
+ if( bBrowseModeChanged )
+ {
+ RecheckBrowseMode();
+ CheckVisArea();
+ }
//Die UsrPref muessen als Modified gekennzeichnet werden.
//call for initialization
@@ -538,6 +607,8 @@ void SwView::ExecViewOptions(SfxRequest &rReq)
const sal_Bool bLockedView = rSh.IsViewLocked();
rSh.LockView( sal_True ); //lock visible section
GetWrtShell().EndAction();
+ if( bBrowseModeChanged && !bFlag )
+ CalcVisArea( GetEditWin().GetOutputSizePixel() );
rSh.LockView( bLockedView );
delete pOpt;
diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx
index 522a4cadd9..4451203e62 100644
--- a/sw/source/ui/uiview/view2.cxx
+++ b/sw/source/ui/uiview/view2.cxx
@@ -1229,8 +1229,9 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
{
const SwViewOption* pVOpt = rShell.GetViewOptions();
SvxZoomType eZoom = (SvxZoomType) pVOpt->GetZoomType();
- SvxZoomItem aZoom(eZoom, pVOpt->GetZoom());
- if(pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE))
+ SvxZoomItem aZoom(eZoom,
+ pVOpt->GetZoom());
+ if( pVOpt->getBrowseMode() )
{
aZoom.SetValueSet(
SVX_ZOOM_ENABLE_50|
@@ -1581,7 +1582,7 @@ void SwView::ExecuteStatusLine(SfxRequest &rReq)
SfxItemSet aCoreSet(pShell->GetPool(), SID_ATTR_ZOOM, SID_ATTR_ZOOM, SID_ATTR_VIEWLAYOUT, SID_ATTR_VIEWLAYOUT, 0 );
SvxZoomItem aZoom( (SvxZoomType)rViewOptions.GetZoomType(), rViewOptions.GetZoom() );
- const bool bBrowseMode = rSh.getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
+ const bool bBrowseMode = rSh.GetViewOptions()->getBrowseMode();
if( bBrowseMode )
{
aZoom.SetValueSet(
diff --git a/sw/source/ui/uiview/viewport.cxx b/sw/source/ui/uiview/viewport.cxx
index 05e60a203d..3e3e1fcf4b 100644
--- a/sw/source/ui/uiview/viewport.cxx
+++ b/sw/source/ui/uiview/viewport.cxx
@@ -75,7 +75,7 @@ static sal_uInt16 nPgNum = 0;
sal_Bool SwView::IsDocumentBorder()
{
return GetDocShell()->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED ||
- pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ||
+ pWrtShell->GetViewOptions()->getBrowseMode() ||
SVX_ZOOM_PAGEWIDTH_NOBORDER == (SvxZoomType)pWrtShell->GetViewOptions()->GetZoomType();
}
@@ -196,7 +196,7 @@ aDocSz = rSz;
//Wenn Text geloescht worden ist, kann es sein, dass die VisArea hinter
//den sichtbaren Bereich verweist
Rectangle aNewVisArea( aVisArea );
- sal_Bool bModified = false;
+ bool bModified = false;
SwTwips lGreenOffset = IsDocumentBorder() ? DOCUMENTBORDER : DOCUMENTBORDER * 2;
SwTwips lTmp = aDocSz.Width() + lGreenOffset;
@@ -205,7 +205,7 @@ aDocSz = rSz;
lTmp = aNewVisArea.Right() - lTmp;
aNewVisArea.Right() -= lTmp;
aNewVisArea.Left() -= lTmp;
- bModified = sal_True;
+ bModified = true;
}
lTmp = aDocSz.Height() + lGreenOffset;
@@ -214,7 +214,7 @@ aDocSz = rSz;
lTmp = aNewVisArea.Bottom() - lTmp;
aNewVisArea.Bottom() -= lTmp;
aNewVisArea.Top() -= lTmp;
- bModified = sal_True;
+ bModified = true;
}
if ( bModified )
@@ -354,7 +354,7 @@ void SwView::SetVisArea( const Point &rPt, sal_Bool bUpdateScrollbar )
void SwView::CheckVisArea()
{
- pHScrollbar->SetAuto( pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) &&
+ pHScrollbar->SetAuto( pWrtShell->GetViewOptions()->getBrowseMode() &&
!GetViewFrame()->GetFrame().IsInPlace() );
if ( IsDocumentBorder() )
{
@@ -713,7 +713,7 @@ IMPL_LINK( SwView, ScrollHdl, SwScrollbar *, pScrollbar )
if ( pScrollbar->GetType() == SCROLL_DRAG )
pWrtShell->EnableSmooth( sal_False );
- if(!pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) &&
+ if(!pWrtShell->GetViewOptions()->getBrowseMode() &&
pScrollbar->GetType() == SCROLL_DRAG)
{
//Hier wieder auskommentieren wenn das mitscrollen nicht gewuenscht ist.
@@ -881,7 +881,7 @@ void SwView::CalcAndSetBorderPixel( SvBorder &rToFill, sal_Bool /*bInner*/ )
}
//#i32913# in browse mode the visibility of the horizontal scrollbar
// depends on the content (fixed width tables may require a scrollbar)
- if ( pHScrollbar->IsVisible(pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE)) )
+ if ( pHScrollbar->IsVisible(pWrtShell->GetViewOptions()->getBrowseMode()) )
rToFill.Bottom() = nTmp;
SetBorderPixel( rToFill );
@@ -1121,7 +1121,7 @@ void SwView::OuterResizePixel( const Point &rOfst, const Size &rSize )
bInOuterResizePixel = sal_True;
// feststellen, ob Scrollbars angezeigt werden duerfen
- sal_Bool bBrowse = pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
+ sal_Bool bBrowse = pWrtShell->GetViewOptions()->getBrowseMode();
sal_Bool bShowH = sal_False,
bShowV = sal_False,
bAuto = sal_False,
@@ -1214,7 +1214,7 @@ void SwView::OuterResizePixel( const Point &rOfst, const Size &rSize )
pDocSh->SetVisArea(
pDocSh->SfxInPlaceObject::GetVisArea() );*/
if ( pWrtShell->GetViewOptions()->GetZoomType() != SVX_ZOOM_PERCENT &&
- !pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ !pWrtShell->GetViewOptions()->getBrowseMode() )
_SetZoom( aEditSz, (SvxZoomType)pWrtShell->GetViewOptions()->GetZoomType(), 100, sal_True );
pWrtShell->EndAction();
@@ -1274,7 +1274,7 @@ void SwView::SetZoomFactor( const Fraction &rX, const Fraction &rY )
Size SwView::GetOptimalSizePixel() const
{
Size aPgSize;
- if ( pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ if ( pWrtShell->GetViewOptions()->getBrowseMode() )
aPgSize = SvxPaperInfo::GetPaperSize(PAPER_A4);
else
{
diff --git a/sw/source/ui/uiview/viewtab.cxx b/sw/source/ui/uiview/viewtab.cxx
index 03b6dfa5f3..c667b29c0e 100644
--- a/sw/source/ui/uiview/viewtab.cxx
+++ b/sw/source/ui/uiview/viewtab.cxx
@@ -276,9 +276,8 @@ void SwView::ExecTabWin( SfxRequest& rReq )
const sal_uInt16 nFrmType = rSh.IsObjSelected() ?
FRMTYPE_DRAWOBJ :
rSh.GetFrmType(0,sal_True);
- const sal_Bool bFrmSelection = rSh.IsFrmSelected();
- const sal_Bool bBrowse = rSh.getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
-
+ const sal_Bool bFrmSelection = rSh.IsFrmSelected();
+ const sal_Bool bBrowse = rSh.GetViewOptions()->getBrowseMode();
const sal_uInt16 nSlot = rReq.GetSlot();
const sal_uInt16 nDescId = rSh.GetCurPageDesc();
@@ -313,8 +312,14 @@ void SwView::ExecTabWin( SfxRequest& rReq )
SwFrmFmt* pFmt = ((SwFrmFmt*)rSh.GetFlyFrmFmt());
const SwRect &rRect = rSh.GetAnyCurRect(RECT_FLY_EMBEDDED);
- sal_Bool bRTL;
- sal_Bool bVerticalFrame = (bFrmSelection && rSh.IsFrmVertical(sal_True, bRTL))|| (!bFrmSelection && bVerticalWriting);
+ sal_Bool bVerticalFrame(sal_False);
+ {
+ sal_Bool bRTL;
+ sal_Bool bVertL2R;
+ bVerticalFrame = ( bFrmSelection &&
+ rSh.IsFrmVertical(sal_True, bRTL, bVertL2R) ) ||
+ ( !bFrmSelection && bVerticalWriting);
+ }
long nDeltaX = bVerticalFrame ?
rRect.Right() - rPageRect.Right() + aLongLR.GetRight() :
rPageRect.Left() + aLongLR.GetLeft() - rRect.Left();
@@ -452,7 +457,10 @@ void SwView::ExecTabWin( SfxRequest& rReq )
RES_VERT_ORIENT, RES_HORI_ORIENT, 0 );
//which of the orientation attributes is to be put depends on the frame's environment
sal_Bool bRTL;
- if((bFrmSelection && rSh.IsFrmVertical(sal_True, bRTL))|| (!bFrmSelection && bVerticalWriting))
+ sal_Bool bVertL2R;
+ if ( ( bFrmSelection &&
+ rSh.IsFrmVertical(sal_True, bRTL, bVertL2R ) ) ||
+ ( !bFrmSelection && bVerticalWriting ) )
{
SwFmtHoriOrient aHoriOrient(pFmt->GetHoriOrient());
aHoriOrient.SetHoriOrient(text::HoriOrientation::NONE);
@@ -914,8 +922,7 @@ void SwView::StateTabWin(SfxItemSet& rSet)
: rSh.GetFrmType( pPt, sal_True );
const sal_Bool bFrmSelection = rSh.IsFrmSelected();
-
- const sal_Bool bBrowse = rSh.getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
+ const sal_Bool bBrowse = rSh.GetViewOptions()->getBrowseMode();
// PageOffset/Begrenzer
const SwRect& rPageRect = rSh.GetAnyCurRect( RECT_PAGE, pPt );
const SwRect& rPagePrtRect = rSh.GetAnyCurRect( RECT_PAGE_PRT, pPt );
@@ -1274,8 +1281,13 @@ void SwView::StateTabWin(SfxItemSet& rSet)
case SID_RULER_BORDERS_VERTICAL:
case SID_RULER_BORDERS:
{
- sal_Bool bFrameRTL;
- sal_Bool bFrameHasVerticalColumns = rSh.IsFrmVertical(sal_False, bFrameRTL) && bFrmSelection;
+ sal_Bool bFrameHasVerticalColumns(sal_False);
+ {
+ sal_Bool bFrameRTL;
+ sal_Bool bFrameVertL2R;
+ bFrameHasVerticalColumns = rSh.IsFrmVertical(sal_False, bFrameRTL, bFrameVertL2R) &&
+ bFrmSelection;
+ }
sal_Bool bHasTable = ( IsTabColFromDoc() ||
( rSh.GetTableFmt() && !bFrmSelection &&
!(nFrmType & FRMTYPE_COLSECT ) ) );
@@ -1498,8 +1510,13 @@ void SwView::StateTabWin(SfxItemSet& rSet)
case SID_RULER_ROWS :
case SID_RULER_ROWS_VERTICAL:
{
- sal_Bool bFrameRTL;
- sal_Bool bFrameHasVerticalColumns = rSh.IsFrmVertical(sal_False, bFrameRTL) && bFrmSelection;
+ sal_Bool bFrameHasVerticalColumns(sal_False);
+ {
+ sal_Bool bFrameRTL;
+ sal_Bool bFrameVertL2R;
+ bFrameHasVerticalColumns = rSh.IsFrmVertical(sal_False, bFrameRTL, bFrameVertL2R) &&
+ bFrmSelection;
+ }
if( ( (SID_RULER_ROWS == nWhich) &&
((!bVerticalWriting && !bFrmSelection) || (bFrmSelection && !bFrameHasVerticalColumns)) ) ||
diff --git a/sw/source/ui/uno/unomod.cxx b/sw/source/ui/uno/unomod.cxx
index 20ff10b7f8..96dc926a3d 100644
--- a/sw/source/ui/uno/unomod.cxx
+++ b/sw/source/ui/uno/unomod.cxx
@@ -776,8 +776,13 @@ void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, c
break;
case HANDLE_VIEWSET_ONLINE_LAYOUT :
{
- if( pView && !bVal != !pView->GetWrtShell().getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
- pView->GetDocShell()->ToggleBrowserMode(bVal, pView );
+ if( pView && !bVal != !pView->GetWrtShell().GetViewOptions()->getBrowseMode() )
+ {
+ SwViewOption aOpt( *pView->GetWrtShell().GetViewOptions() );
+ aOpt.setBrowseMode( bVal );
+ pView->GetWrtShell().ApplyViewOptions( aOpt );
+ pView->RecheckBrowseMode();
+ }
}
break;
case HANDLE_VIEWSET_HELP_URL :
@@ -963,7 +968,7 @@ void SwXViewSettings::_getSingleValue( const comphelper::PropertyInfo & rInfo, u
break;
case HANDLE_VIEWSET_ONLINE_LAYOUT:
if(pView)
- bBoolVal = pView->GetWrtShell().getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
+ bBoolVal = pView->GetWrtShell().GetViewOptions()->getBrowseMode();
break;
case HANDLE_VIEWSET_HELP_URL :
{
diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx
index fb034d41bd..c8441ea44f 100644..100755
--- a/sw/source/ui/uno/unotxdoc.cxx
+++ b/sw/source/ui/uno/unotxdoc.cxx
@@ -2373,10 +2373,10 @@ void SwXTextDocument::refresh(void) throw( RuntimeException )
::vos::OGuard aGuard(Application::GetSolarMutex());
if(!IsValid())
throw RuntimeException();
- SwWrtShell *pWrtShell = pDocShell->GetWrtShell();
+ ViewShell *pViewShell = pDocShell->GetWrtShell();
notifyRefreshListeners();
- if(pWrtShell)
- pWrtShell->CalcLayout();
+ if(pViewShell)
+ pViewShell->CalcLayout();
}
/*-- 21.02.00 08:41:06---------------------------------------------------
@@ -2678,42 +2678,59 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount(
else
{
SwDocShell *pRenderDocShell = pDoc->GetDocShell();
- SwWrtShell *pWrtShell = pRenderDocShell->GetWrtShell();
- if (bFormat)
+
+ // TODO/mba: we really need a generic way to get the ViewShell!
+ ViewShell* pViewShell = 0;
+ SwView* pSwView = PTR_CAST(SwView, pView);
+ if ( pSwView )
{
- // #i38289
- if(pDoc->get(IDocumentSettingAccess::BROWSE_MODE))
+ pViewShell = pSwView->GetWrtShellPtr();
+ }
+ else
+ {
+ if ( bIsPDFExport && bFormat )
{
- pRenderDocShell->ToggleBrowserMode(false,NULL);
+ //create a hidden view to be able to export as PDF also in print preview
+ //pView and pSwView are not changed intentionally!
+ m_pHiddenViewFrame = SfxViewFrame::LoadHiddenDocument( *pRenderDocShell, 2 );
+ pViewShell = ((SwView*)m_pHiddenViewFrame->GetViewShell())->GetWrtShellPtr();
}
+ else
+ pViewShell = ((SwPagePreView*)pView)->GetViewShell();
+ }
+
+ if (!pViewShell || !pViewShell->GetLayout())
+ return 0;
- if (!pWrtShell)
+ if (bFormat)
+ {
+ // #i38289
+ if( pViewShell->GetViewOptions()->getBrowseMode() )
{
- //create a hidden view to be able to export as PDF also in print preview
- m_pHiddenViewFrame = SfxViewFrame::LoadHiddenDocument( *pRenderDocShell, 2 );
- SwView* pSwView = (SwView*) m_pHiddenViewFrame->GetViewShell();
- pWrtShell = pSwView->GetWrtShellPtr();
+ SwViewOption aOpt( *pViewShell->GetViewOptions() );
+ aOpt.setBrowseMode( false );
+ pViewShell->ApplyViewOptions( aOpt );
+ pSwView->RecheckBrowseMode();
}
// reformating the document for printing will show the changes in the view
// which is likely to produce many unwanted and not nice to view actions.
// We don't want that! Thus we disable updating of the view.
- pWrtShell->StartAction();
+ pViewShell->StartAction();
- const TypeId aSwViewTypeId = TYPE(SwView);
- if (pView->IsA(aSwViewTypeId))
+ if (pSwView)
{
- if (m_pRenderData && m_pRenderData->NeedNewViewOptionAdjust( *pWrtShell ) )
+ if (m_pRenderData && m_pRenderData->NeedNewViewOptionAdjust( *pViewShell ) )
m_pRenderData->ViewOptionAdjustStop();
if (m_pRenderData && !m_pRenderData->IsViewOptionAdjust())
- m_pRenderData->ViewOptionAdjustStart( *pWrtShell, *pWrtShell->GetViewOptions() );
+ m_pRenderData->ViewOptionAdjustStart( *pViewShell, *pViewShell->GetViewOptions() );
}
m_pRenderData->SetSwPrtOptions( new SwPrintData );
m_pRenderData->MakeSwPrtOptions( m_pRenderData->GetSwPrtOptionsRef(), pRenderDocShell,
m_pPrintUIOptions, m_pRenderData, bIsPDFExport );
-
- if (pView->IsA(aSwViewTypeId))
+
+ if (pSwView)
{
// PDF export should not make use of the SwPrtOptions
const SwPrintData *pPrtOptions = (bIsPDFExport)
@@ -2723,7 +2740,7 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount(
// since printing now also use the API for PDF export this option
// should be set for printing as well ...
- pWrtShell->SetPDFExportOption( sal_True );
+ pViewShell->SetPDFExportOption( sal_True );
bool bOrigStatus = pRenderDocShell->IsEnableSetModified();
// check configuration: shall update of printing information in DocInfo set the document to "modified"?
bool bStateChanged = false;
@@ -2733,9 +2750,8 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount(
bStateChanged = true;
}
-
// --> FME 2005-05-23 #122919# Force field update before PDF export:
- pWrtShell->ViewShell::UpdateFlds(sal_True);
+ pViewShell->ViewShell::UpdateFlds(sal_True);
// <--
if( bStateChanged )
pRenderDocShell->EnableSetModified( sal_True );
@@ -2743,17 +2759,16 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount(
// there is some redundancy between those two function calls, but right now
// there is no time to sort this out.
//TODO: check what exatly needs to be done and make just one function for that
- pWrtShell->CalcLayout();
- pWrtShell->CalcPagesForPrint( pDoc->GetPageCount() );
+ pViewShell->CalcLayout();
+ pViewShell->CalcPagesForPrint( pViewShell->GetPageCount() );
- pWrtShell->SetPDFExportOption( sal_False );
-
+ pViewShell->SetPDFExportOption( sal_False );
// enable view again
- pWrtShell->EndAction();
+ pViewShell->EndAction();
}
- const sal_Int32 nPageCount = pDoc->GetPageCount();
+ const sal_Int32 nPageCount = pViewShell->GetPageCount();
//
// get number of pages to be rendered
@@ -2761,7 +2776,7 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount(
const bool bPrintProspect = m_pPrintUIOptions->getBoolValue( "PrintProspect", false );
if (bPrintProspect)
{
- pDoc->CalculatePagePairsForProspectPrinting( *m_pRenderData, *m_pPrintUIOptions, nPageCount );
+ pDoc->CalculatePagePairsForProspectPrinting( *pViewShell->GetLayout(), *m_pRenderData, *m_pPrintUIOptions, nPageCount );
nRet = m_pRenderData->GetPagePairsForProspectPrinting().size();
}
else
@@ -2770,12 +2785,12 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount(
if (nPostItMode != POSTITS_NONE)
{
OutputDevice *pOutDev = lcl_GetOutputDevice( *m_pPrintUIOptions );
- m_pRenderData->CreatePostItData( pDoc, pWrtShell->GetViewOptions(), pOutDev );
+ m_pRenderData->CreatePostItData( pDoc, pViewShell->GetViewOptions(), pOutDev );
}
// get set of valid document pages (according to the current settings)
// and their start frames
- pDoc->CalculatePagesForPrinting( *m_pRenderData, *m_pPrintUIOptions, bIsPDFExport, nPageCount );
+ pDoc->CalculatePagesForPrinting( *pViewShell->GetLayout(), *m_pRenderData, *m_pPrintUIOptions, bIsPDFExport, nPageCount );
if (nPostItMode != POSTITS_NONE)
{
@@ -2831,6 +2846,15 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwXTextDocument::getRenderer(
// Thus instead of throwing the exception we silently return.
if (0 > nRenderer)
throw IllegalArgumentException();
+
+ // TODO/mba: we really need a generic way to get the ViewShell!
+ ViewShell* pVwSh = 0;
+ SwView* pSwView = PTR_CAST(SwView, pView);
+ if ( pSwView )
+ pVwSh = pSwView->GetWrtShellPtr();
+ else
+ pVwSh = ((SwPagePreView*)pView)->GetViewShell();
+
sal_Int32 nMaxRenderer = 0;
if (!bIsSwSrcView && m_pRenderData)
{
@@ -2891,20 +2915,37 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwXTextDocument::getRenderer(
aTmpSize = pPrinter->LogicToLogic( aTmpSize,
pPrinter->GetMapMode(), MapMode( MAP_100TH_MM ));
aPageSize = awt::Size( aTmpSize.Width(), aTmpSize.Height() );
+ #if 0
+ // #i115048# it seems users didn't like getting double the formatted page size
+ // revert to "old" behavior scaling to the current paper size of the printer
if (bPrintProspect)
{
// we just state what output size we would need
// which may cause vcl to set that page size on the printer
// (if available and not overriden by the user)
- aTmpSize = pDoc->GetPageSize( nPage, bIsSkipEmptyPages );
+ aTmpSize = pVwSh->GetPageSize( nPage, bIsSkipEmptyPages );
aPreferredPageSize = awt::Size ( TWIP_TO_MM100( 2 * aTmpSize.Width() ),
TWIP_TO_MM100( aTmpSize.Height() ));
}
+ #else
+ if( bPrintProspect )
+ {
+ // just switch to an appropriate portrait/landscape format
+ // FIXME: brochure printing with landscape pages puts the
+ // pages next to each other, so landscape is currently always
+ // the better choice
+ if( aPageSize.Width < aPageSize.Height )
+ {
+ aPreferredPageSize.Width = aPageSize.Height;
+ aPreferredPageSize.Height = aPageSize.Width;
+ }
+ }
+ #endif
}
}
else
{
- aTmpSize = pDoc->GetPageSize( nPage, bIsSkipEmptyPages );
+ aTmpSize = pVwSh->GetPageSize( nPage, bIsSkipEmptyPages );
aPageSize = awt::Size ( TWIP_TO_MM100( aTmpSize.Width() ),
TWIP_TO_MM100( aTmpSize.Height() ));
}
@@ -3043,9 +3084,12 @@ void SAL_CALL SwXTextDocument::render(
ViewShell* pVwSh = 0;
if (pView)
{
- pVwSh = pView->IsA(aSwViewTypeId) ?
- ((SwView*)pView)->GetWrtShellPtr() :
- ((SwPagePreView*)pView)->GetViewShell();
+ // TODO/mba: we really need a generic way to get the ViewShell!
+ SwView* pSwView = PTR_CAST(SwView, pView);
+ if ( pSwView )
+ pVwSh = pSwView->GetWrtShellPtr();
+ else
+ pVwSh = ((SwPagePreView*)pView)->GetViewShell();
}
// get output device to use
@@ -3314,7 +3358,7 @@ uno::Sequence< lang::Locale > SAL_CALL SwXTextDocument::getDocumentLanguages(
}
}
- //get languages from "drawobject"
+ //TODO/mba: it's a strange concept that a view is needed to retrieve core data
SwWrtShell *pWrtSh = pDocShell->GetWrtShell();
SdrView *pSdrView = pWrtSh->GetDrawView();
@@ -4096,7 +4140,7 @@ void SwXDocumentPropertyHelper::onChange()
/*****************************************************************************/
-SwViewOptionAdjust_Impl::SwViewOptionAdjust_Impl( SwWrtShell& rSh, const SwViewOption &rViewOptions ) :
+SwViewOptionAdjust_Impl::SwViewOptionAdjust_Impl( ViewShell& rSh, const SwViewOption &rViewOptions ) :
m_rShell( rSh ),
m_aOldViewOptions( rViewOptions )
{
diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx
index 84854a0f29..e23a18436f 100644..100755
--- a/sw/source/ui/uno/unotxvw.cxx
+++ b/sw/source/ui/uno/unotxvw.cxx
@@ -81,7 +81,7 @@
#include <unocrsrhelper.hxx>
#include <unotextrange.hxx>
#include <sfx2/docfile.hxx>
-
+#include <switerator.hxx>
#include "swdtflvr.hxx"
#include <vcl/svapp.hxx>
@@ -421,8 +421,8 @@ sal_Bool SwXTextView::select(const uno::Any& aInterface) throw( lang::IllegalArg
{
rSh.EnterStdMode();
rSh.GotoMark(pMark);
+ return sal_True;
}
- return sal_True;
}
// IndexMark, Index, TextField, Draw, Section, Footnote, Paragraph
//
@@ -575,9 +575,7 @@ uno::Any SwXTextView::getSelection(void) throw( uno::RuntimeException )
const SwFrmFmt* pFmt = rSh.GetFlyFrmFmt();
if (pFmt)
{
- SwXFrame* pxFrame = (SwXFrame*)SwClientIter((SwFrmFmt&)*pFmt).
- First(TYPE(SwXFrame));
-
+ SwXFrame* pxFrame = SwIterator<SwXFrame,SwFmt>::FirstElement(*pFmt);
if(pxFrame) //das einzige gemeinsame interface fuer alle Frames
{
aRef = uno::Reference< uno::XInterface >((cppu::OWeakObject*)pxFrame, uno::UNO_QUERY);
@@ -1056,7 +1054,7 @@ uno::Any SAL_CALL SwXTextView::getPropertyValue(
sal_Int32 nCount = -1;
if (nWID == WID_PAGE_COUNT)
- nCount = m_pView->GetDocShell()->GetDoc()->GetPageCount();
+ nCount = m_pView->GetWrtShell().GetPageCount();
else // WID_LINE_COUNT
nCount = m_pView->GetWrtShell().GetLineCount( sal_False /*of whole document*/ );
aRet <<= nCount;
diff --git a/sw/source/ui/utlui/navipi.cxx b/sw/source/ui/utlui/navipi.cxx
index fd066e43a9..5dbe797c18 100644
--- a/sw/source/ui/utlui/navipi.cxx
+++ b/sw/source/ui/utlui/navipi.cxx
@@ -80,6 +80,8 @@
#include <utlui.hrc>
#endif
+#include "access.hrc"
+
#include <unomid.h>
@@ -807,7 +809,9 @@ SwNavigationPI::SwNavigationPI( SfxBindings* _pBindings,
&aContentToolBox, SW_RES(NF_PAGE ));
pEdit->SetActionHdl(LINK(this, SwNavigationPI, EditAction));
pEdit->SetGetFocusHdl(LINK(this, SwNavigationPI, EditGetFocus));
- pEdit->SetModifyHdl(LINK(this, SwNavigationPI, PageEditModifyHdl));
+ pEdit->SetAccessibleName(pEdit->GetQuickHelpText());
+ pEdit->SetUpHdl(LINK(this, SwNavigationPI, PageEditModifyHdl));
+ pEdit->SetDownHdl(LINK(this, SwNavigationPI, PageEditModifyHdl));
bPageCtrlsVisible = sal_True;
@@ -933,6 +937,10 @@ SwNavigationPI::SwNavigationPI( SfxBindings* _pBindings,
UsePage(0);
aPageChgTimer.SetTimeoutHdl(LINK(this, SwNavigationPI, ChangePageHdl));
aPageChgTimer.SetTimeout(PAGE_CHANGE_TIMEOUT);
+
+ aContentTree.SetAccessibleName(SW_RESSTR(STR_ACCESS_TL_CONTENT));
+ aGlobalTree.SetAccessibleName(SW_RESSTR(STR_ACCESS_TL_GLOBAL));
+ aDocListBox.SetAccessibleName(aStatusArr[3]);
}
/*------------------------------------------------------------------------
diff --git a/sw/source/ui/utlui/navipi.hrc b/sw/source/ui/utlui/navipi.hrc
index e8a6dc2e39..f7d1e1c329 100644
--- a/sw/source/ui/utlui/navipi.hrc
+++ b/sw/source/ui/utlui/navipi.hrc
@@ -88,4 +88,3 @@
#define ST_POSTIT_SHOW (ST_GLOBAL_CONTEXT_FIRST +35)
#define ST_POSTIT_HIDE (ST_GLOBAL_CONTEXT_FIRST +36)
#define ST_POSTIT_DELETE (ST_GLOBAL_CONTEXT_FIRST +37)
-
diff --git a/sw/source/ui/utlui/navipi.src b/sw/source/ui/utlui/navipi.src
index fd83ec9067..ff2522d9bd 100644
--- a/sw/source/ui/utlui/navipi.src
+++ b/sw/source/ui/utlui/navipi.src
@@ -29,6 +29,7 @@
#include "utlui.hrc"
#include "navipi.hrc"
#include "helpid.h"
+#include "access.hrc"
Window DLG_NAVIGATION_PI
{
@@ -534,3 +535,15 @@ ImageList IMG_NAVI_ENTRYBMPH
MaskColor = IMAGE_MASK_COLOR ;
NAVI_ENTRY_IDS
};
+
+//IAccessibility2 Implementation 2009-----
+String STR_ACCESS_TL_GLOBAL
+{
+ Text [ en-US ] = "Global View";
+};
+String STR_ACCESS_TL_CONTENT
+{
+ Text [ en-US ] = "Content View";
+};
+//-----IAccessibility2 Implementation 2009
+
diff --git a/sw/source/ui/utlui/poolfmt.src b/sw/source/ui/utlui/poolfmt.src
index e7bd9dd7d5..909296c8c2 100644
--- a/sw/source/ui/utlui/poolfmt.src
+++ b/sw/source/ui/utlui/poolfmt.src
@@ -738,7 +738,28 @@ String STR_POOLCHR_RUBYTEXT
{
Text [ en-US ] = "Rubies";
};
-
+//IAccessibility2 Implementation 2009-----
+String STR_COLUMN_VALUESET_ITEM0
+{
+ Text [ en-US ] = "1 column";
+};
+String STR_COLUMN_VALUESET_ITEM1
+{
+ Text [ en-US ] = "2 columns with equal size";
+};
+String STR_COLUMN_VALUESET_ITEM2
+{
+ Text [ en-US ] = "3 columns with equal size";
+};
+String STR_COLUMN_VALUESET_ITEM3
+{
+ Text [ en-US ] = "2 columns with different size (left > right)";
+};
+String STR_COLUMN_VALUESET_ITEM4
+{
+ Text [ en-US ] = "2 columns with different size (left < right)";
+};
+//-----IAccessibility2 Implementation 2009
String STR_POOLCHR_VERT_NUM
{
Text [ en-US ] = "Vertical Numbering Symbols";
diff --git a/sw/source/ui/utlui/swrenamexnameddlg.cxx b/sw/source/ui/utlui/swrenamexnameddlg.cxx
index 7c774be049..29f58799cf 100644
--- a/sw/source/ui/utlui/swrenamexnameddlg.cxx
+++ b/sw/source/ui/utlui/swrenamexnameddlg.cxx
@@ -72,9 +72,9 @@ SwRenameXNamedDlg::SwRenameXNamedDlg( Window* pWin,
uno::Reference< container::XNamed > & xN,
uno::Reference< container::XNameAccess > & xNA ) :
ModalDialog(pWin, SW_RES(DLG_RENAME_XNAMED)),
- aNewNameFT(this, SW_RES(FT_NEW_NAME)),
- aNewNameED(this, SW_RES(ED_NEW_NAME)),
aNameFL(this, SW_RES(FL_NAME)),
+ aNewNameFT(this, SW_RES(FT_NEW_NAME)),
+ aNewNameED(this, SW_RES(ED_NEW_NAME)),
aOk(this, SW_RES(PB_OK)),
aCancel(this, SW_RES(PB_CANCEL)),
aHelp(this, SW_RES(PB_HELP)),
diff --git a/sw/source/ui/utlui/uitool.cxx b/sw/source/ui/utlui/uitool.cxx
index bbf9888ebf..fe020fff06 100644
--- a/sw/source/ui/utlui/uitool.cxx
+++ b/sw/source/ui/utlui/uitool.cxx
@@ -544,7 +544,7 @@ void SfxToSwPageDescAttr( const SwWrtShell& rShell, SfxItemSet& rSet )
SwPageDesc* pDesc = ((SwWrtShell&)rShell).FindPageDescByName(
rDescName, sal_True );
if( pDesc )
- pDesc->Add( &aPgDesc );
+ aPgDesc.RegisterToPageDesc( *pDesc );
}
rSet.ClearItem( SID_ATTR_PARA_MODEL );
bChanged = sal_True;
@@ -557,7 +557,7 @@ void SfxToSwPageDescAttr( const SwWrtShell& rShell, SfxItemSet& rSet )
{
if( ((SwFmtPageDesc*)pItem)->GetPageDesc() )
{
- ((SwFmtPageDesc*)pItem)->GetPageDesc()->Add(&aPgDesc);
+ aPgDesc.RegisterToPageDesc( *((SwFmtPageDesc*)pItem)->GetPageDesc() );
}
}
}
diff --git a/sw/source/ui/vba/vbainformationhelper.cxx b/sw/source/ui/vba/vbainformationhelper.cxx
index b2f24406f4..3766594550 100644
--- a/sw/source/ui/vba/vbainformationhelper.cxx
+++ b/sw/source/ui/vba/vbainformationhelper.cxx
@@ -32,6 +32,7 @@
#include <doc.hxx>
#include <vbahelper/vbahelper.hxx>
#include <swtypes.hxx>
+#include <viewsh.hxx>
using namespace ::ooo::vba;
using namespace ::com::sun::star;
@@ -58,7 +59,9 @@ double SwVbaInformationHelper::handleWdVerticalPositionRelativeToPage( const css
sal_Int32 nCurrentPos = xTVCursor->getPosition().Y;
sal_Int32 nCurrentPage = handleWdActiveEndPageNumber( xTVCursor );
- sal_Int32 nPageHeight = word::getDocShell( xModel )->GetDoc()->GetPageSize( nCurrentPage, sal_False ).Height();
+ SwDoc* pDoc = word::getDocShell( xModel )->GetDoc();
+ ViewShell* pViewSh = pDoc->GetCurrentViewShell();
+ sal_Int32 nPageHeight = pViewSh ? pViewSh->GetPageSize( nCurrentPage, sal_False ).Height() : 0;
// FIXME: handle multipul page style
// it is very strange that the curros position is incorrect when open Word file.
// e.g. if current cursor in the top left of the text body of the first page without header,
diff --git a/sw/source/ui/vba/wordvbahelper.cxx b/sw/source/ui/vba/wordvbahelper.cxx
index e489b0b69d..9cee87b352 100644
--- a/sw/source/ui/vba/wordvbahelper.cxx
+++ b/sw/source/ui/vba/wordvbahelper.cxx
@@ -34,6 +34,7 @@
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <unotxdoc.hxx>
#include <doc.hxx>
+#include <viewsh.hxx>
using namespace ::com::sun::star;
using namespace ::ooo::vba;
@@ -84,7 +85,8 @@ uno::Reference< style::XStyle > getCurrentPageStyle( const uno::Reference< frame
sal_Int32 getPageCount( const uno::Reference< frame::XModel>& xModel ) throw (uno::RuntimeException)
{
SwDocShell* pDocShell = getDocShell( xModel );
- return pDocShell ? pDocShell->GetDoc()->GetPageCount() : 0;
+ ViewShell* pViewSh = pDocShell ? pDocShell->GetDoc()->GetCurrentViewShell() : 0;
+ return pViewSh ? pViewSh->GetPageCount() : 0;
}
} // word
diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx
index d446d0a6b5..b442ec13e3 100644
--- a/sw/source/ui/wrtsh/wrtsh1.cxx
+++ b/sw/source/ui/wrtsh/wrtsh1.cxx
@@ -98,6 +98,7 @@
#include <ndtxt.hxx>
#include <editeng/acorrcfg.hxx>
#include <IMark.hxx>
+#include <sfx2/bindings.hxx>
// -> #111827#
#include <SwRewriter.hxx>
@@ -1307,6 +1308,9 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum)
// <--
aFmt.SetBulletChar( numfunc::GetBulletChar(static_cast<sal_uInt8>(nLevel)));
aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
+ // #i93908# clear suffix for bullet lists
+ aFmt.SetPrefix(::rtl::OUString());
+ aFmt.SetSuffix(::rtl::OUString());
}
aNumRule.Set(static_cast<sal_uInt16>(nLevel), aFmt);
}
@@ -1370,6 +1374,9 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum)
}
aFmt.SetBulletChar( numfunc::GetBulletChar(nLvl) );
aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
+ // #i93908# clear suffix for bullet lists
+ aFmt.SetPrefix(::rtl::OUString());
+ aFmt.SetSuffix(::rtl::OUString());
}
// --> OD 2009-08-26 #i95907#
@@ -1895,3 +1902,11 @@ String SwWrtShell::GetSelDescr() const
return aResult;
}
+void SwWrtShell::ApplyViewOptions( const SwViewOption &rOpt )
+{
+ SwFEShell::ApplyViewOptions( rOpt );
+ //#i115062# invalidate meta character slot
+ GetView().GetViewFrame()->GetBindings().Invalidate( FN_VIEW_META_CHARS );
+}
+
+
diff --git a/sw/uiconfig/sglobal/menubar/menubar.xml b/sw/uiconfig/sglobal/menubar/menubar.xml
index c3bef67c8c..2426a20c59 100644..100755
--- a/sw/uiconfig/sglobal/menubar/menubar.xml
+++ b/sw/uiconfig/sglobal/menubar/menubar.xml
@@ -195,8 +195,6 @@
<menu:menupopup>
<menu:menuitem menu:id=".uno:InsertObject"/>
<menu:menuitem menu:id=".uno:InsertPlugin"/>
- <menu:menuitem menu:id=".uno:InsertSound"/>
- <menu:menuitem menu:id=".uno:InsertVideo"/>
<menu:menuitem menu:id=".uno:InsertObjectStarMath"/>
<menu:menuitem menu:id=".uno:InsertObjectChart"/>
</menu:menupopup>
diff --git a/sw/uiconfig/sweb/menubar/menubar.xml b/sw/uiconfig/sweb/menubar/menubar.xml
index 4b482e373d..ba12b6c027 100644..100755
--- a/sw/uiconfig/sweb/menubar/menubar.xml
+++ b/sw/uiconfig/sweb/menubar/menubar.xml
@@ -143,8 +143,6 @@
<menu:menupopup>
<menu:menuitem menu:id=".uno:InsertObject"/>
<menu:menuitem menu:id=".uno:InsertPlugin"/>
- <menu:menuitem menu:id=".uno:InsertSound"/>
- <menu:menuitem menu:id=".uno:InsertVideo"/>
<menu:menuitem menu:id=".uno:InsertObjectStarMath"/>
<menu:menuitem menu:id=".uno:InsertObjectChart"/>
</menu:menupopup>
diff --git a/sw/uiconfig/swform/menubar/menubar.xml b/sw/uiconfig/swform/menubar/menubar.xml
index 69b65cfd3e..bb58c81f7d 100644..100755
--- a/sw/uiconfig/swform/menubar/menubar.xml
+++ b/sw/uiconfig/swform/menubar/menubar.xml
@@ -195,8 +195,6 @@
<menu:menupopup>
<menu:menuitem menu:id=".uno:InsertObject"/>
<menu:menuitem menu:id=".uno:InsertPlugin"/>
- <menu:menuitem menu:id=".uno:InsertSound"/>
- <menu:menuitem menu:id=".uno:InsertVideo"/>
<menu:menuitem menu:id=".uno:InsertObjectStarMath"/>
<menu:menuitem menu:id=".uno:InsertObjectChart"/>
</menu:menupopup>
diff --git a/sw/uiconfig/swreport/menubar/menubar.xml b/sw/uiconfig/swreport/menubar/menubar.xml
index 69b65cfd3e..bb58c81f7d 100644..100755
--- a/sw/uiconfig/swreport/menubar/menubar.xml
+++ b/sw/uiconfig/swreport/menubar/menubar.xml
@@ -195,8 +195,6 @@
<menu:menupopup>
<menu:menuitem menu:id=".uno:InsertObject"/>
<menu:menuitem menu:id=".uno:InsertPlugin"/>
- <menu:menuitem menu:id=".uno:InsertSound"/>
- <menu:menuitem menu:id=".uno:InsertVideo"/>
<menu:menuitem menu:id=".uno:InsertObjectStarMath"/>
<menu:menuitem menu:id=".uno:InsertObjectChart"/>
</menu:menupopup>
diff --git a/sw/uiconfig/swriter/menubar/menubar.xml b/sw/uiconfig/swriter/menubar/menubar.xml
index fb10ca615b..3243d6b164 100644..100755
--- a/sw/uiconfig/swriter/menubar/menubar.xml
+++ b/sw/uiconfig/swriter/menubar/menubar.xml
@@ -198,8 +198,6 @@
<menu:menupopup>
<menu:menuitem menu:id=".uno:InsertObject"/>
<menu:menuitem menu:id=".uno:InsertPlugin"/>
- <menu:menuitem menu:id=".uno:InsertSound"/>
- <menu:menuitem menu:id=".uno:InsertVideo"/>
<menu:menuitem menu:id=".uno:InsertObjectStarMath"/>
<menu:menuitem menu:id=".uno:InsertObjectChart"/>
</menu:menupopup>
diff --git a/sw/uiconfig/swxform/menubar/menubar.xml b/sw/uiconfig/swxform/menubar/menubar.xml
index ae0df22748..3a31ab3920 100644..100755
--- a/sw/uiconfig/swxform/menubar/menubar.xml
+++ b/sw/uiconfig/swxform/menubar/menubar.xml
@@ -196,8 +196,6 @@
<menu:menupopup>
<menu:menuitem menu:id=".uno:InsertObject"/>
<menu:menuitem menu:id=".uno:InsertPlugin"/>
- <menu:menuitem menu:id=".uno:InsertSound"/>
- <menu:menuitem menu:id=".uno:InsertVideo"/>
<menu:menuitem menu:id=".uno:InsertObjectStarMath"/>
<menu:menuitem menu:id=".uno:InsertObjectChart"/>
</menu:menupopup>