summaryrefslogtreecommitdiff
path: root/sw/source/core
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2011-02-09 09:49:44 +0100
committerMathias Bauer <mba@openoffice.org>2011-02-09 09:49:44 +0100
commit53b8f0865ff2e59cb71eaf4c1bdbc829238fde6f (patch)
tree31528d76013d09428fad98a3dbc6265345dbbeb9 /sw/source/core
parente22a1e2f5c5ed74c22849c9b5bb59dd8f47bffbc (diff)
parent9730661364792059168a06bfbaacf47fc8daf53c (diff)
CWS swlayoutrefactoring: resync to m100
Diffstat (limited to 'sw/source/core')
-rw-r--r--sw/source/core/SwNumberTree/SwNodeNum.cxx2
-rw-r--r--sw/source/core/access/accdoc.cxx2
-rw-r--r--sw/source/core/access/accmap.cxx2
-rw-r--r--sw/source/core/access/accpara.cxx50
-rw-r--r--sw/source/core/access/accpara.hxx2
-rw-r--r--sw/source/core/access/accportions.cxx48
-rw-r--r--sw/source/core/access/accportions.hxx24
-rw-r--r--sw/source/core/access/acctable.cxx2
-rw-r--r--sw/source/core/access/parachangetrackinginfo.cxx2
-rw-r--r--sw/source/core/access/textmarkuphelper.cxx10
-rw-r--r--sw/source/core/attr/calbck.cxx93
-rw-r--r--sw/source/core/attr/cellatr.cxx12
-rw-r--r--sw/source/core/attr/fmtwrapinfluenceonobjpos.cxx4
-rw-r--r--sw/source/core/attr/format.cxx108
-rw-r--r--sw/source/core/attr/hints.cxx40
-rw-r--r--sw/source/core/attr/swatrset.cxx38
-rw-r--r--sw/source/core/bastyp/bparr.cxx92
-rw-r--r--sw/source/core/bastyp/breakit.cxx12
-rw-r--r--sw/source/core/bastyp/calc.cxx140
-rw-r--r--sw/source/core/bastyp/index.cxx10
-rw-r--r--sw/source/core/bastyp/init.cxx86
-rw-r--r--sw/source/core/bastyp/swcache.cxx46
-rw-r--r--sw/source/core/bastyp/swrect.cxx18
-rw-r--r--sw/source/core/bastyp/swregion.cxx32
-rw-r--r--sw/source/core/bastyp/swtypes.cxx3
-rw-r--r--sw/source/core/bastyp/tabcol.cxx20
-rw-r--r--sw/source/core/crsr/bookmrk.cxx18
-rw-r--r--sw/source/core/crsr/callnk.cxx18
-rw-r--r--sw/source/core/crsr/callnk.hxx12
-rw-r--r--sw/source/core/crsr/crsrsh.cxx541
-rw-r--r--sw/source/core/crsr/crstrvl.cxx339
-rw-r--r--sw/source/core/crsr/crstrvl1.cxx30
-rw-r--r--sw/source/core/crsr/findattr.cxx249
-rw-r--r--sw/source/core/crsr/findcoll.cxx33
-rw-r--r--sw/source/core/crsr/findfmt.cxx14
-rw-r--r--sw/source/core/crsr/findtxt.cxx91
-rw-r--r--sw/source/core/crsr/pam.cxx230
-rw-r--r--sw/source/core/crsr/paminit.cxx14
-rw-r--r--sw/source/core/crsr/swcrsr.cxx458
-rw-r--r--sw/source/core/crsr/trvlcol.cxx8
-rw-r--r--sw/source/core/crsr/trvlfnfl.cxx60
-rw-r--r--sw/source/core/crsr/trvlreg.cxx74
-rw-r--r--sw/source/core/crsr/trvltbl.cxx125
-rw-r--r--sw/source/core/crsr/unocrsr.cxx36
-rw-r--r--sw/source/core/crsr/viscrs.cxx91
-rw-r--r--sw/source/core/doc/SwStyleNameMapper.cxx8
-rw-r--r--sw/source/core/doc/acmplwrd.cxx58
-rw-r--r--sw/source/core/doc/dbgoutsw.cxx105
-rw-r--r--sw/source/core/doc/doc.cxx397
-rw-r--r--sw/source/core/doc/docbasic.cxx26
-rw-r--r--sw/source/core/doc/docbm.cxx105
-rw-r--r--sw/source/core/doc/docchart.cxx12
-rw-r--r--sw/source/core/doc/doccomp.cxx367
-rw-r--r--sw/source/core/doc/doccorr.cxx28
-rw-r--r--sw/source/core/doc/docdde.cxx42
-rw-r--r--sw/source/core/doc/docdesc.cxx218
-rw-r--r--sw/source/core/doc/docdraw.cxx85
-rw-r--r--sw/source/core/doc/docedt.cxx242
-rw-r--r--sw/source/core/doc/docfld.cxx324
-rw-r--r--sw/source/core/doc/docfly.cxx222
-rw-r--r--sw/source/core/doc/docfmt.cxx404
-rw-r--r--sw/source/core/doc/docftn.cxx78
-rw-r--r--sw/source/core/doc/docglbl.cxx71
-rw-r--r--sw/source/core/doc/docglos.cxx26
-rw-r--r--sw/source/core/doc/doclay.cxx293
-rw-r--r--sw/source/core/doc/docnew.cxx162
-rw-r--r--sw/source/core/doc/docnum.cxx521
-rw-r--r--sw/source/core/doc/docredln.cxx536
-rw-r--r--sw/source/core/doc/docruby.cxx53
-rw-r--r--sw/source/core/doc/docsort.cxx196
-rw-r--r--sw/source/core/doc/docstat.cxx4
-rw-r--r--sw/source/core/doc/doctxm.cxx290
-rw-r--r--sw/source/core/doc/extinput.cxx32
-rw-r--r--sw/source/core/doc/fmtcol.cxx98
-rw-r--r--sw/source/core/doc/ftnidx.cxx68
-rw-r--r--sw/source/core/doc/gctable.cxx128
-rw-r--r--sw/source/core/doc/htmltbl.cxx493
-rw-r--r--sw/source/core/doc/lineinfo.cxx10
-rw-r--r--sw/source/core/doc/list.cxx8
-rw-r--r--sw/source/core/doc/notxtfrm.cxx100
-rw-r--r--sw/source/core/doc/number.cxx167
-rw-r--r--sw/source/core/doc/poolfmt.cxx431
-rw-r--r--sw/source/core/doc/sortopt.cxx10
-rw-r--r--sw/source/core/doc/swserv.cxx38
-rw-r--r--sw/source/core/doc/tblafmt.cxx224
-rw-r--r--sw/source/core/doc/tblcpy.cxx217
-rw-r--r--sw/source/core/doc/tblrwcl.cxx1000
-rw-r--r--sw/source/core/doc/visiturl.cxx12
-rw-r--r--sw/source/core/docnode/ndcopy.cxx246
-rw-r--r--sw/source/core/docnode/ndindex.cxx6
-rw-r--r--sw/source/core/docnode/ndnotxt.cxx64
-rw-r--r--sw/source/core/docnode/ndnum.cxx28
-rw-r--r--sw/source/core/docnode/ndsect.cxx234
-rw-r--r--sw/source/core/docnode/ndtbl.cxx1118
-rw-r--r--sw/source/core/docnode/ndtbl1.cxx350
-rw-r--r--sw/source/core/docnode/node.cxx326
-rw-r--r--sw/source/core/docnode/node2lay.cxx61
-rw-r--r--sw/source/core/docnode/nodes.cxx343
-rw-r--r--sw/source/core/docnode/section.cxx221
-rw-r--r--sw/source/core/docnode/swbaslnk.cxx105
-rw-r--r--sw/source/core/draw/dcontact.cxx143
-rw-r--r--sw/source/core/draw/dflyobj.cxx47
-rw-r--r--sw/source/core/draw/dpage.cxx12
-rw-r--r--sw/source/core/draw/drawdoc.cxx16
-rw-r--r--sw/source/core/draw/dview.cxx99
-rw-r--r--sw/source/core/edit/acorrect.cxx90
-rw-r--r--sw/source/core/edit/autofmt.cxx507
-rw-r--r--sw/source/core/edit/edatmisc.cxx38
-rw-r--r--sw/source/core/edit/edattr.cxx112
-rw-r--r--sw/source/core/edit/eddel.cxx52
-rw-r--r--sw/source/core/edit/edfcol.cxx23
-rw-r--r--sw/source/core/edit/edfld.cxx94
-rw-r--r--sw/source/core/edit/edfldexp.cxx21
-rw-r--r--sw/source/core/edit/edfmt.cxx22
-rw-r--r--sw/source/core/edit/edglbldc.cxx92
-rw-r--r--sw/source/core/edit/edglss.cxx52
-rw-r--r--sw/source/core/edit/editsh.cxx144
-rw-r--r--sw/source/core/edit/edlingu.cxx59
-rw-r--r--sw/source/core/edit/ednumber.cxx178
-rw-r--r--sw/source/core/edit/edredln.cxx26
-rw-r--r--sw/source/core/edit/edsect.cxx41
-rw-r--r--sw/source/core/edit/edtab.cxx101
-rw-r--r--sw/source/core/edit/edtox.cxx100
-rw-r--r--sw/source/core/edit/edundo.cxx217
-rw-r--r--sw/source/core/edit/edws.cxx56
-rw-r--r--sw/source/core/except/dbgloop.cxx10
-rw-r--r--sw/source/core/except/errhdl.cxx22
-rw-r--r--sw/source/core/fields/authfld.cxx125
-rw-r--r--sw/source/core/fields/cellfml.cxx109
-rw-r--r--sw/source/core/fields/chpfld.cxx18
-rw-r--r--sw/source/core/fields/dbfld.cxx169
-rw-r--r--sw/source/core/fields/ddefld.cxx43
-rw-r--r--sw/source/core/fields/ddetbl.cxx18
-rw-r--r--sw/source/core/fields/docufld.cxx171
-rw-r--r--sw/source/core/fields/expfld.cxx187
-rw-r--r--sw/source/core/fields/fldbas.cxx88
-rw-r--r--sw/source/core/fields/flddat.cxx24
-rw-r--r--sw/source/core/fields/flddropdown.cxx8
-rw-r--r--sw/source/core/fields/fldlst.cxx28
-rw-r--r--sw/source/core/fields/macrofld.cxx24
-rw-r--r--sw/source/core/fields/reffld.cxx99
-rw-r--r--sw/source/core/fields/scrptfld.cxx10
-rw-r--r--sw/source/core/fields/tblcalc.cxx26
-rw-r--r--sw/source/core/fields/usrfld.cxx22
-rw-r--r--sw/source/core/frmedt/fecopy.cxx182
-rw-r--r--sw/source/core/frmedt/fedesc.cxx49
-rw-r--r--sw/source/core/frmedt/fefly1.cxx54
-rw-r--r--sw/source/core/frmedt/feflyole.cxx15
-rw-r--r--sw/source/core/frmedt/feshview.cxx297
-rw-r--r--sw/source/core/frmedt/fetab.cxx318
-rw-r--r--sw/source/core/frmedt/fews.cxx113
-rw-r--r--sw/source/core/frmedt/tblsel.cxx407
-rw-r--r--sw/source/core/graphic/grfatr.cxx74
-rw-r--r--sw/source/core/graphic/ndgrf.cxx112
-rw-r--r--sw/source/core/inc/GetMetricVal.hxx6
-rw-r--r--sw/source/core/inc/SwPortionHandler.hxx10
-rw-r--r--sw/source/core/inc/SwUndoFmt.hxx253
-rw-r--r--sw/source/core/inc/SwUndoPageDesc.hxx93
-rw-r--r--sw/source/core/inc/SwUndoTOXChange.hxx49
-rw-r--r--sw/source/core/inc/SwXMLTextBlocks.hxx58
-rw-r--r--sw/source/core/inc/UndoAttribute.hxx288
-rw-r--r--sw/source/core/inc/UndoBookmark.hxx83
-rw-r--r--sw/source/core/inc/UndoCore.hxx263
-rw-r--r--sw/source/core/inc/UndoDelete.hxx115
-rw-r--r--sw/source/core/inc/UndoDraw.hxx150
-rw-r--r--sw/source/core/inc/UndoInsert.hxx235
-rw-r--r--sw/source/core/inc/UndoManager.hxx124
-rw-r--r--sw/source/core/inc/UndoNumbering.hxx154
-rw-r--r--sw/source/core/inc/UndoOverwrite.hxx105
-rw-r--r--sw/source/core/inc/UndoRedline.hxx145
-rw-r--r--sw/source/core/inc/UndoSection.hxx82
-rw-r--r--sw/source/core/inc/UndoSort.hxx97
-rw-r--r--sw/source/core/inc/UndoSplitMove.hxx96
-rw-r--r--sw/source/core/inc/UndoTable.hxx391
-rw-r--r--sw/source/core/inc/acorrect.hxx36
-rw-r--r--sw/source/core/inc/anchoredobjectposition.hxx2
-rw-r--r--sw/source/core/inc/blink.hxx16
-rw-r--r--sw/source/core/inc/cellfrm.hxx8
-rw-r--r--sw/source/core/inc/cntfrm.hxx48
-rw-r--r--sw/source/core/inc/dbg_lay.hxx20
-rw-r--r--sw/source/core/inc/dbgloop.hxx4
-rw-r--r--sw/source/core/inc/dflyobj.hxx16
-rw-r--r--sw/source/core/inc/docfld.hxx32
-rw-r--r--sw/source/core/inc/docsort.hxx60
-rw-r--r--sw/source/core/inc/doctxm.hxx10
-rw-r--r--sw/source/core/inc/drawdev.hxx28
-rw-r--r--sw/source/core/inc/drawfont.hxx154
-rw-r--r--sw/source/core/inc/dview.hxx8
-rw-r--r--sw/source/core/inc/flowfrm.hxx94
-rw-r--r--sw/source/core/inc/flyfrm.hxx119
-rw-r--r--sw/source/core/inc/flyfrms.hxx18
-rw-r--r--sw/source/core/inc/fntcache.hxx46
-rw-r--r--sw/source/core/inc/frame.hxx385
-rw-r--r--sw/source/core/inc/frminf.hxx12
-rw-r--r--sw/source/core/inc/frmtool.hxx154
-rw-r--r--sw/source/core/inc/ftnboss.hxx12
-rw-r--r--sw/source/core/inc/ftnfrm.hxx22
-rw-r--r--sw/source/core/inc/hffrm.hxx10
-rw-r--r--sw/source/core/inc/layact.hxx148
-rw-r--r--sw/source/core/inc/laycache.hxx4
-rw-r--r--sw/source/core/inc/layfrm.hxx32
-rw-r--r--sw/source/core/inc/layouter.hxx10
-rw-r--r--sw/source/core/inc/mvsave.hxx32
-rw-r--r--sw/source/core/inc/node2lay.hxx6
-rw-r--r--sw/source/core/inc/noteurl.hxx6
-rw-r--r--sw/source/core/inc/notxtfrm.hxx12
-rw-r--r--sw/source/core/inc/pagefrm.hxx124
-rw-r--r--sw/source/core/inc/pamtyp.hxx50
-rw-r--r--sw/source/core/inc/rolbck.hxx453
-rw-r--r--sw/source/core/inc/rootfrm.hxx106
-rw-r--r--sw/source/core/inc/rowfrm.hxx24
-rw-r--r--sw/source/core/inc/scriptinfo.hxx48
-rw-r--r--sw/source/core/inc/sectfrm.hxx65
-rw-r--r--sw/source/core/inc/swblocks.hxx136
-rw-r--r--sw/source/core/inc/swcache.hxx68
-rw-r--r--sw/source/core/inc/swfont.hxx354
-rw-r--r--sw/source/core/inc/tabfrm.hxx89
-rw-r--r--sw/source/core/inc/tblrwcl.hxx92
-rw-r--r--sw/source/core/inc/toxhlp.hxx2
-rw-r--r--sw/source/core/inc/txmsrt.hxx88
-rw-r--r--sw/source/core/inc/txtfrm.hxx48
-rw-r--r--sw/source/core/inc/txttypes.hxx4
-rw-r--r--sw/source/core/inc/undoflystrattr.hxx11
-rwxr-xr-xsw/source/core/inc/unometa.hxx2
-rw-r--r--sw/source/core/inc/viewimp.hxx44
-rw-r--r--sw/source/core/inc/wrong.hxx28
-rw-r--r--sw/source/core/layout/anchoreddrawobject.cxx2
-rw-r--r--sw/source/core/layout/atrfrm.cxx129
-rw-r--r--sw/source/core/layout/calcmove.cxx276
-rw-r--r--sw/source/core/layout/colfrm.cxx76
-rw-r--r--sw/source/core/layout/dbg_lay.cxx126
-rw-r--r--sw/source/core/layout/findfrm.cxx82
-rw-r--r--sw/source/core/layout/flowfrm.cxx332
-rw-r--r--sw/source/core/layout/fly.cxx189
-rw-r--r--sw/source/core/layout/flycnt.cxx114
-rw-r--r--sw/source/core/layout/flyincnt.cxx30
-rw-r--r--sw/source/core/layout/flylay.cxx90
-rw-r--r--sw/source/core/layout/flypos.cxx22
-rw-r--r--sw/source/core/layout/frmtool.cxx298
-rw-r--r--sw/source/core/layout/ftnfrm.cxx301
-rw-r--r--sw/source/core/layout/hffrm.cxx45
-rw-r--r--sw/source/core/layout/layact.cxx385
-rw-r--r--sw/source/core/layout/laycache.cxx229
-rw-r--r--sw/source/core/layout/layhelp.hxx76
-rw-r--r--sw/source/core/layout/layouter.cxx36
-rw-r--r--sw/source/core/layout/newfrm.cxx38
-rw-r--r--sw/source/core/layout/objectformatter.cxx4
-rw-r--r--sw/source/core/layout/pagechg.cxx211
-rw-r--r--sw/source/core/layout/pagedesc.cxx29
-rw-r--r--sw/source/core/layout/paintfrm.cxx394
-rw-r--r--sw/source/core/layout/sectfrm.cxx344
-rw-r--r--sw/source/core/layout/softpagebreak.cxx4
-rw-r--r--sw/source/core/layout/ssfrm.cxx76
-rw-r--r--sw/source/core/layout/tabfrm.cxx496
-rw-r--r--sw/source/core/layout/trvlfrm.cxx321
-rw-r--r--sw/source/core/layout/unusedf.cxx26
-rw-r--r--sw/source/core/layout/virtoutp.cxx24
-rw-r--r--sw/source/core/layout/virtoutp.hxx8
-rw-r--r--sw/source/core/layout/wsfrm.cxx274
-rw-r--r--sw/source/core/objectpositioning/anchoredobjectposition.cxx14
-rw-r--r--sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx14
-rw-r--r--sw/source/core/ole/ndole.cxx90
-rw-r--r--sw/source/core/para/paratr.cxx12
-rw-r--r--sw/source/core/sw3io/sw3convert.cxx30
-rw-r--r--sw/source/core/sw3io/swacorr.cxx12
-rw-r--r--sw/source/core/swg/SwXMLBlockListContext.cxx4
-rw-r--r--sw/source/core/swg/SwXMLTextBlocks.cxx128
-rw-r--r--sw/source/core/swg/SwXMLTextBlocks1.cxx34
-rw-r--r--sw/source/core/swg/swblocks.cxx200
-rw-r--r--sw/source/core/table/swnewtable.cxx380
-rw-r--r--sw/source/core/table/swtable.cxx417
-rw-r--r--sw/source/core/text/EnhancedPDFExportHelper.cxx52
-rw-r--r--sw/source/core/text/atrhndl.hxx24
-rw-r--r--sw/source/core/text/atrstck.cxx64
-rw-r--r--sw/source/core/text/blink.cxx2
-rw-r--r--sw/source/core/text/frmcrsr.cxx22
-rw-r--r--sw/source/core/text/frmform.cxx8
-rw-r--r--sw/source/core/text/frmpaint.cxx2
-rw-r--r--sw/source/core/text/guess.cxx18
-rw-r--r--sw/source/core/text/inftxt.cxx104
-rw-r--r--sw/source/core/text/inftxt.hxx42
-rw-r--r--sw/source/core/text/itradj.cxx28
-rw-r--r--sw/source/core/text/itratr.cxx39
-rw-r--r--sw/source/core/text/itratr.hxx6
-rw-r--r--sw/source/core/text/itrcrsr.cxx48
-rw-r--r--sw/source/core/text/itrform2.cxx58
-rw-r--r--sw/source/core/text/itrform2.hxx4
-rw-r--r--sw/source/core/text/itrpaint.cxx22
-rw-r--r--sw/source/core/text/itrtxt.cxx16
-rw-r--r--sw/source/core/text/itrtxt.hxx4
-rw-r--r--sw/source/core/text/pordrop.hxx6
-rw-r--r--sw/source/core/text/porexp.hxx8
-rw-r--r--sw/source/core/text/porfld.cxx65
-rw-r--r--sw/source/core/text/porfld.hxx12
-rw-r--r--sw/source/core/text/porfly.cxx12
-rw-r--r--sw/source/core/text/porftn.hxx4
-rw-r--r--sw/source/core/text/porglue.cxx2
-rw-r--r--sw/source/core/text/porlay.cxx164
-rw-r--r--sw/source/core/text/porlay.hxx6
-rw-r--r--sw/source/core/text/porlin.cxx16
-rw-r--r--sw/source/core/text/pormulti.cxx78
-rw-r--r--sw/source/core/text/pormulti.hxx24
-rw-r--r--sw/source/core/text/porrst.cxx4
-rw-r--r--sw/source/core/text/porrst.hxx4
-rw-r--r--sw/source/core/text/portab.hxx6
-rw-r--r--sw/source/core/text/portxt.cxx18
-rw-r--r--sw/source/core/text/redlnitr.cxx6
-rw-r--r--sw/source/core/text/redlnitr.hxx2
-rw-r--r--sw/source/core/text/txtdrop.cxx30
-rw-r--r--sw/source/core/text/txtfld.cxx4
-rw-r--r--sw/source/core/text/txtfly.cxx24
-rw-r--r--sw/source/core/text/txtfly.hxx2
-rw-r--r--sw/source/core/text/txtfrm.cxx36
-rw-r--r--sw/source/core/text/txtftn.cxx26
-rw-r--r--sw/source/core/text/txthyph.cxx2
-rw-r--r--sw/source/core/text/txttab.cxx12
-rw-r--r--sw/source/core/text/widorp.cxx2
-rw-r--r--sw/source/core/text/wrong.cxx14
-rw-r--r--sw/source/core/tox/tox.cxx136
-rw-r--r--sw/source/core/tox/toxhlp.cxx2
-rw-r--r--sw/source/core/tox/txmsrt.cxx108
-rw-r--r--sw/source/core/txtnode/atrfld.cxx16
-rw-r--r--sw/source/core/txtnode/atrflyin.cxx18
-rw-r--r--sw/source/core/txtnode/atrftn.cxx42
-rw-r--r--sw/source/core/txtnode/atrtox.cxx4
-rw-r--r--sw/source/core/txtnode/fmtatr2.cxx74
-rw-r--r--sw/source/core/txtnode/fntcache.cxx201
-rw-r--r--sw/source/core/txtnode/fntcap.cxx60
-rw-r--r--sw/source/core/txtnode/ndhints.cxx60
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx412
-rw-r--r--sw/source/core/txtnode/swfntcch.cxx8
-rw-r--r--sw/source/core/txtnode/swfont.cxx166
-rw-r--r--sw/source/core/txtnode/thints.cxx242
-rw-r--r--sw/source/core/txtnode/txatritr.cxx14
-rw-r--r--sw/source/core/txtnode/txtatr2.cxx40
-rw-r--r--sw/source/core/txtnode/txtedt.cxx245
-rw-r--r--sw/source/core/undo/SwUndoField.cxx42
-rw-r--r--sw/source/core/undo/SwUndoFmt.cxx123
-rw-r--r--sw/source/core/undo/SwUndoPageDesc.cxx96
-rw-r--r--sw/source/core/undo/SwUndoTOXChange.cxx16
-rw-r--r--sw/source/core/undo/docundo.cxx1134
-rw-r--r--sw/source/core/undo/rolbck.cxx162
-rw-r--r--sw/source/core/undo/unattr.cxx332
-rw-r--r--sw/source/core/undo/unbkmk.cxx17
-rw-r--r--sw/source/core/undo/undel.cxx160
-rw-r--r--sw/source/core/undo/undobj.cxx377
-rw-r--r--sw/source/core/undo/undobj1.cxx189
-rw-r--r--sw/source/core/undo/undoflystrattr.cxx9
-rw-r--r--sw/source/core/undo/undraw.cxx119
-rw-r--r--sw/source/core/undo/unfmco.cxx43
-rw-r--r--sw/source/core/undo/unins.cxx348
-rw-r--r--sw/source/core/undo/unmove.cxx49
-rw-r--r--sw/source/core/undo/unnum.cxx206
-rw-r--r--sw/source/core/undo/unoutl.cxx27
-rw-r--r--sw/source/core/undo/unovwr.cxx126
-rw-r--r--sw/source/core/undo/unredln.cxx187
-rw-r--r--sw/source/core/undo/unsect.cxx74
-rw-r--r--sw/source/core/undo/unsort.cxx107
-rw-r--r--sw/source/core/undo/unspnd.cxx58
-rw-r--r--sw/source/core/undo/untbl.cxx707
-rw-r--r--sw/source/core/undo/untblk.cxx90
-rw-r--r--sw/source/core/unocore/swunohelper.cxx52
-rw-r--r--sw/source/core/unocore/unobkm.cxx11
-rw-r--r--sw/source/core/unocore/unochart.cxx12
-rw-r--r--sw/source/core/unocore/unocoll.cxx40
-rw-r--r--sw/source/core/unocore/unocrsrhelper.cxx36
-rw-r--r--sw/source/core/unocore/unodraw.cxx28
-rw-r--r--sw/source/core/unocore/unoevent.cxx4
-rw-r--r--sw/source/core/unocore/unofield.cxx98
-rw-r--r--sw/source/core/unocore/unoflatpara.cxx18
-rw-r--r--sw/source/core/unocore/unoframe.cxx71
-rw-r--r--sw/source/core/unocore/unoidx.cxx30
-rw-r--r--sw/source/core/unocore/unomap.cxx3
-rw-r--r--sw/source/core/unocore/unoobj.cxx75
-rw-r--r--sw/source/core/unocore/unoobj2.cxx47
-rw-r--r--sw/source/core/unocore/unoparagraph.cxx12
-rw-r--r--sw/source/core/unocore/unoport.cxx8
-rw-r--r--sw/source/core/unocore/unoportenum.cxx54
-rw-r--r--sw/source/core/unocore/unoprnms.cxx5
-rw-r--r--sw/source/core/unocore/unoredline.cxx10
-rw-r--r--sw/source/core/unocore/unoredlines.cxx21
-rw-r--r--sw/source/core/unocore/unorefmk.cxx2
-rw-r--r--sw/source/core/unocore/unosect.cxx15
-rw-r--r--sw/source/core/unocore/unosett.cxx70
-rw-r--r--sw/source/core/unocore/unosrch.cxx4
-rw-r--r--sw/source/core/unocore/unostyle.cxx59
-rw-r--r--sw/source/core/unocore/unotbl.cxx173
-rw-r--r--sw/source/core/unocore/unotext.cxx68
-rw-r--r--sw/source/core/unocore/unotextmarkup.cxx12
-rw-r--r--sw/source/core/view/pagepreviewlayout.cxx9
-rw-r--r--sw/source/core/view/printdata.cxx166
-rw-r--r--sw/source/core/view/vdraw.cxx28
-rw-r--r--sw/source/core/view/viewimp.cxx28
-rw-r--r--sw/source/core/view/viewpg.cxx2
-rw-r--r--sw/source/core/view/viewsh.cxx300
-rw-r--r--sw/source/core/view/vnew.cxx29
-rw-r--r--sw/source/core/view/vprint.cxx88
397 files changed, 23169 insertions, 18450 deletions
diff --git a/sw/source/core/SwNumberTree/SwNodeNum.cxx b/sw/source/core/SwNumberTree/SwNodeNum.cxx
index d4a9dc0a07d0..cec279e73096 100644
--- a/sw/source/core/SwNumberTree/SwNodeNum.cxx
+++ b/sw/source/core/SwNumberTree/SwNodeNum.cxx
@@ -376,7 +376,7 @@ SwNumberTree::tSwNumTreeNumber SwNodeNum::GetStartValue() const
if (nLevel >= 0 && nLevel < MAXLEVEL)
{
- const SwNumFmt * pFmt = pRule->GetNumFmt( static_cast<USHORT>(nLevel));
+ const SwNumFmt * pFmt = pRule->GetNumFmt( static_cast<sal_uInt16>(nLevel));
if (pFmt)
aResult = pFmt->GetStart();
diff --git a/sw/source/core/access/accdoc.cxx b/sw/source/core/access/accdoc.cxx
index 713a58f1b247..08de7edba46f 100644
--- a/sw/source/core/access/accdoc.cxx
+++ b/sw/source/core/access/accdoc.cxx
@@ -319,7 +319,7 @@ SwAccessibleDocument::SwAccessibleDocument ( SwAccessibleMap* pInitMap ) :
if( pWin )
{
pWin->AddChildEventListener( LINK( this, SwAccessibleDocument, WindowChildEventListener ));
- USHORT nCount = pWin->GetChildCount();
+ sal_uInt16 nCount = pWin->GetChildCount();
for( sal_uInt16 i=0; i < nCount; i++ )
{
Window* pChildWin = pWin->GetChild( i );
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index 32d1fc424cb8..6684354ef7ac 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -2688,7 +2688,7 @@ SwAccessibleSelectedParas_Impl* SwAccessibleMap::_BuildSelectedParas()
pFEShell->IsObjSelected() == 0 ) )
{
// get cursor without updating an existing table cursor.
- pCrsr = pCrsrShell->GetCrsr( FALSE );
+ pCrsr = pCrsrShell->GetCrsr( sal_False );
}
}
}
diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx
index 84d0cc67e7ab..ec8ab7a7c703 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -151,7 +151,7 @@ sal_Int32 SwAccessibleParagraph::GetCaretPos()
{
// same node? Then check whether it's also within 'our' part
// of the paragraph
- USHORT nIndex = pPoint->nContent.GetIndex();
+ sal_uInt16 nIndex = pPoint->nContent.GetIndex();
if( GetPortionData().IsValidCorePosition( nIndex ) )
{
// Yes, it's us!
@@ -195,7 +195,7 @@ sal_Bool SwAccessibleParagraph::GetSelection(
{
// get SwPosition for my node
const SwTxtNode* pNode = GetTxtNode();
- ULONG nHere = pNode->GetIndex();
+ sal_uLong nHere = pNode->GetIndex();
// iterate over ring
SwPaM* pRingStart = pCrsr;
@@ -206,9 +206,9 @@ sal_Bool SwAccessibleParagraph::GetSelection(
{
// check whether nHere is 'inside' pCrsr
SwPosition* pStart = pCrsr->Start();
- ULONG nStartIndex = pStart->nNode.GetIndex();
+ sal_uLong nStartIndex = pStart->nNode.GetIndex();
SwPosition* pEnd = pCrsr->End();
- ULONG nEndIndex = pEnd->nNode.GetIndex();
+ sal_uLong nEndIndex = pEnd->nNode.GetIndex();
if( ( nHere >= nStartIndex ) &&
( nHere <= nEndIndex ) )
{
@@ -230,7 +230,7 @@ sal_Bool SwAccessibleParagraph::GetSelection(
// selection starts in this node:
// then check whether it's before or inside our part of
// the paragraph, and if so, get the proper position
- USHORT nCoreStart = pStart->nContent.GetIndex();
+ sal_uInt16 nCoreStart = pStart->nContent.GetIndex();
if( nCoreStart <
GetPortionData().GetFirstValidCorePosition() )
{
@@ -266,7 +266,7 @@ sal_Bool SwAccessibleParagraph::GetSelection(
// selection ends in this node: then select everything
// before our part of the node
- USHORT nCoreEnd = pEnd->nContent.GetIndex();
+ sal_uInt16 nCoreEnd = pEnd->nContent.GetIndex();
if( nCoreEnd >
GetPortionData().GetLastValidCorePosition() )
{
@@ -329,7 +329,7 @@ SwPaM* SwAccessibleParagraph::GetCursor( const bool _bForSelection )
!(pFESh->IsFrmSelected() || pFESh->IsObjSelected() > 0) )
{
// get the selection, and test whether it affects our text node
- pCrsr = pCrsrShell->GetCrsr( FALSE /* ??? */ );
+ pCrsr = pCrsrShell->GetCrsr( sal_False /* ??? */ );
}
}
@@ -563,7 +563,7 @@ void SwAccessibleParagraph::ClearPortionData()
}
-void SwAccessibleParagraph::ExecuteAtViewShell( UINT16 nSlot )
+void SwAccessibleParagraph::ExecuteAtViewShell( sal_uInt16 nSlot )
{
DBG_ASSERT( GetMap() != NULL, "no map?" );
ViewShell* pViewShell = GetMap()->GetShell();
@@ -597,8 +597,8 @@ SwXTextPortion* SwAccessibleParagraph::CreateUnoPortion(
IsValidRange(nStartIndex, nEndIndex, GetString().getLength()),
"please check parameters before calling this method" );
- USHORT nStart = GetPortionData().GetModelPosition( nStartIndex );
- USHORT nEnd = (nEndIndex == -1) ? (nStart + 1) :
+ sal_uInt16 nStart = GetPortionData().GetModelPosition( nStartIndex );
+ sal_uInt16 nEnd = (nEndIndex == -1) ? (nStart + 1) :
GetPortionData().GetModelPosition( nEndIndex );
// create UNO cursor
@@ -670,13 +670,13 @@ sal_Bool SwAccessibleParagraph::GetWordBoundary(
if( pBreakIt->GetBreakIter().is() )
{
// get locale for this position
- USHORT nModelPos = GetPortionData().GetModelPosition( nPos );
+ sal_uInt16 nModelPos = GetPortionData().GetModelPosition( nPos );
lang::Locale aLocale = pBreakIt->GetLocale(
GetTxtNode()->GetLang( nModelPos ) );
// which type of word are we interested in?
// (DICTIONARY_WORD includes punctuation, ANY_WORD doesn't.)
- const USHORT nWordType = i18n::WordType::ANY_WORD;
+ const sal_uInt16 nWordType = i18n::WordType::ANY_WORD;
// get word boundary, as the Break-Iterator sees fit.
rBound = pBreakIt->GetBreakIter()->getWordBoundary(
@@ -750,12 +750,12 @@ sal_Bool SwAccessibleParagraph::GetGlyphBoundary(
if( pBreakIt->GetBreakIter().is() )
{
// get locale for this position
- USHORT nModelPos = GetPortionData().GetModelPosition( nPos );
+ sal_uInt16 nModelPos = GetPortionData().GetModelPosition( nPos );
lang::Locale aLocale = pBreakIt->GetLocale(
GetTxtNode()->GetLang( nModelPos ) );
// get word boundary, as the Break-Iterator sees fit.
- const USHORT nIterMode = i18n::CharacterIteratorMode::SKIPCELL;
+ const sal_uInt16 nIterMode = i18n::CharacterIteratorMode::SKIPCELL;
sal_Int32 nDone = 0;
rBound.endPos = pBreakIt->GetBreakIter()->nextCharacters(
rText, nPos, aLocale, nIterMode, 1, nDone );
@@ -1532,9 +1532,9 @@ void SwAccessibleParagraph::_getRunAttributesImpl(
{
const SwTxtNode* pTxtNode( GetTxtNode() );
SwPosition* pStartPos = new SwPosition( *pTxtNode );
- pStartPos->nContent.Assign( const_cast<SwTxtNode*>(pTxtNode), static_cast<USHORT>(nIndex) );
+ pStartPos->nContent.Assign( const_cast<SwTxtNode*>(pTxtNode), static_cast<sal_uInt16>(nIndex) );
SwPosition* pEndPos = new SwPosition( *pTxtNode );
- pEndPos->nContent.Assign( const_cast<SwTxtNode*>(pTxtNode), static_cast<USHORT>(nIndex+1) );
+ pEndPos->nContent.Assign( const_cast<SwTxtNode*>(pTxtNode), static_cast<sal_uInt16>(nIndex+1) );
pPaM = new SwPaM( *pStartPos, *pEndPos );
@@ -1550,7 +1550,7 @@ void SwAccessibleParagraph::_getRunAttributesImpl(
// From the perspective of the a11y API the character attributes, which
// are set at the automatic paragraph style of the paragraph are treated
// as run attributes.
-// SwXTextCursor::GetCrsrAttr( *pPaM, aSet, TRUE, TRUE );
+// SwXTextCursor::GetCrsrAttr( *pPaM, aSet, sal_True, sal_True );
// get character attributes from automatic paragraph style and merge these into <aSet>
{
const SwTxtNode* pTxtNode( GetTxtNode() );
@@ -1559,7 +1559,7 @@ void SwAccessibleParagraph::_getRunAttributesImpl(
SfxItemSet aAutomaticParaStyleCharAttrs( pPaM->GetDoc()->GetAttrPool(),
RES_CHRATR_BEGIN, RES_CHRATR_END -1,
0 );
- aAutomaticParaStyleCharAttrs.Put( *(pTxtNode->GetpSwAttrSet()), FALSE );
+ aAutomaticParaStyleCharAttrs.Put( *(pTxtNode->GetpSwAttrSet()), sal_False );
aSet.Put( aAutomaticParaStyleCharAttrs );
}
}
@@ -1568,7 +1568,7 @@ void SwAccessibleParagraph::_getRunAttributesImpl(
SfxItemSet aCharAttrsAtPaM( pPaM->GetDoc()->GetAttrPool(),
RES_CHRATR_BEGIN, RES_CHRATR_END -1,
0 );
- SwUnoCursorHelper::GetCrsrAttr(*pPaM, aCharAttrsAtPaM, TRUE, TRUE);
+ SwUnoCursorHelper::GetCrsrAttr(*pPaM, aCharAttrsAtPaM, sal_True, sal_True);
aSet.Put( aCharAttrsAtPaM );
}
// <--
@@ -1593,7 +1593,7 @@ void SwAccessibleParagraph::_getRunAttributesImpl(
// --> OD 2007-11-12 #i82637#
// Found character attributes, whose value equals the value of
// the corresponding default character attributes, are excluded.
- if ( aSet.GetItemState( aPropIt->nWID, TRUE, &pItem ) == SFX_ITEM_SET )
+ if ( aSet.GetItemState( aPropIt->nWID, sal_True, &pItem ) == SFX_ITEM_SET )
{
uno::Any aVal;
pItem->QueryValue( aVal, aPropIt->nMemberId );
@@ -1696,12 +1696,12 @@ awt::Rectangle SwAccessibleParagraph::getCharacterBounds(
// get model position & prepare GetCharRect() arguments
SwCrsrMoveState aMoveState;
- aMoveState.bRealHeight = TRUE;
- aMoveState.bRealWidth = TRUE;
+ aMoveState.bRealHeight = sal_True;
+ aMoveState.bRealWidth = sal_True;
SwSpecialPos aSpecialPos;
SwTxtNode* pNode = const_cast<SwTxtNode*>( GetTxtNode() );
- USHORT nPos = 0;
+ sal_uInt16 nPos = 0;
/* #i12332# FillSpecialPos does not accept nIndex ==
GetString().getLength(). In that case nPos is set to the
@@ -1793,7 +1793,7 @@ sal_Int32 SwAccessibleParagraph::getIndexAtPoint( const awt::Point& rPoint )
DBG_ASSERT( GetFrm()->IsTxtFrm(), "The text frame has mutated!" );
const SwTxtFrm* pFrm = static_cast<const SwTxtFrm*>( GetFrm() );
SwCrsrMoveState aMoveState;
- aMoveState.bPosMatchesBounds = TRUE;
+ aMoveState.bPosMatchesBounds = sal_True;
sal_Bool bSuccess = pFrm->GetCrsrOfst( &aPos, aCorePoint, &aMoveState );
SwIndex aCntntIdx = aPos.nContent;
@@ -2126,7 +2126,7 @@ sal_Bool SwAccessibleParagraph::replaceText(
SwTxtNode* pNode = const_cast<SwTxtNode*>( GetTxtNode() );
// translate positions
- USHORT nStart, nEnd;
+ sal_uInt16 nStart, nEnd;
sal_Bool bSuccess = GetPortionData().GetEditableRange(
nStartIndex, nEndIndex, nStart, nEnd );
diff --git a/sw/source/core/access/accpara.hxx b/sw/source/core/access/accpara.hxx
index 8a45a4bdd64d..440fd08c7ebd 100644
--- a/sw/source/core/access/accpara.hxx
+++ b/sw/source/core/access/accpara.hxx
@@ -120,7 +120,7 @@ class SwAccessibleParagraph :
SwPaM* GetCursor( const bool _bForSelection );
/// for cut/copy/paste: execute a particular slot at the view shell
- void ExecuteAtViewShell( UINT16 nSlot );
+ void ExecuteAtViewShell( sal_uInt16 nSlot );
/// helper method for get/setAttributes
/// (for the special case of (nEndIndex==-1) a single character will
diff --git a/sw/source/core/access/accportions.cxx b/sw/source/core/access/accportions.cxx
index 093d22136d81..c90fa9d4e34d 100644
--- a/sw/source/core/access/accportions.cxx
+++ b/sw/source/core/access/accportions.cxx
@@ -116,7 +116,7 @@ SwAccessiblePortionData::~SwAccessiblePortionData()
delete pSentences;
}
-void SwAccessiblePortionData::Text(USHORT nLength, USHORT nType)
+void SwAccessiblePortionData::Text(sal_uInt16 nLength, sal_uInt16 nType)
{
DBG_ASSERT( (nModelPosition + nLength) <= pTxtNode->GetTxt().Len(),
"portion exceeds model string!" );
@@ -138,7 +138,7 @@ void SwAccessiblePortionData::Text(USHORT nLength, USHORT nType)
// update buffer + nModelPosition
aBuffer.append( OUString(
pTxtNode->GetTxt().Copy(
- static_cast<USHORT>( nModelPosition ),
+ static_cast<sal_uInt16>( nModelPosition ),
nLength ) ) );
nModelPosition += nLength;
@@ -146,7 +146,7 @@ void SwAccessiblePortionData::Text(USHORT nLength, USHORT nType)
}
void SwAccessiblePortionData::Special(
- USHORT nLength, const String& rText, USHORT nType)
+ sal_uInt16 nLength, const String& rText, sal_uInt16 nType)
{
DBG_ASSERT( nModelPosition >= 0, "illegal position" );
DBG_ASSERT( (nModelPosition + nLength) <= pTxtNode->GetTxt().Len(),
@@ -226,7 +226,7 @@ void SwAccessiblePortionData::LineBreak()
aLineBreaks.push_back( aBuffer.getLength() );
}
-void SwAccessiblePortionData::Skip(USHORT nLength)
+void SwAccessiblePortionData::Skip(sal_uInt16 nLength)
{
DBG_ASSERT( !bFinished, "We are already done!" );
DBG_ASSERT( aModelPositions.size() == 0, "Never Skip() after portions" );
@@ -270,7 +270,7 @@ sal_Bool SwAccessiblePortionData::IsReadOnlyPortion( size_t nPortionNo ) const
return IsPortionAttrSet(nPortionNo, PORATTR_READONLY);
}
-sal_Bool SwAccessiblePortionData::IsGrayPortionType( USHORT nType ) const
+sal_Bool SwAccessiblePortionData::IsGrayPortionType( sal_uInt16 nType ) const
{
// gray portions?
// Compare with: inftxt.cxx, SwTxtPaintInfo::DrawViewOpt(...)
@@ -362,7 +362,7 @@ void SwAccessiblePortionData::GetLastLineBoundary(
FillBoundary( rBound, aLineBreaks, nBreaks <= 3 ? 0 : nBreaks-4 );
}
-USHORT SwAccessiblePortionData::GetModelPosition( sal_Int32 nPos ) const
+sal_uInt16 SwAccessiblePortionData::GetModelPosition( sal_Int32 nPos ) const
{
DBG_ASSERT( nPos >= 0, "illegal position" );
DBG_ASSERT( nPos <= sAccessibleString.getLength(), "illegal position" );
@@ -390,7 +390,7 @@ USHORT SwAccessiblePortionData::GetModelPosition( sal_Int32 nPos ) const
DBG_ASSERT( (nStartPos >= 0) && (nStartPos < USHRT_MAX),
"How can the SwTxtNode have so many characters?" );
- return static_cast<USHORT>(nStartPos);
+ return static_cast<sal_uInt16>(nStartPos);
}
void SwAccessiblePortionData::FillBoundary(
@@ -505,7 +505,7 @@ void SwAccessiblePortionData::GetSentenceBoundary(
{
pSentences->push_back( nCurrent );
- USHORT nModelPos = GetModelPosition( nCurrent );
+ sal_uInt16 nModelPos = GetModelPosition( nCurrent );
sal_Int32 nNew = pBreakIt->GetBreakIter()->endOfSentence(
sAccessibleString, nCurrent,
@@ -548,7 +548,7 @@ void SwAccessiblePortionData::GetAttributeBoundary(
}
-sal_Int32 SwAccessiblePortionData::GetAccessiblePosition( USHORT nPos ) const
+sal_Int32 SwAccessiblePortionData::GetAccessiblePosition( sal_uInt16 nPos ) const
{
DBG_ASSERT( nPos <= pTxtNode->GetTxt().Len(), "illegal position" );
@@ -583,14 +583,14 @@ sal_Int32 SwAccessiblePortionData::GetAccessiblePosition( USHORT nPos ) const
return nRet;
}
-USHORT SwAccessiblePortionData::FillSpecialPos(
+sal_uInt16 SwAccessiblePortionData::FillSpecialPos(
sal_Int32 nPos,
SwSpecialPos& rPos,
SwSpecialPos*& rpPos ) const
{
size_t nPortionNo = FindLastBreak( aAccessiblePositions, nPos );
- BYTE nExtend(SP_EXTEND_RANGE_NONE);
+ sal_uInt8 nExtend(SP_EXTEND_RANGE_NONE);
sal_Int32 nRefPos(0);
sal_Int32 nModelPos(0);
@@ -622,7 +622,7 @@ USHORT SwAccessiblePortionData::FillSpecialPos(
// if we have anything except plain text, compute nExtend + nRefPos
if( (nModelEndPos - nModelPos == 1) &&
- (pTxtNode->GetTxt().GetChar(static_cast<USHORT>(nModelPos)) !=
+ (pTxtNode->GetTxt().GetChar(static_cast<sal_uInt16>(nModelPos)) !=
sAccessibleString.getStr()[nPos]) )
{
// case 1: a one-character, non-text portion
@@ -666,41 +666,41 @@ USHORT SwAccessiblePortionData::FillSpecialPos(
// (if necessary)
size_t nRefLine = FindBreak( aLineBreaks, nRefPos );
size_t nMyLine = FindBreak( aLineBreaks, nPos );
- USHORT nLineOffset = static_cast<USHORT>( nMyLine - nRefLine );
+ sal_uInt16 nLineOffset = static_cast<sal_uInt16>( nMyLine - nRefLine );
if( nLineOffset != 0 )
nRefPos = aLineBreaks[ nMyLine ];
// fill char offset and 'special position'
- rPos.nCharOfst = static_cast<USHORT>( nPos - nRefPos );
+ rPos.nCharOfst = static_cast<sal_uInt16>( nPos - nRefPos );
rPos.nExtendRange = nExtend;
rPos.nLineOfst = nLineOffset;
}
- return static_cast<USHORT>( nModelPos );
+ return static_cast<sal_uInt16>( nModelPos );
}
void SwAccessiblePortionData::AdjustAndCheck(
sal_Int32 nPos,
size_t& nPortionNo,
- USHORT& nCorePos,
+ sal_uInt16& nCorePos,
sal_Bool& bEdit) const
{
// find portion and get mode position
nPortionNo = FindBreak( aAccessiblePositions, nPos );
- nCorePos = static_cast<USHORT>( aModelPositions[ nPortionNo ] );
+ nCorePos = static_cast<sal_uInt16>( aModelPositions[ nPortionNo ] );
// for special portions, make sure we're on a portion boundary
// for text portions, add the in-portion offset
if( IsSpecialPortion( nPortionNo ) )
bEdit &= nPos == aAccessiblePositions[nPortionNo];
else
- nCorePos = static_cast<USHORT>( nCorePos +
+ nCorePos = static_cast<sal_uInt16>( nCorePos +
nPos - aAccessiblePositions[nPortionNo] );
}
sal_Bool SwAccessiblePortionData::GetEditableRange(
sal_Int32 nStart, sal_Int32 nEnd,
- USHORT& nCoreStart, USHORT& nCoreEnd ) const
+ sal_uInt16& nCoreStart, sal_uInt16& nCoreEnd ) const
{
sal_Bool bIsEditable = sal_True;
@@ -735,19 +735,19 @@ sal_Bool SwAccessiblePortionData::GetEditableRange(
return bIsEditable;
}
-sal_Bool SwAccessiblePortionData::IsValidCorePosition( USHORT nPos ) const
+sal_Bool SwAccessiblePortionData::IsValidCorePosition( sal_uInt16 nPos ) const
{
// a position is valid its within the model positions that we know
return ( aModelPositions[0] <= nPos ) &&
( nPos <= aModelPositions[ aModelPositions.size()-1 ] );
}
-USHORT SwAccessiblePortionData::GetFirstValidCorePosition() const
+sal_uInt16 SwAccessiblePortionData::GetFirstValidCorePosition() const
{
- return static_cast<USHORT>( aModelPositions[0] );
+ return static_cast<sal_uInt16>( aModelPositions[0] );
}
-USHORT SwAccessiblePortionData::GetLastValidCorePosition() const
+sal_uInt16 SwAccessiblePortionData::GetLastValidCorePosition() const
{
- return static_cast<USHORT>( aModelPositions[ aModelPositions.size()-1 ] );
+ return static_cast<sal_uInt16>( aModelPositions[ aModelPositions.size()-1 ] );
}
diff --git a/sw/source/core/access/accportions.hxx b/sw/source/core/access/accportions.hxx
index 807070a6573d..1e147ff2d99b 100644
--- a/sw/source/core/access/accportions.hxx
+++ b/sw/source/core/access/accportions.hxx
@@ -90,11 +90,11 @@ class SwAccessiblePortionData : public SwPortionHandler
sal_Bool IsPortionAttrSet( size_t nPortionNo, sal_uInt8 nAttr ) const;
sal_Bool IsSpecialPortion( size_t nPortionNo ) const;
sal_Bool IsReadOnlyPortion( size_t nPortionNo ) const;
- sal_Bool IsGrayPortionType( USHORT nType ) const;
+ sal_Bool IsGrayPortionType( sal_uInt16 nType ) const;
// helper method for GetEditableRange(...):
void AdjustAndCheck( sal_Int32 nPos, size_t& nPortionNo,
- USHORT& nCorePos, sal_Bool& bEdit ) const;
+ sal_uInt16& nCorePos, sal_Bool& bEdit ) const;
public:
SwAccessiblePortionData( const SwTxtNode* pTxtNd,
@@ -102,10 +102,10 @@ public:
virtual ~SwAccessiblePortionData();
// SwPortionHandler methods
- virtual void Text(USHORT nLength, USHORT nType);
- virtual void Special(USHORT nLength, const String& rText, USHORT nType);
+ virtual void Text(sal_uInt16 nLength, sal_uInt16 nType);
+ virtual void Special(sal_uInt16 nLength, const String& rText, sal_uInt16 nType);
virtual void LineBreak();
- virtual void Skip(USHORT nLength);
+ virtual void Skip(sal_uInt16 nLength);
virtual void Finish();
@@ -130,16 +130,16 @@ public:
/// get the position in the model string for a given
/// (accessibility) position
- USHORT GetModelPosition( sal_Int32 nPos ) const;
+ sal_uInt16 GetModelPosition( sal_Int32 nPos ) const;
/// get the position in the accessibility string for a given model position
- sal_Int32 GetAccessiblePosition( USHORT nPos ) const;
+ sal_Int32 GetAccessiblePosition( sal_uInt16 nPos ) const;
/// fill a SwSpecialPos structure, suitable for calling
/// SwTxtFrm->GetCharRect
/// Returns the core position, and fills thr rpPos either with NULL or
/// with the &rPos, after putting the appropriate data into it.
- USHORT FillSpecialPos( sal_Int32 nPos,
+ sal_uInt16 FillSpecialPos( sal_Int32 nPos,
SwSpecialPos& rPos,
SwSpecialPos*& rpPos ) const;
@@ -158,16 +158,16 @@ public:
/// or not at all. This can be used to test whether editing
/// that range would be legal
sal_Bool GetEditableRange( sal_Int32 nStart, sal_Int32 nEnd,
- USHORT& nCoreStart, USHORT& nCoreEnd ) const;
+ sal_uInt16& nCoreStart, sal_uInt16& nCoreEnd ) const;
/// Determine whether this core position is valid for these portions.
/// (A paragraph may be split into several frames, e.g. at page
/// boundaries. In this case, only part of a paragraph is represented
/// through this object. This method determines whether one particular
/// position is valid for this object or not.)
- sal_Bool IsValidCorePosition( USHORT nPos ) const;
- USHORT GetFirstValidCorePosition() const;
- USHORT GetLastValidCorePosition() const;
+ sal_Bool IsValidCorePosition( sal_uInt16 nPos ) const;
+ sal_uInt16 GetFirstValidCorePosition() const;
+ sal_uInt16 GetLastValidCorePosition() const;
};
diff --git a/sw/source/core/access/acctable.cxx b/sw/source/core/access/acctable.cxx
index 869f9b4c7d43..fd788574aad7 100644
--- a/sw/source/core/access/acctable.cxx
+++ b/sw/source/core/access/acctable.cxx
@@ -1468,7 +1468,7 @@ void SAL_CALL SwAccessibleTable::selectAccessibleChild(
const SwTableLine* pUpper = pBox->GetUpper();
while( pUpper->GetUpper() != NULL )
pUpper = pUpper->GetUpper()->GetUpper();
- USHORT nPos =
+ sal_uInt16 nPos =
pSelectedTable->GetTable().GetTabLines().GetPos( pUpper );
if( nPos == USHRT_MAX )
pSelectedTable = NULL;
diff --git a/sw/source/core/access/parachangetrackinginfo.cxx b/sw/source/core/access/parachangetrackinginfo.cxx
index 7c1e25f05c93..465e4a01b3da 100644
--- a/sw/source/core/access/parachangetrackinginfo.cxx
+++ b/sw/source/core/access/parachangetrackinginfo.cxx
@@ -94,7 +94,7 @@ namespace {
// iteration over the redlines which overlap with the text node.
const SwRedlineTbl& rRedlineTbl = pIDocChangeTrack->GetRedlineTbl();
- const USHORT nRedlineCount( rRedlineTbl.Count() );
+ const sal_uInt16 nRedlineCount( rRedlineTbl.Count() );
for ( sal_uInt16 nActRedline = nIdxOfFirstRedlineForTxtNode;
nActRedline < nRedlineCount;
++nActRedline)
diff --git a/sw/source/core/access/textmarkuphelper.cxx b/sw/source/core/access/textmarkuphelper.cxx
index 408a22ebd8ba..90444e4cdca0 100644
--- a/sw/source/core/access/textmarkuphelper.cxx
+++ b/sw/source/core/access/textmarkuphelper.cxx
@@ -147,7 +147,7 @@ sal_Int32 SwTextMarkupHelper::getTextMarkupCount( const sal_Int32 nTextMarkupTyp
if ( pTextMarkupList )
{
const SwWrongArea* pTextMarkup =
- pTextMarkupList->GetElement( static_cast<USHORT>(nTextMarkupIndex) );
+ pTextMarkupList->GetElement( static_cast<sal_uInt16>(nTextMarkupIndex) );
if ( pTextMarkup )
{
const ::rtl::OUString rText = mrPortionData.GetAccessibleString();
@@ -179,7 +179,7 @@ sal_Int32 SwTextMarkupHelper::getTextMarkupCount( const sal_Int32 nTextMarkupTyp
// assumption:
// value of <nCharIndex> is in range [0..length of accessible text)
- const USHORT nCoreCharIndex = mrPortionData.GetModelPosition( nCharIndex );
+ const sal_uInt16 nCoreCharIndex = mrPortionData.GetModelPosition( nCharIndex );
// Handling of portions with core length == 0 at the beginning of the
// paragraph - e.g. numbering portion.
if ( mrPortionData.GetAccessiblePosition( nCoreCharIndex ) > nCharIndex )
@@ -198,11 +198,11 @@ sal_Int32 SwTextMarkupHelper::getTextMarkupCount( const sal_Int32 nTextMarkupTyp
{
const ::rtl::OUString rText = mrPortionData.GetAccessibleString();
- const USHORT nTextMarkupCount = pTextMarkupList->Count();
- for ( USHORT nTextMarkupIdx = 0; nTextMarkupIdx < nTextMarkupCount; ++nTextMarkupIdx )
+ const sal_uInt16 nTextMarkupCount = pTextMarkupList->Count();
+ for ( sal_uInt16 nTextMarkupIdx = 0; nTextMarkupIdx < nTextMarkupCount; ++nTextMarkupIdx )
{
const SwWrongArea* pTextMarkup =
- pTextMarkupList->GetElement( static_cast<USHORT>(nTextMarkupIdx) );
+ pTextMarkupList->GetElement( static_cast<sal_uInt16>(nTextMarkupIdx) );
ASSERT( pTextMarkup,
"<SwTextMarkupHelper::getTextMarkup(..)> - missing <SwWrongArea> instance" );
if ( pTextMarkup &&
diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx
index b12805c9deeb..6a30ed257d41 100644
--- a/sw/source/core/attr/calbck.cxx
+++ b/sw/source/core/attr/calbck.cxx
@@ -42,6 +42,15 @@ TYPEINIT0(SwClient);
SwClient::SwClient(SwModify *pToRegisterIn)
: pLeft( 0 ), pRight( 0 ), pRegisteredIn( 0 ), mbIsAllowedToBeRemovedInModifyCall(false)
{
+<<<<<<< local
+=======
+ bModifyLocked =
+ bInModify =
+ bInDocDTOR =
+ bInCache = sal_False;
+ bInSwFntCache = sal_False;
+
+>>>>>>> other
if(pToRegisterIn)
// connect to SwModify
pToRegisterIn->Add(this);
@@ -92,10 +101,19 @@ SwClient::~SwClient()
}
+<<<<<<< local
/*************************************************************************/
BOOL SwClient::GetInfo( SfxPoolItem& ) const
+=======
+ // erfrage vom Client Informationen
+sal_Bool SwClient::GetInfo( SfxPoolItem& ) const
+>>>>>>> other
{
+<<<<<<< local
return TRUE; // no information here, return TRUE to enable continuation
+=======
+ return sal_True; // und weiter
+>>>>>>> other
}
@@ -170,7 +188,7 @@ void SwModify::NotifyClients( const SfxPoolItem *pOldValue, const SfxPoolItem *p
{
if (IsInCache() || IsInSwFntCache())
{
- const USHORT nWhich = pOldValue ? pOldValue->Which() :
+ const sal_uInt16 nWhich = pOldValue ? pOldValue->Which() :
pNewValue ? pNewValue->Which() : 0;
CheckCaching( nWhich );
}
@@ -180,9 +198,19 @@ void SwModify::NotifyClients( const SfxPoolItem *pOldValue, const SfxPoolItem *p
LockModify();
+<<<<<<< local
// mba: WTF?!
+=======
+#ifndef DBG_UTIL
+ bInModify = sal_True;
+#else
+>>>>>>> other
if( !pOldValue )
+<<<<<<< local
bLockClientList = TRUE;
+=======
+ bInModify = sal_True;
+>>>>>>> other
else
{
// following Modifies shouldn't call an ASSERT
@@ -197,21 +225,53 @@ void SwModify::NotifyClients( const SfxPoolItem *pOldValue, const SfxPoolItem *p
case RES_REFMARK_DELETED:
case RES_TOXMARK_DELETED:
case RES_FIELD_DELETED:
+<<<<<<< local
bLockClientList = FALSE;
+=======
+ bInModify = sal_False;
+>>>>>>> other
break;
default:
+<<<<<<< local
bLockClientList = TRUE;
+=======
+ bInModify = sal_True;
+>>>>>>> other
}
}
+<<<<<<< local
ModifyBroadcast( pOldValue, pNewValue );
bLockClientList = FALSE;
+=======
+ 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;
+>>>>>>> other
UnlockModify();
}
+<<<<<<< local
BOOL SwModify::GetInfo( SfxPoolItem& rInfo ) const
+=======
+// erfrage vom Modify Informationen
+
+sal_Bool SwModify::GetInfo( SfxPoolItem& rInfo ) const
+>>>>>>> other
{
+<<<<<<< local
BOOL bRet = TRUE; // means: continue with next one
+=======
+ sal_Bool bRet = sal_True; // bedeutet weiter zum naechsten
+>>>>>>> other
if( pRoot )
{
@@ -304,9 +364,14 @@ SwClient* SwModify::Remove(SwClient * pDepend)
pDepend->pLeft = 0;
pDepend->pRight = 0;
}
+<<<<<<< local
else
{
ASSERT( false, "SwModify::Remove(): pDepend nicht gefunden" );
+=======
+ else {
+ ASSERT( sal_False, "SwModify::Remove(): pDepend nicht gefunden");
+>>>>>>> other
}
// disconnect client from me
@@ -327,13 +392,24 @@ int SwModify::GetClientCount() const
return nRet;
}
+<<<<<<< local
/*************************************************************************/
+=======
+/*************************************************************************
+|* SwModify::CheckCaching( const sal_uInt16 nWhich )
+|*
+|* Ersterstellung JP 25.06.95
+|* Letzte Aenderung JP 25.06.95
+*************************************************************************/
+
+
+>>>>>>> other
-void SwModify::CheckCaching( const USHORT nWhich )
+void SwModify::CheckCaching( const sal_uInt16 nWhich )
{
if (isCHRATR(nWhich))
{
- SetInSwFntCache( FALSE );
+ SetInSwFntCache( sal_False );
}
else
switch ( nWhich )
@@ -341,7 +417,7 @@ void SwModify::CheckCaching( const USHORT nWhich )
case RES_OBJECTDYING:
case RES_FMT_CHG:
case RES_ATTRSET_CHG:
- SetInSwFntCache( FALSE );
+ SetInSwFntCache( sal_False );
case RES_UL_SPACE:
case RES_LR_SPACE:
@@ -353,7 +429,7 @@ void SwModify::CheckCaching( const USHORT nWhich )
if ( IsInCache() )
{
SwFrm::GetCache().Delete( this );
- SetInCache( FALSE );
+ SetInCache( sal_False );
}
break;
}
@@ -409,9 +485,14 @@ void SwDepend::SwClientNotify( const SwModify& rMod, const SfxHint& rHint )
pToTell->SwClientNotifyCall( rMod, rHint );
}
+<<<<<<< local
BOOL SwDepend::GetInfo( SfxPoolItem& rInfo ) const
+=======
+ // erfrage vom Modify Informationen
+sal_Bool SwDepend::GetInfo( SfxPoolItem& rInfo ) const
+>>>>>>> other
{
- return pToTell ? pToTell->GetInfo( rInfo ) : TRUE;
+ return pToTell ? pToTell->GetInfo( rInfo ) : sal_True;
}
/********************************************************************/
diff --git a/sw/source/core/attr/cellatr.cxx b/sw/source/core/attr/cellatr.cxx
index 17a7461fbc1e..e171b4408018 100644
--- a/sw/source/core/attr/cellatr.cxx
+++ b/sw/source/core/attr/cellatr.cxx
@@ -49,7 +49,7 @@
*************************************************************************/
-SwTblBoxNumFormat::SwTblBoxNumFormat( UINT32 nFormat, BOOL bFlag )
+SwTblBoxNumFormat::SwTblBoxNumFormat( sal_uInt32 nFormat, sal_Bool bFlag )
: SfxUInt32Item( RES_BOXATR_FORMAT, nFormat ), bAuto( bFlag )
{
}
@@ -136,7 +136,7 @@ void SwTblBoxFormula::ChangeState( const SfxPoolItem* pItem )
if( !pItem || RES_TABLEFML_UPDATE != pItem->Which() )
{
// setze bei allen das Value-Flag zurueck
- ChgValid( FALSE );
+ ChgValid( sal_False );
return ;
}
@@ -157,7 +157,7 @@ void SwTblBoxFormula::ChangeState( const SfxPoolItem* pItem )
// if( VF_CMD & pFld->GetFormat() )
// pFld->PtrToBoxNm( pUpdtFld->pTbl );
// else
- ChgValid( FALSE );
+ ChgValid( sal_False );
break;
case TBL_BOXNAME:
// ist es die gesuchte Tabelle ??
@@ -181,20 +181,20 @@ void SwTblBoxFormula::ChangeState( const SfxPoolItem* pItem )
case TBL_SPLITTBL:
if( &pTblNd->GetTable() == pUpdtFld->pTbl )
{
- USHORT nLnPos = SwTableFormula::GetLnPosInTbl(
+ sal_uInt16 nLnPos = SwTableFormula::GetLnPosInTbl(
pTblNd->GetTable(), GetTableBox() );
pUpdtFld->bBehindSplitLine = USHRT_MAX != nLnPos &&
pUpdtFld->nSplitLine <= nLnPos;
}
else
- pUpdtFld->bBehindSplitLine = FALSE;
+ pUpdtFld->bBehindSplitLine = sal_False;
// kein break
case TBL_MERGETBL:
if( pUpdtFld->pHistory )
{
// fuer die History brauche ich aber die unveraenderte Formel
SwTblBoxFormula aCopy( *this );
- pUpdtFld->bModified = FALSE;
+ pUpdtFld->bModified = sal_False;
ToSplitMergeBoxNm( *pUpdtFld );
if( pUpdtFld->bModified )
diff --git a/sw/source/core/attr/fmtwrapinfluenceonobjpos.cxx b/sw/source/core/attr/fmtwrapinfluenceonobjpos.cxx
index 48b9ad321e0e..fde57e74e2ff 100644
--- a/sw/source/core/attr/fmtwrapinfluenceonobjpos.cxx
+++ b/sw/source/core/attr/fmtwrapinfluenceonobjpos.cxx
@@ -77,7 +77,7 @@ SfxPoolItem* SwFmtWrapInfluenceOnObjPos::Clone( SfxItemPool * ) const
return new SwFmtWrapInfluenceOnObjPos(*this);
}
-BOOL SwFmtWrapInfluenceOnObjPos::QueryValue( Any& rVal, BYTE nMemberId ) const
+sal_Bool SwFmtWrapInfluenceOnObjPos::QueryValue( Any& rVal, sal_uInt8 nMemberId ) const
{
nMemberId &= ~CONVERT_TWIPS;
sal_Bool bRet = sal_True;
@@ -96,7 +96,7 @@ BOOL SwFmtWrapInfluenceOnObjPos::QueryValue( Any& rVal, BYTE nMemberId ) const
return bRet;
}
-BOOL SwFmtWrapInfluenceOnObjPos::PutValue( const Any& rVal, BYTE nMemberId )
+sal_Bool SwFmtWrapInfluenceOnObjPos::PutValue( const Any& rVal, sal_uInt8 nMemberId )
{
nMemberId &= ~CONVERT_TWIPS;
sal_Bool bRet = sal_True;
diff --git a/sw/source/core/attr/format.cxx b/sw/source/core/attr/format.cxx
index 51d8e842365e..8c80a87738ea 100644
--- a/sw/source/core/attr/format.cxx
+++ b/sw/source/core/attr/format.cxx
@@ -46,7 +46,7 @@ TYPEINIT1( SwFmt, SwClient ); //rtti fuer SwFmt
SwFmt::SwFmt( SwAttrPool& rPool, const sal_Char* pFmtNm,
- const USHORT* pWhichRanges, SwFmt *pDrvdFrm, USHORT nFmtWhich )
+ const sal_uInt16* pWhichRanges, SwFmt *pDrvdFrm, sal_uInt16 nFmtWhich )
: SwModify( pDrvdFrm ),
aSet( rPool, pWhichRanges ),
nWhichId( nFmtWhich ),
@@ -56,8 +56,8 @@ SwFmt::SwFmt( SwAttrPool& rPool, const sal_Char* pFmtNm,
nPoolHlpFileId( UCHAR_MAX )
{
aFmtName.AssignAscii( pFmtNm );
- bWritten = bFmtInDTOR = bAutoUpdateFmt = FALSE; // LAYER_IMPL
- bAutoFmt = TRUE;
+ bWritten = bFmtInDTOR = bAutoUpdateFmt = sal_False; // LAYER_IMPL
+ bAutoFmt = sal_True;
if( pDrvdFrm )
aSet.SetParent( &pDrvdFrm->aSet );
@@ -65,7 +65,7 @@ SwFmt::SwFmt( SwAttrPool& rPool, const sal_Char* pFmtNm,
SwFmt::SwFmt( SwAttrPool& rPool, const String &rFmtNm,
- const USHORT* pWhichRanges, SwFmt *pDrvdFrm, USHORT nFmtWhich )
+ const sal_uInt16* pWhichRanges, SwFmt *pDrvdFrm, sal_uInt16 nFmtWhich )
: SwModify( pDrvdFrm ),
aFmtName( rFmtNm ),
aSet( rPool, pWhichRanges ),
@@ -75,8 +75,8 @@ SwFmt::SwFmt( SwAttrPool& rPool, const String &rFmtNm,
nPoolHelpId( USHRT_MAX ),
nPoolHlpFileId( UCHAR_MAX )
{
- bWritten = bFmtInDTOR = bAutoUpdateFmt = FALSE; // LAYER_IMPL
- bAutoFmt = TRUE;
+ bWritten = bFmtInDTOR = bAutoUpdateFmt = sal_False; // LAYER_IMPL
+ bAutoFmt = sal_True;
if( pDrvdFrm )
aSet.SetParent( &pDrvdFrm->aSet );
@@ -93,7 +93,7 @@ SwFmt::SwFmt( const SwFmt& rFmt )
nPoolHelpId( rFmt.GetPoolHelpId() ),
nPoolHlpFileId( rFmt.GetPoolHlpFileId() )
{
- bWritten = bFmtInDTOR = FALSE; // LAYER_IMPL
+ bWritten = bFmtInDTOR = sal_False; // LAYER_IMPL
bAutoFmt = rFmt.bAutoFmt;
bAutoUpdateFmt = rFmt.bAutoUpdateFmt;
@@ -122,9 +122,9 @@ SwFmt &SwFmt::operator=(const SwFmt& rFmt)
if ( IsInCache() )
{
SwFrm::GetCache().Delete( this );
- SetInCache( FALSE );
+ SetInCache( sal_False );
}
- SetInSwFntCache( FALSE );
+ SetInSwFntCache( sal_False );
// kopiere nur das Attribut-Delta Array
SwAttrSet aOld( *aSet.GetPool(), aSet.GetRanges() ),
@@ -191,16 +191,16 @@ void SwFmt::SetName( const String& rNewName, sal_Bool bBroadcast )
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
-void SwFmt::CopyAttrs( const SwFmt& rFmt, BOOL bReplace )
+void SwFmt::CopyAttrs( const SwFmt& rFmt, sal_Bool bReplace )
{
// kopiere nur das Attribut-Delta Array
if ( IsInCache() )
{
SwFrm::GetCache().Delete( this );
- SetInCache( FALSE );
+ SetInCache( sal_False );
}
- SetInSwFntCache( FALSE );
+ SetInSwFntCache( sal_False );
// Sonderbehandlung fuer einige Attribute
SwAttrSet* pChgSet = (SwAttrSet*)&rFmt.aSet;
@@ -252,7 +252,7 @@ SwFmt::~SwFmt()
{
ASSERT(DerivedFrom(), "SwFmt::~SwFmt: Def Abhaengige!" );
- bFmtInDTOR = TRUE;
+ bFmtInDTOR = sal_True;
SwFmt *pParentFmt = DerivedFrom();
if (!pParentFmt) // see #112405#
@@ -285,9 +285,9 @@ SwFmt::~SwFmt()
void SwFmt::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue )
{
- BOOL bWeiter = TRUE; // TRUE = Propagierung an die Abhaengigen
+ sal_Bool bWeiter = sal_True; // sal_True = Propagierung an die Abhaengigen
- USHORT nWhich = pOldValue ? pOldValue->Which() :
+ sal_uInt16 nWhich = pOldValue ? pOldValue->Which() :
pNewValue ? pNewValue->Which() : 0 ;
switch( nWhich )
{
@@ -330,8 +330,13 @@ void SwFmt::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue )
if( aNew.Count() )
// keine mehr gesetzt, dann Ende !!
+<<<<<<< local
NotifyClients( &aOld, &aNew );
bWeiter = FALSE;
+=======
+ SwModify::Modify( &aOld, &aNew );
+ bWeiter = sal_False;
+>>>>>>> other
}
break;
case RES_FMT_CHG:
@@ -353,11 +358,20 @@ void SwFmt::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue )
// Formate (und keine Frames) propagieren.
// mba: the code does the opposite from what is written in the comment!
ResetWritten();
+<<<<<<< local
// 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 = FALSE;
+=======
+ SwClientIter aIter( *this );
+ for( SwClient *pClient = aIter.First( TYPE(SwFmt) ); pClient;
+ pClient = aIter.Next() )
+ pClient->Modify( pOldValue, pNewValue );
+
+ bWeiter = sal_False;
+>>>>>>> other
}
break;
@@ -365,14 +379,14 @@ void SwFmt::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue )
{
// Ist das Attribut in diesem Format definiert, dann auf
// NICHT weiter propagieren !!
- if( SFX_ITEM_SET == aSet.GetItemState( nWhich, FALSE ))
+ if( SFX_ITEM_SET == aSet.GetItemState( nWhich, sal_False ))
{
// wie finde ich heraus, ob nicht ich die Message versende ??
// aber wer ruft das hier ????
-//ASSERT( FALSE, "Modify ohne Absender verschickt" );
+//ASSERT( sal_False, "Modify ohne Absender verschickt" );
//JP 11.06.96: DropCaps koennen hierher kommen
ASSERT( RES_PARATR_DROP == nWhich, "Modify ohne Absender verschickt" );
- bWeiter = FALSE;
+ bWeiter = sal_False;
}
} // default
@@ -387,7 +401,7 @@ ASSERT( RES_PARATR_DROP == nWhich, "Modify ohne Absender verschickt" );
}
-BOOL SwFmt::SetDerivedFrom(SwFmt *pDerFrom)
+sal_Bool SwFmt::SetDerivedFrom(SwFmt *pDerFrom)
{
if ( pDerFrom )
{
@@ -396,7 +410,7 @@ BOOL SwFmt::SetDerivedFrom(SwFmt *pDerFrom)
while ( pFmt != 0 )
{
if ( pFmt == this )
- return FALSE;
+ return sal_False;
pFmt=pFmt->DerivedFrom();
}
@@ -409,7 +423,7 @@ BOOL SwFmt::SetDerivedFrom(SwFmt *pDerFrom)
pDerFrom = pDerFrom->DerivedFrom();
}
if ( (pDerFrom == DerivedFrom()) || (pDerFrom == this) )
- return FALSE;
+ return sal_False;
ASSERT( Which()==pDerFrom->Which()
|| ( Which()==RES_CONDTXTFMTCOLL && pDerFrom->Which()==RES_TXTFMTCOLL)
@@ -420,9 +434,9 @@ BOOL SwFmt::SetDerivedFrom(SwFmt *pDerFrom)
if ( IsInCache() )
{
SwFrm::GetCache().Delete( this );
- SetInCache( FALSE );
+ SetInCache( sal_False );
}
- SetInSwFntCache( FALSE );
+ SetInSwFntCache( sal_False );
pDerFrom->Add(this);
aSet.SetParent( &pDerFrom->aSet );
@@ -431,22 +445,22 @@ BOOL SwFmt::SetDerivedFrom(SwFmt *pDerFrom)
SwFmtChg aNewFmt(this);
ModifyNotification( &aOldFmt, &aNewFmt );
- return TRUE;
+ return sal_True;
}
-BOOL SwFmt::SetFmtAttr(const SfxPoolItem& rAttr )
+sal_Bool SwFmt::SetFmtAttr(const SfxPoolItem& rAttr )
{
if ( IsInCache() || IsInSwFntCache() )
{
- const USHORT nWhich = rAttr.Which();
+ const sal_uInt16 nWhich = rAttr.Which();
CheckCaching( nWhich );
}
// wenn Modify gelockt ist, werden keine Modifies verschickt;
// fuer FrmFmt's immer das Modify verschicken!
- BOOL bRet = FALSE;
- const USHORT nFmtWhich = Which();
+ sal_Bool bRet = sal_False;
+ const sal_uInt16 nFmtWhich = Which();
if( IsModifyLocked() || (!GetDepends() &&
(RES_GRFFMTCOLL == nFmtWhich ||
RES_TXTFMTCOLL == nFmtWhich ) ) )
@@ -481,22 +495,22 @@ BOOL SwFmt::SetFmtAttr(const SfxPoolItem& rAttr )
}
-BOOL SwFmt::SetFmtAttr( const SfxItemSet& rSet )
+sal_Bool SwFmt::SetFmtAttr( const SfxItemSet& rSet )
{
if( !rSet.Count() )
- return FALSE;
+ return sal_False;
if ( IsInCache() )
{
SwFrm::GetCache().Delete( this );
- SetInCache( FALSE );
+ SetInCache( sal_False );
}
- SetInSwFntCache( FALSE );
+ SetInSwFntCache( sal_False );
// wenn Modify gelockt ist, werden keine Modifies verschickt;
// fuer FrmFmt's immer das Modify verschicken!
- BOOL bRet = FALSE;
- const USHORT nFmtWhich = Which();
+ sal_Bool bRet = sal_False;
+ const sal_uInt16 nFmtWhich = Which();
if ( IsModifyLocked() ||
( !GetDepends() &&
( RES_GRFFMTCOLL == nFmtWhich ||
@@ -531,17 +545,17 @@ BOOL SwFmt::SetFmtAttr( const SfxItemSet& rSet )
// Nimmt den Hint mit nWhich aus dem Delta-Array
-BOOL SwFmt::ResetFmtAttr( USHORT nWhich1, USHORT nWhich2 )
+sal_Bool SwFmt::ResetFmtAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 )
{
if( !aSet.Count() )
- return FALSE;
+ return sal_False;
if( !nWhich2 || nWhich2 < nWhich1 )
nWhich2 = nWhich1; // dann setze auf 1. Id, nur dieses Item
if ( IsInCache() || IsInSwFntCache() )
{
- for( USHORT n = nWhich1; n < nWhich2; ++n )
+ for( sal_uInt16 n = nWhich1; n < nWhich2; ++n )
CheckCaching( n );
}
@@ -553,7 +567,7 @@ BOOL SwFmt::ResetFmtAttr( USHORT nWhich1, USHORT nWhich2 )
SwAttrSet aOld( *aSet.GetPool(), aSet.GetRanges() ),
aNew( *aSet.GetPool(), aSet.GetRanges() );
- BOOL bRet = 0 != aSet.ClearItem_BC( nWhich1, nWhich2, &aOld, &aNew );
+ sal_Bool bRet = 0 != aSet.ClearItem_BC( nWhich1, nWhich2, &aOld, &aNew );
if( bRet )
{
@@ -568,7 +582,7 @@ BOOL SwFmt::ResetFmtAttr( USHORT nWhich1, USHORT nWhich2 )
// --> OD 2007-01-24 #i73790#
// method renamed
-USHORT SwFmt::ResetAllFmtAttr()
+sal_uInt16 SwFmt::ResetAllFmtAttr()
// <--
{
if( !aSet.Count() )
@@ -577,9 +591,9 @@ USHORT SwFmt::ResetAllFmtAttr()
if ( IsInCache() )
{
SwFrm::GetCache().Delete( this );
- SetInCache( FALSE );
+ SetInCache( sal_False );
}
- SetInSwFntCache( FALSE );
+ SetInSwFntCache( sal_False );
// wenn Modify gelockt ist, werden keine Modifies verschickt
if( IsModifyLocked() )
@@ -587,7 +601,7 @@ USHORT SwFmt::ResetAllFmtAttr()
SwAttrSet aOld( *aSet.GetPool(), aSet.GetRanges() ),
aNew( *aSet.GetPool(), aSet.GetRanges() );
- BOOL bRet = 0 != aSet.ClearItem_BC( 0, &aOld, &aNew );
+ sal_Bool bRet = 0 != aSet.ClearItem_BC( 0, &aOld, &aNew );
if( bRet )
{
@@ -608,9 +622,9 @@ USHORT SwFmt::ResetAllFmtAttr()
*************************************************************************/
-BOOL SwFmt::GetInfo( SfxPoolItem& rInfo ) const
+sal_Bool SwFmt::GetInfo( SfxPoolItem& rInfo ) const
{
- BOOL bRet = SwModify::GetInfo( rInfo );
+ sal_Bool bRet = SwModify::GetInfo( rInfo );
return bRet;
}
@@ -623,9 +637,9 @@ void SwFmt::DelDiffs( const SfxItemSet& rSet )
if ( IsInCache() )
{
SwFrm::GetCache().Delete( this );
- SetInCache( FALSE );
+ SetInCache( sal_False );
}
- SetInSwFntCache( FALSE );
+ SetInSwFntCache( sal_False );
// wenn Modify gelockt ist, werden keine Modifies verschickt
if( IsModifyLocked() )
@@ -636,7 +650,7 @@ void SwFmt::DelDiffs( const SfxItemSet& rSet )
SwAttrSet aOld( *aSet.GetPool(), aSet.GetRanges() ),
aNew( *aSet.GetPool(), aSet.GetRanges() );
- BOOL bRet = 0 != aSet.Intersect_BC( rSet, &aOld, &aNew );
+ sal_Bool bRet = 0 != aSet.Intersect_BC( rSet, &aOld, &aNew );
if( bRet )
{
diff --git a/sw/source/core/attr/hints.cxx b/sw/source/core/attr/hints.cxx
index 0ded6c326320..3d9d284b8c6d 100644
--- a/sw/source/core/attr/hints.cxx
+++ b/sw/source/core/attr/hints.cxx
@@ -68,7 +68,7 @@ SwDelTxt::SwDelTxt( xub_StrLen nS, xub_StrLen nL )
-SwUpdateAttr::SwUpdateAttr( xub_StrLen nS, xub_StrLen nE, USHORT nW )
+SwUpdateAttr::SwUpdateAttr( xub_StrLen nS, xub_StrLen nE, sal_uInt16 nW )
: SwMsgPoolItem( RES_UPDATE_ATTR ),
nStart( nS ),
nEnd( nE ),
@@ -103,7 +103,7 @@ SwTableFmlUpdate::SwTableFmlUpdate( const SwTable* pNewTbl )
eFlags( TBL_CALC )
{
DATA.pDelTbl = 0;
- bModified = bBehindSplitLine = FALSE;
+ bModified = bBehindSplitLine = sal_False;
ASSERT( pTbl, "es muss ein Table-Pointer gesetzt werden!" );
}
@@ -116,7 +116,7 @@ SwAutoFmtGetDocNode::SwAutoFmtGetDocNode( const SwNodes* pNds )
SwAttrSetChg::SwAttrSetChg( const SwAttrSet& rTheSet, SwAttrSet& rSet )
: SwMsgPoolItem( RES_ATTRSET_CHG ),
- bDelSet( FALSE ),
+ bDelSet( sal_False ),
pChgSet( &rSet ),
pTheChgdSet( &rTheSet )
{}
@@ -124,7 +124,7 @@ SwAttrSetChg::SwAttrSetChg( const SwAttrSet& rTheSet, SwAttrSet& rSet )
SwAttrSetChg::SwAttrSetChg( const SwAttrSetChg& rChgSet )
: SwMsgPoolItem( RES_ATTRSET_CHG ),
- bDelSet( TRUE ),
+ bDelSet( sal_True ),
pTheChgdSet( rChgSet.pTheChgdSet )
{
pChgSet = new SwAttrSet( *rChgSet.pChgSet );
@@ -140,7 +140,7 @@ SwAttrSetChg::~SwAttrSetChg()
#ifdef DBG_UTIL
-void SwAttrSetChg::ClearItem( USHORT nWhch )
+void SwAttrSetChg::ClearItem( sal_uInt16 nWhch )
{
ASSERT( bDelSet, "der Set darf nicht veraendert werden!" );
pChgSet->ClearItem( nWhch );
@@ -149,7 +149,7 @@ void SwAttrSetChg::ClearItem( USHORT nWhch )
#endif
-SwMsgPoolItem::SwMsgPoolItem( USHORT nWhch )
+SwMsgPoolItem::SwMsgPoolItem( sal_uInt16 nWhch )
: SfxPoolItem( nWhch )
{}
@@ -157,14 +157,14 @@ SwMsgPoolItem::SwMsgPoolItem( USHORT nWhch )
// "Overhead" vom SfxPoolItem
int SwMsgPoolItem::operator==( const SfxPoolItem& ) const
{
- ASSERT( FALSE, "SwMsgPoolItem kennt kein ==" );
+ ASSERT( sal_False, "SwMsgPoolItem kennt kein ==" );
return 0;
}
SfxPoolItem* SwMsgPoolItem::Clone( SfxItemPool* ) const
{
- ASSERT( FALSE, "SwMsgPoolItem kennt kein Clone" );
+ ASSERT( sal_False, "SwMsgPoolItem kennt kein Clone" );
return 0;
}
@@ -175,12 +175,12 @@ SfxPoolItem* SwMsgPoolItem::Clone( SfxItemPool* ) const
* Used to be inlined (hintids.hxx) in PRODUCT.
******************************************************************************/
#ifndef DBG_UTIL
-const SfxPoolItem* GetDfltAttr( USHORT nWhich )
+const SfxPoolItem* GetDfltAttr( sal_uInt16 nWhich )
{
return aAttrTab[ nWhich - POOLATTR_BEGIN ];
}
#else
-const SfxPoolItem* GetDfltAttr( USHORT nWhich )
+const SfxPoolItem* GetDfltAttr( sal_uInt16 nWhich )
{
ASSERT_ID( nWhich < POOLATTR_END && nWhich >= POOLATTR_BEGIN,
ERR_OUTOFSCOPE );
@@ -228,7 +228,7 @@ void SwFindNearestNode::CheckNode( const SwNode& rNd )
{
if( &pNd->GetNodes() == &rNd.GetNodes() )
{
- ULONG nIdx = rNd.GetIndex();
+ sal_uLong nIdx = rNd.GetIndex();
if( nIdx < pNd->GetIndex() &&
( !pFnd || nIdx > pFnd->GetIndex() ) &&
nIdx > rNd.GetNodes().GetEndOfExtras().GetIndex() )
@@ -238,20 +238,20 @@ void SwFindNearestNode::CheckNode( const SwNode& rNd )
-USHORT GetWhichOfScript( USHORT nWhich, USHORT nScript )
+sal_uInt16 GetWhichOfScript( sal_uInt16 nWhich, sal_uInt16 nScript )
{
- static const USHORT aLangMap[3] =
+ static const sal_uInt16 aLangMap[3] =
{ RES_CHRATR_LANGUAGE, RES_CHRATR_CJK_LANGUAGE, RES_CHRATR_CTL_LANGUAGE };
- static const USHORT aFontMap[3] =
+ static const sal_uInt16 aFontMap[3] =
{ RES_CHRATR_FONT, RES_CHRATR_CJK_FONT, RES_CHRATR_CTL_FONT};
- static const USHORT aFontSizeMap[3] =
+ static const sal_uInt16 aFontSizeMap[3] =
{ RES_CHRATR_FONTSIZE, RES_CHRATR_CJK_FONTSIZE, RES_CHRATR_CTL_FONTSIZE };
- static const USHORT aWeightMap[3] =
+ static const sal_uInt16 aWeightMap[3] =
{ RES_CHRATR_WEIGHT, RES_CHRATR_CJK_WEIGHT, RES_CHRATR_CTL_WEIGHT};
- static const USHORT aPostureMap[3] =
+ static const sal_uInt16 aPostureMap[3] =
{ RES_CHRATR_POSTURE, RES_CHRATR_CJK_POSTURE, RES_CHRATR_CTL_POSTURE};
- const USHORT* pM;
+ const sal_uInt16* pM;
switch( nWhich )
{
case RES_CHRATR_LANGUAGE:
@@ -287,13 +287,13 @@ USHORT GetWhichOfScript( USHORT nWhich, USHORT nScript )
pM = 0;
}
- USHORT nRet;
+ sal_uInt16 nRet;
if( pM )
{
using namespace ::com::sun::star::i18n;
{
if( ScriptType::WEAK == nScript )
- nScript = GetI18NScriptTypeOfLanguage( (USHORT)GetAppLanguage() );
+ nScript = GetI18NScriptTypeOfLanguage( (sal_uInt16)GetAppLanguage() );
switch( nScript)
{
case ScriptType::COMPLEX: ++pM; // no break;
diff --git a/sw/source/core/attr/swatrset.cxx b/sw/source/core/attr/swatrset.cxx
index cdfa6a5f6d3f..1753f06a8c1f 100644
--- a/sw/source/core/attr/swatrset.cxx
+++ b/sw/source/core/attr/swatrset.cxx
@@ -73,13 +73,13 @@ SwAttrPool::~SwAttrPool()
{
}
-SwAttrSet::SwAttrSet( SwAttrPool& rPool, USHORT nWh1, USHORT nWh2 )
+SwAttrSet::SwAttrSet( SwAttrPool& rPool, sal_uInt16 nWh1, sal_uInt16 nWh2 )
: SfxItemSet( rPool, nWh1, nWh2 ), pOldSet( 0 ), pNewSet( 0 )
{
}
-SwAttrSet::SwAttrSet( SwAttrPool& rPool, const USHORT* nWhichPairTable )
+SwAttrSet::SwAttrSet( SwAttrPool& rPool, const sal_uInt16* nWhichPairTable )
: SfxItemSet( rPool, nWhichPairTable ), pOldSet( 0 ), pNewSet( 0 )
{
}
@@ -90,7 +90,7 @@ SwAttrSet::SwAttrSet( const SwAttrSet& rSet )
{
}
-SfxItemSet* SwAttrSet::Clone( BOOL bItems, SfxItemPool *pToPool ) const
+SfxItemSet* SwAttrSet::Clone( sal_Bool bItems, SfxItemPool *pToPool ) const
{
if ( pToPool && pToPool != GetPool() )
{
@@ -104,11 +104,11 @@ SfxItemSet* SwAttrSet::Clone( BOOL bItems, SfxItemPool *pToPool ) const
if ( bItems )
{
SfxWhichIter aIter(*pTmpSet);
- USHORT nWhich = aIter.FirstWhich();
+ sal_uInt16 nWhich = aIter.FirstWhich();
while ( nWhich )
{
const SfxPoolItem* pItem;
- if ( SFX_ITEM_SET == GetItemState( nWhich, FALSE, &pItem ) )
+ if ( SFX_ITEM_SET == GetItemState( nWhich, sal_False, &pItem ) )
pTmpSet->Put( *pItem, pItem->Which() );
nWhich = aIter.NextWhich();
}
@@ -145,24 +145,24 @@ int SwAttrSet::Put_BC( const SfxItemSet& rSet,
-USHORT SwAttrSet::ClearItem_BC( USHORT nWhich,
+sal_uInt16 SwAttrSet::ClearItem_BC( sal_uInt16 nWhich,
SwAttrSet* pOld, SwAttrSet* pNew )
{
pNewSet = pNew;
pOldSet = pOld;
- USHORT nRet = SfxItemSet::ClearItem( nWhich );
+ sal_uInt16 nRet = SfxItemSet::ClearItem( nWhich );
pOldSet = pNewSet = 0;
return nRet;
}
-USHORT SwAttrSet::ClearItem_BC( USHORT nWhich1, USHORT nWhich2,
+sal_uInt16 SwAttrSet::ClearItem_BC( sal_uInt16 nWhich1, sal_uInt16 nWhich2,
SwAttrSet* pOld, SwAttrSet* pNew )
{
ASSERT( nWhich1 <= nWhich2, "kein gueltiger Bereich" );
pNewSet = pNew;
pOldSet = pOld;
- USHORT nRet = 0;
+ sal_uInt16 nRet = 0;
for( ; nWhich1 <= nWhich2; ++nWhich1 )
nRet = nRet + SfxItemSet::ClearItem( nWhich1 );
pOldSet = pNewSet = 0;
@@ -206,14 +206,14 @@ bool SwAttrSet::SetModifyAtAttr( const SwModify* pModify )
bool bSet = false;
const SfxPoolItem* pItem;
- if( SFX_ITEM_SET == GetItemState( RES_PAGEDESC, FALSE, &pItem ) &&
+ if( SFX_ITEM_SET == GetItemState( RES_PAGEDESC, sal_False, &pItem ) &&
((SwFmtPageDesc*)pItem)->GetDefinedIn() != pModify )
{
((SwFmtPageDesc*)pItem)->ChgDefinedIn( pModify );
bSet = true;
}
- if( SFX_ITEM_SET == GetItemState( RES_PARATR_DROP, FALSE, &pItem ) &&
+ if( SFX_ITEM_SET == GetItemState( RES_PARATR_DROP, sal_False, &pItem ) &&
((SwFmtDrop*)pItem)->GetDefinedIn() != pModify )
{
// CharFormat gesetzt und dann noch in unterschiedlichen
@@ -229,7 +229,7 @@ bool SwAttrSet::SetModifyAtAttr( const SwModify* pModify )
bSet = true;
}
- if( SFX_ITEM_SET == GetItemState( RES_BOXATR_FORMULA, FALSE, &pItem ) &&
+ if( SFX_ITEM_SET == GetItemState( RES_BOXATR_FORMULA, sal_False, &pItem ) &&
((SwTblBoxFormula*)pItem)->GetDefinedIn() != pModify )
{
((SwTblBoxFormula*)pItem)->ChgDefinedIn( pModify );
@@ -259,14 +259,14 @@ void SwAttrSet::CopyToModify( SwModify& rMod ) const
// muss die NumRule kopiert werden?
if( pSrcDoc != pDstDoc && SFX_ITEM_SET == GetItemState(
- RES_PARATR_NUMRULE, FALSE, &pItem ) )
+ RES_PARATR_NUMRULE, sal_False, &pItem ) )
{
const String& rNm = ((SwNumRuleItem*)pItem)->GetValue();
if( rNm.Len() )
{
SwNumRule* pDestRule = pDstDoc->FindNumRulePtr( rNm );
if( pDestRule )
- pDestRule->SetInvalidRule( TRUE );
+ pDestRule->SetInvalidRule( sal_True );
else
pDstDoc->MakeNumRule( rNm,
pSrcDoc->FindNumRulePtr( rNm ) );
@@ -278,7 +278,7 @@ void SwAttrSet::CopyToModify( SwModify& rMod ) const
// for text nodes
if ( pSrcDoc != pDstDoc &&
pCNd && pCNd->IsTxtNode() &&
- GetItemState( RES_PARATR_LIST_ID, FALSE, &pItem ) == SFX_ITEM_SET )
+ GetItemState( RES_PARATR_LIST_ID, sal_False, &pItem ) == SFX_ITEM_SET )
{
const String& sListId =
dynamic_cast<const SfxStringItem*>(pItem)->GetValue();
@@ -329,7 +329,7 @@ void SwAttrSet::CopyToModify( SwModify& rMod ) const
// Gegenueber dem alten Verhalten, sie zu entfernen
const SwPageDesc* pPgDesc;
if( pSrcDoc != pDstDoc && SFX_ITEM_SET == GetItemState(
- RES_PAGEDESC, FALSE, &pItem ) &&
+ RES_PAGEDESC, sal_False, &pItem ) &&
0 != ( pPgDesc = ((SwFmtPageDesc*)pItem)->GetPageDesc()) )
{
SfxItemSet aTmpSet( *this );
@@ -391,14 +391,14 @@ void SwAttrSet::CopyToModify( SwModify& rMod ) const
}
// check if ID is InRange of AttrSet-Ids
-BOOL IsInRange( const USHORT* pRange, const USHORT nId )
+sal_Bool IsInRange( const sal_uInt16* pRange, const sal_uInt16 nId )
{
while( *pRange )
{
if( *pRange <= nId && nId <= *(pRange+1) )
- return TRUE;
+ return sal_True;
pRange += 2;
}
- return FALSE;
+ return sal_False;
}
diff --git a/sw/source/core/bastyp/bparr.cxx b/sw/source/core/bastyp/bparr.cxx
index 5dbb3dad6537..1b6db5d3dc52 100644
--- a/sw/source/core/bastyp/bparr.cxx
+++ b/sw/source/core/bastyp/bparr.cxx
@@ -36,7 +36,7 @@
// die Blockverwaltung waechst/schrumpft immer um 20 Bloecke, das sind dann
// immer ~ 20 * MAXENTRY == 20000 Eintraege
-const USHORT nBlockGrowSize = 20;
+const sal_uInt16 nBlockGrowSize = 20;
#ifndef DBG_UTIL
@@ -46,12 +46,12 @@ const USHORT nBlockGrowSize = 20;
#define CHECKIDX( p, n, i, c ) CheckIdx( p, n, i, c );
-void CheckIdx( BlockInfo** ppInf, USHORT nBlock, ULONG nSize, USHORT nCur )
+void CheckIdx( BlockInfo** ppInf, sal_uInt16 nBlock, sal_uLong nSize, sal_uInt16 nCur )
{
DBG_ASSERT( !nSize || nCur < nBlock, "BigPtrArray: CurIndex steht falsch" );
- ULONG nIdx = 0;
- for( USHORT nCnt = 0; nCnt < nBlock; ++nCnt, ++ppInf )
+ sal_uLong nIdx = 0;
+ for( sal_uInt16 nCnt = 0; nCnt < nBlock; ++nCnt, ++ppInf )
{
nIdx += (*ppInf)->nElem;
// Array mit Luecken darf es nicht geben
@@ -80,7 +80,7 @@ BigPtrArray::~BigPtrArray()
if( nBlock )
{
BlockInfo** pp = ppInf;
- for( USHORT n = 0; n < nBlock; ++n, ++pp )
+ for( sal_uInt16 n = 0; n < nBlock; ++n, ++pp )
{
delete[] (*pp)->pData;
delete *pp;
@@ -92,9 +92,9 @@ BigPtrArray::~BigPtrArray()
// Auch der Move ist schlicht. Optimieren ist hier wg. der
// Stueckelung des Feldes zwecklos!
-void BigPtrArray::Move( ULONG from, ULONG to )
+void BigPtrArray::Move( sal_uLong from, sal_uLong to )
{
- USHORT cur = Index2Block( from );
+ sal_uInt16 cur = Index2Block( from );
BlockInfo* p = ppInf[ cur ];
ElementPtr pElem = p->pData[ from - p->nStart ];
Insert( pElem, to ); // erst einfuegen, dann loeschen !!!!
@@ -104,7 +104,7 @@ void BigPtrArray::Move( ULONG from, ULONG to )
// das Ende ist EXCLUSIV
-void BigPtrArray::ForEach( ULONG nStart, ULONG nEnd,
+void BigPtrArray::ForEach( sal_uLong nStart, sal_uLong nEnd,
FnForEach fn, void* pArgs )
{
if( nEnd > nSize )
@@ -112,10 +112,10 @@ void BigPtrArray::ForEach( ULONG nStart, ULONG nEnd,
if( nStart < nEnd )
{
- USHORT cur = Index2Block( nStart );
+ sal_uInt16 cur = Index2Block( nStart );
BlockInfo** pp = ppInf + cur;
BlockInfo* p = *pp;
- USHORT nElem = USHORT( nStart - p->nStart );
+ sal_uInt16 nElem = sal_uInt16( nStart - p->nStart );
ElementPtr* pElem = p->pData + nElem;
nElem = p->nElem - nElem;
for(;;)
@@ -136,12 +136,12 @@ void BigPtrArray::ForEach( ULONG nStart, ULONG nEnd,
}
-ElementPtr BigPtrArray::operator[]( ULONG idx ) const
+ElementPtr BigPtrArray::operator[]( sal_uLong idx ) const
{
// weil die Funktion eben doch nicht const ist:
DBG_ASSERT( idx < nSize, "operator[]: Index aussserhalb" );
BigPtrArray* pThis = (BigPtrArray*) this;
- USHORT cur = Index2Block( idx );
+ sal_uInt16 cur = Index2Block( idx );
BlockInfo* p = ppInf[ cur ];
pThis->nCur = cur;
return p->pData[ idx - p->nStart ];
@@ -161,7 +161,7 @@ ElementPtr BigPtrArray::operator[]( ULONG idx ) const
-USHORT BigPtrArray::Index2Block( ULONG pos ) const
+sal_uInt16 BigPtrArray::Index2Block( sal_uLong pos ) const
{
// zuletzt verwendeter Block?
BlockInfo* p = ppInf[ nCur ];
@@ -186,11 +186,11 @@ USHORT BigPtrArray::Index2Block( ULONG pos ) const
}
// Binaere Suche:
// Diese fuehrt immer zum Erfolg
- USHORT lower = 0, upper = nBlock - 1;
- USHORT cur = 0;
+ sal_uInt16 lower = 0, upper = nBlock - 1;
+ sal_uInt16 cur = 0;
for(;;)
{
- USHORT n = lower + ( upper - lower ) / 2;
+ sal_uInt16 n = lower + ( upper - lower ) / 2;
cur = ( n == cur ) ? n+1 : n;
p = ppInf[ cur ];
if( p->nStart <= pos && p->nEnd >= pos )
@@ -207,10 +207,10 @@ USHORT BigPtrArray::Index2Block( ULONG pos ) const
// pos bezeichnet den letzten korrekten Block
-void BigPtrArray::UpdIndex( USHORT pos )
+void BigPtrArray::UpdIndex( sal_uInt16 pos )
{
BlockInfo** pp = ppInf + pos;
- ULONG idx = (*pp)->nEnd + 1;
+ sal_uLong idx = (*pp)->nEnd + 1;
BlockInfo* p;
while( ++pos < nBlock )
{
@@ -227,7 +227,7 @@ void BigPtrArray::UpdIndex( USHORT pos )
-BlockInfo* BigPtrArray::InsBlock( USHORT pos )
+BlockInfo* BigPtrArray::InsBlock( sal_uInt16 pos )
{
if( nBlock == nMaxBlock )
{
@@ -256,7 +256,7 @@ BlockInfo* BigPtrArray::InsBlock( USHORT pos )
return p;
}
-void BigPtrArray::BlockDel( USHORT nDel )
+void BigPtrArray::BlockDel( sal_uInt16 nDel )
{
nBlock = nBlock - nDel;
if( nMaxBlock - nBlock > nBlockGrowSize )
@@ -272,12 +272,12 @@ void BigPtrArray::BlockDel( USHORT nDel )
}
-void BigPtrArray::Insert( const ElementPtr& rElem, ULONG pos )
+void BigPtrArray::Insert( const ElementPtr& rElem, sal_uLong pos )
{
CHECKIDX( ppInf, nBlock, nSize, nCur );
BlockInfo* p;
- USHORT cur;
+ sal_uInt16 cur;
if( !nSize )
// Sonderfall: erstes Element einfuegen
p = InsBlock( cur = 0 );
@@ -353,14 +353,14 @@ void BigPtrArray::Insert( const ElementPtr& rElem, ULONG pos )
DBG_ASSERT( pos < MAXENTRY, "falsche Pos" );
if( pos != p->nElem )
{
- int nCount = p->nElem - USHORT(pos);
+ int nCount = p->nElem - sal_uInt16(pos);
ElementPtr *pFrom = p->pData + p->nElem,
*pTo = pFrom + 1;
while( nCount-- )
++( *--pTo = *--pFrom )->nOffset;
}
// Element eintragen und Indexe updaten
- ((ElementPtr&)rElem)->nOffset = USHORT(pos);
+ ((ElementPtr&)rElem)->nOffset = sal_uInt16(pos);
((ElementPtr&)rElem)->pBlock = p;
p->pData[ pos ] = rElem;
p->nEnd++;
@@ -372,28 +372,28 @@ void BigPtrArray::Insert( const ElementPtr& rElem, ULONG pos )
CHECKIDX( ppInf, nBlock, nSize, nCur );
}
-void BigPtrArray::Remove( ULONG pos, ULONG n )
+void BigPtrArray::Remove( sal_uLong pos, sal_uLong n )
{
CHECKIDX( ppInf, nBlock, nSize, nCur );
- USHORT nBlkdel = 0; // entfernte Bloecke
- USHORT cur = Index2Block( pos ); // aktuelle Blocknr
- USHORT nBlk1 = cur; // 1. behandelter Block
- USHORT nBlk1del = USHRT_MAX; // 1. entfernter Block
+ sal_uInt16 nBlkdel = 0; // entfernte Bloecke
+ sal_uInt16 cur = Index2Block( pos ); // aktuelle Blocknr
+ sal_uInt16 nBlk1 = cur; // 1. behandelter Block
+ sal_uInt16 nBlk1del = USHRT_MAX; // 1. entfernter Block
BlockInfo* p = ppInf[ cur ];
pos -= p->nStart;
- ULONG nElem = n;
+ sal_uLong nElem = n;
while( nElem )
{
- USHORT nel = p->nElem - USHORT(pos);
- if( ULONG(nel) > nElem )
- nel = USHORT(nElem);
+ sal_uInt16 nel = p->nElem - sal_uInt16(pos);
+ if( sal_uLong(nel) > nElem )
+ nel = sal_uInt16(nElem);
// Eventuell Elemente verschieben
- if( ( pos + nel ) < ULONG(p->nElem) )
+ if( ( pos + nel ) < sal_uLong(p->nElem) )
{
ElementPtr *pTo = p->pData + pos,
*pFrom = pTo + nel;
- int nCount = p->nElem - nel - USHORT(pos);
+ int nCount = p->nElem - nel - sal_uInt16(pos);
while( nCount-- )
{
*pTo = *pFrom++;
@@ -421,7 +421,7 @@ void BigPtrArray::Remove( ULONG pos, ULONG n )
if( nBlkdel )
{
// loeschen sollte man immer !!
- for( USHORT i = nBlk1del; i < ( nBlk1del + nBlkdel ); i++ )
+ for( sal_uInt16 i = nBlk1del; i < ( nBlk1del + nBlkdel ); i++ )
delete ppInf[ i ];
if( ( nBlk1del + nBlkdel ) < nBlock )
@@ -457,15 +457,15 @@ void BigPtrArray::Remove( ULONG pos, ULONG n )
}
-void BigPtrArray::Replace( ULONG idx, const ElementPtr& rElem)
+void BigPtrArray::Replace( sal_uLong idx, const ElementPtr& rElem)
{
// weil die Funktion eben doch nicht const ist:
DBG_ASSERT( idx < nSize, "Set: Index aussserhalb" );
BigPtrArray* pThis = (BigPtrArray*) this;
- USHORT cur = Index2Block( idx );
+ sal_uInt16 cur = Index2Block( idx );
BlockInfo* p = ppInf[ cur ];
pThis->nCur = cur;
- ((ElementPtr&)rElem)->nOffset = USHORT(idx - p->nStart);
+ ((ElementPtr&)rElem)->nOffset = sal_uInt16(idx - p->nStart);
((ElementPtr&)rElem)->pBlock = p;
p->pData[ idx - p->nStart ] = rElem;
}
@@ -473,7 +473,7 @@ void BigPtrArray::Replace( ULONG idx, const ElementPtr& rElem)
// Array komprimieren
-USHORT BigPtrArray::Compress( short nMax )
+sal_uInt16 BigPtrArray::Compress( short nMax )
{
CHECKIDX( ppInf, nBlock, nSize, nCur );
@@ -484,17 +484,17 @@ USHORT BigPtrArray::Compress( short nMax )
BlockInfo** pp = ppInf, **qq = pp;
BlockInfo* p;
BlockInfo* pLast(0); // letzter nicht voller Block
- USHORT nLast = 0; // fehlende Elemente
- USHORT nBlkdel = 0; // Anzahl der geloeschte Bloecke
- USHORT nFirstChgPos = USHRT_MAX; // ab welcher Pos gab es die 1. Aenderung?
+ sal_uInt16 nLast = 0; // fehlende Elemente
+ sal_uInt16 nBlkdel = 0; // Anzahl der geloeschte Bloecke
+ sal_uInt16 nFirstChgPos = USHRT_MAX; // ab welcher Pos gab es die 1. Aenderung?
// von Fuell-Prozenten auf uebrige Eintrage umrechnen
nMax = MAXENTRY - (long) MAXENTRY * nMax / 100;
- for( USHORT cur = 0; cur < nBlock; ++cur )
+ for( sal_uInt16 cur = 0; cur < nBlock; ++cur )
{
p = *pp++;
- USHORT n = p->nElem;
+ sal_uInt16 n = p->nElem;
// Testen, ob der noch nicht volle Block so gelassen wird
// dies ist der Fall, wenn der aktuelle Block gesplittet
// werden muesste, der noch nicht volle Block aber bereits
@@ -515,7 +515,7 @@ USHORT BigPtrArray::Compress( short nMax )
// Elemente uebertragen, vom akt. in den letzten
ElementPtr* pElem = pLast->pData + pLast->nElem;
ElementPtr* pFrom = p->pData;
- for( USHORT nCount = n, nOff = pLast->nElem;
+ for( sal_uInt16 nCount = n, nOff = pLast->nElem;
nCount; --nCount, ++pElem )
*pElem = *pFrom++,
(*pElem)->pBlock = pLast,
diff --git a/sw/source/core/bastyp/breakit.cxx b/sw/source/core/bastyp/breakit.cxx
index 4253507b11b5..29fc02a3f7e1 100644
--- a/sw/source/core/bastyp/breakit.cxx
+++ b/sw/source/core/bastyp/breakit.cxx
@@ -116,11 +116,11 @@ void SwBreakIt::_GetForbidden( const LanguageType aLang )
m_pForbidden = new i18n::ForbiddenCharacters( aWrap.getForbiddenCharacters() );
}
-USHORT SwBreakIt::GetRealScriptOfText( const String& rTxt,
+sal_uInt16 SwBreakIt::GetRealScriptOfText( const String& rTxt,
xub_StrLen nPos ) const
{
createBreakIterator();
- USHORT nScript = i18n::ScriptType::WEAK;
+ sal_uInt16 nScript = i18n::ScriptType::WEAK;
if( xBreak.is() && rTxt.Len() )
{
if( nPos && nPos == rTxt.Len() )
@@ -149,17 +149,17 @@ USHORT SwBreakIt::GetRealScriptOfText( const String& rTxt,
nScript = xBreak->getScriptType( rTxt, nChgPos );
}
if( i18n::ScriptType::WEAK == nScript )
- nScript = GetI18NScriptTypeOfLanguage( (USHORT)GetAppLanguage() );
+ nScript = GetI18NScriptTypeOfLanguage( (sal_uInt16)GetAppLanguage() );
return nScript;
}
-USHORT SwBreakIt::GetAllScriptsOfText( const String& rTxt ) const
+sal_uInt16 SwBreakIt::GetAllScriptsOfText( const String& rTxt ) const
{
- const USHORT coAllScripts = ( SCRIPTTYPE_LATIN |
+ const sal_uInt16 coAllScripts = ( SCRIPTTYPE_LATIN |
SCRIPTTYPE_ASIAN |
SCRIPTTYPE_COMPLEX );
createBreakIterator();
- USHORT nRet = 0, nScript;
+ sal_uInt16 nRet = 0, nScript;
if( !xBreak.is() )
nRet = coAllScripts;
else if( rTxt.Len() )
diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx
index baf76e5fe5ec..b5622c150801 100644
--- a/sw/source/core/bastyp/calc.cxx
+++ b/sw/source/core/bastyp/calc.cxx
@@ -218,16 +218,16 @@ _CalcOp* FindOperator( const String& rSrch )
//-----------------------------------------------------------------------------
-SwHash* Find( const String& rStr, SwHash** ppTable, USHORT nTblSize,
- USHORT* pPos )
+SwHash* Find( const String& rStr, SwHash** ppTable, sal_uInt16 nTblSize,
+ sal_uInt16* pPos )
{
- ULONG ii = 0;
+ sal_uLong ii = 0;
for( xub_StrLen n = 0; n < rStr.Len(); ++n )
ii = ii << 1 ^ rStr.GetChar( n );
ii %= nTblSize;
if( pPos )
- *pPos = (USHORT)ii;
+ *pPos = (sal_uInt16)ii;
for( SwHash* pEntry = *(ppTable+ii); pEntry; pEntry = pEntry->pNext )
if( rStr == pEntry->aStr )
@@ -239,7 +239,7 @@ inline LanguageType GetDocAppScriptLang( SwDoc& rDoc )
{
return ((SvxLanguageItem&)rDoc.GetDefault(
GetWhichOfScript( RES_CHRATR_LANGUAGE,
- GetI18NScriptTypeOfLanguage( (USHORT)GetAppLanguage() ))
+ GetI18NScriptTypeOfLanguage( (sal_uInt16)GetAppLanguage() ))
)).GetLanguage();
}
@@ -336,25 +336,25 @@ static const sal_Char* __READONLY_DATA sNTypeTab[ 27 ] =
// diese sind mit doppelten HashIds
sNType25, sNType26
};
-static USHORT __READONLY_DATA aHashValue[ 27 ] =
+static sal_uInt16 __READONLY_DATA aHashValue[ 27 ] =
{
34, 38, 43, 7, 18, 32, 22, 29, 30, 33, 3,
28, 24, 40, 9, 11, 26, 45, 4, 23, 36, 44, 19, 5, 1,
// diese sind mit doppelten HashIds
11, 38
};
-static USHORT __READONLY_DATA aAdrToken[ 12 ] =
+static sal_uInt16 __READONLY_DATA aAdrToken[ 12 ] =
{
USER_OPT_COMPANY, USER_OPT_STREET, USER_OPT_COUNTRY, USER_OPT_ZIP,
USER_OPT_CITY, USER_OPT_TITLE, USER_OPT_POSITION, USER_OPT_TELEPHONEWORK,
USER_OPT_TELEPHONEHOME, USER_OPT_FAX, USER_OPT_EMAIL, USER_OPT_STATE
};
-static USHORT SwDocStat::* __READONLY_DATA aDocStat1[ 3 ] =
+static sal_uInt16 SwDocStat::* __READONLY_DATA aDocStat1[ 3 ] =
{
&SwDocStat::nTbl, &SwDocStat::nGrf, &SwDocStat::nOLE
};
-static ULONG SwDocStat::* __READONLY_DATA aDocStat2[ 4 ] =
+static sal_uLong SwDocStat::* __READONLY_DATA aDocStat2[ 4 ] =
{
&SwDocStat::nPage, &SwDocStat::nPara,
&SwDocStat::nWord, &SwDocStat::nChar
@@ -368,7 +368,7 @@ static ULONG SwDocStat::* __READONLY_DATA aDocStat2[ 4 ] =
SwSbxValue nVal;
String sTmpStr;
- USHORT n;
+ sal_uInt16 n;
for( n = 0; n < 25; ++n )
{
@@ -376,8 +376,8 @@ static ULONG SwDocStat::* __READONLY_DATA aDocStat2[ 4 ] =
VarTable[ aHashValue[ n ] ] = new SwCalcExp( sTmpStr, nVal, 0 );
}
- ((SwCalcExp*)VarTable[ aHashValue[ 0 ] ])->nValue.PutBool( FALSE );
- ((SwCalcExp*)VarTable[ aHashValue[ 1 ] ])->nValue.PutBool( TRUE );
+ ((SwCalcExp*)VarTable[ aHashValue[ 0 ] ])->nValue.PutBool( sal_False );
+ ((SwCalcExp*)VarTable[ aHashValue[ 1 ] ])->nValue.PutBool( sal_True );
((SwCalcExp*)VarTable[ aHashValue[ 2 ] ])->nValue.PutDouble( F_PI );
((SwCalcExp*)VarTable[ aHashValue[ 3 ] ])->nValue.PutDouble( 2.7182818284590452354 );
@@ -418,7 +418,7 @@ static ULONG SwDocStat::* __READONLY_DATA aDocStat2[ 4 ] =
SwCalc::~SwCalc()
{
- for( USHORT n = 0; n < TBLSZ; ++n )
+ for( sal_uInt16 n = 0; n < TBLSZ; ++n )
delete VarTable[n];
if( pLclData != m_aSysLocale.GetLocaleDataPtr() )
delete pLclData;
@@ -460,9 +460,9 @@ SwSbxValue SwCalc::Calculate( const String& rStr )
/******************************************************************************
|*
-|* String SwCalc::GetStrResult( SwSbxValue nValue, BOOL bRound = TRUE )
-|* Beschreibung Der Parameter bRound ist auf TRUE defaultet und darf
-|* nur beim errechnen von Tabellenzellen auf FALSE gesetzt
+|* String SwCalc::GetStrResult( SwSbxValue nValue, sal_Bool bRound = sal_True )
+|* Beschreibung Der Parameter bRound ist auf sal_True defaultet und darf
+|* nur beim errechnen von Tabellenzellen auf sal_False gesetzt
|* werden, damit keine Rundungsfehler beim zusammenstellen
|* der Formel entstehen.
|* Erstellung OK 12-02-93 11:04am
@@ -470,7 +470,7 @@ SwSbxValue SwCalc::Calculate( const String& rStr )
|*
|******************************************************************************/
-String SwCalc::GetStrResult( const SwSbxValue& rVal, BOOL bRound )
+String SwCalc::GetStrResult( const SwSbxValue& rVal, sal_Bool bRound )
{
if( !rVal.IsDouble() )
return rVal.GetString();
@@ -479,7 +479,7 @@ String SwCalc::GetStrResult( const SwSbxValue& rVal, BOOL bRound )
}
-String SwCalc::GetStrResult( double nValue, BOOL )
+String SwCalc::GetStrResult( double nValue, sal_Bool )
{
if( nValue >= DBL_MAX )
switch( eError )
@@ -494,7 +494,7 @@ String SwCalc::GetStrResult( double nValue, BOOL )
default : return RESOURCE->aCalc_Default;
}
- USHORT nDec = 15; //pLclData->getNumDigits();
+ sal_uInt16 nDec = 15; //pLclData->getNumDigits();
String aRetStr( ::rtl::math::doubleToUString( nValue,
rtl_math_StringFormat_Automatic,
nDec,
@@ -522,17 +522,17 @@ SwCalcExp* SwCalc::VarInsert( const String &rStr )
/******************************************************************************
|*
-|* SwCalcExp* SwCalc::VarLook( const String& , USHORT ins )
+|* SwCalcExp* SwCalc::VarLook( const String& , sal_uInt16 ins )
|*
|* Erstellung OK 12-02-93 11:04am
|* Letzte Aenderung JP 15.11.99
|*
|******************************************************************************/
-SwCalcExp* SwCalc::VarLook( const String& rStr, USHORT ins )
+SwCalcExp* SwCalc::VarLook( const String& rStr, sal_uInt16 ins )
{
aErrExpr.nValue.SetVoidValue(false);
- USHORT ii = 0;
+ sal_uInt16 ii = 0;
String aStr( rStr );
pCharClass->toLower( aStr );
@@ -566,7 +566,7 @@ SwCalcExp* SwCalc::VarLook( const String& rStr, USHORT ins )
else if( !pUFld->IsValid() )
{
// Die aktuellen Werte sichern . . .
- USHORT nOld_ListPor = nListPor;
+ sal_uInt16 nOld_ListPor = nListPor;
SwSbxValue nOld_LastLeft = nLastLeft;
SwSbxValue nOld_NumberValue = nNumberValue;
xub_StrLen nOld_CommandPos = nCommandPos;
@@ -624,7 +624,7 @@ SwCalcExp* SwCalc::VarLook( const String& rStr, USHORT ins )
return &aErrExpr;
}
- ULONG nTmpRec = 0;
+ sal_uLong nTmpRec = 0;
if( 0 != ( pFnd = Find( sDBNum, VarTable, TBLSZ ) ) )
nTmpRec = ((SwCalcExp*)pFnd)->nValue.GetULong();
@@ -679,7 +679,7 @@ SwCalcExp* SwCalc::VarLook( const String& rStr, USHORT ins )
/******************************************************************************
|*
-|* BOOL SwCalc::VarChange( const String& rStr, const SwSbxValue nValue )
+|* sal_Bool SwCalc::VarChange( const String& rStr, const SwSbxValue nValue )
|*
|* Erstellung OK 12-02-93 11:04am
|* Letzte Aenderung OK 12-02-93 11:04am
@@ -697,7 +697,7 @@ void SwCalc::VarChange( const String& rStr, const SwSbxValue& rValue )
String aStr( rStr );
pCharClass->toLower( aStr );
- USHORT nPos = 0;
+ sal_uInt16 nPos = 0;
SwCalcExp* pFnd = (SwCalcExp*)Find( aStr, VarTable, TBLSZ, &nPos );
if( !pFnd )
@@ -712,20 +712,20 @@ void SwCalc::VarChange( const String& rStr, const SwSbxValue& rValue )
/******************************************************************************
|*
-|* BOOL SwCalc::Push( const void* pPtr )
+|* sal_Bool SwCalc::Push( const void* pPtr )
|*
|* Erstellung OK 12-02-93 11:05am
|* Letzte Aenderung OK 12-02-93 11:05am
|*
|******************************************************************************/
-BOOL SwCalc::Push( const VoidPtr pPtr )
+sal_Bool SwCalc::Push( const VoidPtr pPtr )
{
if( USHRT_MAX != aRekurStk.GetPos( pPtr ) )
- return FALSE;
+ return sal_False;
aRekurStk.Insert( pPtr, aRekurStk.Count() );
- return TRUE;
+ return sal_True;
}
/******************************************************************************
@@ -774,13 +774,13 @@ if( !nUseOld )
coStartFlags, aEmptyStr,
coContFlags, aEmptyStr );
- BOOL bSetError = TRUE;
+ sal_Bool bSetError = sal_True;
xub_StrLen nRealStt = nCommandPos + (xub_StrLen)aRes.LeadingWhiteSpace;
if( aRes.TokenType & (KParseType::ASC_NUMBER | KParseType::UNI_NUMBER) )
{
nNumberValue.PutDouble( aRes.Value );
eCurrOper = CALC_NUMBER;
- bSetError = FALSE;
+ bSetError = sal_False;
}
else if( aRes.TokenType & KParseType::IDENTNAME )
{
@@ -824,20 +824,20 @@ if( !nUseOld )
}
aVarName = aName;
eCurrOper = CALC_NAME;
- bSetError = FALSE;
+ bSetError = sal_False;
}
else if ( aRes.TokenType & KParseType::DOUBLE_QUOTE_STRING )
{
nNumberValue.PutString( String( aRes.DequotedNameOrString ));
eCurrOper = CALC_NUMBER;
- bSetError = FALSE;
+ bSetError = sal_False;
}
else if( aRes.TokenType & KParseType::ONE_SINGLE_CHAR )
{
String aName( sCommand.Copy( nRealStt, static_cast<xub_StrLen>(aRes.EndPos) - nRealStt ));
if( 1 == aName.Len() )
{
- bSetError = FALSE;
+ bSetError = sal_False;
sal_Unicode ch = aName.GetChar( 0 );
switch( ch )
{
@@ -914,14 +914,14 @@ if( !nUseOld )
eCurrOper = CALC_NAME;
}
else
- bSetError = TRUE;
+ bSetError = sal_True;
}
else
- bSetError = TRUE;
+ bSetError = sal_True;
break;
default:
- bSetError = TRUE;
+ bSetError = sal_True;
break;
}
}
@@ -933,10 +933,10 @@ if( !nUseOld )
{
sal_Unicode ch = aName.GetChar(0);
- bSetError = TRUE;
+ bSetError = sal_True;
if ('<' == ch || '>' == ch)
{
- bSetError = FALSE;
+ bSetError = sal_False;
SwCalcOper eTmp2 = ('<' == ch) ? CALC_LEQ : CALC_GEQ;
eCurrOper = ('<' == ch) ? CALC_LES : CALC_GRE;
@@ -944,14 +944,14 @@ if( !nUseOld )
if( 2 == aName.Len() && '=' == aName.GetChar(1) )
eCurrOper = eTmp2;
else if( 1 != aName.Len() )
- bSetError = TRUE;
+ bSetError = sal_True;
}
}
}
else if( nRealStt == sCommand.Len() )
{
eCurrOper = CALC_ENDCALC;
- bSetError = FALSE;
+ bSetError = sal_False;
}
if( bSetError )
@@ -1066,15 +1066,15 @@ else
case '[': {
String aStr;
- BOOL bIgnore = FALSE;
+ sal_Bool bIgnore = sal_False;
do {
while( 0 != ( ch = NextCh( sCommand, nCommandPos ))
&& ch != ']' )
{
if( !bIgnore && '\\' == ch )
- bIgnore = TRUE;
+ bIgnore = sal_True;
else if( bIgnore )
- bIgnore = FALSE;
+ bIgnore = sal_False;
aStr += ch;
}
@@ -1175,7 +1175,7 @@ SwSbxValue SwCalc::Term()
nLastLeft = left;
for(;;)
{
- USHORT nSbxOper = USHRT_MAX;
+ sal_uInt16 nSbxOper = USHRT_MAX;
switch( eCurrOper )
{
@@ -1185,20 +1185,20 @@ SwSbxValue SwCalc::Term()
// case CALC_XOR: eSbxOper = SbxXOR; break;
case CALC_AND: {
GetToken();
- BOOL bB = Prim().GetBool();
+ sal_Bool bB = Prim().GetBool();
left.PutBool( left.GetBool() && bB );
}
break;
case CALC_OR: {
GetToken();
- BOOL bB = Prim().GetBool();
+ sal_Bool bB = Prim().GetBool();
left.PutBool( left.GetBool() || bB );
}
break;
case CALC_XOR: {
GetToken();
- BOOL bR = Prim().GetBool();
- BOOL bL = left.GetBool();
+ sal_Bool bR = Prim().GetBool();
+ sal_Bool bL = left.GetBool();
left.PutBool( (bL && !bR) || (!bL && bR) );
}
break;
@@ -1235,7 +1235,7 @@ SwSbxValue SwCalc::Term()
SwSbxValue e = Prim();
sal_Int32 nYear = (sal_Int32) floor( left.GetDouble() );
nYear = nYear & 0x0000FFFF;
- sal_Int32 nMonth = (INT32) floor( e.GetDouble() );
+ sal_Int32 nMonth = (sal_Int32) floor( e.GetDouble() );
nMonth = ( nMonth & 0x000000FF ) << 16;
left.PutLong( nMonth + nYear );
eCurrOper = CALC_DAY;
@@ -1259,7 +1259,7 @@ SwSbxValue SwCalc::Term()
double fVal = 0;
double fFac = 1;
- INT32 nDec = (INT32) floor( e.GetDouble() );
+ sal_Int32 nDec = (sal_Int32) floor( e.GetDouble() );
if( nDec < -20 || nDec > 20 )
{
eError = CALC_OVERFLOW;
@@ -1267,24 +1267,24 @@ SwSbxValue SwCalc::Term()
return left;
}
fVal = left.GetDouble();
- USHORT i;
+ sal_uInt16 i;
if( nDec >= 0)
- for (i = 0; i < (USHORT) nDec; ++i )
+ for (i = 0; i < (sal_uInt16) nDec; ++i )
fFac *= 10.0;
else
- for (i = 0; i < (USHORT) -nDec; ++i )
+ for (i = 0; i < (sal_uInt16) -nDec; ++i )
fFac /= 10.0;
fVal *= fFac;
- BOOL bSign;
+ sal_Bool bSign;
if (fVal < 0.0)
{
fVal *= -1.0;
- bSign = TRUE;
+ bSign = sal_True;
}
else
- bSign = FALSE;
+ bSign = sal_False;
// runden
double fNum = fVal; // find the exponent
@@ -1380,7 +1380,7 @@ SwSbxValue SwCalc::Prim()
pfCalc pFnc = 0;
- BOOL bChkTrig = FALSE, bChkPow = FALSE;
+ sal_Bool bChkTrig = sal_False, bChkPow = sal_False;
switch( eCurrOper )
{
@@ -1388,8 +1388,8 @@ SwSbxValue SwCalc::Prim()
case CALC_COS: pFnc = &cos; break;
case CALC_TAN: pFnc = &tan; break;
case CALC_ATAN: pFnc = &atan; break;
- case CALC_ASIN: pFnc = &asin; bChkTrig = TRUE; break;
- case CALC_ACOS: pFnc = &acos; bChkTrig = TRUE; break;
+ case CALC_ASIN: pFnc = &asin; bChkTrig = sal_True; break;
+ case CALC_ACOS: pFnc = &acos; bChkTrig = sal_True; break;
case CALC_NOT: {
GetToken();
@@ -1424,7 +1424,7 @@ SwSbxValue SwCalc::Prim()
else
{
nErg = nNumberValue;
- bChkPow = TRUE;
+ bChkPow = sal_True;
}
break;
@@ -1437,7 +1437,7 @@ SwSbxValue SwCalc::Prim()
else
{
nErg = VarLook( aVarName )->nValue;
- bChkPow = TRUE;
+ bChkPow = sal_True;
}
break;
@@ -1453,7 +1453,7 @@ SwSbxValue SwCalc::Prim()
else
{
GetToken();
- bChkPow = TRUE; // in order for =(7)^2 to work
+ bChkPow = sal_True; // in order for =(7)^2 to work
}
}
break;
@@ -1633,7 +1633,7 @@ lcl_Str2Double( const String& rCommand, xub_StrLen& rCommandPos, double& rVal,
}
/******************************************************************************
- * Methode : BOOL SwCalc::Str2Double( double& )
+ * Methode : sal_Bool SwCalc::Str2Double( double& )
* Beschreibung:
* Erstellt : OK 07.06.94 12:56
* Aenderung : JP 27.10.98
@@ -1671,10 +1671,10 @@ bool SwCalc::Str2Double( const String& rCommand, xub_StrLen& rCommandPos,
//------------------------------------------------------------------------------
-BOOL SwCalc::IsValidVarName( const String& rStr,
+sal_Bool SwCalc::IsValidVarName( const String& rStr,
String* pValidName )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
using namespace ::com::sun::star::i18n;
{
// Parse any token.
@@ -1719,9 +1719,9 @@ SwHash::~SwHash()
delete pNext;
}
-void DeleteHashTable( SwHash **ppHashTable, USHORT nCount )
+void DeleteHashTable( SwHash **ppHashTable, sal_uInt16 nCount )
{
- for ( USHORT i = 0; i < nCount; ++i )
+ for ( sal_uInt16 i = 0; i < nCount; ++i )
delete *(ppHashTable+i);
delete [] ppHashTable;
}
@@ -1739,7 +1739,7 @@ SwSbxValue::~SwSbxValue()
{
}
-BOOL SwSbxValue::GetBool() const
+sal_Bool SwSbxValue::GetBool() const
{
return SbxSTRING == GetType() ? 0 != GetString().Len()
: 0 != SbxValue::GetBool();
diff --git a/sw/source/core/bastyp/index.cxx b/sw/source/core/bastyp/index.cxx
index 2c1b6e2bbb65..d22c781169b3 100644
--- a/sw/source/core/bastyp/index.cxx
+++ b/sw/source/core/bastyp/index.cxx
@@ -260,7 +260,7 @@ SwIndex& SwIndex::operator=( const SwIndex& rIdx )
Remove();
pArray = rIdx.pArray;
pNext = pPrev = 0;
- bEqual = FALSE;
+ bEqual = sal_False;
}
else
bEqual = rIdx.nIndex == nIndex;
@@ -502,7 +502,7 @@ xub_StrLen SwIndex::operator-=( const SwIndex & rIndex )
|*
*************************************************************************/
-BOOL SwIndex::operator<( const SwIndex & rIndex ) const
+sal_Bool SwIndex::operator<( const SwIndex & rIndex ) const
{
ASSERT( pArray == rIndex.pArray, "Attempt to compare indices into different arrays.");
return nIndex < rIndex.nIndex;
@@ -518,7 +518,7 @@ BOOL SwIndex::operator<( const SwIndex & rIndex ) const
|*
*************************************************************************/
-BOOL SwIndex::operator<=( const SwIndex & rIndex ) const
+sal_Bool SwIndex::operator<=( const SwIndex & rIndex ) const
{
ASSERT( pArray == rIndex.pArray, "Attempt to compare indices into different arrays.");
return nIndex <= rIndex.nIndex;
@@ -534,7 +534,7 @@ BOOL SwIndex::operator<=( const SwIndex & rIndex ) const
|*
*************************************************************************/
-BOOL SwIndex::operator>( const SwIndex & rIndex ) const
+sal_Bool SwIndex::operator>( const SwIndex & rIndex ) const
{
ASSERT( pArray == rIndex.pArray, "Attempt to compare indices into different arrays.");
return nIndex > rIndex.nIndex;
@@ -550,7 +550,7 @@ BOOL SwIndex::operator>( const SwIndex & rIndex ) const
|*
*************************************************************************/
-BOOL SwIndex::operator>=( const SwIndex & rIndex ) const
+sal_Bool SwIndex::operator>=( const SwIndex & rIndex ) const
{
ASSERT( pArray == rIndex.pArray, "Attempt to compare indices into different arrays.");
return nIndex >= rIndex.nIndex;
diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx
index 345dd0221ffd..e150f5f0ae26 100644
--- a/sw/source/core/bastyp/init.cxx
+++ b/sw/source/core/bastyp/init.cxx
@@ -148,7 +148,7 @@ extern void ClearFEShellTabCols();
|* einige Bereiche fuer die Set in Collections / Nodes
|*************************************************************************/
// AttrSet-Range fuer die 2 Break-Attribute
-USHORT __FAR_DATA aBreakSetRange[] = {
+sal_uInt16 __FAR_DATA aBreakSetRange[] = {
RES_PAGEDESC, RES_BREAK,
0 };
@@ -156,7 +156,7 @@ USHORT __FAR_DATA aBreakSetRange[] = {
// OD 2008-02-27 #refactorlists# :
// list attributes ( RES_PARATR_LIST_BEGIN - RES_PARATR_LIST_END ) are not
// included in the paragraph style's itemset.
-USHORT __FAR_DATA aTxtFmtCollSetRange[] = {
+sal_uInt16 __FAR_DATA aTxtFmtCollSetRange[] = {
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
RES_CHRATR_BEGIN, RES_CHRATR_END-1,
RES_PARATR_BEGIN, RES_PARATR_END-1,
@@ -165,7 +165,7 @@ USHORT __FAR_DATA aTxtFmtCollSetRange[] = {
};
// AttrSet-Range fuer die GrfFmtColl
-USHORT __FAR_DATA aGrfFmtCollSetRange[] = {
+sal_uInt16 __FAR_DATA aGrfFmtCollSetRange[] = {
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
RES_GRFATR_BEGIN, RES_GRFATR_END-1,
RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
@@ -173,7 +173,7 @@ USHORT __FAR_DATA aGrfFmtCollSetRange[] = {
};
// AttrSet-Range fuer die TextNode
-USHORT __FAR_DATA aTxtNodeSetRange[] = {
+sal_uInt16 __FAR_DATA aTxtNodeSetRange[] = {
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
RES_CHRATR_BEGIN, RES_CHRATR_END-1,
RES_PARATR_BEGIN, RES_PARATR_END-1,
@@ -185,14 +185,14 @@ USHORT __FAR_DATA aTxtNodeSetRange[] = {
};
// AttrSet-Range fuer die NoTxtNode
-USHORT __FAR_DATA aNoTxtNodeSetRange[] = {
+sal_uInt16 __FAR_DATA aNoTxtNodeSetRange[] = {
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
RES_GRFATR_BEGIN, RES_GRFATR_END-1,
RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
0
};
-USHORT __FAR_DATA aTableSetRange[] = {
+sal_uInt16 __FAR_DATA aTableSetRange[] = {
RES_FILL_ORDER, RES_FRM_SIZE,
RES_LR_SPACE, RES_BREAK,
RES_BACKGROUND, RES_SHADOW,
@@ -207,7 +207,7 @@ USHORT __FAR_DATA aTableSetRange[] = {
0
};
-USHORT __FAR_DATA aTableLineSetRange[] = {
+sal_uInt16 __FAR_DATA aTableLineSetRange[] = {
RES_FILL_ORDER, RES_FRM_SIZE,
RES_LR_SPACE, RES_UL_SPACE,
RES_BACKGROUND, RES_SHADOW,
@@ -218,7 +218,7 @@ USHORT __FAR_DATA aTableLineSetRange[] = {
0
};
-USHORT __FAR_DATA aTableBoxSetRange[] = {
+sal_uInt16 __FAR_DATA aTableBoxSetRange[] = {
RES_FILL_ORDER, RES_FRM_SIZE,
RES_LR_SPACE, RES_UL_SPACE,
RES_BACKGROUND, RES_SHADOW,
@@ -231,21 +231,21 @@ USHORT __FAR_DATA aTableBoxSetRange[] = {
};
// AttrSet-Range fuer die SwFrmFmt
-USHORT __FAR_DATA aFrmFmtSetRange[] = {
+sal_uInt16 __FAR_DATA aFrmFmtSetRange[] = {
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
0
};
// AttrSet-Range fuer die SwCharFmt
-USHORT __FAR_DATA aCharFmtSetRange[] = {
+sal_uInt16 __FAR_DATA aCharFmtSetRange[] = {
RES_CHRATR_BEGIN, RES_CHRATR_END-1,
RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
0
};
// AttrSet-Range fuer die character autostyles
-USHORT __FAR_DATA aCharAutoFmtSetRange[] = {
+sal_uInt16 __FAR_DATA aCharAutoFmtSetRange[] = {
RES_CHRATR_BEGIN, RES_CHRATR_END-1,
RES_TXTATR_UNKNOWN_CONTAINER, RES_TXTATR_UNKNOWN_CONTAINER,
RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
@@ -253,7 +253,7 @@ USHORT __FAR_DATA aCharAutoFmtSetRange[] = {
};
// AttrSet-Range fuer die SwPageDescFmt
-USHORT __FAR_DATA aPgFrmFmtSetRange[] = {
+sal_uInt16 __FAR_DATA aPgFrmFmtSetRange[] = {
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
0
@@ -433,13 +433,13 @@ SfxItemInfo __FAR_DATA aSlotTab[] =
};
-USHORT* SwAttrPool::pVersionMap1 = 0;
-USHORT* SwAttrPool::pVersionMap2 = 0;
-USHORT* SwAttrPool::pVersionMap3 = 0;
-USHORT* SwAttrPool::pVersionMap4 = 0;
+sal_uInt16* SwAttrPool::pVersionMap1 = 0;
+sal_uInt16* SwAttrPool::pVersionMap2 = 0;
+sal_uInt16* SwAttrPool::pVersionMap3 = 0;
+sal_uInt16* SwAttrPool::pVersionMap4 = 0;
// OD 2004-01-21 #i18732#
-USHORT* SwAttrPool::pVersionMap5 = 0;
-USHORT* SwAttrPool::pVersionMap6 = 0;
+sal_uInt16* SwAttrPool::pVersionMap5 = 0;
+sal_uInt16* SwAttrPool::pVersionMap6 = 0;
SwIndexReg* SwIndexReg::pEmptyIndexArray = 0;
const sal_Char* __FAR_DATA pMarkToTable = "table";
@@ -494,9 +494,9 @@ void _InitCore()
aAttrTab[ RES_CHRATR_WEIGHT- POOLATTR_BEGIN ] = new SvxWeightItem( WEIGHT_NORMAL, RES_CHRATR_WEIGHT );
aAttrTab[ RES_CHRATR_WORDLINEMODE- POOLATTR_BEGIN ] = new SvxWordLineModeItem( sal_False, RES_CHRATR_WORDLINEMODE );
aAttrTab[ RES_CHRATR_AUTOKERN- POOLATTR_BEGIN ] = new SvxAutoKernItem( sal_False, RES_CHRATR_AUTOKERN );
- aAttrTab[ RES_CHRATR_BLINK - POOLATTR_BEGIN ] = new SvxBlinkItem( FALSE, RES_CHRATR_BLINK );
- aAttrTab[ RES_CHRATR_NOHYPHEN - POOLATTR_BEGIN ] = new SvxNoHyphenItem( TRUE, RES_CHRATR_NOHYPHEN );
- aAttrTab[ RES_CHRATR_NOLINEBREAK- POOLATTR_BEGIN ] = new SvxNoLinebreakItem( TRUE, RES_CHRATR_NOLINEBREAK );
+ aAttrTab[ RES_CHRATR_BLINK - POOLATTR_BEGIN ] = new SvxBlinkItem( sal_False, RES_CHRATR_BLINK );
+ aAttrTab[ RES_CHRATR_NOHYPHEN - POOLATTR_BEGIN ] = new SvxNoHyphenItem( sal_True, RES_CHRATR_NOHYPHEN );
+ aAttrTab[ RES_CHRATR_NOLINEBREAK- POOLATTR_BEGIN ] = new SvxNoLinebreakItem( sal_True, RES_CHRATR_NOLINEBREAK );
aAttrTab[ RES_CHRATR_BACKGROUND - POOLATTR_BEGIN ] = new SvxBrushItem( RES_CHRATR_BACKGROUND );
// CJK-Attributes
@@ -515,10 +515,10 @@ void _InitCore()
aAttrTab[ RES_CHRATR_ROTATE - POOLATTR_BEGIN ] = new SvxCharRotateItem( 0, sal_False, RES_CHRATR_ROTATE );
aAttrTab[ RES_CHRATR_EMPHASIS_MARK - POOLATTR_BEGIN ] = new SvxEmphasisMarkItem( EMPHASISMARK_NONE, RES_CHRATR_EMPHASIS_MARK );
- aAttrTab[ RES_CHRATR_TWO_LINES - POOLATTR_BEGIN ] = new SvxTwoLinesItem( FALSE, 0, 0, RES_CHRATR_TWO_LINES );
+ aAttrTab[ RES_CHRATR_TWO_LINES - POOLATTR_BEGIN ] = new SvxTwoLinesItem( sal_False, 0, 0, RES_CHRATR_TWO_LINES );
aAttrTab[ RES_CHRATR_SCALEW - POOLATTR_BEGIN ] = new SvxCharScaleWidthItem( 100, RES_CHRATR_SCALEW );
aAttrTab[ RES_CHRATR_RELIEF - POOLATTR_BEGIN ] = new SvxCharReliefItem( RELIEF_NONE, RES_CHRATR_RELIEF );
- aAttrTab[ RES_CHRATR_HIDDEN - POOLATTR_BEGIN ] = new SvxCharHiddenItem( FALSE, RES_CHRATR_HIDDEN );
+ aAttrTab[ RES_CHRATR_HIDDEN - POOLATTR_BEGIN ] = new SvxCharHiddenItem( sal_False, RES_CHRATR_HIDDEN );
aAttrTab[ RES_CHRATR_OVERLINE- POOLATTR_BEGIN ] = new SvxOverlineItem( UNDERLINE_NONE, RES_CHRATR_OVERLINE );
// CharakterAttr - Dummies
@@ -560,12 +560,12 @@ void _InitCore()
aAttrTab[ RES_PARATR_HYPHENZONE- POOLATTR_BEGIN ] = pItem;
aAttrTab[ RES_PARATR_DROP- POOLATTR_BEGIN ] = new SwFmtDrop;
- aAttrTab[ RES_PARATR_REGISTER - POOLATTR_BEGIN ] = new SwRegisterItem( FALSE );
+ aAttrTab[ RES_PARATR_REGISTER - POOLATTR_BEGIN ] = new SwRegisterItem( sal_False );
aAttrTab[ RES_PARATR_NUMRULE - POOLATTR_BEGIN ] = new SwNumRuleItem( aEmptyStr );
- aAttrTab[ RES_PARATR_SCRIPTSPACE - POOLATTR_BEGIN ] = new SvxScriptSpaceItem( TRUE, RES_PARATR_SCRIPTSPACE );
- aAttrTab[ RES_PARATR_HANGINGPUNCTUATION - POOLATTR_BEGIN ] = new SvxHangingPunctuationItem( TRUE, RES_PARATR_HANGINGPUNCTUATION );
- aAttrTab[ RES_PARATR_FORBIDDEN_RULES - POOLATTR_BEGIN ] = new SvxForbiddenRuleItem( TRUE, RES_PARATR_FORBIDDEN_RULES );
+ aAttrTab[ RES_PARATR_SCRIPTSPACE - POOLATTR_BEGIN ] = new SvxScriptSpaceItem( sal_True, RES_PARATR_SCRIPTSPACE );
+ aAttrTab[ RES_PARATR_HANGINGPUNCTUATION - POOLATTR_BEGIN ] = new SvxHangingPunctuationItem( sal_True, RES_PARATR_HANGINGPUNCTUATION );
+ aAttrTab[ RES_PARATR_FORBIDDEN_RULES - POOLATTR_BEGIN ] = new SvxForbiddenRuleItem( sal_True, RES_PARATR_FORBIDDEN_RULES );
aAttrTab[ RES_PARATR_VERTALIGN - POOLATTR_BEGIN ] = new SvxParaVertAlignItem( 0, RES_PARATR_VERTALIGN );
aAttrTab[ RES_PARATR_SNAPTOGRID - POOLATTR_BEGIN ] = new SvxParaGridItem( sal_True, RES_PARATR_SNAPTOGRID );
aAttrTab[ RES_PARATR_CONNECT_BORDER - POOLATTR_BEGIN ] = new SwParaConnectBorderItem;
@@ -575,9 +575,9 @@ void _InitCore()
// --> OD 2008-02-19 #refactorlists#
aAttrTab[ RES_PARATR_LIST_ID - POOLATTR_BEGIN ] = new SfxStringItem( RES_PARATR_LIST_ID, aEmptyStr );
aAttrTab[ RES_PARATR_LIST_LEVEL - POOLATTR_BEGIN ] = new SfxInt16Item( RES_PARATR_LIST_LEVEL, 0 );
- aAttrTab[ RES_PARATR_LIST_ISRESTART - POOLATTR_BEGIN ] = new SfxBoolItem( RES_PARATR_LIST_ISRESTART, FALSE );
+ aAttrTab[ RES_PARATR_LIST_ISRESTART - POOLATTR_BEGIN ] = new SfxBoolItem( RES_PARATR_LIST_ISRESTART, sal_False );
aAttrTab[ RES_PARATR_LIST_RESTARTVALUE - POOLATTR_BEGIN ] = new SfxInt16Item( RES_PARATR_LIST_RESTARTVALUE, 1 );
- aAttrTab[ RES_PARATR_LIST_ISCOUNTED - POOLATTR_BEGIN ] = new SfxBoolItem( RES_PARATR_LIST_ISCOUNTED, TRUE );
+ aAttrTab[ RES_PARATR_LIST_ISCOUNTED - POOLATTR_BEGIN ] = new SfxBoolItem( RES_PARATR_LIST_ISCOUNTED, sal_True );
// <--
aAttrTab[ RES_FILL_ORDER- POOLATTR_BEGIN ] = new SwFmtFillOrder;
@@ -602,7 +602,7 @@ void _InitCore()
aAttrTab[ RES_SHADOW- POOLATTR_BEGIN ] = new SvxShadowItem( RES_SHADOW );
aAttrTab[ RES_FRMMACRO- POOLATTR_BEGIN ] = new SvxMacroItem( RES_FRMMACRO );
aAttrTab[ RES_COL- POOLATTR_BEGIN ] = new SwFmtCol;
- aAttrTab[ RES_KEEP - POOLATTR_BEGIN ] = new SvxFmtKeepItem( FALSE, RES_KEEP );
+ aAttrTab[ RES_KEEP - POOLATTR_BEGIN ] = new SvxFmtKeepItem( sal_False, RES_KEEP );
aAttrTab[ RES_URL - POOLATTR_BEGIN ] = new SwFmtURL();
aAttrTab[ RES_EDIT_IN_READONLY - POOLATTR_BEGIN ] = new SwFmtEditInReadonly;
aAttrTab[ RES_LAYOUT_SPLIT - POOLATTR_BEGIN ] = new SwFmtLayoutSplit;
@@ -617,9 +617,9 @@ void _InitCore()
aAttrTab[ RES_ROW_SPLIT - POOLATTR_BEGIN ] = new SwFmtRowSplit;
// OD 18.09.2003 #i18732#
- aAttrTab[ RES_FOLLOW_TEXT_FLOW - POOLATTR_BEGIN ] = new SwFmtFollowTextFlow( TRUE );
+ aAttrTab[ RES_FOLLOW_TEXT_FLOW - POOLATTR_BEGIN ] = new SwFmtFollowTextFlow( sal_True );
// --> collapsing borders FME 2005-05-27 #i29550#
- aAttrTab[ RES_COLLAPSING_BORDERS - POOLATTR_BEGIN ] = new SfxBoolItem( RES_COLLAPSING_BORDERS, FALSE );
+ aAttrTab[ RES_COLLAPSING_BORDERS - POOLATTR_BEGIN ] = new SfxBoolItem( RES_COLLAPSING_BORDERS, sal_False );
// <-- collapsing
// OD 2004-05-04 #i28701#
// --> OD 2004-10-18 #i35017# - constant name has changed
@@ -671,8 +671,8 @@ void _InitCore()
// - RES_CHRATR_NOLINEBREAK
// - RES_PARATR_REGISTER
// + 2 Dummies fuer die einzelnen "Bereiche"
- SwAttrPool::pVersionMap1 = new USHORT[ 60 ];
- USHORT i;
+ SwAttrPool::pVersionMap1 = new sal_uInt16[ 60 ];
+ sal_uInt16 i;
for( i = 1; i <= 17; i++ )
SwAttrPool::pVersionMap1[ i-1 ] = i;
for ( i = 18; i <= 27; ++i )
@@ -686,7 +686,7 @@ void _InitCore()
// 2. Version - neue Attribute:
// 10 Dummies fuer den Frame "Bereich"
- SwAttrPool::pVersionMap2 = new USHORT[ 75 ];
+ SwAttrPool::pVersionMap2 = new sal_uInt16[ 75 ];
for( i = 1; i <= 70; i++ )
SwAttrPool::pVersionMap2[ i-1 ] = i;
for ( i = 71; i <= 75; ++i )
@@ -695,7 +695,7 @@ void _InitCore()
// 3. Version - neue Attribute:
// neue Attribute und Dummies fuer die CJK-Version
// und neue Grafik-Attribute
- SwAttrPool::pVersionMap3 = new USHORT[ 86 ];
+ SwAttrPool::pVersionMap3 = new sal_uInt16[ 86 ];
for( i = 1; i <= 21; i++ )
SwAttrPool::pVersionMap3[ i-1 ] = i;
for ( i = 22; i <= 27; ++i )
@@ -706,7 +706,7 @@ void _InitCore()
SwAttrPool::pVersionMap3[ i-1 ] = i + 35;
// 4. Version - neue Paragraph Attribute fuer die CJK-Version
- SwAttrPool::pVersionMap4 = new USHORT[ 121 ];
+ SwAttrPool::pVersionMap4 = new sal_uInt16[ 121 ];
for( i = 1; i <= 65; i++ )
SwAttrPool::pVersionMap4[ i-1 ] = i;
for ( i = 66; i <= 121; ++i )
@@ -714,14 +714,14 @@ void _InitCore()
// OD 2004-01-21 #i18732# - setup new version map due to extension of
// the frame attributes (RES_FRMATR_*) for binary filters.
- SwAttrPool::pVersionMap5 = new USHORT[ 130 ];
+ SwAttrPool::pVersionMap5 = new sal_uInt16[ 130 ];
for( i = 1; i <= 109; i++ )
SwAttrPool::pVersionMap5[ i-1 ] = i;
for ( i = 110; i <= 130; ++i )
SwAttrPool::pVersionMap5[ i-1 ] = i + 6;
// 6. Version - new character attribute for overlining plus 2 dummies
- SwAttrPool::pVersionMap6 = new USHORT[ 136 ];
+ SwAttrPool::pVersionMap6 = new sal_uInt16[ 136 ];
for( i = 1; i <= 37; i++ )
SwAttrPool::pVersionMap6[ i-1 ] = i;
for ( i = 38; i <= 136; ++i )
@@ -780,7 +780,7 @@ void _FinitCore()
#ifdef DBG_UTIL
//Defaultattribut freigeben lassen um asserts zu vermeiden.
if ( aAttrTab[0]->GetRefCount() )
- SfxItemPool::ReleaseDefaults( aAttrTab, POOLATTR_END-POOLATTR_BEGIN, FALSE);
+ SfxItemPool::ReleaseDefaults( aAttrTab, POOLATTR_END-POOLATTR_BEGIN, sal_False);
#endif
delete SwDoc::pACmpltWords;
@@ -825,7 +825,7 @@ void _FinitCore()
// loesche alle default-Attribute
SfxPoolItem* pHt;
- for( USHORT n = 0; n < POOLATTR_END - POOLATTR_BEGIN; n++ )
+ for( sal_uInt16 n = 0; n < POOLATTR_END - POOLATTR_BEGIN; n++ )
if( 0 != ( pHt = aAttrTab[n] ))
delete pHt;
@@ -840,7 +840,7 @@ void _FinitCore()
delete[] SwAttrPool::pVersionMap5;
delete[] SwAttrPool::pVersionMap6;
- for ( USHORT i = 0; i < pGlobalOLEExcludeList->Count(); ++i )
+ for ( sal_uInt16 i = 0; i < pGlobalOLEExcludeList->Count(); ++i )
delete (SvGlobalName*)(*pGlobalOLEExcludeList)[i];
delete pGlobalOLEExcludeList;
}
@@ -857,7 +857,7 @@ CharClass& GetAppCharClass()
return *pAppCharClass;
}
-void SwCalendarWrapper::LoadDefaultCalendar( USHORT eLang )
+void SwCalendarWrapper::LoadDefaultCalendar( sal_uInt16 eLang )
{
sUniqueId.Erase();
if( eLang != nLang )
diff --git a/sw/source/core/bastyp/swcache.cxx b/sw/source/core/bastyp/swcache.cxx
index c0611a85160a..e3db1a266648 100644
--- a/sw/source/core/bastyp/swcache.cxx
+++ b/sw/source/core/bastyp/swcache.cxx
@@ -60,8 +60,8 @@ void SwCache::Check()
//Konsistenspruefung.
ASSERT( !pLast->GetNext(), "Last but not last." );
ASSERT( !pRealFirst->GetPrev(), "First but not first." );
- USHORT nCnt = 0;
- BOOL bFirstFound = FALSE;
+ sal_uInt16 nCnt = 0;
+ sal_Bool bFirstFound = sal_False;
SwCacheObj *pObj = pRealFirst;
SwCacheObj *pRekursive = pObj;
while ( pObj )
@@ -74,7 +74,7 @@ void SwCache::Check()
++nCnt;
if ( pObj == pFirst )
- bFirstFound = TRUE;
+ bFirstFound = sal_True;
if ( !pObj->GetNext() )
ASSERT( pObj == pLast, "Last not Found." );
pObj = pObj->GetNext();
@@ -103,12 +103,12 @@ void SwCache::Check()
|*************************************************************************/
-SwCache::SwCache( const USHORT nInitSize, const USHORT nGrowSize
+SwCache::SwCache( const sal_uInt16 nInitSize, const sal_uInt16 nGrowSize
#ifdef DBG_UTIL
, const ByteString &rNm
#endif
) :
- SwCacheObjArr( (BYTE)nInitSize, (BYTE)nGrowSize ),
+ SwCacheObjArr( (sal_uInt8)nInitSize, (sal_uInt8)nGrowSize ),
aFreePositions( 5, 5 ),
pRealFirst( 0 ),
pFirst( 0 ),
@@ -186,7 +186,7 @@ SwCache::~SwCache()
|*************************************************************************/
-void SwCache::Flush( const BYTE )
+void SwCache::Flush( const sal_uInt8 )
{
INCREMENT( nFlushCnt );
SwCacheObj *pObj = pRealFirst;
@@ -197,7 +197,7 @@ void SwCache::Flush( const BYTE )
#ifdef DBG_UTIL
if ( pObj->IsLocked() )
{
- ASSERT( TRUE, "Flushing locked objects." );
+ ASSERT( sal_True, "Flushing locked objects." );
if ( !pRealFirst )
{
pRealFirst = pFirst = pLast = pObj;
@@ -307,8 +307,8 @@ void SwCache::ToTop( SwCacheObj *pObj )
|*************************************************************************/
-SwCacheObj *SwCache::Get( const void *pOwner, const USHORT nIndex,
- const BOOL bToTop )
+SwCacheObj *SwCache::Get( const void *pOwner, const sal_uInt16 nIndex,
+ const sal_Bool bToTop )
{
SwCacheObj *pRet;
if ( 0 != (pRet = nIndex < Count() ? operator[]( nIndex ) : 0) )
@@ -331,7 +331,7 @@ SwCacheObj *SwCache::Get( const void *pOwner, const USHORT nIndex,
-SwCacheObj *SwCache::Get( const void *pOwner, const BOOL bToTop )
+SwCacheObj *SwCache::Get( const void *pOwner, const sal_Bool bToTop )
{
SwCacheObj *pRet = pRealFirst;
while ( pRet && !pRet->IsOwner( pOwner ) )
@@ -399,7 +399,7 @@ void SwCache::DeleteObj( SwCacheObj *pObj )
//Unangenehmer Nebeneffekt ist, das die Positionen verschoben werden
//muessen, und die Eigentuemer der Objekte diese wahrscheinlich nicht
//wiederfinden werden.
- for ( USHORT i = 0; i < Count(); ++i )
+ for ( sal_uInt16 i = 0; i < Count(); ++i )
{
SwCacheObj *pTmpObj = operator[](i);
if ( !pTmpObj )
@@ -417,11 +417,11 @@ void SwCache::DeleteObj( SwCacheObj *pObj )
/*
-void SwCache::Delete( const void *pOwner, const USHORT nIndex )
+void SwCache::Delete( const void *pOwner, const sal_uInt16 nIndex )
{
INCREMENT( nDelete );
SwCacheObj *pObj;
- if ( 0 != (pObj = Get( pOwner, nIndex, FALSE )) )
+ if ( 0 != (pObj = Get( pOwner, nIndex, sal_False )) )
DeleteObj( pObj );
}
*/
@@ -432,7 +432,7 @@ void SwCache::Delete( const void *pOwner )
{
INCREMENT( nDelete );
SwCacheObj *pObj;
- if ( 0 != (pObj = Get( pOwner, BOOL(FALSE) )) )
+ if ( 0 != (pObj = Get( pOwner, sal_Bool(sal_False) )) )
DeleteObj( pObj );
}
@@ -447,12 +447,12 @@ void SwCache::Delete( const void *pOwner )
|*************************************************************************/
-BOOL SwCache::Insert( SwCacheObj *pNew )
+sal_Bool SwCache::Insert( SwCacheObj *pNew )
{
CHECK;
ASSERT( !pNew->GetPrev() && !pNew->GetNext(), "New but not new." );
- USHORT nPos;//Wird hinter den if's zum setzen am Obj benutzt.
+ sal_uInt16 nPos;//Wird hinter den if's zum setzen am Obj benutzt.
if ( Count() < nCurMax )
{
//Es ist noch Platz frei, also einfach einfuegen.
@@ -464,7 +464,7 @@ BOOL SwCache::Insert( SwCacheObj *pNew )
{
//Es exitieren Platzhalter, also den letzten benutzen.
INCREMENT( nInsertFree );
- const USHORT nFreePos = aFreePositions.Count() - 1;
+ const sal_uInt16 nFreePos = aFreePositions.Count() - 1;
nPos = aFreePositions[ nFreePos ];
*(pData + nPos) = pNew;
aFreePositions.Remove( nFreePos );
@@ -479,8 +479,8 @@ BOOL SwCache::Insert( SwCacheObj *pNew )
pObj = pObj->GetPrev();
if ( !pObj )
{
- ASSERT( FALSE, "Cache overflow." );
- return FALSE;
+ ASSERT( sal_False, "Cache overflow." );
+ return sal_False;
}
nPos = pObj->GetCachePos();
@@ -521,7 +521,7 @@ BOOL SwCache::Insert( SwCacheObj *pNew )
pFirst = pNew;
CHECK;
- return TRUE;
+ return sal_True;
}
/*************************************************************************
@@ -534,14 +534,14 @@ BOOL SwCache::Insert( SwCacheObj *pNew )
|*************************************************************************/
-void SwCache::SetLRUOfst( const USHORT nOfst )
+void SwCache::SetLRUOfst( const sal_uInt16 nOfst )
{
if ( !pRealFirst || ((Count() - aFreePositions.Count()) < nOfst) )
return;
CHECK;
pFirst = pRealFirst;
- for ( USHORT i = 0; i < Count() && i < nOfst; ++i )
+ for ( sal_uInt16 i = 0; i < Count() && i < nOfst; ++i )
{
if ( pFirst->GetNext() && pFirst->GetNext()->GetNext() )
pFirst = pFirst->GetNext();
@@ -645,7 +645,7 @@ void SwCacheAccess::_Get()
|*************************************************************************/
-BOOL SwCacheAccess::IsAvailable() const
+sal_Bool SwCacheAccess::IsAvailable() const
{
return pObj != 0;
}
diff --git a/sw/source/core/bastyp/swrect.cxx b/sw/source/core/bastyp/swrect.cxx
index 1213bfaea896..701f7dbbd69c 100644
--- a/sw/source/core/bastyp/swrect.cxx
+++ b/sw/source/core/bastyp/swrect.cxx
@@ -170,7 +170,7 @@ SwRect& SwRect::_Intersection( const SwRect& rRect )
-BOOL SwRect::IsInside( const SwRect& rRect ) const
+sal_Bool SwRect::IsInside( const SwRect& rRect ) const
{
const long nRight = Right();
const long nBottom = Bottom();
@@ -184,7 +184,7 @@ BOOL SwRect::IsInside( const SwRect& rRect ) const
-BOOL SwRect::IsInside( const Point& rPoint ) const
+sal_Bool SwRect::IsInside( const Point& rPoint ) const
{
return (Left() <= rPoint.X())
&& (Top() <= rPoint.Y())
@@ -194,7 +194,7 @@ BOOL SwRect::IsInside( const Point& rPoint ) const
/* -----------------------------11.04.00 15:46--------------------------------
mouse moving of table borders
---------------------------------------------------------------------------*/
-BOOL SwRect::IsNear( const Point& rPoint, long nTolerance ) const
+sal_Bool SwRect::IsNear( const Point& rPoint, long nTolerance ) const
{
return IsInside(rPoint) ||
(((Left() - nTolerance) <= rPoint.X())
@@ -214,12 +214,12 @@ BOOL SwRect::IsNear( const Point& rPoint, long nTolerance ) const
-BOOL SwRect::IsOver( const SwRect& rRect ) const
+sal_Bool SwRect::IsOver( const SwRect& rRect ) const
{
return (Top() <= rRect.Bottom())
&& (Left() <= rRect.Right())
&& (Right() >= rRect.Left())
- && (Bottom()>= rRect.Top()) ? TRUE : FALSE;
+ && (Bottom()>= rRect.Top()) ? sal_True : sal_False;
}
/*************************************************************************
@@ -283,13 +283,13 @@ long SwRect::GetLeftDistance( long nLimit ) const { return m_Point.getX() - nLim
long SwRect::GetBottomDistance( long nLim ) const { return nLim - m_Point.getY() - m_Size.getHeight();}
long SwRect::GetTopDistance( long nLimit ) const { return m_Point.getY() - nLimit; }
long SwRect::GetRightDistance( long nLim ) const { return nLim - m_Point.getX() - m_Size.getWidth(); }
-BOOL SwRect::OverStepLeft( long nLimit ) const
+sal_Bool SwRect::OverStepLeft( long nLimit ) const
{ return nLimit > m_Point.getX() && m_Point.getX() + m_Size.getWidth() > nLimit; }
-BOOL SwRect::OverStepBottom( long nLimit ) const
+sal_Bool SwRect::OverStepBottom( long nLimit ) const
{ return nLimit > m_Point.getY() && m_Point.getY() + m_Size.getHeight() > nLimit; }
-BOOL SwRect::OverStepTop( long nLimit ) const
+sal_Bool SwRect::OverStepTop( long nLimit ) const
{ return nLimit > m_Point.getY() && m_Point.getY() + m_Size.getHeight() > nLimit; }
-BOOL SwRect::OverStepRight( long nLimit ) const
+sal_Bool SwRect::OverStepRight( long nLimit ) const
{ return nLimit > m_Point.getX() && m_Point.getX() + m_Size.getWidth() > nLimit; }
void SwRect::SetLeftAndWidth( long nLeft, long nNew )
{
diff --git a/sw/source/core/bastyp/swregion.cxx b/sw/source/core/bastyp/swregion.cxx
index 899b8f164194..e2b4829b563c 100644
--- a/sw/source/core/bastyp/swregion.cxx
+++ b/sw/source/core/bastyp/swregion.cxx
@@ -48,9 +48,9 @@ SV_IMPL_VARARR( SwRects, SwRect );
|*
|*************************************************************************/
-SwRegionRects::SwRegionRects( const SwRect &rStartRect, USHORT nInit,
- USHORT nGrow ) :
- SwRects( (BYTE)nInit, (BYTE)nGrow ),
+SwRegionRects::SwRegionRects( const SwRect &rStartRect, sal_uInt16 nInit,
+ sal_uInt16 nGrow ) :
+ SwRects( (sal_uInt8)nInit, (sal_uInt8)nGrow ),
aOrigin( rStartRect )
{
Insert( aOrigin, 0 );
@@ -60,18 +60,18 @@ SwRegionRects::SwRegionRects( const SwRect &rStartRect, USHORT nInit,
* inline InsertRect()
*
* InsertRect() wird nur von operator-=() gerufen.
- * Wenn bDel == TRUE ist, dann wird das Rect an der Position nPos mit
+ * Wenn bDel == sal_True ist, dann wird das Rect an der Position nPos mit
* rRect ueberschrieben, ansonsten wird rRect hinten angehaengt.
*************************************************************************/
-inline void SwRegionRects::InsertRect( const SwRect &rRect, const USHORT nPos,
- BOOL &rDel )
+inline void SwRegionRects::InsertRect( const SwRect &rRect, const sal_uInt16 nPos,
+ sal_Bool &rDel )
{
if( rDel )
{
pData = (SwRect*)pData; // looks weird but seems to help gcc ->i78417
*(pData+nPos) = rRect;
- rDel = FALSE;
+ rDel = sal_False;
}
else
Insert( rRect, Count() );
@@ -93,8 +93,8 @@ inline void SwRegionRects::InsertRect( const SwRect &rRect, const USHORT nPos,
void SwRegionRects::operator-=( const SwRect &rRect )
{
- USHORT nMax = Count();
- for ( USHORT i = 0; i < nMax; ++i )
+ sal_uInt16 nMax = Count();
+ for ( sal_uInt16 i = 0; i < nMax; ++i )
{
if ( rRect.IsOver( *(pData+i) ) )
{
@@ -104,7 +104,7 @@ void SwRegionRects::operator-=( const SwRect &rRect )
// Das erste Rect, das wir inserten wollen, nimmt die
// Stelle von i ein. So ersparen wir uns das Delete().
- BOOL bDel = TRUE;
+ sal_Bool bDel = sal_True;
//Jetzt aufteilen das Teil: Es sollen diejenigen Rechtecke
//zurueckbleiben, die im alten aber nicht im neuen liegen.
@@ -173,10 +173,10 @@ void SwRegionRects::Invert()
SwRegionRects aInvRegion( aOrigin, Count()*2+2 );
const SwRect *pDat = GetData();
- for( USHORT i = 0; i < Count(); ++pDat, ++i )
+ for( sal_uInt16 i = 0; i < Count(); ++pDat, ++i )
aInvRegion -= *pDat;
- USHORT nCpy = Count(), nDel = 0;
+ sal_uInt16 nCpy = Count(), nDel = 0;
if( aInvRegion.Count() < Count() )
{
nDel = Count() - aInvRegion.Count();
@@ -205,7 +205,7 @@ inline SwTwips CalcArea( const SwRect &rRect )
}
-void SwRegionRects::Compress( BOOL bFuzzy )
+void SwRegionRects::Compress( sal_Bool bFuzzy )
{
for ( int i = 0; i < Count(); ++i )
{
@@ -215,13 +215,13 @@ void SwRegionRects::Compress( BOOL bFuzzy )
//uberfluessig.
if ( (*(pData + i)).IsInside( *(pData + j) ) )
{
- Remove( static_cast<USHORT>(j), 1 );
+ Remove( static_cast<sal_uInt16>(j), 1 );
--j;
}
else if ( (*(pData + j)).IsInside( *(pData + i) ) )
{
*(pData + i) = *(pData + j);
- Remove( static_cast<USHORT>(j), 1 );
+ Remove( static_cast<sal_uInt16>(j), 1 );
i = -1;
break;
}
@@ -243,7 +243,7 @@ void SwRegionRects::Compress( BOOL bFuzzy )
(::CalcArea( aUnion ) - CalcArea( aInter )) )
{
*(pData + i) = aUnion;
- Remove( static_cast<USHORT>(j), 1 );
+ Remove( static_cast<sal_uInt16>(j), 1 );
i = -1;
break;
}
diff --git a/sw/source/core/bastyp/swtypes.cxx b/sw/source/core/bastyp/swtypes.cxx
index 1ce5e4b9cf6c..3015d8cf4b44 100644
--- a/sw/source/core/bastyp/swtypes.cxx
+++ b/sw/source/core/bastyp/swtypes.cxx
@@ -39,7 +39,8 @@
#include <frmfmt.hxx>
#include <frmtool.hxx>
#include <ndtxt.hxx>
-#include <undobj.hxx>
+#include <UndoDelete.hxx>
+#include <UndoInsert.hxx>
#include <swtable.hxx>
#include <viscrs.hxx>
#include <fntcache.hxx>
diff --git a/sw/source/core/bastyp/tabcol.cxx b/sw/source/core/bastyp/tabcol.cxx
index 63d9ceee8043..bf5b4b06084f 100644
--- a/sw/source/core/bastyp/tabcol.cxx
+++ b/sw/source/core/bastyp/tabcol.cxx
@@ -34,7 +34,7 @@
#include <errhdl.hxx> // fuer Create-Methoden
-SwTabCols::SwTabCols( USHORT nSize ) :
+SwTabCols::SwTabCols( sal_uInt16 nSize ) :
nLeftMin( 0 ),
nLeft( 0 ),
nRight( 0 ),
@@ -54,7 +54,7 @@ SwTabCols::SwTabCols( const SwTabCols& rCpy ) :
aData( rCpy.GetData() )
{
#if OSL_DEBUG_LEVEL > 1
- for ( USHORT i = 0; i < Count(); ++i )
+ for ( sal_uInt16 i = 0; i < Count(); ++i )
{
SwTabColsEntry aEntry1 = aData[i];
SwTabColsEntry aEntry2 = rCpy.GetData()[i];
@@ -83,9 +83,9 @@ SwTabCols &SwTabCols::operator=( const SwTabCols& rCpy )
return *this;
}
-BOOL SwTabCols::operator==( const SwTabCols& rCmp ) const
+sal_Bool SwTabCols::operator==( const SwTabCols& rCmp ) const
{
- USHORT i;
+ sal_uInt16 i;
if ( !(nLeftMin == rCmp.GetLeftMin() &&
nLeft == rCmp.GetLeft() &&
@@ -93,20 +93,20 @@ BOOL SwTabCols::operator==( const SwTabCols& rCmp ) const
nRightMax== rCmp.GetRightMax()&&
bLastRowAllowedToChange== rCmp.IsLastRowAllowedToChange() &&
Count()== rCmp.Count()) )
- return FALSE;
+ return sal_False;
for ( i = 0; i < Count(); ++i )
{
SwTabColsEntry aEntry1 = aData[i];
SwTabColsEntry aEntry2 = rCmp.GetData()[i];
if ( aEntry1.nPos != aEntry2.nPos || aEntry1.bHidden != aEntry2.bHidden )
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
-void SwTabCols::Insert( long nValue, long nMin, long nMax, BOOL bValue, USHORT nPos )
+void SwTabCols::Insert( long nValue, long nMin, long nMax, sal_Bool bValue, sal_uInt16 nPos )
{
SwTabColsEntry aEntry;
aEntry.nPos = nValue;
@@ -116,7 +116,7 @@ void SwTabCols::Insert( long nValue, long nMin, long nMax, BOOL bValue, USHORT n
aData.insert( aData.begin() + nPos, aEntry );
}
-void SwTabCols::Insert( long nValue, BOOL bValue, USHORT nPos )
+void SwTabCols::Insert( long nValue, sal_Bool bValue, sal_uInt16 nPos )
{
SwTabColsEntry aEntry;
aEntry.nPos = nValue;
@@ -134,7 +134,7 @@ void SwTabCols::Insert( long nValue, BOOL bValue, USHORT nPos )
#endif
}
-void SwTabCols::Remove( USHORT nPos, USHORT nAnz )
+void SwTabCols::Remove( sal_uInt16 nPos, sal_uInt16 nAnz )
{
SwTabColsEntries::iterator aStart = aData.begin() + nPos;
aData.erase( aStart, aStart + nAnz );
diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx
index 4a773c6980c4..5b6d5701ed62 100644
--- a/sw/source/core/crsr/bookmrk.cxx
+++ b/sw/source/core/crsr/bookmrk.cxx
@@ -31,6 +31,7 @@
#include <bookmrk.hxx>
#include <IDocumentMarkAccess.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <doc.hxx>
#include <errhdl.hxx>
#include <ndtxt.hxx>
@@ -38,7 +39,7 @@
#include <swserv.hxx>
#include <sfx2/linkmgr.hxx>
#include <swtypes.hxx>
-#include <undobj.hxx>
+#include <UndoBookmark.hxx>
#include <unobookmark.hxx>
#include <rtl/random.h>
#include <xmloff/odffields.hxx>
@@ -79,13 +80,14 @@ namespace
{
SwPosition& rStart = pField->GetMarkStart();
SwPosition& rEnd = pField->GetMarkEnd();
- SwTxtNode const * const pStartTxtNode = io_pDoc->GetNodes()[rStart.nNode]->GetTxtNode();
- SwTxtNode const * const pEndTxtNode = io_pDoc->GetNodes()[rEnd.nNode]->GetTxtNode();
+ SwTxtNode const*const pStartTxtNode =
+ rStart.nNode.GetNode().GetTxtNode();
+ SwTxtNode const*const pEndTxtNode = rEnd.nNode.GetNode().GetTxtNode();
const sal_Unicode ch_start=pStartTxtNode->GetTxt().GetChar(rStart.nContent.GetIndex());
const sal_Unicode ch_end=pEndTxtNode->GetTxt().GetChar(rEnd.nContent.GetIndex()-1);
SwPaM aStartPaM(rStart);
SwPaM aEndPaM(rEnd);
- io_pDoc->StartUndo(UNDO_UI_REPLACE, NULL);
+ io_pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_UI_REPLACE, NULL);
if(ch_start != aStartMark)
{
io_pDoc->InsertString(aStartPaM, aStartMark);
@@ -94,7 +96,7 @@ namespace
{
io_pDoc->InsertString(aEndPaM, aEndMark);
}
- io_pDoc->EndUndo(UNDO_UI_REPLACE, NULL);
+ io_pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_UI_REPLACE, NULL);
};
}
@@ -231,10 +233,10 @@ namespace sw { namespace mark
void Bookmark::InitDoc(SwDoc* const io_pDoc)
{
- if(io_pDoc->DoesUndo())
+ if (io_pDoc->GetIDocumentUndoRedo().DoesUndo())
{
- io_pDoc->ClearRedo();
- io_pDoc->AppendUndo(new SwUndoInsBookmark(*this));
+ io_pDoc->GetIDocumentUndoRedo().AppendUndo(
+ new SwUndoInsBookmark(*this));
}
io_pDoc->SetModified();
}
diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx
index e2775326a127..f47e06b81914 100644
--- a/sw/source/core/crsr/callnk.cxx
+++ b/sw/source/core/crsr/callnk.cxx
@@ -48,8 +48,8 @@
#include <breakit.hxx>
-SwCallLink::SwCallLink( SwCrsrShell & rSh, ULONG nAktNode, xub_StrLen nAktCntnt,
- BYTE nAktNdTyp, long nLRPos, bool bAktSelection )
+SwCallLink::SwCallLink( SwCrsrShell & rSh, sal_uLong nAktNode, xub_StrLen nAktCntnt,
+ sal_uInt8 nAktNdTyp, long nLRPos, bool bAktSelection )
: rShell( rSh ), nNode( nAktNode ), nCntnt( nAktCntnt ),
nNdTyp( nAktNdTyp ), nLeftFrmPos( nLRPos ),
bHasSelection( bAktSelection )
@@ -98,8 +98,8 @@ SwCallLink::~SwCallLink()
return;
xub_StrLen nCmp, nAktCntnt = pCurCrsr->GetPoint()->nContent.GetIndex();
- USHORT nNdWhich = pCNd->GetNodeType();
- ULONG nAktNode = pCurCrsr->GetPoint()->nNode.GetIndex();
+ sal_uInt16 nNdWhich = pCNd->GetNodeType();
+ sal_uLong nAktNode = pCurCrsr->GetPoint()->nNode.GetIndex();
// melde die Shell beim akt. Node als abhaengig an, dadurch koennen
// alle Attribut-Aenderungen ueber den Link weiter gemeldet werden.
@@ -135,7 +135,7 @@ SwCallLink::~SwCallLink()
{
const SwpHints &rHts = ((SwTxtNode*)pCNd)->GetSwpHints();
- USHORT n;
+ sal_uInt16 n;
xub_StrLen nStart;
const xub_StrLen *pEnd;
@@ -191,7 +191,11 @@ SwCallLink::~SwCallLink()
const SwFrm* pFrm;
const SwFlyFrm *pFlyFrm;
+<<<<<<< local
if( !rShell.ActionPend() && 0 != ( pFrm = pCNd->getLayoutFrm(rShell.GetLayout(),0,0,FALSE) ) &&
+=======
+ if( !rShell.ActionPend() && 0 != ( pFrm = pCNd->GetFrm(0,0,sal_False) ) &&
+>>>>>>> other
0 != ( pFlyFrm = pFrm->FindFlyFrm() ) && !rShell.IsTableMode() )
{
const SwNodeIndex* pIndex = pFlyFrm->GetFmt()->GetCntnt().GetCntntIdx();
@@ -208,7 +212,11 @@ SwCallLink::~SwCallLink()
}
}
+<<<<<<< local
long SwCallLink::getLayoutFrm( const SwRootFrm* pRoot, SwTxtNode& rNd, xub_StrLen nCntPos, BOOL bCalcFrm )
+=======
+long SwCallLink::GetFrm( SwTxtNode& rNd, xub_StrLen nCntPos, sal_Bool bCalcFrm )
+>>>>>>> other
{
SwTxtFrm* pFrm = (SwTxtFrm*)rNd.getLayoutFrm(pRoot,0,0,bCalcFrm), *pNext = pFrm;
if ( pFrm && !pFrm->IsHiddenNow() )
diff --git a/sw/source/core/crsr/callnk.hxx b/sw/source/core/crsr/callnk.hxx
index dcedf0b13137..0952bbb256b7 100644
--- a/sw/source/core/crsr/callnk.hxx
+++ b/sw/source/core/crsr/callnk.hxx
@@ -37,19 +37,23 @@ class SwCallLink
{
public:
SwCrsrShell & rShell;
- ULONG nNode;
+ sal_uLong nNode;
xub_StrLen nCntnt;
- BYTE nNdTyp;
+ sal_uInt8 nNdTyp;
long nLeftFrmPos;
bool bHasSelection;
SwCallLink( SwCrsrShell & rSh );
- SwCallLink( SwCrsrShell & rSh, ULONG nAktNode, xub_StrLen nAktCntnt,
- BYTE nAktNdTyp, long nLRPos,
+ SwCallLink( SwCrsrShell & rSh, sal_uLong nAktNode, xub_StrLen nAktCntnt,
+ sal_uInt8 nAktNdTyp, long nLRPos,
bool bAktSelection );
~SwCallLink();
+<<<<<<< local
static long getLayoutFrm( const SwRootFrm*, SwTxtNode& rNd, xub_StrLen nCntPos, BOOL bCalcFrm );
+=======
+ static long GetFrm( SwTxtNode& rNd, xub_StrLen nCntPos, sal_Bool bCalcFrm );
+>>>>>>> other
};
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 4a92f73a9ed8..db5ecf0778ca 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -156,27 +156,42 @@ SwPaM * SwCrsrShell::CreateCrsr()
// loesche den aktuellen Cursor und der folgende wird zum Aktuellen
-BOOL SwCrsrShell::DestroyCrsr()
+sal_Bool SwCrsrShell::DestroyCrsr()
{
// Innerhalb der Tabellen-SSelection keinen neuen Crsr loeschen
ASSERT( !IsTableMode(), "in Tabellen SSelection" );
// ist ueberhaupt ein naechtser vorhanden ?
if(pCurCrsr->GetNext() == pCurCrsr)
- return FALSE;
+ return sal_False;
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen,
SwCursor* pNextCrsr = (SwCursor*)pCurCrsr->GetNext();
delete pCurCrsr;
pCurCrsr = dynamic_cast<SwShellCrsr*>(pNextCrsr);
UpdateCrsr();
- return TRUE;
+ return sal_True;
+}
+
+
+SwPaM & SwCrsrShell::CreateNewShellCursor()
+{
+ if (HasSelection())
+ {
+ (void) CreateCrsr(); // n.b. returns old cursor
+ }
+ return *GetCrsr();
+}
+
+SwPaM & SwCrsrShell::GetCurrentShellCursor()
+{
+ return *GetCrsr();
}
// gebe den aktuellen zurueck
-SwPaM* SwCrsrShell::GetCrsr( BOOL bMakeTblCrsr ) const
+SwPaM* SwCrsrShell::GetCrsr( sal_Bool bMakeTblCrsr ) const
{
if( pTblCrsr )
{
@@ -186,8 +201,13 @@ SwPaM* SwCrsrShell::GetCrsr( BOOL bMakeTblCrsr ) const
const SwCntntNode* pCNd;
if( pTblCrsr->GetPoint()->nNode.GetIndex() &&
pTblCrsr->GetMark()->nNode.GetIndex() &&
+<<<<<<< local
0 != ( pCNd = pTblCrsr->GetCntntNode() ) && pCNd->getLayoutFrm( GetLayout() ) &&
0 != ( pCNd = pTblCrsr->GetCntntNode(FALSE) ) && pCNd->getLayoutFrm( GetLayout() ) )
+=======
+ 0 != ( pCNd = pTblCrsr->GetCntntNode() ) && pCNd->GetFrm() &&
+ 0 != ( pCNd = pTblCrsr->GetCntntNode(sal_False) ) && pCNd->GetFrm())
+>>>>>>> other
{
SwShellTableCrsr* pTC = (SwShellTableCrsr*)pTblCrsr;
GetLayout()->MakeTblCrsrs( *pTC );
@@ -215,7 +235,11 @@ void SwCrsrShell::StartAction()
nAktNdTyp = rNd.GetNodeType();
bAktSelection = *pCurCrsr->GetPoint() != *pCurCrsr->GetMark();
if( ND_TEXTNODE & nAktNdTyp )
+<<<<<<< local
nLeftFrmPos = SwCallLink::getLayoutFrm( GetLayout(), (SwTxtNode&)rNd, nAktCntnt, TRUE );
+=======
+ nLeftFrmPos = SwCallLink::GetFrm( (SwTxtNode&)rNd, nAktCntnt, sal_True );
+>>>>>>> other
else
nLeftFrmPos = 0;
}
@@ -223,7 +247,7 @@ void SwCrsrShell::StartAction()
}
-void SwCrsrShell::EndAction( const BOOL bIdleEnd )
+void SwCrsrShell::EndAction( const sal_Bool bIdleEnd )
{
/*
//OS: Wird z.B. eine Basic-Action im Hintergrund ausgefuehrt, geht es so nicht
@@ -236,7 +260,7 @@ void SwCrsrShell::EndAction( const BOOL bIdleEnd )
}
*/
- BOOL bVis = bSVCrsrVis;
+ sal_Bool bVis = bSVCrsrVis;
// Idle-Formatierung ?
if( bIdleEnd && Imp()->GetRegion() )
@@ -248,7 +272,7 @@ if( GetWin() )
{
GetWin()->Push();
GetWin()->ChangePen( Pen( Color( COL_YELLOW )));
- for( USHORT n = 0; n < aPntReg.Count(); ++n )
+ for( sal_uInt16 n = 0; n < aPntReg.Count(); ++n )
{
SwRect aIRect( aPntReg[n] );
GetWin()->DrawRect( aIRect.SVRect() );
@@ -265,8 +289,8 @@ if( GetWin() )
// Task: 76923: dont show the cursor in the ViewShell::EndAction() - call.
// Only the UpdateCrsr shows the cursor.
- BOOL bSavSVCrsrVis = bSVCrsrVis;
- bSVCrsrVis = FALSE;
+ sal_Bool bSavSVCrsrVis = bSVCrsrVis;
+ bSVCrsrVis = sal_False;
ViewShell::EndAction( bIdleEnd ); //der ViewShell den Vortritt lassen
@@ -291,20 +315,20 @@ if( GetWin() )
{
// Crsr-Moves ueberwachen, evt. Link callen
// der DTOR ist das interressante!!
- SwCallLink aLk( *this, nAktNode, nAktCntnt, (BYTE)nAktNdTyp,
+ SwCallLink aLk( *this, nAktNode, nAktCntnt, (sal_uInt8)nAktNdTyp,
nLeftFrmPos, bAktSelection );
}
if( bCallChgLnk && bChgCallFlag && aChgLnk.IsSet() )
{
aChgLnk.Call( this );
- bChgCallFlag = FALSE; // Flag zuruecksetzen
+ bChgCallFlag = sal_False; // Flag zuruecksetzen
}
}
return;
}
- USHORT nParm = SwCrsrShell::CHKRANGE;
+ sal_uInt16 nParm = SwCrsrShell::CHKRANGE;
if ( !bIdleEnd )
nParm |= SwCrsrShell::SCROLLWIN;
if( !IsViewLocked() )
@@ -313,19 +337,19 @@ if( GetWin() )
{
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen,
aLk.nNode = nAktNode; // evt. Link callen
- aLk.nNdTyp = (BYTE)nAktNdTyp;
+ aLk.nNdTyp = (sal_uInt8)nAktNdTyp;
aLk.nCntnt = nAktCntnt;
aLk.nLeftFrmPos = nLeftFrmPos;
if( !nCrsrMove ||
( 1 == nCrsrMove && bInCMvVisportChgd ) )
- ShowCrsrs( bSVCrsrVis ? TRUE : FALSE ); // Cursor & Selektionen wieder anzeigen
+ ShowCrsrs( bSVCrsrVis ? sal_True : sal_False ); // Cursor & Selektionen wieder anzeigen
}
// falls noch ein ChgCall vorhanden ist, dann rufe ihn
if( bCallChgLnk && bChgCallFlag && aChgLnk.IsSet() )
{
aChgLnk.Call( this );
- bChgCallFlag = FALSE; // Flag zuruecksetzen
+ bChgCallFlag = sal_False; // Flag zuruecksetzen
}
}
@@ -339,25 +363,25 @@ void SwCrsrShell::SttCrsrMove()
StartAction();
}
-void SwCrsrShell::EndCrsrMove( const BOOL bIdleEnd )
+void SwCrsrShell::EndCrsrMove( const sal_Bool bIdleEnd )
{
ASSERT( nCrsrMove, "EndCrsrMove() ohne SttCrsrMove()." );
EndAction( bIdleEnd );
if( !--nCrsrMove )
- bInCMvVisportChgd = FALSE;
+ bInCMvVisportChgd = sal_False;
}
#endif
-BOOL SwCrsrShell::LeftRight( BOOL bLeft, USHORT nCnt, USHORT nMode,
- BOOL bVisualAllowed )
+sal_Bool SwCrsrShell::LeftRight( sal_Bool bLeft, sal_uInt16 nCnt, sal_uInt16 nMode,
+ sal_Bool bVisualAllowed )
{
if( IsTableMode() )
return bLeft ? GoPrevCell() : GoNextCell();
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
// #i27615# Handle cursor in front of label.
const SwTxtNode* pTxtNd = 0;
@@ -372,8 +396,8 @@ BOOL SwCrsrShell::LeftRight( BOOL bLeft, USHORT nCnt, USHORT nMode,
SwShellCrsr* pShellCrsr = getShellCrsr( true );
if ( !bLeft && pShellCrsr->IsInFrontOfLabel() )
{
- SetInFrontOfLabel( FALSE );
- bRet = TRUE;
+ SetInFrontOfLabel( sal_False );
+ bRet = sal_True;
}
//
// 2. CASE: Cursor is at beginning of numbered paragraph. A move
@@ -384,25 +408,25 @@ BOOL SwCrsrShell::LeftRight( BOOL bLeft, USHORT nCnt, USHORT nMode,
0 != ( pTxtNd = pShellCrsr->GetNode()->GetTxtNode() ) &&
pTxtNd->HasVisibleNumberingOrBullet() )
{
- SetInFrontOfLabel( TRUE );
- bRet = TRUE;
+ SetInFrontOfLabel( sal_True );
+ bRet = sal_True;
}
//
// 3. CASE: Regular cursor move. Reset the bInFrontOfLabel flag:
//
else
{
- const BOOL bSkipHidden = !GetViewOptions()->IsShowHiddenChar();
+ const sal_Bool bSkipHidden = !GetViewOptions()->IsShowHiddenChar();
// --> OD 2009-12-30 #i107447#
// To avoid loop the reset of <bInFrontOfLabel> flag is no longer
// reflected in the return value <bRet>.
- const bool bResetOfInFrontOfLabel = SetInFrontOfLabel( FALSE );
+ const bool bResetOfInFrontOfLabel = SetInFrontOfLabel( sal_False );
bRet = pShellCrsr->LeftRight( bLeft, nCnt, nMode, bVisualAllowed,
bSkipHidden, !IsOverwriteCrsr() );
if ( !bRet && bLeft && bResetOfInFrontOfLabel )
{
// undo reset of <bInFrontOfLabel> flag
- SetInFrontOfLabel( TRUE );
+ SetInFrontOfLabel( sal_True );
}
// <--
}
@@ -422,11 +446,11 @@ void SwCrsrShell::MarkListLevel( const String& sListId,
nListLevel != nMarkedListLevel)
{
if ( sMarkedListId.Len() > 0 )
- pDoc->MarkListLevel( sMarkedListId, nMarkedListLevel, FALSE );
+ pDoc->MarkListLevel( sMarkedListId, nMarkedListLevel, sal_False );
if ( sListId.Len() > 0 )
{
- pDoc->MarkListLevel( sListId, nListLevel, TRUE );
+ pDoc->MarkListLevel( sListId, nListLevel, sal_True );
}
sMarkedListId = sListId;
@@ -442,7 +466,7 @@ void SwCrsrShell::UpdateMarkedListLevel()
{
if ( !pTxtNd->IsNumbered() )
{
- pCurCrsr->_SetInFrontOfLabel( FALSE );
+ pCurCrsr->_SetInFrontOfLabel( sal_False );
MarkListLevel( String(), 0 );
}
else if ( pCurCrsr->IsInFrontOfLabel() )
@@ -463,18 +487,18 @@ void SwCrsrShell::UpdateMarkedListLevel()
}
// <--
-BOOL SwCrsrShell::UpDown( BOOL bUp, USHORT nCnt )
+sal_Bool SwCrsrShell::UpDown( sal_Bool bUp, sal_uInt16 nCnt )
{
SET_CURR_SHELL( this );
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
- BOOL bTableMode = IsTableMode();
+ sal_Bool bTableMode = IsTableMode();
SwShellCrsr* pTmpCrsr = getShellCrsr( true );
- BOOL bRet = pTmpCrsr->UpDown( bUp, nCnt );
+ sal_Bool bRet = pTmpCrsr->UpDown( bUp, nCnt );
// --> FME 2005-01-10 #i40019# UpDown should always reset the
// bInFrontOfLabel flag:
- bRet = SetInFrontOfLabel(FALSE) || bRet;
+ bRet = SetInFrontOfLabel(sal_False) || bRet;
// <--
if( pBlockCrsr )
@@ -489,39 +513,39 @@ BOOL SwCrsrShell::UpDown( BOOL bUp, USHORT nCnt )
if( !bTableMode )
eUpdtMode = (CrsrFlag) (eUpdtMode
| SwCrsrShell::UPDOWN | SwCrsrShell::CHKRANGE);
- UpdateCrsr( static_cast<USHORT>(eUpdtMode) );
+ UpdateCrsr( static_cast<sal_uInt16>(eUpdtMode) );
}
}
return bRet;
}
-BOOL SwCrsrShell::LRMargin( BOOL bLeft, BOOL bAPI)
+sal_Bool SwCrsrShell::LRMargin( sal_Bool bLeft, sal_Bool bAPI)
{
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
SET_CURR_SHELL( this );
eMvState = MV_LEFTMARGIN; // Status fuers Crsr-Travelling - GetCrsrOfst
- const BOOL bTableMode = IsTableMode();
+ const sal_Bool bTableMode = IsTableMode();
SwShellCrsr* pTmpCrsr = getShellCrsr( true );
if( pBlockCrsr )
pBlockCrsr->clearPoints();
- const BOOL bWasAtLM =
+ const sal_Bool bWasAtLM =
( 0 == _GetCrsr()->GetPoint()->nContent.GetIndex() );
- BOOL bRet = pTmpCrsr->LeftRightMargin( bLeft, bAPI );
+ sal_Bool bRet = pTmpCrsr->LeftRightMargin( bLeft, bAPI );
if ( bLeft && !bTableMode && bRet && bWasAtLM && !_GetCrsr()->HasMark() )
{
const SwTxtNode * pTxtNd = _GetCrsr()->GetNode()->GetTxtNode();
if ( pTxtNd && pTxtNd->HasVisibleNumberingOrBullet() )
- SetInFrontOfLabel( TRUE );
+ SetInFrontOfLabel( sal_True );
}
else if ( !bLeft )
{
- bRet = SetInFrontOfLabel( FALSE ) || bRet;
+ bRet = SetInFrontOfLabel( sal_False ) || bRet;
}
if( bRet )
@@ -531,19 +555,19 @@ BOOL SwCrsrShell::LRMargin( BOOL bLeft, BOOL bAPI)
return bRet;
}
-BOOL SwCrsrShell::IsAtLRMargin( BOOL bLeft, BOOL bAPI ) const
+sal_Bool SwCrsrShell::IsAtLRMargin( sal_Bool bLeft, sal_Bool bAPI ) const
{
const SwShellCrsr* pTmpCrsr = getShellCrsr( true );
return pTmpCrsr->IsAtLeftRightMargin( bLeft, bAPI );
}
-BOOL SwCrsrShell::SttEndDoc( BOOL bStt )
+sal_Bool SwCrsrShell::SttEndDoc( sal_Bool bStt )
{
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
SwShellCrsr* pTmpCrsr = pBlockCrsr ? &pBlockCrsr->getShellCrsr() : pCurCrsr;
- BOOL bRet = pTmpCrsr->SttEndDoc( bStt );
+ sal_Bool bRet = pTmpCrsr->SttEndDoc( bStt );
if( bRet )
{
if( bStt )
@@ -571,9 +595,9 @@ void SwCrsrShell::ExtendedSelectAll()
pPos->nContent.Assign( pCNd, pCNd ? pCNd->Len() : 0 );
}
-BOOL SwCrsrShell::MovePage( SwWhichPage fnWhichPage, SwPosPage fnPosPage )
+sal_Bool SwCrsrShell::MovePage( SwWhichPage fnWhichPage, SwPosPage fnPosPage )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
// Springe beim Selektieren nie ueber Section-Grenzen !!
if( !pCurCrsr->HasMark() || !pCurCrsr->IsNoCntnt() )
@@ -584,36 +608,41 @@ BOOL SwCrsrShell::MovePage( SwWhichPage fnWhichPage, SwPosPage fnPosPage )
SwCrsrSaveState aSaveState( *pCurCrsr );
Point& rPt = pCurCrsr->GetPtPos();
SwCntntFrm * pFrm = pCurCrsr->GetCntntNode()->
+<<<<<<< local
getLayoutFrm( GetLayout(), &rPt, pCurCrsr->GetPoint(), FALSE );
if( pFrm && TRUE == ( bRet = GetFrmInPage( pFrm, fnWhichPage,
+=======
+ GetFrm( &rPt, pCurCrsr->GetPoint() );
+ if( pFrm && sal_True == ( bRet = GetFrmInPage( pFrm, fnWhichPage,
+>>>>>>> other
fnPosPage, pCurCrsr ) ) &&
!pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE |
nsSwCursorSelOverFlags::SELOVER_CHANGEPOS ))
UpdateCrsr();
else
- bRet = FALSE;
+ bRet = sal_False;
}
return bRet;
}
-BOOL SwCrsrShell::MovePara(SwWhichPara fnWhichPara, SwPosPara fnPosPara )
+sal_Bool SwCrsrShell::MovePara(SwWhichPara fnWhichPara, SwPosPara fnPosPara )
{
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
SwCursor* pTmpCrsr = getShellCrsr( true );
- BOOL bRet = pTmpCrsr->MovePara( fnWhichPara, fnPosPara );
+ sal_Bool bRet = pTmpCrsr->MovePara( fnWhichPara, fnPosPara );
if( bRet )
UpdateCrsr();
return bRet;
}
-BOOL SwCrsrShell::MoveSection( SwWhichSection fnWhichSect,
+sal_Bool SwCrsrShell::MoveSection( SwWhichSection fnWhichSect,
SwPosSection fnPosSect)
{
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
SwCursor* pTmpCrsr = getShellCrsr( true );
- BOOL bRet = pTmpCrsr->MoveSection( fnWhichSect, fnPosSect );
+ sal_Bool bRet = pTmpCrsr->MoveSection( fnWhichSect, fnPosSect );
if( bRet )
UpdateCrsr();
return bRet;
@@ -630,7 +659,11 @@ SwFrm* lcl_IsInHeaderFooter( const SwNodeIndex& rIdx, Point& rPt )
SwCntntNode* pCNd = rIdx.GetNode().GetCntntNode();
if( pCNd )
{
+<<<<<<< local
pFrm = pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &rPt, 0, FALSE )->GetUpper();
+=======
+ pFrm = pCNd->GetFrm( &rPt, 0, sal_False )->GetUpper();
+>>>>>>> other
while( pFrm && !pFrm->IsHeaderFrm() && !pFrm->IsFooterFrm() )
pFrm = pFrm->IsFlyFrm() ? ((SwFlyFrm*)pFrm)->AnchorFrm()
: pFrm->GetUpper();
@@ -638,7 +671,7 @@ SwFrm* lcl_IsInHeaderFooter( const SwNodeIndex& rIdx, Point& rPt )
return pFrm;
}
-BOOL SwCrsrShell::IsInHeaderFooter( BOOL* pbInHeader ) const
+sal_Bool SwCrsrShell::IsInHeaderFooter( sal_Bool* pbInHeader ) const
{
Point aPt;
SwFrm* pFrm = ::lcl_IsInHeaderFooter( pCurCrsr->GetPoint()->nNode, aPt );
@@ -647,7 +680,7 @@ BOOL SwCrsrShell::IsInHeaderFooter( BOOL* pbInHeader ) const
return 0 != pFrm;
}
-int SwCrsrShell::SetCrsr( const Point &rLPt, BOOL bOnlyText, bool bBlock )
+int SwCrsrShell::SetCrsr( const Point &rLPt, sal_Bool bOnlyText, bool bBlock )
{
SET_CURR_SHELL( this );
@@ -667,11 +700,11 @@ int SwCrsrShell::SetCrsr( const Point &rLPt, BOOL bOnlyText, bool bBlock )
// <--
pTxtNd->HasVisibleNumberingOrBullet() )
{
- aTmpState.bInFrontOfLabel = TRUE; // #i27615#
+ aTmpState.bInFrontOfLabel = sal_True; // #i27615#
}
else
{
- aTmpState.bInFrontOfLabel = FALSE;
+ aTmpState.bInFrontOfLabel = sal_False;
}
int bRet = CRSR_POSOLD |
@@ -716,10 +749,17 @@ int SwCrsrShell::SetCrsr( const Point &rLPt, BOOL bOnlyText, bool bBlock )
else if( aPos.nNode.GetNode().IsCntntNode() )
{
// im gleichen Frame gelandet?
+<<<<<<< local
SwFrm* pOld = ((SwCntntNode&)aPos.nNode.GetNode()).getLayoutFrm(
GetLayout(), &aCharRect.Pos(), 0, FALSE );
SwFrm* pNew = ((SwCntntNode&)aPos.nNode.GetNode()).getLayoutFrm(
GetLayout(), &aPt, 0, FALSE );
+=======
+ SwFrm* pOld = ((SwCntntNode&)aPos.nNode.GetNode()).GetFrm(
+ &aCharRect.Pos(), 0, sal_False );
+ SwFrm* pNew = ((SwCntntNode&)aPos.nNode.GetNode()).GetFrm(
+ &aPt, 0, sal_False );
+>>>>>>> other
if( pNew == pOld )
return bRet;
}
@@ -729,7 +769,7 @@ int SwCrsrShell::SetCrsr( const Point &rLPt, BOOL bOnlyText, bool bBlock )
{
// SSelection ueber nicht erlaubte Sections oder wenn im Header/Footer
// dann in verschiedene
- if( !CheckNodesRange( aPos.nNode, pCrsr->GetMark()->nNode, TRUE )
+ if( !CheckNodesRange( aPos.nNode, pCrsr->GetMark()->nNode, sal_True )
|| ( pFrm && !pFrm->Frm().IsInside( pCrsr->GetMkPos() ) ))
return bRet;
@@ -753,7 +793,7 @@ int SwCrsrShell::SetCrsr( const Point &rLPt, BOOL bOnlyText, bool bBlock )
if( !pCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHANGEPOS ) )
{
- USHORT nFlag = SwCrsrShell::SCROLLWIN | SwCrsrShell::CHKRANGE;
+ sal_uInt16 nFlag = SwCrsrShell::SCROLLWIN | SwCrsrShell::CHKRANGE;
UpdateCrsr( nFlag );
bRet &= ~CRSR_POSOLD;
}
@@ -775,10 +815,10 @@ int SwCrsrShell::SetCrsr( const Point &rLPt, BOOL bOnlyText, bool bBlock )
// es gibt keinen gueltigen Inhalt -> Cursor verstecken
pVisCrsr->Hide(); // sichtbaren Cursor immer verstecken
eMvState = MV_NONE; // Status fuers Crsr-Travelling
- bAllProtect = TRUE;
+ bAllProtect = sal_True;
if( GetDoc()->GetDocShell() )
{
- GetDoc()->GetDocShell()->SetReadOnlyUI( TRUE );
+ GetDoc()->GetDocShell()->SetReadOnlyUI( sal_True );
CallChgLnk(); // UI bescheid sagen!
}
}
@@ -871,7 +911,7 @@ void SwCrsrShell::ClearMark()
}
-void SwCrsrShell::NormalizePam(BOOL bPointFirst)
+void SwCrsrShell::NormalizePam(sal_Bool bPointFirst)
{
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
pCurCrsr->Normalize(bPointFirst);
@@ -891,8 +931,8 @@ void SwCrsrShell::SwapPam()
// Ansonsten wird er auf die gewaehlte SSelection gesetzt.
-BOOL SwCrsrShell::ChgCurrPam( const Point & rPt,
- BOOL bTstOnly, BOOL bTstHit )
+sal_Bool SwCrsrShell::ChgCurrPam( const Point & rPt,
+ sal_Bool bTstOnly, sal_Bool bTstHit )
{
SET_CURR_SHELL( this );
@@ -908,7 +948,7 @@ BOOL SwCrsrShell::ChgCurrPam( const Point & rPt,
SwCrsrMoveState aTmpState( MV_NONE );
aTmpState.bSetInReadOnly = IsReadOnlyAvailable();
if ( !GetLayout()->GetCrsrOfst( &aPtPos, aPt, &aTmpState ) && bTstHit )
- return FALSE;
+ return sal_False;
// suche in allen Selektionen nach dieser Position
SwShellCrsr* pCmp = (SwShellCrsr*)pCurCrsr; // sicher den Pointer auf Cursor
@@ -917,15 +957,15 @@ BOOL SwCrsrShell::ChgCurrPam( const Point & rPt,
*pCmp->Start() <= aPtPos && *pCmp->End() > aPtPos )
{
if( bTstOnly || pCurCrsr == pCmp ) // ist der aktuelle.
- return TRUE; // return ohne Update
+ return sal_True; // return ohne Update
pCurCrsr = pCmp;
UpdateCrsr(); // Cursor steht schon richtig
- return TRUE;
+ return sal_True;
}
} while( pCurCrsr !=
( pCmp = dynamic_cast<SwShellCrsr*>(pCmp->GetNext()) ) );
- return FALSE;
+ return sal_False;
}
@@ -1009,20 +1049,20 @@ int SwCrsrShell::CompareCursor( CrsrCompareType eType ) const
}
-BOOL SwCrsrShell::IsSttPara() const
-{ return( pCurCrsr->GetPoint()->nContent == 0 ? TRUE : FALSE ); }
+sal_Bool SwCrsrShell::IsSttPara() const
+{ return( pCurCrsr->GetPoint()->nContent == 0 ? sal_True : sal_False ); }
-BOOL SwCrsrShell::IsEndPara() const
-{ return( pCurCrsr->GetPoint()->nContent == pCurCrsr->GetCntntNode()->Len() ? TRUE : FALSE ); }
+sal_Bool SwCrsrShell::IsEndPara() const
+{ return( pCurCrsr->GetPoint()->nContent == pCurCrsr->GetCntntNode()->Len() ? sal_True : sal_False ); }
-BOOL SwCrsrShell::IsInFrontOfLabel() const
+sal_Bool SwCrsrShell::IsInFrontOfLabel() const
{
return pCurCrsr->IsInFrontOfLabel();
}
-bool SwCrsrShell::SetInFrontOfLabel( BOOL bNew )
+bool SwCrsrShell::SetInFrontOfLabel( sal_Bool bNew )
{
if ( bNew != IsInFrontOfLabel() )
{
@@ -1033,12 +1073,12 @@ bool SwCrsrShell::SetInFrontOfLabel( BOOL bNew )
return false;
}
-BOOL SwCrsrShell::GotoPage( USHORT nPage )
+sal_Bool SwCrsrShell::GotoPage( sal_uInt16 nPage )
{
SET_CURR_SHELL( this );
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
SwCrsrSaveState aSaveState( *pCurCrsr );
- BOOL bRet = GetLayout()->SetCurrPage( pCurCrsr, nPage ) &&
+ sal_Bool bRet = GetLayout()->SetCurrPage( pCurCrsr, nPage ) &&
!pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE |
nsSwCursorSelOverFlags::SELOVER_CHANGEPOS );
if( bRet )
@@ -1047,8 +1087,8 @@ BOOL SwCrsrShell::GotoPage( USHORT nPage )
}
-void SwCrsrShell::GetPageNum( USHORT &rnPhyNum, USHORT &rnVirtNum,
- BOOL bAtCrsrPos, const BOOL bCalcFrm )
+void SwCrsrShell::GetPageNum( sal_uInt16 &rnPhyNum, sal_uInt16 &rnVirtNum,
+ sal_Bool bAtCrsrPos, const sal_Bool bCalcFrm )
{
SET_CURR_SHELL( this );
// Seitennummer: die erste sichtbare Seite oder die am Cursor
@@ -1069,7 +1109,7 @@ void SwCrsrShell::GetPageNum( USHORT &rnPhyNum, USHORT &rnVirtNum,
}
-USHORT SwCrsrShell::GetNextPrevPageNum( BOOL bNext )
+sal_uInt16 SwCrsrShell::GetNextPrevPageNum( sal_Bool bNext )
{
SET_CURR_SHELL( this );
@@ -1110,7 +1150,7 @@ USHORT SwCrsrShell::GetNextPrevPageNum( BOOL bNext )
}
-USHORT SwCrsrShell::GetPageCnt()
+sal_uInt16 SwCrsrShell::GetPageCnt()
{
SET_CURR_SHELL( this );
// gebe die Anzahl der Seiten zurueck
@@ -1120,11 +1160,11 @@ USHORT SwCrsrShell::GetPageCnt()
// Gehe zur naechsten SSelection
-BOOL SwCrsrShell::GoNextCrsr()
+sal_Bool SwCrsrShell::GoNextCrsr()
{
// besteht ueberhaupt ein Ring ?
if( pCurCrsr->GetNext() == pCurCrsr )
- return FALSE;
+ return sal_False;
SET_CURR_SHELL( this );
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
@@ -1136,17 +1176,17 @@ BOOL SwCrsrShell::GoNextCrsr()
UpdateCrsr();
pCurCrsr->Show();
}
- return TRUE;
+ return sal_True;
}
// gehe zur vorherigen SSelection
-BOOL SwCrsrShell::GoPrevCrsr()
+sal_Bool SwCrsrShell::GoPrevCrsr()
{
// besteht ueberhaupt ein Ring ?
if( pCurCrsr->GetNext() == pCurCrsr )
- return FALSE;
+ return sal_False;
SET_CURR_SHELL( this );
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
@@ -1159,7 +1199,7 @@ BOOL SwCrsrShell::GoPrevCrsr()
pCurCrsr->Show();
}
- return TRUE;
+ return sal_True;
}
@@ -1170,11 +1210,11 @@ void SwCrsrShell::Paint( const Rectangle &rRect)
// beim Painten immer alle Cursor ausschalten
SwRect aRect( rRect );
- BOOL bVis = FALSE;
+ sal_Bool bVis = sal_False;
// ist Cursor sichtbar, dann verstecke den SV-Cursor
if( pVisCrsr->IsVisible() && !aRect.IsOver( aCharRect ) ) //JP 18.06.97: ???
{
- bVis = TRUE;
+ bVis = sal_True;
pVisCrsr->Hide();
}
@@ -1204,13 +1244,13 @@ void SwCrsrShell::Paint( const Rectangle &rRect)
void SwCrsrShell::VisPortChgd( const SwRect & rRect )
{
SET_CURR_SHELL( this );
- BOOL bVis; // beim Scrollen immer alle Cursor ausschalten
+ sal_Bool bVis; // beim Scrollen immer alle Cursor ausschalten
// ist Cursor sichtbar, dann verstecke den SV-Cursor
- if( TRUE == ( bVis = pVisCrsr->IsVisible() ))
+ if( sal_True == ( bVis = pVisCrsr->IsVisible() ))
pVisCrsr->Hide();
- bVisPortChgd = TRUE;
+ bVisPortChgd = sal_True;
aOldRBPos.X() = VisArea().Right();
aOldRBPos.Y() = VisArea().Bottom();
@@ -1230,9 +1270,9 @@ void SwCrsrShell::VisPortChgd( const SwRect & rRect )
pVisCrsr->Show();
if( nCrsrMove )
- bInCMvVisportChgd = TRUE;
+ bInCMvVisportChgd = sal_True;
- bVisPortChgd = FALSE;
+ bVisPortChgd = sal_False;
}
// aktualisiere den Crsrs, d.H. setze ihn wieder in den Content.
@@ -1324,7 +1364,7 @@ class SwNotifyAccAboutInvalidTextSelections
}
};
// <--
-void SwCrsrShell::UpdateCrsr( USHORT eFlags, BOOL bIdleEnd )
+void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, sal_Bool bIdleEnd )
{
SET_CURR_SHELL( this );
@@ -1339,7 +1379,7 @@ void SwCrsrShell::UpdateCrsr( USHORT eFlags, BOOL bIdleEnd )
if( ActionPend() && BasicActionPend() )
{
if ( eFlags & SwCrsrShell::READONLY )
- bIgnoreReadonly = TRUE;
+ bIgnoreReadonly = sal_True;
return; // wenn nicht, dann kein Update !!
}
@@ -1349,7 +1389,7 @@ void SwCrsrShell::UpdateCrsr( USHORT eFlags, BOOL bIdleEnd )
if ( bIgnoreReadonly )
{
- bIgnoreReadonly = FALSE;
+ bIgnoreReadonly = sal_False;
eFlags |= SwCrsrShell::READONLY;
}
@@ -1365,8 +1405,8 @@ void SwCrsrShell::UpdateCrsr( USHORT eFlags, BOOL bIdleEnd )
if( pTstCrsr->HasMark() && !pBlockCrsr &&
pDoc->IsIdxInTbl( pTstCrsr->GetPoint()->nNode ) &&
( pTblCrsr ||
- pTstCrsr->GetNode( TRUE )->StartOfSectionNode() !=
- pTstCrsr->GetNode( FALSE )->StartOfSectionNode() ) )
+ pTstCrsr->GetNode( sal_True )->StartOfSectionNode() !=
+ pTstCrsr->GetNode( sal_False )->StartOfSectionNode() ) )
{
SwShellCrsr* pITmpCrsr = getShellCrsr( true );
Point aTmpPt( pITmpCrsr->GetPtPos() );
@@ -1403,8 +1443,12 @@ void SwCrsrShell::UpdateCrsr( USHORT eFlags, BOOL bIdleEnd )
// Second check if mark is in repeated headline:
if ( !bInRepeatedHeadline )
{
+<<<<<<< local
SwCntntFrm* pMarkTblFrm = pITmpCrsr->GetCntntNode( FALSE )->
getLayoutFrm( GetLayout(), &aTmpMk, pITmpCrsr->GetMark(), FALSE );
+=======
+ SwCntntFrm* pMarkTblFrm = pITmpCrsr->GetCntntNode( sal_False )->GetFrm( &aTmpMk, pITmpCrsr->GetMark() );
+>>>>>>> other
ASSERT( pMarkTblFrm, "Tabelle Crsr nicht im Content ??" );
if ( pMarkTblFrm )
@@ -1460,7 +1504,7 @@ void SwCrsrShell::UpdateCrsr( USHORT eFlags, BOOL bIdleEnd )
}
SwCrsrMoveState aTmpState( MV_NONE );
- aTmpState.bRealHeight = TRUE;
+ aTmpState.bRealHeight = sal_True;
if( !pTblFrm->GetCharRect( aCharRect, *pTblCrsr->GetPoint(), &aTmpState ) )
{
Point aCentrPt( aCharRect.Center() );
@@ -1530,7 +1574,7 @@ void SwCrsrShell::UpdateCrsr( USHORT eFlags, BOOL bIdleEnd )
// sind wir vielleicht in einer geschuetzten/versteckten Section ?
{
SwShellCrsr* pShellCrsr = getShellCrsr( true );
- BOOL bChgState = TRUE;
+ sal_Bool bChgState = sal_True;
const SwSectionNode* pSectNd = pShellCrsr->GetNode()->FindSectionNode();
if( pSectNd && ( pSectNd->GetSection().IsHiddenFlag() ||
( !IsReadOnlyAvailable() &&
@@ -1544,14 +1588,14 @@ void SwCrsrShell::UpdateCrsr( USHORT eFlags, BOOL bIdleEnd )
// alles ist geschuetzt / versteckt -> besonderer Mode
if( bAllProtect && !IsReadOnlyAvailable() &&
pSectNd->GetSection().IsProtectFlag() )
- bChgState = FALSE;
+ bChgState = sal_False;
else
{
eMvState = MV_NONE; // Status fuers Crsr-Travelling
- bAllProtect = TRUE;
+ bAllProtect = sal_True;
if( GetDoc()->GetDocShell() )
{
- GetDoc()->GetDocShell()->SetReadOnlyUI( TRUE );
+ GetDoc()->GetDocShell()->SetReadOnlyUI( sal_True );
CallChgLnk(); // UI bescheid sagen!
}
return;
@@ -1560,12 +1604,12 @@ void SwCrsrShell::UpdateCrsr( USHORT eFlags, BOOL bIdleEnd )
}
if( bChgState )
{
- BOOL bWasAllProtect = bAllProtect;
- bAllProtect = FALSE;
+ sal_Bool bWasAllProtect = bAllProtect;
+ bAllProtect = sal_False;
if( bWasAllProtect && GetDoc()->GetDocShell() &&
GetDoc()->GetDocShell()->IsReadOnlyUI() )
{
- GetDoc()->GetDocShell()->SetReadOnlyUI( FALSE );
+ GetDoc()->GetDocShell()->SetReadOnlyUI( sal_False );
CallChgLnk(); // UI bescheid sagen!
}
}
@@ -1608,17 +1652,23 @@ void SwCrsrShell::UpdateCrsr( USHORT eFlags, BOOL bIdleEnd )
SwRect aOld( aCharRect );
- BOOL bFirst = TRUE;
+ sal_Bool bFirst = sal_True;
SwCntntFrm *pFrm;
int nLoopCnt = 100;
SwShellCrsr* pShellCrsr = getShellCrsr( true );
do {
- BOOL bAgainst;
+ sal_Bool bAgainst;
do {
+<<<<<<< local
bAgainst = FALSE;
pFrm = pShellCrsr->GetCntntNode()->getLayoutFrm( GetLayout(),
&pShellCrsr->GetPtPos(), pShellCrsr->GetPoint(), FALSE );
+=======
+ bAgainst = sal_False;
+ pFrm = pShellCrsr->GetCntntNode()->GetFrm(
+ &pShellCrsr->GetPtPos(), pShellCrsr->GetPoint() );
+>>>>>>> other
// ist der Frm nicht mehr vorhanden, dann muss das gesamte Layout
// erzeugt werden, weil ja mal hier einer vorhanden war !!
if ( !pFrm )
@@ -1642,20 +1692,20 @@ void SwCrsrShell::UpdateCrsr( USHORT eFlags, BOOL bIdleEnd )
!pDoc->GetDocShell()->IsReadOnly() || bAllProtect ) )
{
// dann suche eine gueltige Position
- BOOL bChgState = TRUE;
+ sal_Bool bChgState = sal_True;
if( !FindValidCntntNode(!HasDrawView() ||
0 == Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount()))
{
// alles ist geschuetzt / versteckt -> besonderer Mode
if( bAllProtect )
- bChgState = FALSE;
+ bChgState = sal_False;
else
{
eMvState = MV_NONE; // Status fuers Crsr-Travelling
- bAllProtect = TRUE;
+ bAllProtect = sal_True;
if( GetDoc()->GetDocShell() )
{
- GetDoc()->GetDocShell()->SetReadOnlyUI( TRUE );
+ GetDoc()->GetDocShell()->SetReadOnlyUI( sal_True );
CallChgLnk(); // UI bescheid sagen!
}
return;
@@ -1664,16 +1714,16 @@ void SwCrsrShell::UpdateCrsr( USHORT eFlags, BOOL bIdleEnd )
if( bChgState )
{
- BOOL bWasAllProtect = bAllProtect;
- bAllProtect = FALSE;
+ sal_Bool bWasAllProtect = bAllProtect;
+ bAllProtect = sal_False;
if( bWasAllProtect && GetDoc()->GetDocShell() &&
GetDoc()->GetDocShell()->IsReadOnlyUI() )
{
- GetDoc()->GetDocShell()->SetReadOnlyUI( FALSE );
+ GetDoc()->GetDocShell()->SetReadOnlyUI( sal_False );
CallChgLnk(); // UI bescheid sagen!
}
- bAllProtect = FALSE;
- bAgainst = TRUE; // nochmal den richigen Frm suchen
+ bAllProtect = sal_False;
+ bAgainst = sal_True; // nochmal den richigen Frm suchen
}
}
} while( bAgainst );
@@ -1682,7 +1732,7 @@ void SwCrsrShell::UpdateCrsr( USHORT eFlags, BOOL bIdleEnd )
{
SwCrsrMoveState aTmpState( eMvState );
aTmpState.bSetInReadOnly = IsReadOnlyAvailable();
- aTmpState.bRealHeight = TRUE;
+ aTmpState.bRealHeight = sal_True;
aTmpState.bRealWidth = IsOverwriteCrsr();
aTmpState.nCursorBidiLevel = pShellCrsr->GetCrsrBidiLevel();
@@ -1729,7 +1779,7 @@ void SwCrsrShell::UpdateCrsr( USHORT eFlags, BOOL bIdleEnd )
break;
}
aOld = aCharRect;
- bFirst = FALSE;
+ bFirst = sal_False;
// Cursor-Points auf die neuen Positionen setzen
pShellCrsr->GetPtPos().X() = aCharRect.Left();
@@ -1751,7 +1801,7 @@ void SwCrsrShell::UpdateCrsr( USHORT eFlags, BOOL bIdleEnd )
//JP 30.04.99: damit das EndAction, beim evtuellen Scrollen, den
// SV-Crsr nicht wieder sichtbar macht, wird hier das Flag
// gesichert und zurueckgesetzt.
- BOOL bSav = bSVCrsrVis; bSVCrsrVis = FALSE;
+ sal_Bool bSav = bSVCrsrVis; bSVCrsrVis = sal_False;
MakeSelVisible();
bSVCrsrVis = bSav;
}
@@ -1936,20 +1986,20 @@ void SwCrsrShell::Push()
/*
* Loescht einen Cursor (gesteuert durch bOldCrsr)
- * - vom Stack oder ( bOldCrsr = TRUE )
+ * - vom Stack oder ( bOldCrsr = sal_True )
* - den aktuellen und der auf dem Stack stehende wird zum aktuellen
*
* Return: es war auf dem Stack noch einer vorhanden
*/
-BOOL SwCrsrShell::Pop( BOOL bOldCrsr )
+sal_Bool SwCrsrShell::Pop( sal_Bool bOldCrsr )
{
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
// noch weitere vorhanden ?
if( 0 == pCrsrStk )
- return FALSE;
+ return sal_False;
SwShellCrsr *pTmp = 0, *pOldStk = pCrsrStk;
@@ -1990,12 +2040,12 @@ BOOL SwCrsrShell::Pop( BOOL bOldCrsr )
pCurCrsr->GetPtPos() = pOldStk->GetPtPos();
delete pOldStk;
- if( !pCurCrsr->IsInProtectTable( TRUE ) &&
+ if( !pCurCrsr->IsInProtectTable( sal_True ) &&
!pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE |
nsSwCursorSelOverFlags::SELOVER_CHANGEPOS ) )
UpdateCrsr(); // akt. Cursor Updaten
}
- return TRUE;
+ return sal_True;
}
/*
@@ -2015,9 +2065,9 @@ void SwCrsrShell::Combine()
if( pCrsrStk->HasMark() ) // nur wenn GetMark gesetzt wurde
{
#ifndef DBG_UTIL
- CheckNodesRange( pCrsrStk->GetMark()->nNode, pCurCrsr->GetPoint()->nNode, TRUE );
+ CheckNodesRange( pCrsrStk->GetMark()->nNode, pCurCrsr->GetPoint()->nNode, sal_True );
#else
- if( !CheckNodesRange( pCrsrStk->GetMark()->nNode, pCurCrsr->GetPoint()->nNode, TRUE ))
+ if( !CheckNodesRange( pCrsrStk->GetMark()->nNode, pCurCrsr->GetPoint()->nNode, sal_True ))
ASSERT( !this, "StackCrsr & akt. Crsr nicht in gleicher Section." );
#endif
// kopiere das GetMark
@@ -2034,7 +2084,7 @@ void SwCrsrShell::Combine()
}
delete pCrsrStk;
pCrsrStk = pTmp;
- if( !pCurCrsr->IsInProtectTable( TRUE ) &&
+ if( !pCurCrsr->IsInProtectTable( sal_True ) &&
!pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE |
nsSwCursorSelOverFlags::SELOVER_CHANGEPOS ) )
UpdateCrsr(); // akt. Cursor Updaten
@@ -2059,7 +2109,7 @@ void SwCrsrShell::HideCrsrs()
-void SwCrsrShell::ShowCrsrs( BOOL bCrsrVis )
+void SwCrsrShell::ShowCrsrs( sal_Bool bCrsrVis )
{
if( !bHasFocus || bAllProtect || bBasicHideCrsr )
return;
@@ -2079,7 +2129,7 @@ void SwCrsrShell::ShowCrsr()
{
if( !bBasicHideCrsr )
{
- bSVCrsrVis = TRUE;
+ bSVCrsrVis = sal_True;
UpdateCrsr();
}
}
@@ -2089,7 +2139,7 @@ void SwCrsrShell::HideCrsr()
{
if( !bBasicHideCrsr )
{
- bSVCrsrVis = FALSE;
+ bSVCrsrVis = sal_False;
// evt. die sel. Bereiche aufheben !!
SET_CURR_SHELL( this );
pVisCrsr->Hide();
@@ -2101,25 +2151,25 @@ void SwCrsrShell::ShLooseFcs()
{
if( !bBasicHideCrsr )
HideCrsrs();
- bHasFocus = FALSE;
+ bHasFocus = sal_False;
}
-void SwCrsrShell::ShGetFcs( BOOL bUpdate )
+void SwCrsrShell::ShGetFcs( sal_Bool bUpdate )
{
- bHasFocus = TRUE;
+ bHasFocus = sal_True;
if( !bBasicHideCrsr && VisArea().Width() )
{
- UpdateCrsr( static_cast<USHORT>( bUpdate ?
+ UpdateCrsr( static_cast<sal_uInt16>( bUpdate ?
SwCrsrShell::CHKRANGE|SwCrsrShell::SCROLLWIN
: SwCrsrShell::CHKRANGE ) );
- ShowCrsrs( bSVCrsrVis ? TRUE : FALSE );
+ ShowCrsrs( bSVCrsrVis ? sal_True : sal_False );
}
}
// gebe den aktuellen Frame, in dem der Cursor steht, zurueck
-SwCntntFrm *SwCrsrShell::GetCurrFrm( const BOOL bCalcFrm ) const
+SwCntntFrm *SwCrsrShell::GetCurrFrm( const sal_Bool bCalcFrm ) const
{
SET_CURR_SHELL( (ViewShell*)this );
SwCntntFrm *pRet = 0;
@@ -2128,16 +2178,25 @@ SwCntntFrm *SwCrsrShell::GetCurrFrm( const BOOL bCalcFrm ) const
{
if ( bCalcFrm )
{
- const USHORT* pST = &nStartAction;
- ++(*((USHORT*)pST));
+ const sal_uInt16* pST = &nStartAction;
+ ++(*((sal_uInt16*)pST));
const Size aOldSz( GetDocSize() );
+<<<<<<< local
pRet = pNd->getLayoutFrm( GetLayout(), &pCurCrsr->GetPtPos(), pCurCrsr->GetPoint() );
--(*((USHORT*)pST));
+=======
+ pRet = pNd->GetFrm( &pCurCrsr->GetPtPos(), pCurCrsr->GetPoint() );
+ --(*((sal_uInt16*)pST));
+>>>>>>> other
if( aOldSz != GetDocSize() )
((SwCrsrShell*)this)->SizeChgNotify();
}
else
+<<<<<<< local
pRet = pNd->getLayoutFrm( GetLayout(), &pCurCrsr->GetPtPos(), pCurCrsr->GetPoint(), FALSE);
+=======
+ pRet = pNd->GetFrm( &pCurCrsr->GetPtPos(), pCurCrsr->GetPoint(), sal_False);
+>>>>>>> other
}
return pRet;
}
@@ -2149,11 +2208,11 @@ SwCntntFrm *SwCrsrShell::GetCurrFrm( const BOOL bCalcFrm ) const
void SwCrsrShell::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
- const USHORT nWhich = pOld ?
+ const sal_uInt16 nWhich = pOld ?
pOld->Which() :
pNew ?
pNew->Which() :
- sal::static_int_cast<USHORT>(RES_MSG_BEGIN);
+ sal::static_int_cast<sal_uInt16>(RES_MSG_BEGIN);
if( bCallChgLnk &&
( nWhich < RES_MSG_BEGIN || nWhich >= RES_MSG_END ||
@@ -2161,7 +2220,7 @@ void SwCrsrShell::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
nWhich == RES_ATTRSET_CHG ))
// die Messages werden nicht weitergemeldet
//MA 07. Apr. 94 fix(6681): RES_UPDATE_ATTR wird implizit vom
- //SwTxtNode::Insert(SwTxtHint*, USHORT) abgesetzt; hier wird reagiert und
+ //SwTxtNode::Insert(SwTxtHint*, sal_uInt16) abgesetzt; hier wird reagiert und
//vom Insert brauch nicht mehr die Keule RES_FMT_CHG versandt werden.
CallChgLnk();
@@ -2175,12 +2234,12 @@ void SwCrsrShell::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
// also, ob GetMark gesetzt und SPoint und GetMark unterschiedlich sind.
-BOOL SwCrsrShell::HasSelection() const
+sal_Bool SwCrsrShell::HasSelection() const
{
const SwPaM* pCrsr = getShellCrsr( true );
return( IsTableMode() || ( pCrsr->HasMark() &&
*pCrsr->GetPoint() != *pCrsr->GetMark())
- ? TRUE : FALSE );
+ ? sal_True : sal_False );
}
@@ -2189,12 +2248,12 @@ void SwCrsrShell::CallChgLnk()
// innerhalb von Start-/End-Action kein Call, sondern nur merken,
// das sich etwas geaendert hat. Wird bei EndAction beachtet.
if( BasicActionPend() )
- bChgCallFlag = TRUE; // das Change merken
+ bChgCallFlag = sal_True; // das Change merken
else if( aChgLnk.IsSet() )
{
if( bCallChgLnk )
aChgLnk.Call( this );
- bChgCallFlag = FALSE; // Flag zuruecksetzen
+ bChgCallFlag = sal_False; // Flag zuruecksetzen
}
}
@@ -2236,7 +2295,7 @@ String SwCrsrShell::GetText() const
}
// hole vom Start/Ende der akt. SSelection das nte Zeichen
-sal_Unicode SwCrsrShell::GetChar( BOOL bEnd, long nOffset )
+sal_Unicode SwCrsrShell::GetChar( sal_Bool bEnd, long nOffset )
{
if( IsTableMode() ) // im TabelleMode nicht moeglich
return 0;
@@ -2260,10 +2319,10 @@ sal_Unicode SwCrsrShell::GetChar( BOOL bEnd, long nOffset )
// erweiter die akt. SSelection am Anfang/Ende um n Zeichen
-BOOL SwCrsrShell::ExtendSelection( BOOL bEnd, xub_StrLen nCount )
+sal_Bool SwCrsrShell::ExtendSelection( sal_Bool bEnd, xub_StrLen nCount )
{
if( !pCurCrsr->HasMark() || IsTableMode() )
- return FALSE; // keine Selektion
+ return sal_False; // keine Selektion
SwPosition* pPos = bEnd ? pCurCrsr->End() : pCurCrsr->Start();
SwTxtNode* pTxtNd = pPos->nNode.GetNode().GetTxtNode();
@@ -2275,47 +2334,47 @@ BOOL SwCrsrShell::ExtendSelection( BOOL bEnd, xub_StrLen nCount )
if( ( nPos + nCount ) <= pTxtNd->GetTxt().Len() )
nPos = nPos + nCount;
else
- return FALSE; // nicht mehr moeglich
+ return sal_False; // nicht mehr moeglich
}
else if( nPos >= nCount )
nPos = nPos - nCount;
else
- return FALSE; // nicht mehr moeglich
+ return sal_False; // nicht mehr moeglich
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen,
pPos->nContent = nPos;
UpdateCrsr();
- return TRUE;
+ return sal_True;
}
// setze nur den sichtbaren Cursor an die angegebene Dokument-Pos.
-// returnt FALSE: wenn der SPoint vom Layout korrigiert wurde.
+// returnt sal_False: wenn der SPoint vom Layout korrigiert wurde.
-BOOL SwCrsrShell::SetVisCrsr( const Point &rPt )
+sal_Bool SwCrsrShell::SetVisCrsr( const Point &rPt )
{
SET_CURR_SHELL( this );
Point aPt( rPt );
SwPosition aPos( *pCurCrsr->GetPoint() );
SwCrsrMoveState aTmpState( MV_SETONLYTEXT );
aTmpState.bSetInReadOnly = IsReadOnlyAvailable();
- aTmpState.bRealHeight = TRUE;
+ aTmpState.bRealHeight = sal_True;
- BOOL bRet = GetLayout()->GetCrsrOfst( &aPos, aPt /*, &aTmpState*/ );
+ sal_Bool bRet = GetLayout()->GetCrsrOfst( &aPos, aPt /*, &aTmpState*/ );
- SetInFrontOfLabel( FALSE ); // #i27615#
+ SetInFrontOfLabel( sal_False ); // #i27615#
// nur in TextNodes anzeigen !!
SwTxtNode* pTxtNd = aPos.nNode.GetNode().GetTxtNode();
if( !pTxtNd )
- return FALSE;
+ return sal_False;
const SwSectionNode* pSectNd = pTxtNd->FindSectionNode();
if( pSectNd && (pSectNd->GetSection().IsHiddenFlag() ||
( !IsReadOnlyAvailable() &&
pSectNd->GetSection().IsProtectFlag())) )
- return FALSE;
+ return sal_False;
SwCntntFrm *pFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt, &aPos );
if ( Imp()->IsIdleAction() )
@@ -2327,7 +2386,7 @@ BOOL SwCrsrShell::SetVisCrsr( const Point &rPt )
if( aTmp == aCharRect && // BUG 10137: bleibt der Cursor auf der
pVisCrsr->IsVisible() ) // Position nicht hidden & showen
- return TRUE;
+ return sal_True;
pVisCrsr->Hide(); // sichtbaren Cursor immer verstecken
if( IsScrollMDI( this, aCharRect ))
@@ -2348,13 +2407,13 @@ BOOL SwCrsrShell::SetVisCrsr( const Point &rPt )
aCrsrHeight.Y() = aCharRect.Height();
}
- pVisCrsr->SetDragCrsr( TRUE );
+ pVisCrsr->SetDragCrsr( sal_True );
pVisCrsr->Show(); // wieder anzeigen
}
return bRet;
}
-BOOL SwCrsrShell::IsOverReadOnlyPos( const Point& rPt ) const
+sal_Bool SwCrsrShell::IsOverReadOnlyPos( const Point& rPt ) const
{
Point aPt( rPt );
SwPaM aPam( *pCurCrsr->GetPoint() );
@@ -2367,10 +2426,10 @@ BOOL SwCrsrShell::IsOverReadOnlyPos( const Point& rPt ) const
// returne die Anzahl der Cursor im Ring (Flag besagt ob man nur
// aufgepspannte haben will - sprich etwas selektiert ist (Basic))
-USHORT SwCrsrShell::GetCrsrCnt( BOOL bAll ) const
+sal_uInt16 SwCrsrShell::GetCrsrCnt( sal_Bool bAll ) const
{
Ring* pTmp = GetCrsr()->GetNext();
- USHORT n = (bAll || ( pCurCrsr->HasMark() &&
+ sal_uInt16 n = (bAll || ( pCurCrsr->HasMark() &&
*pCurCrsr->GetPoint() != *pCurCrsr->GetMark())) ? 1 : 0;
while( pTmp != pCurCrsr )
{
@@ -2383,10 +2442,10 @@ USHORT SwCrsrShell::GetCrsrCnt( BOOL bAll ) const
}
-BOOL SwCrsrShell::IsStartOfDoc() const
+sal_Bool SwCrsrShell::IsStartOfDoc() const
{
if( pCurCrsr->GetPoint()->nContent.GetIndex() )
- return FALSE;
+ return sal_False;
// Hinter EndOfIcons kommt die Content-Section (EndNd+StNd+CntntNd)
SwNodeIndex aIdx( GetDoc()->GetNodes().GetEndOfExtras(), 2 );
@@ -2396,7 +2455,7 @@ BOOL SwCrsrShell::IsStartOfDoc() const
}
-BOOL SwCrsrShell::IsEndOfDoc() const
+sal_Bool SwCrsrShell::IsEndOfDoc() const
{
SwNodeIndex aIdx( GetDoc()->GetNodes().GetEndOfContent(), -1 );
SwCntntNode* pCNd = aIdx.GetNode().GetCntntNode();
@@ -2412,10 +2471,10 @@ BOOL SwCrsrShell::IsEndOfDoc() const
// Cursor auf seinen TextNode (oder StartNode?).
// Beim naechsten ::GetCrsr werden sie wieder alle erzeugt
// Wird fuers Drag&Drop / ClipBorad-Paste in Tabellen benoetigt.
-BOOL SwCrsrShell::ParkTblCrsr()
+sal_Bool SwCrsrShell::ParkTblCrsr()
{
if( !pTblCrsr )
- return FALSE;
+ return sal_False;
pTblCrsr->ParkCrsr();
@@ -2427,7 +2486,7 @@ BOOL SwCrsrShell::ParkTblCrsr()
*pCurCrsr->GetMark() = *pCurCrsr->GetPoint() = *pTblCrsr->GetPoint();
pCurCrsr->DeleteMark();
- return TRUE;
+ return sal_True;
}
/***********************************************************************
@@ -2447,7 +2506,7 @@ void SwCrsrShell::_ParkPams( SwPaM* pDelRg, SwShellCrsr** ppDelRing )
SwPaM *pTmpDel = 0, *pTmp = *ppDelRing;
// durchsuche den gesamten Ring
- BOOL bGoNext;
+ sal_Bool bGoNext;
do {
const SwPosition *pTmpStt = pTmp->Start(),
*pTmpEnd = pTmp->GetPoint() == pTmpStt ?
@@ -2468,22 +2527,22 @@ void SwCrsrShell::_ParkPams( SwPaM* pDelRg, SwShellCrsr** ppDelRing )
if( *pStt < *pTmpEnd )
pTmpDel = pTmp;
- bGoNext = TRUE;
+ bGoNext = sal_True;
if( pTmpDel ) // ist der Pam im Bereich ?? loesche ihn
{
- BOOL bDelete = TRUE;
+ sal_Bool bDelete = sal_True;
if( *ppDelRing == pTmpDel )
{
if( *ppDelRing == pCurCrsr )
{
- if( TRUE == ( bDelete = GoNextCrsr() ))
+ if( sal_True == ( bDelete = GoNextCrsr() ))
{
- bGoNext = FALSE;
+ bGoNext = sal_False;
pTmp = (SwPaM*)pTmp->GetNext();
}
}
else
- bDelete = FALSE; // StackCrsr nie loeschen !!
+ bDelete = sal_False; // StackCrsr nie loeschen !!
}
if( bDelete )
@@ -2586,9 +2645,9 @@ SwCrsrShell::SwCrsrShell( SwCrsrShell& rShell, Window *pInitWin )
bAllProtect = bVisPortChgd = bChgCallFlag = bInCMvVisportChgd =
bGCAttr = bIgnoreReadonly = bSelTblCells = bBasicHideCrsr =
- bOverwriteCrsr = FALSE;
- bCallChgLnk = bHasFocus = bSVCrsrVis = bAutoUpdateCells = TRUE;
- bSetCrsrInReadOnly = TRUE;
+ bOverwriteCrsr = sal_False;
+ bCallChgLnk = bHasFocus = bSVCrsrVis = bAutoUpdateCells = sal_True;
+ bSetCrsrInReadOnly = sal_True;
pVisCrsr = new SwVisCrsr( this );
// UpdateCrsr( 0 );
// OD 11.02.2003 #100556#
@@ -2629,9 +2688,9 @@ SwCrsrShell::SwCrsrShell( SwDoc& rDoc, Window *pInitWin,
bAllProtect = bVisPortChgd = bChgCallFlag = bInCMvVisportChgd =
bGCAttr = bIgnoreReadonly = bSelTblCells = bBasicHideCrsr =
- bOverwriteCrsr = FALSE;
- bCallChgLnk = bHasFocus = bSVCrsrVis = bAutoUpdateCells = TRUE;
- bSetCrsrInReadOnly = TRUE;
+ bOverwriteCrsr = sal_False;
+ bCallChgLnk = bHasFocus = bSVCrsrVis = bAutoUpdateCells = sal_True;
+ bSetCrsrInReadOnly = sal_True;
pVisCrsr = new SwVisCrsr( this );
// UpdateCrsr( 0 );
@@ -2688,13 +2747,13 @@ SwShellCrsr* SwCrsrShell::getShellCrsr( bool bBlock )
//Sollte fuer das Clipboard der WaitPtr geschaltet werden?
//Warten bei TableMode, Mehrfachselektion und mehr als x Selektieren Absaetzen.
-BOOL SwCrsrShell::ShouldWait() const
+sal_Bool SwCrsrShell::ShouldWait() const
{
if ( IsTableMode() || GetCrsrCnt() > 1 )
- return TRUE;
+ return sal_True;
if( HasDrawView() && GetDrawView()->GetMarkedObjectList().GetMarkCount() )
- return TRUE;
+ return sal_True;
SwPaM* pPam = GetCrsr();
return pPam->Start()->nNode.GetIndex() + 10 <
@@ -2702,7 +2761,7 @@ BOOL SwCrsrShell::ShouldWait() const
}
-USHORT SwCrsrShell::UpdateTblSelBoxes()
+sal_uInt16 SwCrsrShell::UpdateTblSelBoxes()
{
if( pTblCrsr && ( pTblCrsr->IsChgd() || !pTblCrsr->GetBoxesCount() ))
GetLayout()->MakeTblCrsrs( *pTblCrsr );
@@ -2746,18 +2805,18 @@ void SwCrsrShell::MakeSelVisible()
// suche eine gueltige ContentPosition (nicht geschuetzt/nicht versteckt)
-BOOL SwCrsrShell::FindValidCntntNode( BOOL bOnlyText )
+sal_Bool SwCrsrShell::FindValidCntntNode( sal_Bool bOnlyText )
{
if( pTblCrsr ) // was soll ich jetzt machen ??
{
ASSERT( !this, "TabellenSelection nicht aufgehoben!" );
- return FALSE;
+ return sal_False;
}
//JP 28.10.97: Bug 45129 - im UI-ReadOnly ist alles erlaubt
if( !bAllProtect && GetDoc()->GetDocShell() &&
GetDoc()->GetDocShell()->IsReadOnlyUI() )
- return TRUE;
+ return sal_True;
// dann raus da!
if( pCurCrsr->HasMark() )
@@ -2765,12 +2824,16 @@ BOOL SwCrsrShell::FindValidCntntNode( BOOL bOnlyText )
// als erstes mal auf Rahmen abpruefen
SwNodeIndex& rNdIdx = pCurCrsr->GetPoint()->nNode;
- ULONG nNdIdx = rNdIdx.GetIndex(); // sichern
+ sal_uLong nNdIdx = rNdIdx.GetIndex(); // sichern
SwNodes& rNds = pDoc->GetNodes();
SwCntntNode* pCNd = rNdIdx.GetNode().GetCntntNode();
const SwCntntFrm * pFrm;
+<<<<<<< local
if( pCNd && 0 != (pFrm = pCNd->getLayoutFrm( GetLayout(),0,pCurCrsr->GetPoint(),FALSE)) &&
+=======
+ if( pCNd && 0 != (pFrm = pCNd->GetFrm(0,pCurCrsr->GetPoint(),sal_False)) &&
+>>>>>>> other
!IsReadOnlyAvailable() && pFrm->IsProtected() &&
nNdIdx < rNds.GetEndOfExtras().GetIndex() )
{
@@ -2780,17 +2843,17 @@ BOOL SwCrsrShell::FindValidCntntNode( BOOL bOnlyText )
aPam.GetMark()->nNode = rNds.GetEndOfContent();
aPam.GetPoint()->nNode = *pCNd->EndOfSectionNode();
- BOOL bFirst = FALSE;
- if( 0 == (pCNd = ::GetNode( aPam, bFirst, fnMoveForward, FALSE )))
+ sal_Bool bFirst = sal_False;
+ if( 0 == (pCNd = ::GetNode( aPam, bFirst, fnMoveForward, sal_False )))
{
aPam.GetMark()->nNode = *rNds.GetEndOfPostIts().StartOfSectionNode();
- pCNd = ::GetNode( aPam, bFirst, fnMoveBackward, FALSE );
+ pCNd = ::GetNode( aPam, bFirst, fnMoveBackward, sal_False );
}
if( !pCNd ) // sollte nie passieren !!!
{
rNdIdx = nNdIdx; // alten Node zurueck
- return FALSE;
+ return sal_False;
}
*pCurCrsr->GetPoint() = *aPam.GetPoint();
}
@@ -2803,7 +2866,7 @@ BOOL SwCrsrShell::FindValidCntntNode( BOOL bOnlyText )
nNdIdx = rNdIdx.GetIndex();
}
- BOOL bOk = TRUE;
+ sal_Bool bOk = sal_True;
// #i9059# cursor may not stand in protected cells
// (unless cursor in protected areas is OK.)
@@ -2846,15 +2909,15 @@ BOOL SwCrsrShell::FindValidCntntNode( BOOL bOnlyText )
typedef SwCntntNode* (SwNodes:: *FNGoSection)( SwNodeIndex *, int, int ) const;
FNGoSection funcGoSection = &SwNodes::GoNextSection;
- bOk = FALSE;
+ bOk = sal_False;
for( int nLoopCnt = 0; !bOk && nLoopCnt < 2; ++nLoopCnt )
{
- BOOL bWeiter;
+ sal_Bool bWeiter;
do {
- bWeiter = FALSE;
+ bWeiter = sal_False;
while( 0 != ( pCNd = (rNds.*funcGoSection)( &rNdIdx,
- TRUE, !IsReadOnlyAvailable() )) )
+ sal_True, !IsReadOnlyAvailable() )) )
{
// in eine Tabelle verschoben -> pruefe ob die
// vielleicht geschuetzt ist
@@ -2863,14 +2926,14 @@ BOOL SwCrsrShell::FindValidCntntNode( BOOL bOnlyText )
SwCallLink aTmp( *this );
SwCrsrSaveState aSaveState( *pCurCrsr );
aTmp.nNdTyp = 0; // im DTOR nichts machen!
- if( !pCurCrsr->IsInProtectTable( TRUE, TRUE ) )
+ if( !pCurCrsr->IsInProtectTable( sal_True, sal_True ) )
{
const SwSectionNode* pSNd = pCNd->FindSectionNode();
if( !pSNd || !pSNd->GetSection().IsHiddenFlag()
|| (!IsReadOnlyAvailable() &&
pSNd->GetSection().IsProtectFlag() ))
{
- bOk = TRUE;
+ bOk = sal_True;
break; // eine nicht geschuetzte Zelle gef.
}
continue; // dann weiter suchen
@@ -2878,7 +2941,7 @@ BOOL SwCrsrShell::FindValidCntntNode( BOOL bOnlyText )
}
else
{
- bOk = TRUE;
+ bOk = sal_True;
break; // eine nicht geschuetzte Zelle gef.
}
}
@@ -2886,13 +2949,17 @@ BOOL SwCrsrShell::FindValidCntntNode( BOOL bOnlyText )
if( bOk && rNdIdx.GetIndex() < rNds.GetEndOfExtras().GetIndex() )
{
// Teste mal auf Fly - kann auch noch geschuetzt sein!!
+<<<<<<< local
if( 0 == (pFrm = pCNd->getLayoutFrm( GetLayout(),0,0,FALSE)) ||
+=======
+ if( 0 == (pFrm = pCNd->GetFrm(0,0,sal_False)) ||
+>>>>>>> other
( !IsReadOnlyAvailable() && pFrm->IsProtected() ) ||
( bOnlyText && pCNd->IsNoTxtNode() ) )
{
// dann weiter suchen!
- bOk = FALSE;
- bWeiter = TRUE;
+ bOk = sal_False;
+ bWeiter = sal_True;
}
}
} while( bWeiter );
@@ -2908,7 +2975,7 @@ BOOL SwCrsrShell::FindValidCntntNode( BOOL bOnlyText )
if( bOk )
{
pCNd = rNdIdx.GetNode().GetCntntNode();
-// USHORT nCntnt = Min( pCNd->Len(), pCurCrsr->GetPoint()->nContent.GetIndex() );
+// sal_uInt16 nCntnt = Min( pCNd->Len(), pCurCrsr->GetPoint()->nContent.GetIndex() );
xub_StrLen nCntnt = rNdIdx.GetIndex() < nNdIdx ? pCNd->Len() : 0;
pCurCrsr->GetPoint()->nContent.Assign( pCNd, nCntnt );
}
@@ -2918,7 +2985,11 @@ BOOL SwCrsrShell::FindValidCntntNode( BOOL bOnlyText )
// falls Cursor im versteckten Bereich ist, auf jedenfall schon mal
// verschieben!!
+<<<<<<< local
if( !pCNd || !pCNd->getLayoutFrm( GetLayout(),0,0,FALSE) )
+=======
+ if( !pCNd || !pCNd->GetFrm(0,0,sal_False) )
+>>>>>>> other
{
SwCrsrMoveState aTmpState( MV_NONE );
aTmpState.bSetInReadOnly = IsReadOnlyAvailable();
@@ -2935,14 +3006,14 @@ void SwCrsrShell::NewCoreSelection()
}
-BOOL SwCrsrShell::IsCrsrReadonly() const
+sal_Bool SwCrsrShell::IsCrsrReadonly() const
{
if ( GetViewOptions()->IsReadonly() ||
// --> FME 2004-06-29 #114856# Formular view
GetViewOptions()->IsFormView() )
// <--
{
- SwFrm *pFrm = GetCurrFrm( FALSE );
+ SwFrm *pFrm = GetCurrFrm( sal_False );
const SwFlyFrm* pFly;
const SwSection* pSection;
@@ -2952,25 +3023,25 @@ BOOL SwCrsrShell::IsCrsrReadonly() const
!pFly->Lower()->IsNoTxtFrm() &&
!GetDrawView()->GetMarkedObjectList().GetMarkCount() )
{
- return FALSE;
+ return sal_False;
}
// --> FME 2004-06-22 #114856# edit in readonly sections
else if ( pFrm && pFrm->IsInSct() &&
0 != ( pSection = pFrm->FindSctFrm()->GetSection() ) &&
pSection->IsEditInReadonlyFlag() )
{
- return FALSE;
+ return sal_False;
}
// <--
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// darf der Cursor in ReadOnlyBereiche?
-void SwCrsrShell::SetReadOnlyAvailable( BOOL bFlag )
+void SwCrsrShell::SetReadOnlyAvailable( sal_Bool bFlag )
{
// im GlobalDoc darf NIE umgeschaltet werden
if( (!GetDoc()->GetDocShell() ||
@@ -2989,9 +3060,9 @@ void SwCrsrShell::SetReadOnlyAvailable( BOOL bFlag )
}
}
-BOOL SwCrsrShell::HasReadonlySel() const
+sal_Bool SwCrsrShell::HasReadonlySel() const
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( IsReadOnlyAvailable() ||
// --> FME 2004-06-29 #114856# Formular view
GetViewOptions()->IsFormView() )
@@ -3012,16 +3083,16 @@ BOOL SwCrsrShell::HasReadonlySel() const
// --> FME 2004-06-29 #114856# Formular view
GetViewOptions()->IsFormView() ) )
// <--
- bRet = TRUE;
+ bRet = sal_True;
} while( !bRet && pCurCrsr != ( pCrsr = (SwPaM*)pCrsr->GetNext() ));
}
}
return bRet;
}
-BOOL SwCrsrShell::IsSelFullPara() const
+sal_Bool SwCrsrShell::IsSelFullPara() const
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pCurCrsr->GetPoint()->nNode.GetIndex() ==
pCurCrsr->GetMark()->nNode.GetIndex() && pCurCrsr == pCurCrsr->GetNext() )
@@ -3055,13 +3126,13 @@ short SwCrsrShell::GetTextDirection( const Point* pPt ) const
return pDoc->GetTextDirection( aPos, &aPt );
}
-BOOL SwCrsrShell::IsInVerticalText( const Point* pPt ) const
+sal_Bool SwCrsrShell::IsInVerticalText( const Point* pPt ) const
{
const short nDir = GetTextDirection( pPt );
return FRMDIR_VERT_TOP_RIGHT == nDir || FRMDIR_VERT_TOP_LEFT == nDir;
}
-BOOL SwCrsrShell::IsInRightToLeftText( const Point* pPt ) const
+sal_Bool SwCrsrShell::IsInRightToLeftText( const Point* pPt ) const
{
const short nDir = GetTextDirection( pPt );
// GetTextDirection uses FRMDIR_VERT_TOP_LEFT to indicate RTL in
@@ -3104,39 +3175,39 @@ bool SwCrsrShell::SelectHiddenRange()
/* */
// die Suchfunktionen
-ULONG SwCrsrShell::Find( const SearchOptions& rSearchOpt, BOOL bSearchInNotes,
+sal_uLong SwCrsrShell::Find( const SearchOptions& rSearchOpt, sal_Bool bSearchInNotes,
SwDocPositions eStart, SwDocPositions eEnde,
- BOOL& bCancel,
+ sal_Bool& bCancel,
FindRanges eRng, int bReplace )
{
if( pTblCrsr )
GetCrsr();
delete pTblCrsr, pTblCrsr = 0;
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
- ULONG nRet = pCurCrsr->Find( rSearchOpt, bSearchInNotes, eStart, eEnde, bCancel, eRng, bReplace );
+ sal_uLong nRet = pCurCrsr->Find( rSearchOpt, bSearchInNotes, eStart, eEnde, bCancel, eRng, bReplace );
if( nRet || bCancel )
UpdateCrsr();
return nRet;
}
-ULONG SwCrsrShell::Find( const SwTxtFmtColl& rFmtColl,
+sal_uLong SwCrsrShell::Find( const SwTxtFmtColl& rFmtColl,
SwDocPositions eStart, SwDocPositions eEnde,
- BOOL& bCancel,
+ sal_Bool& bCancel,
FindRanges eRng, const SwTxtFmtColl* pReplFmt )
{
if( pTblCrsr )
GetCrsr();
delete pTblCrsr, pTblCrsr = 0;
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
- ULONG nRet = pCurCrsr->Find( rFmtColl, eStart, eEnde, bCancel, eRng, pReplFmt );
+ sal_uLong nRet = pCurCrsr->Find( rFmtColl, eStart, eEnde, bCancel, eRng, pReplFmt );
if( nRet )
UpdateCrsr();
return nRet;
}
-ULONG SwCrsrShell::Find( const SfxItemSet& rSet, BOOL bNoCollections,
+sal_uLong SwCrsrShell::Find( const SfxItemSet& rSet, sal_Bool bNoCollections,
SwDocPositions eStart, SwDocPositions eEnde,
- BOOL& bCancel,
+ sal_Bool& bCancel,
FindRanges eRng, const SearchOptions* pSearchOpt,
const SfxItemSet* rReplSet )
{
@@ -3144,7 +3215,7 @@ ULONG SwCrsrShell::Find( const SfxItemSet& rSet, BOOL bNoCollections,
GetCrsr();
delete pTblCrsr, pTblCrsr = 0;
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
- ULONG nRet = pCurCrsr->Find( rSet, bNoCollections, eStart, eEnde, bCancel,
+ sal_uLong nRet = pCurCrsr->Find( rSet, bNoCollections, eStart, eEnde, bCancel,
eRng, pSearchOpt, rReplSet );
if( nRet )
UpdateCrsr();
@@ -3315,7 +3386,7 @@ void lcl_FillRecognizerData( uno::Sequence< rtl::OUString >& rSmartTagTypes,
std::vector< rtl::OUString > aSmartTagTypes;
std::vector< uno::Reference< container::XStringKeyMap > > aStringKeyMaps;
- for ( USHORT i = 0; i < rSmartTagList.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rSmartTagList.Count(); ++i )
{
const xub_StrLen nSTPos = rSmartTagList.Pos( i );
const xub_StrLen nSTLen = rSmartTagList.Len( i );
@@ -3337,7 +3408,7 @@ void lcl_FillRecognizerData( uno::Sequence< rtl::OUString >& rSmartTagTypes,
rStringKeyMaps.realloc( aSmartTagTypes.size() );
std::vector< rtl::OUString >::const_iterator aTypesIter = aSmartTagTypes.begin();
- USHORT i = 0;
+ sal_uInt16 i = 0;
for ( aTypesIter = aSmartTagTypes.begin(); aTypesIter != aSmartTagTypes.end(); ++aTypesIter )
rSmartTagTypes[i++] = *aTypesIter;
@@ -3386,7 +3457,7 @@ void SwCrsrShell::GetSmartTagTerm( uno::Sequence< rtl::OUString >& rSmartTagType
if( pSmartTagList->InWrongWord( nBegin, nLen ) && !pNode->IsSymbol(nBegin) )
{
- const USHORT nIndex = pSmartTagList->GetWrongPos( nBegin );
+ const sal_uInt16 nIndex = pSmartTagList->GetWrongPos( nBegin );
const SwWrongList* pSubList = pSmartTagList->SubList( nIndex );
if ( pSubList )
{
@@ -3430,7 +3501,7 @@ void SwCrsrShell::GetSmartTagTerm( const Point& rPt, SwRect& rSelectRect,
if( pSmartTagList->InWrongWord( nBegin, nLen ) && !pNode->IsSymbol(nBegin) )
{
- const USHORT nIndex = pSmartTagList->GetWrongPos( nBegin );
+ const sal_uInt16 nIndex = pSmartTagList->GetWrongPos( nBegin );
const SwWrongList* pSubList = pSmartTagList->SubList( nIndex );
if ( pSubList )
{
@@ -3450,7 +3521,7 @@ void SwCrsrShell::GetSmartTagTerm( const Point& rPt, SwRect& rSelectRect,
xub_StrLen nLineStart = GetCrsr()->GetPoint()->nContent.GetIndex();
RightMargin();
xub_StrLen nLineEnd = GetCrsr()->GetPoint()->nContent.GetIndex();
- Pop(FALSE);
+ Pop(sal_False);
// make sure the selection build later from the
// data below does not include footnotes and other
@@ -3481,16 +3552,20 @@ void SwCrsrShell::GetSmartTagTerm( const Point& rPt, SwRect& rSelectRect,
rContent = nWordStart;
SwRect aStartRect;
SwCrsrMoveState aState;
- aState.bRealWidth = TRUE;
+ aState.bRealWidth = sal_True;
SwCntntNode* pCntntNode = pCrsr->GetCntntNode();
+<<<<<<< local
SwCntntFrm *pCntntFrame = pCntntNode->getLayoutFrm( GetLayout(), &rPt, pCrsr->GetPoint(), FALSE);
+=======
+ SwCntntFrm *pCntntFrame = pCntntNode->GetFrm( &rPt, pCrsr->GetPoint(), sal_False);
+>>>>>>> other
pCntntFrame->GetCharRect( aStartRect, *pCrsr->GetPoint(), &aState );
rContent = nWordEnd;
SwRect aEndRect;
pCntntFrame->GetCharRect( aEndRect, *pCrsr->GetPoint(),&aState );
rSelectRect = aStartRect.Union( aEndRect );
- Pop(FALSE);
+ Pop(sal_False);
}
}
}
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 045405247c90..3270ca0a0e7e 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -37,6 +37,7 @@
#include <svx/svdobj.hxx>
#include <crsrsh.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <pagefrm.hxx>
#include <cntfrm.hxx>
#include <rootfrm.hxx>
@@ -79,9 +80,9 @@ using namespace ::com::sun::star;
// zum naechsten/vorhergehenden Punkt auf gleicher Ebene
-BOOL SwCrsrShell::GotoNextNum()
+sal_Bool SwCrsrShell::GotoNextNum()
{
- BOOL bRet = GetDoc()->GotoNextNum( *pCurCrsr->GetPoint() );
+ sal_Bool bRet = GetDoc()->GotoNextNum( *pCurCrsr->GetPoint() );
if( bRet )
{
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen,
@@ -119,9 +120,9 @@ BOOL SwCrsrShell::GotoNextNum()
}
-BOOL SwCrsrShell::GotoPrevNum()
+sal_Bool SwCrsrShell::GotoPrevNum()
{
- BOOL bRet = GetDoc()->GotoPrevNum( *pCurCrsr->GetPoint() );
+ sal_Bool bRet = GetDoc()->GotoPrevNum( *pCurCrsr->GetPoint() );
if( bRet )
{
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen,
@@ -160,7 +161,7 @@ BOOL SwCrsrShell::GotoPrevNum()
// springe aus dem Content zum Header
-BOOL SwCrsrShell::GotoHeaderTxt()
+sal_Bool SwCrsrShell::GotoHeaderTxt()
{
const SwFrm* pFrm = GetCurrFrm()->FindPageFrm();
while( pFrm && !pFrm->IsHeaderFrm() )
@@ -189,7 +190,7 @@ BOOL SwCrsrShell::GotoHeaderTxt()
// springe aus dem Content zum Footer
-BOOL SwCrsrShell::GotoFooterTxt()
+sal_Bool SwCrsrShell::GotoFooterTxt()
{
const SwPageFrm* pFrm = GetCurrFrm()->FindPageFrm();
if( pFrm )
@@ -225,9 +226,9 @@ BOOL SwCrsrShell::GotoFooterTxt()
return 0 != pFrm;
}
-BOOL SwCrsrShell::SetCrsrInHdFt( USHORT nDescNo, BOOL bInHeader )
+sal_Bool SwCrsrShell::SetCrsrInHdFt( sal_uInt16 nDescNo, sal_Bool bInHeader )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
SwDoc *pMyDoc = GetDoc();
SET_CURR_SHELL( this );
@@ -237,7 +238,7 @@ BOOL SwCrsrShell::SetCrsrInHdFt( USHORT nDescNo, BOOL bInHeader )
// dann den akt. nehmen
const SwPageFrm* pPage = GetCurrFrm()->FindPageFrm();
if( pPage )
- for( USHORT i = 0; i < pMyDoc->GetPageDescCnt(); ++i )
+ for( sal_uInt16 i = 0; i < pMyDoc->GetPageDescCnt(); ++i )
if( pPage->GetPageDesc() ==
&const_cast<const SwDoc *>(pMyDoc)->GetPageDesc( i ) )
{
@@ -276,7 +277,11 @@ BOOL SwCrsrShell::SetCrsrInHdFt( USHORT nDescNo, BOOL bInHeader )
const SwFrm* pFrm;
Point aPt( pCurCrsr->GetPtPos() );
+<<<<<<< local
if( pCNd && 0 != ( pFrm = pCNd->getLayoutFrm( GetLayout(), &aPt, 0, FALSE ) ))
+=======
+ if( pCNd && 0 != ( pFrm = pCNd->GetFrm( &aPt, 0, sal_False ) ))
+>>>>>>> other
{
// dann kann der Cursor ja auch hinein gesetzt werden
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
@@ -300,13 +305,13 @@ BOOL SwCrsrShell::SetCrsrInHdFt( USHORT nDescNo, BOOL bInHeader )
// springe zum naechsten Verzeichnis
-BOOL SwCrsrShell::GotoNextTOXBase( const String* pName )
+sal_Bool SwCrsrShell::GotoNextTOXBase( const String* pName )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
const SwSectionFmts& rFmts = GetDoc()->GetSections();
SwCntntNode* pFnd = 0;
- for( USHORT n = rFmts.Count(); n; )
+ for( sal_uInt16 n = rFmts.Count(); n; )
{
const SwSection* pSect = rFmts[ --n ]->GetSection();
const SwSectionNode* pSectNd;
@@ -350,13 +355,13 @@ BOOL SwCrsrShell::GotoNextTOXBase( const String* pName )
// springe zum vorherigen Verzeichnis
-BOOL SwCrsrShell::GotoPrevTOXBase( const String* pName )
+sal_Bool SwCrsrShell::GotoPrevTOXBase( const String* pName )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
const SwSectionFmts& rFmts = GetDoc()->GetSections();
SwCntntNode* pFnd = 0;
- for( USHORT n = rFmts.Count(); n; )
+ for( sal_uInt16 n = rFmts.Count(); n; )
{
const SwSection* pSect = rFmts[ --n ]->GetSection();
const SwSectionNode* pSectNd;
@@ -400,12 +405,12 @@ BOOL SwCrsrShell::GotoPrevTOXBase( const String* pName )
// springe zum Verzeichnis vom TOXMark
-BOOL SwCrsrShell::GotoTOXMarkBase()
+sal_Bool SwCrsrShell::GotoTOXMarkBase()
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
SwTOXMarks aMarks;
- USHORT nCnt = GetDoc()->GetCurTOXMark( *pCurCrsr->GetPoint(), aMarks );
+ sal_uInt16 nCnt = GetDoc()->GetCurTOXMark( *pCurCrsr->GetPoint(), aMarks );
if( nCnt )
{
// dann nehme den 1. und hole den Verzeichnis-Typ.
@@ -451,12 +456,12 @@ BOOL SwCrsrShell::GotoTOXMarkBase()
// springe zur naechsten (vorherigen) Tabellenformel
// optional auch nur zu kaputten Formeln springen
-BOOL SwCrsrShell::GotoNxtPrvTblFormula( BOOL bNext, BOOL bOnlyErrors )
+sal_Bool SwCrsrShell::GotoNxtPrvTblFormula( sal_Bool bNext, sal_Bool bOnlyErrors )
{
if( IsTableMode() )
- return FALSE;
+ return sal_False;
- BOOL bFnd = FALSE;
+ sal_Bool bFnd = sal_False;
SwPosition& rPos = *pCurCrsr->GetPoint();
Point aPt;
@@ -478,8 +483,13 @@ BOOL SwCrsrShell::GotoNxtPrvTblFormula( BOOL bNext, BOOL bOnlyErrors )
if( rPos.nNode < GetDoc()->GetNodes().GetEndOfExtras() )
// auch beim Einsammeln wird nur der erste Frame benutzt!
+<<<<<<< local
aCurGEF.SetBodyPos( *rPos.nNode.GetNode().GetCntntNode()->getLayoutFrm( GetLayout(),
&aPt, &rPos, FALSE ) );
+=======
+ aCurGEF.SetBodyPos( *rPos.nNode.GetNode().GetCntntNode()->GetFrm(
+ &aPt, &rPos, sal_False ) );
+>>>>>>> other
{
const SfxPoolItem* pItem;
@@ -498,7 +508,11 @@ BOOL SwCrsrShell::GotoNxtPrvTblFormula( BOOL bNext, BOOL bOnlyErrors )
const SwCntntFrm* pCFrm;
SwNodeIndex aIdx( *pTBox->GetSttNd() );
const SwCntntNode* pCNd = GetDoc()->GetNodes().GoNext( &aIdx );
+<<<<<<< local
if( pCNd && 0 != ( pCFrm = pCNd->getLayoutFrm( GetLayout(), &aPt, 0, FALSE ) ) &&
+=======
+ if( pCNd && 0 != ( pCFrm = pCNd->GetFrm( &aPt, 0, sal_False ) ) &&
+>>>>>>> other
(IsReadOnlyAvailable() || !pCFrm->IsProtected() ))
{
_SetGetExpFld aCmp( *pTBox );
@@ -508,7 +522,7 @@ BOOL SwCrsrShell::GotoNxtPrvTblFormula( BOOL bNext, BOOL bOnlyErrors )
: ( aCmp < aCurGEF && aFndGEF < aCmp ))
{
aFndGEF = aCmp;
- bFnd = TRUE;
+ bFnd = sal_True;
}
}
}
@@ -532,12 +546,12 @@ BOOL SwCrsrShell::GotoNxtPrvTblFormula( BOOL bNext, BOOL bOnlyErrors )
}
// springe zum naechsten (vorherigen) Verzeichniseintrag
-BOOL SwCrsrShell::GotoNxtPrvTOXMark( BOOL bNext )
+sal_Bool SwCrsrShell::GotoNxtPrvTOXMark( sal_Bool bNext )
{
if( IsTableMode() )
- return FALSE;
+ return sal_False;
- BOOL bFnd = FALSE;
+ sal_Bool bFnd = sal_False;
SwPosition& rPos = *pCurCrsr->GetPoint();
Point aPt;
@@ -549,7 +563,11 @@ BOOL SwCrsrShell::GotoNxtPrvTOXMark( BOOL bNext )
if( rPos.nNode.GetIndex() < GetDoc()->GetNodes().GetEndOfExtras().GetIndex() )
// auch beim Einsammeln wird nur der erste Frame benutzt!
aCurGEF.SetBodyPos( *rPos.nNode.GetNode().
+<<<<<<< local
GetCntntNode()->getLayoutFrm( GetLayout(), &aPt, &rPos, FALSE ) );
+=======
+ GetCntntNode()->GetFrm( &aPt, &rPos, sal_False ) );
+>>>>>>> other
{
const SfxPoolItem* pItem;
@@ -563,7 +581,11 @@ BOOL SwCrsrShell::GotoNxtPrvTOXMark( BOOL bNext )
RES_TXTATR_TOXMARK, n ) ) &&
0 != (pTxtTOX = ((SwTOXMark*)pItem)->GetTxtTOXMark() ) &&
( pTxtNd = &pTxtTOX->GetTxtNode())->GetNodes().IsDocNodes() &&
+<<<<<<< local
0 != ( pCFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt, 0, FALSE )) &&
+=======
+ 0 != ( pCFrm = pTxtNd->GetFrm( &aPt, 0, sal_False )) &&
+>>>>>>> other
( IsReadOnlyAvailable() || !pCFrm->IsProtected() ))
{
SwNodeIndex aNdIndex( *pTxtNd ); // UNIX benoetigt dieses Obj.
@@ -574,7 +596,7 @@ BOOL SwCrsrShell::GotoNxtPrvTOXMark( BOOL bNext )
: ( aCmp < aCurGEF && aFndGEF < aCmp ))
{
aFndGEF = aCmp;
- bFnd = TRUE;
+ bFnd = sal_True;
}
}
}
@@ -624,16 +646,23 @@ const SwTOXMark& SwCrsrShell::GotoTOXMark( const SwTOXMark& rStart,
// springe zum naechsten / vorherigen FeldTypen
void lcl_MakeFldLst( _SetGetExpFlds& rLst, const SwFieldType& rFldType,
- USHORT nSubType, BOOL bInReadOnly,
- BOOL bChkInpFlag = FALSE )
+ sal_uInt16 nSubType, sal_Bool bInReadOnly,
+ sal_Bool bChkInpFlag = sal_False )
{
// es muss immer der 1. Frame gesucht werden
Point aPt;
SwTxtFld* pTxtFld;
+<<<<<<< local
SwIterator<SwFmtFld,SwFieldType> aIter(rFldType);
BOOL bSubType = nSubType != USHRT_MAX;
for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() )
if( 0 != ( pTxtFld = pFmtFld->GetTxtFld() ) &&
+=======
+ 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() ) &&
+>>>>>>> other
( !bChkInpFlag || ((SwSetExpField*)pTxtFld->GetFld().GetFld())
->GetInputFlag() ) &&
(!bSubType || (pFmtFld->GetFld()->GetSubType()
@@ -641,7 +670,11 @@ void lcl_MakeFldLst( _SetGetExpFlds& rLst, const SwFieldType& rFldType,
{
SwCntntFrm* pCFrm;
const SwTxtNode& rTxtNode = pTxtFld->GetTxtNode();
+<<<<<<< local
if( 0 != ( pCFrm = rTxtNode.getLayoutFrm( rTxtNode.GetDoc()->GetCurrentLayout(), &aPt, 0, FALSE )) &&
+=======
+ if( 0 != ( pCFrm = rTxtNode.GetFrm( &aPt, 0, sal_False )) &&
+>>>>>>> other
( bInReadOnly || !pCFrm->IsProtected() ))
{
_SetGetExpFld* pNew = new _SetGetExpFld(
@@ -653,8 +686,8 @@ void lcl_MakeFldLst( _SetGetExpFlds& rLst, const SwFieldType& rFldType,
}
-BOOL SwCrsrShell::MoveFldType( const SwFieldType* pFldType, BOOL bNext,
- USHORT nSubType, USHORT nResType )
+sal_Bool SwCrsrShell::MoveFldType( const SwFieldType* pFldType, sal_Bool bNext,
+ sal_uInt16 nSubType, sal_uInt16 nResType )
{
// sortierte Liste aller Felder
_SetGetExpFlds aSrtLst( 64 );
@@ -662,7 +695,7 @@ BOOL SwCrsrShell::MoveFldType( const SwFieldType* pFldType, BOOL bNext,
if (pFldType)
{
if( RES_INPUTFLD != pFldType->Which() && !pFldType->GetDepends() )
- return FALSE;
+ return sal_False;
// Modify-Object gefunden, trage alle Felder ins Array ein
::lcl_MakeFldLst( aSrtLst, *pFldType, nSubType, IsReadOnlyAvailable() );
@@ -671,22 +704,22 @@ BOOL SwCrsrShell::MoveFldType( const SwFieldType* pFldType, BOOL bNext,
{
// es gibt noch versteckte InputFelder in den SetExp. Feldern
const SwFldTypes& rFldTypes = *pDoc->GetFldTypes();
- const USHORT nSize = rFldTypes.Count();
+ const sal_uInt16 nSize = rFldTypes.Count();
// Alle Typen abklappern
- for( USHORT i=0; i < nSize; ++i )
+ for( sal_uInt16 i=0; i < nSize; ++i )
if( RES_SETEXPFLD == ( pFldType = rFldTypes[ i ] )->Which() )
::lcl_MakeFldLst( aSrtLst, *pFldType, nSubType,
- IsReadOnlyAvailable(), TRUE );
+ IsReadOnlyAvailable(), sal_True );
}
}
else
{
const SwFldTypes& rFldTypes = *pDoc->GetFldTypes();
- const USHORT nSize = rFldTypes.Count();
+ const sal_uInt16 nSize = rFldTypes.Count();
// Alle Typen abklappern
- for( USHORT i=0; i < nSize; ++i )
+ for( sal_uInt16 i=0; i < nSize; ++i )
if( nResType == ( pFldType = rFldTypes[ i ] )->Which() )
::lcl_MakeFldLst( aSrtLst, *pFldType, nSubType,
IsReadOnlyAvailable() );
@@ -694,9 +727,9 @@ BOOL SwCrsrShell::MoveFldType( const SwFieldType* pFldType, BOOL bNext,
// keine Felder gefunden?
if( !aSrtLst.Count() )
- return FALSE;
+ return sal_False;
- USHORT nPos;
+ sal_uInt16 nPos;
SwCursor* pCrsr = getShellCrsr( true );
{
// JP 19.08.98: es muss immer ueber das Feld gesucht werden, damit
@@ -711,7 +744,7 @@ BOOL SwCrsrShell::MoveFldType( const SwFieldType* pFldType, BOOL bNext,
SwTxtFld * pTxtFld = static_cast<SwTxtFld *>(
pTNd->GetTxtAttrForCharAt(rPos.nContent.GetIndex(),
RES_TXTATR_FIELD));
- BOOL bDelFld = 0 == pTxtFld;
+ sal_Bool bDelFld = 0 == pTxtFld;
if( bDelFld )
{
SwFmtFld* pFmtFld = new SwFmtFld( SwDateTimeField(
@@ -726,10 +759,14 @@ BOOL SwCrsrShell::MoveFldType( const SwFieldType* pFldType, BOOL bNext,
{
// auch beim Einsammeln wird nur der erste Frame benutzt!
Point aPt;
+<<<<<<< local
aSrch.SetBodyPos( *pTNd->getLayoutFrm( GetLayout(), &aPt, &rPos, FALSE ) );
+=======
+ aSrch.SetBodyPos( *pTNd->GetFrm( &aPt, &rPos, sal_False ) );
+>>>>>>> other
}
- BOOL bFound = aSrtLst.Seek_Entry( &aSrch, &nPos );
+ sal_Bool bFound = aSrtLst.Seek_Entry( &aSrch, &nPos );
if( bDelFld )
{
delete (SwFmtFld*)&pTxtFld->GetAttr();
@@ -741,13 +778,13 @@ BOOL SwCrsrShell::MoveFldType( const SwFieldType* pFldType, BOOL bNext,
if( bNext )
{
if( ++nPos >= aSrtLst.Count() )
- return FALSE; // schon am Ende
+ return sal_False; // schon am Ende
}
else if( !nPos-- )
- return FALSE; // weiter nach vorne geht nicht
+ return sal_False; // weiter nach vorne geht nicht
}
else if( bNext ? nPos >= aSrtLst.Count() : !nPos--)
- return FALSE;
+ return sal_False;
}
const _SetGetExpFld& rFnd = **( aSrtLst.GetData() + nPos );
@@ -757,7 +794,7 @@ BOOL SwCrsrShell::MoveFldType( const SwFieldType* pFldType, BOOL bNext,
SwCrsrSaveState aSaveState( *pCrsr );
rFnd.GetPosOfContent( *pCrsr->GetPoint() );
- BOOL bRet = !pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
+ sal_Bool bRet = !pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
nsSwCursorSelOverFlags::SELOVER_TOGGLE );
if( bRet )
UpdateCrsr(SwCrsrShell::SCROLLWIN|SwCrsrShell::CHKRANGE|SwCrsrShell::READONLY);
@@ -765,9 +802,9 @@ BOOL SwCrsrShell::MoveFldType( const SwFieldType* pFldType, BOOL bNext,
}
-BOOL SwCrsrShell::GotoFld( const SwFmtFld& rFld )
+sal_Bool SwCrsrShell::GotoFld( const SwFmtFld& rFld )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( rFld.GetTxtFld() )
{
SET_CURR_SHELL( this );
@@ -788,7 +825,7 @@ BOOL SwCrsrShell::GotoFld( const SwFmtFld& rFld )
}
-void SwCrsrShell::GotoOutline( USHORT nIdx )
+void SwCrsrShell::GotoOutline( sal_uInt16 nIdx )
{
SwCursor* pCrsr = getShellCrsr( true );
@@ -806,7 +843,7 @@ void SwCrsrShell::GotoOutline( USHORT nIdx )
}
-BOOL SwCrsrShell::GotoOutline( const String& rName )
+sal_Bool SwCrsrShell::GotoOutline( const String& rName )
{
SwCursor* pCrsr = getShellCrsr( true );
@@ -814,29 +851,29 @@ BOOL SwCrsrShell::GotoOutline( const String& rName )
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
SwCrsrSaveState aSaveState( *pCrsr );
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pDoc->GotoOutline( *pCrsr->GetPoint(), rName ) && !pCrsr->IsSelOvr() )
{
UpdateCrsr(SwCrsrShell::SCROLLWIN|SwCrsrShell::CHKRANGE|SwCrsrShell::READONLY);
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
}
-BOOL SwCrsrShell::GotoNextOutline() // naechster Node mit Outline-Num.
+sal_Bool SwCrsrShell::GotoNextOutline() // naechster Node mit Outline-Num.
{
SwCursor* pCrsr = getShellCrsr( true );
const SwNodes& rNds = GetDoc()->GetNodes();
SwNode* pNd = pCrsr->GetNode();
- USHORT nPos;
+ sal_uInt16 nPos;
if( rNds.GetOutLineNds().Seek_Entry( pNd, &nPos ))
++nPos;
if( nPos == rNds.GetOutLineNds().Count() )
- return FALSE;
+ return sal_False;
pNd = rNds.GetOutLineNds()[ nPos ];
@@ -846,30 +883,30 @@ BOOL SwCrsrShell::GotoNextOutline() // naechster Node mit Outline-Num.
pCrsr->GetPoint()->nNode = *pNd;
pCrsr->GetPoint()->nContent.Assign( (SwTxtNode*)pNd, 0 );
- BOOL bRet = !pCrsr->IsSelOvr();
+ sal_Bool bRet = !pCrsr->IsSelOvr();
if( bRet )
UpdateCrsr(SwCrsrShell::SCROLLWIN|SwCrsrShell::CHKRANGE|SwCrsrShell::READONLY);
return bRet;
}
-BOOL SwCrsrShell::GotoPrevOutline() // vorheriger Node mit Outline-Num.
+sal_Bool SwCrsrShell::GotoPrevOutline() // vorheriger Node mit Outline-Num.
{
SwCursor* pCrsr = getShellCrsr( true );
const SwNodes& rNds = GetDoc()->GetNodes();
SwNode* pNd = pCrsr->GetNode();
- USHORT nPos;
+ sal_uInt16 nPos;
rNds.GetOutLineNds().Seek_Entry( pNd, &nPos );
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( nPos )
{
--nPos; // davor
pNd = rNds.GetOutLineNds()[ nPos ];
if( pNd->GetIndex() > pCrsr->GetPoint()->nNode.GetIndex() )
- return FALSE;
+ return sal_False;
SET_CURR_SHELL( this );
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
@@ -887,13 +924,13 @@ BOOL SwCrsrShell::GotoPrevOutline() // vorheriger Node mit Outline-Num.
// suche die "Outline-Position" vom vorherigen Outline-Node mit dem
// Level.
-USHORT SwCrsrShell::GetOutlinePos( BYTE nLevel )
+sal_uInt16 SwCrsrShell::GetOutlinePos( sal_uInt8 nLevel )
{
SwPaM* pCrsr = getShellCrsr( true );
const SwNodes& rNds = GetDoc()->GetNodes();
SwNode* pNd = pCrsr->GetNode();
- USHORT nPos;
+ sal_uInt16 nPos;
if( rNds.GetOutLineNds().Seek_Entry( pNd, &nPos ))
nPos++; // steht auf der Position, fuers while zum Naechsten
@@ -910,13 +947,13 @@ USHORT SwCrsrShell::GetOutlinePos( BYTE nLevel )
}
-BOOL SwCrsrShell::MakeOutlineSel( USHORT nSttPos, USHORT nEndPos,
- BOOL bWithChilds )
+sal_Bool SwCrsrShell::MakeOutlineSel( sal_uInt16 nSttPos, sal_uInt16 nEndPos,
+ sal_Bool bWithChilds )
{
const SwNodes& rNds = GetDoc()->GetNodes();
const SwOutlineNodes& rOutlNds = rNds.GetOutLineNds();
if( !rOutlNds.Count() ) // wie jetzt ???
- return FALSE;
+ return sal_False;
SET_CURR_SHELL( this );
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
@@ -924,7 +961,7 @@ BOOL SwCrsrShell::MakeOutlineSel( USHORT nSttPos, USHORT nEndPos,
if( nSttPos > nEndPos ) // sollte jemand das vertauscht haben?
{
ASSERT( !this, "Start- > Ende-Position im Array" );
- USHORT nTmp = nSttPos;
+ sal_uInt16 nTmp = nSttPos;
nSttPos = nEndPos;
nEndPos = nTmp;
}
@@ -934,12 +971,12 @@ BOOL SwCrsrShell::MakeOutlineSel( USHORT nSttPos, USHORT nEndPos,
if( bWithChilds )
{
- //BYTE nLevel = pEndNd->GetTxtNode()->GetTxtColl()->GetOutlineLevel();//#outline level,zhaojianwei
+ //sal_uInt8 nLevel = pEndNd->GetTxtNode()->GetTxtColl()->GetOutlineLevel();//#outline level,zhaojianwei
const int nLevel = pEndNd->GetTxtNode()->GetAttrOutlineLevel()-1;//<-end.zhaojianwei
for( ++nEndPos; nEndPos < rOutlNds.Count(); ++nEndPos )
{
pEndNd = rOutlNds[ nEndPos ];
- //BYTE nNxtLevel = pEndNd->GetTxtNode()->GetTxtColl()->GetOutlineLevel();//#outline level,zhaojianwei
+ //sal_uInt8 nNxtLevel = pEndNd->GetTxtNode()->GetTxtColl()->GetOutlineLevel();//#outline level,zhaojianwei
const int nNxtLevel = pEndNd->GetTxtNode()->GetAttrOutlineLevel()-1;//<-end,zhaojianwei
if( nNxtLevel <= nLevel )
break; // EndPos steht jetzt auf dem naechsten
@@ -964,7 +1001,7 @@ BOOL SwCrsrShell::MakeOutlineSel( USHORT nSttPos, USHORT nEndPos,
pCurCrsr->Move( fnMoveBackward, fnGoNode ); // ans Ende vom Vorgaenger
// und schon ist alles selektiert
- BOOL bRet = !pCurCrsr->IsSelOvr();
+ sal_Bool bRet = !pCurCrsr->IsSelOvr();
if( bRet )
UpdateCrsr(SwCrsrShell::SCROLLWIN|SwCrsrShell::CHKRANGE|SwCrsrShell::READONLY);
return bRet;
@@ -972,14 +1009,14 @@ BOOL SwCrsrShell::MakeOutlineSel( USHORT nSttPos, USHORT nEndPos,
// springe zu dieser Refmark
-BOOL SwCrsrShell::GotoRefMark( const String& rRefMark, USHORT nSubType,
- USHORT nSeqNo )
+sal_Bool SwCrsrShell::GotoRefMark( const String& rRefMark, sal_uInt16 nSubType,
+ sal_uInt16 nSeqNo )
{
SET_CURR_SHELL( this );
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
SwCrsrSaveState aSaveState( *pCurCrsr );
- USHORT nPos;
+ sal_uInt16 nPos;
SwTxtNode* pTxtNd = SwGetRefFieldType::FindAnchor( GetDoc(), rRefMark,
nSubType, nSeqNo, &nPos );
if( pTxtNd && pTxtNd->GetNodes().IsDocNodes() )
@@ -990,26 +1027,26 @@ BOOL SwCrsrShell::GotoRefMark( const String& rRefMark, USHORT nSubType,
if( !pCurCrsr->IsSelOvr() )
{
UpdateCrsr(SwCrsrShell::SCROLLWIN|SwCrsrShell::CHKRANGE|SwCrsrShell::READONLY);
- return TRUE;
+ return sal_True;
}
}
- return FALSE;
+ return sal_False;
}
-BOOL SwCrsrShell::IsPageAtPos( const Point &rPt ) const
+sal_Bool SwCrsrShell::IsPageAtPos( const Point &rPt ) const
{
if( GetLayout() )
return 0 != GetLayout()->GetPageAtPos( rPt );
- return FALSE;
+ return sal_False;
}
-BOOL SwCrsrShell::GetContentAtPos( const Point& rPt,
+sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
SwContentAtPos& rCntntAtPos,
- BOOL bSetCrsr,
+ sal_Bool bSetCrsr,
SwRect* pFldRect )
{
SET_CURR_SHELL( this );
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( !IsTableMode() )
{
@@ -1020,16 +1057,16 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt,
SwCntntFrm *pFrm(0);
SwTxtAttr* pTxtAttr;
SwCrsrMoveState aTmpState;
- aTmpState.bFieldInfo = TRUE;
+ aTmpState.bFieldInfo = sal_True;
aTmpState.bExactOnly = !( SwContentAtPos::SW_OUTLINE & rCntntAtPos.eCntntAtPos );
- aTmpState.bCntntCheck = (SwContentAtPos::SW_CONTENT_CHECK & rCntntAtPos.eCntntAtPos) ? TRUE : FALSE;
+ aTmpState.bCntntCheck = (SwContentAtPos::SW_CONTENT_CHECK & rCntntAtPos.eCntntAtPos) ? sal_True : sal_False;
aTmpState.bSetInReadOnly = IsReadOnlyAvailable();
SwSpecialPos aSpecialPos;
aTmpState.pSpecialPos = ( SwContentAtPos::SW_SMARTTAG & rCntntAtPos.eCntntAtPos ) ?
&aSpecialPos : 0;
- const BOOL bCrsrFoundExact = GetLayout()->GetCrsrOfst( &aPos, aPt, &aTmpState );
+ const sal_Bool bCrsrFoundExact = GetLayout()->GetCrsrOfst( &aPos, aPt, &aTmpState );
pTxtNd = aPos.nNode.GetNode().GetTxtNode();
const SwNodes& rNds = GetDoc()->GetNodes();
@@ -1041,14 +1078,14 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt,
{
rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_OUTLINE;
rCntntAtPos.sStr = pONd->GetExpandTxt( 0, STRING_LEN, true );
- bRet = TRUE;
+ bRet = sal_True;
}
}
// --> FME 2005-05-13 #i43742# New function: SW_CONTENT_CHECK
else if ( SwContentAtPos::SW_CONTENT_CHECK & rCntntAtPos.eCntntAtPos &&
bCrsrFoundExact )
{
- bRet = TRUE;
+ bRet = sal_True;
}
// <--
// #i23726#
@@ -1076,17 +1113,17 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt,
if ( pSmartTagList && pSmartTagList->InWrongWord( nCurrent, nLen ) && !pTxtNd->IsSymbol(nBegin) )
{
- const USHORT nIndex = pSmartTagList->GetWrongPos( nBegin );
+ const sal_uInt16 nIndex = pSmartTagList->GetWrongPos( nBegin );
const SwWrongList* pSubList = pSmartTagList->SubList( nIndex );
if ( pSubList )
{
nCurrent = aTmpState.pSpecialPos->nCharOfst;
if ( pSubList->InWrongWord( nCurrent, nLen ) )
- bRet = TRUE;
+ bRet = sal_True;
}
else
- bRet = TRUE;
+ bRet = sal_True;
if( bRet && bSetCrsr )
{
@@ -1096,7 +1133,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt,
*pCurCrsr->GetPoint() = aPos;
if( pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
nsSwCursorSelOverFlags::SELOVER_TOGGLE) )
- bRet = FALSE;
+ bRet = sal_False;
else
UpdateCrsr();
}
@@ -1105,7 +1142,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt,
// rCntntAtPos.sStr = pTxtNd->GetExpandTxt(
// *pTxtAttr->GetStart(),
// *pTxtAttr->GetEnd() - *pTxtAttr->GetStart(),
-// FALSE );
+// sal_False );
// rCntntAtPos.aFnd.pAttr = &pTxtAttr->GetAttr();
rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_SMARTTAG;
@@ -1167,7 +1204,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt,
rCntntAtPos.aFnd.pFld = pFld;
rCntntAtPos.pFndTxtAttr = pTxtAttr;
rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_FIELD;
- bRet = TRUE;
+ bRet = sal_True;
}
}
@@ -1178,7 +1215,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt,
if( bCrsrFoundExact && pTxtNd && pFldBookmark) {
rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_FORMCTRL;
rCntntAtPos.aFnd.pFldmark = pFldBookmark;
- bRet=TRUE;
+ bRet=sal_True;
}
}
@@ -1187,12 +1224,12 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt,
if( aTmpState.bFtnNoInfo )
{
// stehe ueber dem Zeichen der Fussnote (??)
- bRet = TRUE;
+ bRet = sal_True;
if( bSetCrsr )
{
*pCurCrsr->GetPoint() = aPos;
if( !GotoFtnAnchor() )
- bRet = FALSE;
+ bRet = sal_False;
}
if( bRet )
rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_FTN;
@@ -1200,7 +1237,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt,
else if ( 0 != ( pTxtAttr = pTxtNd->GetTxtAttrForCharAt(
aPos.nContent.GetIndex(), RES_TXTATR_FTN )) )
{
- bRet = TRUE;
+ bRet = sal_True;
if( bSetCrsr )
{
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen,
@@ -1208,19 +1245,19 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt,
pCurCrsr->GetPoint()->nNode = *((SwTxtFtn*)pTxtAttr)->GetStartNode();
SwCntntNode* pCNd = GetDoc()->GetNodes().GoNextSection(
&pCurCrsr->GetPoint()->nNode,
- TRUE, !IsReadOnlyAvailable() );
+ sal_True, !IsReadOnlyAvailable() );
if( pCNd )
{
pCurCrsr->GetPoint()->nContent.Assign( pCNd, 0 );
if( pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
nsSwCursorSelOverFlags::SELOVER_TOGGLE ))
- bRet = FALSE;
+ bRet = sal_False;
else
UpdateCrsr();
}
else
- bRet = FALSE;
+ bRet = sal_False;
}
if( bRet )
@@ -1265,7 +1302,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt,
if( pTxtAttr )
{
- bRet = TRUE;
+ bRet = sal_True;
if( bSetCrsr )
{
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen,
@@ -1274,7 +1311,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt,
*pCurCrsr->GetPoint() = aPos;
if( pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
nsSwCursorSelOverFlags::SELOVER_TOGGLE ) )
- bRet = FALSE;
+ bRet = sal_False;
else
UpdateCrsr();
}
@@ -1311,7 +1348,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt,
// nur INetAttrs mit URLs "erkennen"
if( pTxtAttr && pTxtAttr->GetINetFmt().GetValue().Len() )
{
- bRet = TRUE;
+ bRet = sal_True;
if( bSetCrsr )
{
SwCrsrSaveState aSaveState( *pCurCrsr );
@@ -1320,7 +1357,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt,
*pCurCrsr->GetPoint() = aPos;
if( pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
nsSwCursorSelOverFlags::SELOVER_TOGGLE) )
- bRet = FALSE;
+ bRet = sal_False;
else
UpdateCrsr();
}
@@ -1348,7 +1385,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt,
rCntntAtPos.aFnd.pRedl = pRedl;
rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_REDLINE;
rCntntAtPos.pFndTxtAttr = 0;
- bRet = TRUE;
+ bRet = sal_True;
if( pFldRect && 0 != ( pFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt ) ) )
pFrm->GetCharRect( *pFldRect, aPos, &aTmpState );
@@ -1372,12 +1409,12 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt,
pSttNd->GetIndex() )) &&
#ifdef DBG_UTIL
( SFX_ITEM_SET == pBox->GetFrmFmt()->GetItemState(
- RES_BOXATR_FORMULA, FALSE, &pItem ) ||
+ RES_BOXATR_FORMULA, sal_False, &pItem ) ||
SFX_ITEM_SET == pBox->GetFrmFmt()->GetItemState(
- RES_BOXATR_VALUE, FALSE, &pItem ))
+ RES_BOXATR_VALUE, sal_False, &pItem ))
#else
SFX_ITEM_SET == pBox->GetFrmFmt()->GetItemState(
- RES_BOXATR_FORMULA, FALSE, &pItem )
+ RES_BOXATR_FORMULA, sal_False, &pItem )
#endif
)
{
@@ -1411,7 +1448,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt,
#endif
((SwTblBoxFormula*)pItem)->PtrToBoxNm( &pTblNd->GetTable() );
- bRet = TRUE;
+ bRet = sal_True;
if( bSetCrsr )
{
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen,
@@ -1419,7 +1456,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt,
*pCurCrsr->GetPoint() = aPos;
if( pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
nsSwCursorSelOverFlags::SELOVER_TOGGLE) )
- bRet = FALSE;
+ bRet = sal_False;
else
UpdateCrsr();
}
@@ -1446,7 +1483,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt,
POOLATTR_END - 1 );
if( pTxtNd->GetpSwpHints() )
{
- for( USHORT i = 0; i < pTxtNd->GetSwpHints().Count(); ++i )
+ for( sal_uInt16 i = 0; i < pTxtNd->GetSwpHints().Count(); ++i )
{
const SwTxtAttr* pHt = pTxtNd->GetSwpHints()[i];
xub_StrLen nAttrStart = *pHt->GetStart();
@@ -1495,7 +1532,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt,
String sAttrs;
SfxItemIter aIter( aSet );
const SfxPoolItem* pItem = aIter.FirstItem();
- while( TRUE )
+ while( sal_True )
{
if( !IsInvalidItem( pItem ))
{
@@ -1521,7 +1558,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt,
+= sAttrs;
}
}
- bRet = TRUE;
+ bRet = sal_True;
rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_CURR_ATTRS;
}
#endif
@@ -1562,7 +1599,7 @@ const SwPostItField* SwCrsrShell::GetPostItFieldAtCursor() const
// <--
// befindet sich der Node in einem geschuetzten Bereich?
-BOOL SwContentAtPos::IsInProtectSect() const
+sal_Bool SwContentAtPos::IsInProtectSect() const
{
const SwTxtNode* pNd = 0;
if( pFndTxtAttr )
@@ -1589,7 +1626,11 @@ BOOL SwContentAtPos::IsInProtectSect() const
const SwCntntFrm* pFrm;
return pNd && ( pNd->IsInProtectSect() ||
+<<<<<<< local
( 0 != ( pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), 0,0,FALSE)) &&
+=======
+ ( 0 != ( pFrm = pNd->GetFrm(0,0,sal_False)) &&
+>>>>>>> other
pFrm->IsProtected() ));
}
bool SwContentAtPos::IsInRTLText()const
@@ -1626,11 +1667,11 @@ bool SwContentAtPos::IsInRTLText()const
return bRet;
}
-BOOL SwCrsrShell::SelectTxtAttr( USHORT nWhich, BOOL bExpand,
+sal_Bool SwCrsrShell::SelectTxtAttr( sal_uInt16 nWhich, sal_Bool bExpand,
const SwTxtAttr* pTxtAttr )
{
SET_CURR_SHELL( this );
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( !IsTableMode() )
{
@@ -1659,7 +1700,7 @@ BOOL SwCrsrShell::SelectTxtAttr( USHORT nWhich, BOOL bExpand,
if( !pCurCrsr->IsSelOvr() )
{
UpdateCrsr();
- bRet = TRUE;
+ bRet = sal_True;
}
}
}
@@ -1667,9 +1708,9 @@ BOOL SwCrsrShell::SelectTxtAttr( USHORT nWhich, BOOL bExpand,
}
-BOOL SwCrsrShell::GotoINetAttr( const SwTxtINetFmt& rAttr )
+sal_Bool SwCrsrShell::GotoINetAttr( const SwTxtINetFmt& rAttr )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( rAttr.GetpTxtNode() )
{
SwCursor* pCrsr = getShellCrsr( true );
@@ -1694,14 +1735,15 @@ const SwFmtINetFmt* SwCrsrShell::FindINetAttr( const String& rName ) const
return pDoc->FindINetAttr( rName );
}
-BOOL SwCrsrShell::GetShadowCrsrPos( const Point& rPt, SwFillMode eFillMode,
+sal_Bool SwCrsrShell::GetShadowCrsrPos( const Point& rPt, SwFillMode eFillMode,
SwRect& rRect, sal_Int16& rOrient )
{
SET_CURR_SHELL( this );
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
- if( !IsTableMode() && !HasSelection() && GetDoc()->DoesUndo() )
+ if (!IsTableMode() && !HasSelection()
+ && GetDoc()->GetIDocumentUndoRedo().DoesUndo())
{
Point aPt( rPt );
SwPosition aPos( *pCurCrsr->GetPoint() );
@@ -1715,18 +1757,19 @@ BOOL SwCrsrShell::GetShadowCrsrPos( const Point& rPt, SwFillMode eFillMode,
// Start-Position im geschuetzten Bereich?
rRect = aFPos.aCrsr;
rOrient = aFPos.eOrient;
- bRet = TRUE;
+ bRet = sal_True;
}
}
return bRet;
}
-BOOL SwCrsrShell::SetShadowCrsrPos( const Point& rPt, SwFillMode eFillMode )
+sal_Bool SwCrsrShell::SetShadowCrsrPos( const Point& rPt, SwFillMode eFillMode )
{
SET_CURR_SHELL( this );
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
- if( !IsTableMode() && !HasSelection() && GetDoc()->DoesUndo() )
+ if (!IsTableMode() && !HasSelection()
+ && GetDoc()->GetIDocumentUndoRedo().DoesUndo())
{
Point aPt( rPt );
SwPosition aPos( *pCurCrsr->GetPoint() );
@@ -1750,7 +1793,7 @@ BOOL SwCrsrShell::SetShadowCrsrPos( const Point& rPt, SwFillMode eFillMode )
pCNd && pCNd->Len() )
nUndoId = UNDO_EMPTY;
- GetDoc()->StartUndo( nUndoId, NULL );
+ GetDoc()->GetIDocumentUndoRedo().StartUndo( nUndoId, NULL );
SwTxtFmtColl* pNextFmt = 0;
SwTxtNode* pTNd = pCNd->GetTxtNode();
@@ -1771,7 +1814,7 @@ BOOL SwCrsrShell::SetShadowCrsrPos( const Point& rPt, SwFillMode eFillMode )
aPos.nNode = *pSectNd->EndOfSectionNode();
}
- for( USHORT n = 0; n < aFPos.nParaCnt + aFPos.nColumnCnt; ++n )
+ for( sal_uInt16 n = 0; n < aFPos.nParaCnt + aFPos.nColumnCnt; ++n )
{
GetDoc()->AppendTxtNode( aPos );
if( !n && pNextFmt )
@@ -1856,10 +1899,10 @@ BOOL SwCrsrShell::SetShadowCrsrPos( const Point& rPt, SwFillMode eFillMode )
break;
}
- GetDoc()->EndUndo( nUndoId, NULL );
+ GetDoc()->GetIDocumentUndoRedo().EndUndo( nUndoId, NULL );
EndAction();
- bRet = TRUE;
+ bRet = sal_True;
}
}
return bRet;
@@ -1901,7 +1944,7 @@ const SwRedline* SwCrsrShell::SelPrevRedline()
return pFnd;
}
-const SwRedline* SwCrsrShell::_GotoRedline( USHORT nArrPos, BOOL bSelect )
+const SwRedline* SwCrsrShell::_GotoRedline( sal_uInt16 nArrPos, sal_Bool bSelect )
{
const SwRedline* pFnd = 0;
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
@@ -1916,7 +1959,7 @@ const SwRedline* SwCrsrShell::_GotoRedline( USHORT nArrPos, BOOL bSelect )
SwNodeIndex* pIdx = &pCurCrsr->GetPoint()->nNode;
if( !pIdx->GetNode().IsCntntNode() &&
0 != ( pCNd = GetDoc()->GetNodes().GoNextSection( pIdx,
- TRUE, IsReadOnlyAvailable() )) )
+ sal_True, IsReadOnlyAvailable() )) )
{
if( *pIdx <= pFnd->End()->nNode )
pCurCrsr->GetPoint()->nContent.Assign( pCNd, 0 );
@@ -1939,7 +1982,7 @@ const SwRedline* SwCrsrShell::_GotoRedline( USHORT nArrPos, BOOL bSelect )
pIdx = &pCurCrsr->GetPoint()->nNode;
if( !pIdx->GetNode().IsCntntNode() &&
0 != ( pCNd = GetDoc()->GetNodes().GoPrevSection( pIdx,
- TRUE, IsReadOnlyAvailable() )) )
+ sal_True, IsReadOnlyAvailable() )) )
{
if( *pIdx >= pCurCrsr->GetMark()->nNode )
pCurCrsr->GetPoint()->nContent.Assign( pCNd, pCNd->Len() );
@@ -1969,7 +2012,7 @@ const SwRedline* SwCrsrShell::_GotoRedline( USHORT nArrPos, BOOL bSelect )
return pFnd;
}
-const SwRedline* SwCrsrShell::GotoRedline( USHORT nArrPos, BOOL bSelect )
+const SwRedline* SwCrsrShell::GotoRedline( sal_uInt16 nArrPos, sal_Bool bSelect )
{
const SwRedline* pFnd = 0;
if( !IsTableMode() )
@@ -1978,15 +2021,15 @@ const SwRedline* SwCrsrShell::GotoRedline( USHORT nArrPos, BOOL bSelect )
const SwRedlineTbl& rTbl = GetDoc()->GetRedlineTbl();
const SwRedline* pTmp = rTbl[ nArrPos ];
- USHORT nSeqNo = pTmp->GetSeqNo();
+ sal_uInt16 nSeqNo = pTmp->GetSeqNo();
if( nSeqNo && bSelect )
{
- BOOL bCheck = FALSE;
+ sal_Bool bCheck = sal_False;
int nLoopCnt = 2;
- USHORT nArrSavPos = nArrPos;
+ sal_uInt16 nArrSavPos = nArrPos;
do {
- pTmp = _GotoRedline( nArrPos, TRUE );
+ pTmp = _GotoRedline( nArrPos, sal_True );
if( !pFnd )
pFnd = pTmp;
@@ -2005,7 +2048,7 @@ const SwRedline* SwCrsrShell::GotoRedline( USHORT nArrPos, BOOL bSelect )
const SwPosition *pNStt = pNextPam->Start(),
*pNEnd = pNextPam->End();
- BOOL bDel = TRUE;
+ sal_Bool bDel = sal_True;
switch( ::ComparePosition( *pCStt, *pCEnd,
*pNStt, *pNEnd ))
{
@@ -2040,7 +2083,7 @@ const SwRedline* SwCrsrShell::GotoRedline( USHORT nArrPos, BOOL bSelect )
break;
default:
- bDel = FALSE;
+ bDel = sal_False;
}
if( bDel )
@@ -2054,7 +2097,7 @@ const SwRedline* SwCrsrShell::GotoRedline( USHORT nArrPos, BOOL bSelect )
}
}
- USHORT nFndPos = 2 == nLoopCnt
+ sal_uInt16 nFndPos = 2 == nLoopCnt
? rTbl.FindNextOfSeqNo( nArrPos )
: rTbl.FindPrevOfSeqNo( nArrPos );
if( USHRT_MAX != nFndPos ||
@@ -2065,7 +2108,7 @@ const SwRedline* SwCrsrShell::GotoRedline( USHORT nArrPos, BOOL bSelect )
{
// neuen Cursor erzeugen
CreateCrsr();
- bCheck = TRUE;
+ bCheck = sal_True;
}
nArrPos = nFndPos;
}
@@ -2081,12 +2124,12 @@ const SwRedline* SwCrsrShell::GotoRedline( USHORT nArrPos, BOOL bSelect )
}
-BOOL SwCrsrShell::SelectNxtPrvHyperlink( BOOL bNext )
+sal_Bool SwCrsrShell::SelectNxtPrvHyperlink( sal_Bool bNext )
{
SwNodes& rNds = GetDoc()->GetNodes();
const SwNode* pBodyEndNd = &rNds.GetEndOfContent();
const SwNode* pBodySttNd = pBodyEndNd->StartOfSectionNode();
- ULONG nBodySttNdIdx = pBodySttNd->GetIndex();
+ sal_uLong nBodySttNdIdx = pBodySttNd->GetIndex();
Point aPt;
_SetGetExpFld aCmpPos( SwPosition( bNext ? *pBodyEndNd : *pBodySttNd ) );
@@ -2103,7 +2146,7 @@ BOOL SwCrsrShell::SelectNxtPrvHyperlink( BOOL bNext )
{
const SwTxtNode* pTxtNd;
const SwCharFmts* pFmts = GetDoc()->GetCharFmts();
- for( USHORT n = pFmts->Count(); 1 < n; )
+ for( sal_uInt16 n = pFmts->Count(); 1 < n; )
{
SwIterator<SwTxtINetFmt,SwCharFmt> aIter(*(*pFmts)[--n]);
@@ -2138,13 +2181,13 @@ BOOL SwCrsrShell::SelectNxtPrvHyperlink( BOOL bNext )
// then check all the Flys with a URL or imapge map
{
const SwSpzFrmFmts* pFmts = GetDoc()->GetSpzFrmFmts();
- for( USHORT n = 0, nEnd = pFmts->Count(); n < nEnd; ++n )
+ for( sal_uInt16 n = 0, nEnd = pFmts->Count(); n < nEnd; ++n )
{
SwFlyFrmFmt* pFmt = (SwFlyFrmFmt*)(*pFmts)[ n ];
const SwFmtURL& rURLItem = pFmt->GetURL();
if( rURLItem.GetMap() || rURLItem.GetURL().Len() )
{
- SwFlyFrm* pFly = pFmt->GetFrm( &aPt, FALSE );
+ SwFlyFrm* pFly = pFmt->GetFrm( &aPt, sal_False );
SwPosition aTmpPos( *pBodySttNd );
if( pFly &&
GetBodyTxtNode( *GetDoc(), aTmpPos, *pFly->GetLower() ) )
@@ -2161,7 +2204,7 @@ BOOL SwCrsrShell::SelectNxtPrvHyperlink( BOOL bNext )
}
// found any URL ?
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
const SwTxtINetFmt* pFndAttr = aCmpPos.GetINetFmt();
const SwFlyFrmFmt* pFndFmt = aCmpPos.GetFlyFmt();
if( pFndAttr || pFndFmt )
@@ -2183,7 +2226,7 @@ BOOL SwCrsrShell::SelectNxtPrvHyperlink( BOOL bNext )
{
UpdateCrsr( SwCrsrShell::SCROLLWIN|SwCrsrShell::CHKRANGE|
SwCrsrShell::READONLY );
- bRet = TRUE;
+ bRet = sal_True;
}
}
// find a draw object ?
@@ -2192,16 +2235,16 @@ BOOL SwCrsrShell::SelectNxtPrvHyperlink( BOOL bNext )
const SdrObject* pSObj = pFndFmt->FindSdrObject();
((SwFEShell*)this)->SelectObj( pSObj->GetCurrentBoundRect().Center() );
MakeSelVisible();
- bRet = TRUE;
+ bRet = sal_True;
}
else // then is it a fly
{
- SwFlyFrm* pFly = pFndFmt->GetFrm(&aPt, FALSE );
+ SwFlyFrm* pFly = pFndFmt->GetFrm(&aPt, sal_False );
if( pFly )
{
- ((SwFEShell*)this)->SelectFlyFrm( *pFly, TRUE );
+ ((SwFEShell*)this)->SelectFlyFrm( *pFly, sal_True );
MakeSelVisible();
- bRet = TRUE;
+ bRet = sal_True;
}
}
}
diff --git a/sw/source/core/crsr/crstrvl1.cxx b/sw/source/core/crsr/crstrvl1.cxx
index cfb4c2243ac5..3bdd40e7efd0 100644
--- a/sw/source/core/crsr/crstrvl1.cxx
+++ b/sw/source/core/crsr/crstrvl1.cxx
@@ -33,72 +33,72 @@
#include <viscrs.hxx>
#include <callnk.hxx>
-BOOL SwCrsrShell::IsStartWord( sal_Int16 nWordType ) const
+sal_Bool SwCrsrShell::IsStartWord( sal_Int16 nWordType ) const
{
return pCurCrsr->IsStartWord( nWordType );
}
-BOOL SwCrsrShell::IsEndWord( sal_Int16 nWordType ) const
+sal_Bool SwCrsrShell::IsEndWord( sal_Int16 nWordType ) const
{
return pCurCrsr->IsEndWord( nWordType );
}
-BOOL SwCrsrShell::IsInWord( sal_Int16 nWordType ) const
+sal_Bool SwCrsrShell::IsInWord( sal_Int16 nWordType ) const
{
return pCurCrsr->IsInWord( nWordType );
}
-BOOL SwCrsrShell::IsStartSentence() const
+sal_Bool SwCrsrShell::IsStartSentence() const
{
return pCurCrsr->IsStartEndSentence( false );
}
-BOOL SwCrsrShell::IsEndSentence() const
+sal_Bool SwCrsrShell::IsEndSentence() const
{
return pCurCrsr->IsStartEndSentence( true );
}
-BOOL SwCrsrShell::GoStartWord()
+sal_Bool SwCrsrShell::GoStartWord()
{
return CallCrsrFN( &SwCursor::GoStartWord );
}
-BOOL SwCrsrShell::GoEndWord()
+sal_Bool SwCrsrShell::GoEndWord()
{
return CallCrsrFN( &SwCursor::GoEndWord );
}
-BOOL SwCrsrShell::GoNextWord()
+sal_Bool SwCrsrShell::GoNextWord()
{
return CallCrsrFN( &SwCursor::GoNextWord );
}
-BOOL SwCrsrShell::GoPrevWord()
+sal_Bool SwCrsrShell::GoPrevWord()
{
return CallCrsrFN( &SwCursor::GoPrevWord );
}
-BOOL SwCrsrShell::GoNextSentence()
+sal_Bool SwCrsrShell::GoNextSentence()
{
return CallCrsrFN( &SwCursor::GoNextSentence );
}
-BOOL SwCrsrShell::GoEndSentence()
+sal_Bool SwCrsrShell::GoEndSentence()
{
return CallCrsrFN( &SwCursor::GoEndSentence );
}
-BOOL SwCrsrShell::GoPrevSentence()
+sal_Bool SwCrsrShell::GoPrevSentence()
{
return CallCrsrFN( &SwCursor::GoPrevSentence );
}
-BOOL SwCrsrShell::GoStartSentence()
+sal_Bool SwCrsrShell::GoStartSentence()
{
return CallCrsrFN( &SwCursor::GoStartSentence );
}
-BOOL SwCrsrShell::SelectWord( const Point* pPt )
+sal_Bool SwCrsrShell::SelectWord( const Point* pPt )
{
return pCurCrsr->SelectWord( this, pPt );
}
-BOOL SwCrsrShell::ExpandToSentenceBorders()
+sal_Bool SwCrsrShell::ExpandToSentenceBorders()
{
return pCurCrsr->ExpandToSentenceBorders();
}
diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx
index be581b17735d..b505134e4395 100644
--- a/sw/source/core/crsr/findattr.cxx
+++ b/sw/source/core/crsr/findattr.cxx
@@ -45,13 +45,14 @@
#include <fchrfmt.hxx>
#include <charfmt.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <swcrsr.hxx>
#include <editsh.hxx>
#include <ndtxt.hxx>
#include <pamtyp.hxx>
#include <swundo.hxx>
#include <crsskip.hxx>
-#include <undobj.hxx>
+
using namespace ::com::sun::star;
using namespace ::com::sun::star::lang;
@@ -82,7 +83,7 @@ int CmpAttr( const SfxPoolItem& rItem1, const SfxPoolItem& rItem2 )
}
-const SwTxtAttr* GetFrwrdTxtHint( const SwpHints& rHtsArr, USHORT& rPos,
+const SwTxtAttr* GetFrwrdTxtHint( const SwpHints& rHtsArr, sal_uInt16& rPos,
xub_StrLen nCntntPos )
{
while( rPos < rHtsArr.Count() )
@@ -96,7 +97,7 @@ const SwTxtAttr* GetFrwrdTxtHint( const SwpHints& rHtsArr, USHORT& rPos,
}
-const SwTxtAttr* GetBkwrdTxtHint( const SwpHints& rHtsArr, USHORT& rPos,
+const SwTxtAttr* GetBkwrdTxtHint( const SwpHints& rHtsArr, sal_uInt16& rPos,
xub_StrLen nCntntPos )
{
while( rPos > 0 )
@@ -112,14 +113,14 @@ const SwTxtAttr* GetBkwrdTxtHint( const SwpHints& rHtsArr, USHORT& rPos,
void lcl_SetAttrPam( SwPaM & rPam, xub_StrLen nStart, const xub_StrLen* pEnde,
- const BOOL bSaveMark )
+ const sal_Bool bSaveMark )
{
xub_StrLen nCntntPos;
if( bSaveMark )
nCntntPos = rPam.GetMark()->nContent.GetIndex();
else
nCntntPos = rPam.GetPoint()->nContent.GetIndex();
- BOOL bTstEnde = rPam.GetPoint()->nNode == rPam.GetMark()->nNode;
+ sal_Bool bTstEnde = rPam.GetPoint()->nNode == rPam.GetMark()->nNode;
SwCntntNode* pCNd = rPam.GetCntntNode();
rPam.GetPoint()->nContent.Assign( pCNd, nStart );
@@ -142,15 +143,15 @@ void lcl_SetAttrPam( SwPaM & rPam, xub_StrLen nStart, const xub_StrLen* pEnde,
// umspannt, unter Beachtung des Suchbereiches
-BOOL lcl_Search( const SwTxtNode& rTxtNd, SwPaM& rPam,
+sal_Bool lcl_Search( const SwTxtNode& rTxtNd, SwPaM& rPam,
const SfxPoolItem& rCmpItem,
- SwMoveFn fnMove, BOOL bValue )
+ SwMoveFn fnMove, sal_Bool bValue )
{
if ( !rTxtNd.HasHints() )
- return FALSE;
+ return sal_False;
const SwTxtAttr *pTxtHt = 0;
- BOOL bForward = fnMove == fnMoveForward;
- USHORT nPos = bForward ? 0 : rTxtNd.GetSwpHints().Count();
+ sal_Bool bForward = fnMove == fnMoveForward;
+ sal_uInt16 nPos = bForward ? 0 : rTxtNd.GetSwpHints().Count();
xub_StrLen nCntntPos = rPam.GetPoint()->nContent.GetIndex();
while( 0 != ( pTxtHt=(*fnMove->fnGetHint)(rTxtNd.GetSwpHints(),nPos,nCntntPos)))
@@ -158,9 +159,9 @@ BOOL lcl_Search( const SwTxtNode& rTxtNd, SwPaM& rPam,
( !bValue || CmpAttr( pTxtHt->GetAttr(), rCmpItem )))
{
lcl_SetAttrPam( rPam, *pTxtHt->GetStart(), pTxtHt->GetEnd(), bForward );
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
@@ -168,7 +169,7 @@ BOOL lcl_Search( const SwTxtNode& rTxtNd, SwPaM& rPam,
struct _SwSrchChrAttr
{
- USHORT nWhich;
+ sal_uInt16 nWhich;
xub_StrLen nStt, nEnd;
_SwSrchChrAttr( const SfxPoolItem& rItem,
@@ -181,11 +182,11 @@ class SwAttrCheckArr
{
_SwSrchChrAttr *pFndArr, *pStackArr;
xub_StrLen nNdStt, nNdEnd;
- USHORT nArrStart, nArrLen;
- USHORT nFound, nStackCnt;
+ sal_uInt16 nArrStart, nArrLen;
+ sal_uInt16 nFound, nStackCnt;
SfxItemSet aCmpSet;
- BOOL bNoColls;
- BOOL bForward;
+ sal_Bool bNoColls;
+ sal_Bool bForward;
public:
SwAttrCheckArr( const SfxItemSet& rSet, int bForward, int bNoCollections );
@@ -194,7 +195,7 @@ public:
void SetNewSet( const SwTxtNode& rTxtNd, const SwPaM& rPam );
// wieviele Attribute ueberhaupt ??
- USHORT Count() const { return aCmpSet.Count(); }
+ sal_uInt16 Count() const { return aCmpSet.Count(); }
int Found() const { return nFound == aCmpSet.Count(); }
int CheckStack();
@@ -214,7 +215,7 @@ SwAttrCheckArr::SwAttrCheckArr( const SfxItemSet& rSet, int bFwd,
int bNoCollections )
: aCmpSet( *rSet.GetPool(), RES_CHRATR_BEGIN, RES_TXTATR_END-1 )
{
- aCmpSet.Put( rSet, FALSE );
+ aCmpSet.Put( rSet, sal_False );
bNoColls = 0 != bNoCollections;
bForward = 0 != bFwd;
@@ -269,9 +270,9 @@ void SwAttrCheckArr::SetNewSet( const SwTxtNode& rTxtNd, const SwPaM& rPam )
SfxItemIter aIter( aCmpSet );
const SfxPoolItem* pItem = aIter.GetCurItem();
const SfxPoolItem* pFndItem;
- USHORT nWhich;
+ sal_uInt16 nWhich;
- while( TRUE )
+ while( sal_True )
{
// nur testen, ob vorhanden ist ?
if( IsInvalidItem( pItem ) )
@@ -322,7 +323,7 @@ int SwAttrCheckArr::SetAttrFwd( const SwTxtAttr& rAttr )
// --------------------------------------------------------------
// Hier wird jetzt ausdruecklich auch in Zeichenvorlagen gesucht
// --------------------------------------------------------------
- USHORT nWhch = rAttr.Which();
+ sal_uInt16 nWhch = rAttr.Which();
SfxWhichIter* pIter = NULL;
const SfxPoolItem* pTmpItem = NULL;
const SfxItemSet* pSet = NULL;
@@ -337,7 +338,7 @@ int SwAttrCheckArr::SetAttrFwd( const SwTxtAttr& rAttr )
pIter = new SfxWhichIter( *pSet );
nWhch = pIter->FirstWhich();
while( nWhch &&
- SFX_ITEM_SET != pSet->GetItemState( nWhch, TRUE, &pTmpItem ) )
+ SFX_ITEM_SET != pSet->GetItemState( nWhch, sal_True, &pTmpItem ) )
nWhch = pIter->NextWhich();
if( !nWhch )
pTmpItem = NULL;
@@ -347,10 +348,10 @@ int SwAttrCheckArr::SetAttrFwd( const SwTxtAttr& rAttr )
pTmpItem = &rAttr.GetAttr();
while( pTmpItem )
{
- SfxItemState eState = aCmpSet.GetItemState( nWhch, FALSE, &pItem );
+ SfxItemState eState = aCmpSet.GetItemState( nWhch, sal_False, &pItem );
if( SFX_ITEM_DONTCARE == eState || SFX_ITEM_SET == eState )
{
- USHORT n;
+ sal_uInt16 n;
_SwSrchChrAttr* pCmp;
// loesche erstmal alle, die bis zu der Start Position schon wieder
@@ -400,7 +401,7 @@ int SwAttrCheckArr::SetAttrFwd( const SwTxtAttr& rAttr )
}
}
- BOOL bContinue = FALSE;
+ sal_Bool bContinue = sal_False;
if( SFX_ITEM_DONTCARE == eState )
{
@@ -417,7 +418,7 @@ int SwAttrCheckArr::SetAttrFwd( const SwTxtAttr& rAttr )
else if( pCmp->nEnd < aTmp.nEnd ) // erweitern ?
pCmp->nEnd = aTmp.nEnd;
- bContinue = TRUE;
+ bContinue = sal_True;
}
}
// wird Attribut gueltig ?
@@ -425,7 +426,7 @@ int SwAttrCheckArr::SetAttrFwd( const SwTxtAttr& rAttr )
{
pFndArr[ nWhch - nArrStart ] = aTmp;
++nFound;
- bContinue = TRUE;
+ bContinue = sal_True;
}
// tja, dann muss es auf den Stack
@@ -457,7 +458,7 @@ int SwAttrCheckArr::SetAttrFwd( const SwTxtAttr& rAttr )
{
nWhch = pIter->NextWhich();
while( nWhch &&
- SFX_ITEM_SET != pSet->GetItemState( nWhch, TRUE, &pTmpItem ) )
+ SFX_ITEM_SET != pSet->GetItemState( nWhch, sal_True, &pTmpItem ) )
nWhch = pIter->NextWhich();
if( !nWhch )
break;
@@ -480,7 +481,7 @@ int SwAttrCheckArr::SetAttrBwd( const SwTxtAttr& rAttr )
// --------------------------------------------------------------
// Hier wird jetzt ausdruecklich auch in Zeichenvorlagen gesucht
// --------------------------------------------------------------
- USHORT nWhch = rAttr.Which();
+ sal_uInt16 nWhch = rAttr.Which();
SfxWhichIter* pIter = NULL;
const SfxPoolItem* pTmpItem = NULL;
const SfxItemSet* pSet = NULL;
@@ -495,7 +496,7 @@ int SwAttrCheckArr::SetAttrBwd( const SwTxtAttr& rAttr )
pIter = new SfxWhichIter( *pSet );
nWhch = pIter->FirstWhich();
while( nWhch &&
- SFX_ITEM_SET != pSet->GetItemState( nWhch, TRUE, &pTmpItem ) )
+ SFX_ITEM_SET != pSet->GetItemState( nWhch, sal_True, &pTmpItem ) )
nWhch = pIter->NextWhich();
if( !nWhch )
pTmpItem = NULL;
@@ -505,10 +506,10 @@ int SwAttrCheckArr::SetAttrBwd( const SwTxtAttr& rAttr )
pTmpItem = &rAttr.GetAttr();
while( pTmpItem )
{
- SfxItemState eState = aCmpSet.GetItemState( nWhch, FALSE, &pItem );
+ SfxItemState eState = aCmpSet.GetItemState( nWhch, sal_False, &pItem );
if( SFX_ITEM_DONTCARE == eState || SFX_ITEM_SET == eState )
{
- USHORT n;
+ sal_uInt16 n;
_SwSrchChrAttr* pCmp;
// loesche erstmal alle, die bis zu der Start Position schon wieder
@@ -557,7 +558,7 @@ int SwAttrCheckArr::SetAttrBwd( const SwTxtAttr& rAttr )
}
}
- BOOL bContinue = FALSE;
+ sal_Bool bContinue = sal_False;
if( SFX_ITEM_DONTCARE == eState )
{
// wird Attribut gueltig ?
@@ -573,7 +574,7 @@ int SwAttrCheckArr::SetAttrBwd( const SwTxtAttr& rAttr )
else if( pCmp->nStt > aTmp.nStt ) // erweitern ?
pCmp->nStt = aTmp.nStt;
- bContinue = TRUE;
+ bContinue = sal_True;
}
}
// wird Attribut gueltig ?
@@ -581,7 +582,7 @@ int SwAttrCheckArr::SetAttrBwd( const SwTxtAttr& rAttr )
{
pFndArr[ nWhch - nArrStart ] = aTmp;
++nFound;
- bContinue = TRUE;
+ bContinue = sal_True;
}
// tja, dann muss es auf den Stack
@@ -613,7 +614,7 @@ int SwAttrCheckArr::SetAttrBwd( const SwTxtAttr& rAttr )
{
nWhch = pIter->NextWhich();
while( nWhch &&
- SFX_ITEM_SET != pSet->GetItemState( nWhch, TRUE, &pTmpItem ) )
+ SFX_ITEM_SET != pSet->GetItemState( nWhch, sal_True, &pTmpItem ) )
nWhch = pIter->NextWhich();
if( !nWhch )
break;
@@ -629,7 +630,7 @@ xub_StrLen SwAttrCheckArr::Start() const
{
xub_StrLen nStart = nNdStt;
_SwSrchChrAttr* pArrPtr = pFndArr;
- for( USHORT n = 0; n < nArrLen; ++n, ++pArrPtr )
+ for( sal_uInt16 n = 0; n < nArrLen; ++n, ++pArrPtr )
if( pArrPtr->nWhich && pArrPtr->nStt > nStart )
nStart = pArrPtr->nStt;
@@ -641,7 +642,7 @@ xub_StrLen SwAttrCheckArr::End() const
{
_SwSrchChrAttr* pArrPtr = pFndArr;
xub_StrLen nEnd = nNdEnd;
- for( USHORT n = 0; n < nArrLen; ++n, ++pArrPtr )
+ for( sal_uInt16 n = 0; n < nArrLen; ++n, ++pArrPtr )
if( pArrPtr->nWhich && pArrPtr->nEnd < nEnd )
nEnd = pArrPtr->nEnd;
@@ -652,9 +653,9 @@ xub_StrLen SwAttrCheckArr::End() const
int SwAttrCheckArr::CheckStack()
{
if( !nStackCnt )
- return FALSE;
+ return sal_False;
- USHORT n;
+ sal_uInt16 n;
xub_StrLen nSttPos = Start(), nEndPos = End();
_SwSrchChrAttr* pArrPtr;
for( pArrPtr = pStackArr, n = 0; n < nArrLen; ++n, ++pArrPtr )
@@ -693,16 +694,16 @@ int lcl_SearchForward( const SwTxtNode& rTxtNd, SwAttrCheckArr& rCmpArr,
if( !rTxtNd.HasHints() )
{
if( !rCmpArr.Found() )
- return FALSE;
+ return sal_False;
nEndPos = rCmpArr.GetNdEnd();
- lcl_SetAttrPam( rPam, rCmpArr.GetNdStt(), &nEndPos, TRUE );
- return TRUE;
+ lcl_SetAttrPam( rPam, rCmpArr.GetNdStt(), &nEndPos, sal_True );
+ return sal_True;
}
// dann gehe mal durch das nach "Start" sortierte Array
const SwpHints& rHtArr = rTxtNd.GetSwpHints();
const SwTxtAttr* pAttr;
- USHORT nPos = 0;
+ sal_uInt16 nPos = 0;
// sollte jetzt schon alles vorhanden sein, dann teste, mit welchem
// das wieder beendet wird.
@@ -715,8 +716,8 @@ int lcl_SearchForward( const SwTxtNode& rTxtNd, SwAttrCheckArr& rCmpArr,
{
// dann haben wir unser Ende:
lcl_SetAttrPam( rPam, rCmpArr.GetNdStt(),
- pAttr->GetStart(), TRUE );
- return TRUE;
+ pAttr->GetStart(), sal_True );
+ return sal_True;
}
// ansonsten muessen wir weiter suchen
break;
@@ -726,8 +727,8 @@ int lcl_SearchForward( const SwTxtNode& rTxtNd, SwAttrCheckArr& rCmpArr,
{
// dann haben wir unseren Bereich
nEndPos = rCmpArr.GetNdEnd();
- lcl_SetAttrPam( rPam, rCmpArr.GetNdStt(), &nEndPos, TRUE );
- return TRUE;
+ lcl_SetAttrPam( rPam, rCmpArr.GetNdStt(), &nEndPos, sal_True );
+ return sal_True;
}
}
@@ -746,16 +747,16 @@ int lcl_SearchForward( const SwTxtNode& rTxtNd, SwAttrCheckArr& rCmpArr,
// dann haben wir den Bereich zusammen
if( (nSttPos = rCmpArr.Start()) > (nEndPos = rCmpArr.End()) )
- return FALSE;
- lcl_SetAttrPam( rPam, nSttPos, &nEndPos, TRUE );
- return TRUE;
+ return sal_False;
+ lcl_SetAttrPam( rPam, nSttPos, &nEndPos, sal_True );
+ return sal_True;
}
if( !rCmpArr.CheckStack() ||
(nSttPos = rCmpArr.Start()) > (nEndPos = rCmpArr.End()) )
- return FALSE;
- lcl_SetAttrPam( rPam, nSttPos, &nEndPos, TRUE );
- return TRUE;
+ return sal_False;
+ lcl_SetAttrPam( rPam, nSttPos, &nEndPos, sal_True );
+ return sal_True;
}
@@ -767,16 +768,16 @@ int lcl_SearchBackward( const SwTxtNode& rTxtNd, SwAttrCheckArr& rCmpArr,
if( !rTxtNd.HasHints() )
{
if( !rCmpArr.Found() )
- return FALSE;
+ return sal_False;
nEndPos = rCmpArr.GetNdEnd();
- lcl_SetAttrPam( rPam, rCmpArr.GetNdStt(), &nEndPos, FALSE );
- return TRUE;
+ lcl_SetAttrPam( rPam, rCmpArr.GetNdStt(), &nEndPos, sal_False );
+ return sal_True;
}
// dann gehe mal durch das nach "Start" sortierte Array
const SwpHints& rHtArr = rTxtNd.GetSwpHints();
const SwTxtAttr* pAttr;
- USHORT nPos = rHtArr.Count();
+ sal_uInt16 nPos = rHtArr.Count();
// sollte jetzt schon alles vorhanden sein, dann teste, mit welchem
// das wieder beendet wird.
@@ -790,8 +791,8 @@ int lcl_SearchBackward( const SwTxtNode& rTxtNd, SwAttrCheckArr& rCmpArr,
{
// dann haben wir unser Ende:
nEndPos = rCmpArr.GetNdEnd();
- lcl_SetAttrPam( rPam, nSttPos, &nEndPos, FALSE );
- return TRUE;
+ lcl_SetAttrPam( rPam, nSttPos, &nEndPos, sal_False );
+ return sal_True;
}
// ansonsten muessen wir weiter suchen
@@ -802,8 +803,8 @@ int lcl_SearchBackward( const SwTxtNode& rTxtNd, SwAttrCheckArr& rCmpArr,
{
// dann haben wir unseren Bereich
nEndPos = rCmpArr.GetNdEnd();
- lcl_SetAttrPam( rPam, rCmpArr.GetNdStt(), &nEndPos, FALSE );
- return TRUE;
+ lcl_SetAttrPam( rPam, rCmpArr.GetNdStt(), &nEndPos, sal_False );
+ return sal_True;
}
}
@@ -826,32 +827,32 @@ int lcl_SearchBackward( const SwTxtNode& rTxtNd, SwAttrCheckArr& rCmpArr,
// dann haben wir den Bereich zusammen
if( (nSttPos = rCmpArr.Start()) > (nEndPos = rCmpArr.End()) )
- return FALSE;
- lcl_SetAttrPam( rPam, nSttPos, &nEndPos, FALSE );
- return TRUE;
+ return sal_False;
+ lcl_SetAttrPam( rPam, nSttPos, &nEndPos, sal_False );
+ return sal_True;
}
if( !rCmpArr.CheckStack() ||
(nSttPos = rCmpArr.Start()) > (nEndPos = rCmpArr.End()) )
- return FALSE;
- lcl_SetAttrPam( rPam, nSttPos, &nEndPos, FALSE );
- return TRUE;
+ return sal_False;
+ lcl_SetAttrPam( rPam, nSttPos, &nEndPos, sal_False );
+ return sal_True;
}
-int lcl_Search( const SwCntntNode& rCNd, const SfxItemSet& rCmpSet, BOOL bNoColls )
+int lcl_Search( const SwCntntNode& rCNd, const SfxItemSet& rCmpSet, sal_Bool bNoColls )
{
// nur die harte Attributierung suchen ?
if( bNoColls && !rCNd.HasSwAttrSet() )
- return FALSE;
+ return sal_False;
const SfxItemSet& rNdSet = rCNd.GetSwAttrSet();
SfxItemIter aIter( rCmpSet );
const SfxPoolItem* pItem = aIter.GetCurItem();
const SfxPoolItem* pNdItem;
- USHORT nWhich;
+ sal_uInt16 nWhich;
- while( TRUE )
+ while( sal_True )
{
// nur testen, ob vorhanden ist ?
if( IsInvalidItem( pItem ))
@@ -859,7 +860,7 @@ int lcl_Search( const SwCntntNode& rCNd, const SfxItemSet& rCmpSet, BOOL bNoColl
nWhich = rCmpSet.GetWhichByPos( aIter.GetCurPos() );
if( SFX_ITEM_SET != rNdSet.GetItemState( nWhich, !bNoColls, &pNdItem )
|| CmpAttr( *pNdItem, rNdSet.GetPool()->GetDefaultItem( nWhich ) ))
- return FALSE;
+ return sal_False;
}
else
{
@@ -869,29 +870,29 @@ int lcl_Search( const SwCntntNode& rCNd, const SfxItemSet& rCmpSet, BOOL bNoColl
// if( SFX_ITEM_SET != rNdSet.GetItemState( nWhich, !bNoColls, &pNdItem )
// || *pNdItem != *pItem )
if( !CmpAttr( rNdSet.Get( nWhich, !bNoColls ), *pItem ))
- return FALSE;
+ return sal_False;
}
if( aIter.IsAtEnd() )
break;
pItem = aIter.NextItem();
}
- return TRUE; // wurde gefunden
+ return sal_True; // wurde gefunden
}
-BOOL SwPaM::Find( const SfxPoolItem& rAttr, BOOL bValue, SwMoveFn fnMove,
- const SwPaM *pRegion, BOOL bInReadOnly )
+sal_Bool SwPaM::Find( const SfxPoolItem& rAttr, sal_Bool bValue, SwMoveFn fnMove,
+ const SwPaM *pRegion, sal_Bool bInReadOnly )
{
// stelle fest welches Attribut gesucht wird:
- USHORT nWhich = rAttr.Which();
+ sal_uInt16 nWhich = rAttr.Which();
int bCharAttr = isCHRATR(nWhich) || isTXTATR(nWhich);
SwPaM* pPam = MakeRegion( fnMove, pRegion );
- BOOL bFound = FALSE;
- BOOL bFirst = TRUE;
- BOOL bSrchForward = fnMove == fnMoveForward;
+ sal_Bool bFound = sal_False;
+ sal_Bool bFirst = sal_True;
+ sal_Bool bSrchForward = fnMove == fnMoveForward;
SwCntntNode * pNode;
const SfxPoolItem* pItem;
SwpFmts aFmtArr;
@@ -901,10 +902,10 @@ BOOL SwPaM::Find( const SfxPoolItem& rAttr, BOOL bValue, SwMoveFn fnMove,
? pPam->GetPoint()->nContent.GetIndex() == pPam->GetCntntNode()->Len()
: !pPam->GetPoint()->nContent.GetIndex() )
{
- if( !(*fnMove->fnNds)( &pPam->GetPoint()->nNode, FALSE ))
+ if( !(*fnMove->fnNds)( &pPam->GetPoint()->nNode, sal_False ))
{
delete pPam;
- return FALSE;
+ return sal_False;
}
SwCntntNode *pNd = pPam->GetCntntNode();
xub_StrLen nTmpPos = bSrchForward ? 0 : pNd->Len();
@@ -925,7 +926,7 @@ BOOL SwPaM::Find( const SfxPoolItem& rAttr, BOOL bValue, SwMoveFn fnMove,
SetMark();
*GetPoint() = *pPam->GetPoint();
*GetMark() = *pPam->GetMark();
- bFound = TRUE;
+ bFound = sal_True;
break;
}
else if (isTXTATR(nWhich))
@@ -943,7 +944,7 @@ BOOL SwPaM::Find( const SfxPoolItem& rAttr, BOOL bValue, SwMoveFn fnMove,
}
if( SFX_ITEM_SET == pNode->GetSwAttrSet().GetItemState( nWhich,
- TRUE, &pItem ) && ( !bValue || *pItem == rAttr ) )
+ sal_True, &pItem ) && ( !bValue || *pItem == rAttr ) )
{
// FORWARD: Point an das Ende, GetMark zum Anfanf vom Node
// BACKWARD: Point zum Anfang, GetMark an das Ende vom Node
@@ -951,7 +952,7 @@ BOOL SwPaM::Find( const SfxPoolItem& rAttr, BOOL bValue, SwMoveFn fnMove,
*GetPoint() = *pPam->GetPoint();
SetMark();
pNode->MakeEndIndex( &GetPoint()->nContent );
- bFound = TRUE;
+ bFound = sal_True;
break;
}
}
@@ -967,14 +968,14 @@ BOOL SwPaM::Find( const SfxPoolItem& rAttr, BOOL bValue, SwMoveFn fnMove,
typedef int (*FnSearchAttr)( const SwTxtNode&, SwAttrCheckArr&, SwPaM& );
-BOOL SwPaM::Find( const SfxItemSet& rSet, BOOL bNoColls, SwMoveFn fnMove,
- const SwPaM *pRegion, BOOL bInReadOnly, BOOL bMoveFirst )
+sal_Bool SwPaM::Find( const SfxItemSet& rSet, sal_Bool bNoColls, SwMoveFn fnMove,
+ const SwPaM *pRegion, sal_Bool bInReadOnly, sal_Bool bMoveFirst )
{
SwPaM* pPam = MakeRegion( fnMove, pRegion );
- BOOL bFound = FALSE;
- BOOL bFirst = TRUE;
- BOOL bSrchForward = fnMove == fnMoveForward;
+ sal_Bool bFound = sal_False;
+ sal_Bool bFirst = sal_True;
+ sal_Bool bSrchForward = fnMove == fnMoveForward;
SwCntntNode * pNode;
SwpFmts aFmtArr;
@@ -982,7 +983,7 @@ BOOL SwPaM::Find( const SfxItemSet& rSet, BOOL bNoColls, SwMoveFn fnMove,
SwAttrCheckArr aCmpArr( rSet, bSrchForward, bNoColls );
SfxItemSet aOtherSet( GetDoc()->GetAttrPool(),
RES_PARATR_BEGIN, RES_GRFATR_END-1 );
- aOtherSet.Put( rSet, FALSE ); // alle Invalid-Items erhalten!
+ aOtherSet.Put( rSet, sal_False ); // alle Invalid-Items erhalten!
FnSearchAttr fnSearch = bSrchForward
? (&::lcl_SearchForward)
@@ -995,10 +996,10 @@ BOOL SwPaM::Find( const SfxItemSet& rSet, BOOL bNoColls, SwMoveFn fnMove,
? pPam->GetPoint()->nContent.GetIndex() == pPam->GetCntntNode()->Len()
: !pPam->GetPoint()->nContent.GetIndex() ) )
{
- if( !(*fnMove->fnNds)( &pPam->GetPoint()->nNode, FALSE ))
+ if( !(*fnMove->fnNds)( &pPam->GetPoint()->nNode, sal_False ))
{
delete pPam;
- return FALSE;
+ return sal_False;
}
SwCntntNode *pNd = pPam->GetCntntNode();
xub_StrLen nTmpPos = bSrchForward ? 0 : pNd->Len();
@@ -1021,7 +1022,7 @@ BOOL SwPaM::Find( const SfxItemSet& rSet, BOOL bNoColls, SwMoveFn fnMove,
SetMark();
*GetPoint() = *pPam->GetPoint();
*GetMark() = *pPam->GetMark();
- bFound = TRUE;
+ bFound = sal_True;
break;
}
continue; // TextAttribute
@@ -1048,7 +1049,7 @@ BOOL SwPaM::Find( const SfxItemSet& rSet, BOOL bNoColls, SwMoveFn fnMove,
*GetPoint() = *pPam->GetPoint();
SetMark();
pNode->MakeEndIndex( &GetPoint()->nContent );
- bFound = TRUE;
+ bFound = sal_True;
break;
}
}
@@ -1066,13 +1067,13 @@ BOOL SwPaM::Find( const SfxItemSet& rSet, BOOL bNoColls, SwMoveFn fnMove,
// Parameter fuer das Suchen vom Attributen
struct SwFindParaAttr : public SwFindParas
{
- BOOL bValue;
+ sal_Bool bValue;
const SfxItemSet *pSet, *pReplSet;
const SearchOptions *pSearchOpt;
SwCursor& rCursor;
utl::TextSearch* pSTxt;
- SwFindParaAttr( const SfxItemSet& rSet, BOOL bNoCollection,
+ SwFindParaAttr( const SfxItemSet& rSet, sal_Bool bNoCollection,
const SearchOptions* pOpt, const SfxItemSet* pRSet,
SwCursor& rCrsr )
: bValue( bNoCollection ), pSet( &rSet ), pReplSet( pRSet ),
@@ -1080,22 +1081,22 @@ struct SwFindParaAttr : public SwFindParas
virtual ~SwFindParaAttr() { delete pSTxt; }
- virtual int Find( SwPaM* , SwMoveFn , const SwPaM*, BOOL bInReadOnly );
+ virtual int Find( SwPaM* , SwMoveFn , const SwPaM*, sal_Bool bInReadOnly );
virtual int IsReplaceMode() const;
};
int SwFindParaAttr::Find( SwPaM* pCrsr, SwMoveFn fnMove, const SwPaM* pRegion,
- BOOL bInReadOnly )
+ sal_Bool bInReadOnly )
{
// String ersetzen ?? (nur wenn Text angegeben oder nicht attributiert
// gesucht wird)
- BOOL bReplaceTxt = pSearchOpt && ( pSearchOpt->replaceString.getLength() ||
+ sal_Bool bReplaceTxt = pSearchOpt && ( pSearchOpt->replaceString.getLength() ||
!pSet->Count() );
- BOOL bReplaceAttr = pReplSet && pReplSet->Count();
- BOOL bMoveFirst = !bReplaceAttr;
+ sal_Bool bReplaceAttr = pReplSet && pReplSet->Count();
+ sal_Bool bMoveFirst = !bReplaceAttr;
if( bInReadOnly && (bReplaceAttr || bReplaceTxt ))
- bInReadOnly = FALSE;
+ bInReadOnly = sal_False;
// wir suchen nach Attributen, soll zusaetzlich Text gesucht werden ?
{
@@ -1103,7 +1104,7 @@ int SwFindParaAttr::Find( SwPaM* pCrsr, SwMoveFn fnMove, const SwPaM* pRegion,
SwPaM* pTextRegion = &aRegion;
SwPaM aSrchPam( *pCrsr->GetPoint() );
- while( TRUE )
+ while( sal_True )
{
if( pSet->Count() ) // gibts ueberhaupt Attributierung?
{
@@ -1112,7 +1113,7 @@ int SwFindParaAttr::Find( SwPaM* pCrsr, SwMoveFn fnMove, const SwPaM* pRegion,
//JP 17.11.95: was ist mit Attributen in leeren Absaetzen !!
// || *pCrsr->GetMark() == *pCrsr->GetPoint() ) // kein Bereich ??
return FIND_NOT_FOUND;
- bMoveFirst = TRUE;
+ bMoveFirst = sal_True;
if( !pSearchOpt )
break; // ok, nur Attribute, also gefunden
@@ -1137,7 +1138,7 @@ int SwFindParaAttr::Find( SwPaM* pCrsr, SwMoveFn fnMove, const SwPaM* pRegion,
}
// todo/mba: searching for attributes in Outliner text?!
- BOOL bSearchInNotes = FALSE;
+ sal_Bool bSearchInNotes = sal_False;
// Bug 24665: suche im richtigen Bereich weiter (pTextRegion!)
if( aSrchPam.Find( *pSearchOpt, bSearchInNotes, *pSTxt, fnMove, pTextRegion, bInReadOnly ) &&
@@ -1155,12 +1156,12 @@ int SwFindParaAttr::Find( SwPaM* pCrsr, SwMoveFn fnMove, const SwPaM* pRegion,
//JP 04.11.97: Bug 44897 - aber den Mark wieder aufheben, damit
// weiterbewegt werden kann!
{
- BOOL bCheckRegion = TRUE;
+ sal_Bool bCheckRegion = sal_True;
SwPosition* pPos = aSrchPam.GetPoint();
if( !(*fnMove->fnNd)( &pPos->nNode.GetNode(),
&pPos->nContent, CRSR_SKIP_CHARS ))
{
- if( (*fnMove->fnNds)( &pPos->nNode, FALSE ))
+ if( (*fnMove->fnNds)( &pPos->nNode, sal_False ))
{
SwCntntNode *pNd = pPos->nNode.GetNode().GetCntntNode();
xub_StrLen nCPos;
@@ -1171,7 +1172,7 @@ int SwFindParaAttr::Find( SwPaM* pCrsr, SwMoveFn fnMove, const SwPaM* pRegion,
pPos->nContent.Assign( pNd, nCPos );
}
else
- bCheckRegion = FALSE;
+ bCheckRegion = sal_False;
}
if( !bCheckRegion || *aRegion.GetPoint() <= *pPos )
return FIND_NOT_FOUND; // nicht gefunden
@@ -1242,11 +1243,11 @@ int SwFindParaAttr::Find( SwPaM* pCrsr, SwMoveFn fnMove, const SwPaM* pRegion,
SfxItemIter aIter( *pSet );
const SfxPoolItem* pItem = aIter.GetCurItem();
- while( TRUE )
+ while( sal_True )
{
// alle die nicht gesetzt sind mit Pool-Defaults aufuellen
if( !IsInvalidItem( pItem ) && SFX_ITEM_SET !=
- pReplSet->GetItemState( pItem->Which(), FALSE ))
+ pReplSet->GetItemState( pItem->Which(), sal_False ))
aSet.Put( pPool->GetDefaultItem( pItem->Which() ));
if( aIter.IsAtEnd() )
@@ -1274,8 +1275,8 @@ int SwFindParaAttr::IsReplaceMode() const
// Suchen nach Attributen
-ULONG SwCursor::Find( const SfxItemSet& rSet, BOOL bNoCollections,
- SwDocPositions nStart, SwDocPositions nEnde, BOOL& bCancel,
+sal_uLong SwCursor::Find( const SfxItemSet& rSet, sal_Bool bNoCollections,
+ SwDocPositions nStart, SwDocPositions nEnde, sal_Bool& bCancel,
FindRanges eFndRngs,
const SearchOptions* pSearchOpt, const SfxItemSet* pReplSet )
{
@@ -1284,23 +1285,27 @@ ULONG SwCursor::Find( const SfxItemSet& rSet, BOOL bNoCollections,
Link aLnk( pDoc->GetOle2Link() );
pDoc->SetOle2Link( Link() );
- BOOL bReplace = ( pSearchOpt && ( pSearchOpt->replaceString.getLength() ||
+ sal_Bool bReplace = ( pSearchOpt && ( pSearchOpt->replaceString.getLength() ||
!rSet.Count() ) ) ||
(pReplSet && pReplSet->Count());
- BOOL bSttUndo = pDoc->DoesUndo() && bReplace;
- if( bSttUndo )
- pDoc->StartUndo( UNDO_REPLACE, NULL );
+ bool const bStartUndo = pDoc->GetIDocumentUndoRedo().DoesUndo() && bReplace;
+ if (bStartUndo)
+ {
+ pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_REPLACE, NULL );
+ }
SwFindParaAttr aSwFindParaAttr( rSet, bNoCollections, pSearchOpt,
pReplSet, *this );
- ULONG nRet = FindAll(aSwFindParaAttr, nStart, nEnde, eFndRngs, bCancel );
+ sal_uLong nRet = FindAll(aSwFindParaAttr, nStart, nEnde, eFndRngs, bCancel );
pDoc->SetOle2Link( aLnk );
if( nRet && bReplace )
pDoc->SetModified();
- if( bSttUndo )
- pDoc->EndUndo( UNDO_REPLACE, NULL );
+ if (bStartUndo)
+ {
+ pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_REPLACE, NULL );
+ }
return nRet;
}
diff --git a/sw/source/core/crsr/findcoll.cxx b/sw/source/core/crsr/findcoll.cxx
index 4bb594ceb4ca..a78b92b180a1 100644
--- a/sw/source/core/crsr/findcoll.cxx
+++ b/sw/source/core/crsr/findcoll.cxx
@@ -28,16 +28,15 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <tools/resid.hxx>
#include <swcrsr.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <pamtyp.hxx>
#include <swundo.hxx>
-#include <undobj.hxx>
-#ifndef _COMCORE_HRC
+#include <SwRewriter.hxx>
#include <comcore.hrc>
-#endif
-#include <tools/resid.hxx>
//------------------ Methoden der CrsrShell ---------------------------
@@ -50,17 +49,17 @@ struct SwFindParaFmtColl : public SwFindParas
const SwTxtFmtColl* pRpColl, SwCursor& rCrsr )
: pFmtColl( &rFmtColl ), pReplColl( pRpColl ), rCursor( rCrsr )
{}
- virtual int Find( SwPaM* , SwMoveFn , const SwPaM*, BOOL bInReadOnly );
+ virtual int Find( SwPaM* , SwMoveFn , const SwPaM*, sal_Bool bInReadOnly );
virtual int IsReplaceMode() const;
};
int SwFindParaFmtColl::Find( SwPaM* pCrsr, SwMoveFn fnMove, const SwPaM* pRegion,
- BOOL bInReadOnly )
+ sal_Bool bInReadOnly )
{
int nRet = FIND_FOUND;
if( bInReadOnly && pReplColl )
- bInReadOnly = FALSE;
+ bInReadOnly = sal_False;
if( !pCrsr->Find( *pFmtColl, fnMove, pRegion, bInReadOnly ) )
nRet = FIND_NOT_FOUND;
@@ -82,8 +81,8 @@ int SwFindParaFmtColl::IsReplaceMode() const
// Suchen nach Format-Collections
-ULONG SwCursor::Find( const SwTxtFmtColl& rFmtColl,
- SwDocPositions nStart, SwDocPositions nEnde, BOOL& bCancel,
+sal_uLong SwCursor::Find( const SwTxtFmtColl& rFmtColl,
+ SwDocPositions nStart, SwDocPositions nEnde, sal_Bool& bCancel,
FindRanges eFndRngs, const SwTxtFmtColl* pReplFmtColl )
{
// OLE-Benachrichtigung abschalten !!
@@ -91,27 +90,31 @@ ULONG SwCursor::Find( const SwTxtFmtColl& rFmtColl,
Link aLnk( pDoc->GetOle2Link() );
pDoc->SetOle2Link( Link() );
- BOOL bSttUndo = pDoc->DoesUndo() && pReplFmtColl;
- if( bSttUndo )
+ bool const bStartUndo =
+ pDoc->GetIDocumentUndoRedo().DoesUndo() && pReplFmtColl;
+ if (bStartUndo)
{
SwRewriter aRewriter;
aRewriter.AddRule(UNDO_ARG1, rFmtColl.GetName());
aRewriter.AddRule(UNDO_ARG2, SW_RES(STR_YIELDS));
aRewriter.AddRule(UNDO_ARG3, pReplFmtColl->GetName());
- pDoc->StartUndo( UNDO_UI_REPLACE_STYLE, &aRewriter );
+ pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_UI_REPLACE_STYLE,
+ &aRewriter );
}
SwFindParaFmtColl aSwFindParaFmtColl( rFmtColl, pReplFmtColl, *this );
- ULONG nRet = FindAll( aSwFindParaFmtColl, nStart, nEnde, eFndRngs, bCancel );
+ sal_uLong nRet = FindAll( aSwFindParaFmtColl, nStart, nEnde, eFndRngs, bCancel );
pDoc->SetOle2Link( aLnk );
if( nRet && pReplFmtColl )
pDoc->SetModified();
- if( bSttUndo )
- pDoc->EndUndo( UNDO_UI_REPLACE_STYLE, NULL );
+ if (bStartUndo)
+ {
+ pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_END, 0);
+ }
return nRet;
}
diff --git a/sw/source/core/crsr/findfmt.cxx b/sw/source/core/crsr/findfmt.cxx
index bf3492ae0a65..8da8e83bd5cf 100644
--- a/sw/source/core/crsr/findfmt.cxx
+++ b/sw/source/core/crsr/findfmt.cxx
@@ -33,11 +33,11 @@
#include <pamtyp.hxx>
-BOOL SwPaM::Find( const SwFmt& rFmt, SwMoveFn fnMove,
- const SwPaM *pRegion, BOOL bInReadOnly )
+sal_Bool SwPaM::Find( const SwFmt& rFmt, SwMoveFn fnMove,
+ const SwPaM *pRegion, sal_Bool bInReadOnly )
{
- BOOL bFound = FALSE;
- BOOL bSrchForward = fnMove == fnMoveForward;
+ sal_Bool bFound = sal_False;
+ sal_Bool bSrchForward = fnMove == fnMoveForward;
SwPaM* pPam = MakeRegion( fnMove, pRegion );
// Wenn am Anfang/Ende, aus dem Node moven
@@ -45,17 +45,17 @@ BOOL SwPaM::Find( const SwFmt& rFmt, SwMoveFn fnMove,
? pPam->GetPoint()->nContent.GetIndex() == pPam->GetCntntNode()->Len()
: !pPam->GetPoint()->nContent.GetIndex() )
{
- if( !(*fnMove->fnNds)( &pPam->GetPoint()->nNode, FALSE ))
+ if( !(*fnMove->fnNds)( &pPam->GetPoint()->nNode, sal_False ))
{
delete pPam;
- return FALSE;
+ return sal_False;
}
SwCntntNode *pNd = pPam->GetPoint()->nNode.GetNode().GetCntntNode();
xub_StrLen nTmpPos = bSrchForward ? 0 : pNd->Len();
pPam->GetPoint()->nContent.Assign( pNd, nTmpPos );
}
- BOOL bFirst = TRUE;
+ sal_Bool bFirst = sal_True;
SwCntntNode* pNode;
while( !bFound &&
0 != ( pNode = ::GetNode( *pPam, bFirst, fnMove, bInReadOnly )))
diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx
index ed4bcc089957..6eb89eadfbff 100644
--- a/sw/source/core/crsr/findtxt.cxx
+++ b/sw/source/core/crsr/findtxt.cxx
@@ -27,15 +27,17 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
#include <com/sun/star/util/SearchOptions.hpp>
#include <com/sun/star/util/SearchFlags.hpp>
-
-
#define _SVSTDARR_USHORTS
#define _SVSTDARR_ULONGS
#include <svl/svstdarr.hxx>
+
#include <vcl/svapp.hxx>
+#include <vcl/window.hxx>
+
#include <txatritr.hxx>
#include <fldbas.hxx>
#include <fmtfld.hxx>
@@ -43,15 +45,16 @@
#include <txtfld.hxx>
#include <swcrsr.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <pamtyp.hxx>
#include <ndtxt.hxx>
#include <swundo.hxx>
+#include <UndoInsert.hxx>
#include <breakit.hxx>
#include <docsh.hxx>
#include <PostItMgr.hxx>
#include <viewsh.hxx>
-#include <vcl/window.hxx>
using namespace ::com::sun::star;
using namespace util;
@@ -68,7 +71,7 @@ String& lcl_CleanStr( const SwTxtNode& rNd, xub_StrLen nStart,
const SwpHints *pHts = rNd.GetpSwpHints();
- USHORT n = 0;
+ sal_uInt16 n = 0;
xub_StrLen nSoftHyphen = nStart;
xub_StrLen nHintStart = STRING_LEN;
bool bNewHint = true;
@@ -141,7 +144,7 @@ String& lcl_CleanStr( const SwTxtNode& rNd, xub_StrLen nStart,
// wir sie einfach.
// Fuer das Ende merken wir uns die Ersetzungen und entferenen
// hinterher alle am Stringende (koenten ja 'normale' 0x7f drinstehen
- BOOL bEmpty = RES_TXTATR_FIELD != pHt->Which() ||
+ sal_Bool bEmpty = RES_TXTATR_FIELD != pHt->Which() ||
!(static_cast<SwTxtFld const*>(pHt)
->GetFld().GetFld()->ExpandField(true).Len());
if ( bEmpty && nStart == nAkt )
@@ -176,7 +179,7 @@ String& lcl_CleanStr( const SwTxtNode& rNd, xub_StrLen nStart,
}
while ( true );
- for( USHORT i = aReplaced.Count(); i; )
+ for( sal_uInt16 i = aReplaced.Count(); i; )
{
const xub_StrLen nTmp = aReplaced[ --i ];
if( nTmp == rRet.Len() - 1 )
@@ -222,15 +225,15 @@ xub_StrLen GetPostIt(xub_StrLen aCount,const SwpHints *pHts)
return aIndex;
}
-BYTE SwPaM::Find( const SearchOptions& rSearchOpt, BOOL bSearchInNotes , utl::TextSearch& rSTxt,
+sal_uInt8 SwPaM::Find( const SearchOptions& rSearchOpt, sal_Bool bSearchInNotes , utl::TextSearch& rSTxt,
SwMoveFn fnMove, const SwPaM * pRegion,
- BOOL bInReadOnly )
+ sal_Bool bInReadOnly )
{
if( !rSearchOpt.searchString.getLength() )
- return FALSE;
+ return sal_False;
SwPaM* pPam = MakeRegion( fnMove, pRegion );
- BOOL bSrchForward = fnMove == fnMoveForward;
+ sal_Bool bSrchForward = fnMove == fnMoveForward;
SwNodeIndex& rNdIdx = pPam->GetPoint()->nNode;
SwIndex& rCntntIdx = pPam->GetPoint()->nContent;
@@ -241,10 +244,10 @@ BYTE SwPaM::Find( const SearchOptions& rSearchOpt, BOOL bSearchInNotes , utl::Te
rCntntIdx.GetIndex() )
: !rCntntIdx.GetIndex() && pPam->GetCntntNode()->Len() )
{
- if( !(*fnMove->fnNds)( &rNdIdx, FALSE ))
+ if( !(*fnMove->fnNds)( &rNdIdx, sal_False ))
{
delete pPam;
- return FALSE;
+ return sal_False;
}
SwCntntNode *pNd = rNdIdx.GetNode().GetCntntNode();
xub_StrLen nTmpPos = bSrchForward ? 0 : pNd->Len();
@@ -252,14 +255,14 @@ BYTE SwPaM::Find( const SearchOptions& rSearchOpt, BOOL bSearchInNotes , utl::Te
}
/*
- * Ist bFound == TRUE, dann wurde der String gefunden und in
+ * Ist bFound == sal_True, dann wurde der String gefunden und in
* nStart und nEnde steht der gefundenen String
*/
- BOOL bFound = FALSE;
+ sal_Bool bFound = sal_False;
/*
* StartPostion im Text oder Anfangsposition
*/
- BOOL bFirst = TRUE;
+ sal_Bool bFirst = sal_True;
SwCntntNode * pNode;
//testarea
//String sCleanStr;
@@ -268,11 +271,11 @@ BYTE SwPaM::Find( const SearchOptions& rSearchOpt, BOOL bSearchInNotes , utl::Te
xub_StrLen nStart, nEnde, nTxtLen;
- BOOL bRegSearch = SearchAlgorithms_REGEXP == rSearchOpt.algorithmType;
- BOOL bChkEmptyPara = bRegSearch && 2 == rSearchOpt.searchString.getLength() &&
+ sal_Bool bRegSearch = SearchAlgorithms_REGEXP == rSearchOpt.algorithmType;
+ sal_Bool bChkEmptyPara = bRegSearch && 2 == rSearchOpt.searchString.getLength() &&
( !rSearchOpt.searchString.compareToAscii( "^$" ) ||
!rSearchOpt.searchString.compareToAscii( "$^" ) );
- BOOL bChkParaEnd = bRegSearch && 1 == rSearchOpt.searchString.getLength() &&
+ sal_Bool bChkParaEnd = bRegSearch && 1 == rSearchOpt.searchString.getLength() &&
!rSearchOpt.searchString.compareToAscii( "$" );
// LanguageType eLastLang = 0;
@@ -418,7 +421,7 @@ BYTE SwPaM::Find( const SearchOptions& rSearchOpt, BOOL bSearchInNotes , utl::Te
bool SwPaM::DoSearch( const SearchOptions& rSearchOpt, utl::TextSearch& rSTxt,
SwMoveFn fnMove,
- BOOL bSrchForward, BOOL bRegSearch, BOOL bChkEmptyPara, BOOL bChkParaEnd,
+ sal_Bool bSrchForward, sal_Bool bRegSearch, sal_Bool bChkEmptyPara, sal_Bool bChkParaEnd,
xub_StrLen &nStart, xub_StrLen &nEnde, xub_StrLen nTxtLen,SwNode* pNode, SwPaM* pPam)
{
bool bFound = false;
@@ -450,8 +453,8 @@ bool SwPaM::DoSearch( const SearchOptions& rSearchOpt, utl::TextSearch& rSTxt,
aFltArr, sCleanStr, bRemoveSoftHyphens );
SwScriptIterator* pScriptIter = 0;
- USHORT nSearchScript = 0;
- USHORT nCurrScript = 0;
+ sal_uInt16 nSearchScript = 0;
+ sal_uInt16 nCurrScript = 0;
if ( SearchAlgorithms_APPROXIMATE == rSearchOpt.algorithmType &&
pBreakIt->GetBreakIter().is() )
@@ -522,7 +525,7 @@ bool SwPaM::DoSearch( const SearchOptions& rSearchOpt, utl::TextSearch& rSTxt,
if( !bSrchForward ) // rueckwaerts Suche?
Exchange(); // Point und Mark tauschen
- bFound = TRUE;
+ bFound = sal_True;
break;
}
@@ -546,7 +549,7 @@ bool SwPaM::DoSearch( const SearchOptions& rSearchOpt, utl::TextSearch& rSTxt,
{
if( !bSrchForward ) // rueckwaerts Suche?
Exchange(); // Point und Mark tauschen
- //bFound = TRUE;
+ //bFound = sal_True;
//break;
return true;
}
@@ -560,13 +563,13 @@ struct SwFindParaText : public SwFindParas
const SearchOptions& rSearchOpt;
SwCursor& rCursor;
utl::TextSearch aSTxt;
- BOOL bReplace;
- BOOL bSearchInNotes;
+ sal_Bool bReplace;
+ sal_Bool bSearchInNotes;
- SwFindParaText( const SearchOptions& rOpt, BOOL bSearchNotes, int bRepl, SwCursor& rCrsr )
+ SwFindParaText( const SearchOptions& rOpt, sal_Bool bSearchNotes, int bRepl, SwCursor& rCrsr )
: rSearchOpt( rOpt ), rCursor( rCrsr ), aSTxt( rOpt ), bReplace( 0 != bRepl ), bSearchInNotes( bSearchNotes )
{}
- virtual int Find( SwPaM* , SwMoveFn , const SwPaM*, BOOL bInReadOnly );
+ virtual int Find( SwPaM* , SwMoveFn , const SwPaM*, sal_Bool bInReadOnly );
virtual int IsReplaceMode() const;
virtual ~SwFindParaText();
};
@@ -576,12 +579,12 @@ SwFindParaText::~SwFindParaText()
}
int SwFindParaText::Find( SwPaM* pCrsr, SwMoveFn fnMove,
- const SwPaM* pRegion, BOOL bInReadOnly )
+ const SwPaM* pRegion, sal_Bool bInReadOnly )
{
if( bInReadOnly && bReplace )
- bInReadOnly = FALSE;
+ bInReadOnly = sal_False;
- BOOL bFnd = (BOOL)pCrsr->Find( rSearchOpt, bSearchInNotes, aSTxt, fnMove, pRegion, bInReadOnly );
+ sal_Bool bFnd = (sal_Bool)pCrsr->Find( rSearchOpt, bSearchInNotes, aSTxt, fnMove, pRegion, bInReadOnly );
/* #i80135# if we found something in a note, Mark and Point is the same
if( bFnd && *pCrsr->GetMark() == *pCrsr->GetPoint() )
@@ -633,9 +636,9 @@ int SwFindParaText::IsReplaceMode() const
}
-ULONG SwCursor::Find( const SearchOptions& rSearchOpt, BOOL bSearchInNotes,
+sal_uLong SwCursor::Find( const SearchOptions& rSearchOpt, sal_Bool bSearchInNotes,
SwDocPositions nStart, SwDocPositions nEnde,
- BOOL& bCancel,
+ sal_Bool& bCancel,
FindRanges eFndRngs, int bReplace )
{
// OLE-Benachrichtigung abschalten !!
@@ -643,21 +646,27 @@ ULONG SwCursor::Find( const SearchOptions& rSearchOpt, BOOL bSearchInNotes,
Link aLnk( pDoc->GetOle2Link() );
pDoc->SetOle2Link( Link() );
- BOOL bSttUndo = pDoc->DoesUndo() && bReplace;
- if( bSttUndo )
- pDoc->StartUndo( UNDO_REPLACE, NULL );
+ bool const bStartUndo = pDoc->GetIDocumentUndoRedo().DoesUndo() && bReplace;
+ if (bStartUndo)
+ {
+ pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_REPLACE, NULL );
+ }
- BOOL bSearchSel = 0 != (rSearchOpt.searchFlag & SearchFlags::REG_NOT_BEGINOFLINE);
+ sal_Bool bSearchSel = 0 != (rSearchOpt.searchFlag & SearchFlags::REG_NOT_BEGINOFLINE);
if( bSearchSel )
eFndRngs = (FindRanges)(eFndRngs | FND_IN_SEL);
SwFindParaText aSwFindParaText( rSearchOpt, bSearchInNotes, bReplace, *this );
- ULONG nRet = FindAll( aSwFindParaText, nStart, nEnde, eFndRngs, bCancel );
+ sal_uLong nRet = FindAll( aSwFindParaText, nStart, nEnde, eFndRngs, bCancel );
pDoc->SetOle2Link( aLnk );
if( nRet && bReplace )
pDoc->SetModified();
- if( bSttUndo )
- pDoc->EndUndo( UNDO_REPLACE, NULL );
+ if (bStartUndo)
+ {
+ SwRewriter rewriter(MakeUndoReplaceRewriter(
+ nRet, rSearchOpt.searchString, rSearchOpt.replaceString));
+ pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_REPLACE, & rewriter );
+ }
return nRet;
}
@@ -667,8 +676,8 @@ String *ReplaceBackReferences( const SearchOptions& rSearchOpt, SwPaM* pPam )
if( pPam && pPam->HasMark() &&
SearchAlgorithms_REGEXP == rSearchOpt.algorithmType )
{
- const SwCntntNode* pTxtNode = pPam->GetCntntNode( TRUE );
- if( pTxtNode && pTxtNode->IsTxtNode() && pTxtNode == pPam->GetCntntNode( FALSE ) )
+ const SwCntntNode* pTxtNode = pPam->GetCntntNode( sal_True );
+ if( pTxtNode && pTxtNode->IsTxtNode() && pTxtNode == pPam->GetCntntNode( sal_False ) )
{
utl::TextSearch aSTxt( rSearchOpt );
String aStr( pPam->GetTxt() );
diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index 238982aac785..b6615ffae076 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -56,7 +56,7 @@
#include <hints.hxx>
// fuer den dummen ?MSC-? Compiler
-inline xub_StrLen GetSttOrEnd( BOOL bCondition, const SwCntntNode& rNd )
+inline xub_StrLen GetSttOrEnd( sal_Bool bCondition, const SwCntntNode& rNd )
{
return bCondition ? 0 : rNd.Len();
}
@@ -106,58 +106,58 @@ SwPosition &SwPosition::operator=(const SwPosition &rPos)
}
-BOOL SwPosition::operator<(const SwPosition &rPos) const
+sal_Bool SwPosition::operator<(const SwPosition &rPos) const
{
if( nNode < rPos.nNode )
- return TRUE;
+ return sal_True;
if( nNode == rPos.nNode )
return ( nContent < rPos.nContent );
- return FALSE;
+ return sal_False;
}
-BOOL SwPosition::operator>(const SwPosition &rPos) const
+sal_Bool SwPosition::operator>(const SwPosition &rPos) const
{
if(nNode > rPos.nNode )
- return TRUE;
+ return sal_True;
if( nNode == rPos.nNode )
return ( nContent > rPos.nContent );
- return FALSE;
+ return sal_False;
}
-BOOL SwPosition::operator<=(const SwPosition &rPos) const
+sal_Bool SwPosition::operator<=(const SwPosition &rPos) const
{
if(nNode < rPos.nNode )
- return TRUE;
+ return sal_True;
if( nNode == rPos.nNode )
return ( nContent <= rPos.nContent );
- return FALSE;
+ return sal_False;
}
-BOOL SwPosition::operator>=(const SwPosition &rPos) const
+sal_Bool SwPosition::operator>=(const SwPosition &rPos) const
{
if(nNode > rPos.nNode )
- return TRUE;
+ return sal_True;
if( nNode == rPos.nNode )
return ( nContent >= rPos.nContent );
- return FALSE;
+ return sal_False;
}
-BOOL SwPosition::operator==(const SwPosition &rPos) const
+sal_Bool SwPosition::operator==(const SwPosition &rPos) const
{
return
( ( nNode == rPos.nNode ) && ( nContent == rPos.nContent ) ?
- TRUE: FALSE);
+ sal_True: sal_False);
}
-BOOL SwPosition::operator!=(const SwPosition &rPos) const
+sal_Bool SwPosition::operator!=(const SwPosition &rPos) const
{
if( nNode != rPos.nNode )
- return TRUE;
+ return sal_True;
return ( nContent != rPos.nContent );
}
@@ -259,9 +259,9 @@ SwComparePosition ComparePosition(
enum CHKSECTION { Chk_Both, Chk_One, Chk_None };
-CHKSECTION lcl_TstIdx( ULONG nSttIdx, ULONG nEndIdx, const SwNode& rEndNd )
+CHKSECTION lcl_TstIdx( sal_uLong nSttIdx, sal_uLong nEndIdx, const SwNode& rEndNd )
{
- ULONG nStt = rEndNd.StartOfSectionIndex(), nEnd = rEndNd.GetIndex();
+ sal_uLong nStt = rEndNd.StartOfSectionIndex(), nEnd = rEndNd.GetIndex();
CHKSECTION eSec = nStt < nSttIdx && nEnd >= nSttIdx ? Chk_One : Chk_None;
if( nStt < nEndIdx && nEnd >= nEndIdx )
return( eSec == Chk_One ? Chk_Both : Chk_One );
@@ -269,14 +269,14 @@ CHKSECTION lcl_TstIdx( ULONG nSttIdx, ULONG nEndIdx, const SwNode& rEndNd )
}
-BOOL lcl_ChkOneRange( CHKSECTION eSec, BOOL bChkSections,
- const SwNode& rBaseEnd, ULONG nStt, ULONG nEnd )
+sal_Bool lcl_ChkOneRange( CHKSECTION eSec, sal_Bool bChkSections,
+ const SwNode& rBaseEnd, sal_uLong nStt, sal_uLong nEnd )
{
if( eSec != Chk_Both )
- return FALSE;
+ return sal_False;
if( !bChkSections )
- return TRUE;
+ return sal_True;
// suche die umspannende Section
const SwNodes& rNds = rBaseEnd.GetNodes();
@@ -285,29 +285,29 @@ BOOL lcl_ChkOneRange( CHKSECTION eSec, BOOL bChkSections,
pNd = pNd->StartOfSectionNode();
if( pNd == rNds[ nEnd ]->StartOfSectionNode() )
- return TRUE; // der gleiche StartNode, die selbe Section
+ return sal_True; // der gleiche StartNode, die selbe Section
// steht schon auf einem GrundSection Node ? Fehler !!!
if( !pNd->StartOfSectionIndex() )
- return FALSE;
+ return sal_False;
while( ( pTmp = pNd->StartOfSectionNode())->EndOfSectionNode() !=
&rBaseEnd )
pNd = pTmp;
- ULONG nSttIdx = pNd->GetIndex(), nEndIdx = pNd->EndOfSectionIndex();
+ sal_uLong nSttIdx = pNd->GetIndex(), nEndIdx = pNd->EndOfSectionIndex();
return nSttIdx <= nStt && nStt <= nEndIdx &&
- nSttIdx <= nEnd && nEnd <= nEndIdx ? TRUE : FALSE;
+ nSttIdx <= nEnd && nEnd <= nEndIdx ? sal_True : sal_False;
}
-BOOL CheckNodesRange( const SwNodeIndex& rStt,
- const SwNodeIndex& rEnd, BOOL bChkSection )
+sal_Bool CheckNodesRange( const SwNodeIndex& rStt,
+ const SwNodeIndex& rEnd, sal_Bool bChkSection )
{
const SwNodes& rNds = rStt.GetNodes();
- ULONG nStt = rStt.GetIndex(), nEnd = rEnd.GetIndex();
+ sal_uLong nStt = rStt.GetIndex(), nEnd = rEnd.GetIndex();
CHKSECTION eSec = lcl_TstIdx( nStt, nEnd, rNds.GetEndOfContent() );
- if( Chk_None != eSec ) return eSec == Chk_Both ? TRUE : FALSE;
+ if( Chk_None != eSec ) return eSec == Chk_Both ? sal_True : sal_False;
eSec = lcl_TstIdx( nStt, nEnd, rNds.GetEndOfAutotext() );
if( Chk_None != eSec )
@@ -329,34 +329,34 @@ BOOL CheckNodesRange( const SwNodeIndex& rStt,
return lcl_ChkOneRange( eSec, bChkSection,
rNds.GetEndOfRedlines(), nStt, nEnd );
- return FALSE; // liegt irgendwo dazwischen, FEHLER
+ return sal_False; // liegt irgendwo dazwischen, FEHLER
}
-BOOL GoNext(SwNode* pNd, SwIndex * pIdx, USHORT nMode )
+sal_Bool GoNext(SwNode* pNd, SwIndex * pIdx, sal_uInt16 nMode )
{
if( pNd->IsCntntNode() )
return ((SwCntntNode*)pNd)->GoNext( pIdx, nMode );
- return FALSE;
+ return sal_False;
}
-BOOL GoPrevious( SwNode* pNd, SwIndex * pIdx, USHORT nMode )
+sal_Bool GoPrevious( SwNode* pNd, SwIndex * pIdx, sal_uInt16 nMode )
{
if( pNd->IsCntntNode() )
return ((SwCntntNode*)pNd)->GoPrevious( pIdx, nMode );
- return FALSE;
+ return sal_False;
}
-SwCntntNode* GoNextNds( SwNodeIndex* pIdx, BOOL bChk )
+SwCntntNode* GoNextNds( SwNodeIndex* pIdx, sal_Bool bChk )
{
SwNodeIndex aIdx( *pIdx );
SwCntntNode* pNd = aIdx.GetNodes().GoNext( &aIdx );
if( pNd )
{
if( bChk && 1 != aIdx.GetIndex() - pIdx->GetIndex() &&
- !CheckNodesRange( *pIdx, aIdx, TRUE ) )
+ !CheckNodesRange( *pIdx, aIdx, sal_True ) )
pNd = 0;
else
*pIdx = aIdx;
@@ -365,14 +365,14 @@ SwCntntNode* GoNextNds( SwNodeIndex* pIdx, BOOL bChk )
}
-SwCntntNode* GoPreviousNds( SwNodeIndex * pIdx, BOOL bChk )
+SwCntntNode* GoPreviousNds( SwNodeIndex * pIdx, sal_Bool bChk )
{
SwNodeIndex aIdx( *pIdx );
SwCntntNode* pNd = aIdx.GetNodes().GoPrevious( &aIdx );
if( pNd )
{
if( bChk && 1 != pIdx->GetIndex() - aIdx.GetIndex() &&
- !CheckNodesRange( *pIdx, aIdx, TRUE ) )
+ !CheckNodesRange( *pIdx, aIdx, sal_True ) )
pNd = 0;
else
*pIdx = aIdx;
@@ -564,9 +564,9 @@ void SwPaM::Exchange()
// Bewegen des Cursors
-BOOL SwPaM::Move( SwMoveFn fnMove, SwGoInDoc fnGo )
+sal_Bool SwPaM::Move( SwMoveFn fnMove, SwGoInDoc fnGo )
{
- BOOL bRet = (*fnGo)( *this, fnMove );
+ sal_Bool bRet = (*fnGo)( *this, fnMove );
m_bIsInFrontOfLabel = false;
@@ -618,7 +618,7 @@ SwPaM* SwPaM::MakeRegion( SwMoveFn fnMove, const SwPaM * pOrigRg )
return pPam;
}
-SwPaM & SwPaM::Normalize(BOOL bPointFirst)
+SwPaM & SwPaM::Normalize(sal_Bool bPointFirst)
{
if (HasMark())
if ( ( bPointFirst && *m_pPoint > *m_pMark) ||
@@ -630,7 +630,7 @@ SwPaM & SwPaM::Normalize(BOOL bPointFirst)
return *this;
}
-USHORT SwPaM::GetPageNum( BOOL bAtPoint, const Point* pLayPos )
+sal_uInt16 SwPaM::GetPageNum( sal_Bool bAtPoint, const Point* pLayPos )
{
// return die Seitennummer am Cursor
// (fuer Reader + Seitengebundene Rahmen)
@@ -640,7 +640,11 @@ USHORT SwPaM::GetPageNum( BOOL bAtPoint, const Point* pLayPos )
const SwPosition* pPos = bAtPoint ? m_pPoint : m_pMark;
if( 0 != ( pNd = pPos->nNode.GetNode().GetCntntNode() ) &&
+<<<<<<< local
0 != ( pCFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), pLayPos, pPos, FALSE )) &&
+=======
+ 0 != ( pCFrm = pNd->GetFrm( pLayPos, pPos, sal_False )) &&
+>>>>>>> other
0 != ( pPg = pCFrm->FindPageFrm() ))
return pPg->GetPhyPageNum();
return 0;
@@ -675,15 +679,19 @@ const SwFrm* lcl_FindEditInReadonlyFrm( const SwFrm& rFrm )
// steht in etwas geschuetztem oder in die Selektion umspannt
// etwas geschuetztes.
-BOOL SwPaM::HasReadonlySel( bool bFormView ) const
+sal_Bool SwPaM::HasReadonlySel( bool bFormView ) const
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
Point aTmpPt;
const SwCntntNode *pNd;
const SwCntntFrm *pFrm;
if( 0 != ( pNd = GetPoint()->nNode.GetNode().GetCntntNode() ))
+<<<<<<< local
pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), &aTmpPt, GetPoint(), FALSE );
+=======
+ pFrm = pNd->GetFrm( &aTmpPt, GetPoint(), sal_False );
+>>>>>>> other
else
pFrm = 0;
@@ -697,7 +705,7 @@ BOOL SwPaM::HasReadonlySel( bool bFormView ) const
( bFormView &&
0 == ( pSttEIRFrm = lcl_FindEditInReadonlyFrm( *pFrm ) ) ) ) )
// <--
- bRet = TRUE;
+ bRet = sal_True;
else if( pNd )
{
const SwSectionNode* pSNd = pNd->GetSectionNode();
@@ -705,13 +713,17 @@ BOOL SwPaM::HasReadonlySel( bool bFormView ) const
// --> FME 2004-06-29 #114856# Formular view
(bFormView && !pSNd->GetSection().IsEditInReadonlyFlag()) ) )
// <--
- bRet = TRUE;
+ bRet = sal_True;
}
if( !bRet && HasMark() && GetPoint()->nNode != GetMark()->nNode )
{
if( 0 != ( pNd = GetMark()->nNode.GetNode().GetCntntNode() ))
+<<<<<<< local
pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), &aTmpPt, GetMark(), FALSE );
+=======
+ pFrm = pNd->GetFrm( &aTmpPt, GetMark(), sal_False );
+>>>>>>> other
else
pFrm = 0;
@@ -720,7 +732,7 @@ BOOL SwPaM::HasReadonlySel( bool bFormView ) const
( bFormView &&
0 == ( pEndEIRFrm = lcl_FindEditInReadonlyFrm( *pFrm ) ) ) ) )
// <--
- bRet = TRUE;
+ bRet = sal_True;
else if( pNd )
{
const SwSectionNode* pSNd = pNd->GetSectionNode();
@@ -728,7 +740,7 @@ BOOL SwPaM::HasReadonlySel( bool bFormView ) const
// --> FME 2004-06-29 #114856# Formular view
(bFormView && !pSNd->GetSection().IsEditInReadonlyFlag()) ) )
// <--
- bRet = TRUE;
+ bRet = sal_True;
}
// --> FME 2004-06-29 #114856# Formular view
@@ -737,7 +749,7 @@ BOOL SwPaM::HasReadonlySel( bool bFormView ) const
// Check if start and end frame are inside the _same_
// edit-in-readonly-environment. Otherwise we better return 'true'
if ( pSttEIRFrm != pEndEIRFrm )
- bRet = TRUE;
+ bRet = sal_True;
}
// <--
@@ -745,11 +757,11 @@ BOOL SwPaM::HasReadonlySel( bool bFormView ) const
// Selektion liegen?
if( !bRet )
{
- ULONG nSttIdx = GetMark()->nNode.GetIndex(),
+ sal_uLong nSttIdx = GetMark()->nNode.GetIndex(),
nEndIdx = GetPoint()->nNode.GetIndex();
if( nEndIdx <= nSttIdx )
{
- ULONG nTmp = nSttIdx;
+ sal_uLong nTmp = nSttIdx;
nSttIdx = nEndIdx;
nEndIdx = nTmp;
}
@@ -760,14 +772,14 @@ BOOL SwPaM::HasReadonlySel( bool bFormView ) const
if( nSttIdx + 3 < nEndIdx )
{
const SwSectionFmts& rFmts = GetDoc()->GetSections();
- for( USHORT n = rFmts.Count(); n; )
+ for( sal_uInt16 n = rFmts.Count(); n; )
{
const SwSectionFmt* pFmt = rFmts[ --n ];
if( pFmt->GetProtect().IsCntntProtected() )
{
- const SwFmtCntnt& rCntnt = pFmt->GetCntnt(FALSE);
+ const SwFmtCntnt& rCntnt = pFmt->GetCntnt(sal_False);
ASSERT( rCntnt.GetCntntIdx(), "wo ist der SectionNode?" );
- ULONG nIdx = rCntnt.GetCntntIdx()->GetIndex();
+ sal_uLong nIdx = rCntnt.GetCntntIdx()->GetIndex();
if( nSttIdx <= nIdx && nEndIdx >= nIdx &&
rCntnt.GetCntntIdx()->GetNode().GetNodes().IsDocNodes() )
{
@@ -777,10 +789,10 @@ BOOL SwPaM::HasReadonlySel( bool bFormView ) const
if( CONTENT_SECTION == rSect.GetType() )
{
RestoreSavePos();
- return TRUE;
+ return sal_True;
}
*/
- bRet = TRUE;
+ bRet = sal_True;
break;
}
}
@@ -799,18 +811,18 @@ BOOL SwPaM::HasReadonlySel( bool bFormView ) const
{
SwFrmFmt* pFmt = (SwFrmFmt*)rFmts[ --n ];
const SwTable* pTbl = SwTable::FindTable( pFmt );
- ULONG nIdx = pTbl ? pTbl->GetTabSortBoxes()[0]->GetSttIdx()
+ sal_uLong nIdx = pTbl ? pTbl->GetTabSortBoxes()[0]->GetSttIdx()
: 0;
if( nSttIdx <= nIdx && nEndIdx >= nIdx )
{
// dann teste mal alle Boxen
const SwTableSortBoxes& rBoxes = pTbl->GetTabSortBoxes();
- for( USHORT i = rBoxes.Count(); i; )
+ for( sal_uInt16 i = rBoxes.Count(); i; )
if( rBoxes[ --i ]->GetFrmFmt()->GetProtect().
IsCntntProtected() )
{
- bRet = TRUE;
+ bRet = sal_True;
break;
}
@@ -852,8 +864,8 @@ BOOL SwPaM::HasReadonlySel( bool bFormView ) const
// Fall, darf die Position vom Pam nicht veraendert werden!
-SwCntntNode* GetNode( SwPaM & rPam, BOOL& rbFirst, SwMoveFn fnMove,
- BOOL bInReadOnly )
+SwCntntNode* GetNode( SwPaM & rPam, sal_Bool& rbFirst, SwMoveFn fnMove,
+ sal_Bool bInReadOnly )
{
SwCntntNode * pNd = 0;
SwCntntFrm* pFrm;
@@ -862,7 +874,7 @@ SwCntntNode* GetNode( SwPaM & rPam, BOOL& rbFirst, SwMoveFn fnMove,
{
if( rbFirst )
{
- rbFirst = FALSE;
+ rbFirst = sal_False;
pNd = rPam.GetCntntNode();
if( pNd )
{
@@ -885,18 +897,18 @@ SwCntntNode* GetNode( SwPaM & rPam, BOOL& rbFirst, SwMoveFn fnMove,
if( !pNd ) // steht Cursor auf keinem ContentNode ?
{
SwPosition aPos( *rPam.GetPoint() );
- BOOL bSrchForward = fnMove == fnMoveForward;
+ sal_Bool bSrchForward = fnMove == fnMoveForward;
SwNodes& rNodes = aPos.nNode.GetNodes();
// zum naechsten / vorherigen ContentNode
// Funktioniert noch alles, wenn die Uerbpruefung vom ueberspringen der
// Sektions herausgenommen wird ??
// if( (*fnMove->fnNds)( rNodes, &aPos.nNode ) )
- while( TRUE )
+ while( sal_True )
{
pNd = bSrchForward
- ? rNodes.GoNextSection( &aPos.nNode, TRUE, !bInReadOnly )
- : rNodes.GoPrevSection( &aPos.nNode, TRUE, !bInReadOnly );
+ ? rNodes.GoNextSection( &aPos.nNode, sal_True, !bInReadOnly )
+ : rNodes.GoPrevSection( &aPos.nNode, sal_True, !bInReadOnly );
if( pNd )
{
aPos.nContent.Assign( pNd, ::GetSttOrEnd( bSrchForward,*pNd ));
@@ -952,7 +964,7 @@ void GoEndDoc( SwPosition * pPos )
{
SwNodes& rNodes = pPos->nNode.GetNodes();
pPos->nNode = rNodes.GetEndOfContent();
- SwCntntNode* pCNd = GoPreviousNds( &pPos->nNode, TRUE );
+ SwCntntNode* pCNd = GoPreviousNds( &pPos->nNode, sal_True );
if( pCNd )
pCNd->MakeEndIndex( &pPos->nContent );
}
@@ -962,7 +974,7 @@ void GoStartSection( SwPosition * pPos )
{
// springe zum Anfang der Section
SwNodes& rNodes = pPos->nNode.GetNodes();
- USHORT nLevel = rNodes.GetSectionLevel( pPos->nNode );
+ sal_uInt16 nLevel = rNodes.GetSectionLevel( pPos->nNode );
if( pPos->nNode < rNodes.GetEndOfContent().StartOfSectionIndex() )
nLevel--;
do { rNodes.GoStartOfSection( &pPos->nNode ); } while( nLevel-- );
@@ -978,35 +990,35 @@ void GoEndSection( SwPosition * pPos )
{
// springe zum Anfang/Ende der Section
SwNodes& rNodes = pPos->nNode.GetNodes();
- USHORT nLevel = rNodes.GetSectionLevel( pPos->nNode );
+ sal_uInt16 nLevel = rNodes.GetSectionLevel( pPos->nNode );
if( pPos->nNode < rNodes.GetEndOfContent().StartOfSectionIndex() )
nLevel--;
do { rNodes.GoEndOfSection( &pPos->nNode ); } while( nLevel-- );
// steht jetzt auf einem EndNode, also zum vorherigen CntntNode
- if( GoPreviousNds( &pPos->nNode, TRUE ) )
+ if( GoPreviousNds( &pPos->nNode, sal_True ) )
pPos->nNode.GetNode().GetCntntNode()->MakeEndIndex( &pPos->nContent );
}
-BOOL GoInDoc( SwPaM & rPam, SwMoveFn fnMove )
+sal_Bool GoInDoc( SwPaM & rPam, SwMoveFn fnMove )
{
(*fnMove->fnDoc)( rPam.GetPoint() );
- return TRUE;
+ return sal_True;
}
-BOOL GoInSection( SwPaM & rPam, SwMoveFn fnMove )
+sal_Bool GoInSection( SwPaM & rPam, SwMoveFn fnMove )
{
(*fnMove->fnSections)( (SwPosition*)rPam.GetPoint() );
- return TRUE;
+ return sal_True;
}
-BOOL GoInNode( SwPaM & rPam, SwMoveFn fnMove )
+sal_Bool GoInNode( SwPaM & rPam, SwMoveFn fnMove )
{
- SwCntntNode *pNd = (*fnMove->fnNds)( &rPam.GetPoint()->nNode, TRUE );
+ SwCntntNode *pNd = (*fnMove->fnNds)( &rPam.GetPoint()->nNode, sal_True );
if( pNd )
rPam.GetPoint()->nContent.Assign( pNd,
::GetSttOrEnd( fnMove == fnMoveForward, *pNd ) );
@@ -1014,35 +1026,35 @@ BOOL GoInNode( SwPaM & rPam, SwMoveFn fnMove )
}
-BOOL GoInCntnt( SwPaM & rPam, SwMoveFn fnMove )
+sal_Bool GoInCntnt( SwPaM & rPam, SwMoveFn fnMove )
{
if( (*fnMove->fnNd)( &rPam.GetPoint()->nNode.GetNode(),
&rPam.GetPoint()->nContent, CRSR_SKIP_CHARS ))
- return TRUE;
+ return sal_True;
return GoInNode( rPam, fnMove );
}
-BOOL GoInCntntCells( SwPaM & rPam, SwMoveFn fnMove )
+sal_Bool GoInCntntCells( SwPaM & rPam, SwMoveFn fnMove )
{
if( (*fnMove->fnNd)( &rPam.GetPoint()->nNode.GetNode(),
&rPam.GetPoint()->nContent, CRSR_SKIP_CELLS ))
- return TRUE;
+ return sal_True;
return GoInNode( rPam, fnMove );
}
-BOOL GoInCntntSkipHidden( SwPaM & rPam, SwMoveFn fnMove )
+sal_Bool GoInCntntSkipHidden( SwPaM & rPam, SwMoveFn fnMove )
{
if( (*fnMove->fnNd)( &rPam.GetPoint()->nNode.GetNode(),
&rPam.GetPoint()->nContent, CRSR_SKIP_CHARS | CRSR_SKIP_HIDDEN ) )
- return TRUE;
+ return sal_True;
return GoInNode( rPam, fnMove );
}
-BOOL GoInCntntCellsSkipHidden( SwPaM & rPam, SwMoveFn fnMove )
+sal_Bool GoInCntntCellsSkipHidden( SwPaM & rPam, SwMoveFn fnMove )
{
if( (*fnMove->fnNd)( &rPam.GetPoint()->nNode.GetNode(),
&rPam.GetPoint()->nContent, CRSR_SKIP_CELLS | CRSR_SKIP_HIDDEN ) )
- return TRUE;
+ return sal_True;
return GoInNode( rPam, fnMove );
}
@@ -1051,7 +1063,7 @@ BOOL GoInCntntCellsSkipHidden( SwPaM & rPam, SwMoveFn fnMove )
// --------- Funktionsdefinitionen fuer die SwCrsrShell --------------
-BOOL GoPrevPara( SwPaM & rPam, SwPosPara aPosPara )
+sal_Bool GoPrevPara( SwPaM & rPam, SwPosPara aPosPara )
{
if( rPam.Move( fnMoveBackward, fnGoNode ) )
{
@@ -1060,13 +1072,13 @@ BOOL GoPrevPara( SwPaM & rPam, SwPosPara aPosPara )
SwCntntNode * pNd = rPos.nNode.GetNode().GetCntntNode();
rPos.nContent.Assign( pNd,
::GetSttOrEnd( aPosPara == fnMoveForward, *pNd ) );
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
-BOOL GoCurrPara( SwPaM & rPam, SwPosPara aPosPara )
+sal_Bool GoCurrPara( SwPaM & rPam, SwPosPara aPosPara )
{
SwPosition& rPos = *rPam.GetPoint();
SwCntntNode * pNd = rPos.nNode.GetNode().GetCntntNode();
@@ -1078,24 +1090,24 @@ BOOL GoCurrPara( SwPaM & rPam, SwPosPara aPosPara )
if( nOld != nNew )
{
rPos.nContent.Assign( pNd, nNew );
- return TRUE;
+ return sal_True;
}
}
// den Node noch etwas bewegen ( auf den naechsten/vorh. CntntNode)
if( ( aPosPara==fnParaStart && 0 != ( pNd =
- GoPreviousNds( &rPos.nNode, TRUE ))) ||
+ GoPreviousNds( &rPos.nNode, sal_True ))) ||
( aPosPara==fnParaEnd && 0 != ( pNd =
- GoNextNds( &rPos.nNode, TRUE ))) )
+ GoNextNds( &rPos.nNode, sal_True ))) )
{
rPos.nContent.Assign( pNd,
::GetSttOrEnd( aPosPara == fnMoveForward, *pNd ));
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
-BOOL GoNextPara( SwPaM & rPam, SwPosPara aPosPara )
+sal_Bool GoNextPara( SwPaM & rPam, SwPosPara aPosPara )
{
if( rPam.Move( fnMoveForward, fnGoNode ) )
{
@@ -1104,14 +1116,14 @@ BOOL GoNextPara( SwPaM & rPam, SwPosPara aPosPara )
SwCntntNode * pNd = rPos.nNode.GetNode().GetCntntNode();
rPos.nContent.Assign( pNd,
::GetSttOrEnd( aPosPara == fnMoveForward, *pNd ) );
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
-BOOL GoCurrSection( SwPaM & rPam, SwMoveFn fnMove )
+sal_Bool GoCurrSection( SwPaM & rPam, SwMoveFn fnMove )
{
SwPosition& rPos = *rPam.GetPoint();
SwPosition aSavePos( rPos ); // eine Vergleichsposition
@@ -1119,10 +1131,10 @@ BOOL GoCurrSection( SwPaM & rPam, SwMoveFn fnMove )
(rNds.*fnMove->fnSection)( &rPos.nNode );
SwCntntNode *pNd;
if( 0 == ( pNd = rPos.nNode.GetNode().GetCntntNode()) &&
- 0 == ( pNd = (*fnMove->fnNds)( &rPos.nNode, TRUE )) )
+ 0 == ( pNd = (*fnMove->fnNds)( &rPos.nNode, sal_True )) )
{
rPos = aSavePos; // Cusror nicht veraendern
- return FALSE;
+ return sal_False;
}
rPos.nContent.Assign( pNd,
@@ -1131,7 +1143,7 @@ BOOL GoCurrSection( SwPaM & rPam, SwMoveFn fnMove )
}
-BOOL GoNextSection( SwPaM & rPam, SwMoveFn fnMove )
+sal_Bool GoNextSection( SwPaM & rPam, SwMoveFn fnMove )
{
SwPosition& rPos = *rPam.GetPoint();
SwPosition aSavePos( rPos ); // eine Vergleichsposition
@@ -1142,17 +1154,17 @@ BOOL GoNextSection( SwPaM & rPam, SwMoveFn fnMove )
if( !GoInCntnt( rPam, fnMoveForward ) )
{
rPos = aSavePos; // Cusror nicht veraendern
- return FALSE;
+ return sal_False;
}
(rNds.*fnMove->fnSection)( &rPos.nNode );
SwCntntNode *pNd = rPos.nNode.GetNode().GetCntntNode();
rPos.nContent.Assign( pNd,
::GetSttOrEnd( fnMove == fnMoveForward, *pNd ) );
- return TRUE;
+ return sal_True;
}
-BOOL GoPrevSection( SwPaM & rPam, SwMoveFn fnMove )
+sal_Bool GoPrevSection( SwPaM & rPam, SwMoveFn fnMove )
{
SwPosition& rPos = *rPam.GetPoint();
SwPosition aSavePos( rPos ); // eine Vergleichsposition
@@ -1163,13 +1175,13 @@ BOOL GoPrevSection( SwPaM & rPam, SwMoveFn fnMove )
if( !GoInCntnt( rPam, fnMoveBackward ))
{
rPos = aSavePos; // Cusror nicht veraendern
- return FALSE;
+ return sal_False;
}
(rNds.*fnMove->fnSection)( &rPos.nNode );
SwCntntNode *pNd = rPos.nNode.GetNode().GetCntntNode();
rPos.nContent.Assign( pNd,
::GetSttOrEnd( fnMove == fnMoveForward, *pNd ));
- return TRUE;
+ return sal_True;
}
// #111827#
@@ -1221,7 +1233,7 @@ String SwPaM::GetTxt() const
return aResult;
}
-BOOL SwPaM::Overlap(const SwPaM & a, const SwPaM & b)
+sal_Bool SwPaM::Overlap(const SwPaM & a, const SwPaM & b)
{
return !(*b.End() <= *a.Start() || *a.End() <= *b.End());
}
@@ -1240,7 +1252,7 @@ void SwPaM::InvalidatePaM()
}
}
-BOOL SwPaM::LessThan(const SwPaM & a, const SwPaM & b)
+sal_Bool SwPaM::LessThan(const SwPaM & a, const SwPaM & b)
{
return (*a.Start() < *b.Start()) || (*a.Start() == *b.Start() && *a.End() < *b.End());
}
diff --git a/sw/source/core/crsr/paminit.cxx b/sw/source/core/crsr/paminit.cxx
index 56f497215f91..37bd63fe224d 100644
--- a/sw/source/core/crsr/paminit.cxx
+++ b/sw/source/core/crsr/paminit.cxx
@@ -75,9 +75,9 @@ SwPosSection fnSectionStart = &aFwrd;
SwPosSection fnSectionEnd = &aBwrd;
// Travelling in Tabellen
-BOOL GotoPrevTable( SwPaM&, SwPosTable, BOOL bInReadOnly );
-BOOL GotoCurrTable( SwPaM&, SwPosTable, BOOL bInReadOnly );
-BOOL GotoNextTable( SwPaM&, SwPosTable, BOOL bInReadOnly );
+sal_Bool GotoPrevTable( SwPaM&, SwPosTable, sal_Bool bInReadOnly );
+sal_Bool GotoCurrTable( SwPaM&, SwPosTable, sal_Bool bInReadOnly );
+sal_Bool GotoNextTable( SwPaM&, SwPosTable, sal_Bool bInReadOnly );
SwWhichTable fnTablePrev = &GotoPrevTable;
SwWhichTable fnTableCurr = &GotoCurrTable;
@@ -86,10 +86,10 @@ SwPosTable fnTableStart = &aFwrd;
SwPosTable fnTableEnd = &aBwrd;
// Travelling in Bereichen
-BOOL GotoPrevRegion( SwPaM&, SwPosRegion, BOOL bInReadOnly );
-BOOL GotoCurrRegion( SwPaM&, SwPosRegion, BOOL bInReadOnly );
-BOOL GotoCurrRegionAndSkip( SwPaM&, SwPosRegion, BOOL bInReadOnly );
-BOOL GotoNextRegion( SwPaM&, SwPosRegion, BOOL bInReadOnly );
+sal_Bool GotoPrevRegion( SwPaM&, SwPosRegion, sal_Bool bInReadOnly );
+sal_Bool GotoCurrRegion( SwPaM&, SwPosRegion, sal_Bool bInReadOnly );
+sal_Bool GotoCurrRegionAndSkip( SwPaM&, SwPosRegion, sal_Bool bInReadOnly );
+sal_Bool GotoNextRegion( SwPaM&, SwPosRegion, sal_Bool bInReadOnly );
SwWhichRegion fnRegionPrev = &GotoPrevRegion;
SwWhichRegion fnRegionCurr = &GotoCurrRegion;
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index f595bfcee63a..ac76ca3f2d04 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -41,6 +41,7 @@
#include <swcrsr.hxx>
#include <unocrsr.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <docary.hxx>
#include <ndtxt.hxx>
#include <section.hxx>
@@ -64,21 +65,21 @@
using namespace ::com::sun::star::i18n;
-static const USHORT coSrchRplcThreshold = 60000;
+static const sal_uInt16 coSrchRplcThreshold = 60000;
struct _PercentHdl
{
SwDocShell* pDSh;
- ULONG nActPos;
- BOOL bBack, bNodeIdx;
+ sal_uLong nActPos;
+ sal_Bool bBack, bNodeIdx;
- _PercentHdl( ULONG nStt, ULONG nEnd, SwDocShell* pSh )
+ _PercentHdl( sal_uLong nStt, sal_uLong nEnd, SwDocShell* pSh )
: pDSh( pSh )
{
nActPos = nStt;
if( 0 != ( bBack = (nStt > nEnd )) )
{
- ULONG n = nStt; nStt = nEnd; nEnd = n;
+ sal_uLong n = nStt; nStt = nEnd; nEnd = n;
}
::StartProgress( STR_STATSTR_SEARCH, nStt, nEnd, 0 );
}
@@ -86,35 +87,35 @@ struct _PercentHdl
_PercentHdl( const SwPaM& rPam )
: pDSh( (SwDocShell*)rPam.GetDoc()->GetDocShell() )
{
- ULONG nStt, nEnd;
+ sal_uLong nStt, nEnd;
if( rPam.GetPoint()->nNode == rPam.GetMark()->nNode )
{
- bNodeIdx = FALSE;
+ bNodeIdx = sal_False;
nStt = rPam.GetMark()->nContent.GetIndex();
nEnd = rPam.GetPoint()->nContent.GetIndex();
}
else
{
- bNodeIdx = TRUE;
+ bNodeIdx = sal_True;
nStt = rPam.GetMark()->nNode.GetIndex();
nEnd = rPam.GetPoint()->nNode.GetIndex();
}
nActPos = nStt;
if( 0 != ( bBack = (nStt > nEnd )) )
{
- ULONG n = nStt; nStt = nEnd; nEnd = n;
+ sal_uLong n = nStt; nStt = nEnd; nEnd = n;
}
::StartProgress( STR_STATSTR_SEARCH, nStt, nEnd, pDSh );
}
~_PercentHdl() { ::EndProgress( pDSh ); }
- void NextPos( ULONG nPos ) const
+ void NextPos( sal_uLong nPos ) const
{ ::SetProgressState( bBack ? nActPos - nPos : nPos, pDSh ); }
void NextPos( SwPosition& rPos ) const
{
- ULONG nPos;
+ sal_uLong nPos;
if( bNodeIdx )
nPos = rPos.nNode.GetIndex();
else
@@ -156,12 +157,12 @@ bool SwCursor::IsReadOnlyAvailable() const
return false;
}
-BOOL SwCursor::IsSkipOverHiddenSections() const
+sal_Bool SwCursor::IsSkipOverHiddenSections() const
{
- return TRUE;
+ return sal_True;
}
-BOOL SwCursor::IsSkipOverProtectSections() const
+sal_Bool SwCursor::IsSkipOverProtectSections() const
{
return !IsReadOnlyAvailable();
}
@@ -198,7 +199,7 @@ _SwCursor_SavePos* SwCursor::CreateNewSavePos() const
// stelle fest, ob sich der Point ausserhalb des Content-Bereichs
// vom Nodes-Array befindet
-BOOL SwCursor::IsNoCntnt() const
+sal_Bool SwCursor::IsNoCntnt() const
{
return GetPoint()->nNode.GetIndex() <
GetDoc()->GetNodes().GetEndOfExtras().GetIndex();
@@ -218,7 +219,7 @@ bool SwTableCursor::IsSelOvrCheck(int eFlags)
&& HasMark() )
{
SwNodeIndex aOldPos( rNds, GetSavePos()->nNode );
- if( !CheckNodesRange( aOldPos, GetPoint()->nNode, TRUE ))
+ if( !CheckNodesRange( aOldPos, GetPoint()->nNode, sal_True ))
{
GetPoint()->nNode = aOldPos;
GetPoint()->nContent.Assign( GetCntntNode(), GetSavePos()->nCntnt );
@@ -228,17 +229,17 @@ bool SwTableCursor::IsSelOvrCheck(int eFlags)
return SwCursor::IsSelOvrCheck(eFlags);
}
-BOOL SwCursor::IsSelOvr( int eFlags )
+sal_Bool SwCursor::IsSelOvr( int eFlags )
{
SwDoc* pDoc = GetDoc();
SwNodes& rNds = pDoc->GetNodes();
- BOOL bSkipOverHiddenSections = IsSkipOverHiddenSections();
- BOOL bSkipOverProtectSections = IsSkipOverProtectSections();
+ sal_Bool bSkipOverHiddenSections = IsSkipOverHiddenSections();
+ sal_Bool bSkipOverProtectSections = IsSkipOverProtectSections();
if ( IsSelOvrCheck( eFlags ) )
{
- return TRUE;
+ return sal_True;
}
// neu: Bereiche ueberpruefen
@@ -258,7 +259,7 @@ BOOL SwCursor::IsSelOvr( int eFlags )
{
// dann wars das schon
RestoreSavePos();
- return TRUE;
+ return sal_True;
}
// dann setze den Cursor auf die neue Position:
@@ -276,14 +277,14 @@ BOOL SwCursor::IsSelOvr( int eFlags )
}
int bIsValidPos = 0 != pCNd;
- BOOL bValidNodesRange = bIsValidPos &&
- ::CheckNodesRange( rPtIdx, aIdx, TRUE );
+ sal_Bool bValidNodesRange = bIsValidPos &&
+ ::CheckNodesRange( rPtIdx, aIdx, sal_True );
if( !bValidNodesRange )
{
rPtIdx = pSavePos->nNode;
if( 0 == ( pCNd = rPtIdx.GetNode().GetCntntNode() ) )
{
- bIsValidPos = FALSE;
+ bIsValidPos = sal_False;
nCntntPos = 0;
rPtIdx = aIdx;
if( 0 == ( pCNd = rPtIdx.GetNode().GetCntntNode() ) )
@@ -300,32 +301,32 @@ BOOL SwCursor::IsSelOvr( int eFlags )
GetPoint()->nContent.Assign( pCNd, nTmpPos );
if( !bIsValidPos || !bValidNodesRange ||
// sollten wir in einer Tabelle gelandet sein?
- IsInProtectTable( TRUE ) )
- return TRUE;
+ IsInProtectTable( sal_True ) )
+ return sal_True;
}
// oder sollte eine geschuetzte Section innerhalb der Selektion liegen?
if( HasMark() && bSkipOverProtectSections)
{
- ULONG nSttIdx = GetMark()->nNode.GetIndex(),
+ sal_uLong nSttIdx = GetMark()->nNode.GetIndex(),
nEndIdx = GetPoint()->nNode.GetIndex();
if( nEndIdx <= nSttIdx )
{
- ULONG nTmp = nSttIdx;
+ sal_uLong nTmp = nSttIdx;
nSttIdx = nEndIdx;
nEndIdx = nTmp;
}
const SwSectionFmts& rFmts = pDoc->GetSections();
- for( USHORT n = 0; n < rFmts.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rFmts.Count(); ++n )
{
const SwSectionFmt* pFmt = rFmts[n];
const SvxProtectItem& rProtect = pFmt->GetProtect();
if( rProtect.IsCntntProtected() )
{
- const SwFmtCntnt& rCntnt = pFmt->GetCntnt(FALSE);
+ const SwFmtCntnt& rCntnt = pFmt->GetCntnt(sal_False);
ASSERT( rCntnt.GetCntntIdx(), "wo ist der SectionNode?" );
- ULONG nIdx = rCntnt.GetCntntIdx()->GetIndex();
+ sal_uLong nIdx = rCntnt.GetCntntIdx()->GetIndex();
if( nSttIdx <= nIdx && nEndIdx >= nIdx )
{
// ist es keine gelinkte Section, dann kann sie auch
@@ -334,7 +335,7 @@ BOOL SwCursor::IsSelOvr( int eFlags )
if( CONTENT_SECTION == rSect.GetType() )
{
RestoreSavePos();
- return TRUE;
+ return sal_True;
}
}
}
@@ -386,7 +387,7 @@ BOOL SwCursor::IsSelOvr( int eFlags )
GetPoint()->nContent.Assign( pCNd, nTmpPos );
// sollten wir in einer Tabelle gelandet sein?
- if( IsInProtectTable( TRUE ) )
+ if( IsInProtectTable( sal_True ) )
pFrm = 0;
}
}
@@ -395,7 +396,7 @@ BOOL SwCursor::IsSelOvr( int eFlags )
{
DeleteMark();
RestoreSavePos();
- return TRUE; // ohne Frames geht gar nichts!
+ return sal_True; // ohne Frames geht gar nichts!
}
}
@@ -404,19 +405,19 @@ BOOL SwCursor::IsSelOvr( int eFlags )
{
DeleteMark();
RestoreSavePos();
- return TRUE;
+ return sal_True;
}
if( !HasMark() )
- return FALSE;
+ return sal_False;
//JP 19.08.98: teste mal auf ungueltige Selektion - sprich ueber
// GrundSections:
- if( !::CheckNodesRange( GetMark()->nNode, GetPoint()->nNode, TRUE ))
+ if( !::CheckNodesRange( GetMark()->nNode, GetPoint()->nNode, sal_True ))
{
DeleteMark();
RestoreSavePos();
- return TRUE; // ohne Frames geht gar nichts!
+ return sal_True; // ohne Frames geht gar nichts!
}
const SwTableNode* pPtNd = pNd->FindTableNode();
@@ -426,21 +427,21 @@ BOOL SwCursor::IsSelOvr( int eFlags )
{
DeleteMark();
RestoreSavePos();
- return TRUE; // ohne Frames geht gar nichts!
+ return sal_True; // ohne Frames geht gar nichts!
}
const SwTableNode* pMrkNd = pNd->FindTableNode();
// beide in keinem oder beide im gleichen TableNode
if( ( !pMrkNd && !pPtNd ) || pPtNd == pMrkNd )
- return FALSE;
+ return sal_False;
// in unterschiedlichen Tabellen oder nur Mark in der Tabelle
if( ( pPtNd && pMrkNd ) || pMrkNd )
{ // dann lasse das nicht zu, alte Pos zurueck
RestoreSavePos();
// Crsr bleibt an der alten Position
- return TRUE;
+ return sal_True;
}
// ACHTUNG: dieses kann nicht im TableMode geschehen !!
@@ -448,14 +449,14 @@ BOOL SwCursor::IsSelOvr( int eFlags )
{
if( nsSwCursorSelOverFlags::SELOVER_CHANGEPOS & eFlags )
{
- BOOL bSelTop = GetPoint()->nNode.GetIndex() <
+ sal_Bool bSelTop = GetPoint()->nNode.GetIndex() <
(( nsSwCursorSelOverFlags::SELOVER_TOGGLE & eFlags ) ? pSavePos->nNode
: GetMark()->nNode.GetIndex());
do {
// in Schleife fuer Tabelle hinter Tabelle
- ULONG nSEIdx = pPtNd->EndOfSectionIndex();
- ULONG nSttEndTbl = nSEIdx + 1; // dflt. Sel. nach unten
+ sal_uLong nSEIdx = pPtNd->EndOfSectionIndex();
+ sal_uLong nSttEndTbl = nSEIdx + 1; // dflt. Sel. nach unten
if( bSelTop ) // Sel. nach oben
nSttEndTbl = rNds[ nSEIdx ]->StartOfSectionIndex() - 1;
@@ -468,8 +469,8 @@ BOOL SwCursor::IsSelOvr( int eFlags )
{
// die lassen wir zu:
pMyNd = bSelTop
- ? rNds.GoPrevSection( &GetPoint()->nNode,TRUE,FALSE )
- : rNds.GoNextSection( &GetPoint()->nNode,TRUE,FALSE );
+ ? rNds.GoPrevSection( &GetPoint()->nNode,sal_True,sal_False )
+ : rNds.GoNextSection( &GetPoint()->nNode,sal_True,sal_False );
/* #i12312# Handle failure of Go{Prev|Next}Section */
if ( 0 == pMyNd)
@@ -481,7 +482,7 @@ BOOL SwCursor::IsSelOvr( int eFlags )
if( pMyNd->IsCntntNode() && // ist es ein ContentNode ??
::CheckNodesRange( GetMark()->nNode,
- GetPoint()->nNode, TRUE ))
+ GetPoint()->nNode, sal_True ))
{
// TABLE IN TABLE
const SwTableNode* pOuterTableNd = pMyNd->FindTableNode();
@@ -492,21 +493,21 @@ BOOL SwCursor::IsSelOvr( int eFlags )
SwCntntNode* pCNd = (SwCntntNode*)pMyNd;
xub_StrLen nTmpPos = bSelTop ? pCNd->Len() : 0;
GetPoint()->nContent.Assign( pCNd, nTmpPos );
- return FALSE;
+ return sal_False;
}
}
if( bSelTop
? ( !pMyNd->IsEndNode() || 0 == ( pPtNd = pMyNd->FindTableNode() ))
: 0 == ( pPtNd = pMyNd->GetTableNode() ))
break;
- } while( TRUE );
+ } while( sal_True );
}
// dann verbleibe auf der alten Position
RestoreSavePos();
- return TRUE; // Crsr bleibt an der alten Position
+ return sal_True; // Crsr bleibt an der alten Position
}
- return FALSE; // was bleibt noch ??
+ return sal_False; // was bleibt noch ??
}
#if defined( UNX )
@@ -516,20 +517,20 @@ BOOL SwCursor::IsSelOvr( int eFlags )
#endif
-BOOL SwCursor::IsInProtectTable( BOOL bMove, BOOL bChgCrsr )
+sal_Bool SwCursor::IsInProtectTable( sal_Bool bMove, sal_Bool bChgCrsr )
{
SwCntntNode* pCNd = GetCntntNode();
if( !pCNd )
- return FALSE;
+ return sal_False;
// No table, no protected cell:
const SwTableNode* pTableNode = pCNd->FindTableNode();
if ( !pTableNode )
- return FALSE;
+ return sal_False;
// Current position == last save position?
if ( pSavePos->nNode == GetPoint()->nNode.GetIndex() )
- return FALSE;
+ return sal_False;
// Check for convered cell:
bool bInCoveredCell = false;
@@ -544,11 +545,11 @@ BOOL SwCursor::IsInProtectTable( BOOL bMove, BOOL bChgCrsr )
{
// Position not protected?
if ( !pCNd->IsProtect() )
- return FALSE;
+ return sal_False;
// Cursor in protected cells allowed?
if ( IsReadOnlyAvailable() )
- return FALSE;
+ return sal_False;
}
// If we reach this point, we are in a protected or covered table cell!
@@ -558,7 +559,7 @@ BOOL SwCursor::IsInProtectTable( BOOL bMove, BOOL bChgCrsr )
if( bChgCrsr )
// restore the last save position
RestoreSavePos();
- return TRUE; // Crsr bleibt an der alten Position
+ return sal_True; // Crsr bleibt an der alten Position
}
// wir stehen in einer geschuetzten TabellenZelle
@@ -575,7 +576,7 @@ BOOL SwCursor::IsInProtectTable( BOOL bMove, BOOL bChgCrsr )
#else
SwNodeIndex aCellStt( *GetNode()->FindTableBoxStartNode()->EndOfSectionNode(), 1 );
#endif
- BOOL bProt = TRUE;
+ sal_Bool bProt = sal_True;
GoNextCell:
do {
if( !IDX.GetNode().IsStartNode() )
@@ -599,7 +600,7 @@ SetNextCrsr:
if( pTmpCNd )
{
GetPoint()->nContent.Assign( pTmpCNd, 0 );
- return FALSE;
+ return sal_False;
}
return IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE |
nsSwCursorSelOverFlags::SELOVER_CHANGEPOS );
@@ -616,12 +617,12 @@ SetNextCrsr:
#if defined( UNX )
delete pCellStt;
#endif
- return TRUE; // Crsr bleibt an der alten Position
+ return sal_True; // Crsr bleibt an der alten Position
}
else if( pNd->IsTableNode() && IDX++ )
goto GoNextCell;
- bProt = FALSE; // Index steht jetzt auf einem ContentNode
+ bProt = sal_False; // Index steht jetzt auf einem ContentNode
goto SetNextCrsr;
}
@@ -636,7 +637,7 @@ SetNextCrsr:
SwNodeIndex aCellStt( *GetNode()->FindTableBoxStartNode(), -1 );
#endif
SwNode* pNd;
- BOOL bProt = TRUE;
+ sal_Bool bProt = sal_True;
GoPrevCell:
do {
if( !( pNd = &IDX.GetNode())->IsEndNode() )
@@ -660,7 +661,7 @@ SetPrevCrsr:
if( pTmpCNd )
{
GetPoint()->nContent.Assign( pTmpCNd, 0 );
- return FALSE;
+ return sal_False;
}
return IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE |
nsSwCursorSelOverFlags::SELOVER_CHANGEPOS );
@@ -676,18 +677,18 @@ SetPrevCrsr:
#if defined( UNX )
delete pCellStt;
#endif
- return TRUE; // Crsr bleibt an der alten Position
+ return sal_True; // Crsr bleibt an der alten Position
}
else if( pNd->StartOfSectionNode()->IsTableNode() && IDX-- )
goto GoPrevCell;
- bProt = FALSE; // Index steht jetzt auf einem ContentNode
+ bProt = sal_False; // Index steht jetzt auf einem ContentNode
goto SetPrevCrsr;
}
}
-// TRUE: an die Position kann der Cursor gesetzt werden
-BOOL SwCursor::IsAtValidPos( BOOL bPoint ) const
+// sal_True: an die Position kann der Cursor gesetzt werden
+sal_Bool SwCursor::IsAtValidPos( sal_Bool bPoint ) const
{
const SwDoc* pDoc = GetDoc();
const SwPosition* pPos = bPoint ? GetPoint() : GetMark();
@@ -696,23 +697,23 @@ BOOL SwCursor::IsAtValidPos( BOOL bPoint ) const
if( pNd->IsCntntNode() && !((SwCntntNode*)pNd)->getLayoutFrm( pDoc->GetCurrentLayout() ) &&
!dynamic_cast<const SwUnoCrsr*>(this) )
{
- return FALSE;
+ return sal_False;
}
//JP 28.10.97: Bug 45129 - im UI-ReadOnly ist alles erlaubt
if( !pDoc->GetDocShell() || !pDoc->GetDocShell()->IsReadOnlyUI() )
- return TRUE;
+ return sal_True;
- BOOL bCrsrInReadOnly = IsReadOnlyAvailable();
+ sal_Bool bCrsrInReadOnly = IsReadOnlyAvailable();
if( !bCrsrInReadOnly && pNd->IsProtect() )
- return FALSE;
+ return sal_False;
const SwSectionNode* pSectNd = pNd->FindSectionNode();
if( pSectNd && (pSectNd->GetSection().IsHiddenFlag() ||
( !bCrsrInReadOnly && pSectNd->GetSection().IsProtectFlag() )))
- return FALSE;
+ return sal_False;
- return TRUE;
+ return sal_True;
}
void SwCursor::SaveTblBoxCntnt( const SwPosition* ) {}
@@ -734,22 +735,22 @@ SwMoveFnCollection* SwCursor::MakeFindRange( SwDocPositions nStart,
}
-ULONG lcl_FindSelection( SwFindParas& rParas, SwCursor* pCurCrsr,
+sal_uLong lcl_FindSelection( SwFindParas& rParas, SwCursor* pCurCrsr,
SwMoveFn fnMove, SwCursor*& pFndRing,
SwPaM& aRegion, FindRanges eFndRngs,
- BOOL bInReadOnly, BOOL& bCancel )
+ sal_Bool bInReadOnly, sal_Bool& bCancel )
{
SwDoc* pDoc = pCurCrsr->GetDoc();
- BOOL bDoesUndo = pDoc->DoesUndo();
+ bool const bDoesUndo = pDoc->GetIDocumentUndoRedo().DoesUndo();
int nFndRet = 0;
- ULONG nFound = 0;
- int bSrchBkwrd = fnMove == fnMoveBackward, bEnde = FALSE;
+ sal_uLong nFound = 0;
+ int bSrchBkwrd = fnMove == fnMoveBackward, bEnde = sal_False;
SwPaM *pTmpCrsr = pCurCrsr, *pSaveCrsr = pCurCrsr;
// only create progress-bar for ShellCrsr
bool bIsUnoCrsr = 0 != dynamic_cast<SwUnoCrsr*>(pCurCrsr);
_PercentHdl* pPHdl = 0;
- USHORT nCrsrCnt = 0;
+ sal_uInt16 nCrsrCnt = 0;
if( FND_IN_SEL & eFndRngs )
{
while( pCurCrsr != ( pTmpCrsr = (SwPaM*)pTmpCrsr->GetNext() ))
@@ -799,25 +800,26 @@ ULONG lcl_FindSelection( SwFindParas& rParas, SwCursor* pCurCrsr,
if( !( eFndRngs & FND_IN_SELALL) )
{
- bEnde = TRUE;
+ bEnde = sal_True;
break;
}
- if( coSrchRplcThreshold == nFound && pDoc->DoesUndo()
+ if ((coSrchRplcThreshold == nFound)
+ && pDoc->GetIDocumentUndoRedo().DoesUndo()
&& rParas.IsReplaceMode())
{
short nRet = pCurCrsr->MaxReplaceArived();
if( RET_YES == nRet )
{
- pDoc->DelAllUndoObj();
- pDoc->DoUndo( FALSE );
+ pDoc->GetIDocumentUndoRedo().DelAllUndoObj();
+ pDoc->GetIDocumentUndoRedo().DoUndo(false);
}
else
{
- bEnde = TRUE;
+ bEnde = sal_True;
if(RET_CANCEL == nRet)
{
- bCancel = TRUE;
+ bCancel = sal_True;
//unwind() ??
}
break;
@@ -855,7 +857,7 @@ ULONG lcl_FindSelection( SwFindParas& rParas, SwCursor* pCurCrsr,
pFndRing = pCurCrsr->Create();
delete pPHdl;
- pDoc->DoUndo( bDoesUndo );
+ pDoc->GetIDocumentUndoRedo().DoUndo(bDoesUndo);
return nFound;
}
@@ -864,7 +866,7 @@ int lcl_MakeSelFwrd( const SwNode& rSttNd, const SwNode& rEndNd,
SwPaM& rPam, int bFirst )
{
if( rSttNd.GetIndex() + 1 == rEndNd.GetIndex() )
- return FALSE;
+ return sal_False;
SwNodes& rNds = rPam.GetDoc()->GetNodes();
rPam.DeleteMark();
@@ -874,18 +876,18 @@ int lcl_MakeSelFwrd( const SwNode& rSttNd, const SwNode& rEndNd,
rPam.GetPoint()->nNode = rSttNd;
pCNd = rNds.GoNext( &rPam.GetPoint()->nNode );
if( !pCNd )
- return FALSE;
+ return sal_False;
pCNd->MakeStartIndex( &rPam.GetPoint()->nContent );
}
else if( rSttNd.GetIndex() > rPam.GetPoint()->nNode.GetIndex() ||
rPam.GetPoint()->nNode.GetIndex() >= rEndNd.GetIndex() )
- return FALSE; // steht nicht in dieser Section
+ return sal_False; // steht nicht in dieser Section
rPam.SetMark();
rPam.GetPoint()->nNode = rEndNd;
pCNd = rNds.GoPrevious( &rPam.GetPoint()->nNode );
if( !pCNd )
- return FALSE;
+ return sal_False;
pCNd->MakeEndIndex( &rPam.GetPoint()->nContent );
return *rPam.GetMark() < *rPam.GetPoint();
@@ -896,7 +898,7 @@ int lcl_MakeSelBkwrd( const SwNode& rSttNd, const SwNode& rEndNd,
SwPaM& rPam, int bFirst )
{
if( rEndNd.GetIndex() + 1 == rSttNd.GetIndex() )
- return FALSE;
+ return sal_False;
SwNodes& rNds = rPam.GetDoc()->GetNodes();
rPam.DeleteMark();
@@ -906,18 +908,18 @@ int lcl_MakeSelBkwrd( const SwNode& rSttNd, const SwNode& rEndNd,
rPam.GetPoint()->nNode = rSttNd;
pCNd = rNds.GoPrevious( &rPam.GetPoint()->nNode );
if( !pCNd )
- return FALSE;
+ return sal_False;
pCNd->MakeEndIndex( &rPam.GetPoint()->nContent );
}
else if( rEndNd.GetIndex() > rPam.GetPoint()->nNode.GetIndex() ||
rPam.GetPoint()->nNode.GetIndex() >= rSttNd.GetIndex() )
- return FALSE; // steht nicht in dieser Section
+ return sal_False; // steht nicht in dieser Section
rPam.SetMark();
rPam.GetPoint()->nNode = rEndNd;
pCNd = rNds.GoNext( &rPam.GetPoint()->nNode );
if( !pCNd )
- return FALSE;
+ return sal_False;
pCNd->MakeStartIndex( &rPam.GetPoint()->nContent );
return *rPam.GetPoint() < *rPam.GetMark();
@@ -927,20 +929,20 @@ int lcl_MakeSelBkwrd( const SwNode& rSttNd, const SwNode& rEndNd,
// diese Methode "sucht" fuer alle Anwendungsfaelle, denn in SwFindParas
// steht immer die richtigen Parameter und die entsprechende Find-Methode
-ULONG SwCursor::FindAll( SwFindParas& rParas,
+sal_uLong SwCursor::FindAll( SwFindParas& rParas,
SwDocPositions nStart, SwDocPositions nEnde,
- FindRanges eFndRngs, BOOL& bCancel )
+ FindRanges eFndRngs, sal_Bool& bCancel )
{
- bCancel = FALSE;
+ bCancel = sal_False;
SwCrsrSaveState aSaveState( *this );
// Region erzeugen, ohne das diese in den Ring aufgenommen wird !
SwPaM aRegion( *GetPoint() );
SwMoveFn fnMove = MakeFindRange( nStart, nEnde, &aRegion );
- ULONG nFound = 0;
+ sal_uLong nFound = 0;
int bMvBkwrd = fnMove == fnMoveBackward;
- BOOL bInReadOnly = IsReadOnlyAvailable();
+ sal_Bool bInReadOnly = IsReadOnlyAvailable();
SwCursor* pFndRing = 0;
SwNodes& rNds = GetDoc()->GetNodes();
@@ -1035,8 +1037,8 @@ ULONG SwCursor::FindAll( SwFindParas& rParas,
: rNds.GetEndOfPostIts().StartOfSectionNode();
if( bMvBkwrd
- ? lcl_MakeSelBkwrd( rNds.GetEndOfContent(), *pSttNd,*this, FALSE )
- : lcl_MakeSelFwrd( *pSttNd, rNds.GetEndOfContent(), *this, FALSE ))
+ ? lcl_MakeSelBkwrd( rNds.GetEndOfContent(), *pSttNd,*this, sal_False )
+ : lcl_MakeSelFwrd( *pSttNd, rNds.GetEndOfContent(), *this, sal_False ))
{
nFound = lcl_FindSelection( rParas, this, fnMove, pFndRing,
aRegion, eFndRngs, bInReadOnly, bCancel );
@@ -1090,7 +1092,7 @@ ULONG SwCursor::FindAll( SwFindParas& rParas,
void SwCursor::FillFindPos( SwDocPositions ePos, SwPosition& rPos ) const
{
- BOOL bIsStart = TRUE;
+ sal_Bool bIsStart = sal_True;
SwCntntNode* pCNd = 0;
SwNodes& rNds = GetDoc()->GetNodes();
@@ -1104,18 +1106,18 @@ void SwCursor::FillFindPos( SwDocPositions ePos, SwPosition& rPos ) const
case DOCPOS_END:
rPos.nNode = rNds.GetEndOfContent();
pCNd = rNds.GoPrevious( &rPos.nNode );
- bIsStart = FALSE;
+ bIsStart = sal_False;
break;
case DOCPOS_OTHERSTART:
- rPos.nNode = *rNds[ ULONG(0) ];
+ rPos.nNode = *rNds[ sal_uLong(0) ];
pCNd = rNds.GoNext( &rPos.nNode );
break;
case DOCPOS_OTHEREND:
rPos.nNode = *rNds.GetEndOfContent().StartOfSectionNode();
pCNd = rNds.GoPrevious( &rPos.nNode );
- bIsStart = FALSE;
+ bIsStart = sal_False;
break;
// case DOCPOS_CURR:
@@ -1138,49 +1140,53 @@ short SwCursor::MaxReplaceArived()
}
-BOOL SwCursor::IsStartWord( sal_Int16 nWordType ) const
+sal_Bool SwCursor::IsStartWord( sal_Int16 nWordType ) const
{
return IsStartWordWT( nWordType );
}
-BOOL SwCursor::IsEndWord( sal_Int16 nWordType ) const
+sal_Bool SwCursor::IsEndWord( sal_Int16 nWordType ) const
{
return IsEndWordWT( nWordType );
}
-BOOL SwCursor::IsInWord( sal_Int16 nWordType ) const
+sal_Bool SwCursor::IsInWord( sal_Int16 nWordType ) const
{
return IsInWordWT( nWordType );
}
-BOOL SwCursor::GoStartWord()
+sal_Bool SwCursor::GoStartWord()
{
return GoStartWordWT( WordType::ANYWORD_IGNOREWHITESPACES );
}
-BOOL SwCursor::GoEndWord()
+sal_Bool SwCursor::GoEndWord()
{
return GoEndWordWT( WordType::ANYWORD_IGNOREWHITESPACES );
}
-BOOL SwCursor::GoNextWord()
+sal_Bool SwCursor::GoNextWord()
{
return GoNextWordWT( WordType::ANYWORD_IGNOREWHITESPACES );
}
-BOOL SwCursor::GoPrevWord()
+sal_Bool SwCursor::GoPrevWord()
{
return GoPrevWordWT( WordType::ANYWORD_IGNOREWHITESPACES );
}
+<<<<<<< local
BOOL SwCursor::SelectWord( ViewShell* pViewShell, const Point* pPt )
+=======
+sal_Bool SwCursor::SelectWord( const Point* pPt )
+>>>>>>> other
{
return SelectWordWT( pViewShell, WordType::ANYWORD_IGNOREWHITESPACES, pPt );
}
-BOOL SwCursor::IsStartWordWT( sal_Int16 nWordType ) const
+sal_Bool SwCursor::IsStartWordWT( sal_Int16 nWordType ) const
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
const SwTxtNode* pTxtNd = GetNode()->GetTxtNode();
if( pTxtNd && pBreakIt->GetBreakIter().is() )
{
@@ -1193,9 +1199,9 @@ BOOL SwCursor::IsStartWordWT( sal_Int16 nWordType ) const
return bRet;
}
-BOOL SwCursor::IsEndWordWT( sal_Int16 nWordType ) const
+sal_Bool SwCursor::IsEndWordWT( sal_Int16 nWordType ) const
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
const SwTxtNode* pTxtNd = GetNode()->GetTxtNode();
if( pTxtNd && pBreakIt->GetBreakIter().is() )
{
@@ -1209,9 +1215,9 @@ BOOL SwCursor::IsEndWordWT( sal_Int16 nWordType ) const
return bRet;
}
-BOOL SwCursor::IsInWordWT( sal_Int16 nWordType ) const
+sal_Bool SwCursor::IsInWordWT( sal_Int16 nWordType ) const
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
const SwTxtNode* pTxtNd = GetNode()->GetTxtNode();
if( pTxtNd && pBreakIt->GetBreakIter().is() )
{
@@ -1220,7 +1226,7 @@ BOOL SwCursor::IsInWordWT( sal_Int16 nWordType ) const
pTxtNd->GetTxt(), nPtPos,
pBreakIt->GetLocale( pTxtNd->GetLang( nPtPos ) ),
nWordType,
- TRUE );
+ sal_True );
bRet = aBoundary.startPos != aBoundary.endPos &&
aBoundary.startPos <= nPtPos &&
@@ -1234,9 +1240,9 @@ BOOL SwCursor::IsInWordWT( sal_Int16 nWordType ) const
return bRet;
}
-BOOL SwCursor::IsStartEndSentence( bool bEnd ) const
+sal_Bool SwCursor::IsStartEndSentence( bool bEnd ) const
{
- BOOL bRet = bEnd ?
+ sal_Bool bRet = bEnd ?
GetCntntNode() && GetPoint()->nContent == GetCntntNode()->Len() :
GetPoint()->nContent.GetIndex() == 0;
@@ -1251,9 +1257,9 @@ BOOL SwCursor::IsStartEndSentence( bool bEnd ) const
return bRet;
}
-BOOL SwCursor::GoStartWordWT( sal_Int16 nWordType )
+sal_Bool SwCursor::GoStartWordWT( sal_Int16 nWordType )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
const SwTxtNode* pTxtNd = GetNode()->GetTxtNode();
if( pTxtNd && pBreakIt->GetBreakIter().is() )
{
@@ -1263,21 +1269,21 @@ BOOL SwCursor::GoStartWordWT( sal_Int16 nWordType )
pTxtNd->GetTxt(), nPtPos,
pBreakIt->GetLocale( pTxtNd->GetLang( nPtPos ) ),
nWordType,
- FALSE ).startPos;
+ sal_False ).startPos;
if( nPtPos < pTxtNd->GetTxt().Len() )
{
GetPoint()->nContent = nPtPos;
if( !IsSelOvr() )
- bRet = TRUE;
+ bRet = sal_True;
}
}
return bRet;
}
-BOOL SwCursor::GoEndWordWT( sal_Int16 nWordType )
+sal_Bool SwCursor::GoEndWordWT( sal_Int16 nWordType )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
const SwTxtNode* pTxtNd = GetNode()->GetTxtNode();
if( pTxtNd && pBreakIt->GetBreakIter().is() )
{
@@ -1287,22 +1293,22 @@ BOOL SwCursor::GoEndWordWT( sal_Int16 nWordType )
pTxtNd->GetTxt(), nPtPos,
pBreakIt->GetLocale( pTxtNd->GetLang( nPtPos ) ),
nWordType,
- TRUE ).endPos;
+ sal_True ).endPos;
if( nPtPos <= pTxtNd->GetTxt().Len() &&
GetPoint()->nContent.GetIndex() != nPtPos )
{
GetPoint()->nContent = nPtPos;
if( !IsSelOvr() )
- bRet = TRUE;
+ bRet = sal_True;
}
}
return bRet;
}
-BOOL SwCursor::GoNextWordWT( sal_Int16 nWordType )
+sal_Bool SwCursor::GoNextWordWT( sal_Int16 nWordType )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
const SwTxtNode* pTxtNd = GetNode()->GetTxtNode();
if( pTxtNd && pBreakIt->GetBreakIter().is() )
{
@@ -1318,15 +1324,15 @@ BOOL SwCursor::GoNextWordWT( sal_Int16 nWordType )
{
GetPoint()->nContent = nPtPos;
if( !IsSelOvr() )
- bRet = TRUE;
+ bRet = sal_True;
}
}
return bRet;
}
-BOOL SwCursor::GoPrevWordWT( sal_Int16 nWordType )
+sal_Bool SwCursor::GoPrevWordWT( sal_Int16 nWordType )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
const SwTxtNode* pTxtNd = GetNode()->GetTxtNode();
if( pTxtNd && pBreakIt->GetBreakIter().is() )
{
@@ -1345,18 +1351,22 @@ BOOL SwCursor::GoPrevWordWT( sal_Int16 nWordType )
{
GetPoint()->nContent = nPtPos;
if( !IsSelOvr() )
- bRet = TRUE;
+ bRet = sal_True;
}
}
return bRet;
}
+<<<<<<< local
BOOL SwCursor::SelectWordWT( ViewShell* pViewShell, sal_Int16 nWordType, const Point* pPt )
+=======
+sal_Bool SwCursor::SelectWordWT( sal_Int16 nWordType, const Point* pPt )
+>>>>>>> other
{
SwCrsrSaveState aSave( *this );
- BOOL bRet = FALSE;
- BOOL bForward = TRUE;
+ sal_Bool bRet = sal_False;
+ sal_Bool bForward = sal_True;
DeleteMark();
const SwRootFrm* pLayout = pViewShell->GetLayout();
if( pPt && 0 != pLayout )
@@ -1384,7 +1394,7 @@ BOOL SwCursor::SelectWordWT( ViewShell* pViewShell, sal_Int16 nWordType, const P
SetMark();
GetMark()->nContent = (xub_StrLen)aBndry.startPos;
if( !IsSelOvr() )
- bRet = TRUE;
+ bRet = sal_True;
}
}
}
@@ -1410,7 +1420,7 @@ static String lcl_MaskDeletedRedlines( const SwTxtNode* pTxtNd )
const bool nShowChg = IDocumentRedlineAccess::IsShowChanges( rDoc.GetRedlineMode() );
if ( nShowChg )
{
- USHORT nAct = rDoc.GetRedlinePos( *pTxtNd, USHRT_MAX );
+ sal_uInt16 nAct = rDoc.GetRedlinePos( *pTxtNd, USHRT_MAX );
for ( ; nAct < rDoc.GetRedlineTbl().Count(); nAct++ )
{
const SwRedline* pRed = rDoc.GetRedlineTbl()[ nAct ];
@@ -1432,9 +1442,9 @@ static String lcl_MaskDeletedRedlines( const SwTxtNode* pTxtNd )
return aRes;
}
-BOOL SwCursor::GoSentence( SentenceMoveType eMoveType )
+sal_Bool SwCursor::GoSentence( SentenceMoveType eMoveType )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
const SwTxtNode* pTxtNd = GetNode()->GetTxtNode();
if( pTxtNd && pBreakIt->GetBreakIter().is() )
{
@@ -1462,7 +1472,7 @@ BOOL SwCursor::GoSentence( SentenceMoveType eMoveType )
sNodeText,
nPtPos, pBreakIt->GetLocale(
pTxtNd->GetLang( nPtPos ) ));
- while (nPtPos != (USHORT) -1 && ++nPtPos < sNodeText.Len()
+ while (nPtPos != (sal_uInt16) -1 && ++nPtPos < sNodeText.Len()
&& sNodeText.GetChar(nPtPos)== ' ' /*isWhiteSpace( aTxt.GetChar(nPtPos)*/ )
;
break;
@@ -1473,7 +1483,7 @@ BOOL SwCursor::GoSentence( SentenceMoveType eMoveType )
nPtPos, pBreakIt->GetLocale(
pTxtNd->GetLang( nPtPos ) ));
if (nPtPos == 0)
- return FALSE; // the previous sentence is not in this paragraph
+ return sal_False; // the previous sentence is not in this paragraph
if (nPtPos > 0)
nPtPos = (xub_StrLen)pBreakIt->GetBreakIter()->beginOfSentence(
sNodeText,
@@ -1488,16 +1498,16 @@ BOOL SwCursor::GoSentence( SentenceMoveType eMoveType )
{
GetPoint()->nContent = nPtPos;
if( !IsSelOvr() )
- bRet = TRUE;
+ bRet = sal_True;
}
}
return bRet;
}
-BOOL SwCursor::ExpandToSentenceBorders()
+sal_Bool SwCursor::ExpandToSentenceBorders()
{
- BOOL bRes = FALSE;
+ sal_Bool bRes = sal_False;
const SwTxtNode* pStartNd = Start()->nNode.GetNode().GetTxtNode();
const SwTxtNode* pEndNd = End()->nNode.GetNode().GetTxtNode();
if (pStartNd && pEndNd && pBreakIt->GetBreakIter().is())
@@ -1533,14 +1543,14 @@ BOOL SwCursor::ExpandToSentenceBorders()
bChanged = true;
}
if (bChanged && !IsSelOvr())
- bRes = TRUE;
+ bRes = sal_True;
}
return bRes;
}
-BOOL SwTableCursor::LeftRight( BOOL bLeft, USHORT nCnt, USHORT /*nMode*/,
- BOOL /*bVisualAllowed*/, BOOL /*bSkipHidden*/, BOOL /*bInsertCrsr*/ )
+sal_Bool SwTableCursor::LeftRight( sal_Bool bLeft, sal_uInt16 nCnt, sal_uInt16 /*nMode*/,
+ sal_Bool /*bVisualAllowed*/, sal_Bool /*bSkipHidden*/, sal_Bool /*bInsertCrsr*/ )
{
return bLeft ? GoPrevCell( nCnt )
: GoNextCell( nCnt );
@@ -1550,7 +1560,7 @@ BOOL SwTableCursor::LeftRight( BOOL bLeft, USHORT nCnt, USHORT /*nMode*/,
// calculate cursor bidi level: extracted from LeftRight()
const SwCntntFrm*
SwCursor::DoSetBidiLevelLeftRight(
- BOOL & io_rbLeft, BOOL bVisualAllowed, BOOL bInsertCrsr)
+ sal_Bool & io_rbLeft, sal_Bool bVisualAllowed, sal_Bool bInsertCrsr)
{
// calculate cursor bidi level
const SwCntntFrm* pSttFrm = NULL;
@@ -1573,7 +1583,7 @@ SwCursor::DoSetBidiLevelLeftRight(
pSttFrm = rTNd.getLayoutFrm( GetDoc()->GetCurrentLayout(), &aPt, GetPoint() );
if( pSttFrm )
{
- BYTE nCrsrLevel = GetCrsrBidiLevel();
+ sal_uInt8 nCrsrLevel = GetCrsrBidiLevel();
sal_Bool bForward = ! io_rbLeft;
((SwTxtFrm*)pSttFrm)->PrepareVisualMove( nPos, nCrsrLevel,
bForward, bInsertCrsr );
@@ -1597,8 +1607,8 @@ SwCursor::DoSetBidiLevelLeftRight(
return pSttFrm;
}
-BOOL SwCursor::LeftRight( BOOL bLeft, USHORT nCnt, USHORT nMode,
- BOOL bVisualAllowed,BOOL bSkipHidden, BOOL bInsertCrsr )
+sal_Bool SwCursor::LeftRight( sal_Bool bLeft, sal_uInt16 nCnt, sal_uInt16 nMode,
+ sal_Bool bVisualAllowed,sal_Bool bSkipHidden, sal_Bool bInsertCrsr )
{
// calculate cursor bidi level
SwNode& rNode = GetPoint()->nNode.GetNode();
@@ -1648,12 +1658,12 @@ BOOL SwCursor::LeftRight( BOOL bLeft, USHORT nCnt, USHORT nMode,
const long nRowSpan = pTableBox->getRowSpan();
if ( nRowSpan > 1 )
{
- pTableBox = & pTableBox->FindEndOfRowSpan( pOldTabSttNode->GetTable(), (USHORT)(pTableBox->getRowSpan() + mnRowSpanOffset ) );
+ pTableBox = & pTableBox->FindEndOfRowSpan( pOldTabSttNode->GetTable(), (sal_uInt16)(pTableBox->getRowSpan() + mnRowSpanOffset ) );
SwNodeIndex& rPtIdx = GetPoint()->nNode;
SwNodeIndex aNewIdx( *pTableBox->GetSttNd() );
rPtIdx = aNewIdx;
- GetDoc()->GetNodes().GoNextSection( &rPtIdx, FALSE, FALSE );
+ GetDoc()->GetNodes().GoNextSection( &rPtIdx, sal_False, sal_False );
SwCntntNode* pCntntNode = GetCntntNode();
if ( pCntntNode )
{
@@ -1689,7 +1699,7 @@ BOOL SwCursor::LeftRight( BOOL bLeft, USHORT nCnt, USHORT nMode,
SwNodeIndex aNewIdx( *pTableBox->GetSttNd() );
rPtIdx = aNewIdx;
- GetDoc()->GetNodes().GoNextSection( &rPtIdx, FALSE, FALSE );
+ GetDoc()->GetNodes().GoNextSection( &rPtIdx, sal_False, sal_False );
SwCntntNode* pCntntNode = GetCntntNode();
if ( pCntntNode )
{
@@ -1723,7 +1733,7 @@ BOOL SwCursor::LeftRight( BOOL bLeft, USHORT nCnt, USHORT nMode,
}
}
- return 0 == nCnt && !IsInProtectTable( TRUE ) &&
+ return 0 == nCnt && !IsInProtectTable( sal_True ) &&
!IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE |
nsSwCursorSelOverFlags::SELOVER_CHANGEPOS );
}
@@ -1743,8 +1753,8 @@ void SwCursor::DoSetBidiLevelUpDown()
if( nPos && nPos < ((SwTxtNode&)rNode).GetTxt().Len() )
{
- const BYTE nCurrLevel = pSI->DirType( nPos );
- const BYTE nPrevLevel = pSI->DirType( nPos - 1 );
+ const sal_uInt8 nCurrLevel = pSI->DirType( nPos );
+ const sal_uInt8 nPrevLevel = pSI->DirType( nPos - 1 );
if ( nCurrLevel % 2 != nPrevLevel % 2 )
{
@@ -1758,7 +1768,7 @@ void SwCursor::DoSetBidiLevelUpDown()
}
}
-BOOL SwCursor::UpDown( BOOL bUp, USHORT nCnt,
+sal_Bool SwCursor::UpDown( sal_Bool bUp, sal_uInt16 nCnt,
Point* pPt, long nUpDownX )
{
SwTableCursor* pTblCrsr = dynamic_cast<SwTableCursor*>(this);
@@ -1766,15 +1776,15 @@ BOOL SwCursor::UpDown( BOOL bUp, USHORT nCnt,
// vom Tabellen Crsr Point/Mark in der gleichen Box ??
// dann stelle den Point an den Anfang der Box
- if( pTblCrsr && GetNode( TRUE )->StartOfSectionNode() ==
- GetNode( FALSE )->StartOfSectionNode() )
+ if( pTblCrsr && GetNode( sal_True )->StartOfSectionNode() ==
+ GetNode( sal_False )->StartOfSectionNode() )
{
if ( End() != GetPoint() )
Exchange();
bAdjustTableCrsr = sal_True;
}
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
Point aPt;
if( pPt )
aPt = *pPt;
@@ -1797,10 +1807,10 @@ BOOL SwCursor::UpDown( BOOL bUp, USHORT nCnt,
// Bei Fussnoten ist auch die Bewegung in eine andere Fussnote erlaubt.
// aber keine Selection!!
- const BOOL bChkRange = pFrm->IsInFtn() && !HasMark()
- ? FALSE : TRUE;
+ const sal_Bool bChkRange = pFrm->IsInFtn() && !HasMark()
+ ? sal_False : sal_True;
const SwPosition aOldPos( *GetPoint() );
- BOOL bInReadOnly = IsReadOnlyAvailable();
+ sal_Bool bInReadOnly = IsReadOnlyAvailable();
if ( bAdjustTableCrsr && !bUp )
{
@@ -1808,7 +1818,7 @@ BOOL SwCursor::UpDown( BOOL bUp, USHORT nCnt,
// has more than one paragraph. If we want to go down, we have to
// set the point to the last frame in the table box. This is
// only necessary if we do not already have a table selection
- const SwStartNode* pTblNd = GetNode( TRUE )->FindTableBoxStartNode();
+ const SwStartNode* pTblNd = GetNode( sal_True )->FindTableBoxStartNode();
ASSERT( pTblNd, "pTblCrsr without SwTableNode?" )
if ( pTblNd ) // safety first
@@ -1855,7 +1865,7 @@ BOOL SwCursor::UpDown( BOOL bUp, USHORT nCnt,
}
pFrm->GetCrsrOfst( GetPoint(), aPt, &eTmpState );
}
- bRet = TRUE;
+ bRet = sal_True;
}
else
*GetPoint() = aOldPos;
@@ -1866,7 +1876,7 @@ BOOL SwCursor::UpDown( BOOL bUp, USHORT nCnt,
return bRet;
}
-BOOL SwCursor::LeftRightMargin( BOOL bLeft, BOOL bAPI )
+sal_Bool SwCursor::LeftRightMargin( sal_Bool bLeft, sal_Bool bAPI )
{
Point aPt;
SwCntntFrm * pFrm = GetCntntNode()->getLayoutFrm( GetDoc()->GetCurrentLayout(), &aPt, GetPoint() );
@@ -1879,9 +1889,9 @@ BOOL SwCursor::LeftRightMargin( BOOL bLeft, BOOL bAPI )
pFrm->RightMargin( this, bAPI ) );
}
-BOOL SwCursor::IsAtLeftRightMargin( BOOL bLeft, BOOL bAPI ) const
+sal_Bool SwCursor::IsAtLeftRightMargin( sal_Bool bLeft, sal_Bool bAPI ) const
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
Point aPt;
SwCntntFrm * pFrm = GetCntntNode()->getLayoutFrm( GetDoc()->GetCurrentLayout(), &aPt, GetPoint() );
if( pFrm )
@@ -1896,16 +1906,16 @@ BOOL SwCursor::IsAtLeftRightMargin( BOOL bLeft, BOOL bAPI ) const
return bRet;
}
-BOOL SwCursor::SttEndDoc( BOOL bStt )
+sal_Bool SwCursor::SttEndDoc( sal_Bool bStt )
{
SwCrsrSaveState aSave( *this );
// Springe beim Selektieren nie ueber Section-Grenzen !!
// kann der Cursor weiterverschoben werden ?
SwMoveFn fnMove = bStt ? fnMoveBackward : fnMoveForward;
- BOOL bRet = (!HasMark() || !IsNoCntnt() ) &&
+ sal_Bool bRet = (!HasMark() || !IsNoCntnt() ) &&
Move( fnMove, fnGoDoc ) &&
- !IsInProtectTable( TRUE ) &&
+ !IsInProtectTable( sal_True ) &&
!IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE |
nsSwCursorSelOverFlags::SELOVER_CHANGEPOS |
nsSwCursorSelOverFlags::SELOVER_ENABLEREVDIREKTION );
@@ -1913,11 +1923,11 @@ BOOL SwCursor::SttEndDoc( BOOL bStt )
return bRet;
}
-BOOL SwCursor::GoPrevNextCell( BOOL bNext, USHORT nCnt )
+sal_Bool SwCursor::GoPrevNextCell( sal_Bool bNext, sal_uInt16 nCnt )
{
const SwTableNode* pTblNd = GetPoint()->nNode.GetNode().FindTableNode();
if( !pTblNd )
- return FALSE;
+ return sal_False;
// liegt vor dem StartNode der Cell ein weiterer EndNode, dann
// gibt es auch eine vorherige Celle
@@ -1935,7 +1945,7 @@ BOOL SwCursor::GoPrevNextCell( BOOL bNext, USHORT nCnt )
{
if ( pTableBox->getRowSpan() > 1 )
{
- pTableBox = & pTableBox->FindEndOfRowSpan( pTblNd->GetTable(), (USHORT)(pTableBox->getRowSpan() + mnRowSpanOffset) );
+ pTableBox = & pTableBox->FindEndOfRowSpan( pTblNd->GetTable(), (sal_uInt16)(pTableBox->getRowSpan() + mnRowSpanOffset) );
SwNodeIndex aNewIdx( *pTableBox->GetSttNd() );
rPtIdx = aNewIdx;
pTableBoxStartNode = rPtIdx.GetNode().FindTableBoxStartNode();
@@ -1950,7 +1960,7 @@ BOOL SwCursor::GoPrevNextCell( BOOL bNext, USHORT nCnt )
SwNodeIndex aCellIdx( *pTmpNode, bNext ? 1 : -1 );
if( (bNext && !aCellIdx.GetNode().IsStartNode()) ||
(!bNext && !aCellIdx.GetNode().IsEndNode()) )
- return FALSE;
+ return sal_False;
rPtIdx = bNext ? aCellIdx : SwNodeIndex(*aCellIdx.GetNode().StartOfSectionNode());
@@ -1968,20 +1978,20 @@ BOOL SwCursor::GoPrevNextCell( BOOL bNext, USHORT nCnt )
rPtIdx++;
if( !rPtIdx.GetNode().IsCntntNode() )
- GetDoc()->GetNodes().GoNextSection( &rPtIdx, TRUE, FALSE );
+ GetDoc()->GetNodes().GoNextSection( &rPtIdx, sal_True, sal_False );
GetPoint()->nContent.Assign( GetCntntNode(), 0 );
- return !IsInProtectTable( TRUE );
+ return !IsInProtectTable( sal_True );
}
-BOOL SwTableCursor::GotoTable( const String& /*rName*/ )
+sal_Bool SwTableCursor::GotoTable( const String& /*rName*/ )
{
- return FALSE; // invalid action
+ return sal_False; // invalid action
}
-BOOL SwCursor::GotoTable( const String& rName )
+sal_Bool SwCursor::GotoTable( const String& rName )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if ( !HasMark() )
{
SwTable* pTmpTbl = SwTable::FindTable( GetDoc()->FindTblFmtByName( rName ) );
@@ -1998,9 +2008,9 @@ BOOL SwCursor::GotoTable( const String& rName )
return bRet;
}
-BOOL SwCursor::GotoTblBox( const String& rName )
+sal_Bool SwCursor::GotoTblBox( const String& rName )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
const SwTableNode* pTblNd = GetPoint()->nNode.GetNode().FindTableNode();
if( pTblNd )
{
@@ -2019,7 +2029,7 @@ BOOL SwCursor::GotoTblBox( const String& rName )
return bRet;
}
-BOOL SwCursor::MovePara(SwWhichPara fnWhichPara, SwPosPara fnPosPara )
+sal_Bool SwCursor::MovePara(SwWhichPara fnWhichPara, SwPosPara fnPosPara )
{
//JP 28.8.2001: for optimization test something before
const SwNode* pNd = &GetPoint()->nNode.GetNode();
@@ -2054,26 +2064,26 @@ BOOL SwCursor::MovePara(SwWhichPara fnWhichPara, SwPosPara fnPosPara )
// a same node type.
SwCrsrSaveState aSave( *this );
return (*fnWhichPara)( *this, fnPosPara ) &&
- !IsInProtectTable( TRUE ) &&
+ !IsInProtectTable( sal_True ) &&
!IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE |
nsSwCursorSelOverFlags::SELOVER_CHANGEPOS );
}
-BOOL SwCursor::MoveSection( SwWhichSection fnWhichSect,
+sal_Bool SwCursor::MoveSection( SwWhichSection fnWhichSect,
SwPosSection fnPosSect)
{
SwCrsrSaveState aSave( *this );
return (*fnWhichSect)( *this, fnPosSect ) &&
- !IsInProtectTable( TRUE ) &&
+ !IsInProtectTable( sal_True ) &&
!IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE |
nsSwCursorSelOverFlags::SELOVER_CHANGEPOS );
}
/*
- BOOL MoveTable( SwWhichTable, SwPosTable );
- BOOL MoveColumn( SwWhichColumn, SwPosColumn );
- BOOL MoveRegion( SwWhichRegion, SwPosRegion );
+ sal_Bool MoveTable( SwWhichTable, SwPosTable );
+ sal_Bool MoveColumn( SwWhichColumn, SwPosColumn );
+ sal_Bool MoveRegion( SwWhichRegion, SwPosRegion );
*/
void SwCursor::RestoreSavePos() // Point auf die SavePos setzen
@@ -2091,8 +2101,8 @@ void SwCursor::RestoreSavePos() // Point auf die SavePos setzen
SwTableCursor::SwTableCursor( const SwPosition &rPos, SwPaM* pRing )
: SwCursor( rPos, pRing, false )
{
- bParked = FALSE;
- bChg = FALSE;
+ bParked = sal_False;
+ bChg = sal_False;
nTblPtNd = 0, nTblMkNd = 0;
nTblPtCnt = 0, nTblMkCnt = 0;
}
@@ -2100,11 +2110,11 @@ SwTableCursor::SwTableCursor( const SwPosition &rPos, SwPaM* pRing )
SwTableCursor::~SwTableCursor() {}
-BOOL lcl_SeekEntry( const SwSelBoxes& rTmp, const SwStartNode* pSrch, USHORT& rFndPos )
+sal_Bool lcl_SeekEntry( const SwSelBoxes& rTmp, const SwStartNode* pSrch, sal_uInt16& rFndPos )
{
- ULONG nIdx = pSrch->GetIndex();
+ sal_uLong nIdx = pSrch->GetIndex();
- USHORT nO = rTmp.Count(), nM, nU = 0;
+ sal_uInt16 nO = rTmp.Count(), nM, nU = 0;
if( nO > 0 )
{
nO--;
@@ -2114,17 +2124,17 @@ BOOL lcl_SeekEntry( const SwSelBoxes& rTmp, const SwStartNode* pSrch, USHORT& rF
if( rTmp[ nM ]->GetSttNd() == pSrch )
{
rFndPos = nM;
- return TRUE;
+ return sal_True;
}
else if( rTmp[ nM ]->GetSttIdx() < nIdx )
nU = nM + 1;
else if( nM == 0 )
- return FALSE;
+ return sal_False;
else
nO = nM - 1;
}
}
- return FALSE;
+ return sal_False;
}
@@ -2139,10 +2149,10 @@ SwCursor* SwTableCursor::MakeBoxSels( SwCursor* pAktCrsr )
Move( fnMoveForward );
Exchange();
Move( fnMoveForward );
- bParked = FALSE;
+ bParked = sal_False;
}
- bChg = FALSE;
+ bChg = sal_False;
// temp Kopie anlegen, damit alle Boxen, fuer die schon Cursor
// existieren, entfernt werden koennen.
@@ -2151,22 +2161,22 @@ SwCursor* SwTableCursor::MakeBoxSels( SwCursor* pAktCrsr )
//Jetzt die Alten und die neuen abgleichen.
SwNodes& rNds = pAktCrsr->GetDoc()->GetNodes();
- USHORT nPos;
+ sal_uInt16 nPos;
const SwStartNode* pSttNd;
SwPaM* pCur = pAktCrsr;
do {
- BOOL bDel = FALSE;
+ sal_Bool bDel = sal_False;
pSttNd = pCur->GetPoint()->nNode.GetNode().FindTableBoxStartNode();
if( !pCur->HasMark() || !pSttNd ||
pSttNd != pCur->GetMark()->nNode.GetNode().FindTableBoxStartNode() )
- bDel = TRUE;
+ bDel = sal_True;
else if( lcl_SeekEntry( aTmp, pSttNd, nPos ))
{
SwNodeIndex aIdx( *pSttNd, 1 );
const SwNode* pNd = &aIdx.GetNode();
if( !pNd->IsCntntNode() )
- pNd = rNds.GoNextSection( &aIdx, TRUE, FALSE );
+ pNd = rNds.GoNextSection( &aIdx, sal_True, sal_False );
SwPosition* pPos = pCur->GetMark();
if( pNd != &pPos->nNode.GetNode() )
@@ -2175,7 +2185,7 @@ SwCursor* SwTableCursor::MakeBoxSels( SwCursor* pAktCrsr )
aIdx.Assign( *pSttNd->EndOfSectionNode(), - 1 );
if( !( pNd = &aIdx.GetNode())->IsCntntNode() )
- pNd = rNds.GoPrevSection( &aIdx, TRUE, FALSE );
+ pNd = rNds.GoPrevSection( &aIdx, sal_True, sal_False );
pPos = pCur->GetPoint();
if( pNd != &pPos->nNode.GetNode() )
@@ -2185,7 +2195,7 @@ SwCursor* SwTableCursor::MakeBoxSels( SwCursor* pAktCrsr )
aTmp.Remove( nPos );
}
else
- bDel = TRUE;
+ bDel = sal_True;
pCur = (SwPaM*)pCur->GetNext();
if( bDel )
@@ -2221,7 +2231,7 @@ JP 20.07.98: der alte Code geht mit dem UNO-TableCrsr nicht
break;
const SwNode* pNd = &aIdx.GetNode();
if( !pNd->IsCntntNode() )
- pNd = rNds.GoNextSection( &aIdx, TRUE, FALSE );
+ pNd = rNds.GoNextSection( &aIdx, sal_True, sal_False );
SwPaM* pNew;
if( pAktCrsr->GetNext() == pAktCrsr && !pAktCrsr->HasMark() )
@@ -2241,7 +2251,7 @@ JP 20.07.98: der alte Code geht mit dem UNO-TableCrsr nicht
SwPosition* pPos = pNew->GetPoint();
pPos->nNode.Assign( *pSttNd->EndOfSectionNode(), - 1 );
if( !( pNd = &pPos->nNode.GetNode())->IsCntntNode() )
- pNd = rNds.GoPrevSection( &pPos->nNode, TRUE, FALSE );
+ pNd = rNds.GoPrevSection( &pPos->nNode, sal_True, sal_False );
pPos->nContent.Assign( (SwCntntNode*)pNd, ((SwCntntNode*)pNd)->Len() );
}
@@ -2254,14 +2264,14 @@ void SwTableCursor::InsertBox( const SwTableBox& rTblBox )
{
SwTableBox* pBox = (SwTableBox*)&rTblBox;
aSelBoxes.Insert( pBox );
- bChg = TRUE;
+ bChg = sal_True;
}
bool SwTableCursor::NewTableSelection()
{
bool bRet = false;
const SwNode *pStart = GetCntntNode()->FindTableBoxStartNode();
- const SwNode *pEnd = GetCntntNode(FALSE)->FindTableBoxStartNode();
+ const SwNode *pEnd = GetCntntNode(sal_False)->FindTableBoxStartNode();
if( pStart && pEnd )
{
const SwTableNode *pTableNode = pStart->FindTableNode();
@@ -2281,7 +2291,7 @@ bool SwTableCursor::NewTableSelection()
void SwTableCursor::ActualizeSelection( const SwSelBoxes &rNew )
{
- USHORT nOld = 0, nNew = 0;
+ sal_uInt16 nOld = 0, nNew = 0;
while ( nOld < aSelBoxes.Count() && nNew < rNew.Count() )
{
const SwTableBox* pPOld = *( aSelBoxes.GetData() + nOld );
@@ -2308,16 +2318,16 @@ void SwTableCursor::ActualizeSelection( const SwSelBoxes &rNew )
InsertBox( **( rNew.GetData() + nNew ) );
}
-BOOL SwTableCursor::IsCrsrMovedUpdt()
+sal_Bool SwTableCursor::IsCrsrMovedUpdt()
{
if( !IsCrsrMoved() )
- return FALSE;
+ return sal_False;
nTblMkNd = GetMark()->nNode.GetIndex();
nTblPtNd = GetPoint()->nNode.GetIndex();
nTblMkCnt = GetMark()->nContent.GetIndex();
nTblPtCnt = GetPoint()->nContent.GetIndex();
- return TRUE;
+ return sal_True;
}
@@ -2337,18 +2347,18 @@ void SwTableCursor::ParkCrsr()
GetMark()->nNode = *pNd;
GetMark()->nContent.Assign( 0, 0 );
- bChg = TRUE;
- bParked = TRUE;
+ bChg = sal_True;
+ bParked = sal_True;
}
-BOOL SwTableCursor::HasReadOnlyBoxSel() const
+sal_Bool SwTableCursor::HasReadOnlyBoxSel() const
{
- BOOL bRet = FALSE;
- for( USHORT n = aSelBoxes.Count(); n; )
+ sal_Bool bRet = sal_False;
+ for( sal_uInt16 n = aSelBoxes.Count(); n; )
if( aSelBoxes[ --n ]->GetFrmFmt()->GetProtect().IsCntntProtected() )
{
- bRet = TRUE;
+ bRet = sal_True;
break;
}
return bRet;
diff --git a/sw/source/core/crsr/trvlcol.cxx b/sw/source/core/crsr/trvlcol.cxx
index 076af3be386c..92cd87889875 100644
--- a/sw/source/core/crsr/trvlcol.cxx
+++ b/sw/source/core/crsr/trvlcol.cxx
@@ -91,9 +91,9 @@ SwPosColumn fnColumnStart = &GetColumnStt;
SwPosColumn fnColumnEnd = &GetColumnEnd;
-BOOL SwCrsrShell::MoveColumn( SwWhichColumn fnWhichCol, SwPosColumn fnPosCol )
+sal_Bool SwCrsrShell::MoveColumn( SwWhichColumn fnWhichCol, SwPosColumn fnPosCol )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( !pTblCrsr )
{
SwLayoutFrm* pLayFrm = GetCurrFrm()->GetUpper();
@@ -117,11 +117,11 @@ BOOL SwCrsrShell::MoveColumn( SwWhichColumn fnWhichCol, SwPosColumn fnPosCol )
pCnt->GetCrsrOfst( pCurCrsr->GetPoint(), aPt );
- if( !pCurCrsr->IsInProtectTable( TRUE ) &&
+ if( !pCurCrsr->IsInProtectTable( sal_True ) &&
!pCurCrsr->IsSelOvr() )
{
UpdateCrsr();
- bRet = TRUE;
+ bRet = sal_True;
}
}
}
diff --git a/sw/source/core/crsr/trvlfnfl.cxx b/sw/source/core/crsr/trvlfnfl.cxx
index 82c9b56a2489..c3eeaf61b952 100644
--- a/sw/source/core/crsr/trvlfnfl.cxx
+++ b/sw/source/core/crsr/trvlfnfl.cxx
@@ -47,21 +47,21 @@
#include <viscrs.hxx>
#include <callnk.hxx>
-BOOL SwCrsrShell::CallCrsrFN( FNCrsr fnCrsr )
+sal_Bool SwCrsrShell::CallCrsrFN( FNCrsr fnCrsr )
{
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen,
SwCursor* pCrsr = getShellCrsr( true );
- BOOL bRet = (pCrsr->*fnCrsr)();
+ sal_Bool bRet = (pCrsr->*fnCrsr)();
if( bRet )
UpdateCrsr( SwCrsrShell::SCROLLWIN | SwCrsrShell::CHKRANGE |
SwCrsrShell::READONLY );
return bRet;
}
-BOOL SwCursor::GotoFtnTxt()
+sal_Bool SwCursor::GotoFtnTxt()
{
// springe aus dem Content zur Fussnote
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
SwTxtNode* pTxtNd = GetPoint()->nNode.GetNode().GetTxtNode();
SwTxtAttr *const pFtn( (pTxtNd)
@@ -75,7 +75,7 @@ BOOL SwCursor::GotoFtnTxt()
SwCntntNode* pCNd = GetDoc()->GetNodes().GoNextSection(
&GetPoint()->nNode,
- TRUE, !IsReadOnlyAvailable() );
+ sal_True, !IsReadOnlyAvailable() );
if( pCNd )
{
GetPoint()->nContent.Assign( pCNd, 0 );
@@ -86,9 +86,9 @@ BOOL SwCursor::GotoFtnTxt()
return bRet;
}
-BOOL SwCrsrShell::GotoFtnTxt()
+sal_Bool SwCrsrShell::GotoFtnTxt()
{
- BOOL bRet = CallCrsrFN( &SwCursor::GotoFtnTxt );
+ sal_Bool bRet = CallCrsrFN( &SwCursor::GotoFtnTxt );
if( !bRet )
{
SwTxtNode* pTxtNd = _GetCrsr() ?
@@ -134,7 +134,7 @@ BOOL SwCrsrShell::GotoFtnTxt()
}
-BOOL SwCursor::GotoFtnAnchor()
+sal_Bool SwCursor::GotoFtnAnchor()
{
// springe aus der Fussnote zum Anker
const SwNode* pSttNd = GetNode()->FindFootnoteStartNode();
@@ -143,7 +143,7 @@ BOOL SwCursor::GotoFtnAnchor()
// durchsuche alle Fussnoten im Dokument nach diesem StartIndex
const SwTxtFtn* pTxtFtn;
const SwFtnIdxs& rFtnArr = pSttNd->GetDoc()->GetFtnIdxs();
- for( USHORT n = 0; n < rFtnArr.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rFtnArr.Count(); ++n )
if( 0 != ( pTxtFtn = rFtnArr[ n ])->GetStartNode() &&
pSttNd == &pTxtFtn->GetStartNode()->GetNode() )
{
@@ -158,14 +158,14 @@ BOOL SwCursor::GotoFtnAnchor()
nsSwCursorSelOverFlags::SELOVER_TOGGLE );
}
}
- return FALSE;
+ return sal_False;
}
-BOOL SwCrsrShell::GotoFtnAnchor()
+sal_Bool SwCrsrShell::GotoFtnAnchor()
{
// springe aus der Fussnote zum Anker
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen,
- BOOL bRet = pCurCrsr->GotoFtnAnchor();
+ sal_Bool bRet = pCurCrsr->GotoFtnAnchor();
if( bRet )
{
// BUG 5996: Tabellen-Kopfzeile sonderbehandeln
@@ -176,22 +176,22 @@ BOOL SwCrsrShell::GotoFtnAnchor()
return bRet;
}
-inline sal_Bool CmpLE( const SwTxtFtn& rFtn, ULONG nNd, xub_StrLen nCnt )
+inline sal_Bool CmpLE( const SwTxtFtn& rFtn, sal_uLong nNd, xub_StrLen nCnt )
{
- ULONG nTNd = rFtn.GetTxtNode().GetIndex();
+ sal_uLong nTNd = rFtn.GetTxtNode().GetIndex();
return nTNd < nNd || ( nTNd == nNd && *rFtn.GetStart() <= nCnt );
}
-inline sal_Bool CmpL( const SwTxtFtn& rFtn, ULONG nNd, xub_StrLen nCnt )
+inline sal_Bool CmpL( const SwTxtFtn& rFtn, sal_uLong nNd, xub_StrLen nCnt )
{
- ULONG nTNd = rFtn.GetTxtNode().GetIndex();
+ sal_uLong nTNd = rFtn.GetTxtNode().GetIndex();
return nTNd < nNd || ( nTNd == nNd && *rFtn.GetStart() < nCnt );
}
-BOOL SwCursor::GotoNextFtnAnchor()
+sal_Bool SwCursor::GotoNextFtnAnchor()
{
const SwFtnIdxs& rFtnArr = GetDoc()->GetFtnIdxs();
const SwTxtFtn* pTxtFtn = 0;
- USHORT nPos;
+ sal_uInt16 nPos;
if( rFtnArr.SeekEntry( GetPoint()->nNode, &nPos ))
{
@@ -199,7 +199,7 @@ BOOL SwCursor::GotoNextFtnAnchor()
// naechstgelegene
if( nPos < rFtnArr.Count() )
{
- ULONG nNdPos = GetPoint()->nNode.GetIndex();
+ sal_uLong nNdPos = GetPoint()->nNode.GetIndex();
xub_StrLen nCntPos = GetPoint()->nContent.GetIndex();
pTxtFtn = rFtnArr[ nPos ];
@@ -235,7 +235,7 @@ BOOL SwCursor::GotoNextFtnAnchor()
else if( nPos < rFtnArr.Count() )
pTxtFtn = rFtnArr[ nPos ];
- BOOL bRet = 0 != pTxtFtn;
+ sal_Bool bRet = 0 != pTxtFtn;
if( bRet )
{
SwCrsrSaveState aSaveState( *this );
@@ -248,17 +248,17 @@ BOOL SwCursor::GotoNextFtnAnchor()
return bRet;
}
-BOOL SwCursor::GotoPrevFtnAnchor()
+sal_Bool SwCursor::GotoPrevFtnAnchor()
{
const SwFtnIdxs& rFtnArr = GetDoc()->GetFtnIdxs();
const SwTxtFtn* pTxtFtn = 0;
- USHORT nPos;
+ sal_uInt16 nPos;
if( rFtnArr.SeekEntry( GetPoint()->nNode, &nPos ) )
{
// es gibt eine Fussnote mit dem Index, suche also die
// naechstgelegene
- ULONG nNdPos = GetPoint()->nNode.GetIndex();
+ sal_uLong nNdPos = GetPoint()->nNode.GetIndex();
xub_StrLen nCntPos = GetPoint()->nContent.GetIndex();
pTxtFtn = rFtnArr[ nPos ];
@@ -293,7 +293,7 @@ BOOL SwCursor::GotoPrevFtnAnchor()
else if( nPos )
pTxtFtn = rFtnArr[ nPos-1 ];
- BOOL bRet = 0 != pTxtFtn;
+ sal_Bool bRet = 0 != pTxtFtn;
if( bRet )
{
SwCrsrSaveState aSaveState( *this );
@@ -306,12 +306,12 @@ BOOL SwCursor::GotoPrevFtnAnchor()
return bRet;
}
-BOOL SwCrsrShell::GotoNextFtnAnchor()
+sal_Bool SwCrsrShell::GotoNextFtnAnchor()
{
return CallCrsrFN( &SwCursor::GotoNextFtnAnchor );
}
-BOOL SwCrsrShell::GotoPrevFtnAnchor()
+sal_Bool SwCrsrShell::GotoPrevFtnAnchor()
{
return CallCrsrFN( &SwCursor::GotoPrevFtnAnchor );
}
@@ -319,7 +319,7 @@ BOOL SwCrsrShell::GotoPrevFtnAnchor()
// springe aus dem Rahmen zum Anker
-BOOL SwCrsrShell::GotoFlyAnchor()
+sal_Bool SwCrsrShell::GotoFlyAnchor()
{
SET_CURR_SHELL( this );
const SwFrm* pFrm = GetCurrFrm();
@@ -328,7 +328,7 @@ BOOL SwCrsrShell::GotoFlyAnchor()
} while( pFrm && !pFrm->IsFlyFrm() );
if( !pFrm ) // ist kein FlyFrame
- return FALSE;
+ return sal_False;
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen,
SwCrsrSaveState aSaveState( *pCurCrsr );
@@ -344,10 +344,10 @@ BOOL SwCrsrShell::GotoFlyAnchor()
: pFrm->Frm().Left();
const SwPageFrm* pPageFrm = pFrm->FindPageFrm();
- const SwCntntFrm* pFndFrm = pPageFrm->GetCntntPos( aPt, FALSE, TRUE );
+ const SwCntntFrm* pFndFrm = pPageFrm->GetCntntPos( aPt, sal_False, sal_True );
pFndFrm->GetCrsrOfst( pCurCrsr->GetPoint(), aPt );
- BOOL bRet = !pCurCrsr->IsInProtectTable() && !pCurCrsr->IsSelOvr();
+ sal_Bool bRet = !pCurCrsr->IsInProtectTable() && !pCurCrsr->IsSelOvr();
if( bRet )
UpdateCrsr( SwCrsrShell::SCROLLWIN | SwCrsrShell::CHKRANGE |
SwCrsrShell::READONLY );
diff --git a/sw/source/core/crsr/trvlreg.cxx b/sw/source/core/crsr/trvlreg.cxx
index bf6343e77bc0..0dbc6013e465 100644
--- a/sw/source/core/crsr/trvlreg.cxx
+++ b/sw/source/core/crsr/trvlreg.cxx
@@ -41,8 +41,8 @@
-BOOL GotoPrevRegion( SwPaM& rCurCrsr, SwPosRegion fnPosRegion,
- BOOL bInReadOnly )
+sal_Bool GotoPrevRegion( SwPaM& rCurCrsr, SwPosRegion fnPosRegion,
+ sal_Bool bInReadOnly )
{
SwNodeIndex aIdx( rCurCrsr.GetPoint()->nNode );
SwSectionNode* pNd = aIdx.GetNode().FindSectionNode();
@@ -67,7 +67,7 @@ BOOL GotoPrevRegion( SwPaM& rCurCrsr, SwPosRegion fnPosRegion,
{
aIdx = *pNd;
SwCntntNode* pCNd = pNd->GetNodes().GoNextSection( &aIdx,
- TRUE, !bInReadOnly );
+ sal_True, !bInReadOnly );
if( !pCNd )
{
aIdx--;
@@ -79,7 +79,7 @@ BOOL GotoPrevRegion( SwPaM& rCurCrsr, SwPosRegion fnPosRegion,
{
aIdx = *pNd->EndOfSectionNode();
SwCntntNode* pCNd = pNd->GetNodes().GoPrevSection( &aIdx,
- TRUE, !bInReadOnly );
+ sal_True, !bInReadOnly );
if( !pCNd )
{
aIdx.Assign( *pNd, - 1 );
@@ -89,22 +89,22 @@ BOOL GotoPrevRegion( SwPaM& rCurCrsr, SwPosRegion fnPosRegion,
}
rCurCrsr.GetPoint()->nNode = aIdx;
- return TRUE;
+ return sal_True;
}
} while( pNd );
- return FALSE;
+ return sal_False;
}
-BOOL GotoNextRegion( SwPaM& rCurCrsr, SwPosRegion fnPosRegion,
- BOOL bInReadOnly )
+sal_Bool GotoNextRegion( SwPaM& rCurCrsr, SwPosRegion fnPosRegion,
+ sal_Bool bInReadOnly )
{
SwNodeIndex aIdx( rCurCrsr.GetPoint()->nNode );
SwSectionNode* pNd = aIdx.GetNode().FindSectionNode();
if( pNd )
aIdx.Assign( *pNd->EndOfSectionNode(), - 1 );
- ULONG nEndCount = aIdx.GetNode().GetNodes().Count()-1;
+ sal_uLong nEndCount = aIdx.GetNode().GetNodes().Count()-1;
do {
while( aIdx.GetIndex() < nEndCount &&
0 == ( pNd = aIdx.GetNode().GetSectionNode()) )
@@ -123,7 +123,7 @@ BOOL GotoNextRegion( SwPaM& rCurCrsr, SwPosRegion fnPosRegion,
{
aIdx = *pNd;
SwCntntNode* pCNd = pNd->GetNodes().GoNextSection( &aIdx,
- TRUE, !bInReadOnly );
+ sal_True, !bInReadOnly );
if( !pCNd )
{
aIdx.Assign( *pNd->EndOfSectionNode(), +1 );
@@ -135,7 +135,7 @@ BOOL GotoNextRegion( SwPaM& rCurCrsr, SwPosRegion fnPosRegion,
{
aIdx = *pNd->EndOfSectionNode();
SwCntntNode* pCNd = pNd->GetNodes().GoPrevSection( &aIdx,
- TRUE, !bInReadOnly );
+ sal_True, !bInReadOnly );
if( !pCNd )
{
aIdx++;
@@ -145,33 +145,33 @@ BOOL GotoNextRegion( SwPaM& rCurCrsr, SwPosRegion fnPosRegion,
}
rCurCrsr.GetPoint()->nNode = aIdx;
- return TRUE;
+ return sal_True;
}
} while( pNd );
- return FALSE;
+ return sal_False;
}
-BOOL GotoCurrRegion( SwPaM& rCurCrsr, SwPosRegion fnPosRegion,
- BOOL bInReadOnly )
+sal_Bool GotoCurrRegion( SwPaM& rCurCrsr, SwPosRegion fnPosRegion,
+ sal_Bool bInReadOnly )
{
SwSectionNode* pNd = rCurCrsr.GetNode()->FindSectionNode();
if( !pNd )
- return FALSE;
+ return sal_False;
SwPosition* pPos = rCurCrsr.GetPoint();
- BOOL bMoveBackward = fnPosRegion == fnMoveBackward;
+ sal_Bool bMoveBackward = fnPosRegion == fnMoveBackward;
SwCntntNode* pCNd;
if( bMoveBackward )
{
SwNodeIndex aIdx( *pNd->EndOfSectionNode() );
- pCNd = pNd->GetNodes().GoPrevSection( &aIdx, TRUE, !bInReadOnly );
+ pCNd = pNd->GetNodes().GoPrevSection( &aIdx, sal_True, !bInReadOnly );
}
else
{
SwNodeIndex aIdx( *pNd );
- pCNd = pNd->GetNodes().GoNextSection( &aIdx, TRUE, !bInReadOnly );
+ pCNd = pNd->GetNodes().GoNextSection( &aIdx, sal_True, !bInReadOnly );
}
if( pCNd )
@@ -184,34 +184,34 @@ BOOL GotoCurrRegion( SwPaM& rCurCrsr, SwPosRegion fnPosRegion,
}
-BOOL GotoCurrRegionAndSkip( SwPaM& rCurCrsr, SwPosRegion fnPosRegion,
- BOOL bInReadOnly )
+sal_Bool GotoCurrRegionAndSkip( SwPaM& rCurCrsr, SwPosRegion fnPosRegion,
+ sal_Bool bInReadOnly )
{
SwNode* pCurrNd = rCurCrsr.GetNode();
SwSectionNode* pNd = pCurrNd->FindSectionNode();
if( !pNd )
- return FALSE;
+ return sal_False;
SwPosition* pPos = rCurCrsr.GetPoint();
xub_StrLen nCurrCnt = pPos->nContent.GetIndex();
- BOOL bMoveBackward = fnPosRegion == fnMoveBackward;
+ sal_Bool bMoveBackward = fnPosRegion == fnMoveBackward;
do {
SwCntntNode* pCNd;
if( bMoveBackward ) // ans Ende vom Bereich
{
SwNodeIndex aIdx( *pNd->EndOfSectionNode() );
- pCNd = pNd->GetNodes().GoPrevSection( &aIdx, TRUE, !bInReadOnly );
+ pCNd = pNd->GetNodes().GoPrevSection( &aIdx, sal_True, !bInReadOnly );
if( !pCNd )
- return FALSE;
+ return sal_False;
pPos->nNode = aIdx;
}
else
{
SwNodeIndex aIdx( *pNd );
- pCNd = pNd->GetNodes().GoNextSection( &aIdx, TRUE, !bInReadOnly );
+ pCNd = pNd->GetNodes().GoNextSection( &aIdx, sal_True, !bInReadOnly );
if( !pCNd )
- return FALSE;
+ return sal_False;
pPos->nNode = aIdx;
}
@@ -221,18 +221,18 @@ BOOL GotoCurrRegionAndSkip( SwPaM& rCurCrsr, SwPosRegion fnPosRegion,
if( &pPos->nNode.GetNode() != pCurrNd ||
pPos->nContent.GetIndex() != nCurrCnt )
// es gab eine Veraenderung
- return TRUE;
+ return sal_True;
// dann versuche mal den "Parent" dieser Section
SwSection* pParent = pNd->GetSection().GetParent();
pNd = pParent ? pParent->GetFmt()->GetSectionNode() : 0;
} while( pNd );
- return FALSE;
+ return sal_False;
}
-BOOL SwCursor::MoveRegion( SwWhichRegion fnWhichRegion, SwPosRegion fnPosRegion )
+sal_Bool SwCursor::MoveRegion( SwWhichRegion fnWhichRegion, SwPosRegion fnPosRegion )
{
SwCrsrSaveState aSaveState( *this );
return !dynamic_cast<SwTableCursor*>(this) &&
@@ -242,21 +242,21 @@ BOOL SwCursor::MoveRegion( SwWhichRegion fnWhichRegion, SwPosRegion fnPosRegion
GetPoint()->nContent.GetIndex() != pSavePos->nCntnt );
}
-BOOL SwCrsrShell::MoveRegion( SwWhichRegion fnWhichRegion, SwPosRegion fnPosRegion )
+sal_Bool SwCrsrShell::MoveRegion( SwWhichRegion fnWhichRegion, SwPosRegion fnPosRegion )
{
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
- BOOL bRet = !pTblCrsr && pCurCrsr->MoveRegion( fnWhichRegion, fnPosRegion );
+ sal_Bool bRet = !pTblCrsr && pCurCrsr->MoveRegion( fnWhichRegion, fnPosRegion );
if( bRet )
UpdateCrsr();
return bRet;
}
-BOOL SwCursor::GotoRegion( const String& rName )
+sal_Bool SwCursor::GotoRegion( const String& rName )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
const SwSectionFmts& rFmts = GetDoc()->GetSections();
- for( USHORT n = rFmts.Count(); n; )
+ for( sal_uInt16 n = rFmts.Count(); n; )
{
const SwSectionFmt* pFmt = rFmts[ --n ];
const SwNodeIndex* pIdx;
@@ -277,10 +277,10 @@ BOOL SwCursor::GotoRegion( const String& rName )
return bRet;
}
-BOOL SwCrsrShell::GotoRegion( const String& rName )
+sal_Bool SwCrsrShell::GotoRegion( const String& rName )
{
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen,
- BOOL bRet = !pTblCrsr && pCurCrsr->GotoRegion( rName );
+ sal_Bool bRet = !pTblCrsr && pCurCrsr->GotoRegion( rName );
if( bRet )
UpdateCrsr( SwCrsrShell::SCROLLWIN | SwCrsrShell::CHKRANGE |
SwCrsrShell::READONLY ); // und den akt. Updaten
diff --git a/sw/source/core/crsr/trvltbl.cxx b/sw/source/core/crsr/trvltbl.cxx
index e76994ba09fe..0ecc02da4e4a 100644
--- a/sw/source/core/crsr/trvltbl.cxx
+++ b/sw/source/core/crsr/trvltbl.cxx
@@ -51,16 +51,16 @@
// setze Crsr in die naechsten/vorherigen Celle
-BOOL SwCrsrShell::GoNextCell( BOOL bAppendLine )
+sal_Bool SwCrsrShell::GoNextCell( sal_Bool bAppendLine )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
const SwTableNode* pTblNd = 0;
if( IsTableMode() || 0 != ( pTblNd = IsCrsrInTbl() ))
{
SwCursor* pCrsr = pTblCrsr ? pTblCrsr : pCurCrsr;
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen,
- bRet = TRUE;
+ bRet = sal_True;
// Check if we have to move the cursor to a covered cell before
// proceeding:
@@ -75,7 +75,7 @@ BOOL SwCrsrShell::GoNextCell( BOOL bAppendLine )
if ( !pTblNd )
pTblNd = IsCrsrInTbl();
pTableBox = & pTableBox->FindEndOfRowSpan( pTblNd->GetTable(),
- (USHORT)(pTableBox->getRowSpan() + pCrsr->GetCrsrRowSpanOffset() ) );
+ (sal_uInt16)(pTableBox->getRowSpan() + pCrsr->GetCrsrRowSpanOffset() ) );
pTableBoxStartNode = pTableBox->GetSttNd();
}
}
@@ -88,7 +88,7 @@ BOOL SwCrsrShell::GoNextCell( BOOL bAppendLine )
if( !aCellStt.GetNode().IsStartNode() )
{
if( pCrsr->HasMark() || !bAppendLine )
- bRet = FALSE;
+ bRet = sal_False;
else
{
// auf besonderen Wunsch: keine Line mehr vorhanden, dann
@@ -105,7 +105,7 @@ BOOL SwCrsrShell::GoNextCell( BOOL bAppendLine )
//nichts mitbekommen.
((SwEditShell*)this)->StartAllAction();
bRet = pDoc->InsertRow( pTblNd->GetTable().
- SelLineFromBox( pTableBox, aBoxes, FALSE ));
+ SelLineFromBox( pTableBox, aBoxes, sal_False ));
((SwEditShell*)this)->EndAllAction();
}
}
@@ -116,9 +116,9 @@ BOOL SwCrsrShell::GoNextCell( BOOL bAppendLine )
}
-BOOL SwCrsrShell::GoPrevCell()
+sal_Bool SwCrsrShell::GoPrevCell()
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
const SwTableNode* pTblNd;
if( IsTableMode() || 0 != ( pTblNd = IsCrsrInTbl() ))
{
@@ -143,12 +143,12 @@ const SwFrm* lcl_FindMostUpperCellFrm( const SwFrm* pFrm )
return pFrm;
}
-BOOL SwCrsrShell::_SelTblRowOrCol( bool bRow, bool bRowSimple )
+sal_Bool SwCrsrShell::_SelTblRowOrCol( bool bRow, bool bRowSimple )
{
// pruefe ob vom aktuellen Crsr der SPoint/Mark in einer Tabelle stehen
SwFrm *pFrm = GetCurrFrm();
if( !pFrm->IsInTab() )
- return FALSE;
+ return sal_False;
const SwTabFrm* pTabFrm = pFrm->FindTabFrm();
const SwTabFrm* pMasterTabFrm = pTabFrm->IsFollow() ? pTabFrm->FindMaster( true ) : pTabFrm;
@@ -172,7 +172,7 @@ BOOL SwCrsrShell::_SelTblRowOrCol( bool bRow, bool bRowSimple )
GetTblSel( *this, aBoxes, eType );
if( !aBoxes.Count() )
- return FALSE;
+ return sal_False;
pStt = aBoxes[0];
pEnd = aBoxes[aBoxes.Count() - 1];
@@ -184,7 +184,7 @@ BOOL SwCrsrShell::_SelTblRowOrCol( bool bRow, bool bRowSimple )
SwTable::SearchType eSearchType = bRow ? SwTable::SEARCH_ROW : SwTable::SEARCH_COL;
pTable->CreateSelection( *pCrsr, aBoxes, eSearchType, bCheckProtected );
if( !aBoxes.Count() )
- return FALSE;
+ return sal_False;
pStt = aBoxes[0];
pEnd = aBoxes[aBoxes.Count() - 1];
@@ -193,8 +193,13 @@ BOOL SwCrsrShell::_SelTblRowOrCol( bool bRow, bool bRowSimple )
{
const SwShellCrsr *pCrsr = _GetCrsr();
const SwFrm* pStartFrm = pFrm;
+<<<<<<< local
const SwCntntNode *pCNd = pCrsr->GetCntntNode( FALSE );
const SwFrm* pEndFrm = pCNd ? pCNd->getLayoutFrm( GetLayout(), &pCrsr->GetMkPos() ) : 0;
+=======
+ const SwCntntNode *pCNd = pCrsr->GetCntntNode( sal_False );
+ const SwFrm* pEndFrm = pCNd ? pCNd->GetFrm( &pCrsr->GetMkPos() ) : 0;
+>>>>>>> other
if ( bRow )
{
@@ -203,7 +208,7 @@ BOOL SwCrsrShell::_SelTblRowOrCol( bool bRow, bool bRowSimple )
}
if ( !pStartFrm || !pEndFrm )
- return FALSE;
+ return sal_False;
const bool bVert = pFrm->ImplFindTabFrm()->IsVertical();
@@ -220,7 +225,7 @@ BOOL SwCrsrShell::_SelTblRowOrCol( bool bRow, bool bRowSimple )
aBoxes, bSelectUp ? 0 : &aCells, eType );
if( !aBoxes.Count() || ( !bSelectUp && 4 != aCells.Count() ) )
- return FALSE;
+ return sal_False;
if ( bSelectUp )
{
@@ -258,15 +263,15 @@ BOOL SwCrsrShell::_SelTblRowOrCol( bool bRow, bool bRowSimple )
pTblCrsr->GetPtPos() = pMasterTabFrm->IsVertical() ? pMasterTabFrm->Frm().TopRight() : pMasterTabFrm->Frm().TopLeft();
UpdateCrsr(); // und den akt. Updaten
- return TRUE;
+ return sal_True;
}
-BOOL SwCrsrShell::SelTbl()
+sal_Bool SwCrsrShell::SelTbl()
{
// pruefe ob vom aktuellen Crsr der SPoint/Mark in einer Tabelle stehen
SwFrm *pFrm = GetCurrFrm();
if( !pFrm->IsInTab() )
- return FALSE;
+ return sal_False;
const SwTabFrm *pTblFrm = pFrm->ImplFindTabFrm();
const SwTabFrm* pMasterTabFrm = pTblFrm->IsFollow() ? pTblFrm->FindMaster( true ) : pTblFrm;
@@ -291,11 +296,11 @@ BOOL SwCrsrShell::SelTbl()
pTblCrsr->GetPoint()->nNode = *pTblNd->EndOfSectionNode();
pTblCrsr->Move( fnMoveBackward, fnGoCntnt );
UpdateCrsr(); // und den akt. Updaten
- return TRUE;
+ return sal_True;
}
-BOOL SwCrsrShell::SelTblBox()
+sal_Bool SwCrsrShell::SelTblBox()
{
// if we're in a table, create a table cursor, and select the cell
// that the current cursor's point resides in
@@ -314,7 +319,7 @@ BOOL SwCrsrShell::SelTblBox()
#endif
if( pStartNode == NULL )
- return FALSE;
+ return sal_False;
SET_CURR_SHELL( this );
@@ -346,7 +351,7 @@ BOOL SwCrsrShell::SelTblBox()
// needs updateing
UpdateCrsr();
- return TRUE;
+ return sal_True;
}
// return the next non-protected cell inside a table
@@ -354,7 +359,7 @@ BOOL SwCrsrShell::SelTblBox()
// return:
// true - Idx points to content in a suitable cell
// false - could not find a suitable cell
-bool lcl_FindNextCell( SwNodeIndex& rIdx, BOOL bInReadOnly )
+bool lcl_FindNextCell( SwNodeIndex& rIdx, sal_Bool bInReadOnly )
{
// ueberpruefe geschuetzte Zellen
SwNodeIndex aTmp( rIdx, 2 ); // TableNode + StartNode
@@ -433,7 +438,7 @@ bool lcl_FindNextCell( SwNodeIndex& rIdx, BOOL bInReadOnly )
}
// comments see lcl_FindNextCell
-bool lcl_FindPrevCell( SwNodeIndex& rIdx, BOOL bInReadOnly )
+bool lcl_FindPrevCell( SwNodeIndex& rIdx, sal_Bool bInReadOnly )
{
SwNodeIndex aTmp( rIdx, -2 ); // TableNode + EndNode
@@ -493,8 +498,8 @@ bool lcl_FindPrevCell( SwNodeIndex& rIdx, BOOL bInReadOnly )
}
-BOOL GotoPrevTable( SwPaM& rCurCrsr, SwPosTable fnPosTbl,
- BOOL bInReadOnly )
+sal_Bool GotoPrevTable( SwPaM& rCurCrsr, SwPosTable fnPosTbl,
+ sal_Bool bInReadOnly )
{
SwNodeIndex aIdx( rCurCrsr.GetPoint()->nNode );
@@ -550,16 +555,16 @@ BOOL GotoPrevTable( SwPaM& rCurCrsr, SwPosTable fnPosTbl,
pTxtNode->Len() :
0 );
}
- return TRUE;
+ return sal_True;
}
} while( pTblNd );
- return FALSE;
+ return sal_False;
}
-BOOL GotoNextTable( SwPaM& rCurCrsr, SwPosTable fnPosTbl,
- BOOL bInReadOnly )
+sal_Bool GotoNextTable( SwPaM& rCurCrsr, SwPosTable fnPosTbl,
+ sal_Bool bInReadOnly )
{
SwNodeIndex aIdx( rCurCrsr.GetPoint()->nNode );
SwTableNode* pTblNd = aIdx.GetNode().FindTableNode();
@@ -567,7 +572,7 @@ BOOL GotoNextTable( SwPaM& rCurCrsr, SwPosTable fnPosTbl,
if( pTblNd )
aIdx.Assign( *pTblNd->EndOfSectionNode(), 1 );
- ULONG nLastNd = rCurCrsr.GetDoc()->GetNodes().Count() - 1;
+ sal_uLong nLastNd = rCurCrsr.GetDoc()->GetNodes().Count() - 1;
do {
while( aIdx.GetIndex() < nLastNd &&
0 == ( pTblNd = aIdx.GetNode().GetTableNode()) )
@@ -603,34 +608,34 @@ BOOL GotoNextTable( SwPaM& rCurCrsr, SwPosTable fnPosTbl,
pTxtNode->Len() :
0 );
}
- return TRUE;
+ return sal_True;
}
} while( pTblNd );
- return FALSE;
+ return sal_False;
}
-BOOL GotoCurrTable( SwPaM& rCurCrsr, SwPosTable fnPosTbl,
- BOOL bInReadOnly )
+sal_Bool GotoCurrTable( SwPaM& rCurCrsr, SwPosTable fnPosTbl,
+ sal_Bool bInReadOnly )
{
SwTableNode* pTblNd = rCurCrsr.GetPoint()->nNode.GetNode().FindTableNode();
if( !pTblNd )
- return FALSE;
+ return sal_False;
SwTxtNode* pTxtNode = 0;
if( fnPosTbl == fnMoveBackward ) // ans Ende der Tabelle
{
SwNodeIndex aIdx( *pTblNd->EndOfSectionNode() );
if( !lcl_FindPrevCell( aIdx, bInReadOnly ))
- return FALSE;
+ return sal_False;
pTxtNode = aIdx.GetNode().GetTxtNode();
}
else
{
SwNodeIndex aIdx( *pTblNd );
if( !lcl_FindNextCell( aIdx, bInReadOnly ))
- return FALSE;
+ return sal_False;
pTxtNode = aIdx.GetNode().GetTxtNode();
}
@@ -642,13 +647,13 @@ BOOL GotoCurrTable( SwPaM& rCurCrsr, SwPosTable fnPosTbl,
0 );
}
- return TRUE;
+ return sal_True;
}
-BOOL SwCursor::MoveTable( SwWhichTable fnWhichTbl, SwPosTable fnPosTbl )
+sal_Bool SwCursor::MoveTable( SwWhichTable fnWhichTbl, SwPosTable fnPosTbl )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
SwTableCursor* pTblCrsr = dynamic_cast<SwTableCursor*>(this);
if( pTblCrsr || !HasMark() ) // nur wenn kein Mark oder ein TblCrsr
@@ -661,13 +666,13 @@ BOOL SwCursor::MoveTable( SwWhichTable fnWhichTbl, SwPosTable fnPosTbl )
return bRet;
}
-BOOL SwCrsrShell::MoveTable( SwWhichTable fnWhichTbl, SwPosTable fnPosTbl )
+sal_Bool SwCrsrShell::MoveTable( SwWhichTable fnWhichTbl, SwPosTable fnPosTbl )
{
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
SwShellCrsr* pCrsr = pTblCrsr ? pTblCrsr : pCurCrsr;
- BOOL bCheckPos, bRet;
- ULONG nPtNd = 0;
+ sal_Bool bCheckPos, bRet;
+ sal_uLong nPtNd = 0;
xub_StrLen nPtCnt = 0;
if( !pTblCrsr && pCurCrsr->HasMark() ) // wenn Mark und kein TblCrsr,
@@ -678,11 +683,11 @@ BOOL SwCrsrShell::MoveTable( SwWhichTable fnWhichTbl, SwPosTable fnPosTbl )
pCurCrsr->SwSelPaintRects::Hide();
pTblCrsr->SetMark();
pCrsr = pTblCrsr;
- bCheckPos = FALSE;
+ bCheckPos = sal_False;
}
else
{
- bCheckPos = TRUE;
+ bCheckPos = sal_True;
nPtNd = pCrsr->GetPoint()->nNode.GetIndex();
nPtCnt = pCrsr->GetPoint()->nContent.GetIndex();
}
@@ -700,24 +705,24 @@ BOOL SwCrsrShell::MoveTable( SwWhichTable fnWhichTbl, SwPosTable fnPosTbl )
if( bCheckPos &&
pCrsr->GetPoint()->nNode.GetIndex() == nPtNd &&
pCrsr->GetPoint()->nContent.GetIndex() == nPtCnt )
- bRet = FALSE;
+ bRet = sal_False;
}
return bRet;
}
-BOOL SwCrsrShell::IsTblComplex() const
+sal_Bool SwCrsrShell::IsTblComplex() const
{
- SwFrm *pFrm = GetCurrFrm( FALSE );
+ SwFrm *pFrm = GetCurrFrm( sal_False );
if ( pFrm && pFrm->IsInTab() )
return pFrm->FindTabFrm()->GetTable()->IsTblComplex();
- return FALSE;
+ return sal_False;
}
-BOOL SwCrsrShell::IsTblComplexForChart()
+sal_Bool SwCrsrShell::IsTblComplexForChart()
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
StartAction(); // IsTblComplexForChart() may trigger table formatting
// we better do that inside an action
@@ -784,10 +789,10 @@ String SwCrsrShell::GetBoxNms() const
}
-BOOL SwCrsrShell::GotoTable( const String& rName )
+sal_Bool SwCrsrShell::GotoTable( const String& rName )
{
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen,
- BOOL bRet = !pTblCrsr && pCurCrsr->GotoTable( rName );
+ sal_Bool bRet = !pTblCrsr && pCurCrsr->GotoTable( rName );
if( bRet )
{
pCurCrsr->GetPtPos() = Point();
@@ -798,10 +803,10 @@ BOOL SwCrsrShell::GotoTable( const String& rName )
}
-BOOL SwCrsrShell::CheckTblBoxCntnt( const SwPosition* pPos )
+sal_Bool SwCrsrShell::CheckTblBoxCntnt( const SwPosition* pPos )
{
if( !pBoxIdx || !pBoxPtr || IsSelTblCells() || !IsAutoUpdateCells() )
- return FALSE;
+ return sal_False;
// ueberpruefe, ob der Box Inhalt mit dem angegebenen Format der Box
// ueber einstimmt. Wenn nicht, setze neu
@@ -859,7 +864,7 @@ BOOL SwCrsrShell::CheckTblBoxCntnt( const SwPosition* pPos )
// aufruf kommt.
ClearTblBoxCntnt();
StartAction();
- GetDoc()->ChkBoxNumFmt( *pChkBox, TRUE );
+ GetDoc()->ChkBoxNumFmt( *pChkBox, sal_True );
EndAction();
}
@@ -877,13 +882,13 @@ void SwCrsrShell::SaveTblBoxCntnt( const SwPosition* pPos )
SwStartNode* pSttNd = pPos->nNode.GetNode().FindSttNodeByType( SwTableBoxStartNode );
- BOOL bCheckBox = FALSE;
+ sal_Bool bCheckBox = sal_False;
if( pSttNd && pBoxIdx )
{
if( pSttNd == &pBoxIdx->GetNode() )
pSttNd = 0; // die haben wir schon
else
- bCheckBox = TRUE;
+ bCheckBox = sal_True;
}
else
bCheckBox = 0 != pBoxIdx;
@@ -913,9 +918,9 @@ void SwCrsrShell::ClearTblBoxCntnt()
pBoxPtr = 0;
}
-BOOL SwCrsrShell::EndAllTblBoxEdit()
+sal_Bool SwCrsrShell::EndAllTblBoxEdit()
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
ViewShell *pSh = this;
do {
if( pSh->IsA( TYPE( SwCrsrShell ) ) )
diff --git a/sw/source/core/crsr/unocrsr.cxx b/sw/source/core/crsr/unocrsr.cxx
index be83af562584..050306cdc8a7 100644
--- a/sw/source/core/crsr/unocrsr.cxx
+++ b/sw/source/core/crsr/unocrsr.cxx
@@ -41,9 +41,9 @@ IMPL_FIXEDMEMPOOL_NEWDEL( SwUnoCrsr, 10, 10 )
SwUnoCrsr::SwUnoCrsr( const SwPosition &rPos, SwPaM* pRing )
: SwCursor( rPos, pRing, false ), SwModify( 0 ),
- bRemainInSection( TRUE ),
- bSkipOverHiddenSections( FALSE ),
- bSkipOverProtectSections( FALSE )
+ bRemainInSection( sal_True ),
+ bSkipOverHiddenSections( sal_False ),
+ bSkipOverProtectSections( sal_False )
{}
@@ -54,7 +54,7 @@ SwUnoCrsr::~SwUnoCrsr()
{
// dann muss der Cursor aus dem Array ausgetragen werden
SwUnoCrsrTbl& rTbl = (SwUnoCrsrTbl&)pDoc->GetUnoCrsrTbl();
- USHORT nDelPos = rTbl.GetPos( this );
+ sal_uInt16 nDelPos = rTbl.GetPos( this );
if( USHRT_MAX != nDelPos )
rTbl.Remove( nDelPos );
@@ -104,7 +104,7 @@ bool SwUnoCrsr::IsReadOnlyAvailable() const
}
const SwCntntFrm*
-SwUnoCrsr::DoSetBidiLevelLeftRight( BOOL &, BOOL, BOOL )
+SwUnoCrsr::DoSetBidiLevelLeftRight( sal_Bool &, sal_Bool, sal_Bool )
{
return 0; // not for uno cursor
}
@@ -114,7 +114,7 @@ void SwUnoCrsr::DoSetBidiLevelUpDown()
return; // not for uno cursor
}
-BOOL SwUnoCrsr::IsSelOvr( int eFlags )
+sal_Bool SwUnoCrsr::IsSelOvr( int eFlags )
{
if( bRemainInSection )
{
@@ -125,8 +125,8 @@ BOOL SwUnoCrsr::IsSelOvr( int eFlags )
*pNewSttNd = rPtIdx.GetNode().StartOfSectionNode();
if( pOldSttNd != pNewSttNd )
{
- BOOL bMoveDown = GetSavePos()->nNode < rPtIdx.GetIndex();
- BOOL bValidPos = FALSE;
+ sal_Bool bMoveDown = GetSavePos()->nNode < rPtIdx.GetIndex();
+ sal_Bool bValidPos = sal_False;
// search the correct surrounded start node - which the index
// can't leave.
@@ -180,14 +180,14 @@ BOOL SwUnoCrsr::IsSelOvr( int eFlags )
}
}
else
- bValidPos = TRUE;
+ bValidPos = sal_True;
} while ( pInvalidNode );
}
if( bValidPos )
{
SwCntntNode* pCNd = GetCntntNode();
- USHORT nCnt = 0;
+ sal_uInt16 nCnt = 0;
if( pCNd && !bMoveDown )
nCnt = pCNd->Len();
GetPoint()->nContent.Assign( pCNd, nCnt );
@@ -196,7 +196,7 @@ BOOL SwUnoCrsr::IsSelOvr( int eFlags )
{
rPtIdx = GetSavePos()->nNode;
GetPoint()->nContent.Assign( GetCntntNode(), GetSavePos()->nCntnt );
- return TRUE;
+ return sal_True;
}
}
}
@@ -209,7 +209,7 @@ BOOL SwUnoCrsr::IsSelOvr( int eFlags )
SwUnoTableCrsr::SwUnoTableCrsr(const SwPosition& rPos)
: SwCursor(rPos,0,false), SwUnoCrsr(rPos), SwTableCursor(rPos), aTblSel(rPos,0,false)
{
- SetRemainInSection(FALSE);
+ SetRemainInSection(sal_False);
}
SwUnoTableCrsr::~SwUnoTableCrsr()
@@ -226,9 +226,9 @@ SwCursor* SwUnoTableCrsr::Create( SwPaM* pRing ) const
}
*/
-BOOL SwUnoTableCrsr::IsSelOvr( int eFlags )
+sal_Bool SwUnoTableCrsr::IsSelOvr( int eFlags )
{
- BOOL bRet = SwUnoCrsr::IsSelOvr( eFlags );
+ sal_Bool bRet = SwUnoCrsr::IsSelOvr( eFlags );
if( !bRet )
{
const SwTableNode* pTNd = GetPoint()->nNode.GetNode().FindTableNode();
@@ -244,14 +244,20 @@ void SwUnoTableCrsr::MakeBoxSels()
const SwCntntNode* pCNd;
bool bMakeTblCrsrs = true;
if( GetPoint()->nNode.GetIndex() && GetMark()->nNode.GetIndex() &&
+<<<<<<< local
0 != ( pCNd = GetCntntNode() ) && pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout() ) &&
0 != ( pCNd = GetCntntNode(FALSE) ) && pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout() ) )
bMakeTblCrsrs = GetDoc()->GetCurrentLayout()->MakeTblCrsrs( *this ); //swmod 080218
+=======
+ 0 != ( pCNd = GetCntntNode() ) && pCNd->GetFrm() &&
+ 0 != ( pCNd = GetCntntNode(sal_False) ) && pCNd->GetFrm() )
+ bMakeTblCrsrs = GetDoc()->GetRootFrm()->MakeTblCrsrs( *this );
+>>>>>>> other
if ( !bMakeTblCrsrs )
{
SwSelBoxes& rTmpBoxes = (SwSelBoxes&)GetBoxes();
- USHORT nCount = 0;
+ sal_uInt16 nCount = 0;
while( nCount < rTmpBoxes.Count() )
DeleteBox( nCount );
}
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index eb2f0c0a9722..2dc08a28dfd5 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -89,9 +89,9 @@ MapMode* SwSelPaintRects::pMapMode = 0;
// Window* pWin = GetShell()->GetWin();
//
// RasterOp eOld( pWin->GetRasterOp() );
-// BOOL bLCol = pWin->IsLineColor();
+// sal_Bool bLCol = pWin->IsLineColor();
// Color aLCol( pWin->GetLineColor() );
-// BOOL bFCol = pWin->IsFillColor();
+// sal_Bool bFCol = pWin->IsFillColor();
// Color aFCol( pWin->GetFillColor() );
//
// pWin->SetRasterOp( ROP_XOR );
@@ -112,7 +112,7 @@ MapMode* SwSelPaintRects::pMapMode = 0;
//
// const SwBookmarks& rBkmkTbl = GetShell()->getIDocumentMarkAccess()->getBookmarks();
// SwShellCrsr* pCrsr = 0;
-// for( USHORT n = 0; n < rBkmkTbl.Count(); ++n )
+// for( sal_uInt16 n = 0; n < rBkmkTbl.Count(); ++n )
// {
// const SwBookmark& rBkmk = *rBkmkTbl[ n ];
// if( rBkmk.IsBookMark() && rBkmk.GetOtherPos() )
@@ -126,7 +126,7 @@ MapMode* SwSelPaintRects::pMapMode = 0;
// *pCrsr->GetPoint() = rBkmk.GetPos();
// *pCrsr->GetMark() = *rBkmk.GetOtherPos();
// pCrsr->FillRects();
-// for( USHORT i = 0; i < pCrsr->Count(); ++i )
+// for( sal_uInt16 i = 0; i < pCrsr->Count(); ++i )
// aReg -= (*pCrsr)[ i ];
//
// pCrsr->Remove( 0, i );
@@ -174,14 +174,14 @@ MapMode* SwSelPaintRects::pMapMode = 0;
class SwRedlineRects : public SwSelPaintRects
{
- USHORT nMode;
- USHORT nNm;
+ sal_uInt16 nMode;
+ sal_uInt16 nNm;
virtual void Paint( const Rectangle& rRect );
virtual void FillRects();
public:
- SwRedlineRects( const SwCrsrShell& rSh, USHORT nName, USHORT n )
+ SwRedlineRects( const SwCrsrShell& rSh, sal_uInt16 nName, sal_uInt16 n )
: SwSelPaintRects( rSh ), nMode( n ), nNm( nName )
{}
};
@@ -191,15 +191,15 @@ void SwRedlineRects::Paint( const Rectangle& rRect )
Window* pWin = GetShell()->GetWin();
RasterOp eOld( pWin->GetRasterOp() );
- BOOL bLCol = pWin->IsLineColor();
+ sal_Bool bLCol = pWin->IsLineColor();
Color aLCol( pWin->GetLineColor() );
- BOOL bFCol = pWin->IsFillColor();
+ sal_Bool bFCol = pWin->IsFillColor();
Color aFCol( pWin->GetFillColor() );
pWin->SetRasterOp( ROP_XOR );
Color aCol;
- UINT8 nVal = 0xc8 - ( (nMode / 4) * 16 );
+ sal_uInt8 nVal = 0xc8 - ( (nMode / 4) * 16 );
switch( nMode % 4 )
{
case 0: aCol = RGB_COLORDATA( nVal, nVal, 0xFF ); break;
@@ -225,7 +225,7 @@ void SwRedlineRects::FillRects()
const SwRedlineTbl& rTbl = GetShell()->GetDoc()->GetRedlineTbl();
SwShellCrsr* pCrsr = 0;
- for( USHORT n = 0; n < rTbl.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rTbl.Count(); ++n )
{
const SwRedline& rRed = *rTbl[ n ];
if( rRed.HasMark() && (nMode % 4 ) == rRed.GetType() &&
@@ -240,7 +240,7 @@ void SwRedlineRects::FillRects()
*pCrsr->GetPoint() = *rRed.GetPoint();
*pCrsr->GetMark() = *rRed.GetMark();
pCrsr->FillRects();
- for( USHORT i = 0; i < pCrsr->Count(); ++i )
+ for( sal_uInt16 i = 0; i < pCrsr->Count(); ++i )
aReg -= (*pCrsr)[ i ];
pCrsr->Remove( 0, i );
@@ -253,20 +253,20 @@ void SwRedlineRects::FillRects()
}
SwRedlineRects* aRedlines[ 10 * 4 ];
-static int bFirstCall = TRUE;
+static int bFirstCall = sal_True;
void ShowRedlines( const SwCrsrShell* pSh, int nAction, const SwRect* pRect = 0 )
{
if( bFirstCall )
{
memset( aRedlines, 0, sizeof(aRedlines));
- bFirstCall = FALSE;
+ bFirstCall = sal_False;
}
const SwRedlineTbl& rTbl = pSh->GetDoc()->GetRedlineTbl();
const SwRedlineAuthorTbl& rAuthorTbl = pSh->GetDoc()->GetRedlineAuthorTbl();
- for( USHORT n = 0; n < rAuthorTbl.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rAuthorTbl.Count(); ++n )
{
for( int i = 0; i < 4; ++i )
{
@@ -304,7 +304,7 @@ void ShowRedlines( const SwCrsrShell* pSh, int nAction, const SwRect* pRect = 0
if( GetDoc()->GetRedlineTbl().Count() )
{
SwRedlineTbl& rRedlineTbl = (SwRedlineTbl&)GetDoc()->GetRedlineTbl();
- for( USHORT i = 0; i < rRedlineTbl.Count(); ++i )
+ for( sal_uInt16 i = 0; i < rRedlineTbl.Count(); ++i )
rRedlineTbl[ i ]->HideRects( *GetShell() );
}
#endif
@@ -316,11 +316,11 @@ SwVisCrsr::SwVisCrsr( const SwCrsrShell * pCShell )
{
pCShell->GetWin()->SetCursor( &aTxtCrsr );
bIsVisible = aTxtCrsr.IsVisible();
- bIsDragCrsr = FALSE;
+ bIsDragCrsr = sal_False;
aTxtCrsr.SetWidth( 0 );
#ifdef SW_CRSR_TIMER
- bTimerOn = TRUE;
+ bTimerOn = sal_True;
SetTimeout( 50 ); // 50msec Verzoegerung
#endif
}
@@ -347,7 +347,7 @@ void SwVisCrsr::Show()
{
if( !bIsVisible )
{
- bIsVisible = TRUE;
+ bIsVisible = sal_True;
// muss ueberhaupt angezeigt werden ?
if( pCrsrShell->VisArea().IsOver( pCrsrShell->aCharRect ) )
@@ -375,7 +375,7 @@ void SwVisCrsr::Hide()
{
if( bIsVisible )
{
- bIsVisible = FALSE;
+ bIsVisible = sal_False;
#ifdef SW_CRSR_TIMER
if( IsActive() )
@@ -401,13 +401,13 @@ void __EXPORT SwVisCrsr::Timeout()
}
}
-BOOL SwCrsrShell::ChgCrsrTimerFlag( BOOL bTimerOn )
+sal_Bool SwCrsrShell::ChgCrsrTimerFlag( sal_Bool bTimerOn )
{
return pVisCrsr->ChgTimerFlag( bTimerOn );
}
-BOOL SwVisCrsr::ChgTimerFlag( BOOL bFlag )
+sal_Bool SwVisCrsr::ChgTimerFlag( sal_Bool bFlag )
{
bOld = bTimerOn;
if( !bFlag && bIsVisible && IsActive() )
@@ -454,7 +454,11 @@ void SwVisCrsr::_SetPosAndShow()
if( rNode.IsTxtNode() )
{
const SwTxtNode& rTNd = *rNode.GetTxtNode();
+<<<<<<< local
const SwFrm* pFrm = rTNd.getLayoutFrm( pCrsrShell->GetLayout(), 0, 0, FALSE );
+=======
+ const SwFrm* pFrm = rTNd.GetFrm( 0, 0, sal_False );
+>>>>>>> other
if ( pFrm )
{
const SwScriptInfo* pSI = ((SwTxtFrm*)pFrm)->GetScriptInfo();
@@ -500,7 +504,7 @@ void SwVisCrsr::_SetPosAndShow()
((SwDrawView*)pCrsrShell->GetDrawView())->SetAnimationEnabled(
!pCrsrShell->IsSelection() );
- USHORT nStyle = bIsDragCrsr ? CURSOR_SHADOW : 0;
+ sal_uInt16 nStyle = bIsDragCrsr ? CURSOR_SHADOW : 0;
if( nStyle != aTxtCrsr.GetStyle() )
{
aTxtCrsr.SetStyle( nStyle );
@@ -631,7 +635,7 @@ void SwSelPaintRects::Show()
void SwSelPaintRects::Invalidate( const SwRect& rRect )
{
- USHORT nSz = Count();
+ sal_uInt16 nSz = Count();
if( !nSz )
return;
@@ -811,8 +815,13 @@ short SwShellCrsr::MaxReplaceArived()
// alte Actions beenden; die Tabellen-Frames werden angelegt und
// eine SSelection kann erzeugt werden
SvUShorts aArr;
+<<<<<<< local
USHORT nActCnt;
ViewShell *pShell = const_cast< SwCrsrShell* >( GetShell() ),
+=======
+ sal_uInt16 nActCnt;
+ ViewShell *pShell = GetDoc()->GetRootFrm()->GetCurrShell(),
+>>>>>>> other
*pSh = pShell;
do {
for( nActCnt = 0; pSh->ActionPend(); ++nActCnt )
@@ -824,7 +833,7 @@ short SwShellCrsr::MaxReplaceArived()
nRet = QueryBox( pDlg, SW_RES( MSG_COMCORE_ASKSEARCH )).Execute();
}
- for( USHORT n = 0; n < aArr.Count(); ++n )
+ for( sal_uInt16 n = 0; n < aArr.Count(); ++n )
{
for( nActCnt = aArr[n]; nActCnt--; )
pSh->StartAction();
@@ -843,7 +852,7 @@ void SwShellCrsr::SaveTblBoxCntnt( const SwPosition* pPos )
((SwCrsrShell*)GetShell())->SaveTblBoxCntnt( pPos );
}
-BOOL SwShellCrsr::UpDown( BOOL bUp, USHORT nCnt )
+sal_Bool SwShellCrsr::UpDown( sal_Bool bUp, sal_uInt16 nCnt )
{
return SwCursor::UpDown( bUp, nCnt,
&GetPtPos(), GetShell()->GetUpDownX() );
@@ -854,21 +863,21 @@ BOOL SwShellCrsr::UpDown( BOOL bUp, USHORT nCnt )
// JP 05.03.98: zum Testen des UNO-Crsr Verhaltens hier die Implementierung
// am sichtbaren Cursor
-BOOL SwShellCrsr::IsSelOvr( int eFlags )
+sal_Bool SwShellCrsr::IsSelOvr( int eFlags )
{
return SwCursor::IsSelOvr( eFlags );
}
#endif
-// TRUE: an die Position kann der Cursor gesetzt werden
-BOOL SwShellCrsr::IsAtValidPos( BOOL bPoint ) const
+// sal_True: an die Position kann der Cursor gesetzt werden
+sal_Bool SwShellCrsr::IsAtValidPos( sal_Bool bPoint ) const
{
if( GetShell() && ( GetShell()->IsAllProtect() ||
GetShell()->GetViewOptions()->IsReadonly() ||
( GetShell()->Imp()->GetDrawView() &&
GetShell()->Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount() )))
- return TRUE;
+ return sal_True;
return SwCursor::IsAtValidPos( bPoint );
}
@@ -920,13 +929,13 @@ void SwShellTableCrsr::FillRects()
SwRegionRects aReg( GetShell()->VisArea() );
SwNodes& rNds = GetDoc()->GetNodes();
- for( USHORT n = 0; n < aSelBoxes.Count(); ++n )
+ for( sal_uInt16 n = 0; n < aSelBoxes.Count(); ++n )
{
const SwStartNode* pSttNd = (*(aSelBoxes.GetData() + n ))->GetSttNd();
const SwTableNode* pSelTblNd = pSttNd->FindTableNode();
SwNodeIndex aIdx( *pSttNd );
- SwCntntNode* pCNd = rNds.GoNextSection( &aIdx, TRUE, FALSE );
+ SwCntntNode* pCNd = rNds.GoNextSection( &aIdx, sal_True, sal_False );
// TABLE IN TABLE
// (see also lcl_FindTopLevelTable in unoobj2.cxx for a different
@@ -935,7 +944,7 @@ void SwShellTableCrsr::FillRects()
while ( pSelTblNd != pCurTblNd && pCurTblNd )
{
aIdx = pCurTblNd->EndOfSectionIndex();
- pCNd = rNds.GoNextSection( &aIdx, TRUE, FALSE );
+ pCNd = rNds.GoNextSection( &aIdx, sal_True, sal_False );
pCurTblNd = pCNd->FindTableNode();
}
@@ -962,19 +971,19 @@ void SwShellTableCrsr::FillRects()
// Pruefe, ob sich der SPoint innerhalb der Tabellen-SSelection befindet
-BOOL SwShellTableCrsr::IsInside( const Point& rPt ) const
+sal_Bool SwShellTableCrsr::IsInside( const Point& rPt ) const
{
// die neuen Rechtecke berechnen
// JP 16.01.98: wenn der Cursor noch "geparkt" ist nichts machen!!
if( !aSelBoxes.Count() || bParked ||
!GetPoint()->nNode.GetIndex() )
- return FALSE;
+ return sal_False;
SwNodes& rNds = GetDoc()->GetNodes();
- for( USHORT n = 0; n < aSelBoxes.Count(); ++n )
+ for( sal_uInt16 n = 0; n < aSelBoxes.Count(); ++n )
{
SwNodeIndex aIdx( *(*(aSelBoxes.GetData() + n ))->GetSttNd() );
- SwCntntNode* pCNd = rNds.GoNextSection( &aIdx, TRUE, FALSE );
+ SwCntntNode* pCNd = rNds.GoNextSection( &aIdx, sal_True, sal_False );
if( !pCNd )
continue;
@@ -983,23 +992,23 @@ BOOL SwShellTableCrsr::IsInside( const Point& rPt ) const
pFrm = pFrm->GetUpper();
ASSERT( pFrm, "Node nicht in einer Tabelle" );
if( pFrm && pFrm->Frm().IsInside( rPt ) )
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
#ifdef DBG_UTIL
// JP 05.03.98: zum Testen des UNO-Crsr Verhaltens hier die Implementierung
// am sichtbaren Cursor
-BOOL SwShellTableCrsr::IsSelOvr( int eFlags )
+sal_Bool SwShellTableCrsr::IsSelOvr( int eFlags )
{
return SwShellCrsr::IsSelOvr( eFlags );
}
#endif
-BOOL SwShellTableCrsr::IsAtValidPos( BOOL bPoint ) const
+sal_Bool SwShellTableCrsr::IsAtValidPos( sal_Bool bPoint ) const
{
return SwShellCrsr::IsAtValidPos( bPoint );
}
diff --git a/sw/source/core/doc/SwStyleNameMapper.cxx b/sw/source/core/doc/SwStyleNameMapper.cxx
index 99fd15dbc9e2..d25c7d8417cb 100644
--- a/sw/source/core/doc/SwStyleNameMapper.cxx
+++ b/sw/source/core/doc/SwStyleNameMapper.cxx
@@ -1088,7 +1088,7 @@ const SvStringsDtor& SwStyleNameMapper::GetNumRuleProgNameArray()
const String SwStyleNameMapper::GetSpecialExtraProgName( const String& rExtraUIName )
{
String aRes = rExtraUIName;
- BOOL bChgName = FALSE;
+ sal_Bool bChgName = sal_False;
const SvStringsDtor& rExtraArr = GetExtraUINameArray();
static sal_uInt16 nIds[] =
{
@@ -1103,7 +1103,7 @@ const String SwStyleNameMapper::GetSpecialExtraProgName( const String& rExtraUIN
{
if (aRes == *rExtraArr[ *pIds ])
{
- bChgName = TRUE;
+ bChgName = sal_True;
break;
}
}
@@ -1115,7 +1115,7 @@ const String SwStyleNameMapper::GetSpecialExtraProgName( const String& rExtraUIN
const String SwStyleNameMapper::GetSpecialExtraUIName( const String& rExtraProgName )
{
String aRes = rExtraProgName;
- BOOL bChgName = FALSE;
+ sal_Bool bChgName = sal_False;
const SvStringsDtor& rExtraArr = GetExtraProgNameArray();
static sal_uInt16 nIds[] =
{
@@ -1131,7 +1131,7 @@ const String SwStyleNameMapper::GetSpecialExtraUIName( const String& rExtraProgN
{
if (aRes == *rExtraArr[ *pIds ])
{
- bChgName = TRUE;
+ bChgName = sal_True;
break;
}
}
diff --git a/sw/source/core/doc/acmplwrd.cxx b/sw/source/core/doc/acmplwrd.cxx
index 53bbd9cfbd84..f1285cd48ba1 100644
--- a/sw/source/core/doc/acmplwrd.cxx
+++ b/sw/source/core/doc/acmplwrd.cxx
@@ -57,7 +57,7 @@ class SwAutoCompleteClient : public SwClient
SwAutoCompleteWord* pAutoCompleteWord;
SwDoc* pDoc;
#ifdef DBG_UTIL
- static ULONG nSwAutoCompleteClientCount;
+ static sal_uLong nSwAutoCompleteClientCount;
#endif
public:
SwAutoCompleteClient(SwAutoCompleteWord& rToTell, SwDoc& rSwDoc);
@@ -68,7 +68,7 @@ public:
const SwDoc& GetDoc(){return *pDoc;}
#ifdef DBG_UTIL
- static ULONG GetElementCount() {return nSwAutoCompleteClientCount;}
+ static sal_uLong GetElementCount() {return nSwAutoCompleteClientCount;}
#endif
protected:
virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
@@ -97,7 +97,7 @@ typedef std::vector<SwDocPtr> SwDocPtrVector;
class SwAutoCompleteString : public String
{
#ifdef DBG_UTIL
- static ULONG nSwAutoCompleteStringCount;
+ static sal_uLong nSwAutoCompleteStringCount;
#endif
SwDocPtrVector aSourceDocs;
public:
@@ -108,12 +108,12 @@ class SwAutoCompleteString : public String
//returns true if last document reference has been removed
sal_Bool RemoveDocument(const SwDoc& rDoc);
#ifdef DBG_UTIL
- static ULONG GetElementCount() {return nSwAutoCompleteStringCount;}
+ static sal_uLong GetElementCount() {return nSwAutoCompleteStringCount;}
#endif
};
#ifdef DBG_UTIL
- ULONG SwAutoCompleteClient::nSwAutoCompleteClientCount = 0;
- ULONG SwAutoCompleteString::nSwAutoCompleteStringCount = 0;
+ sal_uLong SwAutoCompleteClient::nSwAutoCompleteClientCount = 0;
+ sal_uLong SwAutoCompleteString::nSwAutoCompleteStringCount = 0;
#endif
/* -----------------------------06.08.2002 08:57------------------------------
@@ -258,18 +258,18 @@ sal_Bool SwAutoCompleteString::RemoveDocument(const SwDoc& rDoc)
/* ---------------------------------------------------------------------------
---------------------------------------------------------------------------*/
-SwAutoCompleteWord::SwAutoCompleteWord( USHORT nWords, USHORT nMWrdLen )
+SwAutoCompleteWord::SwAutoCompleteWord( sal_uInt16 nWords, sal_uInt16 nMWrdLen )
: aWordLst( 0, 255 ), aLRULst( 0, 255 ),
pImpl(new SwAutoCompleteWord_Impl(*this)),
nMaxCount( nWords ),
nMinWrdLen( nMWrdLen ),
- bLockWordLst( FALSE )
+ bLockWordLst( sal_False )
{
}
SwAutoCompleteWord::~SwAutoCompleteWord()
{
- for(USHORT nPos = aWordLst.Count(); nPos; nPos--)
+ for(sal_uInt16 nPos = aWordLst.Count(); nPos; nPos--)
{
SwAutoCompleteString* pCurrent = (SwAutoCompleteString*)aWordLst[ nPos - 1 ];
aWordLst.Remove( nPos - 1 );
@@ -277,13 +277,13 @@ SwAutoCompleteWord::~SwAutoCompleteWord()
}
delete pImpl;
#ifdef DBG_UTIL
- ULONG nStrings = SwAutoCompleteString::GetElementCount();
- ULONG nClients = SwAutoCompleteClient::GetElementCount();
+ sal_uLong nStrings = SwAutoCompleteString::GetElementCount();
+ sal_uLong nClients = SwAutoCompleteClient::GetElementCount();
DBG_ASSERT(!nStrings && !nClients, "AutoComplete: clients or string count mismatch");
#endif
}
-BOOL SwAutoCompleteWord::InsertWord( const String& rWord, SwDoc& rDoc )
+sal_Bool SwAutoCompleteWord::InsertWord( const String& rWord, SwDoc& rDoc )
{
SwDocShell* pDocShell = rDoc.GetDocShell();
SfxMedium* pMedium = pDocShell ? pDocShell->GetMedium() : 0;
@@ -300,7 +300,7 @@ BOOL SwAutoCompleteWord::InsertWord( const String& rWord, SwDoc& rDoc )
aNewWord.EraseAllChars( CH_TXTATR_BREAKWORD );
pImpl->AddDocument(rDoc);
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
xub_StrLen nWrdLen = aNewWord.Len();
while( nWrdLen && '.' == aNewWord.GetChar( nWrdLen-1 ))
--nWrdLen;
@@ -310,10 +310,10 @@ BOOL SwAutoCompleteWord::InsertWord( const String& rWord, SwDoc& rDoc )
SwAutoCompleteString* pAutoString;
StringPtr pNew = pAutoString = new SwAutoCompleteString( aNewWord, 0, nWrdLen );
pAutoString->AddDocument(rDoc);
- USHORT nInsPos;
+ sal_uInt16 nInsPos;
if( aWordLst.Insert( pNew, nInsPos ) )
{
- bRet = TRUE;
+ bRet = sal_True;
if( aLRULst.Count() < nMaxCount )
aLRULst.Insert( pNew, 0 );
else
@@ -353,15 +353,15 @@ BOOL SwAutoCompleteWord::InsertWord( const String& rWord, SwDoc& rDoc )
return bRet;
}
-void SwAutoCompleteWord::SetMaxCount( USHORT nNewMax )
+void SwAutoCompleteWord::SetMaxCount( sal_uInt16 nNewMax )
{
if( nNewMax < nMaxCount && aLRULst.Count() > nNewMax )
{
// dann die unten ueberhaengenden entfernen
- USHORT nLRUIndex = nNewMax-1;
+ sal_uInt16 nLRUIndex = nNewMax-1;
while( nNewMax < aWordLst.Count() && nLRUIndex < aLRULst.Count())
{
- USHORT nPos = aWordLst.GetPos( (String*)aLRULst[ nLRUIndex++ ] );
+ sal_uInt16 nPos = aWordLst.GetPos( (String*)aLRULst[ nLRUIndex++ ] );
ASSERT( USHRT_MAX != nPos, "String nicht gefunden" );
void * pDel = aWordLst[nPos];
aWordLst.Remove(nPos);
@@ -372,7 +372,7 @@ void SwAutoCompleteWord::SetMaxCount( USHORT nNewMax )
nMaxCount = nNewMax;
}
-void SwAutoCompleteWord::SetMinWordLen( USHORT n )
+void SwAutoCompleteWord::SetMinWordLen( sal_uInt16 n )
{
// will man wirklich alle Worte, die kleiner als die neue Min Laenge
// sind entfernen?
@@ -381,13 +381,13 @@ void SwAutoCompleteWord::SetMinWordLen( USHORT n )
// JP 11.03.99 - mal testhalber eingebaut
if( n < nMinWrdLen )
{
- for( USHORT nPos = 0; nPos < aWordLst.Count(); ++nPos )
+ for( sal_uInt16 nPos = 0; nPos < aWordLst.Count(); ++nPos )
if( aWordLst[ nPos ]->Len() < n )
{
void* pDel = aWordLst[ nPos ];
aWordLst.Remove(nPos);
- USHORT nDelPos = aLRULst.GetPos( pDel );
+ sal_uInt16 nDelPos = aLRULst.GetPos( pDel );
ASSERT( USHRT_MAX != nDelPos, "String nicht gefunden" );
aLRULst.Remove( nDelPos );
--nPos;
@@ -398,8 +398,8 @@ void SwAutoCompleteWord::SetMinWordLen( USHORT n )
nMinWrdLen = n;
}
-BOOL SwAutoCompleteWord::GetRange( const String& rWord, USHORT& rStt,
- USHORT& rEnd ) const
+sal_Bool SwAutoCompleteWord::GetRange( const String& rWord, sal_uInt16& rStt,
+ sal_uInt16& rEnd ) const
{
const StringPtr pStr = (StringPtr)&rWord;
aWordLst.Seek_Entry( pStr, &rStt );
@@ -414,8 +414,8 @@ BOOL SwAutoCompleteWord::GetRange( const String& rWord, USHORT& rStt,
void SwAutoCompleteWord::CheckChangedList( const SvStringsISortDtor& rNewLst )
{
- USHORT nMyLen = aWordLst.Count(), nNewLen = rNewLst.Count();
- USHORT nMyPos = 0, nNewPos = 0;
+ sal_uInt16 nMyLen = aWordLst.Count(), nNewLen = rNewLst.Count();
+ sal_uInt16 nMyPos = 0, nNewPos = 0;
for( ; nMyPos < nMyLen && nNewPos < nNewLen; ++nMyPos, ++nNewPos )
{
@@ -425,7 +425,7 @@ void SwAutoCompleteWord::CheckChangedList( const SvStringsISortDtor& rNewLst )
void* pDel = aWordLst[ nMyPos ];
aWordLst.Remove(nMyPos);
- USHORT nPos = aLRULst.GetPos( pDel );
+ sal_uInt16 nPos = aLRULst.GetPos( pDel );
ASSERT( USHRT_MAX != nPos, "String nicht gefunden" );
aLRULst.Remove( nPos );
delete (SwAutoCompleteString*)pDel;
@@ -440,7 +440,7 @@ void SwAutoCompleteWord::CheckChangedList( const SvStringsISortDtor& rNewLst )
for( ; nNewPos < nMyLen; ++nNewPos )
{
void* pDel = aWordLst[ nNewPos ];
- USHORT nPos = aLRULst.GetPos( pDel );
+ sal_uInt16 nPos = aLRULst.GetPos( pDel );
ASSERT( USHRT_MAX != nPos, "String nicht gefunden" );
aLRULst.Remove( nPos );
delete (SwAutoCompleteString*)pDel;
@@ -458,13 +458,13 @@ void SwAutoCompleteWord::DocumentDying(const SwDoc& rDoc)
SvxAutoCorrect* pACorr = SvxAutoCorrCfg::Get()->GetAutoCorrect();
const sal_Bool bDelete = !pACorr->GetSwFlags().bAutoCmpltKeepList;
- for(USHORT nPos = aWordLst.Count(); nPos; nPos--)
+ for(sal_uInt16 nPos = aWordLst.Count(); nPos; nPos--)
{
SwAutoCompleteString* pCurrent = (SwAutoCompleteString*)aWordLst[ nPos - 1 ];
if(pCurrent->RemoveDocument(rDoc) && bDelete)
{
aWordLst.Remove( nPos - 1 );
- USHORT nLRUPos = aLRULst.GetPos( (void*)pCurrent );
+ sal_uInt16 nLRUPos = aLRULst.GetPos( (void*)pCurrent );
DBG_ASSERT(nLRUPos < USHRT_MAX, "word not found in LRU list" );
aLRULst.Remove( nLRUPos );
delete pCurrent;
diff --git a/sw/source/core/doc/dbgoutsw.cxx b/sw/source/core/doc/dbgoutsw.cxx
index 3c85091c7d20..08dab4aff359 100644
--- a/sw/source/core/doc/dbgoutsw.cxx
+++ b/sw/source/core/doc/dbgoutsw.cxx
@@ -42,6 +42,7 @@
#include <docary.hxx>
#include <swundo.hxx>
#include <undobj.hxx>
+#include <numrule.hxx>
#include <doc.hxx>
#include <frmfmt.hxx>
#include <fmtanchr.hxx>
@@ -117,15 +118,15 @@ SW_DLLPUBLIC const char * dbg_out(const ::rtl::OUString & aStr)
struct CompareUShort
{
- bool operator()(USHORT a, USHORT b) const
+ bool operator()(sal_uInt16 a, sal_uInt16 b) const
{
return a < b;
}
};
-map<USHORT,String,CompareUShort> & GetItemWhichMap()
+map<sal_uInt16,String,CompareUShort> & GetItemWhichMap()
{
- static map<USHORT,String,CompareUShort> aItemWhichMap;
+ static map<sal_uInt16,String,CompareUShort> aItemWhichMap;
static bool bInitialized = false;
if (! bInitialized)
@@ -341,7 +342,7 @@ const String lcl_dbg_out(const SwpHints & rHints)
{
String aStr("[ SwpHints\n", RTL_TEXTENCODING_ASCII_US);
- for (USHORT i = 0; i < rHints.Count(); i++)
+ for (sal_uInt16 i = 0; i < rHints.Count(); i++)
{
aStr += String(" ", RTL_TEXTENCODING_ASCII_US);
aStr += lcl_dbg_out(*rHints[i]);
@@ -472,7 +473,7 @@ const String lcl_AnchoredFrames(const SwNode & rNode)
if (pFrmFmts)
{
bool bFirst = true;
- for (USHORT nI = 0; nI < pFrmFmts->Count(); nI++)
+ for (sal_uInt16 nI = 0; nI < pFrmFmts->Count(); nI++)
{
const SwFmtAnchor & rAnchor = (*pFrmFmts)[nI]->GetAnchor();
const SwPosition * pPos = rAnchor.GetCntntAnchor();
@@ -601,7 +602,7 @@ String lcl_dbg_out(const SwNode & rNode)
const SfxPoolItem * pItem = NULL;
if (pAttrSet && SFX_ITEM_SET ==
- pAttrSet->GetItemState(RES_PARATR_NUMRULE, FALSE, &pItem))
+ pAttrSet->GetItemState(RES_PARATR_NUMRULE, sal_False, &pItem))
{
aTmpStr += String("(", RTL_TEXTENCODING_ASCII_US);
aTmpStr +=
@@ -614,7 +615,7 @@ String lcl_dbg_out(const SwNode & rNode)
aTmpStr += String("</rule>", RTL_TEXTENCODING_ASCII_US);
if (pTxtNode->GetActualListLevel() > 0)
- pNumFmt = pNumRule->GetNumFmt( static_cast< USHORT >(pTxtNode->GetActualListLevel()) );
+ pNumFmt = pNumRule->GetNumFmt( static_cast< sal_uInt16 >(pTxtNode->GetActualListLevel()) );
if (pNumFmt)
{
@@ -721,7 +722,7 @@ SW_DLLPUBLIC const char * dbg_out(const SwTxtNode * pNode)
return NULL;
}
-BOOL lcl_dbg_add_node(const SwNodePtr & pNode, void * pArgs)
+sal_Bool lcl_dbg_add_node(const SwNodePtr & pNode, void * pArgs)
{
if (pNode)
{
@@ -730,10 +731,10 @@ BOOL lcl_dbg_add_node(const SwNodePtr & pNode, void * pArgs)
}
//MBA: this code didn't compile, needed to add a return value
- return TRUE;
+ return sal_True;
}
-void lcl_dbg_nodes_inner(String & aStr, SwNodes & rNodes, ULONG & nIndex)
+void lcl_dbg_nodes_inner(String & aStr, SwNodes & rNodes, sal_uLong & nIndex)
{
SwNode * pNode = rNodes[nIndex];
SwStartNode * pStartNode = dynamic_cast<SwStartNode *> (pNode);
@@ -742,8 +743,8 @@ void lcl_dbg_nodes_inner(String & aStr, SwNodes & rNodes, ULONG & nIndex)
if (pStartNode != NULL)
pEndNode = pStartNode->EndOfSectionNode();
- ULONG nCount = rNodes.Count();
- ULONG nStartIndex = nIndex;
+ sal_uLong nCount = rNodes.Count();
+ sal_uLong nStartIndex = nIndex;
bool bDone = false;
@@ -786,8 +787,8 @@ String lcl_dbg_out(SwNodes & rNodes)
{
String aStr("<nodes-array>", RTL_TEXTENCODING_ASCII_US);
- ULONG nIndex = 0;
- ULONG nCount = rNodes.Count();
+ sal_uLong nIndex = 0;
+ sal_uLong nCount = rNodes.Count();
while (nIndex < nCount)
{
@@ -808,43 +809,10 @@ String lcl_dbg_out(const SwUndo & rUndo)
{
String aStr("[ ", RTL_TEXTENCODING_ASCII_US);
- aStr += String::CreateFromInt32(rUndo.GetId());
+ aStr += String::CreateFromInt32(
+ static_cast<SfxUndoAction const&>(rUndo).GetId());
aStr += String(": ", RTL_TEXTENCODING_ASCII_US);
- switch(rUndo.GetId())
- {
- case UNDO_START:
- aStr += String(", ", RTL_TEXTENCODING_ASCII_US);
- aStr +=
- String::CreateFromInt32(dynamic_cast
- <const SwUndoStart &>(rUndo).
- GetUserId());
- aStr += String(", ", RTL_TEXTENCODING_ASCII_US);
- aStr += String::CreateFromInt32(dynamic_cast
- <const SwUndoStart &>(rUndo).
- GetEndOffset());
- aStr += String(" ", RTL_TEXTENCODING_ASCII_US);
-
- break;
-
- case UNDO_END:
- aStr += String(", ", RTL_TEXTENCODING_ASCII_US);
- aStr +=
- String::CreateFromInt32(dynamic_cast
- <const SwUndoEnd &>(rUndo).
- GetId());
- aStr += String(", ", RTL_TEXTENCODING_ASCII_US);
- aStr += String::CreateFromInt32(dynamic_cast
- <const SwUndoEnd &>(rUndo).
- GetSttOffset());
- aStr += String(" ", RTL_TEXTENCODING_ASCII_US);
-
- break;
-
- default:
- break;
- }
-
aStr += rUndo.GetComment();
aStr += String(" ]", RTL_TEXTENCODING_ASCII_US);
@@ -860,7 +828,7 @@ String lcl_dbg_out(SwOutlineNodes & rNodes)
{
String aStr("[\n", RTL_TEXTENCODING_ASCII_US);
- for (USHORT i = 0; i < rNodes.Count(); i++)
+ for (sal_uInt16 i = 0; i < rNodes.Count(); i++)
{
aStr += lcl_dbg_out(*rNodes[i]);
aStr += String("\n", RTL_TEXTENCODING_ASCII_US);
@@ -876,39 +844,6 @@ SW_DLLPUBLIC const char * dbg_out(SwOutlineNodes & rNodes)
return dbg_out(lcl_dbg_out(rNodes));
}
-String lcl_dbg_out(const SwUndos & rUndos)
-{
- USHORT nIndent = 0;
-
- String aStr("[\n", RTL_TEXTENCODING_ASCII_US);
-
- for (USHORT n = 0; n < rUndos.Count(); n++)
- {
- SwUndo * pUndo = rUndos[n];
-
- if (pUndo->GetId() == UNDO_END)
- nIndent--;
-
- for (USHORT nI = 0; n < nIndent; nI++)
- aStr += String(" ", RTL_TEXTENCODING_ASCII_US);
-
- aStr += lcl_dbg_out(*pUndo);
- aStr += String("\n", RTL_TEXTENCODING_ASCII_US);
-
- if (pUndo->GetId() == UNDO_START)
- nIndent++;
- }
-
- aStr += String("]\n", RTL_TEXTENCODING_ASCII_US);
-
- return aStr;
-}
-
-SW_DLLPUBLIC const char * dbg_out(const SwUndos & rUndos)
-{
- return dbg_out(lcl_dbg_out(rUndos));
-}
-
String lcl_dbg_out(const SwRewriter & rRewriter)
{
(void) rRewriter;
@@ -940,7 +875,7 @@ String lcl_dbg_out(const SwNumRule & rRule)
aResult += rRule.GetName();
aResult += String(" [", RTL_TEXTENCODING_ASCII_US);
- for (BYTE n = 0; n < MAXLEVEL; n++)
+ for (sal_uInt8 n = 0; n < MAXLEVEL; n++)
{
if (n > 0)
aResult += String(", ", RTL_TEXTENCODING_ASCII_US);
@@ -990,7 +925,7 @@ String lcl_dbg_out(const SwNumRuleTbl & rTbl)
{
String aResult("[", RTL_TEXTENCODING_ASCII_US);
- for (USHORT n = 0; n < rTbl.Count(); n++)
+ for (sal_uInt16 n = 0; n < rTbl.Count(); n++)
{
if (n > 0)
aResult += String(", ", RTL_TEXTENCODING_ASCII_US);
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 91b8d434572c..3271a497f24b 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -27,7 +27,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
#include <doc.hxx>
+#include <UndoManager.hxx>
#include <hintids.hxx>
#include <tools/shl.hxx>
@@ -80,7 +82,10 @@
#include <pam.hxx>
#include <ndtxt.hxx>
#include <swundo.hxx> // fuer die UndoIds
-#include <undobj.hxx>
+#include <UndoCore.hxx>
+#include <UndoInsert.hxx>
+#include <UndoSplitMove.hxx>
+#include <UndoTable.hxx>
#include <pagedesc.hxx> //DTor
#include <breakit.hxx>
#include <ndole.hxx>
@@ -113,15 +118,19 @@
#include <viewsh.hxx>
#include <shellres.hxx>
#include <txtfrm.hxx>
+<<<<<<< local
#include <attrhint.hxx>
+=======
+#include <wdocsh.hxx> // SwWebDocShell
+#include <prtopt.hxx> // SwPrintOptions
+
+>>>>>>> other
#include <vector>
#include <map>
#include <osl/diagnose.h>
#include <osl/interlck.h>
-#ifdef FUTURE_VBA
#include <vbahelper/vbaaccesshelper.hxx>
-#endif
#include "switerator.hxx"
@@ -248,8 +257,8 @@ void SwDoc::set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value)
mbOldNumbering = value;
const SwNumRuleTbl& rNmTbl = GetNumRuleTbl();
- for( USHORT n = 0; n < rNmTbl.Count(); ++n )
- rNmTbl[n]->SetInvalidRule(TRUE);
+ for( sal_uInt16 n = 0; n < rNmTbl.Count(); ++n )
+ rNmTbl[n]->SetInvalidRule(sal_True);
UpdateNumRule();
@@ -358,18 +367,23 @@ void SwDoc::set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value)
}
const i18n::ForbiddenCharacters*
- SwDoc::getForbiddenCharacters(/*[in]*/ USHORT nLang, /*[in]*/ bool bLocaleData ) const
+ SwDoc::getForbiddenCharacters(/*[in]*/ sal_uInt16 nLang, /*[in]*/ bool bLocaleData ) const
{
const i18n::ForbiddenCharacters* pRet = 0;
if( xForbiddenCharsTable.isValid() )
- pRet = xForbiddenCharsTable->GetForbiddenCharacters( nLang, FALSE );
+ pRet = xForbiddenCharsTable->GetForbiddenCharacters( nLang, sal_False );
if( bLocaleData && !pRet && pBreakIt )
pRet = &pBreakIt->GetForbidden( (LanguageType)nLang );
return pRet;
}
+<<<<<<< local
void SwDoc::setForbiddenCharacters(/*[in]*/ USHORT nLang,
/*[in]*/ const com::sun::star::i18n::ForbiddenCharacters& rFChars )
+=======
+void SwDoc::setForbiddenCharacters(/*[in]*/ sal_uInt16 nLang,
+ /*[in]*/ const i18n::ForbiddenCharacters& rFChars )
+>>>>>>> other
{
if( !xForbiddenCharsTable.isValid() )
{
@@ -452,7 +466,7 @@ void SwDoc::setCharacterCompressionType( /*[in]*/SwCharCompressType n )
eChrCmprType = n;
if( pDrawModel )
{
- pDrawModel->SetCharCompressType( static_cast<UINT16>(n) );
+ pDrawModel->SetCharCompressType( static_cast<sal_uInt16>(n) );
if( !mbInReading )
pDrawModel->ReformatAllTextObjects();
}
@@ -600,8 +614,8 @@ const JobSetup* SwDoc::getJobsetup() const
void SwDoc::setJobsetup(/*[in]*/ const JobSetup &rJobSetup )
{
- BOOL bCheckPageDescs = 0 == pPrt;
- BOOL bDataChanged = FALSE;
+ sal_Bool bCheckPageDescs = 0 == pPrt;
+ sal_Bool bDataChanged = sal_False;
if ( pPrt )
{
@@ -610,7 +624,7 @@ void SwDoc::setJobsetup(/*[in]*/ const JobSetup &rJobSetup )
if ( pPrt->GetJobSetup() != rJobSetup )
{
pPrt->SetJobSetup( rJobSetup );
- bDataChanged = TRUE;
+ bDataChanged = sal_True;
}
}
else
@@ -632,18 +646,30 @@ void SwDoc::setJobsetup(/*[in]*/ const JobSetup &rJobSetup )
else
{
pPrt = p;
- bDataChanged = TRUE;
+ bDataChanged = sal_True;
}
}
if ( bDataChanged && !get(IDocumentSettingAccess::USE_VIRTUAL_DEVICE) )
PrtDataChanged();
}
-SwPrintData* SwDoc::getPrintData() const
+const SwPrintData & SwDoc::getPrintData() const
{
if(!pPrtData)
- ((SwDoc*)this)->pPrtData = new SwPrintData;
- return pPrtData;
+ {
+ SwDoc * pThis = const_cast< SwDoc * >(this);
+ pThis->pPrtData = new SwPrintData;
+
+ // SwPrintData should be initialized from the configuration,
+ // the respective config item is implememted by SwPrintOptions which
+ // is also derived from SwPrintData
+ const SwDocShell *pDocSh = GetDocShell();
+ DBG_ASSERT( pDocSh, "pDocSh is 0, can't determine if this is a WebDoc or not" );
+ bool bWeb = 0 != dynamic_cast< const SwWebDocShell * >(pDocSh);
+ SwPrintOptions aPrintOptions( bWeb );
+ *pThis->pPrtData = aPrintOptions;
+ }
+ return *pPrtData;
}
void SwDoc::setPrintData(/*[in]*/ const SwPrintData& rPrtData )
@@ -684,14 +710,14 @@ bool SwDoc::SplitNode( const SwPosition &rPos, bool bChkTableStart )
}
SwUndoSplitNode* pUndo = 0;
- if ( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
+ GetIDocumentUndoRedo().ClearRedo();
// einfuegen vom Undo-Object, z.Z. nur beim TextNode
if( pNode->IsTxtNode() )
{
pUndo = new SwUndoSplitNode( this, rPos, bChkTableStart );
- AppendUndo(pUndo);
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
}
@@ -701,7 +727,7 @@ bool SwDoc::SplitNode( const SwPosition &rPos, bool bChkTableStart )
// einen Absatz ein
if( bChkTableStart && !rPos.nContent.GetIndex() && pNode->IsTxtNode() )
{
- ULONG nPrevPos = rPos.nNode.GetIndex() - 1;
+ sal_uLong nPrevPos = rPos.nNode.GetIndex() - 1;
const SwTableNode* pTblNd;
const SwNode* pNd = GetNodes()[ nPrevPos ];
if( pNd->IsStartNode() &&
@@ -724,8 +750,8 @@ bool SwDoc::SplitNode( const SwPosition &rPos, bool bChkTableStart )
{
// Dann nur, wenn die Tabelle Umbrueche traegt!
const SwFrmFmt* pFrmFmt = pTblNd->GetTable().GetFrmFmt();
- if( SFX_ITEM_SET != pFrmFmt->GetItemState(RES_PAGEDESC, FALSE) &&
- SFX_ITEM_SET != pFrmFmt->GetItemState( RES_BREAK, FALSE ) )
+ if( SFX_ITEM_SET != pFrmFmt->GetItemState(RES_PAGEDESC, sal_False) &&
+ SFX_ITEM_SET != pFrmFmt->GetItemState( RES_BREAK, sal_False ) )
pNd = 0;
}
}
@@ -746,13 +772,13 @@ bool SwDoc::SplitNode( const SwPosition &rPos, bool bChkTableStart )
SwFrmFmt* pFrmFmt = pTblNd->GetTable().GetFrmFmt();
const SfxPoolItem *pItem;
if( SFX_ITEM_SET == pFrmFmt->GetItemState( RES_PAGEDESC,
- FALSE, &pItem ) )
+ sal_False, &pItem ) )
{
pTxtNd->SetAttr( *pItem );
pFrmFmt->ResetFmtAttr( RES_PAGEDESC );
}
if( SFX_ITEM_SET == pFrmFmt->GetItemState( RES_BREAK,
- FALSE, &pItem ) )
+ sal_False, &pItem ) )
{
pTxtNd->SetAttr( *pItem );
pFrmFmt->ResetFmtAttr( RES_BREAK );
@@ -778,7 +804,7 @@ bool SwDoc::SplitNode( const SwPosition &rPos, bool bChkTableStart )
{
// verschiebe noch alle Bookmarks/TOXMarks/FlyAtCnt
if( aBkmkArr.Count() )
- _RestoreCntntIdx( this, aBkmkArr, rPos.nNode.GetIndex()-1, 0, TRUE );
+ _RestoreCntntIdx( this, aBkmkArr, rPos.nNode.GetIndex()-1, 0, sal_True );
if( IsRedlineOn() || (!IsIgnoreRedline() && pRedlineTbl->Count() ))
{
@@ -798,10 +824,8 @@ bool SwDoc::SplitNode( const SwPosition &rPos, bool bChkTableStart )
bool SwDoc::AppendTxtNode( SwPosition& rPos )
{
- /*
- * Neuen Node vor EndOfContent erzeugen.
- */
- SwTxtNode *pCurNode = GetNodes()[ rPos.nNode ]->GetTxtNode();
+ // create new node before EndOfContent
+ SwTxtNode * pCurNode = rPos.nNode.GetNode().GetTxtNode();
if( !pCurNode )
{
// dann kann ja einer angelegt werden!
@@ -815,10 +839,9 @@ bool SwDoc::AppendTxtNode( SwPosition& rPos )
rPos.nNode++;
rPos.nContent.Assign( pCurNode, 0 );
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoInsert( rPos.nNode ));
+ GetIDocumentUndoRedo().AppendUndo( new SwUndoInsert( rPos.nNode ) );
}
if( IsRedlineOn() || (!IsIgnoreRedline() && pRedlineTbl->Count() ))
@@ -833,15 +856,15 @@ bool SwDoc::AppendTxtNode( SwPosition& rPos )
}
SetModified();
- return TRUE;
+ return sal_True;
}
bool SwDoc::InsertString( const SwPaM &rRg, const String &rStr,
const enum InsertFlags nInsertMode )
{
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
+ GetIDocumentUndoRedo().ClearRedo(); // AppendUndo not always called!
}
const SwPosition& rPos = *rRg.GetPoint();
@@ -863,15 +886,16 @@ bool SwDoc::InsertString( const SwPaM &rRg, const String &rStr,
SwDataChanged aTmp( rRg, 0 );
- if( !DoesUndo() || !DoesGroupUndo() )
+ if (!GetIDocumentUndoRedo().DoesUndo() ||
+ !GetIDocumentUndoRedo().DoesGroupUndo())
{
pNode->InsertText( rStr, rPos.nContent, nInsertMode );
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
SwUndoInsert * const pUndo( new SwUndoInsert(
rPos.nNode, rPos.nContent.GetIndex(), rStr.Len(), nInsertMode));
- AppendUndo(pUndo);
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
}
else
@@ -882,25 +906,12 @@ bool SwDoc::InsertString( const SwPaM &rRg, const String &rStr,
if (!(nInsertMode & IDocumentContentOperations::INS_FORCEHINTEXPAND))
// -> #111827#
{
- USHORT const nUndoSize = pUndos->Count();
- if (0 != nUndoSize)
+ SwUndo *const pLastUndo = GetUndoManager().GetLastUndo();
+ SwUndoInsert *const pUndoInsert(
+ dynamic_cast<SwUndoInsert *>(pLastUndo) );
+ if (pUndoInsert && pUndoInsert->CanGrouping(rPos))
{
- SwUndo * const pLastUndo = (*pUndos)[ nUndoSize - 1 ];
-
- switch (pLastUndo->GetId())
- {
- case UNDO_INSERT:
- case UNDO_TYPING:
- if (static_cast<SwUndoInsert*>(pLastUndo)
- ->CanGrouping( rPos ))
- {
- pUndo = static_cast<SwUndoInsert*>(pLastUndo);
- }
- break;
-
- default:
- break;
- }
+ pUndo = pUndoInsert;
}
}
// <- #111827#
@@ -912,7 +923,7 @@ bool SwDoc::InsertString( const SwPaM &rRg, const String &rStr,
{
pUndo = new SwUndoInsert( rPos.nNode, nInsPos, 0, nInsertMode,
!rCC.isLetterNumeric( rStr, 0 ) );
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
}
pNode->InsertText( rStr, rPos.nContent, nInsertMode );
@@ -920,12 +931,12 @@ bool SwDoc::InsertString( const SwPaM &rRg, const String &rStr,
for( xub_StrLen i = 0; i < rStr.Len(); ++i )
{
nInsPos++;
- // wenn CanGrouping() TRUE returnt, ist schon alles erledigt
+ // wenn CanGrouping() sal_True returnt, ist schon alles erledigt
if( !pUndo->CanGrouping( rStr.GetChar( i ) ))
{
pUndo = new SwUndoInsert( rPos.nNode, nInsPos, 1, nInsertMode,
!rCC.isLetterNumeric( rStr, i ) );
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
}
}
}
@@ -1001,7 +1012,7 @@ SwFlyFrmFmt* SwDoc::Insert(const SwPaM &rRg, const svt::EmbeddedObjectRef& xObj,
{
if( !pFrmFmt )
{
- USHORT nId = RES_POOLFRM_OLE;
+ sal_uInt16 nId = RES_POOLFRM_OLE;
SvGlobalName aClassName( xObj->getClassID() );
if (SotExchange::IsMath(aClassName))
nId = RES_POOLFRM_FORMEL;
@@ -1041,9 +1052,9 @@ SwFlyFrmFmt* SwDoc::InsertOLE(const SwPaM &rRg, const String& rObjName,
|* Beschreibung: liefert den am Doc eingerichteten Feldtypen zurueck
*************************************************************************/
-SwFieldType *SwDoc::GetSysFldType( const USHORT eWhich ) const
+SwFieldType *SwDoc::GetSysFldType( const sal_uInt16 eWhich ) const
{
- for( USHORT i = 0; i < INIT_FLDTYPES; ++i )
+ for( sal_uInt16 i = 0; i < INIT_FLDTYPES; ++i )
if( eWhich == (*pFldTypes)[i]->Which() )
return (*pFldTypes)[i];
return 0;
@@ -1070,9 +1081,9 @@ struct _PostItFld : public _SetGetExpFld
_PostItFld( const SwNodeIndex& rNdIdx, const SwTxtFld* pFld, const SwIndex* pIdx = 0 )
: _SetGetExpFld( rNdIdx, pFld, pIdx ) {}
- USHORT GetPageNo( const StringRangeEnumerator &rRangeEnum,
+ sal_uInt16 GetPageNo( const StringRangeEnumerator &rRangeEnum,
const std::set< sal_Int32 > &rPossiblePages,
- USHORT& rVirtPgNo, USHORT& rLineNo );
+ sal_uInt16& rVirtPgNo, sal_uInt16& rLineNo );
SwPostItField* GetPostIt() const
{
@@ -1081,10 +1092,10 @@ struct _PostItFld : public _SetGetExpFld
};
-USHORT _PostItFld::GetPageNo(
+sal_uInt16 _PostItFld::GetPageNo(
const StringRangeEnumerator &rRangeEnum,
const std::set< sal_Int32 > &rPossiblePages,
- /* out */ USHORT& rVirtPgNo, /* out */ USHORT& rLineNo )
+ /* out */ sal_uInt16& rVirtPgNo, /* out */ sal_uInt16& rLineNo )
{
//Problem: Wenn ein PostItFld in einem Node steht, der von mehr als
//einer Layout-Instanz repraesentiert wird, steht die Frage im Raum,
@@ -1093,17 +1104,24 @@ USHORT _PostItFld::GetPageNo(
//sondern die des ersten Auftretens des PostIts innerhalb des selektierten
//Bereichs ermittelt werden.
rVirtPgNo = 0;
+<<<<<<< local
USHORT nPos = GetCntnt();
SwIterator<SwTxtFrm,SwTxtNode> aIter( GetFld()->GetTxtNode() );
for( SwTxtFrm* pFrm = aIter.First(); pFrm; pFrm = aIter.Next() )
+=======
+ sal_uInt16 nPos = GetCntnt();
+ SwClientIter aIter( (SwModify &)GetFld()->GetTxtNode() );
+ for( SwTxtFrm* pFrm = (SwTxtFrm*)aIter.First( TYPE( SwFrm ));
+ pFrm; pFrm = (SwTxtFrm*)aIter.Next() )
+>>>>>>> other
{
if( pFrm->GetOfst() > nPos ||
(pFrm->HasFollow() && pFrm->GetFollow()->GetOfst() <= nPos) )
continue;
- USHORT nPgNo = pFrm->GetPhyPageNum();
+ sal_uInt16 nPgNo = pFrm->GetPhyPageNum();
if( rRangeEnum.hasValue( nPgNo, &rPossiblePages ))
{
- rLineNo = (USHORT)(pFrm->GetLineCount( nPos ) +
+ rLineNo = (sal_uInt16)(pFrm->GetLineCount( nPos ) +
pFrm->GetAllLines() - pFrm->GetThisLines());
rVirtPgNo = pFrm->GetVirtPageNum();
return nPgNo;
@@ -1154,7 +1172,7 @@ static void lcl_FormatPostIt(
SwPaM& aPam,
SwPostItField* pField,
bool bNewPage, bool bIsFirstPostIt,
- USHORT nPageNo, USHORT nLineNo )
+ sal_uInt16 nPageNo, sal_uInt16 nLineNo )
{
static char __READONLY_DATA sTmp[] = " : ";
@@ -1210,7 +1228,7 @@ static sal_Int32 lcl_GetPaperBin( const SwPageFrm *pStartFrm )
const SwFrmFmt &rFmt = pStartFrm->GetPageDesc()->GetMaster();
const SfxPoolItem *pItem = NULL;
- SfxItemState eState = rFmt.GetItemState( RES_PAPER_BIN, FALSE, &pItem );
+ SfxItemState eState = rFmt.GetItemState( RES_PAPER_BIN, sal_False, &pItem );
const SvxPaperBinItem *pPaperBinItem = dynamic_cast< const SvxPaperBinItem * >(pItem);
if (eState > SFX_ITEM_DEFAULT && pPaperBinItem)
nRes = pPaperBinItem->GetValue();
@@ -1245,31 +1263,31 @@ void SwDoc::CalculatePagesForPrinting(
const SwPageFrm *pStPage = dynamic_cast<const SwPageFrm*>( rLayout.Lower() );
const SwFrm *pEndPage = pStPage;
- USHORT nFirstPageNo = 0;
- USHORT nLastPageNo = 0;
- USHORT nPageNo = 1;
+ sal_uInt16 nFirstPageNo = 0;
+ sal_uInt16 nLastPageNo = 0;
+ sal_uInt16 nPageNo = 1;
- for( USHORT i = 1; i <= (USHORT)aPages.Max(); ++i )
+ for( sal_uInt16 i = 1; i <= (sal_uInt16)aPages.Max(); ++i )
{
- if( i < (USHORT)aPages.Min() )
+ if( i < (sal_uInt16)aPages.Min() )
{
if( !pStPage->GetNext() )
break;
pStPage = (SwPageFrm*)pStPage->GetNext();
pEndPage= pStPage;
}
- else if( i == (USHORT)aPages.Min() )
+ else if( i == (sal_uInt16)aPages.Min() )
{
nFirstPageNo = i;
nLastPageNo = nFirstPageNo;
- if( !pStPage->GetNext() || (i == (USHORT)aPages.Max()) )
+ if( !pStPage->GetNext() || (i == (sal_uInt16)aPages.Max()) )
break;
pEndPage = pStPage->GetNext();
}
- else if( i > (USHORT)aPages.Min() )
+ else if( i > (sal_uInt16)aPages.Min() )
{
nLastPageNo = i;
- if( !pEndPage->GetNext() || (i == (USHORT)aPages.Max()) )
+ if( !pEndPage->GetNext() || (i == (sal_uInt16)aPages.Max()) )
break;
pEndPage = pEndPage->GetNext();
}
@@ -1282,7 +1300,7 @@ void SwDoc::CalculatePagesForPrinting(
// geschaffen werden, alle Seiten von Seite x an zu deselektieren.
// Z.B. durch SetTotalRange ....
-// aMulti.Select( Range( nLastPageNo+1, SELECTION_MAX ), FALSE );
+// aMulti.Select( Range( nLastPageNo+1, SELECTION_MAX ), sal_False );
MultiSelection aTmpMulti( Range( 1, nLastPageNo ) );
long nTmpIdx = aMulti.FirstSelected();
static long nEndOfSelection = SFX_ENDOFSELECTION;
@@ -1303,7 +1321,7 @@ void SwDoc::CalculatePagesForPrinting(
rValidStartFrms.clear();
while ( pStPage )
{
- const BOOL bRightPg = pStPage->OnRightPage();
+ const sal_Bool bRightPg = pStPage->OnRightPage();
if ( aMulti.IsSelected( nPageNo ) &&
( (bRightPg && bPrintRightPages) ||
(!bRightPg && bPrintLeftPages) ) )
@@ -1340,12 +1358,14 @@ void SwDoc::CalculatePagesForPrinting(
// get PageRange value to use
OUString aPageRange;
- if (bIsPDFExport)
- {
- // ?? rOptions.getValue( C2U("Selection") );
- aPageRange = rOptions.getStringValue( "PageRange", OUString() );
- }
- else
+ // --> PL, OD #i116085# - adjusting fix for i113919
+// if (bIsPDFExport)
+// {
+// aPageRange = rOptions.getStringValue( "PageRange", OUString() );
+// }
+// else
+ if ( !bIsPDFExport )
+ // <--
{
// PageContent :
// 0 -> print all pages (default if aPageRange is empty)
@@ -1391,7 +1411,7 @@ void SwDoc::UpdatePagesForPrintingWithPostItData(
sal_Int16 nPostItMode = (sal_Int16) rOptions.getIntValue( "PrintAnnotationMode", 0 );
DBG_ASSERT(nPostItMode == POSTITS_NONE || rData.HasPostItData(),
"print post-its without post-it data?" );
- const USHORT nPostItCount = rData.HasPostItData() ? rData.m_pPostItFields->Count() : 0;
+ const sal_uInt16 nPostItCount = rData.HasPostItData() ? rData.m_pPostItFields->Count() : 0;
if (nPostItMode != POSTITS_NONE && nPostItCount > 0)
{
SET_CURR_SHELL( rData.m_pPostItShell );
@@ -1415,9 +1435,9 @@ void SwDoc::UpdatePagesForPrintingWithPostItData(
// temporary post-it document.
// Since the array of post-it fileds is sorted by page and line number we will
// already get them in the correct order
- USHORT nVirtPg = 0, nLineNo = 0, nLastPageNum = 0, nPhyPageNum = 0;
+ sal_uInt16 nVirtPg = 0, nLineNo = 0, nLastPageNum = 0, nPhyPageNum = 0;
bool bIsFirstPostIt = true;
- for (USHORT i = 0; i < nPostItCount; ++i)
+ for (sal_uInt16 i = 0; i < nPostItCount; ++i)
{
_PostItFld& rPostIt = (_PostItFld&)*(*rData.m_pPostItFields)[ i ];
nLastPageNum = nPhyPageNum;
@@ -1658,7 +1678,7 @@ void SwDoc::CalculatePagePairsForProspectPrinting(
// dann sorge mal dafuer, das alle Seiten in der richtigen
// Reihenfolge stehen:
- USHORT nSPg = 0, nEPg = aVec.size(), nStep = 1;
+ sal_uInt16 nSPg = 0, nEPg = aVec.size(), nStep = 1;
if ( 0 == (nEPg & 1 )) // ungerade gibt es nicht!
--nEPg;
@@ -1673,7 +1693,7 @@ void SwDoc::CalculatePagePairsForProspectPrinting(
// the number of 'virtual' pages to be printed
sal_Int32 nCntPage = (( nEPg - nSPg ) / ( 2 * nStep )) + 1;
- for ( USHORT nPrintCount = 0; nSPg < nEPg &&
+ for ( sal_uInt16 nPrintCount = 0; nSPg < nEPg &&
nPrintCount < nCntPage; ++nPrintCount )
{
pStPage = aVec[ nSPg ];
@@ -1723,7 +1743,7 @@ void SwDoc::UpdateDocStat( SwDocStat& rStat )
rStat.nPara = 0; // Default ist auf 1 !!
SwNode* pNd;
- for( ULONG i = GetNodes().Count(); i; )
+ for( sal_uLong i = GetNodes().Count(); i; )
{
switch( ( pNd = GetNodes()[ --i ])->GetNodeType() )
{
@@ -1752,8 +1772,13 @@ void SwDoc::UpdateDocStat( SwDocStat& rStat )
}
}
+<<<<<<< local
rStat.nPage = GetCurrentLayout() ? GetCurrentLayout()->GetPageNum() : 0; //swmod 080218
rStat.bModified = FALSE;
+=======
+ rStat.nPage = GetRootFrm() ? GetRootFrm()->GetPageNum() : 0;
+ rStat.bModified = sal_False;
+>>>>>>> other
SetDocStat( rStat );
com::sun::star::uno::Sequence < com::sun::star::beans::NamedValue > aStat( rStat.nPage ? 7 : 6);
@@ -1830,7 +1855,7 @@ const SwFmtRefMark* SwDoc::GetRefMark( const String& rName ) const
}
// returne die RefMark per Index - fuer Uno
-const SwFmtRefMark* SwDoc::GetRefMark( USHORT nIndex ) const
+const SwFmtRefMark* SwDoc::GetRefMark( sal_uInt16 nIndex ) const
{
const SfxPoolItem* pItem;
const SwTxtRefMark* pTxtRef;
@@ -1857,7 +1882,7 @@ const SwFmtRefMark* SwDoc::GetRefMark( USHORT nIndex ) const
//JP 24.06.96: Ist der ArrayPointer 0 dann returne nur, ob im Doc. eine
// RefMark gesetzt ist
// OS 25.06.96: ab jetzt wird immer die Anzahl der Referenzen returnt
-USHORT SwDoc::GetRefMarks( SvStringsDtor* pNames ) const
+sal_uInt16 SwDoc::GetRefMarks( SvStringsDtor* pNames ) const
{
const SfxPoolItem* pItem;
const SwTxtRefMark* pTxtRef;
@@ -1939,13 +1964,13 @@ void SwDoc::SetModified()
// Bit 0: -> alter Zustand
// Bit 1: -> neuer Zustand
long nCall = mbModified ? 3 : 2;
- mbModified = TRUE;
- pDocStat->bModified = TRUE;
+ mbModified = sal_True;
+ pDocStat->bModified = sal_True;
if( aOle2Link.IsSet() )
{
- mbInCallModified = TRUE;
+ mbInCallModified = sal_True;
aOle2Link.Call( (void*)nCall );
- mbInCallModified = FALSE;
+ mbInCallModified = sal_False;
}
if( pACEWord && !pACEWord->IsDeleted() )
@@ -1958,17 +1983,17 @@ void SwDoc::ResetModified()
// Bit 0: -> alter Zustand
// Bit 1: -> neuer Zustand
long nCall = mbModified ? 1 : 0;
- mbModified = FALSE;
+ mbModified = sal_False;
// If there is already a document statistic, we assume that
// it is correct. In this case we reset the modified flag.
if ( 0 != pDocStat->nChar )
- pDocStat->bModified = FALSE;
- nUndoSavePos = nUndoPos;
+ pDocStat->bModified = sal_False;
+ GetIDocumentUndoRedo().SetUndoNoModifiedPosition();
if( nCall && aOle2Link.IsSet() )
{
- mbInCallModified = TRUE;
+ mbInCallModified = sal_True;
aOle2Link.Call( (void*)nCall );
- mbInCallModified = FALSE;
+ mbInCallModified = sal_False;
}
}
@@ -1982,10 +2007,9 @@ void SwDoc::ReRead( SwPaM& rPam, const String& rGrfName,
|| rPam.GetPoint()->nNode.GetIndex() == rPam.GetMark()->nNode.GetIndex() )
&& 0 != ( pGrfNd = rPam.GetPoint()->nNode.GetNode().GetGrfNode() ) )
{
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoReRead( rPam, *pGrfNd ) );
+ GetIDocumentUndoRedo().AppendUndo(new SwUndoReRead(rPam, *pGrfNd));
}
// Weil nicht bekannt ist, ob sich die Grafik spiegeln laesst,
@@ -1994,15 +2018,15 @@ void SwDoc::ReRead( SwPaM& rPam, const String& rGrfName,
GetMirrorGrf().GetValue() )
pGrfNd->SetAttr( SwMirrorGrf() );
- pGrfNd->ReRead( rGrfName, rFltName, pGraphic, pGrafObj, TRUE );
+ pGrfNd->ReRead( rGrfName, rFltName, pGraphic, pGrafObj, sal_True );
SetModified();
}
}
-BOOL lcl_SpellAndGrammarAgain( const SwNodePtr& rpNd, void* pArgs )
+sal_Bool lcl_SpellAndGrammarAgain( const SwNodePtr& rpNd, void* pArgs )
{
SwTxtNode *pTxtNode = (SwTxtNode*)rpNd->GetTxtNode();
- BOOL bOnlyWrong = *(BOOL*)pArgs;
+ sal_Bool bOnlyWrong = *(sal_Bool*)pArgs;
if( pTxtNode )
{
if( bOnlyWrong )
@@ -2024,13 +2048,13 @@ BOOL lcl_SpellAndGrammarAgain( const SwNodePtr& rpNd, void* pArgs )
pTxtNode->GetGrammarCheck()->SetInvalid( 0, STRING_LEN );
}
}
- return TRUE;
+ return sal_True;
}
-BOOL lcl_CheckSmartTagsAgain( const SwNodePtr& rpNd, void* )
+sal_Bool lcl_CheckSmartTagsAgain( const SwNodePtr& rpNd, void* )
{
SwTxtNode *pTxtNode = (SwTxtNode*)rpNd->GetTxtNode();
-// BOOL bOnlyWrong = *(BOOL*)pArgs;
+// sal_Bool bOnlyWrong = *(sal_Bool*)pArgs;
if( pTxtNode )
{
pTxtNode->SetSmartTagDirty( true );
@@ -2042,22 +2066,22 @@ BOOL lcl_CheckSmartTagsAgain( const SwNodePtr& rpNd, void* )
pTxtNode->SetSmartTags( NULL );
}
}
- return TRUE;
+ return sal_True;
}
/*************************************************************************
- * SwDoc::SpellItAgainSam( BOOL bInvalid, BOOL bOnlyWrong )
+ * SwDoc::SpellItAgainSam( sal_Bool bInvalid, sal_Bool bOnlyWrong )
*
* stoesst das Spelling im Idle-Handler wieder an.
- * Wird bInvalid als TRUE uebergeben, so werden zusaetzlich die WrongListen
+ * Wird bInvalid als sal_True uebergeben, so werden zusaetzlich die WrongListen
* an allen Nodes invalidiert und auf allen Seiten das SpellInvalid-Flag
* gesetzt.
* Mit bOnlyWrong kann man dann steuern, ob nur die Bereiche mit falschen
* Woertern oder die kompletten Bereiche neu ueberprueft werden muessen.
************************************************************************/
-void SwDoc::SpellItAgainSam( BOOL bInvalid, BOOL bOnlyWrong, BOOL bSmartTags )
+void SwDoc::SpellItAgainSam( sal_Bool bInvalid, sal_Bool bOnlyWrong, sal_Bool bSmartTags )
{
std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();//swmod 080307
ASSERT( GetCurrentLayout(), "SpellAgain: Where's my RootFrm?" );
@@ -2078,9 +2102,19 @@ void SwDoc::InvalidateAutoCompleteFlag()
SwRootFrm* pTmpRoot = GetCurrentLayout();
if( pTmpRoot )
{
+<<<<<<< local
std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();
std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::AllInvalidateAutoCompleteWords));//swmod 080305
for( ULONG nNd = 1, nCnt = GetNodes().Count(); nNd < nCnt; ++nNd )
+=======
+ SwPageFrm *pPage = (SwPageFrm*)GetRootFrm()->Lower();
+ while ( pPage )
+ {
+ pPage->InvalidateAutoCompleteWords();
+ pPage = (SwPageFrm*)pPage->GetNext();
+ }
+ for( sal_uLong nNd = 1, nCnt = GetNodes().Count(); nNd < nCnt; ++nNd )
+>>>>>>> other
{
SwTxtNode* pTxtNode = GetNodes()[ nNd ]->GetTxtNode();
if ( pTxtNode ) pTxtNode->SetAutoCompleteWordDirty( true );
@@ -2110,28 +2144,28 @@ const SwFmtINetFmt* SwDoc::FindINetAttr( const String& rName ) const
return 0;
}
-void SwDoc::Summary( SwDoc* pExtDoc, BYTE nLevel, BYTE nPara, BOOL bImpress )
+void SwDoc::Summary( SwDoc* pExtDoc, sal_uInt8 nLevel, sal_uInt8 nPara, sal_Bool bImpress )
{
const SwOutlineNodes& rOutNds = GetNodes().GetOutLineNds();
if( pExtDoc && rOutNds.Count() )
{
- USHORT i;
+ sal_uInt16 i;
::StartProgress( STR_STATSTR_SUMMARY, 0, rOutNds.Count(), GetDocShell() );
SwNodeIndex aEndOfDoc( pExtDoc->GetNodes().GetEndOfContent(), -1 );
for( i = 0; i < rOutNds.Count(); ++i )
{
::SetProgressState( i, GetDocShell() );
- const ULONG nIndex = rOutNds[ i ]->GetIndex();
- //BYTE nLvl = ((SwTxtNode*)GetNodes()[ nIndex ])->GetTxtColl()//#outline level,zhaojianwei
+ const sal_uLong nIndex = rOutNds[ i ]->GetIndex();
+ //sal_uInt8 nLvl = ((SwTxtNode*)GetNodes()[ nIndex ])->GetTxtColl()//#outline level,zhaojianwei
// ->GetOutlineLevel();
const int nLvl = ((SwTxtNode*)GetNodes()[ nIndex ])->GetAttrOutlineLevel()-1;//<-end,zhaojianwei
if( nLvl > nLevel )
continue;
- USHORT nEndOfs = 1;
- BYTE nWish = nPara;
- ULONG nNextOutNd = i + 1 < rOutNds.Count() ?
+ sal_uInt16 nEndOfs = 1;
+ sal_uInt8 nWish = nPara;
+ sal_uLong nNextOutNd = i + 1 < rOutNds.Count() ?
rOutNds[ i + 1 ]->GetIndex() : GetNodes().Count();
- BOOL bKeep = FALSE;
+ sal_Bool bKeep = sal_False;
while( ( nWish || bKeep ) && nIndex + nEndOfs < nNextOutNd &&
GetNodes()[ nIndex + nEndOfs ]->IsTxtNode() )
{
@@ -2153,7 +2187,7 @@ void SwDoc::Summary( SwDoc* pExtDoc, BYTE nLevel, BYTE nPara, BOOL bImpress )
while( aIndx < aEndOfDoc )
{
SwNode *pNode;
- BOOL bDelete = FALSE;
+ sal_Bool bDelete = sal_False;
if( (pNode = &aIndx.GetNode())->IsTxtNode() )
{
SwTxtNode *pNd = (SwTxtNode*)pNode;
@@ -2162,8 +2196,8 @@ void SwDoc::Summary( SwDoc* pExtDoc, BYTE nLevel, BYTE nPara, BOOL bImpress )
if( bImpress )
{
SwTxtFmtColl* pMyColl = pNd->GetTxtColl();
- //USHORT nHeadLine = static_cast<USHORT>(pMyColl->GetOutlineLevel()==NO_NUMBERING ?//#outlinelevel,zhaojianwei
- const USHORT nHeadLine = static_cast<USHORT>(
+ //sal_uInt16 nHeadLine = static_cast<sal_uInt16>(pMyColl->GetOutlineLevel()==NO_NUMBERING ?//#outlinelevel,zhaojianwei
+ const sal_uInt16 nHeadLine = static_cast<sal_uInt16>(
!pMyColl->IsAssignedToListLevelOfOutlineStyle() //<-end,zhaojianwei
? RES_POOLCOLL_HEADLINE2
: RES_POOLCOLL_HEADLINE1 );
@@ -2173,7 +2207,7 @@ void SwDoc::Summary( SwDoc* pExtDoc, BYTE nLevel, BYTE nPara, BOOL bImpress )
if( !pNd->Len() &&
pNd->StartOfSectionIndex()+2 < pNd->EndOfSectionIndex() )
{
- bDelete = TRUE;
+ bDelete = sal_True;
pExtDoc->GetNodes().Delete( aIndx );
}
}
@@ -2186,10 +2220,10 @@ void SwDoc::Summary( SwDoc* pExtDoc, BYTE nLevel, BYTE nPara, BOOL bImpress )
// loesche den nicht sichtbaren Content aus dem Document, wie z.B.:
// versteckte Bereiche, versteckte Absaetze
-BOOL SwDoc::RemoveInvisibleContent()
+bool SwDoc::RemoveInvisibleContent()
{
- BOOL bRet = FALSE;
- StartUndo( UNDO_UI_DELETE_INVISIBLECNTNT, NULL );
+ sal_Bool bRet = sal_False;
+ GetIDocumentUndoRedo().StartUndo( UNDO_UI_DELETE_INVISIBLECNTNT, NULL );
{
SwTxtNode* pTxtNd;
@@ -2201,7 +2235,7 @@ BOOL SwDoc::RemoveInvisibleContent()
pTxtNd->GetpSwpHints() && pTxtNd->HasHiddenParaField() &&
&pTxtNd->GetNodes() == &GetNodes() )
{
- bRet = TRUE;
+ bRet = sal_True;
SwPaM aPam( *pTxtNd, 0, *pTxtNd, pTxtNd->GetTxt().Len() );
// Remove hidden paragraph or delete contents:
@@ -2227,7 +2261,7 @@ BOOL SwDoc::RemoveInvisibleContent()
//
// Remove any hidden paragraph (hidden text attribute)
//
- for( ULONG n = GetNodes().Count(); n; )
+ for( sal_uLong n = GetNodes().Count(); n; )
{
SwTxtNode* pTxtNd = GetNodes()[ --n ]->GetTxtNode();
if ( pTxtNd )
@@ -2236,8 +2270,8 @@ BOOL SwDoc::RemoveInvisibleContent()
SwPaM aPam( *pTxtNd, 0, *pTxtNd, pTxtNd->GetTxt().Len() );
if ( pTxtNd->HasHiddenCharAttribute( true ) )
{
- bRemoved = TRUE;
- bRet = TRUE;
+ bRemoved = sal_True;
+ bRet = sal_True;
// Remove hidden paragraph or delete contents:
// Delete contents if
@@ -2259,8 +2293,8 @@ BOOL SwDoc::RemoveInvisibleContent()
}
else if ( pTxtNd->HasHiddenCharAttribute( false ) )
{
- bRemoved = TRUE;
- bRet = TRUE;
+ bRemoved = sal_True;
+ bRet = sal_True;
SwScriptInfo::DeleteHiddenRanges( *pTxtNd );
}
@@ -2277,7 +2311,7 @@ BOOL SwDoc::RemoveInvisibleContent()
// dann noch alle versteckten Bereiche loeschen/leeren
SwSectionFmts aSectFmts;
SwSectionFmts& rSectFmts = GetSections();
- USHORT n;
+ sal_uInt16 n;
for( n = rSectFmts.Count(); n; )
{
@@ -2316,7 +2350,7 @@ BOOL SwDoc::RemoveInvisibleContent()
SwSectionNode* pSectNd = pSectFmt->GetSectionNode();
if( pSectNd )
{
- bRet = TRUE;
+ bRet = sal_True;
SwPaM aPam( *pSectNd );
if( pSectNd->StartOfSectionNode()->StartOfSectionIndex() ==
@@ -2352,15 +2386,15 @@ BOOL SwDoc::RemoveInvisibleContent()
if( bRet )
SetModified();
- EndUndo( UNDO_UI_DELETE_INVISIBLECNTNT, NULL );
+ GetIDocumentUndoRedo().EndUndo( UNDO_UI_DELETE_INVISIBLECNTNT, NULL );
return bRet;
}
/*-- 25.08.2010 14:18:12---------------------------------------------------
-----------------------------------------------------------------------*/
-BOOL SwDoc::HasInvisibleContent() const
+bool SwDoc::HasInvisibleContent() const
{
- BOOL bRet = sal_False;
+ sal_Bool bRet = sal_False;
SwClientIter aIter( *GetSysFldType( RES_HIDDENPARAFLD ) );
if( aIter.First( TYPE( SwFmtFld ) ) )
@@ -2371,7 +2405,7 @@ BOOL SwDoc::HasInvisibleContent() const
//
if( ! bRet )
{
- for( ULONG n = GetNodes().Count(); !bRet && (n > 0); )
+ for( sal_uLong n = GetNodes().Count(); !bRet && (n > 0); )
{
SwTxtNode* pTxtNd = GetNodes()[ --n ]->GetTxtNode();
if ( pTxtNd )
@@ -2388,7 +2422,7 @@ BOOL SwDoc::HasInvisibleContent() const
if( ! bRet )
{
const SwSectionFmts& rSectFmts = GetSections();
- USHORT n;
+ sal_uInt16 n;
for( n = rSectFmts.Count(); !bRet && (n > 0); )
{
@@ -2403,14 +2437,29 @@ BOOL SwDoc::HasInvisibleContent() const
}
return bRet;
}
+
+bool SwDoc::RestoreInvisibleContent()
+{
+ bool bRet = false;
+ SwUndoId nLastUndoId(UNDO_EMPTY);
+ if (GetIDocumentUndoRedo().GetLastUndoInfo(0, & nLastUndoId)
+ && (UNDO_UI_DELETE_INVISIBLECNTNT == nLastUndoId))
+ {
+ GetIDocumentUndoRedo().Undo();
+ GetIDocumentUndoRedo().ClearRedo();
+ bRet = true;
+ }
+ return bRet;
+}
+
/*-- 11.06.2004 08:34:04---------------------------------------------------
-----------------------------------------------------------------------*/
-BOOL SwDoc::ConvertFieldsToText()
+sal_Bool SwDoc::ConvertFieldsToText()
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
LockExpFlds();
- StartUndo( UNDO_UI_REPLACE, NULL );
+ GetIDocumentUndoRedo().StartUndo( UNDO_UI_REPLACE, NULL );
const SwFldTypes* pMyFldTypes = GetFldTypes();
sal_uInt16 nCount = pMyFldTypes->Count();
@@ -2435,17 +2484,17 @@ BOOL SwDoc::ConvertFieldsToText()
// skip fields that are currently not in the document
// e.g. fields in undo or redo array
- BOOL bSkip = !pTxtFld ||
+ sal_Bool bSkip = !pTxtFld ||
!pTxtFld->GetpTxtNode()->GetNodes().IsDocNodes();
if (!bSkip)
{
- BOOL bInHeaderFooter = IsInHeaderFooter(SwNodeIndex(*pTxtFld->GetpTxtNode()));
+ sal_Bool bInHeaderFooter = IsInHeaderFooter(SwNodeIndex(*pTxtFld->GetpTxtNode()));
const SwFmtFld& rFmtFld = pTxtFld->GetFld();
const SwField* pField = rFmtFld.GetFld();
//#i55595# some fields have to be excluded in headers/footers
- USHORT nWhich = pField->GetTyp()->Which();
+ sal_uInt16 nWhich = pField->GetTyp()->Which();
if(!bInHeaderFooter ||
(nWhich != RES_PAGENUMBERFLD &&
nWhich != RES_CHAPTERFLD &&
@@ -2477,7 +2526,7 @@ BOOL SwDoc::ConvertFieldsToText()
if( bRet )
SetModified();
- EndUndo( UNDO_UI_REPLACE, NULL );
+ GetIDocumentUndoRedo().EndUndo( UNDO_UI_REPLACE, NULL );
UnlockExpFlds();
return bRet;
@@ -2516,7 +2565,7 @@ bool SwDoc::LinksUpdated() const
// embedded alle lokalen Links (Bereiche/Grafiken)
::sfx2::SvBaseLink* lcl_FindNextRemovableLink( const ::sfx2::SvBaseLinks& rLinks, sfx2::LinkManager& rLnkMgr )
{
- for( USHORT n = 0; n < rLinks.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rLinks.Count(); ++n )
{
::sfx2::SvBaseLink* pLnk = &(*rLinks[ n ]);
if( pLnk &&
@@ -2539,13 +2588,12 @@ bool SwDoc::LinksUpdated() const
}
bool SwDoc::EmbedAllLinks()
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
sfx2::LinkManager& rLnkMgr = GetLinkManager();
const ::sfx2::SvBaseLinks& rLinks = rLnkMgr.GetLinks();
if( rLinks.Count() )
{
- BOOL bDoesUndo = DoesUndo();
- DoUndo( FALSE );
+ ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
::sfx2::SvBaseLink* pLnk = 0;
while( 0 != (pLnk = lcl_FindNextRemovableLink( rLinks, rLnkMgr ) ) )
@@ -2558,11 +2606,10 @@ bool SwDoc::EmbedAllLinks()
if( xLink.Is() )
rLnkMgr.Remove( xLink );
- bRet = TRUE;
+ bRet = sal_True;
}
- DelAllUndoObj();
- DoUndo( bDoesUndo );
+ GetIDocumentUndoRedo().DelAllUndoObj();
SetModified();
}
return bRet;
@@ -2572,12 +2619,12 @@ bool SwDoc::EmbedAllLinks()
Beschreibung:
--------------------------------------------------------------------*/
-BOOL SwDoc::IsInsTblFormatNum() const
+sal_Bool SwDoc::IsInsTblFormatNum() const
{
return SW_MOD()->IsInsTblFormatNum(get(IDocumentSettingAccess::HTML_MODE));
}
-BOOL SwDoc::IsInsTblChangeNumFormat() const
+sal_Bool SwDoc::IsInsTblChangeNumFormat() const
{
return SW_MOD()->IsInsTblChangeNumFormat(get(IDocumentSettingAccess::HTML_MODE));
}
@@ -2586,13 +2633,13 @@ BOOL SwDoc::IsInsTblChangeNumFormat() const
Beschreibung:
--------------------------------------------------------------------*/
-BOOL SwDoc::IsInsTblAlignNum() const
+sal_Bool SwDoc::IsInsTblAlignNum() const
{
return SW_MOD()->IsInsTblAlignNum(get(IDocumentSettingAccess::HTML_MODE));
}
// setze das InsertDB als Tabelle Undo auf:
-void SwDoc::AppendUndoForInsertFromDB( const SwPaM& rPam, BOOL bIsTable )
+void SwDoc::AppendUndoForInsertFromDB( const SwPaM& rPam, sal_Bool bIsTable )
{
if( bIsTable )
{
@@ -2601,26 +2648,26 @@ void SwDoc::AppendUndoForInsertFromDB( const SwPaM& rPam, BOOL bIsTable )
{
SwUndoCpyTbl* pUndo = new SwUndoCpyTbl;
pUndo->SetTableSttIdx( pTblNd->GetIndex() );
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
}
}
else if( rPam.HasMark() )
{
SwUndoCpyDoc* pUndo = new SwUndoCpyDoc( rPam );
- pUndo->SetInsertRange( rPam, FALSE );
- AppendUndo( pUndo );
+ pUndo->SetInsertRange( rPam, sal_False );
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
}
}
void SwDoc::ChgTOX(SwTOXBase & rTOX, const SwTOXBase & rNew)
{
- if (DoesUndo())
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- DelAllUndoObj();
+ GetIDocumentUndoRedo().DelAllUndoObj();
SwUndo * pUndo = new SwUndoTOXChange(&rTOX, rNew);
- AppendUndo(pUndo);
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
rTOX = rNew;
@@ -2638,9 +2685,9 @@ String SwDoc::GetPaMDescr(const SwPaM & rPam) const
String aResult;
bool bOK = false;
- if (rPam.GetNode(TRUE) == rPam.GetNode(FALSE))
+ if (rPam.GetNode(sal_True) == rPam.GetNode(sal_False))
{
- SwTxtNode * pTxtNode = rPam.GetNode(TRUE)->GetTxtNode();
+ SwTxtNode * pTxtNode = rPam.GetNode(sal_True)->GetTxtNode();
if (0 != pTxtNode)
{
@@ -2657,9 +2704,9 @@ String SwDoc::GetPaMDescr(const SwPaM & rPam) const
bOK = true;
}
}
- else if (0 != rPam.GetNode(TRUE))
+ else if (0 != rPam.GetNode(sal_True))
{
- if (0 != rPam.GetNode(FALSE))
+ if (0 != rPam.GetNode(sal_False))
aResult += String(SW_RES(STR_PARAGRAPHS));
bOK = true;
@@ -2692,7 +2739,7 @@ SwTxtFld * SwDoc::GetTxtFld(const SwPosition & rPos)
bool SwDoc::ContainsHiddenChars() const
{
- for( ULONG n = GetNodes().Count(); n; )
+ for( sal_uLong n = GetNodes().Count(); n; )
{
SwNode* pNd = GetNodes()[ --n ];
if ( ND_TEXTNODE == pNd->GetNodeType() &&
@@ -2703,7 +2750,7 @@ bool SwDoc::ContainsHiddenChars() const
return false;
}
-SwUnoCrsr* SwDoc::CreateUnoCrsr( const SwPosition& rPos, BOOL bTblCrsr )
+SwUnoCrsr* SwDoc::CreateUnoCrsr( const SwPosition& rPos, sal_Bool bTblCrsr )
{
SwUnoCrsr* pNew;
if( bTblCrsr )
@@ -2717,7 +2764,7 @@ SwUnoCrsr* SwDoc::CreateUnoCrsr( const SwPosition& rPos, BOOL bTblCrsr )
void SwDoc::ChkCondColls()
{
- for (USHORT n = 0; n < pTxtFmtCollTbl->Count(); n++)
+ for (sal_uInt16 n = 0; n < pTxtFmtCollTbl->Count(); n++)
{
SwTxtFmtColl *pColl = (*pTxtFmtCollTbl)[n];
if (RES_CONDTXTFMTCOLL == pColl->Which())
diff --git a/sw/source/core/doc/docbasic.cxx b/sw/source/core/doc/docbasic.cxx
index 37568933e522..77665e55fbce 100644
--- a/sw/source/core/doc/docbasic.cxx
+++ b/sw/source/core/doc/docbasic.cxx
@@ -55,13 +55,13 @@ static Sequence<Any> *lcl_docbasic_convertArgs( SbxArray& rArgs )
{
Sequence<Any> *pRet = 0;
- USHORT nCount = rArgs.Count();
+ sal_uInt16 nCount = rArgs.Count();
if( nCount > 1 )
{
nCount--;
pRet = new Sequence<Any>( nCount );
Any *pUnoArgs = pRet->getArray();
- for( USHORT i=0; i<nCount; i++ )
+ for( sal_uInt16 i=0; i<nCount; i++ )
{
SbxVariable *pVar = rArgs.Get( i+1 );
switch( pVar->GetType() )
@@ -88,7 +88,7 @@ static Sequence<Any> *lcl_docbasic_convertArgs( SbxArray& rArgs )
return pRet;
}
-BOOL SwDoc::ExecMacro( const SvxMacro& rMacro, String* pRet, SbxArray* pArgs )
+sal_Bool SwDoc::ExecMacro( const SvxMacro& rMacro, String* pRet, SbxArray* pArgs )
{
ErrCode eErr = 0;
switch( rMacro.GetScriptType() )
@@ -100,7 +100,7 @@ BOOL SwDoc::ExecMacro( const SvxMacro& rMacro, String* pRet, SbxArray* pArgs )
aRef = pRetValue;
eErr = pDocShell->CallBasic( rMacro.GetMacName(),
rMacro.GetLibName(),
- 0, pArgs, pRet ? pRetValue : 0 );
+ pArgs, pRet ? pRetValue : 0 );
if( pRet && SbxNULL < pRetValue->GetType() &&
SbxVOID != pRetValue->GetType() )
@@ -153,13 +153,13 @@ BOOL SwDoc::ExecMacro( const SvxMacro& rMacro, String* pRet, SbxArray* pArgs )
-USHORT SwDoc::CallEvent( USHORT nEvent, const SwCallMouseEvent& rCallEvent,
- BOOL bCheckPtr, SbxArray* pArgs, const Link* )
+sal_uInt16 SwDoc::CallEvent( sal_uInt16 nEvent, const SwCallMouseEvent& rCallEvent,
+ sal_Bool bCheckPtr, SbxArray* pArgs, const Link* )
{
if( !pDocShell ) // ohne DocShell geht das nicht!
return 0;
- USHORT nRet = 0;
+ sal_uInt16 nRet = 0;
const SvxMacroTableDtor* pTbl = 0;
switch( rCallEvent.eType )
{
@@ -172,7 +172,7 @@ USHORT SwDoc::CallEvent( USHORT nEvent, const SwCallMouseEvent& rCallEvent,
if( 0 != (pItem = GetAttrPool().GetItem2( RES_TXTATR_INETFMT, n ) )
&& rCallEvent.PTR.pINetAttr == pItem )
{
- bCheckPtr = FALSE; // als Flag missbrauchen
+ bCheckPtr = sal_False; // als Flag missbrauchen
break;
}
}
@@ -186,9 +186,9 @@ USHORT SwDoc::CallEvent( USHORT nEvent, const SwCallMouseEvent& rCallEvent,
const SwFrmFmtPtr pFmt = (SwFrmFmtPtr)rCallEvent.PTR.pFmt;
if( bCheckPtr )
{
- USHORT nPos = GetSpzFrmFmts()->GetPos( pFmt );
+ sal_uInt16 nPos = GetSpzFrmFmts()->GetPos( pFmt );
if( USHRT_MAX != nPos )
- bCheckPtr = FALSE; // als Flag missbrauchen
+ bCheckPtr = sal_False; // als Flag missbrauchen
}
if( !bCheckPtr )
pTbl = &pFmt->GetMacro().GetMacroTable();
@@ -201,7 +201,7 @@ USHORT SwDoc::CallEvent( USHORT nEvent, const SwCallMouseEvent& rCallEvent,
if( bCheckPtr )
{
const SwFrmFmtPtr pFmt = (SwFrmFmtPtr)rCallEvent.PTR.IMAP.pFmt;
- USHORT nPos = GetSpzFrmFmts()->GetPos( pFmt );
+ sal_uInt16 nPos = GetSpzFrmFmts()->GetPos( pFmt );
const ImageMap* pIMap;
if( USHRT_MAX != nPos &&
0 != (pIMap = pFmt->GetURL().GetMap()) )
@@ -209,7 +209,7 @@ USHORT SwDoc::CallEvent( USHORT nEvent, const SwCallMouseEvent& rCallEvent,
for( nPos = pIMap->GetIMapObjectCount(); nPos; )
if( pIMapObj == pIMap->GetIMapObject( --nPos ))
{
- bCheckPtr = FALSE; // als Flag missbrauchen
+ bCheckPtr = sal_False; // als Flag missbrauchen
break;
}
}
@@ -231,7 +231,7 @@ USHORT SwDoc::CallEvent( USHORT nEvent, const SwCallMouseEvent& rCallEvent,
if( STARBASIC == rMacro.GetScriptType() )
{
nRet += 0 == pDocShell->CallBasic( rMacro.GetMacName(),
- rMacro.GetLibName(), 0, pArgs ) ? 1 : 0;
+ rMacro.GetLibName(), pArgs ) ? 1 : 0;
}
else if( EXTENDED_STYPE == rMacro.GetScriptType() )
{
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index 442e6cf86faa..f0cc94b6ee19 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -58,7 +58,6 @@
#include <swserv.hxx>
#include <swundo.hxx>
#include <tools/pstm.hxx>
-#include <undobj.hxx>
#include <unocrsr.hxx>
#include <viscrs.hxx>
#include <stdio.h>
@@ -247,7 +246,7 @@ namespace
bind(&::rtl::OUString::equals, bind(&IMark::GetName, _1), rName));
}
-#if FALSE
+#if 0
static void lcl_DebugMarks(IDocumentMarkAccess::container_t vMarks)
{
OSL_TRACE("%d Marks", vMarks.size());
@@ -321,7 +320,7 @@ namespace sw { namespace mark
const ::rtl::OUString& rName,
const IDocumentMarkAccess::MarkType eType)
{
-#if FALSE
+#if 0
{
::rtl::OString sName = ::rtl::OUStringToOString(rName, RTL_TEXTENCODING_UTF8);
const SwPosition* const pPos1 = rPaM.GetPoint();
@@ -410,7 +409,7 @@ namespace sw { namespace mark
break;
}
pMarkBase->InitDoc(m_pDoc);
-#if FALSE
+#if 0
OSL_TRACE("--- makeType ---");
OSL_TRACE("Marks");
lcl_DebugMarks(m_vMarks);
@@ -520,7 +519,7 @@ namespace sw { namespace mark
// restore sorting if needed
if(isSortingNeeded)
sortMarks();
-#if FALSE
+#if 0
OSL_TRACE("correctMarksAbsolute");
lcl_DebugMarks(m_vMarks);
#endif
@@ -560,7 +559,7 @@ namespace sw { namespace mark
// restore sorting if needed
if(isSortingNeeded)
sortMarks();
-#if FALSE
+#if 0
OSL_TRACE("correctMarksRelative");
lcl_DebugMarks(m_vMarks);
#endif
@@ -678,7 +677,7 @@ namespace sw { namespace mark
}
if(isSortingNeeded)
sortMarks();
-#if FALSE
+#if 0
OSL_TRACE("deleteMarks");
lcl_DebugMarks(m_vMarks);
#endif
@@ -885,19 +884,19 @@ namespace
class _SwSaveTypeCountContent
{
union {
- struct { USHORT nType, nCount; } TC;
- ULONG nTypeCount;
+ struct { sal_uInt16 nType, nCount; } TC;
+ sal_uLong nTypeCount;
} TYPECOUNT;
xub_StrLen nContent;
public:
_SwSaveTypeCountContent() { TYPECOUNT.nTypeCount = 0; nContent = 0; }
- _SwSaveTypeCountContent( USHORT nType )
+ _SwSaveTypeCountContent( sal_uInt16 nType )
{
SetTypeAndCount( nType, 0 );
nContent = 0;
}
- _SwSaveTypeCountContent( const SvULongs& rArr, USHORT& rPos )
+ _SwSaveTypeCountContent( const SvULongs& rArr, sal_uInt16& rPos )
{
TYPECOUNT.nTypeCount = rArr[ rPos++ ];
nContent = static_cast<xub_StrLen>(rArr[ rPos++ ]);
@@ -908,17 +907,17 @@ namespace
rArr.Insert( nContent, rArr.Count() );
}
- void SetType( USHORT n ) { TYPECOUNT.TC.nType = n; }
- USHORT GetType() const { return TYPECOUNT.TC.nType; }
+ void SetType( sal_uInt16 n ) { TYPECOUNT.TC.nType = n; }
+ sal_uInt16 GetType() const { return TYPECOUNT.TC.nType; }
void IncType() { ++TYPECOUNT.TC.nType; }
void DecType() { --TYPECOUNT.TC.nType; }
- void SetCount( USHORT n ) { TYPECOUNT.TC.nCount = n; }
- USHORT GetCount() const { return TYPECOUNT.TC.nCount; }
- USHORT IncCount() { return ++TYPECOUNT.TC.nCount; }
- USHORT DecCount() { return --TYPECOUNT.TC.nCount; }
+ void SetCount( sal_uInt16 n ) { TYPECOUNT.TC.nCount = n; }
+ sal_uInt16 GetCount() const { return TYPECOUNT.TC.nCount; }
+ sal_uInt16 IncCount() { return ++TYPECOUNT.TC.nCount; }
+ sal_uInt16 DecCount() { return --TYPECOUNT.TC.nCount; }
- void SetTypeAndCount( USHORT nT, USHORT nC )
+ void SetTypeAndCount( sal_uInt16 nT, sal_uInt16 nC )
{ TYPECOUNT.TC.nCount = nC; TYPECOUNT.TC.nType = nT; }
void SetContent( xub_StrLen n ) { nContent = n; }
@@ -934,9 +933,9 @@ namespace
static const int BEHIND_SAME_NODE = 3; // Same node index but content index behind given content index
static const int BEHIND_NODE = 4; // Position behind the given node index
- static int lcl_RelativePosition( const SwPosition& rPos, ULONG nNode, xub_StrLen nCntnt )
+ static int lcl_RelativePosition( const SwPosition& rPos, sal_uLong nNode, xub_StrLen nCntnt )
{
- ULONG nIndex = rPos.nNode.GetIndex();
+ sal_uLong nIndex = rPos.nNode.GetIndex();
int nReturn = BEFORE_NODE;
if( nIndex == nNode )
{
@@ -959,17 +958,17 @@ namespace
return rPos.nNode > rNdIdx || ( pIdx && rPos.nNode == rNdIdx && rPos.nContent > pIdx->GetIndex() );
}
- static void lcl_ChkPaM( SvULongs& rSaveArr, ULONG nNode, xub_StrLen nCntnt,
+ static void lcl_ChkPaM( SvULongs& rSaveArr, sal_uLong nNode, xub_StrLen nCntnt,
const SwPaM& rPam, _SwSaveTypeCountContent& rSave,
- BOOL bChkSelDirection )
+ sal_Bool bChkSelDirection )
{
// SelektionsRichtung beachten
- bool bBound1IsStart = !bChkSelDirection ? TRUE :
+ bool bBound1IsStart = !bChkSelDirection ? sal_True :
( *rPam.GetPoint() < *rPam.GetMark()
? rPam.GetPoint() == &rPam.GetBound()
: rPam.GetMark() == &rPam.GetBound());
- const SwPosition* pPos = &rPam.GetBound( TRUE );
+ const SwPosition* pPos = &rPam.GetBound( sal_True );
if( pPos->nNode.GetIndex() == nNode &&
( bBound1IsStart ? pPos->nContent.GetIndex() < nCntnt
: pPos->nContent.GetIndex() <= nCntnt ))
@@ -978,7 +977,7 @@ namespace
rSave.Add( rSaveArr );
}
- pPos = &rPam.GetBound( FALSE );
+ pPos = &rPam.GetBound( sal_False );
if( pPos->nNode.GetIndex() == nNode &&
( (bBound1IsStart && bChkSelDirection)
? pPos->nContent.GetIndex() <= nCntnt
@@ -1075,12 +1074,12 @@ void SaveBookmark::SetInDoc(
if(pIdx && !m_nNode2)
aPam.GetMark()->nContent += m_nCntnt2;
else
- aPam.GetMark()->nContent.Assign(aPam.GetCntntNode(FALSE), m_nCntnt2);
+ aPam.GetMark()->nContent.Assign(aPam.GetCntntNode(sal_False), m_nCntnt2);
}
else
{
aPam.GetMark()->nNode = m_nNode2;
- aPam.GetMark()->nContent.Assign(aPam.GetCntntNode(FALSE), m_nCntnt2);
+ aPam.GetMark()->nContent.Assign(aPam.GetCntntNode(sal_False), m_nCntnt2);
}
}
@@ -1100,7 +1099,7 @@ void SaveBookmark::SetInDoc(
}
if(!aPam.HasMark()
- || CheckNodesRange(aPam.GetPoint()->nNode, aPam.GetMark()->nNode, TRUE))
+ || CheckNodesRange(aPam.GetPoint()->nNode, aPam.GetMark()->nNode, sal_True))
{
::sw::mark::IBookmark* const pBookmark = dynamic_cast< ::sw::mark::IBookmark* >(pDoc->getIDocumentMarkAccess()->makeMark(aPam, m_aName, m_eOrigBkmType));
if(pBookmark)
@@ -1142,13 +1141,13 @@ void _DelBookmarks(
// Array, das alle Angaben auf die Position als Offset speichert.
// Die neue Zuordung erfolgt nach dem Moven.
SwRedlineTbl& rTbl = (SwRedlineTbl&)pDoc->GetRedlineTbl();
- for(USHORT nCnt = 0; nCnt < rTbl.Count(); ++nCnt )
+ for(sal_uInt16 nCnt = 0; nCnt < rTbl.Count(); ++nCnt )
{
// liegt auf der Position ??
SwRedline* pRedl = rTbl[ nCnt ];
- SwPosition *pRStt = &pRedl->GetBound(TRUE),
- *pREnd = &pRedl->GetBound(FALSE);
+ SwPosition *pRStt = &pRedl->GetBound(sal_True),
+ *pREnd = &pRedl->GetBound(sal_False);
if( *pRStt > *pREnd )
{
SwPosition *pTmp = pRStt; pRStt = pREnd, pREnd = pTmp;
@@ -1161,11 +1160,11 @@ void _DelBookmarks(
pRStt->nContent = *pEndIdx;
else
{
- BOOL bStt = TRUE;
+ sal_Bool bStt = sal_True;
SwCntntNode* pCNd = pRStt->nNode.GetNode().GetCntntNode();
if( !pCNd && 0 == ( pCNd = pDoc->GetNodes().GoNext( &pRStt->nNode )) )
{
- bStt = FALSE;
+ bStt = sal_False;
pRStt->nNode = rStt;
if( 0 == ( pCNd = pDoc->GetNodes().GoPrevious( &pRStt->nNode )) )
{
@@ -1184,11 +1183,11 @@ void _DelBookmarks(
pREnd->nContent = *pSttIdx;
else
{
- BOOL bStt = FALSE;
+ sal_Bool bStt = sal_False;
SwCntntNode* pCNd = pREnd->nNode.GetNode().GetCntntNode();
if( !pCNd && 0 == ( pCNd = pDoc->GetNodes().GoPrevious( &pREnd->nNode )) )
{
- bStt = TRUE;
+ bStt = sal_True;
pREnd->nNode = rEnd;
if( 0 == ( pCNd = pDoc->GetNodes().GoNext( &pREnd->nNode )) )
{
@@ -1204,10 +1203,10 @@ void _DelBookmarks(
}
void _SaveCntntIdx(SwDoc* pDoc,
- ULONG nNode,
+ sal_uLong nNode,
xub_StrLen nCntnt,
SvULongs& rSaveArr,
- BYTE nSaveFly)
+ sal_uInt8 nSaveFly)
{
// 1. Bookmarks
_SwSaveTypeCountContent aSave;
@@ -1288,7 +1287,7 @@ void _SaveCntntIdx(SwDoc* pDoc,
SwFrm* pFrm = pNode->getLayoutFrm( pDoc->GetCurrentLayout() );
#if OSL_DEBUG_LEVEL > 1
- static BOOL bViaDoc = FALSE;
+ static sal_Bool bViaDoc = sal_False;
if( bViaDoc )
pFrm = NULL;
#endif
@@ -1382,14 +1381,14 @@ void _SaveCntntIdx(SwDoc* pDoc,
if( _pStkCrsr )
do {
lcl_ChkPaM( rSaveArr, nNode, nCntnt, *_pStkCrsr,
- aSave, FALSE );
+ aSave, sal_False );
aSave.IncCount();
} while ( (_pStkCrsr != 0 ) &&
((_pStkCrsr=(SwPaM *)_pStkCrsr->GetNext()) != PCURSH->GetStkCrsr()) );
FOREACHPAM_START( PCURSH->_GetCrsr() )
lcl_ChkPaM( rSaveArr, nNode, nCntnt, *PCURCRSR,
- aSave, FALSE );
+ aSave, sal_False );
aSave.IncCount();
FOREACHPAM_END()
@@ -1400,10 +1399,10 @@ void _SaveCntntIdx(SwDoc* pDoc,
{
aSave.SetTypeAndCount( 0x400, 0 );
const SwUnoCrsrTbl& rTbl = pDoc->GetUnoCrsrTbl();
- for( USHORT n = 0; n < rTbl.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rTbl.Count(); ++n )
{
FOREACHPAM_START( rTbl[ n ] )
- lcl_ChkPaM( rSaveArr, nNode, nCntnt, *PCURCRSR, aSave, FALSE );
+ lcl_ChkPaM( rSaveArr, nNode, nCntnt, *PCURCRSR, aSave, sal_False );
aSave.IncCount();
FOREACHPAM_END()
@@ -1412,7 +1411,7 @@ void _SaveCntntIdx(SwDoc* pDoc,
if( pUnoTblCrsr )
{
FOREACHPAM_START( &pUnoTblCrsr->GetSelRing() )
- lcl_ChkPaM( rSaveArr, nNode, nCntnt, *PCURCRSR, aSave, FALSE );
+ lcl_ChkPaM( rSaveArr, nNode, nCntnt, *PCURCRSR, aSave, sal_False );
aSave.IncCount();
FOREACHPAM_END()
}
@@ -1423,15 +1422,15 @@ void _SaveCntntIdx(SwDoc* pDoc,
void _RestoreCntntIdx(SwDoc* pDoc,
SvULongs& rSaveArr,
- ULONG nNode,
+ sal_uLong nNode,
xub_StrLen nOffset,
- BOOL bAuto)
+ sal_Bool bAuto)
{
SwCntntNode* pCNd = pDoc->GetNodes()[ nNode ]->GetCntntNode();
const SwRedlineTbl& rRedlTbl = pDoc->GetRedlineTbl();
SwSpzFrmFmts* pSpz = pDoc->GetSpzFrmFmts();
IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess();
- USHORT n = 0;
+ sal_uInt16 n = 0;
while( n < rSaveArr.Count() )
{
_SwSaveTypeCountContent aSave( rSaveArr, n );
@@ -1497,7 +1496,7 @@ void _RestoreCntntIdx(SwDoc* pDoc,
case 0x0800:
case 0x0801:
{
- USHORT nCnt = 0;
+ sal_uInt16 nCnt = 0;
SwCrsrShell* pShell = pDoc->GetEditShell();
if( pShell )
{
@@ -1538,9 +1537,9 @@ void _RestoreCntntIdx(SwDoc* pDoc,
case 0x0400:
case 0x0401:
{
- USHORT nCnt = 0;
+ sal_uInt16 nCnt = 0;
const SwUnoCrsrTbl& rTbl = pDoc->GetUnoCrsrTbl();
- for( USHORT i = 0; i < rTbl.Count(); ++i )
+ for( sal_uInt16 i = 0; i < rTbl.Count(); ++i )
{
FOREACHPAM_START( rTbl[ i ] )
if( aSave.GetCount() == nCnt )
@@ -1594,7 +1593,7 @@ void _RestoreCntntIdx(SvULongs& rSaveArr,
const IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess();
SwCntntNode* pCNd = (SwCntntNode*)rNd.GetCntntNode();
- USHORT n = 0;
+ sal_uInt16 n = 0;
while( n < rSaveArr.Count() )
{
_SwSaveTypeCountContent aSave( rSaveArr, n );
@@ -1657,7 +1656,7 @@ void _RestoreCntntIdx(SvULongs& rSaveArr,
case 0x0800:
case 0x0801:
{
- USHORT nCnt = 0;
+ sal_uInt16 nCnt = 0;
SwCrsrShell* pShell = pDoc->GetEditShell();
if( pShell )
{
@@ -1698,9 +1697,9 @@ void _RestoreCntntIdx(SvULongs& rSaveArr,
case 0x0400:
case 0x0401:
{
- USHORT nCnt = 0;
+ sal_uInt16 nCnt = 0;
const SwUnoCrsrTbl& rTbl = pDoc->GetUnoCrsrTbl();
- for( USHORT i = 0; i < rTbl.Count(); ++i )
+ for( sal_uInt16 i = 0; i < rTbl.Count(); ++i )
{
FOREACHPAM_START( rTbl[ i ] )
if( aSave.GetCount() == nCnt )
diff --git a/sw/source/core/doc/docchart.cxx b/sw/source/core/doc/docchart.cxx
index 4ef5891271a3..95cdd4caed1b 100644
--- a/sw/source/core/doc/docchart.cxx
+++ b/sw/source/core/doc/docchart.cxx
@@ -66,7 +66,7 @@ void SwTable::UpdateCharts() const
GetFrmFmt()->GetDoc()->UpdateCharts( GetFrmFmt()->GetName() );
}
-BOOL SwTable::IsTblComplexForChart( const String& rSelection,
+sal_Bool SwTable::IsTblComplexForChart( const String& rSelection,
SwChartLines* pGetCLines ) const
{
const SwTableBox* pSttBox, *pEndBox;
@@ -115,7 +115,7 @@ IMPL_LINK( SwDoc, DoUpdateAllCharts, Timer *, EMPTYARG )
if( pVSh )
{
const SwFrmFmts& rTblFmts = *GetTblFrmFmts();
- for( USHORT n = 0; n < rTblFmts.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rTblFmts.Count(); ++n )
{
SwTable* pTmpTbl;
const SwTableNode* pTblNd;
@@ -171,20 +171,20 @@ void SwDoc::UpdateCharts( const String &rName ) const
void SwDoc::SetTableName( SwFrmFmt& rTblFmt, const String &rNewName )
{
-// BOOL bStop = 1;
+// sal_Bool bStop = 1;
const String aOldName( rTblFmt.GetName() );
- BOOL bNameFound = 0 == rNewName.Len();
+ sal_Bool bNameFound = 0 == rNewName.Len();
if( !bNameFound )
{
SwFrmFmt* pFmt;
const SwFrmFmts& rTbl = *GetTblFrmFmts();
- for( USHORT i = rTbl.Count(); i; )
+ for( sal_uInt16 i = rTbl.Count(); i; )
if( !( pFmt = rTbl[ --i ] )->IsDefault() &&
pFmt->GetName() == rNewName && IsUsed( *pFmt ) )
{
- bNameFound = TRUE;
+ bNameFound = sal_True;
break;
}
}
diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx
index 170193778421..e0c550dff020 100644
--- a/sw/source/core/doc/doccomp.cxx
+++ b/sw/source/core/doc/doccomp.cxx
@@ -37,11 +37,12 @@
#include <editeng/boxitem.hxx>
#include <editeng/udlnitem.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <docary.hxx>
#include <pam.hxx>
#include <ndtxt.hxx>
#include <redline.hxx>
-#include <undobj.hxx>
+#include <UndoRedline.hxx>
#include <section.hxx>
#include <tox.hxx>
#include <docsh.hxx>
@@ -58,20 +59,20 @@ public:
CompareLine() {}
virtual ~CompareLine();
- virtual ULONG GetHashValue() const = 0;
- virtual BOOL Compare( const CompareLine& rLine ) const = 0;
+ virtual sal_uLong GetHashValue() const = 0;
+ virtual sal_Bool Compare( const CompareLine& rLine ) const = 0;
};
DECLARE_LIST( CompareList, CompareLine* )
class CompareData
{
- ULONG* pIndex;
- BOOL* pChangedFlag;
+ sal_uLong* pIndex;
+ sal_Bool* pChangedFlag;
protected:
CompareList aLines;
- ULONG nSttLineNum;
+ sal_uLong nSttLineNum;
// Anfang und Ende beschneiden und alle anderen in das
// LinesArray setzen
@@ -82,7 +83,7 @@ public:
virtual ~CompareData();
// gibt es unterschiede?
- BOOL HasDiffs( const CompareData& rData ) const;
+ sal_Bool HasDiffs( const CompareData& rData ) const;
// startet das Vergleichen und Erzeugen der Unterschiede zweier
// Dokumente
@@ -91,33 +92,33 @@ public:
// ShowInsert / ShowDelete. Diese bekommen die Start und EndLine-Nummer
// uebergeben. Die Abbildung auf den tatsaechline Inhalt muss die
// Ableitung uebernehmen!
- ULONG ShowDiffs( const CompareData& rData );
+ sal_uLong ShowDiffs( const CompareData& rData );
- virtual void ShowInsert( ULONG nStt, ULONG nEnd );
- virtual void ShowDelete( const CompareData& rData, ULONG nStt,
- ULONG nEnd, ULONG nInsPos );
+ virtual void ShowInsert( sal_uLong nStt, sal_uLong nEnd );
+ virtual void ShowDelete( const CompareData& rData, sal_uLong nStt,
+ sal_uLong nEnd, sal_uLong nInsPos );
virtual void CheckForChangesInLine( const CompareData& rData,
- ULONG& nStt, ULONG& nEnd,
- ULONG& nThisStt, ULONG& nThisEnd );
+ sal_uLong& nStt, sal_uLong& nEnd,
+ sal_uLong& nThisStt, sal_uLong& nThisEnd );
// Eindeutigen Index fuer eine Line setzen. Gleiche Lines haben den
// selben Index; auch in den anderen CompareData!
- void SetIndex( ULONG nLine, ULONG nIndex );
- ULONG GetIndex( ULONG nLine ) const
+ void SetIndex( sal_uLong nLine, sal_uLong nIndex );
+ sal_uLong GetIndex( sal_uLong nLine ) const
{ return nLine < aLines.Count() ? pIndex[ nLine ] : 0; }
// setze/erfrage ob eine Zeile veraendert ist
- void SetChanged( ULONG nLine, BOOL bFlag = TRUE );
- BOOL GetChanged( ULONG nLine ) const
+ void SetChanged( sal_uLong nLine, sal_Bool bFlag = sal_True );
+ sal_Bool GetChanged( sal_uLong nLine ) const
{
return (pChangedFlag && nLine < aLines.Count())
? pChangedFlag[ nLine ]
: 0;
}
- ULONG GetLineCount() const { return aLines.Count(); }
- ULONG GetLineOffset() const { return nSttLineNum; }
- const CompareLine* GetLine( ULONG nLine ) const
+ sal_uLong GetLineCount() const { return aLines.Count(); }
+ sal_uLong GetLineOffset() const { return nSttLineNum; }
+ const CompareLine* GetLine( sal_uLong nLine ) const
{ return aLines.GetObject( nLine ); }
void InsertLine( CompareLine* pLine )
{ aLines.Insert( pLine, LIST_APPEND ); }
@@ -127,24 +128,24 @@ class Hash
{
struct _HashData
{
- ULONG nNext, nHash;
+ sal_uLong nNext, nHash;
const CompareLine* pLine;
_HashData()
: nNext( 0 ), nHash( 0 ), pLine(0) {}
};
- ULONG* pHashArr;
+ sal_uLong* pHashArr;
_HashData* pDataArr;
- ULONG nCount, nPrime;
+ sal_uLong nCount, nPrime;
public:
- Hash( ULONG nSize );
+ Hash( sal_uLong nSize );
~Hash();
void CalcHashValue( CompareData& rData );
- ULONG GetCount() const { return nCount; }
+ sal_uLong GetCount() const { return nCount; }
};
class Compare
@@ -152,17 +153,17 @@ class Compare
public:
class MovedData
{
- ULONG* pIndex;
- ULONG* pLineNum;
- ULONG nCount;
+ sal_uLong* pIndex;
+ sal_uLong* pLineNum;
+ sal_uLong nCount;
public:
MovedData( CompareData& rData, sal_Char* pDiscard );
~MovedData();
- ULONG GetIndex( ULONG n ) const { return pIndex[ n ]; }
- ULONG GetLineNum( ULONG n ) const { return pLineNum[ n ]; }
- ULONG GetCount() const { return nCount; }
+ sal_uLong GetIndex( sal_uLong n ) const { return pIndex[ n ]; }
+ sal_uLong GetLineNum( sal_uLong n ) const { return pLineNum[ n ]; }
+ sal_uLong GetCount() const { return nCount; }
};
private:
@@ -173,9 +174,9 @@ private:
const MovedData &rMoved1, &rMoved2;
long *pMemory, *pFDiag, *pBDiag;
- void Compare( ULONG nStt1, ULONG nEnd1, ULONG nStt2, ULONG nEnd2 );
- ULONG CheckDiag( ULONG nStt1, ULONG nEnd1,
- ULONG nStt2, ULONG nEnd2, ULONG* pCost );
+ void Compare( sal_uLong nStt1, sal_uLong nEnd1, sal_uLong nStt2, sal_uLong nEnd2 );
+ sal_uLong CheckDiag( sal_uLong nStt1, sal_uLong nEnd1,
+ sal_uLong nStt2, sal_uLong nEnd2, sal_uLong* pCost );
public:
CompareSequence( CompareData& rData1, CompareData& rData2,
const MovedData& rD1, const MovedData& rD2 );
@@ -183,15 +184,15 @@ private:
};
- static void CountDifference( const CompareData& rData, ULONG* pCounts );
+ static void CountDifference( const CompareData& rData, sal_uLong* pCounts );
static void SetDiscard( const CompareData& rData,
- sal_Char* pDiscard, ULONG* pCounts );
- static void CheckDiscard( ULONG nLen, sal_Char* pDiscard );
- static ULONG SetChangedFlag( CompareData& rData, sal_Char* pDiscard, int bFirst );
+ sal_Char* pDiscard, sal_uLong* pCounts );
+ static void CheckDiscard( sal_uLong nLen, sal_Char* pDiscard );
+ static sal_uLong SetChangedFlag( CompareData& rData, sal_Char* pDiscard, int bFirst );
static void ShiftBoundaries( CompareData& rData1, CompareData& rData2 );
public:
- Compare( ULONG nDiff, CompareData& rData1, CompareData& rData2 );
+ Compare( sal_uLong nDiff, CompareData& rData1, CompareData& rData2 );
};
// ====================================================================
@@ -211,23 +212,23 @@ CompareData::~CompareData()
delete[] pChangedFlag;
}
-void CompareData::SetIndex( ULONG nLine, ULONG nIndex )
+void CompareData::SetIndex( sal_uLong nLine, sal_uLong nIndex )
{
if( !pIndex )
{
- pIndex = new ULONG[ aLines.Count() ];
- memset( pIndex, 0, aLines.Count() * sizeof( ULONG ) );
+ pIndex = new sal_uLong[ aLines.Count() ];
+ memset( pIndex, 0, aLines.Count() * sizeof( sal_uLong ) );
}
if( nLine < aLines.Count() )
pIndex[ nLine ] = nIndex;
}
-void CompareData::SetChanged( ULONG nLine, BOOL bFlag )
+void CompareData::SetChanged( sal_uLong nLine, sal_Bool bFlag )
{
if( !pChangedFlag )
{
- pChangedFlag = new BOOL[ aLines.Count() +1 ];
- memset( pChangedFlag, 0, aLines.Count() +1 * sizeof( BOOL ) );
+ pChangedFlag = new sal_Bool[ aLines.Count() +1 ];
+ memset( pChangedFlag, 0, aLines.Count() +1 * sizeof( sal_Bool ) );
}
if( nLine < aLines.Count() )
pChangedFlag[ nLine ] = bFlag;
@@ -237,7 +238,7 @@ void CompareData::CompareLines( CompareData& rData )
{
CheckRanges( rData );
- ULONG nDifferent;
+ sal_uLong nDifferent;
{
Hash aH( GetLineCount() + rData.GetLineCount() + 1 );
aH.CalcHashValue( *this );
@@ -249,17 +250,17 @@ void CompareData::CompareLines( CompareData& rData )
}
}
-ULONG CompareData::ShowDiffs( const CompareData& rData )
+sal_uLong CompareData::ShowDiffs( const CompareData& rData )
{
- ULONG nLen1 = rData.GetLineCount(), nLen2 = GetLineCount();
- ULONG nStt1 = 0, nStt2 = 0;
- ULONG nCnt = 0;
+ sal_uLong nLen1 = rData.GetLineCount(), nLen2 = GetLineCount();
+ sal_uLong nStt1 = 0, nStt2 = 0;
+ sal_uLong nCnt = 0;
while( nStt1 < nLen1 || nStt2 < nLen2 )
{
if( rData.GetChanged( nStt1 ) || GetChanged( nStt2 ) )
{
- ULONG nSav1 = nStt1, nSav2 = nStt2;
+ sal_uLong nSav1 = nStt1, nSav2 = nStt2;
while( nStt1 < nLen1 && rData.GetChanged( nStt1 )) ++nStt1;
while( nStt2 < nLen2 && GetChanged( nStt2 )) ++nStt2;
@@ -280,17 +281,17 @@ ULONG CompareData::ShowDiffs( const CompareData& rData )
return nCnt;
}
-BOOL CompareData::HasDiffs( const CompareData& rData ) const
+sal_Bool CompareData::HasDiffs( const CompareData& rData ) const
{
- BOOL bRet = FALSE;
- ULONG nLen1 = rData.GetLineCount(), nLen2 = GetLineCount();
- ULONG nStt1 = 0, nStt2 = 0;
+ sal_Bool bRet = sal_False;
+ sal_uLong nLen1 = rData.GetLineCount(), nLen2 = GetLineCount();
+ sal_uLong nStt1 = 0, nStt2 = 0;
while( nStt1 < nLen1 || nStt2 < nLen2 )
{
if( rData.GetChanged( nStt1 ) || GetChanged( nStt2 ) )
{
- bRet = TRUE;
+ bRet = sal_True;
break;
}
++nStt1, ++nStt2;
@@ -298,26 +299,26 @@ BOOL CompareData::HasDiffs( const CompareData& rData ) const
return bRet;
}
-void CompareData::ShowInsert( ULONG, ULONG )
+void CompareData::ShowInsert( sal_uLong, sal_uLong )
{
}
-void CompareData::ShowDelete( const CompareData&, ULONG, ULONG, ULONG )
+void CompareData::ShowDelete( const CompareData&, sal_uLong, sal_uLong, sal_uLong )
{
}
void CompareData::CheckForChangesInLine( const CompareData& ,
- ULONG&, ULONG&, ULONG&, ULONG& )
+ sal_uLong&, sal_uLong&, sal_uLong&, sal_uLong& )
{
}
// ----------------------------------------------------------------------
-Hash::Hash( ULONG nSize )
+Hash::Hash( sal_uLong nSize )
: nCount( 1 )
{
-static const ULONG primes[] =
+static const sal_uLong primes[] =
{
509,
1021,
@@ -358,8 +359,8 @@ static const ULONG primes[] =
return;
}
nPrime = primes[ i ];
- pHashArr = new ULONG[ nPrime ];
- memset( pHashArr, 0, nPrime * sizeof( ULONG ) );
+ pHashArr = new sal_uLong[ nPrime ];
+ memset( pHashArr, 0, nPrime * sizeof( sal_uLong ) );
}
Hash::~Hash()
@@ -372,14 +373,14 @@ void Hash::CalcHashValue( CompareData& rData )
{
if( pHashArr )
{
- for( ULONG n = 0; n < rData.GetLineCount(); ++n )
+ for( sal_uLong n = 0; n < rData.GetLineCount(); ++n )
{
const CompareLine* pLine = rData.GetLine( n );
ASSERT( pLine, "wo ist die Line?" );
- ULONG nH = pLine->GetHashValue();
+ sal_uLong nH = pLine->GetHashValue();
- ULONG* pFound = &pHashArr[ nH % nPrime ];
- ULONG i;
+ sal_uLong* pFound = &pHashArr[ nH % nPrime ];
+ sal_uLong i;
for( i = *pFound; ; i = pDataArr[i].nNext )
if( !i )
{
@@ -401,7 +402,7 @@ void Hash::CalcHashValue( CompareData& rData )
// ----------------------------------------------------------------------
-Compare::Compare( ULONG nDiff, CompareData& rData1, CompareData& rData2 )
+Compare::Compare( sal_uLong nDiff, CompareData& rData1, CompareData& rData2 )
{
MovedData *pMD1, *pMD2;
// Suche die unterschiedlichen Lines
@@ -409,10 +410,10 @@ Compare::Compare( ULONG nDiff, CompareData& rData1, CompareData& rData2 )
sal_Char* pDiscard1 = new sal_Char[ rData1.GetLineCount() ];
sal_Char* pDiscard2 = new sal_Char[ rData2.GetLineCount() ];
- ULONG* pCount1 = new ULONG[ nDiff ];
- ULONG* pCount2 = new ULONG[ nDiff ];
- memset( pCount1, 0, nDiff * sizeof( ULONG ));
- memset( pCount2, 0, nDiff * sizeof( ULONG ));
+ sal_uLong* pCount1 = new sal_uLong[ nDiff ];
+ sal_uLong* pCount2 = new sal_uLong[ nDiff ];
+ memset( pCount1, 0, nDiff * sizeof( sal_uLong ));
+ memset( pCount2, 0, nDiff * sizeof( sal_uLong ));
// stelle fest, welche Indizies in den CompareData mehrfach vergeben wurden
CountDifference( rData1, pCount1 );
@@ -449,31 +450,31 @@ Compare::Compare( ULONG nDiff, CompareData& rData1, CompareData& rData2 )
-void Compare::CountDifference( const CompareData& rData, ULONG* pCounts )
+void Compare::CountDifference( const CompareData& rData, sal_uLong* pCounts )
{
- ULONG nLen = rData.GetLineCount();
- for( ULONG n = 0; n < nLen; ++n )
+ sal_uLong nLen = rData.GetLineCount();
+ for( sal_uLong n = 0; n < nLen; ++n )
{
- ULONG nIdx = rData.GetIndex( n );
+ sal_uLong nIdx = rData.GetIndex( n );
++pCounts[ nIdx ];
}
}
void Compare::SetDiscard( const CompareData& rData,
- sal_Char* pDiscard, ULONG* pCounts )
+ sal_Char* pDiscard, sal_uLong* pCounts )
{
- ULONG nLen = rData.GetLineCount();
+ sal_uLong nLen = rData.GetLineCount();
// berechne Max in Abhanegigkeit zur LineAnzahl
- USHORT nMax = 5;
- ULONG n;
+ sal_uInt16 nMax = 5;
+ sal_uLong n;
for( n = nLen / 64; ( n = n >> 2 ) > 0; )
nMax <<= 1;
for( n = 0; n < nLen; ++n )
{
- ULONG nIdx = rData.GetIndex( n );
+ sal_uLong nIdx = rData.GetIndex( n );
if( nIdx )
{
nIdx = pCounts[ nIdx ];
@@ -484,17 +485,17 @@ void Compare::SetDiscard( const CompareData& rData,
}
}
-void Compare::CheckDiscard( ULONG nLen, sal_Char* pDiscard )
+void Compare::CheckDiscard( sal_uLong nLen, sal_Char* pDiscard )
{
- for( ULONG n = 0; n < nLen; ++n )
+ for( sal_uLong n = 0; n < nLen; ++n )
{
if( 2 == pDiscard[ n ] )
pDiscard[n] = 0;
else if( pDiscard[ n ] )
{
- ULONG j;
- ULONG length;
- ULONG provisional = 0;
+ sal_uLong j;
+ sal_uLong length;
+ sal_uLong provisional = 0;
/* Find end of this run of discardable lines.
Count how many are provisionally discardable. */
@@ -524,9 +525,9 @@ void Compare::CheckDiscard( ULONG nLen, sal_Char* pDiscard )
}
else
{
- ULONG consec;
- ULONG minimum = 1;
- ULONG tem = length / 4;
+ sal_uLong consec;
+ sal_uLong minimum = 1;
+ sal_uLong tem = length / 4;
/* MINIMUM is approximate square root of LENGTH/4.
A subrun of two or more provisionals can stand
@@ -592,8 +593,8 @@ void Compare::CheckDiscard( ULONG nLen, sal_Char* pDiscard )
Compare::MovedData::MovedData( CompareData& rData, sal_Char* pDiscard )
: pIndex( 0 ), pLineNum( 0 ), nCount( 0 )
{
- ULONG nLen = rData.GetLineCount();
- ULONG n;
+ sal_uLong nLen = rData.GetLineCount();
+ sal_uLong n;
for( n = 0; n < nLen; ++n )
if( pDiscard[ n ] )
@@ -603,8 +604,8 @@ Compare::MovedData::MovedData( CompareData& rData, sal_Char* pDiscard )
if( nCount )
{
- pIndex = new ULONG[ nCount ];
- pLineNum = new ULONG[ nCount ];
+ pIndex = new sal_uLong[ nCount ];
+ pLineNum = new sal_uLong[ nCount ];
for( n = 0, nCount = 0; n < nLen; ++n )
if( !pDiscard[ n ] )
@@ -629,7 +630,7 @@ Compare::CompareSequence::CompareSequence(
const MovedData& rMD1, const MovedData& rMD2 )
: rData1( rD1 ), rData2( rD2 ), rMoved1( rMD1 ), rMoved2( rMD2 )
{
- ULONG nSize = rMD1.GetCount() + rMD2.GetCount() + 3;
+ sal_uLong nSize = rMD1.GetCount() + rMD2.GetCount() + 3;
pMemory = new long[ nSize * 2 ];
pFDiag = pMemory + ( rMD2.GetCount() + 1 );
pBDiag = pMemory + ( nSize + rMD2.GetCount() + 1 );
@@ -642,8 +643,8 @@ Compare::CompareSequence::~CompareSequence()
delete pMemory;
}
-void Compare::CompareSequence::Compare( ULONG nStt1, ULONG nEnd1,
- ULONG nStt2, ULONG nEnd2 )
+void Compare::CompareSequence::Compare( sal_uLong nStt1, sal_uLong nEnd1,
+ sal_uLong nStt2, sal_uLong nEnd2 )
{
/* Slide down the bottom initial diagonal. */
while( nStt1 < nEnd1 && nStt2 < nEnd2 &&
@@ -666,7 +667,7 @@ void Compare::CompareSequence::Compare( ULONG nStt1, ULONG nEnd1,
else
{
- ULONG c, d, b;
+ sal_uLong c, d, b;
/* Find a point of correspondence in the middle of the files. */
@@ -686,8 +687,8 @@ void Compare::CompareSequence::Compare( ULONG nStt1, ULONG nEnd1,
}
}
-ULONG Compare::CompareSequence::CheckDiag( ULONG nStt1, ULONG nEnd1,
- ULONG nStt2, ULONG nEnd2, ULONG* pCost )
+sal_uLong Compare::CompareSequence::CheckDiag( sal_uLong nStt1, sal_uLong nEnd1,
+ sal_uLong nStt2, sal_uLong nEnd2, sal_uLong* pCost )
{
const long dmin = nStt1 - nEnd2; /* Minimum valid diagonal. */
const long dmax = nEnd1 - nStt2; /* Maximum valid diagonal. */
@@ -722,7 +723,7 @@ ULONG Compare::CompareSequence::CheckDiag( ULONG nStt1, ULONG nEnd1,
x = thi;
oldx = x;
y = x - d;
- while( ULONG(x) < nEnd1 && ULONG(y) < nEnd2 &&
+ while( sal_uLong(x) < nEnd1 && sal_uLong(y) < nEnd2 &&
rMoved1.GetIndex( x ) == rMoved2.GetIndex( y ))
++x, ++y;
if (x - oldx > 20)
@@ -748,7 +749,7 @@ ULONG Compare::CompareSequence::CheckDiag( ULONG nStt1, ULONG nEnd1,
x = thi - 1;
oldx = x;
y = x - d;
- while( ULONG(x) > nStt1 && ULONG(y) > nStt2 &&
+ while( sal_uLong(x) > nStt1 && sal_uLong(y) > nStt2 &&
rMoved1.GetIndex( x - 1 ) == rMoved2.GetIndex( y - 1 ))
--x, --y;
if (oldx - x > 20)
@@ -770,15 +771,15 @@ void Compare::ShiftBoundaries( CompareData& rData1, CompareData& rData2 )
CompareData* pData = &rData1;
CompareData* pOtherData = &rData2;
- ULONG i = 0;
- ULONG j = 0;
- ULONG i_end = pData->GetLineCount();
- ULONG preceding = ULONG_MAX;
- ULONG other_preceding = ULONG_MAX;
+ sal_uLong i = 0;
+ sal_uLong j = 0;
+ sal_uLong i_end = pData->GetLineCount();
+ sal_uLong preceding = ULONG_MAX;
+ sal_uLong other_preceding = ULONG_MAX;
while (1)
{
- ULONG start, other_start;
+ sal_uLong start, other_start;
/* Scan forwards to find beginning of another run of changes.
Also keep track of the corresponding point in the other file. */
@@ -848,15 +849,15 @@ public:
SwCompareLine( const SwNode& rNd );
virtual ~SwCompareLine();
- virtual ULONG GetHashValue() const;
- virtual BOOL Compare( const CompareLine& rLine ) const;
+ virtual sal_uLong GetHashValue() const;
+ virtual sal_Bool Compare( const CompareLine& rLine ) const;
- static ULONG GetTxtNodeHashValue( const SwTxtNode& rNd, ULONG nVal );
- static BOOL CompareNode( const SwNode& rDstNd, const SwNode& rSrcNd );
- static BOOL CompareTxtNd( const SwTxtNode& rDstNd,
+ static sal_uLong GetTxtNodeHashValue( const SwTxtNode& rNd, sal_uLong nVal );
+ static sal_Bool CompareNode( const SwNode& rDstNd, const SwNode& rSrcNd );
+ static sal_Bool CompareTxtNd( const SwTxtNode& rDstNd,
const SwTxtNode& rSrcNd );
- BOOL ChangesInLine( const SwCompareLine& rLine,
+ sal_Bool ChangesInLine( const SwCompareLine& rLine,
SwPaM *& rpInsRing, SwPaM*& rpDelRing ) const;
const SwNode& GetNode() const { return rNode; }
@@ -872,23 +873,23 @@ class SwCompareData : public CompareData
SwDoc& rDoc;
SwPaM *pInsRing, *pDelRing;
- ULONG PrevIdx( const SwNode* pNd );
- ULONG NextIdx( const SwNode* pNd );
+ sal_uLong PrevIdx( const SwNode* pNd );
+ sal_uLong NextIdx( const SwNode* pNd );
virtual void CheckRanges( CompareData& );
- virtual void ShowInsert( ULONG nStt, ULONG nEnd );
- virtual void ShowDelete( const CompareData& rData, ULONG nStt,
- ULONG nEnd, ULONG nInsPos );
+ virtual void ShowInsert( sal_uLong nStt, sal_uLong nEnd );
+ virtual void ShowDelete( const CompareData& rData, sal_uLong nStt,
+ sal_uLong nEnd, sal_uLong nInsPos );
virtual void CheckForChangesInLine( const CompareData& rData,
- ULONG& nStt, ULONG& nEnd,
- ULONG& nThisStt, ULONG& nThisEnd );
+ sal_uLong& nStt, sal_uLong& nEnd,
+ sal_uLong& nThisStt, sal_uLong& nThisEnd );
public:
SwCompareData( SwDoc& rD ) : rDoc( rD ), pInsRing(0), pDelRing(0) {}
virtual ~SwCompareData();
- void SetRedlinesToDoc( BOOL bUseDocInfo );
+ void SetRedlinesToDoc( sal_Bool bUseDocInfo );
};
// ----------------------------------------------------------------
@@ -902,9 +903,9 @@ SwCompareLine::~SwCompareLine()
{
}
-ULONG SwCompareLine::GetHashValue() const
+sal_uLong SwCompareLine::GetHashValue() const
{
- ULONG nRet = 0;
+ sal_uLong nRet = 0;
switch( rNode.GetNodeType() )
{
case ND_TEXTNODE:
@@ -961,7 +962,7 @@ const SwNode& SwCompareLine::GetEndNode() const
return *pNd;
}
-BOOL SwCompareLine::Compare( const CompareLine& rLine ) const
+sal_Bool SwCompareLine::Compare( const CompareLine& rLine ) const
{
return CompareNode( rNode, ((SwCompareLine&)rLine).rNode );
}
@@ -989,12 +990,12 @@ namespace
}
}
-BOOL SwCompareLine::CompareNode( const SwNode& rDstNd, const SwNode& rSrcNd )
+sal_Bool SwCompareLine::CompareNode( const SwNode& rDstNd, const SwNode& rSrcNd )
{
if( rSrcNd.GetNodeType() != rDstNd.GetNodeType() )
- return FALSE;
+ return sal_False;
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
switch( rDstNd.GetNodeType() )
{
@@ -1144,7 +1145,7 @@ String SwCompareLine::GetText() const
return sRet;
}
-ULONG SwCompareLine::GetTxtNodeHashValue( const SwTxtNode& rNd, ULONG nVal )
+sal_uLong SwCompareLine::GetTxtNodeHashValue( const SwTxtNode& rNd, sal_uLong nVal )
{
String sStr( rNd.GetExpandTxt() );
for( xub_StrLen n = 0; n < sStr.Len(); ++n )
@@ -1152,24 +1153,24 @@ ULONG SwCompareLine::GetTxtNodeHashValue( const SwTxtNode& rNd, ULONG nVal )
return nVal;
}
-BOOL SwCompareLine::CompareTxtNd( const SwTxtNode& rDstNd,
+sal_Bool SwCompareLine::CompareTxtNd( const SwTxtNode& rDstNd,
const SwTxtNode& rSrcNd )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
// erstmal ganz einfach!
if( rDstNd.GetTxt() == rSrcNd.GetTxt() )
{
// der Text ist gleich, aber sind die "Sonderattribute" (0xFF) auch
// dieselben??
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
}
-BOOL SwCompareLine::ChangesInLine( const SwCompareLine& rLine,
+sal_Bool SwCompareLine::ChangesInLine( const SwCompareLine& rLine,
SwPaM *& rpInsRing, SwPaM*& rpDelRing ) const
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( ND_TEXTNODE == rNode.GetNodeType() &&
ND_TEXTNODE == rLine.GetNode().GetNodeType() )
{
@@ -1216,14 +1217,12 @@ BOOL SwCompareLine::ChangesInLine( const SwCompareLine& rLine,
if( nStt != nSEnd )
{
{
- BOOL bUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ ::sw::UndoGuard const ug(pDoc->GetIDocumentUndoRedo());
SwPaM aCpyPam( rSrcNd, nStt );
aCpyPam.SetMark();
aCpyPam.GetPoint()->nContent = nSEnd;
aCpyPam.GetDoc()->CopyRange( aCpyPam, *aPam.GetPoint(),
false );
- pDoc->DoUndo( bUndo );
}
SwPaM* pTmp = new SwPaM( *aPam.GetPoint(), rpDelRing );
@@ -1240,7 +1239,7 @@ BOOL SwCompareLine::ChangesInLine( const SwCompareLine& rLine,
*pCorr->GetPoint() = *pTmp->GetMark();
}
}
- bRet = TRUE;
+ bRet = sal_True;
}
}
return bRet;
@@ -1264,7 +1263,7 @@ SwCompareData::~SwCompareData()
}
}
-ULONG SwCompareData::NextIdx( const SwNode* pNd )
+sal_uLong SwCompareData::NextIdx( const SwNode* pNd )
{
if( pNd->IsStartNode() )
{
@@ -1278,7 +1277,7 @@ ULONG SwCompareData::NextIdx( const SwNode* pNd )
return pNd->GetIndex() + 1;
}
-ULONG SwCompareData::PrevIdx( const SwNode* pNd )
+sal_uLong SwCompareData::PrevIdx( const SwNode* pNd )
{
if( pNd->IsEndNode() )
{
@@ -1301,11 +1300,11 @@ void SwCompareData::CheckRanges( CompareData& rData )
const SwNode& rSrcEndNd = rSrcNds.GetEndOfContent();
const SwNode& rDstEndNd = rDstNds.GetEndOfContent();
- ULONG nSrcSttIdx = NextIdx( rSrcEndNd.StartOfSectionNode() );
- ULONG nSrcEndIdx = rSrcEndNd.GetIndex();
+ sal_uLong nSrcSttIdx = NextIdx( rSrcEndNd.StartOfSectionNode() );
+ sal_uLong nSrcEndIdx = rSrcEndNd.GetIndex();
- ULONG nDstSttIdx = NextIdx( rDstEndNd.StartOfSectionNode() );
- ULONG nDstEndIdx = rDstEndNd.GetIndex();
+ sal_uLong nDstSttIdx = NextIdx( rDstEndNd.StartOfSectionNode() );
+ sal_uLong nDstEndIdx = rDstEndNd.GetIndex();
while( nSrcSttIdx < nSrcEndIdx && nDstSttIdx < nDstEndIdx )
{
@@ -1347,7 +1346,7 @@ void SwCompareData::CheckRanges( CompareData& rData )
}
-void SwCompareData::ShowInsert( ULONG nStt, ULONG nEnd )
+void SwCompareData::ShowInsert( sal_uLong nStt, sal_uLong nEnd )
{
SwPaM* pTmp = new SwPaM( ((SwCompareLine*)GetLine( nStt ))->GetNode(), 0,
((SwCompareLine*)GetLine( nEnd-1 ))->GetEndNode(), 0,
@@ -1359,14 +1358,14 @@ void SwCompareData::ShowInsert( ULONG nStt, ULONG nEnd )
}
-void SwCompareData::ShowDelete( const CompareData& rData, ULONG nStt,
- ULONG nEnd, ULONG nInsPos )
+void SwCompareData::ShowDelete( const CompareData& rData, sal_uLong nStt,
+ sal_uLong nEnd, sal_uLong nInsPos )
{
SwNodeRange aRg(
((SwCompareLine*)rData.GetLine( nStt ))->GetNode(), 0,
((SwCompareLine*)rData.GetLine( nEnd-1 ))->GetEndNode(), 1 );
- USHORT nOffset = 0;
+ sal_uInt16 nOffset = 0;
const CompareLine* pLine;
if( GetLineCount() == nInsPos )
{
@@ -1418,8 +1417,8 @@ void SwCompareData::ShowDelete( const CompareData& rData, ULONG nStt,
}
void SwCompareData::CheckForChangesInLine( const CompareData& rData,
- ULONG& rStt, ULONG& rEnd,
- ULONG& rThisStt, ULONG& rThisEnd )
+ sal_uLong& rStt, sal_uLong& rEnd,
+ sal_uLong& rThisStt, sal_uLong& rThisEnd )
{
while( rStt < rEnd && rThisStt < rThisEnd )
{
@@ -1433,13 +1432,13 @@ void SwCompareData::CheckForChangesInLine( const CompareData& rData,
}
}
-void SwCompareData::SetRedlinesToDoc( BOOL bUseDocInfo )
+void SwCompareData::SetRedlinesToDoc( sal_Bool bUseDocInfo )
{
SwPaM* pTmp = pDelRing;
// Bug #83296#: get the Author / TimeStamp from the "other"
// document info
- USHORT nAuthor = rDoc.GetRedlineAuthor();
+ sal_uInt16 nAuthor = rDoc.GetRedlineAuthor();
DateTime aTimeStamp;
SwDocShell *pDocShell(rDoc.GetDocShell());
DBG_ASSERT(pDocShell, "no SwDocShell");
@@ -1494,8 +1493,11 @@ void SwCompareData::SetRedlinesToDoc( BOOL bUseDocInfo )
rDoc.DeleteRedline( *pTmp, false, USHRT_MAX );
- if( rDoc.DoesUndo() )
- rDoc.AppendUndo( new SwUndoCompDoc( *pTmp, FALSE ));
+ if (rDoc.GetIDocumentUndoRedo().DoesUndo())
+ {
+ SwUndo *const pUndo(new SwUndoCompDoc( *pTmp, sal_False )) ;
+ rDoc.GetIDocumentUndoRedo().AppendUndo(pUndo);
+ }
rDoc.AppendRedline( new SwRedline( aRedlnData, *pTmp ), true );
} while( pDelRing != ( pTmp = (SwPaM*)pTmp->GetNext() ));
@@ -1560,8 +1562,11 @@ void SwCompareData::SetRedlinesToDoc( BOOL bUseDocInfo )
do {
if( rDoc.AppendRedline( new SwRedline( aRedlnData, *pTmp ), true) &&
- rDoc.DoesUndo() )
- rDoc.AppendUndo( new SwUndoCompDoc( *pTmp, TRUE ));
+ rDoc.GetIDocumentUndoRedo().DoesUndo())
+ {
+ SwUndo *const pUndo(new SwUndoCompDoc( *pTmp, sal_True ));
+ rDoc.GetIDocumentUndoRedo().AppendUndo(pUndo);
+ }
} while( pInsRing != ( pTmp = (SwPaM*)pTmp->GetNext() ));
}
}
@@ -1578,10 +1583,10 @@ long SwDoc::CompareDoc( const SwDoc& rDoc )
long nRet = 0;
- StartUndo(UNDO_EMPTY, NULL);
- BOOL bDocWasModified = IsModified();
+ GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL);
+ sal_Bool bDocWasModified = IsModified();
SwDoc& rSrcDoc = (SwDoc&)rDoc;
- BOOL bSrcModified = rSrcDoc.IsModified();
+ sal_Bool bSrcModified = rSrcDoc.IsModified();
RedlineMode_t eSrcRedlMode = rSrcDoc.GetRedlineMode();
rSrcDoc.SetRedlineMode( nsRedlineMode_t::REDLINE_SHOW_INSERT );
@@ -1609,14 +1614,12 @@ long SwDoc::CompareDoc( const SwDoc& rDoc )
if( !bSrcModified )
rSrcDoc.ResetModified();
- EndUndo(UNDO_EMPTY, NULL);
+ GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, NULL);
return nRet;
}
-typedef void (SwDoc::*FNInsUndo)( SwUndo* );
-
class _SaveMergeRedlines : public Ring
{
const SwRedline* pSrcRedl;
@@ -1624,7 +1627,7 @@ class _SaveMergeRedlines : public Ring
public:
_SaveMergeRedlines( const SwNode& rDstNd,
const SwRedline& rSrcRedl, Ring* pRing );
- USHORT InsertRedline( FNInsUndo pFn );
+ sal_uInt16 InsertRedline();
SwRedline* GetDestRedline() { return pDestRedl; }
};
@@ -1655,16 +1658,15 @@ _SaveMergeRedlines::_SaveMergeRedlines( const SwNode& rDstNd,
}
}
-USHORT _SaveMergeRedlines::InsertRedline( FNInsUndo pFn )
+sal_uInt16 _SaveMergeRedlines::InsertRedline()
{
- USHORT nIns = 0;
+ sal_uInt16 nIns = 0;
SwDoc* pDoc = pDestRedl->GetDoc();
if( nsRedlineType_t::REDLINE_INSERT == pDestRedl->GetType() )
{
// der Teil wurde eingefuegt, also kopiere ihn aus dem SourceDoc
- BOOL bUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
SwNodeIndex aSaveNd( pDestRedl->GetPoint()->nNode, -1 );
xub_StrLen nSaveCnt = pDestRedl->GetPoint()->nContent.GetIndex();
@@ -1677,7 +1679,6 @@ USHORT _SaveMergeRedlines::InsertRedline( FNInsUndo pFn )
*pDestRedl->GetPoint(), false );
pDoc->SetRedlineMode_intern( eOld );
- pDoc->DoUndo( bUndo );
pDestRedl->SetMark();
aSaveNd++;
@@ -1699,7 +1700,7 @@ USHORT _SaveMergeRedlines::InsertRedline( FNInsUndo pFn )
// eingefuegter ist, dann muss dieser gesplittet werden!
SwPosition* pDStt = pDestRedl->GetMark(),
* pDEnd = pDestRedl->GetPoint();
- USHORT n = 0;
+ sal_uInt16 n = 0;
// zur StartPos das erste Redline suchen
if( !pDoc->GetRedline( *pDStt, &n ) && n )
@@ -1739,13 +1740,16 @@ USHORT _SaveMergeRedlines::InsertRedline( FNInsUndo pFn )
pCpyRedl->SetMark();
*pCpyRedl->GetPoint() = *pRStt;
- SwUndoCompDoc* pUndo = pDoc->DoesUndo()
+ SwUndoCompDoc *const pUndo =
+ (pDoc->GetIDocumentUndoRedo().DoesUndo())
? new SwUndoCompDoc( *pCpyRedl ) : 0;
// now modify doc: append redline, undo (and count)
pDoc->AppendRedline( pCpyRedl, true );
if( pUndo )
- (pDoc->*pFn)( pUndo );
+ {
+ pDoc->GetIDocumentUndoRedo().AppendUndo(pUndo);
+ }
++nIns;
*pDStt = *pREnd;
@@ -1772,12 +1776,15 @@ USHORT _SaveMergeRedlines::InsertRedline( FNInsUndo pFn )
if( pDestRedl )
{
- SwUndoCompDoc* pUndo = pDoc->DoesUndo() ? new SwUndoCompDoc( *pDestRedl ) : 0;
+ SwUndoCompDoc *const pUndo = (pDoc->GetIDocumentUndoRedo().DoesUndo())
+ ? new SwUndoCompDoc( *pDestRedl ) : 0;
// now modify doc: append redline, undo (and count)
bool bRedlineAccepted = pDoc->AppendRedline( pDestRedl, true );
if( pUndo )
- (pDoc->*pFn)( pUndo );
+ {
+ pDoc->GetIDocumentUndoRedo().AppendUndo( pUndo );
+ }
++nIns;
// if AppendRedline has deleted our redline, we may not keep a
@@ -1796,10 +1803,10 @@ long SwDoc::MergeDoc( const SwDoc& rDoc )
long nRet = 0;
- StartUndo(UNDO_EMPTY, NULL);
+ GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL);
SwDoc& rSrcDoc = (SwDoc&)rDoc;
- BOOL bSrcModified = rSrcDoc.IsModified();
+ sal_Bool bSrcModified = rSrcDoc.IsModified();
RedlineMode_t eSrcRedlMode = rSrcDoc.GetRedlineMode();
rSrcDoc.SetRedlineMode( nsRedlineMode_t::REDLINE_SHOW_DELETE );
@@ -1818,12 +1825,12 @@ long SwDoc::MergeDoc( const SwDoc& rDoc )
// deren Position im DestDoc
_SaveMergeRedlines* pRing = 0;
const SwRedlineTbl& rSrcRedlTbl = rSrcDoc.GetRedlineTbl();
- ULONG nEndOfExtra = rSrcDoc.GetNodes().GetEndOfExtras().GetIndex();
- ULONG nMyEndOfExtra = GetNodes().GetEndOfExtras().GetIndex();
- for( USHORT n = 0; n < rSrcRedlTbl.Count(); ++n )
+ sal_uLong nEndOfExtra = rSrcDoc.GetNodes().GetEndOfExtras().GetIndex();
+ sal_uLong nMyEndOfExtra = GetNodes().GetEndOfExtras().GetIndex();
+ for( sal_uInt16 n = 0; n < rSrcRedlTbl.Count(); ++n )
{
const SwRedline* pRedl = rSrcRedlTbl[ n ];
- ULONG nNd = pRedl->GetPoint()->nNode.GetIndex();
+ sal_uLong nNd = pRedl->GetPoint()->nNode.GetIndex();
RedlineType_t eType = pRedl->GetType();
if( nEndOfExtra < nNd &&
( nsRedlineType_t::REDLINE_INSERT == eType || nsRedlineType_t::REDLINE_DELETE == eType ))
@@ -1853,7 +1860,7 @@ long SwDoc::MergeDoc( const SwDoc& rDoc )
_SaveMergeRedlines* pTmp = pRing;
do {
- nRet += pTmp->InsertRedline( &SwDoc::AppendUndo );
+ nRet += pTmp->InsertRedline();
} while( pRing != ( pTmp = (_SaveMergeRedlines*)pTmp->GetNext() ));
while( pRing != pRing->GetNext() )
@@ -1868,7 +1875,7 @@ long SwDoc::MergeDoc( const SwDoc& rDoc )
SetRedlineMode((RedlineMode_t)(nsRedlineMode_t::REDLINE_SHOW_INSERT | nsRedlineMode_t::REDLINE_SHOW_DELETE));
- EndUndo(UNDO_EMPTY, NULL);
+ GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, NULL);
return nRet;
}
diff --git a/sw/source/core/doc/doccorr.cxx b/sw/source/core/doc/doccorr.cxx
index 3fe0bc66bdb6..6585b3359004 100644
--- a/sw/source/core/doc/doccorr.cxx
+++ b/sw/source/core/doc/doccorr.cxx
@@ -114,12 +114,12 @@ namespace
const xub_StrLen nCntIdx)
{
for(int nb = 0; nb < 2; ++nb)
- if(&((pPam)->GetBound(BOOL(nb)).nNode.GetNode()) == pOldNode)
+ if(&((pPam)->GetBound(sal_Bool(nb)).nNode.GetNode()) == pOldNode)
{
- (pPam)->GetBound(BOOL(nb)).nNode = rNewPos.nNode;
- (pPam)->GetBound(BOOL(nb)).nContent.Assign(
+ (pPam)->GetBound(sal_Bool(nb)).nNode = rNewPos.nNode;
+ (pPam)->GetBound(sal_Bool(nb)).nContent.Assign(
const_cast<SwIndexReg*>(rNewPos.nContent.GetIdxReg()),
- nCntIdx + (pPam)->GetBound(BOOL(nb)).nContent.GetIndex());
+ nCntIdx + (pPam)->GetBound(sal_Bool(nb)).nContent.GetIndex());
}
}
}
@@ -156,7 +156,7 @@ void PaMCorrAbs( const SwPaM& rRange,
{
SwUnoCrsrTbl& rTbl = const_cast<SwUnoCrsrTbl&>(pDoc->GetUnoCrsrTbl());
- for( USHORT n = 0; n < rTbl.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rTbl.Count(); ++n )
{
SwUnoCrsr *const pUnoCursor = rTbl[ n ];
@@ -199,7 +199,7 @@ void PaMCorrAbs( const SwPaM& rRange,
void SwDoc::CorrAbs(const SwNodeIndex& rOldNode,
const SwPosition& rNewPos,
const xub_StrLen nOffset,
- BOOL bMoveCrsr)
+ sal_Bool bMoveCrsr)
{
SwCntntNode *const pCntntNode( rOldNode.GetNode().GetCntntNode() );
SwPaM const aPam(rOldNode, 0,
@@ -210,7 +210,7 @@ void SwDoc::CorrAbs(const SwNodeIndex& rOldNode,
getIDocumentMarkAccess()->correctMarksAbsolute(rOldNode, rNewPos, nOffset);
{ // fix redlines
SwRedlineTbl& rTbl = *pRedlineTbl;
- for( USHORT n = 0; n < rTbl.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rTbl.Count(); ++n )
{
// is on position ??
lcl_PaMCorrAbs(*rTbl[ n ], *aPam.Start(), *aPam.End(), aNewPos);
@@ -225,7 +225,7 @@ void SwDoc::CorrAbs(const SwNodeIndex& rOldNode,
void SwDoc::CorrAbs(const SwPaM& rRange,
const SwPosition& rNewPos,
- BOOL bMoveCrsr)
+ sal_Bool bMoveCrsr)
{
SwPosition aStart(*rRange.Start());
SwPosition aEnd(*rRange.End());
@@ -240,7 +240,7 @@ void SwDoc::CorrAbs(const SwPaM& rRange,
void SwDoc::CorrAbs(const SwNodeIndex& rStartNode,
const SwNodeIndex& rEndNode,
const SwPosition& rNewPos,
- BOOL bMoveCrsr)
+ sal_Bool bMoveCrsr)
{
_DelBookmarks(rStartNode, rEndNode);
@@ -289,7 +289,7 @@ void PaMCorrRel( const SwNodeIndex &rOldNode,
}
{
SwUnoCrsrTbl& rTbl = (SwUnoCrsrTbl&)pDoc->GetUnoCrsrTbl();
- for( USHORT n = 0; n < rTbl.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rTbl.Count(); ++n )
{
FOREACHPAM_START( rTbl[ n ] )
lcl_PaMCorrRel1( PCURCRSR, pOldNode, aNewPos, nCntIdx );
@@ -310,14 +310,14 @@ void PaMCorrRel( const SwNodeIndex &rOldNode,
void SwDoc::CorrRel(const SwNodeIndex& rOldNode,
const SwPosition& rNewPos,
const xub_StrLen nOffset,
- BOOL bMoveCrsr)
+ sal_Bool bMoveCrsr)
{
getIDocumentMarkAccess()->correctMarksRelative(rOldNode, rNewPos, nOffset);
{ // dann die Redlines korrigieren
SwRedlineTbl& rTbl = *pRedlineTbl;
SwPosition aNewPos(rNewPos);
- for( USHORT n = 0; n < rTbl.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rTbl.Count(); ++n )
{
// liegt auf der Position ??
lcl_PaMCorrRel1( rTbl[ n ], &rOldNode.GetNode(), aNewPos, aNewPos.nContent.GetIndex() + nOffset );
@@ -351,4 +351,8 @@ SwEditShell* SwDoc::GetEditShell( ViewShell** ppSh ) const
return 0;
}
+::sw::IShellCursorSupplier * SwDoc::GetIShellCursorSupplier()
+{
+ return GetEditShell(0);
+}
diff --git a/sw/source/core/doc/docdde.cxx b/sw/source/core/doc/docdde.cxx
index d21e6313a2df..bef9ea1f254f 100644
--- a/sw/source/core/doc/docdde.cxx
+++ b/sw/source/core/doc/docdde.cxx
@@ -93,7 +93,7 @@ struct _FindItem
{}
};
-BOOL lcl_FindSection( const SwSectionFmtPtr& rpSectFmt, void* pArgs, bool bCaseSensitive )
+sal_Bool lcl_FindSection( const SwSectionFmtPtr& rpSectFmt, void* pArgs, bool bCaseSensitive )
{
_FindItem * const pItem( static_cast<_FindItem*>(pArgs) );
SwSection* pSect = rpSectFmt->GetSection();
@@ -114,26 +114,26 @@ BOOL lcl_FindSection( const SwSectionFmtPtr& rpSectFmt, void* pArgs, bool bCaseS
{
// eine Tabelle im normalen NodesArr
pItem->pSectNd = pIdx->GetNode().GetSectionNode();
- return FALSE;
+ return sal_False;
}
//nein!! // sollte der Namen schon passen, der Rest aber nicht, dann haben wir
// sie nicht. Die Namen sind immer eindeutig.
}
}
- return TRUE; // dann weiter
+ return sal_True; // dann weiter
}
-BOOL lcl_FindSectionCaseSensitive( const SwSectionFmtPtr& rpSectFmt, void* pArgs )
+sal_Bool lcl_FindSectionCaseSensitive( const SwSectionFmtPtr& rpSectFmt, void* pArgs )
{
return lcl_FindSection( rpSectFmt, pArgs, true );
}
-BOOL lcl_FindSectionCaseInsensitive( const SwSectionFmtPtr& rpSectFmt, void* pArgs )
+sal_Bool lcl_FindSectionCaseInsensitive( const SwSectionFmtPtr& rpSectFmt, void* pArgs )
{
return lcl_FindSection( rpSectFmt, pArgs, false );
}
-BOOL lcl_FindTable( const SwFrmFmtPtr& rpTableFmt, void* pArgs )
+sal_Bool lcl_FindTable( const SwFrmFmtPtr& rpTableFmt, void* pArgs )
{
_FindItem * const pItem( static_cast<_FindItem*>(pArgs) );
String sNm( GetAppCharClass().lower( rpTableFmt->GetName() ));
@@ -149,12 +149,12 @@ BOOL lcl_FindTable( const SwFrmFmtPtr& rpTableFmt, void* pArgs )
// eine Tabelle im normalen NodesArr
pItem->pTblNd = (SwTableNode*)
pFBox->GetSttNd()->FindTableNode();
- return FALSE;
+ return sal_False;
}
//nein! // sollte der Namen schon passen, der Rest aber nicht, dann haben wir
// sie nicht. Die Namen sind immer eindeutig.
}
- return TRUE; // dann weiter
+ return sal_True; // dann weiter
}
@@ -193,7 +193,7 @@ bool SwDoc::GetData( const String& rItem, const String& rMimeType,
return SwServerObject( *aPara.pTblNd ).GetData( rValue, rMimeType );
}
- return FALSE;
+ return sal_False;
}
@@ -231,7 +231,7 @@ bool SwDoc::SetData( const String& rItem, const String& rMimeType,
return SwServerObject( *aPara.pTblNd ).SetData( rMimeType, rValue );
}
- return FALSE;
+ return sal_False;
}
@@ -289,7 +289,7 @@ bool SwDoc::SetData( const String& rItem, const String& rMimeType,
return pObj;
}
-BOOL SwDoc::SelectServerObj( const String& rStr, SwPaM*& rpPam,
+sal_Bool SwDoc::SelectServerObj( const String& rStr, SwPaM*& rpPam,
SwNodeRange*& rpRange ) const
{
// haben wir ueberhaupt das Item vorraetig?
@@ -308,7 +308,7 @@ BOOL SwDoc::SelectServerObj( const String& rStr, SwPaM*& rpPam,
// sondern auch Rahmen(Text!), Tabellen, Gliederungen:
if( STRING_NOTFOUND != nPos )
{
- BOOL bWeiter = FALSE;
+ sal_Bool bWeiter = sal_False;
String sName( sItem.Copy( 0, nPos ) );
String sCmp( sItem.Copy( nPos + 1 ));
rCC.toLower( sItem );
@@ -324,7 +324,7 @@ BOOL SwDoc::SelectServerObj( const String& rStr, SwPaM*& rpPam,
{
rpRange = new SwNodeRange( *aPara.pTblNd, 0,
*aPara.pTblNd->EndOfSectionNode(), 1 );
- return TRUE;
+ return sal_True;
}
}
else if( sCmp.EqualsAscii( pMarkToFrame ) )
@@ -337,13 +337,13 @@ BOOL SwDoc::SelectServerObj( const String& rStr, SwPaM*& rpPam,
!( pNd = &pIdx->GetNode())->IsNoTxtNode() )
{
rpRange = new SwNodeRange( *pNd, 1, *pNd->EndOfSectionNode() );
- return TRUE;
+ return sal_True;
}
}
else if( sCmp.EqualsAscii( pMarkToRegion ) )
{
sItem = sName; // wird unten behandelt !
- bWeiter = TRUE;
+ bWeiter = sal_True;
}
else if( sCmp.EqualsAscii( pMarkToOutline ) )
{
@@ -351,11 +351,11 @@ BOOL SwDoc::SelectServerObj( const String& rStr, SwPaM*& rpPam,
if( GotoOutline( aPos, sName ))
{
SwNode* pNd = &aPos.nNode.GetNode();
- //BYTE nLvl = pNd->GetTxtNode()->GetTxtColl()->GetOutlineLevel();//#outline level,zhaojianwei
+ //sal_uInt8 nLvl = pNd->GetTxtNode()->GetTxtColl()->GetOutlineLevel();//#outline level,zhaojianwei
const int nLvl = pNd->GetTxtNode()->GetAttrOutlineLevel()-1;//<-end,zhaojianwei
const SwOutlineNodes& rOutlNds = GetNodes().GetOutLineNds();
- USHORT nTmpPos;
+ sal_uInt16 nTmpPos;
rOutlNds.Seek_Entry( pNd, &nTmpPos );
rpRange = new SwNodeRange( aPos.nNode, 0, aPos.nNode );
@@ -372,12 +372,12 @@ BOOL SwDoc::SelectServerObj( const String& rStr, SwPaM*& rpPam,
rpRange->aEnd = *rOutlNds[ nTmpPos ];
else
rpRange->aEnd = GetNodes().GetEndOfContent();
- return TRUE;
+ return sal_True;
}
}
if( !bWeiter )
- return FALSE;
+ return sal_False;
}
//search for bookmarks and sections case senstive at first. If nothing is found then try again case insensitive
@@ -405,7 +405,7 @@ BOOL SwDoc::SelectServerObj( const String& rStr, SwPaM*& rpPam,
{
rpRange = new SwNodeRange( *aPara.pSectNd, 1,
*aPara.pSectNd->EndOfSectionNode() );
- return TRUE;
+ return sal_True;
}
}
@@ -413,6 +413,6 @@ BOOL SwDoc::SelectServerObj( const String& rStr, SwPaM*& rpPam,
break;
bCaseSensitive = false;
}
- return FALSE;
+ return sal_False;
}
diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index 3f3d4630d5f8..f64f37e02011 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -27,6 +27,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
#include <hintids.hxx>
#include <vcl/virdev.hxx>
#include <svx/svdmodel.hxx>
@@ -48,6 +49,7 @@
#include <ndole.hxx>
#include <mdiexp.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <docary.hxx>
#include <pagefrm.hxx> //Fuer DelPageDesc
#include <rootfrm.hxx> //Fuer DelPageDesc
@@ -68,7 +70,12 @@
#include <GetMetricVal.hxx>
#include <unotools/syslocale.hxx>
#include <statstr.hrc>
+<<<<<<< local
#include <switerator.hxx>
+=======
+#include <hints.hxx>
+
+>>>>>>> other
#include <SwUndoPageDesc.hxx>
#include <pagedeschint.hxx>
#include <tgrditem.hxx>
@@ -119,8 +126,8 @@ static void lcl_DefaultPageFmt( sal_uInt16 nPoolFmtId,
SvxLRSpaceItem aLR( RES_LR_SPACE );
SvxULSpaceItem aUL( RES_UL_SPACE );
- aUL.SetUpper( (USHORT)nMinTop );
- aUL.SetLower( (USHORT)nMinBottom );
+ aUL.SetUpper( (sal_uInt16)nMinTop );
+ aUL.SetLower( (sal_uInt16)nMinBottom );
aLR.SetRight( nMinRight );
aLR.SetLeft( nMinLeft );
@@ -143,7 +150,7 @@ static void lcl_DefaultPageFmt( sal_uInt16 nPoolFmtId,
|*************************************************************************/
void lcl_DescSetAttr( const SwFrmFmt &rSource, SwFrmFmt &rDest,
- const BOOL bPage = TRUE )
+ const sal_Bool bPage = sal_True )
{
/////////////// !!!!!!!!!!!!!!!!
//JP 03.03.99:
@@ -151,7 +158,7 @@ void lcl_DescSetAttr( const SwFrmFmt &rSource, SwFrmFmt &rDest,
// funktioniert nicht richtig, wenn man unterschiedliche WhichRanges hat.
/////////////// !!!!!!!!!!!!!!!!
//Die interressanten Attribute uebernehmen.
- USHORT __READONLY_DATA aIdArr[] = { RES_FRM_SIZE, RES_UL_SPACE,
+ sal_uInt16 __READONLY_DATA aIdArr[] = { RES_FRM_SIZE, RES_UL_SPACE,
RES_BACKGROUND, RES_SHADOW,
RES_COL, RES_COL,
RES_FRAMEDIR, RES_FRAMEDIR,
@@ -165,9 +172,9 @@ void lcl_DescSetAttr( const SwFrmFmt &rSource, SwFrmFmt &rDest,
0 };
const SfxPoolItem* pItem;
- for( USHORT n = 0; aIdArr[ n ]; n += 2 )
+ for( sal_uInt16 n = 0; aIdArr[ n ]; n += 2 )
{
- for( USHORT nId = aIdArr[ n ]; nId <= aIdArr[ n+1]; ++nId )
+ for( sal_uInt16 nId = aIdArr[ n ]; nId <= aIdArr[ n+1]; ++nId )
{
// --> FME 2005-04-18 #i45539#
// bPage == true:
@@ -178,7 +185,7 @@ void lcl_DescSetAttr( const SwFrmFmt &rSource, SwFrmFmt &rDest,
if( ( bPage && RES_HEADER_FOOTER_EAT_SPACING != nId ) ||
( !bPage && RES_COL != nId && RES_PAPER_BIN != nId ))
{
- if( SFX_ITEM_SET == rSource.GetItemState( nId, FALSE, &pItem ))
+ if( SFX_ITEM_SET == rSource.GetItemState( nId, sal_False, &pItem ))
rDest.SetFmtAttr( *pItem );
else
rDest.ResetFmtAttr( nId );
@@ -193,19 +200,19 @@ void lcl_DescSetAttr( const SwFrmFmt &rSource, SwFrmFmt &rDest,
}
-void SwDoc::ChgPageDesc( USHORT i, const SwPageDesc &rChged )
+void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged )
{
ASSERT( i < aPageDescs.Count(), "PageDescs ueberindiziert." );
SwPageDesc *pDesc = aPageDescs[i];
SwRootFrm* pTmpRoot = GetCurrentLayout();//swmod 080219
- BOOL bDoesUndo = DoesUndo();
- if (DoesUndo())
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- AppendUndo(new SwUndoPageDesc(*pDesc, rChged, this));
- DoUndo(FALSE);
+ SwUndo *const pUndo(new SwUndoPageDesc(*pDesc, rChged, this));
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
+ ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
//Als erstes wird ggf. gespiegelt.
if ( rChged.GetUseOn() == nsUseOnPage::PD_MIRROR )
@@ -228,7 +235,7 @@ void SwDoc::ChgPageDesc( USHORT i, const SwPageDesc &rChged )
// ErgoSum-Texte geben, die sich auf eine geaenderte Seite beziehen,
// deshalb werden die Fussnoten invalidiert
SwFtnIdxs& rFtnIdxs = GetFtnIdxs();
- for( USHORT nPos = 0; nPos < rFtnIdxs.Count(); ++nPos )
+ for( sal_uInt16 nPos = 0; nPos < rFtnIdxs.Count(); ++nPos )
{
SwTxtFtn *pTxtFtn = rFtnIdxs[ nPos ];
const SwFmtFtn &rFtn = pTxtFtn->GetFtn();
@@ -244,7 +251,7 @@ void SwDoc::ChgPageDesc( USHORT i, const SwPageDesc &rChged )
//Header abgleichen.
const SwFmtHeader &rHead = rChged.GetMaster().GetHeader();
- if( bDoesUndo )
+ if (undoGuard.UndoWasEnabled())
{
// #i46909# no undo if header or footer changed
// hat sich an den Nodes etwas veraendert ?
@@ -271,7 +278,7 @@ void SwDoc::ChgPageDesc( USHORT i, const SwPageDesc &rChged )
SwFmtHeader aHead( MakeLayoutFmt( RND_STD_HEADERL, 0 ) );
pDesc->GetLeft().SetFmtAttr( aHead );
//Weitere Attribute (Raender, Umrandung...) uebernehmen.
- ::lcl_DescSetAttr( *rHead.GetHeaderFmt(), *aHead.GetHeaderFmt(), FALSE);
+ ::lcl_DescSetAttr( *rHead.GetHeaderFmt(), *aHead.GetHeaderFmt(), sal_False);
}
else
{
@@ -284,7 +291,7 @@ void SwDoc::ChgPageDesc( USHORT i, const SwPageDesc &rChged )
{
SwFrmFmt *pFmt = new SwFrmFmt( GetAttrPool(), "Header",
GetDfltFrmFmt() );
- ::lcl_DescSetAttr( *pRight, *pFmt, FALSE );
+ ::lcl_DescSetAttr( *pRight, *pFmt, sal_False );
//Der Bereich auf den das rechte Kopfattribut zeigt wird
//kopiert und der Index auf den StartNode in das linke
//Kopfattribut gehaengt.
@@ -293,14 +300,14 @@ void SwDoc::ChgPageDesc( USHORT i, const SwPageDesc &rChged )
SwNodeRange aRange( aRCnt.GetCntntIdx()->GetNode(), 0,
*aRCnt.GetCntntIdx()->GetNode().EndOfSectionNode() );
aTmp = *pSttNd->EndOfSectionNode();
- GetNodes()._Copy( aRange, aTmp, FALSE );
+ GetNodes()._Copy( aRange, aTmp, sal_False );
pFmt->SetFmtAttr( SwFmtCntnt( pSttNd ) );
pDesc->GetLeft().SetFmtAttr( SwFmtHeader( pFmt ) );
}
else
::lcl_DescSetAttr( *pRight,
- *(SwFrmFmt*)rLeftHead.GetHeaderFmt(), FALSE );
+ *(SwFrmFmt*)rLeftHead.GetHeaderFmt(), sal_False );
}
}
@@ -308,7 +315,7 @@ void SwDoc::ChgPageDesc( USHORT i, const SwPageDesc &rChged )
//Footer abgleichen.
const SwFmtFooter &rFoot = rChged.GetMaster().GetFooter();
- if( bDoesUndo )
+ if (undoGuard.UndoWasEnabled())
{
// #i46909# no undo if header or footer changed
// hat sich an den Nodes etwas veraendert ?
@@ -333,7 +340,7 @@ void SwDoc::ChgPageDesc( USHORT i, const SwPageDesc &rChged )
SwFmtFooter aFoot( MakeLayoutFmt( RND_STD_FOOTER, 0 ) );
pDesc->GetLeft().SetFmtAttr( aFoot );
//Weitere Attribute (Raender, Umrandung...) uebernehmen.
- ::lcl_DescSetAttr( *rFoot.GetFooterFmt(), *aFoot.GetFooterFmt(), FALSE);
+ ::lcl_DescSetAttr( *rFoot.GetFooterFmt(), *aFoot.GetFooterFmt(), sal_False);
}
else
{
@@ -346,7 +353,7 @@ void SwDoc::ChgPageDesc( USHORT i, const SwPageDesc &rChged )
{
SwFrmFmt *pFmt = new SwFrmFmt( GetAttrPool(), "Footer",
GetDfltFrmFmt() );
- ::lcl_DescSetAttr( *pRight, *pFmt, FALSE );
+ ::lcl_DescSetAttr( *pRight, *pFmt, sal_False );
//Der Bereich auf den das rechte Kopfattribut zeigt wird
//kopiert und der Index auf den StartNode in das linke
//Kopfattribut gehaengt.
@@ -355,14 +362,14 @@ void SwDoc::ChgPageDesc( USHORT i, const SwPageDesc &rChged )
SwNodeRange aRange( aRCnt.GetCntntIdx()->GetNode(), 0,
*aRCnt.GetCntntIdx()->GetNode().EndOfSectionNode() );
aTmp = *pSttNd->EndOfSectionNode();
- GetNodes()._Copy( aRange, aTmp, FALSE );
+ GetNodes()._Copy( aRange, aTmp, sal_False );
pFmt->SetFmtAttr( SwFmtCntnt( pSttNd ) );
pDesc->GetLeft().SetFmtAttr( SwFmtFooter( pFmt ) );
}
else
::lcl_DescSetAttr( *pRight,
- *(SwFrmFmt*)rLeftFoot.GetFooterFmt(), FALSE );
+ *(SwFrmFmt*)rLeftFoot.GetFooterFmt(), sal_False );
}
}
pDesc->ChgFooterShare( rChged.IsFooterShared() );
@@ -375,22 +382,22 @@ void SwDoc::ChgPageDesc( USHORT i, const SwPageDesc &rChged )
//Wenn sich das UseOn oder der Follow aendern muessen die
//Absaetze das erfahren.
- BOOL bUseOn = FALSE;
- BOOL bFollow = FALSE;
+ sal_Bool bUseOn = sal_False;
+ sal_Bool bFollow = sal_False;
if ( pDesc->GetUseOn() != rChged.GetUseOn() )
{ pDesc->SetUseOn( rChged.GetUseOn() );
- bUseOn = TRUE;
+ bUseOn = sal_True;
}
if ( pDesc->GetFollow() != rChged.GetFollow() )
{ if ( rChged.GetFollow() == &rChged )
{ if ( pDesc->GetFollow() != pDesc )
{ pDesc->SetFollow( pDesc );
- bFollow = TRUE;
+ bFollow = sal_True;
}
}
else
{ pDesc->SetFollow( rChged.pFollow );
- bFollow = TRUE;
+ bFollow = sal_True;
}
}
@@ -420,13 +427,10 @@ void SwDoc::ChgPageDesc( USHORT i, const SwPageDesc &rChged )
}
SetModified();
- DoUndo(bDoesUndo);
-
// #i46909# no undo if header or footer changed
if( bHeaderFooterChanged )
{
- ClearRedo();
- DelAllUndoObj();
+ GetIDocumentUndoRedo().DelAllUndoObj();
}
}
@@ -441,6 +445,28 @@ void SwDoc::ChgPageDesc( USHORT i, const SwPageDesc &rChged )
|*
|*************************************************************************/
+<<<<<<< local
+=======
+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;
+ }
+}
+
+>>>>>>> other
// #i7983#
void SwDoc::PreDelPageDesc(SwPageDesc * pDel)
{
@@ -471,6 +497,7 @@ void SwDoc::PreDelPageDesc(SwPageDesc * pDel)
}
}
+<<<<<<< local
for ( USHORT j = 0; j < aPageDescs.Count(); ++j )
{
if ( aPageDescs[j]->GetFollow() == pDel )
@@ -483,11 +510,51 @@ void SwDoc::PreDelPageDesc(SwPageDesc * pDel)
}
}
}
+=======
+ sal_Bool bFtnInf = sal_False;
+ if ( sal_True == (bFtnInf = pLast == pFtnInfo->GetPageDescDep()) ||
+ pLast == pEndNoteInfo->GetPageDescDep() )
+ {
+ aPageDescs[0]->Add( pLast );
+ if ( GetRootFrm() )
+ GetRootFrm()->CheckFtnPageDescs( !bFtnInf );
+ }
+ }
+
+ 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( 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 );
+ }
+>>>>>>> other
}
// #116530#
void SwDoc::BroadcastStyleOperation(String rName, SfxStyleFamily eFamily,
- USHORT nOp)
+ sal_uInt16 nOp)
{
if (pDocShell)
{
@@ -504,7 +571,7 @@ void SwDoc::BroadcastStyleOperation(String rName, SfxStyleFamily eFamily,
}
}
-void SwDoc::DelPageDesc( USHORT i, BOOL bBroadcast )
+void SwDoc::DelPageDesc( sal_uInt16 i, sal_Bool bBroadcast )
{
ASSERT( i < aPageDescs.Count(), "PageDescs ueberindiziert." );
ASSERT( i != 0, "Default Pagedesc loeschen is nicht." );
@@ -519,9 +586,10 @@ void SwDoc::DelPageDesc( USHORT i, BOOL bBroadcast )
SFX_STYLESHEET_ERASED);
// <- #116530#
- if (DoesUndo())
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- AppendUndo(new SwUndoPageDescDelete(*pDel, this));
+ SwUndo *const pUndo(new SwUndoPageDescDelete(*pDel, this));
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
PreDelPageDesc(pDel); // #i7983#
@@ -542,8 +610,8 @@ void SwDoc::DelPageDesc( USHORT i, BOOL bBroadcast )
|*
|*************************************************************************/
-USHORT SwDoc::MakePageDesc( const String &rName, const SwPageDesc *pCpy,
- BOOL bRegardLanguage, BOOL bBroadcast) // #116530#
+sal_uInt16 SwDoc::MakePageDesc( const String &rName, const SwPageDesc *pCpy,
+ sal_Bool bRegardLanguage, sal_Bool bBroadcast) // #116530#
{
SwPageDesc *pNew;
if( pCpy )
@@ -578,19 +646,22 @@ USHORT SwDoc::MakePageDesc( const String &rName, const SwPageDesc *pCpy,
SFX_STYLESHEET_CREATED);
// <- #116530#
- if (DoesUndo())
- AppendUndo(new SwUndoPageDescCreate(pNew, this)); // #116530#
+ if (GetIDocumentUndoRedo().DoesUndo())
+ {
+ // #116530#
+ GetIDocumentUndoRedo().AppendUndo(new SwUndoPageDescCreate(pNew, this));
+ }
SetModified();
return (aPageDescs.Count()-1);
}
-SwPageDesc* SwDoc::FindPageDescByName( const String& rName, USHORT* pPos ) const
+SwPageDesc* SwDoc::FindPageDescByName( const String& rName, sal_uInt16* pPos ) const
{
SwPageDesc* pRet = 0;
if( pPos ) *pPos = USHRT_MAX;
- for( USHORT n = 0, nEnd = aPageDescs.Count(); n < nEnd; ++n )
+ for( sal_uInt16 n = 0, nEnd = aPageDescs.Count(); n < nEnd; ++n )
if( aPageDescs[ n ]->GetName() == rName )
{
pRet = aPageDescs[ n ];
@@ -618,25 +689,35 @@ void SwDoc::PrtDataChanged()
// <--
SwRootFrm* pTmpRoot = GetCurrentLayout();//swmod 080219
SwWait *pWait = 0;
- BOOL bEndAction = FALSE;
+ sal_Bool bEndAction = sal_False;
if( GetDocShell() )
GetDocShell()->UpdateFontList();
+<<<<<<< local
BOOL bDraw = TRUE;
if ( pTmpRoot )
+=======
+ sal_Bool bDraw = sal_True;
+ if ( GetRootFrm() )
+>>>>>>> other
{
ViewShell *pSh = GetCurrentViewShell();
if( !pSh->GetViewOptions()->getBrowseMode() ||
pSh->GetViewOptions()->IsPrtFormat() )
{
if ( GetDocShell() )
- pWait = new SwWait( *GetDocShell(), TRUE );
+ pWait = new SwWait( *GetDocShell(), sal_True );
+<<<<<<< local
pTmpRoot->StartAllAction();
bEndAction = TRUE;
+=======
+ GetRootFrm()->StartAllAction();
+ bEndAction = sal_True;
+>>>>>>> other
- bDraw = FALSE;
+ bDraw = sal_False;
if( pDrawModel )
{
pDrawModel->SetAddExtLeading( get(IDocumentSettingAccess::ADD_EXT_LEADING) );
@@ -671,7 +752,7 @@ void SwDoc::PrtDataChanged()
pDrawModel->SetRefDevice( pOutDev );
}
- PrtOLENotify( TRUE );
+ PrtOLENotify( sal_True );
if ( bEndAction )
pTmpRoot->EndAllAction(); //swmod 080218
@@ -685,7 +766,7 @@ void SwDoc::PrtDataChanged()
//ist in init.cxx zu finden.
extern SvPtrarr *pGlobalOLEExcludeList;
-void SwDoc::PrtOLENotify( BOOL bAll )
+void SwDoc::PrtOLENotify( sal_Bool bAll )
{
SwFEShell *pShell = 0;
if ( GetCurrentViewShell() )
@@ -707,16 +788,16 @@ void SwDoc::PrtOLENotify( BOOL bAll )
//Da wir keine Shell haben, merken wir uns diesen unguenstigen
//Zustand am Dokument, dies wird dann beim Erzeugen der ersten Shell
//nachgeholt.
- mbOLEPrtNotifyPending = TRUE;
+ mbOLEPrtNotifyPending = sal_True;
if ( bAll )
- mbAllOLENotify = TRUE;
+ mbAllOLENotify = sal_True;
}
else
{
if ( mbAllOLENotify )
- bAll = TRUE;
+ bAll = sal_True;
- mbOLEPrtNotifyPending = mbAllOLENotify = FALSE;
+ mbOLEPrtNotifyPending = mbAllOLENotify = sal_False;
SwOLENodes *pNodes = SwCntntNode::CreateOLENodesArray( *GetDfltGrfFmtColl(), !bAll );
if ( pNodes )
@@ -725,12 +806,12 @@ void SwDoc::PrtOLENotify( BOOL bAll )
0, pNodes->Count(), GetDocShell());
GetCurrentLayout()->StartAllAction(); //swmod 080218
- for( USHORT i = 0; i < pNodes->Count(); ++i )
+ for( sal_uInt16 i = 0; i < pNodes->Count(); ++i )
{
::SetProgressState( i, GetDocShell() );
SwOLENode* pOLENd = (*pNodes)[i];
- pOLENd->SetOLESizeInvalid( FALSE );
+ pOLENd->SetOLESizeInvalid( sal_False );
//Ersteinmal die Infos laden und festellen ob das Teil nicht
//schon in der Exclude-Liste steht
@@ -745,8 +826,8 @@ void SwDoc::PrtOLENotify( BOOL bAll )
// aName = ????
}
- BOOL bFound = FALSE;
- for ( USHORT j = 0;
+ sal_Bool bFound = sal_False;
+ for ( sal_uInt16 j = 0;
j < pGlobalOLEExcludeList->Count() && !bFound;
++j )
{
@@ -770,7 +851,7 @@ void SwDoc::PrtOLENotify( BOOL bAll )
pShell->CalcAndSetScale( xObj );//Client erzeugen lassen.
}
else
- pOLENd->SetOLESizeInvalid( TRUE );
+ pOLENd->SetOLESizeInvalid( sal_True );
}
else */
pGlobalOLEExcludeList->Insert(
@@ -790,7 +871,7 @@ IMPL_LINK( SwDoc, DoUpdateModifiedOLE, Timer *, )
SwFEShell* pSh = (SwFEShell*)GetEditShell();
if( pSh )
{
- mbOLEPrtNotifyPending = mbAllOLENotify = FALSE;
+ mbOLEPrtNotifyPending = mbAllOLENotify = sal_False;
SwOLENodes *pNodes = SwCntntNode::CreateOLENodesArray( *GetDfltGrfFmtColl(), true );
if( pNodes )
@@ -800,12 +881,21 @@ IMPL_LINK( SwDoc, DoUpdateModifiedOLE, Timer *, )
GetCurrentLayout()->StartAllAction(); //swmod 080218
SwMsgPoolItem aMsgHint( RES_UPDATE_ATTR );
+<<<<<<< local
for( USHORT i = 0; i < pNodes->Count(); ++i )
+=======
+ for( sal_uInt16 i = 0; i < aOLENodes.Count(); ++i )
+>>>>>>> other
{
::SetProgressState( i, GetDocShell() );
+<<<<<<< local
SwOLENode* pOLENd = (*pNodes)[i];
pOLENd->SetOLESizeInvalid( FALSE );
+=======
+ SwOLENode* pOLENd = aOLENodes[i];
+ pOLENd->SetOLESizeInvalid( sal_False );
+>>>>>>> other
//Kennen wir nicht, also muss das Objekt geladen werden.
//Wenn es keine Benachrichtigung wuenscht
@@ -822,7 +912,7 @@ IMPL_LINK( SwDoc, DoUpdateModifiedOLE, Timer *, )
pSh->CalcAndSetScale( xRef );//Client erzeugen lassen.
}
else
- pOLENd->SetOLESizeInvalid( TRUE );
+ pOLENd->SetOLESizeInvalid( sal_True );
}*/
// repaint it
pOLENd->ModifyNotification( &aMsgHint, &aMsgHint );
@@ -836,16 +926,16 @@ IMPL_LINK( SwDoc, DoUpdateModifiedOLE, Timer *, )
return 0;
}
-BOOL SwDoc::FindPageDesc( const String & rName, sal_uInt16 * pFound)
+sal_Bool SwDoc::FindPageDesc( const String & rName, sal_uInt16 * pFound)
{
- BOOL bResult = FALSE;
+ sal_Bool bResult = sal_False;
sal_uInt16 nI;
for (nI = 0; nI < aPageDescs.Count(); nI++)
{
if (aPageDescs[nI]->GetName() == rName)
{
*pFound = nI;
- bResult = TRUE;
+ bResult = sal_True;
break;
}
}
@@ -865,7 +955,7 @@ SwPageDesc * SwDoc::GetPageDesc( const String & rName )
return aResult;
}
-void SwDoc::DelPageDesc( const String & rName, BOOL bBroadcast ) // #116530#
+void SwDoc::DelPageDesc( const String & rName, sal_Bool bBroadcast ) // #116530#
{
sal_uInt16 nI;
@@ -888,7 +978,7 @@ void SwDoc::ChgPageDesc( const String & rName, const SwPageDesc & rDesc)
*/
void SwDoc::CheckDefaultPageFmt()
{
- for ( USHORT i = 0; i < GetPageDescCnt(); ++i )
+ for ( sal_uInt16 i = 0; i < GetPageDescCnt(); ++i )
{
SwPageDesc& rDesc = _GetPageDesc( i );
@@ -920,7 +1010,7 @@ void SwDoc::SetDefaultPageMode(bool bSquaredPageMode)
aNewGrid.Init();
SetDefault(aNewGrid);
- for ( USHORT i = 0; i < GetPageDescCnt(); ++i )
+ for ( sal_uInt16 i = 0; i < GetPageDescCnt(); ++i )
{
SwPageDesc& rDesc = _GetPageDesc( i );
diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx
index 6c09d1c4fcf5..5c93ac5b8201 100644
--- a/sw/source/core/doc/docdraw.cxx
+++ b/sw/source/core/doc/docdraw.cxx
@@ -27,6 +27,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
#include <hintids.hxx>
#include <rtl/logfile.hxx>
#include <vcl/outdev.hxx>
@@ -49,12 +50,13 @@
#include <viewimp.hxx>
#include <swhints.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <docsh.hxx>
#include <rootfrm.hxx> //Damit der RootDtor gerufen wird.
#include <poolfmt.hxx>
#include <viewsh.hxx> // fuer MakeDrawView
#include <drawdoc.hxx>
-#include <undobj.hxx>
+#include <UndoDraw.hxx>
#include <swundo.hxx> // fuer die UndoIds
#include <dcontact.hxx>
#include <dview.hxx>
@@ -213,7 +215,7 @@ SwDrawContact* SwDoc::GroupSelection( SdrView& rDrawView )
const SdrMarkList &rMrkList = rDrawView.GetMarkedObjectList();
SwDrawFrmFmt *pFmt = 0L;
SdrObject *pObj = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
- BOOL bNoGroup = ( 0 == pObj->GetUpGroup() );
+ sal_Bool bNoGroup = ( 0 == pObj->GetUpGroup() );
SwDrawContact* pNewContact = 0;
if( bNoGroup )
{
@@ -221,9 +223,9 @@ SwDrawContact* SwDoc::GroupSelection( SdrView& rDrawView )
SwDrawContact *pMyContact = (SwDrawContact*)GetUserCall(pObj);
const SwFmtAnchor aAnch( pMyContact->GetFmt()->GetAnchor() );
- SwUndoDrawGroup* pUndo = !DoesUndo()
+ SwUndoDrawGroup *const pUndo = (!GetIDocumentUndoRedo().DoesUndo())
? 0
- : new SwUndoDrawGroup( (USHORT)rMrkList.GetMarkCount() );
+ : new SwUndoDrawGroup( (sal_uInt16)rMrkList.GetMarkCount() );
// --> OD 2005-08-16 #i53320#
bool bGroupMembersNotPositioned( false );
@@ -234,7 +236,7 @@ SwDrawContact* SwDoc::GroupSelection( SdrView& rDrawView )
}
// <--
//ContactObjekte und Formate vernichten.
- for( USHORT i = 0; i < rMrkList.GetMarkCount(); ++i )
+ for( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i )
{
pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
SwDrawContact *pContact = (SwDrawContact*)GetUserCall(pObj);
@@ -297,14 +299,15 @@ SwDrawContact* SwDoc::GroupSelection( SdrView& rDrawView )
if( pUndo )
{
pUndo->SetGroupFmt( pFmt );
- ClearRedo();
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
}
}
else
{
- if ( DoesUndo() )
- ClearRedo();
+ if (GetIDocumentUndoRedo().DoesUndo())
+ {
+ GetIDocumentUndoRedo().ClearRedo();
+ }
rDrawView.GroupMarked();
ASSERT( rMrkList.GetMarkCount() == 1, "GroupMarked more or none groups." );
@@ -316,9 +319,11 @@ SwDrawContact* SwDoc::GroupSelection( SdrView& rDrawView )
void SwDoc::UnGroupSelection( SdrView& rDrawView )
{
- const int bUndo = DoesUndo();
+ bool const bUndo = GetIDocumentUndoRedo().DoesUndo();
if( bUndo )
- ClearRedo();
+ {
+ GetIDocumentUndoRedo().ClearRedo();
+ }
// OD 30.06.2003 #108784# - replace marked 'virtual' drawing objects by
// the corresponding 'master' drawing objects.
@@ -339,7 +344,7 @@ void SwDoc::UnGroupSelection( SdrView& rDrawView )
{
String sDrwFmtNm( String::CreateFromAscii(
RTL_CONSTASCII_STRINGPARAM("DrawObject" )));
- for ( USHORT i = 0; i < nMarkCount; ++i )
+ for ( sal_uInt16 i = 0; i < nMarkCount; ++i )
{
SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
if ( pObj->IsA( TYPE(SdrObjGroup) ) )
@@ -352,10 +357,10 @@ void SwDoc::UnGroupSelection( SdrView& rDrawView )
if( bUndo )
{
pUndo = new SwUndoDrawUnGroup( (SdrObjGroup*)pObj );
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
- for ( USHORT i2 = 0; i2 < pLst->GetObjCount(); ++i2 )
+ for ( sal_uInt16 i2 = 0; i2 < pLst->GetObjCount(); ++i2 )
{
SdrObject* pSubObj = pLst->GetObj( i2 );
SwDrawFrmFmt *pFmt = MakeDrawFrmFmt( sDrwFmtNm,
@@ -397,7 +402,7 @@ void SwDoc::UnGroupSelection( SdrView& rDrawView )
if( bUndo )
{
pUndo = new SwUndoDrawUnGroupConnectToLayout();
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
while ( pFmtsAndObjs[i].size() > 0 )
@@ -430,15 +435,15 @@ void SwDoc::UnGroupSelection( SdrView& rDrawView )
|*
|*************************************************************************/
-BOOL SwDoc::DeleteSelection( SwDrawView& rDrawView )
+sal_Bool SwDoc::DeleteSelection( SwDrawView& rDrawView )
{
- BOOL bCallBase = FALSE;
+ sal_Bool bCallBase = sal_False;
const SdrMarkList &rMrkList = rDrawView.GetMarkedObjectList();
if( rMrkList.GetMarkCount() )
{
- StartUndo(UNDO_EMPTY, NULL);
- USHORT i;
- BOOL bDelMarked = TRUE;
+ GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL);
+ sal_uInt16 i;
+ sal_Bool bDelMarked = sal_True;
if( 1 == rMrkList.GetMarkCount() )
{
@@ -450,7 +455,7 @@ BOOL SwDoc::DeleteSelection( SwDrawView& rDrawView )
if( pFrmFmt )
{
DelLayoutFmt( pFrmFmt );
- bDelMarked = FALSE;
+ bDelMarked = sal_False;
}
}
}
@@ -465,7 +470,7 @@ BOOL SwDoc::DeleteSelection( SwDrawView& rDrawView )
if( pFrmFmt &&
FLY_AS_CHAR == pFrmFmt->GetAnchor().GetAnchorId() )
{
- rDrawView.MarkObj( pObj, rDrawView.Imp().GetPageView(), TRUE );
+ rDrawView.MarkObj( pObj, rDrawView.Imp().GetPageView(), sal_True );
--i;
DelLayoutFmt( pFrmFmt );
}
@@ -477,8 +482,10 @@ BOOL SwDoc::DeleteSelection( SwDrawView& rDrawView )
SdrObject *pObj = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
if( !pObj->GetUpGroup() )
{
- SwUndoDrawDelete* pUndo = !DoesUndo() ? 0
- : new SwUndoDrawDelete( (USHORT)rMrkList.GetMarkCount() );
+ SwUndoDrawDelete *const pUndo =
+ (!GetIDocumentUndoRedo().DoesUndo())
+ ? 0
+ : new SwUndoDrawDelete( (sal_uInt16)rMrkList.GetMarkCount() );
//ContactObjekte vernichten, Formate sicherstellen.
for( i = 0; i < rMrkList.GetMarkCount(); ++i )
@@ -510,13 +517,15 @@ BOOL SwDoc::DeleteSelection( SwDrawView& rDrawView )
}
if( pUndo )
- AppendUndo( pUndo );
+ {
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
+ }
}
- bCallBase = TRUE;
+ bCallBase = sal_True;
}
SetModified();
- EndUndo(UNDO_EMPTY, NULL);
+ GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, NULL);
}
return bCallBase;
@@ -532,7 +541,7 @@ BOOL SwDoc::DeleteSelection( SwDrawView& rDrawView )
|*************************************************************************/
_ZSortFly::_ZSortFly( const SwFrmFmt* pFrmFmt, const SwFmtAnchor* pFlyAn,
- UINT32 nArrOrdNum )
+ sal_uInt32 nArrOrdNum )
: pFmt( pFrmFmt ), pAnchor( pFlyAn ), nOrdNum( nArrOrdNum )
{
// #i11176#
@@ -605,7 +614,7 @@ void SwDoc::InitDrawModel()
pSdrPool->SetPoolDefaultItem(SdrShadowXDistItem((300 * 72) / 127));
pSdrPool->SetPoolDefaultItem(SdrShadowYDistItem((300 * 72) / 127));
}
- SfxItemPool *pEEgPool = EditEngine::CreatePool( FALSE );
+ SfxItemPool *pEEgPool = EditEngine::CreatePool( sal_False );
pSdrPool->SetSecondaryPool( pEEgPool );
if ( !GetAttrPool().GetFrozenIdRanges () )
GetAttrPool().FreezeIdRanges();
@@ -620,7 +629,7 @@ void SwDoc::InitDrawModel()
//Seite.
pDrawModel = new SwDrawDocument( this );
- pDrawModel->EnableUndo( DoesUndo() );
+ pDrawModel->EnableUndo( GetIDocumentUndoRedo().DoesUndo() );
String sLayerNm;
sLayerNm.AssignAscii(RTL_CONSTASCII_STRINGPARAM("Hell" ));
@@ -645,8 +654,12 @@ void SwDoc::InitDrawModel()
nInvisibleControls = pDrawModel->GetLayerAdmin().NewLayer( sLayerNm )->GetID();
}
+<<<<<<< local
SdrPage* pMasterPage = pDrawModel->AllocPage( FALSE );
pDrawModel->InsertPage( pMasterPage );
+=======
+ pDrawModel->InsertPage( pDrawModel->AllocPage( sal_False ) );
+>>>>>>> other
RTL_LOGFILE_CONTEXT_TRACE( aLog, "after create DrawDocument" );
RTL_LOGFILE_CONTEXT_TRACE( aLog, "before create Spellchecker/Hyphenator" );
@@ -702,13 +715,13 @@ void SwDoc::NotifyInvisibleLayers( SdrPageView& _rSdrPageView )
{
String sLayerNm;
sLayerNm.AssignAscii(RTL_CONSTASCII_STRINGPARAM("InvisibleHell" ));
- _rSdrPageView.SetLayerVisible( sLayerNm, FALSE );
+ _rSdrPageView.SetLayerVisible( sLayerNm, sal_False );
sLayerNm.AssignAscii(RTL_CONSTASCII_STRINGPARAM("InvisibleHeaven" ));
- _rSdrPageView.SetLayerVisible( sLayerNm, FALSE );
+ _rSdrPageView.SetLayerVisible( sLayerNm, sal_False );
sLayerNm.AssignAscii(RTL_CONSTASCII_STRINGPARAM("InvisibleControls" ));
- _rSdrPageView.SetLayerVisible( sLayerNm, FALSE );
+ _rSdrPageView.SetLayerVisible( sLayerNm, sal_False );
}
/** method to determine, if a layer ID belongs to the visible ones.
@@ -911,7 +924,7 @@ IMPL_LINK(SwDoc, CalcFieldValueHdl, EditFieldInfo*, pInfo)
******************************************************************/
pInfo->SetRepresentation(
((const SvxDateField*) pField)->GetFormatted(
- *GetNumberFormatter( TRUE ), LANGUAGE_SYSTEM) );
+ *GetNumberFormatter( sal_True ), LANGUAGE_SYSTEM) );
}
else if (pField && pField->ISA(SvxURLField))
{
@@ -937,7 +950,7 @@ IMPL_LINK(SwDoc, CalcFieldValueHdl, EditFieldInfo*, pInfo)
break;
}
- USHORT nChrFmt;
+ sal_uInt16 nChrFmt;
if (IsVisitedURL(((const SvxURLField*)pField)->GetURL()))
nChrFmt = RES_POOLCHR_INET_VISIT;
@@ -966,7 +979,7 @@ IMPL_LINK(SwDoc, CalcFieldValueHdl, EditFieldInfo*, pInfo)
******************************************************************/
pInfo->SetRepresentation(
((const SvxExtTimeField*) pField)->GetFormatted(
- *GetNumberFormatter( TRUE ), LANGUAGE_SYSTEM) );
+ *GetNumberFormatter( sal_True ), LANGUAGE_SYSTEM) );
}
else
{
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index 30ad4316b13e..ef5ecb8c255c 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -48,6 +48,7 @@
#include <cntfrm.hxx> // fuers Spell
#include <crsrsh.hxx>
#include <doc.hxx>
+#include <UndoManager.hxx>
#include <docsh.hxx>
#include <docary.hxx>
#include <doctxm.hxx> // beim Move: Verzeichnisse korrigieren
@@ -63,7 +64,12 @@
#include <swtable.hxx>
#include <swundo.hxx> // fuer die UndoIds
#include <txtfrm.hxx>
-#include <undobj.hxx>
+#include <hints.hxx>
+#include <UndoSplitMove.hxx>
+#include <UndoRedline.hxx>
+#include <UndoOverwrite.hxx>
+#include <UndoInsert.hxx>
+#include <UndoDelete.hxx>
#include <breakit.hxx>
#include <hhcwrp.hxx>
#include <breakit.hxx>
@@ -463,8 +469,8 @@ bool lcl_SaveFtn( const SwNodeIndex& rSttNd, const SwNodeIndex& rEndNd,
if( pHints && pHints->HasFtn() ) //...with footnotes
{
bUpdateFtn = sal_True; // Heureka
- USHORT nCount = pHints->Count();
- for( USHORT i = 0; i < nCount; ++i )
+ sal_uInt16 nCount = pHints->Count();
+ for( sal_uInt16 i = 0; i < nCount; ++i )
{
SwTxtAttr *pAttr = pHints->GetTextHint( i );
if ( pAttr->Which() == RES_TXTATR_FTN )
@@ -773,8 +779,10 @@ bool SwDoc::Overwrite( const SwPaM &rRg, const String &rStr )
if(!pNode)
return sal_False;
- if( DoesUndo() )
- ClearRedo();
+ if (GetIDocumentUndoRedo().DoesUndo())
+ {
+ GetIDocumentUndoRedo().ClearRedo(); // AppendUndo not always called
+ }
sal_uInt16 nOldAttrCnt = pNode->GetpSwpHints()
? pNode->GetpSwpHints()->Count() : 0;
@@ -782,13 +790,11 @@ bool SwDoc::Overwrite( const SwPaM &rRg, const String &rStr )
SwIndex& rIdx = rPt.nContent;
xub_StrLen nStart = 0;
- sal_uInt16 nUndoSize = pUndos->Count();
- SwUndo * pUndo;
sal_Unicode c;
String aStr;
- BOOL bOldExpFlg = pNode->IsIgnoreDontExpand();
- pNode->SetIgnoreDontExpand( TRUE );
+ sal_Bool bOldExpFlg = pNode->IsIgnoreDontExpand();
+ pNode->SetIgnoreDontExpand( sal_True );
for( xub_StrLen nCnt = 0; nCnt < rStr.Len(); ++nCnt )
{
@@ -799,16 +805,24 @@ bool SwDoc::Overwrite( const SwPaM &rRg, const String &rStr )
lcl_SkipAttr( pNode, rIdx, nStart );
}
c = rStr.GetChar( nCnt );
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- if( DoesGroupUndo() && nUndoSize &&
- UNDO_OVERWRITE == ( pUndo = (*pUndos)[ nUndoSize-1 ])->GetId() &&
- ((SwUndoOverwrite*)pUndo)->CanGrouping( this, rPt, c ))
- ;// wenn CanGrouping() sal_True returnt, ist schon alles erledigt
- else
+ bool bMerged(false);
+ if (GetIDocumentUndoRedo().DoesGroupUndo())
+ {
+ SwUndo *const pUndo = GetUndoManager().GetLastUndo();
+ SwUndoOverwrite *const pUndoOW(
+ dynamic_cast<SwUndoOverwrite *>(pUndo) );
+ if (pUndoOW)
+ {
+ // if CanGrouping() returns true it's already merged
+ bMerged = pUndoOW->CanGrouping( this, rPt, c );
+ }
+ }
+ if (!bMerged)
{
- AppendUndo( new SwUndoOverwrite( this, rPt, c ));
- nUndoSize = pUndos->Count();
+ SwUndo *const pUndoOW( new SwUndoOverwrite(this, rPt, c) );
+ GetIDocumentUndoRedo().AppendUndo(pUndoOW);
}
}
else
@@ -835,7 +849,8 @@ bool SwDoc::Overwrite( const SwPaM &rRg, const String &rStr )
pNode->ModifyBroadcast( 0, &aHint, TYPE( SwCrsrShell ) );
}
- if( !DoesUndo() && !IsIgnoreRedline() && GetRedlineTbl().Count() )
+ if (!GetIDocumentUndoRedo().DoesUndo() &&
+ !IsIgnoreRedline() && GetRedlineTbl().Count())
{
SwPaM aPam( rPt.nNode, nStart, rPt.nNode, rPt.nContent.GetIndex() );
DeleteRedline( aPam, true, USHRT_MAX );
@@ -903,15 +918,13 @@ bool SwDoc::MoveRange( SwPaM& rPaM, SwPosition& rPos, SwMoveFlags eMvFlags )
// in a particular order, and presence of bookmarks
// will change this order. Hence, we delete bookmarks
// here without undo.
- BOOL bDoesUndo = DoesUndo();
- DoUndo( FALSE );
+ ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
_DelBookmarks(
pStt->nNode,
pEnd->nNode,
NULL,
&pStt->nContent,
&pEnd->nContent);
- DoUndo( bDoesUndo );
}
@@ -920,9 +933,9 @@ bool SwDoc::MoveRange( SwPaM& rPaM, SwPosition& rPos, SwMoveFlags eMvFlags )
// falls Undo eingeschaltet, erzeuge das UndoMove-Objekt
SwUndoMove * pUndoMove = 0;
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
+ GetIDocumentUndoRedo().ClearRedo();
pUndoMove = new SwUndoMove( rPaM, rPos );
pUndoMove->SetMoveRedlines( eMvFlags == DOC_MOVEREDLINES );
}
@@ -1019,7 +1032,7 @@ bool SwDoc::MoveRange( SwPaM& rPaM, SwPosition& rPos, SwMoveFlags eMvFlags )
rPaM.SetMark(); // um den neuen Bereich eine Sel. aufspannen
pTNd = aSavePam.GetNode()->GetTxtNode();
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
// korrigiere erstmal den Content vom SavePam
if( bNullCntnt )
@@ -1063,7 +1076,7 @@ bool SwDoc::MoveRange( SwPaM& rPaM, SwPosition& rPos, SwMoveFlags eMvFlags )
// zwischen SPoint und GetMark steht jetzt der neu eingefuegte Bereich
pUndoMove->SetDestRange( aSavePam, *rPaM.GetPoint(),
bJoin, bCorrSavePam );
- AppendUndo( pUndoMove );
+ GetIDocumentUndoRedo().AppendUndo( pUndoMove );
}
else
{
@@ -1146,11 +1159,15 @@ bool SwDoc::MoveNodeRange( SwNodeRange& rRange, SwNodeIndex& rPos,
SwFtnIdxs aTmpFntIdx;
SwUndoMove* pUndo = 0;
- if( (DOC_CREATEUNDOOBJ & eMvFlags ) && DoesUndo() )
+ if ((DOC_CREATEUNDOOBJ & eMvFlags ) && GetIDocumentUndoRedo().DoesUndo())
+ {
pUndo = new SwUndoMove( this, rRange, rPos );
+ }
else
+ {
bUpdateFtn = lcl_SaveFtn( rRange.aStart, rRange.aEnd, rPos,
GetFtnIdxs(), aTmpFntIdx );
+ }
_SaveRedlines aSaveRedl( 0, 4 );
SvPtrarr aSavRedlInsPosArr( 0, 4 );
@@ -1196,7 +1213,7 @@ bool SwDoc::MoveNodeRange( SwNodeRange& rRange, SwNodeIndex& rPos,
pSaveInsPos = new SwNodeIndex( rRange.aStart, -1 );
// verschiebe die Nodes
- BOOL bNoDelFrms = 0 != (DOC_NO_DELFRMS & eMvFlags);
+ sal_Bool bNoDelFrms = 0 != (DOC_NO_DELFRMS & eMvFlags);
if( GetNodes()._MoveNodes( rRange, GetNodes(), rPos, !bNoDelFrms ) )
{
aIdx++; // wieder auf alte Position
@@ -1240,9 +1257,8 @@ bool SwDoc::MoveNodeRange( SwNodeRange& rRange, SwNodeIndex& rPos,
if( pUndo )
{
- ClearRedo();
pUndo->SetDestRange( aIdx, rPos, *pSaveInsPos );
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
if( pSaveInsPos )
@@ -1265,7 +1281,7 @@ bool SwDoc::MoveNodeRange( SwNodeRange& rRange, SwNodeIndex& rPos,
/* #107318# Convert list of ranges of whichIds to a corresponding list
of whichIds*/
-SvUShorts * lcl_RangesToUShorts(USHORT * pRanges)
+SvUShorts * lcl_RangesToUShorts(sal_uInt16 * pRanges)
{
SvUShorts * pResult = new SvUShorts();
@@ -1274,7 +1290,7 @@ SvUShorts * lcl_RangesToUShorts(USHORT * pRanges)
{
ASSERT(pRanges[i+1] != 0, "malformed ranges");
- for (USHORT j = pRanges[i]; j < pRanges[i+1]; j++)
+ for (sal_uInt16 j = pRanges[i]; j < pRanges[i+1]; j++)
pResult->Insert(j, pResult->Count());
i += 2;
@@ -1353,8 +1369,7 @@ void lcl_JoinText( SwPaM& rPam, sal_Bool bJoinPrev )
// falls PageBreaks geloescht / gesetzt werden, darf das
// nicht in die Undo-History aufgenommen werden !!
// (das loeschen vom Node geht auch am Undo vorbei !!!)
- sal_Bool bDoUndo = pDoc->DoesUndo();
- pDoc->DoUndo( sal_False );
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
/* PageBreaks, PageDesc, ColumnBreaks */
// Sollte an der Logik zum Kopieren der PageBreak's ...
@@ -1406,8 +1421,6 @@ void lcl_JoinText( SwPaM& rPam, sal_Bool bJoinPrev )
if( aBkmkArr.Count() )
::_RestoreCntntIdx( pDoc, aBkmkArr, aIdx.GetIndex() );
- pDoc->DoUndo( bDoUndo );
-
// falls der uebergebene PaM nicht im Crsr-Ring steht,
// gesondert behandeln (z.B. Aufruf aus dem Auto-Format)
if( pOldTxtNd == rPam.GetBound( sal_True ).nContent.GetIdxReg() )
@@ -1547,21 +1560,19 @@ bool SwDoc::DeleteAndJoinWithRedlineImpl( SwPaM & rPam, const bool )
ASSERT( IsRedlineOn(), "DeleteAndJoinWithRedline: redline off" );
{
- sal_uInt16 nUndoSize = 0;
SwUndoRedlineDelete* pUndo = 0;
RedlineMode_t eOld = GetRedlineMode();
checkRedlining(eOld);
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
//JP 06.01.98: MUSS noch optimiert werden!!!
SetRedlineMode(
(RedlineMode_t)(nsRedlineMode_t::REDLINE_ON | nsRedlineMode_t::REDLINE_SHOW_INSERT | nsRedlineMode_t::REDLINE_SHOW_DELETE ));
- nUndoSize = pUndos->Count();
- StartUndo(UNDO_EMPTY, NULL);
- AppendUndo( pUndo = new SwUndoRedlineDelete( rPam, UNDO_DELETE ));
+ GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL);
+ pUndo = new SwUndoRedlineDelete( rPam, UNDO_DELETE );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
if( *rPam.GetPoint() != *rPam.GetMark() )
AppendRedline( new SwRedline( nsRedlineType_t::REDLINE_DELETE, rPam ), true);
@@ -1569,18 +1580,29 @@ bool SwDoc::DeleteAndJoinWithRedlineImpl( SwPaM & rPam, const bool )
if( pUndo )
{
- EndUndo(UNDO_EMPTY, NULL);
- SwUndo* pPrevUndo;
- if( nUndoSize && DoesGroupUndo() &&
- nUndoSize + 1 == pUndos->Count() &&
- UNDO_REDLINE == ( pPrevUndo = (*pUndos)[ nUndoSize-1 ])->GetId() &&
- UNDO_DELETE == ((SwUndoRedline*)pPrevUndo)->GetUserId() &&
- ((SwUndoRedlineDelete*)pPrevUndo)->CanGrouping( *pUndo ))
+ GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, NULL);
+ // ??? why the hell is the AppendUndo not below the
+ // CanGrouping, so this hideous cleanup wouldn't be necessary?
+ // bah, this is redlining, probably changing this would break it...
+ if (GetIDocumentUndoRedo().DoesGroupUndo())
{
- DoUndo( sal_False );
- pUndos->DeleteAndDestroy( nUndoSize, 1 );
- --nUndoPos, --nUndoCnt;
- DoUndo( sal_True );
+ SwUndo *const pLastUndo( GetUndoManager().GetLastUndo() );
+ SwUndoRedlineDelete *const pUndoRedlineDel(
+ dynamic_cast<SwUndoRedlineDelete*>(pLastUndo) );
+ if (pUndoRedlineDel)
+ {
+ bool const bMerged = pUndoRedlineDel->CanGrouping(*pUndo);
+ if (bMerged)
+ {
+ ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
+ SwUndo const*const pDeleted =
+ GetUndoManager().RemoveLastUndo();
+ OSL_ENSURE(pDeleted == pUndo,
+ "DeleteAndJoinWithRedlineImpl: "
+ "undo removed is not undo inserted?");
+ delete pDeleted;
+ }
+ }
}
//JP 06.01.98: MUSS noch optimiert werden!!!
SetRedlineMode( eOld );
@@ -1677,17 +1699,25 @@ bool SwDoc::DeleteRangeImplImpl(SwPaM & rPam)
}
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- sal_uInt16 nUndoSize = pUndos->Count();
- SwUndo * pUndo;
- if( DoesGroupUndo() && nUndoSize-- &&
- UNDO_DELETE == ( pUndo = (*pUndos)[ nUndoSize ])->GetId() &&
- ((SwUndoDelete*)pUndo)->CanGrouping( this, rPam ))
- ;// wenn CanGrouping() sal_True returnt, ist schon alles erledigt
- else
- AppendUndo( new SwUndoDelete( rPam ) );
+ GetIDocumentUndoRedo().ClearRedo();
+ bool bMerged(false);
+ if (GetIDocumentUndoRedo().DoesGroupUndo())
+ {
+ SwUndo *const pLastUndo( GetUndoManager().GetLastUndo() );
+ SwUndoDelete *const pUndoDelete(
+ dynamic_cast<SwUndoDelete *>(pLastUndo) );
+ if (pUndoDelete)
+ {
+ bMerged = pUndoDelete->CanGrouping( this, rPam );
+ // if CanGrouping() returns true it's already merged
+ }
+ }
+ if (!bMerged)
+ {
+ GetIDocumentUndoRedo().AppendUndo( new SwUndoDelete( rPam ) );
+ }
SetModified();
@@ -1832,7 +1862,7 @@ void lcl_syncGrammarError( SwTxtNode &rTxtNode, linguistic2::ProofreadingResult&
return;
SwGrammarMarkUp* pWrong = rTxtNode.GetGrammarCheck();
linguistic2::SingleProofreadingError* pArray = rResult.aErrors.getArray();
- USHORT i, j = 0;
+ sal_uInt16 i, j = 0;
if( pWrong )
{
for( i = 0; i < rResult.aErrors.getLength(); ++i )
@@ -1873,8 +1903,8 @@ uno::Any SwDoc::Spell( SwPaM& rPaM,
pEndPos->nNode.GetNode().GetTxtNode(), pEndPos->nContent,
bGrammarCheck );
- ULONG nCurrNd = pSttPos->nNode.GetIndex();
- ULONG nEndNd = pEndPos->nNode.GetIndex();
+ sal_uLong nCurrNd = pSttPos->nNode.GetIndex();
+ sal_uLong nEndNd = pEndPos->nNode.GetIndex();
uno::Any aRet;
if( nCurrNd <= nEndNd )
@@ -2207,7 +2237,7 @@ bool SwDoc::ReplaceRange( SwPaM& rPam, const String& rStr,
::std::vector<xub_StrLen> Breaks;
SwPaM aPam( *rPam.GetMark(), *rPam.GetPoint() );
- aPam.Normalize(FALSE);
+ aPam.Normalize(sal_False);
if (aPam.GetPoint()->nNode != aPam.GetMark()->nNode)
{
aPam.Move(fnMoveBackward);
@@ -2310,9 +2340,9 @@ bool SwDoc::ReplaceRangeImpl( SwPaM& rPam, const String& rStr,
{
RedlineMode_t eOld = GetRedlineMode();
checkRedlining(eOld);
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- StartUndo(UNDO_EMPTY, NULL);
+ GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL);
// Bug 68584 - if any Redline will change (split!) the node
const ::sw::mark::IMark* pBkmk = getIDocumentMarkAccess()->makeMark( aDelPam, ::rtl::OUString(), IDocumentMarkAccess::UNO_BOOKMARK );
@@ -2392,15 +2422,19 @@ bool SwDoc::ReplaceRangeImpl( SwPaM& rPam, const String& rStr,
InsertItemSet( aTmpRange, aSet, 0 );
}
- if( DoesUndo() )
- AppendUndo( new SwUndoRedlineDelete( aDelPam, UNDO_REPLACE ));
+ if (GetIDocumentUndoRedo().DoesUndo())
+ {
+ SwUndo *const pUndoRD =
+ new SwUndoRedlineDelete( aDelPam, UNDO_REPLACE );
+ GetIDocumentUndoRedo().AppendUndo(pUndoRD);
+ }
AppendRedline( new SwRedline( nsRedlineType_t::REDLINE_DELETE, aDelPam ), true);
*rPam.GetMark() = *aDelPam.GetMark();
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
*aDelPam.GetPoint() = *rPam.GetPoint();
- EndUndo(UNDO_EMPTY, NULL);
+ GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, NULL);
// Bug 68584 - if any Redline will change (split!) the node
const ::sw::mark::IMark* pBkmk = getIDocumentMarkAccess()->makeMark( aDelPam, ::rtl::OUString(), IDocumentMarkAccess::UNO_BOOKMARK );
@@ -2427,21 +2461,13 @@ SetRedlineMode( eOld );
DeleteRedline( aDelPam, true, USHRT_MAX );
SwUndoReplace* pUndoRpl = 0;
- if( DoesUndo() )
+ bool const bDoesUndo = GetIDocumentUndoRedo().DoesUndo();
+ if (bDoesUndo)
{
- ClearRedo();
- SwUndo* pU;
-
- if( !pUndos->Count() ||
- UNDO_REPLACE != ( pU = (*pUndos)[ pUndos->Count()-1 ])->GetId() ||
- ( pUndoRpl = (SwUndoReplace*)pU )->IsFull() )
- {
- pUndoRpl = new SwUndoReplace();
- AppendUndo( pUndoRpl );
- }
- pUndoRpl->AddEntry( aDelPam, sRepl, bRegExReplace );
- DoUndo( sal_False );
+ pUndoRpl = new SwUndoReplace(aDelPam, sRepl, bRegExReplace);
+ GetIDocumentUndoRedo().AppendUndo(pUndoRpl);
}
+ ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
if( aDelPam.GetPoint() != pStt )
aDelPam.Exchange();
@@ -2494,8 +2520,7 @@ SetRedlineMode( eOld );
if( pUndoRpl )
{
- pUndoRpl->SetEntryEnd( rPam );
- DoUndo( sal_True );
+ pUndoRpl->SetEnd(rPam);
}
}
}
@@ -2526,16 +2551,18 @@ bool SwDoc::DelFullPara( SwPaM& rPam )
if ( nSectDiff-2 <= nNodeDiff || IsRedlineOn() ||
/* #i9185# Prevent getting the node after the end node (see below) */
- rEnd.nNode.GetIndex() + 1 == aNodes.Count() )
+ rEnd.nNode.GetIndex() + 1 == GetNodes().Count() )
+ {
return sal_False;
+ }
// harte SeitenUmbrueche am nachfolgenden Node verschieben
sal_Bool bSavePageBreak = sal_False, bSavePageDesc = sal_False;
/* #i9185# This whould lead to a segmentation fault if not catched
above. */
- ULONG nNextNd = rEnd.nNode.GetIndex() + 1;
- SwTableNode* pTblNd = aNodes[ nNextNd ]->GetTableNode();
+ sal_uLong nNextNd = rEnd.nNode.GetIndex() + 1;
+ SwTableNode *const pTblNd = GetNodes()[ nNextNd ]->GetTableNode();
if( pTblNd && pNd->IsCntntNode() )
{
@@ -2564,7 +2591,7 @@ bool SwDoc::DelFullPara( SwPaM& rPam )
}
}
- sal_Bool bDoesUndo = DoesUndo();
+ bool const bDoesUndo = GetIDocumentUndoRedo().DoesUndo();
if( bDoesUndo )
{
if( !rPam.HasMark() )
@@ -2579,7 +2606,7 @@ bool SwDoc::DelFullPara( SwPaM& rPam )
pTmpNode = rPam.GetMark()->nNode.GetNode().GetCntntNode();
rPam.GetMark()->nContent.Assign( pTmpNode, 0 );
- ClearRedo();
+ GetIDocumentUndoRedo().ClearRedo();
SwPaM aDelPam( *rPam.GetMark(), *rPam.GetPoint() );
{
@@ -2596,7 +2623,7 @@ bool SwDoc::DelFullPara( SwPaM& rPam )
*rPam.GetPoint() = *aDelPam.GetPoint();
pUndo->SetPgBrkFlags( bSavePageBreak, bSavePageDesc );
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
else
{
@@ -2637,10 +2664,10 @@ bool SwDoc::DelFullPara( SwPaM& rPam )
}
}
- SwCntntNode *pTmpNode = rPam.GetBound( TRUE ).nNode.GetNode().GetCntntNode();
- rPam.GetBound( TRUE ).nContent.Assign( pTmpNode, 0 );
- pTmpNode = rPam.GetBound( FALSE ).nNode.GetNode().GetCntntNode();
- rPam.GetBound( FALSE ).nContent.Assign( pTmpNode, 0 );
+ SwCntntNode *pTmpNode = rPam.GetBound( sal_True ).nNode.GetNode().GetCntntNode();
+ rPam.GetBound( sal_True ).nContent.Assign( pTmpNode, 0 );
+ pTmpNode = rPam.GetBound( sal_False ).nNode.GetNode().GetCntntNode();
+ rPam.GetBound( sal_False ).nContent.Assign( pTmpNode, 0 );
GetNodes().Delete( aRg.aStart, nNodeDiff+1 );
}
rPam.DeleteMark();
@@ -2654,15 +2681,13 @@ void SwDoc::TransliterateText(
const SwPaM& rPaM,
utl::TransliterationWrapper& rTrans )
{
- SwUndoTransliterate* pUndo;
- if( DoesUndo() )
- pUndo = new SwUndoTransliterate( rPaM, rTrans );
- else
- pUndo = 0;
+ SwUndoTransliterate *const pUndo = (GetIDocumentUndoRedo().DoesUndo())
+ ? new SwUndoTransliterate( rPaM, rTrans )
+ : 0;
const SwPosition* pStt = rPaM.Start(),
* pEnd = rPaM.End();
- ULONG nSttNd = pStt->nNode.GetIndex(),
+ sal_uLong nSttNd = pStt->nNode.GetIndex(),
nEndNd = pEnd->nNode.GetIndex();
xub_StrLen nSttCnt = pStt->nContent.GetIndex(),
nEndCnt = pEnd->nContent.GetIndex();
@@ -2678,7 +2703,7 @@ void SwDoc::TransliterateText(
pTNd->GetTxt(), nSttCnt,
pBreakIt->GetLocale( pTNd->GetLang( nSttCnt ) ),
WordType::ANY_WORD /*ANYWORD_IGNOREWHITESPACES*/,
- TRUE );
+ sal_True );
if( aBndry.startPos < nSttCnt && nSttCnt < aBndry.endPos )
{
@@ -2716,8 +2741,7 @@ void SwDoc::TransliterateText(
{
if( pUndo->HasData() )
{
- ClearRedo();
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
else
delete pUndo;
@@ -2737,7 +2761,7 @@ void SwDoc::checkRedlining(RedlineMode_t& _rReadlineMode)
&& !((_rReadlineMode & nsRedlineMode_t::REDLINE_SHOW_DELETE) == nsRedlineMode_t::REDLINE_SHOW_DELETE) )
{
WarningBox aWarning( pParent,SW_RES(MSG_DISABLE_READLINE_QUESTION));
- USHORT nResult = aWarning.Execute();
+ sal_uInt16 nResult = aWarning.Execute();
mbReadlineChecked = sal_True;
if ( nResult == RET_YES )
{
@@ -2756,8 +2780,8 @@ void SwDoc::CountWords( const SwPaM& rPaM, SwDocStat& rStat ) const
const SwPosition* pEnd = pStt == rPaM.GetPoint() ? rPaM.GetMark()
: rPaM.GetPoint();
- const ULONG nSttNd = pStt->nNode.GetIndex();
- const ULONG nEndNd = pEnd->nNode.GetIndex();
+ const sal_uLong nSttNd = pStt->nNode.GetIndex();
+ const sal_uLong nEndNd = pEnd->nNode.GetIndex();
const xub_StrLen nSttCnt = pStt->nContent.GetIndex();
const xub_StrLen nEndCnt = pEnd->nContent.GetIndex();
diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx
index d7de1c800d48..67d14f505fb9 100644
--- a/sw/source/core/doc/docfld.cxx
+++ b/sw/source/core/doc/docfld.cxx
@@ -43,6 +43,7 @@
#include <unotools/charclass.hxx>
#include <unotools/transliterationwrapper.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <cntfrm.hxx>
#include <pam.hxx>
#include <ndtxt.hxx>
@@ -69,17 +70,15 @@
#include <authfld.hxx>
#include <txtinet.hxx>
#include <fmtcntnt.hxx>
-#ifndef _POOLFMT_HRC
#include <poolfmt.hrc> // fuer InitFldTypes
-#endif
#include <SwUndoField.hxx>
#include "switerator.hxx"
using namespace ::com::sun::star::uno;
-extern BOOL IsFrameBehind( const SwTxtNode& rMyNd, USHORT nMySttPos,
- const SwTxtNode& rBehindNd, USHORT nSttPos );
+extern sal_Bool IsFrameBehind( const SwTxtNode& rMyNd, sal_uInt16 nMySttPos,
+ const SwTxtNode& rBehindNd, sal_uInt16 nSttPos );
SV_IMPL_OP_PTRARR_SORT( _SetGetExpFlds, _SetGetExpFldPtr )
@@ -95,10 +94,10 @@ SV_IMPL_OP_PTRARR_SORT( _SetGetExpFlds, _SetGetExpFldPtr )
SwFieldType* SwDoc::InsertFldType(const SwFieldType &rFldTyp)
{
- USHORT nSize = pFldTypes->Count(),
+ sal_uInt16 nSize = pFldTypes->Count(),
nFldWhich = rFldTyp.Which();
- USHORT i = INIT_FLDTYPES;
+ sal_uInt16 i = INIT_FLDTYPES;
switch( nFldWhich )
{
@@ -175,8 +174,8 @@ void SwDoc::InsDeletedFldType( SwFieldType& rFldTyp )
// - Wird genau der gleiche Typ gefunden, dann muss der geloeschte
// einen anderen Namen erhalten.
- USHORT nSize = pFldTypes->Count(), nFldWhich = rFldTyp.Which();
- USHORT i = INIT_FLDTYPES;
+ sal_uInt16 nSize = pFldTypes->Count(), nFldWhich = rFldTyp.Which();
+ sal_uInt16 i = INIT_FLDTYPES;
ASSERT( RES_SETEXPFLD == nFldWhich ||
RES_USERFLD == nFldWhich ||
@@ -191,7 +190,7 @@ void SwDoc::InsDeletedFldType( SwFieldType& rFldTyp )
rSCmp.isEqual( rFldNm, pFnd->GetName() ) )
{
// neuen Namen suchen
- USHORT nNum = 1;
+ sal_uInt16 nNum = 1;
do {
String sSrch( rFldNm );
sSrch.Append( String::CreateFromInt32( nNum ));
@@ -206,7 +205,7 @@ void SwDoc::InsDeletedFldType( SwFieldType& rFldTyp )
break; // raus aus der While-Schleife
}
++nNum;
- } while( TRUE );
+ } while( sal_True );
break;
}
@@ -215,13 +214,13 @@ void SwDoc::InsDeletedFldType( SwFieldType& rFldTyp )
switch( nFldWhich )
{
case RES_SETEXPFLD:
- ((SwSetExpFieldType&)rFldTyp).SetDeleted( FALSE );
+ ((SwSetExpFieldType&)rFldTyp).SetDeleted( sal_False );
break;
case RES_USERFLD:
- ((SwUserFieldType&)rFldTyp).SetDeleted( FALSE );
+ ((SwUserFieldType&)rFldTyp).SetDeleted( sal_False );
break;
case RES_DDEFLD:
- ((SwDDEFieldType&)rFldTyp).SetDeleted( FALSE );
+ ((SwDDEFieldType&)rFldTyp).SetDeleted( sal_False );
break;
}
}
@@ -230,19 +229,19 @@ void SwDoc::InsDeletedFldType( SwFieldType& rFldTyp )
Beschreibung: Feldtypen loeschen
--------------------------------------------------------------------*/
-void SwDoc::RemoveFldType(USHORT nFld)
+void SwDoc::RemoveFldType(sal_uInt16 nFld)
{
ASSERT( INIT_FLDTYPES <= nFld, "keine InitFields loeschen" );
/*
* Abheangige Felder vorhanden -> ErrRaise
*/
- USHORT nSize = pFldTypes->Count();
+ sal_uInt16 nSize = pFldTypes->Count();
if(nFld < nSize)
{
SwFieldType* pTmp = (*pFldTypes)[nFld];
// JP 29.07.96: opt. FeldListe fuer den Calculator vorbereiten:
- USHORT nWhich = pTmp->Which();
+ sal_uInt16 nWhich = pTmp->Which();
switch( nWhich )
{
case RES_SETEXPFLD:
@@ -253,11 +252,11 @@ void SwDoc::RemoveFldType(USHORT nFld)
if( pTmp->GetDepends() && !IsUsed( *pTmp ) )
{
if( RES_SETEXPFLD == nWhich )
- ((SwSetExpFieldType*)pTmp)->SetDeleted( TRUE );
+ ((SwSetExpFieldType*)pTmp)->SetDeleted( sal_True );
else if( RES_USERFLD == nWhich )
- ((SwUserFieldType*)pTmp)->SetDeleted( TRUE );
+ ((SwUserFieldType*)pTmp)->SetDeleted( sal_True );
else
- ((SwDDEFieldType*)pTmp)->SetDeleted( TRUE );
+ ((SwDDEFieldType*)pTmp)->SetDeleted( sal_True );
nWhich = 0;
}
break;
@@ -283,13 +282,13 @@ const SwFldTypes* SwDoc::GetFldTypes() const
Beschreibung: Den ersten Typen mit ResId und Namen finden
--------------------------------------------------------------------*/
-SwFieldType* SwDoc::GetFldType( USHORT nResId, const String& rName,
+SwFieldType* SwDoc::GetFldType( sal_uInt16 nResId, const String& rName,
bool bDbFieldMatching // used in some UNO calls for RES_DBFLD
// to use different string matching code
// #i51815#
) const
{
- USHORT nSize = pFldTypes->Count(), i = 0;
+ sal_uInt16 nSize = pFldTypes->Count(), i = 0;
const ::utl::TransliterationWrapper& rSCmp = GetAppCmpStrIgnore();
switch( nResId )
@@ -344,7 +343,7 @@ void SwDoc::UpdateFlds( SfxPoolItem *pNewHt, bool bCloseDB )
// Modify() fuer jeden Feldtypen rufen,
// abhaengige SwTxtFld werden benachrichtigt ...
- for( USHORT i=0; i < pFldTypes->Count(); ++i)
+ for( sal_uInt16 i=0; i < pFldTypes->Count(); ++i)
{
switch( (*pFldTypes)[i]->Which() )
{
@@ -381,7 +380,7 @@ void SwDoc::UpdateFlds( SfxPoolItem *pNewHt, bool bCloseDB )
}
if( !IsExpFldsLocked() )
- UpdateExpFlds( 0, FALSE ); // Expression-Felder Updaten
+ UpdateExpFlds( 0, sal_False ); // Expression-Felder Updaten
// Tabellen
UpdateTblFlds(pNewHt);
@@ -404,7 +403,7 @@ void SwDoc::UpdateUsrFlds()
{
SwCalc* pCalc = 0;
const SwFieldType* pFldType;
- for( USHORT i = INIT_FLDTYPES; i < pFldTypes->Count(); ++i )
+ for( sal_uInt16 i = INIT_FLDTYPES; i < pFldTypes->Count(); ++i )
if( RES_USERFLD == ( pFldType = (*pFldTypes)[i] )->Which() )
{
if( !pCalc )
@@ -426,7 +425,7 @@ void SwDoc::UpdateUsrFlds()
void SwDoc::UpdateRefFlds( SfxPoolItem* pHt )
{
SwFieldType* pFldType;
- for( USHORT i = 0; i < pFldTypes->Count(); ++i )
+ for( sal_uInt16 i = 0; i < pFldTypes->Count(); ++i )
if( RES_GETREFFLD == ( pFldType = (*pFldTypes)[i] )->Which() )
pFldType->ModifyNotification( 0, pHt );
}
@@ -438,7 +437,7 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt )
SwFieldType* pFldType(0);
- for (USHORT i = 0; i < pFldTypes->Count(); ++i)
+ for (sal_uInt16 i = 0; i < pFldTypes->Count(); ++i)
{
if( RES_TABLEFLD == ( pFldType = (*pFldTypes)[i] )->Which() )
{
@@ -471,7 +470,7 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt )
if( nsSwExtendedSubType::SUB_CMD & pFld->GetSubType() )
pFld->PtrToBoxNm( pUpdtFld->pTbl );
else
- pFld->ChgValid( FALSE );
+ pFld->ChgValid( sal_False );
break;
case TBL_BOXNAME:
// ist es die gesuchte Tabelle ??
@@ -497,7 +496,7 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt )
}
else
// setze bei allen das Value-Flag zurueck
- pFld->ChgValid( FALSE );
+ pFld->ChgValid( sal_False );
}
}
@@ -695,7 +694,7 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt )
void SwDoc::UpdatePageFlds( SfxPoolItem* pMsgHnt )
{
SwFieldType* pFldType;
- for( USHORT i = 0; i < INIT_FLDTYPES; ++i )
+ for( sal_uInt16 i = 0; i < INIT_FLDTYPES; ++i )
switch( ( pFldType = (*pFldTypes)[ i ] )->Which() )
{
case RES_PAGENUMBERFLD:
@@ -718,7 +717,7 @@ void SwDoc::UpdatePageFlds( SfxPoolItem* pMsgHnt )
// ---- Loesche alle nicht referenzierten FeldTypen eines Dokumentes --
void SwDoc::GCFieldTypes()
{
- for( USHORT n = pFldTypes->Count(); n > INIT_FLDTYPES; )
+ for( sal_uInt16 n = pFldTypes->Count(); n > INIT_FLDTYPES; )
if( !(*pFldTypes)[ --n ]->GetDepends() )
RemoveFldType( n );
}
@@ -911,19 +910,19 @@ void _SetGetExpFld::SetBodyPos( const SwCntntFrm& rFrm )
}
}
-BOOL _SetGetExpFld::operator<( const _SetGetExpFld& rFld ) const
+sal_Bool _SetGetExpFld::operator<( const _SetGetExpFld& rFld ) const
{
if( nNode < rFld.nNode || ( nNode == rFld.nNode && nCntnt < rFld.nCntnt ))
- return TRUE;
+ return sal_True;
else if( nNode != rFld.nNode || nCntnt != rFld.nCntnt )
- return FALSE;
+ return sal_False;
const SwNode *pFirst = GetNodeFromCntnt(),
*pNext = rFld.GetNodeFromCntnt();
// Position gleich: nur weiter wenn beide FeldPointer besetzt sind !!
if( !pFirst || !pNext )
- return FALSE;
+ return sal_False;
// gleiche Section ??
if( pFirst->StartOfSectionNode() != pNext->StartOfSectionNode() )
@@ -1007,7 +1006,7 @@ const SwNode* _SetGetExpFld::GetNodeFromCntnt() const
xub_StrLen _SetGetExpFld::GetCntPosFromCntnt() const
{
- USHORT nRet = 0;
+ sal_uInt16 nRet = 0;
if( CNTNT.pTxtFld )
switch( eSetGetExpFldType )
{
@@ -1034,8 +1033,8 @@ _HashStr::_HashStr( const String& rName, const String& rText,
// suche nach dem Namen, ist er vorhanden, returne seinen String, sonst
// einen LeerString
-void LookString( SwHash** ppTbl, USHORT nSize, const String& rName,
- String& rRet, USHORT* pPos )
+void LookString( SwHash** ppTbl, sal_uInt16 nSize, const String& rName,
+ String& rRet, sal_uInt16* pPos )
{
rRet = rName;
rRet.EraseLeadingChars().EraseTrailingChars();
@@ -1080,7 +1079,7 @@ void lcl_CalcFld( SwDoc& rDoc, SwCalc& rCalc, const _SetGetExpFld& rSGEFld,
return ;
const SwField* pFld = pTxtFld->GetFld().GetFld();
- const USHORT nFldWhich = pFld->GetTyp()->Which();
+ const sal_uInt16 nFldWhich = pFld->GetTyp()->Which();
if( RES_SETEXPFLD == nFldWhich )
{
@@ -1133,38 +1132,38 @@ void SwDoc::FldsToCalc( SwCalc& rCalc, const _SetGetExpFld& rToThisFld )
{
// erzeuge die Sortierteliste aller SetFelder
pUpdtFlds->MakeFldList( *this, mbNewFldLst, GETFLD_CALC );
- mbNewFldLst = FALSE;
+ mbNewFldLst = sal_False;
SwNewDBMgr* pMgr = GetNewDBMgr();
- pMgr->CloseAll(FALSE);
+ pMgr->CloseAll(sal_False);
if( pUpdtFlds->GetSortLst()->Count() )
{
- USHORT nLast;
+ sal_uInt16 nLast;
_SetGetExpFld* pFld = (_SetGetExpFld*)&rToThisFld;
if( pUpdtFlds->GetSortLst()->Seek_Entry( pFld, &nLast ) )
++nLast;
const _SetGetExpFldPtr* ppSortLst = pUpdtFlds->GetSortLst()->GetData();
- for( USHORT n = 0; n < nLast; ++n, ++ppSortLst )
+ for( sal_uInt16 n = 0; n < nLast; ++n, ++ppSortLst )
lcl_CalcFld( *this, rCalc, **ppSortLst, pMgr );
}
- pMgr->CloseAll(FALSE);
+ pMgr->CloseAll(sal_False);
}
-void SwDoc::FldsToCalc( SwCalc& rCalc, ULONG nLastNd, sal_uInt16 nLastCnt )
+void SwDoc::FldsToCalc( SwCalc& rCalc, sal_uLong nLastNd, sal_uInt16 nLastCnt )
{
// erzeuge die Sortierteliste aller SetFelder
pUpdtFlds->MakeFldList( *this, mbNewFldLst, GETFLD_CALC );
- mbNewFldLst = FALSE;
+ mbNewFldLst = sal_False;
SwNewDBMgr* pMgr = GetNewDBMgr();
- pMgr->CloseAll(FALSE);
+ pMgr->CloseAll(sal_False);
const _SetGetExpFldPtr* ppSortLst = pUpdtFlds->GetSortLst()->GetData();
- for( USHORT n = pUpdtFlds->GetSortLst()->Count();
+ for( sal_uInt16 n = pUpdtFlds->GetSortLst()->Count();
n &&
( (*ppSortLst)->GetNode() < nLastNd ||
( (*ppSortLst)->GetNode() == nLastNd && (*ppSortLst)->GetCntnt() <= nLastCnt )
@@ -1172,15 +1171,15 @@ void SwDoc::FldsToCalc( SwCalc& rCalc, ULONG nLastNd, sal_uInt16 nLastCnt )
--n, ++ppSortLst )
lcl_CalcFld( *this, rCalc, **ppSortLst, pMgr );
- pMgr->CloseAll(FALSE);
+ pMgr->CloseAll(sal_False);
}
-void SwDoc::FldsToExpand( SwHash**& ppHashTbl, USHORT& rTblSize,
+void SwDoc::FldsToExpand( SwHash**& ppHashTbl, sal_uInt16& rTblSize,
const _SetGetExpFld& rToThisFld )
{
// erzeuge die Sortierteliste aller SetFelder
pUpdtFlds->MakeFldList( *this, mbNewFldLst, GETFLD_EXPAND );
- mbNewFldLst = FALSE;
+ mbNewFldLst = sal_False;
// HashTabelle fuer alle String Ersetzungen, wird "one the fly" gefuellt
// (versuche eine "ungerade"-Zahl zu erzeugen)
@@ -1188,14 +1187,14 @@ void SwDoc::FldsToExpand( SwHash**& ppHashTbl, USHORT& rTblSize,
ppHashTbl = new SwHash*[ rTblSize ];
memset( ppHashTbl, 0, sizeof( _HashStr* ) * rTblSize );
- USHORT nLast;
+ sal_uInt16 nLast;
{
_SetGetExpFld* pTmp = (_SetGetExpFld*)&rToThisFld;
if( pUpdtFlds->GetSortLst()->Seek_Entry( pTmp, &nLast ) )
++nLast;
}
- USHORT nPos;
+ sal_uInt16 nPos;
SwHash* pFnd;
String aNew;
const _SetGetExpFldPtr* ppSortLst = pUpdtFlds->GetSortLst()->GetData();
@@ -1267,11 +1266,11 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds )
if( IsExpFldsLocked() || IsInReading() )
return;
- BOOL bOldInUpdateFlds = pUpdtFlds->IsInUpdateFlds();
- pUpdtFlds->SetInUpdateFlds( TRUE );
+ sal_Bool bOldInUpdateFlds = pUpdtFlds->IsInUpdateFlds();
+ pUpdtFlds->SetInUpdateFlds( sal_True );
- pUpdtFlds->MakeFldList( *this, TRUE, GETFLD_ALL );
- mbNewFldLst = FALSE;
+ pUpdtFlds->MakeFldList( *this, sal_True, GETFLD_ALL );
+ mbNewFldLst = sal_False;
if( !pUpdtFlds->GetSortLst()->Count() )
{
@@ -1279,15 +1278,15 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds )
UpdateRefFlds(NULL);
pUpdtFlds->SetInUpdateFlds( bOldInUpdateFlds );
- pUpdtFlds->SetFieldsDirty( FALSE );
+ pUpdtFlds->SetFieldsDirty( sal_False );
return ;
}
- USHORT nWhich, n;
+ sal_uInt16 nWhich, n;
// HashTabelle fuer alle String Ersetzungen, wird "one the fly" gefuellt
// (versuche eine "ungerade"-Zahl zu erzeugen)
- USHORT nStrFmtCnt = (( pFldTypes->Count() / 7 ) + 1 ) * 7;
+ sal_uInt16 nStrFmtCnt = (( pFldTypes->Count() / 7 ) + 1 ) * 7;
SwHash** pHashStrTbl = new SwHash*[ nStrFmtCnt ];
memset( pHashStrTbl, 0, sizeof( _HashStr* ) * nStrFmtCnt );
@@ -1300,7 +1299,7 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds )
case RES_USERFLD:
{
// Eintrag vorhanden ?
- USHORT nPos;
+ sal_uInt16 nPos;
const String& rNm = pFldType->GetName();
String sExpand(((SwUserFieldType*)pFldType)->Expand(nsSwGetSetExpType::GSE_STRING, 0, 0));
SwHash* pFnd = Find( rNm, pHashStrTbl, nStrFmtCnt, &nPos );
@@ -1326,9 +1325,9 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds )
// aktuelle Datensatznummer schon vorher einstellen
SwNewDBMgr* pMgr = GetNewDBMgr();
- pMgr->CloseAll(FALSE);
+ pMgr->CloseAll(sal_False);
/*
- if(pMgr && pMgr->OpenDB(DBMGR_STD, GetDBDesc(), FALSE))
+ if(pMgr && pMgr->OpenDB(DBMGR_STD, GetDBDesc(), sal_False))
{
if(!pMgr->IsInMerge() )
pMgr->ToFirstSelectedRecord(DBMGR_STD);
@@ -1418,7 +1417,7 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds )
// Eintrag in den HashTable eintragen
// Eintrag vorhanden ?
- USHORT nPos;
+ sal_uInt16 nPos;
SwHash* pFnd = Find( rName, pHashStrTbl, nStrFmtCnt, &nPos );
String const value(pFld->ExpandField(IsClipBoard()));
if( pFnd )
@@ -1468,7 +1467,7 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds )
// suche den Namen vom Feld
aNew = ((SwSetExpFieldType*)pSFld->GetTyp())->GetSetRefName();
// Eintrag vorhanden ?
- USHORT nPos;
+ sal_uInt16 nPos;
SwHash* pFnd = Find( aNew, pHashStrTbl, nStrFmtCnt, &nPos );
if( pFnd )
// Eintrag in der HashTabelle aendern
@@ -1510,7 +1509,7 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds )
if( pSFld->IsSequenceFld() )
{
- const BYTE nLvl = pSFldTyp->GetOutlineLvl();
+ const sal_uInt8 nLvl = pSFldTyp->GetOutlineLvl();
if( MAXLEVEL > nLvl )
{
// dann teste, ob die Nummer neu aufsetzen muss
@@ -1556,7 +1555,7 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds )
}
}
- pMgr->CloseAll(FALSE);
+ pMgr->CloseAll(sal_False);
// HashTabelle wieder loeschen
::DeleteHashTable( pHashStrTbl, nStrFmtCnt );
@@ -1565,7 +1564,7 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds )
UpdateRefFlds(NULL);
pUpdtFlds->SetInUpdateFlds( bOldInUpdateFlds );
- pUpdtFlds->SetFieldsDirty( FALSE );
+ pUpdtFlds->SetFieldsDirty( sal_False );
}
/*--------------------------------------------------------------------
@@ -1576,9 +1575,9 @@ void SwDoc::UpdateDBNumFlds( SwDBNameInfField& rDBFld, SwCalc& rCalc )
{
SwNewDBMgr* pMgr = GetNewDBMgr();
- USHORT nFldType = rDBFld.Which();
+ sal_uInt16 nFldType = rDBFld.Which();
- BOOL bPar1 = rCalc.Calculate( rDBFld.GetPar1() ).GetBool();
+ sal_Bool bPar1 = rCalc.Calculate( rDBFld.GetPar1() ).GetBool();
if( RES_DBNEXTSETFLD == nFldType )
((SwDBNextSetField&)rDBFld).SetCondValid( bPar1 );
@@ -1612,7 +1611,7 @@ void SwDoc::UpdateDBNumFlds( SwDBNameInfField& rDBFld, SwCalc& rCalc )
void SwDoc::_InitFieldTypes() // wird vom CTOR gerufen!!
{
// Feldtypen
- USHORT nFldType = 0;
+ sal_uInt16 nFldType = 0;
pFldTypes->Insert( new SwDateTimeFieldType(this), nFldType++ );
pFldTypes->Insert( new SwChapterFieldType, nFldType++ );
pFldTypes->Insert( new SwPageNumberFieldType, nFldType++ );
@@ -1673,11 +1672,11 @@ const SwDBData& SwDoc::GetDBDesc()
{
if(!aDBData.sDataSource.getLength())
{
- const USHORT nSize = pFldTypes->Count();
- for(USHORT i = 0; i < nSize && !aDBData.sDataSource.getLength(); ++i)
+ const sal_uInt16 nSize = pFldTypes->Count();
+ for(sal_uInt16 i = 0; i < nSize && !aDBData.sDataSource.getLength(); ++i)
{
SwFieldType& rFldType = *((*pFldTypes)[i]);
- USHORT nWhich = rFldType.Which();
+ sal_uInt16 nWhich = rFldType.Which();
if(IsUsed(rFldType))
{
switch(nWhich)
@@ -1712,7 +1711,7 @@ const SwDBData& SwDoc::GetDBDesc()
return aDBData;
}
-void SwDoc::SetInitDBFields( BOOL b )
+void SwDoc::SetInitDBFields( sal_Bool b )
{
GetNewDBMgr()->SetInitDBFields( b );
}
@@ -1742,7 +1741,7 @@ void SwDoc::GetAllUsedDB( SvStringsDtor& rDBNameList,
}
SwSectionFmts& rArr = GetSections();
- for (USHORT n = rArr.Count(); n; )
+ for (sal_uInt16 n = rArr.Count(); n; )
{
SwSection* pSect = rArr[ --n ]->GetSection();
@@ -1814,7 +1813,7 @@ void SwDoc::GetAllDBNames( SvStringsDtor& rAllDBNames )
SwNewDBMgr* pMgr = GetNewDBMgr();
const SwDSParamArr& rArr = pMgr->GetDSParamArray();
- for(USHORT i = 0; i < rArr.Count(); i++)
+ for(sal_uInt16 i = 0; i < rArr.Count(); i++)
{
SwDSParam* pParam = rArr[i];
String* pStr = new String( pParam->sDataSource );
@@ -1839,7 +1838,7 @@ SvStringsDtor& SwDoc::FindUsedDBs( const SvStringsDtor& rAllDBNames,
#endif
xub_StrLen nPos;
- for (USHORT i = 0; i < rAllDBNames.Count(); ++i )
+ for (sal_uInt16 i = 0; i < rAllDBNames.Count(); ++i )
{
const String* pStr = rAllDBNames.GetObject(i);
@@ -1869,7 +1868,7 @@ SvStringsDtor& SwDoc::FindUsedDBs( const SvStringsDtor& rAllDBNames,
void SwDoc::AddUsedDBToList( SvStringsDtor& rDBNameList,
const SvStringsDtor& rUsedDBNames )
{
- for (USHORT i = 0; i < rUsedDBNames.Count(); i++)
+ for (sal_uInt16 i = 0; i < rUsedDBNames.Count(); i++)
AddUsedDBToList( rDBNameList, *rUsedDBNames.GetObject(i) );
}
@@ -1883,12 +1882,12 @@ void SwDoc::AddUsedDBToList( SvStringsDtor& rDBNameList, const String& rDBName)
return;
#ifdef UNX
- for( USHORT i = 0; i < rDBNameList.Count(); ++i )
+ for( sal_uInt16 i = 0; i < rDBNameList.Count(); ++i )
if( rDBName == rDBNameList.GetObject(i)->GetToken(0) )
return;
#else
const ::utl::TransliterationWrapper& rSCmp = GetAppCmpStrIgnore();
- for( USHORT i = 0; i < rDBNameList.Count(); ++i )
+ for( sal_uInt16 i = 0; i < rDBNameList.Count(); ++i )
if( rSCmp.isEqual( rDBName, rDBNameList.GetObject(i)->GetToken(0) ) )
return;
#endif
@@ -1917,7 +1916,7 @@ void SwDoc::ChangeDBFields( const SvStringsDtor& rOldNames,
String sFormel;
SwSectionFmts& rArr = GetSections();
- for (USHORT n = rArr.Count(); n; )
+ for (sal_uInt16 n = rArr.Count(); n; )
{
SwSection* pSect = rArr[ --n ]->GetSection();
@@ -1943,7 +1942,7 @@ void SwDoc::ChangeDBFields( const SvStringsDtor& rOldNames,
continue;
SwField* pFld = pFmtFld->GetFld();
- BOOL bExpand = FALSE;
+ sal_Bool bExpand = sal_False;
switch( pFld->GetTyp()->Which() )
{
@@ -1961,7 +1960,7 @@ void SwDoc::ChangeDBFields( const SvStringsDtor& rOldNames,
((SwDBField*)pFld)->ClearInitialized();
((SwDBField*)pFld)->InitContent();
- bExpand = TRUE;
+ bExpand = sal_True;
}
break;
@@ -1971,7 +1970,7 @@ void SwDoc::ChangeDBFields( const SvStringsDtor& rOldNames,
lcl_DBDataToString(((SwDBNameInfField*)pFld)->GetRealDBData())))
{
((SwDBNameInfField*)pFld)->SetDBData(aNewDBData);
- bExpand = TRUE;
+ bExpand = sal_True;
}
break;
@@ -1981,7 +1980,7 @@ void SwDoc::ChangeDBFields( const SvStringsDtor& rOldNames,
lcl_DBDataToString(((SwDBNameInfField*)pFld)->GetRealDBData())))
{
((SwDBNameInfField*)pFld)->SetDBData(aNewDBData);
- bExpand = TRUE;
+ bExpand = sal_True;
}
// kein break;
case RES_HIDDENTXTFLD:
@@ -1989,7 +1988,7 @@ void SwDoc::ChangeDBFields( const SvStringsDtor& rOldNames,
sFormel = pFld->GetPar1();
ReplaceUsedDBs( rOldNames, rNewName, sFormel);
pFld->SetPar1( sFormel );
- bExpand = TRUE;
+ bExpand = sal_True;
break;
case RES_SETEXPFLD:
@@ -1998,7 +1997,7 @@ void SwDoc::ChangeDBFields( const SvStringsDtor& rOldNames,
sFormel = pFld->GetFormula();
ReplaceUsedDBs( rOldNames, rNewName, sFormel);
pFld->SetPar2( sFormel );
- bExpand = TRUE;
+ bExpand = sal_True;
break;
}
@@ -2024,7 +2023,7 @@ void SwDoc::ReplaceUsedDBs( const SvStringsDtor& rUsedDBNames,
String sUpperNewNm( sNewName );
- for( USHORT i = 0; i < rUsedDBNames.Count(); ++i )
+ for( sal_uInt16 i = 0; i < rUsedDBNames.Count(); ++i )
{
String sDBName( *rUsedDBNames.GetObject( i ) );
@@ -2057,26 +2056,26 @@ void SwDoc::ReplaceUsedDBs( const SvStringsDtor& rUsedDBNames,
Beschreibung:
--------------------------------------------------------------------*/
-BOOL SwDoc::IsNameInArray( const SvStringsDtor& rArr, const String& rName )
+sal_Bool SwDoc::IsNameInArray( const SvStringsDtor& rArr, const String& rName )
{
#ifdef UNX
- for( USHORT i = 0; i < rArr.Count(); ++i )
+ for( sal_uInt16 i = 0; i < rArr.Count(); ++i )
if( rName == *rArr[ i ] )
- return TRUE;
+ return sal_True;
#else
const ::utl::TransliterationWrapper& rSCmp = GetAppCmpStrIgnore();
- for( USHORT i = 0; i < rArr.Count(); ++i )
+ for( sal_uInt16 i = 0; i < rArr.Count(); ++i )
if( rSCmp.isEqual( rName, *rArr[ i] ))
- return TRUE;
+ return sal_True;
#endif
- return FALSE;
+ return sal_False;
}
void SwDoc::SetFixFields( bool bOnlyTimeDate, const DateTime* pNewDateTime )
{
- BOOL bIsModified = IsModified();
+ sal_Bool bIsModified = IsModified();
- ULONG nDate, nTime;
+ sal_uLong nDate, nTime;
if( pNewDateTime )
{
nDate = pNewDateTime->GetDate();
@@ -2088,14 +2087,14 @@ void SwDoc::SetFixFields( bool bOnlyTimeDate, const DateTime* pNewDateTime )
nTime = Time().GetTime();
}
- USHORT aTypes[5] = {
+ sal_uInt16 aTypes[5] = {
/*0*/ RES_DOCINFOFLD,
/*1*/ RES_AUTHORFLD,
/*2*/ RES_EXTUSERFLD,
/*3*/ RES_FILENAMEFLD,
/*4*/ RES_DATETIMEFLD }; // MUSS am Ende stehen!!
- USHORT nStt = bOnlyTimeDate ? 4 : 0;
+ sal_uInt16 nStt = bOnlyTimeDate ? 4 : 0;
for( ; nStt < 5; ++nStt )
{
@@ -2105,13 +2104,13 @@ void SwDoc::SetFixFields( bool bOnlyTimeDate, const DateTime* pNewDateTime )
{
if( pFld && pFld->GetTxtFld() )
{
- BOOL bChgd = FALSE;
+ sal_Bool bChgd = sal_False;
switch( aTypes[ nStt ] )
{
case RES_DOCINFOFLD:
if( ((SwDocInfoField*)pFld->GetFld())->IsFixed() )
{
- bChgd = TRUE;
+ bChgd = sal_True;
SwDocInfoField* pDocInfFld = (SwDocInfoField*)pFld->GetFld();
pDocInfFld->SetExpansion( ((SwDocInfoFieldType*)
pDocInfFld->GetTyp())->Expand(
@@ -2125,7 +2124,7 @@ void SwDoc::SetFixFields( bool bOnlyTimeDate, const DateTime* pNewDateTime )
case RES_AUTHORFLD:
if( ((SwAuthorField*)pFld->GetFld())->IsFixed() )
{
- bChgd = TRUE;
+ bChgd = sal_True;
SwAuthorField* pAuthorFld = (SwAuthorField*)pFld->GetFld();
pAuthorFld->SetExpansion( ((SwAuthorFieldType*)
pAuthorFld->GetTyp())->Expand(
@@ -2136,7 +2135,7 @@ void SwDoc::SetFixFields( bool bOnlyTimeDate, const DateTime* pNewDateTime )
case RES_EXTUSERFLD:
if( ((SwExtUserField*)pFld->GetFld())->IsFixed() )
{
- bChgd = TRUE;
+ bChgd = sal_True;
SwExtUserField* pExtUserFld = (SwExtUserField*)pFld->GetFld();
pExtUserFld->SetExpansion( ((SwExtUserFieldType*)
pExtUserFld->GetTyp())->Expand(
@@ -2148,7 +2147,7 @@ void SwDoc::SetFixFields( bool bOnlyTimeDate, const DateTime* pNewDateTime )
case RES_DATETIMEFLD:
if( ((SwDateTimeField*)pFld->GetFld())->IsFixed() )
{
- bChgd = TRUE;
+ bChgd = sal_True;
((SwDateTimeField*)pFld->GetFld())->SetDateTime(
DateTime(Date(nDate), Time(nTime)) );
}
@@ -2157,7 +2156,7 @@ void SwDoc::SetFixFields( bool bOnlyTimeDate, const DateTime* pNewDateTime )
case RES_FILENAMEFLD:
if( ((SwFileNameField*)pFld->GetFld())->IsFixed() )
{
- bChgd = TRUE;
+ bChgd = sal_True;
SwFileNameField* pFileNameFld =
(SwFileNameField*)pFld->GetFld();
pFileNameFld->SetExpansion( ((SwFileNameFieldType*)
@@ -2178,19 +2177,19 @@ void SwDoc::SetFixFields( bool bOnlyTimeDate, const DateTime* pNewDateTime )
ResetModified();
}
-bool SwDoc::SetFieldsDirty( bool b, const SwNode* pChk, ULONG nLen )
+bool SwDoc::SetFieldsDirty( bool b, const SwNode* pChk, sal_uLong nLen )
{
// teste ggfs. mal, ob die angegbenen Nodes ueberhaupt Felder beinhalten.
// wenn nicht, braucht das Flag nicht veraendert werden.
- BOOL bFldsFnd = FALSE;
+ sal_Bool bFldsFnd = sal_False;
if( b && pChk && !GetUpdtFlds().IsFieldsDirty() && !IsInDtor()
// ?? was ist mit Undo, da will man es doch auch haben !!
/*&& &pChk->GetNodes() == &GetNodes()*/ )
{
- b = FALSE;
+ b = sal_False;
if( !nLen )
++nLen;
- ULONG nStt = pChk->GetIndex();
+ sal_uLong nStt = pChk->GetIndex();
const SwNodes& rNds = pChk->GetNodes();
while( nLen-- )
{
@@ -2201,15 +2200,15 @@ bool SwDoc::SetFieldsDirty( bool b, const SwNode* pChk, ULONG nLen )
// MAXLEVEL > pTNd->GetTxtColl()->GetOutlineLevel() )
pTNd->GetAttrOutlineLevel() != 0 )//<-end,zhaojianwei
// Kapitelfelder aktualisieren
- b = TRUE;
+ b = sal_True;
else if( pTNd->GetpSwpHints() && pTNd->GetSwpHints().Count() )
- for( USHORT n = 0, nEnd = pTNd->GetSwpHints().Count();
+ for( sal_uInt16 n = 0, nEnd = pTNd->GetSwpHints().Count();
n < nEnd; ++n )
{
const SwTxtAttr* pAttr = pTNd->GetSwpHints()[ n ];
if( RES_TXTATR_FIELD == pAttr->Which() )
{
- b = TRUE;
+ b = sal_True;
break;
}
}
@@ -2228,9 +2227,9 @@ bool SwDoc::SetFieldsDirty( bool b, const SwNode* pChk, ULONG nLen )
---------------------------------------------------------------------------*/
void SwDoc::ChangeAuthorityData( const SwAuthEntry* pNewData )
{
- const USHORT nSize = pFldTypes->Count();
+ const sal_uInt16 nSize = pFldTypes->Count();
- for( USHORT i = INIT_FLDTYPES; i < nSize; ++i )
+ for( sal_uInt16 i = INIT_FLDTYPES; i < nSize; ++i )
{
SwFieldType* pFldType = (*pFldTypes)[i];
if( RES_AUTHORITY == pFldType->Which() )
@@ -2246,9 +2245,9 @@ void SwDoc::ChangeAuthorityData( const SwAuthEntry* pNewData )
Beschreibung:
--------------------------------------------------------------------*/
-void SwDocUpdtFld::InsDelFldInFldLst( BOOL bIns, const SwTxtFld& rFld )
+void SwDocUpdtFld::InsDelFldInFldLst( sal_Bool bIns, const SwTxtFld& rFld )
{
- USHORT nWhich = rFld.GetFld().GetFld()->GetTyp()->Which();
+ sal_uInt16 nWhich = rFld.GetFld().GetFld()->GetTyp()->Which();
switch( nWhich )
{
case RES_DBFLD:
@@ -2265,7 +2264,7 @@ void SwDocUpdtFld::InsDelFldInFldLst( BOOL bIns, const SwTxtFld& rFld )
return;
}
- SetFieldsDirty( TRUE );
+ SetFieldsDirty( sal_True );
if( !pFldSortLst )
{
if( !bIns ) // keine Liste vorhanden und loeschen
@@ -2280,7 +2279,7 @@ void SwDocUpdtFld::InsDelFldInFldLst( BOOL bIns, const SwTxtFld& rFld )
// ueber den pTxtFld Pointer suchen. Ist zwar eine Sortierte
// Liste, aber nach Node-Positionen sortiert. Bis dieser
// bestimmt ist, ist das Suchen nach dem Pointer schon fertig
- for( USHORT n = 0; n < pFldSortLst->Count(); ++n )
+ for( sal_uInt16 n = 0; n < pFldSortLst->Count(); ++n )
if( &rFld == (*pFldSortLst)[ n ]->GetPointer() )
pFldSortLst->DeleteAndDestroy( n--, 1 );
// ein Feld kann mehrfach vorhanden sein!
@@ -2323,17 +2322,17 @@ void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode )
SvULongs aTmpArr;
SwSectionFmts& rArr = rDoc.GetSections();
SwSectionNode* pSectNd;
- USHORT nArrStt = 0;
- ULONG nSttCntnt = rDoc.GetNodes().GetEndOfExtras().GetIndex();
+ sal_uInt16 nArrStt = 0;
+ sal_uLong nSttCntnt = rDoc.GetNodes().GetEndOfExtras().GetIndex();
- for (USHORT n = rArr.Count(); n; )
+ for (sal_uInt16 n = rArr.Count(); n; )
{
SwSection* pSect = rArr[ --n ]->GetSection();
if( pSect && pSect->IsHidden() && pSect->GetCondition().Len() &&
0 != ( pSectNd = pSect->GetFmt()->GetSectionNode() ))
{
- ULONG nIdx = pSectNd->GetIndex();
- USHORT i;
+ sal_uLong nIdx = pSectNd->GetIndex();
+ sal_uInt16 i;
for( i = 0; i < aTmpArr.Count() && aTmpArr[ i ] < nIdx; ++i )
;
@@ -2346,33 +2345,33 @@ void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode )
// erst alle anzeigen, damit die Frames vorhanden sind. Mit deren
// Position wird das BodyAnchor ermittelt.
// Dafuer erst den ContentBereich, dann die Sonderbereiche!!!
- for (USHORT n = nArrStt; n < aTmpArr.Count(); ++n)
+ for (sal_uInt16 n = nArrStt; n < aTmpArr.Count(); ++n)
{
pSectNd = rDoc.GetNodes()[ aTmpArr[ n ] ]->GetSectionNode();
ASSERT( pSectNd, "Wo ist mein SectionNode" );
- pSectNd->GetSection().SetCondHidden( FALSE );
+ pSectNd->GetSection().SetCondHidden( sal_False );
}
- for (USHORT n = 0; n < nArrStt; ++n)
+ for (sal_uInt16 n = 0; n < nArrStt; ++n)
{
pSectNd = rDoc.GetNodes()[ aTmpArr[ n ] ]->GetSectionNode();
ASSERT( pSectNd, "Wo ist mein SectionNode" );
- pSectNd->GetSection().SetCondHidden( FALSE );
+ pSectNd->GetSection().SetCondHidden( sal_False );
}
// so, erst jetzt alle sortiert in die Liste eintragen
- for (USHORT n = 0; n < aTmpArr.Count(); ++n)
+ for (sal_uInt16 n = 0; n < aTmpArr.Count(); ++n)
{
GetBodyNode( *rDoc.GetNodes()[ aTmpArr[ n ] ]->GetSectionNode() );
}
}
String sTrue( String::CreateFromAscii(
- RTL_CONSTASCII_STRINGPARAM( "TRUE" ))),
+ RTL_CONSTASCII_STRINGPARAM( "sal_True" ))),
sFalse( String::CreateFromAscii(
- RTL_CONSTASCII_STRINGPARAM( "FALSE" )));
+ RTL_CONSTASCII_STRINGPARAM( "sal_False" )));
- BOOL bIsDBMgr = 0 != rDoc.GetNewDBMgr();
- USHORT nWhich, n;
+ sal_Bool bIsDBMgr = 0 != rDoc.GetNewDBMgr();
+ sal_uInt16 nWhich, n;
const String* pFormel = 0;
const SfxPoolItem* pItem;
sal_uInt32 nMaxItems = rDoc.GetAttrPool().GetItemCount2( RES_TXTATR_FIELD );
@@ -2425,9 +2424,9 @@ void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode )
{
pFormel = &pFld->GetPar1();
if( !pFormel->Len() || pFormel->Equals( sFalse ))
- ((SwHiddenParaField*)pFld)->SetHidden( FALSE );
+ ((SwHiddenParaField*)pFld)->SetHidden( sal_False );
else if( pFormel->Equals( sTrue ))
- ((SwHiddenParaField*)pFld)->SetHidden( TRUE );
+ ((SwHiddenParaField*)pFld)->SetHidden( sal_True );
else
break;
@@ -2442,9 +2441,9 @@ void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode )
{
pFormel = &pFld->GetPar1();
if( !pFormel->Len() || pFormel->Equals( sFalse ))
- ((SwHiddenTxtField*)pFld)->SetValue( TRUE );
+ ((SwHiddenTxtField*)pFld)->SetValue( sal_True );
else if( pFormel->Equals( sTrue ))
- ((SwHiddenTxtField*)pFld)->SetValue( FALSE );
+ ((SwHiddenTxtField*)pFld)->SetValue( sal_False );
else
break;
@@ -2491,7 +2490,7 @@ void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode )
pFormel = 0;
}
}
- nFldLstGetMode = static_cast<BYTE>( eGetMode );
+ nFldLstGetMode = static_cast<sal_uInt8>( eGetMode );
nNodes = rDoc.GetNodes().Count();
#ifdef JP_DEBUG
@@ -2500,7 +2499,7 @@ void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode )
sOut.Seek( STREAM_SEEK_TO_END );
sOut << "------------------" << endl;
const _SetGetExpFldPtr* pSortLst = pFldSortLst->GetData();
- for( USHORT n = pFldSortLst->Count(); n; --n, ++pSortLst )
+ for( sal_uInt16 n = pFldSortLst->Count(); n; --n, ++pSortLst )
{
String sStr( (*pSortLst)->GetNode() );
sStr += "\t, ";
@@ -2523,17 +2522,21 @@ void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode )
Beschreibung:
--------------------------------------------------------------------*/
-void SwDocUpdtFld::GetBodyNode( const SwTxtFld& rTFld, USHORT nFldWhich )
+void SwDocUpdtFld::GetBodyNode( const SwTxtFld& rTFld, sal_uInt16 nFldWhich )
{
const SwTxtNode& rTxtNd = rTFld.GetTxtNode();
const SwDoc& rDoc = *rTxtNd.GetDoc();
// immer den ersten !! (in Tab-Headline, Kopf-/Fuss )
Point aPt;
+<<<<<<< local
const SwCntntFrm* pFrm = rTxtNd.getLayoutFrm( rDoc.GetCurrentLayout(), &aPt, 0, FALSE );
+=======
+ const SwCntntFrm* pFrm = rTxtNd.GetFrm( &aPt, 0, sal_False );
+>>>>>>> other
_SetGetExpFld* pNew = NULL;
- BOOL bIsInBody = FALSE;
+ sal_Bool bIsInBody = sal_False;
if( !pFrm || pFrm->IsInDocBody() )
{
@@ -2596,7 +2599,11 @@ void SwDocUpdtFld::GetBodyNode( const SwSectionNode& rSectNd )
// immer den ersten !! (in Tab-Headline, Kopf-/Fuss )
Point aPt;
+<<<<<<< local
const SwCntntFrm* pFrm = pCNd->getLayoutFrm( rDoc.GetCurrentLayout(), &aPt, 0, FALSE );
+=======
+ const SwCntntFrm* pFrm = pCNd->GetFrm( &aPt, 0, sal_False );
+>>>>>>> other
if( !pFrm )
break;
@@ -2607,7 +2614,7 @@ void SwDocUpdtFld::GetBodyNode( const SwSectionNode& rSectNd )
#endif
pNew = new _SetGetExpFld( rSectNd, &aPos );
- } while( FALSE );
+ } while( sal_False );
}
if( !pNew )
@@ -2634,10 +2641,10 @@ void SwDocUpdtFld::InsertFldType( const SwFieldType& rType )
if( sFldName.Len() )
{
- SetFieldsDirty( TRUE );
+ SetFieldsDirty( sal_True );
// suchen und aus der HashTabelle entfernen
GetAppCharClass().toLower( sFldName );
- USHORT n;
+ sal_uInt16 n;
SwHash* pFnd = Find( sFldName, GetFldTypeTable(), TBLSZ, &n );
@@ -2665,10 +2672,10 @@ void SwDocUpdtFld::RemoveFldType( const SwFieldType& rType )
if( sFldName.Len() )
{
- SetFieldsDirty( TRUE );
+ SetFieldsDirty( sal_True );
// suchen und aus der HashTabelle entfernen
GetAppCharClass().toLower( sFldName );
- USHORT n;
+ sal_uInt16 n;
SwHash* pFnd = Find( sFldName, GetFldTypeTable(), TBLSZ, &n );
if( pFnd )
@@ -2691,7 +2698,7 @@ void SwDocUpdtFld::RemoveFldType( const SwFieldType& rType )
SwDocUpdtFld::SwDocUpdtFld()
: pFldSortLst(0), nFldUpdtPos(LONG_MAX), nFldLstGetMode(0)
{
- bInUpdateFlds = bFldsDirty = FALSE;
+ bInUpdateFlds = bFldsDirty = sal_False;
memset( aFldTypeTable, 0, sizeof( aFldTypeTable ) );
}
@@ -2699,7 +2706,7 @@ SwDocUpdtFld::~SwDocUpdtFld()
{
delete pFldSortLst;
- for( USHORT n = 0; n < TBLSZ; ++n )
+ for( sal_uInt16 n = 0; n < TBLSZ; ++n )
delete aFldTypeTable[n];
}
@@ -2710,23 +2717,24 @@ bool SwDoc::UpdateFld(SwTxtFld * pDstTxtFld, SwField & rSrcFld,
{
ASSERT(pDstTxtFld, "no field to update!");
- BOOL bTblSelBreak = FALSE;
+ sal_Bool bTblSelBreak = sal_False;
SwFmtFld * pDstFmtFld = (SwFmtFld*)&pDstTxtFld->GetFld();
SwField * pDstFld = pDstFmtFld->GetFld();
- USHORT nFldWhich = rSrcFld.GetTyp()->Which();
+ sal_uInt16 nFldWhich = rSrcFld.GetTyp()->Which();
SwNodeIndex aTblNdIdx(pDstTxtFld->GetTxtNode());
if (pDstFld->GetTyp()->Which() ==
rSrcFld.GetTyp()->Which())
{
- if (DoesUndo())
+ if (GetIDocumentUndoRedo().DoesUndo())
{
SwPosition aPosition( pDstTxtFld->GetTxtNode() );
aPosition.nContent = *pDstTxtFld->GetStart();
- AppendUndo(new SwUndoFieldFromDoc(aPosition, *pDstFld, rSrcFld,
- pMsgHnt, bUpdateFlds));
+ SwUndo *const pUndo( new SwUndoFieldFromDoc(
+ aPosition, *pDstFld, rSrcFld, pMsgHnt, bUpdateFlds) );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
// Das gefundene Feld wird angepasst ...
@@ -2759,7 +2767,7 @@ bool SwDoc::UpdateFld(SwTxtFld * pDstTxtFld, SwField & rSrcFld,
pNewFld->GetTyp()->ModifyNotification(0, &aTblUpdate);
if (! bUpdateFlds)
- bTblSelBreak = TRUE;
+ bTblSelBreak = sal_True;
}
}
break;
@@ -2786,7 +2794,7 @@ bool SwDoc::UpdateFld(SwTxtFld * pDstTxtFld, SwField & rSrcFld,
//richtig setzt
SwDBField* pDBFld = (SwDBField*)pNewFld;
if (pDBFld->IsInitialized())
- pDBFld->ChgValue( pDBFld->GetValue(), TRUE );
+ pDBFld->ChgValue( pDBFld->GetValue(), sal_True );
pDBFld->ClearInitialized();
pDBFld->InitContent();
@@ -2807,14 +2815,18 @@ bool SwDoc::UpdateFld(SwTxtFld * pDstTxtFld, SwField & rSrcFld,
}
bool SwDoc::PutValueToField(const SwPosition & rPos,
- const Any& rVal, USHORT nWhich)
+ const Any& rVal, sal_uInt16 nWhich)
{
Any aOldVal;
SwField * pField = GetField(rPos);
- if (DoesUndo() && pField->QueryValue(aOldVal, nWhich))
- AppendUndo(new SwUndoFieldFromAPI(rPos, aOldVal, rVal, nWhich));
+ if (GetIDocumentUndoRedo().DoesUndo() &&
+ pField->QueryValue(aOldVal, nWhich))
+ {
+ SwUndo *const pUndo(new SwUndoFieldFromAPI(rPos, aOldVal, rVal, nWhich));
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
+ }
return pField->PutValue(rVal, nWhich);
}
diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx
index 14d7c8ef02e3..e26669f7b604 100644
--- a/sw/source/core/doc/docfly.cxx
+++ b/sw/source/core/doc/docfly.cxx
@@ -28,7 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <hintids.hxx>
#include <svl/itemiter.hxx>
#include <svx/svdobj.hxx>
@@ -43,6 +42,7 @@
#include <ndgrf.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <ndindex.hxx>
#include <docary.hxx>
#include <fmtcntnt.hxx>
@@ -61,24 +61,32 @@
#include <swundo.hxx>
#include <swtable.hxx>
#include <crstate.hxx>
-#include <undobj.hxx>
+#include <UndoCore.hxx>
+#include <UndoAttribute.hxx>
#include <fmtcnct.hxx>
#include <dflyobj.hxx>
#include <undoflystrattr.hxx>
#include <switerator.hxx>
-extern USHORT GetHtmlMode( const SwDocShell* );
+extern sal_uInt16 GetHtmlMode( const SwDocShell* );
using namespace ::com::sun::star;
+<<<<<<< local
USHORT SwDoc::GetFlyCount( FlyCntType eType ) const
+=======
+/*-----------------17.02.98 08:35-------------------
+
+--------------------------------------------------*/
+sal_uInt16 SwDoc::GetFlyCount( FlyCntType eType ) const
+>>>>>>> other
{
const SwSpzFrmFmts& rFmts = *GetSpzFrmFmts();
- USHORT nSize = rFmts.Count();
- USHORT nCount = 0;
+ sal_uInt16 nSize = rFmts.Count();
+ sal_uInt16 nCount = 0;
const SwNodeIndex* pIdx;
- for ( USHORT i = 0; i < nSize; i++)
+ for ( sal_uInt16 i = 0; i < nSize; i++)
{
const SwFrmFmt* pFlyFmt = rFmts[ i ];
if( RES_FLYFRMFMT == pFlyFmt->Which()
@@ -114,14 +122,14 @@ USHORT SwDoc::GetFlyCount( FlyCntType eType ) const
}
// If you change this, also update SwXFrameEnumeration in unocoll.
-SwFrmFmt* SwDoc::GetFlyNum( USHORT nIdx, FlyCntType eType )
+SwFrmFmt* SwDoc::GetFlyNum( sal_uInt16 nIdx, FlyCntType eType )
{
SwSpzFrmFmts& rFmts = *GetSpzFrmFmts();
SwFrmFmt* pRetFmt = 0;
- USHORT nSize = rFmts.Count();
+ sal_uInt16 nSize = rFmts.Count();
const SwNodeIndex* pIdx;
- USHORT nCount = 0;
- for( USHORT i = 0; !pRetFmt && i < nSize; ++i )
+ sal_uInt16 nCount = 0;
+ for( sal_uInt16 i = 0; !pRetFmt && i < nSize; ++i )
{
SwFrmFmt* pFlyFmt = rFmts[ i ];
if( RES_FLYFRMFMT == pFlyFmt->Which()
@@ -163,7 +171,7 @@ Point lcl_FindAnchorLayPos( SwDoc& rDoc, const SwFmtAnchor& rAnch,
case FLY_AS_CHAR:
if( pFlyFmt && rAnch.GetCntntAnchor() )
{
- const SwFrm* pOld = ((SwFlyFrmFmt*)pFlyFmt)->GetFrm( &aRet, FALSE );
+ const SwFrm* pOld = ((SwFlyFrmFmt*)pFlyFmt)->GetFrm( &aRet, sal_False );
if( pOld )
aRet = pOld->Frm().Pos();
}
@@ -175,7 +183,11 @@ Point lcl_FindAnchorLayPos( SwDoc& rDoc, const SwFmtAnchor& rAnch,
{
const SwPosition *pPos = rAnch.GetCntntAnchor();
const SwCntntNode* pNd = pPos->nNode.GetNode().GetCntntNode();
+<<<<<<< local
const SwFrm* pOld = pNd ? pNd->getLayoutFrm( rDoc.GetCurrentLayout(), &aRet, 0, FALSE ) : 0;
+=======
+ const SwFrm* pOld = pNd ? pNd->GetFrm( &aRet, 0, sal_False ) : 0;
+>>>>>>> other
if( pOld )
aRet = pOld->Frm().Pos();
}
@@ -186,7 +198,7 @@ Point lcl_FindAnchorLayPos( SwDoc& rDoc, const SwFmtAnchor& rAnch,
{
const SwFlyFrmFmt* pFmt = (SwFlyFrmFmt*)rAnch.GetCntntAnchor()->
nNode.GetNode().GetFlyFmt();
- const SwFrm* pOld = pFmt ? pFmt->GetFrm( &aRet, FALSE ) : 0;
+ const SwFrm* pOld = pFmt ? pFmt->GetFrm( &aRet, sal_False ) : 0;
if( pOld )
aRet = pOld->Frm().Pos();
}
@@ -194,9 +206,15 @@ Point lcl_FindAnchorLayPos( SwDoc& rDoc, const SwFmtAnchor& rAnch,
case FLY_AT_PAGE:
{
+<<<<<<< local
USHORT nPgNum = rAnch.GetPageNum();
const SwPageFrm *pPage = (SwPageFrm*)rDoc.GetCurrentLayout()->Lower();
for( USHORT i = 1; (i <= nPgNum) && pPage; ++i,
+=======
+ sal_uInt16 nPgNum = rAnch.GetPageNum();
+ const SwPageFrm *pPage = (SwPageFrm*)rDoc.GetRootFrm()->Lower();
+ for( sal_uInt16 i = 1; (i <= nPgNum) && pPage; ++i,
+>>>>>>> other
pPage = (const SwPageFrm*)pPage->GetNext() )
if( i == nPgNum )
{
@@ -215,7 +233,7 @@ Point lcl_FindAnchorLayPos( SwDoc& rDoc, const SwFmtAnchor& rAnch,
#define IGNOREANCHOR 1
#define DONTMAKEFRMS 2
-sal_Int8 SwDoc::SetFlyFrmAnchor( SwFrmFmt& rFmt, SfxItemSet& rSet, BOOL bNewFrms )
+sal_Int8 SwDoc::SetFlyFrmAnchor( SwFrmFmt& rFmt, SfxItemSet& rSet, sal_Bool bNewFrms )
{
//Ankerwechsel sind fast immer in alle 'Richtungen' erlaubt.
//Ausnahme: Absatz- bzw. Zeichengebundene Rahmen duerfen wenn sie in
@@ -289,10 +307,10 @@ sal_Int8 SwDoc::SetFlyFrmAnchor( SwFrmFmt& rFmt, SfxItemSet& rSet, BOOL bNewFrms
pNd->InsertItem( aFmt, pPos->nContent.GetIndex(), 0 );
}
- if( SFX_ITEM_SET != rSet.GetItemState( RES_VERT_ORIENT, FALSE, &pItem ))
+ if( SFX_ITEM_SET != rSet.GetItemState( RES_VERT_ORIENT, sal_False, &pItem ))
{
SwFmtVertOrient aOldV( rFmt.GetVertOrient() );
- BOOL bSet = TRUE;
+ sal_Bool bSet = sal_True;
switch( aOldV.GetVertOrient() )
{
case text::VertOrientation::LINE_TOP: aOldV.SetVertOrient( text::VertOrientation::TOP ); break;
@@ -300,7 +318,7 @@ sal_Int8 SwDoc::SetFlyFrmAnchor( SwFrmFmt& rFmt, SfxItemSet& rSet, BOOL bNewFrms
case text::VertOrientation::LINE_BOTTOM: aOldV.SetVertOrient( text::VertOrientation::BOTTOM); break;
case text::VertOrientation::NONE: aOldV.SetVertOrient( text::VertOrientation::CENTER); break;
default:
- bSet = FALSE;
+ bSet = sal_False;
}
if( bSet )
rSet.Put( aOldV );
@@ -318,7 +336,7 @@ sal_Int8 SwDoc::SetFlyFrmAnchor( SwFrmFmt& rFmt, SfxItemSet& rSet, BOOL bNewFrms
//Chg: Wenn sich in den Positionsattributen lediglich die
//Ausrichtung veraendert (text::RelOrientation::FRAME vs. text::RelOrientation::PRTAREA), dann wird die
//Position ebenfalls korrigiert.
- if( SFX_ITEM_SET != rSet.GetItemState( RES_HORI_ORIENT, FALSE, &pItem ))
+ if( SFX_ITEM_SET != rSet.GetItemState( RES_HORI_ORIENT, sal_False, &pItem ))
pItem = 0;
SwFmtHoriOrient aOldH( rFmt.GetHoriOrient() );
@@ -339,7 +357,7 @@ sal_Int8 SwDoc::SetFlyFrmAnchor( SwFrmFmt& rFmt, SfxItemSet& rSet, BOOL bNewFrms
rSet.Put( aOldH );
}
- if( SFX_ITEM_SET != rSet.GetItemState( RES_VERT_ORIENT, FALSE, &pItem ))
+ if( SFX_ITEM_SET != rSet.GetItemState( RES_VERT_ORIENT, sal_False, &pItem ))
pItem = 0;
SwFmtVertOrient aOldV( rFmt.GetVertOrient() );
@@ -371,35 +389,27 @@ sal_Int8 SwDoc::SetFlyFrmAnchor( SwFrmFmt& rFmt, SfxItemSet& rSet, BOOL bNewFrms
return MAKEFRMS;
}
-BOOL SwDoc::SetFlyFrmAttr( SwFrmFmt& rFlyFmt, SfxItemSet& rSet )
+static bool
+lcl_SetFlyFrmAttr(SwDoc & rDoc,
+ sal_Int8 (SwDoc::*pSetFlyFrmAnchor)(SwFrmFmt &, SfxItemSet &, sal_Bool),
+ SwFrmFmt & rFlyFmt, SfxItemSet & rSet)
{
- if( !rSet.Count() )
- return FALSE;
-
- ::std::auto_ptr<SwUndoFmtAttrHelper> pSaveUndo;
- const bool bDoesUndo = DoesUndo();
-
- if( DoesUndo() )
- {
- ClearRedo();
- pSaveUndo.reset( new SwUndoFmtAttrHelper( rFlyFmt ) );
- // --> FME 2004-10-13 #i32968#
- // Inserting columns in the frame causes MakeFrmFmt to put two
- // objects of type SwUndoFrmFmt on the undo stack. We don't want them.
- DoUndo( FALSE );
- // <--
- }
+ // #i32968# Inserting columns in the frame causes MakeFrmFmt to put two
+ // objects of type SwUndoFrmFmt on the undo stack. We don't want them.
+ ::sw::UndoGuard const undoGuard(rDoc.GetIDocumentUndoRedo());
//Ist das Ankerattribut dabei? Falls ja ueberlassen wir die Verarbeitung
- //desselben einer Spezialmethode. Sie Returnt TRUE wenn der Fly neu
+ //desselben einer Spezialmethode. Sie Returnt sal_True wenn der Fly neu
//erzeugt werden muss (z.B. weil ein Wechsel des FlyTyps vorliegt).
- sal_Int8 nMakeFrms = SFX_ITEM_SET == rSet.GetItemState( RES_ANCHOR, FALSE )?
- SetFlyFrmAnchor( rFlyFmt, rSet, FALSE ) : DONTMAKEFRMS;
+ sal_Int8 const nMakeFrms =
+ (SFX_ITEM_SET == rSet.GetItemState( RES_ANCHOR, sal_False ))
+ ? (rDoc.*pSetFlyFrmAnchor)( rFlyFmt, rSet, sal_False )
+ : DONTMAKEFRMS;
const SfxPoolItem* pItem;
SfxItemIter aIter( rSet );
- SfxItemSet aTmpSet( GetAttrPool(), aFrmFmtSetRange );
- USHORT nWhich = aIter.GetCurItem()->Which();
+ SfxItemSet aTmpSet( rDoc.GetAttrPool(), aFrmFmtSetRange );
+ sal_uInt16 nWhich = aIter.GetCurItem()->Which();
do {
switch( nWhich )
{
@@ -408,7 +418,7 @@ BOOL SwDoc::SetFlyFrmAttr( SwFrmFmt& rFlyFmt, SfxItemSet& rSet )
case RES_PAGEDESC:
case RES_CNTNT:
case RES_FOOTER:
- ASSERT( !this, ":-) Unbekanntes Attribut fuer Fly." );
+ OSL_ENSURE(false, ":-) unknown Attribute for Fly.");
// kein break;
case RES_CHAIN:
rSet.ClearItem( nWhich );
@@ -419,7 +429,7 @@ BOOL SwDoc::SetFlyFrmAttr( SwFrmFmt& rFlyFmt, SfxItemSet& rSet )
default:
if( !IsInvalidItem( aIter.GetCurItem() ) && ( SFX_ITEM_SET !=
- rFlyFmt.GetAttrSet().GetItemState( nWhich, TRUE, &pItem ) ||
+ rFlyFmt.GetAttrSet().GetItemState( nWhich, sal_True, &pItem ) ||
*pItem != *aIter.GetCurItem() ))
aTmpSet.Put( *aIter.GetCurItem() );
break;
@@ -436,21 +446,36 @@ BOOL SwDoc::SetFlyFrmAttr( SwFrmFmt& rFlyFmt, SfxItemSet& rSet )
if( MAKEFRMS == nMakeFrms )
rFlyFmt.MakeFrms();
- if ( pSaveUndo.get() )
+ return aTmpSet.Count() || MAKEFRMS == nMakeFrms;
+}
+
+sal_Bool SwDoc::SetFlyFrmAttr( SwFrmFmt& rFlyFmt, SfxItemSet& rSet )
+{
+ if( !rSet.Count() )
+ return sal_False;
+
+ ::std::auto_ptr<SwUndoFmtAttrHelper> pSaveUndo;
+
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- // --> FME 2004-10-13 #i32968#
- DoUndo( bDoesUndo );
- // <--
+ GetIDocumentUndoRedo().ClearRedo(); // AppendUndo far below, so leave it
+ pSaveUndo.reset( new SwUndoFmtAttrHelper( rFlyFmt ) );
+ }
+
+ bool const bRet =
+ lcl_SetFlyFrmAttr(*this, &SwDoc::SetFlyFrmAnchor, rFlyFmt, rSet);
+ if ( pSaveUndo.get() )
+ {
if ( pSaveUndo->GetUndo() )
{
- AppendUndo( pSaveUndo->ReleaseUndo() );
+ GetIDocumentUndoRedo().AppendUndo( pSaveUndo->ReleaseUndo() );
}
}
SetModified();
- return aTmpSet.Count() || MAKEFRMS == nMakeFrms;
+ return bRet;
}
// --> OD 2009-07-20 #i73249#
@@ -462,13 +487,11 @@ void SwDoc::SetFlyFrmTitle( SwFlyFrmFmt& rFlyFrmFmt,
return;
}
- const bool bFormerIsNoDrawUndoObj( IsNoDrawUndoObj() );
- SetNoDrawUndoObj( true );
+ ::sw::DrawUndoGuard const drawUndoGuard(GetIDocumentUndoRedo());
- if ( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoFlyStrAttr( rFlyFrmFmt,
+ GetIDocumentUndoRedo().AppendUndo( new SwUndoFlyStrAttr( rFlyFrmFmt,
UNDO_FLYFRMFMT_TITLE,
rFlyFrmFmt.GetObjTitle(),
sNewTitle ) );
@@ -476,8 +499,6 @@ void SwDoc::SetFlyFrmTitle( SwFlyFrmFmt& rFlyFrmFmt,
rFlyFrmFmt.SetObjTitle( sNewTitle, true );
- SetNoDrawUndoObj( bFormerIsNoDrawUndoObj );
-
SetModified();
}
@@ -489,13 +510,11 @@ void SwDoc::SetFlyFrmDescription( SwFlyFrmFmt& rFlyFrmFmt,
return;
}
- const bool bFormerIsNoDrawUndoObj( IsNoDrawUndoObj() );
- SetNoDrawUndoObj( true );
+ ::sw::DrawUndoGuard const drawUndoGuard(GetIDocumentUndoRedo());
- if ( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoFlyStrAttr( rFlyFrmFmt,
+ GetIDocumentUndoRedo().AppendUndo( new SwUndoFlyStrAttr( rFlyFrmFmt,
UNDO_FLYFRMFMT_DESCRIPTION,
rFlyFrmFmt.GetObjDescription(),
sNewDescription ) );
@@ -503,33 +522,43 @@ void SwDoc::SetFlyFrmDescription( SwFlyFrmFmt& rFlyFrmFmt,
rFlyFrmFmt.SetObjDescription( sNewDescription, true );
- SetNoDrawUndoObj( bFormerIsNoDrawUndoObj );
-
SetModified();
}
// <--
+<<<<<<< local
BOOL SwDoc::SetFrmFmtToFly( SwFrmFmt& rFmt, SwFrmFmt& rNewFmt,
SfxItemSet* pSet, BOOL bKeepOrient )
+=======
+/***************************************************************************
+ * 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 )
+>>>>>>> other
{
- BOOL bChgAnchor = FALSE, bFrmSz = FALSE;
+ sal_Bool bChgAnchor = sal_False, bFrmSz = sal_False;
const SwFmtFrmSize aFrmSz( rFmt.GetFrmSize() );
const SwFmtVertOrient aVert( rFmt.GetVertOrient() );
const SwFmtHoriOrient aHori( rFmt.GetHoriOrient() );
SwUndoSetFlyFmt* pUndo = 0;
- if( DoesUndo() )
+ bool const bUndo = GetIDocumentUndoRedo().DoesUndo();
+ if (bUndo)
{
- ClearRedo();
- AppendUndo( pUndo = new SwUndoSetFlyFmt( rFmt, rNewFmt ) );
- // --> FME 2004-10-13 #i32968#
- // Inserting columns in the section causes MakeFrmFmt to put two
- // objects of type SwUndoFrmFmt on the undo stack. We don't want them.
- DoUndo( FALSE );
- // <--
+ pUndo = new SwUndoSetFlyFmt( rFmt, rNewFmt );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
+ // #i32968# Inserting columns in the section causes MakeFrmFmt to put
+ // 2 objects of type SwUndoFrmFmt on the undo stack. We don't want them.
+ ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
+
//Erstmal die Spalten setzen, sonst gibts nix als Aerger mit dem
//Set/Reset/Abgleich usw.
const SfxPoolItem* pItem;
@@ -542,20 +571,20 @@ BOOL SwDoc::SetFrmFmtToFly( SwFrmFmt& rFmt, SwFrmFmt& rNewFmt,
// 1. wenn nicht automatisch -> ignorieren, sonst -> wech
// 2. wech damit, MB!
- if( SFX_ITEM_SET == rNewFmt.GetAttrSet().GetItemState( RES_FRM_SIZE, FALSE ))
+ if( SFX_ITEM_SET == rNewFmt.GetAttrSet().GetItemState( RES_FRM_SIZE, sal_False ))
{
rFmt.ResetFmtAttr( RES_FRM_SIZE );
- bFrmSz = TRUE;
+ bFrmSz = sal_True;
}
const SfxItemSet* pAsk = pSet;
if( !pAsk ) pAsk = &rNewFmt.GetAttrSet();
- if( SFX_ITEM_SET == pAsk->GetItemState( RES_ANCHOR, FALSE, &pItem )
+ if( SFX_ITEM_SET == pAsk->GetItemState( RES_ANCHOR, sal_False, &pItem )
&& ((SwFmtAnchor*)pItem)->GetAnchorId() !=
rFmt.GetAnchor().GetAnchorId() )
{
if( pSet )
- bChgAnchor = MAKEFRMS == SetFlyFrmAnchor( rFmt, *pSet, FALSE );
+ bChgAnchor = MAKEFRMS == SetFlyFrmAnchor( rFmt, *pSet, sal_False );
else
{
//JP 23.04.98: muss den FlyFmt-Range haben, denn im SetFlyFrmAnchor
@@ -563,7 +592,7 @@ BOOL SwDoc::SetFrmFmtToFly( SwFrmFmt& rFmt, SwFrmFmt& rNewFmt,
SfxItemSet aFlySet( *rNewFmt.GetAttrSet().GetPool(),
rNewFmt.GetAttrSet().GetRanges() );
aFlySet.Put( *pItem );
- bChgAnchor = MAKEFRMS == SetFlyFrmAnchor( rFmt, aFlySet, FALSE);
+ bChgAnchor = MAKEFRMS == SetFlyFrmAnchor( rFmt, aFlySet, sal_False);
}
}
}
@@ -596,11 +625,6 @@ BOOL SwDoc::SetFrmFmtToFly( SwFrmFmt& rFmt, SwFrmFmt& rNewFmt,
SetModified();
- // --> FME 2004-10-13 #i32968#
- if ( pUndo )
- DoUndo( TRUE );
- // <--
-
return bChgAnchor;
}
@@ -626,10 +650,10 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
return false;
}
- StartUndo( UNDO_INSATTR, NULL );
+ GetIDocumentUndoRedo().StartUndo( UNDO_INSATTR, NULL );
- BOOL bUnmark = FALSE;
- for ( USHORT i = 0; i < _rMrkList.GetMarkCount(); ++i )
+ sal_Bool bUnmark = sal_False;
+ for ( sal_uInt16 i = 0; i < _rMrkList.GetMarkCount(); ++i )
{
SdrObject* pObj = _rMrkList.GetMark( i )->GetMarkedSdrObj();
if ( !pObj->ISA(SwVirtFlyDrawObj) )
@@ -720,7 +744,11 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
// OD 20.06.2003 #108784# - consider that drawing objects
// can be in header/footer. Thus, <GetFrm()> by left-top-corner
pTxtFrm = aPos.nNode.GetNode().
+<<<<<<< local
GetCntntNode()->getLayoutFrm( GetCurrentLayout(), &aPt, 0, FALSE );
+=======
+ GetCntntNode()->GetFrm( &aPt, 0, sal_False );
+>>>>>>> other
}
const SwFrm *pTmp = ::FindAnchor( pTxtFrm, aPt );
pNewAnchorFrm = pTmp->FindFlyFrm();
@@ -857,7 +885,7 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
}
}
- EndUndo( UNDO_END, NULL );
+ GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
SetModified();
return bUnmark;
@@ -900,16 +928,16 @@ int SwDoc::Chainable( const SwFrmFmt &rSource, const SwFrmFmt &rDest )
if( !pTxtNd )
return SW_CHAIN_NOT_FOUND;
- const ULONG nFlySttNd = pCntIdx->GetIndex();
+ const sal_uLong nFlySttNd = pCntIdx->GetIndex();
if( 2 != ( pCntIdx->GetNode().EndOfSectionIndex() - nFlySttNd ) ||
pTxtNd->GetTxt().Len() )
return SW_CHAIN_NOT_EMPTY;
- USHORT nArrLen = GetSpzFrmFmts()->Count();
- for( USHORT n = 0; n < nArrLen; ++n )
+ sal_uInt16 nArrLen = GetSpzFrmFmts()->Count();
+ for( sal_uInt16 n = 0; n < nArrLen; ++n )
{
const SwFmtAnchor& rAnchor = (*GetSpzFrmFmts())[ n ]->GetAnchor();
- ULONG nTstSttNd;
+ sal_uLong nTstSttNd;
// OD 11.12.2003 #i20622# - to-frame anchored objects are allowed.
if ( ((rAnchor.GetAnchorId() == FLY_AT_PARA) ||
(rAnchor.GetAnchorId() == FLY_AT_CHAR)) &&
@@ -931,14 +959,14 @@ int SwDoc::Chainable( const SwFrmFmt &rSource, const SwFrmFmt &rDest )
// both in the same fly, header, footer or on the page?
const SwFmtAnchor &rSrcAnchor = rSource.GetAnchor(),
&rDstAnchor = rDest.GetAnchor();
- ULONG nEndOfExtras = GetNodes().GetEndOfExtras().GetIndex();
- BOOL bAllowed = FALSE;
+ sal_uLong nEndOfExtras = GetNodes().GetEndOfExtras().GetIndex();
+ sal_Bool bAllowed = sal_False;
if ( FLY_AT_PAGE == rSrcAnchor.GetAnchorId() )
{
if ( (FLY_AT_PAGE == rDstAnchor.GetAnchorId()) ||
( rDstAnchor.GetCntntAnchor() &&
rDstAnchor.GetCntntAnchor()->nNode.GetIndex() > nEndOfExtras ))
- bAllowed = TRUE;
+ bAllowed = sal_True;
}
else if( rSrcAnchor.GetCntntAnchor() && rDstAnchor.GetCntntAnchor() )
{
@@ -957,7 +985,7 @@ int SwDoc::Chainable( const SwFrmFmt &rSource, const SwFrmFmt &rDest )
pSttNd == rDstIdx.GetNode().FindHeaderStartNode() ) ||
( !pSttNd && rDstIdx.GetIndex() > nEndOfExtras &&
rSrcIdx.GetIndex() > nEndOfExtras ))
- bAllowed = TRUE;
+ bAllowed = sal_True;
}
return bAllowed ? SW_CHAIN_OK : SW_CHAIN_WRONG_AREA;
@@ -968,7 +996,7 @@ int SwDoc::Chain( SwFrmFmt &rSource, const SwFrmFmt &rDest )
int nErr = Chainable( rSource, rDest );
if ( !nErr )
{
- StartUndo( UNDO_CHAINE, NULL );
+ GetIDocumentUndoRedo().StartUndo( UNDO_CHAINE, NULL );
SwFlyFrmFmt& rDestFmt = (SwFlyFrmFmt&)rDest;
@@ -1001,7 +1029,7 @@ int SwDoc::Chain( SwFrmFmt &rSource, const SwFrmFmt &rDest )
}
SetAttr( aSet, rSource );
- EndUndo( UNDO_CHAINE, NULL );
+ GetIDocumentUndoRedo().EndUndo( UNDO_CHAINE, NULL );
}
return nErr;
}
@@ -1011,14 +1039,14 @@ void SwDoc::Unchain( SwFrmFmt &rFmt )
SwFmtChain aChain( rFmt.GetChain() );
if ( aChain.GetNext() )
{
- StartUndo( UNDO_UNCHAIN, NULL );
+ GetIDocumentUndoRedo().StartUndo( UNDO_UNCHAIN, NULL );
SwFrmFmt *pFollow = aChain.GetNext();
aChain.SetNext( 0 );
SetAttr( aChain, rFmt );
aChain = pFollow->GetChain();
aChain.SetPrev( 0 );
SetAttr( aChain, *pFollow );
- EndUndo( UNDO_UNCHAIN, NULL );
+ GetIDocumentUndoRedo().EndUndo( UNDO_UNCHAIN, NULL );
}
}
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 26e20128f375..d0f60e5bb058 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -54,12 +54,14 @@
#include <fmtcntnt.hxx>
#include <frmatr.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <rootfrm.hxx>
#include <pagefrm.hxx>
#include <hints.hxx> // fuer SwHyphenBug (in SetDefault)
#include <ndtxt.hxx>
#include <pam.hxx>
-#include <undobj.hxx>
+#include <UndoCore.hxx>
+#include <UndoAttribute.hxx>
#include <ndgrf.hxx>
#include <pagedesc.hxx> // Fuer Sonderbehandlung in InsFrmFmt
#include <rolbck.hxx> // Undo-Attr
@@ -95,14 +97,14 @@ SV_IMPL_PTRARR(SwSpzFrmFmts,SwFrmFmtPtr)
* interne Funktionen
*/
-BOOL SetTxtFmtCollNext( const SwTxtFmtCollPtr& rpTxtColl, void* pArgs )
+sal_Bool SetTxtFmtCollNext( const SwTxtFmtCollPtr& rpTxtColl, void* pArgs )
{
SwTxtFmtColl *pDel = (SwTxtFmtColl*) pArgs;
if ( &rpTxtColl->GetNextTxtFmtColl() == pDel )
{
rpTxtColl->SetNextTxtFmtColl( *rpTxtColl );
}
- return TRUE;
+ return sal_True;
}
/*
@@ -116,7 +118,7 @@ struct ParaRstFmt
SwHistory* pHistory;
const SwPosition *pSttNd, *pEndNd;
const SfxItemSet* pDelSet;
- USHORT nWhich;
+ sal_uInt16 nWhich;
bool bReset;
// --> OD 2007-11-06 #i62575#
bool bResetListAttrs;
@@ -127,7 +129,7 @@ struct ParaRstFmt
bool bKeepOutlineLevelAttr; //#outline level,add by zhaojianwei
ParaRstFmt( const SwPosition* pStt, const SwPosition* pEnd,
- SwHistory* pHst, USHORT nWhch = 0, const SfxItemSet* pSet = 0 )
+ SwHistory* pHst, sal_uInt16 nWhch = 0, const SfxItemSet* pSet = 0 )
: pFmtColl(0),
pHistory(pHst),
pSttNd(pStt),
@@ -164,14 +166,14 @@ struct ParaRstFmt
* (wird bei Selectionen am Start/Ende und bei keiner SSelection benoetigt)
*/
-BOOL lcl_RstTxtAttr( const SwNodePtr& rpNd, void* pArgs )
+sal_Bool lcl_RstTxtAttr( const SwNodePtr& rpNd, void* pArgs )
{
ParaRstFmt* pPara = (ParaRstFmt*)pArgs;
SwTxtNode * pTxtNode = (SwTxtNode*)rpNd->GetTxtNode();
if( pTxtNode && pTxtNode->GetpSwpHints() )
{
SwIndex aSt( pTxtNode, 0 );
- USHORT nEnd = pTxtNode->Len();
+ sal_uInt16 nEnd = pTxtNode->Len();
if( &pPara->pSttNd->nNode.GetNode() == pTxtNode &&
pPara->pSttNd->nContent.GetIndex() )
@@ -194,16 +196,16 @@ BOOL lcl_RstTxtAttr( const SwNodePtr& rpNd, void* pArgs )
pTxtNode->RstAttr( aSt, nEnd - aSt.GetIndex(), pPara->nWhich,
pPara->pDelSet, pPara->bInclRefToxMark );
}
- return TRUE;
+ return sal_True;
}
-BOOL lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs )
+sal_Bool lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs )
{
ParaRstFmt* pPara = (ParaRstFmt*)pArgs;
SwCntntNode* pNode = (SwCntntNode*)rpNd->GetCntntNode();
if( pNode && pNode->HasSwAttrSet() )
{
- const BOOL bLocked = pNode->IsModifyLocked();
+ const sal_Bool bLocked = pNode->IsModifyLocked();
pNode->LockModify();
SwDoc* pDoc = pNode->GetDoc();
@@ -220,7 +222,7 @@ BOOL lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs )
const SfxItemSet* pSet = pNode->GetpSwAttrSet();
// --> OD 2008-04-15 #refactorlists#
-// std::vector<USHORT> aClearWhichIds;
+// std::vector<sal_uInt16> aClearWhichIds;
SvUShorts aClearWhichIds;
// <--
// --> OD 2008-04-15 #refactorlists#
@@ -245,15 +247,15 @@ BOOL lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs )
// <--
const SfxPoolItem* pItem;
- // USHORT __READONLY_DATA aSavIds[ 3 ] = { RES_PAGEDESC, RES_BREAK, //#outline level,removed by zhaojianwei
+ // sal_uInt16 __READONLY_DATA aSavIds[ 3 ] = { RES_PAGEDESC, RES_BREAK, //#outline level,removed by zhaojianwei
// RES_PARATR_NUMRULE };
- //for( USHORT n = 0; n < 3; ++n )
- USHORT __READONLY_DATA aSavIds[ 4 ] = { RES_PAGEDESC, RES_BREAK, //->add by zhaojianwei
+ //for( sal_uInt16 n = 0; n < 3; ++n )
+ sal_uInt16 __READONLY_DATA aSavIds[ 4 ] = { RES_PAGEDESC, RES_BREAK, //->add by zhaojianwei
RES_PARATR_NUMRULE,
RES_PARATR_OUTLINELEVEL };
- for( USHORT n = 0; n < 4; ++n ) //<-end,zhaojianwei
+ for( sal_uInt16 n = 0; n < 4; ++n ) //<-end,zhaojianwei
{
- if( SFX_ITEM_SET == pSet->GetItemState( aSavIds[ n ], FALSE, &pItem ))
+ if( SFX_ITEM_SET == pSet->GetItemState( aSavIds[ n ], sal_False, &pItem ))
{
bool bSave = false;
switch( aSavIds[ n ] )
@@ -312,14 +314,14 @@ BOOL lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs )
// <--
SfxItemIter aIter( *pPara->pDelSet );
pItem = aIter.FirstItem();
- while( TRUE )
+ while( sal_True )
{
// --> OD 2008-04-14 #refactorlists#
//
if ( ( pItem->Which() != RES_PAGEDESC &&
pItem->Which() != RES_BREAK &&
pItem->Which() != RES_PARATR_NUMRULE ) ||
- ( aSet.GetItemState( pItem->Which(), FALSE ) != SFX_ITEM_SET ) )
+ ( aSet.GetItemState( pItem->Which(), sal_False ) != SFX_ITEM_SET ) )
{
pNode->ResetAttr( pItem->Which() );
}
@@ -350,30 +352,29 @@ BOOL lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs )
pNode->UnlockModify();
}
}
- return TRUE;
+ return sal_True;
}
-void SwDoc::RstTxtAttrs(const SwPaM &rRg, BOOL bInclRefToxMark )
+void SwDoc::RstTxtAttrs(const SwPaM &rRg, sal_Bool bInclRefToxMark )
{
SwHistory* pHst = 0;
SwDataChanged aTmp( rRg, 0 );
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
SwUndoResetAttr* pUndo = new SwUndoResetAttr( rRg, RES_CHRFMT );
pHst = &pUndo->GetHistory();
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
const SwPosition *pStt = rRg.Start(), *pEnd = rRg.End();
ParaRstFmt aPara( pStt, pEnd, pHst );
- aPara.bInclRefToxMark = ( bInclRefToxMark == TRUE );
+ aPara.bInclRefToxMark = ( bInclRefToxMark == sal_True );
GetNodes().ForEach( pStt->nNode.GetIndex(), pEnd->nNode.GetIndex()+1,
lcl_RstTxtAttr, &aPara );
SetModified();
}
void SwDoc::ResetAttrs( const SwPaM &rRg,
- BOOL bTxtAttr,
+ sal_Bool bTxtAttr,
const SvUShortsSort* pAttrs,
// --> OD 2008-11-28 #b96644#
const bool bSendDataChangedEvents )
@@ -382,7 +383,7 @@ void SwDoc::ResetAttrs( const SwPaM &rRg,
SwPaM* pPam = (SwPaM*)&rRg;
if( !bTxtAttr && pAttrs && pAttrs->Count() &&
RES_TXTATR_END > (*pAttrs)[ 0 ] )
- bTxtAttr = TRUE;
+ bTxtAttr = sal_True;
if( !rRg.HasMark() )
{
@@ -393,7 +394,7 @@ void SwDoc::ResetAttrs( const SwPaM &rRg,
pPam = new SwPaM( *rRg.GetPoint() );
SwIndex& rSt = pPam->GetPoint()->nContent;
- USHORT nMkPos, nPtPos = rSt.GetIndex();
+ sal_uInt16 nMkPos, nPtPos = rSt.GetIndex();
// JP 22.08.96: Sonderfall: steht der Crsr in einem URL-Attribut
// dann wird dessen Bereich genommen
@@ -412,7 +413,7 @@ void SwDoc::ResetAttrs( const SwPaM &rRg,
pTxtNd->GetTxt(), nPtPos,
pBreakIt->GetLocale( pTxtNd->GetLang( nPtPos ) ),
WordType::ANY_WORD /*ANYWORD_IGNOREWHITESPACES*/,
- TRUE );
+ sal_True );
if( aBndry.startPos < nPtPos && nPtPos < aBndry.endPos )
{
@@ -423,7 +424,7 @@ void SwDoc::ResetAttrs( const SwPaM &rRg,
{
nPtPos = nMkPos = rSt.GetIndex();
if( bTxtAttr )
- pTxtNd->DontExpandFmt( rSt, TRUE );
+ pTxtNd->DontExpandFmt( rSt, sal_True );
}
}
@@ -441,24 +442,23 @@ void SwDoc::ResetAttrs( const SwPaM &rRg,
}
// <--
SwHistory* pHst = 0;
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
SwUndoResetAttr* pUndo = new SwUndoResetAttr( rRg,
- static_cast<USHORT>(bTxtAttr ? RES_CONDTXTFMTCOLL : RES_TXTFMTCOLL ));
+ static_cast<sal_uInt16>(bTxtAttr ? RES_CONDTXTFMTCOLL : RES_TXTFMTCOLL ));
if( pAttrs && pAttrs->Count() )
{
pUndo->SetAttrs( *pAttrs );
}
pHst = &pUndo->GetHistory();
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
const SwPosition *pStt = pPam->Start(), *pEnd = pPam->End();
ParaRstFmt aPara( pStt, pEnd, pHst );
// mst: not including META here; it seems attrs with CH_TXTATR are omitted
- USHORT __FAR_DATA aResetableSetRange[] = {
+ sal_uInt16 __FAR_DATA aResetableSetRange[] = {
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
RES_CHRATR_BEGIN, RES_CHRATR_END-1,
RES_PARATR_BEGIN, RES_PARATR_END-1,
@@ -476,7 +476,7 @@ void SwDoc::ResetAttrs( const SwPaM &rRg,
SfxItemSet aDelSet( GetAttrPool(), aResetableSetRange );
if( pAttrs && pAttrs->Count() )
{
- for( USHORT n = pAttrs->Count(); n; )
+ for( sal_uInt16 n = pAttrs->Count(); n; )
if( POOLATTR_END > (*pAttrs)[ --n ] )
aDelSet.Put( *GetDfltAttr( (*pAttrs)[ n ] ));
@@ -484,7 +484,7 @@ void SwDoc::ResetAttrs( const SwPaM &rRg,
aPara.pDelSet = &aDelSet;
}
- BOOL bAdd = TRUE;
+ sal_Bool bAdd = sal_True;
SwNodeIndex aTmpStt( pStt->nNode );
SwNodeIndex aTmpEnd( pEnd->nNode );
if( pStt->nContent.GetIndex() ) // nur ein Teil
@@ -497,7 +497,7 @@ void SwDoc::ResetAttrs( const SwPaM &rRg,
const SfxPoolItem* pItem = aIter.GetCurItem();
SfxItemSet aCharSet( GetAttrPool(), RES_CHRATR_BEGIN, RES_CHRATR_END );
- while( TRUE )
+ while( sal_True )
{
if( IsInRange( aCharFmtSetRange, pItem->Which() ))
{
@@ -539,7 +539,7 @@ void SwDoc::ResetAttrs( const SwPaM &rRg,
}
if( pEnd->nContent.GetIndex() == pEnd->nNode.GetNode().GetCntntNode()->Len() )
// dann spaeter aufsetzen und alle CharFmtAttr -> TxtFmtAttr
- aTmpEnd++, bAdd = FALSE;
+ aTmpEnd++, bAdd = sal_False;
else if( pStt->nNode != pEnd->nNode || !pStt->nContent.GetIndex() )
{
SwTxtNode* pTNd = aTmpEnd.GetNode().GetTxtNode();
@@ -547,7 +547,7 @@ void SwDoc::ResetAttrs( const SwPaM &rRg,
{
SfxItemIter aIter( *pTNd->GetpSwAttrSet() );
const SfxPoolItem* pItem = aIter.GetCurItem();
- while( TRUE )
+ while( sal_True )
{
if( IsInRange( aCharFmtSetRange, pItem->Which() ))
{
@@ -615,7 +615,7 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
{
SfxItemIter aIter( rChgSet );
const SfxPoolItem* pItem = aIter.FirstItem();
- const USHORT nWhich = pItem->Which();
+ const sal_uInt16 nWhich = pItem->Which();
if ( isCHRATR(nWhich) ||
(RES_TXTATR_CHARFMT == nWhich) ||
@@ -695,7 +695,7 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
}
// <--
- SwNumFmt aNumFmt = pNumRule->Get(static_cast<USHORT>(pTxtNd->GetActualListLevel()));
+ SwNumFmt aNumFmt = pNumRule->Get(static_cast<sal_uInt16>(pTxtNd->GetActualListLevel()));
SwCharFmt * pCharFmt =
pDoc->FindCharFmtByName(aNumFmt.GetCharFmtName());
@@ -734,7 +734,7 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
pStt->nNode, pStt->nContent.GetIndex() );
if( pUndo )
- pUndo->SaveRedlineData( aPam, TRUE );
+ pUndo->SaveRedlineData( aPam, sal_True );
if( pDoc->IsRedlineOn() )
pDoc->AppendRedline( new SwRedline( nsRedlineType_t::REDLINE_INSERT, aPam ), true);
@@ -759,8 +759,8 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
aTxtSet.Put( rChgSet );
if( aTxtSet.Count() )
{
- USHORT nInsCnt = rSt.GetIndex();
- USHORT nEnd = pStt->nNode == pEnd->nNode
+ sal_uInt16 nInsCnt = rSt.GetIndex();
+ sal_uInt16 nEnd = pStt->nNode == pEnd->nNode
? pEnd->nContent.GetIndex()
: pNode->Len();
SwRegHistory history( pNode, *pNode, pHistory );
@@ -771,7 +771,7 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
&& pDoc->GetRedlineTbl().Count())))
{
// wurde Text-Inhalt eingefuegt? (RefMark/TOXMarks ohne Ende)
- BOOL bTxtIns = nInsCnt != rSt.GetIndex();
+ sal_Bool bTxtIns = nInsCnt != rSt.GetIndex();
// wurde Inhalt eingefuegt oder ueber die Selektion gesetzt?
SwPaM aPam( pStt->nNode, bTxtIns ? nInsCnt + 1 : nEnd,
pStt->nNode, nInsCnt );
@@ -795,7 +795,7 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
SwTableNode* pTblNd;
const SwFmtPageDesc* pDesc;
if( SFX_ITEM_SET == pOtherSet->GetItemState( RES_PAGEDESC,
- FALSE, (const SfxPoolItem**)&pDesc ))
+ sal_False, (const SfxPoolItem**)&pDesc ))
{
if( pNode )
{
@@ -844,7 +844,7 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
if( pNode && 0 == (nFlags & nsSetAttrMode::SETATTR_APICALL) &&
0 != (pTblNd = pNode->FindTableNode() ) &&
SFX_ITEM_SET == pOtherSet->GetItemState( RES_BREAK,
- FALSE, (const SfxPoolItem**)&pBreak ) )
+ sal_False, (const SfxPoolItem**)&pBreak ) )
{
SwTableNode* pCurTblNd = pTblNd;
while ( 0 != ( pCurTblNd = pCurTblNd->StartOfSectionNode()->FindTableNode() ) )
@@ -873,9 +873,9 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
{
// wenns eine PoolNumRule ist, diese ggfs. anlegen
const SwNumRuleItem* pRule;
- USHORT nPoolId;
+ sal_uInt16 nPoolId;
if( SFX_ITEM_SET == pOtherSet->GetItemState( RES_PARATR_NUMRULE,
- FALSE, (const SfxPoolItem**)&pRule ) &&
+ sal_False, (const SfxPoolItem**)&pRule ) &&
!pDoc->FindNumRulePtr( pRule->GetValue() ) &&
USHRT_MAX != (nPoolId = SwStyleNameMapper::GetPoolIdFromUIName ( pRule->GetValue(),
nsSwGetPoolIdFromName::GET_POOLID_NUMRULE )) )
@@ -896,7 +896,7 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
{
SwTxtNode* pTxtNd = static_cast<SwTxtNode*>(pNode);
const SwIndex& rSt = pStt->nContent;
- USHORT nMkPos, nPtPos = rSt.GetIndex();
+ sal_uInt16 nMkPos, nPtPos = rSt.GetIndex();
const String& rStr = pTxtNd->GetTxt();
// JP 22.08.96: Sonderfall: steht der Crsr in einem URL-Attribut
@@ -916,7 +916,7 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
pTxtNd->GetTxt(), nPtPos,
pBreakIt->GetLocale( pTxtNd->GetLang( nPtPos ) ),
WordType::ANY_WORD /*ANYWORD_IGNOREWHITESPACES*/,
- TRUE );
+ sal_True );
if( aBndry.startPos < nPtPos && nPtPos < aBndry.endPos )
{
@@ -958,7 +958,7 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
SwPaM aPam( *pNode, nMkPos, *pNode, nPtPos );
if( pUndo )
- pUndo->SaveRedlineData( aPam, FALSE );
+ pUndo->SaveRedlineData( aPam, sal_False );
pDoc->AppendRedline( new SwRedline( nsRedlineType_t::REDLINE_FORMAT, aPam ), true);
}
}
@@ -975,12 +975,12 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
if( pDoc->IsRedlineOn() && pCharSet && pCharSet->Count() )
{
if( pUndo )
- pUndo->SaveRedlineData( rRg, FALSE );
+ pUndo->SaveRedlineData( rRg, sal_False );
pDoc->AppendRedline( new SwRedline( nsRedlineType_t::REDLINE_FORMAT, rRg ), true);
}
/* jetzt wenn Bereich */
- ULONG nNodes = 0;
+ sal_uLong nNodes = 0;
SwNodeIndex aSt( pDoc->GetNodes() );
SwNodeIndex aEnd( pDoc->GetNodes() );
@@ -988,7 +988,7 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
if( pNode )
{
- USHORT nLen = pNode->Len();
+ sal_uInt16 nLen = pNode->Len();
if( pStt->nNode != pEnd->nNode )
aCntEnd.Assign( pNode, nLen );
@@ -1035,7 +1035,7 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
pNode = pEnd->nNode.GetNode().GetCntntNode();
if(pNode)
{
- USHORT nLen = pNode->Len();
+ sal_uInt16 nLen = pNode->Len();
if( aCntEnd.GetIndex() != nLen )
{
// the SwRegHistory inserts the attribute into the TxtNode!
@@ -1075,9 +1075,9 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
pDoc->GetNodes().ForEach( aSt, aEnd, lcl_RstTxtAttr, &aPara );
}
- BOOL bCreateSwpHints = pCharSet && (
- SFX_ITEM_SET == pCharSet->GetItemState( RES_TXTATR_CHARFMT, FALSE ) ||
- SFX_ITEM_SET == pCharSet->GetItemState( RES_TXTATR_INETFMT, FALSE ) );
+ sal_Bool bCreateSwpHints = pCharSet && (
+ SFX_ITEM_SET == pCharSet->GetItemState( RES_TXTATR_CHARFMT, sal_False ) ||
+ SFX_ITEM_SET == pCharSet->GetItemState( RES_TXTATR_INETFMT, sal_False ) );
for(; aSt < aEnd; aSt++ )
{
@@ -1125,9 +1125,9 @@ bool SwDoc::InsertPoolItem( const SwPaM &rRg, const SfxPoolItem &rHt,
{
SwDataChanged aTmp( rRg, 0 );
SwUndoAttr* pUndoAttr = 0;
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
+ GetIDocumentUndoRedo().ClearRedo();
pUndoAttr = new SwUndoAttr( rRg, rHt, nFlags );
}
@@ -1135,8 +1135,10 @@ bool SwDoc::InsertPoolItem( const SwPaM &rRg, const SfxPoolItem &rHt,
aSet.Put( rHt );
bool bRet = lcl_InsAttr( this, rRg, aSet, nFlags, pUndoAttr );
- if( DoesUndo() )
- AppendUndo( pUndoAttr );
+ if (GetIDocumentUndoRedo().DoesUndo())
+ {
+ GetIDocumentUndoRedo().AppendUndo( pUndoAttr );
+ }
if( bRet )
SetModified();
@@ -1148,16 +1150,18 @@ bool SwDoc::InsertItemSet ( const SwPaM &rRg, const SfxItemSet &rSet,
{
SwDataChanged aTmp( rRg, 0 );
SwUndoAttr* pUndoAttr = 0;
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
+ GetIDocumentUndoRedo().ClearRedo();
pUndoAttr = new SwUndoAttr( rRg, rSet, nFlags );
}
bool bRet = lcl_InsAttr( this, rRg, rSet, nFlags, pUndoAttr );
- if( DoesUndo() )
- AppendUndo( pUndoAttr );
+ if (GetIDocumentUndoRedo().DoesUndo())
+ {
+ GetIDocumentUndoRedo().AppendUndo( pUndoAttr );
+ }
if( bRet )
SetModified();
@@ -1179,14 +1183,17 @@ void SwDoc::SetAttr( const SfxPoolItem& rAttr, SwFmt& rFmt )
// das alte in die Undo-History aufgenommen
void SwDoc::SetAttr( const SfxItemSet& rSet, SwFmt& rFmt )
{
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
SwUndoFmtAttrHelper aTmp( rFmt );
rFmt.SetFmtAttr( rSet );
if ( aTmp.GetUndo() )
{
- AppendUndo( aTmp.ReleaseUndo() );
+ GetIDocumentUndoRedo().AppendUndo( aTmp.ReleaseUndo() );
+ }
+ else
+ {
+ GetIDocumentUndoRedo().ClearRedo();
}
}
else
@@ -1197,19 +1204,21 @@ void SwDoc::SetAttr( const SfxItemSet& rSet, SwFmt& rFmt )
}
// --> OD 2008-02-12 #newlistlevelattrs#
-void SwDoc::ResetAttrAtFormat( const USHORT nWhichId,
+void SwDoc::ResetAttrAtFormat( const sal_uInt16 nWhichId,
SwFmt& rChangedFormat )
{
- SwUndo* pUndo = 0;
- if ( DoesUndo() )
- pUndo = new SwUndoFmtResetAttr( rChangedFormat, nWhichId );
+ SwUndo *const pUndo = (GetIDocumentUndoRedo().DoesUndo())
+ ? new SwUndoFmtResetAttr( rChangedFormat, nWhichId )
+ : 0;
- const BOOL bAttrReset = rChangedFormat.ResetFmtAttr( nWhichId );
+ const sal_Bool bAttrReset = rChangedFormat.ResetFmtAttr( nWhichId );
if ( bAttrReset )
{
if ( pUndo )
- AppendUndo( pUndo );
+ {
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
+ }
SetModified();
}
@@ -1227,14 +1236,14 @@ int lcl_SetNewDefTabStops( SwTwips nOldWidth, SwTwips nNewWidth,
// auf dem gleichen TabStop (gepoolt!) vorgenommen
// wird. Als Modify wird ein FmtChg verschickt.
- USHORT nOldCnt = rChgTabStop.Count();
+ sal_uInt16 nOldCnt = rChgTabStop.Count();
if( !nOldCnt || nOldWidth == nNewWidth )
- return FALSE;
+ return sal_False;
// suche den Anfang der Defaults
SvxTabStop* pTabs = ((SvxTabStop*)rChgTabStop.GetStart())
+ (nOldCnt-1);
- USHORT n;
+ sal_uInt16 n;
for( n = nOldCnt; n ; --n, --pTabs )
if( SVX_TAB_ADJUST_DEFAULT != pTabs->GetAdjustment() )
@@ -1242,7 +1251,7 @@ int lcl_SetNewDefTabStops( SwTwips nOldWidth, SwTwips nNewWidth,
++n;
if( n < nOldCnt ) // die DefTabStops loeschen
rChgTabStop.Remove( n, nOldCnt - n );
- return TRUE;
+ return sal_True;
}
// Setze das Attribut als neues default Attribut in diesem Dokument.
@@ -1263,12 +1272,12 @@ void SwDoc::SetDefault( const SfxItemSet& rSet )
SwAttrSet aOld( GetAttrPool(), rSet.GetRanges() ),
aNew( GetAttrPool(), rSet.GetRanges() );
SfxItemIter aIter( rSet );
- USHORT nWhich;
+ sal_uInt16 nWhich;
const SfxPoolItem* pItem = aIter.GetCurItem();
SfxItemPool* pSdrPool = GetAttrPool().GetSecondaryPool();
- while( TRUE )
+ while( sal_True )
{
- BOOL bCheckSdrDflt = FALSE;
+ sal_Bool bCheckSdrDflt = sal_False;
nWhich = pItem->Which();
aOld.Put( GetAttrPool().GetDefaultItem( nWhich ) );
GetAttrPool().SetPoolDefaultItem( *pItem );
@@ -1306,7 +1315,7 @@ void SwDoc::SetDefault( const SfxItemSet& rSet )
// copy also the defaults
if( bCheckSdrDflt )
{
- USHORT nEdtWhich, nSlotId;
+ sal_uInt16 nEdtWhich, nSlotId;
if( 0 != (nSlotId = GetAttrPool().GetSlotId( nWhich ) ) &&
nSlotId != nWhich &&
0 != (nEdtWhich = pSdrPool->GetWhich( nSlotId )) &&
@@ -1326,15 +1335,14 @@ void SwDoc::SetDefault( const SfxItemSet& rSet )
if( aNew.Count() && aCallMod.GetDepends() )
{
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoDefaultAttr( aOld ) );
+ GetIDocumentUndoRedo().AppendUndo( new SwUndoDefaultAttr( aOld ) );
}
const SfxPoolItem* pTmpItem;
if( ( SFX_ITEM_SET ==
- aNew.GetItemState( RES_PARATR_TABSTOP, FALSE, &pTmpItem ) ) &&
+ aNew.GetItemState( RES_PARATR_TABSTOP, sal_False, &pTmpItem ) ) &&
((SvxTabStopItem*)pTmpItem)->Count() )
{
// TabStop-Aenderungen behandeln wir erstmal anders:
@@ -1346,7 +1354,7 @@ void SwDoc::SetDefault( const SfxItemSet& rSet )
SwTwips nNewWidth = (*(SvxTabStopItem*)pTmpItem)[ 0 ].GetTabPos(),
nOldWidth = ((SvxTabStopItem&)aOld.Get(RES_PARATR_TABSTOP))[ 0 ].GetTabPos();
- int bChg = FALSE;
+ int bChg = sal_False;
sal_uInt32 nMaxItems = GetAttrPool().GetItemCount2( RES_PARATR_TABSTOP );
for( sal_uInt32 n = 0; n < nMaxItems; ++n )
if( 0 != (pTmpItem = GetAttrPool().GetItem2( RES_PARATR_TABSTOP, n ) ))
@@ -1380,7 +1388,7 @@ void SwDoc::SetDefault( const SfxItemSet& rSet )
}
// Erfrage das Default Attribut in diesem Dokument.
-const SfxPoolItem& SwDoc::GetDefault( USHORT nFmtHint ) const
+const SfxPoolItem& SwDoc::GetDefault( sal_uInt16 nFmtHint ) const
{
return GetAttrPool().GetDefaultItem( nFmtHint );
}
@@ -1388,7 +1396,7 @@ const SfxPoolItem& SwDoc::GetDefault( USHORT nFmtHint ) const
/*
* Loeschen der Formate
*/
-void SwDoc::DelCharFmt(USHORT nFmt, BOOL bBroadcast)
+void SwDoc::DelCharFmt(sal_uInt16 nFmt, sal_Bool bBroadcast)
{
SwCharFmt * pDel = (*pCharFmtTbl)[nFmt];
@@ -1396,12 +1404,12 @@ void SwDoc::DelCharFmt(USHORT nFmt, BOOL bBroadcast)
BroadcastStyleOperation(pDel->GetName(), SFX_STYLE_FAMILY_CHAR,
SFX_STYLESHEET_ERASED);
- if (DoesUndo())
+ if (GetIDocumentUndoRedo().DoesUndo())
{
SwUndo * pUndo =
new SwUndoCharFmtDelete(pDel, this);
- AppendUndo(pUndo);
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
pCharFmtTbl->DeleteAndDestroy(nFmt);
@@ -1409,15 +1417,15 @@ void SwDoc::DelCharFmt(USHORT nFmt, BOOL bBroadcast)
SetModified();
}
-void SwDoc::DelCharFmt( SwCharFmt *pFmt, BOOL bBroadcast )
+void SwDoc::DelCharFmt( SwCharFmt *pFmt, sal_Bool bBroadcast )
{
- USHORT nFmt = pCharFmtTbl->GetPos( pFmt );
+ sal_uInt16 nFmt = pCharFmtTbl->GetPos( pFmt );
ASSERT( USHRT_MAX != nFmt, "Fmt not found," );
DelCharFmt( nFmt, bBroadcast );
}
-void SwDoc::DelFrmFmt( SwFrmFmt *pFmt, BOOL bBroadcast )
+void SwDoc::DelFrmFmt( SwFrmFmt *pFmt, sal_Bool bBroadcast )
{
if( pFmt->ISA( SwTableBoxFmt ) || pFmt->ISA( SwTableLineFmt ))
{
@@ -1430,7 +1438,7 @@ void SwDoc::DelFrmFmt( SwFrmFmt *pFmt, BOOL bBroadcast )
//Das Format muss in einem der beiden Arrays stehen, in welchem
//werden wir schon merken.
- USHORT nPos;
+ sal_uInt16 nPos;
if ( USHRT_MAX != ( nPos = pFrmFmtTbl->GetPos( pFmt )) )
{
if (bBroadcast)
@@ -1438,11 +1446,11 @@ void SwDoc::DelFrmFmt( SwFrmFmt *pFmt, BOOL bBroadcast )
SFX_STYLE_FAMILY_FRAME,
SFX_STYLESHEET_ERASED);
- if (DoesUndo())
+ if (GetIDocumentUndoRedo().DoesUndo())
{
SwUndo * pUndo = new SwUndoFrmFmtDelete(pFmt, this);
- AppendUndo(pUndo);
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
pFrmFmtTbl->DeleteAndDestroy( nPos );
@@ -1459,7 +1467,7 @@ void SwDoc::DelFrmFmt( SwFrmFmt *pFmt, BOOL bBroadcast )
void SwDoc::DelTblFrmFmt( SwTableFmt *pFmt )
{
- USHORT nPos = pTblFrmFmtTbl->GetPos( pFmt );
+ sal_uInt16 nPos = pTblFrmFmtTbl->GetPos( pFmt );
ASSERT( USHRT_MAX != nPos, "Fmt not found," );
pTblFrmFmtTbl->DeleteAndDestroy( nPos );
}
@@ -1486,13 +1494,13 @@ SwDrawFrmFmt *SwDoc::MakeDrawFrmFmt( const String &rFmtName,
}
-USHORT SwDoc::GetTblFrmFmtCount(BOOL bUsed) const
+sal_uInt16 SwDoc::GetTblFrmFmtCount(sal_Bool bUsed) const
{
- USHORT nCount = pTblFrmFmtTbl->Count();
+ sal_uInt16 nCount = pTblFrmFmtTbl->Count();
if(bUsed)
{
- SwAutoFmtGetDocNode aGetHt( &aNodes );
- for ( USHORT i = nCount; i; )
+ SwAutoFmtGetDocNode aGetHt( &GetNodes() );
+ for ( sal_uInt16 i = nCount; i; )
{
if((*pTblFrmFmtTbl)[--i]->GetInfo( aGetHt ))
@@ -1504,14 +1512,13 @@ USHORT SwDoc::GetTblFrmFmtCount(BOOL bUsed) const
}
-SwFrmFmt& SwDoc::GetTblFrmFmt(USHORT nFmt, BOOL bUsed ) const
+SwFrmFmt& SwDoc::GetTblFrmFmt(sal_uInt16 nFmt, sal_Bool bUsed ) const
{
- USHORT nRemoved = 0;
+ sal_uInt16 nRemoved = 0;
if(bUsed)
{
- SwAutoFmtGetDocNode aGetHt( &aNodes );
-
- for ( USHORT i = 0; i <= nFmt; i++ )
+ SwAutoFmtGetDocNode aGetHt( &GetNodes() );
+ for ( sal_uInt16 i = 0; i <= nFmt; i++ )
{
while ( (*pTblFrmFmtTbl)[ i + nRemoved]->GetInfo( aGetHt ))
{
@@ -1534,7 +1541,7 @@ SwTableFmt* SwDoc::MakeTblFrmFmt( const String &rFmtName,
SwFrmFmt *SwDoc::MakeFrmFmt(const String &rFmtName,
SwFrmFmt *pDerivedFrom,
- BOOL bBroadcast, BOOL bAuto)
+ sal_Bool bBroadcast, sal_Bool bAuto)
{
SwFrmFmt *pFmt = new SwFrmFmt( GetAttrPool(), rFmtName, pDerivedFrom );
@@ -1548,11 +1555,11 @@ SwFrmFmt *SwDoc::MakeFrmFmt(const String &rFmtName,
BroadcastStyleOperation(rFmtName, SFX_STYLE_FAMILY_PARA,
SFX_STYLESHEET_CREATED);
- if (DoesUndo())
+ if (GetIDocumentUndoRedo().DoesUndo())
{
SwUndo * pUndo = new SwUndoFrmFmtCreate(pFmt, pDerivedFrom, this);
- AppendUndo(pUndo);
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
}
@@ -1561,7 +1568,7 @@ SwFrmFmt *SwDoc::MakeFrmFmt(const String &rFmtName,
SwFmt *SwDoc::_MakeFrmFmt(const String &rFmtName,
SwFmt *pDerivedFrom,
- BOOL bBroadcast, BOOL bAuto)
+ sal_Bool bBroadcast, sal_Bool bAuto)
{
SwFrmFmt *pFrmFmt = dynamic_cast<SwFrmFmt*>(pDerivedFrom);
pFrmFmt = MakeFrmFmt( rFmtName, pFrmFmt, bBroadcast, bAuto );
@@ -1572,20 +1579,20 @@ SwFmt *SwDoc::_MakeFrmFmt(const String &rFmtName,
// --> OD 2005-01-13 #i40550# - add parameter <bAuto> - not relevant
SwCharFmt *SwDoc::MakeCharFmt( const String &rFmtName,
SwCharFmt *pDerivedFrom,
- BOOL bBroadcast,
- BOOL )
+ sal_Bool bBroadcast,
+ sal_Bool )
// <--
{
SwCharFmt *pFmt = new SwCharFmt( GetAttrPool(), rFmtName, pDerivedFrom );
pCharFmtTbl->Insert( pFmt, pCharFmtTbl->Count() );
- pFmt->SetAuto( FALSE );
+ pFmt->SetAuto( sal_False );
SetModified();
- if (DoesUndo())
+ if (GetIDocumentUndoRedo().DoesUndo())
{
SwUndo * pUndo = new SwUndoCharFmtCreate(pFmt, pDerivedFrom, this);
- AppendUndo(pUndo);
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
if (bBroadcast)
@@ -1599,7 +1606,7 @@ SwCharFmt *SwDoc::MakeCharFmt( const String &rFmtName,
SwFmt *SwDoc::_MakeCharFmt(const String &rFmtName,
SwFmt *pDerivedFrom,
- BOOL bBroadcast, BOOL bAuto)
+ sal_Bool bBroadcast, sal_Bool bAuto)
{
SwCharFmt *pCharFmt = dynamic_cast<SwCharFmt*>(pDerivedFrom);
pCharFmt = MakeCharFmt( rFmtName, pCharFmt, bBroadcast, bAuto );
@@ -1614,21 +1621,21 @@ SwFmt *SwDoc::_MakeCharFmt(const String &rFmtName,
// --> OD 2005-01-13 #i40550# - add parameter <bAuto> - not relevant
SwTxtFmtColl* SwDoc::MakeTxtFmtColl( const String &rFmtName,
SwTxtFmtColl *pDerivedFrom,
- BOOL bBroadcast,
- BOOL )
+ sal_Bool bBroadcast,
+ sal_Bool )
// <--
{
SwTxtFmtColl *pFmtColl = new SwTxtFmtColl( GetAttrPool(), rFmtName,
pDerivedFrom );
pTxtFmtCollTbl->Insert(pFmtColl, pTxtFmtCollTbl->Count());
- pFmtColl->SetAuto( FALSE );
+ pFmtColl->SetAuto( sal_False );
SetModified();
- if (DoesUndo())
+ if (GetIDocumentUndoRedo().DoesUndo())
{
SwUndo * pUndo = new SwUndoTxtFmtCollCreate(pFmtColl, pDerivedFrom,
this);
- AppendUndo(pUndo);
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
if (bBroadcast)
@@ -1640,7 +1647,7 @@ SwTxtFmtColl* SwDoc::MakeTxtFmtColl( const String &rFmtName,
SwFmt *SwDoc::_MakeTxtFmtColl(const String &rFmtName,
SwFmt *pDerivedFrom,
- BOOL bBroadcast, BOOL bAuto)
+ sal_Bool bBroadcast, sal_Bool bAuto)
{
SwTxtFmtColl *pTxtFmtColl = dynamic_cast<SwTxtFmtColl*>(pDerivedFrom);
pTxtFmtColl = MakeTxtFmtColl( rFmtName, pTxtFmtColl, bBroadcast, bAuto );
@@ -1651,12 +1658,12 @@ SwFmt *SwDoc::_MakeTxtFmtColl(const String &rFmtName,
//FEATURE::CONDCOLL
SwConditionTxtFmtColl* SwDoc::MakeCondTxtFmtColl( const String &rFmtName,
SwTxtFmtColl *pDerivedFrom,
- BOOL bBroadcast)
+ sal_Bool bBroadcast)
{
SwConditionTxtFmtColl*pFmtColl = new SwConditionTxtFmtColl( GetAttrPool(),
rFmtName, pDerivedFrom );
pTxtFmtCollTbl->Insert(pFmtColl, pTxtFmtCollTbl->Count());
- pFmtColl->SetAuto( FALSE );
+ pFmtColl->SetAuto( sal_False );
SetModified();
if (bBroadcast)
@@ -1675,12 +1682,12 @@ SwGrfFmtColl* SwDoc::MakeGrfFmtColl( const String &rFmtName,
SwGrfFmtColl *pFmtColl = new SwGrfFmtColl( GetAttrPool(), rFmtName,
pDerivedFrom );
pGrfFmtCollTbl->Insert( pFmtColl, pGrfFmtCollTbl->Count() );
- pFmtColl->SetAuto( FALSE );
+ pFmtColl->SetAuto( sal_False );
SetModified();
return pFmtColl;
}
-void SwDoc::DelTxtFmtColl(USHORT nFmtColl, BOOL bBroadcast)
+void SwDoc::DelTxtFmtColl(sal_uInt16 nFmtColl, sal_Bool bBroadcast)
{
ASSERT( nFmtColl, "Remove fuer Coll 0." );
@@ -1693,12 +1700,12 @@ void SwDoc::DelTxtFmtColl(USHORT nFmtColl, BOOL bBroadcast)
BroadcastStyleOperation(pDel->GetName(), SFX_STYLE_FAMILY_PARA,
SFX_STYLESHEET_ERASED);
- if (DoesUndo())
+ if (GetIDocumentUndoRedo().DoesUndo())
{
SwUndoTxtFmtCollDelete * pUndo =
new SwUndoTxtFmtCollDelete(pDel, this);
- AppendUndo(pUndo);
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
// Die FmtColl austragen
@@ -1710,14 +1717,14 @@ void SwDoc::DelTxtFmtColl(USHORT nFmtColl, BOOL bBroadcast)
SetModified();
}
-void SwDoc::DelTxtFmtColl( SwTxtFmtColl *pColl, BOOL bBroadcast )
+void SwDoc::DelTxtFmtColl( SwTxtFmtColl *pColl, sal_Bool bBroadcast )
{
- USHORT nFmt = pTxtFmtCollTbl->GetPos( pColl );
+ sal_uInt16 nFmt = pTxtFmtCollTbl->GetPos( pColl );
ASSERT( USHRT_MAX != nFmt, "Collection not found," );
DelTxtFmtColl( nFmt, bBroadcast );
}
-BOOL lcl_SetTxtFmtColl( const SwNodePtr& rpNode, void* pArgs )
+sal_Bool lcl_SetTxtFmtColl( const SwNodePtr& rpNode, void* pArgs )
{
// ParaSetFmtColl * pPara = (ParaSetFmtColl*)pArgs;
SwCntntNode* pCNd = (SwCntntNode*)rpNode->GetTxtNode();
@@ -1794,10 +1801,10 @@ BOOL lcl_SetTxtFmtColl( const SwNodePtr& rpNode, void* pArgs )
pPara->nWhich++;
}
- return TRUE;
+ return sal_True;
}
-BOOL SwDoc::SetTxtFmtColl( const SwPaM &rRg,
+sal_Bool SwDoc::SetTxtFmtColl( const SwPaM &rRg,
SwTxtFmtColl *pFmt,
bool bReset,
bool bResetListAttrs )
@@ -1805,18 +1812,17 @@ BOOL SwDoc::SetTxtFmtColl( const SwPaM &rRg,
SwDataChanged aTmp( rRg, 0 );
const SwPosition *pStt = rRg.Start(), *pEnd = rRg.End();
SwHistory* pHst = 0;
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
// --> OD 2008-04-15 #refactorlists#
SwUndoFmtColl* pUndo = new SwUndoFmtColl( rRg, pFmt,
bReset,
bResetListAttrs );
// <--
pHst = pUndo->GetHistory();
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
ParaRstFmt aPara( pStt, pEnd, pHst );
@@ -1829,7 +1835,7 @@ BOOL SwDoc::SetTxtFmtColl( const SwPaM &rRg,
GetNodes().ForEach( pStt->nNode.GetIndex(), pEnd->nNode.GetIndex()+1,
lcl_SetTxtFmtColl, &aPara );
if( !aPara.nWhich )
- bRet = FALSE; // keinen gueltigen Node gefunden
+ bRet = sal_False; // keinen gueltigen Node gefunden
if( bRet )
SetModified();
@@ -1846,7 +1852,7 @@ SwFmt* SwDoc::CopyFmt( const SwFmt& rFmt,
// kein-Autoformat || default Format || Collection-Format
// dann suche danach.
if( !rFmt.IsAuto() || !rFmt.GetRegisteredIn() )
- for( USHORT n = 0; n < rFmtArr.Count(); n++ )
+ for( sal_uInt16 n = 0; n < rFmtArr.Count(); n++ )
{
// ist die Vorlage schon im Doc vorhanden ??
if( ((SwFmt*)rFmtArr[n])->GetName().Equals( rFmt.GetName() ))
@@ -1861,10 +1867,10 @@ SwFmt* SwDoc::CopyFmt( const SwFmt& rFmt,
// erzeuge das Format und kopiere die Attribute
// --> OD 2005-01-13 #i40550#
- SwFmt* pNewFmt = (this->*fnCopyFmt)( rFmt.GetName(), pParent, FALSE, TRUE );
+ SwFmt* pNewFmt = (this->*fnCopyFmt)( rFmt.GetName(), pParent, sal_False, sal_True );
// <--
pNewFmt->SetAuto( rFmt.IsAuto() );
- pNewFmt->CopyAttrs( rFmt, TRUE ); // kopiere Attribute
+ pNewFmt->CopyAttrs( rFmt, sal_True ); // kopiere Attribute
pNewFmt->SetPoolFmtId( rFmt.GetPoolFmtId() );
pNewFmt->SetPoolHelpId( rFmt.GetPoolHelpId() );
@@ -1913,7 +1919,7 @@ SwTxtFmtColl* SwDoc::CopyTxtColl( const SwTxtFmtColl& rColl )
pNewColl = new SwConditionTxtFmtColl( GetAttrPool(), rColl.GetName(),
pParent);
pTxtFmtCollTbl->Insert( pNewColl, pTxtFmtCollTbl->Count() );
- pNewColl->SetAuto( FALSE );
+ pNewColl->SetAuto( sal_False );
SetModified();
// Kopiere noch die Bedingungen
@@ -1925,7 +1931,7 @@ SwTxtFmtColl* SwDoc::CopyTxtColl( const SwTxtFmtColl& rColl )
pNewColl = MakeTxtFmtColl( rColl.GetName(), pParent );
// kopiere jetzt noch die Auto-Formate oder kopiere die Attribute
- pNewColl->CopyAttrs( rColl, TRUE );
+ pNewColl->CopyAttrs( rColl, sal_True );
// setze noch den Outline-Level
//if( NO_NUMBERING != rColl.GetOutlineLevel() ) //#outline level,zhaojianwei
@@ -1947,7 +1953,7 @@ SwTxtFmtColl* SwDoc::CopyTxtColl( const SwTxtFmtColl& rColl )
{
const SfxPoolItem* pItem;
if( SFX_ITEM_SET == pNewColl->GetItemState( RES_PARATR_NUMRULE,
- FALSE, &pItem ))
+ sal_False, &pItem ))
{
const SwNumRule* pRule;
const String& rName = ((SwNumRuleItem*)pItem)->GetValue();
@@ -1957,7 +1963,7 @@ SwTxtFmtColl* SwDoc::CopyTxtColl( const SwTxtFmtColl& rColl )
{
SwNumRule* pDestRule = FindNumRulePtr( rName );
if( pDestRule )
- pDestRule->SetInvalidRule( TRUE );
+ pDestRule->SetInvalidRule( sal_True );
else
MakeNumRule( rName, pRule );
}
@@ -1996,7 +2002,7 @@ SwGrfFmtColl* SwDoc::CopyGrfColl( const SwGrfFmtColl& rColl )
SwPageDesc* lcl_FindPageDesc( const SwPageDescs& rArr, const String& rName )
{
- for( USHORT n = rArr.Count(); n; )
+ for( sal_uInt16 n = rArr.Count(); n; )
{
SwPageDesc* pDesc = rArr[ --n ];
if( pDesc->GetName() == rName )
@@ -2010,7 +2016,7 @@ void SwDoc::CopyFmtArr( const SvPtrarr& rSourceArr,
FNCopyFmt fnCopyFmt,
SwFmt& rDfltFmt )
{
- USHORT nSrc;
+ sal_uInt16 nSrc;
SwFmt* pSrc, *pDest;
// 1. Schritt alle Formate anlegen (das 0. ueberspringen - Default!)
@@ -2026,7 +2032,7 @@ void SwDoc::CopyFmtArr( const SvPtrarr& rSourceArr,
MakeCondTxtFmtColl( pSrc->GetName(), (SwTxtFmtColl*)&rDfltFmt );
else
// --> OD 2005-01-13 #i40550#
- (this->*fnCopyFmt)( pSrc->GetName(), &rDfltFmt, FALSE, TRUE );
+ (this->*fnCopyFmt)( pSrc->GetName(), &rDfltFmt, sal_False, sal_True );
// <--
}
}
@@ -2039,14 +2045,21 @@ void SwDoc::CopyFmtArr( const SvPtrarr& rSourceArr,
continue;
pDest = FindFmtByName( rDestArr, pSrc->GetName() );
+<<<<<<< local
pDest->SetAuto( FALSE );
+=======
+ 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!
+>>>>>>> other
pDest->DelDiffs( *pSrc );
// #i94285#: existing <SwFmtPageDesc> instance, before copying attributes
const SfxPoolItem* pItem;
if( &GetAttrPool() != pSrc->GetAttrSet().GetPool() &&
SFX_ITEM_SET == pSrc->GetAttrSet().GetItemState(
- RES_PAGEDESC, FALSE, &pItem ) &&
+ RES_PAGEDESC, sal_False, &pItem ) &&
((SwFmtPageDesc*)pItem)->GetPageDesc() )
{
SwFmtPageDesc aPageDesc( *(SwFmtPageDesc*)pItem );
@@ -2107,9 +2120,9 @@ void SwDoc::CopyPageDescHeaderFooterImpl( bool bCpyHeader,
{
// jetzt noch Header-/Footer-Attribute richtig behandeln
// Contenten Nodes Dokumentuebergreifend kopieren!
- USHORT nAttr = static_cast<USHORT>( bCpyHeader ? RES_HEADER : RES_FOOTER );
+ sal_uInt16 nAttr = static_cast<sal_uInt16>( bCpyHeader ? RES_HEADER : RES_FOOTER );
const SfxPoolItem* pItem;
- if( SFX_ITEM_SET != rSrcFmt.GetAttrSet().GetItemState( nAttr, FALSE, &pItem ))
+ if( SFX_ITEM_SET != rSrcFmt.GetAttrSet().GetItemState( nAttr, sal_False, &pItem ))
return ;
// Im Header steht noch der Verweis auf das Format aus dem
@@ -2126,10 +2139,10 @@ void SwDoc::CopyPageDescHeaderFooterImpl( bool bCpyHeader,
{
SwFrmFmt* pNewFmt = new SwFrmFmt( GetAttrPool(), "CpyDesc",
GetDfltFrmFmt() );
- pNewFmt->CopyAttrs( *pOldFmt, TRUE );
+ pNewFmt->CopyAttrs( *pOldFmt, sal_True );
if( SFX_ITEM_SET == pNewFmt->GetAttrSet().GetItemState(
- RES_CNTNT, FALSE, &pItem ))
+ RES_CNTNT, sal_False, &pItem ))
{
SwFmtCntnt* pCntnt = (SwFmtCntnt*)pItem;
if( pCntnt->GetCntntIdx() )
@@ -2161,17 +2174,21 @@ void SwDoc::CopyPageDescHeaderFooterImpl( bool bCpyHeader,
}
void SwDoc::CopyPageDesc( const SwPageDesc& rSrcDesc, SwPageDesc& rDstDesc,
- BOOL bCopyPoolIds )
+ sal_Bool bCopyPoolIds )
{
+<<<<<<< local
BOOL bNotifyLayout = FALSE;
SwRootFrm* pTmpRoot = GetCurrentLayout();//swmod 080219
+=======
+ sal_Bool bNotifyLayout = sal_False;
+>>>>>>> other
rDstDesc.SetLandscape( rSrcDesc.GetLandscape() );
rDstDesc.SetNumType( rSrcDesc.GetNumType() );
if( rDstDesc.ReadUseOn() != rSrcDesc.ReadUseOn() )
{
rDstDesc.WriteUseOn( rSrcDesc.ReadUseOn() );
- bNotifyLayout = TRUE;
+ bNotifyLayout = sal_True;
}
if( bCopyPoolIds )
@@ -2189,12 +2206,12 @@ void SwDoc::CopyPageDesc( const SwPageDesc& rSrcDesc, SwPageDesc& rDstDesc,
if( !pFollow )
{
// dann mal kopieren
- USHORT nPos = MakePageDesc( rSrcDesc.GetFollow()->GetName() );
+ sal_uInt16 nPos = MakePageDesc( rSrcDesc.GetFollow()->GetName() );
pFollow = aPageDescs[ nPos ];
CopyPageDesc( *rSrcDesc.GetFollow(), *pFollow );
}
rDstDesc.SetFollow( pFollow );
- bNotifyLayout = TRUE;
+ bNotifyLayout = sal_True;
}
// die Header/Footer-Attribute werden gesondert kopiert, die Content-
@@ -2251,8 +2268,7 @@ void SwDoc::CopyPageDesc( const SwPageDesc& rSrcDesc, SwPageDesc& rDstDesc,
void SwDoc::ReplaceStyles( SwDoc& rSource )
{
- BOOL bIsUndo = DoesUndo();
- DoUndo( FALSE );
+ ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
CopyFmtArr( *rSource.pCharFmtTbl, *pCharFmtTbl,
&SwDoc::_MakeCharFmt, *pDfltCharFmt );
@@ -2262,7 +2278,7 @@ void SwDoc::ReplaceStyles( SwDoc& rSource )
&SwDoc::_MakeTxtFmtColl, *pDfltTxtFmtColl );
// und jetzt noch die Seiten-Vorlagen
- USHORT nCnt = rSource.aPageDescs.Count();
+ sal_uInt16 nCnt = rSource.aPageDescs.Count();
if( nCnt )
{
// ein anderes Doc -> Numberformatter muessen gemergt werden
@@ -2289,7 +2305,7 @@ void SwDoc::ReplaceStyles( SwDoc& rSource )
if( nCnt )
{
const SwNumRuleTbl& rArr = rSource.GetNumRuleTbl();
- for( USHORT n = 0; n < nCnt; ++n )
+ for( sal_uInt16 n = 0; n < nCnt; ++n )
{
const SwNumRule& rR = *rArr[ n ];
if( !rR.IsAutoRule() )
@@ -2303,22 +2319,20 @@ void SwDoc::ReplaceStyles( SwDoc& rSource )
}
}
- if( bIsUndo )
+ if (undoGuard.UndoWasEnabled())
{
- // es wurde am Nodes-Array gedreht!
- ClearRedo();
- DelAllUndoObj();
+ // nodes array was modified!
+ GetIDocumentUndoRedo().DelAllUndoObj();
}
SetModified();
- DoUndo( bIsUndo );
}
SwFmt* SwDoc::FindFmtByName( const SvPtrarr& rFmtArr,
const String& rName ) const
{
SwFmt* pFnd = 0;
- for( USHORT n = 0; n < rFmtArr.Count(); n++ )
+ for( sal_uInt16 n = 0; n < rFmtArr.Count(); n++ )
{
// ist die Vorlage schon im Doc vorhanden ??
if( ((SwFmt*)rFmtArr[n])->GetName() == rName )
@@ -2330,21 +2344,20 @@ SwFmt* SwDoc::FindFmtByName( const SvPtrarr& rFmtArr,
return pFnd;
}
-void SwDoc::MoveLeftMargin( const SwPaM& rPam, BOOL bRight, BOOL bModulus )
+void SwDoc::MoveLeftMargin( const SwPaM& rPam, sal_Bool bRight, sal_Bool bModulus )
{
SwHistory* pHistory = 0;
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
SwUndoMoveLeftMargin* pUndo = new SwUndoMoveLeftMargin( rPam, bRight,
bModulus );
pHistory = &pUndo->GetHistory();
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
}
const SvxTabStopItem& rTabItem = (SvxTabStopItem&)GetDefault( RES_PARATR_TABSTOP );
- USHORT nDefDist = rTabItem.Count() ?
- static_cast<USHORT>(rTabItem[0].GetTabPos()) : 1134;
+ sal_uInt16 nDefDist = rTabItem.Count() ?
+ static_cast<sal_uInt16>(rTabItem[0].GetTabPos()) : 1134;
const SwPosition &rStt = *rPam.Start(), &rEnd = *rPam.End();
SwNodeIndex aIdx( rStt.nNode );
while( aIdx <= rEnd.nNode )
@@ -2363,7 +2376,7 @@ void SwDoc::MoveLeftMargin( const SwPaM& rPam, BOOL bRight, BOOL bModulus )
const int nListLevel = pTNd->GetActualListLevel();
if ( nListLevel >= 0 )
{
- const SwNumFmt& rFmt = pRule->Get(static_cast<USHORT>(nListLevel));
+ const SwNumFmt& rFmt = pRule->Get(static_cast<sal_uInt16>(nListLevel));
if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT )
{
aLS.SetTxtLeft( rFmt.GetIndentAt() );
@@ -2392,17 +2405,16 @@ void SwDoc::MoveLeftMargin( const SwPaM& rPam, BOOL bRight, BOOL bModulus )
SetModified();
}
-BOOL SwDoc::DontExpandFmt( const SwPosition& rPos, BOOL bFlag )
+sal_Bool SwDoc::DontExpandFmt( const SwPosition& rPos, sal_Bool bFlag )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
SwTxtNode* pTxtNd = rPos.nNode.GetNode().GetTxtNode();
if( pTxtNd )
{
bRet = pTxtNd->DontExpandFmt( rPos.nContent, bFlag );
- if( bRet && DoesUndo() )
+ if( bRet && GetIDocumentUndoRedo().DoesUndo() )
{
- ClearRedo();
- AppendUndo( new SwUndoDontExpandFmt( rPos ));
+ GetIDocumentUndoRedo().AppendUndo( new SwUndoDontExpandFmt(rPos) );
}
}
return bRet;
@@ -2438,7 +2450,7 @@ void SwDoc::_CreateNumberFormatter()
Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
pNumberFormatter = new SvNumberFormatter( xMSF, eLang );
pNumberFormatter->SetEvalDateFormat( NF_EVALDATEFORMAT_FORMAT_INTL );
- pNumberFormatter->SetYear2000(static_cast<USHORT>(::utl::MiscCfg().GetYear2000()));
+ pNumberFormatter->SetYear2000(static_cast<sal_uInt16>(::utl::MiscCfg().GetYear2000()));
}
@@ -2447,8 +2459,8 @@ SwTblNumFmtMerge::SwTblNumFmtMerge( const SwDoc& rSrc, SwDoc& rDest )
{
// ein anderes Doc -> Numberformatter muessen gemergt werden
SvNumberFormatter* pN;
- if( &rSrc != &rDest && 0 != ( pN = ((SwDoc&)rSrc).GetNumberFormatter( FALSE ) ))
- ( pNFmt = rDest.GetNumberFormatter( TRUE ))->MergeFormatter( *pN );
+ if( &rSrc != &rDest && 0 != ( pN = ((SwDoc&)rSrc).GetNumberFormatter( sal_False ) ))
+ ( pNFmt = rDest.GetNumberFormatter( sal_True ))->MergeFormatter( *pN );
if( &rSrc != &rDest )
((SwGetRefFieldType*)rSrc.GetSysFldType( RES_GETREFFLD ))->
@@ -2462,7 +2474,7 @@ SwTblNumFmtMerge::~SwTblNumFmtMerge()
}
-void SwDoc::SetTxtFmtCollByAutoFmt( const SwPosition& rPos, USHORT nPoolId,
+void SwDoc::SetTxtFmtCollByAutoFmt( const SwPosition& rPos, sal_uInt16 nPoolId,
const SfxItemSet* pSet )
{
SwPaM aPam( rPos );
@@ -2486,7 +2498,7 @@ void SwDoc::SetTxtFmtCollByAutoFmt( const SwPosition& rPos, USHORT nPoolId,
// das Adjust Item behalten wir extra
const SfxPoolItem* pItem;
if( SFX_ITEM_SET == pTNd->GetpSwAttrSet()->GetItemState(
- RES_PARATR_ADJUST, FALSE, &pItem ))
+ RES_PARATR_ADJUST, sal_False, &pItem ))
aTmp.Put( *pItem );
aExtraData.SetItemSet( aTmp );
}
@@ -2531,7 +2543,7 @@ void SwDoc::SetFmtItemByAutoFmt( const SwPaM& rPam, const SfxItemSet& rSet )
// das Adjust Item behalten wir extra
const SfxPoolItem* pItem;
if( SFX_ITEM_SET == pTNd->GetpSwAttrSet()->GetItemState(
- RES_PARATR_ADJUST, FALSE, &pItem ))
+ RES_PARATR_ADJUST, sal_False, &pItem ))
aTmp.Put( *pItem );
aExtraData.SetItemSet( aTmp );
}
@@ -2550,7 +2562,7 @@ void SwDoc::SetFmtItemByAutoFmt( const SwPaM& rPam, const SfxItemSet& rSet )
void SwDoc::ChgFmt(SwFmt & rFmt, const SfxItemSet & rSet)
{
- if (DoesUndo())
+ if (GetIDocumentUndoRedo().DoesUndo())
{
// copying <rSet> to <aSet>
SfxItemSet aSet(rSet);
@@ -2578,18 +2590,18 @@ void SwDoc::ChgFmt(SwFmt & rFmt, const SfxItemSet & rSet)
SwUndo * pUndo = new SwUndoFmtAttr(aOldSet, rFmt);
- AppendUndo(pUndo);
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
rFmt.SetFmtAttr(rSet);
}
void SwDoc::RenameFmt(SwFmt & rFmt, const String & sNewName,
- BOOL bBroadcast)
+ sal_Bool bBroadcast)
{
SfxStyleFamily eFamily = SFX_STYLE_FAMILY_ALL;
- if (DoesUndo())
+ if (GetIDocumentUndoRedo().DoesUndo())
{
SwUndo * pUndo = NULL;
@@ -2613,7 +2625,9 @@ void SwDoc::RenameFmt(SwFmt & rFmt, const String & sNewName,
}
if (pUndo)
- AppendUndo(pUndo);
+ {
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
+ }
}
rFmt.SetName(sNewName);
@@ -2637,8 +2651,8 @@ namespace docfunc
const SwTxtFmtColls* pTxtFmtColls( rDoc.GetTxtFmtColls() );
if ( pTxtFmtColls )
{
- const USHORT nCount = pTxtFmtColls->Count();
- for ( USHORT i = 0; i < nCount; ++i )
+ const sal_uInt16 nCount = pTxtFmtColls->Count();
+ for ( sal_uInt16 i = 0; i < nCount; ++i )
{
SwTxtFmtColl* pTxtFmtColl = (*pTxtFmtColls)[i];
diff --git a/sw/source/core/doc/docftn.cxx b/sw/source/core/doc/docftn.cxx
index b8b42149b177..2d8d911cbc9c 100644
--- a/sw/source/core/doc/docftn.cxx
+++ b/sw/source/core/doc/docftn.cxx
@@ -36,9 +36,11 @@
#include <pam.hxx>
#include <pagedesc.hxx>
#include <charfmt.hxx>
-#include <undobj.hxx>
+#include <UndoAttribute.hxx>
+#include <hints.hxx>
#include <rolbck.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <ndtxt.hxx>
#include <poolfmt.hxx>
#include <ftninfo.hxx>
@@ -78,7 +80,7 @@ SwEndNoteInfo& SwEndNoteInfo::operator=(const SwEndNoteInfo& rInfo)
}
-BOOL SwEndNoteInfo::operator==( const SwEndNoteInfo& rInfo ) const
+sal_Bool SwEndNoteInfo::operator==( const SwEndNoteInfo& rInfo ) const
{
return aPageDescDep.GetRegisteredIn() ==
rInfo.aPageDescDep.GetRegisteredIn() &&
@@ -196,7 +198,7 @@ void SwEndNoteInfo::SetAnchorCharFmt( SwCharFmt* pChFmt )
void SwEndNoteInfo::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
- USHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0 ;
+ sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0 ;
if( RES_ATTRSET_CHG == nWhich ||
RES_FMT_CHG == nWhich )
@@ -207,7 +209,7 @@ void SwEndNoteInfo::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
else
pDoc = ((SwCharFmt*)aAnchorCharFmtDep.GetRegisteredIn())->GetDoc();
SwFtnIdxs& rFtnIdxs = pDoc->GetFtnIdxs();
- for( USHORT nPos = 0; nPos < rFtnIdxs.Count(); ++nPos )
+ for( sal_uInt16 nPos = 0; nPos < rFtnIdxs.Count(); ++nPos )
{
SwTxtFtn *pTxtFtn = rFtnIdxs[ nPos ];
const SwFmtFtn &rFtn = pTxtFtn->GetFtn();
@@ -232,7 +234,7 @@ SwFtnInfo& SwFtnInfo::operator=(const SwFtnInfo& rInfo)
}
-BOOL SwFtnInfo::operator==( const SwFtnInfo& rInfo ) const
+sal_Bool SwFtnInfo::operator==( const SwFtnInfo& rInfo ) const
{
return ePos == rInfo.ePos &&
eNum == rInfo.eNum &&
@@ -271,23 +273,22 @@ void SwDoc::SetFtnInfo(const SwFtnInfo& rInfo)
{
const SwFtnInfo &rOld = GetFtnInfo();
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoFootNoteInfo( rOld ) );
+ GetIDocumentUndoRedo().AppendUndo( new SwUndoFootNoteInfo(rOld) );
}
- BOOL bFtnPos = rInfo.ePos != rOld.ePos;
- BOOL bFtnDesc = rOld.ePos == FTNPOS_CHAPTER &&
+ sal_Bool bFtnPos = rInfo.ePos != rOld.ePos;
+ sal_Bool bFtnDesc = rOld.ePos == FTNPOS_CHAPTER &&
rInfo.GetPageDesc( *this ) != rOld.GetPageDesc( *this );
- BOOL bExtra = rInfo.aQuoVadis != rOld.aQuoVadis ||
+ sal_Bool bExtra = rInfo.aQuoVadis != rOld.aQuoVadis ||
rInfo.aErgoSum != rOld.aErgoSum ||
rInfo.aFmt.GetNumberingType() != rOld.aFmt.GetNumberingType() ||
rInfo.GetPrefix() != rOld.GetPrefix() ||
rInfo.GetSuffix() != rOld.GetSuffix();
SwCharFmt *pOldChrFmt = rOld.GetCharFmt( *this ),
*pNewChrFmt = rInfo.GetCharFmt( *this );
- BOOL bFtnChrFmts = pOldChrFmt != pNewChrFmt;
+ sal_Bool bFtnChrFmts = pOldChrFmt != pNewChrFmt;
*pFtnInfo = rInfo;
@@ -302,14 +303,18 @@ void SwDoc::SetFtnInfo(const SwFtnInfo& rInfo)
//pTmpRoot->UpdateFtnNums();
std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::UpdateFtnNums));//swmod 080304
if ( bFtnDesc )
+<<<<<<< local
//pTmpRoot->CheckFtnPageDescs( FALSE );
std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::bind2nd(std::mem_fun(&SwRootFrm::CheckFtnPageDescs), FALSE));//swmod 080304
+=======
+ GetRootFrm()->CheckFtnPageDescs( sal_False );
+>>>>>>> other
if ( bExtra )
{
//Fuer die Benachrichtung bezueglich ErgoSum usw. sparen wir uns
//extra-Code und nutzen die vorhandenen Wege.
SwFtnIdxs& rFtnIdxs = GetFtnIdxs();
- for( USHORT nPos = 0; nPos < rFtnIdxs.Count(); ++nPos )
+ for( sal_uInt16 nPos = 0; nPos < rFtnIdxs.Count(); ++nPos )
{
SwTxtFtn *pTxtFtn = rFtnIdxs[ nPos ];
const SwFmtFtn &rFtn = pTxtFtn->GetFtn();
@@ -343,13 +348,13 @@ void SwDoc::SetEndNoteInfo(const SwEndNoteInfo& rInfo)
SwRootFrm* pTmpRoot = GetCurrentLayout();//swmod 080219
if( !(GetEndNoteInfo() == rInfo) )
{
- if( DoesUndo() )
+ if(GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoEndNoteInfo( GetEndNoteInfo() ) );
+ SwUndo *const pUndo( new SwUndoEndNoteInfo( GetEndNoteInfo() ) );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
- BOOL bNumChg = rInfo.nFtnOffset != GetEndNoteInfo().nFtnOffset;
+ sal_Bool bNumChg = rInfo.nFtnOffset != GetEndNoteInfo().nFtnOffset;
// this seems to be an optimization: UpdateAllFtn() is only called
// if the offset changes; if the offset is the same,
// but type/prefix/suffix changes, just set new numbers.
@@ -359,28 +364,32 @@ void SwDoc::SetEndNoteInfo(const SwEndNoteInfo& rInfo)
|| (rInfo.GetPrefix() != GetEndNoteInfo().GetPrefix())
|| (rInfo.GetSuffix() != GetEndNoteInfo().GetSuffix())
);
- BOOL bFtnDesc = rInfo.GetPageDesc( *this ) !=
+ sal_Bool bFtnDesc = rInfo.GetPageDesc( *this ) !=
GetEndNoteInfo().GetPageDesc( *this );
SwCharFmt *pOldChrFmt = GetEndNoteInfo().GetCharFmt( *this ),
*pNewChrFmt = rInfo.GetCharFmt( *this );
- BOOL bFtnChrFmts = pOldChrFmt != pNewChrFmt;
+ sal_Bool bFtnChrFmts = pOldChrFmt != pNewChrFmt;
*pEndNoteInfo = rInfo;
if ( pTmpRoot )
{
if ( bFtnDesc )
+<<<<<<< local
//pTmpRoot->CheckFtnPageDescs( TRUE );
{
std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();
std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::bind2nd(std::mem_fun(&SwRootFrm::CheckFtnPageDescs), TRUE));//swmod 080304
}
+=======
+ GetRootFrm()->CheckFtnPageDescs( sal_True );
+>>>>>>> other
if ( bExtra )
{
//Fuer die Benachrichtung bezueglich ErgoSum usw. sparen wir uns
//extra-Code und nutzen die vorhandenen Wege.
SwFtnIdxs& rFtnIdxs = GetFtnIdxs();
- for( USHORT nPos = 0; nPos < rFtnIdxs.Count(); ++nPos )
+ for( sal_uInt16 nPos = 0; nPos < rFtnIdxs.Count(); ++nPos )
{
SwTxtFtn *pTxtFtn = rFtnIdxs[ nPos ];
const SwFmtFtn &rFtn = pTxtFtn->GetFtn();
@@ -416,26 +425,26 @@ bool SwDoc::SetCurFtn( const SwPaM& rPam, const String& rNumStr,
SwRootFrm* pTmpRoot = GetCurrentLayout();//swmod 080219
const SwPosition* pStt = rPam.Start(), *pEnd = rPam.End();
- const ULONG nSttNd = pStt->nNode.GetIndex();
+ const sal_uLong nSttNd = pStt->nNode.GetIndex();
const xub_StrLen nSttCnt = pStt->nContent.GetIndex();
- const ULONG nEndNd = pEnd->nNode.GetIndex();
+ const sal_uLong nEndNd = pEnd->nNode.GetIndex();
const xub_StrLen nEndCnt = pEnd->nContent.GetIndex();
- USHORT nPos;
+ sal_uInt16 nPos;
rFtnArr.SeekEntry( pStt->nNode, &nPos );
SwUndoChangeFootNote* pUndo = 0;
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
+ GetIDocumentUndoRedo().ClearRedo(); // AppendUndo far below, so leave it
pUndo = new SwUndoChangeFootNote( rPam, rNumStr, nNumber, bIsEndNote );
}
SwTxtFtn* pTxtFtn;
- ULONG nIdx;
- BOOL bChg = FALSE;
- BOOL bTypeChgd = FALSE;
- USHORT n = nPos; // sichern
+ sal_uLong nIdx;
+ sal_Bool bChg = sal_False;
+ sal_Bool bTypeChgd = sal_False;
+ sal_uInt16 n = nPos; // sichern
while( nPos < rFtnArr.Count() &&
(( nIdx = _SwTxtFtn_GetIndex((pTxtFtn = rFtnArr[ nPos++ ] )))
< nEndNd || ( nIdx == nEndNd &&
@@ -448,7 +457,7 @@ bool SwDoc::SetCurFtn( const SwPaM& rPam, const String& rNumStr,
rFtn.GetNumStr() != rNumStr ||
rFtn.IsEndNote() != bIsEndNote )
{
- bChg = TRUE;
+ bChg = sal_True;
if ( pUndo )
{
pUndo->GetHistory().Add( *pTxtFtn );
@@ -458,7 +467,7 @@ bool SwDoc::SetCurFtn( const SwPaM& rPam, const String& rNumStr,
if( rFtn.IsEndNote() != bIsEndNote )
{
((SwFmtFtn&)rFtn).SetEndNote( bIsEndNote );
- bTypeChgd = TRUE;
+ bTypeChgd = sal_True;
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() );
@@ -480,7 +489,7 @@ bool SwDoc::SetCurFtn( const SwPaM& rPam, const String& rNumStr,
rFtn.GetNumStr() != rNumStr ||
rFtn.IsEndNote() != bIsEndNote )
{
- bChg = TRUE;
+ bChg = sal_True;
if ( pUndo )
{
pUndo->GetHistory().Add( *pTxtFtn );
@@ -490,7 +499,7 @@ bool SwDoc::SetCurFtn( const SwPaM& rPam, const String& rNumStr,
if( rFtn.IsEndNote() != bIsEndNote )
{
((SwFmtFtn&)rFtn).SetEndNote( bIsEndNote );
- bTypeChgd = TRUE;
+ bTypeChgd = sal_True;
pTxtFtn->CheckCondColl();
}
}
@@ -501,8 +510,7 @@ bool SwDoc::SetCurFtn( const SwPaM& rPam, const String& rNumStr,
{
if( pUndo )
{
- ClearRedo();
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
if ( bTypeChgd )
diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx
index 5ae6629a5715..26d9c75e2140 100644
--- a/sw/source/core/doc/docglbl.cxx
+++ b/sw/source/core/doc/docglbl.cxx
@@ -43,6 +43,7 @@
#include <fmtinfmt.hxx>
#include <fmtanchr.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <docary.hxx>
#include <pam.hxx>
#include <ndtxt.hxx>
@@ -66,32 +67,32 @@ enum SwSplitDocType
SPLITDOC_TO_HTML
};
-BOOL SwDoc::GenerateGlobalDoc( const String& rPath,
+sal_Bool SwDoc::GenerateGlobalDoc( const String& rPath,
const SwTxtFmtColl* pSplitColl )
{
return SplitDoc( SPLITDOC_TO_GLOBALDOC, rPath, pSplitColl );
}
//#outline level,add by zhaojianwei
-BOOL SwDoc::GenerateGlobalDoc( const String& rPath, int nOutlineLevel )
+sal_Bool SwDoc::GenerateGlobalDoc( const String& rPath, int nOutlineLevel )
{
return SplitDoc( SPLITDOC_TO_GLOBALDOC, rPath, nOutlineLevel );
}
-BOOL SwDoc::GenerateHTMLDoc( const String& rPath, int nOutlineLevel )
+sal_Bool SwDoc::GenerateHTMLDoc( const String& rPath, int nOutlineLevel )
{
return SplitDoc( SPLITDOC_TO_HTML, rPath, nOutlineLevel );
}
//<-end,zhaojianwei
-BOOL SwDoc::GenerateHTMLDoc( const String& rPath,
+sal_Bool SwDoc::GenerateHTMLDoc( const String& rPath,
const SwTxtFmtColl* pSplitColl )
{
#ifdef JP_TEST
if( !pSplitColl )
{
- BYTE nLvl = 1;
+ sal_uInt8 nLvl = 1;
const SwTxtFmtColls& rFmtColls =*GetTxtFmtColls();
- for( USHORT n = rFmtColls.Count(); n; )
+ for( sal_uInt16 n = rFmtColls.Count(); n; )
//if( nLvl == rFmtColls[ --n ]->GetOutlineLevel() )//#outline level,zhaojianwei
if( nLvl == rFmtColls[ --n ]->GetAttrOutlineLevel() -1 )//<-end,zhaojianwei 0814
{
@@ -107,7 +108,7 @@ BOOL SwDoc::GenerateHTMLDoc( const String& rPath,
return SplitDoc( SPLITDOC_TO_HTML, rPath, pSplitColl );
}
-BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath,
+sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath,
const SwTxtFmtColl* pSplitColl )
{
// ueber alle Node der Vorlage Iterieren und dafuer einzelne
@@ -118,9 +119,9 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath,
// Am Ende wird dieses Doc als GlobalDoc/HTML-Doc gespreichert.
if( !pDocShell || !pDocShell->GetMedium() ||
( SPLITDOC_TO_GLOBALDOC == eDocType && get(IDocumentSettingAccess::GLOBAL_DOCUMENT) ) )
- return FALSE;
+ return sal_False;
- USHORT nOutl = 0;
+ sal_uInt16 nOutl = 0;
SwOutlineNodes* pOutlNds = (SwOutlineNodes*)&GetNodes().GetOutLineNds();
SwNodePtr pSttNd;
@@ -140,7 +141,7 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath,
if( !pOutlNds->Count() )
{
delete pOutlNds;
- return FALSE;
+ return sal_False;
}
}
}
@@ -148,7 +149,7 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath,
{
// dann suche die Gliederungs - Vorlage, der 1. Ebene
const SwTxtFmtColls& rFmtColls =*GetTxtFmtColls();
- for( USHORT n = rFmtColls.Count(); n; )
+ for( sal_uInt16 n = rFmtColls.Count(); n; )
//if( !rFmtColls[ --n ]->GetOutlineLevel() )//#outline level,zhaojianwei
if ( rFmtColls[ --n ]->GetAttrOutlineLevel() == 1 )//<-end,zhaojianwei
{
@@ -157,7 +158,7 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath,
}
if( !pSplitColl )
- return FALSE;
+ return sal_False;
}
const SfxFilter* pFilter;
@@ -177,10 +178,10 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath,
}
if( !pFilter )
- return FALSE;
+ return sal_False;
// Undo/Redline aufjedenfall abschalten
- DoUndo( FALSE );
+ GetIDocumentUndoRedo().DoUndo(false);
SetRedlineMode_intern( (RedlineMode_t)(GetRedlineMode() & ~nsRedlineMode_t::REDLINE_ON));
String sExt( pFilter->GetSuffixes().GetToken(0, ',') );
@@ -253,7 +254,7 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath,
String sFileName;
if( pSttNd->GetIndex() + 1 < aEndIdx.GetIndex() )
{
- SfxObjectShellRef xDocSh( new SwDocShell( SFX_CREATE_MODE_INTERNAL ));
+ SfxObjectShellLock xDocSh( new SwDocShell( SFX_CREATE_MODE_INTERNAL ));
if( xDocSh->DoInitNew( 0 ) )
{
SwDoc* pDoc = ((SwDocShell*)(&xDocSh))->GetDoc();
@@ -290,7 +291,7 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath,
SwNodeRange aRg( *pSttNd, 0, aEndIdx.GetNode() );
SwNodeIndex aTmpIdx( pDoc->GetNodes().GetEndOfContent() );
- GetNodes()._Copy( aRg, aTmpIdx, FALSE );
+ GetNodes()._Copy( aRg, aTmpIdx, sal_False );
// den initialen TextNode loeschen
SwNodeIndex aIdx( pDoc->GetNodes().GetEndOfExtras(), 2 );
@@ -308,7 +309,7 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath,
utl::TempFile aTempFile2(sLeading,&sExt,&sPath );
sFileName = aTempFile2.GetURL();
SfxMedium* pTmpMed = new SfxMedium( sFileName,
- STREAM_STD_READWRITE, TRUE );
+ STREAM_STD_READWRITE, sal_True );
pTmpMed->SetFilter( pFilter );
// fuer den HTML-Filter mussen wir aber ein Layout
@@ -339,7 +340,7 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath,
{
// loesche alle Nodes im Bereich und setze im "Start-
// Node" den Link auf das gespeicherte Doc
- ULONG nNodeDiff = aEndIdx.GetIndex() -
+ sal_uLong nNodeDiff = aEndIdx.GetIndex() -
pSttNd->GetIndex() - 1;
if( nNodeDiff )
{
@@ -356,14 +357,14 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath,
aTmp.Exchange();
if( !aTmp.Move( fnMoveBackward, fnGoNode ))
{
- ASSERT( FALSE, "kein Node mehr vorhanden" );
+ ASSERT( sal_False, "kein Node mehr vorhanden" );
}
}
// Bookmarks usw. verschieben
- CorrAbs( aSIdx, aEIdx, *aTmp.GetPoint(), TRUE);
+ CorrAbs( aSIdx, aEIdx, *aTmp.GetPoint(), sal_True);
// stehen noch FlyFrames rum, loesche auch diese
- for( USHORT n = 0; n < GetSpzFrmFmts()->Count(); ++n )
+ for( sal_uInt16 n = 0; n < GetSpzFrmFmts()->Count(); ++n )
{
SwFrmFmt* pFly = (*GetSpzFrmFmts())[n];
const SwFmtAnchor* pAnchor = &pFly->GetAnchor();
@@ -420,7 +421,7 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath,
if( pSectNd->GetIndex() + 1 ==
pSttNd->GetIndex() )
{
- BOOL bMvIdx = aEndIdx == *pSectEnd;
+ sal_Bool bMvIdx = aEndIdx == *pSectEnd;
DelSectionFmt( pSectNd->GetSection().GetFmt() );
if( bMvIdx )
aEndIdx--;
@@ -511,13 +512,13 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath,
}
//#outline level,add by zhaojianwei
-BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath, int nOutlineLevel )
+sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath, int nOutlineLevel )
{
if( !pDocShell || !pDocShell->GetMedium() ||
( SPLITDOC_TO_GLOBALDOC == eDocType && get(IDocumentSettingAccess::GLOBAL_DOCUMENT) ) )
- return FALSE;
+ return sal_False;
- USHORT nOutl = 0;
+ sal_uInt16 nOutl = 0;
SwOutlineNodes* pOutlNds = (SwOutlineNodes*)&GetNodes().GetOutLineNds();
SwNodePtr pSttNd;
@@ -538,10 +539,10 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath, int nOutlineLevel )
}
if( !pFilter )
- return FALSE;
+ return sal_False;
// Undo/Redline aufjedenfall abschalten
- DoUndo( FALSE );
+ GetIDocumentUndoRedo().DoUndo(false);
SetRedlineMode_intern( (RedlineMode_t)(GetRedlineMode() & ~nsRedlineMode_t::REDLINE_ON));
String sExt( pFilter->GetSuffixes().GetToken(0, ',') );
@@ -604,7 +605,7 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath, int nOutlineLevel )
String sFileName;
if( pSttNd->GetIndex() + 1 < aEndIdx.GetIndex() )
{
- SfxObjectShellRef xDocSh( new SwDocShell( SFX_CREATE_MODE_INTERNAL ));
+ SfxObjectShellLock xDocSh( new SwDocShell( SFX_CREATE_MODE_INTERNAL ));
if( xDocSh->DoInitNew( 0 ) )
{
SwDoc* pDoc = ((SwDocShell*)(&xDocSh))->GetDoc();
@@ -641,7 +642,7 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath, int nOutlineLevel )
SwNodeRange aRg( *pSttNd, 0, aEndIdx.GetNode() );
SwNodeIndex aTmpIdx( pDoc->GetNodes().GetEndOfContent() );
- GetNodes()._Copy( aRg, aTmpIdx, FALSE );
+ GetNodes()._Copy( aRg, aTmpIdx, sal_False );
// den initialen TextNode loeschen
SwNodeIndex aIdx( pDoc->GetNodes().GetEndOfExtras(), 2 );
@@ -659,7 +660,7 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath, int nOutlineLevel )
utl::TempFile aTempFile2(sLeading,&sExt,&sPath );
sFileName = aTempFile2.GetURL();
SfxMedium* pTmpMed = new SfxMedium( sFileName,
- STREAM_STD_READWRITE, TRUE );
+ STREAM_STD_READWRITE, sal_True );
pTmpMed->SetFilter( pFilter );
// fuer den HTML-Filter mussen wir aber ein Layout
@@ -690,7 +691,7 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath, int nOutlineLevel )
{
// loesche alle Nodes im Bereich und setze im "Start-
// Node" den Link auf das gespeicherte Doc
- ULONG nNodeDiff = aEndIdx.GetIndex() -
+ sal_uLong nNodeDiff = aEndIdx.GetIndex() -
pSttNd->GetIndex() - 1;
if( nNodeDiff )
{
@@ -707,14 +708,14 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath, int nOutlineLevel )
aTmp.Exchange();
if( !aTmp.Move( fnMoveBackward, fnGoNode ))
{
- ASSERT( FALSE, "kein Node mehr vorhanden" );
+ ASSERT( sal_False, "kein Node mehr vorhanden" );
}
}
// Bookmarks usw. verschieben
- CorrAbs( aSIdx, aEIdx, *aTmp.GetPoint(), TRUE);
+ CorrAbs( aSIdx, aEIdx, *aTmp.GetPoint(), sal_True);
// stehen noch FlyFrames rum, loesche auch diese
- for( USHORT n = 0; n < GetSpzFrmFmts()->Count(); ++n )
+ for( sal_uInt16 n = 0; n < GetSpzFrmFmts()->Count(); ++n )
{
SwFrmFmt* pFly = (*GetSpzFrmFmts())[n];
const SwFmtAnchor* pAnchor = &pFly->GetAnchor();
@@ -771,7 +772,7 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath, int nOutlineLevel )
if( pSectNd->GetIndex() + 1 ==
pSttNd->GetIndex() )
{
- BOOL bMvIdx = aEndIdx == *pSectEnd;
+ sal_Bool bMvIdx = aEndIdx == *pSectEnd;
DelSectionFmt( pSectNd->GetSection().GetFmt() );
if( bMvIdx )
aEndIdx--;
diff --git a/sw/source/core/doc/docglos.cxx b/sw/source/core/doc/docglos.cxx
index 8395c358c495..610a8fb170b8 100644
--- a/sw/source/core/doc/docglos.cxx
+++ b/sw/source/core/doc/docglos.cxx
@@ -28,8 +28,13 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
+#include <com/sun/star/document/XDocumentProperties.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/XPropertySetInfo.hpp>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <shellio.hxx>
#include <pam.hxx>
#include <swundo.hxx>
@@ -38,11 +43,6 @@
#include <crsrsh.hxx>
#include <docsh.hxx>
-#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
-#include <com/sun/star/document/XDocumentProperties.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/beans/XPropertySetInfo.hpp>
-
using namespace ::com::sun::star;
@@ -108,16 +108,16 @@ static void lcl_copyDocumentProperties(
/* -----------------22.07.99 11:47-------------------
Description: inserts an AutoText block
--------------------------------------------------*/
-BOOL SwDoc::InsertGlossary( SwTextBlocks& rBlock, const String& rEntry,
+sal_Bool SwDoc::InsertGlossary( SwTextBlocks& rBlock, const String& rEntry,
SwPaM& rPaM, SwCrsrShell* pShell )
{
- BOOL bRet = FALSE;
- USHORT nIdx = rBlock.GetIndex( rEntry );
- if( (USHORT) -1 != nIdx )
+ sal_Bool bRet = sal_False;
+ sal_uInt16 nIdx = rBlock.GetIndex( rEntry );
+ if( (sal_uInt16) -1 != nIdx )
{
// Bug #70238# ask the TextOnly-Flag before BeginGetDoc, because
// the method closed the Storage!
- BOOL bSav_IsInsGlossary = mbInsOnlyTxtGlssry;
+ sal_Bool bSav_IsInsGlossary = mbInsOnlyTxtGlssry;
mbInsOnlyTxtGlssry = rBlock.IsOnlyTextBlock( nIdx );
if( rBlock.BeginGetDoc( nIdx ) )
@@ -160,7 +160,7 @@ BOOL SwDoc::InsertGlossary( SwTextBlocks& rBlock, const String& rEntry,
pCntntNd = aCpyPam.GetCntntNode();
aCpyPam.GetPoint()->nContent.Assign( pCntntNd, pCntntNd->Len() );
- StartUndo( UNDO_INSGLOSSARY, NULL );
+ GetIDocumentUndoRedo().StartUndo( UNDO_INSGLOSSARY, NULL );
SwPaM *_pStartCrsr = &rPaM, *__pStartCrsr = _pStartCrsr;
do {
@@ -187,12 +187,12 @@ BOOL SwDoc::InsertGlossary( SwTextBlocks& rBlock, const String& rEntry,
pShell->SaveTblBoxCntnt( &rInsPos );
} while( (_pStartCrsr=(SwPaM *)_pStartCrsr->GetNext()) !=
__pStartCrsr );
- EndUndo( UNDO_INSGLOSSARY, NULL );
+ GetIDocumentUndoRedo().EndUndo( UNDO_INSGLOSSARY, NULL );
UnlockExpFlds();
if( !IsExpFldsLocked() )
UpdateExpFlds(NULL, true);
- bRet = TRUE;
+ bRet = sal_True;
}
mbInsOnlyTxtGlssry = bSav_IsInsGlossary;
}
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index 0cccb8c70cf0..65dd1c51a797 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -75,6 +75,7 @@
#include <ndnotxt.hxx>
#include <ndole.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <rootfrm.hxx>
#include <pagefrm.hxx>
#include <cntfrm.hxx>
@@ -85,7 +86,7 @@
#include <dcontact.hxx>
#include <swundo.hxx>
#include <flypos.hxx>
-#include <undobj.hxx>
+#include <UndoInsert.hxx>
#include <expfld.hxx> // InsertLabel
#include <poolfmt.hxx> // PoolVorlagen-Id's
#include <docary.hxx>
@@ -115,7 +116,7 @@ using ::rtl::OUString;
#define DEF_FLY_WIDTH 2268 //Defaultbreite fuer FlyFrms (2268 == 4cm)
/* #109161# */
-static bool lcl_IsItemSet(const SwCntntNode & rNode, USHORT which)
+static bool lcl_IsItemSet(const SwCntntNode & rNode, sal_uInt16 which)
{
bool bResult = false;
@@ -197,10 +198,10 @@ SwFrmFmt *SwDoc::MakeLayoutFmt( RndStdIds eRequest, const SfxItemSet* pSet )
if( pSet ) // noch ein paar Attribute setzen ?
pFmt->SetFmtAttr( *pSet );
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoInsLayFmt( pFmt,0,0 ));
+ GetIDocumentUndoRedo().AppendUndo(
+ new SwUndoInsLayFmt(pFmt, 0, 0));
}
}
break;
@@ -253,7 +254,7 @@ void SwDoc::DelLayoutFmt( SwFrmFmt *pFmt )
}
const SwNodeIndex* pCntIdx = pFmt->GetCntnt().GetCntntIdx();
- if( pCntIdx && !DoesUndo() )
+ if (pCntIdx && !GetIDocumentUndoRedo().DoesUndo())
{
//Verbindung abbauen, falls es sich um ein OLE-Objekt handelt.
SwOLENode* pOLENd = GetNodes()[ pCntIdx->GetIndex()+1 ]->GetOLENode();
@@ -295,11 +296,10 @@ void SwDoc::DelLayoutFmt( SwFrmFmt *pFmt )
// erstmal sind nur Fly's Undofaehig
const sal_uInt16 nWh = pFmt->Which();
- if( DoesUndo() && (RES_FLYFRMFMT == nWh || RES_DRAWFRMFMT == nWh) )
+ if (GetIDocumentUndoRedo().DoesUndo() &&
+ (RES_FLYFRMFMT == nWh || RES_DRAWFRMFMT == nWh))
{
- // erstmal werden alle Undo - Objecte geloescht.
- ClearRedo();
- AppendUndo( new SwUndoDelLayFmt( pFmt ));
+ GetIDocumentUndoRedo().AppendUndo( new SwUndoDelLayFmt( pFmt ));
}
else
{
@@ -314,9 +314,9 @@ void SwDoc::DelLayoutFmt( SwFrmFmt *pFmt )
if ( pTbl )
{
std::vector<SwFrmFmt*> aToDeleteFrmFmts;
- const ULONG nNodeIdxOfFlyFmt( pCntntIdx->GetIndex() );
+ const sal_uLong nNodeIdxOfFlyFmt( pCntntIdx->GetIndex() );
- for ( USHORT i = 0; i < pTbl->Count(); ++i )
+ for ( sal_uInt16 i = 0; i < pTbl->Count(); ++i )
{
SwFrmFmt* pTmpFmt = (*pTbl)[i];
const SwFmtAnchor &rAnch = pTmpFmt->GetAnchor();
@@ -494,10 +494,9 @@ SwFrmFmt *SwDoc::CopyLayoutFmt( const SwFrmFmt& rSource,
}
}
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoInsLayFmt( pDest,0,0 ));
+ GetIDocumentUndoRedo().AppendUndo(new SwUndoInsLayFmt(pDest,0,0));
}
// sorge dafuer das auch Fly's in Fly's kopiert werden
@@ -536,10 +535,9 @@ SwFrmFmt *SwDoc::CopyLayoutFmt( const SwFrmFmt& rSource,
else
pDest->SetFmtAttr( rNewAnchor );
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoInsLayFmt( pDest,0,0 ));
+ GetIDocumentUndoRedo().AppendUndo(new SwUndoInsLayFmt(pDest,0,0));
}
}
@@ -729,12 +727,12 @@ SwFlyFrmFmt* SwDoc::_MakeFlySection( const SwPosition& rAnchPos,
if( GetCurrentViewShell() )
pFmt->MakeFrms(); // ??? //swmod 071108//swmod 071225
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- ULONG nNodeIdx = rAnchPos.nNode.GetIndex();
+ sal_uLong nNodeIdx = rAnchPos.nNode.GetIndex();
xub_StrLen nCntIdx = rAnchPos.nContent.GetIndex();
- AppendUndo( new SwUndoInsLayFmt( pFmt, nNodeIdx, nCntIdx ));
+ GetIDocumentUndoRedo().AppendUndo(
+ new SwUndoInsLayFmt( pFmt, nNodeIdx, nCntIdx ));
}
SetModified();
@@ -744,7 +742,7 @@ SwFlyFrmFmt* SwDoc::_MakeFlySection( const SwPosition& rAnchPos,
SwFlyFrmFmt* SwDoc::MakeFlySection( RndStdIds eAnchorType,
const SwPosition* pAnchorPos,
const SfxItemSet* pFlySet,
- SwFrmFmt* pFrmFmt, BOOL bCalledFromShell )
+ SwFrmFmt* pFrmFmt, sal_Bool bCalledFromShell )
{
SwFlyFrmFmt* pFmt = 0;
sal_Bool bCallMake = sal_True;
@@ -788,7 +786,7 @@ SwFlyFrmFmt* SwDoc::MakeFlySection( RndStdIds eAnchorType,
if (bCalledFromShell && !lcl_IsItemSet(*pNewTxtNd, RES_PARATR_ADJUST) &&
SFX_ITEM_SET == pAnchorNode->GetSwAttrSet().
- GetItemState(RES_PARATR_ADJUST, TRUE, &pItem))
+ GetItemState(RES_PARATR_ADJUST, sal_True, &pItem))
static_cast<SwCntntNode *>(pNewTxtNd)->SetAttr(*pItem);
pFmt = _MakeFlySection( *pAnchorPos, *pNewTxtNd,
@@ -803,7 +801,7 @@ SwFlyFrmFmt* SwDoc::MakeFlyAndMove( const SwPaM& rPam, const SfxItemSet& rSet,
{
SwFmtAnchor& rAnch = (SwFmtAnchor&)rSet.Get( RES_ANCHOR );
- StartUndo( UNDO_INSLAYFMT, NULL );
+ GetIDocumentUndoRedo().StartUndo( UNDO_INSLAYFMT, NULL );
SwFlyFrmFmt* pFmt = MakeFlySection( rAnch.GetAnchorId(), rPam.GetPoint(),
&rSet, pParent );
@@ -860,7 +858,7 @@ SwFlyFrmFmt* SwDoc::MakeFlyAndMove( const SwPaM& rPam, const SfxItemSet& rSet,
rTbl.MakeCopy( this, aPos, *pSelBoxes );
// Don't delete a part of a table with row span!!
// You could delete the content instead -> ToDo
- //rTbl.DeleteSel( this, *pSelBoxes, 0, 0, TRUE, TRUE );
+ //rTbl.DeleteSel( this, *pSelBoxes, 0, 0, sal_True, sal_True );
}
// wenn Tabelle im Rahmen, dann ohne nachfolgenden TextNode
@@ -871,8 +869,11 @@ SwFlyFrmFmt* SwDoc::MakeFlyAndMove( const SwPaM& rPam, const SfxItemSet& rSet,
GetNodes().Delete( aIndex, 1 );
//JP erstmal ein Hack, solange keine Flys/Headers/Footers Undofaehig sind
-if( DoesUndo() ) // werden erstmal alle Undo - Objecte geloescht.
- DelAllUndoObj();
+// werden erstmal alle Undo - Objecte geloescht.
+if( GetIDocumentUndoRedo().DoesUndo() )
+{
+ GetIDocumentUndoRedo().DelAllUndoObj();
+}
}
else
@@ -888,9 +889,10 @@ if( DoesUndo() ) // werden erstmal alle Undo - Objecte geloescht.
*/
// copy all Pams and then delete all
SwPaM* pTmp = (SwPaM*)&rPam;
- BOOL bOldFlag = mbCopyIsMove, bOldUndo = mbUndo;
- mbCopyIsMove = TRUE;
- mbUndo = FALSE;
+ sal_Bool bOldFlag = mbCopyIsMove;
+ bool const bOldUndo = GetIDocumentUndoRedo().DoesUndo();
+ mbCopyIsMove = sal_True;
+ GetIDocumentUndoRedo().DoUndo(false);
do {
if( pTmp->HasMark() &&
*pTmp->GetPoint() != *pTmp->GetMark() )
@@ -900,7 +902,7 @@ if( DoesUndo() ) // werden erstmal alle Undo - Objecte geloescht.
pTmp = static_cast<SwPaM*>(pTmp->GetNext());
} while ( &rPam != pTmp );
mbCopyIsMove = bOldFlag;
- mbUndo = bOldUndo;
+ GetIDocumentUndoRedo().DoUndo(bOldUndo);
pTmp = (SwPaM*)&rPam;
do {
@@ -917,7 +919,7 @@ if( DoesUndo() ) // werden erstmal alle Undo - Objecte geloescht.
SetModified();
- EndUndo( UNDO_INSLAYFMT, NULL );
+ GetIDocumentUndoRedo().EndUndo( UNDO_INSLAYFMT, NULL );
return pFmt;
}
@@ -1016,10 +1018,9 @@ SwDrawFrmFmt* SwDoc::Insert( const SwPaM &rRg,
// <--
}
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoInsLayFmt( pFmt,0,0 ));
+ GetIDocumentUndoRedo().AppendUndo( new SwUndoInsLayFmt(pFmt, 0, 0) );
}
SetModified();
@@ -1055,7 +1056,7 @@ SwDrawFrmFmt* SwDoc::Insert( const SwPaM &rRg,
sal_Bool TstFlyRange( const SwPaM* pPam, const SwPosition* pFlyPos,
RndStdIds nAnchorId )
{
- sal_Bool bOk = FALSE;
+ sal_Bool bOk = sal_False;
const SwPaM* pTmp = pPam;
do {
const sal_uInt32 nFlyIndex = pFlyPos->nNode.GetIndex();
@@ -1225,31 +1226,27 @@ void lcl_CpyAttr( SfxItemSet &rNewSet, const SfxItemSet &rOldSet, sal_uInt16 nWh
}
-SwFlyFrmFmt* SwDoc::InsertLabel( const SwLabelType eType, const String &rTxt, const String& rSeparator,
+static SwFlyFrmFmt *
+lcl_InsertLabel(SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
+ SwUndoInsertLabel *const pUndo,
+ SwLabelType const eType, String const& rTxt, String const& rSeparator,
const String& rNumberingSeparator,
- const sal_Bool bBefore, const sal_uInt16 nId, const ULONG nNdIdx,
+ const sal_Bool bBefore, const sal_uInt16 nId, const sal_uLong nNdIdx,
const String& rCharacterStyle,
const sal_Bool bCpyBrd )
{
- sal_Bool bWasUndo = DoesUndo();
- SwUndoInsertLabel* pUndo = 0;
- if( bWasUndo )
- {
- ClearRedo();
- pUndo = new SwUndoInsertLabel( eType, rTxt, rSeparator, rNumberingSeparator,
- bBefore, nId, rCharacterStyle, bCpyBrd );
- DoUndo( sal_False );
- }
+ ::sw::UndoGuard const undoGuard(rDoc.GetIDocumentUndoRedo());
sal_Bool bTable = sal_False; //Um etwas Code zu sparen.
//Erstmal das Feld bauen, weil ueber den Namen die TxtColl besorgt werden
//muss
- ASSERT( nId == USHRT_MAX || nId < GetFldTypes()->Count(), "FldType ueberindiziert." );
- SwFieldType *pType = nId != USHRT_MAX ? (*GetFldTypes())[nId] : NULL;
- ASSERT( !pType || pType->Which() == RES_SETEXPFLD, "Falsche Id fuer Label" );
+ OSL_ENSURE( nId == USHRT_MAX || nId < rDoc.GetFldTypes()->Count(),
+ "FldType index out of bounds." );
+ SwFieldType *pType = (nId != USHRT_MAX) ? (*rDoc.GetFldTypes())[nId] : NULL;
+ OSL_ENSURE(!pType || pType->Which() == RES_SETEXPFLD, "wrong Id for Label");
- SwTxtFmtColl *pColl = NULL;
+ SwTxtFmtColl * pColl = NULL;
if( pType )
{
for( sal_uInt16 i = pTxtFmtCollTbl->Count(); i; )
@@ -1264,7 +1261,9 @@ SwFlyFrmFmt* SwDoc::InsertLabel( const SwLabelType eType, const String &rTxt, co
}
if( !pColl )
- pColl = GetTxtCollFromPool( RES_POOLCOLL_LABEL );
+ {
+ pColl = rDoc.GetTxtCollFromPool( RES_POOLCOLL_LABEL );
+ }
SwTxtNode *pNew = NULL;
SwFlyFrmFmt* pNewFmt = NULL;
@@ -1278,9 +1277,9 @@ SwFlyFrmFmt* SwDoc::InsertLabel( const SwLabelType eType, const String &rTxt, co
//Am Anfang/Ende der Fly-Section den entsprechenden Node mit Feld
//einfuegen (Frame wird automatisch erzeugt).
{
- SwStartNode *pSttNd = GetNodes()[nNdIdx]->GetStartNode();
+ SwStartNode *pSttNd = rDoc.GetNodes()[nNdIdx]->GetStartNode();
ASSERT( pSttNd, "Kein StartNode in InsertLabel." );
- ULONG nNode;
+ sal_uLong nNode;
if( bBefore )
{
nNode = pSttNd->GetIndex();
@@ -1298,8 +1297,8 @@ SwFlyFrmFmt* SwDoc::InsertLabel( const SwLabelType eType, const String &rTxt, co
pUndo->SetNodePos( nNode );
//Node fuer Beschriftungsabsatz erzeugen.
- SwNodeIndex aIdx( GetNodes(), nNode );
- pNew = GetNodes().MakeTxtNode( aIdx, pColl );
+ SwNodeIndex aIdx( rDoc.GetNodes(), nNode );
+ pNew = rDoc.GetNodes().MakeTxtNode( aIdx, pColl );
}
break;
@@ -1311,12 +1310,12 @@ SwFlyFrmFmt* SwDoc::InsertLabel( const SwLabelType eType, const String &rTxt, co
// Frames erzeugen.
//Erstmal das Format zum Fly besorgen und das Layout entkoppeln.
- SwFrmFmt *pOldFmt = GetNodes()[nNdIdx]->GetFlyFmt();
+ SwFrmFmt *pOldFmt = rDoc.GetNodes()[nNdIdx]->GetFlyFmt();
ASSERT( pOldFmt, "Format des Fly nicht gefunden." );
pOldFmt->DelFrms();
- pNewFmt = MakeFlyFrmFmt( GetUniqueFrameName(),
- GetFrmFmtFromPool( RES_POOLFRM_FRAME ));
+ pNewFmt = rDoc.MakeFlyFrmFmt( rDoc.GetUniqueFrameName(),
+ rDoc.GetFrmFmtFromPool(RES_POOLFRM_FRAME) );
/* #i6447#: Only the selected items are copied from the old
format. */
@@ -1374,8 +1373,8 @@ SwFlyFrmFmt* SwDoc::InsertLabel( const SwLabelType eType, const String &rTxt, co
aFrmSize.SetHeightSizeType( ATT_MIN_SIZE );
pNewSet->Put( aFrmSize );
- SwStartNode* pSttNd = GetNodes().MakeTextSection(
- SwNodeIndex( GetNodes().GetEndOfAutotext() ),
+ SwStartNode* pSttNd = rDoc.GetNodes().MakeTextSection(
+ SwNodeIndex( rDoc.GetNodes().GetEndOfAutotext() ),
SwFlyStartNode, pColl );
pNewSet->Put( SwFmtCntnt( pSttNd ));
@@ -1454,7 +1453,7 @@ SwFlyFrmFmt* SwDoc::InsertLabel( const SwLabelType eType, const String &rTxt, co
break;
default:
- ASSERT( !this, "Neuer LabelType?." );
+ OSL_ENSURE(false, "unknown LabelType?");
}
ASSERT( pNew, "No Label inserted" );
if( pNew )
@@ -1496,11 +1495,11 @@ SwFlyFrmFmt* SwDoc::InsertLabel( const SwLabelType eType, const String &rTxt, co
pNew->InsertItem( aFmt, nIdx, nIdx );
if(rCharacterStyle.Len())
{
- SwCharFmt* pCharFmt = FindCharFmtByName( rCharacterStyle );
+ SwCharFmt* pCharFmt = rDoc.FindCharFmtByName(rCharacterStyle);
if( !pCharFmt )
{
- const USHORT nMyId = SwStyleNameMapper::GetPoolIdFromUIName(rCharacterStyle, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT);
- pCharFmt = GetCharFmtFromPool( nMyId );
+ const sal_uInt16 nMyId = SwStyleNameMapper::GetPoolIdFromUIName(rCharacterStyle, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT);
+ pCharFmt = rDoc.GetCharFmtFromPool( nMyId );
}
if (pCharFmt)
{
@@ -1520,7 +1519,8 @@ SwFlyFrmFmt* SwDoc::InsertLabel( const SwLabelType eType, const String &rTxt, co
}
else
{
- SwTableNode *pNd = GetNodes()[nNdIdx]->GetStartNode()->GetTableNode();
+ SwTableNode *const pNd =
+ rDoc.GetNodes()[nNdIdx]->GetStartNode()->GetTableNode();
SwTable &rTbl = pNd->GetTable();
if ( !rTbl.GetFrmFmt()->GetKeep().GetValue() )
rTbl.GetFrmFmt()->SetFmtAttr( SvxFmtKeepItem( sal_True, RES_KEEP ) );
@@ -1528,18 +1528,45 @@ SwFlyFrmFmt* SwDoc::InsertLabel( const SwLabelType eType, const String &rTxt, co
pUndo->SetUndoKeep();
}
}
- SetModified();
+ rDoc.SetModified();
}
- if( pUndo )
- AppendUndo( pUndo );
+ return pNewFmt;
+}
+
+SwFlyFrmFmt *
+SwDoc::InsertLabel(
+ SwLabelType const eType, String const& rTxt, String const& rSeparator,
+ String const& rNumberingSeparator,
+ sal_Bool const bBefore, sal_uInt16 const nId, sal_uLong const nNdIdx,
+ String const& rCharacterStyle,
+ sal_Bool const bCpyBrd )
+{
+ SwUndoInsertLabel * pUndo(0);
+ if (GetIDocumentUndoRedo().DoesUndo())
+ {
+ pUndo = new SwUndoInsertLabel(
+ eType, rTxt, rSeparator, rNumberingSeparator,
+ bBefore, nId, rCharacterStyle, bCpyBrd );
+ }
+
+ SwFlyFrmFmt *const pNewFmt = lcl_InsertLabel(*this, pTxtFmtCollTbl, pUndo,
+ eType, rTxt, rSeparator, rNumberingSeparator, bBefore,
+ nId, nNdIdx, rCharacterStyle, bCpyBrd);
+
+ if (pUndo)
+ {
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
+ }
else
- DelAllUndoObj();
- DoUndo( bWasUndo );
+ {
+ GetIDocumentUndoRedo().DelAllUndoObj();
+ }
return pNewFmt;
}
+
/*************************************************************************
|*
|* SwDoc::InsertDrawLabel()
@@ -1549,41 +1576,25 @@ SwFlyFrmFmt* SwDoc::InsertLabel( const SwLabelType eType, const String &rTxt, co
|*
|*************************************************************************/
-SwFlyFrmFmt* SwDoc::InsertDrawLabel( const String &rTxt,
+static SwFlyFrmFmt *
+lcl_InsertDrawLabel( SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
+ SwUndoInsertLabel *const pUndo, SwDrawFrmFmt *const pOldFmt,
+ String const& rTxt,
const String& rSeparator,
const String& rNumberSeparator,
const sal_uInt16 nId,
const String& rCharacterStyle,
SdrObject& rSdrObj )
{
-
- SwDrawContact* pContact = (SwDrawContact*)GetUserCall( &rSdrObj );
- ASSERT( RES_DRAWFRMFMT == pContact->GetFmt()->Which(),
- "Kein DrawFrmFmt" );
- if ( !pContact )
- return 0;
-
- SwDrawFrmFmt* pOldFmt = (SwDrawFrmFmt *)pContact->GetFmt();
- if( !pOldFmt )
- return 0;
-
- sal_Bool bWasUndo = DoesUndo();
- sal_Bool bWasNoDrawUndo = IsNoDrawUndoObj();
- SwUndoInsertLabel* pUndo = 0;
- if( bWasUndo )
- {
- ClearRedo();
- pUndo = new SwUndoInsertLabel(
- LTYPE_DRAW, rTxt, rSeparator, rNumberSeparator, sal_False, nId, rCharacterStyle, sal_False );
- DoUndo( sal_False );
- SetNoDrawUndoObj( sal_True );
- }
+ ::sw::UndoGuard const undoGuard(rDoc.GetIDocumentUndoRedo());
+ ::sw::DrawUndoGuard const drawUndoGuard(rDoc.GetIDocumentUndoRedo());
// Erstmal das Feld bauen, weil ueber den Namen die TxtColl besorgt
// werden muss
- ASSERT( nId == USHRT_MAX || nId < GetFldTypes()->Count(), "FldType overflow" );
- SwFieldType *pType = nId != USHRT_MAX ? (*GetFldTypes())[nId] : 0;
- ASSERT( !pType || pType->Which() == RES_SETEXPFLD, "Wrong label id" );
+ OSL_ENSURE( nId == USHRT_MAX || nId < rDoc.GetFldTypes()->Count(),
+ "FldType index out of bounds" );
+ SwFieldType *pType = nId != USHRT_MAX ? (*rDoc.GetFldTypes())[nId] : 0;
+ OSL_ENSURE( !pType || pType->Which() == RES_SETEXPFLD, "Wrong label id" );
SwTxtFmtColl *pColl = NULL;
if( pType )
@@ -1600,7 +1611,9 @@ SwFlyFrmFmt* SwDoc::InsertDrawLabel( const String &rTxt,
}
if( !pColl )
- pColl = GetTxtCollFromPool( RES_POOLCOLL_LABEL );
+ {
+ pColl = rDoc.GetTxtCollFromPool( RES_POOLCOLL_LABEL );
+ }
SwTxtNode* pNew = NULL;
SwFlyFrmFmt* pNewFmt = NULL;
@@ -1639,8 +1652,8 @@ SwFlyFrmFmt* SwDoc::InsertDrawLabel( const String &rTxt,
// Den Rahmen ggf. in den Hintergrund schicken.
// OD 02.07.2003 #108784# - consider 'invisible' hell layer.
- if ( GetHellId() != nLayerId &&
- GetInvisibleHellId() != nLayerId )
+ if ( rDoc.GetHellId() != nLayerId &&
+ rDoc.GetInvisibleHellId() != nLayerId )
{
SvxOpaqueItem aOpaque( RES_OPAQUE );
aOpaque.SetValue( sal_True );
@@ -1669,11 +1682,12 @@ SwFlyFrmFmt* SwDoc::InsertDrawLabel( const String &rTxt,
pNewSet->Put( pOldFmt->GetULSpace() );
SwStartNode* pSttNd =
- GetNodes().MakeTextSection( SwNodeIndex( GetNodes().GetEndOfAutotext() ),
+ rDoc.GetNodes().MakeTextSection(
+ SwNodeIndex( rDoc.GetNodes().GetEndOfAutotext() ),
SwFlyStartNode, pColl );
- pNewFmt = MakeFlyFrmFmt( GetUniqueFrameName(),
- GetFrmFmtFromPool( RES_POOLFRM_FRAME ) );
+ pNewFmt = rDoc.MakeFlyFrmFmt( rDoc.GetUniqueFrameName(),
+ rDoc.GetFrmFmtFromPool( RES_POOLFRM_FRAME ) );
// JP 28.10.99: Bug 69487 - set border and shadow to default if the
// template contains any.
@@ -1712,11 +1726,15 @@ SwFlyFrmFmt* SwDoc::InsertDrawLabel( const String &rTxt,
pNewSet->ClearItem();
pNewSet->Put( SwFmtSurround( SURROUND_NONE ) );
- if( nLayerId == GetHellId() )
- rSdrObj.SetLayer( GetHeavenId() );
+ if (nLayerId == rDoc.GetHellId())
+ {
+ rSdrObj.SetLayer( rDoc.GetHeavenId() );
+ }
// OD 02.07.2003 #108784# - consider drawing objects in 'invisible' hell layer
- else if( nLayerId == GetInvisibleHellId() )
- rSdrObj.SetLayer( GetInvisibleHeavenId() );
+ else if (nLayerId == rDoc.GetInvisibleHellId())
+ {
+ rSdrObj.SetLayer( rDoc.GetInvisibleHeavenId() );
+ }
pNewSet->Put( SvxLRSpaceItem( RES_LR_SPACE ) );
pNewSet->Put( SvxULSpaceItem( RES_UL_SPACE ) );
@@ -1785,11 +1803,11 @@ SwFlyFrmFmt* SwDoc::InsertDrawLabel( const String &rTxt,
pNew->InsertItem( aFmt, nIdx, nIdx );
if ( rCharacterStyle.Len() )
{
- SwCharFmt* pCharFmt = FindCharFmtByName( rCharacterStyle );
+ SwCharFmt * pCharFmt = rDoc.FindCharFmtByName(rCharacterStyle);
if ( !pCharFmt )
{
- const USHORT nMyId = SwStyleNameMapper::GetPoolIdFromUIName( rCharacterStyle, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT );
- pCharFmt = GetCharFmtFromPool( nMyId );
+ const sal_uInt16 nMyId = SwStyleNameMapper::GetPoolIdFromUIName( rCharacterStyle, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT );
+ pCharFmt = rDoc.GetCharFmtFromPool( nMyId );
}
if ( pCharFmt )
{
@@ -1801,18 +1819,54 @@ SwFlyFrmFmt* SwDoc::InsertDrawLabel( const String &rTxt,
}
}
- if( pUndo )
+ return pNewFmt;
+}
+
+SwFlyFrmFmt* SwDoc::InsertDrawLabel(
+ String const& rTxt,
+ String const& rSeparator,
+ String const& rNumberSeparator,
+ sal_uInt16 const nId,
+ String const& rCharacterStyle,
+ SdrObject& rSdrObj )
+{
+ SwDrawContact *const pContact =
+ static_cast<SwDrawContact*>(GetUserCall( &rSdrObj ));
+ OSL_ENSURE( RES_DRAWFRMFMT == pContact->GetFmt()->Which(),
+ "InsertDrawLabel(): not a DrawFrmFmt" );
+ if (!pContact)
+ return 0;
+
+ SwDrawFrmFmt* pOldFmt = (SwDrawFrmFmt *)pContact->GetFmt();
+ if (!pOldFmt)
+ return 0;
+
+ SwUndoInsertLabel * pUndo = 0;
+ if (GetIDocumentUndoRedo().DoesUndo())
+ {
+ GetIDocumentUndoRedo().ClearRedo();
+ pUndo = new SwUndoInsertLabel(
+ LTYPE_DRAW, rTxt, rSeparator, rNumberSeparator, sal_False,
+ nId, rCharacterStyle, sal_False );
+ }
+
+ SwFlyFrmFmt *const pNewFmt = lcl_InsertDrawLabel(
+ *this, pTxtFmtCollTbl, pUndo, pOldFmt,
+ rTxt, rSeparator, rNumberSeparator, nId, rCharacterStyle, rSdrObj);
+
+ if (pUndo)
{
- AppendUndo( pUndo );
- SetNoDrawUndoObj( bWasNoDrawUndo );
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
}
else
- DelAllUndoObj();
- DoUndo( bWasUndo );
+ {
+ GetIDocumentUndoRedo().DelAllUndoObj();
+ }
return pNewFmt;
}
+
/*************************************************************************
|*
|* IDocumentTimerAccess-methods
@@ -1881,7 +1935,12 @@ IMPL_LINK( SwDoc, DoIdleJobs, Timer *, pTimer )
if( pTmpRoot->IsNeedGrammarCheck() )
{
+<<<<<<< local
BOOL bIsOnlineSpell = pSh->GetViewOptions()->IsOnlineSpell();
+=======
+ sal_Bool bIsOnlineSpell = pSh->GetViewOptions()->IsOnlineSpell();
+
+>>>>>>> other
sal_Bool bIsAutoGrammar = sal_False;
SvtLinguConfig().GetProperty( ::rtl::OUString::createFromAscii(
UPN_IS_GRAMMAR_AUTO ) ) >>= bIsAutoGrammar;
@@ -2278,7 +2337,7 @@ short SwDoc::GetTextDirection( const SwPosition& rPos,
if( !pItem )
{
- const SwPageDesc* pPgDsc = pNd->FindPageDesc( FALSE );
+ const SwPageDesc* pPgDsc = pNd->FindPageDesc( sal_False );
if( pPgDsc )
pItem = &pPgDsc->GetMaster().GetFrmDir();
}
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index 8e80ca7adf34..9ff8e90f76b6 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -96,6 +96,7 @@
#include <IGrammarContact.hxx>
#include <tblsel.hxx>
#include <MarkManager.hxx>
+#include <UndoManager.hxx>
#include <unochart.hxx>
#include <cmdid.h> // fuer den dflt - Printer in SetJob
@@ -202,7 +203,7 @@ void StartGrammarChecking( SwDoc &rDoc )
-BOOL lcl_DelFmtIndizes( const SwFrmFmtPtr& rpFmt, void* )
+sal_Bool lcl_DelFmtIndizes( const SwFrmFmtPtr& rpFmt, void* )
{
SwFmtCntnt &rFmtCntnt = (SwFmtCntnt&)rpFmt->GetCntnt();
if ( rFmtCntnt.GetCntntIdx() )
@@ -210,19 +211,21 @@ BOOL lcl_DelFmtIndizes( const SwFrmFmtPtr& rpFmt, void* )
SwFmtAnchor &rFmtAnchor = (SwFmtAnchor&)rpFmt->GetAnchor();
if ( rFmtAnchor.GetCntntAnchor() )
rFmtAnchor.SetAnchor( 0 );
- return TRUE;
+ return sal_True;
}
/*
* exportierte Methoden
*/
-SwDoc::SwDoc() :
- aNodes( this ),
- aUndoNodes( this ),
+SwDoc::SwDoc()
+ : m_pNodes( new SwNodes(this) )
+ ,
mpAttrPool(new SwAttrPool(this)),
pMarkManager(new ::sw::mark::MarkManager(*this)),
m_pMetaFieldManager(new ::sw::MetaFieldManager()),
+ m_pUndoManager(new ::sw::UndoManager(
+ ::std::auto_ptr<SwNodes>(new SwNodes(this)), *this, *this, *this)),
pDfltFrmFmt( new SwFrmFmt( GetAttrPool(), sFrmFmtStr, 0 ) ),
pEmptyPageFmt( new SwFrmFmt( GetAttrPool(), sEmptyPageStr, pDfltFrmFmt ) ),
pColumnContFmt( new SwFrmFmt( GetAttrPool(), sColumnCntStr, pDfltFrmFmt ) ),
@@ -240,7 +243,6 @@ SwDoc::SwDoc() :
pDefTOXBases( new SwDefTOXBase_Impl() ),
pCurrentView( 0 ), //swmod 071225
pDrawModel( 0 ),
- pUndos( new SwUndos( 0, 20 ) ),
pUpdtFlds( new SwDocUpdtFld() ),
pFldTypes( new SwFldTypes() ),
pVirDev( 0 ),
@@ -254,7 +256,6 @@ SwDoc::SwDoc() :
pFtnIdxs( new SwFtnIdxs ),
pDocStat( new SwDocStat ),
pDocShell( 0 ),
- pDocShRef( 0 ),
pLinkMgr( new sfx2::LinkManager( 0 ) ),
pACEWord( 0 ),
pURLStateChgd( 0 ),
@@ -282,10 +283,6 @@ SwDoc::SwDoc() :
mpListItemsList( new tImplSortedNodeNumList() ),
// <--
m_pXmlIdRegistry(),
- nUndoPos( 0 ),
- nUndoSavePos( 0 ),
- nUndoCnt( 0 ),
- nUndoSttEnd( 0 ),
nAutoFmtRedlnCommentNo( 0 ),
nLinkUpdMode( GLOBALSETTING ),
eFldUpdMode( AUTOUPD_GLOBALSETTING ),
@@ -311,13 +308,16 @@ SwDoc::SwDoc() :
mbGlossDoc =
mbModified =
mbDtor =
- mbUndo =
mbPageNums =
mbLoaded =
mbUpdateExpFld =
mbNewDoc =
mbCopyIsMove =
+<<<<<<< local
mbNoDrawUndoObj =
+=======
+ mbBrowseMode =
+>>>>>>> other
mbInReading =
mbInXMLImport =
mbUpdateTOX =
@@ -342,7 +342,6 @@ SwDoc::SwDoc() :
// <--
false;
- mbGroupUndo =
mbNewFldLst =
mbVisibleLinks =
mbPurgeOLE =
@@ -434,8 +433,10 @@ SwDoc::SwDoc() :
pOutlineRule->SetCountPhantoms( !get(IDocumentSettingAccess::OLD_NUMBERING) );
// <--
- new SwTxtNode( SwNodeIndex( aUndoNodes.GetEndOfContent() ), pDfltTxtFmtColl );
- new SwTxtNode( SwNodeIndex( aNodes.GetEndOfContent() ),
+ new SwTxtNode(
+ SwNodeIndex(GetUndoManager().GetUndoNodes().GetEndOfContent()),
+ pDfltTxtFmtColl );
+ new SwTxtNode( SwNodeIndex( GetNodes().GetEndOfContent() ),
GetTxtCollFromPool( RES_POOLCOLL_STANDARD ));
// den eigenen IdleTimer setzen
@@ -475,6 +476,14 @@ SwDoc::SwDoc() :
SwDoc::~SwDoc()
{
+ // nothing here should create Undo actions!
+ GetIDocumentUndoRedo().DoUndo(false);
+
+ if (pDocShell)
+ {
+ pDocShell->SetUndoManager(0);
+ }
+
// --> OD 2007-03-16 #i73788#
SwPauseThreadStarting aPauseThreadStarting;
// <--
@@ -523,9 +532,7 @@ SwDoc::~SwDoc()
delete pPgPViewPrtData;
- mbUndo = FALSE; // immer das Undo abschalten !!
- // damit die Fussnotenattribute die Fussnotennodes in Frieden lassen.
- mbDtor = TRUE;
+ mbDtor = sal_True;
delete pRedlineTbl;
delete pUnoCrsrTbl;
@@ -539,7 +546,7 @@ SwDoc::~SwDoc()
// die BaseLinks freigeben.
{
- for( USHORT n = pLinkMgr->GetServers().Count(); n; )
+ for( sal_uInt16 n = pLinkMgr->GetServers().Count(); n; )
pLinkMgr->GetServers()[ --n ]->Closed();
if( pLinkMgr->GetLinks().Count() )
@@ -548,13 +555,14 @@ SwDoc::~SwDoc()
// die KapitelNummern / Nummern muessen vor den Vorlage geloescht werden
// ansonsten wird noch staendig geupdatet !!!
- aNodes.pOutlineNds->Remove( USHORT(0), aNodes.pOutlineNds->Count() );
- aUndoNodes.pOutlineNds->Remove( USHORT(0), aUndoNodes.pOutlineNds->Count() );
+ m_pNodes->pOutlineNds->Remove(sal_uInt16(0), m_pNodes->pOutlineNds->Count());
+ SwNodes & rUndoNodes( GetUndoManager().GetUndoNodes() );
+ rUndoNodes.pOutlineNds->Remove(sal_uInt16(0), rUndoNodes.pOutlineNds->Count());
- pFtnIdxs->Remove( USHORT(0), pFtnIdxs->Count() );
+ pFtnIdxs->Remove( sal_uInt16(0), pFtnIdxs->Count() );
- pUndos->DeleteAndDestroy( 0, pUndos->Count() ); //Es koennen in den Attributen noch
- //noch indizes angemeldet sein.
+ // indices could be registered in attributes
+ m_pUndoManager->DelAllUndoObj();
// in den BookMarks sind Indizies auf den Content. Diese muessen vorm
// loesche der Nodes geloescht werden.
@@ -573,7 +581,7 @@ SwDoc::~SwDoc()
//JP: alt - loeschen ohne Flag ist teuer; Modify wird verschickt!
// aTOXTypes.DeleteAndDestroy( 0, aTOXTypes.Count() );
{
- for( USHORT n = pTOXTypes->Count(); n; )
+ for( sal_uInt16 n = pTOXTypes->Count(); n; )
{
(*pTOXTypes)[ --n ]->SetInDocDTOR();
delete (*pTOXTypes)[ n ];
@@ -597,8 +605,8 @@ SwDoc::~SwDoc()
// Inhaltssections loeschen
// nicht erst durch den SwNodes-DTOR, damit Formate
// keine Abhaengigen mehr haben.
- aNodes.DelNodes( SwNodeIndex( aNodes ), aNodes.Count() );
- aUndoNodes.DelNodes( SwNodeIndex( aUndoNodes ), aUndoNodes.Count() );
+ m_pNodes->DelNodes( SwNodeIndex(*m_pNodes), m_pNodes->Count() );
+ rUndoNodes.DelNodes( SwNodeIndex( rUndoNodes ), rUndoNodes.Count() );
// Formate loeschen, spaeter mal permanent machen.
@@ -688,7 +696,6 @@ SwDoc::~SwDoc()
delete pFtnIdxs;
delete pFldTypes;
delete pTOXTypes;
- delete pUndos;
delete pDocStat;
delete pEmptyPageFmt;
delete pColumnContFmt;
@@ -751,7 +758,15 @@ void SwDoc::SetDocShell( SwDocShell* pDSh )
{
if( pDocShell != pDSh )
{
+ if (pDocShell)
+ {
+ pDocShell->SetUndoManager(0);
+ }
pDocShell = pDSh;
+ if (pDocShell)
+ {
+ pDocShell->SetUndoManager(& GetUndoManager());
+ }
pLinkMgr->SetPersist( pDocShell );
//JP 27.08.98: Bug 55570 - DocShell Pointer auch am DrawModel setzen
@@ -790,9 +805,8 @@ SfxObjectShell* SwDoc::GetPersist() const
void SwDoc::ClearDoc()
{
- BOOL bOldUndo = mbUndo;
- DelAllUndoObj();
- mbUndo = FALSE; // immer das Undo abschalten !!
+ GetIDocumentUndoRedo().DelAllUndoObj();
+ ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
// Undo-Benachrichtigung vom Draw abschalten
if( pDrawModel )
@@ -802,7 +816,7 @@ void SwDoc::ClearDoc()
}
// stehen noch FlyFrames rum, loesche auch diese
- USHORT n;
+ sal_uInt16 n;
while ( 0 != (n = GetSpzFrmFmts()->Count()) )
DelLayoutFmt((*pSpzFrmFmtTbl)[n-1]);
ASSERT( !pDrawModel || !pDrawModel->GetPage(0)->GetObjCount(),
@@ -901,8 +915,6 @@ void SwDoc::ClearDoc()
pFirstNd->ResetAllAttr();
// delete now the dummy pagedesc
DelPageDesc( nDummyPgDsc );
-
- mbUndo = bOldUndo;
}
void SwDoc::SetPreViewPrtData( const SwPagePreViewPrtData* pNew )
@@ -958,11 +970,11 @@ IGrammarContact* getGrammarContact( const SwTxtNode& rTxtNode )
// --> FME 2005-02-25 #i42634# Moved common code of SwReader::Read() and
// SwDocShell::UpdateLinks() to new SwDoc::UpdateLinks():
-void SwDoc::UpdateLinks( BOOL bUI )
+void SwDoc::UpdateLinks( sal_Bool bUI )
{
SfxObjectCreateMode eMode;
- USHORT nLinkMode = getLinkUpdateMode( true );
- USHORT nUpdateDocMode = GetDocShell()->GetUpdateDocMode();
+ sal_uInt16 nLinkMode = getLinkUpdateMode( true );
+ sal_uInt16 nUpdateDocMode = GetDocShell()->GetUpdateDocMode();
if( GetDocShell() &&
(nLinkMode != NEVER || document::UpdateDocMode::FULL_UPDATE == nUpdateDocMode) &&
GetLinkManager().GetLinks().Count() &&
@@ -973,13 +985,13 @@ void SwDoc::UpdateLinks( BOOL bUI )
!GetDocShell()->IsPreview() )
{
ViewShell* pVSh = 0;
- BOOL bAskUpdate = nLinkMode == MANUAL;
- BOOL bUpdate = TRUE;
+ sal_Bool bAskUpdate = nLinkMode == MANUAL;
+ sal_Bool bUpdate = sal_True;
switch(nUpdateDocMode)
{
- case document::UpdateDocMode::NO_UPDATE: bUpdate = FALSE;break;
- case document::UpdateDocMode::QUIET_UPDATE:bAskUpdate = FALSE; break;
- case document::UpdateDocMode::FULL_UPDATE: bAskUpdate = TRUE; break;
+ case document::UpdateDocMode::NO_UPDATE: bUpdate = sal_False;break;
+ case document::UpdateDocMode::QUIET_UPDATE:bAskUpdate = sal_False; break;
+ case document::UpdateDocMode::FULL_UPDATE: bAskUpdate = sal_True; break;
}
if( bUpdate && (bUI || !bAskUpdate) )
{
@@ -991,10 +1003,10 @@ void SwDoc::UpdateLinks( BOOL bUI )
ViewShell aVSh( *this, 0, 0 );
SET_CURR_SHELL( &aVSh );
- GetLinkManager().UpdateAllLinks( bAskUpdate , TRUE, FALSE, pDlgParent );
+ GetLinkManager().UpdateAllLinks( bAskUpdate , sal_True, sal_False, pDlgParent );
}
else
- GetLinkManager().UpdateAllLinks( bAskUpdate, TRUE, FALSE, pDlgParent );
+ GetLinkManager().UpdateAllLinks( bAskUpdate, sal_True, sal_False, pDlgParent );
}
}
@@ -1057,6 +1069,30 @@ SwDoc::GetMetaFieldManager()
return *m_pMetaFieldManager;
}
+::sw::UndoManager &
+SwDoc::GetUndoManager()
+{
+ return *m_pUndoManager;
+}
+
+::sw::UndoManager const&
+SwDoc::GetUndoManager() const
+{
+ return *m_pUndoManager;
+}
+
+IDocumentUndoRedo &
+SwDoc::GetIDocumentUndoRedo()
+{
+ return *m_pUndoManager;
+}
+
+IDocumentUndoRedo const&
+SwDoc::GetIDocumentUndoRedo() const
+{
+ return *m_pUndoManager;
+}
+
void SwDoc::InitTOXTypes()
{
ShellResource* pShellRes = ViewShell::GetShellRes();
@@ -1083,7 +1119,7 @@ SfxObjectShell* SwDoc::CreateCopy(bool bCallInitNew ) const
{
SwDoc* pRet = new SwDoc;
//copy settings
- USHORT __FAR_DATA aRangeOfDefaults[] = {
+ sal_uInt16 __FAR_DATA aRangeOfDefaults[] = {
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
RES_CHRATR_BEGIN, RES_CHRATR_END-1,
RES_PARATR_BEGIN, RES_PARATR_END-1,
@@ -1096,8 +1132,8 @@ SfxObjectShell* SwDoc::CreateCopy(bool bCallInitNew ) const
SfxItemSet aNewDefaults( pRet->GetAttrPool(), aRangeOfDefaults );
- USHORT nWhich;
- USHORT nRange = 0;
+ sal_uInt16 nWhich;
+ sal_uInt16 nRange = 0;
while( aRangeOfDefaults[nRange] != 0)
{
for( nWhich = aRangeOfDefaults[nRange]; nWhich < aRangeOfDefaults[nRange + 1]; ++nWhich )
@@ -1143,22 +1179,30 @@ SfxObjectShell* SwDoc::CreateCopy(bool bCallInitNew ) const
// COMPATIBILITY FLAGS END
//
pRet->ReplaceStyles( * const_cast< SwDoc*>( this ));
- SfxObjectShellRef aDocShellRef = const_cast< SwDocShell* >( GetDocShell() );
- pRet->SetRefForDocShell( boost::addressof(aDocShellRef) );
- SfxObjectShellRef xRetShell = new SwDocShell( pRet, SFX_CREATE_MODE_STANDARD );
+
+ // we have to use pointer here, since the callee has to decide whether SfxObjectShellLock or SfxObjectShellRef should be used
+ // sometimes the object will be returned with refcount set to 0 ( if no DoInitNew is done )
+ SfxObjectShell* pRetShell = new SwDocShell( pRet, SFX_CREATE_MODE_STANDARD );
if( bCallInitNew )
- xRetShell->DoInitNew();
+ {
+ // it could happen that DoInitNew creates model, that increases the refcount of the object
+ pRetShell->DoInitNew();
+ }
+
//copy content
pRet->Paste( *this );
- pRet->SetRefForDocShell( 0 );
- return xRetShell;
+
+ // remove the temporary shell if it is there as it was done before
+ pRet->SetTmpDocShell( (SfxObjectShell*)NULL );
+
+ return pRetShell;
}
/*-- 08.05.2009 10:52:40---------------------------------------------------
- copy document content - code from SwFEShell::Paste( SwDoc* , BOOL )
+ copy document content - code from SwFEShell::Paste( SwDoc* , sal_Bool )
-----------------------------------------------------------------------*/
void SwDoc::Paste( const SwDoc& rSource )
{
-// this has to be empty const USHORT nStartPageNumber = GetPhyPageNum();
+// this has to be empty const sal_uInt16 nStartPageNumber = GetPhyPageNum();
// until the end of the NodesArray
SwNodeIndex aSourceIdx( rSource.GetNodes().GetEndOfExtras(), 2 );
SwPaM aCpyPam( aSourceIdx ); //DocStart
@@ -1169,7 +1213,7 @@ void SwDoc::Paste( const SwDoc& rSource )
aCpyPam.SetMark();
aCpyPam.Move( fnMoveForward, fnGoDoc );
- this->StartUndo( UNDO_INSGLOSSARY, NULL );
+ this->GetIDocumentUndoRedo().StartUndo( UNDO_INSGLOSSARY, NULL );
this->LockExpFlds();
{
@@ -1204,9 +1248,9 @@ void SwDoc::Paste( const SwDoc& rSource )
//additionally copy page bound frames
if( /*bIncludingPageFrames && */rSource.GetSpzFrmFmts()->Count() )
{
- for ( USHORT i = 0; i < rSource.GetSpzFrmFmts()->Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rSource.GetSpzFrmFmts()->Count(); ++i )
{
- BOOL bInsWithFmt = TRUE;
+ sal_Bool bInsWithFmt = sal_True;
const SwFrmFmt& rCpyFmt = *(*rSource.GetSpzFrmFmts())[i];
if( bInsWithFmt )
{
@@ -1223,7 +1267,7 @@ void SwDoc::Paste( const SwDoc& rSource )
}
}
- this->EndUndo( UNDO_INSGLOSSARY, NULL );
+ this->GetIDocumentUndoRedo().EndUndo( UNDO_INSGLOSSARY, NULL );
UnlockExpFlds();
UpdateFlds(NULL, false);
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx
index e0ebde6d8782..93cef43b956c 100644
--- a/sw/source/core/doc/docnum.cxx
+++ b/sw/source/core/doc/docnum.cxx
@@ -27,6 +27,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
#include <hintids.hxx>
#include <tools/date.hxx>
#include <tools/time.hxx>
@@ -35,11 +36,14 @@
#include <ftninfo.hxx>
#include <ftnidx.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <pam.hxx>
#include <ndtxt.hxx>
#include <doctxm.hxx> // pTOXBaseRing
#include <poolfmt.hxx>
-#include <undobj.hxx>
+#include <UndoCore.hxx>
+#include <UndoRedline.hxx>
+#include <UndoNumbering.hxx>
#include <swundo.hxx>
#include <SwUndoFmt.hxx>
#include <rolbck.hxx>
@@ -61,7 +65,7 @@
#include <map>
-inline BYTE GetUpperLvlChg( BYTE nCurLvl, BYTE nLevel, USHORT nMask )
+inline sal_uInt8 GetUpperLvlChg( sal_uInt8 nCurLvl, sal_uInt8 nLevel, sal_uInt16 nMask )
{
if( 1 < nLevel )
{
@@ -70,7 +74,7 @@ inline BYTE GetUpperLvlChg( BYTE nCurLvl, BYTE nLevel, USHORT nMask )
else
nCurLvl = 0;
}
- return static_cast<BYTE>((nMask - 1) & ~(( 1 << nCurLvl ) - 1));
+ return static_cast<sal_uInt8>((nMask - 1) & ~(( 1 << nCurLvl ) - 1));
}
void SwDoc::SetOutlineNumRule( const SwNumRule& rRule )
@@ -92,7 +96,7 @@ void SwDoc::SetOutlineNumRule( const SwNumRule& rRule )
// <--
// --> OD 2006-09-21 #i69522#
// assure that the outline numbering rule is an automatic rule
- pOutlineRule->SetAutoRule( TRUE );
+ pOutlineRule->SetAutoRule( sal_True );
// <--
// teste ob die evt. gesetzen CharFormate in diesem Document
@@ -121,7 +125,7 @@ void SwDoc::SetOutlineNumRule( const SwNumRule& rRule )
// <--
PropagateOutlineRule();
- pOutlineRule->SetInvalidRule(TRUE);
+ pOutlineRule->SetInvalidRule(sal_True);
UpdateNumRule();
// gibt es Fussnoten && gilt Kapitelweises Nummerieren, dann updaten
@@ -135,7 +139,7 @@ void SwDoc::SetOutlineNumRule( const SwNumRule& rRule )
void SwDoc::PropagateOutlineRule()
{
- for (USHORT n = 0; n < pTxtFmtCollTbl->Count(); n++)
+ for (sal_uInt16 n = 0; n < pTxtFmtCollTbl->Count(); n++)
{
SwTxtFmtColl *pColl = (*pTxtFmtCollTbl)[n];
@@ -144,7 +148,7 @@ void SwDoc::PropagateOutlineRule()
{
// --> OD 2006-11-20 #i71764#
// Check only the list style, which is set at the paragraph style
- const SwNumRuleItem & rCollRuleItem = pColl->GetNumRule( FALSE );
+ const SwNumRuleItem & rCollRuleItem = pColl->GetNumRule( sal_False );
// <--
// --> OD 2006-11-20 #i71764#
@@ -166,21 +170,21 @@ void SwDoc::PropagateOutlineRule()
}
// Hoch-/Runterstufen
-BOOL SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset )
+sal_Bool SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset )
{
if( !GetNodes().GetOutLineNds().Count() || !nOffset )
- return FALSE;
+ return sal_False;
// den Bereich feststellen
const SwOutlineNodes& rOutlNds = GetNodes().GetOutLineNds();
const SwNodePtr pSttNd = (SwNodePtr)&rPam.Start()->nNode.GetNode();
const SwNodePtr pEndNd = (SwNodePtr)&rPam.End()->nNode.GetNode();
- USHORT nSttPos, nEndPos;
+ sal_uInt16 nSttPos, nEndPos;
if( !rOutlNds.Seek_Entry( pSttNd, &nSttPos ) &&
!nSttPos-- )
// wir stehen in keiner "Outline-Section"
- return FALSE;
+ return sal_False;
if( rOutlNds.Seek_Entry( pEndNd, &nEndPos ) )
++nEndPos;
@@ -188,7 +192,7 @@ BOOL SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset )
// jetzt haben wir unseren Bereich im OutlineNodes-Array
// dann prufe ersmal, ob nicht unterebenen aufgehoben werden
// (Stufung ueber die Grenzen)
- USHORT n;
+ sal_uInt16 n;
// so, dann koennen wir:
// 1. Vorlagen-Array anlegen
@@ -197,7 +201,7 @@ BOOL SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset )
for( n = 0; n < pTxtFmtCollTbl->Count(); ++n )
{
- //BYTE nLevel = (*pTxtFmtCollTbl)[ n ]->GetOutlineLevel();//#outline level,zhaojianwei
+ //sal_uInt8 nLevel = (*pTxtFmtCollTbl)[ n ]->GetOutlineLevel();//#outline level,zhaojianwei
//if( nLevel < MAXLEVEL )
// aCollArr[ nLevel ] = (*pTxtFmtCollTbl)[ n ];
if((*pTxtFmtCollTbl)[ n ]->IsAssignedToListLevelOfOutlineStyle())
@@ -310,12 +314,12 @@ BOOL SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset )
*/
if (aCollArr[n] != NULL)
{
- USHORT m = n;
+ sal_uInt16 m = n;
int nCount = nNum;
while (nCount > 0 && m + nStep >= 0 && m + nStep < MAXLEVEL)
{
- m = static_cast<USHORT>(m + nStep);
+ m = static_cast<sal_uInt16>(m + nStep);
if (aCollArr[m] != NULL)
nCount--;
@@ -363,14 +367,14 @@ BOOL SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset )
}
if (! bMoveApplicable )
- return FALSE;
+ return sal_False;
/* <-- #i13747 # */
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- StartUndo(UNDO_OUTLINE_LR, NULL);
- AppendUndo( new SwUndoOutlineLeftRight( rPam, nOffset ) );
+ GetIDocumentUndoRedo().StartUndo(UNDO_OUTLINE_LR, NULL);
+ SwUndo *const pUndoOLR( new SwUndoOutlineLeftRight( rPam, nOffset ) );
+ GetIDocumentUndoRedo().AppendUndo(pUndoOLR);
}
// 2. allen Nodes die neue Vorlage zuweisen
@@ -412,52 +416,56 @@ BOOL SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset )
n++;
// Undo ???
}
- if (DoesUndo())
- EndUndo(UNDO_OUTLINE_LR, NULL);
+ if (GetIDocumentUndoRedo().DoesUndo())
+ {
+ GetIDocumentUndoRedo().EndUndo(UNDO_OUTLINE_LR, NULL);
+ }
ChkCondColls();
SetModified();
- return TRUE;
+ return sal_True;
}
// Hoch-/Runter - Verschieben !
-BOOL SwDoc::MoveOutlinePara( const SwPaM& rPam, short nOffset )
+sal_Bool SwDoc::MoveOutlinePara( const SwPaM& rPam, short nOffset )
{
// kein Verschiebung in den Sonderbereichen
const SwPosition& rStt = *rPam.Start(),
& rEnd = &rStt == rPam.GetPoint() ? *rPam.GetMark()
: *rPam.GetPoint();
if( !GetNodes().GetOutLineNds().Count() || !nOffset ||
- rStt.nNode.GetIndex() < aNodes.GetEndOfExtras().GetIndex() ||
- rEnd.nNode.GetIndex() < aNodes.GetEndOfExtras().GetIndex() )
- return FALSE;
+ (rStt.nNode.GetIndex() < GetNodes().GetEndOfExtras().GetIndex()) ||
+ (rEnd.nNode.GetIndex() < GetNodes().GetEndOfExtras().GetIndex()))
+ {
+ return sal_False;
+ }
- USHORT nAktPos = 0;
+ sal_uInt16 nAktPos = 0;
SwNodeIndex aSttRg( rStt.nNode ), aEndRg( rEnd.nNode );
- //BYTE nOutLineLevel = NO_NUMBERING; //#outline level,zhaojianwei
+ //sal_uInt8 nOutLineLevel = NO_NUMBERING; //#outline level,zhaojianwei
int nOutLineLevel = MAXLEVEL; //<-end,zhaojianwei
SwNode* pSrch = &aSttRg.GetNode();
//if( pSrch->IsTxtNode() ) //#outline level,zhaojianwei
- // nOutLineLevel = static_cast<BYTE>(((SwTxtNode*)pSrch)->GetOutlineLevel());
+ // nOutLineLevel = static_cast<sal_uInt8>(((SwTxtNode*)pSrch)->GetOutlineLevel());
if( pSrch->IsTxtNode())
- nOutLineLevel = static_cast<BYTE>(((SwTxtNode*)pSrch)->GetAttrOutlineLevel()-1);//<-end,zhaojianwei
+ nOutLineLevel = static_cast<sal_uInt8>(((SwTxtNode*)pSrch)->GetAttrOutlineLevel()-1);//<-end,zhaojianwei
SwNode* pEndSrch = &aEndRg.GetNode();
if( !GetNodes().GetOutLineNds().Seek_Entry( pSrch, &nAktPos ) )
{
if( !nAktPos )
- return FALSE; // Promoting or demoting before the first outline => no.
+ return sal_False; // Promoting or demoting before the first outline => no.
if( --nAktPos )
aSttRg = *GetNodes().GetOutLineNds()[ nAktPos ];
else if( 0 > nOffset )
- return FALSE; // Promoting at the top of document?!
+ return sal_False; // Promoting at the top of document?!
else
aSttRg = *GetNodes().GetEndOfContent().StartOfSectionNode();
}
- USHORT nTmpPos = 0;
+ sal_uInt16 nTmpPos = 0;
// If the given range ends at an outlined text node we have to decide if it has to be a part of
// the moving range or not. Normally it will be a sub outline of our chapter
// and has to be moved, too. But if the chapter ends with a table(or a section end),
@@ -511,14 +519,14 @@ BOOL SwDoc::MoveOutlinePara( const SwPaM& rPam, short nOffset )
aEndRg++;
// calculation of the new position
- if( nOffset < 0 && nAktPos < USHORT(-nOffset) )
+ if( nOffset < 0 && nAktPos < sal_uInt16(-nOffset) )
pNd = GetNodes().GetEndOfContent().StartOfSectionNode();
else if( nAktPos + nOffset >= GetNodes().GetOutLineNds().Count() )
pNd = &GetNodes().GetEndOfContent();
else
pNd = GetNodes().GetOutLineNds()[ nAktPos + nOffset ];
- ULONG nNewPos = pNd->GetIndex();
+ sal_uLong nNewPos = pNd->GetIndex();
// And now a correction of the insert position if necessary...
SwNodeIndex aInsertPos( *pNd, -1 );
@@ -558,7 +566,7 @@ BOOL SwDoc::MoveOutlinePara( const SwPaM& rPam, short nOffset )
if( pNd->IsTableNode() )
pNd = pNd->StartOfSectionNode();
if( pNd->FindTableNode() )
- return FALSE;
+ return sal_False;
ASSERT( aSttRg.GetIndex() > nNewPos || nNewPos >= aEndRg.GetIndex(),
"Position liegt im MoveBereich" );
@@ -567,20 +575,20 @@ BOOL SwDoc::MoveOutlinePara( const SwPaM& rPam, short nOffset )
// setze die Position auf den Dokumentanfang.
// Sollten da Bereiche oder Tabellen stehen, so werden sie nach
// hinten verschoben.
- nNewPos = Max( nNewPos, aNodes.GetEndOfExtras().GetIndex() + 2 );
+ nNewPos = Max( nNewPos, GetNodes().GetEndOfExtras().GetIndex() + 2 );
long nOffs = nNewPos - ( 0 < nOffset ? aEndRg.GetIndex() : aSttRg.GetIndex());
SwPaM aPam( aSttRg, aEndRg, 0, -1 );
- return MoveParagraph( aPam, nOffs, TRUE );
+ return MoveParagraph( aPam, nOffs, sal_True );
}
-USHORT lcl_FindOutlineName( const SwNodes& rNds, const String& rName,
- BOOL bExact )
+sal_uInt16 lcl_FindOutlineName( const SwNodes& rNds, const String& rName,
+ sal_Bool bExact )
{
- USHORT nSavePos = USHRT_MAX;
+ sal_uInt16 nSavePos = USHRT_MAX;
const SwOutlineNodes& rOutlNds = rNds.GetOutLineNds();
- for( USHORT n = 0; n < rOutlNds.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rOutlNds.Count(); ++n )
{
SwTxtNode* pTxtNd = rOutlNds[ n ]->GetTxtNode();
String sTxt( pTxtNd->GetExpandTxt() );
@@ -603,7 +611,7 @@ USHORT lcl_FindOutlineName( const SwNodes& rNds, const String& rName,
-USHORT lcl_FindOutlineNum( const SwNodes& rNds, String& rName )
+sal_uInt16 lcl_FindOutlineNum( const SwNodes& rNds, String& rName )
{
// Gueltig Nummern sind (immer nur Offsets!!!):
// ([Nummer]+\.)+ (als regulaerer Ausdruck!)
@@ -614,16 +622,16 @@ USHORT lcl_FindOutlineNum( const SwNodes& rNds, String& rName )
if( STRING_NOTFOUND == nPos )
return USHRT_MAX; // ungueltige Nummer!!!
- USHORT nLevelVal[ MAXLEVEL ]; // Nummern aller Levels
+ sal_uInt16 nLevelVal[ MAXLEVEL ]; // Nummern aller Levels
memset( nLevelVal, 0, MAXLEVEL * sizeof( nLevelVal[0] ));
- BYTE nLevel = 0;
+ sal_uInt8 nLevel = 0;
String sName( rName );
while( STRING_NOTFOUND != nPos )
{
- USHORT nVal = 0;
+ sal_uInt16 nVal = 0;
sal_Unicode c;
- for( USHORT n = 0; n < sNum.Len(); ++n )
+ for( sal_uInt16 n = 0; n < sNum.Len(); ++n )
if( '0' <= ( c = sNum.GetChar( n )) && c <= '9' )
{
nVal *= 10; nVal += c - '0';
@@ -658,7 +666,7 @@ USHORT lcl_FindOutlineNum( const SwNodes& rNds, String& rName )
for( ; nPos < rOutlNds.Count(); ++nPos )
{
pNd = rOutlNds[ nPos ]->GetTxtNode();
- //BYTE nLvl = pNd->GetTxtColl()->GetOutlineLevel(); //#outline level,zhaojianwei
+ //sal_uInt8 nLvl = pNd->GetTxtColl()->GetOutlineLevel(); //#outline level,zhaojianwei
const int nLvl = pNd->GetAttrOutlineLevel()-1; //<-end,zhaojianwei
if( nLvl == nLevel - 1)
{
@@ -676,7 +684,7 @@ USHORT lcl_FindOutlineNum( const SwNodes& rNds, String& rName )
SwNumberTree::tNumberVector aLevelVal = rNdNum.GetNumberVector();
//now compare with the one searched for
bool bEqual = true;
- for( BYTE n = 0; (n < nLevel) && bEqual; ++n )
+ for( sal_uInt8 n = 0; (n < nLevel) && bEqual; ++n )
{
bEqual = aLevelVal[n] == nLevelVal[n];
}
@@ -714,7 +722,7 @@ USHORT lcl_FindOutlineNum( const SwNodes& rNds, String& rName )
// der ueber die Nummer gefunden wurde.
// Ist keine Nummer angegeben, dann nur den Text suchen.
-BOOL SwDoc::GotoOutline( SwPosition& rPos, const String& rName ) const
+sal_Bool SwDoc::GotoOutline( SwPosition& rPos, const String& rName ) const
{
if( rName.Len() )
{
@@ -722,7 +730,7 @@ BOOL SwDoc::GotoOutline( SwPosition& rPos, const String& rName ) const
// 1. Schritt: ueber die Nummer:
String sName( rName );
- USHORT nFndPos = ::lcl_FindOutlineNum( GetNodes(), sName );
+ sal_uInt16 nFndPos = ::lcl_FindOutlineNum( GetNodes(), sName );
if( USHRT_MAX != nFndPos )
{
SwTxtNode* pNd = rOutlNds[ nFndPos ]->GetTxtNode();
@@ -730,7 +738,7 @@ BOOL SwDoc::GotoOutline( SwPosition& rPos, const String& rName ) const
//#i4533# leading numbers followed by a dot have been remove while
//searching for the outline position
//to compensate this they must be removed from the paragraphs text content, too
- USHORT nPos = 0;
+ sal_uInt16 nPos = 0;
String sTempNum;
while(sExpandedText.Len() && (sTempNum = sExpandedText.GetToken(0, '.', nPos)).Len() &&
STRING_NOTFOUND != nPos &&
@@ -742,7 +750,7 @@ BOOL SwDoc::GotoOutline( SwPosition& rPos, const String& rName ) const
if( !sExpandedText.Equals( sName ) )
{
- USHORT nTmp = ::lcl_FindOutlineName( GetNodes(), sName, TRUE );
+ sal_uInt16 nTmp = ::lcl_FindOutlineName( GetNodes(), sName, sal_True );
if( USHRT_MAX != nTmp ) // ueber den Namen gefunden
{
nFndPos = nTmp;
@@ -751,34 +759,34 @@ BOOL SwDoc::GotoOutline( SwPosition& rPos, const String& rName ) const
}
rPos.nNode = *pNd;
rPos.nContent.Assign( pNd, 0 );
- return TRUE;
+ return sal_True;
}
- nFndPos = ::lcl_FindOutlineName( GetNodes(), rName, FALSE );
+ nFndPos = ::lcl_FindOutlineName( GetNodes(), rName, sal_False );
if( USHRT_MAX != nFndPos )
{
SwTxtNode* pNd = rOutlNds[ nFndPos ]->GetTxtNode();
rPos.nNode = *pNd;
rPos.nContent.Assign( pNd, 0 );
- return TRUE;
+ return sal_True;
}
// --> OD 2006-09-22 #i68289#
// additional search on hyperlink URL without its outline numbering part
if ( !sName.Equals( rName ) )
{
- nFndPos = ::lcl_FindOutlineName( GetNodes(), sName, FALSE );
+ nFndPos = ::lcl_FindOutlineName( GetNodes(), sName, sal_False );
if( USHRT_MAX != nFndPos )
{
SwTxtNode* pNd = rOutlNds[ nFndPos ]->GetTxtNode();
rPos.nNode = *pNd;
rPos.nContent.Assign( pNd, 0 );
- return TRUE;
+ return sal_True;
}
}
// <--
}
- return FALSE;
+ return sal_False;
}
/* */
@@ -786,7 +794,7 @@ BOOL SwDoc::GotoOutline( SwPosition& rPos, const String& rName ) const
// --- Nummerierung -----------------------------------------
// --> OD 2008-02-19 #refactorlists#
-//void SwNumRuleInfo::MakeList( SwDoc& rDoc, BOOL )
+//void SwNumRuleInfo::MakeList( SwDoc& rDoc, sal_Bool )
//{
// SwNumRule* pRule = rDoc.FindNumRulePtr(rName);
@@ -812,7 +820,7 @@ BOOL SwDoc::GotoOutline( SwPosition& rPos, const String& rName ) const
// {
// const SwOutlineNodes & rOutlineNodes = rDoc.GetNodes().GetOutLineNds();
-// for (USHORT i = 0; i < rOutlineNodes.Count(); ++i)
+// for (sal_uInt16 i = 0; i < rOutlineNodes.Count(); ++i)
// {
// SwTxtNode & aNode = *((SwTxtNode *) rOutlineNodes[i]);
@@ -823,7 +831,7 @@ BOOL SwDoc::GotoOutline( SwPosition& rPos, const String& rName ) const
// {
// SwModify* pMod;
// const SfxPoolItem* pItem;
-// USHORT i, nMaxItems = rDoc.GetAttrPool().GetItemCount
+// sal_uInt16 i, nMaxItems = rDoc.GetAttrPool().GetItemCount
// ( RES_PARATR_NUMRULE);
// for( i = 0; i < nMaxItems; ++i )
// {
@@ -867,8 +875,8 @@ void lcl_ChgNumRule( SwDoc& rDoc, const SwNumRule& rRule )
SwNumRule* pOld = rDoc.FindNumRulePtr( rRule.GetName() );
ASSERT( pOld, "ohne die alte NumRule geht gar nichts" );
- USHORT nChgFmtLevel = 0, nMask = 1;
- BYTE n;
+ sal_uInt16 nChgFmtLevel = 0, nMask = 1;
+ sal_uInt8 n;
for( n = 0; n < MAXLEVEL; ++n, nMask <<= 1 )
{
@@ -898,7 +906,7 @@ void lcl_ChgNumRule( SwDoc& rDoc, const SwNumRule& rRule )
// --> OD 2006-04-27 #i64311#
if ( bInvalidateNumRule )
{
- pOld->SetInvalidRule(TRUE);
+ pOld->SetInvalidRule(sal_True);
}
// <--
return ;
@@ -908,12 +916,12 @@ void lcl_ChgNumRule( SwDoc& rDoc, const SwNumRule& rRule )
// SwNumRuleInfo* pUpd = new SwNumRuleInfo( rRule.GetName() );
// pUpd->MakeList( rDoc );
-// BYTE nLvl;
-// for( ULONG nFirst = 0, nLast = pUpd->GetList().Count();
+// sal_uInt8 nLvl;
+// for( sal_uLong nFirst = 0, nLast = pUpd->GetList().Count();
// nFirst < nLast; ++nFirst )
// {
// SwTxtNode* pTxtNd = pUpd->GetList().GetObject( nFirst );
-// nLvl = static_cast<BYTE>(pTxtNd->GetLevel());
+// nLvl = static_cast<sal_uInt8>(pTxtNd->GetLevel());
// if( nLvl < MAXLEVEL )
// {
@@ -925,12 +933,12 @@ void lcl_ChgNumRule( SwDoc& rDoc, const SwNumRule& rRule )
// }
SwNumRule::tTxtNodeList aTxtNodeList;
pOld->GetTxtNodeList( aTxtNodeList );
- BYTE nLvl( 0 );
+ sal_uInt8 nLvl( 0 );
for ( SwNumRule::tTxtNodeList::iterator aIter = aTxtNodeList.begin();
aIter != aTxtNodeList.end(); ++aIter )
{
SwTxtNode* pTxtNd = *aIter;
- nLvl = static_cast<BYTE>(pTxtNd->GetActualListLevel());
+ nLvl = static_cast<sal_uInt8>(pTxtNd->GetActualListLevel());
if( nLvl < MAXLEVEL )
{
@@ -947,7 +955,7 @@ void lcl_ChgNumRule( SwDoc& rDoc, const SwNumRule& rRule )
pOld->Set( n, rRule.GetNumFmt( n ));
pOld->CheckCharFmts( &rDoc );
- pOld->SetInvalidRule(TRUE);
+ pOld->SetInvalidRule(sal_True);
pOld->SetContinusNum( rRule.IsContinusNum() );
// --> OD 2008-06-17 #i87166#
// Do NOT change list style type
@@ -971,11 +979,12 @@ void SwDoc::SetNumRule( const SwPaM& rPam,
const bool bResetIndentAttrs )
{
SwUndoInsNum * pUndo = NULL;
- if (DoesUndo())
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- StartUndo( UNDO_INSNUM, NULL ); // Klammerung fuer die Attribute!
- AppendUndo( pUndo = new SwUndoInsNum( rPam, rRule ) );
+ // Start/End for attributes!
+ GetIDocumentUndoRedo().StartUndo( UNDO_INSNUM, NULL );
+ pUndo = new SwUndoInsNum( rPam, rRule );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
SwNumRule * pNew = FindNumRulePtr( rRule.GetName() );
@@ -1097,18 +1106,20 @@ void SwDoc::SetNumRule( const SwPaM& rPam,
rPam.End()->nNode );
aPam.Start()->nContent = 0;
aPam.End()->nContent = rPam.End()->nNode.GetNode().GetTxtNode()->Len();
- ResetAttrs( aPam, FALSE, &aResetAttrsArray );
+ ResetAttrs( aPam, sal_False, &aResetAttrsArray );
}
else
{
- ResetAttrs( rPam, FALSE, &aResetAttrsArray );
+ ResetAttrs( rPam, sal_False, &aResetAttrsArray );
}
// <--
}
// <--
- if (DoesUndo())
- EndUndo( UNDO_INSNUM, NULL );
+ if (GetIDocumentUndoRedo().DoesUndo())
+ {
+ GetIDocumentUndoRedo().EndUndo( UNDO_INSNUM, NULL );
+ }
SetModified();
}
@@ -1129,22 +1140,22 @@ void SwDoc::SetCounted(const SwPaM & rPam, bool bCounted)
rPam.End()->nNode );
aPam.Start()->nContent = 0;
aPam.End()->nContent = rPam.End()->nNode.GetNode().GetTxtNode()->Len();
- ResetAttrs( aPam, FALSE, &aResetAttrsArray );
+ ResetAttrs( aPam, sal_False, &aResetAttrsArray );
}
else
{
- ResetAttrs( rPam, FALSE, &aResetAttrsArray );
+ ResetAttrs( rPam, sal_False, &aResetAttrsArray );
}
// <--
}
else
{
InsertPoolItem( rPam,
- SfxBoolItem( RES_PARATR_LIST_ISCOUNTED, FALSE ), 0 );
+ SfxBoolItem( RES_PARATR_LIST_ISCOUNTED, sal_False ), 0 );
}
}
-void SwDoc::SetNumRuleStart( const SwPosition& rPos, BOOL bFlag )
+void SwDoc::SetNumRuleStart( const SwPosition& rPos, sal_Bool bFlag )
{
SwTxtNode* pTxtNd = rPos.nNode.GetNode().GetTxtNode();
@@ -1153,10 +1164,10 @@ void SwDoc::SetNumRuleStart( const SwPosition& rPos, BOOL bFlag )
const SwNumRule* pRule = pTxtNd->GetNumRule();
if( pRule && !bFlag != !pTxtNd->IsListRestart())
{
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoNumRuleStart( rPos, bFlag ));
+ SwUndo *const pUndo( new SwUndoNumRuleStart(rPos, bFlag) );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
pTxtNd->SetListRestart(bFlag ? true : false);
@@ -1166,7 +1177,7 @@ void SwDoc::SetNumRuleStart( const SwPosition& rPos, BOOL bFlag )
}
}
-void SwDoc::SetNodeNumStart( const SwPosition& rPos, USHORT nStt )
+void SwDoc::SetNodeNumStart( const SwPosition& rPos, sal_uInt16 nStt )
{
SwTxtNode* pTxtNd = rPos.nNode.GetNode().GetTxtNode();
@@ -1188,10 +1199,10 @@ void SwDoc::SetNodeNumStart( const SwPosition& rPos, USHORT nStt )
if ( !pTxtNd->HasAttrListRestartValue() ||
pTxtNd->GetAttrListRestartValue() != nStt )
{
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoNumRuleStart( rPos, nStt ));
+ SwUndo *const pUndo( new SwUndoNumRuleStart(rPos, nStt) );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
pTxtNd->SetAttrListRestartValue( nStt );
@@ -1202,27 +1213,26 @@ void SwDoc::SetNodeNumStart( const SwPosition& rPos, USHORT nStt )
}
// loeschen geht nur, wenn die Rule niemand benutzt!
-BOOL SwDoc::DelNumRule( const String& rName, BOOL bBroadcast )
+sal_Bool SwDoc::DelNumRule( const String& rName, sal_Bool bBroadcast )
{
- USHORT nPos = FindNumRule( rName );
+ sal_uInt16 nPos = FindNumRule( rName );
// --> OD 2007-12-17 #151213#
if ( (*pNumRuleTbl)[ nPos ] == GetOutlineNumRule() )
{
ASSERT( false,
"<SwDoc::DelNumRule(..)> - No deletion of outline list style. This is serious defect - please inform OD" );
- return FALSE;
+ return sal_False;
}
// <--
if( USHRT_MAX != nPos && !IsUsed( *(*pNumRuleTbl)[ nPos ] ))
{
- if (DoesUndo())
+ if (GetIDocumentUndoRedo().DoesUndo())
{
SwUndo * pUndo =
new SwUndoNumruleDelete(*(*pNumRuleTbl)[nPos], this);
-
- AppendUndo(pUndo);
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
if (bBroadcast)
@@ -1261,9 +1271,9 @@ BOOL SwDoc::DelNumRule( const String& rName, BOOL bBroadcast )
maNumRuleMap.erase(aTmpName);
SetModified();
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// #106897#
@@ -1274,12 +1284,11 @@ void SwDoc::ChgNumRuleFmts( const SwNumRule& rRule, const String * pName )
if( pRule )
{
SwUndoInsNum* pUndo = 0;
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
pUndo = new SwUndoInsNum( *pRule, rRule );
pUndo->GetHistory();
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
}
::lcl_ChgNumRule( *this, rRule );
@@ -1291,18 +1300,17 @@ void SwDoc::ChgNumRuleFmts( const SwNumRule& rRule, const String * pName )
}
sal_Bool SwDoc::RenameNumRule(const String & rOldName, const String & rNewName,
- BOOL bBroadcast)
+ sal_Bool bBroadcast)
{
sal_Bool bResult = sal_False;
SwNumRule * pNumRule = FindNumRulePtr(rOldName);
if (pNumRule)
{
- if (DoesUndo())
+ if (GetIDocumentUndoRedo().DoesUndo())
{
SwUndo * pUndo = new SwUndoNumruleRename(rOldName, rNewName, this);
-
- AppendUndo(pUndo);
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
// --> OD 2008-02-19 #refactorlists#
@@ -1318,7 +1326,7 @@ sal_Bool SwDoc::RenameNumRule(const String & rOldName, const String & rNewName,
SwNumRuleItem aItem(rNewName);
// --> OD 2008-02-19 #refactorlists#
-// for (ULONG nI = 0; nI < aInfo.GetList().Count(); ++nI)
+// for (sal_uLong nI = 0; nI < aInfo.GetList().Count(); ++nI)
// {
// SwTxtNode * pTxtNd = aInfo.GetList().GetObject(nI);
// pTxtNd->SwCntntNode::SetAttr(aItem);
@@ -1343,8 +1351,25 @@ sal_Bool SwDoc::RenameNumRule(const String & rOldName, const String & rNewName,
void SwDoc::StopNumRuleAnimations( OutputDevice* pOut )
{
- for( USHORT n = GetNumRuleTbl().Count(); n; )
+ for( sal_uInt16 n = GetNumRuleTbl().Count(); n; )
{
+<<<<<<< local
+=======
+ // --> 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 );
+// }
+>>>>>>> other
SwNumRule::tTxtNodeList aTxtNodeList;
GetNumRuleTbl()[ --n ]->GetTxtNodeList( aTxtNodeList );
for ( SwNumRule::tTxtNodeList::iterator aTxtNodeIter = aTxtNodeList.begin();
@@ -1359,21 +1384,22 @@ void SwDoc::StopNumRuleAnimations( OutputDevice* pOut )
}
}
-BOOL SwDoc::ReplaceNumRule( const SwPosition& rPos,
+sal_Bool SwDoc::ReplaceNumRule( const SwPosition& rPos,
const String& rOldRule, const String& rNewRule )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
SwNumRule *pOldRule = FindNumRulePtr( rOldRule ),
*pNewRule = FindNumRulePtr( rNewRule );
if( pOldRule && pNewRule && pOldRule != pNewRule )
{
// --> OD 2008-02-19 #refactorlists#
SwUndoInsNum* pUndo = 0;
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- StartUndo( UNDO_START, NULL ); // Klammerung fuer die Attribute!
- AppendUndo( pUndo = new SwUndoInsNum( rPos, *pNewRule, rOldRule ) );
+ // Start/End for attributes!
+ GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
+ pUndo = new SwUndoInsNum( rPos, *pNewRule, rOldRule );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
// --> OD 2008-02-19 #refactorlists#
@@ -1391,7 +1417,7 @@ BOOL SwDoc::ReplaceNumRule( const SwPosition& rPos,
// // Position suchen und bestimme ob ein Node davor oder dahinter
// // einen Start erzwingt
// SwTxtNode* pTxtNd;
-// ULONG nFndPos, nFirst, nLast;
+// sal_uLong nFndPos, nFirst, nLast;
// if( TABLE_ENTRY_NOTFOUND != aUpd.GetList().SearchKey(
// rPos.nNode.GetIndex(), &nFndPos ))
@@ -1420,8 +1446,8 @@ BOOL SwDoc::ReplaceNumRule( const SwPosition& rPos,
// }
SwRegHistory aRegH( pUndo ? pUndo->GetHistory() : 0 );
- USHORT nChgFmtLevel = 0;
- for( BYTE n = 0; n < MAXLEVEL; ++n )
+ sal_uInt16 nChgFmtLevel = 0;
+ for( sal_uInt8 n = 0; n < MAXLEVEL; ++n )
{
const SwNumFmt& rOldFmt = pOldRule->Get( n ),
& rNewFmt = pNewRule->Get( n );
@@ -1456,10 +1482,10 @@ BOOL SwDoc::ReplaceNumRule( const SwPosition& rPos,
pTxtNd->NumRuleChgd();
}
}
- EndUndo( UNDO_END, NULL );
+ GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
SetModified();
- bRet = TRUE; // #106897#
+ bRet = sal_True; // #106897#
}
}
@@ -1493,12 +1519,12 @@ void SwDoc::MakeUniqueNumRules(const SwPaM & rPaM)
::std::map<SwNumRule *, ListStyleData> aMyNumRuleMap;
// <--
- ULONG nStt = rPaM.Start()->nNode.GetIndex();
- ULONG nEnd = rPaM.End()->nNode.GetIndex();
+ sal_uLong nStt = rPaM.Start()->nNode.GetIndex();
+ sal_uLong nEnd = rPaM.End()->nNode.GetIndex();
bool bFirst = true;
- for (ULONG n = nStt; n <= nEnd; n++)
+ for (sal_uLong n = nStt; n <= nEnd; n++)
{
SwTxtNode * pCNd = GetNodes()[n]->GetTxtNode();
@@ -1561,10 +1587,10 @@ void SwDoc::MakeUniqueNumRules(const SwPaM & rPaM)
}
}
-BOOL SwDoc::NoNum( const SwPaM& rPam )
+sal_Bool SwDoc::NoNum( const SwPaM& rPam )
{
- BOOL bRet = SplitNode( *rPam.GetPoint(), false );
+ sal_Bool bRet = SplitNode( *rPam.GetPoint(), false );
// ist ueberhaupt Nummerierung im Spiel ?
if( bRet )
{
@@ -1579,25 +1605,25 @@ BOOL SwDoc::NoNum( const SwPaM& rPam )
SetModified();
}
else
- bRet = FALSE; // keine Nummerierung , ?? oder immer TRUE ??
+ bRet = sal_False; // keine Nummerierung , ?? oder immer sal_True ??
}
return bRet;
}
void SwDoc::DelNumRules( const SwPaM& rPam )
{
- ULONG nStt = rPam.GetPoint()->nNode.GetIndex(),
+ sal_uLong nStt = rPam.GetPoint()->nNode.GetIndex(),
nEnd = rPam.GetMark()->nNode.GetIndex();
if( nStt > nEnd )
{
- ULONG nTmp = nStt; nStt = nEnd; nEnd = nTmp;
+ sal_uLong nTmp = nStt; nStt = nEnd; nEnd = nTmp;
}
SwUndoDelNum* pUndo;
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( pUndo = new SwUndoDelNum( rPam ) );
+ pUndo = new SwUndoDelNum( rPam );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
else
pUndo = 0;
@@ -1611,7 +1637,7 @@ void SwDoc::DelNumRules( const SwPaM& rPam )
SwTxtNode* pTNd = GetNodes()[ nStt ]->GetTxtNode();
// --> OD 2008-03-13 #refactorlists#
// if( pTNd && 0 != ( pItem = pTNd->GetNoCondAttr(
-// RES_PARATR_NUMRULE, TRUE ) ) &&
+// RES_PARATR_NUMRULE, sal_True ) ) &&
// ( pName = &((SwNumRuleItem*)pItem)->GetValue())->Len() )
SwNumRule* pNumRuleOfTxtNode = pTNd ? pTNd->GetNumRule() : 0;
if ( pTNd && pNumRuleOfTxtNode )
@@ -1621,13 +1647,13 @@ void SwDoc::DelNumRules( const SwPaM& rPam )
aRegH.RegisterInModify( pTNd, *pTNd );
if( pUndo )
- pUndo->AddNode( *pTNd, FALSE );
+ pUndo->AddNode( *pTNd, sal_False );
// directly set list style attribute is reset, otherwise empty
// list style is applied
const SfxItemSet* pAttrSet = pTNd->GetpSwAttrSet();
if ( pAttrSet &&
- pAttrSet->GetItemState( RES_PARATR_NUMRULE, FALSE ) == SFX_ITEM_SET )
+ pAttrSet->GetItemState( RES_PARATR_NUMRULE, sal_False ) == SFX_ITEM_SET )
pTNd->ResetAttr( RES_PARATR_NUMRULE );
else
pTNd->SetAttr( aEmptyRule );
@@ -1659,24 +1685,24 @@ void SwDoc::DelNumRules( const SwPaM& rPam )
void SwDoc::InvalidateNumRules()
{
- for (USHORT n = 0; n < pNumRuleTbl->Count(); ++n)
- (*pNumRuleTbl)[n]->SetInvalidRule(TRUE);
+ for (sal_uInt16 n = 0; n < pNumRuleTbl->Count(); ++n)
+ (*pNumRuleTbl)[n]->SetInvalidRule(sal_True);
}
// zum naechsten/vorhergehenden Punkt auf gleicher Ebene
-BOOL lcl_IsNumOk( BYTE nSrchNum, BYTE& rLower, BYTE& rUpper,
- BOOL bOverUpper, BYTE nNumber )
+sal_Bool lcl_IsNumOk( sal_uInt8 nSrchNum, sal_uInt8& rLower, sal_uInt8& rUpper,
+ sal_Bool bOverUpper, sal_uInt8 nNumber )
{
// --> OD 2008-04-02 #refactorlists#
ASSERT( nNumber < MAXLEVEL,
"<lcl_IsNumOk(..)> - misusage of method" );
// <--
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
{
if( bOverUpper ? nSrchNum == nNumber : nSrchNum >= nNumber )
- bRet = TRUE;
+ bRet = sal_True;
else if( nNumber > rLower )
rLower = nNumber;
else if( nNumber < rUpper )
@@ -1685,9 +1711,9 @@ BOOL lcl_IsNumOk( BYTE nSrchNum, BYTE& rLower, BYTE& rUpper,
return bRet;
}
-BOOL lcl_IsValidPrevNextNumNode( const SwNodeIndex& rIdx )
+sal_Bool lcl_IsValidPrevNextNumNode( const SwNodeIndex& rIdx )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
const SwNode& rNd = rIdx.GetNode();
switch( rNd.GetNodeType() )
{
@@ -1701,28 +1727,28 @@ BOOL lcl_IsValidPrevNextNumNode( const SwNodeIndex& rIdx )
break;
case ND_SECTIONNODE: // der ist erlaubt, also weiter
- bRet = TRUE;
+ bRet = sal_True;
break;
}
return bRet;
}
-BOOL lcl_GotoNextPrevNum( SwPosition& rPos, BOOL bNext,
- BOOL bOverUpper, BYTE* pUpper, BYTE* pLower )
+sal_Bool lcl_GotoNextPrevNum( SwPosition& rPos, sal_Bool bNext,
+ sal_Bool bOverUpper, sal_uInt8* pUpper, sal_uInt8* pLower )
{
const SwTxtNode* pNd = rPos.nNode.GetNode().GetTxtNode();
const SwNumRule* pRule;
if( !pNd || 0 == ( pRule = pNd->GetNumRule()))
- return FALSE;
+ return sal_False;
- BYTE nSrchNum = static_cast<BYTE>(pNd->GetActualListLevel());
+ sal_uInt8 nSrchNum = static_cast<sal_uInt8>(pNd->GetActualListLevel());
SwNodeIndex aIdx( rPos.nNode );
if( ! pNd->IsCountedInList() )
{
// falls gerade mal NO_NUMLEVEL an ist, so such den vorherigen Node
// mit Nummerierung
- BOOL bError = FALSE;
+ sal_Bool bError = sal_False;
do {
aIdx--;
if( aIdx.GetNode().IsTxtNode() )
@@ -1730,28 +1756,28 @@ BOOL lcl_GotoNextPrevNum( SwPosition& rPos, BOOL bNext,
pNd = aIdx.GetNode().GetTxtNode();
pRule = pNd->GetNumRule();
- BYTE nTmpNum;
+ sal_uInt8 nTmpNum;
if( pRule )
{
- nTmpNum = static_cast<BYTE>(pNd->GetActualListLevel());
+ nTmpNum = static_cast<sal_uInt8>(pNd->GetActualListLevel());
if( !( ! pNd->IsCountedInList() &&
(nTmpNum >= nSrchNum )) )
break; // gefunden
}
else
- bError = TRUE;
+ bError = sal_True;
}
else
bError = !lcl_IsValidPrevNextNumNode( aIdx );
} while( !bError );
if( bError )
- return FALSE;
+ return sal_False;
}
- BYTE nLower = nSrchNum, nUpper = nSrchNum;
- BOOL bRet = FALSE;
+ sal_uInt8 nLower = nSrchNum, nUpper = nSrchNum;
+ sal_Bool bRet = sal_False;
const SwTxtNode* pLast;
if( bNext )
@@ -1769,11 +1795,11 @@ BOOL lcl_GotoNextPrevNum( SwPosition& rPos, BOOL bNext,
if( pRule )
{
if( ::lcl_IsNumOk( nSrchNum, nLower, nUpper, bOverUpper,
- static_cast<BYTE>(pNd->GetActualListLevel()) ))
+ static_cast<sal_uInt8>(pNd->GetActualListLevel()) ))
{
rPos.nNode = aIdx;
rPos.nContent.Assign( (SwTxtNode*)pNd, 0 );
- bRet = TRUE;
+ bRet = sal_True;
break;
}
else
@@ -1804,7 +1830,7 @@ BOOL lcl_GotoNextPrevNum( SwPosition& rPos, BOOL bNext,
rPos.nNode.Assign( *pLast );
rPos.nContent.Assign( (SwTxtNode*)pLast, 0 );
}
- bRet = TRUE;
+ bRet = sal_True;
}
if( bRet )
@@ -1817,10 +1843,10 @@ BOOL lcl_GotoNextPrevNum( SwPosition& rPos, BOOL bNext,
return bRet;
}
-BOOL SwDoc::GotoNextNum( SwPosition& rPos, BOOL bOverUpper,
- BYTE* pUpper, BYTE* pLower )
+sal_Bool SwDoc::GotoNextNum( SwPosition& rPos, sal_Bool bOverUpper,
+ sal_uInt8* pUpper, sal_uInt8* pLower )
{
- return ::lcl_GotoNextPrevNum( rPos, TRUE, bOverUpper, pUpper, pLower );
+ return ::lcl_GotoNextPrevNum( rPos, sal_True, bOverUpper, pUpper, pLower );
}
// -> #i23731#
@@ -1862,7 +1888,7 @@ const SwNumRule * SwDoc::SearchNumRule(const SwPosition & rPos,
const SwNumRule * pNumRule = pTxtNd->GetNumRule();
if (pNumRule)
{
- if ( ( pNumRule->IsOutlineRule() == ( bOutline ? TRUE : FALSE ) ) && // #115901#
+ if ( ( pNumRule->IsOutlineRule() == ( bOutline ? sal_True : sal_False ) ) && // #115901#
( ( bNum && pNumRule->Get(0).IsEnumeration()) ||
( !bNum && pNumRule->Get(0).IsItemize() ) ) ) // #i22362#, #i29560#
{
@@ -1898,8 +1924,8 @@ const SwNumRule * SwDoc::SearchNumRule(const SwPosition & rPos,
pNode = &aIdx.GetNode();
}
- while (! (pNode == aNodes.DocumentSectionStartNode(pStartFromNode) ||
- pNode == aNodes.DocumentSectionEndNode(pStartFromNode)));
+ while (!(pNode == GetNodes().DocumentSectionStartNode(pStartFromNode) ||
+ pNode == GetNodes().DocumentSectionEndNode(pStartFromNode)));
// <--
}
@@ -1907,25 +1933,25 @@ const SwNumRule * SwDoc::SearchNumRule(const SwPosition & rPos,
}
// <- #i23731#
-BOOL SwDoc::GotoPrevNum( SwPosition& rPos, BOOL bOverUpper,
- BYTE* pUpper, BYTE* pLower )
+sal_Bool SwDoc::GotoPrevNum( SwPosition& rPos, sal_Bool bOverUpper,
+ sal_uInt8* pUpper, sal_uInt8* pLower )
{
- return ::lcl_GotoNextPrevNum( rPos, FALSE, bOverUpper, pUpper, pLower );
+ return ::lcl_GotoNextPrevNum( rPos, sal_False, bOverUpper, pUpper, pLower );
}
-BOOL SwDoc::NumUpDown( const SwPaM& rPam, BOOL bDown )
+sal_Bool SwDoc::NumUpDown( const SwPaM& rPam, sal_Bool bDown )
{
- ULONG nStt = rPam.GetPoint()->nNode.GetIndex(),
+ sal_uLong nStt = rPam.GetPoint()->nNode.GetIndex(),
nEnd = rPam.GetMark()->nNode.GetIndex();
if( nStt > nEnd )
{
- ULONG nTmp = nStt; nStt = nEnd; nEnd = nTmp;
+ sal_uLong nTmp = nStt; nStt = nEnd; nEnd = nTmp;
}
// -> #115901# outline nodes are promoted or demoted differently
bool bOnlyOutline = true;
bool bOnlyNonOutline = true;
- for (ULONG n = nStt; n <= nEnd; n++)
+ for (sal_uLong n = nStt; n <= nEnd; n++)
{
SwTxtNode * pTxtNd = GetNodes()[n]->GetTxtNode();
@@ -1944,7 +1970,7 @@ BOOL SwDoc::NumUpDown( const SwPaM& rPam, BOOL bDown )
}
// <- #115901#
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
char nDiff = bDown ? 1 : -1;
// ->#115901#
@@ -1958,7 +1984,7 @@ BOOL SwDoc::NumUpDown( const SwPaM& rPam, BOOL bDown )
promotable resp. demotable.
*/
- for (ULONG nTmp = nStt; nTmp <= nEnd; ++nTmp)
+ for (sal_uLong nTmp = nStt; nTmp <= nEnd; ++nTmp)
{
SwTxtNode* pTNd = GetNodes()[ nTmp ]->GetTxtNode();
@@ -1970,10 +1996,10 @@ BOOL SwDoc::NumUpDown( const SwPaM& rPam, BOOL bDown )
if (pRule)
{
- BYTE nLevel = static_cast<BYTE>(pTNd->GetActualListLevel());
+ sal_uInt8 nLevel = static_cast<sal_uInt8>(pTNd->GetActualListLevel());
if( (-1 == nDiff && 0 >= nLevel) ||
(1 == nDiff && MAXLEVEL - 1 <= nLevel))
- bRet = FALSE;
+ bRet = sal_False;
}
}
// <--
@@ -1982,15 +2008,15 @@ BOOL SwDoc::NumUpDown( const SwPaM& rPam, BOOL bDown )
if( bRet )
{
/* <-- #i24560# */
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoNumUpDown( rPam, nDiff ) );
+ SwUndo *const pUndo( new SwUndoNumUpDown(rPam, nDiff) );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
String sNumRule;
- for(ULONG nTmp = nStt; nTmp <= nEnd; ++nTmp )
+ for(sal_uLong nTmp = nStt; nTmp <= nEnd; ++nTmp )
{
SwTxtNode* pTNd = GetNodes()[ nTmp ]->GetTxtNode();
@@ -2000,7 +2026,7 @@ BOOL SwDoc::NumUpDown( const SwPaM& rPam, BOOL bDown )
if (pRule)
{
- BYTE nLevel = static_cast<BYTE>(pTNd->GetActualListLevel());
+ sal_uInt8 nLevel = static_cast<sal_uInt8>(pTNd->GetActualListLevel());
nLevel = nLevel + nDiff;
pTNd->SetAttrListLevel(nLevel);
@@ -2016,12 +2042,12 @@ BOOL SwDoc::NumUpDown( const SwPaM& rPam, BOOL bDown )
return bRet;
}
-BOOL SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, BOOL bIsOutlMv )
+sal_Bool SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, sal_Bool bIsOutlMv )
{
const SwPosition *pStt = rPam.Start(), *pEnd = rPam.End();
- ULONG nStIdx = pStt->nNode.GetIndex();
- ULONG nEndIdx = pEnd->nNode.GetIndex();
+ sal_uLong nStIdx = pStt->nNode.GetIndex();
+ sal_uLong nEndIdx = pEnd->nNode.GetIndex();
// Here are some sophisticated checks whether the wished PaM will be moved or not.
// For moving outlines (bIsOutlMv) I've already done some checks, so here are two different
@@ -2041,24 +2067,24 @@ BOOL SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, BOOL bIsOutlMv )
{ // First is a start node
pTmp2 = pTmp1->EndOfSectionNode();
if( pTmp2->GetIndex() > nEndIdx )
- return FALSE; // Its end node is behind the moved range
+ return sal_False; // Its end node is behind the moved range
}
pTmp1 = pTmp1->StartOfSectionNode()->EndOfSectionNode();
if( pTmp1->GetIndex() <= nEndIdx )
- return FALSE; // End node inside but start node before moved range => no.
+ return sal_False; // End node inside but start node before moved range => no.
pTmp1 = GetNodes()[ nEndIdx ];
if( pTmp1->IsEndNode() )
{ // The last one is an end node
pTmp1 = pTmp1->StartOfSectionNode();
if( pTmp1->GetIndex() < nStIdx )
- return FALSE; // Its start node is before the moved range.
+ return sal_False; // Its start node is before the moved range.
}
pTmp1 = pTmp1->StartOfSectionNode();
if( pTmp1->GetIndex() >= nStIdx )
- return FALSE; // A start node which ends behind the moved area => no.
+ return sal_False; // A start node which ends behind the moved area => no.
}
- ULONG nInStIdx, nInEndIdx;
+ sal_uLong nInStIdx, nInEndIdx;
long nOffs = nOffset;
if( nOffset > 0 )
{
@@ -2069,8 +2095,8 @@ BOOL SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, BOOL bIsOutlMv )
else
{
//Impossible to move to negative index
- if( ULONG(abs( nOffset )) > nStIdx)
- return FALSE;
+ if( sal_uLong(abs( nOffset )) > nStIdx)
+ return sal_False;
nInEndIdx = nStIdx - 1;
nStIdx += nOffset;
@@ -2080,7 +2106,7 @@ BOOL SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, BOOL bIsOutlMv )
// [ nStIdx, nInEndIdx ] mit [ nInStIdx, nEndIdx ]
if( nEndIdx >= GetNodes().GetEndOfContent().GetIndex() )
- return FALSE;
+ return sal_False;
if( !bIsOutlMv )
{ // And here the restrictions for moving paragraphs other than chapters (outlines)
@@ -2091,7 +2117,7 @@ BOOL SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, BOOL bIsOutlMv )
pTmp1 = GetNodes()[ nStIdx ]->StartOfSectionNode();
pTmp2 = GetNodes()[ nInStIdx ]->StartOfSectionNode();
if( pTmp1 != pTmp2 )
- return FALSE; // "start" nodes in different sections
+ return sal_False; // "start" nodes in different sections
pTmp1 = GetNodes()[ nEndIdx ];
bool bIsEndNode = pTmp1->IsEndNode();
if( !pTmp1->IsStartNode() )
@@ -2111,21 +2137,21 @@ BOOL SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, BOOL bIsOutlMv )
}
pTmp2 = pTmp2->EndOfSectionNode();
if( pTmp1 != pTmp2 )
- return FALSE; // The "end" notes are in different sections
+ return sal_False; // The "end" notes are in different sections
}
// auf Redlining testen - darf die Selektion ueberhaupt verschoben
// werden?
if( !IsIgnoreRedline() )
{
- USHORT nRedlPos = GetRedlinePos( pStt->nNode.GetNode(), nsRedlineType_t::REDLINE_DELETE );
+ sal_uInt16 nRedlPos = GetRedlinePos( pStt->nNode.GetNode(), nsRedlineType_t::REDLINE_DELETE );
if( USHRT_MAX != nRedlPos )
{
SwPosition aStPos( *pStt ), aEndPos( *pEnd );
aStPos.nContent = 0;
SwCntntNode* pCNd = pEnd->nNode.GetNode().GetCntntNode();
aEndPos.nContent = pCNd ? pCNd->Len() : 1;
- BOOL bCheckDel = TRUE;
+ sal_Bool bCheckDel = sal_True;
// es existiert fuer den Bereich irgendein Redline-Delete-Object
for( ; nRedlPos < GetRedlineTbl().Count(); ++nRedlPos )
@@ -2147,14 +2173,14 @@ BOOL SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, BOOL bIsOutlMv )
case POS_INSIDE: // Pos1 liegt vollstaendig in Pos2
// ist erlaubt, aber checke dann alle nachfolgenden
// auf Ueberlappungen
- bCheckDel = FALSE;
+ bCheckDel = sal_False;
break;
case POS_OUTSIDE: // Pos2 liegt vollstaendig in Pos1
case POS_EQUAL: // Pos1 ist genauso gross wie Pos2
case POS_OVERLAP_BEFORE: // Pos1 ueberlappt Pos2 am Anfang
case POS_OVERLAP_BEHIND: // Pos1 ueberlappt Pos2 am Ende
- return FALSE;
+ return sal_False;
}
}
}
@@ -2176,7 +2202,7 @@ BOOL SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, BOOL bIsOutlMv )
{
// wenn der Bereich komplett im eigenen Redline liegt, kann es
// verschoben werden!
- USHORT nRedlPos = GetRedlinePos( pStt->nNode.GetNode(), nsRedlineType_t::REDLINE_INSERT );
+ sal_uInt16 nRedlPos = GetRedlinePos( pStt->nNode.GetNode(), nsRedlineType_t::REDLINE_INSERT );
if( USHRT_MAX != nRedlPos )
{
SwRedline* pTmp = GetRedlineTbl()[ nRedlPos ];
@@ -2212,7 +2238,7 @@ BOOL SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, BOOL bIsOutlMv )
if( !pOwnRedl )
{
- StartUndo( UNDO_START, NULL );
+ GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
// zuerst das Insert, dann das Loeschen
SwPosition aInsPos( aIdx );
@@ -2224,7 +2250,7 @@ BOOL SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, BOOL bIsOutlMv )
rOrigPam.DeleteMark();
rOrigPam.GetPoint()->nNode = aIdx.GetIndex() - 1;
- BOOL bDelLastPara = !aInsPos.nNode.GetNode().IsCntntNode();
+ sal_Bool bDelLastPara = !aInsPos.nNode.GetNode().IsCntntNode();
/* #101076# When copying to a non-content node Copy will
insert a paragraph before that node and insert before
@@ -2237,7 +2263,7 @@ BOOL SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, BOOL bIsOutlMv )
/* aInsPos points to the non-content node. Move it to
the previous content node. */
SwPaM aInsPam(aInsPos);
- BOOL bMoved = aInsPam.Move(fnMoveBackward);
+ sal_Bool bMoved = aInsPam.Move(fnMoveBackward);
ASSERT(bMoved, "No content node found!");
if (bMoved)
@@ -2263,21 +2289,21 @@ BOOL SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, BOOL bIsOutlMv )
// alle die im zu loeschenden Node stehen, mussen auf den
// naechsten umgestezt werden
SwPosition* pPos;
- for( USHORT n = 0; n < GetRedlineTbl().Count(); ++n )
+ for( sal_uInt16 n = 0; n < GetRedlineTbl().Count(); ++n )
{
SwRedline* pTmp = GetRedlineTbl()[ n ];
- if( ( pPos = &pTmp->GetBound(TRUE))->nNode == aIdx )
+ if( ( pPos = &pTmp->GetBound(sal_True))->nNode == aIdx )
{
pPos->nNode++;
pPos->nContent.Assign( pPos->nNode.GetNode().GetCntntNode(),0);
}
- if( ( pPos = &pTmp->GetBound(FALSE))->nNode == aIdx )
+ if( ( pPos = &pTmp->GetBound(sal_False))->nNode == aIdx )
{
pPos->nNode++;
pPos->nContent.Assign( pPos->nNode.GetNode().GetCntntNode(),0);
}
}
- CorrRel( aIdx, aInsPos, 0, FALSE );
+ CorrRel( aIdx, aInsPos, 0, sal_False );
pCNd->JoinNext();
}
@@ -2287,12 +2313,13 @@ BOOL SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, BOOL bIsOutlMv )
RedlineMode_t eOld = GetRedlineMode();
checkRedlining(eOld);
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
//JP 06.01.98: MUSS noch optimiert werden!!!
SetRedlineMode(
(RedlineMode_t)(nsRedlineMode_t::REDLINE_ON | nsRedlineMode_t::REDLINE_SHOW_INSERT | nsRedlineMode_t::REDLINE_SHOW_DELETE));
- AppendUndo( new SwUndoRedlineDelete( aPam, UNDO_DELETE ));
+ SwUndo *const pUndo(new SwUndoRedlineDelete(aPam, UNDO_DELETE));
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
SwRedline* pNewRedline = new SwRedline( nsRedlineType_t::REDLINE_DELETE, aPam );
@@ -2300,17 +2327,17 @@ BOOL SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, BOOL bIsOutlMv )
// #101654# prevent assertion from aPam's target being deleted
// (Alternatively, one could just let aPam go out of scope, but
// that requires touching a lot of code.)
- aPam.GetBound(TRUE).nContent.Assign( NULL, 0 );
- aPam.GetBound(FALSE).nContent.Assign( NULL, 0 );
+ aPam.GetBound(sal_True).nContent.Assign( NULL, 0 );
+ aPam.GetBound(sal_False).nContent.Assign( NULL, 0 );
AppendRedline( pNewRedline, true );
//JP 06.01.98: MUSS noch optimiert werden!!!
SetRedlineMode( eOld );
- EndUndo( UNDO_END, NULL );
+ GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
SetModified();
- return TRUE;
+ return sal_True;
}
}
@@ -2320,7 +2347,7 @@ SetRedlineMode( eOld );
SplitRedline(aTemp);
}
- ULONG nRedlSttNd(0), nRedlEndNd(0);
+ sal_uLong nRedlSttNd(0), nRedlEndNd(0);
if( pOwnRedl )
{
const SwPosition *pRStt = pOwnRedl->Start(), *pREnd = pOwnRedl->End();
@@ -2329,8 +2356,8 @@ SetRedlineMode( eOld );
}
SwUndoMoveNum* pUndo = 0;
- ULONG nMoved = 0;
- if( DoesUndo() )
+ sal_uLong nMoved = 0;
+ if (GetIDocumentUndoRedo().DoesUndo())
{
pUndo = new SwUndoMoveNum( rPam, nOffset, bIsOutlMv );
nMoved = rPam.End()->nNode.GetIndex() - rPam.Start()->nNode.GetIndex() + 1;
@@ -2341,13 +2368,12 @@ SetRedlineMode( eOld );
if( pUndo )
{
- ClearRedo();
// i57907: Under circumstances (sections at the end of a chapter)
// the rPam.Start() is not moved to the new position.
// But aIdx should be at the new end position and as long as the number of moved paragraphs
// is nMoved, I know, where the new position is.
pUndo->SetStartNode( aIdx.GetIndex() - nMoved );
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
if( pOwnRedl )
@@ -2368,12 +2394,12 @@ SetRedlineMode( eOld );
}
SetModified();
- return TRUE;
+ return sal_True;
}
-BOOL SwDoc::NumOrNoNum( const SwNodeIndex& rIdx, BOOL bDel )
+sal_Bool SwDoc::NumOrNoNum( const SwNodeIndex& rIdx, sal_Bool bDel )
{
- BOOL bResult = FALSE;
+ sal_Bool bResult = sal_False;
SwTxtNode * pTxtNd = rIdx.GetNode().GetTxtNode();
if (pTxtNd && pTxtNd->GetNumRule() != NULL &&
@@ -2381,23 +2407,23 @@ BOOL SwDoc::NumOrNoNum( const SwNodeIndex& rIdx, BOOL bDel )
{
if ( !pTxtNd->IsCountedInList() == !bDel)
{
- BOOL bOldNum = bDel; // == pTxtNd->IsCounted();
- BOOL bNewNum = bDel ? FALSE : TRUE;
+ sal_Bool bOldNum = bDel; // == pTxtNd->IsCounted();
+ sal_Bool bNewNum = bDel ? sal_False : sal_True;
pTxtNd->SetCountedInList(bNewNum ? true : false);
SetModified();
- bResult = TRUE;
+ bResult = sal_True;
- if (DoesUndo())
+ if (GetIDocumentUndoRedo().DoesUndo())
{
SwUndoNumOrNoNum * pUndo =
new SwUndoNumOrNoNum(rIdx, bOldNum, bNewNum);
- AppendUndo(pUndo);
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
}
- else if (bDel && pTxtNd->GetNumRule(FALSE) &&
+ else if (bDel && pTxtNd->GetNumRule(sal_False) &&
pTxtNd->GetActualListLevel() >= 0 &&
pTxtNd->GetActualListLevel() < MAXLEVEL)
{
@@ -2405,7 +2431,7 @@ BOOL SwDoc::NumOrNoNum( const SwNodeIndex& rIdx, BOOL bDel )
DelNumRules(aPam);
- bResult = TRUE;
+ bResult = sal_True;
}
}
@@ -2428,9 +2454,9 @@ SwNumRule* SwDoc::GetCurrNumRule( const SwPosition& rPos ) const
return pRet;
}
-USHORT SwDoc::FindNumRule( const String& rName ) const
+sal_uInt16 SwDoc::FindNumRule( const String& rName ) const
{
- for( USHORT n = pNumRuleTbl->Count(); n; )
+ for( sal_uInt16 n = pNumRuleTbl->Count(); n; )
if( (*pNumRuleTbl)[ --n ]->GetName() == rName )
return n;
@@ -2445,7 +2471,7 @@ SwNumRule* SwDoc::FindNumRulePtr( const String& rName ) const
if ( !pResult )
{
- for (USHORT n = 0; n < pNumRuleTbl->Count(); ++n)
+ for (sal_uInt16 n = 0; n < pNumRuleTbl->Count(); ++n)
{
if ((*pNumRuleTbl)[n]->GetName() == rName)
{
@@ -2472,9 +2498,9 @@ void SwDoc::AddNumRule(SwNumRule * pRule)
}
// --> OD 2008-02-11 #newlistlevelattrs#
-USHORT SwDoc::MakeNumRule( const String &rName,
+sal_uInt16 SwDoc::MakeNumRule( const String &rName,
const SwNumRule* pCpy,
- BOOL bBroadcast,
+ sal_Bool bBroadcast,
const SvxNumberFormat::SvxNumPositionAndSpaceMode eDefaultNumberFormatPositionAndSpaceMode )
{
SwNumRule* pNew;
@@ -2504,15 +2530,14 @@ USHORT SwDoc::MakeNumRule( const String &rName,
// <--
}
- USHORT nRet = pNumRuleTbl->Count();
+ sal_uInt16 nRet = pNumRuleTbl->Count();
AddNumRule(pNew); // #i36749#
- if (DoesUndo())
+ if (GetIDocumentUndoRedo().DoesUndo())
{
SwUndo * pUndo = new SwUndoNumruleCreate(pNew, this);
-
- AppendUndo(pUndo);
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
if (bBroadcast)
@@ -2522,7 +2547,7 @@ USHORT SwDoc::MakeNumRule( const String &rName,
return nRet;
}
-String SwDoc::GetUniqueNumRuleName( const String* pChkStr, BOOL bAutoNum ) const
+String SwDoc::GetUniqueNumRuleName( const String* pChkStr, sal_Bool bAutoNum ) const
{
String aName;
if( bAutoNum )
@@ -2541,8 +2566,8 @@ String SwDoc::GetUniqueNumRuleName( const String* pChkStr, BOOL bAutoNum ) const
aName = SW_RESSTR( STR_NUMRULE_DEFNAME );
}
- USHORT nNum(0), nTmp, nFlagSize = ( pNumRuleTbl->Count() / 8 ) +2;
- BYTE* pSetFlags = new BYTE[ nFlagSize ];
+ sal_uInt16 nNum(0), nTmp, nFlagSize = ( pNumRuleTbl->Count() / 8 ) +2;
+ sal_uInt8* pSetFlags = new sal_uInt8[ nFlagSize ];
memset( pSetFlags, 0, nFlagSize );
xub_StrLen nNmLen = aName.Len();
@@ -2560,7 +2585,7 @@ String SwDoc::GetUniqueNumRuleName( const String* pChkStr, BOOL bAutoNum ) const
}
const SwNumRule* pNumRule;
- USHORT n;
+ sal_uInt16 n;
for( n = 0; n < pNumRuleTbl->Count(); ++n )
if( 0 != ( pNumRule = (*pNumRuleTbl)[ n ] ) )
@@ -2569,7 +2594,7 @@ String SwDoc::GetUniqueNumRuleName( const String* pChkStr, BOOL bAutoNum ) const
if( rNm.Match( aName ) == nNmLen )
{
// Nummer bestimmen und das Flag setzen
- nNum = (USHORT)rNm.Copy( nNmLen ).ToInt32();
+ nNum = (sal_uInt16)rNm.Copy( nNmLen ).ToInt32();
if( nNum-- && nNum < pNumRuleTbl->Count() )
pSetFlags[ nNum / 8 ] |= (0x01 << ( nNum & 0x07 ));
}
@@ -2601,7 +2626,7 @@ String SwDoc::GetUniqueNumRuleName( const String* pChkStr, BOOL bAutoNum ) const
void SwDoc::UpdateNumRule()
{
const SwNumRuleTbl& rNmTbl = GetNumRuleTbl();
- for( USHORT n = 0; n < rNmTbl.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rNmTbl.Count(); ++n )
if( rNmTbl[ n ]->IsInvalidRule() )
rNmTbl[ n ]->Validate();
}
@@ -2609,7 +2634,7 @@ void SwDoc::UpdateNumRule()
// --> OD 2008-04-02 #refactorlists#
void SwDoc::MarkListLevel( const String& sListId,
const int nListLevel,
- const BOOL bValue )
+ const sal_Bool bValue )
{
SwList* pList = getListByName( sListId );
@@ -2621,7 +2646,7 @@ void SwDoc::MarkListLevel( const String& sListId,
void SwDoc::MarkListLevel( SwList& rList,
const int nListLevel,
- const BOOL bValue )
+ const sal_Bool bValue )
{
// Set new marked list level and notify all affected nodes of the changed mark.
rList.MarkListLevel( nListLevel, bValue );
@@ -2630,9 +2655,9 @@ void SwDoc::MarkListLevel( SwList& rList,
// <--
// #i23726#
-BOOL SwDoc::IsFirstOfNumRule(SwPosition & rPos)
+sal_Bool SwDoc::IsFirstOfNumRule(SwPosition & rPos)
{
- BOOL bResult = FALSE;
+ sal_Bool bResult = sal_False;
SwTxtNode * pTxtNode = rPos.nNode.GetNode().GetTxtNode();
if (pTxtNode)
@@ -2737,7 +2762,7 @@ sal_Int32 SwDoc::getOutlineNodesCount() const
int SwDoc::getOutlineLevel( const sal_Int32 nIdx ) const
{
- return GetNodes().GetOutLineNds()[ static_cast<USHORT>(nIdx) ]->
+ return GetNodes().GetOutLineNds()[ static_cast<sal_uInt16>(nIdx) ]->
// GetTxtNode()->GetOutlineLevel(); //#outline level,zhaojianwei
GetTxtNode()->GetAttrOutlineLevel()-1; //<-end,zhaojianwei
}
@@ -2746,14 +2771,14 @@ String SwDoc::getOutlineText( const sal_Int32 nIdx,
const bool bWithNumber,
const bool bWithSpacesForLevel ) const
{
- return GetNodes().GetOutLineNds()[ static_cast<USHORT>(nIdx) ]->
+ return GetNodes().GetOutLineNds()[ static_cast<sal_uInt16>(nIdx) ]->
GetTxtNode()->GetExpandTxt( 0, STRING_LEN, bWithNumber,
bWithNumber, bWithSpacesForLevel );
}
SwTxtNode* SwDoc::getOutlineNode( const sal_Int32 nIdx ) const
{
- return GetNodes().GetOutLineNds()[ static_cast<USHORT>(nIdx) ]->GetTxtNode();
+ return GetNodes().GetOutLineNds()[ static_cast<sal_uInt16>(nIdx) ]->GetTxtNode();
}
void SwDoc::getOutlineNodes( IDocumentOutlineNodes::tSortedOutlineNodeList& orOutlineNodeList ) const
@@ -2761,8 +2786,8 @@ void SwDoc::getOutlineNodes( IDocumentOutlineNodes::tSortedOutlineNodeList& orOu
orOutlineNodeList.clear();
orOutlineNodeList.reserve( getOutlineNodesCount() );
- const USHORT nOutlCount( static_cast<USHORT>(getOutlineNodesCount()) );
- for ( USHORT i = 0; i < nOutlCount; ++i )
+ const sal_uInt16 nOutlCount( static_cast<sal_uInt16>(getOutlineNodesCount()) );
+ for ( sal_uInt16 i = 0; i < nOutlCount; ++i )
{
orOutlineNodeList.push_back(
GetNodes().GetOutLineNds()[i]->GetTxtNode() );
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index b2540c3501c8..b46cf1e101c0 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -31,20 +31,21 @@
#include <hintids.hxx>
#include <tools/shl.hxx>
-#ifndef _SFX_ITEMITER_HXX //autogen
#include <svl/itemiter.hxx>
-#endif
#include <sfx2/app.hxx>
#include <editeng/colritem.hxx>
#include <editeng/udlnitem.hxx>
#include <editeng/crsditem.hxx>
#include <swmodule.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <docary.hxx>
#include <ndtxt.hxx>
#include <redline.hxx>
#include <swundo.hxx>
-#include <undobj.hxx>
+#include <UndoCore.hxx>
+#include <UndoRedline.hxx>
+#include <hints.hxx>
#include <pamtyp.hxx>
#include <poolfmt.hxx>
#include <viewsh.hxx>
@@ -106,10 +107,10 @@ TYPEINIT1(SwRedlineHint, SfxHint);
const SwRedlineTbl& rTbl = pDoc->GetRedlineTbl();
// verify valid redline positions
- for( USHORT i = 0; i < rTbl.Count(); ++i )
+ for( sal_uInt16 i = 0; i < rTbl.Count(); ++i )
lcl_CheckPam( rTbl[ i ] );
- for( USHORT j = 0; j < rTbl.Count(); ++j )
+ for( sal_uInt16 j = 0; j < rTbl.Count(); ++j )
{
// check for empty redlines
DBG_ASSERT( ( *(rTbl[j]->GetPoint()) != *(rTbl[j]->GetMark()) ) ||
@@ -118,7 +119,7 @@ TYPEINIT1(SwRedlineHint, SfxHint);
}
// verify proper redline sorting
- for( USHORT n = 1; n < rTbl.Count(); ++n )
+ for( sal_uInt16 n = 1; n < rTbl.Count(); ++n )
{
const SwRedline* pPrev = rTbl[ n-1 ];
const SwRedline* pCurrent = rTbl[ n ];
@@ -137,11 +138,11 @@ TYPEINIT1(SwRedlineHint, SfxHint);
void lcl_DebugRedline( const SwDoc* pDoc )
{
- static USHORT nWatch = 0;
+ static sal_uInt16 nWatch = 0;
const SwRedlineTbl& rTbl = pDoc->GetRedlineTbl();
- for( USHORT n = 0; n < rTbl.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rTbl.Count(); ++n )
{
- USHORT nDummy = 0;
+ sal_uInt16 nDummy = 0;
const SwRedline* pCurrent = rTbl[ n ];
const SwRedline* pNext = n+1 < rTbl.Count() ? rTbl[ n+1 ] : 0;
if( pCurrent == pNext )
@@ -172,7 +173,7 @@ void SwDoc::SetRedlineMode( RedlineMode_t eMode )
bool bSaveInXMLImportFlag = IsInXMLImport();
SetInXMLImport( false );
// und dann alles verstecken, anzeigen
- void (SwRedline::*pFnc)( USHORT ) = 0;
+ void (SwRedline::*pFnc)( sal_uInt16 ) = 0;
switch( nsRedlineMode_t::REDLINE_SHOW_MASK & eMode )
{
@@ -195,8 +196,8 @@ void SwDoc::SetRedlineMode( RedlineMode_t eMode )
_CHECK_REDLINE( this )
if( pFnc )
- for( USHORT nLoop = 1; nLoop <= 2; ++nLoop )
- for( USHORT i = 0; i < pRedlineTbl->Count(); ++i )
+ for( sal_uInt16 nLoop = 1; nLoop <= 2; ++nLoop )
+ for( sal_uInt16 i = 0; i < pRedlineTbl->Count(); ++i )
((*pRedlineTbl)[ i ]->*pFnc)( nLoop );
_CHECK_REDLINE( this )
SetInXMLImport( bSaveInXMLImportFlag );
@@ -371,10 +372,10 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
( pNewRedl->GetContentIdx() == NULL ) )
{ // Do not insert empty redlines
delete pNewRedl;
- return FALSE;
+ return sal_False;
}
- BOOL bCompress = FALSE;
- USHORT n = 0;
+ sal_Bool bCompress = sal_False;
+ sal_uInt16 n = 0;
// zur StartPos das erste Redline suchen
if( !GetRedline( *pStt, &n ) && n )
--n;
@@ -477,7 +478,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
if( bDelete )
{
delete pNewRedl, pNewRedl = 0;
- bCompress = TRUE;
+ bCompress = sal_True;
}
}
else if( POS_INSIDE == eCmpPos )
@@ -681,7 +682,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
case POS_INSIDE:
case POS_EQUAL:
delete pNewRedl, pNewRedl = 0;
- bCompress = TRUE;
+ bCompress = sal_True;
break;
case POS_OVERLAP_BEFORE:
@@ -734,7 +735,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
// delete current (below), and restart process with
// previous
- USHORT nToBeDeleted = n;
+ sal_uInt16 nToBeDeleted = n;
bDec = true;
// #107359# Do it again, Sam!
@@ -775,7 +776,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
switch( eCmpPos )
{
case POS_EQUAL:
- bCompress = TRUE;
+ bCompress = sal_True;
pRedlineTbl->DeleteAndDestroy( n );
bDec = true;
// kein break!
@@ -802,7 +803,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
else
DeleteAndJoin( *pNewRedl );
- bCompress = TRUE;
+ bCompress = sal_True;
}
delete pNewRedl, pNewRedl = 0;
break;
@@ -817,7 +818,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
{
pRedlineTbl->SavePtrInArr( pNewRedl );
DeleteAndJoin( *pRedl );
- USHORT nFnd = pRedlineTbl->GetPos(pNewRedl );
+ sal_uInt16 nFnd = pRedlineTbl->GetPos(pNewRedl );
if( USHRT_MAX != nFnd )
pRedlineTbl->Remove( nFnd );
else
@@ -847,7 +848,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
// behandelt wird, erstmal temp. einfuegen
pRedlineTbl->SavePtrInArr( pNewRedl );
DeleteAndJoin( aPam );
- USHORT nFnd = pRedlineTbl->GetPos(pNewRedl );
+ sal_uInt16 nFnd = pRedlineTbl->GetPos(pNewRedl );
if( USHRT_MAX != nFnd )
pRedlineTbl->Remove( nFnd );
else
@@ -876,7 +877,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
// behandelt wird, erstmal temp. einfuegen
pRedlineTbl->SavePtrInArr( pNewRedl );
DeleteAndJoin( aPam );
- USHORT nFnd = pRedlineTbl->GetPos(pNewRedl );
+ sal_uInt16 nFnd = pRedlineTbl->GetPos(pNewRedl );
if( USHRT_MAX != nFnd )
pRedlineTbl->Remove( nFnd );
else
@@ -908,7 +909,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
delete pNewRedl, pNewRedl = 0;
if( IsHideChanges( eRedlineMode ))
pRedl->Hide();
- bCompress = TRUE;
+ bCompress = sal_True;
}
break;
@@ -921,7 +922,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
if (*pStt != *pEnd)
// <--
{
- pNewRedl->PushData( *pRedl, FALSE );
+ pNewRedl->PushData( *pRedl, sal_False );
pRedl->SetStart( *pEnd, pRStt );
// re-insert
pRedlineTbl->Remove( n );
@@ -931,7 +932,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
}
else
{
- pNewRedl->PushData( *pRedl, FALSE );
+ pNewRedl->PushData( *pRedl, sal_False );
if( *pREnd != *pEnd )
{
pNew = new SwRedline( *pRedl );
@@ -959,7 +960,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
pNew->SetEnd( *pRStt );
pNewRedl->SetStart( *pREnd, pStt );
}
- bCompress = TRUE;
+ bCompress = sal_True;
}
break;
@@ -1286,7 +1287,7 @@ void SwDoc::CompressRedlines()
{
_CHECK_REDLINE( this )
- void (SwRedline::*pFnc)(USHORT) = 0;
+ void (SwRedline::*pFnc)(sal_uInt16) = 0;
switch( nsRedlineMode_t::REDLINE_SHOW_MASK & eRedlineMode )
{
case nsRedlineMode_t::REDLINE_SHOW_INSERT | nsRedlineMode_t::REDLINE_SHOW_DELETE:
@@ -1298,7 +1299,7 @@ void SwDoc::CompressRedlines()
}
// versuche gleiche zusammenzufassen
- for( USHORT n = 1; n < pRedlineTbl->Count(); ++n )
+ for( sal_uInt16 n = 1; n < pRedlineTbl->Count(); ++n )
{
SwRedline* pPrev = (*pRedlineTbl)[ n-1 ],
* pCur = (*pRedlineTbl)[ n ];
@@ -1329,8 +1330,8 @@ void SwDoc::CompressRedlines()
bool SwDoc::SplitRedline( const SwPaM& rRange )
{
- BOOL bChg = FALSE;
- USHORT n = 0;
+ sal_Bool bChg = sal_False;
+ sal_uInt16 n = 0;
const SwPosition* pStt = rRange.Start(),
* pEnd = pStt == rRange.GetPoint() ? rRange.GetMark()
: rRange.GetPoint();
@@ -1344,7 +1345,7 @@ bool SwDoc::SplitRedline( const SwPaM& rRange )
if( *pTStt <= *pStt && *pStt <= *pTEnd &&
*pTStt <= *pEnd && *pEnd <= *pTEnd )
{
- bChg = TRUE;
+ bChg = sal_True;
int nn = 0;
if( *pStt == *pTStt )
nn += 1;
@@ -1390,21 +1391,20 @@ bool SwDoc::SplitRedline( const SwPaM& rRange )
}
bool SwDoc::DeleteRedline( const SwPaM& rRange, bool bSaveInUndo,
- USHORT nDelType )
+ sal_uInt16 nDelType )
{
if( nsRedlineMode_t::REDLINE_IGNOREDELETE_REDLINES & eRedlineMode ||
!rRange.HasMark() || *rRange.GetMark() == *rRange.GetPoint() )
- return FALSE;
+ return sal_False;
- BOOL bChg = FALSE;
+ sal_Bool bChg = sal_False;
- if( bSaveInUndo && DoesUndo() )
+ if (bSaveInUndo && GetIDocumentUndoRedo().DoesUndo())
{
SwUndoRedline* pUndo = new SwUndoRedline( UNDO_REDLINE, rRange );
if( pUndo->GetRedlSaveCount() )
{
- ClearRedo();
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
else
delete pUndo;
@@ -1413,7 +1413,7 @@ bool SwDoc::DeleteRedline( const SwPaM& rRange, bool bSaveInUndo,
const SwPosition* pStt = rRange.Start(),
* pEnd = pStt == rRange.GetPoint() ? rRange.GetMark()
: rRange.GetPoint();
- USHORT n = 0;
+ sal_uInt16 n = 0;
GetRedline( *pStt, &n );
for( ; n < pRedlineTbl->Count() ; ++n )
{
@@ -1424,17 +1424,17 @@ bool SwDoc::DeleteRedline( const SwPaM& rRange, bool bSaveInUndo,
SwPosition* pRStt = pRedl->Start(),
* pREnd = pRStt == pRedl->GetPoint() ? pRedl->GetMark()
: pRedl->GetPoint();
- BOOL bDel = FALSE;
+ sal_Bool bDel = sal_False;
switch( ComparePosition( *pStt, *pEnd, *pRStt, *pREnd ) )
{
case POS_EQUAL:
case POS_OUTSIDE:
- bDel = TRUE;
+ bDel = sal_True;
break;
case POS_OVERLAP_BEFORE:
if( *pEnd == *pREnd )
- bDel = TRUE;
+ bDel = sal_True;
else
{
pRedl->InvalidateRange();
@@ -1448,7 +1448,7 @@ bool SwDoc::DeleteRedline( const SwPaM& rRange, bool bSaveInUndo,
case POS_OVERLAP_BEHIND:
if( *pStt == *pRStt )
- bDel = TRUE;
+ bDel = sal_True;
else
{
pRedl->InvalidateRange();
@@ -1511,7 +1511,7 @@ bool SwDoc::DeleteRedline( const SwPaM& rRange, bool bSaveInUndo,
{
pRedl->InvalidateRange();
pRedlineTbl->DeleteAndDestroy( n-- );
- bChg = TRUE;
+ bChg = sal_True;
}
}
@@ -1522,19 +1522,19 @@ bool SwDoc::DeleteRedline( const SwPaM& rRange, bool bSaveInUndo,
}
bool SwDoc::DeleteRedline( const SwStartNode& rNode, bool bSaveInUndo,
- USHORT nDelType )
+ sal_uInt16 nDelType )
{
SwPaM aTemp(*rNode.EndOfSectionNode(), rNode);
return DeleteRedline(aTemp, bSaveInUndo, nDelType);
}
-USHORT SwDoc::GetRedlinePos( const SwNode& rNd, USHORT nType ) const
+sal_uInt16 SwDoc::GetRedlinePos( const SwNode& rNd, sal_uInt16 nType ) const
{
- const ULONG nNdIdx = rNd.GetIndex();
- for( USHORT n = 0; n < pRedlineTbl->Count() ; ++n )
+ const sal_uLong nNdIdx = rNd.GetIndex();
+ for( sal_uInt16 n = 0; n < pRedlineTbl->Count() ; ++n )
{
const SwRedline* pTmp = (*pRedlineTbl)[ n ];
- ULONG nPt = pTmp->GetPoint()->nNode.GetIndex(),
+ sal_uLong nPt = pTmp->GetPoint()->nNode.GetIndex(),
nMk = pTmp->GetMark()->nNode.GetIndex();
if( nPt < nMk ) { long nTmp = nMk; nMk = nPt; nPt = nTmp; }
@@ -1549,9 +1549,9 @@ USHORT SwDoc::GetRedlinePos( const SwNode& rNd, USHORT nType ) const
}
const SwRedline* SwDoc::GetRedline( const SwPosition& rPos,
- USHORT* pFndPos ) const
+ sal_uInt16* pFndPos ) const
{
- USHORT nO = pRedlineTbl->Count(), nM, nU = 0;
+ sal_uInt16 nO = pRedlineTbl->Count(), nM, nU = 0;
if( nO > 0 )
{
nO--;
@@ -1596,17 +1596,17 @@ const SwRedline* SwDoc::GetRedline( const SwPosition& rPos,
return 0;
}
-typedef BOOL (*Fn_AcceptReject)( SwRedlineTbl& rArr, USHORT& rPos,
- BOOL bCallDelete,
+typedef sal_Bool (*Fn_AcceptReject)( SwRedlineTbl& rArr, sal_uInt16& rPos,
+ sal_Bool bCallDelete,
const SwPosition* pSttRng,
const SwPosition* pEndRng);
-BOOL lcl_AcceptRedline( SwRedlineTbl& rArr, USHORT& rPos,
- BOOL bCallDelete,
+sal_Bool lcl_AcceptRedline( SwRedlineTbl& rArr, sal_uInt16& rPos,
+ sal_Bool bCallDelete,
const SwPosition* pSttRng = 0,
const SwPosition* pEndRng = 0 )
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
SwRedline* pRedl = rArr[ rPos ];
SwPosition *pRStt = 0, *pREnd = 0;
SwComparePosition eCmp = POS_OUTSIDE;
@@ -1624,7 +1624,7 @@ BOOL lcl_AcceptRedline( SwRedlineTbl& rArr, USHORT& rPos,
case nsRedlineType_t::REDLINE_INSERT:
case nsRedlineType_t::REDLINE_FORMAT:
{
- BOOL bCheck = FALSE, bReplace = FALSE;
+ sal_Bool bCheck = sal_False, bReplace = sal_False;
switch( eCmp )
{
case POS_INSIDE:
@@ -1640,18 +1640,18 @@ BOOL lcl_AcceptRedline( SwRedlineTbl& rArr, USHORT& rPos,
rArr.Insert( pNew ); ++rPos;
}
pRedl->SetEnd( *pSttRng, pREnd );
- bCheck = TRUE;
+ bCheck = sal_True;
}
break;
case POS_OVERLAP_BEFORE:
pRedl->SetStart( *pEndRng, pRStt );
- bReplace = TRUE;
+ bReplace = sal_True;
break;
case POS_OVERLAP_BEHIND:
pRedl->SetEnd( *pSttRng, pREnd );
- bCheck = TRUE;
+ bCheck = sal_True;
break;
case POS_OUTSIDE:
@@ -1660,7 +1660,7 @@ BOOL lcl_AcceptRedline( SwRedlineTbl& rArr, USHORT& rPos,
break;
default:
- bRet = FALSE;
+ bRet = sal_False;
}
if( bReplace || ( bCheck && !pRedl->HasValidRange() ))
@@ -1675,7 +1675,7 @@ BOOL lcl_AcceptRedline( SwRedlineTbl& rArr, USHORT& rPos,
{
SwDoc& rDoc = *pRedl->GetDoc();
const SwPosition *pDelStt = 0, *pDelEnd = 0;
- BOOL bDelRedl = FALSE;
+ sal_Bool bDelRedl = sal_False;
switch( eCmp )
{
case POS_INSIDE:
@@ -1705,7 +1705,7 @@ BOOL lcl_AcceptRedline( SwRedlineTbl& rArr, USHORT& rPos,
case POS_EQUAL:
{
rArr.Remove( rPos-- );
- bDelRedl = TRUE;
+ bDelRedl = sal_True;
if( bCallDelete )
{
pDelStt = pRedl->Start();
@@ -1714,7 +1714,7 @@ BOOL lcl_AcceptRedline( SwRedlineTbl& rArr, USHORT& rPos,
}
break;
default:
- bRet = FALSE;
+ bRet = sal_False;
}
if( pDelStt && pDelEnd )
@@ -1737,8 +1737,8 @@ BOOL lcl_AcceptRedline( SwRedlineTbl& rArr, USHORT& rPos,
if( pCSttNd && !pCEndNd )
{
- aPam.GetBound( TRUE ).nContent.Assign( 0, 0 );
- aPam.GetBound( FALSE ).nContent.Assign( 0, 0 );
+ aPam.GetBound( sal_True ).nContent.Assign( 0, 0 );
+ aPam.GetBound( sal_False ).nContent.Assign( 0, 0 );
aPam.DeleteMark();
rDoc.DelFullPara( aPam );
}
@@ -1755,17 +1755,17 @@ BOOL lcl_AcceptRedline( SwRedlineTbl& rArr, USHORT& rPos,
break;
default:
- bRet = FALSE;
+ bRet = sal_False;
}
return bRet;
}
-BOOL lcl_RejectRedline( SwRedlineTbl& rArr, USHORT& rPos,
- BOOL bCallDelete,
+sal_Bool lcl_RejectRedline( SwRedlineTbl& rArr, sal_uInt16& rPos,
+ sal_Bool bCallDelete,
const SwPosition* pSttRng = 0,
const SwPosition* pEndRng = 0 )
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
SwRedline* pRedl = rArr[ rPos ];
SwPosition *pRStt = 0, *pREnd = 0;
SwComparePosition eCmp = POS_OUTSIDE;
@@ -1784,7 +1784,7 @@ BOOL lcl_RejectRedline( SwRedlineTbl& rArr, USHORT& rPos,
{
SwDoc& rDoc = *pRedl->GetDoc();
const SwPosition *pDelStt = 0, *pDelEnd = 0;
- BOOL bDelRedl = FALSE;
+ sal_Bool bDelRedl = sal_False;
switch( eCmp )
{
case POS_INSIDE:
@@ -1814,7 +1814,7 @@ BOOL lcl_RejectRedline( SwRedlineTbl& rArr, USHORT& rPos,
{
// dann den Bereich wieder loeschen
rArr.Remove( rPos-- );
- bDelRedl = TRUE;
+ bDelRedl = sal_True;
if( bCallDelete )
{
pDelStt = pRedl->Start();
@@ -1824,7 +1824,7 @@ BOOL lcl_RejectRedline( SwRedlineTbl& rArr, USHORT& rPos,
break;
default:
- bRet = FALSE;
+ bRet = sal_False;
}
if( pDelStt && pDelEnd )
{
@@ -1847,8 +1847,8 @@ BOOL lcl_RejectRedline( SwRedlineTbl& rArr, USHORT& rPos,
if( pCSttNd && !pCEndNd )
{
- aPam.GetBound( TRUE ).nContent.Assign( 0, 0 );
- aPam.GetBound( FALSE ).nContent.Assign( 0, 0 );
+ aPam.GetBound( sal_True ).nContent.Assign( 0, 0 );
+ aPam.GetBound( sal_False ).nContent.Assign( 0, 0 );
aPam.DeleteMark();
rDoc.DelFullPara( aPam );
}
@@ -1862,7 +1862,7 @@ BOOL lcl_RejectRedline( SwRedlineTbl& rArr, USHORT& rPos,
case nsRedlineType_t::REDLINE_DELETE:
{
SwRedline* pNew = 0;
- BOOL bCheck = FALSE, bReplace = FALSE;
+ sal_Bool bCheck = sal_False, bReplace = sal_False;
switch( eCmp )
{
@@ -1876,7 +1876,7 @@ BOOL lcl_RejectRedline( SwRedlineTbl& rArr, USHORT& rPos,
if( *pSttRng == *pRStt )
{
pRedl->SetStart( *pEndRng, pRStt );
- bReplace = TRUE;
+ bReplace = sal_True;
if( pNew )
pNew->SetEnd( *pEndRng );
}
@@ -1893,7 +1893,7 @@ BOOL lcl_RejectRedline( SwRedlineTbl& rArr, USHORT& rPos,
}
pRedl->SetEnd( *pSttRng, pREnd );
- bCheck = TRUE;
+ bCheck = sal_True;
if( pNew )
pNew->SetStart( *pSttRng );
}
@@ -1907,7 +1907,7 @@ BOOL lcl_RejectRedline( SwRedlineTbl& rArr, USHORT& rPos,
pNew->PopData();
}
pRedl->SetStart( *pEndRng, pRStt );
- bReplace = TRUE;
+ bReplace = sal_True;
if( pNew )
pNew->SetEnd( *pEndRng );
break;
@@ -1919,7 +1919,7 @@ BOOL lcl_RejectRedline( SwRedlineTbl& rArr, USHORT& rPos,
pNew->PopData();
}
pRedl->SetEnd( *pSttRng, pREnd );
- bCheck = TRUE;
+ bCheck = sal_True;
if( pNew )
pNew->SetStart( *pSttRng );
break;
@@ -1932,7 +1932,7 @@ BOOL lcl_RejectRedline( SwRedlineTbl& rArr, USHORT& rPos,
break;
default:
- bRet = FALSE;
+ bRet = sal_False;
}
if( pNew )
@@ -1959,15 +1959,15 @@ BOOL lcl_RejectRedline( SwRedlineTbl& rArr, USHORT& rPos,
break;
default:
- bRet = FALSE;
+ bRet = sal_False;
}
return bRet;
}
const SwRedline* lcl_FindCurrRedline( const SwPosition& rSttPos,
- USHORT& rPos,
- BOOL bNext = TRUE )
+ sal_uInt16& rPos,
+ sal_Bool bNext = sal_True )
{
const SwRedline* pFnd = 0;
const SwRedlineTbl& rArr = rSttPos.nNode.GetNode().GetDoc()->GetRedlineTbl();
@@ -1996,16 +1996,16 @@ const SwRedline* lcl_FindCurrRedline( const SwPosition& rSttPos,
// #111827#
int lcl_AcceptRejectRedl( Fn_AcceptReject fn_AcceptReject,
- SwRedlineTbl& rArr, BOOL bCallDelete,
+ SwRedlineTbl& rArr, sal_Bool bCallDelete,
const SwPaM& rPam)
{
- USHORT n = 0;
+ sal_uInt16 n = 0;
int nCount = 0; // #111827#
const SwPosition* pStt = rPam.Start(),
* pEnd = pStt == rPam.GetPoint() ? rPam.GetMark()
: rPam.GetPoint();
- const SwRedline* pFnd = lcl_FindCurrRedline( *pStt, n, TRUE );
+ const SwRedline* pFnd = lcl_FindCurrRedline( *pStt, n, sal_True );
if( pFnd && // neu ein Teil davon?
( *pFnd->Start() != *pStt || *pFnd->End() > *pEnd ))
{
@@ -2077,9 +2077,9 @@ void lcl_AdjustRedlineRange( SwPaM& rPam )
}
-bool SwDoc::AcceptRedline( USHORT nPos, bool bCallDelete )
+bool SwDoc::AcceptRedline( sal_uInt16 nPos, bool bCallDelete )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
// aufjedenfall auf sichtbar umschalten
if( (nsRedlineMode_t::REDLINE_SHOW_INSERT | nsRedlineMode_t::REDLINE_SHOW_DELETE) !=
@@ -2089,22 +2089,25 @@ bool SwDoc::AcceptRedline( USHORT nPos, bool bCallDelete )
SwRedline* pTmp = (*pRedlineTbl)[ nPos ];
if( pTmp->HasMark() && pTmp->IsVisible() )
{
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
// #111827#
SwRewriter aRewriter;
aRewriter.AddRule(UNDO_ARG1, pTmp->GetDescr());
- StartUndo( UNDO_ACCEPT_REDLINE, &aRewriter);
+ GetIDocumentUndoRedo().StartUndo(UNDO_ACCEPT_REDLINE, &aRewriter);
}
int nLoopCnt = 2;
- USHORT nSeqNo = pTmp->GetSeqNo();
+ sal_uInt16 nSeqNo = pTmp->GetSeqNo();
do {
- if( DoesUndo() )
- AppendUndo( new SwUndoAcceptRedline( *pTmp ));
+ if (GetIDocumentUndoRedo().DoesUndo())
+ {
+ SwUndo *const pUndo( new SwUndoAcceptRedline(*pTmp) );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
+ }
bRet |= lcl_AcceptRedline( *pRedlineTbl, nPos, bCallDelete );
@@ -2112,7 +2115,7 @@ bool SwDoc::AcceptRedline( USHORT nPos, bool bCallDelete )
{
if( USHRT_MAX == nPos )
nPos = 0;
- USHORT nFndPos = 2 == nLoopCnt
+ sal_uInt16 nFndPos = 2 == nLoopCnt
? pRedlineTbl->FindNextSeqNo( nSeqNo, nPos )
: pRedlineTbl->FindPrevSeqNo( nSeqNo, nPos );
if( USHRT_MAX != nFndPos || ( 0 != ( --nLoopCnt ) &&
@@ -2133,8 +2136,10 @@ bool SwDoc::AcceptRedline( USHORT nPos, bool bCallDelete )
SetModified();
}
- if( DoesUndo() )
- EndUndo( UNDO_ACCEPT_REDLINE, NULL );
+ if (GetIDocumentUndoRedo().DoesUndo())
+ {
+ GetIDocumentUndoRedo().EndUndo(UNDO_END, 0);
+ }
}
return bRet;
}
@@ -2152,10 +2157,10 @@ bool SwDoc::AcceptRedline( const SwPaM& rPam, bool bCallDelete )
SwPaM aPam( *rPam.GetMark(), *rPam.GetPoint() );
lcl_AdjustRedlineRange( aPam );
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- StartUndo( UNDO_ACCEPT_REDLINE, NULL );
- AppendUndo( new SwUndoAcceptRedline( aPam ));
+ GetIDocumentUndoRedo().StartUndo( UNDO_ACCEPT_REDLINE, NULL );
+ GetIDocumentUndoRedo().AppendUndo( new SwUndoAcceptRedline( aPam ));
}
// #111827#
@@ -2166,7 +2171,7 @@ bool SwDoc::AcceptRedline( const SwPaM& rPam, bool bCallDelete )
CompressRedlines();
SetModified();
}
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
// #111827#
String aTmpStr;
@@ -2180,14 +2185,14 @@ bool SwDoc::AcceptRedline( const SwPaM& rPam, bool bCallDelete )
SwRewriter aRewriter;
aRewriter.AddRule(UNDO_ARG1, aTmpStr);
- EndUndo( UNDO_ACCEPT_REDLINE, &aRewriter );
+ GetIDocumentUndoRedo().EndUndo( UNDO_ACCEPT_REDLINE, &aRewriter );
}
return nRet != 0;
}
-bool SwDoc::RejectRedline( USHORT nPos, bool bCallDelete )
+bool SwDoc::RejectRedline( sal_uInt16 nPos, bool bCallDelete )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
// aufjedenfall auf sichtbar umschalten
if( (nsRedlineMode_t::REDLINE_SHOW_INSERT | nsRedlineMode_t::REDLINE_SHOW_DELETE) !=
@@ -2197,22 +2202,25 @@ bool SwDoc::RejectRedline( USHORT nPos, bool bCallDelete )
SwRedline* pTmp = (*pRedlineTbl)[ nPos ];
if( pTmp->HasMark() && pTmp->IsVisible() )
{
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
// #111827#
SwRewriter aRewriter;
aRewriter.AddRule(UNDO_ARG1, pTmp->GetDescr());
- StartUndo( UNDO_REJECT_REDLINE, NULL );
+ GetIDocumentUndoRedo().StartUndo(UNDO_REJECT_REDLINE, &aRewriter);
}
int nLoopCnt = 2;
- USHORT nSeqNo = pTmp->GetSeqNo();
+ sal_uInt16 nSeqNo = pTmp->GetSeqNo();
do {
- if( DoesUndo() )
- AppendUndo( new SwUndoRejectRedline( *pTmp ));
+ if (GetIDocumentUndoRedo().DoesUndo())
+ {
+ SwUndo *const pUndo( new SwUndoRejectRedline( *pTmp ) );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
+ }
bRet |= lcl_RejectRedline( *pRedlineTbl, nPos, bCallDelete );
@@ -2220,7 +2228,7 @@ bool SwDoc::RejectRedline( USHORT nPos, bool bCallDelete )
{
if( USHRT_MAX == nPos )
nPos = 0;
- USHORT nFndPos = 2 == nLoopCnt
+ sal_uInt16 nFndPos = 2 == nLoopCnt
? pRedlineTbl->FindNextSeqNo( nSeqNo, nPos )
: pRedlineTbl->FindPrevSeqNo( nSeqNo, nPos );
if( USHRT_MAX != nFndPos || ( 0 != ( --nLoopCnt ) &&
@@ -2241,8 +2249,10 @@ bool SwDoc::RejectRedline( USHORT nPos, bool bCallDelete )
SetModified();
}
- if( DoesUndo() )
- EndUndo( UNDO_REJECT_REDLINE, NULL );
+ if (GetIDocumentUndoRedo().DoesUndo())
+ {
+ GetIDocumentUndoRedo().EndUndo(UNDO_END, 0);
+ }
}
return bRet;
}
@@ -2260,10 +2270,10 @@ bool SwDoc::RejectRedline( const SwPaM& rPam, bool bCallDelete )
SwPaM aPam( *rPam.GetMark(), *rPam.GetPoint() );
lcl_AdjustRedlineRange( aPam );
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- StartUndo( UNDO_REJECT_REDLINE, NULL );
- AppendUndo( new SwUndoRejectRedline( aPam ));
+ GetIDocumentUndoRedo().StartUndo( UNDO_REJECT_REDLINE, NULL );
+ GetIDocumentUndoRedo().AppendUndo( new SwUndoRejectRedline(aPam) );
}
// #111827#
@@ -2274,7 +2284,7 @@ bool SwDoc::RejectRedline( const SwPaM& rPam, bool bCallDelete )
CompressRedlines();
SetModified();
}
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
// #111827#
String aTmpStr;
@@ -2288,7 +2298,7 @@ bool SwDoc::RejectRedline( const SwPaM& rPam, bool bCallDelete )
SwRewriter aRewriter;
aRewriter.AddRule(UNDO_ARG1, aTmpStr);
- EndUndo( UNDO_REJECT_REDLINE, &aRewriter );
+ GetIDocumentUndoRedo().EndUndo( UNDO_REJECT_REDLINE, &aRewriter );
}
return nRet != 0;
@@ -2301,12 +2311,12 @@ const SwRedline* SwDoc::SelNextRedline( SwPaM& rPam ) const
SwPosition& rSttPos = *rPam.GetPoint();
SwPosition aSavePos( rSttPos );
- BOOL bRestart;
+ sal_Bool bRestart;
// sollte die StartPos auf dem letzen gueligen ContentNode stehen,
// dann aufjedenfall das naechste Redline nehmen
- USHORT n = 0;
- const SwRedline* pFnd = lcl_FindCurrRedline( rSttPos, n, TRUE );
+ sal_uInt16 n = 0;
+ const SwRedline* pFnd = lcl_FindCurrRedline( rSttPos, n, sal_True );
if( pFnd )
{
const SwPosition* pEnd = pFnd->End();
@@ -2323,7 +2333,7 @@ const SwRedline* SwDoc::SelNextRedline( SwPaM& rPam ) const
}
do {
- bRestart = FALSE;
+ bRestart = sal_False;
for( ; !pFnd && n < pRedlineTbl->Count(); ++n )
{
@@ -2395,7 +2405,7 @@ const SwRedline* SwDoc::SelNextRedline( SwPaM& rPam ) const
{
if( n < pRedlineTbl->Count() )
{
- bRestart = TRUE;
+ bRestart = sal_True;
*rPam.GetPoint() = *pSaveFnd->End();
}
else
@@ -2418,12 +2428,12 @@ const SwRedline* SwDoc::SelPrevRedline( SwPaM& rPam ) const
SwPosition& rSttPos = *rPam.GetPoint();
SwPosition aSavePos( rSttPos );
- BOOL bRestart;
+ sal_Bool bRestart;
// sollte die StartPos auf dem ersten gueligen ContentNode stehen,
// dann aufjedenfall das vorherige Redline nehmen
- USHORT n = 0;
- const SwRedline* pFnd = lcl_FindCurrRedline( rSttPos, n, FALSE );
+ sal_uInt16 n = 0;
+ const SwRedline* pFnd = lcl_FindCurrRedline( rSttPos, n, sal_False );
if( pFnd )
{
const SwPosition* pStt = pFnd->Start();
@@ -2440,7 +2450,7 @@ const SwRedline* SwDoc::SelPrevRedline( SwPaM& rPam ) const
}
do {
- bRestart = FALSE;
+ bRestart = sal_False;
while( !pFnd && 0 < n )
{
@@ -2514,7 +2524,7 @@ const SwRedline* SwDoc::SelPrevRedline( SwPaM& rPam ) const
{
if( n )
{
- bRestart = TRUE;
+ bRestart = sal_True;
*rPam.GetPoint() = *pSaveFnd->Start();
}
else
@@ -2533,16 +2543,16 @@ const SwRedline* SwDoc::SelPrevRedline( SwPaM& rPam ) const
// Kommentar am Redline setzen
bool SwDoc::SetRedlineComment( const SwPaM& rPaM, const String& rS )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
const SwPosition* pStt = rPaM.Start(),
* pEnd = pStt == rPaM.GetPoint() ? rPaM.GetMark()
: rPaM.GetPoint();
- USHORT n = 0;
- if( lcl_FindCurrRedline( *pStt, n, TRUE ) )
+ sal_uInt16 n = 0;
+ if( lcl_FindCurrRedline( *pStt, n, sal_True ) )
{
for( ; n < pRedlineTbl->Count(); ++n )
{
- bRet = TRUE;
+ bRet = sal_True;
SwRedline* pTmp = (*pRedlineTbl)[ n ];
if( pStt != pEnd && *pTmp->Start() > *pEnd )
break;
@@ -2559,13 +2569,13 @@ bool SwDoc::SetRedlineComment( const SwPaM& rPaM, const String& rS )
}
// legt gebenenfalls einen neuen Author an
-USHORT SwDoc::GetRedlineAuthor()
+sal_uInt16 SwDoc::GetRedlineAuthor()
{
return SW_MOD()->GetRedlineAuthor();
}
// fuer die Reader usw. - neuen Author in die Tabelle eintragen
-USHORT SwDoc::InsertRedlineAuthor( const String& rNew )
+sal_uInt16 SwDoc::InsertRedlineAuthor( const String& rNew )
{
return SW_MOD()->InsertRedlineAuthor(rNew);
}
@@ -2573,7 +2583,7 @@ USHORT SwDoc::InsertRedlineAuthor( const String& rNew )
void SwDoc::UpdateRedlineAttr()
{
const SwRedlineTbl& rTbl = GetRedlineTbl();
- for( USHORT n = 0; n < rTbl.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rTbl.Count(); ++n )
{
SwRedline* pRedl = rTbl[ n ];
if( pRedl->IsVisible() )
@@ -2584,7 +2594,7 @@ void SwDoc::UpdateRedlineAttr()
// setze Kommentar-Text fuers Redline, das dann per AppendRedline
// hereinkommt. Wird vom Autoformat benutzt. 0-Pointer setzt den Modus
// wieder zurueck. Pointer wird nicht kopiert, muss also gueltig bleiben!
-void SwDoc::SetAutoFmtRedlineComment( const String* pTxt, USHORT nSeqNo )
+void SwDoc::SetAutoFmtRedlineComment( const String* pTxt, sal_uInt16 nSeqNo )
{
mbIsAutoFmtRedline = 0 != pTxt;
if( pTxt )
@@ -2609,9 +2619,9 @@ void SwDoc::SetRedlinePassword(
/* */
-BOOL SwRedlineTbl::Insert( SwRedlinePtr& p, BOOL bIns )
+sal_Bool SwRedlineTbl::Insert( SwRedlinePtr& p, sal_Bool bIns )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( p->HasValidRange() )
{
bRet = _SwRedlineTbl::Insert( p );
@@ -2626,9 +2636,9 @@ BOOL SwRedlineTbl::Insert( SwRedlinePtr& p, BOOL bIns )
return bRet;
}
-BOOL SwRedlineTbl::Insert( SwRedlinePtr& p, USHORT& rP, BOOL bIns )
+sal_Bool SwRedlineTbl::Insert( SwRedlinePtr& p, sal_uInt16& rP, sal_Bool bIns )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( p->HasValidRange() )
{
bRet = _SwRedlineTbl::Insert( p, rP );
@@ -2643,10 +2653,10 @@ BOOL SwRedlineTbl::Insert( SwRedlinePtr& p, USHORT& rP, BOOL bIns )
return bRet;
}
-BOOL SwRedlineTbl::InsertWithValidRanges( SwRedlinePtr& p, USHORT* pInsPos )
+sal_Bool SwRedlineTbl::InsertWithValidRanges( SwRedlinePtr& p, sal_uInt16* pInsPos )
{
// erzeuge aus den Selektion gueltige "Teilbereiche".
- BOOL bAnyIns = FALSE;
+ sal_Bool bAnyIns = sal_False;
SwPosition* pStt = p->Start(),
* pEnd = pStt == p->GetPoint() ? p->GetMark() : p->GetPoint();
SwPosition aNewStt( *pStt );
@@ -2663,7 +2673,7 @@ BOOL SwRedlineTbl::InsertWithValidRanges( SwRedlinePtr& p, USHORT* pInsPos )
}
SwRedline* pNew = 0;
- USHORT nInsPos;
+ sal_uInt16 nInsPos;
if( aNewStt < *pEnd )
do {
@@ -2688,7 +2698,7 @@ BOOL SwRedlineTbl::InsertWithValidRanges( SwRedlinePtr& p, USHORT* pInsPos )
{
// We want to be before the table
*pNew->GetPoint() = SwPosition(*pTab);
- pC = GoPreviousNds( &pNew->GetPoint()->nNode, FALSE ); // here we are.
+ pC = GoPreviousNds( &pNew->GetPoint()->nNode, sal_False ); // here we are.
if( pC )
pNew->GetPoint()->nContent.Assign( pC, 0 );
pTab = pNew->GetPoint()->nNode.GetNode().StartOfSectionNode()->FindTableNode();
@@ -2733,7 +2743,7 @@ BOOL SwRedlineTbl::InsertWithValidRanges( SwRedlinePtr& p, USHORT* pInsPos )
_SwRedlineTbl::Insert( pNew, nInsPos ) )
{
pNew->CallDisplayFunc();
- bAnyIns = TRUE;
+ bAnyIns = sal_True;
pNew = 0;
if( pInsPos && *pInsPos < nInsPos )
*pInsPos = nInsPos;
@@ -2752,7 +2762,7 @@ BOOL SwRedlineTbl::InsertWithValidRanges( SwRedlinePtr& p, USHORT* pInsPos )
return bAnyIns;
}
-void SwRedlineTbl::Remove( USHORT nP, USHORT nL )
+void SwRedlineTbl::Remove( sal_uInt16 nP, sal_uInt16 nL )
{
SwDoc* pDoc = 0;
if( !nP && nL && nL == _SwRedlineTbl::Count() )
@@ -2766,7 +2776,7 @@ void SwRedlineTbl::Remove( USHORT nP, USHORT nL )
pSh->InvalidateWindows( SwRect( 0, 0, LONG_MAX, LONG_MAX ) );
}
-void SwRedlineTbl::DeleteAndDestroy( USHORT nP, USHORT nL )
+void SwRedlineTbl::DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL )
{
SwDoc* pDoc = 0;
if( !nP && nL && nL == _SwRedlineTbl::Count() )
@@ -2783,7 +2793,7 @@ void SwRedlineTbl::DeleteAndDestroy( USHORT nP, USHORT nL )
// suche den naechsten oder vorherigen Redline mit dergleichen Seq.No
// Mit dem Lookahead kann die Suche eingeschraenkt werden. 0 oder
// USHRT_MAX suchen im gesamten Array.
-USHORT SwRedlineTbl::FindNextOfSeqNo( USHORT nSttPos, USHORT nLookahead ) const
+sal_uInt16 SwRedlineTbl::FindNextOfSeqNo( sal_uInt16 nSttPos, sal_uInt16 nLookahead ) const
{
return nSttPos + 1 < _SwRedlineTbl::Count()
? FindNextSeqNo( _SwRedlineTbl::GetObject( nSttPos )
@@ -2791,7 +2801,7 @@ USHORT SwRedlineTbl::FindNextOfSeqNo( USHORT nSttPos, USHORT nLookahead ) const
: USHRT_MAX;
}
-USHORT SwRedlineTbl::FindPrevOfSeqNo( USHORT nSttPos, USHORT nLookahead ) const
+sal_uInt16 SwRedlineTbl::FindPrevOfSeqNo( sal_uInt16 nSttPos, sal_uInt16 nLookahead ) const
{
return nSttPos ? FindPrevSeqNo( _SwRedlineTbl::GetObject(
nSttPos )->GetSeqNo(),
@@ -2799,10 +2809,10 @@ USHORT SwRedlineTbl::FindPrevOfSeqNo( USHORT nSttPos, USHORT nLookahead ) const
: USHRT_MAX;
}
-USHORT SwRedlineTbl::FindNextSeqNo( USHORT nSeqNo, USHORT nSttPos,
- USHORT nLookahead ) const
+sal_uInt16 SwRedlineTbl::FindNextSeqNo( sal_uInt16 nSeqNo, sal_uInt16 nSttPos,
+ sal_uInt16 nLookahead ) const
{
- USHORT nRet = USHRT_MAX, nEnd;
+ sal_uInt16 nRet = USHRT_MAX, nEnd;
if( nSeqNo && nSttPos < _SwRedlineTbl::Count() )
{
nEnd = _SwRedlineTbl::Count();
@@ -2820,10 +2830,10 @@ USHORT SwRedlineTbl::FindNextSeqNo( USHORT nSeqNo, USHORT nSttPos,
return nRet;
}
-USHORT SwRedlineTbl::FindPrevSeqNo( USHORT nSeqNo, USHORT nSttPos,
- USHORT nLookahead ) const
+sal_uInt16 SwRedlineTbl::FindPrevSeqNo( sal_uInt16 nSeqNo, sal_uInt16 nSttPos,
+ sal_uInt16 nLookahead ) const
{
- USHORT nRet = USHRT_MAX, nEnd;
+ sal_uInt16 nRet = USHRT_MAX, nEnd;
if( nSeqNo && nSttPos < _SwRedlineTbl::Count() )
{
nEnd = 0;
@@ -2857,12 +2867,12 @@ void SwRedlineExtraData::Reject( SwPaM& ) const
int SwRedlineExtraData::operator == ( const SwRedlineExtraData& ) const
{
- return FALSE;
+ return sal_False;
}
SwRedlineExtraData_FmtColl::SwRedlineExtraData_FmtColl( const String& rColl,
- USHORT nPoolFmtId,
+ sal_uInt16 nPoolFmtId,
const SfxItemSet* pItemSet )
: sFmtNm(rColl), pSet(0), nPoolId(nPoolFmtId)
{
@@ -2940,7 +2950,7 @@ SwRedlineExtraData_Format::SwRedlineExtraData_Format( const SfxItemSet& rSet )
{
SfxItemIter aIter( rSet );
const SfxPoolItem* pItem = aIter.FirstItem();
- while( TRUE )
+ while( sal_True )
{
aWhichIds.Insert( pItem->Which(), aWhichIds.Count() );
if( aIter.IsAtEnd() )
@@ -2951,7 +2961,7 @@ SwRedlineExtraData_Format::SwRedlineExtraData_Format( const SfxItemSet& rSet )
SwRedlineExtraData_Format::SwRedlineExtraData_Format(
const SwRedlineExtraData_Format& rCpy )
- : SwRedlineExtraData(), aWhichIds( (BYTE)rCpy.aWhichIds.Count() )
+ : SwRedlineExtraData(), aWhichIds( (sal_uInt8)rCpy.aWhichIds.Count() )
{
aWhichIds.Insert( &rCpy.aWhichIds, 0 );
}
@@ -2973,7 +2983,7 @@ void SwRedlineExtraData_Format::Reject( SwPaM& rPam ) const
pDoc->SetRedlineMode_intern((RedlineMode_t)(eOld & ~(nsRedlineMode_t::REDLINE_ON | nsRedlineMode_t::REDLINE_IGNORE)));
// eigentlich muesste hier das Attribut zurueck gesetzt werden!!!
- for( USHORT n = 0, nEnd = aWhichIds.Count(); n < nEnd; ++n )
+ for( sal_uInt16 n = 0, nEnd = aWhichIds.Count(); n < nEnd; ++n )
{
pDoc->InsertPoolItem( rPam, *GetDfltAttr( aWhichIds[ n ] ),
nsSetAttrMode::SETATTR_DONTEXPAND );
@@ -2985,7 +2995,7 @@ void SwRedlineExtraData_Format::Reject( SwPaM& rPam ) const
int SwRedlineExtraData_Format::operator == ( const SwRedlineExtraData& rCmp ) const
{
int nRet = 1;
- USHORT n = 0, nEnd = aWhichIds.Count();
+ sal_uInt16 n = 0, nEnd = aWhichIds.Count();
if( nEnd != ((SwRedlineExtraData_Format&)rCmp).aWhichIds.Count() )
nRet = 0;
else
@@ -3000,14 +3010,14 @@ int SwRedlineExtraData_Format::operator == ( const SwRedlineExtraData& rCmp ) co
/* */
-SwRedlineData::SwRedlineData( RedlineType_t eT, USHORT nAut )
+SwRedlineData::SwRedlineData( RedlineType_t eT, sal_uInt16 nAut )
: pNext( 0 ), pExtraData( 0 ), eType( eT ), nAuthor( nAut ), nSeqNo( 0 )
{
aStamp.SetSec( 0 );
aStamp.Set100Sec( 0 );
}
-SwRedlineData::SwRedlineData( const SwRedlineData& rCpy, BOOL bCpyNext )
+SwRedlineData::SwRedlineData( const SwRedlineData& rCpy, sal_Bool bCpyNext )
:
pNext( (bCpyNext && rCpy.pNext) ? new SwRedlineData( *rCpy.pNext ) : 0 ),
pExtraData( rCpy.pExtraData ? rCpy.pExtraData->CreateNew() : 0 ),
@@ -3017,7 +3027,7 @@ SwRedlineData::SwRedlineData( const SwRedlineData& rCpy, BOOL bCpyNext )
}
// fuer sw3io: pNext geht in eigenen Besitz ueber!
-SwRedlineData::SwRedlineData(RedlineType_t eT, USHORT nAut, const DateTime& rDT,
+SwRedlineData::SwRedlineData(RedlineType_t eT, sal_uInt16 nAut, const DateTime& rDT,
const String& rCmnt, SwRedlineData *pNxt, SwRedlineExtraData* pData)
: pNext(pNxt), pExtraData(pData), sComment(rCmnt), aStamp(rDT),
eType(eT), nAuthor(nAut), nSeqNo(0)
@@ -3059,8 +3069,8 @@ SwRedline::SwRedline(RedlineType_t eTyp, const SwPaM& rPam )
pRedlineData( new SwRedlineData( eTyp, GetDoc()->GetRedlineAuthor() ) ),
pCntntSect( 0 )
{
- bDelLastPara = bIsLastParaDelete = FALSE;
- bIsVisible = TRUE;
+ bDelLastPara = bIsLastParaDelete = sal_False;
+ bIsVisible = sal_True;
if( !rPam.HasMark() )
DeleteMark();
}
@@ -3070,8 +3080,8 @@ SwRedline::SwRedline( const SwRedlineData& rData, const SwPaM& rPam )
pRedlineData( new SwRedlineData( rData )),
pCntntSect( 0 )
{
- bDelLastPara = bIsLastParaDelete = FALSE;
- bIsVisible = TRUE;
+ bDelLastPara = bIsLastParaDelete = sal_False;
+ bIsVisible = sal_True;
if( !rPam.HasMark() )
DeleteMark();
}
@@ -3081,8 +3091,8 @@ SwRedline::SwRedline( const SwRedlineData& rData, const SwPosition& rPos )
pRedlineData( new SwRedlineData( rData )),
pCntntSect( 0 )
{
- bDelLastPara = bIsLastParaDelete = FALSE;
- bIsVisible = TRUE;
+ bDelLastPara = bIsLastParaDelete = sal_False;
+ bIsVisible = sal_True;
}
SwRedline::SwRedline( const SwRedline& rCpy )
@@ -3090,8 +3100,8 @@ SwRedline::SwRedline( const SwRedline& rCpy )
pRedlineData( new SwRedlineData( *rCpy.pRedlineData )),
pCntntSect( 0 )
{
- bDelLastPara = bIsLastParaDelete = FALSE;
- bIsVisible = TRUE;
+ bDelLastPara = bIsLastParaDelete = sal_False;
+ bIsVisible = sal_True;
if( !rCpy.HasMark() )
DeleteMark();
}
@@ -3109,7 +3119,7 @@ SwRedline::~SwRedline()
}
// liegt eine gueltige Selektion vor?
-BOOL SwRedline::HasValidRange() const
+sal_Bool SwRedline::HasValidRange() const
{
const SwNode* pPtNd = &GetPoint()->nNode.GetNode(),
* pMkNd = &GetMark()->nNode.GetNode();
@@ -3121,11 +3131,11 @@ BOOL SwRedline::HasValidRange() const
( pPtNd != pMkNd || GetContentIdx() != NULL ||
pPtNd != &pPtNd->GetNodes().GetEndOfContent() )
)
- return TRUE;
- return FALSE;
+ return sal_True;
+ return sal_False;
}
-void SwRedline::CallDisplayFunc( USHORT nLoop )
+void SwRedline::CallDisplayFunc( sal_uInt16 nLoop )
{
switch( nsRedlineMode_t::REDLINE_SHOW_MASK & GetDoc()->GetRedlineMode() )
{
@@ -3141,25 +3151,24 @@ void SwRedline::CallDisplayFunc( USHORT nLoop )
}
}
-void SwRedline::Show( USHORT nLoop )
+void SwRedline::Show( sal_uInt16 nLoop )
{
if( 1 <= nLoop )
{
SwDoc* pDoc = GetDoc();
RedlineMode_t eOld = pDoc->GetRedlineMode();
pDoc->SetRedlineMode_intern((RedlineMode_t)(eOld | nsRedlineMode_t::REDLINE_IGNORE));
- BOOL bUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
switch( GetType() )
{
case nsRedlineType_t::REDLINE_INSERT: // Inhalt wurde eingefuegt
- bIsVisible = TRUE;
+ bIsVisible = sal_True;
MoveFromSection();
break;
case nsRedlineType_t::REDLINE_DELETE: // Inhalt wurde geloescht
- bIsVisible = TRUE;
+ bIsVisible = sal_True;
MoveFromSection();
break;
@@ -3171,28 +3180,26 @@ void SwRedline::Show( USHORT nLoop )
break;
}
pDoc->SetRedlineMode_intern( eOld );
- pDoc->DoUndo( bUndo );
}
}
-void SwRedline::Hide( USHORT nLoop )
+void SwRedline::Hide( sal_uInt16 nLoop )
{
SwDoc* pDoc = GetDoc();
RedlineMode_t eOld = pDoc->GetRedlineMode();
pDoc->SetRedlineMode_intern((RedlineMode_t)(eOld | nsRedlineMode_t::REDLINE_IGNORE));
- BOOL bUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
switch( GetType() )
{
case nsRedlineType_t::REDLINE_INSERT: // Inhalt wurde eingefuegt
- bIsVisible = TRUE;
+ bIsVisible = sal_True;
if( 1 <= nLoop )
MoveFromSection();
break;
case nsRedlineType_t::REDLINE_DELETE: // Inhalt wurde geloescht
- bIsVisible = FALSE;
+ bIsVisible = sal_False;
switch( nLoop )
{
case 0: MoveToSection(); break;
@@ -3210,18 +3217,16 @@ void SwRedline::Hide( USHORT nLoop )
break;
}
pDoc->SetRedlineMode_intern( eOld );
- pDoc->DoUndo( bUndo );
}
-void SwRedline::ShowOriginal( USHORT nLoop )
+void SwRedline::ShowOriginal( sal_uInt16 nLoop )
{
SwDoc* pDoc = GetDoc();
RedlineMode_t eOld = pDoc->GetRedlineMode();
SwRedlineData* pCur;
pDoc->SetRedlineMode_intern((RedlineMode_t)(eOld | nsRedlineMode_t::REDLINE_IGNORE));
- BOOL bUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
// bestimme den Type, ist der erste auf Stack
for( pCur = pRedlineData; pCur->pNext; )
@@ -3230,7 +3235,7 @@ void SwRedline::ShowOriginal( USHORT nLoop )
switch( pCur->eType )
{
case nsRedlineType_t::REDLINE_INSERT: // Inhalt wurde eingefuegt
- bIsVisible = FALSE;
+ bIsVisible = sal_False;
switch( nLoop )
{
case 0: MoveToSection(); break;
@@ -3240,7 +3245,7 @@ void SwRedline::ShowOriginal( USHORT nLoop )
break;
case nsRedlineType_t::REDLINE_DELETE: // Inhalt wurde geloescht
- bIsVisible = TRUE;
+ bIsVisible = sal_True;
if( 1 <= nLoop )
MoveFromSection();
break;
@@ -3254,27 +3259,26 @@ void SwRedline::ShowOriginal( USHORT nLoop )
break;
}
pDoc->SetRedlineMode_intern( eOld );
- pDoc->DoUndo( bUndo );
}
void SwRedline::InvalidateRange() // das Layout anstossen
{
- ULONG nSttNd = GetMark()->nNode.GetIndex(),
+ sal_uLong nSttNd = GetMark()->nNode.GetIndex(),
nEndNd = GetPoint()->nNode.GetIndex();
- USHORT nSttCnt = GetMark()->nContent.GetIndex(),
+ sal_uInt16 nSttCnt = GetMark()->nContent.GetIndex(),
nEndCnt = GetPoint()->nContent.GetIndex();
if( nSttNd > nEndNd || ( nSttNd == nEndNd && nSttCnt > nEndCnt ))
{
- ULONG nTmp = nSttNd; nSttNd = nEndNd; nEndNd = nTmp;
- nTmp = nSttCnt; nSttCnt = nEndCnt; nEndCnt = (USHORT)nTmp;
+ sal_uLong nTmp = nSttNd; nSttNd = nEndNd; nEndNd = nTmp;
+ nTmp = nSttCnt; nSttCnt = nEndCnt; nEndCnt = (sal_uInt16)nTmp;
}
SwUpdateAttr aHt( 0, 0, RES_FMT_CHG );
SwNodes& rNds = GetDoc()->GetNodes();
SwNode* pNd;
- for( ULONG n = nSttNd; n <= nEndNd; ++n )
+ for( sal_uLong n = nSttNd; n <= nEndNd; ++n )
if( ND_TEXTNODE == ( pNd = rNds[ n ] )->GetNodeType() )
{
aHt.nStart = n == nSttNd ? nSttCnt : 0;
@@ -3289,7 +3293,7 @@ void SwRedline::InvalidateRange() // das Layout anstossen
* text node nNdIdx
*************************************************************************/
-void SwRedline::CalcStartEnd( ULONG nNdIdx, USHORT& nStart, USHORT& nEnd ) const
+void SwRedline::CalcStartEnd( sal_uLong nNdIdx, sal_uInt16& nStart, sal_uInt16& nEnd ) const
{
const SwPosition *pRStt = Start(), *pREnd = End();
if( pRStt->nNode < nNdIdx )
@@ -3339,13 +3343,13 @@ void SwRedline::MoveToSection()
// damit die Indizies der anderen Redlines nicht mitverschoben
// werden, diese aufs Ende setzen (ist exclusive).
const SwRedlineTbl& rTbl = pDoc->GetRedlineTbl();
- for( USHORT n = 0; n < rTbl.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rTbl.Count(); ++n )
{
SwRedline* pRedl = rTbl[ n ];
- if( pRedl->GetBound(TRUE) == *pStt )
- pRedl->GetBound(TRUE) = *pEnd;
- if( pRedl->GetBound(FALSE) == *pStt )
- pRedl->GetBound(FALSE) = *pEnd;
+ if( pRedl->GetBound(sal_True) == *pStt )
+ pRedl->GetBound(sal_True) = *pEnd;
+ if( pRedl->GetBound(sal_False) == *pStt )
+ pRedl->GetBound(sal_False) = *pEnd;
}
}
@@ -3371,7 +3375,7 @@ void SwRedline::MoveToSection()
else
{
if( pCSttNd && !pCEndNd )
- bDelLastPara = TRUE;
+ bDelLastPara = sal_True;
pDoc->MoveRange( aPam, aPos,
IDocumentContentOperations::DOC_MOVEDEFAULT );
}
@@ -3410,9 +3414,9 @@ void SwRedline::CopyToSection()
SwDoc* pDoc = GetDoc();
SwNodes& rNds = pDoc->GetNodes();
- BOOL bSaveCopyFlag = pDoc->IsCopyIsMove(),
+ sal_Bool bSaveCopyFlag = pDoc->IsCopyIsMove(),
bSaveRdlMoveFlg = pDoc->IsRedlineMove();
- pDoc->SetCopyIsMove( TRUE );
+ pDoc->SetCopyIsMove( sal_True );
// #100619# The IsRedlineMove() flag causes the behaviour of the
// SwDoc::_CopyFlyInFly method to change, which will eventually be
@@ -3492,13 +3496,13 @@ void SwRedline::DelCopyOfSection()
// damit die Indizies der anderen Redlines nicht mitverschoben
// werden, diese aufs Ende setzen (ist exclusive).
const SwRedlineTbl& rTbl = pDoc->GetRedlineTbl();
- for( USHORT n = 0; n < rTbl.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rTbl.Count(); ++n )
{
SwRedline* pRedl = rTbl[ n ];
- if( pRedl->GetBound(TRUE) == *pStt )
- pRedl->GetBound(TRUE) = *pEnd;
- if( pRedl->GetBound(FALSE) == *pStt )
- pRedl->GetBound(FALSE) = *pEnd;
+ if( pRedl->GetBound(sal_True) == *pStt )
+ pRedl->GetBound(sal_True) = *pEnd;
+ if( pRedl->GetBound(sal_False) == *pStt )
+ pRedl->GetBound(sal_False) = *pEnd;
}
}
@@ -3512,7 +3516,7 @@ void SwRedline::DelCopyOfSection()
else if( pCSttNd || pCEndNd )
{
if( pCSttNd && !pCEndNd )
- bDelLastPara = TRUE;
+ bDelLastPara = sal_True;
pDoc->DeleteRange( aPam );
if( bDelLastPara )
@@ -3524,21 +3528,21 @@ void SwRedline::DelCopyOfSection()
// bDelLastPara condition above), only redlines before the
// current ones can be affected.
const SwRedlineTbl& rTbl = pDoc->GetRedlineTbl();
- USHORT n = rTbl.GetPos( this );
+ sal_uInt16 n = rTbl.GetPos( this );
ASSERT( n != USHRT_MAX, "How strange. We don't exist!" );
- for( BOOL bBreak = FALSE; !bBreak && n > 0; )
+ for( sal_Bool bBreak = sal_False; !bBreak && n > 0; )
{
--n;
- bBreak = TRUE;
- if( rTbl[ n ]->GetBound(TRUE) == *aPam.GetPoint() )
+ bBreak = sal_True;
+ if( rTbl[ n ]->GetBound(sal_True) == *aPam.GetPoint() )
{
- rTbl[ n ]->GetBound(TRUE) = *pEnd;
- bBreak = FALSE;
+ rTbl[ n ]->GetBound(sal_True) = *pEnd;
+ bBreak = sal_False;
}
- if( rTbl[ n ]->GetBound(FALSE) == *aPam.GetPoint() )
+ if( rTbl[ n ]->GetBound(sal_False) == *aPam.GetPoint() )
{
- rTbl[ n ]->GetBound(FALSE) = *pEnd;
- bBreak = FALSE;
+ rTbl[ n ]->GetBound(sal_False) = *pEnd;
+ bBreak = sal_False;
}
}
@@ -3547,8 +3551,8 @@ void SwRedline::DelCopyOfSection()
*GetMark() = *pEnd;
DeleteMark();
- aPam.GetBound( TRUE ).nContent.Assign( 0, 0 );
- aPam.GetBound( FALSE ).nContent.Assign( 0, 0 );
+ aPam.GetBound( sal_True ).nContent.Assign( 0, 0 );
+ aPam.GetBound( sal_False ).nContent.Assign( 0, 0 );
aPam.DeleteMark();
pDoc->DelFullPara( aPam );
}
@@ -3572,42 +3576,42 @@ void SwRedline::MoveFromSection()
SwDoc* pDoc = GetDoc();
const SwRedlineTbl& rTbl = pDoc->GetRedlineTbl();
SvPtrarr aBeforeArr( 16, 16 ), aBehindArr( 16, 16 );
- USHORT nMyPos = rTbl.GetPos( this );
+ sal_uInt16 nMyPos = rTbl.GetPos( this );
ASSERT( this, "this nicht im Array?" );
- BOOL bBreak = FALSE;
- USHORT n;
+ sal_Bool bBreak = sal_False;
+ sal_uInt16 n;
for( n = nMyPos+1; !bBreak && n < rTbl.Count(); ++n )
{
- bBreak = TRUE;
- if( rTbl[ n ]->GetBound(TRUE) == *GetPoint() )
+ bBreak = sal_True;
+ if( rTbl[ n ]->GetBound(sal_True) == *GetPoint() )
{
- void* pTmp = &rTbl[ n ]->GetBound(TRUE);
+ void* pTmp = &rTbl[ n ]->GetBound(sal_True);
aBehindArr.Insert( pTmp, aBehindArr.Count());
- bBreak = FALSE;
+ bBreak = sal_False;
}
- if( rTbl[ n ]->GetBound(FALSE) == *GetPoint() )
+ if( rTbl[ n ]->GetBound(sal_False) == *GetPoint() )
{
- void* pTmp = &rTbl[ n ]->GetBound(FALSE);
+ void* pTmp = &rTbl[ n ]->GetBound(sal_False);
aBehindArr.Insert( pTmp, aBehindArr.Count() );
- bBreak = FALSE;
+ bBreak = sal_False;
}
}
- for( bBreak = FALSE, n = nMyPos; !bBreak && n ; )
+ for( bBreak = sal_False, n = nMyPos; !bBreak && n ; )
{
--n;
- bBreak = TRUE;
- if( rTbl[ n ]->GetBound(TRUE) == *GetPoint() )
+ bBreak = sal_True;
+ if( rTbl[ n ]->GetBound(sal_True) == *GetPoint() )
{
- void* pTmp = &rTbl[ n ]->GetBound(TRUE);
+ void* pTmp = &rTbl[ n ]->GetBound(sal_True);
aBeforeArr.Insert( pTmp, aBeforeArr.Count() );
- bBreak = FALSE;
+ bBreak = sal_False;
}
- if( rTbl[ n ]->GetBound(FALSE) == *GetPoint() )
+ if( rTbl[ n ]->GetBound(sal_False) == *GetPoint() )
{
- void* pTmp = &rTbl[ n ]->GetBound(FALSE);
+ void* pTmp = &rTbl[ n ]->GetBound(sal_False);
aBeforeArr.Insert( pTmp, aBeforeArr.Count() );
- bBreak = FALSE;
+ bBreak = sal_False;
}
}
@@ -3629,7 +3633,7 @@ void SwRedline::MoveFromSection()
? pCNd->GetFmtColl() : 0;
SwNodeIndex aNdIdx( GetPoint()->nNode, -1 );
- USHORT nPos = GetPoint()->nContent.GetIndex();
+ sal_uInt16 nPos = GetPoint()->nContent.GetIndex();
SwPosition aPos( *GetPoint() );
if( bDelLastPara && *aPam.GetPoint() == *aPam.GetMark() )
@@ -3654,7 +3658,7 @@ void SwRedline::MoveFromSection()
{
GetPoint()->nNode++;
GetPoint()->nContent.Assign( pCNd = GetCntntNode(), 0 );
- bDelLastPara = FALSE;
+ bDelLastPara = sal_False;
}
else if( pColl )
pCNd = GetCntntNode();
@@ -3694,12 +3698,12 @@ void SwRedline::SetContentIdx( const SwNodeIndex* pIdx )
if( pIdx && !pCntntSect )
{
pCntntSect = new SwNodeIndex( *pIdx );
- bIsVisible = FALSE;
+ bIsVisible = sal_False;
}
else if( !pIdx && pCntntSect )
{
delete pCntntSect, pCntntSect = 0;
- bIsVisible = FALSE;
+ bIsVisible = sal_False;
}
#ifdef DBG_UTIL
else
@@ -3707,17 +3711,17 @@ void SwRedline::SetContentIdx( const SwNodeIndex* pIdx )
#endif
}
-BOOL SwRedline::CanCombine( const SwRedline& rRedl ) const
+sal_Bool SwRedline::CanCombine( const SwRedline& rRedl ) const
{
return IsVisible() && rRedl.IsVisible() &&
pRedlineData->CanCombine( *rRedl.pRedlineData );
}
-void SwRedline::PushData( const SwRedline& rRedl, BOOL bOwnAsNext )
+void SwRedline::PushData( const SwRedline& rRedl, sal_Bool bOwnAsNext )
{
// SwRedlineData* pNew = new SwRedlineData( rRedl.GetType(),
// rRedl.GetAuthor() );
- SwRedlineData* pNew = new SwRedlineData( *rRedl.pRedlineData, FALSE );
+ SwRedlineData* pNew = new SwRedlineData( *rRedl.pRedlineData, sal_False );
if( bOwnAsNext )
{
pNew->pNext = pRedlineData;
@@ -3730,47 +3734,47 @@ void SwRedline::PushData( const SwRedline& rRedl, BOOL bOwnAsNext )
}
}
-BOOL SwRedline::PopData()
+sal_Bool SwRedline::PopData()
{
if( !pRedlineData->pNext )
- return FALSE;
+ return sal_False;
SwRedlineData* pCur = pRedlineData;
pRedlineData = pCur->pNext;
pCur->pNext = 0;
delete pCur;
- return TRUE;
+ return sal_True;
}
-USHORT SwRedline::GetStackCount() const
+sal_uInt16 SwRedline::GetStackCount() const
{
- USHORT nRet = 1;
+ sal_uInt16 nRet = 1;
for( SwRedlineData* pCur = pRedlineData; pCur->pNext; ++nRet )
pCur = pCur->pNext;
return nRet;
}
// -> #111827#
-USHORT SwRedline::GetAuthor( USHORT nPos ) const
+sal_uInt16 SwRedline::GetAuthor( sal_uInt16 nPos ) const
{
return GetRedlineData(nPos).nAuthor;
}
-const String& SwRedline::GetAuthorString( USHORT nPos ) const
+const String& SwRedline::GetAuthorString( sal_uInt16 nPos ) const
{
return SW_MOD()->GetRedlineAuthor(GetRedlineData(nPos).nAuthor);
}
-const DateTime& SwRedline::GetTimeStamp( USHORT nPos ) const
+const DateTime& SwRedline::GetTimeStamp( sal_uInt16 nPos ) const
{
return GetRedlineData(nPos).aStamp;
}
-RedlineType_t SwRedline::GetRealType( USHORT nPos ) const
+RedlineType_t SwRedline::GetRealType( sal_uInt16 nPos ) const
{
return GetRedlineData(nPos).eType;
}
-const String& SwRedline::GetComment( USHORT nPos ) const
+const String& SwRedline::GetComment( sal_uInt16 nPos ) const
{
return GetRedlineData(nPos).sComment;
}
@@ -3783,19 +3787,19 @@ int SwRedline::operator==( const SwRedline& rCmp ) const
int SwRedline::operator<( const SwRedline& rCmp ) const
{
- BOOL nResult = FALSE;
+ sal_Bool nResult = sal_False;
if (*Start() < *rCmp.Start())
- nResult = TRUE;
+ nResult = sal_True;
else if (*Start() == *rCmp.Start())
if (*End() < *rCmp.End())
- nResult = TRUE;
+ nResult = sal_True;
return nResult;
}
// -> #111827#
-const SwRedlineData & SwRedline::GetRedlineData(USHORT nPos) const
+const SwRedlineData & SwRedline::GetRedlineData(sal_uInt16 nPos) const
{
SwRedlineData * pCur = pRedlineData;
@@ -3811,7 +3815,7 @@ const SwRedlineData & SwRedline::GetRedlineData(USHORT nPos) const
return *pCur;
}
-String SwRedline::GetDescr(USHORT nPos)
+String SwRedline::GetDescr(sal_uInt16 nPos)
{
String aResult;
@@ -3856,9 +3860,9 @@ String SwRedline::GetDescr(USHORT nPos)
bool SwDoc::IsInRedlines(const SwNode & rNode) const
{
SwPosition aPos(rNode);
- SwNode & rEndOfRedlines = aNodes.GetEndOfRedlines();
+ SwNode & rEndOfRedlines = GetNodes().GetEndOfRedlines();
SwPaM aPam(SwPosition(*rEndOfRedlines.StartOfSectionNode()),
SwPosition(rEndOfRedlines));
- return aPam.ContainsPosition(aPos) ? sal_True : sal_False;
+ return aPam.ContainsPosition(aPos) ? true : false;
}
diff --git a/sw/source/core/doc/docruby.cxx b/sw/source/core/doc/docruby.cxx
index 4a707e1fb1af..c8703ab6adcb 100644
--- a/sw/source/core/doc/docruby.cxx
+++ b/sw/source/core/doc/docruby.cxx
@@ -28,18 +28,16 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <string.h> // fuer strchr()
-#include <hintids.hxx>
-#ifndef _COM_SUN_STAR_I18N_UNICODETYPE_HDL
#include <com/sun/star/i18n/UnicodeType.hdl>
-#endif
-#ifndef _COM_SUN_STAR_I18N_WORDTYPE_HDL
#include <com/sun/star/i18n/WordType.hdl>
-#endif
+
#include <unotools/charclass.hxx>
+
+#include <hintids.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <docary.hxx>
#include <mvsave.hxx> // Strukturen zum Sichern beim Move/Delete
#include <ndtxt.hxx>
@@ -47,7 +45,6 @@
#include <rubylist.hxx>
#include <pam.hxx>
#include <swundo.hxx> // fuer die UndoIds
-#include <undobj.hxx>
#include <breakit.hxx>
#include <crsskip.hxx>
@@ -63,12 +60,12 @@ using namespace ::com::sun::star::i18n;
*
*
*/
-USHORT SwDoc::FillRubyList( const SwPaM& rPam, SwRubyList& rList,
- USHORT nMode )
+sal_uInt16 SwDoc::FillRubyList( const SwPaM& rPam, SwRubyList& rList,
+ sal_uInt16 nMode )
{
const SwPaM *_pStartCrsr = (SwPaM*)rPam.GetNext(),
*__pStartCrsr = _pStartCrsr;
- BOOL bCheckEmpty = &rPam != _pStartCrsr;
+ sal_Bool bCheckEmpty = &rPam != _pStartCrsr;
do {
const SwPosition* pStt = _pStartCrsr->Start(),
* pEnd = pStt == _pStartCrsr->GetPoint()
@@ -109,18 +106,18 @@ USHORT SwDoc::FillRubyList( const SwPaM& rPam, SwRubyList& rList,
return rList.Count();
}
-USHORT SwDoc::SetRubyList( const SwPaM& rPam, const SwRubyList& rList,
- USHORT nMode )
+sal_uInt16 SwDoc::SetRubyList( const SwPaM& rPam, const SwRubyList& rList,
+ sal_uInt16 nMode )
{
- StartUndo( UNDO_SETRUBYATTR, NULL );
+ GetIDocumentUndoRedo().StartUndo( UNDO_SETRUBYATTR, NULL );
SvUShortsSort aDelArr;
aDelArr.Insert( RES_TXTATR_CJK_RUBY );
- USHORT nListEntry = 0;
+ sal_uInt16 nListEntry = 0;
const SwPaM *_pStartCrsr = (SwPaM*)rPam.GetNext(),
*__pStartCrsr = _pStartCrsr;
- BOOL bCheckEmpty = &rPam != _pStartCrsr;
+ sal_Bool bCheckEmpty = &rPam != _pStartCrsr;
do {
const SwPosition* pStt = _pStartCrsr->Start(),
* pEnd = pStt == _pStartCrsr->GetPoint()
@@ -149,7 +146,7 @@ USHORT SwDoc::SetRubyList( const SwPaM& rPam, const SwRubyList& rList,
}
else
{
- ResetAttrs( aPam, TRUE, &aDelArr );
+ ResetAttrs( aPam, sal_True, &aDelArr );
}
}
@@ -193,12 +190,12 @@ USHORT SwDoc::SetRubyList( const SwPaM& rPam, const SwRubyList& rList,
} while( 30 > rList.Count() &&
(_pStartCrsr=(SwPaM *)_pStartCrsr->GetNext()) != __pStartCrsr );
- EndUndo( UNDO_SETRUBYATTR, NULL );
+ GetIDocumentUndoRedo().EndUndo( UNDO_SETRUBYATTR, NULL );
return nListEntry;
}
-BOOL SwDoc::_SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rEntry, USHORT )
+sal_Bool SwDoc::_SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rEntry, sal_uInt16 )
{
// Point must be the startposition, Mark is optional the end position
SwPosition* pPos = rPam.GetPoint();
@@ -206,7 +203,7 @@ BOOL SwDoc::_SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rEntry, USHORT )
const String* pTxt = &pTNd->GetTxt();
xub_StrLen nStart = pPos->nContent.GetIndex(), nEnd = pTxt->Len();
- BOOL bHasMark = rPam.HasMark();
+ sal_Bool bHasMark = rPam.HasMark();
if( bHasMark )
{
// in the same node?
@@ -222,7 +219,7 @@ BOOL SwDoc::_SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rEntry, USHORT )
// ----- search the start
// --- look where a ruby attribut starts
- USHORT nHtIdx = USHRT_MAX;
+ sal_uInt16 nHtIdx = USHRT_MAX;
const SwpHints* pHts = pTNd->GetpSwpHints();
const SwTxtAttr* pAttr = 0;
if( pHts )
@@ -252,7 +249,7 @@ BOOL SwDoc::_SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rEntry, USHORT )
*pTxt, nStart,
pBreakIt->GetLocale( pTNd->GetLang( nStart )),
WordType::ANYWORD_IGNOREWHITESPACES,
- TRUE ).startPos;
+ sal_True ).startPos;
if( nWordStt < nStart && -1 != nWordStt )
{
nStart = (xub_StrLen)nWordStt;
@@ -260,7 +257,7 @@ BOOL SwDoc::_SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rEntry, USHORT )
}
}
- BOOL bAlphaNum = FALSE;
+ sal_Bool bAlphaNum = sal_False;
long nWordEnd = nEnd;
CharClass& rCC = GetAppCharClass();
while( nStart < nEnd )
@@ -280,14 +277,14 @@ BOOL SwDoc::_SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rEntry, USHORT )
}
sal_Int32 nChType = rCC.getType( *pTxt, nStart );
- BOOL bIgnoreChar = FALSE, bIsAlphaNum = FALSE, bChkNxtWrd = FALSE;
+ sal_Bool bIgnoreChar = sal_False, bIsAlphaNum = sal_False, bChkNxtWrd = sal_False;
switch( nChType )
{
case UnicodeType::UPPERCASE_LETTER:
case UnicodeType::LOWERCASE_LETTER:
case UnicodeType::TITLECASE_LETTER:
case UnicodeType::DECIMAL_DIGIT_NUMBER:
- bChkNxtWrd = bIsAlphaNum = TRUE;
+ bChkNxtWrd = bIsAlphaNum = sal_True;
break;
case UnicodeType::SPACE_SEPARATOR:
@@ -295,12 +292,12 @@ BOOL SwDoc::_SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rEntry, USHORT )
/*??*/ case UnicodeType::PRIVATE_USE:
case UnicodeType::START_PUNCTUATION:
case UnicodeType::END_PUNCTUATION:
- bIgnoreChar = TRUE;
+ bIgnoreChar = sal_True;
break;
case UnicodeType::OTHER_LETTER:
- bChkNxtWrd = TRUE;
+ bChkNxtWrd = sal_True;
// no break!
// case UnicodeType::UNASSIGNED:
// case UnicodeType::MODIFIER_LETTER:
@@ -324,7 +321,7 @@ BOOL SwDoc::_SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rEntry, USHORT )
// case UnicodeType::INITIAL_PUNCTUATION:
// case UnicodeType::FINAL_PUNCTUATION:
default:
- bIsAlphaNum = FALSE;
+ bIsAlphaNum = sal_False;
break;
}
@@ -344,7 +341,7 @@ BOOL SwDoc::_SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rEntry, USHORT )
*pTxt, nStart,
pBreakIt->GetLocale( pTNd->GetLang( nStart )),
WordType::ANYWORD_IGNOREWHITESPACES,
- TRUE ).endPos;
+ sal_True ).endPos;
if( 0 > nWordEnd || nWordEnd > nEnd || nWordEnd == nStart )
nWordEnd = nEnd;
}
diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx
index 8923b5322998..497e00b70125 100644
--- a/sw/source/core/doc/docsort.cxx
+++ b/sw/source/core/doc/docsort.cxx
@@ -27,6 +27,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
#include <hintids.hxx>
#include <rtl/math.hxx>
#include <unotools/collatorwrapper.hxx>
@@ -39,6 +40,7 @@
#include <fmtanchr.hxx>
#include <frmfmt.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <node.hxx>
#include <pam.hxx>
#include <ndtxt.hxx>
@@ -46,7 +48,9 @@
#include <swundo.hxx>
#include <sortopt.hxx>
#include <docsort.hxx>
-#include <undobj.hxx>
+#include <UndoSort.hxx>
+#include <UndoRedline.hxx>
+#include <hints.hxx>
#include <tblsel.hxx>
#include <cellatr.hxx>
#include <redline.hxx>
@@ -141,21 +145,21 @@ double SwSortElement::StrToDouble( const String& rStr ) const
--------------------------------------------------------------------*/
-BOOL SwSortElement::operator==(const SwSortElement& )
+sal_Bool SwSortElement::operator==(const SwSortElement& )
{
- return FALSE;
+ return sal_False;
}
/*--------------------------------------------------------------------
Beschreibung: Kleiner-Operator fuers sortieren
--------------------------------------------------------------------*/
-BOOL SwSortElement::operator<(const SwSortElement& rCmp)
+sal_Bool SwSortElement::operator<(const SwSortElement& rCmp)
{
// der eigentliche Vergleich
//
- for(USHORT nKey = 0; nKey < pOptions->aKeys.Count(); ++nKey)
+ for(sal_uInt16 nKey = 0; nKey < pOptions->aKeys.Count(); ++nKey)
{
const SwSortElement *pOrig, *pCmp;
@@ -196,10 +200,10 @@ BOOL SwSortElement::operator<(const SwSortElement& rCmp)
return -1 == nCmp;
}
}
- return FALSE;
+ return sal_False;
}
-double SwSortElement::GetValue( USHORT nKey ) const
+double SwSortElement::GetValue( sal_uInt16 nKey ) const
{
return StrToDouble( GetKey( nKey ));
}
@@ -225,7 +229,7 @@ SwSortTxtElement::~SwSortTxtElement()
--------------------------------------------------------------------*/
-String SwSortTxtElement::GetKey(USHORT nId) const
+String SwSortTxtElement::GetKey(sal_uInt16 nId) const
{
SwTxtNode* pTxtNd = aPos.GetNode().GetTxtNode();
if( !pTxtNd )
@@ -235,7 +239,7 @@ String SwSortTxtElement::GetKey(USHORT nId) const
const String& rStr = pTxtNd->GetTxt();
sal_Unicode nDeli = pOptions->cDeli;
- USHORT nDCount = pOptions->aKeys[nId]->nColumnId, i = 1;
+ sal_uInt16 nDCount = pOptions->aKeys[nId]->nColumnId, i = 1;
xub_StrLen nStart = 0;
// Den Delimitter suchen
@@ -256,7 +260,7 @@ String SwSortTxtElement::GetKey(USHORT nId) const
Beschreibung: Sortier-Elemente fuer Tabellen
--------------------------------------------------------------------*/
-SwSortBoxElement::SwSortBoxElement( USHORT nRC )
+SwSortBoxElement::SwSortBoxElement( sal_uInt16 nRC )
: nRow( nRC )
{
}
@@ -271,10 +275,10 @@ SwSortBoxElement::~SwSortBoxElement()
--------------------------------------------------------------------*/
-String SwSortBoxElement::GetKey(USHORT nKey) const
+String SwSortBoxElement::GetKey(sal_uInt16 nKey) const
{
const _FndBox* pFndBox;
- USHORT nCol = pOptions->aKeys[nKey]->nColumnId-1;
+ sal_uInt16 nCol = pOptions->aKeys[nKey]->nColumnId-1;
if( SRT_ROWS == pOptions->eDirection )
pFndBox = pBox->GetBox(nCol, nRow); // Zeilen sortieren
@@ -292,7 +296,7 @@ String SwSortBoxElement::GetKey(USHORT nKey) const
{
// ueber alle TextNodes der Box
const SwNode *pNd = 0, *pEndNd = pMyBox->GetSttNd()->EndOfSectionNode();
- for( ULONG nIdx = pMyBox->GetSttIdx() + 1; pNd != pEndNd; ++nIdx )
+ for( sal_uLong nIdx = pMyBox->GetSttIdx() + 1; pNd != pEndNd; ++nIdx )
if( ( pNd = pDoc->GetNodes()[ nIdx ])->IsTxtNode() )
aRetStr += ((SwTxtNode*)pNd)->GetTxt();
}
@@ -300,10 +304,10 @@ String SwSortBoxElement::GetKey(USHORT nKey) const
return aRetStr;
}
-double SwSortBoxElement::GetValue( USHORT nKey ) const
+double SwSortBoxElement::GetValue( sal_uInt16 nKey ) const
{
const _FndBox* pFndBox;
- USHORT nCol = pOptions->aKeys[nKey]->nColumnId-1;
+ sal_uInt16 nCol = pOptions->aKeys[nKey]->nColumnId-1;
if( SRT_ROWS == pOptions->eDirection )
pFndBox = pBox->GetBox(nCol, nRow); // Zeilen sortieren
@@ -330,13 +334,13 @@ double SwSortBoxElement::GetValue( USHORT nKey ) const
--------------------------------------------------------------------*/
-BOOL SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt)
+sal_Bool SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt)
{
// pruefen ob Rahmen im Text
const SwPosition *pStart = rPaM.Start(), *pEnd = rPaM.End();
// Index auf den Start der Selektion
- for ( USHORT n = 0; n < GetSpzFrmFmts()->Count(); ++n )
+ for ( sal_uInt16 n = 0; n < GetSpzFrmFmts()->Count(); ++n )
{
SwFrmFmt *const pFmt = static_cast<SwFrmFmt*>((*GetSpzFrmFmts())[n]);
SwFmtAnchor const*const pAnchor = &pFmt->GetAnchor();
@@ -344,22 +348,24 @@ BOOL SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt)
if (pAPos && (FLY_AT_PARA == pAnchor->GetAnchorId()) &&
pStart->nNode <= pAPos->nNode && pAPos->nNode <= pEnd->nNode )
- return FALSE;
+ return sal_False;
}
// pruefe ob nur TextNodes in der Selection liegen
{
- ULONG nStart = pStart->nNode.GetIndex(),
+ sal_uLong nStart = pStart->nNode.GetIndex(),
nEnd = pEnd->nNode.GetIndex();
while( nStart <= nEnd )
// Iterieren ueber einen selektierten Bereich
if( !GetNodes()[ nStart++ ]->IsTxtNode() )
- return FALSE;
+ return sal_False;
}
- BOOL bUndo = DoesUndo();
+ bool const bUndo = GetIDocumentUndoRedo().DoesUndo();
if( bUndo )
- StartUndo( UNDO_START, NULL );
+ {
+ GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
+ }
SwPaM* pRedlPam = 0;
SwUndoRedlineSort* pRedlUndo = 0;
@@ -368,7 +374,7 @@ BOOL SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt)
if( IsRedlineOn() || (!IsIgnoreRedline() && pRedlineTbl->Count() ))
{
pRedlPam = new SwPaM( pStart->nNode, pEnd->nNode, -1, 1 );
- SwCntntNode* pCNd = pRedlPam->GetCntntNode( FALSE );
+ SwCntntNode* pCNd = pRedlPam->GetCntntNode( sal_False );
if( pCNd )
pRedlPam->GetMark()->nContent = pCNd->Len();
@@ -377,7 +383,7 @@ BOOL SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt)
if( bUndo )
{
pRedlUndo = new SwUndoRedlineSort( *pRedlPam,rOpt );
- DoUndo( FALSE );
+ GetIDocumentUndoRedo().DoUndo(false);
}
// erst den Bereich kopieren, dann
SwNodeIndex aEndIdx( pEnd->nNode, 1 );
@@ -388,11 +394,11 @@ BOOL SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt)
DeleteRedline( *pRedlPam, true, USHRT_MAX );
pRedlPam->GetMark()->nNode.Assign( pEnd->nNode.GetNode(), 1 );
- pCNd = pRedlPam->GetCntntNode( FALSE );
+ pCNd = pRedlPam->GetCntntNode( sal_False );
pRedlPam->GetMark()->nContent.Assign( pCNd, 0 );
pRedlPam->GetPoint()->nNode.Assign( aEndIdx.GetNode() );
- pCNd = pRedlPam->GetCntntNode( TRUE );
+ pCNd = pRedlPam->GetCntntNode( sal_True );
xub_StrLen nCLen = 0;
if( !pCNd &&
0 != (pCNd = GetNodes()[ aEndIdx.GetIndex()-1 ]->GetCntntNode()))
@@ -426,15 +432,18 @@ BOOL SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt)
// Und jetzt der Akt: Verschieben von Nodes und immer schoen auf UNDO
// achten
//
- ULONG nBeg = pStart->nNode.GetIndex();
+ sal_uLong nBeg = pStart->nNode.GetIndex();
SwNodeRange aRg( aStart, aStart );
if( bUndo && !pRedlUndo )
- AppendUndo( pUndoSort = new SwUndoSort( rPaM, rOpt ) );
+ {
+ pUndoSort = new SwUndoSort(rPaM, rOpt);
+ GetIDocumentUndoRedo().AppendUndo(pUndoSort);
+ }
- DoUndo( FALSE );
+ GetIDocumentUndoRedo().DoUndo(false);
- for ( USHORT n = 0; n < aSortArr.Count(); ++n )
+ for ( sal_uInt16 n = 0; n < aSortArr.Count(); ++n )
{
SwSortTxtElement* pBox = (SwSortTxtElement*)aSortArr[n];
aStart = nBeg + n;
@@ -458,7 +467,10 @@ BOOL SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt)
if( pRedlUndo )
{
pRedlUndo->SetSaveRange( *pRedlPam );
- AppendUndo( pRedlUndo );
+ // UGLY: temp. enable Undo
+ GetIDocumentUndoRedo().DoUndo(true);
+ GetIDocumentUndoRedo().AppendUndo( pRedlUndo );
+ GetIDocumentUndoRedo().DoUndo(false);
}
// nBeg is start of sorted range
@@ -495,24 +507,26 @@ BOOL SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt)
delete pRedlPam, pRedlPam = 0;
}
- DoUndo( bUndo );
+ GetIDocumentUndoRedo().DoUndo( bUndo );
if( bUndo )
- EndUndo( UNDO_END, NULL );
+ {
+ GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
+ }
- return TRUE;
+ return sal_True;
}
/*--------------------------------------------------------------------
Beschreibung: Tabelle sortieren im Document
--------------------------------------------------------------------*/
-BOOL SwDoc::SortTbl(const SwSelBoxes& rBoxes, const SwSortOptions& rOpt)
+sal_Bool SwDoc::SortTbl(const SwSelBoxes& rBoxes, const SwSortOptions& rOpt)
{
// uebers SwDoc fuer Undo !!
ASSERT( rBoxes.Count(), "keine gueltige Box-Liste" );
SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode();
if( !pTblNd )
- return FALSE;
+ return sal_False;
// Auf gehts sortieren
// suche alle Boxen / Lines
@@ -523,12 +537,12 @@ BOOL SwDoc::SortTbl(const SwSelBoxes& rBoxes, const SwSortOptions& rOpt)
}
if(!aFndBox.GetLines().Count())
- return FALSE;
+ return sal_False;
if( !IsIgnoreRedline() && GetRedlineTbl().Count() )
DeleteRedline( *pTblNd, true, USHRT_MAX );
- USHORT nStart = 0;
+ sal_uInt16 nStart = 0;
if( pTblNd->GetTable().GetRowsToRepeat() > 0 && rOpt.eDirection == SRT_ROWS )
{
// Oberste seleketierte Zeile
@@ -561,7 +575,7 @@ BOOL SwDoc::SortTbl(const SwSelBoxes& rBoxes, const SwSortOptions& rOpt)
FlatFndBox aFlatBox(this, aFndBox);
if(!aFlatBox.IsSymmetric())
- return FALSE;
+ return sal_False;
// MIB 9.7.97: HTML-Layout loeschen
pTblNd->GetTable().SetHTMLTableLayout( 0 );
@@ -575,21 +589,18 @@ BOOL SwDoc::SortTbl(const SwSelBoxes& rBoxes, const SwSortOptions& rOpt)
pTblNd->DelFrms();
// ? TL_CHART2: ?
- // Redo loeschen bevor Undo
- BOOL bUndo = DoesUndo();
SwUndoSort* pUndoSort = 0;
- if(bUndo)
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
pUndoSort = new SwUndoSort( rBoxes[0]->GetSttIdx(),
rBoxes[rBoxes.Count()-1]->GetSttIdx(),
*pTblNd, rOpt, aFlatBox.HasItemSets() );
- AppendUndo(pUndoSort);
- DoUndo(FALSE);
+ GetIDocumentUndoRedo().AppendUndo(pUndoSort);
}
+ ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
// SchluesselElemente einsortieren
- USHORT nCount = (rOpt.eDirection == SRT_ROWS) ?
+ sal_uInt16 nCount = (rOpt.eDirection == SRT_ROWS) ?
aFlatBox.GetRows() : aFlatBox.GetCols();
// SortList nach Schluessel sortieren
@@ -598,7 +609,7 @@ BOOL SwDoc::SortTbl(const SwSelBoxes& rBoxes, const SwSortOptions& rOpt)
// wenn die HeaderLine wiederholt wird und die
// Zeilen sortiert werden 1.Zeile nicht mitsortieren
- USHORT i;
+ sal_uInt16 i;
for( i = nStart; i < nCount; ++i)
{
@@ -620,7 +631,7 @@ BOOL SwDoc::SortTbl(const SwSelBoxes& rBoxes, const SwSortOptions& rOpt)
// Restore table frames:
// --> FME 2004-11-26 #i37739# A simple 'MakeFrms' after the node sorting
// does not work if the table is inside a frame and has no prev/next.
- const ULONG nIdx = pTblNd->GetIndex();
+ const sal_uLong nIdx = pTblNd->GetIndex();
aNode2Layout.RestoreUpperFrms( GetNodes(), nIdx, nIdx + 1 );
// <--
@@ -631,11 +642,8 @@ BOOL SwDoc::SortTbl(const SwSelBoxes& rBoxes, const SwSortOptions& rOpt)
aSortList.DeleteAndDestroy( 0, aSortList.Count() );
SwSortElement::Finit();
- // Undo wieder aktivieren
- DoUndo(bUndo);
-
SetModified();
- return TRUE;
+ return sal_True;
}
/*--------------------------------------------------------------------
@@ -643,10 +651,10 @@ BOOL SwDoc::SortTbl(const SwSelBoxes& rBoxes, const SwSortOptions& rOpt)
--------------------------------------------------------------------*/
-void MoveRow(SwDoc* pDoc, const FlatFndBox& rBox, USHORT nS, USHORT nT,
+void MoveRow(SwDoc* pDoc, const FlatFndBox& rBox, sal_uInt16 nS, sal_uInt16 nT,
SwMovedBoxes& rMovedList, SwUndoSort* pUD)
{
- for( USHORT i=0; i < rBox.GetCols(); ++i )
+ for( sal_uInt16 i=0; i < rBox.GetCols(); ++i )
{ // Alte Zellen-Pos bestimmen und merken
const _FndBox* pSource = rBox.GetBox(i, nS);
@@ -656,7 +664,7 @@ void MoveRow(SwDoc* pDoc, const FlatFndBox& rBox, USHORT nS, USHORT nT,
const SwTableBox* pT = pTarget->GetBox();
const SwTableBox* pS = pSource->GetBox();
- BOOL bMoved = rMovedList.GetPos(pT) != USHRT_MAX;
+ sal_Bool bMoved = rMovedList.GetPos(pT) != USHRT_MAX;
// und verschieben
MoveCell(pDoc, pS, pT, bMoved, pUD);
@@ -691,10 +699,10 @@ void MoveRow(SwDoc* pDoc, const FlatFndBox& rBox, USHORT nS, USHORT nT,
--------------------------------------------------------------------*/
-void MoveCol(SwDoc* pDoc, const FlatFndBox& rBox, USHORT nS, USHORT nT,
+void MoveCol(SwDoc* pDoc, const FlatFndBox& rBox, sal_uInt16 nS, sal_uInt16 nT,
SwMovedBoxes& rMovedList, SwUndoSort* pUD)
{
- for(USHORT i=0; i < rBox.GetRows(); ++i)
+ for(sal_uInt16 i=0; i < rBox.GetRows(); ++i)
{ // Alte Zellen-Pos bestimmen und merken
const _FndBox* pSource = rBox.GetBox(nS, i);
@@ -706,7 +714,7 @@ void MoveCol(SwDoc* pDoc, const FlatFndBox& rBox, USHORT nS, USHORT nT,
const SwTableBox* pS = pSource->GetBox();
// und verschieben
- BOOL bMoved = rMovedList.GetPos(pT) != USHRT_MAX;
+ sal_Bool bMoved = rMovedList.GetPos(pT) != USHRT_MAX;
MoveCell(pDoc, pS, pT, bMoved, pUD);
rMovedList.Insert(pS, rMovedList.Count() );
@@ -740,7 +748,7 @@ void MoveCol(SwDoc* pDoc, const FlatFndBox& rBox, USHORT nS, USHORT nT,
void MoveCell(SwDoc* pDoc, const SwTableBox* pSource, const SwTableBox* pTar,
- BOOL bMovedBefore, SwUndoSort* pUD)
+ sal_Bool bMovedBefore, SwUndoSort* pUD)
{
ASSERT(pSource && pTar,"Fehlende Quelle oder Ziel");
@@ -767,9 +775,9 @@ void MoveCell(SwDoc* pDoc, const SwTableBox* pSource, const SwTableBox* pTar,
// Ziel
SwNodeIndex aTar( *pTar->GetSttNd() );
pNd = pDoc->GetNodes().GoNext( &aTar ); // naechsten ContentNode
- ULONG nCount = pNd->EndOfSectionIndex() - pNd->StartOfSectionIndex();
+ sal_uLong nCount = pNd->EndOfSectionIndex() - pNd->StartOfSectionIndex();
- BOOL bDelFirst = FALSE;
+ sal_Bool bDelFirst = sal_False;
if( nCount == 2 )
{
ASSERT( pNd->GetCntntNode(), "Kein ContentNode");
@@ -836,26 +844,26 @@ FlatFndBox::~FlatFndBox()
--------------------------------------------------------------------*/
-BOOL FlatFndBox::CheckLineSymmetry(const _FndBox& rBox)
+sal_Bool FlatFndBox::CheckLineSymmetry(const _FndBox& rBox)
{
const _FndLines &rLines = rBox.GetLines();
- USHORT nBoxes(0);
+ sal_uInt16 nBoxes(0);
// UeberLines iterieren
- for(USHORT i=0; i < rLines.Count(); ++i)
+ for(sal_uInt16 i=0; i < rLines.Count(); ++i)
{ // Die Boxen einer Line
_FndLine* pLn = rLines[i];
const _FndBoxes& rBoxes = pLn->GetBoxes();
// Anzahl der Boxen aller Lines ungleich -> keine Symmetrie
if( i && nBoxes != rBoxes.Count())
- return FALSE;
+ return sal_False;
nBoxes = rBoxes.Count();
if( !CheckBoxSymmetry( *pLn ) )
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
/*--------------------------------------------------------------------
@@ -864,26 +872,26 @@ BOOL FlatFndBox::CheckLineSymmetry(const _FndBox& rBox)
--------------------------------------------------------------------*/
-BOOL FlatFndBox::CheckBoxSymmetry(const _FndLine& rLn)
+sal_Bool FlatFndBox::CheckBoxSymmetry(const _FndLine& rLn)
{
const _FndBoxes &rBoxes = rLn.GetBoxes();
- USHORT nLines(0);
+ sal_uInt16 nLines(0);
// Ueber Boxes iterieren
- for(USHORT i=0; i < rBoxes.Count(); ++i)
+ for(sal_uInt16 i=0; i < rBoxes.Count(); ++i)
{ // Die Boxen einer Line
_FndBox* pBox = rBoxes[i];
const _FndLines& rLines = pBox->GetLines();
// Anzahl der Boxen aller Lines ungleich -> keine Symmetrie
if( i && nLines != rLines.Count() )
- return FALSE;
+ return sal_False;
nLines = rLines.Count();
if( nLines && !CheckLineSymmetry( *pBox ) )
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
/*--------------------------------------------------------------------
@@ -891,20 +899,20 @@ BOOL FlatFndBox::CheckBoxSymmetry(const _FndLine& rLn)
--------------------------------------------------------------------*/
-USHORT FlatFndBox::GetColCount(const _FndBox& rBox)
+sal_uInt16 FlatFndBox::GetColCount(const _FndBox& rBox)
{
const _FndLines& rLines = rBox.GetLines();
// Ueber Lines iterieren
if( !rLines.Count() )
return 1;
- USHORT nSum = 0;
- for( USHORT i=0; i < rLines.Count(); ++i )
+ sal_uInt16 nSum = 0;
+ for( sal_uInt16 i=0; i < rLines.Count(); ++i )
{
// Die Boxen einer Line
- USHORT nCount = 0;
+ sal_uInt16 nCount = 0;
const _FndBoxes& rBoxes = rLines[i]->GetBoxes();
- for( USHORT j=0; j < rBoxes.Count(); ++j )
+ for( sal_uInt16 j=0; j < rBoxes.Count(); ++j )
// Rekursiv wirder ueber die Lines Iterieren
nCount += rBoxes[j]->GetLines().Count()
? GetColCount(*rBoxes[j]) : 1;
@@ -920,18 +928,18 @@ USHORT FlatFndBox::GetColCount(const _FndBox& rBox)
--------------------------------------------------------------------*/
-USHORT FlatFndBox::GetRowCount(const _FndBox& rBox)
+sal_uInt16 FlatFndBox::GetRowCount(const _FndBox& rBox)
{
const _FndLines& rLines = rBox.GetLines();
if( !rLines.Count() )
return 1;
- USHORT nLines = 0;
- for(USHORT i=0; i < rLines.Count(); ++i)
+ sal_uInt16 nLines = 0;
+ for(sal_uInt16 i=0; i < rLines.Count(); ++i)
{ // Die Boxen einer Line
const _FndBoxes& rBoxes = rLines[i]->GetBoxes();
- USHORT nLn = 1;
- for(USHORT j=0; j < rBoxes.Count(); ++j)
+ sal_uInt16 nLn = 1;
+ for(sal_uInt16 j=0; j < rBoxes.Count(); ++j)
if( rBoxes[j]->GetLines().Count() )
// Rekursiv ueber die Lines Iterieren
nLn = Max(GetRowCount(*rBoxes[j]), nLn);
@@ -946,19 +954,19 @@ USHORT FlatFndBox::GetRowCount(const _FndBox& rBox)
--------------------------------------------------------------------*/
-void FlatFndBox::FillFlat(const _FndBox& rBox, BOOL bLastBox)
+void FlatFndBox::FillFlat(const _FndBox& rBox, sal_Bool bLastBox)
{
- BOOL bModRow = FALSE;
+ sal_Bool bModRow = sal_False;
const _FndLines& rLines = rBox.GetLines();
// Ueber Lines iterieren
- USHORT nOldRow = nRow;
- for( USHORT i=0; i < rLines.Count(); ++i )
+ sal_uInt16 nOldRow = nRow;
+ for( sal_uInt16 i=0; i < rLines.Count(); ++i )
{
// Die Boxen einer Line
const _FndBoxes& rBoxes = rLines[i]->GetBoxes();
- USHORT nOldCol = nCol;
- for( USHORT j = 0; j < rBoxes.Count(); ++j )
+ sal_uInt16 nOldCol = nCol;
+ for( sal_uInt16 j = 0; j < rBoxes.Count(); ++j )
{
// Die Box pruefen ob es eine atomare Box ist
const _FndBox* pBox = rBoxes[ j ];
@@ -966,7 +974,7 @@ void FlatFndBox::FillFlat(const _FndBox& rBox, BOOL bLastBox)
if( !pBox->GetLines().Count() )
{
// peichern
- USHORT nOff = nRow * nCols + nCol;
+ sal_uInt16 nOff = nRow * nCols + nCol;
*(pArr + nOff) = pBox;
// sicher die Formel/Format/Value Werte
@@ -987,7 +995,7 @@ void FlatFndBox::FillFlat(const _FndBox& rBox, BOOL bLastBox)
*(ppItemSets + nOff ) = pSet;
}
- bModRow = TRUE;
+ bModRow = sal_True;
}
else
{
@@ -1009,16 +1017,16 @@ void FlatFndBox::FillFlat(const _FndBox& rBox, BOOL bLastBox)
--------------------------------------------------------------------*/
-const _FndBox* FlatFndBox::GetBox(USHORT n_Col, USHORT n_Row) const
+const _FndBox* FlatFndBox::GetBox(sal_uInt16 n_Col, sal_uInt16 n_Row) const
{
- USHORT nOff = n_Row * nCols + n_Col;
+ sal_uInt16 nOff = n_Row * nCols + n_Col;
const _FndBox* pTmp = *(pArr + nOff);
ASSERT(n_Col < nCols && n_Row < nRows && pTmp, "unzulaessiger Array-Zugriff");
return pTmp;
}
-const SfxItemSet* FlatFndBox::GetItemSet(USHORT n_Col, USHORT n_Row) const
+const SfxItemSet* FlatFndBox::GetItemSet(sal_uInt16 n_Col, sal_uInt16 n_Row) const
{
ASSERT( !ppItemSets || ( n_Col < nCols && n_Row < nRows), "unzulaessiger Array-Zugriff");
diff --git a/sw/source/core/doc/docstat.cxx b/sw/source/core/doc/docstat.cxx
index ee53168bb175..ee44bf142de3 100644
--- a/sw/source/core/doc/docstat.cxx
+++ b/sw/source/core/doc/docstat.cxx
@@ -45,7 +45,7 @@ SwDocStat::SwDocStat() :
nAllPara(1),
nWord(0),
nChar(0),
- bModified(TRUE)
+ bModified(sal_True)
{}
/************************************************************************
@@ -62,6 +62,6 @@ void SwDocStat::Reset()
nAllPara= 1;
nWord = 0;
nChar = 0;
- bModified = TRUE;
+ bModified = sal_True;
}
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index 8165668f1a28..999d797f94fe 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -49,6 +49,7 @@
#include <frmatr.hxx>
#include <pagedesc.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <pagefrm.hxx>
#include <ndtxt.hxx>
#include <swtable.hxx>
@@ -58,7 +59,7 @@
#include <poolfmt.hxx>
#include <txtfrm.hxx>
#include <rootfrm.hxx>
-#include <undobj.hxx>
+#include <UndoAttribute.hxx>
#include <swundo.hxx>
#include <mdiexp.hxx>
#include <docary.hxx>
@@ -102,10 +103,10 @@ typedef LinkStruct* LinkStructPtr;
SV_DECL_PTRARR(LinkStructArr, LinkStructPtr, 0, 5 )
SV_IMPL_PTRARR(LinkStructArr, LinkStructPtr)
-USHORT SwDoc::GetTOIKeys( SwTOIKeyType eTyp, SvStringsSort& rArr ) const
+sal_uInt16 SwDoc::GetTOIKeys( SwTOIKeyType eTyp, SvStringsSort& rArr ) const
{
if( rArr.Count() )
- rArr.Remove( USHORT(0), rArr.Count() );
+ rArr.Remove( sal_uInt16(0), rArr.Count() );
// dann mal ueber den Pool und alle Primary oder Secondary heraussuchen
const SwTxtTOXMark* pMark;
@@ -138,12 +139,11 @@ USHORT SwDoc::GetTOIKeys( SwTOIKeyType eTyp, SvStringsSort& rArr ) const
--------------------------------------------------------------------*/
-USHORT SwDoc::GetCurTOXMark( const SwPosition& rPos,
+sal_uInt16 SwDoc::GetCurTOXMark( const SwPosition& rPos,
SwTOXMarks& rArr ) const
{
- // suche an der Position rPos nach allen SwTOXMark's
- SwTxtNode* pTxtNd = GetNodes()[ rPos.nNode ]->GetTxtNode();
- // kein TextNode oder kein HintsArray vorhanden ??
+ // search on Position rPos for all SwTOXMarks
+ SwTxtNode *const pTxtNd = rPos.nNode.GetNode().GetTxtNode();
if( !pTxtNd || !pTxtNd->GetpSwpHints() )
return 0;
@@ -154,7 +154,7 @@ USHORT SwDoc::GetCurTOXMark( const SwPosition& rPos,
xub_StrLen nAktPos = rPos.nContent.GetIndex();
- for( USHORT n = 0; n < rHts.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rHts.Count(); ++n )
{
if( RES_TXTATR_TOXMARK != (pHt = rHts[n])->Which() )
continue;
@@ -189,14 +189,13 @@ void SwDoc::DeleteTOXMark( const SwTOXMark* pTOXMark )
SwTxtNode& rTxtNd = const_cast<SwTxtNode&>(pTxtTOXMark->GetTxtNode());
ASSERT( rTxtNd.GetpSwpHints(), "kann nicht geloescht werden" );
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- // fuers Undo die Attribute sichern
- ClearRedo();
+ // save attributes for Undo
SwUndoResetAttr* pUndo = new SwUndoResetAttr(
SwPosition( rTxtNd, SwIndex( &rTxtNd, *pTxtTOXMark->GetStart() ) ),
RES_TXTATR_TOXMARK );
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
SwRegHistory aRHst( rTxtNd, &pUndo->GetHistory() );
rTxtNd.GetpSwpHints()->Register( &aRHst );
@@ -204,7 +203,7 @@ void SwDoc::DeleteTOXMark( const SwTOXMark* pTOXMark )
rTxtNd.DeleteAttribute( const_cast<SwTxtTOXMark*>(pTxtTOXMark) );
- if ( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
if( rTxtNd.GetpSwpHints() )
rTxtNd.GetpSwpHints()->DeRegister();
@@ -218,10 +217,10 @@ void SwDoc::DeleteTOXMark( const SwTOXMark* pTOXMark )
class CompareNodeCntnt
{
- ULONG nNode;
+ sal_uLong nNode;
xub_StrLen nCntnt;
public:
- CompareNodeCntnt( ULONG nNd, xub_StrLen nCnt )
+ CompareNodeCntnt( sal_uLong nNd, xub_StrLen nCnt )
: nNode( nNd ), nCntnt( nCnt ) {}
int operator==( const CompareNodeCntnt& rCmp )
@@ -243,7 +242,7 @@ public:
};
const SwTOXMark& SwDoc::GotoTOXMark( const SwTOXMark& rCurTOXMark,
- SwTOXSearch eDir, BOOL bInReadOnly )
+ SwTOXSearch eDir, sal_Bool bInReadOnly )
{
const SwTxtTOXMark* pMark = rCurTOXMark.GetTxtTOXMark();
ASSERT(pMark, "pMark==0 Ungueltige TxtTOXMark");
@@ -273,7 +272,11 @@ const SwTOXMark& SwDoc::GotoTOXMark( const SwTOXMark& rCurTOXMark,
if( pTOXMark != &rCurTOXMark &&
0 != ( pMark = pTOXMark->GetTxtTOXMark()) &&
0 != ( pTOXSrc = pMark->GetpTxtNd() ) &&
+<<<<<<< local
0 != ( pCFrm = pTOXSrc->getLayoutFrm( GetCurrentLayout(), &aPt, 0, FALSE )) &&
+=======
+ 0 != ( pCFrm = pTOXSrc->GetFrm( &aPt, 0, sal_False )) &&
+>>>>>>> other
( bInReadOnly || !pCFrm->IsProtected() ))
{
CompareNodeCntnt aAbsNew( pTOXSrc->GetIndex(), *pMark->GetStart() );
@@ -292,12 +295,12 @@ const SwTOXMark& SwDoc::GotoTOXMark( const SwTOXMark& rCurTOXMark,
if ( (aAbsNew < aAbsIdx && aAbsNew > aPrevPos &&
aPrevPos != aAbsIdx && aAbsNew != aAbsIdx ) ||
(aAbsIdx == aAbsNew &&
- (ULONG(&rCurTOXMark) > ULONG(pTOXMark) &&
+ (sal_uLong(&rCurTOXMark) > sal_uLong(pTOXMark) &&
(!pNew ||
(pNew && (aPrevPos < aAbsIdx ||
- ULONG(pNew) < ULONG(pTOXMark)))))) ||
+ sal_uLong(pNew) < sal_uLong(pTOXMark)))))) ||
(aPrevPos == aAbsNew && aAbsIdx != aAbsNew &&
- ULONG(pTOXMark) > ULONG(pNew)) )
+ sal_uLong(pTOXMark) > sal_uLong(pNew)) )
{
pNew = pTOXMark;
aPrevPos = aAbsNew;
@@ -317,12 +320,12 @@ const SwTOXMark& SwDoc::GotoTOXMark( const SwTOXMark& rCurTOXMark,
if ( (aAbsNew > aAbsIdx && aAbsNew < aNextPos &&
aNextPos != aAbsIdx && aAbsNew != aAbsIdx ) ||
(aAbsIdx == aAbsNew &&
- (ULONG(&rCurTOXMark) < ULONG(pTOXMark) &&
+ (sal_uLong(&rCurTOXMark) < sal_uLong(pTOXMark) &&
(!pNew ||
(pNew && (aNextPos > aAbsIdx ||
- ULONG(pNew) > ULONG(pTOXMark)))))) ||
+ sal_uLong(pNew) > sal_uLong(pTOXMark)))))) ||
(aNextPos == aAbsNew && aAbsIdx != aAbsNew &&
- ULONG(pTOXMark) < ULONG(pNew)) )
+ sal_uLong(pTOXMark) < sal_uLong(pNew)) )
{
pNew = pTOXMark;
aNextPos = aAbsNew;
@@ -363,9 +366,9 @@ const SwTOXMark& SwDoc::GotoTOXMark( const SwTOXMark& rCurTOXMark,
const SwTOXBaseSection* SwDoc::InsertTableOf( const SwPosition& rPos,
const SwTOXBase& rTOX,
const SfxItemSet* pSet,
- BOOL bExpand )
+ sal_Bool bExpand )
{
- StartUndo( UNDO_INSTOX, NULL );
+ GetIDocumentUndoRedo().StartUndo( UNDO_INSTOX, NULL );
String sSectNm( rTOX.GetTOXName() );
sSectNm = GetUniqueTOXBaseName( *rTOX.GetTOXType(), &sSectNm );
@@ -407,14 +410,14 @@ sNm.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "_Head" ));
}
}
- EndUndo( UNDO_INSTOX, NULL );
+ GetIDocumentUndoRedo().EndUndo( UNDO_INSTOX, NULL );
return pNewSection;
}
-const SwTOXBaseSection* SwDoc::InsertTableOf( ULONG nSttNd, ULONG nEndNd,
+const SwTOXBaseSection* SwDoc::InsertTableOf( sal_uLong nSttNd, sal_uLong nEndNd,
const SwTOXBase& rTOX,
const SfxItemSet* pSet )
{
@@ -488,7 +491,12 @@ const SwAttrSet& SwDoc::GetTOXBaseAttrSet(const SwTOXBase& rTOXBase) const
return pFmt->GetAttrSet();
}
+<<<<<<< local
const SwTOXBase* SwDoc::GetDefaultTOXBase( TOXTypes eTyp, BOOL bCreate )
+=======
+ --------------------------------------------------*/
+const SwTOXBase* SwDoc::GetDefaultTOXBase( TOXTypes eTyp, sal_Bool bCreate )
+>>>>>>> other
{
SwTOXBase** prBase = 0;
switch(eTyp)
@@ -533,17 +541,17 @@ void SwDoc::SetDefaultTOXBase(const SwTOXBase& rBase)
--------------------------------------------------------------------*/
-BOOL SwDoc::DeleteTOX( const SwTOXBase& rTOXBase, BOOL bDelNodes )
+sal_Bool SwDoc::DeleteTOX( const SwTOXBase& rTOXBase, sal_Bool bDelNodes )
{
// its only delete the TOX, not the nodes
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
ASSERT( rTOXBase.ISA( SwTOXBaseSection ), "keine TOXBaseSection!" );
const SwTOXBaseSection& rTOXSect = (const SwTOXBaseSection&)rTOXBase;
SwSectionFmt* pFmt = rTOXSect.GetFmt();
if( pFmt )
{
- StartUndo( UNDO_CLEARTOXRANGE, NULL );
+ GetIDocumentUndoRedo().StartUndo( UNDO_CLEARTOXRANGE, NULL );
/* Save the start node of the TOX' section. */
SwSectionNode * pMyNode = pFmt->GetSectionNode();
@@ -602,8 +610,8 @@ BOOL SwDoc::DeleteTOX( const SwTOXBase& rTOXBase, BOOL bDelNodes )
if( !bDelNodes )
{
SwSections aArr( 0, 4 );
- USHORT nCnt = pFmt->GetChildSections( aArr, SORTSECT_NOT, FALSE );
- for( USHORT n = 0; n < nCnt; ++n )
+ sal_uInt16 nCnt = pFmt->GetChildSections( aArr, SORTSECT_NOT, sal_False );
+ for( sal_uInt16 n = 0; n < nCnt; ++n )
{
SwSection* pSect = aArr[ n ];
if( TOX_HEADER_SECTION == pSect->GetType() )
@@ -615,8 +623,8 @@ BOOL SwDoc::DeleteTOX( const SwTOXBase& rTOXBase, BOOL bDelNodes )
DelSectionFmt( pFmt, bDelNodes );
- EndUndo( UNDO_CLEARTOXRANGE, NULL );
- bRet = TRUE;
+ GetIDocumentUndoRedo().EndUndo( UNDO_CLEARTOXRANGE, NULL );
+ bRet = sal_True;
}
return bRet;
@@ -626,21 +634,26 @@ BOOL SwDoc::DeleteTOX( const SwTOXBase& rTOXBase, BOOL bDelNodes )
Beschreibung: Verzeichnistypen verwalten
--------------------------------------------------------------------*/
-USHORT SwDoc::GetTOXTypeCount(TOXTypes eTyp) const
+sal_uInt16 SwDoc::GetTOXTypeCount(TOXTypes eTyp) const
{
const SwTOXTypePtr * ppTTypes = pTOXTypes->GetData();
- USHORT nCnt = 0;
- for( USHORT n = 0; n < pTOXTypes->Count(); ++n, ++ppTTypes )
+ sal_uInt16 nCnt = 0;
+ for( sal_uInt16 n = 0; n < pTOXTypes->Count(); ++n, ++ppTTypes )
if( eTyp == (*ppTTypes)->GetType() )
++nCnt;
return nCnt;
}
+<<<<<<< local
const SwTOXType* SwDoc::GetTOXType( TOXTypes eTyp, USHORT nId ) const
+=======
+ --------------------------------------------------------------------*/
+const SwTOXType* SwDoc::GetTOXType( TOXTypes eTyp, sal_uInt16 nId ) const
+>>>>>>> other
{
const SwTOXTypePtr * ppTTypes = pTOXTypes->GetData();
- USHORT nCnt = 0;
- for( USHORT n = 0; n < pTOXTypes->Count(); ++n, ++ppTTypes )
+ sal_uInt16 nCnt = 0;
+ for( sal_uInt16 n = 0; n < pTOXTypes->Count(); ++n, ++ppTTypes )
if( eTyp == (*ppTTypes)->GetType() && nCnt++ == nId )
return (*ppTTypes);
return 0;
@@ -657,7 +670,7 @@ const SwTOXType* SwDoc::InsertTOXType( const SwTOXType& rTyp )
String SwDoc::GetUniqueTOXBaseName( const SwTOXType& rType,
const String* pChkStr ) const
{
- USHORT n;
+ sal_uInt16 n;
const SwSectionNode* pSectNd;
const SwSection* pSect;
@@ -666,21 +679,21 @@ String SwDoc::GetUniqueTOXBaseName( const SwTOXType& rType,
String aName( rType.GetTypeName() );
xub_StrLen nNmLen = aName.Len();
- USHORT nNum = 0;
- USHORT nTmp = 0;
- USHORT nFlagSize = ( pSectionFmtTbl->Count() / 8 ) +2;
- BYTE* pSetFlags = new BYTE[ nFlagSize ];
+ sal_uInt16 nNum = 0;
+ sal_uInt16 nTmp = 0;
+ sal_uInt16 nFlagSize = ( pSectionFmtTbl->Count() / 8 ) +2;
+ sal_uInt8* pSetFlags = new sal_uInt8[ nFlagSize ];
memset( pSetFlags, 0, nFlagSize );
for( n = 0; n < pSectionFmtTbl->Count(); ++n )
- if( 0 != ( pSectNd = (*pSectionFmtTbl)[ n ]->GetSectionNode( FALSE ) )&&
+ if( 0 != ( pSectNd = (*pSectionFmtTbl)[ n ]->GetSectionNode( sal_False ) )&&
TOX_CONTENT_SECTION == (pSect = &pSectNd->GetSection())->GetType())
{
const String& rNm = pSect->GetSectionName();
if( rNm.Match( aName ) == nNmLen )
{
// Nummer bestimmen und das Flag setzen
- nNum = (USHORT)rNm.Copy( nNmLen ).ToInt32();
+ nNum = (sal_uInt16)rNm.Copy( nNmLen ).ToInt32();
if( nNum-- && nNum < pSectionFmtTbl->Count() )
pSetFlags[ nNum / 8 ] |= (0x01 << ( nNum & 0x07 ));
}
@@ -708,14 +721,21 @@ String SwDoc::GetUniqueTOXBaseName( const SwTOXType& rType,
return aName += String::CreateFromInt32( ++nNum );
}
+<<<<<<< local
BOOL SwDoc::SetTOXBaseName(const SwTOXBase& rTOXBase, const String& rName)
+=======
+/*--------------------------------------------------------------------
+
+ --------------------------------------------------------------------*/
+sal_Bool SwDoc::SetTOXBaseName(const SwTOXBase& rTOXBase, const String& rName)
+>>>>>>> other
{
ASSERT( rTOXBase.ISA( SwTOXBaseSection ),
"keine TOXBaseSection!" );
SwTOXBaseSection* pTOX = (SwTOXBaseSection*)&rTOXBase;
String sTmp = GetUniqueTOXBaseName(*rTOXBase.GetTOXType(), &rName);
- BOOL bRet = sTmp == rName;
+ sal_Bool bRet = sTmp == rName;
if(bRet)
{
pTOX->SetTOXName(rName);
@@ -726,7 +746,7 @@ BOOL SwDoc::SetTOXBaseName(const SwTOXBase& rTOXBase, const String& rName)
}
-const SwTxtNode* lcl_FindChapterNode( const SwNode& rNd, BYTE nLvl = 0 )
+const SwTxtNode* lcl_FindChapterNode( const SwNode& rNd, sal_uInt8 nLvl = 0 )
{
const SwNode* pNd = &rNd;
if( pNd->GetNodes().GetEndOfExtras().GetIndex() > pNd->GetIndex() )
@@ -734,7 +754,7 @@ const SwTxtNode* lcl_FindChapterNode( const SwNode& rNd, BYTE nLvl = 0 )
// then find the "Anchor" (Body) position
Point aPt;
SwNode2Layout aNode2Layout( *pNd, pNd->GetIndex() );
- const SwFrm* pFrm = aNode2Layout.GetFrm( &aPt, 0, FALSE );
+ const SwFrm* pFrm = aNode2Layout.GetFrm( &aPt, 0, sal_False );
if( pFrm )
{
@@ -765,9 +785,9 @@ SwTOXBaseSection::~SwTOXBaseSection()
}
-BOOL SwTOXBaseSection::SetPosAtStartEnd( SwPosition& rPos, BOOL bAtStart ) const
+sal_Bool SwTOXBaseSection::SetPosAtStartEnd( SwPosition& rPos, sal_Bool bAtStart ) const
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
const SwSectionNode* pSectNd = GetFmt()->GetSectionNode();
if( pSectNd )
{
@@ -785,7 +805,7 @@ BOOL SwTOXBaseSection::SetPosAtStartEnd( SwPosition& rPos, BOOL bAtStart ) const
if( pCNd ) nC = pCNd->Len();
}
rPos.nContent.Assign( pCNd, nC );
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
}
@@ -822,7 +842,7 @@ void SwTOXBaseSection::Update(const SfxItemSet* pAttr,
// determine page description of table-of-content
sal_uInt32 nPgDescNdIdx = pSectNd->GetIndex() + 1;
sal_uInt32* pPgDescNdIdx = &nPgDescNdIdx;
- pDefaultPageDesc = pSectNd->FindPageDesc( FALSE, pPgDescNdIdx );
+ pDefaultPageDesc = pSectNd->FindPageDesc( sal_False, pPgDescNdIdx );
if ( nPgDescNdIdx < pSectNd->GetIndex() )
{
pDefaultPageDesc = 0;
@@ -844,7 +864,7 @@ void SwTOXBaseSection::Update(const SfxItemSet* pAttr,
eBreak == SVX_BREAK_PAGE_BOTH )
)
{
- pDefaultPageDesc = pNdAfterTOX->FindPageDesc( FALSE );
+ pDefaultPageDesc = pNdAfterTOX->FindPageDesc( sal_False );
}
}
// OD 28.04.2003 #109166# - consider start node of content section in
@@ -857,7 +877,7 @@ void SwTOXBaseSection::Update(const SfxItemSet* pAttr,
// determine page description of content before table-of-content
SwNodeIndex aIdx( *pSectNd );
pDefaultPageDesc =
- pSectNd->GetNodes().GoPrevious( &aIdx )->FindPageDesc( FALSE );
+ pSectNd->GetNodes().GoPrevious( &aIdx )->FindPageDesc( sal_False );
}
if ( !pDefaultPageDesc )
@@ -913,7 +933,7 @@ void SwTOXBaseSection::Update(const SfxItemSet* pAttr,
}
aEndIdx--;
SwPosition aPos( aEndIdx, SwIndex( pFirstEmptyNd, 0 ));
- pDoc->CorrAbs( aSttIdx, aEndIdx, aPos, TRUE );
+ pDoc->CorrAbs( aSttIdx, aEndIdx, aPos, sal_True );
// delete all before
DelFlyInRange( aSttIdx, aEndIdx );
@@ -990,9 +1010,9 @@ sNm.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "_Head" ));
// sortierte Liste aller Verzeichnismarken und Verzeichnisbereiche
void* p = 0;
String* pStr = 0;
- USHORT nCnt = 0, nFormMax = GetTOXForm().GetFormMax();
- SvStringsDtor aStrArr( (BYTE)nFormMax );
- SvPtrarr aCollArr( (BYTE)nFormMax );
+ sal_uInt16 nCnt = 0, nFormMax = GetTOXForm().GetFormMax();
+ SvStringsDtor aStrArr( (sal_uInt8)nFormMax );
+ SvPtrarr aCollArr( (sal_uInt8)nFormMax );
for( ; nCnt < nFormMax; ++nCnt )
{
aCollArr.Insert( p, nCnt );
@@ -1005,7 +1025,7 @@ sNm.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "_Head" ));
::SetProgressState( 0, pDoc->GetDocShell() );
// setze den Text in das Verzeichniss
- USHORT nLvl = aSortArr[ nCnt ]->GetLevel();
+ sal_uInt16 nLvl = aSortArr[ nCnt ]->GetLevel();
SwTxtFmtColl* pColl = (SwTxtFmtColl*)aCollArr[ nLvl ];
if( !pColl )
{
@@ -1023,7 +1043,7 @@ sNm.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "_Head" ));
// fuer die Seitennummer eintragen
//if it is a TOX_INDEX and the SwForm IsCommaSeparated()
// then a range of entries must be generated into one paragraph
- USHORT nRange = 1;
+ sal_uInt16 nRange = 1;
if(TOX_INDEX == SwTOXBase::GetType() &&
GetTOXForm().IsCommaSeparated() &&
aSortArr[nCnt]->GetType() == TOX_SORT_INDEX)
@@ -1053,7 +1073,7 @@ sNm.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "_Head" ));
if( !aCorPam.Move( fnMoveForward ) )
aCorPam.Move( fnMoveBackward );
SwNodeIndex aEndIdx( aInsPos, 1 );
- pDoc->CorrAbs( aInsPos, aEndIdx, *aCorPam.GetPoint(), TRUE );
+ pDoc->CorrAbs( aInsPos, aEndIdx, *aCorPam.GetPoint(), sal_True );
// Task 70995 - save and restore PageDesc and Break Attributes
if( pFirstEmptyNd->HasSwAttrSet() )
@@ -1069,7 +1089,7 @@ sNm.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "_Head" ));
}
// now create the new Frames
- ULONG nIdx = pSectNd->GetIndex();
+ sal_uLong nIdx = pSectNd->GetIndex();
// don't delete if index is empty
if(nIdx + 2 < pSectNd->EndOfSectionIndex())
pDoc->GetNodes().Delete( aInsPos, 1 );
@@ -1093,12 +1113,12 @@ void SwTOXBaseSection::InsertAlphaDelimitter( const SwTOXInternational& rIntl )
{
SwDoc* pDoc = (SwDoc*)GetFmt()->GetDoc();
String sDeli, sLastDeli;
- USHORT i = 0;
+ sal_uInt16 i = 0;
while( i < aSortArr.Count() )
{
::SetProgressState( 0, pDoc->GetDocShell() );
- USHORT nLevel = aSortArr[i]->GetLevel();
+ sal_uInt16 nLevel = aSortArr[i]->GetLevel();
// Alpha-Delimitter ueberlesen
if( nLevel == FORM_ALPHA_DELIMITTER )
@@ -1134,14 +1154,14 @@ void SwTOXBaseSection::InsertAlphaDelimitter( const SwTOXInternational& rIntl )
Beschreibung: Template auswerten
--------------------------------------------------------------------*/
-SwTxtFmtColl* SwTOXBaseSection::GetTxtFmtColl( USHORT nLevel )
+SwTxtFmtColl* SwTOXBaseSection::GetTxtFmtColl( sal_uInt16 nLevel )
{
SwDoc* pDoc = (SwDoc*)GetFmt()->GetDoc();
const String& rName = GetTOXForm().GetTemplate( nLevel );
SwTxtFmtColl* pColl = rName.Len() ? pDoc->FindTxtFmtCollByName(rName) :0;
if( !pColl )
{
- USHORT nPoolFmt = 0;
+ sal_uInt16 nPoolFmt = 0;
const TOXTypes eMyType = SwTOXBase::GetType();
switch( eMyType )
{
@@ -1270,14 +1290,20 @@ void SwTOXBaseSection::UpdateOutline( const SwTxtNode* pOwnChapterNode )
SwNodes& rNds = pDoc->GetNodes();
const SwOutlineNodes& rOutlNds = rNds.GetOutLineNds();
- for( USHORT n = 0; n < rOutlNds.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rOutlNds.Count(); ++n )
{
::SetProgressState( 0, pDoc->GetDocShell() );
SwTxtNode* pTxtNd = rOutlNds[ n ]->GetTxtNode();
if( pTxtNd && pTxtNd->Len() && pTxtNd->GetDepends() &&
+<<<<<<< local
//USHORT(pTxtNd->GetTxtColl()->GetOutlineLevel()+1) <= GetLevel() && //#outline level,zhaojianwei
USHORT( pTxtNd->GetAttrOutlineLevel()) <= GetLevel() && //<-end,zhaojianwei
pTxtNd->getLayoutFrm( pDoc->GetCurrentLayout() ) &&
+=======
+ //sal_uInt16(pTxtNd->GetTxtColl()->GetOutlineLevel()+1) <= GetLevel() && //#outline level,zhaojianwei
+ sal_uInt16( pTxtNd->GetAttrOutlineLevel()) <= GetLevel() && //<-end,zhaojianwei
+ pTxtNd->GetFrm() &&
+>>>>>>> other
!pTxtNd->HasHiddenParaField() &&
!pTxtNd->HasHiddenCharAttribute( true ) &&
( !IsFromChapter() ||
@@ -1296,11 +1322,11 @@ void SwTOXBaseSection::UpdateOutline( const SwTxtNode* pOwnChapterNode )
void SwTOXBaseSection::UpdateTemplate( const SwTxtNode* pOwnChapterNode )
{
SwDoc* pDoc = (SwDoc*)GetFmt()->GetDoc();
- for(USHORT i = 0; i < MAXLEVEL; i++)
+ for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
{
String sTmpStyleNames = GetStyleNames(i);
- USHORT nTokenCount = sTmpStyleNames.GetTokenCount(TOX_STYLE_DELIMITER);
- for( USHORT nStyle = 0; nStyle < nTokenCount; ++nStyle )
+ sal_uInt16 nTokenCount = sTmpStyleNames.GetTokenCount(TOX_STYLE_DELIMITER);
+ for( sal_uInt16 nStyle = 0; nStyle < nTokenCount; ++nStyle )
{
SwTxtFmtColl* pColl = pDoc->FindTxtFmtCollByName(
sTmpStyleNames.GetToken( nStyle,
@@ -1415,9 +1441,9 @@ long lcl_IsSOObject( const SvGlobalName& rFactoryNm )
long nFlag;
// GlobalNameId
struct _GlobalNameIds {
- UINT32 n1;
- USHORT n2, n3;
- BYTE b8, b9, b10, b11, b12, b13, b14, b15;
+ sal_uInt32 n1;
+ sal_uInt16 n2, n3;
+ sal_uInt8 b8, b9, b10, b11, b12, b13, b14, b15;
} aGlNmIds[4];
} aArr[] = {
{ nsSwTOOElements::TOO_MATH,
@@ -1464,7 +1490,7 @@ void SwTOXBaseSection::UpdateCntnt( SwTOXElement eMyType,
SwDoc* pDoc = (SwDoc*)GetFmt()->GetDoc();
SwNodes& rNds = pDoc->GetNodes();
// auf den 1. Node der 1. Section
- ULONG nIdx = rNds.GetEndOfAutotext().StartOfSectionIndex() + 2,
+ sal_uLong nIdx = rNds.GetEndOfAutotext().StartOfSectionIndex() + 2,
nEndIdx = rNds.GetEndOfAutotext().GetIndex();
while( nIdx < nEndIdx )
@@ -1493,7 +1519,7 @@ void SwTOXBaseSection::UpdateCntnt( SwTOXElement eMyType,
case nsSwTOXElement::TOX_OLE:
if( pNd->IsOLENode() )
{
- BOOL bInclude = TRUE;
+ sal_Bool bInclude = sal_True;
if(TOX_OBJECTS == SwTOXBase::GetType())
{
SwOLENode* pOLENode = pNd->GetOLENode();
@@ -1510,7 +1536,7 @@ void SwTOXBaseSection::UpdateCntnt( SwTOXElement eMyType,
else
{
DBG_ERROR("OLE-object nicht geladen?");
- bInclude = FALSE;
+ bInclude = sal_False;
}
}
@@ -1536,7 +1562,7 @@ void SwTOXBaseSection::UpdateCntnt( SwTOXElement eMyType,
MAXLEVEL - 1 );
if( pOutlNd )
{
- //USHORT nTmp = pOutlNd->GetTxtColl()->GetOutlineLevel();//#outline level,zhaojianwei
+ //sal_uInt16 nTmp = pOutlNd->GetTxtColl()->GetOutlineLevel();//#outline level,zhaojianwei
//if( nTmp < NO_NUMBERING )
// nSetLevel = nTmp + 1;
if( pOutlNd->GetTxtColl()->IsAssignedToListLevelOfOutlineStyle())
@@ -1549,7 +1575,7 @@ void SwTOXBaseSection::UpdateCntnt( SwTOXElement eMyType,
{
SwTOXPara * pNew = new SwTOXPara( *pCNd, eMyType,
( USHRT_MAX != nSetLevel )
- ? static_cast<USHORT>(nSetLevel)
+ ? static_cast<sal_uInt16>(nSetLevel)
: FORM_ALPHA_DELIMITTER );
InsertSorted( pNew );
}
@@ -1569,7 +1595,7 @@ void SwTOXBaseSection::UpdateTable( const SwTxtNode* pOwnChapterNode )
SwNodes& rNds = pDoc->GetNodes();
const SwFrmFmts& rArr = *pDoc->GetTblFrmFmts();
- for( USHORT n = 0; n < rArr.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rArr.Count(); ++n )
{
::SetProgressState( 0, pDoc->GetDocShell() );
@@ -1595,13 +1621,13 @@ void SwTOXBaseSection::UpdateTable( const SwTxtNode* pOwnChapterNode )
::lcl_FindChapterNode( *pCNd, MAXLEVEL - 1 );
if( pOutlNd )
{
- //USHORT nTmp = pOutlNd->GetTxtColl()->GetOutlineLevel();//#outline level,zhaojianwei
+ //sal_uInt16 nTmp = pOutlNd->GetTxtColl()->GetOutlineLevel();//#outline level,zhaojianwei
//if( nTmp < NO_NUMBERING )
// pNew->SetLevel( nTmp + 1 );
if( pOutlNd->GetTxtColl()->IsAssignedToListLevelOfOutlineStyle())
{
const int nTmp = pOutlNd->GetTxtColl()->GetAttrOutlineLevel();
- pNew->SetLevel( static_cast<USHORT>(nTmp) );//<-end ,zhaojianwei
+ pNew->SetLevel( static_cast<sal_uInt16>(nTmp) );//<-end ,zhaojianwei
}
}
}
@@ -1618,7 +1644,7 @@ void SwTOXBaseSection::UpdateTable( const SwTxtNode* pOwnChapterNode )
SonderZeichen 0-31 und 255 entfernen
--------------------------------------------------------------------*/
-String lcl_GetNumString( const SwTOXSortTabBase& rBase, sal_Bool bUsePrefix, BYTE nLevel )
+String lcl_GetNumString( const SwTOXSortTabBase& rBase, sal_Bool bUsePrefix, sal_uInt8 nLevel )
{
String sRet;
@@ -1638,8 +1664,8 @@ String lcl_GetNumString( const SwTOXSortTabBase& rBase, sal_Bool bUsePrefix, BYT
// OD 18.03.2003 #106329# - add parameter <_TOXSectNdIdx> and <_pDefaultPageDesc>
// in order to control, which page description is used, no appropriate one is found.
-void SwTOXBaseSection::GenerateText( USHORT nArrayIdx,
- USHORT nCount,
+void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx,
+ sal_uInt16 nCount,
SvStringsDtor& ,
const sal_uInt32 _nTOXSectNdIdx,
const SwPageDesc* _pDefaultPageDesc )
@@ -1652,13 +1678,13 @@ void SwTOXBaseSection::GenerateText( USHORT nArrayIdx,
SwTxtNode* pTOXNd = (SwTxtNode*)aSortArr[nArrayIdx]->pTOXNd;
String& rTxt = (String&)pTOXNd->GetTxt();
rTxt.Erase();
- for(USHORT nIndex = nArrayIdx; nIndex < nArrayIdx + nCount; nIndex++)
+ for(sal_uInt16 nIndex = nArrayIdx; nIndex < nArrayIdx + nCount; nIndex++)
{
if(nIndex > nArrayIdx)
rTxt.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ", " )); // comma separation
// String mit dem Pattern aus der Form initialisieren
const SwTOXSortTabBase& rBase = *aSortArr[nIndex];
- USHORT nLvl = rBase.GetLevel();
+ sal_uInt16 nLvl = rBase.GetLevel();
ASSERT( nLvl < GetTOXForm().GetFormMax(), "ungueltiges FORM_LEVEL");
SvxTabStopItem aTStops( 0, 0, SVX_TAB_ADJUST_DEFAULT, RES_PARATR_TABSTOP );
@@ -1678,7 +1704,7 @@ void SwTOXBaseSection::GenerateText( USHORT nArrayIdx,
{
case TOKEN_ENTRY_NO:
// fuer Inhaltsverzeichnis Numerierung
- rTxt.Insert( lcl_GetNumString( rBase, aToken.nChapterFormat == CF_NUMBER, static_cast<BYTE>(aToken.nOutlineLevel - 1)) );
+ rTxt.Insert( lcl_GetNumString( rBase, aToken.nChapterFormat == CF_NUMBER, static_cast<sal_uInt8>(aToken.nOutlineLevel - 1)) );
break;
case TOKEN_ENTRY_TEXT:
@@ -1707,7 +1733,7 @@ void SwTOXBaseSection::GenerateText( USHORT nArrayIdx,
{
const SvxLRSpaceItem& rLR =
(SvxLRSpaceItem&)pTOXNd->
- SwCntntNode::GetAttr( RES_LR_SPACE, TRUE );
+ SwCntntNode::GetAttr( RES_LR_SPACE, sal_True );
long nTabPosition = aToken.nTabStopPosition;
if( !GetTOXForm().IsRelTabPos() && rLR.GetTxtLeft() )
@@ -1722,20 +1748,24 @@ void SwTOXBaseSection::GenerateText( USHORT nArrayIdx,
const SwPageDesc* pPageDesc = ((SwFmtPageDesc&)pTOXNd->
SwCntntNode::GetAttr( RES_PAGEDESC )).GetPageDesc();
- BOOL bCallFindRect = TRUE;
+ sal_Bool bCallFindRect = sal_True;
long nRightMargin;
if( pPageDesc )
{
+<<<<<<< local
const SwFrm* pFrm = pTOXNd->getLayoutFrm( pDoc->GetCurrentLayout(), 0, 0, TRUE );
+=======
+ const SwFrm* pFrm = pTOXNd->GetFrm( 0, 0, sal_True );
+>>>>>>> other
if( !pFrm || 0 == ( pFrm = pFrm->FindPageFrm() ) ||
pPageDesc != ((SwPageFrm*)pFrm)->GetPageDesc() )
// dann muss man ueber den PageDesc gehen
- bCallFindRect = FALSE;
+ bCallFindRect = sal_False;
}
SwRect aNdRect;
if( bCallFindRect )
- aNdRect = pTOXNd->FindLayoutRect( TRUE );
+ aNdRect = pTOXNd->FindLayoutRect( sal_True );
if( aNdRect.IsEmpty() )
{
@@ -1744,7 +1774,7 @@ void SwTOXBaseSection::GenerateText( USHORT nArrayIdx,
// OD 18.03.2003 #106329# - call
sal_uInt32 nPgDescNdIdx = pTOXNd->GetIndex() + 1;
sal_uInt32* pPgDescNdIdx = &nPgDescNdIdx;
- pPageDesc = pTOXNd->FindPageDesc( FALSE, pPgDescNdIdx );
+ pPageDesc = pTOXNd->FindPageDesc( sal_False, pPgDescNdIdx );
if ( !pPageDesc ||
*pPgDescNdIdx < _nTOXSectNdIdx )
{
@@ -1786,11 +1816,11 @@ void SwTOXBaseSection::GenerateText( USHORT nArrayIdx,
{
// Die Anzahl der gleichen Eintrage bestimmt die Seitennummern-Pattern
//
- USHORT nSize = rBase.aTOXSources.Count();
+ sal_uInt16 nSize = rBase.aTOXSources.Count();
if( nSize > 0 )
{
String aInsStr( cNumRepl );
- for(USHORT i=1; i < nSize; ++i)
+ for(sal_uInt16 i=1; i < nSize; ++i)
{
aInsStr.AppendAscii( sPageDeli );
aInsStr += cNumRepl;
@@ -1823,12 +1853,12 @@ void SwTOXBaseSection::GenerateText( USHORT nArrayIdx,
{
SwChapterFieldType aFldTyp;
SwChapterField aFld( &aFldTyp, aToken.nChapterFormat );
- aFld.SetLevel( static_cast<BYTE>(aToken.nOutlineLevel - 1) );
+ aFld.SetLevel( static_cast<sal_uInt8>(aToken.nOutlineLevel - 1) );
// --> OD 2008-02-14 #i53420#
-// aFld.ChangeExpansion( pFrm, (SwTxtNode*)pTOXSource->pNd, TRUE );
+// aFld.ChangeExpansion( pFrm, (SwTxtNode*)pTOXSource->pNd, sal_True );
aFld.ChangeExpansion( pFrm,
dynamic_cast<const SwCntntNode*>(pTOXSource->pNd),
- TRUE );
+ sal_True );
// <--
//---> i89791
// OD 2008-06-26 - continue to support CF_NUMBER
@@ -1878,7 +1908,7 @@ void SwTOXBaseSection::GenerateText( USHORT nArrayIdx,
pNewLink->aINetFmt.SetINetFmt(sLinkCharacterStyle);
if(sLinkCharacterStyle.Len())
{
- USHORT nPoolId =
+ sal_uInt16 nPoolId =
SwStyleNameMapper::GetPoolIdFromUIName( sLinkCharacterStyle, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT );
pNewLink->aINetFmt.SetVisitedFmtId(nPoolId);
pNewLink->aINetFmt.SetINetFmtId(nPoolId);
@@ -1898,7 +1928,7 @@ void SwTOXBaseSection::GenerateText( USHORT nArrayIdx,
{
ToxAuthorityField eField = (ToxAuthorityField)aToken.nAuthorityField;
SwIndex aIdx( pTOXNd, rTxt.Len() );
- rBase.FillText( *pTOXNd, aIdx, static_cast<USHORT>(eField) );
+ rBase.FillText( *pTOXNd, aIdx, static_cast<sal_uInt16>(eField) );
}
break;
case TOKEN_END: break;
@@ -1927,7 +1957,7 @@ void SwTOXBaseSection::GenerateText( USHORT nArrayIdx,
}
if(aLinkArr.Count())
- for(USHORT i = 0; i < aLinkArr.Count(); ++i )
+ for(sal_uInt16 i = 0; i < aLinkArr.Count(); ++i )
{
LinkStruct* pTmp = aLinkArr.GetObject(i);
pTOXNd->InsertItem( pTmp->aINetFmt, pTmp->nStartTextPos,
@@ -1947,7 +1977,7 @@ void SwTOXBaseSection::UpdatePageNum()
// die aktuellen Seitennummern ins Verzeichnis eintragen
SwPageFrm* pAktPage = 0;
- USHORT nPage = 0;
+ sal_uInt16 nPage = 0;
SwDoc* pDoc = (SwDoc*)GetFmt()->GetDoc();
SwTOXInternational aIntl( GetLanguage(),
@@ -1955,7 +1985,7 @@ void SwTOXBaseSection::UpdatePageNum()
GetOptions() : 0,
GetSortAlgorithm() );
- for( USHORT nCnt = 0; nCnt < aSortArr.Count(); ++nCnt )
+ for( sal_uInt16 nCnt = 0; nCnt < aSortArr.Count(); ++nCnt )
{
// Schleife ueber alle SourceNodes
SvUShorts aNums; //Die Seitennummern
@@ -1963,7 +1993,7 @@ void SwTOXBaseSection::UpdatePageNum()
SvUShorts* pMainNums = 0; // contains page numbers of main entries
// process run in lines
- USHORT nRange = 0;
+ sal_uInt16 nRange = 0;
if(GetTOXForm().IsCommaSeparated() &&
aSortArr[nCnt]->GetType() == TOX_SORT_INDEX)
{
@@ -1981,12 +2011,12 @@ void SwTOXBaseSection::UpdatePageNum()
else
nRange = 1;
- for(USHORT nRunInEntry = nCnt; nRunInEntry < nCnt + nRange; nRunInEntry++)
+ for(sal_uInt16 nRunInEntry = nCnt; nRunInEntry < nCnt + nRange; nRunInEntry++)
{
SwTOXSortTabBase* pSortBase = aSortArr[nRunInEntry];
- USHORT nSize = pSortBase->aTOXSources.Count();
- USHORT i;
- for( USHORT j = 0; j < nSize; ++j )
+ sal_uInt16 nSize = pSortBase->aTOXSources.Count();
+ sal_uInt16 i;
+ for( sal_uInt16 j = 0; j < nSize; ++j )
{
::SetProgressState( 0, pDoc->GetDocShell() );
@@ -2057,12 +2087,12 @@ void SwTOXBaseSection::UpdatePageNum()
--------------------------------------------------------------------*/
// search for the page no in the array of main entry page numbers
-BOOL lcl_HasMainEntry( const SvUShorts* pMainEntryNums, USHORT nToFind )
+sal_Bool lcl_HasMainEntry( const SvUShorts* pMainEntryNums, sal_uInt16 nToFind )
{
- for(USHORT i = 0; pMainEntryNums && i < pMainEntryNums->Count(); ++i)
+ for(sal_uInt16 i = 0; pMainEntryNums && i < pMainEntryNums->Count(); ++i)
if(nToFind == (*pMainEntryNums)[i])
- return TRUE;
- return FALSE;
+ return sal_True;
+ return sal_False;
}
void SwTOXBaseSection::_UpdatePageNum( SwTxtNode* pNd,
@@ -2079,7 +2109,7 @@ void SwTOXBaseSection::_UpdatePageNum( SwTxtNode* pNd,
xub_StrLen nStartPos = pNd->GetTxt().Search( sSrchStr );
( sSrchStr = cNumRepl ) += cEndPageNum;
xub_StrLen nEndPos = pNd->GetTxt().Search( sSrchStr );
- USHORT i;
+ sal_uInt16 i;
if( STRING_NOTFOUND == nEndPos || !rNums.Count() )
return;
@@ -2087,14 +2117,14 @@ void SwTOXBaseSection::_UpdatePageNum( SwTxtNode* pNd,
if( STRING_NOTFOUND == nStartPos || nStartPos > nEndPos)
nStartPos = nEndPos;
- USHORT nOld = rNums[0],
+ sal_uInt16 nOld = rNums[0],
nBeg = nOld,
nCount = 0;
String aNumStr( SvxNumberType( ((SwPageDesc*)rDescs[0])->GetNumType() ).
GetNumStr( nBeg ) );
if( pCharStyleIdx && lcl_HasMainEntry( pMainEntryNums, nBeg ))
{
- USHORT nTemp = 0;
+ sal_uInt16 nTemp = 0;
pCharStyleIdx->Insert( nTemp, pCharStyleIdx->Count());
}
@@ -2103,7 +2133,7 @@ void SwTOXBaseSection::_UpdatePageNum( SwTxtNode* pNd,
SwCharFmt* pPageNoCharFmt = 0;
SwpHints* pHints = pNd->GetpSwpHints();
if(pHints)
- for(USHORT nHintIdx = 0; nHintIdx < pHints->GetStartCount(); nHintIdx++)
+ for(sal_uInt16 nHintIdx = 0; nHintIdx < pHints->GetStartCount(); nHintIdx++)
{
SwTxtAttr* pAttr = pHints->GetStart(nHintIdx);
xub_StrLen nTmpEnd = pAttr->GetEnd() ? *pAttr->GetEnd() : 0;
@@ -2125,7 +2155,7 @@ void SwTOXBaseSection::_UpdatePageNum( SwTxtNode* pNd,
// Alle folgenden aufaddieren
// break up if main entry starts or ends and
// insert a char style index
- BOOL bMainEntryChanges = lcl_HasMainEntry(pMainEntryNums, nOld)
+ sal_Bool bMainEntryChanges = lcl_HasMainEntry(pMainEntryNums, nOld)
!= lcl_HasMainEntry(pMainEntryNums, rNums[i]);
if(nOld == rNums[i]-1 && !bMainEntryChanges &&
@@ -2164,7 +2194,7 @@ void SwTOXBaseSection::_UpdatePageNum( SwTxtNode* pNd,
}
else
{ // Alle Nummern eintragen
- aNumStr += aType.GetNumStr( USHORT(rNums[i]) );
+ aNumStr += aType.GetNumStr( sal_uInt16(rNums[i]) );
if(i != (rNums.Count()-1))
aNumStr.AppendAscii( sPageDeli );
}
@@ -2208,7 +2238,7 @@ void SwTOXBaseSection::_UpdatePageNum( SwTxtNode* pNd,
//search by name
SwDoc* pDoc = pNd->GetDoc();
- USHORT nPoolId = SwStyleNameMapper::GetPoolIdFromUIName( GetMainEntryCharStyle(), nsSwGetPoolIdFromName::GET_POOLID_CHRFMT );
+ sal_uInt16 nPoolId = SwStyleNameMapper::GetPoolIdFromUIName( GetMainEntryCharStyle(), nsSwGetPoolIdFromName::GET_POOLID_CHRFMT );
SwCharFmt* pCharFmt = 0;
if(USHRT_MAX != nPoolId)
pCharFmt = pDoc->GetCharFmtFromPool(nPoolId);
@@ -2220,7 +2250,7 @@ void SwTOXBaseSection::_UpdatePageNum( SwTxtNode* pNd,
//find the page numbers in aNumStr and set the character style
xub_StrLen nOffset = pNd->GetTxt().Len() - aNumStr.Len();
SwFmtCharFmt aCharFmt(pCharFmt);
- for(USHORT j = 0; j < pCharStyleIdx->Count(); j += 2)
+ for(sal_uInt16 j = 0; j < pCharStyleIdx->Count(); j += 2)
{
xub_StrLen nStartIdx = (*pCharStyleIdx)[j] + nOffset;
xub_StrLen nEndIdx = (*pCharStyleIdx)[j + 1] + nOffset;
@@ -2334,7 +2364,7 @@ void SwTOXBaseSection::InsertSorted(SwTOXSortTabBase* pNew)
Range SwTOXBaseSection::GetKeyRange(const String& rStr, const String& rStrReading,
const SwTOXSortTabBase& rNew,
- USHORT nLevel, const Range& rRange )
+ sal_uInt16 nLevel, const Range& rRange )
{
const SwTOXInternational& rIntl = *rNew.pTOXIntl;
String sToCompare(rStr);
@@ -2348,10 +2378,10 @@ Range SwTOXBaseSection::GetKeyRange(const String& rStr, const String& rStrReadin
ASSERT(rRange.Min() >= 0 && rRange.Max() >= 0, "Min Max < 0");
- const USHORT nMin = (USHORT)rRange.Min();
- const USHORT nMax = (USHORT)rRange.Max();
+ const sal_uInt16 nMin = (sal_uInt16)rRange.Min();
+ const sal_uInt16 nMax = (sal_uInt16)rRange.Max();
- USHORT i;
+ sal_uInt16 i;
for( i = nMin; i < nMax; ++i)
{
@@ -2377,8 +2407,8 @@ Range SwTOXBaseSection::GetKeyRange(const String& rStr, const String& rStrReadin
}
aSortArr.Insert(pKey, i );
}
- USHORT nStart = i+1;
- USHORT nEnd = aSortArr.Count();
+ sal_uInt16 nStart = i+1;
+ sal_uInt16 nEnd = aSortArr.Count();
// Ende des Bereiches suchen
for(i = nStart; i < aSortArr.Count(); ++i)
@@ -2392,10 +2422,10 @@ Range SwTOXBaseSection::GetKeyRange(const String& rStr, const String& rStrReadin
}
-BOOL SwTOXBase::IsTOXBaseInReadonly() const
+sal_Bool SwTOXBase::IsTOXBaseInReadonly() const
{
const SwTOXBaseSection *pSect = PTR_CAST(SwTOXBaseSection, this);
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
const SwSectionNode* pSectNode;
if(pSect && pSect->GetFmt() &&
0 != (pSectNode = pSect->GetFmt()->GetSectionNode()))
@@ -2425,7 +2455,7 @@ void SwTOXBase::SetAttrSet( const SfxItemSet& rSet )
pSect->GetFmt()->SetFmtAttr( rSet );
}
-BOOL SwTOXBase::GetInfo( SfxPoolItem& rInfo ) const
+sal_Bool SwTOXBase::GetInfo( SfxPoolItem& rInfo ) const
{
switch( rInfo.Which() )
{
@@ -2435,8 +2465,8 @@ BOOL SwTOXBase::GetInfo( SfxPoolItem& rInfo ) const
if( pSect && pSect->GetFmt() )
pSect->GetFmt()->GetInfo( rInfo );
}
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
diff --git a/sw/source/core/doc/extinput.cxx b/sw/source/core/doc/extinput.cxx
index f627870932f9..93d177aed548 100644
--- a/sw/source/core/doc/extinput.cxx
+++ b/sw/source/core/doc/extinput.cxx
@@ -28,19 +28,23 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <com/sun/star/i18n/ScriptType.hpp>
+
+#include <editeng/langitem.hxx>
+#include <editeng/scripttypeitem.hxx>
-#include <hintids.hxx>
#include <vcl/keycodes.hxx>
#include <vcl/cmdevt.hxx>
+
+#include <hintids.hxx>
#include <extinput.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <index.hxx>
#include <ndtxt.hxx>
#include <txtfrm.hxx>
#include <swundo.hxx>
-#include <editeng/langitem.hxx>
-#include <editeng/scripttypeitem.hxx>
-#include <com/sun/star/i18n/ScriptType.hpp>
+
using namespace ::com::sun::star;
@@ -48,8 +52,8 @@ SwExtTextInput::SwExtTextInput( const SwPaM& rPam, Ring* pRing )
: SwPaM( *rPam.GetPoint(), (SwPaM*)pRing ),
eInputLanguage(LANGUAGE_DONTKNOW)
{
- bIsOverwriteCursor = FALSE;
- bInsText = TRUE;
+ bIsOverwriteCursor = sal_False;
+ bInsText = sal_True;
}
SwExtTextInput::~SwExtTextInput()
@@ -78,7 +82,7 @@ SwExtTextInput::~SwExtTextInput()
// for CJK/CTL scripts.
bool bLang = true;
// <--
- USHORT nWhich = RES_CHRATR_LANGUAGE;
+ sal_uInt16 nWhich = RES_CHRATR_LANGUAGE;
switch(GetI18NScriptTypeOfLanguage(eInputLanguage))
{
case i18n::ScriptType::ASIAN: nWhich = RES_CHRATR_CJK_LANGUAGE; break;
@@ -106,12 +110,14 @@ SwExtTextInput::~SwExtTextInput()
if( bInsText )
{
rIdx = nSttCnt;
- pDoc->StartUndo( UNDO_OVERWRITE, NULL );
+ pDoc->GetIDocumentUndoRedo().StartUndo(
+ UNDO_OVERWRITE, NULL );
pDoc->Overwrite( *this, sTxt.Copy( 0,
sOverwriteText.Len() ));
pDoc->InsertString( *this,
sTxt.Copy( sOverwriteText.Len() ) );
- pDoc->EndUndo( UNDO_OVERWRITE, NULL );
+ pDoc->GetIDocumentUndoRedo().EndUndo(
+ UNDO_OVERWRITE, NULL );
}
}
else
@@ -205,7 +211,7 @@ void SwExtTextInput::SetInputData( const CommandExtTextInputData& rData )
}
}
-void SwExtTextInput::SetOverwriteCursor( BOOL bFlag )
+void SwExtTextInput::SetOverwriteCursor( sal_Bool bFlag )
{
bIsOverwriteCursor = bFlag;
@@ -258,17 +264,17 @@ SwExtTextInput* SwDoc::GetExtTextInput( const SwNode& rNd,
SwExtTextInput* pRet = 0;
if( pExtInputRing )
{
- ULONG nNdIdx = rNd.GetIndex();
+ sal_uLong nNdIdx = rNd.GetIndex();
SwExtTextInput* pTmp = (SwExtTextInput*)pExtInputRing;
do {
- ULONG nPt = pTmp->GetPoint()->nNode.GetIndex(),
+ sal_uLong nPt = pTmp->GetPoint()->nNode.GetIndex(),
nMk = pTmp->GetMark()->nNode.GetIndex();
xub_StrLen nPtCnt = pTmp->GetPoint()->nContent.GetIndex(),
nMkCnt = pTmp->GetMark()->nContent.GetIndex();
if( nPt < nMk || ( nPt == nMk && nPtCnt < nMkCnt ))
{
- ULONG nTmp = nMk; nMk = nPt; nPt = nTmp;
+ sal_uLong nTmp = nMk; nMk = nPt; nPt = nTmp;
nTmp = nMkCnt; nMkCnt = nPtCnt; nPtCnt = (xub_StrLen)nTmp;
}
diff --git a/sw/source/core/doc/fmtcol.cxx b/sw/source/core/doc/fmtcol.cxx
index f79febf7dd3a..030ab6bc311c 100644
--- a/sw/source/core/doc/fmtcol.cxx
+++ b/sw/source/core/doc/fmtcol.cxx
@@ -77,7 +77,7 @@ namespace TxtFmtCollFunc
{
if ( !pNewNumRuleItem )
{
- pTxtFmtColl->GetItemState( RES_PARATR_NUMRULE, FALSE, (const SfxPoolItem**)&pNewNumRuleItem );
+ pTxtFmtColl->GetItemState( RES_PARATR_NUMRULE, sal_False, (const SfxPoolItem**)&pNewNumRuleItem );
}
if ( pNewNumRuleItem )
{
@@ -98,7 +98,7 @@ namespace TxtFmtCollFunc
SwNumRule* pNumRule( 0 );
const SwNumRuleItem* pNumRuleItem( 0 );
- rTxtFmtColl.GetItemState( RES_PARATR_NUMRULE, FALSE, (const SfxPoolItem**)&pNumRuleItem );
+ rTxtFmtColl.GetItemState( RES_PARATR_NUMRULE, sal_False, (const SfxPoolItem**)&pNumRuleItem );
if ( pNumRuleItem )
{
const String sNumRuleName = pNumRuleItem->GetValue();
@@ -163,22 +163,22 @@ void SwTxtFmtColl::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
pNewChgSet = (SwAttrSetChg*)pNew;
pOldChgSet = (SwAttrSetChg*)pOld;
pNewChgSet->GetChgSet()->GetItemState(
- RES_LR_SPACE, FALSE, (const SfxPoolItem**)&pNewLRSpace );
+ RES_LR_SPACE, sal_False, (const SfxPoolItem**)&pNewLRSpace );
pNewChgSet->GetChgSet()->GetItemState(
- RES_UL_SPACE, FALSE, (const SfxPoolItem**)&pNewULSpace );
+ RES_UL_SPACE, sal_False, (const SfxPoolItem**)&pNewULSpace );
pNewChgSet->GetChgSet()->GetItemState( RES_CHRATR_FONTSIZE,
- FALSE, (const SfxPoolItem**)&(aFontSizeArr[0]) );
+ sal_False, (const SfxPoolItem**)&(aFontSizeArr[0]) );
pNewChgSet->GetChgSet()->GetItemState( RES_CHRATR_CJK_FONTSIZE,
- FALSE, (const SfxPoolItem**)&(aFontSizeArr[1]) );
+ sal_False, (const SfxPoolItem**)&(aFontSizeArr[1]) );
pNewChgSet->GetChgSet()->GetItemState( RES_CHRATR_CTL_FONTSIZE,
- FALSE, (const SfxPoolItem**)&(aFontSizeArr[2]) );
+ sal_False, (const SfxPoolItem**)&(aFontSizeArr[2]) );
// --> OD 2006-10-17 #i70223#
// --> OD 2007-12-19 #i84745#
// check, if attribute set is applied to this paragraph style
if ( bAssignedToListLevelOfOutlineStyle &&
pNewChgSet->GetTheChgdSet() == &GetAttrSet() )
{
- pNewChgSet->GetChgSet()->GetItemState( RES_PARATR_NUMRULE, FALSE,
+ pNewChgSet->GetChgSet()->GetItemState( RES_PARATR_NUMRULE, sal_False,
(const SfxPoolItem**)&pNewNumRuleItem );
}
// <--
@@ -236,13 +236,13 @@ void SwTxtFmtColl::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
}
// <--
- int bWeiter = TRUE;
+ int bWeiter = sal_True;
// dann pruefe doch mal gegen die eigenen Attribute
- if( pNewLRSpace && SFX_ITEM_SET == GetItemState( RES_LR_SPACE, FALSE,
+ if( pNewLRSpace && SFX_ITEM_SET == GetItemState( RES_LR_SPACE, sal_False,
(const SfxPoolItem**)&pOldLRSpace ))
{
- int bChg = FALSE;
+ int bChg = sal_False;
if( pOldLRSpace != pNewLRSpace ) // verhinder Rekursion (SetAttr!!)
{
SvxLRSpaceItem aNew( *pOldLRSpace );
@@ -281,22 +281,22 @@ void SwTxtFmtColl::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
}
if( pNewULSpace && SFX_ITEM_SET == GetItemState(
- RES_UL_SPACE, FALSE, (const SfxPoolItem**)&pOldULSpace ) &&
+ RES_UL_SPACE, sal_False, (const SfxPoolItem**)&pOldULSpace ) &&
pOldULSpace != pNewULSpace ) // verhinder Rekursion (SetAttr!!)
{
SvxULSpaceItem aNew( *pOldULSpace );
- int bChg = FALSE;
+ int bChg = sal_False;
// wir hatten eine relative Angabe -> neu berechnen
if( 100 != aNew.GetPropUpper() )
{
- USHORT nTmp = aNew.GetUpper(); // alten zum Vergleichen
+ sal_uInt16 nTmp = aNew.GetUpper(); // alten zum Vergleichen
aNew.SetUpper( pNewULSpace->GetUpper(), aNew.GetPropUpper() );
bChg |= nTmp != aNew.GetUpper();
}
// wir hatten eine relative Angabe -> neu berechnen
if( 100 != aNew.GetPropLower() )
{
- USHORT nTmp = aNew.GetLower(); // alten zum Vergleichen
+ sal_uInt16 nTmp = aNew.GetLower(); // alten zum Vergleichen
aNew.SetLower( pNewULSpace->GetLower(), aNew.GetPropLower() );
bChg |= nTmp != aNew.GetLower();
}
@@ -317,7 +317,7 @@ void SwTxtFmtColl::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
SvxFontHeightItem *pFSize = aFontSizeArr[ nC ], *pOldFSize;
if( pFSize && SFX_ITEM_SET == GetItemState(
- pFSize->Which(), FALSE, (const SfxPoolItem**)&pOldFSize ) &&
+ pFSize->Which(), sal_False, (const SfxPoolItem**)&pOldFSize ) &&
// verhinder Rekursion (SetAttr!!)
pFSize != pOldFSize )
{
@@ -332,7 +332,7 @@ void SwTxtFmtColl::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
else
{
// wir hatten eine relative Angabe -> neu berechnen
- UINT32 nTmp = pOldFSize->GetHeight(); // alten zum Vergleichen
+ sal_uInt32 nTmp = pOldFSize->GetHeight(); // alten zum Vergleichen
SvxFontHeightItem aNew(240 , 100, pFSize->Which());
aNew.SetHeight( pFSize->GetHeight(), pOldFSize->GetProp(),
pOldFSize->GetPropUnit() );
@@ -353,19 +353,25 @@ void SwTxtFmtColl::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
SwFmtColl::Modify( pOld, pNew );
}
-BOOL SwTxtFmtColl::IsAtDocNodeSet() const
+sal_Bool SwTxtFmtColl::IsAtDocNodeSet() const
{
SwIterator<SwCntntNode,SwFmtColl> aIter( *this );
const SwNodes& rNds = GetDoc()->GetNodes();
+<<<<<<< local
for( SwCntntNode* pNode = aIter.First(); pNode; pNode = aIter.Next() )
if( &(pNode->GetNodes()) == &rNds )
return TRUE;
+=======
+ for( SwClient* pC = aIter.First(TYPE(SwCntntNode)); pC; pC = aIter.Next() )
+ if( &((SwCntntNode*)pC)->GetNodes() == &rNds )
+ return sal_True;
+>>>>>>> other
- return FALSE;
+ return sal_False;
}
// --> OD 2008-03-04 #refactorlists#
-BOOL SwTxtFmtColl::SetFmtAttr( const SfxPoolItem& rAttr )
+sal_Bool SwTxtFmtColl::SetFmtAttr( const SfxPoolItem& rAttr )
{
const bool bIsNumRuleItem = rAttr.Which() == RES_PARATR_NUMRULE;
if ( bIsNumRuleItem )
@@ -373,7 +379,7 @@ BOOL SwTxtFmtColl::SetFmtAttr( const SfxPoolItem& rAttr )
TxtFmtCollFunc::RemoveFromNumRule( *this );
}
- const BOOL bRet = SwFmtColl::SetFmtAttr( rAttr );
+ const sal_Bool bRet = SwFmtColl::SetFmtAttr( rAttr );
if ( bIsNumRuleItem )
{
@@ -383,16 +389,16 @@ BOOL SwTxtFmtColl::SetFmtAttr( const SfxPoolItem& rAttr )
return bRet;
}
-BOOL SwTxtFmtColl::SetFmtAttr( const SfxItemSet& rSet )
+sal_Bool SwTxtFmtColl::SetFmtAttr( const SfxItemSet& rSet )
{
const bool bIsNumRuleItemAffected =
- rSet.GetItemState( RES_PARATR_NUMRULE, FALSE ) == SFX_ITEM_SET;
+ rSet.GetItemState( RES_PARATR_NUMRULE, sal_False ) == SFX_ITEM_SET;
if ( bIsNumRuleItemAffected )
{
TxtFmtCollFunc::RemoveFromNumRule( *this );
}
- const BOOL bRet = SwFmtColl::SetFmtAttr( rSet );
+ const sal_Bool bRet = SwFmtColl::SetFmtAttr( rSet );
if ( bIsNumRuleItemAffected )
{
@@ -402,7 +408,7 @@ BOOL SwTxtFmtColl::SetFmtAttr( const SfxItemSet& rSet )
return bRet;
}
-BOOL SwTxtFmtColl::ResetFmtAttr( USHORT nWhich1, USHORT nWhich2 )
+sal_Bool SwTxtFmtColl::ResetFmtAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 )
{
const bool bIsNumRuleItemAffected =
( nWhich2 != 0 && nWhich2 > nWhich1 )
@@ -414,14 +420,14 @@ BOOL SwTxtFmtColl::ResetFmtAttr( USHORT nWhich1, USHORT nWhich2 )
TxtFmtCollFunc::RemoveFromNumRule( *this );
}
- const BOOL bRet = SwFmtColl::ResetFmtAttr( nWhich1, nWhich2 );
+ const sal_Bool bRet = SwFmtColl::ResetFmtAttr( nWhich1, nWhich2 );
return bRet;
}
// <--
// --> OD 2007-01-24 #i73790#
-USHORT SwTxtFmtColl::ResetAllFmtAttr()
+sal_uInt16 SwTxtFmtColl::ResetAllFmtAttr()
{
const bool bOldState( mbStayAssignedToListLevelOfOutlineStyle );
mbStayAssignedToListLevelOfOutlineStyle = true;
@@ -434,7 +440,7 @@ USHORT SwTxtFmtColl::ResetAllFmtAttr()
: -1;
// <--
- USHORT nRet = SwFmtColl::ResetAllFmtAttr();
+ sal_uInt16 nRet = SwFmtColl::ResetAllFmtAttr();
// --> OD 2008-12-16 #i70748#
if ( nAssignedOutlineStyleLevel != -1 )
@@ -459,12 +465,12 @@ bool SwTxtFmtColl::AreListLevelIndentsApplicable() const
// no list style applied to paragraph style
bAreListLevelIndentsApplicable = false;
}
- else if ( GetItemState( RES_LR_SPACE, FALSE ) == SFX_ITEM_SET )
+ else if ( GetItemState( RES_LR_SPACE, sal_False ) == SFX_ITEM_SET )
{
// paragraph style has hard-set indent attributes
bAreListLevelIndentsApplicable = false;
}
- else if ( GetItemState( RES_PARATR_NUMRULE, FALSE ) == SFX_ITEM_SET )
+ else if ( GetItemState( RES_PARATR_NUMRULE, sal_False ) == SFX_ITEM_SET )
{
// list style is directly applied to paragraph style and paragraph
// style has no hard-set indent attributes
@@ -479,14 +485,14 @@ bool SwTxtFmtColl::AreListLevelIndentsApplicable() const
const SwTxtFmtColl* pColl = dynamic_cast<const SwTxtFmtColl*>(DerivedFrom());
while ( pColl )
{
- if ( pColl->GetAttrSet().GetItemState( RES_LR_SPACE, FALSE ) == SFX_ITEM_SET )
+ if ( pColl->GetAttrSet().GetItemState( RES_LR_SPACE, sal_False ) == SFX_ITEM_SET )
{
// indent attributes found in the paragraph style hierarchy.
bAreListLevelIndentsApplicable = false;
break;
}
- if ( pColl->GetAttrSet().GetItemState( RES_PARATR_NUMRULE, FALSE ) == SFX_ITEM_SET )
+ if ( pColl->GetAttrSet().GetItemState( RES_PARATR_NUMRULE, sal_False ) == SFX_ITEM_SET )
{
// paragraph style with the list style found and until now no
// indent attributes are found in the paragraph style hierarchy.
@@ -506,15 +512,15 @@ bool SwTxtFmtColl::AreListLevelIndentsApplicable() const
//FEATURE::CONDCOLL
-SwCollCondition::SwCollCondition( SwTxtFmtColl* pColl, ULONG nMasterCond,
- ULONG nSubCond )
+SwCollCondition::SwCollCondition( SwTxtFmtColl* pColl, sal_uLong nMasterCond,
+ sal_uLong nSubCond )
: SwClient( pColl ), nCondition( nMasterCond )
{
aSubCondition.nSubCondition = nSubCond;
}
-SwCollCondition::SwCollCondition( SwTxtFmtColl* pColl, ULONG nMasterCond,
+SwCollCondition::SwCollCondition( SwTxtFmtColl* pColl, sal_uLong nMasterCond,
const String& rSubExp )
: SwClient( pColl ), nCondition( nMasterCond )
{
@@ -580,7 +586,7 @@ int SwCollCondition::operator==( const SwCollCondition& rCmp ) const
}
-void SwCollCondition::SetCondition( ULONG nCond, ULONG nSubCond )
+void SwCollCondition::SetCondition( sal_uLong nCond, sal_uLong nSubCond )
{
if( USRFLD_EXPRESSION & nCondition )
delete aSubCondition.pFldExpression;
@@ -597,7 +603,7 @@ const SwCollCondition* SwConditionTxtFmtColl::HasCondition(
const SwCollCondition& rCond ) const
{
const SwCollCondition* pFnd = 0;
- USHORT n;
+ sal_uInt16 n;
for( n = 0; n < aCondColls.Count(); ++n )
if( *( pFnd = aCondColls[ n ]) == rCond )
@@ -609,7 +615,7 @@ const SwCollCondition* SwConditionTxtFmtColl::HasCondition(
void SwConditionTxtFmtColl::InsertCondition( const SwCollCondition& rCond )
{
- for( USHORT n = 0; n < aCondColls.Count(); ++n )
+ for( sal_uInt16 n = 0; n < aCondColls.Count(); ++n )
if( *aCondColls[ n ] == rCond )
{
aCondColls.DeleteAndDestroy( n );
@@ -622,14 +628,14 @@ void SwConditionTxtFmtColl::InsertCondition( const SwCollCondition& rCond )
}
-BOOL SwConditionTxtFmtColl::RemoveCondition( const SwCollCondition& rCond )
+sal_Bool SwConditionTxtFmtColl::RemoveCondition( const SwCollCondition& rCond )
{
- BOOL bRet = FALSE;
- for( USHORT n = 0; n < aCondColls.Count(); ++n )
+ sal_Bool bRet = sal_False;
+ for( sal_uInt16 n = 0; n < aCondColls.Count(); ++n )
if( *aCondColls[ n ] == rCond )
{
aCondColls.DeleteAndDestroy( n );
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
@@ -642,7 +648,7 @@ void SwConditionTxtFmtColl::SetConditions( const SwFmtCollConditions& rCndClls )
if( aCondColls.Count() )
aCondColls.DeleteAndDestroy( 0, aCondColls.Count() );
SwDoc& rDoc = *GetDoc();
- for( USHORT n = 0; n < rCndClls.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rCndClls.Count(); ++n )
{
SwCollCondition* pFnd = rCndClls[ n ];
SwTxtFmtColl* pTmpColl = pFnd->GetTxtFmtColl()
@@ -663,7 +669,7 @@ void SwTxtFmtColl::SetAttrOutlineLevel( int nLevel)
{
ASSERT( 0 <= nLevel && nLevel <= MAXLEVEL ,"SwTxtFmtColl: Level Out Of Range" );
SetFmtAttr( SfxUInt16Item( RES_PARATR_OUTLINELEVEL,
- static_cast<UINT16>(nLevel) ) );
+ static_cast<sal_uInt16>(nLevel) ) );
}
int SwTxtFmtColl::GetAttrOutlineLevel() const
@@ -690,12 +696,12 @@ void SwTxtFmtColl::AssignToListLevelOfOutlineStyle(const int nAssignedListLevel)
{
if ( !pDerivedTxtFmtColl->IsAssignedToListLevelOfOutlineStyle() )
{
- if ( pDerivedTxtFmtColl->GetItemState( RES_PARATR_NUMRULE, FALSE ) == SFX_ITEM_DEFAULT )
+ if ( pDerivedTxtFmtColl->GetItemState( RES_PARATR_NUMRULE, sal_False ) == SFX_ITEM_DEFAULT )
{
SwNumRuleItem aItem(aEmptyStr);
pDerivedTxtFmtColl->SetFmtAttr( aItem );
}
- if ( pDerivedTxtFmtColl->GetItemState( RES_PARATR_OUTLINELEVEL, FALSE ) == SFX_ITEM_DEFAULT )
+ if ( pDerivedTxtFmtColl->GetItemState( RES_PARATR_OUTLINELEVEL, sal_False ) == SFX_ITEM_DEFAULT )
{
pDerivedTxtFmtColl->SetAttrOutlineLevel( 0 );
}
diff --git a/sw/source/core/doc/ftnidx.cxx b/sw/source/core/doc/ftnidx.cxx
index a8b39c9062a6..40579fddd960 100644
--- a/sw/source/core/doc/ftnidx.cxx
+++ b/sw/source/core/doc/ftnidx.cxx
@@ -42,24 +42,24 @@
_SV_IMPL_SORTAR_ALG( _SwFtnIdxs, SwTxtFtnPtr )
-BOOL _SwFtnIdxs::Seek_Entry( const SwTxtFtnPtr rSrch, USHORT* pFndPos ) const
+sal_Bool _SwFtnIdxs::Seek_Entry( const SwTxtFtnPtr rSrch, sal_uInt16* pFndPos ) const
{
- ULONG nIdx = _SwTxtFtn_GetIndex( rSrch );
+ sal_uLong nIdx = _SwTxtFtn_GetIndex( rSrch );
xub_StrLen nCntIdx = *rSrch->GetStart();
- USHORT nO = Count(), nM, nU = 0;
+ sal_uInt16 nO = Count(), nM, nU = 0;
if( nO > 0 )
{
nO--;
while( nU <= nO )
{
nM = nU + ( nO - nU ) / 2;
- ULONG nFndIdx = _SwTxtFtn_GetIndex( (*this)[ nM ] );
+ sal_uLong nFndIdx = _SwTxtFtn_GetIndex( (*this)[ nM ] );
if( nFndIdx == nIdx && *(*this)[ nM ]->GetStart() == nCntIdx )
{
if( pFndPos )
*pFndPos = nM;
- return TRUE;
+ return sal_True;
}
else if( nFndIdx < nIdx ||
(nFndIdx == nIdx && *(*this)[ nM ]->GetStart() < nCntIdx ))
@@ -68,7 +68,7 @@ BOOL _SwFtnIdxs::Seek_Entry( const SwTxtFtnPtr rSrch, USHORT* pFndPos ) const
{
if( pFndPos )
*pFndPos = nU;
- return FALSE;
+ return sal_False;
}
else
nO = nM - 1;
@@ -76,7 +76,7 @@ BOOL _SwFtnIdxs::Seek_Entry( const SwTxtFtnPtr rSrch, USHORT* pFndPos ) const
}
if( pFndPos )
*pFndPos = nU;
- return FALSE;
+ return sal_False;
}
@@ -101,11 +101,11 @@ void SwFtnIdxs::UpdateFtn( const SwNodeIndex& rStt )
{
const SwOutlineNodes& rOutlNds = pDoc->GetNodes().GetOutLineNds();
const SwNode* pCapStt = &pDoc->GetNodes().GetEndOfExtras();
- ULONG nCapEnd = pDoc->GetNodes().GetEndOfContent().GetIndex();
+ sal_uLong nCapEnd = pDoc->GetNodes().GetEndOfContent().GetIndex();
if( rOutlNds.Count() )
{
// suche den Start des Kapitels, in den rStt steht.
- USHORT n;
+ sal_uInt16 n;
for( n = 0; n < rOutlNds.Count(); ++n )
if( rOutlNds[ n ]->GetIndex() > rStt.GetIndex() )
@@ -123,7 +123,7 @@ void SwFtnIdxs::UpdateFtn( const SwNodeIndex& rStt )
}
}
- USHORT nPos, nFtnNo = 1;
+ sal_uInt16 nPos, nFtnNo = 1;
if( SeekEntry( *pCapStt, &nPos ) && nPos )
{
// gehe nach vorne bis der Index nicht mehr gleich ist
@@ -155,12 +155,12 @@ void SwFtnIdxs::UpdateFtn( const SwNodeIndex& rStt )
SwUpdFtnEndNtAtEnd aNumArr;
- // BOOL, damit hier auch bei Chapter-Einstellung die Endnoten
+ // sal_Bool, damit hier auch bei Chapter-Einstellung die Endnoten
// durchlaufen.
- const BOOL bEndNoteOnly = FTNNUM_DOC != rFtnInfo.eNum;
+ const sal_Bool bEndNoteOnly = FTNNUM_DOC != rFtnInfo.eNum;
- USHORT nPos, nFtnNo = 1, nEndNo = 1;
- ULONG nUpdNdIdx = rStt.GetIndex();
+ sal_uInt16 nPos, nFtnNo = 1, nEndNo = 1;
+ sal_uLong nUpdNdIdx = rStt.GetIndex();
for( nPos = 0; nPos < Count(); ++nPos )
{
pTxtFtn = (*this)[ nPos ];
@@ -187,7 +187,7 @@ void SwFtnIdxs::UpdateFtn( const SwNodeIndex& rStt )
const SwFmtFtn &rFtn = pTxtFtn->GetFtn();
if( !rFtn.GetNumStr().Len() )
{
- USHORT nSectNo = aNumArr.ChkNumber( *pTxtFtn );
+ sal_uInt16 nSectNo = aNumArr.ChkNumber( *pTxtFtn );
if( !nSectNo && ( rFtn.IsEndNote() || !bEndNoteOnly ))
nSectNo = rFtn.IsEndNote()
? rEndInfo.nFtnOffset + nEndNo++
@@ -228,13 +228,13 @@ void SwFtnIdxs::UpdateAllFtn()
if( FTNNUM_CHAPTER == rFtnInfo.eNum )
{
const SwOutlineNodes& rOutlNds = pDoc->GetNodes().GetOutLineNds();
- USHORT nNo = 1, // Nummer fuer die Fussnoten
+ sal_uInt16 nNo = 1, // Nummer fuer die Fussnoten
nFtnIdx = 0; // Index in das FtnIdx-Array
- for( USHORT n = 0; n < rOutlNds.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rOutlNds.Count(); ++n )
{
if ( rOutlNds[ n ]->GetTxtNode()->GetAttrOutlineLevel() == 1 )//<-end,zhaojianwei
{
- ULONG nCapStt = rOutlNds[ n ]->GetIndex(); // Start eines neuen Kapitels
+ sal_uLong nCapStt = rOutlNds[ n ]->GetIndex(); // Start eines neuen Kapitels
for( ; nFtnIdx < Count(); ++nFtnIdx )
{
pTxtFtn = (*this)[ nFtnIdx ];
@@ -267,17 +267,17 @@ void SwFtnIdxs::UpdateAllFtn()
}
- // BOOL, damit hier auch bei Chapter-Einstellung die Endnoten
+ // sal_Bool, damit hier auch bei Chapter-Einstellung die Endnoten
// durchlaufen.
- const BOOL bEndNoteOnly = FTNNUM_DOC != rFtnInfo.eNum;
- USHORT nFtnNo = 0, nEndNo = 0;
- for( USHORT nPos = 0; nPos < Count(); ++nPos )
+ const sal_Bool bEndNoteOnly = FTNNUM_DOC != rFtnInfo.eNum;
+ sal_uInt16 nFtnNo = 0, nEndNo = 0;
+ for( sal_uInt16 nPos = 0; nPos < Count(); ++nPos )
{
pTxtFtn = (*this)[ nPos ];
const SwFmtFtn &rFtn = pTxtFtn->GetFtn();
if( !rFtn.GetNumStr().Len() )
{
- USHORT nSectNo = aNumArr.ChkNumber( *pTxtFtn );
+ sal_uInt16 nSectNo = aNumArr.ChkNumber( *pTxtFtn );
if( !nSectNo && ( rFtn.IsEndNote() || !bEndNoteOnly ))
nSectNo = rFtn.IsEndNote()
? rEndInfo.nFtnOffset + (++nEndNo)
@@ -297,18 +297,18 @@ void SwFtnIdxs::UpdateAllFtn()
std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::UpdateFtnNums));//swmod 0
}
-SwTxtFtn* SwFtnIdxs::SeekEntry( const SwNodeIndex& rPos, USHORT* pFndPos ) const
+SwTxtFtn* SwFtnIdxs::SeekEntry( const SwNodeIndex& rPos, sal_uInt16* pFndPos ) const
{
- ULONG nIdx = rPos.GetIndex();
+ sal_uLong nIdx = rPos.GetIndex();
- USHORT nO = Count(), nM, nU = 0;
+ sal_uInt16 nO = Count(), nM, nU = 0;
if( nO > 0 )
{
nO--;
while( nU <= nO )
{
nM = nU + ( nO - nU ) / 2;
- ULONG nNdIdx = _SwTxtFtn_GetIndex( (*this)[ nM ] );
+ sal_uLong nNdIdx = _SwTxtFtn_GetIndex( (*this)[ nM ] );
if( nNdIdx == nIdx )
{
if( pFndPos )
@@ -337,23 +337,23 @@ SwTxtFtn* SwFtnIdxs::SeekEntry( const SwNodeIndex& rPos, USHORT* pFndPos ) const
const SwSectionNode* SwUpdFtnEndNtAtEnd::FindSectNdWithEndAttr(
const SwTxtFtn& rTxtFtn )
{
- USHORT nWh = static_cast<USHORT>( rTxtFtn.GetFtn().IsEndNote() ?
+ sal_uInt16 nWh = static_cast<sal_uInt16>( rTxtFtn.GetFtn().IsEndNote() ?
RES_END_AT_TXTEND : RES_FTN_AT_TXTEND );
- USHORT nVal;
+ sal_uInt16 nVal;
const SwSectionNode* pNd = rTxtFtn.GetTxtNode().FindSectionNode();
while( pNd && FTNEND_ATTXTEND_OWNNUMSEQ != ( nVal =
((const SwFmtFtnAtTxtEnd&)pNd->GetSection().GetFmt()->
- GetFmtAttr( nWh, TRUE )).GetValue() ) &&
+ GetFmtAttr( nWh, sal_True )).GetValue() ) &&
FTNEND_ATTXTEND_OWNNUMANDFMT != nVal )
pNd = pNd->StartOfSectionNode()->FindSectionNode();
return pNd;
}
-USHORT SwUpdFtnEndNtAtEnd::GetNumber( const SwTxtFtn& rTxtFtn,
+sal_uInt16 SwUpdFtnEndNtAtEnd::GetNumber( const SwTxtFtn& rTxtFtn,
const SwSectionNode& rNd )
{
- USHORT nRet = 0, nWh;
+ sal_uInt16 nRet = 0, nWh;
SvPtrarr* pArr;
SvUShorts* pNum;
if( rTxtFtn.GetFtn().IsEndNote() )
@@ -370,7 +370,7 @@ USHORT SwUpdFtnEndNtAtEnd::GetNumber( const SwTxtFtn& rTxtFtn,
}
void* pNd = (void*)&rNd;
- for( USHORT n = pArr->Count(); n; )
+ for( sal_uInt16 n = pArr->Count(); n; )
if( pArr->GetObject( --n ) == pNd )
{
nRet = ++pNum->GetObject( n );
@@ -388,7 +388,7 @@ USHORT SwUpdFtnEndNtAtEnd::GetNumber( const SwTxtFtn& rTxtFtn,
return nRet;
}
-USHORT SwUpdFtnEndNtAtEnd::ChkNumber( const SwTxtFtn& rTxtFtn )
+sal_uInt16 SwUpdFtnEndNtAtEnd::ChkNumber( const SwTxtFtn& rTxtFtn )
{
const SwSectionNode* pSectNd = FindSectNdWithEndAttr( rTxtFtn );
return pSectNd ? GetNumber( rTxtFtn, *pSectNd ) : 0;
diff --git a/sw/source/core/doc/gctable.cxx b/sw/source/core/doc/gctable.cxx
index 5f22b885cada..607bb4f79c2e 100644
--- a/sw/source/core/doc/gctable.cxx
+++ b/sw/source/core/doc/gctable.cxx
@@ -35,40 +35,40 @@
#include <swtblfmt.hxx>
-inline const SvxBorderLine* GetLineTB( const SvxBoxItem* pBox, BOOL bTop )
+inline const SvxBorderLine* GetLineTB( const SvxBoxItem* pBox, sal_Bool bTop )
{
return bTop ? pBox->GetTop() : pBox->GetBottom();
}
-BOOL _SwGCBorder_BoxBrd::CheckLeftBorderOfFormat( const SwFrmFmt& rFmt )
+sal_Bool _SwGCBorder_BoxBrd::CheckLeftBorderOfFormat( const SwFrmFmt& rFmt )
{
const SvxBorderLine* pBrd;
const SfxPoolItem* pItem;
- if( SFX_ITEM_SET == rFmt.GetItemState( RES_BOX, TRUE, &pItem ) &&
+ if( SFX_ITEM_SET == rFmt.GetItemState( RES_BOX, sal_True, &pItem ) &&
0 != ( pBrd = ((SvxBoxItem*)pItem)->GetLeft() ) )
{
if( *pBrdLn == *pBrd )
- bAnyBorderFnd = TRUE;
- return TRUE;
+ bAnyBorderFnd = sal_True;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
-BOOL lcl_GCBorder_ChkBoxBrd_L( const SwTableLine*& rpLine, void* pPara )
+sal_Bool lcl_GCBorder_ChkBoxBrd_L( const SwTableLine*& rpLine, void* pPara )
{
const SwTableBox* pBox = rpLine->GetTabBoxes()[ 0 ];
return lcl_GCBorder_ChkBoxBrd_B( pBox, pPara );
}
-BOOL lcl_GCBorder_ChkBoxBrd_B( const SwTableBox*& rpBox, void* pPara )
+sal_Bool lcl_GCBorder_ChkBoxBrd_B( const SwTableBox*& rpBox, void* pPara )
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
if( rpBox->GetTabLines().Count() )
{
- for( USHORT n = 0, nLines = rpBox->GetTabLines().Count();
+ for( sal_uInt16 n = 0, nLines = rpBox->GetTabLines().Count();
n < nLines && bRet; ++n )
{
const SwTableLine* pLine = rpBox->GetTabLines()[ n ];
@@ -83,36 +83,36 @@ BOOL lcl_GCBorder_ChkBoxBrd_B( const SwTableBox*& rpBox, void* pPara )
return bRet;
}
-BOOL lcl_GCBorder_GetLastBox_L( const SwTableLine*& rpLine, void* pPara )
+sal_Bool lcl_GCBorder_GetLastBox_L( const SwTableLine*& rpLine, void* pPara )
{
const SwTableBoxes& rBoxes = rpLine->GetTabBoxes();
const SwTableBox* pBox = rBoxes[ rBoxes.Count()-1 ];
::lcl_GCBorder_GetLastBox_B( pBox, pPara );
- return TRUE;
+ return sal_True;
}
-BOOL lcl_GCBorder_GetLastBox_B( const SwTableBox*& rpBox, void* pPara )
+sal_Bool lcl_GCBorder_GetLastBox_B( const SwTableBox*& rpBox, void* pPara )
{
SwTableLines& rLines = (SwTableLines&)rpBox->GetTabLines();
if( rLines.Count() )
rLines.ForEach( &lcl_GCBorder_GetLastBox_L, pPara );
else
((SwTableBoxes*)pPara)->Insert( rpBox, ((SwTableBoxes*)pPara)->Count() );
- return TRUE;
+ return sal_True;
}
// suche das "Ende" der vorgegebene BorderLine. Returnt wird die "Layout"Pos!
-USHORT lcl_FindEndPosOfBorder( const SwCollectTblLineBoxes& rCollTLB,
- const SvxBorderLine& rBrdLn, USHORT& rStt, BOOL bTop )
+sal_uInt16 lcl_FindEndPosOfBorder( const SwCollectTblLineBoxes& rCollTLB,
+ const SvxBorderLine& rBrdLn, sal_uInt16& rStt, sal_Bool bTop )
{
- USHORT nPos, nLastPos = 0;
- for( USHORT nEnd = rCollTLB.Count(); rStt < nEnd; ++rStt )
+ sal_uInt16 nPos, nLastPos = 0;
+ for( sal_uInt16 nEnd = rCollTLB.Count(); rStt < nEnd; ++rStt )
{
const SfxPoolItem* pItem;
const SvxBorderLine* pBrd;
const SwTableBox& rBox = rCollTLB.GetBox( rStt, &nPos );
- if( SFX_ITEM_SET != rBox.GetFrmFmt()->GetItemState(RES_BOX,TRUE, &pItem )
+ if( SFX_ITEM_SET != rBox.GetFrmFmt()->GetItemState(RES_BOX,sal_True, &pItem )
|| 0 == ( pBrd = GetLineTB( (SvxBoxItem*)pItem, bTop ))
|| !( *pBrd == rBrdLn ))
break;
@@ -122,23 +122,23 @@ USHORT lcl_FindEndPosOfBorder( const SwCollectTblLineBoxes& rCollTLB,
}
inline const SvxBorderLine* lcl_GCBorder_GetBorder( const SwTableBox& rBox,
- BOOL bTop,
+ sal_Bool bTop,
const SfxPoolItem** ppItem )
{
- return SFX_ITEM_SET == rBox.GetFrmFmt()->GetItemState( RES_BOX, TRUE, ppItem )
+ return SFX_ITEM_SET == rBox.GetFrmFmt()->GetItemState( RES_BOX, sal_True, ppItem )
? GetLineTB( (SvxBoxItem*)*ppItem, bTop )
: 0;
}
void lcl_GCBorder_DelBorder( const SwCollectTblLineBoxes& rCollTLB,
- USHORT& rStt, BOOL bTop,
+ sal_uInt16& rStt, sal_Bool bTop,
const SvxBorderLine& rLine,
const SfxPoolItem* pItem,
- USHORT nEndPos,
+ sal_uInt16 nEndPos,
SwShareBoxFmts* pShareFmts )
{
SwTableBox* pBox = (SwTableBox*)&rCollTLB.GetBox( rStt );
- USHORT nNextPos;
+ sal_uInt16 nNextPos;
const SvxBorderLine* pLn = &rLine;
do {
@@ -165,11 +165,11 @@ void lcl_GCBorder_DelBorder( const SwCollectTblLineBoxes& rCollTLB,
pLn = lcl_GCBorder_GetBorder( *pBox, bTop, &pItem );
- } while( TRUE );
+ } while( sal_True );
}
-BOOL lcl_GC_Line_Border( const SwTableLine*& rpLine, void* pPara )
+sal_Bool lcl_GC_Line_Border( const SwTableLine*& rpLine, void* pPara )
{
_SwGCLineBorder* pGCPara = (_SwGCLineBorder*)pPara;
@@ -180,7 +180,7 @@ BOOL lcl_GC_Line_Border( const SwTableLine*& rpLine, void* pPara )
const SvxBorderLine* pBrd;
const SfxPoolItem* pItem;
const SwTableBoxes& rBoxes = rpLine->GetTabBoxes();
- for( USHORT n = 0, nBoxes = rBoxes.Count() - 1; n < nBoxes; ++n )
+ for( sal_uInt16 n = 0, nBoxes = rBoxes.Count() - 1; n < nBoxes; ++n )
{
SwTableBoxes aBoxes;
{
@@ -192,9 +192,9 @@ BOOL lcl_GC_Line_Border( const SwTableLine*& rpLine, void* pPara )
}
SwTableBox* pBox;
- for( USHORT i = aBoxes.Count(); i; )
+ for( sal_uInt16 i = aBoxes.Count(); i; )
if( SFX_ITEM_SET == (pBox = aBoxes[ --i ])->GetFrmFmt()->
- GetItemState( RES_BOX, TRUE, &pItem ) &&
+ GetItemState( RES_BOX, sal_True, &pItem ) &&
0 != ( pBrd = ((SvxBoxItem*)pItem)->GetRight() ) )
{
aBPara.SetBorder( *pBrd );
@@ -218,8 +218,8 @@ BOOL lcl_GC_Line_Border( const SwTableLine*& rpLine, void* pPara )
// und jetzt die eigene untere Kante mit der nachfolgenden oberen Kante
if( !pGCPara->IsLastLine() )
{
- SwCollectTblLineBoxes aBottom( FALSE );
- SwCollectTblLineBoxes aTop( TRUE );
+ SwCollectTblLineBoxes aBottom( sal_False );
+ SwCollectTblLineBoxes aTop( sal_True );
::lcl_Line_CollectBox( rpLine, &aBottom );
@@ -227,7 +227,7 @@ BOOL lcl_GC_Line_Border( const SwTableLine*& rpLine, void* pPara )
::lcl_Line_CollectBox( pNextLine, &aTop );
// dann entferne mal alle "doppelten" gleichen Lines
- USHORT nBtmPos, nTopPos,
+ sal_uInt16 nBtmPos, nTopPos,
nSttBtm = 0, nSttTop = 0,
nEndBtm = aBottom.Count(), nEndTop = aTop.Count();
@@ -235,23 +235,23 @@ BOOL lcl_GC_Line_Border( const SwTableLine*& rpLine, void* pPara )
*pTopBox = &aTop.GetBox( nSttTop++, &nTopPos );
const SfxPoolItem *pBtmItem = 0, *pTopItem = 0;
const SvxBorderLine *pBtmLine(0), *pTopLine(0);
- BOOL bGetTopItem = TRUE, bGetBtmItem = TRUE;
+ sal_Bool bGetTopItem = sal_True, bGetBtmItem = sal_True;
do {
if( bGetBtmItem )
- pBtmLine = lcl_GCBorder_GetBorder( *pBtmBox, FALSE, &pBtmItem );
+ pBtmLine = lcl_GCBorder_GetBorder( *pBtmBox, sal_False, &pBtmItem );
if( bGetTopItem )
- pTopLine = lcl_GCBorder_GetBorder( *pTopBox, TRUE, &pTopItem );
+ pTopLine = lcl_GCBorder_GetBorder( *pTopBox, sal_True, &pTopItem );
if( pTopLine && pBtmLine && *pTopLine == *pBtmLine )
{
// dann kann einer entfernt werden, aber welche?
- USHORT nSavSttBtm = nSttBtm, nSavSttTop = nSttTop;
- USHORT nBtmEndPos = ::lcl_FindEndPosOfBorder( aBottom,
- *pTopLine, nSttBtm, FALSE );
+ sal_uInt16 nSavSttBtm = nSttBtm, nSavSttTop = nSttTop;
+ sal_uInt16 nBtmEndPos = ::lcl_FindEndPosOfBorder( aBottom,
+ *pTopLine, nSttBtm, sal_False );
if( !nBtmEndPos ) nBtmEndPos = nBtmPos;
- USHORT nTopEndPos = ::lcl_FindEndPosOfBorder( aTop,
- *pTopLine, nSttTop, TRUE );
+ sal_uInt16 nTopEndPos = ::lcl_FindEndPosOfBorder( aTop,
+ *pTopLine, nSttTop, sal_True );
if( !nTopEndPos ) nTopEndPos = nTopPos;
@@ -260,7 +260,7 @@ BOOL lcl_GC_Line_Border( const SwTableLine*& rpLine, void* pPara )
// dann die TopBorder bis zur BottomEndPos loeschen
nSttTop = nSavSttTop;
if( nTopPos <= nBtmEndPos )
- lcl_GCBorder_DelBorder( aTop, --nSttTop, TRUE,
+ lcl_GCBorder_DelBorder( aTop, --nSttTop, sal_True,
*pBtmLine, pTopItem, nBtmEndPos,
pGCPara->pShareFmts );
else
@@ -271,7 +271,7 @@ BOOL lcl_GC_Line_Border( const SwTableLine*& rpLine, void* pPara )
// sonst die BottomBorder bis zur TopEndPos loeschen
nSttBtm = nSavSttBtm;
if( nBtmPos <= nTopEndPos )
- lcl_GCBorder_DelBorder( aBottom, --nSttBtm, FALSE,
+ lcl_GCBorder_DelBorder( aBottom, --nSttBtm, sal_False,
*pTopLine, pBtmItem, nTopEndPos,
pGCPara->pShareFmts );
else
@@ -287,36 +287,36 @@ BOOL lcl_GC_Line_Border( const SwTableLine*& rpLine, void* pPara )
pBtmBox = &aBottom.GetBox( nSttBtm++, &nBtmPos );
pTopBox = &aTop.GetBox( nSttTop++, &nTopPos );
- bGetTopItem = bGetBtmItem = TRUE;
+ bGetTopItem = bGetBtmItem = sal_True;
}
else if( nTopPos < nBtmPos )
{
if( nSttTop >= nEndTop )
break;
pTopBox = &aTop.GetBox( nSttTop++, &nTopPos );
- bGetTopItem = TRUE;
- bGetBtmItem = FALSE;
+ bGetTopItem = sal_True;
+ bGetBtmItem = sal_False;
}
else
{
if( nSttBtm >= nEndBtm )
break;
pBtmBox = &aBottom.GetBox( nSttBtm++, &nBtmPos );
- bGetTopItem = FALSE;
- bGetBtmItem = TRUE;
+ bGetTopItem = sal_False;
+ bGetBtmItem = sal_True;
}
- } while( TRUE );
+ } while( sal_True );
}
((SwTableLine*)rpLine)->GetTabBoxes().ForEach( &lcl_GC_Box_Border, pPara );
++pGCPara->nLinePos;
- return TRUE;
+ return sal_True;
}
-BOOL lcl_GC_Box_Border( const SwTableBox*& rpBox, void* pPara )
+sal_Bool lcl_GC_Box_Border( const SwTableBox*& rpBox, void* pPara )
{
if( rpBox->GetTabLines().Count() )
{
@@ -324,7 +324,7 @@ BOOL lcl_GC_Box_Border( const SwTableBox*& rpBox, void* pPara )
aPara.pShareFmts = ((_SwGCLineBorder*)pPara)->pShareFmts;
((SwTableBox*)rpBox)->GetTabLines().ForEach( &lcl_GC_Line_Border, &aPara );
}
- return TRUE;
+ return sal_True;
}
struct _GCLinePara
@@ -337,10 +337,10 @@ struct _GCLinePara
{}
};
-BOOL lcl_MergeGCBox( const SwTableBox*& rpTblBox, void* pPara )
+sal_Bool lcl_MergeGCBox( const SwTableBox*& rpTblBox, void* pPara )
{
SwTableBox*& rpBox = (SwTableBox*&)rpTblBox;
- USHORT n, nLen = rpBox->GetTabLines().Count();
+ sal_uInt16 n, nLen = rpBox->GetTabLines().Count();
if( nLen )
{
// ACHTUNG: die Anzahl der Lines kann sich aendern!
@@ -356,7 +356,7 @@ BOOL lcl_MergeGCBox( const SwTableBox*& rpTblBox, void* pPara )
// hinter diese Box in der Parent-Line und loesche diese Box
SwTableLine* pInsLine = rpBox->GetUpper();
SwTableLine* pCpyLine = rpBox->GetTabLines()[0];
- USHORT nInsPos = pInsLine->GetTabBoxes().C40_GETPOS( SwTableBox, rpBox );
+ sal_uInt16 nInsPos = pInsLine->GetTabBoxes().C40_GETPOS( SwTableBox, rpBox );
for( n = 0; n < pCpyLine->GetTabBoxes().Count(); ++n )
pCpyLine->GetTabBoxes()[n]->SetUpper( pInsLine );
@@ -365,16 +365,16 @@ BOOL lcl_MergeGCBox( const SwTableBox*& rpTblBox, void* pPara )
// loesche alte die Box mit der Line
pInsLine->GetTabBoxes().DeleteAndDestroy( nInsPos );
- return FALSE; // neu aufsetzen
+ return sal_False; // neu aufsetzen
}
}
- return TRUE;
+ return sal_True;
}
-BOOL lcl_MergeGCLine( const SwTableLine*& rpLine, void* pPara )
+sal_Bool lcl_MergeGCLine( const SwTableLine*& rpLine, void* pPara )
{
SwTableLine* pLn = (SwTableLine*)rpLine;
- USHORT nLen = pLn->GetTabBoxes().Count();
+ sal_uInt16 nLen = pLn->GetTabBoxes().Count();
if( nLen )
{
_GCLinePara* pGCPara = (_GCLinePara*)pPara;
@@ -395,7 +395,7 @@ BOOL lcl_MergeGCLine( const SwTableLine*& rpLine, void* pPara )
SwTableLines& rLns = *pGCPara->pLns;
const SwTableLine* pTmp = pLn;
- USHORT nInsPos = rLns.GetPos( pTmp );
+ sal_uInt16 nInsPos = rLns.GetPos( pTmp );
ASSERT( USHRT_MAX != nInsPos, "Line nicht gefunden!" );
SwTableBox* pUpper = pLn->GetUpper();
@@ -407,12 +407,12 @@ BOOL lcl_MergeGCLine( const SwTableLine*& rpLine, void* pPara )
// Line an die "eingefuegten" uebertragen
const SfxPoolItem* pItem;
if( SFX_ITEM_SET == pLn->GetFrmFmt()->GetItemState(
- RES_BACKGROUND, TRUE, &pItem ))
+ RES_BACKGROUND, sal_True, &pItem ))
{
SwTableLines& rBoxLns = pBox->GetTabLines();
- for( USHORT nLns = 0; nLns < nLen; ++nLns )
+ for( sal_uInt16 nLns = 0; nLns < nLen; ++nLns )
if( SFX_ITEM_SET != rBoxLns[ nLns ]->GetFrmFmt()->
- GetItemState( RES_BACKGROUND, TRUE ))
+ GetItemState( RES_BACKGROUND, sal_True ))
pGCPara->pShareFmts->SetAttr( *rBoxLns[ nLns ], *pItem );
}
@@ -433,7 +433,7 @@ BOOL lcl_MergeGCLine( const SwTableLine*& rpLine, void* pPara )
if( !lcl_MergeGCBox( *(pLn->GetTabBoxes().GetData() + nLen ), pPara ))
--nLen;
}
- return TRUE;
+ return sal_True;
}
// Struktur ein wenig aufraeumen
@@ -443,7 +443,7 @@ void SwTable::GCLines()
_GCLinePara aPara( GetTabLines() );
SwShareBoxFmts aShareFmts;
aPara.pShareFmts = &aShareFmts;
- for( USHORT n = 0; n < GetTabLines().Count() &&
+ for( sal_uInt16 n = 0; n < GetTabLines().Count() &&
lcl_MergeGCLine( *(GetTabLines().GetData() + n ), &aPara ); ++n )
;
}
diff --git a/sw/source/core/doc/htmltbl.cxx b/sw/source/core/doc/htmltbl.cxx
index 24e7b67801cb..8538ff0991ea 100644
--- a/sw/source/core/doc/htmltbl.cxx
+++ b/sw/source/core/doc/htmltbl.cxx
@@ -64,37 +64,37 @@ using namespace ::com::sun::star;
class SwHTMLTableLayoutConstraints
{
- USHORT nRow; // Start-Zeile
- USHORT nCol; // Start-Spalte
- USHORT nColSpan; // COLSPAN der Zelle
+ sal_uInt16 nRow; // Start-Zeile
+ sal_uInt16 nCol; // Start-Spalte
+ sal_uInt16 nColSpan; // COLSPAN der Zelle
SwHTMLTableLayoutConstraints *pNext; // die naechste Bedingung
- ULONG nMinNoAlign, nMaxNoAlign; // Zwischenergebnisse AL-Pass 1
+ sal_uLong nMinNoAlign, nMaxNoAlign; // Zwischenergebnisse AL-Pass 1
public:
- SwHTMLTableLayoutConstraints( ULONG nMin, ULONG nMax, USHORT nRow,
- USHORT nCol, USHORT nColSp );
+ SwHTMLTableLayoutConstraints( sal_uLong nMin, sal_uLong nMax, sal_uInt16 nRow,
+ sal_uInt16 nCol, sal_uInt16 nColSp );
~SwHTMLTableLayoutConstraints();
- ULONG GetMinNoAlign() const { return nMinNoAlign; }
- ULONG GetMaxNoAlign() const { return nMaxNoAlign; }
+ sal_uLong GetMinNoAlign() const { return nMinNoAlign; }
+ sal_uLong GetMaxNoAlign() const { return nMaxNoAlign; }
SwHTMLTableLayoutConstraints *InsertNext( SwHTMLTableLayoutConstraints *pNxt );
SwHTMLTableLayoutConstraints* GetNext() const { return pNext; }
- USHORT GetRow() const { return nRow; }
+ sal_uInt16 GetRow() const { return nRow; }
- USHORT GetColSpan() const { return nColSpan; }
- USHORT GetColumn() const { return nCol; }
+ sal_uInt16 GetColSpan() const { return nColSpan; }
+ sal_uInt16 GetColumn() const { return nCol; }
};
/* */
SwHTMLTableLayoutCnts::SwHTMLTableLayoutCnts( const SwStartNode *pSttNd,
SwHTMLTableLayout* pTab,
- BOOL bNoBrTag,
+ sal_Bool bNoBrTag,
SwHTMLTableLayoutCnts* pNxt ) :
pNext( pNxt ), pBox( 0 ), pTable( pTab ), pStartNode( pSttNd ),
nPass1Done( 0 ), nWidthSet( 0 ), bNoBreakTag( bNoBrTag )
@@ -115,9 +115,9 @@ const SwStartNode *SwHTMLTableLayoutCnts::GetStartNode() const
/* */
SwHTMLTableLayoutCell::SwHTMLTableLayoutCell( SwHTMLTableLayoutCnts *pCnts,
- USHORT nRSpan, USHORT nCSpan,
- USHORT nWidth, BOOL bPrcWidth,
- BOOL bNWrapOpt ) :
+ sal_uInt16 nRSpan, sal_uInt16 nCSpan,
+ sal_uInt16 nWidth, sal_Bool bPrcWidth,
+ sal_Bool bNWrapOpt ) :
pContents( pCnts ),
nRowSpan( nRSpan ), nColSpan( nCSpan ),
nWidthOption( nWidth ), bPrcWidthOption( bPrcWidth ),
@@ -134,9 +134,9 @@ SwHTMLTableLayoutCell::~SwHTMLTableLayoutCell()
/* */
-SwHTMLTableLayoutColumn::SwHTMLTableLayoutColumn( USHORT nWidth,
- BOOL bRelWidth,
- BOOL bLBorder ) :
+SwHTMLTableLayoutColumn::SwHTMLTableLayoutColumn( sal_uInt16 nWidth,
+ sal_Bool bRelWidth,
+ sal_Bool bLBorder ) :
nMinNoAlign(MINLAY), nMaxNoAlign(MINLAY), nAbsMinNoAlign(MINLAY),
nMin(0), nMax(0),
nAbsColWidth(0), nRelColWidth(0),
@@ -148,7 +148,7 @@ SwHTMLTableLayoutColumn::SwHTMLTableLayoutColumn( USHORT nWidth,
/* */
SwHTMLTableLayoutConstraints::SwHTMLTableLayoutConstraints(
- ULONG nMin, ULONG nMax, USHORT nRw, USHORT nColumn, USHORT nColSp ):
+ sal_uLong nMin, sal_uLong nMax, sal_uInt16 nRw, sal_uInt16 nColumn, sal_uInt16 nColSp ):
nRow( nRw ), nCol( nColumn ), nColSpan( nColSp ),
pNext( 0 ),
nMinNoAlign( nMin ), nMaxNoAlign( nMax )
@@ -195,13 +195,13 @@ typedef SwHTMLTableLayoutCell *SwHTMLTableLayoutCellPtr;
SwHTMLTableLayout::SwHTMLTableLayout(
const SwTable * pSwTbl,
- USHORT nRws, USHORT nCls, BOOL bColsOpt, BOOL bColTgs,
- USHORT nWdth, BOOL bPrcWdth, USHORT nBorderOpt,
- USHORT nCellPad, USHORT nCellSp, SvxAdjust eAdjust,
- USHORT nLMargin, USHORT nRMargin,
- USHORT nBWidth, USHORT nLeftBWidth,
- USHORT nRightBWidth,
- USHORT nInhLeftBWidth, USHORT nInhRightBWidth ) :
+ sal_uInt16 nRws, sal_uInt16 nCls, sal_Bool bColsOpt, sal_Bool bColTgs,
+ sal_uInt16 nWdth, sal_Bool bPrcWdth, sal_uInt16 nBorderOpt,
+ sal_uInt16 nCellPad, sal_uInt16 nCellSp, SvxAdjust eAdjust,
+ sal_uInt16 nLMargin, sal_uInt16 nRMargin,
+ sal_uInt16 nBWidth, sal_uInt16 nLeftBWidth,
+ sal_uInt16 nRightBWidth,
+ sal_uInt16 nInhLeftBWidth, sal_uInt16 nInhRightBWidth ) :
aColumns( new SwHTMLTableLayoutColumnPtr[nCls] ),
aCells( new SwHTMLTableLayoutCellPtr[nRws*nCls] ),
pSwTable( pSwTbl ), pLeftFillerBox( 0 ), pRightFillerBox( 0 ),
@@ -219,9 +219,9 @@ SwHTMLTableLayout::SwHTMLTableLayout(
nDelayedResizeAbsAvail( 0 ), nLastResizeAbsAvail( 0 ),
nPass1Done( 0 ), nWidthSet( 0 ), eTableAdjust( eAdjust ),
bColsOption( bColsOpt ), bColTags( bColTgs ),
- bPrcWidthOption( bPrcWdth ), bUseRelWidth( FALSE ),
- bMustResize( TRUE ), bExportable( TRUE ), bBordersChanged( FALSE ),
- bMustNotResize( FALSE ), bMustNotRecalc( FALSE )
+ bPrcWidthOption( bPrcWdth ), bUseRelWidth( sal_False ),
+ bMustResize( sal_True ), bExportable( sal_True ), bBordersChanged( sal_False ),
+ bMustNotResize( sal_False ), bMustNotRecalc( sal_False )
{
aResizeTimer.SetTimeoutHdl( STATIC_LINK( this, SwHTMLTableLayout,
DelayedResize_Impl ) );
@@ -229,13 +229,13 @@ SwHTMLTableLayout::SwHTMLTableLayout(
SwHTMLTableLayout::~SwHTMLTableLayout()
{
- USHORT i;
+ sal_uInt16 i;
for( i = 0; i < nCols; i++ )
delete aColumns[i];
delete[] aColumns;
- USHORT nCount = nRows*nCols;
+ sal_uInt16 nCount = nRows*nCols;
for( i=0; i<nCount; i++ )
delete aCells[i];
delete[] aCells;
@@ -249,10 +249,10 @@ SwHTMLTableLayout::~SwHTMLTableLayout()
// MIB 27.6.97: Dabei muss auch der Abstand zum Inhalt berueckichtigt werden,
// und zwar auch dann, wenn wenn nur die gegenueberliegende Seite
// eine Umrandung hat.
-USHORT SwHTMLTableLayout::GetLeftCellSpace( USHORT nCol, USHORT nColSpan,
- BOOL bSwBorders ) const
+sal_uInt16 SwHTMLTableLayout::GetLeftCellSpace( sal_uInt16 nCol, sal_uInt16 nColSpan,
+ sal_Bool bSwBorders ) const
{
- USHORT nSpace = nCellSpacing + nCellPadding;
+ sal_uInt16 nSpace = nCellSpacing + nCellPadding;
if( nCol == 0 )
{
@@ -283,10 +283,10 @@ USHORT SwHTMLTableLayout::GetLeftCellSpace( USHORT nCol, USHORT nColSpan,
return nSpace;
}
-USHORT SwHTMLTableLayout::GetRightCellSpace( USHORT nCol, USHORT nColSpan,
- BOOL bSwBorders ) const
+sal_uInt16 SwHTMLTableLayout::GetRightCellSpace( sal_uInt16 nCol, sal_uInt16 nColSpan,
+ sal_Bool bSwBorders ) const
{
- USHORT nSpace = nCellPadding;
+ sal_uInt16 nSpace = nCellPadding;
if( nCol+nColSpan == nCols )
{
@@ -308,12 +308,12 @@ USHORT SwHTMLTableLayout::GetRightCellSpace( USHORT nCol, USHORT nColSpan,
return nSpace;
}
-void SwHTMLTableLayout::AddBorderWidth( ULONG &rMin, ULONG &rMax,
- ULONG &rAbsMin,
- USHORT nCol, USHORT nColSpan,
- BOOL bSwBorders ) const
+void SwHTMLTableLayout::AddBorderWidth( sal_uLong &rMin, sal_uLong &rMax,
+ sal_uLong &rAbsMin,
+ sal_uInt16 nCol, sal_uInt16 nColSpan,
+ sal_Bool bSwBorders ) const
{
- ULONG nAdd = GetLeftCellSpace( nCol, nColSpan, bSwBorders ) +
+ sal_uLong nAdd = GetLeftCellSpace( nCol, nColSpan, bSwBorders ) +
GetRightCellSpace( nCol, nColSpan, bSwBorders );
rMin += nAdd;
@@ -321,8 +321,8 @@ void SwHTMLTableLayout::AddBorderWidth( ULONG &rMin, ULONG &rMax,
rAbsMin += nAdd;
}
-void SwHTMLTableLayout::SetBoxWidth( SwTableBox *pBox, USHORT nCol,
- USHORT nColSpan ) const
+void SwHTMLTableLayout::SetBoxWidth( SwTableBox *pBox, sal_uInt16 nCol,
+ sal_uInt16 nColSpan ) const
{
SwFrmFmt *pFrmFmt = pBox->GetFrmFmt();
@@ -336,12 +336,12 @@ void SwHTMLTableLayout::SetBoxWidth( SwTableBox *pBox, USHORT nCol,
pFrmFmt->SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE, nFrmWidth, 0 ));
}
-void SwHTMLTableLayout::GetAvail( USHORT nCol, USHORT nColSpan,
- USHORT& rAbsAvail, USHORT& rRelAvail ) const
+void SwHTMLTableLayout::GetAvail( sal_uInt16 nCol, sal_uInt16 nColSpan,
+ sal_uInt16& rAbsAvail, sal_uInt16& rRelAvail ) const
{
rAbsAvail = 0;
rRelAvail = 0;
- for( USHORT i=nCol; i<nCol+nColSpan;i++ )
+ for( sal_uInt16 i=nCol; i<nCol+nColSpan;i++ )
{
const SwHTMLTableLayoutColumn *pColumn = GetColumn(i);
rAbsAvail = rAbsAvail + pColumn->GetAbsColWidth();
@@ -349,19 +349,19 @@ void SwHTMLTableLayout::GetAvail( USHORT nCol, USHORT nColSpan,
}
}
-USHORT SwHTMLTableLayout::GetBrowseWidthByVisArea( const SwDoc& rDoc )
+sal_uInt16 SwHTMLTableLayout::GetBrowseWidthByVisArea( const SwDoc& rDoc )
{
ViewShell *pVSh = 0;
rDoc.GetEditShell( &pVSh );
if( pVSh )
{
- return (USHORT)pVSh->GetBrowseWidth();
+ return (sal_uInt16)pVSh->GetBrowseWidth();
}
return 0;
}
-USHORT SwHTMLTableLayout::GetBrowseWidth( 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.GetCurrentLayout(); //swmod 080218
@@ -369,7 +369,7 @@ USHORT SwHTMLTableLayout::GetBrowseWidth( const SwDoc& rDoc )
{
const SwFrm *pPageFrm = pRootFrm->GetLower();
if( pPageFrm )
- return (USHORT)pPageFrm->Prt().Width();
+ return (sal_uInt16)pPageFrm->Prt().Width();
}
// --> OD 2010-05-12 #i91658#
@@ -380,7 +380,7 @@ USHORT SwHTMLTableLayout::GetBrowseWidth( const SwDoc& rDoc )
// <--
}
-USHORT SwHTMLTableLayout::GetBrowseWidthByTabFrm(
+sal_uInt16 SwHTMLTableLayout::GetBrowseWidthByTabFrm(
const SwTabFrm& rTabFrm ) const
{
SwTwips nWidth = 0;
@@ -409,14 +409,21 @@ USHORT SwHTMLTableLayout::GetBrowseWidthByTabFrm(
rTabFrm.CalcFlyOffsets( nUpperDummy, nLeftOffset, nRightOffset );
nWidth -= (nLeftOffset + nRightOffset);
- return nWidth < USHRT_MAX ? static_cast<USHORT>(nWidth) : USHRT_MAX;
+ return nWidth < USHRT_MAX ? static_cast<sal_uInt16>(nWidth) : USHRT_MAX;
}
-USHORT SwHTMLTableLayout::GetBrowseWidthByTable( const SwDoc& rDoc ) const
+sal_uInt16 SwHTMLTableLayout::GetBrowseWidthByTable( const SwDoc& rDoc ) const
{
+<<<<<<< local
USHORT nBrowseWidth = 0;
SwTabFrm* pFrm = SwIterator<SwTabFrm,SwFmt>::FirstElement( *pSwTable->GetFrmFmt() );
if( pFrm )
+=======
+ sal_uInt16 nBrowseWidth = 0;
+ SwClientIter aIter( *(SwModify*)pSwTable->GetFrmFmt() );
+ SwClient* pCli = aIter.First( TYPE( SwTabFrm ));
+ if( pCli )
+>>>>>>> other
{
nBrowseWidth = GetBrowseWidthByTabFrm( *pFrm );
}
@@ -452,12 +459,12 @@ SwFrmFmt *SwHTMLTableLayout::FindFlyFrmFmt() const
return pTblNd->GetFlyFmt();
}
-static void lcl_GetMinMaxSize( ULONG& rMinNoAlignCnts, ULONG& rMaxNoAlignCnts,
- ULONG& rAbsMinNoAlignCnts,
+static void lcl_GetMinMaxSize( sal_uLong& rMinNoAlignCnts, sal_uLong& rMaxNoAlignCnts,
+ sal_uLong& rAbsMinNoAlignCnts,
#ifdef FIX41370
- BOOL& rHR,
+ sal_Bool& rHR,
#endif
- SwTxtNode *pTxtNd, ULONG nIdx, BOOL bNoBreak )
+ SwTxtNode *pTxtNd, sal_uLong nIdx, sal_Bool bNoBreak )
{
pTxtNd->GetMinMaxSize( nIdx, rMinNoAlignCnts, rMaxNoAlignCnts,
rAbsMinNoAlignCnts );
@@ -487,7 +494,7 @@ static void lcl_GetMinMaxSize( ULONG& rMinNoAlignCnts, ULONG& rMaxNoAlignCnts,
{
rHR |= !pTxtNd->HasSwAttrSet() ||
SFX_ITEM_SET != pTxtNd->GetpSwAttrSet()
- ->GetItemState( RES_LR_SPACE, FALSE );
+ ->GetItemState( RES_LR_SPACE, sal_False );
}
#endif
}
@@ -498,8 +505,8 @@ void SwHTMLTableLayout::AutoLayoutPass1()
ClearPass1Info();
- BOOL bFixRelWidths = FALSE;
- USHORT i;
+ sal_Bool bFixRelWidths = sal_False;
+ sal_uInt16 i;
SwHTMLTableLayoutConstraints *pConstraints = 0;
@@ -507,19 +514,19 @@ void SwHTMLTableLayout::AutoLayoutPass1()
{
SwHTMLTableLayoutColumn *pColumn = GetColumn( i );
pColumn->ClearPass1Info( !HasColTags() );
- USHORT nMinColSpan = USHRT_MAX; // Spaltenzahl, auf die sich dir
+ sal_uInt16 nMinColSpan = USHRT_MAX; // Spaltenzahl, auf die sich dir
// berechnete Breite bezieht
- USHORT nColSkip = USHRT_MAX; // Wie viele Spalten muessen
+ sal_uInt16 nColSkip = USHRT_MAX; // Wie viele Spalten muessen
// uebersprungen werden
- for( USHORT j=0; j<nRows; j++ )
+ for( sal_uInt16 j=0; j<nRows; j++ )
{
SwHTMLTableLayoutCell *pCell = GetCell(j,i);
SwHTMLTableLayoutCnts *pCnts = pCell->GetContents();
// fix #31488#: Zum Ermitteln der naechsten zu berechnenden
// Spalte muessen alle Zeilen herangezogen werden
- USHORT nColSpan = pCell->GetColSpan();
+ sal_uInt16 nColSpan = pCell->GetColSpan();
if( nColSpan < nColSkip )
nColSkip = nColSpan;
@@ -530,13 +537,13 @@ void SwHTMLTableLayout::AutoLayoutPass1()
if( nColSpan < nMinColSpan )
nMinColSpan = nColSpan;
- ULONG nMinNoAlignCell = 0;
- ULONG nMaxNoAlignCell = 0;
- ULONG nAbsMinNoAlignCell = 0;
- ULONG nMaxTableCell = 0;
- ULONG nAbsMinTableCell = 0;
+ sal_uLong nMinNoAlignCell = 0;
+ sal_uLong nMaxNoAlignCell = 0;
+ sal_uLong nAbsMinNoAlignCell = 0;
+ sal_uLong nMaxTableCell = 0;
+ sal_uLong nAbsMinTableCell = 0;
#ifdef FIX41370
- BOOL bHR = FALSE;
+ sal_Bool bHR = sal_False;
#endif
while( pCnts )
@@ -545,15 +552,15 @@ void SwHTMLTableLayout::AutoLayoutPass1()
if( pSttNd )
{
const SwDoc *pDoc = pSttNd->GetDoc();
- ULONG nIdx = pSttNd->GetIndex();
+ sal_uLong nIdx = pSttNd->GetIndex();
while( !(pDoc->GetNodes()[nIdx])->IsEndNode() )
{
SwTxtNode *pTxtNd = (pDoc->GetNodes()[nIdx])->GetTxtNode();
if( pTxtNd )
{
- ULONG nMinNoAlignCnts = 0;
- ULONG nMaxNoAlignCnts = 0;
- ULONG nAbsMinNoAlignCnts = 0;
+ sal_uLong nMinNoAlignCnts = 0;
+ sal_uLong nMaxNoAlignCnts = 0;
+ sal_uLong nAbsMinNoAlignCnts = 0;
lcl_GetMinMaxSize( nMinNoAlignCnts,
nMaxNoAlignCnts,
@@ -580,14 +587,14 @@ void SwHTMLTableLayout::AutoLayoutPass1()
if( pChild )
{
pChild->AutoLayoutPass1();
- ULONG nMaxTableCnts = pChild->nMax;
- ULONG nAbsMinTableCnts = pChild->nMin;
+ sal_uLong nMaxTableCnts = pChild->nMax;
+ sal_uLong nAbsMinTableCnts = pChild->nMin;
// Eine feste Tabellen-Breite wird als Minimum
// und Maximum gleichzeitig uebernommen
if( !pChild->bPrcWidthOption && pChild->nWidthOption )
{
- ULONG nTabWidth = pChild->nWidthOption;
+ sal_uLong nTabWidth = pChild->nWidthOption;
if( nTabWidth >= nAbsMinTableCnts )
{
nMaxTableCnts = nTabWidth;
@@ -615,14 +622,14 @@ void SwHTMLTableLayout::AutoLayoutPass1()
ASSERT( !this, "Sub tables in HTML import?" )
SwHTMLTableLayout *pChild = pCnts->GetTable();
pChild->AutoLayoutPass1();
- ULONG nMaxTableCnts = pChild->nMax;
- ULONG nAbsMinTableCnts = pChild->nMin;
+ sal_uLong nMaxTableCnts = pChild->nMax;
+ sal_uLong nAbsMinTableCnts = pChild->nMin;
// Eine feste Tabellen-Breite wird als Minimum
// und Maximum gleichzeitig uebernommen
if( !pChild->bPrcWidthOption && pChild->nWidthOption )
{
- ULONG nTabWidth = pChild->nWidthOption;
+ sal_uLong nTabWidth = pChild->nWidthOption;
if( nTabWidth >= nAbsMinTableCnts )
{
nMaxTableCnts = nTabWidth;
@@ -659,8 +666,8 @@ void SwHTMLTableLayout::AutoLayoutPass1()
}
// War frueher hinter AddBorderWidth
- BOOL bRelWidth = pCell->IsPrcWidthOption();
- USHORT nWidth = pCell->GetWidthOption();
+ sal_Bool bRelWidth = pCell->IsPrcWidthOption();
+ sal_uInt16 nWidth = pCell->GetWidthOption();
// Eine NOWRAP-Option bezieht sich auf Text und auf
// Tabellen, wird aber bei fester Zellenbreite
@@ -732,9 +739,9 @@ void SwHTMLTableLayout::AutoLayoutPass1()
// unten erklaert.
if( !HasColTags() && nWidth && !bRelWidth )
{
- ULONG nAbsWidth = nWidth, nDummy = 0, nDummy2 = 0;
+ sal_uLong nAbsWidth = nWidth, nDummy = 0, nDummy2 = 0;
AddBorderWidth( nAbsWidth, nDummy, nDummy2,
- i, nColSpan, FALSE );
+ i, nColSpan, sal_False );
if( nAbsWidth >= nMinNoAlignCell )
{
@@ -801,9 +808,9 @@ void SwHTMLTableLayout::AutoLayoutPass1()
{
// absolute Breiten als Minimal- und Maximalbreite
// uebernehmen.
- ULONG nAbsWidth = pColumn->GetWidthOption();
- ULONG nDummy = 0, nDummy2 = 0;
- AddBorderWidth( nAbsWidth, nDummy, nDummy2, i, 1, FALSE );
+ sal_uLong nAbsWidth = pColumn->GetWidthOption();
+ sal_uLong nDummy = 0, nDummy2 = 0;
+ AddBorderWidth( nAbsWidth, nDummy, nDummy2, i, 1, sal_False );
if( nAbsWidth >= pColumn->GetMinNoAlign() )
{
@@ -849,16 +856,16 @@ void SwHTMLTableLayout::AutoLayoutPass1()
{
// Erstmal muss die Breite analog zu den den Spaltenbreiten
// aufbereitet werden
- USHORT nCol = pConstr->GetColumn();
- USHORT nColSpan = pConstr->GetColSpan();
- ULONG nConstrMin = pConstr->GetMinNoAlign();
- ULONG nConstrMax = pConstr->GetMaxNoAlign();
+ sal_uInt16 nCol = pConstr->GetColumn();
+ sal_uInt16 nColSpan = pConstr->GetColSpan();
+ sal_uLong nConstrMin = pConstr->GetMinNoAlign();
+ sal_uLong nConstrMax = pConstr->GetMaxNoAlign();
// jetzt holen wir uns die bisherige Breite der ueberspannten
// Spalten
- ULONG nColsMin = 0;
- ULONG nColsMax = 0;
- for( USHORT j=nCol; j<nCol+nColSpan; j++ )
+ sal_uLong nColsMin = 0;
+ sal_uLong nColsMax = 0;
+ for( sal_uInt16 j=nCol; j<nCol+nColSpan; j++ )
{
SwHTMLTableLayoutColumn *pColumn = GetColumn( j );
nColsMin += pColumn->GetMin();
@@ -868,22 +875,22 @@ void SwHTMLTableLayout::AutoLayoutPass1()
if( nColsMin<nConstrMin )
{
// den Minimalwert anteilig auf die Spalten verteilen
- ULONG nMinD = nConstrMin-nColsMin;
+ sal_uLong nMinD = nConstrMin-nColsMin;
if( nConstrMin > nColsMax )
{
// Anteilig anhand der Mindestbreiten
- USHORT nEndCol = nCol+nColSpan;
- ULONG nDiff = nMinD;
- for( USHORT ic=nCol; ic<nEndCol; ic++ )
+ sal_uInt16 nEndCol = nCol+nColSpan;
+ sal_uLong nDiff = nMinD;
+ for( sal_uInt16 ic=nCol; ic<nEndCol; ic++ )
{
SwHTMLTableLayoutColumn *pColumn = GetColumn( ic );
- ULONG nColMin = pColumn->GetMin();
- ULONG nColMax = pColumn->GetMax();
+ sal_uLong nColMin = pColumn->GetMin();
+ sal_uLong nColMax = pColumn->GetMax();
nMin -= nColMin;
- ULONG nAdd = ic<nEndCol-1 ? (nColMin * nMinD) / nColsMin
+ sal_uLong nAdd = ic<nEndCol-1 ? (nColMin * nMinD) / nColsMin
: nDiff;
nColMin += nAdd;
nMin += nColMin;
@@ -905,11 +912,11 @@ void SwHTMLTableLayout::AutoLayoutPass1()
else
{
// Anteilig anhand der Differenz zwischen Max und Min
- for( USHORT ic=nCol; ic<nCol+nColSpan; ic++ )
+ for( sal_uInt16 ic=nCol; ic<nCol+nColSpan; ic++ )
{
SwHTMLTableLayoutColumn *pColumn = GetColumn( ic );
- ULONG nDiff = pColumn->GetMax()-pColumn->GetMin();
+ sal_uLong nDiff = pColumn->GetMax()-pColumn->GetMin();
if( nMinD < nDiff )
nDiff = nMinD;
@@ -926,9 +933,9 @@ void SwHTMLTableLayout::AutoLayoutPass1()
if( !HasColTags() && nColsMax<nConstrMax )
{
- ULONG nMaxD = nConstrMax-nColsMax;
+ sal_uLong nMaxD = nConstrMax-nColsMax;
- for( USHORT ic=nCol; ic<nCol+nColSpan; ic++ )
+ for( sal_uInt16 ic=nCol; ic<nCol+nColSpan; ic++ )
{
SwHTMLTableLayoutColumn *pColumn = GetColumn( ic );
@@ -959,9 +966,9 @@ void SwHTMLTableLayout::AutoLayoutPass1()
// erhalten und dient als Ausgangsbasis fuer die andern Breiten.
// Es werden auch hier nur die Maximalbreiten beeinflusst!
- ULONG nAbsMin = 0; // absolte Min-Breite alter Spalten mit
+ sal_uLong nAbsMin = 0; // absolte Min-Breite alter Spalten mit
// relativer Breite
- ULONG nRel = 0; // Summe der relativen Breiten aller Spalten
+ sal_uLong nRel = 0; // Summe der relativen Breiten aller Spalten
for( i=0; i<nCols; i++ )
{
SwHTMLTableLayoutColumn *pColumn = GetColumn( i );
@@ -972,7 +979,7 @@ void SwHTMLTableLayout::AutoLayoutPass1()
}
}
- ULONG nQuot = ULONG_MAX;
+ sal_uLong nQuot = ULONG_MAX;
for( i=0; i<nCols; i++ )
{
SwHTMLTableLayoutColumn *pColumn = GetColumn( i );
@@ -982,7 +989,7 @@ void SwHTMLTableLayout::AutoLayoutPass1()
if( pColumn->GetWidthOption() && pColumn->GetMin() )
{
pColumn->SetMax( nAbsMin * pColumn->GetWidthOption() );
- ULONG nColQuot = pColumn->GetMax() / pColumn->GetMin();
+ sal_uLong nColQuot = pColumn->GetMax() / pColumn->GetMin();
if( nColQuot<nQuot )
nQuot = nColQuot;
}
@@ -1007,9 +1014,9 @@ void SwHTMLTableLayout::AutoLayoutPass1()
}
else
{
- USHORT nRel = 0; // Summe der relativen Breiten aller Spalten
- USHORT nRelCols = 0; // Anzahl Spalten mit relativer Angabe
- ULONG nRelMax = 0; // Anteil am Maximum dieser Spalten
+ sal_uInt16 nRel = 0; // Summe der relativen Breiten aller Spalten
+ sal_uInt16 nRelCols = 0; // Anzahl Spalten mit relativer Angabe
+ sal_uLong nRelMax = 0; // Anteil am Maximum dieser Spalten
for( i=0; i<nCols; i++ )
{
ASSERT( nRel<=100, "relative Breite aller Spalten>100%" );
@@ -1018,11 +1025,11 @@ void SwHTMLTableLayout::AutoLayoutPass1()
{
// Sicherstellen, dass die relativen breiten nicht
// ueber 100% landen
- USHORT nColWidth = pColumn->GetWidthOption();
+ sal_uInt16 nColWidth = pColumn->GetWidthOption();
if( nRel+nColWidth > 100 )
{
nColWidth = 100 - nRel;
- pColumn->SetWidthOption( nColWidth, TRUE, FALSE );
+ pColumn->SetWidthOption( nColWidth, sal_True, sal_False );
}
nRelMax += pColumn->GetMax();
nRel = nRel + nColWidth;
@@ -1046,8 +1053,8 @@ void SwHTMLTableLayout::AutoLayoutPass1()
// mit fester Breite. Ist das richtig???
if( nRel < 100 && nRelCols < nCols )
{
- USHORT nRelLeft = 100 - nRel;
- ULONG nFixMax = nMax - nRelMax;
+ sal_uInt16 nRelLeft = 100 - nRel;
+ sal_uLong nFixMax = nMax - nRelMax;
for( i=0; i<nCols; i++ )
{
SwHTMLTableLayoutColumn *pColumn = GetColumn( i );
@@ -1056,16 +1063,16 @@ void SwHTMLTableLayout::AutoLayoutPass1()
pColumn->GetMin() )
{
// den Rest bekommt die naechste Spalte
- USHORT nColWidth =
- (USHORT)((pColumn->GetMax() * nRelLeft) / nFixMax);
- pColumn->SetWidthOption( nColWidth, TRUE, FALSE );
+ sal_uInt16 nColWidth =
+ (sal_uInt16)((pColumn->GetMax() * nRelLeft) / nFixMax);
+ pColumn->SetWidthOption( nColWidth, sal_True, sal_False );
}
}
}
// nun die Maximalbreiten entsprechend anpassen
- ULONG nQuotMax = ULONG_MAX;
- ULONG nOldMax = nMax;
+ sal_uLong nQuotMax = ULONG_MAX;
+ sal_uLong nOldMax = nMax;
nMax = 0;
for( i=0; i<nCols; i++ )
{
@@ -1077,8 +1084,8 @@ void SwHTMLTableLayout::AutoLayoutPass1()
SwHTMLTableLayoutColumn *pColumn = GetColumn( i );
if( pColumn->IsRelWidthOption() && pColumn->GetWidthOption() )
{
- ULONG nNewMax;
- ULONG nColQuotMax;
+ sal_uLong nNewMax;
+ sal_uLong nColQuotMax;
if( !nWidthOption )
{
nNewMax = nOldMax * pColumn->GetWidthOption();
@@ -1126,10 +1133,10 @@ void SwHTMLTableLayout::AutoLayoutPass1()
// nRelAvail ist der auf USHRT_MAX bezogene verfuegbare Platz oder 0
// nAbsSpace ist der Anteil von nAbsAvail, der durch der umgebende Zelle
// fur die Umrandung und den Abstand zum Inhalt reserviert ist.
-void SwHTMLTableLayout::AutoLayoutPass2( USHORT nAbsAvail, USHORT nRelAvail,
- USHORT nAbsLeftSpace,
- USHORT nAbsRightSpace,
- USHORT nParentInhAbsSpace )
+void SwHTMLTableLayout::AutoLayoutPass2( sal_uInt16 nAbsAvail, sal_uInt16 nRelAvail,
+ sal_uInt16 nAbsLeftSpace,
+ sal_uInt16 nAbsRightSpace,
+ sal_uInt16 nParentInhAbsSpace )
{
// Erstmal fuehren wie jede Menge Plausibilaets-Test durch
@@ -1155,7 +1162,7 @@ void SwHTMLTableLayout::AutoLayoutPass2( USHORT nAbsAvail, USHORT nRelAvail,
// vorhandene Filler-Zellen und Abstande angepasst
// Abstand zum Inhalt und Unrandung
- USHORT nAbsLeftFill = 0, nAbsRightFill = 0;
+ sal_uInt16 nAbsLeftFill = 0, nAbsRightFill = 0;
if( !IsTopTable() &&
GetMin() + nAbsLeftSpace + nAbsRightSpace <= nAbsAvail )
{
@@ -1195,10 +1202,10 @@ void SwHTMLTableLayout::AutoLayoutPass2( USHORT nAbsAvail, USHORT nRelAvail,
nRelRightFill = 0;
if( !IsTopTable() && (nAbsLeftFill>0 || nAbsRightFill) )
{
- ULONG nAbsLeftFillL = nAbsLeftFill, nAbsRightFillL = nAbsRightFill;
+ sal_uLong nAbsLeftFillL = nAbsLeftFill, nAbsRightFillL = nAbsRightFill;
- nRelLeftFill = (USHORT)((nAbsLeftFillL * nRelAvail) / nAbsAvail);
- nRelRightFill = (USHORT)((nAbsRightFillL * nRelAvail) / nAbsAvail);
+ nRelLeftFill = (sal_uInt16)((nAbsLeftFillL * nRelAvail) / nAbsAvail);
+ nRelRightFill = (sal_uInt16)((nAbsRightFillL * nRelAvail) / nAbsAvail);
nAbsAvail -= (nAbsLeftFill + nAbsRightFill);
if( nRelAvail )
@@ -1207,8 +1214,8 @@ void SwHTMLTableLayout::AutoLayoutPass2( USHORT nAbsAvail, USHORT nRelAvail,
// Schritt 2: Die absolute Tabellenbreite wird berechnet.
- USHORT nAbsTabWidth = 0;
- bUseRelWidth = FALSE;
+ sal_uInt16 nAbsTabWidth = 0;
+ bUseRelWidth = sal_False;
if( nWidthOption )
{
if( bPrcWidthOption )
@@ -1230,12 +1237,12 @@ void SwHTMLTableLayout::AutoLayoutPass2( USHORT nAbsAvail, USHORT nRelAvail,
// MIB 19.2.98: Wegen fix #47394# spielen wir solche Spielchen
// jetzt doch. Dort war eine Grafik in einer 1%-breiten
// Tabelle und hat da natuerlich nicht hineingepasst.
- nAbsTabWidth = (USHORT)( ((ULONG)nAbsAvail * nWidthOption) / 100 );
+ nAbsTabWidth = (sal_uInt16)( ((sal_uLong)nAbsAvail * nWidthOption) / 100 );
if( IsTopTable() &&
- ( /*MayBeInFlyFrame() ||*/ (ULONG)nAbsTabWidth > nMin ) )
+ ( /*MayBeInFlyFrame() ||*/ (sal_uLong)nAbsTabWidth > nMin ) )
{
nRelAvail = USHRT_MAX;
- bUseRelWidth = TRUE;
+ bUseRelWidth = sal_True;
}
}
else
@@ -1263,7 +1270,7 @@ void SwHTMLTableLayout::AutoLayoutPass2( USHORT nAbsAvail, USHORT nRelAvail,
// Schritt 3: Bestimmen der Spaltenbreiten und ggf. auch der
// absoluten und relativen Tabellenbreiten.
- if( (!IsTopTable() && nMin > (ULONG)nAbsAvail) ||
+ if( (!IsTopTable() && nMin > (sal_uLong)nAbsAvail) ||
nMin > MAX_TABWIDTH )
{
// Wenn
@@ -1281,10 +1288,10 @@ void SwHTMLTableLayout::AutoLayoutPass2( USHORT nAbsAvail, USHORT nRelAvail,
// that are: Every cell's width excluding the borders must be at least
// MINLAY:
- ULONG nRealMin = 0;
- for( USHORT i=0; i<nCols; i++ )
+ sal_uLong nRealMin = 0;
+ for( sal_uInt16 i=0; i<nCols; i++ )
{
- ULONG nRealColMin = MINLAY, nDummy1, nDummy2;
+ sal_uLong nRealColMin = MINLAY, nDummy1, nDummy2;
AddBorderWidth( nRealColMin, nDummy1, nDummy2, i, 1 );
nRealMin += nRealColMin;
}
@@ -1293,30 +1300,30 @@ void SwHTMLTableLayout::AutoLayoutPass2( USHORT nAbsAvail, USHORT nRelAvail,
// "Nichts geht mehr". We cannot get the minimum column widths
// the layout wants to have.
- USHORT nAbs = 0, nRel = 0;
+ sal_uInt16 nAbs = 0, nRel = 0;
SwHTMLTableLayoutColumn *pColumn;
- for( USHORT i=0; i<nCols-1; i++ )
+ for( sal_uInt16 i=0; i<nCols-1; i++ )
{
pColumn = GetColumn( i );
- ULONG nColMin = pColumn->GetMin();
+ sal_uLong nColMin = pColumn->GetMin();
if( nColMin <= USHRT_MAX )
{
pColumn->SetAbsColWidth(
- (USHORT)((nColMin * nAbsTabWidth) / nMin) );
+ (sal_uInt16)((nColMin * nAbsTabWidth) / nMin) );
pColumn->SetRelColWidth(
- (USHORT)((nColMin * nRelTabWidth) / nMin) );
+ (sal_uInt16)((nColMin * nRelTabWidth) / nMin) );
}
else
{
double nColMinD = nColMin;
pColumn->SetAbsColWidth(
- (USHORT)((nColMinD * nAbsTabWidth) / nMin) );
+ (sal_uInt16)((nColMinD * nAbsTabWidth) / nMin) );
pColumn->SetRelColWidth(
- (USHORT)((nColMinD * nRelTabWidth) / nMin) );
+ (sal_uInt16)((nColMinD * nRelTabWidth) / nMin) );
}
- nAbs = nAbs + (USHORT)pColumn->GetAbsColWidth();
- nRel = nRel + (USHORT)pColumn->GetRelColWidth();
+ nAbs = nAbs + (sal_uInt16)pColumn->GetAbsColWidth();
+ nRel = nRel + (sal_uInt16)pColumn->GetRelColWidth();
}
pColumn = GetColumn( nCols-1 );
pColumn->SetAbsColWidth( nAbsTabWidth - nAbs );
@@ -1324,43 +1331,43 @@ void SwHTMLTableLayout::AutoLayoutPass2( USHORT nAbsAvail, USHORT nRelAvail,
}
else
{
- ULONG nDistAbs = nAbsTabWidth - nRealMin;
- ULONG nDistRel = nRelTabWidth - nRealMin;
- ULONG nDistMin = nMin - nRealMin;
- USHORT nAbs = 0, nRel = 0;
+ sal_uLong nDistAbs = nAbsTabWidth - nRealMin;
+ sal_uLong nDistRel = nRelTabWidth - nRealMin;
+ sal_uLong nDistMin = nMin - nRealMin;
+ sal_uInt16 nAbs = 0, nRel = 0;
SwHTMLTableLayoutColumn *pColumn;
- for( USHORT i=0; i<nCols-1; i++ )
+ for( sal_uInt16 i=0; i<nCols-1; i++ )
{
pColumn = GetColumn( i );
- ULONG nColMin = pColumn->GetMin();
- ULONG nRealColMin = MINLAY, nDummy1, nDummy2;
+ sal_uLong nColMin = pColumn->GetMin();
+ sal_uLong nRealColMin = MINLAY, nDummy1, nDummy2;
AddBorderWidth( nRealColMin, nDummy1, nDummy2, i, 1 );
if( nColMin <= USHRT_MAX )
{
pColumn->SetAbsColWidth(
- (USHORT)((((nColMin-nRealColMin) * nDistAbs) / nDistMin) + nRealColMin) );
+ (sal_uInt16)((((nColMin-nRealColMin) * nDistAbs) / nDistMin) + nRealColMin) );
pColumn->SetRelColWidth(
- (USHORT)((((nColMin-nRealColMin) * nDistRel) / nDistMin) + nRealColMin) );
+ (sal_uInt16)((((nColMin-nRealColMin) * nDistRel) / nDistMin) + nRealColMin) );
}
else
{
double nColMinD = nColMin;
pColumn->SetAbsColWidth(
- (USHORT)((((nColMinD-nRealColMin) * nDistAbs) / nDistMin) + nRealColMin) );
+ (sal_uInt16)((((nColMinD-nRealColMin) * nDistAbs) / nDistMin) + nRealColMin) );
pColumn->SetRelColWidth(
- (USHORT)((((nColMinD-nRealColMin) * nDistRel) / nDistMin) + nRealColMin) );
+ (sal_uInt16)((((nColMinD-nRealColMin) * nDistRel) / nDistMin) + nRealColMin) );
}
- nAbs = nAbs + (USHORT)pColumn->GetAbsColWidth();
- nRel = nRel + (USHORT)pColumn->GetRelColWidth();
+ nAbs = nAbs + (sal_uInt16)pColumn->GetAbsColWidth();
+ nRel = nRel + (sal_uInt16)pColumn->GetRelColWidth();
}
pColumn = GetColumn( nCols-1 );
pColumn->SetAbsColWidth( nAbsTabWidth - nAbs );
pColumn->SetRelColWidth( nRelTabWidth - nRel );
}
}
- else if( nMax <= (ULONG)(nAbsTabWidth ? nAbsTabWidth : nAbsAvail) )
+ else if( nMax <= (sal_uLong)(nAbsTabWidth ? nAbsTabWidth : nAbsAvail) )
{
// Wenn
// - die Tabelle eine fixe Breite besitzt und das Maximum der
@@ -1372,7 +1379,7 @@ void SwHTMLTableLayout::AutoLayoutPass2( USHORT nAbsAvail, USHORT nRelAvail,
// Keine fixe Breite, dann das Maximum nehmen.
if( !nAbsTabWidth )
- nAbsTabWidth = (USHORT)nMax;
+ nAbsTabWidth = (sal_uInt16)nMax;
// Eine Top-Table darf auch beriter werden als der verfuegbare Platz.
if( nAbsTabWidth > nAbsAvail )
@@ -1384,14 +1391,14 @@ void SwHTMLTableLayout::AutoLayoutPass2( USHORT nAbsAvail, USHORT nRelAvail,
// Nur den Anteil der relativen Breite verwenden, der auch fuer
// die absolute Breite verwendet wuerde.
- ULONG nAbsTabWidthL = nAbsTabWidth;
+ sal_uLong nAbsTabWidthL = nAbsTabWidth;
nRelTabWidth =
- ( nRelAvail ? (USHORT)((nAbsTabWidthL * nRelAvail) / nAbsAvail)
+ ( nRelAvail ? (sal_uInt16)((nAbsTabWidthL * nRelAvail) / nAbsAvail)
: nAbsTabWidth );
// Gibt es Spalten mit und Spalten ohne %-Angabe?
- ULONG nFixMax = nMax;
- for( USHORT i=0; i<nCols; i++ )
+ sal_uLong nFixMax = nMax;
+ for( sal_uInt16 i=0; i<nCols; i++ )
{
const SwHTMLTableLayoutColumn *pColumn = GetColumn( i );
if( pColumn->IsRelWidthOption() && pColumn->GetWidthOption()>0 )
@@ -1411,9 +1418,9 @@ void SwHTMLTableLayout::AutoLayoutPass2( USHORT nAbsAvail, USHORT nRelAvail,
// werden zuerst die fixen Breiten entsprechend korrigiert
// eingestellt und erst danach die relativen.
- USHORT nAbs = 0, nRel = 0;
- USHORT nFixedCols = 0;
- USHORT i;
+ sal_uInt16 nAbs = 0, nRel = 0;
+ sal_uInt16 nFixedCols = 0;
+ sal_uInt16 i;
for( i = 0; i < nCols; i++ )
{
@@ -1422,21 +1429,21 @@ void SwHTMLTableLayout::AutoLayoutPass2( USHORT nAbsAvail, USHORT nRelAvail,
{
// Die Spalte behaelt ihre Breite bei.
nFixedCols++;
- ULONG nColMax = pColumn->GetMax();
- pColumn->SetAbsColWidth( (USHORT)nColMax );
+ sal_uLong nColMax = pColumn->GetMax();
+ pColumn->SetAbsColWidth( (sal_uInt16)nColMax );
- ULONG nRelColWidth =
+ sal_uLong nRelColWidth =
(nColMax * nRelTabWidth) / nAbsTabWidth;
- ULONG nChkWidth =
+ sal_uLong nChkWidth =
(nRelColWidth * nAbsTabWidth) / nRelTabWidth;
if( nChkWidth < nColMax )
nRelColWidth++;
else if( nChkWidth > nColMax )
nRelColWidth--;
- pColumn->SetRelColWidth( (USHORT)nRelColWidth );
+ pColumn->SetRelColWidth( (sal_uInt16)nRelColWidth );
- nAbs = nAbs + (USHORT)nColMax;
- nRel = nRel + (USHORT)nRelColWidth;
+ nAbs = nAbs + (sal_uInt16)nColMax;
+ nRel = nRel + (sal_uInt16)nRelColWidth;
}
}
@@ -1445,9 +1452,9 @@ void SwHTMLTableLayout::AutoLayoutPass2( USHORT nAbsAvail, USHORT nRelAvail,
// nAbs, so dass man gleich nFixMax haette nehmen koennen.
// Der Code ist so aber verstaendlicher.
ASSERT( nFixMax == nAbs, "Zwei Schleifen, zwei Summen?" )
- ULONG nDistMax = nMax - nFixMax;
- USHORT nDistAbsTabWidth = nAbsTabWidth - nAbs;
- USHORT nDistRelTabWidth = nRelTabWidth - nRel;
+ sal_uLong nDistMax = nMax - nFixMax;
+ sal_uInt16 nDistAbsTabWidth = nAbsTabWidth - nAbs;
+ sal_uInt16 nDistRelTabWidth = nRelTabWidth - nRel;
for( i=0; i<nCols; i++ )
{
@@ -1463,11 +1470,11 @@ void SwHTMLTableLayout::AutoLayoutPass2( USHORT nAbsAvail, USHORT nRelAvail,
}
else
{
- ULONG nColMax = pColumn->GetMax();
+ sal_uLong nColMax = pColumn->GetMax();
pColumn->SetAbsColWidth(
- (USHORT)((nColMax * nDistAbsTabWidth) / nDistMax) );
+ (sal_uInt16)((nColMax * nDistAbsTabWidth) / nDistMax) );
pColumn->SetRelColWidth(
- (USHORT)((nColMax * nDistRelTabWidth) / nDistMax) );
+ (sal_uInt16)((nColMax * nDistRelTabWidth) / nDistMax) );
}
nAbs = nAbs + pColumn->GetAbsColWidth();
nRel = nRel + pColumn->GetRelColWidth();
@@ -1479,13 +1486,13 @@ void SwHTMLTableLayout::AutoLayoutPass2( USHORT nAbsAvail, USHORT nRelAvail,
{
// nein, dann den zu verteilenden Platz auf alle Spalten
// gleichmaessig vertilen.
- for( USHORT i=0; i<nCols; i++ )
+ for( sal_uInt16 i=0; i<nCols; i++ )
{
- ULONG nColMax = GetColumn( i )->GetMax();
+ sal_uLong nColMax = GetColumn( i )->GetMax();
GetColumn( i )->SetAbsColWidth(
- (USHORT)((nColMax * nAbsTabWidth) / nMax) );
+ (sal_uInt16)((nColMax * nAbsTabWidth) / nMax) );
GetColumn( i )->SetRelColWidth(
- (USHORT)((nColMax * nRelTabWidth) / nMax) );
+ (sal_uInt16)((nColMax * nRelTabWidth) / nMax) );
}
}
}
@@ -1496,7 +1503,7 @@ void SwHTMLTableLayout::AutoLayoutPass2( USHORT nAbsAvail, USHORT nRelAvail,
if( !nAbsTabWidth )
nAbsTabWidth = nAbsAvail;
if( nAbsTabWidth < nMin )
- nAbsTabWidth = (USHORT)nMin;
+ nAbsTabWidth = (sal_uInt16)nMin;
if( nAbsTabWidth > nAbsAvail )
{
@@ -1505,25 +1512,25 @@ void SwHTMLTableLayout::AutoLayoutPass2( USHORT nAbsAvail, USHORT nRelAvail,
nAbsAvail = nAbsTabWidth;
}
- ULONG nAbsTabWidthL = nAbsTabWidth;
+ sal_uLong nAbsTabWidthL = nAbsTabWidth;
nRelTabWidth =
- ( nRelAvail ? (USHORT)((nAbsTabWidthL * nRelAvail) / nAbsAvail)
+ ( nRelAvail ? (sal_uInt16)((nAbsTabWidthL * nRelAvail) / nAbsAvail)
: nAbsTabWidth );
double nW = nAbsTabWidth - nMin;
double nD = (nMax==nMin ? 1 : nMax-nMin);
- USHORT nAbs = 0, nRel = 0;
- for( USHORT i=0; i<nCols-1; i++ )
+ sal_uInt16 nAbs = 0, nRel = 0;
+ for( sal_uInt16 i=0; i<nCols-1; i++ )
{
double nd = GetColumn( i )->GetMax() - GetColumn( i )->GetMin();
- ULONG nAbsColWidth = GetColumn( i )->GetMin() + (ULONG)((nd*nW)/nD);
- ULONG nRelColWidth = nRelAvail
+ sal_uLong nAbsColWidth = GetColumn( i )->GetMin() + (sal_uLong)((nd*nW)/nD);
+ sal_uLong nRelColWidth = nRelAvail
? (nAbsColWidth * nRelTabWidth) / nAbsTabWidth
: nAbsColWidth;
- GetColumn( i )->SetAbsColWidth( (USHORT)nAbsColWidth );
- GetColumn( i )->SetRelColWidth( (USHORT)nRelColWidth );
- nAbs = nAbs + (USHORT)nAbsColWidth;
- nRel = nRel + (USHORT)nRelColWidth;
+ GetColumn( i )->SetAbsColWidth( (sal_uInt16)nAbsColWidth );
+ GetColumn( i )->SetRelColWidth( (sal_uInt16)nRelColWidth );
+ nAbs = nAbs + (sal_uInt16)nAbsColWidth;
+ nRel = nRel + (sal_uInt16)nRelColWidth;
}
GetColumn( nCols-1 )->SetAbsColWidth( nAbsTabWidth - nAbs );
GetColumn( nCols-1 )->SetRelColWidth( nRelTabWidth - nRel );
@@ -1539,9 +1546,9 @@ void SwHTMLTableLayout::AutoLayoutPass2( USHORT nAbsAvail, USHORT nRelAvail,
{
// Die Breite von zusaetzlichen Zellen zur Ausrichtung der
// inneren Tabelle bestimmen
- USHORT nAbsDist = (USHORT)(nAbsAvail-nAbsTabWidth);
- USHORT nRelDist = (USHORT)(nRelAvail-nRelTabWidth);
- USHORT nParentInhAbsLeftSpace = 0, nParentInhAbsRightSpace = 0;
+ sal_uInt16 nAbsDist = (sal_uInt16)(nAbsAvail-nAbsTabWidth);
+ sal_uInt16 nRelDist = (sal_uInt16)(nRelAvail-nRelTabWidth);
+ sal_uInt16 nParentInhAbsLeftSpace = 0, nParentInhAbsRightSpace = 0;
// Groesse und Position der zusaetzlichen Zellen bestimmen
switch( eTableAdjust )
@@ -1553,10 +1560,10 @@ void SwHTMLTableLayout::AutoLayoutPass2( USHORT nAbsAvail, USHORT nRelAvail,
break;
case SVX_ADJUST_CENTER:
{
- USHORT nAbsLeftDist = nAbsDist / 2;
+ sal_uInt16 nAbsLeftDist = nAbsDist / 2;
nAbsLeftFill = nAbsLeftFill + nAbsLeftDist;
nAbsRightFill += nAbsDist - nAbsLeftDist;
- USHORT nRelLeftDist = nRelDist / 2;
+ sal_uInt16 nRelLeftDist = nRelDist / 2;
nRelLeftFill = nRelLeftFill + nRelLeftDist;
nRelRightFill += nRelDist - nRelLeftDist;
nParentInhAbsLeftSpace = nParentInhAbsSpace / 2;
@@ -1607,32 +1614,32 @@ void SwHTMLTableLayout::AutoLayoutPass2( USHORT nAbsAvail, USHORT nRelAvail,
}
}
-static BOOL lcl_ResizeLine( const SwTableLine*& rpLine, void* pPara );
+static sal_Bool lcl_ResizeLine( const SwTableLine*& rpLine, void* pPara );
-static BOOL lcl_ResizeBox( const SwTableBox*& rpBox, void* pPara )
+static sal_Bool lcl_ResizeBox( const SwTableBox*& rpBox, void* pPara )
{
- USHORT *pWidth = (USHORT *)pPara;
+ sal_uInt16 *pWidth = (sal_uInt16 *)pPara;
if( !rpBox->GetSttNd() )
{
- USHORT nWidth = 0;
+ sal_uInt16 nWidth = 0;
((SwTableBox *)rpBox)->GetTabLines().ForEach( &lcl_ResizeLine, &nWidth );
rpBox->GetFrmFmt()->SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE, nWidth, 0 ));
*pWidth = *pWidth + nWidth;
}
else
{
- *pWidth = *pWidth + (USHORT)rpBox->GetFrmFmt()->GetFrmSize().GetSize().Width();
+ *pWidth = *pWidth + (sal_uInt16)rpBox->GetFrmFmt()->GetFrmSize().GetSize().Width();
}
- return TRUE;
+ return sal_True;
}
-static BOOL lcl_ResizeLine( const SwTableLine*& rpLine, void* pPara )
+static sal_Bool lcl_ResizeLine( const SwTableLine*& rpLine, void* pPara )
{
- USHORT *pWidth = (USHORT *)pPara;
+ sal_uInt16 *pWidth = (sal_uInt16 *)pPara;
#ifdef DBG_UTIL
- USHORT nOldWidth = *pWidth;
+ sal_uInt16 nOldWidth = *pWidth;
#endif
*pWidth = 0;
((SwTableLine *)rpLine)->GetTabBoxes().ForEach( &lcl_ResizeBox, pWidth );
@@ -1642,13 +1649,13 @@ static BOOL lcl_ResizeLine( const SwTableLine*& rpLine, void* pPara )
"Zeilen einer Box sind unterschiedlich lang" );
#endif
- return TRUE;
+ return sal_True;
}
-void SwHTMLTableLayout::SetWidths( BOOL bCallPass2, USHORT nAbsAvail,
- USHORT nRelAvail, USHORT nAbsLeftSpace,
- USHORT nAbsRightSpace,
- USHORT nParentInhAbsSpace )
+void SwHTMLTableLayout::SetWidths( sal_Bool bCallPass2, sal_uInt16 nAbsAvail,
+ sal_uInt16 nRelAvail, sal_uInt16 nAbsLeftSpace,
+ sal_uInt16 nAbsRightSpace,
+ sal_uInt16 nParentInhAbsSpace )
{
// SetWidth muss am Ende einmal mehr fuer jede Zelle durchlaufen
// worden sein.
@@ -1664,9 +1671,9 @@ void SwHTMLTableLayout::SetWidths( BOOL bCallPass2, USHORT nAbsAvail,
// Da die Boxen nichts von der HTML-Tabellen-Struktur wissen, wird
// ueber die HTML-Tabellen-Struktur iteriert. Fuer Tabellen in Tabellen
// in Tabellen wird rekursiv SetWidth aufgerufen.
- for( USHORT i=0; i<nRows; i++ )
+ for( sal_uInt16 i=0; i<nRows; i++ )
{
- for( USHORT j=0; j<nCols; j++ )
+ for( sal_uInt16 j=0; j<nCols; j++ )
{
SwHTMLTableLayoutCell *pCell = GetCell( i, j );
@@ -1680,11 +1687,11 @@ void SwHTMLTableLayout::SetWidths( BOOL bCallPass2, USHORT nAbsAvail,
}
else
{
- USHORT nAbs = 0, nRel = 0, nLSpace = 0, nRSpace = 0,
+ sal_uInt16 nAbs = 0, nRel = 0, nLSpace = 0, nRSpace = 0,
nInhSpace = 0;
if( bCallPass2 )
{
- USHORT nColSpan = pCell->GetColSpan();
+ sal_uInt16 nColSpan = pCell->GetColSpan();
GetAvail( j, nColSpan, nAbs, nRel );
nLSpace = GetLeftCellSpace( j, nColSpan );
nRSpace = GetRightCellSpace( j, nColSpan );
@@ -1709,7 +1716,7 @@ void SwHTMLTableLayout::SetWidths( BOOL bCallPass2, USHORT nAbsAvail,
// stattdessen die Breiten der Filler-Zellen gesetzt.
if( IsTopTable() )
{
- USHORT nCalcTabWidth = 0;
+ sal_uInt16 nCalcTabWidth = 0;
((SwTable *)pSwTable)->GetTabLines().ForEach( &lcl_ResizeLine,
&nCalcTabWidth );
ASSERT( Abs( nRelTabWidth-nCalcTabWidth ) < COLFUZZY,
@@ -1722,9 +1729,9 @@ void SwHTMLTableLayout::SetWidths( BOOL bCallPass2, USHORT nAbsAvail,
((SwTable *)pSwTable)->LockModify();
SwFmtFrmSize aFrmSize( pFrmFmt->GetFrmSize() );
aFrmSize.SetWidth( nRelTabWidth );
- BOOL bRel = bUseRelWidth &&
+ sal_Bool bRel = bUseRelWidth &&
text::HoriOrientation::FULL!=pFrmFmt->GetHoriOrient().GetHoriOrient();
- aFrmSize.SetWidthPercent( (BYTE)(bRel ? nWidthOption : 0) );
+ aFrmSize.SetWidthPercent( (sal_uInt8)(bRel ? nWidthOption : 0) );
pFrmFmt->SetFmtAttr( aFrmSize );
((SwTable *)pSwTable)->UnlockModify();
@@ -1742,7 +1749,7 @@ void SwHTMLTableLayout::SetWidths( BOOL bCallPass2, USHORT nAbsAvail,
// Bei %-Angaben wird die Breite auf das Minimum gesetzt.
aFlyFrmSize.SetWidth( nMin > USHRT_MAX ? USHRT_MAX
: nMin );
- aFlyFrmSize.SetWidthPercent( (BYTE)nWidthOption );
+ aFlyFrmSize.SetWidthPercent( (sal_uInt8)nWidthOption );
}
pFlyFrmFmt->SetFmtAttr( aFlyFrmSize );
}
@@ -1756,7 +1763,7 @@ void SwHTMLTableLayout::SetWidths( BOOL bCallPass2, USHORT nAbsAvail,
// checke doch mal ob die Tabellen korrekte Breiten haben
SwTwips nSize = pSwTable->GetFrmFmt()->GetFrmSize().GetWidth();
const SwTableLines& rLines = pSwTable->GetTabLines();
- for( USHORT n = 0; n < rLines.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rLines.Count(); ++n )
_CheckBoxWidth( *rLines[ n ], nSize );
}
#endif
@@ -1777,7 +1784,7 @@ void SwHTMLTableLayout::SetWidths( BOOL bCallPass2, USHORT nAbsAvail,
}
}
-void SwHTMLTableLayout::_Resize( USHORT nAbsAvail, BOOL bRecalc )
+void SwHTMLTableLayout::_Resize( sal_uInt16 nAbsAvail, sal_Bool bRecalc )
{
// Wenn bRecalc gestzt ist, hat sich am Inhalt der Tabelle etwas
// geaendert. Es muss dann der erste Pass noch einmal durchgefuehrt
@@ -1791,10 +1798,14 @@ void SwHTMLTableLayout::_Resize( USHORT nAbsAvail, BOOL bRecalc )
// Sonst koennen die Breiten gesetzt werden, wobei zuvor aber jewils
// noch der Pass 2 laufen muss.
- SetWidths( TRUE, nAbsAvail );
+ SetWidths( sal_True, nAbsAvail );
if ( pRoot && pRoot->IsCallbackActionEnabled() )
+<<<<<<< local
pRoot->EndAllAction( TRUE ); //True per VirDev (Browsen ruhiger) //swmod 071108//swmod 071225
+=======
+ pRoot->EndAllAction( sal_True ); //True per VirDev (Browsen ruhiger)
+>>>>>>> other
}
IMPL_STATIC_LINK( SwHTMLTableLayout, DelayedResize_Impl, void*, EMPTYARG )
@@ -1810,20 +1821,20 @@ IMPL_STATIC_LINK( SwHTMLTableLayout, DelayedResize_Impl, void*, EMPTYARG )
}
-BOOL SwHTMLTableLayout::Resize( USHORT nAbsAvail, BOOL bRecalc,
- BOOL bForce, ULONG nDelay )
+sal_Bool SwHTMLTableLayout::Resize( sal_uInt16 nAbsAvail, sal_Bool bRecalc,
+ sal_Bool bForce, sal_uLong nDelay )
{
if( 0 == nAbsAvail )
- return FALSE;
+ return sal_False;
ASSERT( IsTopTable(), "Resize darf nur an Top-Tabellen aufgerufen werden" );
// Darf die Tabelle uberhaupt Resized werden oder soll sie es trotzdem?
if( bMustNotResize && !bForce )
- return FALSE;
+ return sal_False;
// Darf ein Recalc der Tabelle durchgefuehrt werden?
if( bMustNotRecalc && !bForce )
- bRecalc = FALSE;
+ bRecalc = sal_False;
const SwDoc *pDoc = GetDoc();
@@ -1833,7 +1844,7 @@ BOOL SwHTMLTableLayout::Resize( USHORT nAbsAvail, BOOL bRecalc,
// weil sond die Umschaltung von relativ nach absolut nicht funktioniert.
if( pDoc->GetCurrentViewShell() && pDoc->GetCurrentViewShell()->GetViewOptions()->getBrowseMode() )
{
- const USHORT nVisAreaWidth = GetBrowseWidthByVisArea( *pDoc );
+ const sal_uInt16 nVisAreaWidth = GetBrowseWidthByVisArea( *pDoc );
if( nVisAreaWidth < nAbsAvail && !FindFlyFrmFmt() )
nAbsAvail = nVisAreaWidth;
}
@@ -1845,7 +1856,7 @@ BOOL SwHTMLTableLayout::Resize( USHORT nAbsAvail, BOOL bRecalc,
bRecalc |= bDelayedResizeRecalc;
nDelayedResizeAbsAvail = nAbsAvail;
- return FALSE;
+ return sal_False;
}
// Optimierung:
@@ -1861,7 +1872,7 @@ BOOL SwHTMLTableLayout::Resize( USHORT nAbsAvail, BOOL bRecalc,
(nLastResizeAbsAvail==nAbsAvail) ||
(nAbsAvail<=nMin && nRelTabWidth==nMin) ||
(!bPrcWidthOption && nAbsAvail>=nMax && nRelTabWidth==nMax) ) )
- return FALSE;
+ return sal_False;
if( nDelay==HTMLTABLE_RESIZE_NOW )
{
@@ -1884,12 +1895,12 @@ BOOL SwHTMLTableLayout::Resize( USHORT nAbsAvail, BOOL bRecalc,
_Resize( nAbsAvail, bRecalc );
}
- return TRUE;
+ return sal_True;
}
-void SwHTMLTableLayout::BordersChanged( USHORT nAbsAvail, BOOL bRecalc )
+void SwHTMLTableLayout::BordersChanged( sal_uInt16 nAbsAvail, sal_Bool bRecalc )
{
- bBordersChanged = TRUE;
+ bBordersChanged = sal_True;
Resize( nAbsAvail, bRecalc );
}
diff --git a/sw/source/core/doc/lineinfo.cxx b/sw/source/core/doc/lineinfo.cxx
index cd1c9b70b69f..c29e7a80c665 100644
--- a/sw/source/core/doc/lineinfo.cxx
+++ b/sw/source/core/doc/lineinfo.cxx
@@ -66,10 +66,10 @@ SwLineNumberInfo::SwLineNumberInfo() :
nCountBy( 5 ),
nDividerCountBy( 3 ),
ePos( LINENUMBER_POS_LEFT ),
- bPaintLineNumbers( FALSE ),
- bCountBlankLines( TRUE ),
- bCountInFlys( FALSE ),
- bRestartEachPage( FALSE )
+ bPaintLineNumbers( sal_False ),
+ bCountBlankLines( sal_True ),
+ bCountInFlys( sal_False ),
+ bRestartEachPage( sal_False )
{
}
@@ -110,7 +110,7 @@ SwLineNumberInfo& SwLineNumberInfo::operator=(const SwLineNumberInfo &rCpy)
return *this;
}
-BOOL SwLineNumberInfo::operator==( const SwLineNumberInfo& rInf ) const
+sal_Bool SwLineNumberInfo::operator==( const SwLineNumberInfo& rInf ) const
{
return GetRegisteredIn() == rInf.GetRegisteredIn() &&
aType.GetNumberingType() == rInf.GetNumType().GetNumberingType() &&
diff --git a/sw/source/core/doc/list.cxx b/sw/source/core/doc/list.cxx
index 42fc6bc7919d..81f139bba99e 100644
--- a/sw/source/core/doc/list.cxx
+++ b/sw/source/core/doc/list.cxx
@@ -60,7 +60,7 @@ class SwListImpl
void ValidateListTree();
void MarkListLevel( const int nListLevel,
- const BOOL bValue );
+ const sal_Bool bValue );
bool IsListLevelMarked( const int nListLevel ) const;
@@ -102,7 +102,7 @@ SwListImpl::SwListImpl( const String sListId,
pNode = pNode->EndOfSectionNode();
if (pNode != &rNodes.GetEndOfContent())
{
- ULONG nIndex = pNode->GetIndex();
+ sal_uLong nIndex = pNode->GetIndex();
nIndex++;
pNode = rNodes[nIndex];
}
@@ -186,7 +186,7 @@ void SwListImpl::ValidateListTree()
}
void SwListImpl::MarkListLevel( const int nListLevel,
- const BOOL bValue )
+ const sal_Bool bValue )
{
if ( bValue )
{
@@ -279,7 +279,7 @@ void SwList::ValidateListTree()
}
void SwList::MarkListLevel( const int nListLevel,
- const BOOL bValue )
+ const sal_Bool bValue )
{
mpListImpl->MarkListLevel( nListLevel, bValue );
}
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 7c70418191c5..74da906022f6 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -89,9 +89,9 @@ using namespace com::sun::star;
extern void ClrContourCache( const SdrObject *pObj ); // TxtFly.Cxx
-inline BOOL GetRealURL( const SwGrfNode& rNd, String& rTxt )
+inline sal_Bool GetRealURL( const SwGrfNode& rNd, String& rTxt )
{
- BOOL bRet = rNd.GetFileFilterNms( &rTxt, 0 );
+ sal_Bool bRet = rNd.GetFileFilterNms( &rTxt, 0 );
if( bRet )
rTxt = URIHelper::removePassword( rTxt, INetURLObject::WAS_ENCODED,
INetURLObject::DECODE_UNAMBIGUOUS);
@@ -100,7 +100,7 @@ inline BOOL GetRealURL( const SwGrfNode& rNd, String& rTxt )
void lcl_PaintReplacement( const SwRect &rRect, const String &rText,
const ViewShell &rSh, const SwNoTxtFrm *pFrm,
- BOOL bDefect )
+ sal_Bool bDefect )
{
static Font *pFont = 0;
if ( !pFont )
@@ -111,7 +111,7 @@ void lcl_PaintReplacement( const SwRect &rRect, const String &rText,
pFont->SetName( String::CreateFromAscii(
RTL_CONSTASCII_STRINGPARAM( "Arial Unicode" )));
pFont->SetFamily( FAMILY_SWISS );
- pFont->SetTransparent( TRUE );
+ pFont->SetTransparent( sal_True );
}
Color aCol( COL_RED );
@@ -119,16 +119,16 @@ void lcl_PaintReplacement( const SwRect &rRect, const String &rText,
const SwFmtURL &rURL = pFrm->FindFlyFrm()->GetFmt()->GetURL();
if( rURL.GetURL().Len() || rURL.GetMap() )
{
- BOOL bVisited = FALSE;
+ sal_Bool bVisited = sal_False;
if ( rURL.GetMap() )
{
ImageMap *pMap = (ImageMap*)rURL.GetMap();
- for( USHORT i = 0; i < pMap->GetIMapObjectCount(); i++ )
+ for( sal_uInt16 i = 0; i < pMap->GetIMapObjectCount(); i++ )
{
IMapObject *pObj = pMap->GetIMapObject( i );
if( rSh.GetDoc()->IsVisitedURL( pObj->GetURL() ) )
{
- bVisited = TRUE;
+ bVisited = sal_True;
break;
}
}
@@ -145,7 +145,7 @@ void lcl_PaintReplacement( const SwRect &rRect, const String &rText,
pFont->SetUnderline( eUnderline );
pFont->SetColor( aCol );
- const BitmapEx& rBmp = ViewShell::GetReplacementBitmap( bDefect != FALSE );
+ const BitmapEx& rBmp = ViewShell::GetReplacementBitmap( bDefect != sal_False );
Graphic::DrawEx( rSh.GetOut(), rText, *pFont, rBmp, rRect.Pos(), rRect.SSize() );
}
@@ -238,8 +238,8 @@ void lcl_ClearArea( const SwFrm &rFrm,
if ( aRegion.Count() )
{
const SvxBrushItem *pItem; const Color *pCol; SwRect aOrigRect;
- if ( rFrm.GetBackgroundBrush( pItem, pCol, aOrigRect, FALSE ) )
- for( USHORT i = 0; i < aRegion.Count(); ++i )
+ if ( rFrm.GetBackgroundBrush( pItem, pCol, aOrigRect, sal_False ) )
+ for( sal_uInt16 i = 0; i < aRegion.Count(); ++i )
::DrawGraphic( pItem, &rOut, aOrigRect, aRegion[i] );
else
{
@@ -247,7 +247,7 @@ void lcl_ClearArea( const SwFrm &rFrm,
rOut.Push( PUSH_FILLCOLOR|PUSH_LINECOLOR );
rOut.SetFillColor( rFrm.getRootFrm()->GetCurrShell()->Imp()->GetRetoucheColor());
rOut.SetLineColor();
- for( USHORT i = 0; i < aRegion.Count(); ++i )
+ for( sal_uInt16 i = 0; i < aRegion.Count(); ++i )
rOut.DrawRect( aRegion[i].SVRect() );
rOut.Pop();
}
@@ -282,7 +282,7 @@ void SwNoTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
GetRealURL( *(SwGrfNode*)pNd, aTxt );
if( !aTxt.Len() )
aTxt = FindFlyFrm()->GetFmt()->GetName();
- lcl_PaintReplacement( Frm(), aTxt, *pSh, this, FALSE );
+ lcl_PaintReplacement( Frm(), aTxt, *pSh, this, sal_False );
}
return;
}
@@ -297,13 +297,13 @@ void SwNoTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
OutputDevice *pOut = pSh->GetOut();
pOut->Push();
- BOOL bClip = TRUE;
+ sal_Bool bClip = sal_True;
PolyPolygon aPoly;
SwNoTxtNode& rNoTNd = *(SwNoTxtNode*)GetNode();
SwGrfNode* pGrfNd = rNoTNd.GetGrfNode();
if( pGrfNd )
- pGrfNd->SetFrameInPaint( TRUE );
+ pGrfNd->SetFrameInPaint( sal_True );
// OD 16.04.2003 #i13147# - add 2nd parameter with value <sal_True> to
// method call <FindFlyFrm().GetContour(..)> to indicate that it is called
@@ -314,7 +314,7 @@ void SwNoTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
)
{
pOut->SetClipRegion( aPoly );
- bClip = FALSE;
+ bClip = sal_False;
}
SwRect aOrigPaint( rRect );
@@ -349,7 +349,7 @@ void SwNoTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
// wenn nicht sichtbar, loesche einfach den angegebenen Bereich
lcl_ClearArea( *this, *pSh->GetOut(), aPaintArea, SwRect() );
if( pGrfNd )
- pGrfNd->SetFrameInPaint( FALSE );
+ pGrfNd->SetFrameInPaint( sal_False );
pOut->Pop();
SfxProgress::LeaveLock();
@@ -358,7 +358,7 @@ void SwNoTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
/*************************************************************************
|*
|* void lcl_CalcRect( Point & aPt, Size & aDim,
-|* USHORT nMirror )
+|* sal_uInt16 nMirror )
|*
|* Beschreibung Errechne die Position und die Groesse der Grafik im
|* Frame, entsprechen der aktuellen Grafik-Attribute
@@ -372,7 +372,7 @@ void SwNoTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
*************************************************************************/
-void lcl_CalcRect( Point& rPt, Size& rDim, USHORT nMirror )
+void lcl_CalcRect( Point& rPt, Size& rDim, sal_uInt16 nMirror )
{
if( nMirror == RES_MIRROR_GRAPH_VERT || nMirror == RES_MIRROR_GRAPH_BOTH )
{
@@ -400,7 +400,7 @@ void lcl_CalcRect( Point& rPt, Size& rDim, USHORT nMirror )
*************************************************************************/
void SwNoTxtFrm::GetGrfArea( SwRect &rRect, SwRect* pOrigRect,
- BOOL ) const
+ sal_Bool ) const
{
// JP 23.01.2001: currently only used for scaling, cropping and mirroring
// the contour of graphics!
@@ -411,7 +411,7 @@ void SwNoTxtFrm::GetGrfArea( SwRect &rRect, SwRect* pOrigRect,
const SwAttrSet& rAttrSet = GetNode()->GetSwAttrSet();
const SwCropGrf& rCrop = rAttrSet.GetCropGrf();
- USHORT nMirror = rAttrSet.GetMirrorGrf().GetValue();
+ sal_uInt16 nMirror = rAttrSet.GetMirrorGrf().GetValue();
if( rAttrSet.GetMirrorGrf().IsGrfToggle() )
{
@@ -563,7 +563,7 @@ void SwNoTxtFrm::MakeAll()
MakePrtArea( rAttrs );
if ( !bValidSize )
- { bValidSize = TRUE;
+ { bValidSize = sal_True;
Format();
}
}
@@ -605,11 +605,11 @@ void SwNoTxtFrm::Format( const SwBorderAttrs * )
|*************************************************************************/
-BOOL SwNoTxtFrm::GetCharRect( SwRect &rRect, const SwPosition& rPos,
+sal_Bool SwNoTxtFrm::GetCharRect( SwRect &rRect, const SwPosition& rPos,
SwCrsrMoveState *pCMS ) const
{
if ( &rPos.nNode.GetNode() != (SwNode*)GetNode() )
- return FALSE;
+ return sal_False;
Calc();
SwRect aFrameRect( Frm() );
@@ -638,17 +638,17 @@ BOOL SwNoTxtFrm::GetCharRect( SwRect &rRect, const SwPosition& rPos,
}
}
- return TRUE;
+ return sal_True;
}
-BOOL SwNoTxtFrm::GetCrsrOfst(SwPosition* pPos, Point& ,
+sal_Bool SwNoTxtFrm::GetCrsrOfst(SwPosition* pPos, Point& ,
SwCrsrMoveState* ) const
{
SwCntntNode* pCNd = (SwCntntNode*)GetNode();
pPos->nNode = *pCNd;
pPos->nContent.Assign( pCNd, 0 );
- return TRUE;
+ return sal_True;
}
#define CLEARCACHE( pNd ) {\
@@ -663,7 +663,7 @@ BOOL SwNoTxtFrm::GetCrsrOfst(SwPosition* pPos, Point& ,
void SwNoTxtFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
- USHORT nWhich = pNew ? pNew->Which() : pOld ? pOld->Which() : 0;
+ sal_uInt16 nWhich = pNew ? pNew->Which() : pOld ? pOld->Which() : 0;
// --> OD 2007-03-06 #i73788#
// no <SwCntntFrm::Modify(..)> for RES_LINKED_GRAPHIC_STREAM_ARRIVED
@@ -676,7 +676,7 @@ void SwNoTxtFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
SwCntntFrm::Modify( pOld, pNew );
}
- BOOL bComplete = TRUE;
+ sal_Bool bComplete = sal_True;
switch( nWhich )
{
@@ -686,7 +686,7 @@ void SwNoTxtFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
case RES_GRF_REREAD_AND_INCACHE:
if( ND_GRFNODE == GetNode()->GetNodeType() )
{
- bComplete = FALSE;
+ bComplete = sal_False;
SwGrfNode* pNd = (SwGrfNode*) GetNode();
ViewShell *pVSh = 0;
@@ -722,10 +722,10 @@ void SwNoTxtFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
case RES_ATTRSET_CHG:
{
- USHORT n;
+ sal_uInt16 n;
for( n = RES_GRFATR_BEGIN; n < RES_GRFATR_END; ++n )
if( SFX_ITEM_SET == ((SwAttrSetChg*)pOld)->GetChgSet()->
- GetItemState( n, FALSE ))
+ GetItemState( n, sal_False ))
{
CLEARCACHE( (SwGrfNode*) GetNode() )
break;
@@ -743,7 +743,7 @@ void SwNoTxtFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
// <--
if ( GetNode()->GetNodeType() == ND_GRFNODE )
{
- bComplete = FALSE;
+ bComplete = sal_False;
SwGrfNode* pNd = (SwGrfNode*) GetNode();
CLEARCACHE( pNd )
@@ -830,7 +830,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
SwGrfNode* pGrfNd = rNoTNd.GetGrfNode();
SwOLENode* pOLENd = rNoTNd.GetOLENode();
- const BOOL bPrn = pOut == rNoTNd.getIDocumentDeviceAccess()->getPrinter( false ) ||
+ const sal_Bool bPrn = pOut == rNoTNd.getIDocumentDeviceAccess()->getPrinter( false ) ||
pOut->GetConnectMetaFile();
const bool bIsChart = pOLENd && ChartPrettyPainter::IsChart( pOLENd->GetOLEObj().GetObject() );
@@ -860,7 +860,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
if( pGrfNd )
{
- BOOL bForceSwap = FALSE, bContinue = TRUE;
+ sal_Bool bForceSwap = sal_False, bContinue = sal_True;
GraphicObject& rGrfObj = pGrfNd->GetGrfObj();
GraphicAttr aGrfAttr;
@@ -898,8 +898,8 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
String aTxt( pGrfNd->GetTitle() );
if ( !aTxt.Len() )
GetRealURL( *pGrfNd, aTxt );
- ::lcl_PaintReplacement( aAlignedGrfArea, aTxt, *pShell, this, FALSE );
- bContinue = FALSE;
+ ::lcl_PaintReplacement( aAlignedGrfArea, aTxt, *pShell, this, sal_False );
+ bContinue = sal_False;
}
else if( rGrfObj.IsCached( pOut, aAlignedGrfArea.Pos(),
aAlignedGrfArea.SSize(), &aGrfAttr ))
@@ -907,17 +907,17 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
rGrfObj.DrawWithPDFHandling( *pOut,
aAlignedGrfArea.Pos(), aAlignedGrfArea.SSize(),
&aGrfAttr );
- bContinue = FALSE;
+ bContinue = sal_False;
}
}
if( bContinue )
{
- const BOOL bSwapped = rGrfObj.IsSwappedOut();
- const BOOL bSwappedIn = 0 != pGrfNd->SwapIn( bPrn );
+ const sal_Bool bSwapped = rGrfObj.IsSwappedOut();
+ const sal_Bool bSwappedIn = 0 != pGrfNd->SwapIn( bPrn );
if( bSwappedIn && rGrfObj.GetGraphic().IsSupportedGraphic())
{
- const BOOL bAnimate = rGrfObj.IsAnimated() &&
+ const sal_Bool bAnimate = rGrfObj.IsAnimated() &&
!pShell->IsPreView() &&
!pShell->GetAccessibilityOptions()->IsStopAnimatedGraphics() &&
// --> FME 2004-06-21 #i9684# Stop animation during printing/pdf export
@@ -951,7 +951,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
}
else
{
- USHORT nResId = 0;
+ sal_uInt16 nResId = 0;
if( bSwappedIn )
{
if( GRAPHIC_NONE == rGrfObj.GetType() )
@@ -970,12 +970,12 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
if ( nResId )
aText = SW_RESSTR( nResId );
- ::lcl_PaintReplacement( aAlignedGrfArea, aText, *pShell, this, TRUE );
+ ::lcl_PaintReplacement( aAlignedGrfArea, aText, *pShell, this, sal_True );
}
//Beim Drucken duerfen wir nicht die Grafiken sammeln...
if( bSwapped && bPrn )
- bForceSwap = TRUE;
+ bForceSwap = sal_True;
}
if( bForceSwap )
pGrfNd->SwapOut();
@@ -993,11 +993,11 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
{
// --> OD 2009-03-05 #i99665#
// Adjust AntiAliasing mode at output device for chart OLE
- const USHORT nFormerAntialiasingAtOutput( pOut->GetAntialiasing() );
+ const sal_uInt16 nFormerAntialiasingAtOutput( pOut->GetAntialiasing() );
if ( pOLENd->IsChart() &&
pShell->Imp()->GetDrawView()->IsAntiAliasing() )
{
- const USHORT nAntialiasingForChartOLE =
+ const sal_uInt16 nAntialiasingForChartOLE =
nFormerAntialiasingAtOutput | ANTIALIASING_PIXELSNAPHAIRLINE;
pOut->SetAntialiasing( nAntialiasingForChartOLE );
}
@@ -1009,7 +1009,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
// Im BrowseModus gibt es nicht unbedingt einen Drucker und
// damit kein JobSetup, also legen wir eines an ...
const JobSetup* pJobSetup = pOLENd->getIDocumentDeviceAccess()->getJobsetup();
- BOOL bDummyJobSetup = 0 == pJobSetup;
+ sal_Bool bDummyJobSetup = 0 == pJobSetup;
if( bDummyJobSetup )
pJobSetup = new JobSetup();
@@ -1064,18 +1064,18 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
}
-BOOL SwNoTxtFrm::IsTransparent() const
+sal_Bool SwNoTxtFrm::IsTransparent() const
{
const ViewShell* pSh = getRootFrm()->GetCurrShell();
if ( !pSh || !pSh->GetViewOptions()->IsGraphic() )
- return TRUE;
+ return sal_True;
const SwGrfNode *pNd;
if( 0 != (pNd = GetNode()->GetGrfNode()) )
return pNd->IsTransparent();
//#29381# OLE sind immer Transparent.
- return TRUE;
+ return sal_True;
}
@@ -1088,7 +1088,7 @@ void SwNoTxtFrm::StopAnimation( OutputDevice* pOut ) const
}
-BOOL SwNoTxtFrm::HasAnimation() const
+sal_Bool SwNoTxtFrm::HasAnimation() const
{
const SwGrfNode* pGrfNd = GetNode()->GetGrfNode();
return pGrfNd && pGrfNd->IsAnimated();
diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx
index b26fe6ff6dcd..bf632eed0c02 100644
--- a/sw/source/core/doc/number.cxx
+++ b/sw/source/core/doc/number.cxx
@@ -70,7 +70,7 @@
using namespace ::com::sun::star;
-USHORT SwNumRule::nRefCount = 0;
+sal_uInt16 SwNumRule::nRefCount = 0;
SwNumFmt* SwNumRule::aBaseFmts[ RULE_END ][ MAXLEVEL ] = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } };
// --> OD 2008-02-11 #newlistlevelattrs#
@@ -81,13 +81,13 @@ char sOutline[] = "Outline";
char* SwNumRule::pDefOutlineName = sOutline;
// #i30312#
-USHORT SwNumRule::aDefNumIndents[ MAXLEVEL ] = {
+sal_uInt16 SwNumRule::aDefNumIndents[ MAXLEVEL ] = {
//inch: 0,5 1,0 1,5 2,0 2,5 3,0 3,5 4,0 4,5 5,0
1440/4, 1440/2, 1440*3/4, 1440, 1440*5/4, 1440*3/2, 1440*7/4, 1440*2,
1440*9/4, 1440*5/2
};
-const SwNumFmt& SwNumRule::Get( USHORT i ) const
+const SwNumFmt& SwNumRule::Get( sal_uInt16 i ) const
{
ASSERT_ID( i < MAXLEVEL && eRuleType < RULE_END, ERR_NUMLEVEL);
return aFmts[ i ]
@@ -99,7 +99,7 @@ const SwNumFmt& SwNumRule::Get( USHORT i ) const
// <--
}
-const SwNumFmt* SwNumRule::GetNumFmt( USHORT i ) const
+const SwNumFmt* SwNumRule::GetNumFmt( sal_uInt16 i ) const
{
const SwNumFmt * pResult = NULL;
@@ -176,13 +176,13 @@ void SwNumRule::SetNumRuleMap(std::hash_map<String, SwNumRule *, StringHash> *
pNumRuleMap = _pNumRuleMap;
}
-USHORT SwNumRule::GetNumIndent( BYTE nLvl )
+sal_uInt16 SwNumRule::GetNumIndent( sal_uInt8 nLvl )
{
ASSERT( MAXLEVEL > nLvl, "NumLevel is out of range" );
return aDefNumIndents[ nLvl ];
}
-USHORT SwNumRule::GetBullIndent( BYTE nLvl )
+sal_uInt16 SwNumRule::GetBullIndent( sal_uInt8 nLvl )
{
ASSERT( MAXLEVEL > nLvl, "NumLevel is out of range" );
return aDefNumIndents[ nLvl ];
@@ -190,7 +190,7 @@ USHORT SwNumRule::GetBullIndent( BYTE nLvl )
-static void lcl_SetRuleChgd( SwTxtNode& rNd, BYTE nLevel )
+static void lcl_SetRuleChgd( SwTxtNode& rNd, sal_uInt8 nLevel )
{
if( rNd.GetActualListLevel() == nLevel )
rNd.NumRuleChgd();
@@ -232,7 +232,7 @@ SwNumFmt::SwNumFmt(const SvxNumberFormat& rNumFmt, SwDoc* pDoc) :
SwCharFmt* pCFmt = pDoc->FindCharFmtByName( rCharStyleName );
if( !pCFmt )
{
- USHORT nId = SwStyleNameMapper::GetPoolIdFromUIName( rCharStyleName,
+ sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName( rCharStyleName,
nsSwGetPoolIdFromName::GET_POOLID_CHRFMT );
pCFmt = nId != USHRT_MAX
? pDoc->GetCharFmtFromPool( nId )
@@ -261,7 +261,7 @@ void SwNumFmt::NotifyGraphicArrived()
}
// #i22362#
-BOOL SwNumFmt::IsEnumeration() const
+sal_Bool SwNumFmt::IsEnumeration() const
{
// --> FME 2004-08-12 #i30655# native numbering did not work any longer
// using this code. Therefore HBRINKM and I agreed upon defining
@@ -270,7 +270,7 @@ BOOL SwNumFmt::IsEnumeration() const
// <--
/*
- BOOL bResult;
+ sal_Bool bResult;
switch(GetNumberingType())
{
@@ -282,12 +282,12 @@ BOOL SwNumFmt::IsEnumeration() const
case SVX_NUM_PAGEDESC:
case SVX_NUM_CHARS_UPPER_LETTER_N:
case SVX_NUM_CHARS_LOWER_LETTER_N:
- bResult = TRUE;
+ bResult = sal_True;
break;
default:
- bResult = FALSE;
+ bResult = sal_False;
}
return bResult;
@@ -295,20 +295,20 @@ BOOL SwNumFmt::IsEnumeration() const
}
// #i29560#
-BOOL SwNumFmt::IsItemize() const
+sal_Bool SwNumFmt::IsItemize() const
{
- BOOL bResult;
+ sal_Bool bResult;
switch(GetNumberingType())
{
case SVX_NUM_CHAR_SPECIAL:
case SVX_NUM_BITMAP:
- bResult = TRUE;
+ bResult = sal_True;
break;
default:
- bResult = FALSE;
+ bResult = sal_False;
}
return bResult;
@@ -331,10 +331,15 @@ SwNumFmt& SwNumFmt::operator=( const SwNumFmt& rNumFmt)
/* -----------------------------23.02.01 09:28--------------------------------
---------------------------------------------------------------------------*/
-BOOL SwNumFmt::operator==( const SwNumFmt& rNumFmt) const
+sal_Bool SwNumFmt::operator==( const SwNumFmt& rNumFmt) const
{
+<<<<<<< local
BOOL bRet = SvxNumberFormat::operator==(rNumFmt) &&
GetRegisteredIn() == rNumFmt.GetRegisteredIn();
+=======
+ sal_Bool bRet = SvxNumberFormat::operator==(rNumFmt) &&
+ pRegisteredIn == rNumFmt.pRegisteredIn;
+>>>>>>> other
return bRet;
}
@@ -423,13 +428,13 @@ sal_Int16 SwNumFmt::GetVertOrient() const
---------------------------------------------------------------------------*/
void SwNumFmt::UpdateNumNodes( SwDoc* pDoc )
{
- BOOL bDocIsModified = pDoc->IsModified();
- BOOL bFnd = FALSE;
+ sal_Bool bDocIsModified = pDoc->IsModified();
+ sal_Bool bFnd = sal_False;
const SwNumRule* pRule;
- for( USHORT n = pDoc->GetNumRuleTbl().Count(); !bFnd && n; )
+ for( sal_uInt16 n = pDoc->GetNumRuleTbl().Count(); !bFnd && n; )
{
pRule = pDoc->GetNumRuleTbl()[ --n ];
- for( BYTE i = 0; i < MAXLEVEL; ++i )
+ for( sal_uInt8 i = 0; i < MAXLEVEL; ++i )
if( pRule->GetNumFmt( i ) == this )
{
// --> OD 2008-02-19 #refactorlists#
@@ -437,7 +442,7 @@ void SwNumFmt::UpdateNumNodes( SwDoc* pDoc )
// SwModify* pMod;
// const SfxPoolItem* pItem;
-// USHORT k, nMaxItems = pDoc->GetAttrPool().GetItemCount(
+// sal_uInt16 k, nMaxItems = pDoc->GetAttrPool().GetItemCount(
// RES_PARATR_NUMRULE );
// for( k = 0; k < nMaxItems; ++k )
// if( 0 != (pItem = pDoc->GetAttrPool().GetItem(
@@ -451,7 +456,7 @@ void SwNumFmt::UpdateNumNodes( SwDoc* pDoc )
// SwNumRuleInfo aInfo( rRuleNm );
// pMod->GetInfo( aInfo );
-// for( ULONG nFirst = 0, nLast = aInfo.GetList().Count();
+// for( sal_uLong nFirst = 0, nLast = aInfo.GetList().Count();
// nFirst < nLast; ++nFirst )
// lcl_SetRuleChgd(
// *aInfo.GetList().GetObject( nFirst ), i );
@@ -467,7 +472,7 @@ void SwNumFmt::UpdateNumNodes( SwDoc* pDoc )
lcl_SetRuleChgd( *(*aIter), i );
}
// <--
- bFnd = TRUE;
+ bFnd = sal_True;
break;
}
}
@@ -499,7 +504,7 @@ long int SwNumRule::nInstances = 0;
SwNumRule::SwNumRule( const String& rNm,
const SvxNumberFormat::SvxNumPositionAndSpaceMode eDefaultNumberFormatPositionAndSpaceMode,
SwNumRuleType eType,
- BOOL bAutoFlg )
+ sal_Bool bAutoFlg )
: maTxtNodeList(),
// --> OD 2008-03-03 #refactorlists#
maParagraphStyleList(),
@@ -511,9 +516,9 @@ SwNumRule::SwNumRule( const String& rNm,
nPoolHelpId( USHRT_MAX ),
nPoolHlpFileId( UCHAR_MAX ),
bAutoRuleFlag( bAutoFlg ),
- bInvalidRuleFlag( TRUE ),
- bContinusNum( FALSE ),
- bAbsSpaces( FALSE ),
+ bInvalidRuleFlag( sal_True ),
+ bContinusNum( sal_False ),
+ bAbsSpaces( sal_False ),
// --> OD 2005-10-21 - initialize member <mbCountPhantoms>
mbCountPhantoms( true ),
// <--
@@ -531,7 +536,7 @@ SwNumRule::SwNumRule( const String& rNm,
if( !nRefCount++ ) // zum erstmal, also initialisiern
{
SwNumFmt* pFmt;
- BYTE n;
+ sal_uInt8 n;
// numbering:
// position-and-space mode LABEL_WIDTH_AND_POSITION:
@@ -631,7 +636,7 @@ SwNumRule::SwNumRule( const SwNumRule& rNumRule )
nPoolHelpId( rNumRule.GetPoolHelpId() ),
nPoolHlpFileId( rNumRule.GetPoolHlpFileId() ),
bAutoRuleFlag( rNumRule.bAutoRuleFlag ),
- bInvalidRuleFlag( TRUE ),
+ bInvalidRuleFlag( sal_True ),
bContinusNum( rNumRule.bContinusNum ),
bAbsSpaces( rNumRule.bAbsSpaces ),
// --> OD 2005-10-21 - initialize member <mbCountPhantoms>
@@ -650,14 +655,14 @@ SwNumRule::SwNumRule( const SwNumRule& rNumRule )
++nRefCount;
memset( aFmts, 0, sizeof( aFmts ));
- for( USHORT n = 0; n < MAXLEVEL; ++n )
+ for( sal_uInt16 n = 0; n < MAXLEVEL; ++n )
if( rNumRule.aFmts[ n ] )
Set( n, *rNumRule.aFmts[ n ] );
}
SwNumRule::~SwNumRule()
{
- for( USHORT n = 0; n < MAXLEVEL; ++n )
+ for( sal_uInt16 n = 0; n < MAXLEVEL; ++n )
delete aFmts[ n ];
if (pNumRuleMap)
@@ -696,7 +701,7 @@ SwNumRule::~SwNumRule()
void SwNumRule::CheckCharFmts( SwDoc* pDoc )
{
SwCharFmt* pFmt;
- for( BYTE n = 0; n < MAXLEVEL; ++n )
+ for( sal_uInt8 n = 0; n < MAXLEVEL; ++n )
if( aFmts[ n ] && 0 != ( pFmt = aFmts[ n ]->GetCharFmt() ) &&
pFmt->GetDoc() != pDoc )
{
@@ -712,13 +717,13 @@ SwNumRule& SwNumRule::operator=( const SwNumRule& rNumRule )
{
if( this != &rNumRule )
{
- for( USHORT n = 0; n < MAXLEVEL; ++n )
+ for( sal_uInt16 n = 0; n < MAXLEVEL; ++n )
Set( n, rNumRule.aFmts[ n ] );
eRuleType = rNumRule.eRuleType;
sName = rNumRule.sName;
bAutoRuleFlag = rNumRule.bAutoRuleFlag;
- bInvalidRuleFlag = TRUE;
+ bInvalidRuleFlag = sal_True;
bContinusNum = rNumRule.bContinusNum;
bAbsSpaces = rNumRule.bAbsSpaces;
nPoolFmtId = rNumRule.GetPoolFmtId();
@@ -729,9 +734,9 @@ SwNumRule& SwNumRule::operator=( const SwNumRule& rNumRule )
}
-BOOL SwNumRule::operator==( const SwNumRule& rRule ) const
+sal_Bool SwNumRule::operator==( const SwNumRule& rRule ) const
{
- BOOL bRet = eRuleType == rRule.eRuleType &&
+ sal_Bool bRet = eRuleType == rRule.eRuleType &&
sName == rRule.sName &&
bAutoRuleFlag == rRule.bAutoRuleFlag &&
bContinusNum == rRule.bContinusNum &&
@@ -741,10 +746,10 @@ BOOL SwNumRule::operator==( const SwNumRule& rRule ) const
nPoolHlpFileId == rRule.GetPoolHlpFileId();
if( bRet )
{
- for( BYTE n = 0; n < MAXLEVEL; ++n )
+ for( sal_uInt8 n = 0; n < MAXLEVEL; ++n )
if( !( rRule.Get( n ) == Get( n ) ))
{
- bRet = FALSE;
+ bRet = sal_False;
break;
}
}
@@ -752,7 +757,7 @@ BOOL SwNumRule::operator==( const SwNumRule& rRule ) const
}
-void SwNumRule::Set( USHORT i, const SwNumFmt& rNumFmt )
+void SwNumRule::Set( sal_uInt16 i, const SwNumFmt& rNumFmt )
{
ASSERT( i < MAXLEVEL, "Serious defect, please inform OD" )
if( i < MAXLEVEL )
@@ -761,12 +766,12 @@ void SwNumRule::Set( USHORT i, const SwNumFmt& rNumFmt )
{
delete aFmts[ i ];
aFmts[ i ] = new SwNumFmt( rNumFmt );
- bInvalidRuleFlag = TRUE;
+ bInvalidRuleFlag = sal_True;
}
}
}
-void SwNumRule::Set( USHORT i, const SwNumFmt* pNumFmt )
+void SwNumRule::Set( sal_uInt16 i, const SwNumFmt* pNumFmt )
{
ASSERT( i < MAXLEVEL, "Serious defect, please inform OD" )
if( i >= MAXLEVEL )
@@ -777,18 +782,18 @@ void SwNumRule::Set( USHORT i, const SwNumFmt* pNumFmt )
if( pNumFmt )
{
aFmts[ i ] = new SwNumFmt( *pNumFmt );
- bInvalidRuleFlag = TRUE;
+ bInvalidRuleFlag = sal_True;
}
}
else if( !pNumFmt )
- delete pOld, aFmts[ i ] = 0, bInvalidRuleFlag = TRUE;
+ delete pOld, aFmts[ i ] = 0, bInvalidRuleFlag = sal_True;
else if( *pOld != *pNumFmt )
- *pOld = *pNumFmt, bInvalidRuleFlag = TRUE;
+ *pOld = *pNumFmt, bInvalidRuleFlag = sal_True;
}
-String SwNumRule::MakeNumString( const SwNodeNum& rNum, BOOL bInclStrings,
- BOOL bOnlyArabic ) const
+String SwNumRule::MakeNumString( const SwNodeNum& rNum, sal_Bool bInclStrings,
+ sal_Bool bOnlyArabic ) const
{
String aStr;
@@ -800,8 +805,8 @@ String SwNumRule::MakeNumString( const SwNodeNum& rNum, BOOL bInclStrings,
}
String SwNumRule::MakeNumString( const SwNumberTree::tNumberVector & rNumVector,
- const BOOL bInclStrings,
- const BOOL bOnlyArabic,
+ const sal_Bool bInclStrings,
+ const sal_Bool bOnlyArabic,
const unsigned int _nRestrictToThisLevel ) const
{
String aStr;
@@ -816,13 +821,13 @@ String SwNumRule::MakeNumString( const SwNumberTree::tNumberVector & rNumVector,
if (nLevel < MAXLEVEL)
{
- const SwNumFmt& rMyNFmt = Get( static_cast<USHORT>(nLevel) );
+ const SwNumFmt& rMyNFmt = Get( static_cast<sal_uInt16>(nLevel) );
// --> OD 2006-06-02 #b6432095#
// - levels with numbering none has to provide prefix and suffix string
// if( SVX_NUM_NUMBER_NONE != rMyNFmt.GetNumberingType() )
// <--
{
- BYTE i = static_cast<BYTE>(nLevel);
+ sal_uInt8 i = static_cast<sal_uInt8>(nLevel);
if( !IsContinusNum() &&
// --> OD 2006-09-19 #i69672#
@@ -831,7 +836,7 @@ String SwNumRule::MakeNumString( const SwNumberTree::tNumberVector & rNumVector,
// <--
rMyNFmt.GetIncludeUpperLevels() ) // nur der eigene Level ?
{
- BYTE n = rMyNFmt.GetIncludeUpperLevels();
+ sal_uInt8 n = rMyNFmt.GetIncludeUpperLevels();
if( 1 < n )
{
if( i+1 >= n )
@@ -895,7 +900,7 @@ String SwNumRule::MakeRefNumString( const SwNodeNum& rNodeNum,
bool bMakeNumStringForPhantom( false );
if ( pWorkingNodeNum->IsPhantom() )
{
- SwNumFmt aFmt( Get( static_cast<USHORT>(pWorkingNodeNum->GetLevelInListTree()) ) );
+ SwNumFmt aFmt( Get( static_cast<sal_uInt16>(pWorkingNodeNum->GetLevelInListTree()) ) );
bMakeNumStringForPhantom = aFmt.IsEnumeration() &&
SVX_NUM_NUMBER_NONE != aFmt.GetNumberingType();
@@ -914,7 +919,7 @@ String SwNumRule::MakeRefNumString( const SwNodeNum& rNodeNum,
if ( bInclSuperiorNumLabels && pWorkingNodeNum->GetLevelInListTree() > 0 )
{
- BYTE n = Get( static_cast<USHORT>(pWorkingNodeNum->GetLevelInListTree()) ).GetIncludeUpperLevels();
+ sal_uInt8 n = Get( static_cast<sal_uInt16>(pWorkingNodeNum->GetLevelInListTree()) ).GetIncludeUpperLevels();
pWorkingNodeNum = dynamic_cast<SwNodeNum*>(pWorkingNodeNum->GetParent());
// skip parents, whose list label is already contained in the actual list label.
while ( pWorkingNodeNum && n > 1 )
@@ -943,7 +948,7 @@ String SwNumRule::MakeRefNumString( const SwNodeNum& rNodeNum,
SwNumRule& SwNumRule::CopyNumRule( SwDoc* pDoc, const SwNumRule& rNumRule )
{
- for( USHORT n = 0; n < MAXLEVEL; ++n )
+ for( sal_uInt16 n = 0; n < MAXLEVEL; ++n )
{
Set( n, rNumRule.aFmts[ n ] );
if( aFmts[ n ] && aFmts[ n ]->GetCharFmt() &&
@@ -960,7 +965,7 @@ SwNumRule& SwNumRule::CopyNumRule( SwDoc* pDoc, const SwNumRule& rNumRule )
nPoolFmtId = rNumRule.GetPoolFmtId();
nPoolHelpId = rNumRule.GetPoolHelpId();
nPoolHlpFileId = rNumRule.GetPoolHlpFileId();
- bInvalidRuleFlag = TRUE;
+ bInvalidRuleFlag = sal_True;
return *this;
}
/* -----------------30.10.98 08:33-------------------
@@ -968,14 +973,14 @@ SwNumRule& SwNumRule::CopyNumRule( SwDoc* pDoc, const SwNumRule& rNumRule )
* --------------------------------------------------*/
void SwNumRule::SetSvxRule(const SvxNumRule& rNumRule, SwDoc* pDoc)
{
- for( USHORT n = 0; n < MAXLEVEL; ++n )
+ for( sal_uInt16 n = 0; n < MAXLEVEL; ++n )
{
const SvxNumberFormat* pSvxFmt = rNumRule.Get(n);
delete aFmts[n];
aFmts[n] = pSvxFmt ? new SwNumFmt(*pSvxFmt, pDoc) : 0;
}
- bInvalidRuleFlag = TRUE;
+ bInvalidRuleFlag = sal_True;
bContinusNum = rNumRule.IsContinuousNumbering();
}
/* -----------------30.10.98 08:33-------------------
@@ -990,7 +995,7 @@ SvxNumRule SwNumRule::MakeSvxNumRule() const
NUM_RULE ?
SVX_RULETYPE_NUMBERING :
SVX_RULETYPE_OUTLINE_NUMBERING );
- for( USHORT n = 0; n < MAXLEVEL; ++n )
+ for( sal_uInt16 n = 0; n < MAXLEVEL; ++n )
{
SwNumFmt aNumFmt = Get(n);
if(aNumFmt.GetCharFmt())
@@ -1000,7 +1005,7 @@ SvxNumRule SwNumRule::MakeSvxNumRule() const
return aRule;
}
-void SwNumRule::SetInvalidRule(BOOL bFlag)
+void SwNumRule::SetInvalidRule(sal_Bool bFlag)
{
if (bFlag)
{
@@ -1034,11 +1039,11 @@ void SwNumRule::SetInvalidRule(BOOL bFlag)
// --> OD 2008-06-16 #i90078#
// #i23725#, #i23726#
//void SwNumRule::Indent(short nAmount, int nLevel, int nReferenceLevel,
-// BOOL bRelative, BOOL bFirstLine, BOOL bCheckGtZero)
+// sal_Bool bRelative, sal_Bool bFirstLine, sal_Bool bCheckGtZero)
//{
// int nStartLevel = 0;
// int nEndLevel = MAXLEVEL - 1;
-// BOOL bGotInvalid = FALSE;
+// sal_Bool bGotInvalid = sal_False;
// if (nLevel >= 0)
// nStartLevel = nEndLevel = nLevel;
@@ -1051,46 +1056,46 @@ void SwNumRule::SetInvalidRule(BOOL bFlag)
// if (bFirstLine)
// {
// if (nReferenceLevel >= 0)
-// nAmount = nAmount - Get(static_cast<USHORT>(nReferenceLevel)).GetFirstLineOffset();
+// nAmount = nAmount - Get(static_cast<sal_uInt16>(nReferenceLevel)).GetFirstLineOffset();
// else
-// nAmount = nAmount - Get(static_cast<USHORT>(nStartLevel)).GetFirstLineOffset();
+// nAmount = nAmount - Get(static_cast<sal_uInt16>(nStartLevel)).GetFirstLineOffset();
// }
-// BOOL bFirst = TRUE;
+// sal_Bool bFirst = sal_True;
// if (nReferenceLevel >= 0)
-// nRealAmount = nAmount - Get(static_cast<USHORT>(nReferenceLevel)).GetAbsLSpace();
+// nRealAmount = nAmount - Get(static_cast<sal_uInt16>(nReferenceLevel)).GetAbsLSpace();
// else
// for (i = nStartLevel; i < nEndLevel + 1; i++)
// {
-// short nTmp = nAmount - Get(static_cast<USHORT>(i)).GetAbsLSpace();
+// short nTmp = nAmount - Get(static_cast<sal_uInt16>(i)).GetAbsLSpace();
// if (bFirst || nTmp > nRealAmount)
// {
// nRealAmount = nTmp;
-// bFirst = FALSE;
+// bFirst = sal_False;
// }
// }
// }
// if (nRealAmount < 0)
// for (i = nStartLevel; i < nEndLevel + 1; i++)
-// if (Get(static_cast<USHORT>(i)).GetAbsLSpace() + nRealAmount < 0)
-// nRealAmount = -Get(static_cast<USHORT>(i)).GetAbsLSpace();
+// if (Get(static_cast<sal_uInt16>(i)).GetAbsLSpace() + nRealAmount < 0)
+// nRealAmount = -Get(static_cast<sal_uInt16>(i)).GetAbsLSpace();
// for (i = nStartLevel; i < nEndLevel + 1; i++)
// {
-// short nNew = Get(static_cast<USHORT>(i)).GetAbsLSpace() + nRealAmount;
+// short nNew = Get(static_cast<sal_uInt16>(i)).GetAbsLSpace() + nRealAmount;
// if (bCheckGtZero && nNew < 0)
// nNew = 0;
-// SwNumFmt aTmpNumFmt(Get(static_cast<USHORT>(i)));
+// SwNumFmt aTmpNumFmt(Get(static_cast<sal_uInt16>(i)));
// aTmpNumFmt.SetAbsLSpace(nNew);
-// Set(static_cast<USHORT>(i), aTmpNumFmt);
+// Set(static_cast<sal_uInt16>(i), aTmpNumFmt);
-// bGotInvalid = TRUE;
+// bGotInvalid = sal_True;
// }
// if (bGotInvalid)
@@ -1100,7 +1105,7 @@ void SwNumRule::SetInvalidRule(BOOL bFlag)
// change indent of all list levels by given difference
void SwNumRule::ChangeIndent( const short nDiff )
{
- for ( USHORT i = 0; i < MAXLEVEL; ++i )
+ for ( sal_uInt16 i = 0; i < MAXLEVEL; ++i )
{
SwNumFmt aTmpNumFmt( Get(i) );
@@ -1134,12 +1139,12 @@ void SwNumRule::ChangeIndent( const short nDiff )
Set( i, aTmpNumFmt );
}
- SetInvalidRule( TRUE );
+ SetInvalidRule( sal_True );
}
// set indent of certain list level to given value
void SwNumRule::SetIndent( const short nNewIndent,
- const USHORT nListLevel )
+ const sal_uInt16 nListLevel )
{
SwNumFmt aTmpNumFmt( Get(nListLevel) );
@@ -1163,7 +1168,7 @@ void SwNumRule::SetIndent( const short nNewIndent,
aTmpNumFmt.SetIndentAt( nNewIndent );
}
- SetInvalidRule( TRUE );
+ SetInvalidRule( sal_True );
}
// set indent of first list level to given value and change other list level's
@@ -1210,7 +1215,7 @@ void SwNumRule::Validate()
std::mem_fun( &SwList::ValidateListTree ) );
// <--
- SetInvalidRule(FALSE);
+ SetInvalidRule(sal_False);
}
bool SwNumRule::IsCountPhantoms() const
@@ -1294,7 +1299,7 @@ namespace numfunc
{
return static_cast<short>(meFontItalic);
}
- inline sal_Unicode GetChar( BYTE p_nListLevel ) const
+ inline sal_Unicode GetChar( sal_uInt8 p_nListLevel ) const
{
if ( p_nListLevel > MAXLEVEL )
{
@@ -1529,7 +1534,7 @@ namespace numfunc
return SwDefBulletConfig::getInstance()->GetFont();
}
- sal_Unicode GetBulletChar( BYTE nLevel )
+ sal_Unicode GetBulletChar( sal_uInt8 nLevel )
{
return SwDefBulletConfig::getInstance()->GetChar( nLevel );
}
diff --git a/sw/source/core/doc/poolfmt.cxx b/sw/source/core/doc/poolfmt.cxx
index fd7f0ad6ed7b..961983007e2a 100644
--- a/sw/source/core/doc/poolfmt.cxx
+++ b/sw/source/core/doc/poolfmt.cxx
@@ -27,6 +27,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
#include <hintids.hxx>
#include <i18npool/mslangid.hxx>
#include <unotools/localedatawrapper.hxx>
@@ -54,6 +55,7 @@
#include <editeng/scriptspaceitem.hxx>
#include <viewopt.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <fmtanchr.hxx>
#include <fmtornt.hxx>
#include <fmtsrnd.hxx>
@@ -67,36 +69,34 @@
#include <fmtcol.hxx>
#include <ndtxt.hxx>
#include <fmtline.hxx>
-#ifndef _POOLFMT_HRC
#include <poolfmt.hrc>
-#endif
#include <GetMetricVal.hxx>
#include <numrule.hxx>
using namespace ::com::sun::star;
-const USHORT PT_3 = 3 * 20; // 3 pt
-const USHORT PT_6 = 6 * 20; // 6 pt
-const USHORT PT_7 = 7 * 20; // 6 pt
-const USHORT PT_8 = 8 * 20; // 8 pt
-const USHORT PT_9 = 9 * 20; // 9 pt
-const USHORT PT_10 = 10 * 20; // 10 pt
-const USHORT PT_11 = 11 * 20; // 11 pt
-const USHORT PT_12 = 12 * 20; // 12 pt
-const USHORT PT_14 = 14 * 20; // 14 pt
-const USHORT PT_16 = 16 * 20; // 16 pt
-const USHORT PT_18 = 18 * 20; // 18 pt
-const USHORT PT_22 = 22 * 20; // 22 pt
-const USHORT PT_24 = 24 * 20; // 22 pt
-
-
-//const USHORT HTML_PARSPACE = ((CM_05 * 7) / 10);
+const sal_uInt16 PT_3 = 3 * 20; // 3 pt
+const sal_uInt16 PT_6 = 6 * 20; // 6 pt
+const sal_uInt16 PT_7 = 7 * 20; // 6 pt
+const sal_uInt16 PT_8 = 8 * 20; // 8 pt
+const sal_uInt16 PT_9 = 9 * 20; // 9 pt
+const sal_uInt16 PT_10 = 10 * 20; // 10 pt
+const sal_uInt16 PT_11 = 11 * 20; // 11 pt
+const sal_uInt16 PT_12 = 12 * 20; // 12 pt
+const sal_uInt16 PT_14 = 14 * 20; // 14 pt
+const sal_uInt16 PT_16 = 16 * 20; // 16 pt
+const sal_uInt16 PT_18 = 18 * 20; // 18 pt
+const sal_uInt16 PT_22 = 22 * 20; // 22 pt
+const sal_uInt16 PT_24 = 24 * 20; // 22 pt
+
+
+//const sal_uInt16 HTML_PARSPACE = ((CM_05 * 7) / 10);
#define HTML_PARSPACE GetMetricVal( CM_05 )
static const sal_Char __FAR_DATA sKomma[] = ", ";
-static const USHORT aHeadlineSizes[ 2 * MAXLEVEL ] = {
+static const sal_uInt16 aHeadlineSizes[ 2 * MAXLEVEL ] = {
// PT_16, PT_14, PT_14, PT_12, PT_12, // normal
//JP 10.12.96: jetzt soll alles prozentual sein:
115, 100, 100, 85, 85,
@@ -122,7 +122,7 @@ long lcl_GetRightMargin( SwDoc& rDoc )
void SetAllScriptItem( SfxItemSet& rSet, const SfxPoolItem& rItem )
{
rSet.Put( rItem );
- USHORT nWhCJK = 0, nWhCTL = 0;
+ sal_uInt16 nWhCJK = 0, nWhCTL = 0;
switch( rItem.Which() )
{
case RES_CHRATR_FONTSIZE:
@@ -148,19 +148,19 @@ void SetAllScriptItem( SfxItemSet& rSet, const SfxPoolItem& rItem )
rSet.Put( rItem, nWhCTL );
}
-void lcl_SetDfltFont( USHORT nFntType, SfxItemSet& rSet )
+void lcl_SetDfltFont( sal_uInt16 nFntType, SfxItemSet& rSet )
{
static struct {
- USHORT nResLngId;
- USHORT nResFntId;
+ sal_uInt16 nResLngId;
+ sal_uInt16 nResFntId;
} aArr[ 3 ] = {
{ RES_CHRATR_LANGUAGE, RES_CHRATR_FONT },
{ RES_CHRATR_CJK_LANGUAGE, RES_CHRATR_CJK_FONT },
{ RES_CHRATR_CTL_LANGUAGE, RES_CHRATR_CTL_FONT }
};
- for( USHORT n = 0; n < 3; ++n )
+ for( sal_uInt16 n = 0; n < 3; ++n )
{
- USHORT nLng = ((SvxLanguageItem&)rSet.GetPool()->GetDefaultItem(
+ sal_uInt16 nLng = ((SvxLanguageItem&)rSet.GetPool()->GetDefaultItem(
aArr[n].nResLngId )).GetLanguage();
Font aFnt( OutputDevice::GetDefaultFont( nFntType,
nLng, DEFAULTFONT_FLAGS_ONLYONE ) );
@@ -171,13 +171,13 @@ void lcl_SetDfltFont( USHORT nFntType, SfxItemSet& rSet )
}
}
-void lcl_SetDfltFont( USHORT nLatinFntType, USHORT nCJKFntType,
- USHORT nCTLFntType, SfxItemSet& rSet )
+void lcl_SetDfltFont( sal_uInt16 nLatinFntType, sal_uInt16 nCJKFntType,
+ sal_uInt16 nCTLFntType, SfxItemSet& rSet )
{
static struct {
- USHORT nResLngId;
- USHORT nResFntId;
- USHORT nFntType;
+ sal_uInt16 nResLngId;
+ sal_uInt16 nResFntId;
+ sal_uInt16 nFntType;
} aArr[ 3 ] = {
{ RES_CHRATR_LANGUAGE, RES_CHRATR_FONT, 0 },
{ RES_CHRATR_CJK_LANGUAGE, RES_CHRATR_CJK_FONT, 0 },
@@ -187,9 +187,9 @@ void lcl_SetDfltFont( USHORT nLatinFntType, USHORT nCJKFntType,
aArr[1].nFntType = nCJKFntType;
aArr[2].nFntType = nCTLFntType;
- for( USHORT n = 0; n < 3; ++n )
+ for( sal_uInt16 n = 0; n < 3; ++n )
{
- USHORT nLng = ((SvxLanguageItem&)rSet.GetPool()->GetDefaultItem(
+ sal_uInt16 nLng = ((SvxLanguageItem&)rSet.GetPool()->GetDefaultItem(
aArr[n].nResLngId )).GetLanguage();
Font aFnt( OutputDevice::GetDefaultFont( aArr[n].nFntType,
nLng, DEFAULTFONT_FLAGS_ONLYONE ) );
@@ -202,7 +202,7 @@ void lcl_SetDfltFont( USHORT nLatinFntType, USHORT nCJKFntType,
void lcl_SetHeadline( SwDoc* pDoc, SwTxtFmtColl* pColl,
SfxItemSet& rSet,
- USHORT nOutLvlBits, BYTE nLevel, BOOL bItalic )
+ sal_uInt16 nOutLvlBits, sal_uInt8 nLevel, sal_Bool bItalic )
{
SetAllScriptItem( rSet, SvxWeightItem( WEIGHT_BOLD, RES_CHRATR_WEIGHT ) );
SvxFontHeightItem aHItem(240, 100, RES_CHRATR_FONTSIZE);
@@ -263,11 +263,11 @@ void lcl_SetHeadline( SwDoc* pDoc, SwTxtFmtColl* pColl,
-void lcl_SetRegister( SwDoc* pDoc, SfxItemSet& rSet, USHORT nFact,
- BOOL bHeader, BOOL bTab )
+void lcl_SetRegister( SwDoc* pDoc, SfxItemSet& rSet, sal_uInt16 nFact,
+ sal_Bool bHeader, sal_Bool bTab )
{
SvxLRSpaceItem aLR( RES_LR_SPACE );
- USHORT nLeft = nFact ? GetMetricVal( CM_05 ) * nFact : 0;
+ sal_uInt16 nLeft = nFact ? GetMetricVal( CM_05 ) * nFact : 0;
aLR.SetTxtLeft( nLeft );
rSet.Put( aLR );
@@ -291,13 +291,13 @@ void lcl_SetRegister( SwDoc* pDoc, SfxItemSet& rSet, USHORT nFact,
void lcl_SetNumBul( SwDoc* pDoc, SwTxtFmtColl* pColl,
SfxItemSet& rSet,
- USHORT nNxt, SwTwips nEZ, SwTwips nLeft,
+ sal_uInt16 nNxt, SwTwips nEZ, SwTwips nLeft,
SwTwips nUpper, SwTwips nLower )
{
SvxLRSpaceItem aLR( RES_LR_SPACE ); SvxULSpaceItem aUL( RES_UL_SPACE );
- aLR.SetTxtFirstLineOfst( USHORT(nEZ) ); aLR.SetTxtLeft( USHORT(nLeft) );
- aUL.SetUpper( USHORT(nUpper) ); aUL.SetLower( USHORT(nLower) );
+ aLR.SetTxtFirstLineOfst( sal_uInt16(nEZ) ); aLR.SetTxtLeft( sal_uInt16(nLeft) );
+ aUL.SetUpper( sal_uInt16(nUpper) ); aUL.SetLower( sal_uInt16(nLower) );
rSet.Put( aLR );
rSet.Put( aUL );
@@ -312,14 +312,14 @@ void lcl_SetNumBul( SwDoc* pDoc, SwTxtFmtColl* pColl,
// Ist der String-Pointer definiert, dann erfrage nur die
// Beschreibung der Attribute, !! es legt keine Vorlage an !!
-SvxFrameDirection GetDefaultFrameDirection(ULONG nLanguage)
+SvxFrameDirection GetDefaultFrameDirection(sal_uLong nLanguage)
{
SvxFrameDirection eResult = (MsLangId::isRightToLeft( static_cast<LanguageType>(nLanguage)) ?
FRMDIR_HORI_RIGHT_TOP : FRMDIR_HORI_LEFT_TOP);
return eResult;
}
-SwTxtFmtColl* SwDoc::GetTxtCollFromPool( USHORT nId, bool bRegardLanguage )
+SwTxtFmtColl* SwDoc::GetTxtCollFromPool( sal_uInt16 nId, bool bRegardLanguage )
{
ASSERT(
(RES_POOLCOLL_TEXT_BEGIN <= nId && nId < RES_POOLCOLL_TEXT_END) ||
@@ -331,8 +331,8 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( USHORT nId, bool bRegardLanguage )
"Falsche AutoFormat-Id" );
SwTxtFmtColl* pNewColl;
- USHORT nOutLvlBits = 0;
- for( USHORT n = 0; n < pTxtFmtCollTbl->Count(); ++n )
+ sal_uInt16 nOutLvlBits = 0;
+ for( sal_uInt16 n = 0; n < pTxtFmtCollTbl->Count(); ++n )
{
if( nId == ( pNewColl = (*pTxtFmtCollTbl)[ n ] )->GetPoolFmtId() )
{
@@ -345,7 +345,7 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( USHORT nId, bool bRegardLanguage )
}
// bis hierher nicht gefunden -> neu anlegen
- USHORT nResId = 0;
+ sal_uInt16 nResId = 0;
if( RES_POOLCOLL_TEXT_BEGIN <= nId && nId < RES_POOLCOLL_TEXT_END )
nResId = RC_POOLCOLL_TEXT_BEGIN - RES_POOLCOLL_TEXT_BEGIN;
else if (RES_POOLCOLL_LISTS_BEGIN <= nId && nId < RES_POOLCOLL_LISTS_END)
@@ -368,7 +368,7 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( USHORT nId, bool bRegardLanguage )
// ein Set fuer alle zusetzenden Attribute
SwAttrSet aSet( GetAttrPool(), aTxtFmtCollSetRange );
- USHORT nParent = GetPoolParent( nId );
+ sal_uInt16 nParent = GetPoolParent( nId );
{
@@ -390,10 +390,10 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( USHORT nId, bool bRegardLanguage )
{
// allgemeine Inhaltsformen
case RES_POOLCOLL_STANDARD:
- /* #111214# koreans do not like SvxScriptItem(TRUE) */
+ /* #111214# koreans do not like SvxScriptItem(sal_True) */
if (bRegardLanguage)
{
- ULONG nAppLanguage = GetAppLanguage();
+ sal_uLong nAppLanguage = GetAppLanguage();
if (GetDefaultFrameDirection(nAppLanguage) ==
FRMDIR_HORI_RIGHT_TOP)
{
@@ -402,7 +402,7 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( USHORT nId, bool bRegardLanguage )
}
if (nAppLanguage == LANGUAGE_KOREAN)
{
- SvxScriptSpaceItem aScriptSpace(FALSE, RES_PARATR_SCRIPTSPACE);
+ SvxScriptSpaceItem aScriptSpace(sal_False, RES_PARATR_SCRIPTSPACE);
aSet.Put(aScriptSpace);
}
}
@@ -463,7 +463,7 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( USHORT nId, bool bRegardLanguage )
case RES_POOLCOLL_HEADLINE_BASE: // Basis Ueberschrift
{
- static const USHORT aFntInit[] = {
+ static const sal_uInt16 aFntInit[] = {
DEFAULTFONT_LATIN_HEADING, RES_CHRATR_FONT,
RES_CHRATR_LANGUAGE, LANGUAGE_ENGLISH_US,
DEFAULTFONT_CJK_HEADING, RES_CHRATR_CJK_FONT,
@@ -473,9 +473,9 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( USHORT nId, bool bRegardLanguage )
0
};
- for( const USHORT* pArr = aFntInit; *pArr; pArr += 4 )
+ for( const sal_uInt16* pArr = aFntInit; *pArr; pArr += 4 )
{
- USHORT nLng = ((SvxLanguageItem&)GetDefault( *(pArr+2) )).GetLanguage();
+ sal_uInt16 nLng = ((SvxLanguageItem&)GetDefault( *(pArr+2) )).GetLanguage();
if( LANGUAGE_DONTKNOW == nLng )
nLng = *(pArr+3);
@@ -491,7 +491,7 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( USHORT nId, bool bRegardLanguage )
SvxULSpaceItem aUL( PT_12, PT_6, RES_UL_SPACE );
if( get(IDocumentSettingAccess::HTML_MODE) )
aUL.SetLower( HTML_PARSPACE );
- aSet.Put( SvxFmtKeepItem( TRUE, RES_KEEP ));
+ aSet.Put( SvxFmtKeepItem( sal_True, RES_KEEP ));
pNewColl->SetNextTxtFmtColl( *GetTxtCollFromPool( RES_POOLCOLL_TEXT ));
@@ -508,40 +508,40 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( USHORT nId, bool bRegardLanguage )
case RES_POOLCOLL_SIGNATURE: // Unterschrift
case RES_POOLCOLL_TABLE: // Tabelle-Inhalt
{
- SwFmtLineNumber aLN; aLN.SetCountLines( FALSE );
+ SwFmtLineNumber aLN; aLN.SetCountLines( sal_False );
aSet.Put( aLN );
}
break;
case RES_POOLCOLL_HEADLINE1: // Ueberschrift 1
- lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 0, FALSE );
+ lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 0, sal_False );
break;
case RES_POOLCOLL_HEADLINE2: // Ueberschrift 2
- lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 1, TRUE );
+ lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 1, sal_True );
break;
case RES_POOLCOLL_HEADLINE3: // Ueberschrift 3
- lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 2, FALSE );
+ lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 2, sal_False );
break;
case RES_POOLCOLL_HEADLINE4: // Ueberschrift 4
- lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 3, TRUE );
+ lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 3, sal_True );
break;
case RES_POOLCOLL_HEADLINE5: // Ueberschrift 5
- lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 4, FALSE );
+ lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 4, sal_False );
break;
case RES_POOLCOLL_HEADLINE6: // Ueberschrift 6
- lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 5, FALSE );
+ lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 5, sal_False );
break;
case RES_POOLCOLL_HEADLINE7: // Ueberschrift 7
- lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 6, FALSE );
+ lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 6, sal_False );
break;
case RES_POOLCOLL_HEADLINE8: // Ueberschrift 8
- lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 7, FALSE );
+ lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 7, sal_False );
break;
case RES_POOLCOLL_HEADLINE9: // Ueberschrift 9
- lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 8, FALSE );
+ lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 8, sal_False );
break;
case RES_POOLCOLL_HEADLINE10: // Ueberschrift 10
- lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 9, FALSE );
+ lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 9, sal_False );
break;
@@ -555,7 +555,7 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( USHORT nId, bool bRegardLanguage )
case RES_POOLCOLL_FOOTERL:
case RES_POOLCOLL_FOOTERR:
{
- SwFmtLineNumber aLN; aLN.SetCountLines( FALSE );
+ SwFmtLineNumber aLN; aLN.SetCountLines( sal_False );
aSet.Put( aLN );
long nRightMargin = lcl_GetRightMargin( *this );
@@ -572,7 +572,7 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( USHORT nId, bool bRegardLanguage )
{
SetAllScriptItem( aSet, SvxWeightItem( WEIGHT_BOLD, RES_CHRATR_WEIGHT ) );
aSet.Put( SvxAdjustItem( SVX_ADJUST_CENTER, RES_PARATR_ADJUST ) );
- SwFmtLineNumber aLN; aLN.SetCountLines( FALSE );
+ SwFmtLineNumber aLN; aLN.SetCountLines( sal_False );
aSet.Put( aLN );
}
break;
@@ -585,7 +585,7 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( USHORT nId, bool bRegardLanguage )
aLR.SetTxtLeft( GetMetricVal( CM_05 ));
SetAllScriptItem( aSet, SvxFontHeightItem( PT_10, 100, RES_CHRATR_FONTSIZE ) );
aSet.Put( aLR );
- SwFmtLineNumber aLN; aLN.SetCountLines( FALSE );
+ SwFmtLineNumber aLN; aLN.SetCountLines( sal_False );
aSet.Put( aLN );
}
break;
@@ -596,7 +596,7 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( USHORT nId, bool bRegardLanguage )
aSet.Put( aUL );
SetAllScriptItem( aSet, SvxPostureItem( ITALIC_NORMAL, RES_CHRATR_POSTURE ) );
SetAllScriptItem( aSet, SvxFontHeightItem( PT_10, 100, RES_CHRATR_FONTSIZE ) );
- SwFmtLineNumber aLN; aLN.SetCountLines( FALSE );
+ SwFmtLineNumber aLN; aLN.SetCountLines( sal_False );
aSet.Put( aLN );
}
break;
@@ -612,7 +612,7 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( USHORT nId, bool bRegardLanguage )
{
SvxULSpaceItem aUL( RES_UL_SPACE ); aUL.SetLower( PT_3 );
aSet.Put( aUL );
- SwFmtLineNumber aLN; aLN.SetCountLines( FALSE );
+ SwFmtLineNumber aLN; aLN.SetCountLines( sal_False );
aSet.Put( aLN );
}
break;
@@ -626,117 +626,117 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( USHORT nId, bool bRegardLanguage )
SvxULSpaceItem aUL( RES_UL_SPACE ); aUL.SetLower( PT_3 );
aSet.Put( aUL );
}
- SwFmtLineNumber aLN; aLN.SetCountLines( FALSE );
+ SwFmtLineNumber aLN; aLN.SetCountLines( sal_False );
aSet.Put( aLN );
}
break;
// Benutzer-Verzeichnisse:
case RES_POOLCOLL_TOX_USERH: // Header
- lcl_SetRegister( this, aSet, 0, TRUE, FALSE );
+ lcl_SetRegister( this, aSet, 0, sal_True, sal_False );
{
- SwFmtLineNumber aLN; aLN.SetCountLines( FALSE );
+ SwFmtLineNumber aLN; aLN.SetCountLines( sal_False );
aSet.Put( aLN );
}
break;
case RES_POOLCOLL_TOX_USER1: // 1. Ebene
- lcl_SetRegister( this, aSet, 0, FALSE, TRUE );
+ lcl_SetRegister( this, aSet, 0, sal_False, sal_True );
break;
case RES_POOLCOLL_TOX_USER2: // 2. Ebene
- lcl_SetRegister( this, aSet, 1, FALSE, TRUE );
+ lcl_SetRegister( this, aSet, 1, sal_False, sal_True );
break;
case RES_POOLCOLL_TOX_USER3: // 3. Ebene
- lcl_SetRegister( this, aSet, 2, FALSE, TRUE );
+ lcl_SetRegister( this, aSet, 2, sal_False, sal_True );
break;
case RES_POOLCOLL_TOX_USER4: // 4. Ebene
- lcl_SetRegister( this, aSet, 3, FALSE, TRUE );
+ lcl_SetRegister( this, aSet, 3, sal_False, sal_True );
break;
case RES_POOLCOLL_TOX_USER5: // 5. Ebene
- lcl_SetRegister( this, aSet, 4, FALSE, TRUE );
+ lcl_SetRegister( this, aSet, 4, sal_False, sal_True );
break;
case RES_POOLCOLL_TOX_USER6: // 6. Ebene
- lcl_SetRegister( this, aSet, 5, FALSE, TRUE );
+ lcl_SetRegister( this, aSet, 5, sal_False, sal_True );
break;
case RES_POOLCOLL_TOX_USER7: // 7. Ebene
- lcl_SetRegister( this, aSet, 6, FALSE, TRUE );
+ lcl_SetRegister( this, aSet, 6, sal_False, sal_True );
break;
case RES_POOLCOLL_TOX_USER8: // 8. Ebene
- lcl_SetRegister( this, aSet, 7, FALSE, TRUE );
+ lcl_SetRegister( this, aSet, 7, sal_False, sal_True );
break;
case RES_POOLCOLL_TOX_USER9: // 9. Ebene
- lcl_SetRegister( this, aSet, 8, FALSE, TRUE );
+ lcl_SetRegister( this, aSet, 8, sal_False, sal_True );
break;
case RES_POOLCOLL_TOX_USER10: // 10. Ebene
- lcl_SetRegister( this, aSet, 9, FALSE, TRUE );
+ lcl_SetRegister( this, aSet, 9, sal_False, sal_True );
break;
// Index-Verzeichnisse
case RES_POOLCOLL_TOX_IDXH: // Header
- lcl_SetRegister( this, aSet, 0, TRUE, FALSE );
+ lcl_SetRegister( this, aSet, 0, sal_True, sal_False );
{
- SwFmtLineNumber aLN; aLN.SetCountLines( FALSE );
+ SwFmtLineNumber aLN; aLN.SetCountLines( sal_False );
aSet.Put( aLN );
}
break;
case RES_POOLCOLL_TOX_IDX1: // 1. Ebene
- lcl_SetRegister( this, aSet, 0, FALSE, FALSE );
+ lcl_SetRegister( this, aSet, 0, sal_False, sal_False );
break;
case RES_POOLCOLL_TOX_IDX2: // 2. Ebene
- lcl_SetRegister( this, aSet, 1, FALSE, FALSE );
+ lcl_SetRegister( this, aSet, 1, sal_False, sal_False );
break;
case RES_POOLCOLL_TOX_IDX3: // 3. Ebene
- lcl_SetRegister( this, aSet, 2, FALSE, FALSE );
+ lcl_SetRegister( this, aSet, 2, sal_False, sal_False );
break;
case RES_POOLCOLL_TOX_IDXBREAK: // Trenner
- lcl_SetRegister( this, aSet, 0, FALSE, FALSE );
+ lcl_SetRegister( this, aSet, 0, sal_False, sal_False );
break;
// Inhalts-Verzeichnisse
case RES_POOLCOLL_TOX_CNTNTH: // Header
- lcl_SetRegister( this, aSet, 0, TRUE, FALSE );
+ lcl_SetRegister( this, aSet, 0, sal_True, sal_False );
{
- SwFmtLineNumber aLN; aLN.SetCountLines( FALSE );
+ SwFmtLineNumber aLN; aLN.SetCountLines( sal_False );
aSet.Put( aLN );
}
break;
case RES_POOLCOLL_TOX_CNTNT1: // 1. Ebene
- lcl_SetRegister( this, aSet, 0, FALSE, TRUE );
+ lcl_SetRegister( this, aSet, 0, sal_False, sal_True );
break;
case RES_POOLCOLL_TOX_CNTNT2: // 2. Ebene
- lcl_SetRegister( this, aSet, 1, FALSE, TRUE );
+ lcl_SetRegister( this, aSet, 1, sal_False, sal_True );
break;
case RES_POOLCOLL_TOX_CNTNT3: // 3. Ebene
- lcl_SetRegister( this, aSet, 2, FALSE, TRUE );
+ lcl_SetRegister( this, aSet, 2, sal_False, sal_True );
break;
case RES_POOLCOLL_TOX_CNTNT4: // 4. Ebene
- lcl_SetRegister( this, aSet, 3, FALSE, TRUE );
+ lcl_SetRegister( this, aSet, 3, sal_False, sal_True );
break;
case RES_POOLCOLL_TOX_CNTNT5: // 5. Ebene
- lcl_SetRegister( this, aSet, 4, FALSE, TRUE );
+ lcl_SetRegister( this, aSet, 4, sal_False, sal_True );
break;
case RES_POOLCOLL_TOX_CNTNT6: // 6. Ebene
- lcl_SetRegister( this, aSet, 5, FALSE, TRUE );
+ lcl_SetRegister( this, aSet, 5, sal_False, sal_True );
break;
case RES_POOLCOLL_TOX_CNTNT7: // 7. Ebene
- lcl_SetRegister( this, aSet, 6, FALSE, TRUE );
+ lcl_SetRegister( this, aSet, 6, sal_False, sal_True );
break;
case RES_POOLCOLL_TOX_CNTNT8: // 8. Ebene
- lcl_SetRegister( this, aSet, 7, FALSE, TRUE );
+ lcl_SetRegister( this, aSet, 7, sal_False, sal_True );
break;
case RES_POOLCOLL_TOX_CNTNT9: // 9. Ebene
- lcl_SetRegister( this, aSet, 8, FALSE, TRUE );
+ lcl_SetRegister( this, aSet, 8, sal_False, sal_True );
break;
case RES_POOLCOLL_TOX_CNTNT10: // 10. Ebene
- lcl_SetRegister( this, aSet, 9, FALSE, TRUE );
+ lcl_SetRegister( this, aSet, 9, sal_False, sal_True );
break;
case RES_POOLCOLL_TOX_ILLUSH:
case RES_POOLCOLL_TOX_OBJECTH:
case RES_POOLCOLL_TOX_TABLESH:
case RES_POOLCOLL_TOX_AUTHORITIESH:
- lcl_SetRegister( this, aSet, 0, TRUE, FALSE );
+ lcl_SetRegister( this, aSet, 0, sal_True, sal_False );
{
- SwFmtLineNumber aLN; aLN.SetCountLines( FALSE );
+ SwFmtLineNumber aLN; aLN.SetCountLines( sal_False );
aSet.Put( aLN );
}
break;
@@ -744,7 +744,7 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( USHORT nId, bool bRegardLanguage )
case RES_POOLCOLL_TOX_OBJECT1:
case RES_POOLCOLL_TOX_TABLES1:
case RES_POOLCOLL_TOX_AUTHORITIES1:
- lcl_SetRegister( this, aSet, 0, FALSE, TRUE );
+ lcl_SetRegister( this, aSet, 0, sal_False, sal_True );
break;
@@ -1006,7 +1006,7 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( USHORT nId, bool bRegardLanguage )
aBox.SetLine( &aNew, BOX_LINE_BOTTOM );
aSet.Put( aBox );
- aSet.Put( SwParaConnectBorderItem( FALSE ) );
+ aSet.Put( SwParaConnectBorderItem( sal_False ) );
SetAllScriptItem( aSet, SvxFontHeightItem(120, 100, RES_CHRATR_FONTSIZE) );
SvxULSpaceItem aUL( RES_UL_SPACE );
@@ -1017,7 +1017,7 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( USHORT nId, bool bRegardLanguage )
}
aUL.SetLower( HTML_PARSPACE );
aSet.Put( aUL);
- SwFmtLineNumber aLN; aLN.SetCountLines( FALSE );
+ SwFmtLineNumber aLN; aLN.SetCountLines( sal_False );
aSet.Put( aLN );
}
break;
@@ -1062,7 +1062,7 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( USHORT nId, bool bRegardLanguage )
// pruefe, ob diese "Auto-Collection" in Dokument schon/noch
// benutzt wird
-bool SwDoc::IsPoolTxtCollUsed( USHORT nId ) const
+bool SwDoc::IsPoolTxtCollUsed( sal_uInt16 nId ) const
{
ASSERT(
(RES_POOLCOLL_TEXT_BEGIN <= nId && nId < RES_POOLCOLL_TEXT_END) ||
@@ -1074,32 +1074,32 @@ bool SwDoc::IsPoolTxtCollUsed( USHORT nId ) const
"Falsche AutoFormat-Id" );
SwTxtFmtColl* pNewColl = 0;
- BOOL bFnd = FALSE;
- for( USHORT n = 0; !bFnd && n < pTxtFmtCollTbl->Count(); ++n )
+ sal_Bool bFnd = sal_False;
+ for( sal_uInt16 n = 0; !bFnd && n < pTxtFmtCollTbl->Count(); ++n )
{
pNewColl = (*pTxtFmtCollTbl)[ n ];
if( nId == pNewColl->GetPoolFmtId() )
- bFnd = TRUE;
+ bFnd = sal_True;
}
if( !bFnd || !pNewColl->GetDepends() )
- return FALSE;
+ return sal_False;
- SwAutoFmtGetDocNode aGetHt( &aNodes );
+ SwAutoFmtGetDocNode aGetHt( &GetNodes() );
return !pNewColl->GetInfo( aGetHt );
}
// Gebe das "Auto[matische]-Format" mit der Id zurueck. Existiert
// es noch nicht, dann erzeuge es
-SwFmt* SwDoc::GetFmtFromPool( USHORT nId )
+SwFmt* SwDoc::GetFmtFromPool( sal_uInt16 nId )
{
SwFmt *pNewFmt = 0;
SwFmt *pDeriveFmt = 0;
SvPtrarr* pArray[ 2 ];
- USHORT nArrCnt = 1, nRCId = 0;
- USHORT* pWhichRange = 0;
+ sal_uInt16 nArrCnt = 1, nRCId = 0;
+ sal_uInt16* pWhichRange = 0;
switch( nId & (COLL_GET_RANGE_BITS + POOLGRP_NOCOLLID) )
{
@@ -1150,7 +1150,7 @@ SwFmt* SwDoc::GetFmtFromPool( USHORT nId )
ASSERT( nRCId, "ungueltige Id" );
while( nArrCnt-- )
- for( USHORT n = 0; n < (*pArray[nArrCnt]).Count(); ++n )
+ for( sal_uInt16 n = 0; n < (*pArray[nArrCnt]).Count(); ++n )
if( nId == ( pNewFmt = (SwFmt*)(*pArray[ nArrCnt ] )[ n ] )->
GetPoolFmtId() )
{
@@ -1162,30 +1162,27 @@ SwFmt* SwDoc::GetFmtFromPool( USHORT nId )
SwAttrSet aSet( GetAttrPool(), pWhichRange );
{
- BOOL bIsModified = IsModified();
+ sal_Bool bIsModified = IsModified();
- BOOL bDoesUndo = DoesUndo();
- DoUndo(FALSE);
- switch (nId & (COLL_GET_RANGE_BITS + POOLGRP_NOCOLLID) )
{
- case POOLGRP_CHARFMT:
- pNewFmt = _MakeCharFmt( aNm, pDeriveFmt, FALSE, TRUE );
-
- break;
- case POOLGRP_FRAMEFMT:
- pNewFmt = _MakeFrmFmt(aNm, pDeriveFmt, FALSE, TRUE );
-
- break;
- default:
- break;
+ ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
+ switch (nId & (COLL_GET_RANGE_BITS + POOLGRP_NOCOLLID) )
+ {
+ case POOLGRP_CHARFMT:
+ pNewFmt = _MakeCharFmt(aNm, pDeriveFmt, sal_False, sal_True);
+ break;
+ case POOLGRP_FRAMEFMT:
+ pNewFmt = _MakeFrmFmt(aNm, pDeriveFmt, sal_False, sal_True);
+ break;
+ default:
+ break;
+ }
}
- DoUndo(bDoesUndo);
-
if( !bIsModified )
ResetModified();
pNewFmt->SetPoolFmtId( nId );
- pNewFmt->SetAuto( FALSE ); // kein Auto-Format
+ pNewFmt->SetAuto( sal_False ); // kein Auto-Format
}
switch( nId )
@@ -1354,7 +1351,7 @@ SwFmt* SwDoc::GetFmtFromPool( USHORT nId )
aSet.Put( SwFmtAnchor( FLY_AT_PAGE ));
aSet.Put( SwFmtHoriOrient( 0, text::HoriOrientation::CENTER, text::RelOrientation::FRAME ));
aSet.Put( SwFmtVertOrient( 0, text::VertOrientation::CENTER, text::RelOrientation::FRAME ));
- aSet.Put( SvxOpaqueItem( FALSE ));
+ aSet.Put( SvxOpaqueItem( sal_False ));
aSet.Put( SwFmtSurround( SURROUND_THROUGHT ));
}
break;
@@ -1366,11 +1363,11 @@ SwFmt* SwDoc::GetFmtFromPool( USHORT nId )
aSet.Put( SvxLRSpaceItem( 114, 114, 0, 0, RES_LR_SPACE ) );
SvxProtectItem aProtect( RES_PROTECT );
- aProtect.SetSizeProtect( TRUE );
- aProtect.SetPosProtect( TRUE );
+ aProtect.SetSizeProtect( sal_True );
+ aProtect.SetPosProtect( sal_True );
aSet.Put( aProtect );
- pNewFmt->SetAutoUpdateFmt( TRUE );
+ pNewFmt->SetAutoUpdateFmt( sal_True );
}
break;
}
@@ -1398,12 +1395,12 @@ SwCharFmt* SwDoc::GetCharFmtFromPool( sal_uInt16 nId )
// pruefe, ob diese "Auto-Collection" in Dokument schon/noch
// benutzt wird
-bool SwDoc::IsPoolFmtUsed( USHORT nId ) const
+bool SwDoc::IsPoolFmtUsed( sal_uInt16 nId ) const
{
SwFmt *pNewFmt = 0;
const SvPtrarr* pArray[ 2 ];
- USHORT nArrCnt = 1;
- BOOL bFnd = TRUE;
+ sal_uInt16 nArrCnt = 1;
+ sal_Bool bFnd = sal_True;
if( RES_POOLCHR_BEGIN <= nId && nId < RES_POOLCHR_END )
{
@@ -1417,18 +1414,18 @@ bool SwDoc::IsPoolFmtUsed( USHORT nId ) const
}
else
{
- ASSERT( FALSE, "ungueltige Id" );
- bFnd = FALSE;
+ ASSERT( sal_False, "ungueltige Id" );
+ bFnd = sal_False;
}
if( bFnd )
{
- bFnd = FALSE;
+ bFnd = sal_False;
while( nArrCnt-- && !bFnd )
- for( USHORT n = 0; !bFnd && n < (*pArray[nArrCnt]).Count(); ++n )
+ for( sal_uInt16 n = 0; !bFnd && n < (*pArray[nArrCnt]).Count(); ++n )
if( nId == ( pNewFmt = (SwFmt*)(*pArray[ nArrCnt ] )[ n ] )->
GetPoolFmtId() )
- bFnd = TRUE;
+ bFnd = sal_True;
}
// nicht gefunden oder keine Abhaengigen ?
@@ -1436,11 +1433,11 @@ bool SwDoc::IsPoolFmtUsed( USHORT nId ) const
{
// dann teste mal, ob es abhaengige ContentNodes im Nodes Array gibt
// (auch indirekte fuer Format-Ableitung! )
- SwAutoFmtGetDocNode aGetHt( &aNodes );
+ SwAutoFmtGetDocNode aGetHt( &GetNodes() );
bFnd = !pNewFmt->GetInfo( aGetHt );
}
else
- bFnd = FALSE;
+ bFnd = sal_False;
return bFnd;
}
@@ -1466,7 +1463,7 @@ SwPageDesc* SwDoc::GetPageDescFromPool( sal_uInt16 nId, bool bRegardLanguage )
"Falsche AutoFormat-Id" );
SwPageDesc *pNewPgDsc;
- USHORT n;
+ sal_uInt16 n;
for( n = 0; n < aPageDescs.Count(); ++n )
if( nId == ( pNewPgDsc = aPageDescs[ n ] )->GetPoolFmtId() )
@@ -1484,12 +1481,12 @@ SwPageDesc* SwDoc::GetPageDescFromPool( sal_uInt16 nId, bool bRegardLanguage )
ResId aResId( sal_uInt32(RC_POOLPAGEDESC_BEGIN + nId - RES_POOLPAGE_BEGIN), *pSwResMgr );
String aNm( aResId );
{
- BOOL bIsModified = IsModified();
+ sal_Bool bIsModified = IsModified();
- BOOL bDoesUndo = DoesUndo();
- DoUndo(FALSE);
- n = MakePageDesc( aNm, 0, bRegardLanguage );
- DoUndo(bDoesUndo);
+ {
+ ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
+ n = MakePageDesc( aNm, 0, bRegardLanguage );
+ }
pNewPgDsc = aPageDescs[ n ];
pNewPgDsc->SetPoolFmtId( nId );
@@ -1502,11 +1499,11 @@ SwPageDesc* SwDoc::GetPageDescFromPool( sal_uInt16 nId, bool bRegardLanguage )
aLR.SetLeft( GetMetricVal( CM_1 ) * 2 );
aLR.SetRight( aLR.GetLeft() );
SvxULSpaceItem aUL( RES_UL_SPACE );
- aUL.SetUpper( (USHORT)aLR.GetLeft() );
- aUL.SetLower( (USHORT)aLR.GetLeft() );
+ aUL.SetUpper( (sal_uInt16)aLR.GetLeft() );
+ aUL.SetLower( (sal_uInt16)aLR.GetLeft() );
SwAttrSet aSet( GetAttrPool(), aPgFrmFmtSetRange );
- BOOL bSetLeft = TRUE;
+ sal_Bool bSetLeft = sal_True;
switch( nId )
{
@@ -1539,7 +1536,7 @@ SwPageDesc* SwDoc::GetPageDescFromPool( sal_uInt16 nId, bool bRegardLanguage )
lcl_GetStdPgSize( this, aSet );
aSet.Put( aLR );
aSet.Put( aUL );
- bSetLeft = FALSE;
+ bSetLeft = sal_False;
if( pNewPgDsc )
pNewPgDsc->SetUseOn( nsUseOnPage::PD_LEFT );
}
@@ -1549,7 +1546,7 @@ SwPageDesc* SwDoc::GetPageDescFromPool( sal_uInt16 nId, bool bRegardLanguage )
lcl_GetStdPgSize( this, aSet );
aSet.Put( aLR );
aSet.Put( aUL );
- bSetLeft = FALSE;
+ bSetLeft = sal_False;
if( pNewPgDsc )
pNewPgDsc->SetUseOn( nsUseOnPage::PD_RIGHT );
}
@@ -1568,7 +1565,7 @@ SwPageDesc* SwDoc::GetPageDescFromPool( sal_uInt16 nId, bool bRegardLanguage )
if( pNewPgDsc )
{
pNewPgDsc->SetUseOn( nsUseOnPage::PD_ALL );
- pNewPgDsc->SetLandscape( TRUE );
+ pNewPgDsc->SetLandscape( sal_True );
}
}
break;
@@ -1577,8 +1574,8 @@ SwPageDesc* SwDoc::GetPageDescFromPool( sal_uInt16 nId, bool bRegardLanguage )
{
lcl_GetStdPgSize( this, aSet );
aLR.SetRight( GetMetricVal( CM_1 ));
- aUL.SetUpper( (USHORT)aLR.GetRight() );
- aUL.SetLower( (USHORT)aLR.GetRight() );
+ aUL.SetUpper( (sal_uInt16)aLR.GetRight() );
+ aUL.SetLower( (sal_uInt16)aLR.GetRight() );
aSet.Put( aLR );
aSet.Put( aUL );
@@ -1614,7 +1611,7 @@ SwPageDesc* SwDoc::GetPageDescFromPool( sal_uInt16 nId, bool bRegardLanguage )
if( pNewPgDsc )
{
pNewPgDsc->SetUseOn( nsUseOnPage::PD_ALL );
- pNewPgDsc->SetLandscape( TRUE );
+ pNewPgDsc->SetLandscape( sal_True );
}
}
break;
@@ -1635,13 +1632,13 @@ SwPageDesc* SwDoc::GetPageDescFromPool( sal_uInt16 nId, bool bRegardLanguage )
return pNewPgDsc;
}
-SwNumRule* SwDoc::GetNumRuleFromPool( USHORT nId )
+SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
{
ASSERT( RES_POOLNUMRULE_BEGIN <= nId && nId < RES_POOLNUMRULE_END,
"Falsche AutoFormat-Id" );
SwNumRule* pNewRule;
- USHORT n;
+ sal_uInt16 n;
for( n = 0; n < GetNumRuleTbl().Count(); ++n )
if( nId == ( pNewRule = GetNumRuleTbl()[ n ] )->GetPoolFmtId() )
@@ -1668,13 +1665,13 @@ SwNumRule* SwDoc::GetNumRuleFromPool( USHORT nId )
// <--
// <--
{
- BOOL bIsModified = IsModified();
+ sal_Bool bIsModified = IsModified();
// --> OD 2008-02-11 #newlistlevelattrs#
- n = MakeNumRule( aNm, 0, FALSE, eNumberFormatPositionAndSpaceMode );
+ n = MakeNumRule( aNm, 0, sal_False, eNumberFormatPositionAndSpaceMode );
// <--
pNewRule = GetNumRuleTbl()[ n ];
pNewRule->SetPoolFmtId( nId );
- pNewRule->SetAutoRule( FALSE );
+ pNewRule->SetAutoRule( sal_False );
if( RES_POOLNUMRULE_NUM1 <= nId && nId <= RES_POOLNUMRULE_NUM5 )
pNumCFmt = GetCharFmtFromPool( RES_POOLCHR_NUM_LEVEL );
@@ -1701,22 +1698,22 @@ SwNumRule* SwDoc::GetNumRuleFromPool( USHORT nId )
aFmt.SetIncludeUpperLevels( 1 );
aFmt.SetSuffix( aDotStr );
- static const USHORT aAbsSpace[ MAXLEVEL ] =
+ static const sal_uInt16 aAbsSpace[ MAXLEVEL ] =
{
// cm: 0,5 1,0 1,5 2,0 2,5 3,0 3,5 4,0 4,5 5,0
283, 567, 850, 1134, 1417, 1701, 1984, 2268, 2551, 2835
};
#ifdef USE_MEASUREMENT
- static const USHORT aAbsSpaceInch[ MAXLEVEL ] =
+ static const sal_uInt16 aAbsSpaceInch[ MAXLEVEL ] =
{
283, 567, 850, 1134, 1417, 1701, 1984, 2268, 2551, 2835
};
- const USHORT* pArr = MEASURE_METRIC ==
+ const sal_uInt16* pArr = MEASURE_METRIC ==
SvtSysLocale().GetLocaleData().getMeasurementSystemEnum()
? aAbsSpace
: aAbsSpaceInch;
#else
- const USHORT* pArr = aAbsSpace;
+ const sal_uInt16* pArr = aAbsSpace;
#endif
// --> OD 2008-02-11 #newlistlevelattrs#
@@ -1750,7 +1747,7 @@ SwNumRule* SwDoc::GetNumRuleFromPool( USHORT nId )
case RES_POOLNUMRULE_NUM2:
{
- static const USHORT aAbsSpace[ MAXLEVEL ] =
+ static const sal_uInt16 aAbsSpace[ MAXLEVEL ] =
{
283, 283, 567, 709, // 0.50, 0.50, 1.00, 1.25
850, 1021, 1304, 1474, // 1.50, 1.80, 2.30, 2.60
@@ -1758,19 +1755,19 @@ SwNumRule* SwDoc::GetNumRuleFromPool( USHORT nId )
};
#ifdef USE_MEASUREMENT
- static const USHORT aAbsSpaceInch[ MAXLEVEL ] =
+ static const sal_uInt16 aAbsSpaceInch[ MAXLEVEL ] =
{
385, 385, 770, 963,
1155, 1386, 1771, 2002,
2156, 2387
};
- const USHORT* pArr = MEASURE_METRIC ==
+ const sal_uInt16* pArr = MEASURE_METRIC ==
SvtSysLocale().GetLocaleData().getMeasurementSystemEnum()
? aAbsSpace
: aAbsSpaceInch;
#else
- const USHORT* pArr = aAbsSpace;
+ const sal_uInt16* pArr = aAbsSpace;
#endif
SwNumFmt aFmt;
// --> OD 2008-02-11 #newlistlevelattrs#
@@ -1785,7 +1782,7 @@ SwNumRule* SwDoc::GetNumRuleFromPool( USHORT nId )
aFmt.SetLabelFollowedBy( SvxNumberFormat::LISTTAB );
}
// <--
- USHORT nSpace = 0;
+ sal_uInt16 nSpace = 0;
for( n = 0; n < MAXLEVEL; ++n )
{
// --> OD 2008-02-11 #newlistlevelattrs#
@@ -1816,7 +1813,7 @@ SwNumRule* SwDoc::GetNumRuleFromPool( USHORT nId )
aFmt.SetCharFmt( pNumCFmt );
aFmt.SetIncludeUpperLevels( 1 );
- USHORT nOffs = GetMetricVal( CM_1 ) * 3;
+ sal_uInt16 nOffs = GetMetricVal( CM_1 ) * 3;
// --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
@@ -1858,22 +1855,22 @@ SwNumRule* SwDoc::GetNumRuleFromPool( USHORT nId )
aFmt.SetIncludeUpperLevels( 1 );
aFmt.SetSuffix( aDotStr );
- static const USHORT aAbsSpace[ MAXLEVEL ] =
+ static const sal_uInt16 aAbsSpace[ MAXLEVEL ] =
{
// cm: 0,5 1,0 1,5 2,0 2,5 3,0 3,5 4,0 4,5 5,0
283, 567, 850, 1134, 1417, 1701, 1984, 2268, 2551, 2835
};
#ifdef USE_MEASUREMENT
- static const USHORT aAbsSpaceInch[ MAXLEVEL ] =
+ static const sal_uInt16 aAbsSpaceInch[ MAXLEVEL ] =
{
283, 567, 850, 1134, 1417, 1701, 1984, 2268, 2551, 2835
};
- const USHORT* pArr = MEASURE_METRIC ==
+ const sal_uInt16* pArr = MEASURE_METRIC ==
SvtSysLocale().GetLocaleData().getMeasurementSystemEnum()
? aAbsSpace
: aAbsSpaceInch;
#else
- const USHORT* pArr = aAbsSpace;
+ const sal_uInt16* pArr = aAbsSpace;
#endif
// --> OD 2008-02-11 #newlistlevelattrs#
@@ -1908,7 +1905,7 @@ SwNumRule* SwDoc::GetNumRuleFromPool( USHORT nId )
case RES_POOLNUMRULE_NUM5:
{
// [ First, LSpace ]
- static const USHORT aAbsSpace0to2[] =
+ static const sal_uInt16 aAbsSpace0to2[] =
{
227, 227, // 0.40, 0.40,
369, 624, // 0.65, 1.10,
@@ -1916,18 +1913,18 @@ SwNumRule* SwDoc::GetNumRuleFromPool( USHORT nId )
};
#ifdef USE_MEASUREMENT
- static const USHORT aAbsSpaceInch0to2[] =
+ static const sal_uInt16 aAbsSpaceInch0to2[] =
{
308, 308,
501, 847,
347, 1194
};
- const USHORT* pArr0to2 = MEASURE_METRIC ==
+ const sal_uInt16* pArr0to2 = MEASURE_METRIC ==
SvtSysLocale().GetLocaleData().getMeasurementSystemEnum()
? aAbsSpace0to2
: aAbsSpaceInch0to2;
#else
- const USHORT* pArr0to2 = aAbsSpace0to2;
+ const sal_uInt16* pArr0to2 = aAbsSpace0to2;
#endif
SwNumFmt aFmt;
// --> OD 2008-02-11 #newlistlevelattrs#
@@ -2004,7 +2001,7 @@ SwNumRule* SwDoc::GetNumRuleFromPool( USHORT nId )
aFmt.SetBulletFont( &numfunc::GetDefBulletFont() );
// <--
aFmt.SetBulletChar( cBulletChar );
- USHORT nOffs = GetMetricVal( CM_01 ) * 4,
+ sal_uInt16 nOffs = GetMetricVal( CM_01 ) * 4,
nOffs2 = GetMetricVal( CM_1 ) * 2;
// --> OD 2008-02-11 #newlistlevelattrs#
@@ -2052,22 +2049,22 @@ SwNumRule* SwDoc::GetNumRuleFromPool( USHORT nId )
// <--
aFmt.SetBulletChar( cBulletChar );
- static const USHORT aAbsSpace[ MAXLEVEL ] =
+ static const sal_uInt16 aAbsSpace[ MAXLEVEL ] =
{
// cm: 0,4 0,8 1,2 1,6 2,0 2,4 2,8 3,2 3,6 4,0
227, 454, 680, 907, 1134, 1361, 1587, 1814, 2041, 2268
};
#ifdef USE_MEASUREMENT
- static const USHORT aAbsSpaceInch[ MAXLEVEL ] =
+ static const sal_uInt16 aAbsSpaceInch[ MAXLEVEL ] =
{
227, 454, 680, 907, 1134, 1361, 1587, 1814, 2041, 2268
};
- const USHORT* pArr = MEASURE_METRIC ==
+ const sal_uInt16* pArr = MEASURE_METRIC ==
SvtSysLocale().GetLocaleData().getMeasurementSystemEnum()
? aAbsSpace
: aAbsSpaceInch;
#else
- const USHORT* pArr = aAbsSpace;
+ const sal_uInt16* pArr = aAbsSpace;
#endif
// --> OD 2008-02-11 #newlistlevelattrs#
@@ -2113,22 +2110,22 @@ SwNumRule* SwDoc::GetNumRuleFromPool( USHORT nId )
// <--
aFmt.SetBulletChar( 0x2013 );
- static const USHORT aAbsSpace[ MAXLEVEL ] =
+ static const sal_uInt16 aAbsSpace[ MAXLEVEL ] =
{
// cm: 0,3 0,6 0,9 1,2 1,5 1,8 2,1 2,4 2,7 3,0
170, 340, 510, 680, 850, 1020, 1191, 1361, 1531, 1701
};
#ifdef USE_MEASUREMENT
- static const USHORT aAbsSpaceInch[ MAXLEVEL ] =
+ static const sal_uInt16 aAbsSpaceInch[ MAXLEVEL ] =
{
170, 340, 510, 680, 850, 1020, 1191, 1361, 1531, 1701
};
- const USHORT* pArr = MEASURE_METRIC ==
+ const sal_uInt16* pArr = MEASURE_METRIC ==
SvtSysLocale().GetLocaleData().getMeasurementSystemEnum()
? aAbsSpace
: aAbsSpaceInch;
#else
- const USHORT* pArr = aAbsSpace;
+ const sal_uInt16* pArr = aAbsSpace;
#endif
// --> OD 2008-02-11 #newlistlevelattrs#
@@ -2173,7 +2170,7 @@ SwNumRule* SwDoc::GetNumRuleFromPool( USHORT nId )
aFmt.SetBulletFont( &numfunc::GetDefBulletFont() );
// <--
- USHORT nOffs = GetMetricVal( CM_01 ) * 4;
+ sal_uInt16 nOffs = GetMetricVal( CM_01 ) * 4;
// --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
@@ -2218,22 +2215,22 @@ SwNumRule* SwDoc::GetNumRuleFromPool( USHORT nId )
aFmt.SetBulletFont( &numfunc::GetDefBulletFont() );
// <--
- static const USHORT aAbsSpace[ MAXLEVEL ] =
+ static const sal_uInt16 aAbsSpace[ MAXLEVEL ] =
{
// cm: 0,4 0,8 1,2 1,6 2,0 2,4 2,8 3,2 3,6 4,0
227, 454, 680, 907, 1134, 1361, 1587, 1814, 2041, 2268
};
#ifdef USE_MEASUREMENT
- static const USHORT aAbsSpaceInch[ MAXLEVEL ] =
+ static const sal_uInt16 aAbsSpaceInch[ MAXLEVEL ] =
{
227, 454, 680, 907, 1134, 1361, 1587, 1814, 2041, 2268
};
- const USHORT* pArr = MEASURE_METRIC ==
+ const sal_uInt16* pArr = MEASURE_METRIC ==
SvtSysLocale().GetLocaleData().getMeasurementSystemEnum()
? aAbsSpace
: aAbsSpaceInch;
#else
- const USHORT* pArr = aAbsSpace;
+ const sal_uInt16* pArr = aAbsSpace;
#endif
// --> OD 2008-02-11 #newlistlevelattrs#
@@ -2285,22 +2282,22 @@ SwNumRule* SwDoc::GetNumRuleFromPool( USHORT nId )
aFmt.SetBulletFont( &numfunc::GetDefBulletFont() );
// <--
- static const USHORT aAbsSpace[ MAXLEVEL ] =
+ static const sal_uInt16 aAbsSpace[ MAXLEVEL ] =
{
// cm: 0,4 0,8 1,2 1,6 2,0 2,4 2,8 3,2 3,6 4,0
227, 454, 680, 907, 1134, 1361, 1587, 1814, 2041, 2268
};
#ifdef USE_MEASUREMENT
- static const USHORT aAbsSpaceInch[ MAXLEVEL ] =
+ static const sal_uInt16 aAbsSpaceInch[ MAXLEVEL ] =
{
227, 454, 680, 907, 1134, 1361, 1587, 1814, 2041, 2268
};
- const USHORT* pArr = MEASURE_METRIC ==
+ const sal_uInt16* pArr = MEASURE_METRIC ==
SvtSysLocale().GetLocaleData().getMeasurementSystemEnum()
? aAbsSpace
: aAbsSpaceInch;
#else
- const USHORT* pArr = aAbsSpace;
+ const sal_uInt16* pArr = aAbsSpace;
#endif
// --> OD 2008-02-11 #newlistlevelattrs#
@@ -2340,26 +2337,26 @@ SwNumRule* SwDoc::GetNumRuleFromPool( USHORT nId )
// pruefe, ob diese "Auto-Collection" in Dokument schon/noch
// benutzt wird
-bool SwDoc::IsPoolPageDescUsed( USHORT nId ) const
+bool SwDoc::IsPoolPageDescUsed( sal_uInt16 nId ) const
{
ASSERT( RES_POOLPAGE_BEGIN <= nId && nId < RES_POOLPAGE_END,
"Falsche AutoFormat-Id" );
SwPageDesc *pNewPgDsc = 0;
- BOOL bFnd = FALSE;
- for( USHORT n = 0; !bFnd && n < aPageDescs.Count(); ++n )
+ sal_Bool bFnd = sal_False;
+ for( sal_uInt16 n = 0; !bFnd && n < aPageDescs.Count(); ++n )
{
pNewPgDsc = aPageDescs[ n ];
if( nId == pNewPgDsc->GetPoolFmtId() )
- bFnd = TRUE;
+ bFnd = sal_True;
}
// nicht gefunden oder keine Abhaengigen ?
if( !bFnd || !pNewPgDsc->GetDepends() ) // ??????
- return FALSE;
+ return sal_False;
// dann teste mal, ob es abhaengige ContentNodes im Nodes Array gibt
// (auch indirekte fuer Format-Ableitung! )
- SwAutoFmtGetDocNode aGetHt( &aNodes );
+ SwAutoFmtGetDocNode aGetHt( &GetNodes() );
return !pNewPgDsc->GetInfo( aGetHt );
}
@@ -2368,7 +2365,7 @@ sal_Bool SwDoc::IsUsed( const SwModify& rModify ) const
{
// dann teste mal, ob es abhaengige ContentNodes im Nodes Array gibt
// (auch indirekte fuer Format-Ableitung! )
- SwAutoFmtGetDocNode aGetHt( &aNodes );
+ SwAutoFmtGetDocNode aGetHt( &GetNodes() );
return !rModify.GetInfo( aGetHt );
}
@@ -2378,11 +2375,11 @@ sal_Bool SwDoc::IsUsed( const SwNumRule& rRule ) const
// --> OD 2008-03-04 #refactorlists#
// // dann teste mal, ob es abhaengige ContentNodes im Nodes Array gibt
// // (auch indirekte fuer Format-Ableitung! )
-// sal_Bool bUsed = FALSE;
+// sal_Bool bUsed = sal_False;
// SwAutoFmtGetDocNode aGetHt( &aNodes );
// SwModify* pMod;
// const SfxPoolItem* pItem;
-// USHORT i, nMaxItems = GetAttrPool().GetItemCount( RES_PARATR_NUMRULE);
+// sal_uInt16 i, nMaxItems = GetAttrPool().GetItemCount( RES_PARATR_NUMRULE);
// for( i = 0; i < nMaxItems; ++i )
// {
// if( 0 != (pItem = GetAttrPool().GetItem( RES_PARATR_NUMRULE, i ) ) &&
@@ -2398,7 +2395,7 @@ sal_Bool SwDoc::IsUsed( const SwNumRule& rRule ) const
// }
// else if( ((SwTxtNode*)pMod)->GetNodes().IsDocNodes() )
// {
-// bUsed = TRUE;
+// bUsed = sal_True;
// break;
// }
// }
@@ -2414,12 +2411,12 @@ sal_Bool SwDoc::IsUsed( const SwNumRule& rRule ) const
// Suche die Position vom Vorlagen-Namen. Ist nicht vorhanden
// dann fuege neu ein
-USHORT SwDoc::SetDocPattern( const String& rPatternName )
+sal_uInt16 SwDoc::SetDocPattern( const String& rPatternName )
{
ASSERT( rPatternName.Len(), "kein Dokument-Vorlagenname" );
- USHORT nNewPos = aPatternNms.Count();
- for( USHORT n = 0; n < aPatternNms.Count(); ++n )
+ sal_uInt16 nNewPos = aPatternNms.Count();
+ for( sal_uInt16 n = 0; n < aPatternNms.Count(); ++n )
if( !aPatternNms[n] )
{
if( nNewPos == aPatternNms.Count() )
@@ -2437,9 +2434,9 @@ USHORT SwDoc::SetDocPattern( const String& rPatternName )
return nNewPos;
}
-USHORT GetPoolParent( USHORT nId )
+sal_uInt16 GetPoolParent( sal_uInt16 nId )
{
- USHORT nRet = USHRT_MAX;
+ sal_uInt16 nRet = USHRT_MAX;
if( POOLGRP_NOCOLLID & nId ) // 1 == Formate / 0 == Collections
{
switch( ( COLL_GET_RANGE_BITS | POOLGRP_NOCOLLID ) & nId )
@@ -2572,7 +2569,7 @@ void SwDoc::RemoveAllFmtLanguageDependencies()
SwTxtFmtColl * pTxtFmtColl = GetTxtCollFromPool( RES_POOLCOLL_STANDARD );
pTxtFmtColl->ResetFmtAttr( RES_PARATR_ADJUST );
- /* #111214# koreans do not like SvxScriptItem(TRUE) */
+ /* #111214# koreans do not like SvxScriptItem(sal_True) */
pTxtFmtColl->ResetFmtAttr( RES_PARATR_SCRIPTSPACE );
SvxFrameDirectionItem aFrameDir( FRMDIR_HORI_LEFT_TOP, RES_FRAMEDIR );
diff --git a/sw/source/core/doc/sortopt.cxx b/sw/source/core/doc/sortopt.cxx
index 51cf1d4bca93..e845ec6f6897 100644
--- a/sw/source/core/doc/sortopt.cxx
+++ b/sw/source/core/doc/sortopt.cxx
@@ -43,11 +43,11 @@ SV_IMPL_PTRARR(SwSortKeys, SwSortKey*)
SwSortKey::SwSortKey() :
eSortOrder( SRT_ASCENDING ),
nColumnId( 0 ),
- bIsNumeric( TRUE )
+ bIsNumeric( sal_True )
{
}
-SwSortKey::SwSortKey(USHORT nId, const String& rSrtType, SwSortOrder eOrder) :
+SwSortKey::SwSortKey(sal_uInt16 nId, const String& rSrtType, SwSortOrder eOrder) :
sSortType( rSrtType ),
eSortOrder( eOrder ),
nColumnId( nId ),
@@ -73,8 +73,8 @@ SwSortOptions::SwSortOptions()
: eDirection( SRT_ROWS ),
cDeli( 9 ),
nLanguage( LANGUAGE_SYSTEM ),
- bTable( FALSE ),
- bIgnoreCase( FALSE )
+ bTable( sal_False ),
+ bIgnoreCase( sal_False )
{
}
@@ -86,7 +86,7 @@ SwSortOptions::SwSortOptions(const SwSortOptions& rOpt) :
bTable( rOpt.bTable ),
bIgnoreCase( rOpt.bIgnoreCase )
{
- for( USHORT i=0; i < rOpt.aKeys.Count(); ++i )
+ for( sal_uInt16 i=0; i < rOpt.aKeys.Count(); ++i )
{
SwSortKey* pNew = new SwSortKey(*rOpt.aKeys[i]);
aKeys.C40_INSERT( SwSortKey, pNew, aKeys.Count());
diff --git a/sw/source/core/doc/swserv.cxx b/sw/source/core/doc/swserv.cxx
index aed1ceef2772..d53ac908f0c1 100644
--- a/sw/source/core/doc/swserv.cxx
+++ b/sw/source/core/doc/swserv.cxx
@@ -54,10 +54,10 @@ SwServerObject::~SwServerObject()
}
-BOOL SwServerObject::GetData( uno::Any & rData,
- const String & rMimeType, BOOL )
+sal_Bool SwServerObject::GetData( uno::Any & rData,
+ const String & rMimeType, sal_Bool )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
WriterRef xWrt;
switch( SotExchange::GetFormatIdFromMimeType( rMimeType ) )
{
@@ -104,14 +104,14 @@ BOOL SwServerObject::GetData( uno::Any & rData,
{
// Stream anlegen
SvMemoryStream aMemStm( 65535, 65535 );
- SwWriter aWrt( aMemStm, *pPam, FALSE );
+ SwWriter aWrt( aMemStm, *pPam, sal_False );
if( !IsError( aWrt.Write( xWrt )) )
{
aMemStm << '\0'; // append a zero char
rData <<= uno::Sequence< sal_Int8 >(
(sal_Int8*)aMemStm.GetData(),
aMemStm.Seek( STREAM_SEEK_TO_END ) );
- bRet = TRUE;
+ bRet = sal_True;
}
delete pPam;
@@ -121,11 +121,11 @@ BOOL SwServerObject::GetData( uno::Any & rData,
}
-BOOL SwServerObject::SetData( const String & ,
+sal_Bool SwServerObject::SetData( const String & ,
const uno::Any& )
{
// set new data into the "server" -> at first nothing to do
- return FALSE;
+ return sal_False;
}
@@ -134,7 +134,7 @@ void SwServerObject::SendDataChanged( const SwPosition& rPos )
// ist an unseren Aenderungen jemand interessiert ?
if( HasDataLinks() )
{
- int bCall = FALSE;
+ int bCall = sal_False;
const SwStartNode* pNd = 0;
switch( eType )
{
@@ -152,7 +152,7 @@ void SwServerObject::SendDataChanged( const SwPosition& rPos )
}
if( pNd )
{
- ULONG nNd = rPos.nNode.GetIndex();
+ sal_uLong nNd = rPos.nNode.GetIndex();
bCall = pNd->GetIndex() < nNd && nNd < pNd->EndOfSectionIndex();
}
@@ -175,7 +175,7 @@ void SwServerObject::SendDataChanged( const SwPaM& rRange )
// ist an unseren Aenderungen jemand interessiert ?
if( HasDataLinks() )
{
- int bCall = FALSE;
+ int bCall = sal_False;
const SwStartNode* pNd = 0;
const SwPosition* pStt = rRange.Start(), *pEnd = rRange.End();
switch( eType )
@@ -213,9 +213,9 @@ void SwServerObject::SendDataChanged( const SwPaM& rRange )
}
-BOOL SwServerObject::IsLinkInServer( const SwBaseLink* pChkLnk ) const
+sal_Bool SwServerObject::IsLinkInServer( const SwBaseLink* pChkLnk ) const
{
- ULONG nSttNd = 0, nEndNd = 0;
+ sal_uLong nSttNd = 0, nEndNd = 0;
xub_StrLen nStt = 0;
xub_StrLen nEnd = 0;
const SwNode* pNd = 0;
@@ -241,7 +241,7 @@ BOOL SwServerObject::IsLinkInServer( const SwBaseLink* pChkLnk ) const
case SECTION_SERVER: pNd = CNTNT_TYPE.pSectNd; break;
case SECTION_SERVER+1:
- return TRUE;
+ return sal_True;
}
if( pNd )
@@ -265,7 +265,7 @@ if( !pChkLnk )
// #41723#
// *((int*)&eType) = SECTION_SERVER+1;
((SwServerObject*)this)->eType = NONE_SERVER;
- for( USHORT n = rLnks.Count(); n; )
+ for( sal_uInt16 n = rLnks.Count(); n; )
{
const ::sfx2::SvBaseLink* pLnk = &(*rLnks[ --n ]);
if( pLnk && OBJECT_CLIENT_GRF != pLnk->GetObjType() &&
@@ -277,7 +277,7 @@ if( !pChkLnk )
{
if( pLnk == pChkLnk ||
((SwBaseLink*)pLnk)->IsRecursion( pChkLnk ) )
- return TRUE;
+ return sal_True;
}
else if( ((SwBaseLink*)pLnk)->IsRecursion( (SwBaseLink*)pLnk ) )
((SwBaseLink*)pLnk)->SetNoDataFlag();
@@ -288,7 +288,7 @@ if( !pChkLnk )
((SwServerObject*)this)->eType = eSave;
}
- return FALSE;
+ return sal_False;
}
void SwServerObject::SetNoServer()
@@ -322,7 +322,7 @@ void SwServerObject::SetDdeBookmark( ::sw::mark::IMark& rBookmark)
/* */
-SwDataChanged::SwDataChanged( const SwPaM& rPam, USHORT nTyp )
+SwDataChanged::SwDataChanged( const SwPaM& rPam, sal_uInt16 nTyp )
: pPam( &rPam ), pPos( 0 ), pDoc( rPam.GetDoc() ), nType( nTyp )
{
nNode = rPam.GetPoint()->nNode.GetIndex();
@@ -330,7 +330,7 @@ SwDataChanged::SwDataChanged( const SwPaM& rPam, USHORT nTyp )
}
-SwDataChanged::SwDataChanged( SwDoc* pDc, const SwPosition& rPos, USHORT nTyp )
+SwDataChanged::SwDataChanged( SwDoc* pDc, const SwPosition& rPos, sal_uInt16 nTyp )
: pPam( 0 ), pPos( &rPos ), pDoc( pDc ), nType( nTyp )
{
nNode = rPos.nNode.GetIndex();
@@ -345,7 +345,7 @@ SwDataChanged::~SwDataChanged()
{
const ::sfx2::SvLinkSources& rServers = pDoc->GetLinkManager().GetServers();
- for( USHORT nCnt = rServers.Count(); nCnt; )
+ for( sal_uInt16 nCnt = rServers.Count(); nCnt; )
{
::sfx2::SvLinkSourceRef refObj( rServers[ --nCnt ] );
// noch jemand am Object interessiert ?
diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index 7633f92e7867..647acfe9d9a4 100644
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -53,43 +53,43 @@
#include <SwStyleNameMapper.hxx>
// bis SO5PF
-const USHORT AUTOFORMAT_ID_X = 9501;
-const USHORT AUTOFORMAT_ID_358 = 9601;
-const USHORT AUTOFORMAT_DATA_ID_X = 9502;
+const sal_uInt16 AUTOFORMAT_ID_X = 9501;
+const sal_uInt16 AUTOFORMAT_ID_358 = 9601;
+const sal_uInt16 AUTOFORMAT_DATA_ID_X = 9502;
// ab SO5
//! in nachfolgenden Versionen muss der Betrag dieser IDs groesser sein
-const USHORT AUTOFORMAT_ID_504 = 9801;
-const USHORT AUTOFORMAT_DATA_ID_504 = 9802;
+const sal_uInt16 AUTOFORMAT_ID_504 = 9801;
+const sal_uInt16 AUTOFORMAT_DATA_ID_504 = 9802;
-const USHORT AUTOFORMAT_ID_552 = 9901;
-const USHORT AUTOFORMAT_DATA_ID_552 = 9902;
+const sal_uInt16 AUTOFORMAT_ID_552 = 9901;
+const sal_uInt16 AUTOFORMAT_DATA_ID_552 = 9902;
// --- from 641 on: CJK and CTL font settings
-const USHORT AUTOFORMAT_ID_641 = 10001;
-const USHORT AUTOFORMAT_DATA_ID_641 = 10002;
+const sal_uInt16 AUTOFORMAT_ID_641 = 10001;
+const sal_uInt16 AUTOFORMAT_DATA_ID_641 = 10002;
// --- from 680/dr14 on: diagonal frame lines
-const USHORT AUTOFORMAT_ID_680DR14 = 10011;
-const USHORT AUTOFORMAT_DATA_ID_680DR14 = 10012;
+const sal_uInt16 AUTOFORMAT_ID_680DR14 = 10011;
+const sal_uInt16 AUTOFORMAT_DATA_ID_680DR14 = 10012;
// --- from 680/dr25 on: #21549# store strings as UTF-8
-const USHORT AUTOFORMAT_ID_680DR25 = 10021;
-const USHORT AUTOFORMAT_DATA_ID_680DR25 = 10022;
+const sal_uInt16 AUTOFORMAT_ID_680DR25 = 10021;
+const sal_uInt16 AUTOFORMAT_DATA_ID_680DR25 = 10022;
// --- from DEV300/overline2 on: #5991# overline
-const USHORT AUTOFORMAT_ID_300OVRLN = 10031;
-const USHORT AUTOFORMAT_DATA_ID_300OVRLN = 10032;
+const sal_uInt16 AUTOFORMAT_ID_300OVRLN = 10031;
+const sal_uInt16 AUTOFORMAT_DATA_ID_300OVRLN = 10032;
// current version
-const USHORT AUTOFORMAT_ID = AUTOFORMAT_ID_300OVRLN;
-const USHORT AUTOFORMAT_DATA_ID = AUTOFORMAT_DATA_ID_300OVRLN;
+const sal_uInt16 AUTOFORMAT_ID = AUTOFORMAT_ID_300OVRLN;
+const sal_uInt16 AUTOFORMAT_DATA_ID = AUTOFORMAT_DATA_ID_300OVRLN;
#ifdef READ_OLDVERS
-const USHORT AUTOFORMAT_OLD_ID = 8201;
-const USHORT AUTOFORMAT_OLD_ID1 = 8301;
-const USHORT AUTOFORMAT_OLD_DATA_ID = 8202;
+const sal_uInt16 AUTOFORMAT_OLD_ID = 8201;
+const sal_uInt16 AUTOFORMAT_OLD_ID1 = 8301;
+const sal_uInt16 AUTOFORMAT_OLD_DATA_ID = 8202;
#endif
@@ -106,34 +106,34 @@ SV_IMPL_PTRARR( _SwTableAutoFmtTbl, SwTableAutoFmt* )
struct SwAfVersions
{
public:
- USHORT nFontVersion;
- USHORT nFontHeightVersion;
- USHORT nWeightVersion;
- USHORT nPostureVersion;
- USHORT nUnderlineVersion;
- USHORT nOverlineVersion;
- USHORT nCrossedOutVersion;
- USHORT nContourVersion;
- USHORT nShadowedVersion;
- USHORT nColorVersion;
- USHORT nBoxVersion;
- USHORT nLineVersion;
- USHORT nBrushVersion;
-
- USHORT nAdjustVersion;
-
- USHORT nHorJustifyVersion;
- USHORT nVerJustifyVersion;
- USHORT nOrientationVersion;
- USHORT nMarginVersion;
- USHORT nBoolVersion;
- USHORT nInt32Version;
- USHORT nRotateModeVersion;
-
- USHORT nNumFmtVersion;
+ sal_uInt16 nFontVersion;
+ sal_uInt16 nFontHeightVersion;
+ sal_uInt16 nWeightVersion;
+ sal_uInt16 nPostureVersion;
+ sal_uInt16 nUnderlineVersion;
+ sal_uInt16 nOverlineVersion;
+ sal_uInt16 nCrossedOutVersion;
+ sal_uInt16 nContourVersion;
+ sal_uInt16 nShadowedVersion;
+ sal_uInt16 nColorVersion;
+ sal_uInt16 nBoxVersion;
+ sal_uInt16 nLineVersion;
+ sal_uInt16 nBrushVersion;
+
+ sal_uInt16 nAdjustVersion;
+
+ sal_uInt16 nHorJustifyVersion;
+ sal_uInt16 nVerJustifyVersion;
+ sal_uInt16 nOrientationVersion;
+ sal_uInt16 nMarginVersion;
+ sal_uInt16 nBoolVersion;
+ sal_uInt16 nInt32Version;
+ sal_uInt16 nRotateModeVersion;
+
+ sal_uInt16 nNumFmtVersion;
SwAfVersions();
- void Load( SvStream& rStream, USHORT nVer );
+ void Load( SvStream& rStream, sal_uInt16 nVer );
};
SwAfVersions::SwAfVersions() :
@@ -162,7 +162,7 @@ SwAfVersions::SwAfVersions() :
{
}
-void SwAfVersions::Load( SvStream& rStream, USHORT nVer )
+void SwAfVersions::Load( SvStream& rStream, sal_uInt16 nVer )
{
rStream >> nFontVersion;
rStream >> nFontHeightVersion;
@@ -328,7 +328,7 @@ SwBoxAutoFmt& SwBoxAutoFmt::operator=( const SwBoxAutoFmt& rNew )
aItem = *(aItemType*)pNew; \
delete pNew;
-BOOL SwBoxAutoFmt::Load( SvStream& rStream, const SwAfVersions& rVersions, USHORT nVer )
+sal_Bool SwBoxAutoFmt::Load( SvStream& rStream, const SwAfVersions& rVersions, sal_uInt16 nVer )
{
SfxPoolItem* pNew;
SvxOrientationItem aOrientation( SVX_ORIENTATION_STANDARD, 0);
@@ -399,7 +399,7 @@ BOOL SwBoxAutoFmt::Load( SvStream& rStream, const SwAfVersions& rVersions, USHOR
if( 0 == rVersions.nNumFmtVersion )
{
- USHORT eSys, eLge;
+ sal_uInt16 eSys, eLge;
// --- from 680/dr25 on: #21549# store strings as UTF-8
CharSet eCharSet = (nVer >= AUTOFORMAT_ID_680DR25) ? RTL_TEXTENCODING_UTF8 : rStream.GetStreamCharSet();
rStream.ReadByteString( sNumFmtString, eCharSet )
@@ -418,7 +418,7 @@ BOOL SwBoxAutoFmt::Load( SvStream& rStream, const SwAfVersions& rVersions, USHOR
#ifdef READ_OLDVERS
-BOOL SwBoxAutoFmt::LoadOld( SvStream& rStream, USHORT aLoadVer[] )
+sal_Bool SwBoxAutoFmt::LoadOld( SvStream& rStream, sal_uInt16 aLoadVer[] )
{
SfxPoolItem* pNew;
READ( aFont, SvxFontItem , 0)
@@ -448,7 +448,7 @@ BOOL SwBoxAutoFmt::LoadOld( SvStream& rStream, USHORT aLoadVer[] )
#endif
-BOOL SwBoxAutoFmt::Save( SvStream& rStream ) const
+sal_Bool SwBoxAutoFmt::Save( SvStream& rStream ) const
{
SvxOrientationItem aOrientation( aRotateAngle.GetValue(), aStacked.GetValue(), 0 );
@@ -488,13 +488,13 @@ BOOL SwBoxAutoFmt::Save( SvStream& rStream ) const
// --- from 680/dr25 on: #21549# store strings as UTF-8
rStream.WriteByteString( sNumFmtString, RTL_TEXTENCODING_UTF8 )
- << (USHORT)eSysLanguage << (USHORT)eNumFmtLanguage;
+ << (sal_uInt16)eSysLanguage << (sal_uInt16)eNumFmtLanguage;
return 0 == rStream.GetError();
}
-BOOL SwBoxAutoFmt::SaveVerionNo( SvStream& rStream ) const
+sal_Bool SwBoxAutoFmt::SaveVerionNo( SvStream& rStream ) const
{
rStream << aFont.GetVersion( SOFFICE_FILEFORMAT_40 );
rStream << aHeight.GetVersion( SOFFICE_FILEFORMAT_40 );
@@ -520,7 +520,7 @@ BOOL SwBoxAutoFmt::SaveVerionNo( SvStream& rStream ) const
rStream << aRotateAngle.GetVersion( SOFFICE_FILEFORMAT_40 );
rStream << aRotateMode.GetVersion( SOFFICE_FILEFORMAT_40 );
- rStream << (USHORT)0; // NumberFormat
+ rStream << (sal_uInt16)0; // NumberFormat
return 0 == rStream.GetError();
}
@@ -531,12 +531,12 @@ BOOL SwBoxAutoFmt::SaveVerionNo( SvStream& rStream ) const
SwTableAutoFmt::SwTableAutoFmt( const String& rName )
: aName( rName ), nStrResId( USHRT_MAX )
{
- bInclFont = TRUE;
- bInclJustify = TRUE;
- bInclFrame = TRUE;
- bInclBackground = TRUE;
- bInclValueFormat = TRUE;
- bInclWidthHeight = TRUE;
+ bInclFont = sal_True;
+ bInclJustify = sal_True;
+ bInclFrame = sal_True;
+ bInclBackground = sal_True;
+ bInclValueFormat = sal_True;
+ bInclWidthHeight = sal_True;
memset( aBoxAutoFmt, 0, sizeof( aBoxAutoFmt ) );
}
@@ -544,14 +544,14 @@ SwTableAutoFmt::SwTableAutoFmt( const String& rName )
SwTableAutoFmt::SwTableAutoFmt( const SwTableAutoFmt& rNew )
{
- for( BYTE n = 0; n < 16; ++n )
+ for( sal_uInt8 n = 0; n < 16; ++n )
aBoxAutoFmt[ n ] = 0;
*this = rNew;
}
SwTableAutoFmt& SwTableAutoFmt::operator=( const SwTableAutoFmt& rNew )
{
- for( BYTE n = 0; n < 16; ++n )
+ for( sal_uInt8 n = 0; n < 16; ++n )
{
if( aBoxAutoFmt[ n ] )
delete aBoxAutoFmt[ n ];
@@ -579,13 +579,13 @@ SwTableAutoFmt& SwTableAutoFmt::operator=( const SwTableAutoFmt& rNew )
SwTableAutoFmt::~SwTableAutoFmt()
{
SwBoxAutoFmt** ppFmt = aBoxAutoFmt;
- for( BYTE n = 0; n < 16; ++n, ++ppFmt )
+ for( sal_uInt8 n = 0; n < 16; ++n, ++ppFmt )
if( *ppFmt )
delete *ppFmt;
}
-void SwTableAutoFmt::SetBoxFmt( const SwBoxAutoFmt& rNew, BYTE nPos )
+void SwTableAutoFmt::SetBoxFmt( const SwBoxAutoFmt& rNew, sal_uInt8 nPos )
{
ASSERT( nPos < 16, "falscher Bereich" );
@@ -597,7 +597,7 @@ void SwTableAutoFmt::SetBoxFmt( const SwBoxAutoFmt& rNew, BYTE nPos )
}
-const SwBoxAutoFmt& SwTableAutoFmt::GetBoxFmt( BYTE nPos ) const
+const SwBoxAutoFmt& SwTableAutoFmt::GetBoxFmt( sal_uInt8 nPos ) const
{
ASSERT( nPos < 16, "falscher Bereich" );
@@ -615,7 +615,7 @@ const SwBoxAutoFmt& SwTableAutoFmt::GetBoxFmt( BYTE nPos ) const
-SwBoxAutoFmt& SwTableAutoFmt::UpdateFromSet( BYTE nPos,
+SwBoxAutoFmt& SwTableAutoFmt::UpdateFromSet( sal_uInt8 nPos,
const SfxItemSet& rSet,
UpdateFlags eFlags,
SvNumberFormatter* pNFmtr )
@@ -661,7 +661,7 @@ SwBoxAutoFmt& SwTableAutoFmt::UpdateFromSet( BYTE nPos,
const SwTblBoxNumFormat* pNumFmtItem;
const SvNumberformat* pNumFormat = 0;
- if( SFX_ITEM_SET == rSet.GetItemState( RES_BOXATR_FORMAT, TRUE,
+ if( SFX_ITEM_SET == rSet.GetItemState( RES_BOXATR_FORMAT, sal_True,
(const SfxPoolItem**)&pNumFmtItem ) && pNFmtr &&
0 != (pNumFormat = pNFmtr->GetEntry( pNumFmtItem->GetValue() )) )
pFmt->SetValueFormat( ((SvNumberformat*)pNumFormat)->GetFormatstring(),
@@ -680,7 +680,7 @@ SwBoxAutoFmt& SwTableAutoFmt::UpdateFromSet( BYTE nPos,
}
-void SwTableAutoFmt::UpdateToSet( BYTE nPos, SfxItemSet& rSet,
+void SwTableAutoFmt::UpdateToSet( sal_uInt8 nPos, SfxItemSet& rSet,
UpdateFlags eFlags, SvNumberFormatter* pNFmtr ) const
{
const SwBoxAutoFmt& rChg = GetBoxFmt( nPos );
@@ -753,7 +753,7 @@ void SwTableAutoFmt::UpdateToSet( BYTE nPos, SfxItemSet& rSet,
if( sFmt.Len() )
{
short nType;
- BOOL bNew;
+ sal_Bool bNew;
xub_StrLen nCheckPos;
sal_uInt32 nKey = pNFmtr->GetIndexPuttingAndConverting( sFmt, eLng,
eSys, nType, bNew, nCheckPos);
@@ -768,24 +768,24 @@ void SwTableAutoFmt::UpdateToSet( BYTE nPos, SfxItemSet& rSet,
}
-BOOL SwTableAutoFmt::Load( SvStream& rStream, const SwAfVersions& rVersions )
+sal_Bool SwTableAutoFmt::Load( SvStream& rStream, const SwAfVersions& rVersions )
{
- BOOL bRet = TRUE;
- USHORT nVal = 0;
+ sal_Bool bRet = sal_True;
+ sal_uInt16 nVal = 0;
rStream >> nVal;
bRet = 0 == rStream.GetError();
if( bRet && (nVal == AUTOFORMAT_DATA_ID_X ||
(AUTOFORMAT_DATA_ID_504 <= nVal && nVal <= AUTOFORMAT_DATA_ID)) )
{
- BOOL b;
+ sal_Bool b;
// --- from 680/dr25 on: #21549# store strings as UTF-8
CharSet eCharSet = (nVal >= AUTOFORMAT_ID_680DR25) ? RTL_TEXTENCODING_UTF8 : rStream.GetStreamCharSet();
rStream.ReadByteString( aName, eCharSet );
if( AUTOFORMAT_DATA_ID_552 <= nVal )
{
rStream >> nStrResId;
- USHORT nId = RID_SVXSTR_TBLAFMT_BEGIN + nStrResId;
+ sal_uInt16 nId = RID_SVXSTR_TBLAFMT_BEGIN + nStrResId;
if( RID_SVXSTR_TBLAFMT_BEGIN <= nId &&
nId < RID_SVXSTR_TBLAFMT_END )
{
@@ -803,7 +803,7 @@ BOOL SwTableAutoFmt::Load( SvStream& rStream, const SwAfVersions& rVersions )
bRet = 0 == rStream.GetError();
- for( BYTE i = 0; i < 16; ++i )
+ for( sal_uInt8 i = 0; i < 16; ++i )
{
SwBoxAutoFmt* pFmt = new SwBoxAutoFmt;
bRet = pFmt->Load( rStream, rVersions, nVal );
@@ -821,16 +821,16 @@ BOOL SwTableAutoFmt::Load( SvStream& rStream, const SwAfVersions& rVersions )
#ifdef READ_OLDVERS
-BOOL SwTableAutoFmt::LoadOld( SvStream& rStream, USHORT aLoadVer[] )
+sal_Bool SwTableAutoFmt::LoadOld( SvStream& rStream, sal_uInt16 aLoadVer[] )
{
- BOOL bRet = TRUE;
- USHORT nVal = 0;
+ sal_Bool bRet = sal_True;
+ sal_uInt16 nVal = 0;
rStream >> nVal;
bRet = 0 == rStream.GetError();
if( bRet && ( AUTOFORMAT_OLD_DATA_ID == nVal ))
{
- BOOL b;
+ sal_Bool b;
rStream.ReadByteString( aName, rStream.GetStreamCharSet() );
rStream >> b; bInclFont = b;
rStream >> b; bInclJustify = b;
@@ -856,10 +856,10 @@ BOOL SwTableAutoFmt::LoadOld( SvStream& rStream, USHORT aLoadVer[] )
#endif
-BOOL SwTableAutoFmt::Save( SvStream& rStream ) const
+sal_Bool SwTableAutoFmt::Save( SvStream& rStream ) const
{
- USHORT nVal = AUTOFORMAT_DATA_ID;
- BOOL b;
+ sal_uInt16 nVal = AUTOFORMAT_DATA_ID;
+ sal_Bool b;
rStream << nVal;
// --- from 680/dr25 on: #21549# store strings as UTF-8
rStream.WriteByteString( aName, RTL_TEXTENCODING_UTF8 );
@@ -871,7 +871,7 @@ BOOL SwTableAutoFmt::Save( SvStream& rStream ) const
rStream << ( b = bInclValueFormat );
rStream << ( b = bInclWidthHeight );
- BOOL bRet = 0 == rStream.GetError();
+ sal_Bool bRet = 0 == rStream.GetError();
for( int i = 0; bRet && i < 16; ++i )
{
@@ -897,7 +897,7 @@ SwTableAutoFmtTbl::SwTableAutoFmtTbl()
SwBoxAutoFmt aNew;
- BYTE i;
+ sal_uInt8 i;
Color aColor( COL_BLUE );
SvxBrushItem aBrushItem( aColor, RES_BACKGROUND );
@@ -947,39 +947,39 @@ SwTableAutoFmtTbl::SwTableAutoFmtTbl()
Insert( pNew, Count() );
}
-BOOL SwTableAutoFmtTbl::Load()
+sal_Bool SwTableAutoFmtTbl::Load()
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
String sNm( String::CreateFromAscii(
RTL_CONSTASCII_STRINGPARAM( sAutoTblFmtName )));
SvtPathOptions aOpt;
if( aOpt.SearchFile( sNm, SvtPathOptions::PATH_USERCONFIG ))
{
- SfxMedium aStream( sNm, STREAM_STD_READ, TRUE );
+ SfxMedium aStream( sNm, STREAM_STD_READ, sal_True );
bRet = Load( *aStream.GetInStream() );
}
else
- bRet = FALSE;
+ bRet = sal_False;
return bRet;
}
-BOOL SwTableAutoFmtTbl::Save() const
+sal_Bool SwTableAutoFmtTbl::Save() const
{
SvtPathOptions aPathOpt;
String sNm( aPathOpt.GetUserConfigPath() );
sNm += INET_PATH_TOKEN;
sNm.AppendAscii( RTL_CONSTASCII_STRINGPARAM( sAutoTblFmtName ));
- SfxMedium aStream(sNm, STREAM_STD_WRITE, TRUE );
+ SfxMedium aStream(sNm, STREAM_STD_WRITE, sal_True );
return Save( *aStream.GetOutStream() ) && aStream.Commit();
}
-BOOL SwTableAutoFmtTbl::Load( SvStream& rStream )
+sal_Bool SwTableAutoFmtTbl::Load( SvStream& rStream )
{
- BOOL bRet = 0 == rStream.GetError();
+ sal_Bool bRet = 0 == rStream.GetError();
if (bRet)
{
// Achtung hier muss ein allgemeiner Header gelesen werden
- USHORT nVal = 0;
+ sal_uInt16 nVal = 0;
rStream >> nVal;
bRet = 0 == rStream.GetError();
@@ -990,13 +990,13 @@ BOOL SwTableAutoFmtTbl::Load( SvStream& rStream )
if( nVal == AUTOFORMAT_ID_358 ||
(AUTOFORMAT_ID_504 <= nVal && nVal <= AUTOFORMAT_ID) )
{
- UINT16 nFileVers = SOFFICE_FILEFORMAT_40;
- BYTE nChrSet, nCnt;
+ sal_uInt16 nFileVers = SOFFICE_FILEFORMAT_40;
+ sal_uInt8 nChrSet, nCnt;
long nPos = rStream.Tell();
rStream >> nCnt >> nChrSet;
// if( 4 <= nCnt )
// rStream >> nFileVers;
- if( rStream.Tell() != ULONG(nPos + nCnt) )
+ if( rStream.Tell() != sal_uLong(nPos + nCnt) )
{
ASSERT( !this, "Der Header enthaelt mehr/neuere Daten" );
rStream.Seek( nPos + nCnt );
@@ -1011,12 +1011,12 @@ BOOL SwTableAutoFmtTbl::Load( SvStream& rStream )
aVersions.Load( rStream, nVal ); // Item-Versionen
SwTableAutoFmt* pNew;
- USHORT nAnz = 0;
+ sal_uInt16 nAnz = 0;
rStream >> nAnz;
bRet = 0 == rStream.GetError();
- for( USHORT i = 0; i < nAnz; ++i )
+ for( sal_uInt16 i = 0; i < nAnz; ++i )
{
pNew = new SwTableAutoFmt( aEmptyStr );
bRet = pNew->Load( rStream, aVersions );
@@ -1035,18 +1035,18 @@ BOOL SwTableAutoFmtTbl::Load( SvStream& rStream )
else if( AUTOFORMAT_OLD_ID == nVal || AUTOFORMAT_OLD_ID1 == nVal )
{
SwTableAutoFmt* pNew;
- USHORT nAnz = 0;
+ sal_uInt16 nAnz = 0;
rStream >> nAnz;
- USHORT aArr[ 12 ];
- memset( aArr, 0, 12 * sizeof( USHORT ) );
+ sal_uInt16 aArr[ 12 ];
+ memset( aArr, 0, 12 * sizeof( sal_uInt16 ) );
if( AUTOFORMAT_OLD_ID1 == nVal )
- for( USHORT n = 0; n < 12; ++n )
+ for( sal_uInt16 n = 0; n < 12; ++n )
rStream >> aArr[ n ];
bRet = 0 == rStream.GetError();
- for( USHORT i = 0; i < nAnz; ++i )
+ for( sal_uInt16 i = 0; i < nAnz; ++i )
{
pNew = new SwTableAutoFmt( aEmptyStr );
bRet = pNew->LoadOld( rStream, aArr );
@@ -1068,20 +1068,20 @@ BOOL SwTableAutoFmtTbl::Load( SvStream& rStream )
}
-BOOL SwTableAutoFmtTbl::Save( SvStream& rStream ) const
+sal_Bool SwTableAutoFmtTbl::Save( SvStream& rStream ) const
{
- BOOL bRet = 0 == rStream.GetError();
+ sal_Bool bRet = 0 == rStream.GetError();
if (bRet)
{
rStream.SetVersion( SOFFICE_FILEFORMAT_40 );
// Achtung hier muss ein allgemeiner Header gespeichert werden
- USHORT nVal = AUTOFORMAT_ID;
+ sal_uInt16 nVal = AUTOFORMAT_ID;
rStream << nVal
- << (BYTE)2 // Anzahl von Zeichen des Headers incl. diesem
- << (BYTE)GetStoreCharSet( ::gsl_getSystemTextEncoding() );
-// << (BYTE)4 // Anzahl von Zeichen des Headers incl. diesem
-// << (BYTE)::GetSystemCharSet()
+ << (sal_uInt8)2 // Anzahl von Zeichen des Headers incl. diesem
+ << (sal_uInt8)GetStoreCharSet( ::gsl_getSystemTextEncoding() );
+// << (sal_uInt8)4 // Anzahl von Zeichen des Headers incl. diesem
+// << (sal_uInt8)::GetSystemCharSet()
// << (UNIT16)SOFFICE_FILEFORMAT_NOW;
bRet = 0 == rStream.GetError();
@@ -1089,10 +1089,10 @@ BOOL SwTableAutoFmtTbl::Save( SvStream& rStream ) const
// die VersionsNummer fuer alle Attribute schreiben
(*this)[ 0 ]->GetBoxFmt( 0 ).SaveVerionNo( rStream );
- rStream << (USHORT)(Count() - 1);
+ rStream << (sal_uInt16)(Count() - 1);
bRet = 0 == rStream.GetError();
- for( USHORT i = 1; bRet && i < Count(); ++i )
+ for( sal_uInt16 i = 1; bRet && i < Count(); ++i )
{
SwTableAutoFmt* pFmt = (*this)[ i ];
bRet = pFmt->Save( rStream );
diff --git a/sw/source/core/doc/tblcpy.cxx b/sw/source/core/doc/tblcpy.cxx
index e19e60e645df..51e1d455beb5 100644
--- a/sw/source/core/doc/tblcpy.cxx
+++ b/sw/source/core/doc/tblcpy.cxx
@@ -35,6 +35,7 @@
#include <svl/zforlist.hxx>
#include <frmfmt.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <cntfrm.hxx>
#include <pam.hxx>
#include <swtable.hxx>
@@ -47,16 +48,17 @@
#include <mvsave.hxx>
#include <docary.hxx>
#include <fmtanchr.hxx>
-#include <undobj.hxx>
+#include <hints.hxx>
+#include <UndoTable.hxx>
#include <redline.hxx>
#include <fmtfsize.hxx>
#include <list>
-BOOL _FndCntntLine( const SwTableLine*& rpLine, void* pPara );
-BOOL _FndCntntBox( const SwTableBox*& rpBox, void* pPara );
+sal_Bool _FndCntntLine( const SwTableLine*& rpLine, void* pPara );
+sal_Bool _FndCntntBox( const SwTableBox*& rpBox, void* pPara );
void lcl_CpyBox( const SwTable& rCpyTbl, const SwTableBox* pCpyBox,
SwTable& rDstTbl, SwTableBox* pDstBox,
- BOOL bDelCntnt, SwUndoTblCpyTbl* pUndo );
+ sal_Bool bDelCntnt, SwUndoTblCpyTbl* pUndo );
// The following type will be used by table copy functions to describe
// the structure of tables (or parts of tables).
@@ -68,13 +70,13 @@ namespace
{
SwTableBox* mpBox;
SwTableBox* mpCopy;
- USHORT mnColSpan;
+ sal_uInt16 mnColSpan;
bool mbSelected;
};
typedef std::vector< BoxSpanInfo > BoxStructure;
typedef std::vector< BoxStructure > LineStructure;
- typedef std::list< ULONG > ColumnStructure;
+ typedef std::list< sal_uLong > ColumnStructure;
struct SubBox
{
@@ -90,14 +92,14 @@ namespace
public:
LineStructure maLines;
ColumnStructure maCols;
- USHORT mnStartCol;
- USHORT mnAddLine;
- void addLine( USHORT &rLine, const SwTableBoxes&, const SwSelBoxes*,
+ sal_uInt16 mnStartCol;
+ sal_uInt16 mnAddLine;
+ void addLine( sal_uInt16 &rLine, const SwTableBoxes&, const SwSelBoxes*,
bool bNewModel );
- void addBox( USHORT nLine, const SwSelBoxes*, SwTableBox *pBox,
- ULONG &rnB, USHORT &rnC, ColumnStructure::iterator& rpCl,
+ void addBox( sal_uInt16 nLine, const SwSelBoxes*, SwTableBox *pBox,
+ sal_uLong &rnB, sal_uInt16 &rnC, ColumnStructure::iterator& rpCl,
BoxStructure::iterator& rpSel, bool &rbSel, bool bCover );
- void incColSpan( USHORT nLine, USHORT nCol );
+ void incColSpan( sal_uInt16 nLine, sal_uInt16 nCol );
TableStructure( const SwTable& rTable );
TableStructure( const SwTable& rTable, _FndBox &rFndBox,
const SwSelBoxes& rSelBoxes,
@@ -137,7 +139,7 @@ namespace
rSubTable.insert( pEndLn, aSubLine );
} while( ++nSize < rBox.GetTabLines().Count() );
}
- for( USHORT nLine = 0; nLine < rBox.GetTabLines().Count(); ++nLine )
+ for( sal_uInt16 nLine = 0; nLine < rBox.GetTabLines().Count(); ++nLine )
pStartLn = insertSubLine( rSubTable, *rBox.GetTabLines()[nLine],
pStartLn );
ASSERT( pStartLn == pEndLn, "Sub line confusion" );
@@ -163,7 +165,7 @@ namespace
SubTable::iterator pMax = pStartLn;
++pMax;
SubTable::difference_type nMax = 1;
- for( USHORT nBox = 0; nBox < rLine.GetTabBoxes().Count(); ++nBox )
+ for( sal_uInt16 nBox = 0; nBox < rLine.GetTabBoxes().Count(); ++nBox )
{
SubTable::iterator pTmp = insertSubBox( rSubTable,
*rLine.GetTabBoxes()[nBox], pStartLn, pMax );
@@ -183,8 +185,8 @@ namespace
{
maCols.push_front(0);
const SwTableLines &rLines = rTable.GetTabLines();
- USHORT nCnt = 0;
- for( USHORT nLine = 0; nLine < rLines.Count(); ++nLine )
+ sal_uInt16 nCnt = 0;
+ for( sal_uInt16 nLine = 0; nLine < rLines.Count(); ++nLine )
addLine( nCnt, rLines[nLine]->GetTabBoxes(), 0, rTable.IsNewModel() );
}
@@ -199,8 +201,8 @@ namespace
_FndLines &rFndLines = rFndBox.GetLines();
maCols.push_front(0);
const SwTableLine* pLine = rFndLines[0]->GetLine();
- USHORT nStartLn = rTable.GetTabLines().C40_GETPOS( SwTableLine, pLine );
- USHORT nEndLn = nStartLn;
+ sal_uInt16 nStartLn = rTable.GetTabLines().C40_GETPOS( SwTableLine, pLine );
+ sal_uInt16 nEndLn = nStartLn;
if( rFndLines.Count() > 1 )
{
pLine = rFndLines[ rFndLines.Count()-1 ]->GetLine();
@@ -210,9 +212,9 @@ namespace
{
const SwTableLines &rLines = rTable.GetTabLines();
if( bNoSelection &&
- (USHORT)nMinSize > nEndLn - nStartLn + 1 )
+ (sal_uInt16)nMinSize > nEndLn - nStartLn + 1 )
{
- USHORT nNewEndLn = nStartLn + (USHORT)nMinSize - 1;
+ sal_uInt16 nNewEndLn = nStartLn + (sal_uInt16)nMinSize - 1;
if( nNewEndLn >= rLines.Count() )
{
mnAddLine = nNewEndLn - rLines.Count() + 1;
@@ -230,8 +232,8 @@ namespace
}
maLines.resize( nEndLn - nStartLn + 1 );
const SwSelBoxes* pSelBoxes = &rSelBoxes;
- USHORT nCnt = 0;
- for( USHORT nLine = nStartLn; nLine <= nEndLn; ++nLine )
+ sal_uInt16 nCnt = 0;
+ for( sal_uInt16 nLine = nStartLn; nLine <= nEndLn; ++nLine )
{
addLine( nCnt, rLines[nLine]->GetTabBoxes(),
pSelBoxes, rTable.IsNewModel() );
@@ -243,7 +245,7 @@ namespace
{
BoxStructure::iterator pC = maLines[0].begin();
BoxStructure::iterator pEnd = maLines[0].end();
- USHORT nIdx = mnStartCol;
+ sal_uInt16 nIdx = mnStartCol;
mnStartCol = 0;
while( nIdx && pC != pEnd )
{
@@ -257,12 +259,12 @@ namespace
}
}
- void TableStructure::addLine( USHORT &rLine, const SwTableBoxes& rBoxes,
+ void TableStructure::addLine( sal_uInt16 &rLine, const SwTableBoxes& rBoxes,
const SwSelBoxes* pSelBoxes, bool bNewModel )
{
bool bComplex = false;
if( !bNewModel )
- for( USHORT nBox = 0; !bComplex && nBox < rBoxes.Count(); ++nBox )
+ for( sal_uInt16 nBox = 0; !bComplex && nBox < rBoxes.Count(); ++nBox )
bComplex = rBoxes[nBox]->GetTabLines().Count() > 0;
if( bComplex )
{
@@ -271,7 +273,7 @@ namespace
aSubTable.push_back( aSubLine );
SubTable::iterator pStartLn = aSubTable.begin();
SubTable::iterator pEndLn = aSubTable.end();
- for( USHORT nBox = 0; nBox < rBoxes.Count(); ++nBox )
+ for( sal_uInt16 nBox = 0; nBox < rBoxes.Count(); ++nBox )
insertSubBox( aSubTable, *rBoxes[nBox], pStartLn, pEndLn );
SubTable::size_type nSize = aSubTable.size();
if( nSize )
@@ -280,8 +282,8 @@ namespace
while( pStartLn != pEndLn )
{
bool bSelected = false;
- ULONG nBorder = 0;
- USHORT nCol = 0;
+ sal_uLong nBorder = 0;
+ sal_uInt16 nCol = 0;
maLines[rLine].reserve( pStartLn->size() );
BoxStructure::iterator pSel = maLines[rLine].end();
ColumnStructure::iterator pCol = maCols.begin();
@@ -301,20 +303,20 @@ namespace
else
{
bool bSelected = false;
- ULONG nBorder = 0;
- USHORT nCol = 0;
+ sal_uLong nBorder = 0;
+ sal_uInt16 nCol = 0;
maLines[rLine].reserve( rBoxes.Count() );
ColumnStructure::iterator pCol = maCols.begin();
BoxStructure::iterator pSel = maLines[rLine].end();
- for( USHORT nBox = 0; nBox < rBoxes.Count(); ++nBox )
+ for( sal_uInt16 nBox = 0; nBox < rBoxes.Count(); ++nBox )
addBox( rLine, pSelBoxes, rBoxes[nBox], nBorder, nCol,
pCol, pSel, bSelected, false );
++rLine;
}
}
- void TableStructure::addBox( USHORT nLine, const SwSelBoxes* pSelBoxes,
- SwTableBox *pBox, ULONG &rnBorder, USHORT &rnCol,
+ void TableStructure::addBox( sal_uInt16 nLine, const SwSelBoxes* pSelBoxes,
+ SwTableBox *pBox, sal_uLong &rnBorder, sal_uInt16 &rnCol,
ColumnStructure::iterator& rpCol, BoxStructure::iterator& rpSel,
bool &rbSelected, bool bCovered )
{
@@ -325,7 +327,7 @@ namespace
aInfo.mbSelected = true;
if( mnStartCol == USHRT_MAX )
{
- mnStartCol = (USHORT)maLines[nLine].size();
+ mnStartCol = (sal_uInt16)maLines[nLine].size();
if( pSelBoxes->Count() < 2 )
{
pSelBoxes = 0;
@@ -336,7 +338,7 @@ namespace
else
aInfo.mbSelected = false;
rnBorder += pBox->GetFrmFmt()->GetFrmSize().GetWidth();
- USHORT nLeftCol = rnCol;
+ sal_uInt16 nLeftCol = rnCol;
while( rpCol != maCols.end() && *rpCol < rnBorder )
{
++rnCol;
@@ -376,10 +378,10 @@ namespace
if( mnAddLine )
{
const SwTableLines &rLines = rTable.GetTabLines();
- USHORT nLineCount = rLines.Count();
+ sal_uInt16 nLineCount = rLines.Count();
if( nLineCount < mnAddLine )
mnAddLine = nLineCount;
- USHORT nLine = (USHORT)maLines.size();
+ sal_uInt16 nLine = (sal_uInt16)maLines.size();
maLines.resize( nLine + mnAddLine );
while( mnAddLine )
{
@@ -390,9 +392,9 @@ namespace
}
}
- void TableStructure::incColSpan( USHORT nLineMax, USHORT nNewCol )
+ void TableStructure::incColSpan( sal_uInt16 nLineMax, sal_uInt16 nNewCol )
{
- for( USHORT nLine = 0; nLine < nLineMax; ++nLine )
+ for( sal_uInt16 nLine = 0; nLine < nLineMax; ++nLine )
{
BoxStructure::iterator pInfo = maLines[nLine].begin();
BoxStructure::iterator pEnd = maLines[nLine].end();
@@ -412,7 +414,7 @@ namespace
return;
LineStructure::const_iterator pCurrLine = pFirstLine;
LineStructure::size_type nLineCount = maLines.size();
- USHORT nFirstStartCol = 0;
+ sal_uInt16 nFirstStartCol = 0;
{
BoxStructure::const_iterator pFirstBox = pFirstLine->begin();
if( pFirstBox != pFirstLine->end() && pFirstBox->mpBox &&
@@ -423,7 +425,7 @@ namespace
{
BoxStructure::const_iterator pFirstBox = pCurrLine->begin();
BoxStructure::const_iterator pLastBox = pCurrLine->end();
- USHORT nCurrStartCol = mnStartCol;
+ sal_uInt16 nCurrStartCol = mnStartCol;
if( pFirstBox != pLastBox )
{
BoxStructure::const_iterator pTmpBox = pLastBox;
@@ -447,7 +449,7 @@ namespace
BoxStructure::const_iterator pCurrBox = pFirstBox;
BoxStructure &rBox = maLines[nLine];
BoxStructure::size_type nBoxCount = rBox.size();
- USHORT nCol = 0;
+ sal_uInt16 nCol = 0;
for( BoxStructure::size_type nBox = 0; nBox < nBoxCount; ++nBox )
{
BoxSpanInfo& rInfo = rBox[nBox];
@@ -504,16 +506,16 @@ namespace
SwTableBox *pBox = rInfo.mpBox;
if( pBox && pBox->getRowSpan() > 0 )
lcl_CpyBox( rSource, rInfo.mpCopy, rDstTbl, pBox,
- TRUE, pUndo );
+ sal_True, pUndo );
/* Idea: If target cell is a covered cell, append content
to master cell.
- BOOL bReplace = TRUE;
+ sal_Bool bReplace = sal_True;
if( pBox->getRowSpan() < 0 )
{
if( rInfo.mpCopy->getRowSpan() < 0 )
continue;
pBox = &pBox->FindStartOfRowSpan( rDstTbl );
- bReplace = FALSE;
+ bReplace = sal_False;
}
lcl_CpyBox( rSource, rInfo.mpCopy, rDstTbl, pBox,
bReplace, pUndo );
@@ -537,7 +539,7 @@ namespace
void lcl_CpyBox( const SwTable& rCpyTbl, const SwTableBox* pCpyBox,
SwTable& rDstTbl, SwTableBox* pDstBox,
- BOOL bDelCntnt, SwUndoTblCpyTbl* pUndo )
+ sal_Bool bDelCntnt, SwUndoTblCpyTbl* pUndo )
{
ASSERT( ( !pCpyBox || pCpyBox->GetSttNd() ) && pDstBox->GetSttNd(),
"Keine inhaltstragende Box" );
@@ -558,13 +560,12 @@ void lcl_CpyBox( const SwTable& rCpyTbl, const SwTableBox* pCpyBox,
if( pUndo )
pUndo->AddBoxBefore( *pDstBox, bDelCntnt );
- BOOL bUndo = pDoc->DoesUndo();
bool bUndoRedline = pUndo && pDoc->IsRedlineOn();
- pDoc->DoUndo( FALSE );
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
SwNodeIndex aSavePos( aInsIdx, -1 );
if( pRg.get() )
- pCpyDoc->CopyWithFlyInFly( *pRg, 0, aInsIdx, FALSE );
+ pCpyDoc->CopyWithFlyInFly( *pRg, 0, aInsIdx, sal_False );
else
pDoc->GetNodes().MakeTxtNode( aInsIdx, (SwTxtFmtColl*)pDoc->GetDfltTxtFmtColl() );
aSavePos++;
@@ -573,7 +574,7 @@ void lcl_CpyBox( const SwTable& rCpyTbl, const SwTableBox* pCpyBox,
while( pLine->GetUpper() )
pLine = pLine->GetUpper()->GetUpper();
- BOOL bReplaceColl = TRUE;
+ sal_Bool bReplaceColl = sal_True;
if( bDelCntnt && !bUndoRedline )
{
// zuerst die Fly loeschen, dann die entsprechenden Nodes
@@ -584,11 +585,11 @@ void lcl_CpyBox( const SwTable& rCpyTbl, const SwTableBox* pCpyBox,
SwPosition aMvPos( aInsIdx );
SwCntntNode* pCNd = pDoc->GetNodes().GoPrevious( &aMvPos.nNode );
aMvPos.nContent.Assign( pCNd, pCNd->Len() );
- pDoc->CorrAbs( aInsIdx, aEndNdIdx, aMvPos, /*TRUE*/FALSE );
+ pDoc->CorrAbs( aInsIdx, aEndNdIdx, aMvPos, /*sal_True*/sal_False );
}
// stehen noch FlyFrames rum, loesche auch diese
- for( USHORT n = 0; n < pDoc->GetSpzFrmFmts()->Count(); ++n )
+ for( sal_uInt16 n = 0; n < pDoc->GetSpzFrmFmts()->Count(); ++n )
{
SwFrmFmt *const pFly = (*pDoc->GetSpzFrmFmts())[n];
SwFmtAnchor const*const pAnchor = &pFly->GetAnchor();
@@ -618,7 +619,7 @@ void lcl_CpyBox( const SwTable& rCpyTbl, const SwTableBox* pCpyBox,
/*RES_POOLCOLL_TABLE == */
RES_POOLCOLL_TABLE_HDLN !=
pCNd->GetFmtColl()->GetPoolFmtId() )
- bReplaceColl = FALSE;
+ bReplaceColl = sal_False;
}
pDoc->GetNodes().Delete( aInsIdx, aEndNdIdx.GetIndex() - aInsIdx.GetIndex() );
@@ -628,11 +629,11 @@ void lcl_CpyBox( const SwTable& rCpyTbl, const SwTableBox* pCpyBox,
if( pUndo )
pUndo->AddBoxAfter( *pDstBox, aInsIdx, bDelCntnt );
- // Ueberschrift
- SwTxtNode* pTxtNd = pDoc->GetNodes()[ aSavePos ]->GetTxtNode();
+ // heading
+ SwTxtNode *const pTxtNd = aSavePos.GetNode().GetTxtNode();
if( pTxtNd )
{
- USHORT nPoolId = pTxtNd->GetTxtColl()->GetPoolFmtId();
+ sal_uInt16 nPoolId = pTxtNd->GetTxtColl()->GetPoolFmtId();
if( bReplaceColl &&
(( 1 < rDstTbl.GetTabLines().Count() &&
pLine == rDstTbl.GetTabLines()[0] )
@@ -672,12 +673,12 @@ void lcl_CpyBox( const SwTable& rCpyTbl, const SwTableBox* pCpyBox,
if( aBoxAttrSet.Count() )
{
const SfxPoolItem* pItem;
- SvNumberFormatter* pN = pDoc->GetNumberFormatter( FALSE );
+ SvNumberFormatter* pN = pDoc->GetNumberFormatter( sal_False );
if( pN && pN->HasMergeFmtTbl() && SFX_ITEM_SET == aBoxAttrSet.
- GetItemState( RES_BOXATR_FORMAT, FALSE, &pItem ) )
+ GetItemState( RES_BOXATR_FORMAT, sal_False, &pItem ) )
{
- ULONG nOldIdx = ((SwTblBoxNumFormat*)pItem)->GetValue();
- ULONG nNewIdx = pN->GetMergeFmtIndex( nOldIdx );
+ sal_uLong nOldIdx = ((SwTblBoxNumFormat*)pItem)->GetValue();
+ sal_uLong nNewIdx = pN->GetMergeFmtIndex( nOldIdx );
if( nNewIdx != nOldIdx )
aBoxAttrSet.Put( SwTblBoxNumFormat( nNewIdx ));
}
@@ -685,11 +686,9 @@ void lcl_CpyBox( const SwTable& rCpyTbl, const SwTableBox* pCpyBox,
}
}
}
-
- pDoc->DoUndo( bUndo );
}
-BOOL SwTable::InsNewTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,
+sal_Bool SwTable::InsNewTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,
SwUndoTblCpyTbl* pUndo )
{
SwDoc* pDoc = GetFrmFmt()->GetDoc();
@@ -716,7 +715,7 @@ BOOL SwTable::InsNewTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,
if( pUndo )
pUndo->InsertRow( *this, aBoxes, aTarget.mnAddLine );
else
- InsertRow( pDoc, aBoxes, aTarget.mnAddLine, TRUE );
+ InsertRow( pDoc, aBoxes, aTarget.mnAddLine, sal_True );
aTarget.moreLines( *this );
bClear = true;
@@ -746,7 +745,7 @@ BOOL SwTable::InsNewTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,
// make frames
aFndBox.MakeFrms( *this );
- return TRUE;
+ return sal_True;
}
// ---------------------------------------------------------------
@@ -760,7 +759,7 @@ BOOL SwTable::InsNewTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,
// einer "GrundLine"
-BOOL SwTable::InsTable( const SwTable& rCpyTbl, const SwNodeIndex& rSttBox,
+sal_Bool SwTable::InsTable( const SwTable& rCpyTbl, const SwNodeIndex& rSttBox,
SwUndoTblCpyTbl* pUndo )
{
SetHTMLTableLayout( 0 ); // MIB 9.7.97: HTML-Layout loeschen
@@ -790,10 +789,10 @@ BOOL SwTable::InsTable( const SwTable& rCpyTbl, const SwNodeIndex& rSttBox,
SwTblNumFmtMerge aTNFM( *pCpyDoc, *pDoc );
- BOOL bDelCntnt = TRUE;
+ sal_Bool bDelCntnt = sal_True;
const SwTableBox* pTmp;
- for( USHORT nLines = 0; nLines < rCpyTbl.GetTabLines().Count(); ++nLines )
+ for( sal_uInt16 nLines = 0; nLines < rCpyTbl.GetTabLines().Count(); ++nLines )
{
// hole die erste Box von der Copy-Line
const SwTableBox* pCpyBox = rCpyTbl.GetTabLines()[nLines]
@@ -806,25 +805,25 @@ BOOL SwTable::InsTable( const SwTable& rCpyTbl, const SwNodeIndex& rSttBox,
// (keine leeren Section erzeugen, werden sonst geloescht!)
lcl_CpyBox( rCpyTbl, pCpyBox, *this, pMyBox, bDelCntnt, pUndo );
- if( 0 == (pTmp = pCpyBox->FindNextBox( rCpyTbl, pCpyBox, FALSE )))
+ if( 0 == (pTmp = pCpyBox->FindNextBox( rCpyTbl, pCpyBox, sal_False )))
break; // es folgt keine weitere Box mehr
pCpyBox = pTmp;
- if( 0 == ( pTmp = pMyBox->FindNextBox( *this, pMyBox, FALSE )))
- bDelCntnt = FALSE; // kein Platz mehr ??
+ if( 0 == ( pTmp = pMyBox->FindNextBox( *this, pMyBox, sal_False )))
+ bDelCntnt = sal_False; // kein Platz mehr ??
else
pMyBox = (SwTableBox*)pTmp;
- } while( TRUE );
+ } while( sal_True );
// suche die oberste Line
SwTableLine* pNxtLine = pMyBox->GetUpper();
while( pNxtLine->GetUpper() )
pNxtLine = pNxtLine->GetUpper()->GetUpper();
- USHORT nPos = GetTabLines().C40_GETPOS( SwTableLine, pNxtLine );
+ sal_uInt16 nPos = GetTabLines().C40_GETPOS( SwTableLine, pNxtLine );
// gibt es eine naechste ??
if( nPos + 1 >= GetTabLines().Count() )
- bDelCntnt = FALSE; // es gibt keine, alles in die letzte Box
+ bDelCntnt = sal_False; // es gibt keine, alles in die letzte Box
else
{
// suche die naechste "Inhaltstragende Box"
@@ -832,16 +831,16 @@ BOOL SwTable::InsTable( const SwTable& rCpyTbl, const SwNodeIndex& rSttBox,
pMyBox = pNxtLine->GetTabBoxes()[0];
while( pMyBox->GetTabLines().Count() )
pMyBox = pMyBox->GetTabLines()[0]->GetTabBoxes()[0];
- bDelCntnt = TRUE;
+ bDelCntnt = sal_True;
}
}
aFndBox.MakeFrms( pTblNd->GetTable() ); // erzeuge die Frames neu
- return TRUE;
+ return sal_True;
}
-BOOL SwTable::InsTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,
+sal_Bool SwTable::InsTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,
SwUndoTblCpyTbl* pUndo )
{
ASSERT( rSelBoxes.Count(), "Missing selection" )
@@ -860,7 +859,7 @@ BOOL SwTable::InsTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,
SwTableBox *pTmpBox, *pSttBox = (SwTableBox*)rSelBoxes[0];
- USHORT nLn, nBx;
+ sal_uInt16 nLn, nBx;
_FndLine *pFLine, *pInsFLine = 0;
_FndBox aFndBox( 0, 0 );
// suche alle Boxen / Lines
@@ -874,16 +873,16 @@ BOOL SwTable::InsTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,
if( 1 != rCpyTbl.GetTabSortBoxes().Count() )
{
SwTableLine* pSttLine = pSttBox->GetUpper();
- USHORT nSttBox = pSttLine->GetTabBoxes().C40_GETPOS( SwTableBox, pSttBox );
- USHORT nSttLine = GetTabLines().C40_GETPOS( SwTableLine, pSttLine );
+ sal_uInt16 nSttBox = pSttLine->GetTabBoxes().C40_GETPOS( SwTableBox, pSttBox );
+ sal_uInt16 nSttLine = GetTabLines().C40_GETPOS( SwTableLine, pSttLine );
_FndBox* pFndBox;
- USHORT nFndCnt = aFndBox.GetLines().Count();
+ sal_uInt16 nFndCnt = aFndBox.GetLines().Count();
if( !nFndCnt )
- return FALSE;
+ return sal_False;
// teste ob genug Platz fuer die einzelnen Lines und Boxen ist:
- USHORT nTstLns = 0;
+ sal_uInt16 nTstLns = 0;
pFLine = aFndBox.GetLines()[ 0 ];
pSttLine = pFLine->GetLine();
nSttLine = GetTabLines().C40_GETPOS( SwTableLine, pSttLine );
@@ -898,9 +897,9 @@ BOOL SwTable::InsTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,
// teste, ob man durch einfuegen neuer zum Ziel kommt. Aber
// nur wenn die SSelection eine Box umfasst !!
if( 1 < rSelBoxes.Count() )
- return FALSE;
+ return sal_False;
- USHORT nNewLns = rCpyTbl.GetTabLines().Count() -
+ sal_uInt16 nNewLns = rCpyTbl.GetTabLines().Count() -
(GetTabLines().Count() - nSttLine );
// Dann teste mal ob die Anzahl der Boxen fuer die Lines reicht
@@ -908,7 +907,7 @@ BOOL SwTable::InsTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,
pSttBox = pFLine->GetBoxes()[0]->GetBox();
nSttBox = pFLine->GetLine()->GetTabBoxes().C40_GETPOS( SwTableBox, pSttBox );
- for( USHORT n = rCpyTbl.GetTabLines().Count() - nNewLns;
+ for( sal_uInt16 n = rCpyTbl.GetTabLines().Count() - nNewLns;
n < rCpyTbl.GetTabLines().Count(); ++n )
{
SwTableLine* pCpyLn = rCpyTbl.GetTabLines()[ n ];
@@ -916,13 +915,13 @@ BOOL SwTable::InsTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,
if( pLastLn->GetTabBoxes().Count() < nSttBox ||
( pLastLn->GetTabBoxes().Count() - nSttBox ) <
pCpyLn->GetTabBoxes().Count() )
- return FALSE;
+ return sal_False;
// Test auf Verschachtelungen
for( nBx = 0; nBx < pCpyLn->GetTabBoxes().Count(); ++nBx )
if( !( pTmpBox = pLastLn->GetTabBoxes()[ nSttBox + nBx ])
->GetSttNd() )
- return FALSE;
+ return sal_False;
}
// es ist also Platz fuer das zu kopierende vorhanden, also
// fuege entsprechend neue Zeilen ein.
@@ -933,10 +932,10 @@ BOOL SwTable::InsTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,
if( pUndo
? !pUndo->InsertRow( *this, SelLineFromBox( pInsBox,
- aBoxes, TRUE ), nNewLns )
+ aBoxes, sal_True ), nNewLns )
: !InsertRow( pDoc, SelLineFromBox( pInsBox,
- aBoxes, TRUE ), nNewLns, TRUE ) )
- return FALSE;
+ aBoxes, sal_True ), nNewLns, sal_True ) )
+ return sal_False;
}
nTstLns = rCpyTbl.GetTabLines().Count(); // soviele Kopieren
@@ -944,7 +943,7 @@ BOOL SwTable::InsTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,
else if( 0 == (nFndCnt % rCpyTbl.GetTabLines().Count()) )
nTstLns = nFndCnt;
else
- return FALSE; // kein Platz fuer die Zeilen
+ return sal_False; // kein Platz fuer die Zeilen
for( nLn = 0; nLn < nTstLns; ++nLn )
{
@@ -971,14 +970,14 @@ BOOL SwTable::InsTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,
if( pLine->GetTabBoxes().Count() < nSttBox ||
( pLine->GetTabBoxes().Count() - nSttBox ) <
pFLine->GetBoxes().Count() )
- return FALSE;
+ return sal_False;
// Test auf Verschachtelungen
for( nBx = 0; nBx < pFLine->GetBoxes().Count(); ++nBx )
{
if( !( pTmpBox = pLine->GetTabBoxes()[ nSttBox + nBx ])
->GetSttNd() )
- return FALSE;
+ return sal_False;
// wenn Ok, fuege die Box in die FndLine zu
pFndBox = new _FndBox( pTmpBox, pInsFLine );
pInsFLine->GetBoxes().C40_INSERT( _FndBox, pFndBox, nBx );
@@ -990,14 +989,14 @@ BOOL SwTable::InsTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,
if( pLine->GetTabBoxes().Count() < nSttBox ||
( pLine->GetTabBoxes().Count() - nSttBox ) <
pCpyLn->GetTabBoxes().Count() )
- return FALSE;
+ return sal_False;
// Test auf Verschachtelungen
for( nBx = 0; nBx < pCpyLn->GetTabBoxes().Count(); ++nBx )
{
if( !( pTmpBox = pLine->GetTabBoxes()[ nSttBox + nBx ])
->GetSttNd() )
- return FALSE;
+ return sal_False;
// wenn Ok, fuege die Box in die FndLine zu
if( nBx == pFLine->GetBoxes().Count() )
{
@@ -1012,17 +1011,17 @@ BOOL SwTable::InsTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,
// (n-Fach)
if( 0 != ( pFLine->GetBoxes().Count() %
pCpyLn->GetTabBoxes().Count() ))
- return FALSE;
+ return sal_False;
// Test auf Verschachtelungen
for( nBx = 0; nBx < pFLine->GetBoxes().Count(); ++nBx )
if( !pFLine->GetBoxes()[ nBx ]->GetBox()->GetSttNd() )
- return FALSE;
+ return sal_False;
}
}
if( !aFndBox.GetLines().Count() )
- return FALSE;
+ return sal_False;
}
{
@@ -1039,9 +1038,9 @@ BOOL SwTable::InsTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,
if( 1 == rCpyTbl.GetTabSortBoxes().Count() )
{
SwTableBox *pTmpBx = rCpyTbl.GetTabSortBoxes()[0];
- for( USHORT n = 0; n < rSelBoxes.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rSelBoxes.Count(); ++n )
lcl_CpyBox( rCpyTbl, pTmpBx, *this,
- (SwTableBox*)rSelBoxes[n], TRUE, pUndo );
+ (SwTableBox*)rSelBoxes[n], sal_True, pUndo );
}
else
for( nLn = 0; nLn < aFndBox.GetLines().Count(); ++nLn )
@@ -1054,37 +1053,37 @@ BOOL SwTable::InsTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,
// Kopiere in pMyBox die pCpyBox
lcl_CpyBox( rCpyTbl, pCpyLn->GetTabBoxes()[
nBx % pCpyLn->GetTabBoxes().Count() ],
- *this, pFLine->GetBoxes()[ nBx ]->GetBox(), TRUE, pUndo );
+ *this, pFLine->GetBoxes()[ nBx ]->GetBox(), sal_True, pUndo );
}
}
aFndBox.MakeFrms( *this );
- return TRUE;
+ return sal_True;
}
-BOOL _FndCntntBox( const SwTableBox*& rpBox, void* pPara )
+sal_Bool _FndCntntBox( const SwTableBox*& rpBox, void* pPara )
{
SwTableBox* pBox = (SwTableBox*)rpBox;
if( rpBox->GetTabLines().Count() )
pBox->GetTabLines().ForEach( &_FndCntntLine, pPara );
else
((SwSelBoxes*)pPara)->Insert( pBox );
- return TRUE;
+ return sal_True;
}
-BOOL _FndCntntLine( const SwTableLine*& rpLine, void* pPara )
+sal_Bool _FndCntntLine( const SwTableLine*& rpLine, void* pPara )
{
((SwTableLine*)rpLine)->GetTabBoxes().ForEach( &_FndCntntBox, pPara );
- return TRUE;
+ return sal_True;
}
// suche alle Inhaltstragenden-Boxen dieser Box
SwSelBoxes& SwTable::SelLineFromBox( const SwTableBox* pBox,
- SwSelBoxes& rBoxes, BOOL bToTop ) const
+ SwSelBoxes& rBoxes, sal_Bool bToTop ) const
{
SwTableLine* pLine = (SwTableLine*)pBox->GetUpper();
if( bToTop )
@@ -1092,7 +1091,7 @@ SwSelBoxes& SwTable::SelLineFromBox( const SwTableBox* pBox,
pLine = pLine->GetUpper()->GetUpper();
// alle alten loeschen
- rBoxes.Remove( USHORT(0), rBoxes.Count() );
+ rBoxes.Remove( sal_uInt16(0), rBoxes.Count() );
pLine->GetTabBoxes().ForEach( &_FndCntntBox, &rBoxes );
return rBoxes;
}
diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx
index 263b722653ee..b5ca8e4f8a11 100644
--- a/sw/source/core/doc/tblrwcl.cxx
+++ b/sw/source/core/doc/tblrwcl.cxx
@@ -52,7 +52,8 @@
#include <swundo.hxx>
#include <rowfrm.hxx>
#include <ddefld.hxx>
-#include <undobj.hxx>
+#include <hints.hxx>
+#include <UndoTable.hxx>
#include <cellatr.hxx>
#include <mvsave.hxx>
#include <swtblfmt.hxx>
@@ -103,10 +104,10 @@ struct _CpyTabFrm
_CpyTabFrm& operator=( const _CpyTabFrm& );
- BOOL operator==( const _CpyTabFrm& rCpyTabFrm )
- { return (ULONG)Value.nSize == (ULONG)rCpyTabFrm.Value.nSize; }
- BOOL operator<( const _CpyTabFrm& rCpyTabFrm )
- { return (ULONG)Value.nSize < (ULONG)rCpyTabFrm.Value.nSize; }
+ sal_Bool operator==( const _CpyTabFrm& rCpyTabFrm )
+ { return (sal_uLong)Value.nSize == (sal_uLong)rCpyTabFrm.Value.nSize; }
+ sal_Bool operator<( const _CpyTabFrm& rCpyTabFrm )
+ { return (sal_uLong)Value.nSize < (sal_uLong)rCpyTabFrm.Value.nSize; }
};
struct CR_SetBoxWidth
@@ -119,15 +120,15 @@ struct CR_SetBoxWidth
SwUndoTblNdsChg* pUndo;
SwTwips nDiff, nSide, nMaxSize, nLowerDiff;
TblChgMode nMode;
- USHORT nTblWidth, nRemainWidth, nBoxWidth;
- BOOL bBigger, bLeft, bSplittBox, bAnyBoxFnd;
+ sal_uInt16 nTblWidth, nRemainWidth, nBoxWidth;
+ sal_Bool bBigger, bLeft, bSplittBox, bAnyBoxFnd;
- CR_SetBoxWidth( USHORT eType, SwTwips nDif, SwTwips nSid, SwTwips nTblW,
+ CR_SetBoxWidth( sal_uInt16 eType, SwTwips nDif, SwTwips nSid, SwTwips nTblW,
SwTwips nMax, SwTableNode* pTNd )
: pTblNd( pTNd ),
nDiff( nDif ), nSide( nSid ), nMaxSize( nMax ), nLowerDiff( 0 ),
- nTblWidth( (USHORT)nTblW ), nRemainWidth( 0 ), nBoxWidth( 0 ),
- bSplittBox( FALSE ), bAnyBoxFnd( FALSE )
+ nTblWidth( (sal_uInt16)nTblW ), nRemainWidth( 0 ), nBoxWidth( 0 ),
+ bSplittBox( sal_False ), bAnyBoxFnd( sal_False )
{
bLeft = nsTblChgWidthHeightType::WH_COL_LEFT == ( eType & 0xff ) ||
nsTblChgWidthHeightType::WH_CELL_LEFT == ( eType & 0xff );
@@ -158,20 +159,20 @@ struct CR_SetBoxWidth
nLowerDiff = 0; nRemainWidth = 0;
}
- void AddBoxWidth( const SwTableBox& rBox, USHORT nWidth )
+ void AddBoxWidth( const SwTableBox& rBox, sal_uInt16 nWidth )
{
SwTableLinePtr p = (SwTableLine*)rBox.GetUpper();
- USHORT nFndPos;
+ sal_uInt16 nFndPos;
if( aLines.Insert( p, nFndPos ))
aLinesWidth.Insert( nWidth, nFndPos );
else
aLinesWidth[ nFndPos ] = aLinesWidth[ nFndPos ] + nWidth;
}
- USHORT GetBoxWidth( const SwTableLine& rLn ) const
+ sal_uInt16 GetBoxWidth( const SwTableLine& rLn ) const
{
SwTableLinePtr p = (SwTableLine*)&rLn;
- USHORT nFndPos;
+ sal_uInt16 nFndPos;
if( aLines.Seek_Entry( p, &nFndPos ) )
nFndPos = aLinesWidth[ nFndPos ];
else
@@ -180,20 +181,20 @@ struct CR_SetBoxWidth
}
};
-BOOL lcl_SetSelBoxWidth( SwTableLine* pLine, CR_SetBoxWidth& rParam,
- SwTwips nDist, BOOL bCheck );
-BOOL lcl_SetOtherBoxWidth( SwTableLine* pLine, CR_SetBoxWidth& rParam,
- SwTwips nDist, BOOL bCheck );
-BOOL lcl_InsSelBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
- SwTwips nDist, BOOL bCheck );
-BOOL lcl_InsOtherBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
- SwTwips nDist, BOOL bCheck );
-BOOL lcl_DelSelBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
- SwTwips nDist, BOOL bCheck );
-BOOL lcl_DelOtherBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
- SwTwips nDist, BOOL bCheck );
-
-typedef BOOL (*FN_lcl_SetBoxWidth)(SwTableLine*, CR_SetBoxWidth&, SwTwips, BOOL );
+sal_Bool lcl_SetSelBoxWidth( SwTableLine* pLine, CR_SetBoxWidth& rParam,
+ SwTwips nDist, sal_Bool bCheck );
+sal_Bool lcl_SetOtherBoxWidth( SwTableLine* pLine, CR_SetBoxWidth& rParam,
+ SwTwips nDist, sal_Bool bCheck );
+sal_Bool lcl_InsSelBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
+ SwTwips nDist, sal_Bool bCheck );
+sal_Bool lcl_InsOtherBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
+ SwTwips nDist, sal_Bool bCheck );
+sal_Bool lcl_DelSelBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
+ SwTwips nDist, sal_Bool bCheck );
+sal_Bool lcl_DelOtherBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
+ SwTwips nDist, sal_Bool bCheck );
+
+typedef sal_Bool (*FN_lcl_SetBoxWidth)(SwTableLine*, CR_SetBoxWidth&, SwTwips, sal_Bool );
#if defined(DBG_UTIL) || defined( JP_DEBUG )
@@ -202,13 +203,13 @@ void _CheckBoxWidth( const SwTableLine& rLine, SwTwips nSize );
#define CHECKBOXWIDTH \
{ \
SwTwips nSize = GetFrmFmt()->GetFrmSize().GetWidth(); \
- for( USHORT nTmp = 0; nTmp < aLines.Count(); ++nTmp ) \
+ for( sal_uInt16 nTmp = 0; nTmp < aLines.Count(); ++nTmp ) \
::_CheckBoxWidth( *aLines[ nTmp ], nSize ); \
}
#define CHECKTABLELAYOUT \
{ \
- for ( USHORT i = 0; i < GetTabLines().Count(); ++i ) \
+ for ( sal_uInt16 i = 0; i < GetTabLines().Count(); ++i ) \
{ \
SwFrmFmt* pFmt = GetTabLines()[i]->GetFrmFmt(); \
SwIterator<SwRowFrm,SwFmt> aIter( *pFmt ); \
@@ -239,13 +240,13 @@ struct CR_SetLineHeight
SwUndoTblNdsChg* pUndo;
SwTwips nMaxSpace, nMaxHeight;
TblChgMode nMode;
- USHORT nLines;
- BOOL bBigger, bTop, bSplittBox, bAnyBoxFnd;
+ sal_uInt16 nLines;
+ sal_Bool bBigger, bTop, bSplittBox, bAnyBoxFnd;
- CR_SetLineHeight( USHORT eType, SwTableNode* pTNd )
+ CR_SetLineHeight( sal_uInt16 eType, SwTableNode* pTNd )
: pTblNd( pTNd ), pUndo( 0 ),
nMaxSpace( 0 ), nMaxHeight( 0 ), nLines( 0 ),
- bSplittBox( FALSE ), bAnyBoxFnd( FALSE )
+ bSplittBox( sal_False ), bAnyBoxFnd( sal_False )
{
bTop = nsTblChgWidthHeightType::WH_ROW_TOP == ( eType & 0xff ) || nsTblChgWidthHeightType::WH_CELL_TOP == ( eType & 0xff );
bBigger = 0 != (eType & nsTblChgWidthHeightType::WH_FLAG_BIGGER );
@@ -267,14 +268,14 @@ struct CR_SetLineHeight
}
};
-BOOL lcl_SetSelLineHeight( SwTableLine* pLine, CR_SetLineHeight& rParam,
- SwTwips nDist, BOOL bCheck );
-BOOL lcl_SetOtherLineHeight( SwTableLine* pLine, CR_SetLineHeight& rParam,
- SwTwips nDist, BOOL bCheck );
-BOOL lcl_InsDelSelLine( SwTableLine* pLine, CR_SetLineHeight& rParam,
- SwTwips nDist, BOOL bCheck );
+sal_Bool lcl_SetSelLineHeight( SwTableLine* pLine, CR_SetLineHeight& rParam,
+ SwTwips nDist, sal_Bool bCheck );
+sal_Bool lcl_SetOtherLineHeight( SwTableLine* pLine, CR_SetLineHeight& rParam,
+ SwTwips nDist, sal_Bool bCheck );
+sal_Bool lcl_InsDelSelLine( SwTableLine* pLine, CR_SetLineHeight& rParam,
+ SwTwips nDist, sal_Bool bCheck );
-typedef BOOL (*FN_lcl_SetLineHeight)(SwTableLine*, CR_SetLineHeight&, SwTwips, BOOL );
+typedef sal_Bool (*FN_lcl_SetLineHeight)(SwTableLine*, CR_SetLineHeight&, SwTwips, sal_Bool );
_CpyTabFrm& _CpyTabFrm::operator=( const _CpyTabFrm& rCpyTabFrm )
{
@@ -292,21 +293,21 @@ void lcl_DelCpyTabFrmFmts( _CpyTabFrm& rArr );
struct _CpyPara
{
- boost::shared_ptr< std::vector< std::vector< ULONG > > > pWidths;
+ boost::shared_ptr< std::vector< std::vector< sal_uLong > > > pWidths;
SwDoc* pDoc;
SwTableNode* pTblNd;
_CpyTabFrms& rTabFrmArr;
SwTableLine* pInsLine;
SwTableBox* pInsBox;
- ULONG nOldSize, nNewSize; // zum Korrigieren der Size-Attribute
- ULONG nMinLeft, nMaxRight;
- USHORT nCpyCnt, nInsPos;
- USHORT nLnIdx, nBoxIdx;
- BYTE nDelBorderFlag;
- BOOL bCpyCntnt;
-
- _CpyPara( SwTableNode* pNd, USHORT nCopies, _CpyTabFrms& rFrmArr,
- BOOL bCopyContent = TRUE )
+ sal_uLong nOldSize, nNewSize; // zum Korrigieren der Size-Attribute
+ sal_uLong nMinLeft, nMaxRight;
+ sal_uInt16 nCpyCnt, nInsPos;
+ sal_uInt16 nLnIdx, nBoxIdx;
+ sal_uInt8 nDelBorderFlag;
+ sal_Bool bCpyCntnt;
+
+ _CpyPara( SwTableNode* pNd, sal_uInt16 nCopies, _CpyTabFrms& rFrmArr,
+ sal_Bool bCopyContent = sal_True )
: pDoc( pNd->GetDoc() ), pTblNd( pNd ), rTabFrmArr(rFrmArr),
pInsLine(0), pInsBox(0), nOldSize(0), nNewSize(0),
nMinLeft(ULONG_MAX), nMaxRight(0),
@@ -334,7 +335,7 @@ struct _CpyPara
};
-BOOL lcl_CopyCol( const _FndBox*& rpFndBox, void* pPara )
+sal_Bool lcl_CopyCol( const _FndBox*& rpFndBox, void* pPara )
{
_CpyPara* pCpyPara = (_CpyPara*)pPara;
@@ -342,7 +343,7 @@ BOOL lcl_CopyCol( const _FndBox*& rpFndBox, void* pPara )
SwTableBox* pBox = (SwTableBox*)rpFndBox->GetBox();
_CpyTabFrm aFindFrm( (SwTableBoxFmt*)pBox->GetFrmFmt() );
- USHORT nFndPos;
+ sal_uInt16 nFndPos;
if( pCpyPara->nCpyCnt )
{
if( !pCpyPara->rTabFrmArr.Seek_Entry( aFindFrm, &nFndPos ))
@@ -368,7 +369,7 @@ BOOL lcl_CopyCol( const _FndBox*& rpFndBox, void* pPara )
// die erste Line sollte reichen
_FndBoxes& rFndBoxes = pCmpLine->GetBoxes();
long nSz = 0;
- for( USHORT n = rFndBoxes.Count(); n; )
+ for( sal_uInt16 n = rFndBoxes.Count(); n; )
nSz += rFndBoxes[ --n ]->GetBox()->GetFrmFmt()->GetFrmSize().GetWidth();
aFrmSz.SetWidth( aFrmSz.GetWidth() -
nSz / ( pCpyPara->nCpyCnt + 1 ) );
@@ -461,10 +462,10 @@ BOOL lcl_CopyCol( const _FndBox*& rpFndBox, void* pPara )
}
}
}
- return TRUE;
+ return sal_True;
}
-BOOL lcl_CopyRow( const _FndLine*& rpFndLine, void* pPara )
+sal_Bool lcl_CopyRow( const _FndLine*& rpFndLine, void* pPara )
{
_CpyPara* pCpyPara = (_CpyPara*)pPara;
SwTableLine* pNewLine = new SwTableLine(
@@ -484,13 +485,13 @@ BOOL lcl_CopyRow( const _FndLine*& rpFndLine, void* pPara )
((_FndLine*)rpFndLine)->GetBoxes().ForEach( &lcl_CopyCol, &aPara );
pCpyPara->nDelBorderFlag &= 0xf8;
- return TRUE;
+ return sal_True;
}
//-----------------------------------------------------------
-void lcl_InsCol( _FndLine* pFndLn, _CpyPara& rCpyPara, USHORT nCpyCnt,
- BOOL bBehind )
+void lcl_InsCol( _FndLine* pFndLn, _CpyPara& rCpyPara, sal_uInt16 nCpyCnt,
+ sal_Bool bBehind )
{
// Bug 29124: nicht nur in den Grundlines kopieren. Wenns geht, so weit
// runter wie moeglich.
@@ -499,7 +500,7 @@ void lcl_InsCol( _FndLine* pFndLn, _CpyPara& rCpyPara, USHORT nCpyCnt,
!( pFBox = pFndLn->GetBoxes()[ 0 ] )->GetBox()->GetSttNd() )
{
// eine Box mit mehreren Lines, also in diese Lines einfuegen
- for( USHORT n = 0; n < pFBox->GetLines().Count(); ++n )
+ for( sal_uInt16 n = 0; n < pFBox->GetLines().Count(); ++n )
lcl_InsCol( pFBox->GetLines()[ n ], rCpyPara, nCpyCnt, bBehind );
}
else
@@ -511,7 +512,7 @@ void lcl_InsCol( _FndLine* pFndLn, _CpyPara& rCpyPara, USHORT nCpyCnt,
if( bBehind )
++rCpyPara.nInsPos;
- for( USHORT n = 0; n < nCpyCnt; ++n )
+ for( sal_uInt16 n = 0; n < nCpyCnt; ++n )
{
if( n + 1 == nCpyCnt && bBehind )
rCpyPara.nDelBorderFlag = 9;
@@ -532,14 +533,14 @@ SwRowFrm* GetRowFrm( SwTableLine& rLine )
}
-BOOL SwTable::InsertCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, USHORT nCnt, BOOL bBehind )
+sal_Bool SwTable::InsertCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nCnt, sal_Bool bBehind )
{
ASSERT( rBoxes.Count() && nCnt, "keine gueltige Box-Liste" );
SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode();
if( !pTblNd )
- return FALSE;
+ return sal_False;
- BOOL bRes = TRUE;
+ sal_Bool bRes = sal_True;
if( IsNewModel() )
bRes = NewInsertCol( pDoc, rBoxes, nCnt, bBehind );
else
@@ -551,7 +552,7 @@ BOOL SwTable::InsertCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, USHORT nCnt, BOO
GetTabLines().ForEach( &_FndLineCopyCol, &aPara );
}
if( !aFndBox.GetLines().Count() )
- return FALSE;
+ return sal_False;
SetHTMLTableLayout( 0 ); // MIB 9.7.97: HTML-Layout loeschen
@@ -565,7 +566,7 @@ BOOL SwTable::InsertCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, USHORT nCnt, BOO
_CpyTabFrms aTabFrmArr;
_CpyPara aCpyPara( pTblNd, nCnt, aTabFrmArr );
- for( USHORT n = 0; n < aFndBox.GetLines().Count(); ++n )
+ for( sal_uInt16 n = 0; n < aFndBox.GetLines().Count(); ++n )
lcl_InsCol( aFndBox.GetLines()[ n ], aCpyPara, nCnt, bBehind );
// dann raeume die Struktur dieser Line noch mal auf, generell alle
@@ -576,7 +577,7 @@ BOOL SwTable::InsertCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, USHORT nCnt, BOO
CHECKBOXWIDTH
CHECKTABLELAYOUT
- bRes = TRUE;
+ bRes = sal_True;
}
SwChartDataProvider *pPCD = pDoc->GetChartDataProvider();
@@ -587,13 +588,13 @@ BOOL SwTable::InsertCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, USHORT nCnt, BOO
return bRes;
}
-BOOL SwTable::_InsertRow( SwDoc* pDoc, const SwSelBoxes& rBoxes,
- USHORT nCnt, BOOL bBehind )
+sal_Bool SwTable::_InsertRow( SwDoc* pDoc, const SwSelBoxes& rBoxes,
+ sal_uInt16 nCnt, sal_Bool bBehind )
{
ASSERT( pDoc && rBoxes.Count() && nCnt, "keine gueltige Box-Liste" );
SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode();
if( !pTblNd )
- return FALSE;
+ return sal_False;
// suche alle Boxen / Lines
_FndBox aFndBox( 0, 0 );
@@ -602,7 +603,7 @@ BOOL SwTable::_InsertRow( SwDoc* pDoc, const SwSelBoxes& rBoxes,
GetTabLines().ForEach( &_FndLineCopyCol, &aPara );
}
if( !aFndBox.GetLines().Count() )
- return FALSE;
+ return sal_False;
SetHTMLTableLayout( 0 ); // MIB 9.7.97: HTML-Layout loeschen
@@ -622,8 +623,13 @@ BOOL SwTable::_InsertRow( SwDoc* pDoc, const SwSelBoxes& rBoxes,
}
//Lines fuer das Layout-Update herausuchen.
+<<<<<<< local
const BOOL bLayout = !IsNewModel() &&
0 != SwIterator<SwTabFrm,SwFmt>::FirstElement( *GetFrmFmt() );
+=======
+ const sal_Bool bLayout = !IsNewModel() &&
+ 0 != SwClientIter( *GetFrmFmt() ).First( TYPE(SwTabFrm) );
+>>>>>>> other
if ( bLayout )
{
@@ -655,7 +661,7 @@ BOOL SwTable::_InsertRow( SwDoc* pDoc, const SwSelBoxes& rBoxes,
else
aCpyPara.nDelBorderFlag = 2;
- for( USHORT nCpyCnt = 0; nCpyCnt < nCnt; ++nCpyCnt )
+ for( sal_uInt16 nCpyCnt = 0; nCpyCnt < nCnt; ++nCpyCnt )
{
if( bBehind )
aCpyPara.nDelBorderFlag = 1;
@@ -683,12 +689,12 @@ BOOL SwTable::_InsertRow( SwDoc* pDoc, const SwSelBoxes& rBoxes,
pPCD->AddRowCols( *this, rBoxes, nCnt, bBehind );
pDoc->UpdateCharts( GetFrmFmt()->GetName() );
- return TRUE;
+ return sal_True;
}
-BOOL _FndBoxAppendRowLine( const SwTableLine*& rpLine, void* pPara );
+sal_Bool _FndBoxAppendRowLine( const SwTableLine*& rpLine, void* pPara );
-BOOL _FndBoxAppendRowBox( const SwTableBox*& rpBox, void* pPara )
+sal_Bool _FndBoxAppendRowBox( const SwTableBox*& rpBox, void* pPara )
{
_FndPara* pFndPara = (_FndPara*)pPara;
_FndBox* pFndBox = new _FndBox( (SwTableBox*)rpBox, pFndPara->pFndLine );
@@ -702,10 +708,10 @@ BOOL _FndBoxAppendRowBox( const SwTableBox*& rpBox, void* pPara )
else
pFndPara->pFndLine->GetBoxes().C40_INSERT( _FndBox, pFndBox,
pFndPara->pFndLine->GetBoxes().Count() );
- return TRUE;
+ return sal_True;
}
-BOOL _FndBoxAppendRowLine( const SwTableLine*& rpLine, void* pPara )
+sal_Bool _FndBoxAppendRowLine( const SwTableLine*& rpLine, void* pPara )
{
_FndPara* pFndPara = (_FndPara*)pPara;
_FndLine* pFndLine = new _FndLine( (SwTableLine*)rpLine, pFndPara->pFndBox );
@@ -718,15 +724,15 @@ BOOL _FndBoxAppendRowLine( const SwTableLine*& rpLine, void* pPara )
}
else
delete pFndLine;
- return TRUE;
+ return sal_True;
}
-BOOL SwTable::AppendRow( SwDoc* pDoc, USHORT nCnt )
+sal_Bool SwTable::AppendRow( SwDoc* pDoc, sal_uInt16 nCnt )
{
SwTableNode* pTblNd = (SwTableNode*)aSortCntBoxes[0]->GetSttNd()->FindTableNode();
if( !pTblNd )
- return FALSE;
+ return sal_False;
// suche alle Boxen / Lines
_FndBox aFndBox( 0, 0 );
@@ -739,12 +745,16 @@ BOOL SwTable::AppendRow( SwDoc* pDoc, USHORT nCnt )
_FndBoxAppendRowLine( pLLine, &aPara );
}
if( !aFndBox.GetLines().Count() )
- return FALSE;
+ return sal_False;
SetHTMLTableLayout( 0 ); // MIB 9.7.97: HTML-Layout loeschen
//Lines fuer das Layout-Update herausuchen.
+<<<<<<< local
const BOOL bLayout = 0 != SwIterator<SwTabFrm,SwFmt>::FirstElement( *GetFrmFmt() );
+=======
+ const sal_Bool bLayout = 0 != SwClientIter( *GetFrmFmt() ).First( TYPE(SwTabFrm) );
+>>>>>>> other
if( bLayout )
{
aFndBox.SetTableLines( *this );
@@ -757,7 +767,7 @@ BOOL SwTable::AppendRow( SwDoc* pDoc, USHORT nCnt )
aCpyPara.nInsPos = GetTabLines().Count();
aCpyPara.nDelBorderFlag = 1;
- for( USHORT nCpyCnt = 0; nCpyCnt < nCnt; ++nCpyCnt )
+ for( sal_uInt16 nCpyCnt = 0; nCpyCnt < nCnt; ++nCpyCnt )
{
aCpyPara.nDelBorderFlag = 1;
aFndBox.GetLines().ForEach( &lcl_CopyRow, &aCpyPara );
@@ -770,7 +780,7 @@ BOOL SwTable::AppendRow( SwDoc* pDoc, USHORT nCnt )
//Layout updaten
if ( bLayout )
{
- aFndBox.MakeNewFrms( *this, nCnt, TRUE );
+ aFndBox.MakeNewFrms( *this, nCnt, sal_True );
}
// TL_CHART2: need to inform chart of probably changed cell names
pDoc->UpdateCharts( GetFrmFmt()->GetName() );
@@ -778,23 +788,23 @@ BOOL SwTable::AppendRow( SwDoc* pDoc, USHORT nCnt )
CHECKBOXWIDTH
CHECKTABLELAYOUT
- return TRUE;
+ return sal_True;
}
void lcl_LastBoxSetWidth( SwTableBoxes &rBoxes, const long nOffset,
- BOOL bFirst, SwShareBoxFmts& rShareFmts );
+ sal_Bool bFirst, SwShareBoxFmts& rShareFmts );
void lcl_LastBoxSetWidthLine( SwTableLines &rLines, const long nOffset,
- BOOL bFirst, SwShareBoxFmts& rShareFmts )
+ sal_Bool bFirst, SwShareBoxFmts& rShareFmts )
{
- for ( USHORT i = 0; i < rLines.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rLines.Count(); ++i )
::lcl_LastBoxSetWidth( rLines[i]->GetTabBoxes(), nOffset, bFirst,
rShareFmts );
}
void lcl_LastBoxSetWidth( SwTableBoxes &rBoxes, const long nOffset,
- BOOL bFirst, SwShareBoxFmts& rShareFmts )
+ sal_Bool bFirst, SwShareBoxFmts& rShareFmts )
{
SwTableBox& rBox = *rBoxes[ bFirst ? 0 : rBoxes.Count() - 1 ];
if( !rBox.GetSttNd() )
@@ -821,7 +831,7 @@ void lcl_LastBoxSetWidth( SwTableBoxes &rBoxes, const long nOffset,
}
void _DeleteBox( SwTable& rTbl, SwTableBox* pBox, SwUndo* pUndo,
- BOOL bCalcNewSize, const BOOL bCorrBorder,
+ sal_Bool bCalcNewSize, const sal_Bool bCorrBorder,
SwShareBoxFmts* pShareFmts )
{
do {
@@ -829,13 +839,13 @@ void _DeleteBox( SwTable& rTbl, SwTableBox* pBox, SwUndo* pUndo,
pBox->GetFrmFmt()->GetFrmSize().GetWidth() : 0;
SwTableLine* pLine = pBox->GetUpper();
SwTableBoxes& rTblBoxes = pLine->GetTabBoxes();
- USHORT nDelPos = rTblBoxes.C40_GETPOS( SwTableBox, pBox );
+ sal_uInt16 nDelPos = rTblBoxes.C40_GETPOS( SwTableBox, pBox );
SwTableBox* pUpperBox = pBox->GetUpper()->GetUpper();
// Sonderbehandlung fuer Umrandung:
if( bCorrBorder && 1 < rTblBoxes.Count() )
{
- BOOL bChgd = FALSE;
+ sal_Bool bChgd = sal_False;
const SvxBoxItem& rBoxItem = pBox->GetFrmFmt()->GetBox();
if( rBoxItem.GetLeft() || rBoxItem.GetRight() )
@@ -860,7 +870,7 @@ void _DeleteBox( SwTable& rTbl, SwTableBox* pBox, SwUndo* pUndo,
pShareFmts->SetAttr( *pNxtBox, aTmp );
else
pNxtBox->ClaimFrmFmt()->SetFmtAttr( aTmp );
- bChgd = TRUE;
+ bChgd = sal_True;
}
}
if( !bChgd && nDelPos )
@@ -907,7 +917,7 @@ void _DeleteBox( SwTable& rTbl, SwTableBox* pBox, SwUndo* pUndo,
if( rTblBoxes.Count() )
{
// dann passe noch die Frame-SSize an
- BOOL bLastBox = nDelPos == rTblBoxes.Count();
+ sal_Bool bLastBox = nDelPos == rTblBoxes.Count();
if( bLastBox )
--nDelPos;
pBox = rTblBoxes[nDelPos];
@@ -955,8 +965,8 @@ void _DeleteBox( SwTable& rTbl, SwTableBox* pBox, SwUndo* pUndo,
SwTableBox* lcl_FndNxtPrvDelBox( const SwTableLines& rTblLns,
SwTwips nBoxStt, SwTwips nBoxWidth,
- USHORT nLinePos, BOOL bNxt,
- SwSelBoxes* pAllDelBoxes, USHORT* pCurPos )
+ sal_uInt16 nLinePos, sal_Bool bNxt,
+ SwSelBoxes* pAllDelBoxes, sal_uInt16* pCurPos )
{
SwTableBox* pFndBox = 0;
do {
@@ -967,10 +977,10 @@ SwTableBox* lcl_FndNxtPrvDelBox( const SwTableLines& rTblLns,
SwTableLine* pLine = rTblLns[ nLinePos ];
SwTwips nFndBoxWidth = 0;
SwTwips nFndWidth = nBoxStt + nBoxWidth;
- USHORT nBoxCnt = pLine->GetTabBoxes().Count();
+ sal_uInt16 nBoxCnt = pLine->GetTabBoxes().Count();
pFndBox = pLine->GetTabBoxes()[ 0 ];
- for( USHORT n = 0; 0 < nFndWidth && n < nBoxCnt; ++n )
+ for( sal_uInt16 n = 0; 0 < nFndWidth && n < nBoxCnt; ++n )
{
pFndBox = pLine->GetTabBoxes()[ n ];
nFndWidth -= (nFndBoxWidth = pFndBox->GetFrmFmt()->
@@ -993,7 +1003,7 @@ SwTableBox* lcl_FndNxtPrvDelBox( const SwTableLines& rTblLns,
else if( pAllDelBoxes )
{
// falls der Vorganger auch geloscht wird, ist nicht zu tun
- USHORT nFndPos;
+ sal_uInt16 nFndPos;
if( !pAllDelBoxes->Seek_Entry( pFndBox, &nFndPos ) )
break;
@@ -1011,45 +1021,45 @@ SwTableBox* lcl_FndNxtPrvDelBox( const SwTableLines& rTblLns,
void lcl_SaveUpperLowerBorder( SwTable& rTbl, const SwTableBox& rBox,
SwShareBoxFmts& rShareFmts,
SwSelBoxes* pAllDelBoxes = 0,
- USHORT* pCurPos = 0 )
+ sal_uInt16* pCurPos = 0 )
{
//JP 16.04.97: 2.Teil fuer Bug 36271
- BOOL bChgd = FALSE;
+ sal_Bool bChgd = sal_False;
const SwTableLine* pLine = rBox.GetUpper();
const SwTableBoxes& rTblBoxes = pLine->GetTabBoxes();
const SwTableBox* pUpperBox = &rBox;
- USHORT nDelPos = rTblBoxes.C40_GETPOS( SwTableBox, pUpperBox );
+ sal_uInt16 nDelPos = rTblBoxes.C40_GETPOS( SwTableBox, pUpperBox );
pUpperBox = rBox.GetUpper()->GetUpper();
const SvxBoxItem& rBoxItem = rBox.GetFrmFmt()->GetBox();
// dann die unteren/oberen Kanten
if( rBoxItem.GetTop() || rBoxItem.GetBottom() )
{
- bChgd = FALSE;
+ bChgd = sal_False;
const SwTableLines* pTblLns;
if( pUpperBox )
pTblLns = &pUpperBox->GetTabLines();
else
pTblLns = &rTbl.GetTabLines();
- USHORT nLnPos = pTblLns->GetPos( pLine );
+ sal_uInt16 nLnPos = pTblLns->GetPos( pLine );
// bestimme die Attr.Position der akt. zu loeschenden Box
// und suche dann in der unteren / oberen Line die entspr.
// Gegenstuecke
SwTwips nBoxStt = 0;
- for( USHORT n = 0; n < nDelPos; ++n )
+ for( sal_uInt16 n = 0; n < nDelPos; ++n )
nBoxStt += rTblBoxes[ n ]->GetFrmFmt()->GetFrmSize().GetWidth();
SwTwips nBoxWidth = rBox.GetFrmFmt()->GetFrmSize().GetWidth();
SwTableBox *pPrvBox = 0, *pNxtBox = 0;
if( nLnPos ) // Vorgaenger?
pPrvBox = ::lcl_FndNxtPrvDelBox( *pTblLns, nBoxStt, nBoxWidth,
- nLnPos, FALSE, pAllDelBoxes, pCurPos );
+ nLnPos, sal_False, pAllDelBoxes, pCurPos );
if( nLnPos + 1 < pTblLns->Count() ) // Nachfolger?
pNxtBox = ::lcl_FndNxtPrvDelBox( *pTblLns, nBoxStt, nBoxWidth,
- nLnPos, TRUE, pAllDelBoxes, pCurPos );
+ nLnPos, sal_True, pAllDelBoxes, pCurPos );
if( pNxtBox && pNxtBox->GetSttNd() )
{
@@ -1062,7 +1072,7 @@ void lcl_SaveUpperLowerBorder( SwTable& rTbl, const SwTableBox& rBox,
: rBoxItem.GetBottom(),
BOX_LINE_TOP );
rShareFmts.SetAttr( *pNxtBox, aTmp );
- bChgd = TRUE;
+ bChgd = sal_True;
}
}
if( !bChgd && pPrvBox && pPrvBox->GetSttNd() )
@@ -1083,12 +1093,12 @@ void lcl_SaveUpperLowerBorder( SwTable& rTbl, const SwTableBox& rBox,
}
-BOOL SwTable::DeleteSel(
+sal_Bool SwTable::DeleteSel(
SwDoc* pDoc
,
const SwSelBoxes& rBoxes,
const SwSelBoxes* pMerged, SwUndo* pUndo,
- const BOOL bDelMakeFrms, const BOOL bCorrBorder )
+ const sal_Bool bDelMakeFrms, const sal_Bool bCorrBorder )
{
ASSERT( pDoc, "No doc?" );
SwTableNode* pTblNd = 0;
@@ -1096,7 +1106,7 @@ BOOL SwTable::DeleteSel(
{
pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode();
if( !pTblNd )
- return FALSE;
+ return sal_False;
}
SetHTMLTableLayout( 0 ); // MIB 9.7.97: HTML-Layout loeschen
@@ -1119,7 +1129,7 @@ BOOL SwTable::DeleteSel(
{
SwSelBoxes aBoxes;
aBoxes.Insert( &rBoxes );
- for( USHORT n = 0; n < aBoxes.Count(); ++n )
+ for( sal_uInt16 n = 0; n < aBoxes.Count(); ++n )
::lcl_SaveUpperLowerBorder( *this, *rBoxes[ n ], aShareFmts,
&aBoxes, &n );
}
@@ -1129,9 +1139,9 @@ BOOL SwTable::DeleteSel(
SwChartDataProvider *pPCD = pDoc->GetChartDataProvider();
//
// delete boxes from last to first
- for( USHORT n = 0; n < rBoxes.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rBoxes.Count(); ++n )
{
- USHORT nIdx = rBoxes.Count() - 1 - n;
+ sal_uInt16 nIdx = rBoxes.Count() - 1 - n;
// first adapt the data-sequence for chart if necessary
// (needed to move the implementation cursor properly to it's new
@@ -1140,7 +1150,7 @@ BOOL SwTable::DeleteSel(
pPCD->DeleteBox( &pTblNd->GetTable(), *rBoxes[nIdx] );
// ... then delete the boxes
- _DeleteBox( *this, rBoxes[nIdx], pUndo, TRUE, bCorrBorder, &aShareFmts );
+ _DeleteBox( *this, rBoxes[nIdx], pUndo, sal_True, bCorrBorder, &aShareFmts );
}
// dann raeume die Struktur aller Lines auf
@@ -1155,19 +1165,19 @@ BOOL SwTable::DeleteSel(
CHECKTABLELAYOUT
CHECK_TABLE( *this )
- return TRUE;
+ return sal_True;
}
// ---------------------------------------------------------------
-BOOL SwTable::OldSplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, USHORT nCnt,
- BOOL bSameHeight )
+sal_Bool SwTable::OldSplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nCnt,
+ sal_Bool bSameHeight )
{
ASSERT( pDoc && rBoxes.Count() && nCnt, "keine gueltigen Werte" );
SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode();
if( !pTblNd )
- return FALSE;
+ return sal_False;
// TL_CHART2: splitting/merging of a number of cells or rows will usually make
// the table to complex to be handled with chart.
@@ -1182,7 +1192,7 @@ BOOL SwTable::OldSplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, USHORT nCnt,
if ( bSameHeight )
{
pRowHeights = new long[ rBoxes.Count() ];
- for( USHORT n = 0; n < rBoxes.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rBoxes.Count(); ++n )
{
SwTableBox* pSelBox = *( rBoxes.GetData() + n );
const SwRowFrm* pRow = GetRowFrm( *pSelBox->GetUpper() );
@@ -1197,7 +1207,7 @@ BOOL SwTable::OldSplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, USHORT nCnt,
aFndBox.SetTableLines( rBoxes, *this );
aFndBox.DelFrms( *this );
- for( USHORT n = 0; n < rBoxes.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rBoxes.Count(); ++n )
{
SwTableBox* pSelBox = *( rBoxes.GetData() + n );
ASSERT( pSelBox, "Box steht nicht in der Tabelle" );
@@ -1211,13 +1221,13 @@ BOOL SwTable::OldSplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, USHORT nCnt,
if ( bSameHeight && ATT_VAR_SIZE == aFSz.GetHeightSizeType() )
aFSz.SetHeightSizeType( ATT_MIN_SIZE );
- BOOL bChgLineSz = 0 != aFSz.GetHeight() || bSameHeight;
+ sal_Bool bChgLineSz = 0 != aFSz.GetHeight() || bSameHeight;
if ( bChgLineSz )
aFSz.SetHeight( ( bSameHeight ? pRowHeights[ n ] : aFSz.GetHeight() ) /
(nCnt + 1) );
SwTableBox* pNewBox = new SwTableBox( pFrmFmt, nCnt, pInsLine );
- USHORT nBoxPos = pInsLine->GetTabBoxes().C40_GETPOS( SwTableBox, pSelBox );
+ sal_uInt16 nBoxPos = pInsLine->GetTabBoxes().C40_GETPOS( SwTableBox, pSelBox );
pInsLine->GetTabBoxes().Remove( nBoxPos ); // alte loeschen
pInsLine->GetTabBoxes().C40_INSERT( SwTableBox, pNewBox, nBoxPos );
@@ -1225,24 +1235,24 @@ BOOL SwTable::OldSplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, USHORT nCnt,
SwTableBox* pLastBox = pSelBox; // zum verteilen der TextNodes !!
// sollte Bereiche in der Box stehen, dann bleibt sie so bestehen
// !! FALLS DAS GEAENDERT WIRD MUSS DAS UNDO ANGEPASST WERDEN !!!
- BOOL bMoveNodes = TRUE;
+ sal_Bool bMoveNodes = sal_True;
{
- ULONG nSttNd = pLastBox->GetSttIdx() + 1,
+ sal_uLong nSttNd = pLastBox->GetSttIdx() + 1,
nEndNd = pLastBox->GetSttNd()->EndOfSectionIndex();
while( nSttNd < nEndNd )
if( !pDoc->GetNodes()[ nSttNd++ ]->IsTxtNode() )
{
- bMoveNodes = FALSE;
+ bMoveNodes = sal_False;
break;
}
}
SwTableBoxFmt* pCpyBoxFrmFmt = (SwTableBoxFmt*)pSelBox->GetFrmFmt();
- BOOL bChkBorder = 0 != pCpyBoxFrmFmt->GetBox().GetTop();
+ sal_Bool bChkBorder = 0 != pCpyBoxFrmFmt->GetBox().GetTop();
if( bChkBorder )
pCpyBoxFrmFmt = (SwTableBoxFmt*)pSelBox->ClaimFrmFmt();
- for( USHORT i = 0; i <= nCnt; ++i )
+ for( sal_uInt16 i = 0; i <= nCnt; ++i )
{
// also erstmal eine neue Linie in der neuen Box
SwTableLine* pNewLine = new SwTableLine(
@@ -1270,7 +1280,7 @@ BOOL SwTable::OldSplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, USHORT nCnt,
SvxBoxItem aTmp( pCpyBoxFrmFmt->GetBox() );
aTmp.SetLine( 0, BOX_LINE_TOP );
pCpyBoxFrmFmt->SetFmtAttr( aTmp );
- bChkBorder = FALSE;
+ bChkBorder = sal_False;
}
if( bMoveNodes )
@@ -1282,7 +1292,7 @@ BOOL SwTable::OldSplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, USHORT nCnt,
SwNodeRange aRg( *pLastBox->GetSttNd(), +2, *pEndNd );
pLastBox = pNewLine->GetTabBoxes()[0]; // neu setzen
SwNodeIndex aInsPos( *pLastBox->GetSttNd(), 1 );
- pDoc->GetNodes()._MoveNodes(aRg, pDoc->GetNodes(), aInsPos, FALSE);
+ pDoc->GetNodes()._MoveNodes(aRg, pDoc->GetNodes(), aInsPos, sal_False);
pDoc->GetNodes().Delete( aInsPos, 1 ); // den leeren noch loeschen
}
}
@@ -1302,15 +1312,15 @@ BOOL SwTable::OldSplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, USHORT nCnt,
CHECKBOXWIDTH
CHECKTABLELAYOUT
- return TRUE;
+ return sal_True;
}
-BOOL SwTable::SplitCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, USHORT nCnt )
+sal_Bool SwTable::SplitCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nCnt )
{
ASSERT( pDoc && rBoxes.Count() && nCnt, "keine gueltigen Werte" );
SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode();
if( !pTblNd )
- return FALSE;
+ return sal_False;
// TL_CHART2: splitting/merging of a number of cells or rows will usually make
// the table to complex to be handled with chart.
@@ -1329,8 +1339,8 @@ BOOL SwTable::SplitCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, USHORT nCnt )
_CpyTabFrms aFrmArr;
SvPtrarr aLastBoxArr;
- USHORT nFndPos;
- for( USHORT n = 0; n < aSelBoxes.Count(); ++n )
+ sal_uInt16 nFndPos;
+ for( sal_uInt16 n = 0; n < aSelBoxes.Count(); ++n )
{
SwTableBox* pSelBox = *( aSelBoxes.GetData() + n );
ASSERT( pSelBox, "Box steht nicht in der Tabelle" );
@@ -1341,7 +1351,7 @@ BOOL SwTable::SplitCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, USHORT nCnt )
// dann teile die Box nCnt in nCnt Boxen
SwTableLine* pInsLine = pSelBox->GetUpper();
- USHORT nBoxPos = pInsLine->GetTabBoxes().C40_GETPOS( SwTableBox, pSelBox );
+ sal_uInt16 nBoxPos = pInsLine->GetTabBoxes().C40_GETPOS( SwTableBox, pSelBox );
// suche das FrmFmt im Array aller Frame-Formate
SwTableBoxFmt* pLastBoxFmt;
@@ -1376,7 +1386,7 @@ BOOL SwTable::SplitCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, USHORT nCnt )
}
// dann fuege mal an der Position die neuen Boxen ein
- for( USHORT i = 1; i < nCnt; ++i )
+ for( sal_uInt16 i = 1; i < nCnt; ++i )
::_InsTblBox( pDoc, pTblNd, pInsLine, aFindFrm.pNewFrmFmt,
pSelBox, nBoxPos + i ); // dahinter einfuegen
@@ -1394,7 +1404,7 @@ BOOL SwTable::SplitCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, USHORT nCnt )
aFindFrm.pNewFrmFmt->SetFmtAttr( aTmp );
// und dann das Format aus dem "cache" entfernen
- for( USHORT i = aFrmArr.Count(); i; )
+ for( sal_uInt16 i = aFrmArr.Count(); i; )
{
const _CpyTabFrm& rCTF = aFrmArr[ --i ];
if( rCTF.pNewFrmFmt == aFindFrm.pNewFrmFmt ||
@@ -1412,7 +1422,7 @@ BOOL SwTable::SplitCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, USHORT nCnt )
CHECKBOXWIDTH
CHECKTABLELAYOUT
- return TRUE;
+ return sal_True;
}
// ---------------------------------------------------------------
@@ -1432,12 +1442,12 @@ BOOL SwTable::SplitCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, USHORT nCnt )
----------------------- >> MERGE << ------------------------
*/
-void lcl_CpyLines( USHORT nStt, USHORT nEnd,
+void lcl_CpyLines( sal_uInt16 nStt, sal_uInt16 nEnd,
SwTableLines& rLines,
SwTableBox* pInsBox,
- USHORT nPos = USHRT_MAX )
+ sal_uInt16 nPos = USHRT_MAX )
{
- for( USHORT n = nStt; n < nEnd; ++n )
+ for( sal_uInt16 n = nStt; n < nEnd; ++n )
rLines[n]->SetUpper( pInsBox );
if( USHRT_MAX == nPos )
nPos = pInsBox->GetTabLines().Count();
@@ -1445,12 +1455,12 @@ void lcl_CpyLines( USHORT nStt, USHORT nEnd,
rLines.Remove( nStt, nEnd - nStt );
}
-void lcl_CpyBoxes( USHORT nStt, USHORT nEnd,
+void lcl_CpyBoxes( sal_uInt16 nStt, sal_uInt16 nEnd,
SwTableBoxes& rBoxes,
SwTableLine* pInsLine,
- USHORT nPos = USHRT_MAX )
+ sal_uInt16 nPos = USHRT_MAX )
{
- for( USHORT n = nStt; n < nEnd; ++n )
+ for( sal_uInt16 n = nStt; n < nEnd; ++n )
rBoxes[n]->SetUpper( pInsLine );
if( USHRT_MAX == nPos )
nPos = pInsLine->GetTabBoxes().Count();
@@ -1468,7 +1478,7 @@ void lcl_CalcWidth( SwTableBox* pBox )
ASSERT( pLine, "Box steht in keiner Line" );
long nWidth = 0;
- for( USHORT n = 0; n < pLine->GetTabBoxes().Count(); ++n )
+ for( sal_uInt16 n = 0; n < pLine->GetTabBoxes().Count(); ++n )
nWidth += pLine->GetTabBoxes()[n]->GetFrmFmt()->GetFrmSize().GetWidth();
pFmt->SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE, nWidth, 0 ));
@@ -1485,14 +1495,14 @@ struct _InsULPara
SwTableNode* pTblNd;
SwTableLine* pInsLine;
SwTableBox* pInsBox;
- BOOL bUL_LR : 1; // Upper-Lower(TRUE) oder Left-Right(FALSE) ?
- BOOL bUL : 1; // Upper-Left(TRUE) oder Lower-Right(FALSE) ?
+ sal_Bool bUL_LR : 1; // Upper-Lower(sal_True) oder Left-Right(sal_False) ?
+ sal_Bool bUL : 1; // Upper-Left(sal_True) oder Lower-Right(sal_False) ?
SwTableBox* pLeftBox;
SwTableBox* pRightBox;
SwTableBox* pMergeBox;
- _InsULPara( SwTableNode* pTNd, BOOL bUpperLower, BOOL bUpper,
+ _InsULPara( SwTableNode* pTNd, sal_Bool bUpperLower, sal_Bool bUpper,
SwTableBox* pLeft, SwTableBox* pMerge, SwTableBox* pRight,
SwTableLine* pLine=0, SwTableBox* pBox=0 )
: pTblNd( pTNd ), pInsLine( pLine ), pInsBox( pBox ),
@@ -1500,26 +1510,26 @@ struct _InsULPara
{ bUL_LR = bUpperLower; bUL = bUpper; }
void SetLeft( SwTableBox* pBox=0 )
- { bUL_LR = FALSE; bUL = TRUE; if( pBox ) pInsBox = pBox; }
+ { bUL_LR = sal_False; bUL = sal_True; if( pBox ) pInsBox = pBox; }
void SetRight( SwTableBox* pBox=0 )
- { bUL_LR = FALSE; bUL = FALSE; if( pBox ) pInsBox = pBox; }
+ { bUL_LR = sal_False; bUL = sal_False; if( pBox ) pInsBox = pBox; }
void SetUpper( SwTableLine* pLine=0 )
- { bUL_LR = TRUE; bUL = TRUE; if( pLine ) pInsLine = pLine; }
+ { bUL_LR = sal_True; bUL = sal_True; if( pLine ) pInsLine = pLine; }
void SetLower( SwTableLine* pLine=0 )
- { bUL_LR = TRUE; bUL = FALSE; if( pLine ) pInsLine = pLine; }
+ { bUL_LR = sal_True; bUL = sal_False; if( pLine ) pInsLine = pLine; }
};
-BOOL lcl_Merge_MoveBox( const _FndBox*& rpFndBox, void* pPara )
+sal_Bool lcl_Merge_MoveBox( const _FndBox*& rpFndBox, void* pPara )
{
_InsULPara* pULPara = (_InsULPara*)pPara;
SwTableBoxes* pBoxes;
- USHORT nStt = 0, nEnd = rpFndBox->GetLines().Count();
- USHORT nInsPos = USHRT_MAX;
+ sal_uInt16 nStt = 0, nEnd = rpFndBox->GetLines().Count();
+ sal_uInt16 nInsPos = USHRT_MAX;
if( !pULPara->bUL_LR ) // Left/Right
{
- USHORT nPos;
+ sal_uInt16 nPos;
SwTableBox* pFndBox = (SwTableBox*)rpFndBox->GetBox();
pBoxes = &pFndBox->GetUpper()->GetTabBoxes();
if( pULPara->bUL ) // Left ?
@@ -1566,19 +1576,19 @@ BOOL lcl_Merge_MoveBox( const _FndBox*& rpFndBox, void* pPara )
else
delete pBox;
}
- return TRUE;
+ return sal_True;
}
-BOOL lcl_Merge_MoveLine( const _FndLine*& rpFndLine, void* pPara )
+sal_Bool lcl_Merge_MoveLine( const _FndLine*& rpFndLine, void* pPara )
{
_InsULPara* pULPara = (_InsULPara*)pPara;
SwTableLines* pLines;
- USHORT nStt = 0, nEnd = rpFndLine->GetBoxes().Count();
- USHORT nInsPos = USHRT_MAX;
+ sal_uInt16 nStt = 0, nEnd = rpFndLine->GetBoxes().Count();
+ sal_uInt16 nInsPos = USHRT_MAX;
if( pULPara->bUL_LR ) // UpperLower ?
{
- USHORT nPos;
+ sal_uInt16 nPos;
SwTableLine* pFndLn = (SwTableLine*)rpFndLine->GetLine();
pLines = pFndLn->GetUpper() ?
&pFndLn->GetUpper()->GetTabLines() :
@@ -1587,8 +1597,8 @@ BOOL lcl_Merge_MoveLine( const _FndLine*& rpFndLine, void* pPara )
SwTableBox* pLBx = rpFndLine->GetBoxes()[0]->GetBox();
SwTableBox* pRBx = rpFndLine->GetBoxes()[
rpFndLine->GetBoxes().Count()-1]->GetBox();
- USHORT nLeft = pFndLn->GetTabBoxes().C40_GETPOS( SwTableBox, pLBx );
- USHORT nRight = pFndLn->GetTabBoxes().C40_GETPOS( SwTableBox, pRBx );
+ sal_uInt16 nLeft = pFndLn->GetTabBoxes().C40_GETPOS( SwTableBox, pLBx );
+ sal_uInt16 nRight = pFndLn->GetTabBoxes().C40_GETPOS( SwTableBox, pRBx );
// if( ( nLeft && nRight+1 < pFndLn->GetTabBoxes().Count() ) ||
// ( !nLeft && nRight+1 >= pFndLn->GetTabBoxes().Count() ) )
@@ -1668,7 +1678,7 @@ BOOL lcl_Merge_MoveLine( const _FndLine*& rpFndLine, void* pPara )
// Right auch mit in die Line
pInsLine = pULPara->pLeftBox->GetUpper();
- USHORT nMvPos = pULPara->pRightBox->GetUpper()->GetTabBoxes().
+ sal_uInt16 nMvPos = pULPara->pRightBox->GetUpper()->GetTabBoxes().
C40_GETPOS( SwTableBox, pULPara->pRightBox );
lcl_CpyBoxes( nMvPos, nMvPos+1,
pULPara->pRightBox->GetUpper()->GetTabBoxes(),
@@ -1690,7 +1700,7 @@ BOOL lcl_Merge_MoveLine( const _FndLine*& rpFndLine, void* pPara )
pRMBox = new SwTableBox( (SwTableBoxFmt*)pRMBox->GetFrmFmt(), 0, pNewLn );
pNewLn->GetTabBoxes().C40_INSERT( SwTableBox, pRMBox, 0 );
- USHORT nPos1, nPos2;
+ sal_uInt16 nPos1, nPos2;
if( pULPara->bUL )
nPos1 = 0,
nPos2 = nMvPos;
@@ -1721,7 +1731,7 @@ BOOL lcl_Merge_MoveLine( const _FndLine*& rpFndLine, void* pPara )
lcl_CalcWidth( pRMBox ); // bereche die Breite der Box
}
else {
- ASSERT( FALSE , "Was denn nun" );
+ ASSERT( sal_False , "Was denn nun" );
}
}
// Left/Right
@@ -1748,17 +1758,17 @@ BOOL lcl_Merge_MoveLine( const _FndLine*& rpFndLine, void* pPara )
else
delete pNewLine;
- return TRUE;
+ return sal_True;
}
-BOOL SwTable::OldMerge( SwDoc* pDoc, const SwSelBoxes& rBoxes,
+sal_Bool SwTable::OldMerge( SwDoc* pDoc, const SwSelBoxes& rBoxes,
SwTableBox* pMergeBox, SwUndoTblMerge* pUndo )
{
ASSERT( rBoxes.Count() && pMergeBox, "keine gueltigen Werte" );
SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode();
if( !pTblNd )
- return FALSE;
+ return sal_False;
// suche alle Boxen / Lines
_FndBox aFndBox( 0, 0 );
@@ -1767,7 +1777,7 @@ BOOL SwTable::OldMerge( SwDoc* pDoc, const SwSelBoxes& rBoxes,
GetTabLines().ForEach( &_FndLineCopyCol, &aPara );
}
if( !aFndBox.GetLines().Count() )
- return FALSE;
+ return sal_False;
// TL_CHART2: splitting/merging of a number of cells or rows will usually make
// the table to complex to be handled with chart.
@@ -1798,7 +1808,7 @@ BOOL SwTable::OldMerge( SwDoc* pDoc, const SwSelBoxes& rBoxes,
&pFndBox->GetBox()->GetTabLines() : &GetTabLines();
SwTableLine* pNewLine = pFndBox->GetLines()[0]->GetLine();
- USHORT nInsPos = pLines->C40_GETPOS( SwTableLine, pNewLine );
+ sal_uInt16 nInsPos = pLines->C40_GETPOS( SwTableLine, pNewLine );
pLines->C40_INSERT( SwTableLine, pInsLine, nInsPos );
SwTableBox* pLeftBox = new SwTableBox( (SwTableBoxFmt*)pMergeBox->GetFrmFmt(), 0, pInsLine );
@@ -1812,13 +1822,13 @@ BOOL SwTable::OldMerge( SwDoc* pDoc, const SwSelBoxes& rBoxes,
// in diese kommen alle Lines, die ueber dem selektierten Bereich stehen
// Sie bilden also eine Upper/Lower Line
- _InsULPara aPara( pTblNd, TRUE, TRUE, pLeftBox, pMergeBox, pRightBox, pInsLine );
+ _InsULPara aPara( pTblNd, sal_True, sal_True, pLeftBox, pMergeBox, pRightBox, pInsLine );
// move die oben/unten ueberhaengenden Lines vom selektierten Bereich
pFndBox->GetLines()[0]->GetBoxes().ForEach( &lcl_Merge_MoveBox,
&aPara );
aPara.SetLower( pInsLine );
- USHORT nEnd = pFndBox->GetLines().Count()-1;
+ sal_uInt16 nEnd = pFndBox->GetLines().Count()-1;
pFndBox->GetLines()[nEnd]->GetBoxes().ForEach( &lcl_Merge_MoveBox,
&aPara );
@@ -1830,7 +1840,7 @@ BOOL SwTable::OldMerge( SwDoc* pDoc, const SwSelBoxes& rBoxes,
pFndBox->GetLines().ForEach( &lcl_Merge_MoveLine, &aPara );
if( !pLeftBox->GetTabLines().Count() )
- _DeleteBox( *this, pLeftBox, 0, FALSE, FALSE );
+ _DeleteBox( *this, pLeftBox, 0, sal_False, sal_False );
else
{
lcl_CalcWidth( pLeftBox ); // bereche die Breite der Box
@@ -1838,7 +1848,7 @@ BOOL SwTable::OldMerge( SwDoc* pDoc, const SwSelBoxes& rBoxes,
pUndo->AddNewBox( pLeftBox->GetSttIdx() );
}
if( !pRightBox->GetTabLines().Count() )
- _DeleteBox( *this, pRightBox, 0, FALSE, FALSE );
+ _DeleteBox( *this, pRightBox, 0, sal_False, sal_False );
else
{
lcl_CalcWidth( pRightBox ); // bereche die Breite der Box
@@ -1846,7 +1856,7 @@ BOOL SwTable::OldMerge( SwDoc* pDoc, const SwSelBoxes& rBoxes,
pUndo->AddNewBox( pRightBox->GetSttIdx() );
}
- DeleteSel( pDoc, rBoxes, 0, 0, FALSE, FALSE );
+ DeleteSel( pDoc, rBoxes, 0, 0, sal_False, sal_False );
// dann raeume die Struktur dieser Line noch mal auf:
// generell alle Aufraeumen
@@ -1859,20 +1869,20 @@ BOOL SwTable::OldMerge( SwDoc* pDoc, const SwSelBoxes& rBoxes,
CHECKBOXWIDTH
CHECKTABLELAYOUT
- return TRUE;
+ return sal_True;
}
// ---------------------------------------------------------------
void lcl_CheckRowSpan( SwTable &rTbl )
{
- USHORT nLineCount = rTbl.GetTabLines().Count();
- USHORT nMaxSpan = nLineCount;
+ sal_uInt16 nLineCount = rTbl.GetTabLines().Count();
+ sal_uInt16 nMaxSpan = nLineCount;
long nMinSpan = 1;
while( nMaxSpan )
{
SwTableLine* pLine = rTbl.GetTabLines()[ nLineCount - nMaxSpan ];
- for( USHORT nBox = 0; nBox < pLine->GetTabBoxes().Count(); ++nBox )
+ for( sal_uInt16 nBox = 0; nBox < pLine->GetTabBoxes().Count(); ++nBox )
{
SwTableBox* pBox = pLine->GetTabBoxes()[nBox];
long nRowSpan = pBox->getRowSpan();
@@ -1886,31 +1896,31 @@ void lcl_CheckRowSpan( SwTable &rTbl )
}
}
-USHORT lcl_GetBoxOffset( const _FndBox& rBox )
+sal_uInt16 lcl_GetBoxOffset( const _FndBox& rBox )
{
// suche die erste Box
const _FndBox* pFirstBox = &rBox;
while( pFirstBox->GetLines().Count() )
pFirstBox = pFirstBox->GetLines()[ 0 ]->GetBoxes()[ 0 ];
- USHORT nRet = 0;
+ sal_uInt16 nRet = 0;
// dann ueber die Lines nach oben die Position bestimmen
const SwTableBox* pBox = pFirstBox->GetBox();
do {
const SwTableBoxes& rBoxes = pBox->GetUpper()->GetTabBoxes();
const SwTableBox* pCmp;
- for( USHORT n = 0; pBox != ( pCmp = rBoxes[ n ] ); ++n )
- nRet = nRet + (USHORT) pCmp->GetFrmFmt()->GetFrmSize().GetWidth();
+ for( sal_uInt16 n = 0; pBox != ( pCmp = rBoxes[ n ] ); ++n )
+ nRet = nRet + (sal_uInt16) pCmp->GetFrmFmt()->GetFrmSize().GetWidth();
pBox = pBox->GetUpper()->GetUpper();
} while( pBox );
return nRet;
}
-USHORT lcl_GetLineWidth( const _FndLine& rLine )
+sal_uInt16 lcl_GetLineWidth( const _FndLine& rLine )
{
- USHORT nRet = 0;
- for( USHORT n = rLine.GetBoxes().Count(); n; )
- nRet = nRet + (USHORT)rLine.GetBoxes()[ --n ]->GetBox()->GetFrmFmt()
+ sal_uInt16 nRet = 0;
+ for( sal_uInt16 n = rLine.GetBoxes().Count(); n; )
+ nRet = nRet + (sal_uInt16)rLine.GetBoxes()[ --n ]->GetBox()->GetFrmFmt()
->GetFrmSize().GetWidth();
return nRet;
}
@@ -1918,27 +1928,27 @@ USHORT lcl_GetLineWidth( const _FndLine& rLine )
void lcl_CalcNewWidths( const _FndLines& rFndLines, _CpyPara& rPara )
{
rPara.pWidths.reset();
- USHORT nLineCount = rFndLines.Count();
+ sal_uInt16 nLineCount = rFndLines.Count();
if( nLineCount )
{
- rPara.pWidths = boost::shared_ptr< std::vector< std::vector< ULONG > > >
- ( new std::vector< std::vector< ULONG > >( nLineCount ));
+ rPara.pWidths = boost::shared_ptr< std::vector< std::vector< sal_uLong > > >
+ ( new std::vector< std::vector< sal_uLong > >( nLineCount ));
// First we collect information about the left/right borders of all
// selected cells
- for( USHORT nLine = 0; nLine < nLineCount; ++nLine )
+ for( sal_uInt16 nLine = 0; nLine < nLineCount; ++nLine )
{
- std::vector< ULONG > &rWidth = (*rPara.pWidths.get())[ nLine ];
+ std::vector< sal_uLong > &rWidth = (*rPara.pWidths.get())[ nLine ];
const _FndLine *pFndLine = rFndLines[ nLine ];
if( pFndLine && pFndLine->GetBoxes().Count() )
{
const SwTableLine *pLine = pFndLine->GetLine();
if( pLine && pLine->GetTabBoxes().Count() )
{
- USHORT nBoxCount = pLine->GetTabBoxes().Count();
- ULONG nPos = 0;
+ sal_uInt16 nBoxCount = pLine->GetTabBoxes().Count();
+ sal_uLong nPos = 0;
// The first selected box...
const SwTableBox *pSel = pFndLine->GetBoxes()[0]->GetBox();
- USHORT nBox = 0;
+ sal_uInt16 nBox = 0;
// Sum up the width of all boxes before the first selected box
while( nBox < nBoxCount )
{
@@ -1952,7 +1962,7 @@ void lcl_CalcNewWidths( const _FndLines& rFndLines, _CpyPara& rPara )
if( rPara.nMinLeft > nPos )
rPara.nMinLeft = nPos;
nBoxCount = pFndLine->GetBoxes().Count();
- rWidth = std::vector< ULONG >( nBoxCount+2 );
+ rWidth = std::vector< sal_uLong >( nBoxCount+2 );
rWidth[ 0 ] = nPos;
// Add now the widths of all selected boxes and store
// the positions in the vector
@@ -1972,39 +1982,39 @@ void lcl_CalcNewWidths( const _FndLines& rFndLines, _CpyPara& rPara )
}
}
// Second step: calculate the new widths for the copied cells
- ULONG nSelSize = rPara.nMaxRight - rPara.nMinLeft;
+ sal_uLong nSelSize = rPara.nMaxRight - rPara.nMinLeft;
if( nSelSize )
{
- for( USHORT nLine = 0; nLine < nLineCount; ++nLine )
+ for( sal_uInt16 nLine = 0; nLine < nLineCount; ++nLine )
{
- std::vector< ULONG > &rWidth = (*rPara.pWidths.get())[ nLine ];
- USHORT nCount = (USHORT)rWidth.size();
+ std::vector< sal_uLong > &rWidth = (*rPara.pWidths.get())[ nLine ];
+ sal_uInt16 nCount = (sal_uInt16)rWidth.size();
if( nCount > 2 )
{
rWidth[ nCount - 1 ] = rPara.nMaxRight;
- ULONG nLastPos = 0;
- for( USHORT nBox = 0; nBox < nCount; ++nBox )
+ sal_uLong nLastPos = 0;
+ for( sal_uInt16 nBox = 0; nBox < nCount; ++nBox )
{
sal_uInt64 nNextPos = rWidth[ nBox ];
nNextPos -= rPara.nMinLeft;
nNextPos *= rPara.nNewSize;
nNextPos /= nSelSize;
- rWidth[ nBox ] = (ULONG)(nNextPos - nLastPos);
- nLastPos = (ULONG)nNextPos;
+ rWidth[ nBox ] = (sal_uLong)(nNextPos - nLastPos);
+ nLastPos = (sal_uLong)nNextPos;
}
}
}
}
}
-BOOL lcl_CopyBoxToDoc( const _FndBox*& rpFndBox, void* pPara )
+sal_Bool lcl_CopyBoxToDoc( const _FndBox*& rpFndBox, void* pPara )
{
_CpyPara* pCpyPara = (_CpyPara*)pPara;
// Calculation of new size
- ULONG nRealSize;
- ULONG nDummy1 = 0;
- ULONG nDummy2 = 0;
+ sal_uLong nRealSize;
+ sal_uLong nDummy1 = 0;
+ sal_uLong nDummy2 = 0;
if( pCpyPara->pTblNd->GetTable().IsNewModel() )
{
if( pCpyPara->nBoxIdx == 1 )
@@ -2020,7 +2030,7 @@ BOOL lcl_CopyBoxToDoc( const _FndBox*& rpFndBox, void* pPara )
nRealSize /= pCpyPara->nOldSize;
}
- ULONG nSize;
+ sal_uLong nSize;
bool bDummy = nDummy1 > 0;
if( bDummy )
nSize = nDummy1;
@@ -2035,7 +2045,7 @@ BOOL lcl_CopyBoxToDoc( const _FndBox*& rpFndBox, void* pPara )
_CpyTabFrm aFindFrm( (SwTableBoxFmt*)rpFndBox->GetBox()->GetFrmFmt() );
SwFmtFrmSize aFrmSz;
- USHORT nFndPos;
+ sal_uInt16 nFndPos;
if( !pCpyPara->rTabFrmArr.Seek_Entry( aFindFrm, &nFndPos ) ||
( aFrmSz = ( aFindFrm = pCpyPara->rTabFrmArr[ nFndPos ]).pNewFrmFmt->
GetFrmSize()).GetWidth() != (SwTwips)nSize )
@@ -2084,12 +2094,12 @@ BOOL lcl_CopyBoxToDoc( const _FndBox*& rpFndBox, void* pPara )
if( aBoxAttrSet.Count() )
{
const SfxPoolItem* pItem;
- SvNumberFormatter* pN = pCpyPara->pDoc->GetNumberFormatter( FALSE );
+ SvNumberFormatter* pN = pCpyPara->pDoc->GetNumberFormatter( sal_False );
if( pN && pN->HasMergeFmtTbl() && SFX_ITEM_SET == aBoxAttrSet.
- GetItemState( RES_BOXATR_FORMAT, FALSE, &pItem ) )
+ GetItemState( RES_BOXATR_FORMAT, sal_False, &pItem ) )
{
- ULONG nOldIdx = ((SwTblBoxNumFormat*)pItem)->GetValue();
- ULONG nNewIdx = pN->GetMergeFmtIndex( nOldIdx );
+ sal_uLong nOldIdx = ((SwTblBoxNumFormat*)pItem)->GetValue();
+ sal_uLong nNewIdx = pN->GetMergeFmtIndex( nOldIdx );
if( nNewIdx != nOldIdx )
aBoxAttrSet.Put( SwTblBoxNumFormat( nNewIdx ));
}
@@ -2101,7 +2111,7 @@ BOOL lcl_CopyBoxToDoc( const _FndBox*& rpFndBox, void* pPara )
*rpFndBox->GetBox()->GetSttNd()->EndOfSectionNode() );
SwNodeIndex aInsIdx( *pBox->GetSttNd(), 1 );
- pFromDoc->CopyWithFlyInFly( aCpyRg, 0, aInsIdx, FALSE );
+ pFromDoc->CopyWithFlyInFly( aCpyRg, 0, aInsIdx, sal_False );
// den initialen TextNode loeschen
pCpyPara->pDoc->GetNodes().Delete( aInsIdx, 1 );
}
@@ -2121,16 +2131,16 @@ BOOL lcl_CopyBoxToDoc( const _FndBox*& rpFndBox, void* pPara )
}
}
while( nSize );
- return TRUE;
+ return sal_True;
}
-BOOL lcl_CopyLineToDoc( const _FndLine*& rpFndLine, void* pPara )
+sal_Bool lcl_CopyLineToDoc( const _FndLine*& rpFndLine, void* pPara )
{
_CpyPara* pCpyPara = (_CpyPara*)pPara;
// suche das Format in der Liste aller Formate
_CpyTabFrm aFindFrm( (SwTableBoxFmt*)rpFndLine->GetLine()->GetFrmFmt() );
- USHORT nFndPos;
+ sal_uInt16 nFndPos;
if( !pCpyPara->rTabFrmArr.Seek_Entry( aFindFrm, &nFndPos ))
{
// es ist noch nicht vorhanden, also kopiere es
@@ -2174,23 +2184,23 @@ BOOL lcl_CopyLineToDoc( const _FndLine*& rpFndLine, void* pPara )
}
else
// errechne sie
- for( USHORT n = 0; n < rpFndLine->GetBoxes().Count(); ++n )
+ for( sal_uInt16 n = 0; n < rpFndLine->GetBoxes().Count(); ++n )
aPara.nOldSize += rpFndLine->GetBoxes()[n]
->GetBox()->GetFrmFmt()->GetFrmSize().GetWidth();
((_FndLine*)rpFndLine)->GetBoxes().ForEach( &lcl_CopyBoxToDoc, &aPara );
if( pCpyPara->pTblNd->GetTable().IsNewModel() )
++pCpyPara->nLnIdx;
- return TRUE;
+ return sal_True;
}
-BOOL SwTable::CopyHeadlineIntoTable( SwTableNode& rTblNd )
+sal_Bool SwTable::CopyHeadlineIntoTable( SwTableNode& rTblNd )
{
// suche alle Boxen / Lines
SwSelBoxes aSelBoxes;
SwTableBox* pBox = GetTabSortBoxes()[ 0 ];
pBox = GetTblBox( pBox->GetSttNd()->StartOfSectionNode()->GetIndex() + 1 );
- SelLineFromBox( pBox, aSelBoxes, TRUE );
+ SelLineFromBox( pBox, aSelBoxes, sal_True );
_FndBox aFndBox( 0, 0 );
{
@@ -2198,7 +2208,7 @@ BOOL SwTable::CopyHeadlineIntoTable( SwTableNode& rTblNd )
((SwTableLines&)GetTabLines()).ForEach( &_FndLineCopyCol, &aPara );
}
if( !aFndBox.GetLines().Count() )
- return FALSE;
+ return sal_False;
{
// Tabellen-Formeln in die relative Darstellung umwandeln
@@ -2208,7 +2218,7 @@ BOOL SwTable::CopyHeadlineIntoTable( SwTableNode& rTblNd )
}
_CpyTabFrms aCpyFmt;
- _CpyPara aPara( &rTblNd, 1, aCpyFmt, TRUE );
+ _CpyPara aPara( &rTblNd, 1, aCpyFmt, sal_True );
aPara.nNewSize = aPara.nOldSize = rTblNd.GetTable().GetFrmFmt()->GetFrmSize().GetWidth();
// dann kopiere mal
if( IsNewModel() )
@@ -2217,9 +2227,9 @@ BOOL SwTable::CopyHeadlineIntoTable( SwTableNode& rTblNd )
if( rTblNd.GetTable().IsNewModel() )
{ // The copied line must not contain any row span attributes > 1
SwTableLine* pLine = rTblNd.GetTable().GetTabLines()[0];
- USHORT nColCount = pLine->GetTabBoxes().Count();
+ sal_uInt16 nColCount = pLine->GetTabBoxes().Count();
ASSERT( nColCount, "Empty Table Line" )
- for( USHORT nCurrCol = 0; nCurrCol < nColCount; ++nCurrCol )
+ for( sal_uInt16 nCurrCol = 0; nCurrCol < nColCount; ++nCurrCol )
{
SwTableBox* pTableBox = pLine->GetTabBoxes()[nCurrCol];
ASSERT( pTableBox, "Missing Table Box" );
@@ -2227,12 +2237,12 @@ BOOL SwTable::CopyHeadlineIntoTable( SwTableNode& rTblNd )
}
}
- return TRUE;
+ return sal_True;
}
-BOOL SwTable::MakeCopy( SwDoc* pInsDoc, const SwPosition& rPos,
- const SwSelBoxes& rSelBoxes, BOOL bCpyNds,
- BOOL bCpyName ) const
+sal_Bool SwTable::MakeCopy( SwDoc* pInsDoc, const SwPosition& rPos,
+ const SwSelBoxes& rSelBoxes, sal_Bool bCpyNds,
+ sal_Bool bCpyName ) const
{
// suche alle Boxen / Lines
_FndBox aFndBox( 0, 0 );
@@ -2241,7 +2251,7 @@ BOOL SwTable::MakeCopy( SwDoc* pInsDoc, const SwPosition& rPos,
((SwTableLines&)GetTabLines()).ForEach( &_FndLineCopyCol, &aPara );
}
if( !aFndBox.GetLines().Count() )
- return FALSE;
+ return sal_False;
// erst die Poolvorlagen fuer die Tabelle kopieren, damit die dann
// wirklich kopiert und damit die gueltigen Werte haben.
@@ -2255,9 +2265,9 @@ BOOL SwTable::MakeCopy( SwDoc* pInsDoc, const SwPosition& rPos,
SwTable* pNewTbl = (SwTable*)pInsDoc->InsertTable(
SwInsertTableOptions( tabopts::HEADLINE_NO_BORDER, 1 ),
rPos, 1, 1, GetFrmFmt()->GetHoriOrient().GetHoriOrient(),
- 0, 0, FALSE, IsNewModel() );
+ 0, 0, sal_False, IsNewModel() );
if( !pNewTbl )
- return FALSE;
+ return sal_False;
SwNodeIndex aIdx( rPos.nNode, -1 );
SwTableNode* pTblNd = aIdx.GetNode().FindTableNode();
@@ -2277,7 +2287,7 @@ BOOL SwTable::MakeCopy( SwDoc* pInsDoc, const SwPosition& rPos,
// tauschen am Node den Tabellen-Pointer aus
pNewTbl = new SwDDETable( *pNewTbl,
(SwDDEFieldType*)pFldType );
- pTblNd->SetNewTable( pNewTbl, FALSE );
+ pTblNd->SetNewTable( pNewTbl, sal_False );
}
pNewTbl->GetFrmFmt()->CopyAttrs( *GetFrmFmt() );
@@ -2313,11 +2323,11 @@ BOOL SwTable::MakeCopy( SwDoc* pInsDoc, const SwPosition& rPos,
_FndLine* pFndLn = aFndBox.GetLines()[ 0 ];
SwTableLine* pLn = pFndLn->GetLine();
const SwTableLine* pTmp = pLn;
- USHORT nLnPos = GetTabLines().GetPos( pTmp );
+ sal_uInt16 nLnPos = GetTabLines().GetPos( pTmp );
if( USHRT_MAX != nLnPos && nLnPos )
{
// es gibt eine Line davor
- SwCollectTblLineBoxes aLnPara( FALSE, HEADLINE_BORDERCOPY );
+ SwCollectTblLineBoxes aLnPara( sal_False, HEADLINE_BORDERCOPY );
pLn = GetTabLines()[ nLnPos - 1 ];
pLn->GetTabBoxes().ForEach( &lcl_Box_CollectBox, &aLnPara );
@@ -2325,7 +2335,7 @@ BOOL SwTable::MakeCopy( SwDoc* pInsDoc, const SwPosition& rPos,
if( aLnPara.Resize( lcl_GetBoxOffset( aFndBox ),
lcl_GetLineWidth( *pFndLn )) )
{
- aLnPara.SetValues( TRUE );
+ aLnPara.SetValues( sal_True );
pLn = pNewTbl->GetTabLines()[ 0 ];
pLn->GetTabBoxes().ForEach( &lcl_BoxSetSplitBoxFmts, &aLnPara );
}
@@ -2338,7 +2348,7 @@ BOOL SwTable::MakeCopy( SwDoc* pInsDoc, const SwPosition& rPos,
if( nLnPos < GetTabLines().Count() - 1 )
{
// es gibt eine Line dahinter
- SwCollectTblLineBoxes aLnPara( TRUE, HEADLINE_BORDERCOPY );
+ SwCollectTblLineBoxes aLnPara( sal_True, HEADLINE_BORDERCOPY );
pLn = GetTabLines()[ nLnPos + 1 ];
pLn->GetTabBoxes().ForEach( &lcl_Box_CollectBox, &aLnPara );
@@ -2346,7 +2356,7 @@ BOOL SwTable::MakeCopy( SwDoc* pInsDoc, const SwPosition& rPos,
if( aLnPara.Resize( lcl_GetBoxOffset( aFndBox ),
lcl_GetLineWidth( *pFndLn )) )
{
- aLnPara.SetValues( FALSE );
+ aLnPara.SetValues( sal_False );
pLn = pNewTbl->GetTabLines()[ pNewTbl->GetTabLines().Count()-1 ];
pLn->GetTabBoxes().ForEach( &lcl_BoxSetSplitBoxFmts, &aLnPara );
}
@@ -2356,7 +2366,7 @@ BOOL SwTable::MakeCopy( SwDoc* pInsDoc, const SwPosition& rPos,
// die initiale Box muss noch geloescht werden
_DeleteBox( *pNewTbl, pNewTbl->GetTabLines()[
pNewTbl->GetTabLines().Count() - 1 ]->GetTabBoxes()[0],
- 0, FALSE, FALSE );
+ 0, sal_False, sal_False );
if( pNewTbl->IsNewModel() )
lcl_CheckRowSpan( *pNewTbl );
@@ -2367,7 +2377,7 @@ BOOL SwTable::MakeCopy( SwDoc* pInsDoc, const SwPosition& rPos,
CHECKTABLELAYOUT
- return TRUE;
+ return sal_True;
}
@@ -2376,11 +2386,11 @@ BOOL SwTable::MakeCopy( SwDoc* pInsDoc, const SwPosition& rPos,
// suche ab dieser Line nach der naechsten Box mit Inhalt
SwTableBox* SwTableLine::FindNextBox( const SwTable& rTbl,
- const SwTableBox* pSrchBox, BOOL bOvrTblLns ) const
+ const SwTableBox* pSrchBox, sal_Bool bOvrTblLns ) const
{
const SwTableLine* pLine = this; // fuer M800
SwTableBox* pBox;
- USHORT nFndPos;
+ sal_uInt16 nFndPos;
if( GetTabBoxes().Count() && pSrchBox &&
USHRT_MAX != ( nFndPos = GetTabBoxes().GetPos( pSrchBox )) &&
nFndPos + 1 != GetTabBoxes().Count() )
@@ -2424,11 +2434,11 @@ SwTableBox* SwTableLine::FindNextBox( const SwTable& rTbl,
// suche ab dieser Line nach der vorherigen Box
SwTableBox* SwTableLine::FindPreviousBox( const SwTable& rTbl,
- const SwTableBox* pSrchBox, BOOL bOvrTblLns ) const
+ const SwTableBox* pSrchBox, sal_Bool bOvrTblLns ) const
{
const SwTableLine* pLine = this; // fuer M800
SwTableBox* pBox;
- USHORT nFndPos;
+ sal_uInt16 nFndPos;
if( GetTabBoxes().Count() && pSrchBox &&
USHRT_MAX != ( nFndPos = GetTabBoxes().GetPos( pSrchBox )) &&
nFndPos )
@@ -2478,7 +2488,7 @@ SwTableBox* SwTableLine::FindPreviousBox( const SwTable& rTbl,
// suche ab dieser Line nach der naechsten Box mit Inhalt
SwTableBox* SwTableBox::FindNextBox( const SwTable& rTbl,
- const SwTableBox* pSrchBox, BOOL bOvrTblLns ) const
+ const SwTableBox* pSrchBox, sal_Bool bOvrTblLns ) const
{
if( !pSrchBox && !GetTabLines().Count() )
return (SwTableBox*)this;
@@ -2489,7 +2499,7 @@ SwTableBox* SwTableBox::FindNextBox( const SwTable& rTbl,
// suche ab dieser Line nach der naechsten Box mit Inhalt
SwTableBox* SwTableBox::FindPreviousBox( const SwTable& rTbl,
- const SwTableBox* pSrchBox, BOOL bOvrTblLns ) const
+ const SwTableBox* pSrchBox, sal_Bool bOvrTblLns ) const
{
if( !pSrchBox && !GetTabLines().Count() )
return (SwTableBox*)this;
@@ -2498,7 +2508,7 @@ SwTableBox* SwTableBox::FindPreviousBox( const SwTable& rTbl,
}
-BOOL lcl_BoxSetHeadCondColl( const SwTableBox*& rpBox, void* )
+sal_Bool lcl_BoxSetHeadCondColl( const SwTableBox*& rpBox, void* )
{
// in der HeadLine sind die Absaetze mit BedingtenVorlage anzupassen
const SwStartNode* pSttNd = rpBox->GetSttNd();
@@ -2506,29 +2516,29 @@ BOOL lcl_BoxSetHeadCondColl( const SwTableBox*& rpBox, void* )
pSttNd->CheckSectionCondColl();
else
((SwTableBox*)rpBox)->GetTabLines().ForEach( &lcl_LineSetHeadCondColl, 0 );
- return TRUE;
+ return sal_True;
}
-BOOL lcl_LineSetHeadCondColl( const SwTableLine*& rpLine, void* )
+sal_Bool lcl_LineSetHeadCondColl( const SwTableLine*& rpLine, void* )
{
((SwTableLine*)rpLine)->GetTabBoxes().ForEach( &lcl_BoxSetHeadCondColl, 0 );
- return TRUE;
+ return sal_True;
}
/* */
-SwTwips lcl_GetDistance( SwTableBox* pBox, BOOL bLeft )
+SwTwips lcl_GetDistance( SwTableBox* pBox, sal_Bool bLeft )
{
- BOOL bFirst = TRUE;
+ sal_Bool bFirst = sal_True;
SwTwips nRet = 0;
SwTableLine* pLine;
while( pBox && 0 != ( pLine = pBox->GetUpper() ) )
{
- USHORT nStt = 0, nPos = pLine->GetTabBoxes().C40_GETPOS( SwTableBox, pBox );
+ sal_uInt16 nStt = 0, nPos = pLine->GetTabBoxes().C40_GETPOS( SwTableBox, pBox );
if( bFirst && !bLeft )
++nPos;
- bFirst = FALSE;
+ bFirst = sal_False;
while( nStt < nPos )
nRet += pLine->GetTabBoxes()[ nStt++ ]->GetFrmFmt()
@@ -2538,30 +2548,30 @@ SwTwips lcl_GetDistance( SwTableBox* pBox, BOOL bLeft )
return nRet;
}
-BOOL lcl_SetSelBoxWidth( SwTableLine* pLine, CR_SetBoxWidth& rParam,
- SwTwips nDist, BOOL bCheck )
+sal_Bool lcl_SetSelBoxWidth( SwTableLine* pLine, CR_SetBoxWidth& rParam,
+ SwTwips nDist, sal_Bool bCheck )
{
SwTableBoxes& rBoxes = pLine->GetTabBoxes();
- for( USHORT n = 0; n < rBoxes.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rBoxes.Count(); ++n )
{
SwTableBox* pBox = rBoxes[ n ];
SwFrmFmt* pFmt = pBox->GetFrmFmt();
const SwFmtFrmSize& rSz = pFmt->GetFrmSize();
SwTwips nWidth = rSz.GetWidth();
- BOOL bGreaterBox = FALSE;
+ sal_Bool bGreaterBox = sal_False;
if( bCheck )
{
- for( USHORT i = 0; i < pBox->GetTabLines().Count(); ++i )
+ for( sal_uInt16 i = 0; i < pBox->GetTabLines().Count(); ++i )
if( !::lcl_SetSelBoxWidth( pBox->GetTabLines()[ i ], rParam,
- nDist, TRUE ))
- return FALSE;
+ nDist, sal_True ))
+ return sal_False;
// dann noch mal alle "ContentBoxen" sammeln
if( ( 0 != ( bGreaterBox = TBLFIX_CHGABS != rParam.nMode && ( nDist + ( rParam.bLeft ? 0 : nWidth ) ) >= rParam.nSide)) ||
( !rParam.bBigger && ( Abs( nDist + (( rParam.nMode && rParam.bLeft ) ? 0 : nWidth ) - rParam.nSide ) < COLFUZZY ) ) )
{
- rParam.bAnyBoxFnd = TRUE;
+ rParam.bAnyBoxFnd = sal_True;
SwTwips nLowerDiff;
if( bGreaterBox && TBLFIX_CHGPROP == rParam.nMode )
{
@@ -2576,16 +2586,16 @@ BOOL lcl_SetSelBoxWidth( SwTableLine* pLine, CR_SetBoxWidth& rParam,
nLowerDiff = rParam.nDiff;
if( nWidth < nLowerDiff || nWidth - nLowerDiff < MINLAY )
- return FALSE;
+ return sal_False;
}
}
else
{
SwTwips nLowerDiff = 0, nOldLower = rParam.nLowerDiff;
- for( USHORT i = 0; i < pBox->GetTabLines().Count(); ++i )
+ for( sal_uInt16 i = 0; i < pBox->GetTabLines().Count(); ++i )
{
rParam.nLowerDiff = 0;
- lcl_SetSelBoxWidth( pBox->GetTabLines()[ i ], rParam, nDist, FALSE );
+ lcl_SetSelBoxWidth( pBox->GetTabLines()[ i ], rParam, nDist, sal_False );
if( nLowerDiff < rParam.nLowerDiff )
nLowerDiff = rParam.nLowerDiff;
@@ -2638,14 +2648,14 @@ BOOL lcl_SetSelBoxWidth( SwTableLine* pLine, CR_SetBoxWidth& rParam,
nDist >= rParam.nSide )
break;
}
- return TRUE;
+ return sal_True;
}
-BOOL lcl_SetOtherBoxWidth( SwTableLine* pLine, CR_SetBoxWidth& rParam,
- SwTwips nDist, BOOL bCheck )
+sal_Bool lcl_SetOtherBoxWidth( SwTableLine* pLine, CR_SetBoxWidth& rParam,
+ SwTwips nDist, sal_Bool bCheck )
{
SwTableBoxes& rBoxes = pLine->GetTabBoxes();
- for( USHORT n = 0; n < rBoxes.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rBoxes.Count(); ++n )
{
SwTableBox* pBox = rBoxes[ n ];
SwFrmFmt* pFmt = pBox->GetFrmFmt();
@@ -2654,17 +2664,17 @@ BOOL lcl_SetOtherBoxWidth( SwTableLine* pLine, CR_SetBoxWidth& rParam,
if( bCheck )
{
- for( USHORT i = 0; i < pBox->GetTabLines().Count(); ++i )
+ for( sal_uInt16 i = 0; i < pBox->GetTabLines().Count(); ++i )
if( !::lcl_SetOtherBoxWidth( pBox->GetTabLines()[ i ],
- rParam, nDist, TRUE ))
- return FALSE;
+ rParam, nDist, sal_True ))
+ return sal_False;
if( rParam.bBigger && ( TBLFIX_CHGABS == rParam.nMode
? Abs( nDist - rParam.nSide ) < COLFUZZY
: ( rParam.bLeft ? nDist < rParam.nSide - COLFUZZY
: nDist >= rParam.nSide - COLFUZZY )) )
{
- rParam.bAnyBoxFnd = TRUE;
+ rParam.bAnyBoxFnd = sal_True;
SwTwips nDiff;
if( TBLFIX_CHGPROP == rParam.nMode ) // Tabelle fix, proport.
{
@@ -2677,17 +2687,17 @@ BOOL lcl_SetOtherBoxWidth( SwTableLine* pLine, CR_SetBoxWidth& rParam,
nDiff = rParam.nDiff;
if( nWidth < nDiff || nWidth - nDiff < MINLAY )
- return FALSE;
+ return sal_False;
}
}
else
{
SwTwips nLowerDiff = 0, nOldLower = rParam.nLowerDiff;
- for( USHORT i = 0; i < pBox->GetTabLines().Count(); ++i )
+ for( sal_uInt16 i = 0; i < pBox->GetTabLines().Count(); ++i )
{
rParam.nLowerDiff = 0;
lcl_SetOtherBoxWidth( pBox->GetTabLines()[ i ], rParam,
- nDist, FALSE );
+ nDist, sal_False );
if( nLowerDiff < rParam.nLowerDiff )
nLowerDiff = rParam.nLowerDiff;
@@ -2732,16 +2742,16 @@ BOOL lcl_SetOtherBoxWidth( SwTableLine* pLine, CR_SetBoxWidth& rParam,
nDist > rParam.nSide )
break;
}
- return TRUE;
+ return sal_True;
}
/* */
-BOOL lcl_InsSelBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
- SwTwips nDist, BOOL bCheck )
+sal_Bool lcl_InsSelBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
+ SwTwips nDist, sal_Bool bCheck )
{
SwTableBoxes& rBoxes = pLine->GetTabBoxes();
- USHORT n, nCmp;
+ sal_uInt16 n, nCmp;
for( n = 0; n < rBoxes.Count(); ++n )
{
SwTableBox* pBox = rBoxes[ n ];
@@ -2751,10 +2761,10 @@ BOOL lcl_InsSelBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
if( bCheck )
{
- for( USHORT i = 0; i < pBox->GetTabLines().Count(); ++i )
+ for( sal_uInt16 i = 0; i < pBox->GetTabLines().Count(); ++i )
if( !::lcl_InsSelBox( pBox->GetTabLines()[ i ], rParam,
- nDist, TRUE ))
- return FALSE;
+ nDist, sal_True ))
+ return sal_False;
// dann noch mal alle "ContentBoxen" sammeln
if( Abs( nDist + ( rParam.bLeft ? 0 : nWidth )
@@ -2767,14 +2777,14 @@ BOOL lcl_InsSelBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
if( nCmp )
{
- rParam.bAnyBoxFnd = TRUE;
+ rParam.bAnyBoxFnd = sal_True;
if( pFmt->GetProtect().IsCntntProtected() )
- return FALSE;
+ return sal_False;
if( rParam.bSplittBox &&
nWidth - rParam.nDiff <= COLFUZZY +
( 567 / 2 /* min. 0,5 cm Platz lassen*/) )
- return FALSE;
+ return sal_False;
if( pBox->GetSttNd() )
rParam.aBoxes.Insert( pBox );
@@ -2785,10 +2795,10 @@ BOOL lcl_InsSelBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
else
{
SwTwips nLowerDiff = 0, nOldLower = rParam.nLowerDiff;
- for( USHORT i = 0; i < pBox->GetTabLines().Count(); ++i )
+ for( sal_uInt16 i = 0; i < pBox->GetTabLines().Count(); ++i )
{
rParam.nLowerDiff = 0;
- lcl_InsSelBox( pBox->GetTabLines()[ i ], rParam, nDist, FALSE );
+ lcl_InsSelBox( pBox->GetTabLines()[ i ], rParam, nDist, sal_False );
if( nLowerDiff < rParam.nLowerDiff )
nLowerDiff = rParam.nLowerDiff;
@@ -2868,18 +2878,18 @@ BOOL lcl_InsSelBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
nDist += nWidth;
}
- return TRUE;
+ return sal_True;
}
-BOOL lcl_InsOtherBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
- SwTwips nDist, BOOL bCheck )
+sal_Bool lcl_InsOtherBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
+ SwTwips nDist, sal_Bool bCheck )
{
// Sonderfall: kein Platz in den anderen Boxen aber in der Zelle
if( rParam.bSplittBox )
- return TRUE;
+ return sal_True;
SwTableBoxes& rBoxes = pLine->GetTabBoxes();
- USHORT n;
+ sal_uInt16 n;
// Tabelle fix, proport.
if( !rParam.nRemainWidth && TBLFIX_CHGPROP == rParam.nMode )
@@ -2893,8 +2903,8 @@ BOOL lcl_InsOtherBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
if( (nTmpDist + nWidth / 2 ) > rParam.nSide )
{
rParam.nRemainWidth = rParam.bLeft
- ? USHORT(nTmpDist)
- : USHORT(rParam.nTblWidth - nTmpDist);
+ ? sal_uInt16(nTmpDist)
+ : sal_uInt16(rParam.nTblWidth - nTmpDist);
break;
}
nTmpDist += nWidth;
@@ -2910,10 +2920,10 @@ BOOL lcl_InsOtherBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
if( bCheck )
{
- for( USHORT i = 0; i < pBox->GetTabLines().Count(); ++i )
+ for( sal_uInt16 i = 0; i < pBox->GetTabLines().Count(); ++i )
if( !::lcl_InsOtherBox( pBox->GetTabLines()[ i ],
- rParam, nDist, TRUE ))
- return FALSE;
+ rParam, nDist, sal_True ))
+ return sal_False;
if(
rParam.bLeft ? ((nDist + nWidth / 2 ) <= rParam.nSide &&
@@ -2925,7 +2935,7 @@ BOOL lcl_InsOtherBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
: (nDist + nWidth / 2 ) > rParam.nSide
)
{
- rParam.bAnyBoxFnd = TRUE;
+ rParam.bAnyBoxFnd = sal_True;
SwTwips nDiff;
if( TBLFIX_CHGPROP == rParam.nMode ) // Tabelle fix, proport.
{
@@ -2935,7 +2945,7 @@ BOOL lcl_InsOtherBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
nDiff /= rParam.nRemainWidth;
if( nWidth < nDiff || nWidth - nDiff < MINLAY )
- return FALSE;
+ return sal_False;
}
else
{
@@ -2948,7 +2958,7 @@ BOOL lcl_InsOtherBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
if( rParam.bLeft && pBox->GetUpper()->GetUpper() )
{
const SwTableBox* pTmpBox = pBox;
- USHORT nBoxPos = n;
+ sal_uInt16 nBoxPos = n;
while( !nBoxPos && pTmpBox->GetUpper()->GetUpper() )
{
pTmpBox = pTmpBox->GetUpper()->GetUpper();
@@ -2961,7 +2971,7 @@ BOOL lcl_InsOtherBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
}
if( nTmpWidth < nDiff || nTmpWidth - nDiff < MINLAY )
- return FALSE;
+ return sal_False;
break;
}
}
@@ -2969,11 +2979,11 @@ BOOL lcl_InsOtherBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
else
{
SwTwips nLowerDiff = 0, nOldLower = rParam.nLowerDiff;
- for( USHORT i = 0; i < pBox->GetTabLines().Count(); ++i )
+ for( sal_uInt16 i = 0; i < pBox->GetTabLines().Count(); ++i )
{
rParam.nLowerDiff = 0;
lcl_InsOtherBox( pBox->GetTabLines()[ i ], rParam,
- nDist, FALSE );
+ nDist, sal_False );
if( nLowerDiff < rParam.nLowerDiff )
nLowerDiff = rParam.nLowerDiff;
@@ -3018,7 +3028,7 @@ BOOL lcl_InsOtherBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
nDist += nWidth;
}
- return TRUE;
+ return sal_True;
}
@@ -3031,8 +3041,8 @@ BOOL lcl_InsOtherBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
// POS_OVERLAP_BEFORE, // Box ueberlappt den Start
// POS_OVERLAP_BEHIND // Box ueberlappt das Ende
-SwComparePosition _CheckBoxInRange( USHORT nStt, USHORT nEnd,
- USHORT nBoxStt, USHORT nBoxEnd )
+SwComparePosition _CheckBoxInRange( sal_uInt16 nStt, sal_uInt16 nEnd,
+ sal_uInt16 nBoxStt, sal_uInt16 nBoxEnd )
{
// COLFUZZY noch beachten!!
SwComparePosition nRet;
@@ -3073,7 +3083,7 @@ void lcl_DelSelBox_CorrLowers( SwTableLine& rLine, CR_SetBoxWidth& rParam,
// 1. Schritt die eigene Breite feststellen
SwTableBoxes& rBoxes = rLine.GetTabBoxes();
SwTwips nBoxWidth = 0;
- USHORT n;
+ sal_uInt16 n;
for( n = rBoxes.Count(); n; )
nBoxWidth += rBoxes[ --n ]->GetFrmFmt()->GetFrmSize().GetWidth();
@@ -3095,7 +3105,7 @@ void lcl_DelSelBox_CorrLowers( SwTableLine& rLine, CR_SetBoxWidth& rParam,
if( !pBox->GetSttNd() )
{
// hat selbst auch Lower, also auch die anpassen
- for( USHORT i = pBox->GetTabLines().Count(); i; )
+ for( sal_uInt16 i = pBox->GetTabLines().Count(); i; )
::lcl_DelSelBox_CorrLowers( *pBox->GetTabLines()[ --i ],
rParam, nDiff );
}
@@ -3105,16 +3115,16 @@ void lcl_DelSelBox_CorrLowers( SwTableLine& rLine, CR_SetBoxWidth& rParam,
void lcl_ChgBoxSize( SwTableBox& rBox, CR_SetBoxWidth& rParam,
const SwFmtFrmSize& rOldSz,
- USHORT& rDelWidth, SwTwips nDist )
+ sal_uInt16& rDelWidth, SwTwips nDist )
{
long nDiff = 0;
- BOOL bSetSize = FALSE;
+ sal_Bool bSetSize = sal_False;
switch( rParam.nMode )
{
case TBLFIX_CHGABS: // Tabelle feste Breite, den Nachbar andern
nDiff = rDelWidth + rParam.nLowerDiff;
- bSetSize = TRUE;
+ bSetSize = sal_True;
break;
case TBLFIX_CHGPROP: // Tabelle feste Breite, alle Nachbarn aendern
@@ -3122,9 +3132,9 @@ void lcl_ChgBoxSize( SwTableBox& rBox, CR_SetBoxWidth& rParam,
{
// dann kurz berechnen:
if( rParam.bLeft )
- rParam.nRemainWidth = USHORT(nDist);
+ rParam.nRemainWidth = sal_uInt16(nDist);
else
- rParam.nRemainWidth = USHORT(rParam.nTblWidth - nDist);
+ rParam.nRemainWidth = sal_uInt16(rParam.nTblWidth - nDist);
}
// relativ berechnen
@@ -3132,7 +3142,7 @@ void lcl_ChgBoxSize( SwTableBox& rBox, CR_SetBoxWidth& rParam,
nDiff *= rDelWidth + rParam.nLowerDiff;
nDiff /= rParam.nRemainWidth;
- bSetSize = TRUE;
+ bSetSize = sal_True;
break;
case TBLVAR_CHGABS: // Tabelle variable, alle Nachbarn aendern
@@ -3141,10 +3151,10 @@ void lcl_ChgBoxSize( SwTableBox& rBox, CR_SetBoxWidth& rParam,
{
nDiff = rDelWidth + rParam.nLowerDiff - rParam.nBoxWidth;
if( 0 < nDiff )
- rDelWidth = rDelWidth - USHORT(nDiff);
+ rDelWidth = rDelWidth - sal_uInt16(nDiff);
else
- rDelWidth = rDelWidth + USHORT(-nDiff);
- bSetSize = TRUE;
+ rDelWidth = rDelWidth + sal_uInt16(-nDiff);
+ bSetSize = sal_True;
}
break;
}
@@ -3156,23 +3166,23 @@ void lcl_ChgBoxSize( SwTableBox& rBox, CR_SetBoxWidth& rParam,
rParam.aShareFmts.SetSize( rBox, aNew );
// dann leider nochmals die Lower anpassen
- for( USHORT i = rBox.GetTabLines().Count(); i; )
+ for( sal_uInt16 i = rBox.GetTabLines().Count(); i; )
::lcl_DelSelBox_CorrLowers( *rBox.GetTabLines()[ --i ], rParam,
aNew.GetWidth() );
}
}
-BOOL lcl_DeleteBox_Rekursiv( CR_SetBoxWidth& rParam, SwTableBox& rBox,
- BOOL bCheck )
+sal_Bool lcl_DeleteBox_Rekursiv( CR_SetBoxWidth& rParam, SwTableBox& rBox,
+ sal_Bool bCheck )
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
if( rBox.GetSttNd() )
{
if( bCheck )
{
- rParam.bAnyBoxFnd = TRUE;
+ rParam.bAnyBoxFnd = sal_True;
if( rBox.GetFrmFmt()->GetProtect().IsCntntProtected() )
- bRet = FALSE;
+ bRet = sal_False;
else
{
SwTableBox* pBox = &rBox;
@@ -3181,42 +3191,42 @@ BOOL lcl_DeleteBox_Rekursiv( CR_SetBoxWidth& rParam, SwTableBox& rBox,
}
else
::_DeleteBox( rParam.pTblNd->GetTable(), &rBox,
- rParam.pUndo, FALSE, TRUE, &rParam.aShareFmts );
+ rParam.pUndo, sal_False, sal_True, &rParam.aShareFmts );
}
else
{
// die muessen leider alle sequentiel ueber die
// Contentboxen geloescht werden
- for( USHORT i = rBox.GetTabLines().Count(); i; )
+ for( sal_uInt16 i = rBox.GetTabLines().Count(); i; )
{
SwTableLine& rLine = *rBox.GetTabLines()[ --i ];
- for( USHORT n = rLine.GetTabBoxes().Count(); n; )
+ for( sal_uInt16 n = rLine.GetTabBoxes().Count(); n; )
if( !::lcl_DeleteBox_Rekursiv( rParam,
*rLine.GetTabBoxes()[ --n ], bCheck ))
- return FALSE;
+ return sal_False;
}
}
return bRet;
}
-BOOL lcl_DelSelBox( SwTableLine* pTabLine, CR_SetBoxWidth& rParam,
- SwTwips nDist, BOOL bCheck )
+sal_Bool lcl_DelSelBox( SwTableLine* pTabLine, CR_SetBoxWidth& rParam,
+ SwTwips nDist, sal_Bool bCheck )
{
SwTableBoxes& rBoxes = pTabLine->GetTabBoxes();
- USHORT n, nCntEnd, nBoxChkStt, nBoxChkEnd, nDelWidth = 0;
+ sal_uInt16 n, nCntEnd, nBoxChkStt, nBoxChkEnd, nDelWidth = 0;
if( rParam.bLeft )
{
n = rBoxes.Count();
nCntEnd = 0;
- nBoxChkStt = (USHORT)rParam.nSide;
- nBoxChkEnd = static_cast<USHORT>(rParam.nSide + rParam.nBoxWidth);
+ nBoxChkStt = (sal_uInt16)rParam.nSide;
+ nBoxChkEnd = static_cast<sal_uInt16>(rParam.nSide + rParam.nBoxWidth);
}
else
{
n = 0;
nCntEnd = rBoxes.Count();
- nBoxChkStt = static_cast<USHORT>(rParam.nSide - rParam.nBoxWidth);
- nBoxChkEnd = (USHORT)rParam.nSide;
+ nBoxChkStt = static_cast<sal_uInt16>(rParam.nSide - rParam.nBoxWidth);
+ nBoxChkEnd = (sal_uInt16)rParam.nSide;
}
@@ -3231,13 +3241,13 @@ BOOL lcl_DelSelBox( SwTableLine* pTabLine, CR_SetBoxWidth& rParam,
SwFrmFmt* pFmt = pBox->GetFrmFmt();
const SwFmtFrmSize& rSz = pFmt->GetFrmSize();
long nWidth = rSz.GetWidth();
- BOOL bDelBox = FALSE, bChgLowers = FALSE;
+ sal_Bool bDelBox = sal_False, bChgLowers = sal_False;
// die Boxenbreite testen und entpsrechend reagieren
SwComparePosition ePosType = ::_CheckBoxInRange(
nBoxChkStt, nBoxChkEnd,
- USHORT(rParam.bLeft ? nDist - nWidth : nDist),
- USHORT(rParam.bLeft ? nDist : nDist + nWidth));
+ sal_uInt16(rParam.bLeft ? nDist - nWidth : nDist),
+ sal_uInt16(rParam.bLeft ? nDist : nDist + nWidth));
switch( ePosType )
{
@@ -3245,7 +3255,7 @@ BOOL lcl_DelSelBox( SwTableLine* pTabLine, CR_SetBoxWidth& rParam,
if( bCheck )
{
if( rParam.bLeft )
- return TRUE;
+ return sal_True;
}
else if( rParam.bLeft )
{
@@ -3259,7 +3269,7 @@ BOOL lcl_DelSelBox( SwTableLine* pTabLine, CR_SetBoxWidth& rParam,
if( bCheck )
{
if( !rParam.bLeft )
- return TRUE;
+ return sal_True;
}
else if( !rParam.bLeft )
{
@@ -3272,7 +3282,7 @@ BOOL lcl_DelSelBox( SwTableLine* pTabLine, CR_SetBoxWidth& rParam,
case POS_OUTSIDE: // Box ueberlappt Start/End vollstaendig
case POS_INSIDE: // Box liegt vollstaendig in Start/End
case POS_EQUAL: // Box und Start/End sind gleich
- bDelBox = TRUE;
+ bDelBox = sal_True;
break;
case POS_OVERLAP_BEFORE: // Box ueberlappt den Start
@@ -3280,14 +3290,14 @@ BOOL lcl_DelSelBox( SwTableLine* pTabLine, CR_SetBoxWidth& rParam,
: nWidth / 2 )))
{
if( !pBox->GetSttNd() )
- bChgLowers = TRUE;
+ bChgLowers = sal_True;
else
- bDelBox = TRUE;
+ bDelBox = sal_True;
}
else if( !bCheck && rParam.bLeft )
{
if( !pBox->GetSttNd() )
- bChgLowers = TRUE;
+ bChgLowers = sal_True;
else
{
::lcl_ChgBoxSize( *pBox, rParam, rSz, nDelWidth, nDist );
@@ -3302,16 +3312,16 @@ BOOL lcl_DelSelBox( SwTableLine* pTabLine, CR_SetBoxWidth& rParam,
// generell loeschen oder wie beim OVERLAP_Before nur die, die
// bis zur Haelfte in die "Loesch-"Box reicht ???
if( !pBox->GetSttNd() )
- bChgLowers = TRUE;
+ bChgLowers = sal_True;
else
- bDelBox = TRUE;
+ bDelBox = sal_True;
break;
default: break;
}
if( bDelBox )
{
- nDelWidth = nDelWidth + USHORT(nWidth);
+ nDelWidth = nDelWidth + sal_uInt16(nWidth);
if( bCheck )
{
// die letzte/erste Box kann nur bei Tbl-Var geloescht werden,
@@ -3322,10 +3332,10 @@ BOOL lcl_DelSelBox( SwTableLine* pTabLine, CR_SetBoxWidth& rParam,
? nWidth - nDist
: (nDist + nWidth - rParam.nTblWidth )))
|| !::lcl_DeleteBox_Rekursiv( rParam, *pBox, bCheck ) )
- return FALSE;
+ return sal_False;
if( pFmt->GetProtect().IsCntntProtected() )
- return FALSE;
+ return sal_False;
}
else
{
@@ -3337,11 +3347,11 @@ BOOL lcl_DelSelBox( SwTableLine* pTabLine, CR_SetBoxWidth& rParam,
}
else if( bChgLowers )
{
- BOOL bFirst = TRUE, bCorrLowers = FALSE;
+ sal_Bool bFirst = sal_True, bCorrLowers = sal_False;
long nLowerDiff = 0;
long nOldLower = rParam.nLowerDiff;
- USHORT nOldRemain = rParam.nRemainWidth;
- USHORT i;
+ sal_uInt16 nOldRemain = rParam.nRemainWidth;
+ sal_uInt16 i;
for( i = pBox->GetTabLines().Count(); i; )
{
@@ -3349,7 +3359,7 @@ BOOL lcl_DelSelBox( SwTableLine* pTabLine, CR_SetBoxWidth& rParam,
rParam.nRemainWidth = nOldRemain;
SwTableLine* pLine = pBox->GetTabLines()[ --i ];
if( !::lcl_DelSelBox( pLine, rParam, nDist, bCheck ))
- return FALSE;
+ return sal_False;
// gibt es die Box und die darin enthaltenen Lines noch??
if( n < rBoxes.Count() &&
@@ -3359,14 +3369,14 @@ BOOL lcl_DelSelBox( SwTableLine* pTabLine, CR_SetBoxWidth& rParam,
{
if( !bFirst && !bCorrLowers &&
COLFUZZY < Abs( nLowerDiff - rParam.nLowerDiff ) )
- bCorrLowers = TRUE;
+ bCorrLowers = sal_True;
// die groesste "loesch" Breite entscheidet, aber nur wenn
// nicht die gesamte Line geloescht wurde
if( nLowerDiff < rParam.nLowerDiff )
nLowerDiff = rParam.nLowerDiff;
- bFirst = FALSE;
+ bFirst = sal_False;
}
}
rParam.nLowerDiff = nOldLower;
@@ -3378,7 +3388,7 @@ BOOL lcl_DelSelBox( SwTableLine* pTabLine, CR_SetBoxWidth& rParam,
nLowerDiff = nWidth;
// DelBreite anpassen!!
- nDelWidth = nDelWidth + USHORT(nLowerDiff);
+ nDelWidth = nDelWidth + sal_uInt16(nLowerDiff);
if( !bCheck )
{
@@ -3394,7 +3404,7 @@ BOOL lcl_DelSelBox( SwTableLine* pTabLine, CR_SetBoxWidth& rParam,
{
// sonst muss die Groesse der Box angepasst werden
SwFmtFrmSize aNew( rSz );
- BOOL bCorrRel = FALSE;
+ sal_Bool bCorrRel = sal_False;
if( TBLVAR_CHGABS != rParam.nMode )
{
@@ -3406,7 +3416,7 @@ BOOL lcl_DelSelBox( SwTableLine* pTabLine, CR_SetBoxWidth& rParam,
else if( rParam.bLeft ) // TBLFIX_CHGABS
{
nLowerDiff = nLowerDiff - nDelWidth;
- bCorrLowers = TRUE;
+ bCorrLowers = sal_True;
n = nCntEnd;
}
break;
@@ -3417,7 +3427,7 @@ BOOL lcl_DelSelBox( SwTableLine* pTabLine, CR_SetBoxWidth& rParam,
else if( !rParam.bLeft ) // TBLFIX_CHGABS
{
nLowerDiff = nLowerDiff - nDelWidth;
- bCorrLowers = TRUE;
+ bCorrLowers = sal_True;
n = nCntEnd;
}
break;
@@ -3434,9 +3444,9 @@ BOOL lcl_DelSelBox( SwTableLine* pTabLine, CR_SetBoxWidth& rParam,
{
// dann kurz berechnen:
if( rParam.bLeft )
- rParam.nRemainWidth = USHORT(nDist - nLowerDiff);
+ rParam.nRemainWidth = sal_uInt16(nDist - nLowerDiff);
else
- rParam.nRemainWidth = USHORT(rParam.nTblWidth - nDist
+ rParam.nRemainWidth = sal_uInt16(rParam.nTblWidth - nDist
- nLowerDiff );
}
@@ -3467,13 +3477,13 @@ BOOL lcl_DelSelBox( SwTableLine* pTabLine, CR_SetBoxWidth& rParam,
nDist += nWidth;
}
rParam.nLowerDiff = nDelWidth;
- return TRUE;
+ return sal_True;
}
// Dummy Funktion fuer die Methode SetColWidth
-BOOL lcl_DelOtherBox( SwTableLine* , CR_SetBoxWidth& , SwTwips , BOOL )
+sal_Bool lcl_DelOtherBox( SwTableLine* , CR_SetBoxWidth& , SwTwips , sal_Bool )
{
- return TRUE;
+ return sal_True;
}
/* */
@@ -3481,7 +3491,7 @@ BOOL lcl_DelOtherBox( SwTableLine* , CR_SetBoxWidth& , SwTwips , BOOL )
void lcl_AjustLines( SwTableLine* pLine, CR_SetBoxWidth& rParam )
{
SwTableBoxes& rBoxes = pLine->GetTabBoxes();
- for( USHORT n = 0; n < rBoxes.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rBoxes.Count(); ++n )
{
SwTableBox* pBox = rBoxes[ n ];
@@ -3492,7 +3502,7 @@ void lcl_AjustLines( SwTableLine* pLine, CR_SetBoxWidth& rParam )
aSz.SetWidth( nWidth );
rParam.aShareFmts.SetSize( *pBox, aSz );
- for( USHORT i = 0; i < pBox->GetTabLines().Count(); ++i )
+ for( sal_uInt16 i = 0; i < pBox->GetTabLines().Count(); ++i )
::lcl_AjustLines( pBox->GetTabLines()[ i ], rParam );
}
}
@@ -3505,13 +3515,13 @@ void _CheckBoxWidth( const SwTableLine& rLine, SwTwips nSize )
SwTwips nAktSize = 0;
// checke doch mal ob die Tabellen korrekte Breiten haben
- for( USHORT n = 0; n < rBoxes.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rBoxes.Count(); ++n )
{
const SwTableBox* pBox = rBoxes[ n ];
const SwTwips nBoxW = pBox->GetFrmFmt()->GetFrmSize().GetWidth();
nAktSize += nBoxW;
- for( USHORT i = 0; i < pBox->GetTabLines().Count(); ++i )
+ for( sal_uInt16 i = 0; i < pBox->GetTabLines().Count(); ++i )
_CheckBoxWidth( *pBox->GetTabLines()[ i ], nBoxW );
}
@@ -3536,11 +3546,11 @@ _FndBox* lcl_SaveInsDelData( CR_SetBoxWidth& rParam, SwUndo** ppUndo,
{
// erstmal die Boxen besorgen !
if( rParam.bBigger )
- for( USHORT n = 0; n < rTbl.GetTabLines().Count(); ++n )
- ::lcl_DelSelBox( rTbl.GetTabLines()[ n ], rParam, nDistStt, TRUE );
+ for( sal_uInt16 n = 0; n < rTbl.GetTabLines().Count(); ++n )
+ ::lcl_DelSelBox( rTbl.GetTabLines()[ n ], rParam, nDistStt, sal_True );
else
- for( USHORT n = 0; n < rTbl.GetTabLines().Count(); ++n )
- ::lcl_InsSelBox( rTbl.GetTabLines()[ n ], rParam, nDistStt, TRUE );
+ for( sal_uInt16 n = 0; n < rTbl.GetTabLines().Count(); ++n )
+ ::lcl_InsSelBox( rTbl.GetTabLines()[ n ], rParam, nDistStt, sal_True );
}
// loeschen der gesamten Tabelle verhindern
@@ -3572,7 +3582,7 @@ _FndBox* lcl_SaveInsDelData( CR_SetBoxWidth& rParam, SwUndo** ppUndo,
return pFndBox;
}
-BOOL SwTable::SetColWidth( SwTableBox& rAktBox, USHORT eType,
+sal_Bool SwTable::SetColWidth( SwTableBox& rAktBox, sal_uInt16 eType,
SwTwips nAbsDiff, SwTwips nRelDiff, SwUndo** ppUndo )
{
SetHTMLTableLayout( 0 ); // MIB 9.7.97: HTML-Layout loeschen
@@ -3582,13 +3592,13 @@ BOOL SwTable::SetColWidth( SwTableBox& rAktBox, USHORT eType,
_FndBox* pFndBox = 0; // fuers Einfuegen/Loeschen
SwTableSortBoxes aTmpLst( 0, 5 ); // fuers Undo
- BOOL bBigger,
- bRet = FALSE,
+ sal_Bool bBigger,
+ bRet = sal_False,
bLeft = nsTblChgWidthHeightType::WH_COL_LEFT == ( eType & 0xff ) ||
nsTblChgWidthHeightType::WH_CELL_LEFT == ( eType & 0xff ),
bInsDel = 0 != (eType & nsTblChgWidthHeightType::WH_FLAG_INSDEL );
- USHORT n;
- ULONG nBoxIdx = rAktBox.GetSttIdx();
+ sal_uInt16 n;
+ sal_uLong nBoxIdx = rAktBox.GetSttIdx();
// bestimme die akt. Kante der Box
// wird nur fuer die Breitenmanipulation benoetigt!
@@ -3606,7 +3616,7 @@ BOOL SwTable::SetColWidth( SwTableBox& rAktBox, USHORT eType,
{
fnSelBox = lcl_DelSelBox;
fnOtherBox = lcl_DelOtherBox;
- aParam.nBoxWidth = (USHORT)rAktBox.GetFrmFmt()->GetFrmSize().GetWidth();
+ aParam.nBoxWidth = (sal_uInt16)rAktBox.GetFrmFmt()->GetFrmSize().GetWidth();
if( bLeft )
nDistStt = rSz.GetWidth();
}
@@ -3633,7 +3643,7 @@ BOOL SwTable::SetColWidth( SwTableBox& rAktBox, USHORT eType,
bBigger = !bBigger;
// erstmal testen, ob ueberhaupt Platz ist
- BOOL bChgLRSpace = TRUE;
+ sal_Bool bChgLRSpace = sal_True;
if( bBigger )
{
if( GetFrmFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) &&
@@ -3652,7 +3662,7 @@ BOOL SwTable::SetColWidth( SwTableBox& rAktBox, USHORT eType,
( bLeft ? rLR.GetRight() >= nAbsDiff
: rLR.GetLeft() >= nAbsDiff ))
{
- bRet = TRUE; bLeft = !bLeft;
+ bRet = sal_True; bLeft = !bLeft;
}
if( !bRet )
@@ -3670,13 +3680,13 @@ BOOL SwTable::SetColWidth( SwTableBox& rAktBox, USHORT eType,
}
else
{
- bRet = TRUE;
+ bRet = sal_True;
for( n = 0; n < aLines.Count(); ++n )
{
aParam.LoopClear();
- if( !(*fnSelBox)( aLines[ n ], aParam, nDistStt, TRUE ))
+ if( !(*fnSelBox)( aLines[ n ], aParam, nDistStt, sal_True ))
{
- bRet = FALSE;
+ bRet = sal_False;
break;
}
}
@@ -3693,7 +3703,7 @@ BOOL SwTable::SetColWidth( SwTableBox& rAktBox, USHORT eType,
{
// dies gesamte Tabelle soll geloescht werden!!
GetFrmFmt()->GetDoc()->DeleteRowCol( aParam.aBoxes );
- return FALSE;
+ return sal_False;
}
if( ppUndo )
@@ -3702,7 +3712,7 @@ BOOL SwTable::SetColWidth( SwTableBox& rAktBox, USHORT eType,
: UNDO_TABLE_INSCOL );
}
else if( ppUndo )
- *ppUndo = new SwUndoAttrTbl( *aParam.pTblNd, TRUE );
+ *ppUndo = new SwUndoAttrTbl( *aParam.pTblNd, sal_True );
long nFrmWidth = LONG_MAX;
LockModify();
@@ -3717,7 +3727,7 @@ BOOL SwTable::SetColWidth( SwTableBox& rAktBox, USHORT eType,
// dann mal herunterbrechen auf USHRT_MAX / 2
CR_SetBoxWidth aTmpPara( 0, aSz.GetWidth() / 2,
0, aSz.GetWidth(), aSz.GetWidth(), aParam.pTblNd );
- for( USHORT nLn = 0; nLn < aLines.Count(); ++nLn )
+ for( sal_uInt16 nLn = 0; nLn < aLines.Count(); ++nLn )
::lcl_AjustLines( aLines[ nLn ], aTmpPara );
aSz.SetWidth( aSz.GetWidth() / 2 );
aParam.nDiff = nRelDiff /= 2;
@@ -3726,14 +3736,14 @@ BOOL SwTable::SetColWidth( SwTableBox& rAktBox, USHORT eType,
}
if( bLeft )
- aLR.SetLeft( USHORT( aLR.GetLeft() - nAbsDiff ) );
+ aLR.SetLeft( sal_uInt16( aLR.GetLeft() - nAbsDiff ) );
else
- aLR.SetRight( USHORT( aLR.GetRight() - nAbsDiff ) );
+ aLR.SetRight( sal_uInt16( aLR.GetRight() - nAbsDiff ) );
}
else if( bLeft )
- aLR.SetLeft( USHORT( aLR.GetLeft() + nAbsDiff ) );
+ aLR.SetLeft( sal_uInt16( aLR.GetLeft() + nAbsDiff ) );
else
- aLR.SetRight( USHORT( aLR.GetRight() + nAbsDiff ) );
+ aLR.SetRight( sal_uInt16( aLR.GetRight() + nAbsDiff ) );
if( bChgLRSpace )
GetFrmFmt()->SetFmtAttr( aLR );
@@ -3771,11 +3781,11 @@ BOOL SwTable::SetColWidth( SwTableBox& rAktBox, USHORT eType,
aSz.SetWidth( aSz.GetWidth() - nRelDiff );
if( rSz.GetWidthPercent() )
- aSz.SetWidthPercent( static_cast<BYTE>(( aSz.GetWidth() * 100 ) /
+ aSz.SetWidthPercent( static_cast<sal_uInt8>(( aSz.GetWidth() * 100 ) /
( aSz.GetWidth() + aLR.GetRight() + aLR.GetLeft())));
GetFrmFmt()->SetFmtAttr( aSz );
- aParam.nTblWidth = USHORT( aSz.GetWidth() );
+ aParam.nTblWidth = sal_uInt16( aSz.GetWidth() );
UnlockModify();
@@ -3783,7 +3793,7 @@ BOOL SwTable::SetColWidth( SwTableBox& rAktBox, USHORT eType,
{
--n;
aParam.LoopClear();
- (*fnSelBox)( aLines[ n ], aParam, nDistStt, FALSE );
+ (*fnSelBox)( aLines[ n ], aParam, nDistStt, sal_False );
}
// sollte die Tabelle noch auf relativen Werten
@@ -3800,7 +3810,7 @@ BOOL SwTable::SetColWidth( SwTableBox& rAktBox, USHORT eType,
else if( bInsDel ||
( bLeft ? nDist : Abs( rSz.GetWidth() - nDist ) > COLFUZZY ) )
{
- bRet = TRUE;
+ bRet = sal_True;
if( bLeft && TBLFIX_CHGABS == eTblChgMode && !bInsDel )
aParam.bBigger = !bBigger;
@@ -3812,9 +3822,9 @@ BOOL SwTable::SetColWidth( SwTableBox& rAktBox, USHORT eType,
for( n = 0; n < aLines.Count(); ++n )
{
aParam.LoopClear();
- if( !(*fnSelBox)( aLines[ n ], aParam, nDistStt, TRUE ))
+ if( !(*fnSelBox)( aLines[ n ], aParam, nDistStt, sal_True ))
{
- bRet = FALSE;
+ bRet = sal_False;
break;
}
}
@@ -3827,14 +3837,14 @@ BOOL SwTable::SetColWidth( SwTableBox& rAktBox, USHORT eType,
for( n = 0; n < aLines.Count(); ++n )
{
aParam.LoopClear();
- if( !(*fnOtherBox)( aLines[ n ], aParam, 0, TRUE ))
+ if( !(*fnOtherBox)( aLines[ n ], aParam, 0, sal_True ))
{
- bRet = FALSE;
+ bRet = sal_False;
break;
}
}
if( bRet && !aParam.bAnyBoxFnd )
- bRet = FALSE;
+ bRet = sal_False;
}
if( !bRet && rAktBox.GetFrmFmt()->GetFrmSize().GetWidth()
@@ -3842,16 +3852,16 @@ BOOL SwTable::SetColWidth( SwTableBox& rAktBox, USHORT eType,
( 567 / 2 /* min. 0,5 cm Platz lassen*/) )
{
// dann den Platz von der akt. Zelle nehmen
- aParam.bSplittBox = TRUE;
+ aParam.bSplittBox = sal_True;
// aber das muss auch mal getestet werden!
- bRet = TRUE;
+ bRet = sal_True;
for( n = 0; n < aLines.Count(); ++n )
{
aParam.LoopClear();
- if( !(*fnSelBox)( aLines[ n ], aParam, nDistStt, TRUE ))
+ if( !(*fnSelBox)( aLines[ n ], aParam, nDistStt, sal_True ))
{
- bRet = FALSE;
+ bRet = sal_False;
break;
}
}
@@ -3863,9 +3873,9 @@ BOOL SwTable::SetColWidth( SwTableBox& rAktBox, USHORT eType,
for( n = 0; n < aLines.Count(); ++n )
{
aParam.LoopClear();
- if( !(*fnOtherBox)( aLines[ n ], aParam, 0, TRUE ))
+ if( !(*fnOtherBox)( aLines[ n ], aParam, 0, sal_True ))
{
- bRet = FALSE;
+ bRet = sal_False;
break;
}
}
@@ -3875,9 +3885,9 @@ BOOL SwTable::SetColWidth( SwTableBox& rAktBox, USHORT eType,
for( n = 0; n < aLines.Count(); ++n )
{
aParam.LoopClear();
- if( !(*fnSelBox)( aLines[ n ], aParam, nDistStt, TRUE ))
+ if( !(*fnSelBox)( aLines[ n ], aParam, nDistStt, sal_True ))
{
- bRet = FALSE;
+ bRet = sal_False;
break;
}
}
@@ -3898,7 +3908,7 @@ BOOL SwTable::SetColWidth( SwTableBox& rAktBox, USHORT eType,
: UNDO_TABLE_INSCOL );
}
else if( ppUndo )
- *ppUndo = new SwUndoAttrTbl( *aParam.pTblNd, TRUE );
+ *ppUndo = new SwUndoAttrTbl( *aParam.pTblNd, sal_True );
if( bInsDel
? ( TBLFIX_CHGABS == eTblChgMode ? bLeft : bLeft )
@@ -3909,8 +3919,8 @@ BOOL SwTable::SetColWidth( SwTableBox& rAktBox, USHORT eType,
--n;
aParam.LoopClear();
aParam1.LoopClear();
- (*fnSelBox)( aLines[ n ], aParam, nDistStt, FALSE );
- (*fnOtherBox)( aLines[ n ], aParam1, nDistStt, FALSE );
+ (*fnSelBox)( aLines[ n ], aParam, nDistStt, sal_False );
+ (*fnOtherBox)( aLines[ n ], aParam1, nDistStt, sal_False );
}
}
else
@@ -3919,8 +3929,8 @@ BOOL SwTable::SetColWidth( SwTableBox& rAktBox, USHORT eType,
--n;
aParam.LoopClear();
aParam1.LoopClear();
- (*fnOtherBox)( aLines[ n ], aParam1, nDistStt, FALSE );
- (*fnSelBox)( aLines[ n ], aParam, nDistStt, FALSE );
+ (*fnOtherBox)( aLines[ n ], aParam1, nDistStt, sal_False );
+ (*fnSelBox)( aLines[ n ], aParam, nDistStt, sal_False );
}
}
}
@@ -3951,7 +3961,7 @@ BOOL SwTable::SetColWidth( SwTableBox& rAktBox, USHORT eType,
SwTableLine* pLine = rAktBox.GetUpper();
while( pLine->GetUpper() )
{
- USHORT nPos = pLine->GetTabBoxes().C40_GETPOS( SwTableBox, pBox );
+ sal_uInt16 nPos = pLine->GetTabBoxes().C40_GETPOS( SwTableBox, pBox );
if( bLeft ? nPos : nPos + 1 != pLine->GetTabBoxes().Count() )
break;
@@ -3962,7 +3972,7 @@ BOOL SwTable::SetColWidth( SwTableBox& rAktBox, USHORT eType,
if( pLine->GetUpper() )
{
// dann muss die Distanz wieder korriegiert werden!
- aParam.nSide -= ::lcl_GetDistance( pLine->GetUpper(), TRUE );
+ aParam.nSide -= ::lcl_GetDistance( pLine->GetUpper(), sal_True );
if( bLeft )
aParam.nMaxSize = aParam.nSide;
@@ -3978,9 +3988,9 @@ BOOL SwTable::SetColWidth( SwTableBox& rAktBox, USHORT eType,
: ( rSz.GetWidth() - nDist ) > COLFUZZY ) &&
!aParam.bBigger )
{
- bRet = (*fnOtherBox)( pLine, aParam, 0, TRUE );
+ bRet = (*fnOtherBox)( pLine, aParam, 0, sal_True );
if( bRet && !aParam.bAnyBoxFnd )
- bRet = FALSE;
+ bRet = sal_False;
}
if( !bRet && !aParam.bBigger && rAktBox.GetFrmFmt()->
@@ -3988,14 +3998,14 @@ BOOL SwTable::SetColWidth( SwTableBox& rAktBox, USHORT eType,
( 567 / 2 /* min. 0,5 cm Platz lassen*/) )
{
// dann den Platz von der akt. Zelle nehmen
- aParam.bSplittBox = TRUE;
- bRet = TRUE;
+ aParam.bSplittBox = sal_True;
+ bRet = sal_True;
}
}
else
{
FN_lcl_SetBoxWidth fnTmp = aParam.bBigger ? fnOtherBox : fnSelBox;
- bRet = (*fnTmp)( pLine, aParam, nDistStt, TRUE );
+ bRet = (*fnTmp)( pLine, aParam, nDistStt, sal_True );
}
// wenn ja, dann setzen
@@ -4012,19 +4022,19 @@ BOOL SwTable::SetColWidth( SwTableBox& rAktBox, USHORT eType,
: UNDO_TABLE_INSCOL );
}
else if( ppUndo )
- *ppUndo = new SwUndoAttrTbl( *aParam.pTblNd, TRUE );
+ *ppUndo = new SwUndoAttrTbl( *aParam.pTblNd, sal_True );
if( bInsDel
? ( TBLFIX_CHGABS == eTblChgMode ? (bBigger && bLeft) : bLeft )
: ( TBLFIX_CHGABS != eTblChgMode && bLeft ) )
{
- (*fnSelBox)( pLine, aParam, nDistStt, FALSE );
- (*fnOtherBox)( pLine, aParam1, nDistStt, FALSE );
+ (*fnSelBox)( pLine, aParam, nDistStt, sal_False );
+ (*fnOtherBox)( pLine, aParam1, nDistStt, sal_False );
}
else
{
- (*fnOtherBox)( pLine, aParam1, nDistStt, FALSE );
- (*fnSelBox)( pLine, aParam, nDistStt, FALSE );
+ (*fnOtherBox)( pLine, aParam1, nDistStt, sal_False );
+ (*fnSelBox)( pLine, aParam, nDistStt, sal_False );
}
}
}
@@ -4049,7 +4059,7 @@ BOOL SwTable::SetColWidth( SwTableBox& rAktBox, USHORT eType,
if( ppUndo && *ppUndo )
{
- aParam.pUndo->SetColWidthParam( nBoxIdx, static_cast<USHORT>(eTblChgMode), eType,
+ aParam.pUndo->SetColWidthParam( nBoxIdx, static_cast<sal_uInt16>(eTblChgMode), eType,
nAbsDiff, nRelDiff );
if( !aParam.bBigger )
aParam.pUndo->SaveNewBoxes( *aParam.pTblNd, aTmpLst );
@@ -4102,7 +4112,7 @@ _FndBox* lcl_SaveInsDelData( CR_SetLineHeight& rParam, SwUndo** ppUndo,
}
void SetLineHeight( SwTableLine& rLine, SwTwips nOldHeight, SwTwips nNewHeight,
- BOOL bMinSize )
+ sal_Bool bMinSize )
{
SwLayoutFrm* pLineFrm = GetRowFrm( rLine );
ASSERT( pLineFrm, "wo ist der Frm von der SwTableLine?" );
@@ -4130,18 +4140,18 @@ void SetLineHeight( SwTableLine& rLine, SwTwips nOldHeight, SwTwips nNewHeight,
// erst alle inneren anpassen
SwTableBoxes& rBoxes = rLine.GetTabBoxes();
- for( USHORT n = 0; n < rBoxes.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rBoxes.Count(); ++n )
{
SwTableBox& rBox = *rBoxes[ n ];
- for( USHORT i = 0; i < rBox.GetTabLines().Count(); ++i )
+ for( sal_uInt16 i = 0; i < rBox.GetTabLines().Count(); ++i )
SetLineHeight( *rBox.GetTabLines()[ i ], nMyOldH, nMyNewH, bMinSize );
}
}
-BOOL lcl_SetSelLineHeight( SwTableLine* pLine, CR_SetLineHeight& rParam,
- SwTwips nDist, BOOL bCheck )
+sal_Bool lcl_SetSelLineHeight( SwTableLine* pLine, CR_SetLineHeight& rParam,
+ SwTwips nDist, sal_Bool bCheck )
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
if( !bCheck )
{
// Zeilenhoehe einstellen
@@ -4155,15 +4165,15 @@ BOOL lcl_SetSelLineHeight( SwTableLine* pLine, CR_SetLineHeight& rParam,
ASSERT( pLineFrm, "wo ist der Frm von der SwTableLine?" );
SwTwips nRstHeight = CalcRowRstHeight( pLineFrm );
if( (nRstHeight + ROWFUZZY) < nDist )
- bRet = FALSE;
+ bRet = sal_False;
}
return bRet;
}
-BOOL lcl_SetOtherLineHeight( SwTableLine* pLine, CR_SetLineHeight& rParam,
- SwTwips nDist, BOOL bCheck )
+sal_Bool lcl_SetOtherLineHeight( SwTableLine* pLine, CR_SetLineHeight& rParam,
+ SwTwips nDist, sal_Bool bCheck )
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
if( bCheck )
{
if( rParam.bBigger )
@@ -4210,17 +4220,17 @@ BOOL lcl_SetOtherLineHeight( SwTableLine* pLine, CR_SetLineHeight& rParam,
return bRet;
}
-BOOL lcl_InsDelSelLine( SwTableLine* pLine, CR_SetLineHeight& rParam,
- SwTwips nDist, BOOL bCheck )
+sal_Bool lcl_InsDelSelLine( SwTableLine* pLine, CR_SetLineHeight& rParam,
+ SwTwips nDist, sal_Bool bCheck )
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
if( !bCheck )
{
SwTableBoxes& rBoxes = pLine->GetTabBoxes();
SwDoc* pDoc = pLine->GetFrmFmt()->GetDoc();
if( !rParam.bBigger )
{
- USHORT n;
+ sal_uInt16 n;
for( n = rBoxes.Count(); n; )
::lcl_SaveUpperLowerBorder( rParam.pTblNd->GetTable(),
@@ -4228,8 +4238,8 @@ BOOL lcl_InsDelSelLine( SwTableLine* pLine, CR_SetLineHeight& rParam,
rParam.aShareFmts );
for( n = rBoxes.Count(); n; )
::_DeleteBox( rParam.pTblNd->GetTable(),
- rBoxes[ --n ], rParam.pUndo, FALSE,
- FALSE, &rParam.aShareFmts );
+ rBoxes[ --n ], rParam.pUndo, sal_False,
+ sal_False, &rParam.aShareFmts );
}
else
{
@@ -4241,7 +4251,7 @@ BOOL lcl_InsDelSelLine( SwTableLine* pLine, CR_SetLineHeight& rParam,
pLines = &pLine->GetUpper()->GetTabLines();
else
pLines = &rParam.pTblNd->GetTable().GetTabLines();
- USHORT nPos = pLines->C40_GETPOS( SwTableLine, pLine );
+ sal_uInt16 nPos = pLines->C40_GETPOS( SwTableLine, pLine );
if( !rParam.bTop )
++nPos;
pLines->C40_INSERT( SwTableLine, pNewLine, nPos );
@@ -4251,7 +4261,7 @@ BOOL lcl_InsDelSelLine( SwTableLine* pLine, CR_SetLineHeight& rParam,
// und noch mal die Anzahl Boxen erzeugen
SwTableBoxes& rNewBoxes = pNewLine->GetTabBoxes();
- for( USHORT n = 0; n < rBoxes.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rBoxes.Count(); ++n )
{
SwTwips nWidth = 0;
SwTableBox* pOld = rBoxes[ n ];
@@ -4288,26 +4298,26 @@ BOOL lcl_InsDelSelLine( SwTableLine* pLine, CR_SetLineHeight& rParam,
{
// Boxen einsammeln!
SwTableBoxes& rBoxes = pLine->GetTabBoxes();
- for( USHORT n = rBoxes.Count(); n; )
+ for( sal_uInt16 n = rBoxes.Count(); n; )
{
SwTableBox* pBox = rBoxes[ --n ];
if( pBox->GetFrmFmt()->GetProtect().IsCntntProtected() )
- return FALSE;
+ return sal_False;
if( pBox->GetSttNd() )
rParam.aBoxes.Insert( pBox );
else
{
- for( USHORT i = pBox->GetTabLines().Count(); i; )
+ for( sal_uInt16 i = pBox->GetTabLines().Count(); i; )
lcl_InsDelSelLine( pBox->GetTabLines()[ --i ],
- rParam, 0, TRUE );
+ rParam, 0, sal_True );
}
}
}
return bRet;
}
-BOOL SwTable::SetRowHeight( SwTableBox& rAktBox, USHORT eType,
+sal_Bool SwTable::SetRowHeight( SwTableBox& rAktBox, sal_uInt16 eType,
SwTwips nAbsDiff, SwTwips nRelDiff,SwUndo** ppUndo )
{
SwTableLine* pLine = rAktBox.GetUpper();
@@ -4318,13 +4328,13 @@ BOOL SwTable::SetRowHeight( SwTableBox& rAktBox, USHORT eType,
_FndBox* pFndBox = 0; // fuers Einfuegen/Loeschen
SwTableSortBoxes aTmpLst( 0, 5 ); // fuers Undo
- BOOL bBigger,
- bRet = FALSE,
+ sal_Bool bBigger,
+ bRet = sal_False,
bTop = nsTblChgWidthHeightType::WH_ROW_TOP == ( eType & 0xff ) ||
nsTblChgWidthHeightType::WH_CELL_TOP == ( eType & 0xff ),
bInsDel = 0 != (eType & nsTblChgWidthHeightType::WH_FLAG_INSDEL );
- USHORT n, nBaseLinePos = GetTabLines().C40_GETPOS( SwTableLine, pBaseLine );
- ULONG nBoxIdx = rAktBox.GetSttIdx();
+ sal_uInt16 n, nBaseLinePos = GetTabLines().C40_GETPOS( SwTableLine, pBaseLine );
+ sal_uLong nBoxIdx = rAktBox.GetSttIdx();
CR_SetLineHeight aParam( eType,
(SwTableNode*)rAktBox.GetSttNd()->FindTableNode() );
@@ -4365,7 +4375,7 @@ BOOL SwTable::SetRowHeight( SwTableBox& rAktBox, USHORT eType,
// erstmal testen, ob ueberhaupt Platz ist
if( bBigger )
{
- bRet = TRUE;
+ bRet = sal_True;
// was ist mit Top, was ist mit Tabelle im Rahmen oder in Kopf-/Fusszeile
// mit fester Hoehe ??
if( !bRet )
@@ -4384,7 +4394,7 @@ BOOL SwTable::SetRowHeight( SwTableBox& rAktBox, USHORT eType,
}
else
bRet = (*fnSelLine)( (*pLines)[ nBaseLinePos ], aParam,
- nAbsDiff, TRUE );
+ nAbsDiff, sal_True );
if( bRet )
{
@@ -4392,7 +4402,7 @@ BOOL SwTable::SetRowHeight( SwTableBox& rAktBox, USHORT eType,
{
if( !aParam.aBoxes.Count() )
::lcl_InsDelSelLine( (*pLines)[ nBaseLinePos ],
- aParam, 0, TRUE );
+ aParam, 0, sal_True );
pFndBox = ::lcl_SaveInsDelData( aParam, ppUndo, aTmpLst );
@@ -4402,7 +4412,7 @@ BOOL SwTable::SetRowHeight( SwTableBox& rAktBox, USHORT eType,
aParam.aBoxes.Count() == aSortCntBoxes.Count() )
{
GetFrmFmt()->GetDoc()->DeleteRowCol( aParam.aBoxes );
- return FALSE;
+ return sal_False;
}
@@ -4412,16 +4422,16 @@ BOOL SwTable::SetRowHeight( SwTableBox& rAktBox, USHORT eType,
: UNDO_ROW_DELETE );
}
else if( ppUndo )
- *ppUndo = new SwUndoAttrTbl( *aParam.pTblNd, TRUE );
+ *ppUndo = new SwUndoAttrTbl( *aParam.pTblNd, sal_True );
(*fnSelLine)( (*pLines)[ nBaseLinePos ], aParam,
- nAbsDiff, FALSE );
+ nAbsDiff, sal_False );
}
}
else
{
- bRet = TRUE;
- USHORT nStt, nEnd;
+ bRet = sal_True;
+ sal_uInt16 nStt, nEnd;
if( bTop )
nStt = 0, nEnd = nBaseLinePos;
else
@@ -4438,7 +4448,7 @@ BOOL SwTable::SetRowHeight( SwTableBox& rAktBox, USHORT eType,
aParam.nMaxHeight += pLineFrm->Frm().Height();
}
if( bBigger && aParam.nMaxSpace < nAbsDiff )
- bRet = FALSE;
+ bRet = sal_False;
}
else
{
@@ -4450,7 +4460,7 @@ BOOL SwTable::SetRowHeight( SwTableBox& rAktBox, USHORT eType,
nEnd = nStt + 1;
}
else
- bRet = FALSE;
+ bRet = sal_False;
}
if( bRet )
@@ -4460,16 +4470,16 @@ BOOL SwTable::SetRowHeight( SwTableBox& rAktBox, USHORT eType,
for( n = nStt; n < nEnd; ++n )
{
if( !(*fnOtherLine)( (*pLines)[ n ], aParam,
- nAbsDiff, TRUE ))
+ nAbsDiff, sal_True ))
{
- bRet = FALSE;
+ bRet = sal_False;
break;
}
}
}
else
bRet = (*fnSelLine)( (*pLines)[ nBaseLinePos ], aParam,
- nAbsDiff, TRUE );
+ nAbsDiff, sal_True );
}
if( bRet )
@@ -4479,7 +4489,7 @@ BOOL SwTable::SetRowHeight( SwTableBox& rAktBox, USHORT eType,
{
if( !aParam.aBoxes.Count() )
::lcl_InsDelSelLine( (*pLines)[ nBaseLinePos ],
- aParam, 0, TRUE );
+ aParam, 0, sal_True );
pFndBox = ::lcl_SaveInsDelData( aParam, ppUndo, aTmpLst );
if( ppUndo )
*ppUndo = aParam.CreateUndo(
@@ -4487,7 +4497,7 @@ BOOL SwTable::SetRowHeight( SwTableBox& rAktBox, USHORT eType,
: UNDO_ROW_DELETE );
}
else if( ppUndo )
- *ppUndo = new SwUndoAttrTbl( *aParam.pTblNd, TRUE );
+ *ppUndo = new SwUndoAttrTbl( *aParam.pTblNd, sal_True );
CR_SetLineHeight aParam1( aParam );
if( TBLFIX_CHGPROP == eTblChgMode && !bBigger &&
@@ -4502,18 +4512,18 @@ BOOL SwTable::SetRowHeight( SwTableBox& rAktBox, USHORT eType,
if( bTop )
{
(*fnSelLine)( (*pLines)[ nBaseLinePos ], aParam,
- nAbsDiff, FALSE );
+ nAbsDiff, sal_False );
for( n = nStt; n < nEnd; ++n )
(*fnOtherLine)( (*pLines)[ n ], aParam1,
- nAbsDiff, FALSE );
+ nAbsDiff, sal_False );
}
else
{
for( n = nStt; n < nEnd; ++n )
(*fnOtherLine)( (*pLines)[ n ], aParam1,
- nAbsDiff, FALSE );
+ nAbsDiff, sal_False );
(*fnSelLine)( (*pLines)[ nBaseLinePos ], aParam,
- nAbsDiff, FALSE );
+ nAbsDiff, sal_False );
}
}
else
@@ -4549,7 +4559,7 @@ BOOL SwTable::SetRowHeight( SwTableBox& rAktBox, USHORT eType,
if( ppUndo && *ppUndo )
{
- aParam.pUndo->SetColWidthParam( nBoxIdx, static_cast<USHORT>(eTblChgMode), eType,
+ aParam.pUndo->SetColWidthParam( nBoxIdx, static_cast<sal_uInt16>(eTblChgMode), eType,
nAbsDiff, nRelDiff );
if( bBigger )
aParam.pUndo->SaveNewBoxes( *aParam.pTblNd, aTmpLst );
@@ -4566,7 +4576,7 @@ BOOL SwTable::SetRowHeight( SwTableBox& rAktBox, USHORT eType,
SwFrmFmt* SwShareBoxFmt::GetFormat( long nWidth ) const
{
SwFrmFmt *pRet = 0, *pTmp;
- for( USHORT n = aNewFmts.Count(); n; )
+ for( sal_uInt16 n = aNewFmts.Count(); n; )
if( ( pTmp = (SwFrmFmt*)aNewFmts[ --n ])->GetFrmSize().GetWidth()
== nWidth )
{
@@ -4579,13 +4589,13 @@ SwFrmFmt* SwShareBoxFmt::GetFormat( long nWidth ) const
SwFrmFmt* SwShareBoxFmt::GetFormat( const SfxPoolItem& rItem ) const
{
const SfxPoolItem* pItem;
- USHORT nWhich = rItem.Which();
+ sal_uInt16 nWhich = rItem.Which();
SwFrmFmt *pRet = 0, *pTmp;
- const SfxPoolItem& rFrmSz = pOldFmt->GetFmtAttr( RES_FRM_SIZE, FALSE );
- for( USHORT n = aNewFmts.Count(); n; )
+ const SfxPoolItem& rFrmSz = pOldFmt->GetFmtAttr( RES_FRM_SIZE, sal_False );
+ for( sal_uInt16 n = aNewFmts.Count(); n; )
if( SFX_ITEM_SET == ( pTmp = (SwFrmFmt*)aNewFmts[ --n ])->
- GetItemState( nWhich, FALSE, &pItem ) && *pItem == rItem &&
- pTmp->GetFmtAttr( RES_FRM_SIZE, FALSE ) == rFrmSz )
+ GetItemState( nWhich, sal_False, &pItem ) && *pItem == rItem &&
+ pTmp->GetFmtAttr( RES_FRM_SIZE, sal_False ) == rFrmSz )
{
pRet = pTmp;
break;
@@ -4599,14 +4609,14 @@ void SwShareBoxFmt::AddFormat( const SwFrmFmt& rNew )
aNewFmts.Insert( pFmt, aNewFmts.Count() );
}
-BOOL SwShareBoxFmt::RemoveFormat( const SwFrmFmt& rFmt )
+sal_Bool SwShareBoxFmt::RemoveFormat( const SwFrmFmt& rFmt )
{
- // returnt TRUE, wenn geloescht werden kann
+ // returnt sal_True, wenn geloescht werden kann
if( pOldFmt == &rFmt )
- return TRUE;
+ return sal_True;
void* p = (void*)&rFmt;
- USHORT nFnd = aNewFmts.GetPos( p );
+ sal_uInt16 nFnd = aNewFmts.GetPos( p );
if( USHRT_MAX != nFnd )
aNewFmts.Remove( nFnd );
return 0 == aNewFmts.Count();
@@ -4618,7 +4628,7 @@ SwShareBoxFmts::~SwShareBoxFmts()
SwFrmFmt* SwShareBoxFmts::GetFormat( const SwFrmFmt& rFmt, long nWidth ) const
{
- USHORT nPos;
+ sal_uInt16 nPos;
return Seek_Entry( rFmt, &nPos )
? aShareArr[ nPos ]->GetFormat( nWidth )
: 0;
@@ -4626,7 +4636,7 @@ SwFrmFmt* SwShareBoxFmts::GetFormat( const SwFrmFmt& rFmt, long nWidth ) const
SwFrmFmt* SwShareBoxFmts::GetFormat( const SwFrmFmt& rFmt,
const SfxPoolItem& rItem ) const
{
- USHORT nPos;
+ sal_uInt16 nPos;
return Seek_Entry( rFmt, &nPos )
? aShareArr[ nPos ]->GetFormat( rItem )
: 0;
@@ -4639,7 +4649,7 @@ void SwShareBoxFmts::AddFormat( const SwFrmFmt& rOld, const SwFrmFmt& rNew )
//leider werden auch die CellFrms gefunden
// if( !rOld.IsLastDepend() )
{
- USHORT nPos;
+ sal_uInt16 nPos;
SwShareBoxFmt* pEntry;
if( !Seek_Entry( rOld, &nPos ))
{
@@ -4720,27 +4730,27 @@ void SwShareBoxFmts::SetAttr( SwTableLine& rLine, const SfxPoolItem& rItem )
void SwShareBoxFmts::RemoveFormat( const SwFrmFmt& rFmt )
{
- for( USHORT i = aShareArr.Count(); i; )
+ for( sal_uInt16 i = aShareArr.Count(); i; )
if( aShareArr[ --i ]->RemoveFormat( rFmt ))
aShareArr.DeleteAndDestroy( i );
}
-BOOL SwShareBoxFmts::Seek_Entry( const SwFrmFmt& rFmt, USHORT* pPos ) const
+sal_Bool SwShareBoxFmts::Seek_Entry( const SwFrmFmt& rFmt, sal_uInt16* pPos ) const
{
- ULONG nIdx = (ULONG)&rFmt;
- USHORT nO = aShareArr.Count(), nM, nU = 0;
+ sal_uLong nIdx = (sal_uLong)&rFmt;
+ sal_uInt16 nO = aShareArr.Count(), nM, nU = 0;
if( nO > 0 )
{
nO--;
while( nU <= nO )
{
nM = nU + ( nO - nU ) / 2;
- ULONG nFmt = (ULONG)&aShareArr[ nM ]->GetOldFormat();
+ sal_uLong nFmt = (sal_uLong)&aShareArr[ nM ]->GetOldFormat();
if( nFmt == nIdx )
{
if( pPos )
*pPos = nM;
- return TRUE;
+ return sal_True;
}
else if( nFmt < nIdx )
nU = nM + 1;
@@ -4748,7 +4758,7 @@ BOOL SwShareBoxFmts::Seek_Entry( const SwFrmFmt& rFmt, USHORT* pPos ) const
{
if( pPos )
*pPos = nU;
- return FALSE;
+ return sal_False;
}
else
nO = nM - 1;
@@ -4756,7 +4766,7 @@ BOOL SwShareBoxFmts::Seek_Entry( const SwFrmFmt& rFmt, USHORT* pPos ) const
}
if( pPos )
*pPos = nU;
- return FALSE;
+ return sal_False;
}
diff --git a/sw/source/core/doc/visiturl.cxx b/sw/source/core/doc/visiturl.cxx
index ef857f5e5c4b..01b4623fba96 100644
--- a/sw/source/core/doc/visiturl.cxx
+++ b/sw/source/core/doc/visiturl.cxx
@@ -67,7 +67,7 @@ void SwURLStateChanged::Notify( SfxBroadcaster& , const SfxHint& rHint )
sURL == pDoc->GetDocShell()->GetMedium()->GetName() )
(sBkmk = pIURL->GetMark()).Insert( INET_MARK_TOKEN, 0 );
- BOOL bAction = FALSE, bUnLockView = FALSE;
+ sal_Bool bAction = sal_False, bUnLockView = sal_False;
const SwFmtINetFmt* pItem;
const SwTxtINetFmt* pTxtAttr;
const SwTxtNode* pTxtNd;
@@ -83,9 +83,9 @@ void SwURLStateChanged::Notify( SfxBroadcaster& , const SfxHint& rHint )
if( !bAction && pESh )
{
pESh->StartAllAction();
- bAction = TRUE;
+ bAction = sal_True;
bUnLockView = !pESh->IsViewLocked();
- pESh->LockView( TRUE );
+ pESh->LockView( sal_True );
}
const_cast<SwTxtINetFmt*>(pTxtAttr)->SetVisitedValid( false );
const SwTxtAttr* pAttr = pTxtAttr;
@@ -98,20 +98,20 @@ void SwURLStateChanged::Notify( SfxBroadcaster& , const SfxHint& rHint )
if( bAction )
pESh->EndAllAction();
if( bUnLockView )
- pESh->LockView( FALSE );
+ pESh->LockView( sal_False );
}
}
// erfrage ob die URL besucht war. Uebers Doc, falls nur ein Bookmark
// angegeben ist. Dann muss der Doc. Name davor gesetzt werden!
-BOOL SwDoc::IsVisitedURL( const String& rURL ) const
+sal_Bool SwDoc::IsVisitedURL( const String& rURL ) const
{
#if OSL_DEBUG_LEVEL > 1
static long nTmp = 0;
++nTmp;
#endif
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( rURL.Len() )
{
INetURLHistory *pHist = INetURLHistory::GetOrCreate();
diff --git a/sw/source/core/docnode/ndcopy.cxx b/sw/source/core/docnode/ndcopy.cxx
index 982f1b0a902e..e73c9cf3fd7c 100644
--- a/sw/source/core/docnode/ndcopy.cxx
+++ b/sw/source/core/docnode/ndcopy.cxx
@@ -28,16 +28,15 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <editeng/brkitem.hxx>
#define _ZFORLIST_DECLARE_TABLE
#include <hintids.hxx>
-
-
-#include <editeng/brkitem.hxx>
#include <fmtpdsc.hxx>
#include <fmtanchr.hxx>
#include <fmtcntnt.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <pam.hxx>
#include <ndtxt.hxx>
#include <fldbas.hxx>
@@ -79,10 +78,10 @@ namespace
nNewIdx is the new position of interest.
*/
- static void lcl_NonCopyCount( const SwPaM& rPam, SwNodeIndex& rLastIdx, const ULONG nNewIdx, ULONG& rDelCount )
+ static void lcl_NonCopyCount( const SwPaM& rPam, SwNodeIndex& rLastIdx, const sal_uLong nNewIdx, sal_uLong& rDelCount )
{
- ULONG nStart = rPam.Start()->nNode.GetIndex();
- ULONG nEnd = rPam.End()->nNode.GetIndex();
+ sal_uLong nStart = rPam.Start()->nNode.GetIndex();
+ sal_uLong nEnd = rPam.End()->nNode.GetIndex();
if( rLastIdx.GetIndex() < nNewIdx ) // Moving forward?
{
do // count "non-copy" nodes
@@ -113,9 +112,9 @@ namespace
const SwPosition& rOrigStt,
const SwPosition& rCpyStt,
SwPosition& rChgPos,
- ULONG nDelCount )
+ sal_uLong nDelCount )
{
- ULONG nNdOff = rOrigPos.nNode.GetIndex();
+ sal_uLong nNdOff = rOrigPos.nNode.GetIndex();
nNdOff -= rOrigStt.nNode.GetIndex();
nNdOff -= nDelCount;
xub_StrLen nCntntPos = rOrigPos.nContent.GetIndex();
@@ -142,8 +141,7 @@ namespace
const SwDoc* pSrcDoc = rPam.GetDoc();
SwDoc* pDestDoc = rCpyPam.GetDoc();
const IDocumentMarkAccess* const pSrcMarkAccess = pSrcDoc->getIDocumentMarkAccess();
- bool bDoesUndo = pDestDoc->DoesUndo();
- pDestDoc->DoUndo(false);
+ ::sw::UndoGuard const undoGuard(pDestDoc->GetIDocumentUndoRedo());
const SwPosition &rStt = *rPam.Start(), &rEnd = *rPam.End();
SwPosition* pCpyStt = rCpyPam.Start();
@@ -169,7 +167,7 @@ namespace
}
// We have to count the "non-copied" nodes..
SwNodeIndex aCorrIdx(rStt.nNode);
- ULONG nDelCount = 0;
+ sal_uLong nDelCount = 0;
for(mark_vector_t::const_iterator ppMark = vMarksToCopy.begin();
ppMark != vMarksToCopy.end();
++ppMark)
@@ -209,7 +207,6 @@ namespace
pNewMetadatable->RegisterAsCopyOf(*pMetadatable);
}
}
- pDestDoc->DoUndo(bDoesUndo);
}
}
@@ -289,37 +286,37 @@ SwCntntNode* SwTxtNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const
}
-BOOL lcl_SrchNew( const _MapTblFrmFmt& rMap, void * pPara )
+sal_Bool lcl_SrchNew( const _MapTblFrmFmt& rMap, void * pPara )
{
if( rMap.pOld != *(const SwFrmFmt**)pPara )
- return TRUE;
+ return sal_True;
*((const SwFrmFmt**)pPara) = rMap.pNew;
- return FALSE; // abbrechen, Pointer gefunden
+ return sal_False; // abbrechen, Pointer gefunden
}
struct _CopyTable
{
SwDoc* pDoc;
- ULONG nOldTblSttIdx;
+ sal_uLong nOldTblSttIdx;
_MapTblFrmFmts& rMapArr;
SwTableLine* pInsLine;
SwTableBox* pInsBox;
SwTableNode *pTblNd;
const SwTable *pOldTable;
- _CopyTable( SwDoc* pDc, _MapTblFrmFmts& rArr, ULONG nOldStt,
+ _CopyTable( SwDoc* pDc, _MapTblFrmFmts& rArr, sal_uLong nOldStt,
SwTableNode& rTblNd, const SwTable* pOldTbl )
: pDoc(pDc), nOldTblSttIdx(nOldStt), rMapArr(rArr),
pInsLine(0), pInsBox(0), pTblNd(&rTblNd), pOldTable( pOldTbl )
{}
};
-BOOL lcl_CopyTblBox( const SwTableBox*& rpBox, void* pPara );
+sal_Bool lcl_CopyTblBox( const SwTableBox*& rpBox, void* pPara );
-BOOL lcl_CopyTblLine( const SwTableLine*& rpLine, void* pPara );
+sal_Bool lcl_CopyTblLine( const SwTableLine*& rpLine, void* pPara );
-BOOL lcl_CopyTblBox( const SwTableBox*& rpBox, void* pPara )
+sal_Bool lcl_CopyTblBox( const SwTableBox*& rpBox, void* pPara )
{
_CopyTable* pCT = (_CopyTable*)pPara;
@@ -328,7 +325,7 @@ BOOL lcl_CopyTblBox( const SwTableBox*& rpBox, void* pPara )
if( pBoxFmt == rpBox->GetFrmFmt() ) // ein neues anlegen ??
{
const SfxPoolItem* pItem;
- if( SFX_ITEM_SET == pBoxFmt->GetItemState( RES_BOXATR_FORMULA, FALSE,
+ if( SFX_ITEM_SET == pBoxFmt->GetItemState( RES_BOXATR_FORMULA, sal_False,
&pItem ) && ((SwTblBoxFormula*)pItem)->IsIntrnlName() )
{
((SwTblBoxFormula*)pItem)->PtrToBoxNm( pCT->pOldTable );
@@ -339,12 +336,12 @@ BOOL lcl_CopyTblBox( const SwTableBox*& rpBox, void* pPara )
if( rpBox->GetSttIdx() )
{
- SvNumberFormatter* pN = pCT->pDoc->GetNumberFormatter( FALSE );
+ SvNumberFormatter* pN = pCT->pDoc->GetNumberFormatter( sal_False );
if( pN && pN->HasMergeFmtTbl() && SFX_ITEM_SET == pBoxFmt->
- GetItemState( RES_BOXATR_FORMAT, FALSE, &pItem ) )
+ GetItemState( RES_BOXATR_FORMAT, sal_False, &pItem ) )
{
- ULONG nOldIdx = ((SwTblBoxNumFormat*)pItem)->GetValue();
- ULONG nNewIdx = pN->GetMergeFmtIndex( nOldIdx );
+ sal_uLong nOldIdx = ((SwTblBoxNumFormat*)pItem)->GetValue();
+ sal_uLong nNewIdx = pN->GetMergeFmtIndex( nOldIdx );
if( nNewIdx != nOldIdx )
pBoxFmt->SetFmtAttr( SwTblBoxNumFormat( nNewIdx ));
@@ -355,7 +352,7 @@ BOOL lcl_CopyTblBox( const SwTableBox*& rpBox, void* pPara )
pCT->rMapArr.Count() );
}
- USHORT nLines = rpBox->GetTabLines().Count();
+ sal_uInt16 nLines = rpBox->GetTabLines().Count();
SwTableBox* pNewBox;
if( nLines )
pNewBox = new SwTableBox( pBoxFmt, nLines, pCT->pInsLine );
@@ -380,10 +377,10 @@ BOOL lcl_CopyTblBox( const SwTableBox*& rpBox, void* pPara )
else if( pNewBox->IsInHeadline( &pCT->pTblNd->GetTable() ))
// in der HeadLine sind die Absaetze mit BedingtenVorlage anzupassen
pNewBox->GetSttNd()->CheckSectionCondColl();
- return TRUE;
+ return sal_True;
}
-BOOL lcl_CopyTblLine( const SwTableLine*& rpLine, void* pPara )
+sal_Bool lcl_CopyTblLine( const SwTableLine*& rpLine, void* pPara )
{
_CopyTable* pCT = (_CopyTable*)pPara;
SwTableLineFmt* pLineFmt = (SwTableLineFmt*)rpLine->GetFrmFmt();
@@ -410,7 +407,7 @@ BOOL lcl_CopyTblLine( const SwTableLine*& rpLine, void* pPara )
}
pCT->pInsLine = pNewLine;
((SwTableLine*)rpLine)->GetTabBoxes().ForEach( &lcl_CopyTblBox, pCT );
- return TRUE;
+ return sal_True;
}
SwTableNode* SwTableNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const
@@ -440,7 +437,7 @@ SwTableNode* SwTableNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const
if( !pDoc->IsCopyIsMove() )
{
const SwFrmFmts& rTblFmts = *pDoc->GetTblFrmFmts();
- for( USHORT n = rTblFmts.Count(); n; )
+ for( sal_uInt16 n = rTblFmts.Count(); n; )
if( rTblFmts[ --n ]->GetName() == sTblName )
{
sTblName = pDoc->GetUniqueTblName();
@@ -475,7 +472,7 @@ SwTableNode* SwTableNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const
// tauschen am Node den Tabellen-Pointer aus
SwDDETable* pNewTable = new SwDDETable( pTblNd->GetTable(), pDDEType );
- pTblNd->SetNewTable( pNewTable, FALSE );
+ pTblNd->SetNewTable( pNewTable, sal_False );
}
// dann kopiere erstmal den Inhalt der Tabelle, die Zuordnung der
// Boxen/Lines und das anlegen der Frames erfolgt spaeter
@@ -487,7 +484,7 @@ SwTableNode* SwTableNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const
// We have to make sure that the table node of the SwTable is accessible, even
// without any content in aSortCntBoxes. #i26629#
pTblNd->GetTable().SetTableNode( pTblNd );
- rNds._Copy( aRg, aInsPos, FALSE );
+ rNds._Copy( aRg, aInsPos, sal_False );
pTblNd->GetTable().SetTableNode( 0 );
// Sonderbehandlung fuer eine einzelne Box
@@ -527,10 +524,10 @@ void SwTxtNode::CopyCollFmt( SwTxtNode& rDestNd )
{
// Sonderbehandlung fuer unsere Break-Attribute
const SfxPoolItem* pAttr;
- if( SFX_ITEM_SET == pSet->GetItemState( RES_BREAK, FALSE, &pAttr ) )
+ if( SFX_ITEM_SET == pSet->GetItemState( RES_BREAK, sal_False, &pAttr ) )
aPgBrkSet.Put( *pAttr );
- if( SFX_ITEM_SET == pSet->GetItemState( RES_PAGEDESC, FALSE, &pAttr ) )
+ if( SFX_ITEM_SET == pSet->GetItemState( RES_PAGEDESC, sal_False, &pAttr ) )
aPgBrkSet.Put( *pAttr );
}
@@ -546,12 +543,12 @@ void SwTxtNode::CopyCollFmt( SwTxtNode& rDestNd )
// ----- Copy-Methode vom SwDoc ------
// verhinder das Kopieren in Fly's, die im Bereich verankert sind.
-BOOL lcl_ChkFlyFly( SwDoc* pDoc, ULONG nSttNd, ULONG nEndNd,
- ULONG nInsNd )
+sal_Bool lcl_ChkFlyFly( SwDoc* pDoc, sal_uLong nSttNd, sal_uLong nEndNd,
+ sal_uLong nInsNd )
{
const SwSpzFrmFmts& rFrmFmtTbl = *pDoc->GetSpzFrmFmts();
- for( USHORT n = 0; n < rFrmFmtTbl.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rFrmFmtTbl.Count(); ++n )
{
SwFrmFmt const*const pFmt = rFrmFmtTbl[n];
SwFmtAnchor const*const pAnchor = &pFmt->GetAnchor();
@@ -572,15 +569,15 @@ BOOL lcl_ChkFlyFly( SwDoc* pDoc, ULONG nSttNd, ULONG nEndNd,
if( pSNd->GetIndex() < nInsNd &&
nInsNd < pSNd->EndOfSectionIndex() )
- return TRUE; // nicht kopieren !!
+ return sal_True; // nicht kopieren !!
if( lcl_ChkFlyFly( pDoc, pSNd->GetIndex(),
pSNd->EndOfSectionIndex(), nInsNd ) )
- return TRUE; // nicht kopieren !!
+ return sal_True; // nicht kopieren !!
}
}
- return FALSE;
+ return sal_False;
}
void lcl_DeleteRedlines( const SwPaM& rPam, SwPaM& rCpyPam )
@@ -594,10 +591,10 @@ void lcl_DeleteRedlines( const SwPaM& rPam, SwPaM& rCpyPam )
SwPaM* pDelPam = 0;
const SwPosition *pStt = rPam.Start(), *pEnd = rPam.End();
// We have to count the "non-copied" nodes
- ULONG nDelCount = 0;
+ sal_uLong nDelCount = 0;
SwNodeIndex aCorrIdx( pStt->nNode );
- USHORT n = 0;
+ sal_uInt16 n = 0;
pSrcDoc->GetRedline( *pStt, &n );
for( ; n < rTbl.Count(); ++n )
{
@@ -647,18 +644,16 @@ void lcl_DeleteRedlines( const SwPaM& rPam, SwPaM& rCpyPam )
RedlineMode_t eOld = pDestDoc->GetRedlineMode();
pDestDoc->SetRedlineMode_intern( (RedlineMode_t)(eOld | nsRedlineMode_t::REDLINE_IGNORE));
- BOOL bDoesUndo = pDestDoc->DoesUndo();
- pDestDoc->DoUndo( FALSE );
+ ::sw::UndoGuard const undoGuard(pDestDoc->GetIDocumentUndoRedo());
do {
pDestDoc->DeleteAndJoin( *(SwPaM*)pDelPam->GetNext() );
if( pDelPam->GetNext() == pDelPam )
break;
delete pDelPam->GetNext();
- } while( TRUE );
+ } while( sal_True );
delete pDelPam;
- pDestDoc->DoUndo( bDoesUndo );
pDestDoc->SetRedlineMode_intern( eOld );
}
}
@@ -693,7 +688,7 @@ SwDoc::CopyRange( SwPaM& rPam, SwPosition& rPos, const bool bCopyAll ) const
if( pDoc == this )
{
// Start-/EndNode noch korrigieren
- ULONG nStt = pStt->nNode.GetIndex(),
+ sal_uLong nStt = pStt->nNode.GetIndex(),
nEnd = pEnd->nNode.GetIndex(),
nDiff = nEnd - nStt +1;
SwNode* pNd = GetNodes()[ nStt ];
@@ -737,49 +732,50 @@ SwDoc::CopyRange( SwPaM& rPam, SwPosition& rPos, const bool bCopyAll ) const
"please tell me what you did to get here!");
pDoc->SetRedlineMode_intern((RedlineMode_t)(eOld | nsRedlineMode_t::REDLINE_IGNORE));
- BOOL bDoUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE ); // Auf jedenfall Undo abschalten
// dann kopiere den Bereich im unteren DokumentBereich,
// (mit Start/End-Nodes geklammert) und verschiebe diese
// dann an die gewuenschte Stelle.
SwUndoCpyDoc* pUndo = 0;
SwPaM aPam( rPos ); // UndoBereich sichern
- if( bDoUndo )
+ if (pDoc->GetIDocumentUndoRedo().DoesUndo())
{
- pDoc->ClearRedo();
+ pDoc->GetIDocumentUndoRedo().ClearRedo();
pUndo = new SwUndoCpyDoc( aPam );
}
- SwStartNode* pSttNd = pDoc->GetNodes().MakeEmptySection(
+ {
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
+ SwStartNode* pSttNd = pDoc->GetNodes().MakeEmptySection(
SwNodeIndex( GetNodes().GetEndOfAutotext() ));
- aPam.GetPoint()->nNode = *pSttNd->EndOfSectionNode();
- // copy without Frames
- pDoc->CopyImpl( rPam, *aPam.GetPoint(), false, bCopyAll, 0 );
-
- aPam.GetPoint()->nNode = pDoc->GetNodes().GetEndOfAutotext();
- aPam.SetMark();
- SwCntntNode* pNode = pDoc->GetNodes().GoPrevious( &aPam.GetMark()->nNode );
- pNode->MakeEndIndex( &aPam.GetMark()->nContent );
-
- aPam.GetPoint()->nNode = *aPam.GetNode()->StartOfSectionNode();
- pNode = pDoc->GetNodes().GoNext( &aPam.GetPoint()->nNode );
- pNode->MakeStartIndex( &aPam.GetPoint()->nContent );
- // move to desired position
- pDoc->MoveRange( aPam, rPos, DOC_MOVEDEFAULT );
-
- pNode = aPam.GetCntntNode();
- *aPam.GetPoint() = rPos; // Cursor umsetzen fuers Undo !
- aPam.SetMark(); // auch den Mark umsetzen !!
- aPam.DeleteMark(); // aber keinen Bereich makieren !!
- pDoc->DeleteSection( pNode ); // Bereich wieder loeschen
-
- // falls Undo eingeschaltet ist, so speicher den eingefuegten Bereich
- pDoc->DoUndo( bDoUndo );
- if( bDoUndo )
+ aPam.GetPoint()->nNode = *pSttNd->EndOfSectionNode();
+ // copy without Frames
+ pDoc->CopyImpl( rPam, *aPam.GetPoint(), false, bCopyAll, 0 );
+
+ aPam.GetPoint()->nNode = pDoc->GetNodes().GetEndOfAutotext();
+ aPam.SetMark();
+ SwCntntNode* pNode =
+ pDoc->GetNodes().GoPrevious( &aPam.GetMark()->nNode );
+ pNode->MakeEndIndex( &aPam.GetMark()->nContent );
+
+ aPam.GetPoint()->nNode = *aPam.GetNode()->StartOfSectionNode();
+ pNode = pDoc->GetNodes().GoNext( &aPam.GetPoint()->nNode );
+ pNode->MakeStartIndex( &aPam.GetPoint()->nContent );
+ // move to desired position
+ pDoc->MoveRange( aPam, rPos, DOC_MOVEDEFAULT );
+
+ pNode = aPam.GetCntntNode();
+ *aPam.GetPoint() = rPos; // Cursor umsetzen fuers Undo !
+ aPam.SetMark(); // auch den Mark umsetzen !!
+ aPam.DeleteMark(); // aber keinen Bereich makieren !!
+ pDoc->DeleteSection( pNode ); // Bereich wieder loeschen
+ }
+
+ // if Undo is enabled, store the insertion range
+ if (pDoc->GetIDocumentUndoRedo().DoesUndo())
{
pUndo->SetInsertRange( aPam );
- pDoc->AppendUndo( pUndo );
+ pDoc->GetIDocumentUndoRedo().AppendUndo(pUndo);
}
if( pRedlineRange )
@@ -889,11 +885,10 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
SwTblNumFmtMerge aTNFM( *this, *pDoc );
- if( pDoc->DoesUndo() )
+ if (pDoc->GetIDocumentUndoRedo().DoesUndo())
{
- pDoc->ClearRedo();
pUndo = new SwUndoCpyDoc( aCpyPam );
- pDoc->AppendUndo( pUndo );
+ pDoc->GetIDocumentUndoRedo().AppendUndo( pUndo );
}
RedlineMode_t eOld = pDoc->GetRedlineMode();
@@ -903,7 +898,7 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
// bewege den Pam von der Insert-Position ein zurueck, dadurch wird
// die Position nicht "verschoben"
aCpyPam.SetMark();
- BOOL bCanMoveBack = aCpyPam.Move( fnMoveBackward, fnGoCntnt );
+ sal_Bool bCanMoveBack = aCpyPam.Move( fnMoveBackward, fnGoCntnt );
if( !bCanMoveBack )
aCpyPam.GetPoint()->nNode--;
@@ -917,7 +912,7 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
( ( pDestTxtNd && !pDestTxtNd->GetTxt().Len() ) ||
( !bOneNode && !rPos.nContent.GetIndex() ) );
bool bCopyBookmarks = true;
- BOOL bStartIsTxtNode = 0 != pSttTxtNd;
+ sal_Bool bStartIsTxtNode = 0 != pSttTxtNd;
// #i104585# copy outline num rule to clipboard (for ASCII filter)
if (pDoc->IsClipBoard() && GetOutlineNumRule())
@@ -959,7 +954,7 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
if( !bCopyCollFmt || bColumnSel || pStt->nContent.GetIndex() )
{
SwIndex aDestIdx( rPos.nContent );
- BOOL bCopyOk = FALSE;
+ sal_Bool bCopyOk = sal_False;
if( !pDestTxtNd )
{
if( pStt->nContent.GetIndex() || bOneNode )
@@ -968,7 +963,7 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
else
{
pDestTxtNd = static_cast<SwTxtNode*>(pSttTxtNd->MakeCopy( pDoc, aInsPos ));
- bCopyOk = TRUE;
+ bCopyOk = sal_True;
}
aDestIdx.Assign( pDestTxtNd, 0 );
bCopyCollFmt = true;
@@ -976,10 +971,10 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
else if( !bOneNode || bColumnSel )
{
xub_StrLen nCntntEnd = pEnd->nContent.GetIndex();
- BOOL bDoesUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
- pDoc->SplitNode( rPos, false );
- pDoc->DoUndo( bDoesUndo );
+ {
+ ::sw::UndoGuard const ug(pDoc->GetIDocumentUndoRedo());
+ pDoc->SplitNode( rPos, false );
+ }
if( bCanMoveBack && rPos == *aCpyPam.GetPoint() )
{
@@ -994,7 +989,7 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
// korrigiere den Bereich wieder !!
if( bEndEqualIns )
{
- BOOL bChg = pEnd != rPam.GetPoint();
+ sal_Bool bChg = pEnd != rPam.GetPoint();
if( bChg )
rPam.Exchange();
rPam.Move( fnMoveBackward, fnGoCntnt );
@@ -1025,12 +1020,12 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
if (pAttrSet != NULL)
{
const SfxPoolItem * pItem = NULL;
- aNumRuleState = pAttrSet->GetItemState(RES_PARATR_NUMRULE, FALSE, &pItem);
+ aNumRuleState = pAttrSet->GetItemState(RES_PARATR_NUMRULE, sal_False, &pItem);
if (SFX_ITEM_SET == aNumRuleState)
aNumRuleItem = *((SwNumRuleItem *) pItem);
aListIdState =
- pAttrSet->GetItemState(RES_PARATR_LIST_ID, FALSE, &pItem);
+ pAttrSet->GetItemState(RES_PARATR_LIST_ID, sal_False, &pItem);
if (SFX_ITEM_SET == aListIdState)
{
aListIdItem.SetValue( static_cast<const SfxStringItem*>(pItem)->GetValue() );
@@ -1102,14 +1097,14 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
else if( rPos.nContent.GetIndex() )
{ // Insertion in the middle of a text node, it has to be split
// (and joined from undo)
- bStartIsTxtNode = TRUE;
+ bStartIsTxtNode = sal_True;
// splitte den TextNode, bei dem Eingefuegt wird.
xub_StrLen nCntntEnd = pEnd->nContent.GetIndex();
- BOOL bDoesUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
- pDoc->SplitNode( rPos, false );
- pDoc->DoUndo( bDoesUndo );
+ {
+ ::sw::UndoGuard const ug(pDoc->GetIDocumentUndoRedo());
+ pDoc->SplitNode( rPos, false );
+ }
if( bCanMoveBack && rPos == *aCpyPam.GetPoint() )
{
@@ -1159,7 +1154,7 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
// will ensure that this node will be deleted during Undo
// using JoinNext.
DBG_ASSERT( !bStartIsTxtNode, "Oops, undo may be instable now." );
- bStartIsTxtNode = TRUE;
+ bStartIsTxtNode = sal_True;
}
/* #107213# Save numrule at destination */
@@ -1176,12 +1171,12 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
const SfxPoolItem * pItem = NULL;
aNumRuleState =
- pAttrSet->GetItemState(RES_PARATR_NUMRULE, FALSE, &pItem);
+ pAttrSet->GetItemState(RES_PARATR_NUMRULE, sal_False, &pItem);
if (SFX_ITEM_SET == aNumRuleState)
aNumRuleItem = *((SwNumRuleItem *) pItem);
aListIdState =
- pAttrSet->GetItemState(RES_PARATR_LIST_ID, FALSE, &pItem);
+ pAttrSet->GetItemState(RES_PARATR_LIST_ID, sal_False, &pItem);
if (SFX_ITEM_SET == aListIdState)
aListIdItem.SetValue( static_cast<const SfxStringItem*>(pItem)->GetValue() );
}
@@ -1233,22 +1228,22 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
if( pSttTxtNd && bCopyCollFmt && pDestTxtNd->HasSwAttrSet() )
{
aBrkSet.Put( *pDestTxtNd->GetpSwAttrSet() );
- if( SFX_ITEM_SET == aBrkSet.GetItemState( RES_BREAK, FALSE ) )
+ if( SFX_ITEM_SET == aBrkSet.GetItemState( RES_BREAK, sal_False ) )
pDestTxtNd->ResetAttr( RES_BREAK );
- if( SFX_ITEM_SET == aBrkSet.GetItemState( RES_PAGEDESC, FALSE ) )
+ if( SFX_ITEM_SET == aBrkSet.GetItemState( RES_PAGEDESC, sal_False ) )
pDestTxtNd->ResetAttr( RES_PAGEDESC );
}
if( aInsPos == pEnd->nNode )
{
SwNodeIndex aSaveIdx( aInsPos, -1 );
- CopyWithFlyInFly( aRg, 0,aInsPos, bMakeNewFrms, FALSE );
+ CopyWithFlyInFly( aRg, 0,aInsPos, bMakeNewFrms, sal_False );
aSaveIdx++;
pEnd->nNode = aSaveIdx;
pEnd->nContent.Assign( aSaveIdx.GetNode().GetTxtNode(), 0 );
}
else
- CopyWithFlyInFly( aRg, pEnd->nContent.GetIndex(), aInsPos, bMakeNewFrms, FALSE );
+ CopyWithFlyInFly( aRg, pEnd->nContent.GetIndex(), aInsPos, bMakeNewFrms, sal_False );
bCopyBookmarks = false;
@@ -1259,7 +1254,7 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
pDestTxtNd->SetAttr( aBrkSet );
}
}
- } while( FALSE );
+ } while( sal_False );
// Position ummelden ( falls verschoben / im anderen Node )
rPos.nContent.Assign( rPos.nNode.GetNode().GetCntntNode(),
@@ -1268,7 +1263,7 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
if( rPos.nNode != aInsPos )
{
aCpyPam.GetMark()->nNode = aInsPos;
- aCpyPam.GetMark()->nContent.Assign( aCpyPam.GetCntntNode(FALSE), 0 );
+ aCpyPam.GetMark()->nContent.Assign( aCpyPam.GetCntntNode(sal_False), 0 );
rPos = *aCpyPam.GetMark();
}
else
@@ -1285,8 +1280,10 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
lcl_DeleteRedlines( rPam, aCpyPam );
// falls Undo eingeschaltet ist, so speicher den eingefuegten Bereich
- if( pDoc->DoesUndo() )
- pUndo->SetInsertRange( aCpyPam, TRUE, bStartIsTxtNode );
+ if (pDoc->GetIDocumentUndoRedo().DoesUndo())
+ {
+ pUndo->SetInsertRange( aCpyPam, sal_True, bStartIsTxtNode );
+ }
if( pCpyRange )
{
@@ -1314,16 +1311,16 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
// ----- Copy-Methode vom SwDoc - "kopiere Fly's in Fly's" ------
void SwDoc::CopyWithFlyInFly( const SwNodeRange& rRg, const xub_StrLen nEndContentIndex,
- const SwNodeIndex& rInsPos, BOOL bMakeNewFrms,
- BOOL bDelRedlines, BOOL bCopyFlyAtFly ) const
+ const SwNodeIndex& rInsPos, sal_Bool bMakeNewFrms,
+ sal_Bool bDelRedlines, sal_Bool bCopyFlyAtFly ) const
{
SwDoc* pDest = rInsPos.GetNode().GetDoc();
_SaveRedlEndPosForRestore aRedlRest( rInsPos, 0 );
SwNodeIndex aSavePos( rInsPos, -1 );
- BOOL bEndIsEqualEndPos = rInsPos == rRg.aEnd;
- GetNodes()._CopyNodes( rRg, rInsPos, bMakeNewFrms, TRUE );
+ sal_Bool bEndIsEqualEndPos = rInsPos == rRg.aEnd;
+ GetNodes()._CopyNodes( rRg, rInsPos, bMakeNewFrms, sal_True );
aSavePos++;
if( bEndIsEqualEndPos )
((SwNodeIndex&)rRg.aEnd) = aSavePos;
@@ -1349,11 +1346,10 @@ void SwDoc::CopyWithFlyInFly( const SwNodeRange& rRg, const xub_StrLen nEndConte
}
#endif
- // Undo abschalten
- BOOL bUndo = pDest->DoesUndo();
- pDest->DoUndo( FALSE );
- CopyFlyInFlyImpl( rRg, nEndContentIndex, aSavePos, bCopyFlyAtFly );
- pDest->DoUndo( bUndo );
+ {
+ ::sw::UndoGuard const undoGuard(pDest->GetIDocumentUndoRedo());
+ CopyFlyInFlyImpl( rRg, nEndContentIndex, aSavePos, bCopyFlyAtFly );
+ }
SwNodeRange aCpyRange( aSavePos, rInsPos );
@@ -1398,9 +1394,9 @@ void SwDoc::CopyFlyInFlyImpl( const SwNodeRange& rRg,
// beibehalten.
SwDoc *const pDest = rStartIdx.GetNode().GetDoc();
_ZSortFlys aArr;
- USHORT nArrLen = GetSpzFrmFmts()->Count();
+ sal_uInt16 nArrLen = GetSpzFrmFmts()->Count();
- for ( USHORT n = 0; n < nArrLen; ++n )
+ for ( sal_uInt16 n = 0; n < nArrLen; ++n )
{
SwFrmFmt const*const pFmt = (*GetSpzFrmFmts())[n];
SwFmtAnchor const*const pAnchor = &pFmt->GetAnchor();
@@ -1440,7 +1436,7 @@ void SwDoc::CopyFlyInFlyImpl( const SwNodeRange& rRg,
//last node information is only necessary to know for the last TextNode
SwNodeIndex aTmp( pAPos->nNode );
++aTmp;//goto next node
- while( rNodes[aTmp ]->IsEndNode() )
+ while (aTmp.GetNode().IsEndNode())
{
if( aTmp == rNodes.GetEndOfContent().GetIndex() )
{
@@ -1470,7 +1466,7 @@ void SwDoc::CopyFlyInFlyImpl( const SwNodeRange& rRg,
//die Chains entsprechend aufgebaut werden koennen.
SvPtrarr aNewArr( 10, 10 );
- for ( USHORT n = 0; n < aArr.Count(); ++n )
+ for ( sal_uInt16 n = 0; n < aArr.Count(); ++n )
{
const _ZSortFly& rZSortFly = aArr[ n ];
@@ -1490,7 +1486,7 @@ void SwDoc::CopyFlyInFlyImpl( const SwNodeRange& rRg,
{
// First, determine number of anchor text node in the copied range.
// Note: The anchor text node *have* to be inside the copied range.
- ULONG nAnchorTxtNdNumInRange( 0L );
+ sal_uLong nAnchorTxtNdNumInRange( 0L );
bool bAnchorTxtNdFound( false );
SwNodeIndex aIdx( rRg.aStart );
while ( !bAnchorTxtNdFound && aIdx <= rRg.aEnd )
@@ -1565,7 +1561,7 @@ void SwDoc::CopyFlyInFlyImpl( const SwNodeRange& rRg,
// ueberpruefe Rekursion: Inhalt in "seinen eigenen" Frame
// kopieren. Dann nicht kopieren
- BOOL bMakeCpy = TRUE;
+ sal_Bool bMakeCpy = sal_True;
if( pDest == this )
{
const SwFmtCntnt& rCntnt = rZSortFly.GetFmt()->GetCntnt();
@@ -1575,7 +1571,7 @@ void SwDoc::CopyFlyInFlyImpl( const SwNodeRange& rRg,
pSNd->GetIndex() < rStartIdx.GetIndex() &&
rStartIdx.GetIndex() < pSNd->EndOfSectionIndex() )
{
- bMakeCpy = FALSE;
+ bMakeCpy = sal_False;
aArr.Remove( n, 1 );
--n;
}
@@ -1592,13 +1588,13 @@ void SwDoc::CopyFlyInFlyImpl( const SwNodeRange& rRg,
ASSERT( aArr.Count() == aNewArr.Count(), "Missing new Flys" );
if ( aArr.Count() == aNewArr.Count() )
{
- for ( USHORT n = 0; n < aArr.Count(); ++n )
+ for ( sal_uInt16 n = 0; n < aArr.Count(); ++n )
{
const SwFrmFmt *pFmt = aArr[n].GetFmt();
const SwFmtChain &rChain = pFmt->GetChain();
int nCnt = 0 != rChain.GetPrev();
nCnt += rChain.GetNext() ? 1: 0;
- for ( USHORT k = 0; nCnt && k < aArr.Count(); ++k )
+ for ( sal_uInt16 k = 0; nCnt && k < aArr.Count(); ++k )
{
const _ZSortFly &rTmp = aArr[k];
const SwFrmFmt *pTmp = rTmp.GetFmt();
diff --git a/sw/source/core/docnode/ndindex.cxx b/sw/source/core/docnode/ndindex.cxx
index cd7288430479..a6b718df2d09 100644
--- a/sw/source/core/docnode/ndindex.cxx
+++ b/sw/source/core/docnode/ndindex.cxx
@@ -47,7 +47,7 @@ SwNodeRange::SwNodeRange( const SwNodeRange &rRange )
: aStart( rRange.aStart ), aEnd( rRange.aEnd )
{}
-SwNodeRange::SwNodeRange( SwNodes& rNds, ULONG nSttIdx, ULONG nEndIdx )
+SwNodeRange::SwNodeRange( SwNodes& rNds, sal_uLong nSttIdx, sal_uLong nEndIdx )
: aStart( rNds, nSttIdx ), aEnd( rNds, nEndIdx )
{}
@@ -63,7 +63,7 @@ SwNodeRange::SwNodeRange( const SwNode& rS, long nSttDiff,
{}
-SwNodeIndex::SwNodeIndex( SwNodes& rNds, ULONG nIdx )
+SwNodeIndex::SwNodeIndex( SwNodes& rNds, sal_uLong nIdx )
: pNd( rNds[ nIdx ] ), pNext( 0 ), pPrev( 0 )
{
rNds.RegisterIndex( *this );
@@ -135,7 +135,7 @@ SwNodeIndex& SwNodeIndex::operator=( const SwNode& rNd )
return *this;
}
-SwNodeIndex& SwNodeIndex::Assign( SwNodes& rNds, ULONG nIdx )
+SwNodeIndex& SwNodeIndex::Assign( SwNodes& rNds, sal_uLong nIdx )
{
if( &pNd->GetNodes() != &rNds )
{
diff --git a/sw/source/core/docnode/ndnotxt.cxx b/sw/source/core/docnode/ndnotxt.cxx
index 985c4c8e4709..6ad9605a18f2 100644
--- a/sw/source/core/docnode/ndnotxt.cxx
+++ b/sw/source/core/docnode/ndnotxt.cxx
@@ -50,14 +50,14 @@
// <--
SwNoTxtNode::SwNoTxtNode( const SwNodeIndex & rWhere,
- const BYTE nNdType,
+ const sal_uInt8 nNdType,
SwGrfFmtColl *pGrfColl,
SwAttrSet* pAutoAttr ) :
SwCntntNode( rWhere, nNdType, pGrfColl ),
pContour( 0 ),
- bAutomaticContour( FALSE ),
- bContourMapModeValid( TRUE ),
- bPixelContour( FALSE )
+ bAutomaticContour( sal_False ),
+ bContourMapModeValid( sal_True ),
+ bPixelContour( sal_False )
{
// soll eine Harte-Attributierung gesetzt werden?
if( pAutoAttr )
@@ -93,19 +93,19 @@ void SwNoTxtNode::NewAttrSet( SwAttrPool& rPool )
// bei Grafiken und OLE-Objekten
-BOOL SwNoTxtNode::RestorePersistentData()
+sal_Bool SwNoTxtNode::RestorePersistentData()
{
- return TRUE;
+ return sal_True;
}
-BOOL SwNoTxtNode::SavePersistentData()
+sal_Bool SwNoTxtNode::SavePersistentData()
{
- return TRUE;
+ return sal_True;
}
-void SwNoTxtNode::SetContour( const PolyPolygon *pPoly, BOOL bAutomatic )
+void SwNoTxtNode::SetContour( const PolyPolygon *pPoly, sal_Bool bAutomatic )
{
delete pContour;
if ( pPoly )
@@ -113,8 +113,8 @@ void SwNoTxtNode::SetContour( const PolyPolygon *pPoly, BOOL bAutomatic )
else
pContour = 0;
bAutomaticContour = bAutomatic;
- bContourMapModeValid = TRUE;
- bPixelContour = FALSE;
+ bContourMapModeValid = sal_True;
+ bPixelContour = sal_False;
}
@@ -122,9 +122,9 @@ void SwNoTxtNode::CreateContour()
{
ASSERT( !pContour, "Contour available." );
pContour = new PolyPolygon(SvxContourDlg::CreateAutoContour(GetGraphic()));
- bAutomaticContour = TRUE;
- bContourMapModeValid = TRUE;
- bPixelContour = FALSE;
+ bAutomaticContour = sal_True;
+ bContourMapModeValid = sal_True;
+ bPixelContour = sal_False;
}
const PolyPolygon *SwNoTxtNode::HasContour() const
@@ -132,7 +132,7 @@ const PolyPolygon *SwNoTxtNode::HasContour() const
if( !bContourMapModeValid )
{
const MapMode aGrfMap( GetGraphic().GetPrefMapMode() );
- BOOL bPixelGrf = aGrfMap.GetMapUnit() == MAP_PIXEL;
+ sal_Bool bPixelGrf = aGrfMap.GetMapUnit() == MAP_PIXEL;
const MapMode aContourMap( bPixelGrf ? MAP_PIXEL : MAP_100TH_MM );
if( bPixelGrf ? !bPixelContour : aGrfMap != aContourMap )
{
@@ -141,13 +141,13 @@ const PolyPolygon *SwNoTxtNode::HasContour() const
OutputDevice* pOutDev =
(bPixelGrf || bPixelContour) ? Application::GetDefaultDevice()
: 0;
- USHORT nPolyCount = pContour->Count();
- for( USHORT j=0; j<nPolyCount; j++ )
+ sal_uInt16 nPolyCount = pContour->Count();
+ for( sal_uInt16 j=0; j<nPolyCount; j++ )
{
Polygon& rPoly = (*pContour)[j];
- USHORT nCount = rPoly.GetSize();
- for( USHORT i=0 ; i<nCount; i++ )
+ sal_uInt16 nCount = rPoly.GetSize();
+ for( sal_uInt16 i=0 ; i<nCount; i++ )
{
if( bPixelGrf )
rPoly[i] = pOutDev->LogicToPixel( rPoly[i],
@@ -161,8 +161,8 @@ const PolyPolygon *SwNoTxtNode::HasContour() const
}
}
}
- ((SwNoTxtNode *)this)->bContourMapModeValid = TRUE;
- ((SwNoTxtNode *)this)->bPixelContour = FALSE;
+ ((SwNoTxtNode *)this)->bContourMapModeValid = sal_True;
+ ((SwNoTxtNode *)this)->bPixelContour = sal_False;
}
return pContour;
@@ -181,13 +181,13 @@ void SwNoTxtNode::SetContourAPI( const PolyPolygon *pPoly )
pContour = new PolyPolygon( *pPoly );
else
pContour = 0;
- bContourMapModeValid = FALSE;
+ bContourMapModeValid = sal_False;
}
-BOOL SwNoTxtNode::GetContourAPI( PolyPolygon &rContour ) const
+sal_Bool SwNoTxtNode::GetContourAPI( PolyPolygon &rContour ) const
{
if( !pContour )
- return FALSE;
+ return sal_False;
rContour = *pContour;
if( bContourMapModeValid )
@@ -200,13 +200,13 @@ BOOL SwNoTxtNode::GetContourAPI( PolyPolygon &rContour ) const
if( aGrfMap.GetMapUnit() != MAP_PIXEL &&
aGrfMap != aContourMap )
{
- USHORT nPolyCount = rContour.Count();
- for( USHORT j=0; j<nPolyCount; j++ )
+ sal_uInt16 nPolyCount = rContour.Count();
+ for( sal_uInt16 j=0; j<nPolyCount; j++ )
{
Polygon& rPoly = (*pContour)[j];
- USHORT nCount = rPoly.GetSize();
- for( USHORT i=0 ; i<nCount; i++ )
+ sal_uInt16 nCount = rPoly.GetSize();
+ for( sal_uInt16 i=0 ; i<nCount; i++ )
{
rPoly[i] = OutputDevice::LogicToLogic( rPoly[i], aGrfMap,
aContourMap );
@@ -215,12 +215,12 @@ BOOL SwNoTxtNode::GetContourAPI( PolyPolygon &rContour ) const
}
}
- return TRUE;
+ return sal_True;
}
-BOOL SwNoTxtNode::IsPixelContour() const
+sal_Bool SwNoTxtNode::IsPixelContour() const
{
- BOOL bRet;
+ sal_Bool bRet;
if( bContourMapModeValid )
{
const MapMode aGrfMap( GetGraphic().GetPrefMapMode() );
@@ -240,7 +240,7 @@ Graphic SwNoTxtNode::GetGraphic() const
Graphic aRet;
if ( GetGrfNode() )
{
- ((SwGrfNode*)this)->SwapIn( TRUE );
+ ((SwGrfNode*)this)->SwapIn( sal_True );
aRet = ((SwGrfNode*)this)->GetGrf();
}
else
diff --git a/sw/source/core/docnode/ndnum.cxx b/sw/source/core/docnode/ndnum.cxx
index 1d1203a70e9b..6e00748b618e 100644
--- a/sw/source/core/docnode/ndnum.cxx
+++ b/sw/source/core/docnode/ndnum.cxx
@@ -37,11 +37,11 @@
#include <docary.hxx>
_SV_IMPL_SORTAR_ALG( SwOutlineNodes, SwNodePtr )
-BOOL SwOutlineNodes::Seek_Entry( const SwNodePtr rSrch, USHORT* pFndPos ) const
+sal_Bool SwOutlineNodes::Seek_Entry( const SwNodePtr rSrch, sal_uInt16* pFndPos ) const
{
- ULONG nIdx = rSrch->GetIndex();
+ sal_uLong nIdx = rSrch->GetIndex();
- USHORT nO = Count(), nM, nU = 0;
+ sal_uInt16 nO = Count(), nM, nU = 0;
if( nO > 0 )
{
//JP 17.03.98: aufgrund des Bug 48592 - wo unter anderem nach Undo/Redo
@@ -49,7 +49,7 @@ BOOL SwOutlineNodes::Seek_Entry( const SwNodePtr rSrch, USHORT* pFndPos ) const
// jetzt mal einen Check eingebaut.
#ifdef DBG_UTIL
{
- for( USHORT n = 1; n < nO; ++n )
+ for( sal_uInt16 n = 1; n < nO; ++n )
if( &(*this)[ n-1 ]->GetNodes() !=
&(*this)[ n ]->GetNodes() )
{
@@ -66,7 +66,7 @@ BOOL SwOutlineNodes::Seek_Entry( const SwNodePtr rSrch, USHORT* pFndPos ) const
{
if( pFndPos )
*pFndPos = nM;
- return TRUE;
+ return sal_True;
}
else if( (*this)[ nM ]->GetIndex() < nIdx )
nU = nM + 1;
@@ -74,7 +74,7 @@ BOOL SwOutlineNodes::Seek_Entry( const SwNodePtr rSrch, USHORT* pFndPos ) const
{
if( pFndPos )
*pFndPos = nU;
- return FALSE;
+ return sal_False;
}
else
nO = nM - 1;
@@ -82,7 +82,7 @@ BOOL SwOutlineNodes::Seek_Entry( const SwNodePtr rSrch, USHORT* pFndPos ) const
}
if( pFndPos )
*pFndPos = nU;
- return FALSE;
+ return sal_False;
}
void SwNodes::UpdateOutlineNode(SwNode & rNd)
@@ -91,7 +91,7 @@ void SwNodes::UpdateOutlineNode(SwNode & rNd)
if (pTxtNd && pTxtNd->IsOutlineStateChanged())
{
- BOOL bFound = pOutlineNds->Seek_Entry(pTxtNd);
+ sal_Bool bFound = pOutlineNds->Seek_Entry(pTxtNd);
if (pTxtNd->IsOutline())
{
@@ -124,12 +124,12 @@ void SwNodes::UpdateOutlineNode(SwNode & rNd)
}
}
-//void SwNodes::UpdateOutlineNode( const SwNode& rNd, BYTE nOldLevel, //#outline level,removed by zhaojianwei
-// BYTE nNewLevel )
+//void SwNodes::UpdateOutlineNode( const SwNode& rNd, sal_uInt8 nOldLevel, //#outline level,removed by zhaojianwei
+// sal_uInt8 nNewLevel )
//{
// const SwNodePtr pSrch = (SwNodePtr)&rNd;
-// USHORT nSttPos;
-// BOOL bSeekIdx = pOutlineNds->Seek_Entry( pSrch, &nSttPos );
+// sal_uInt16 nSttPos;
+// sal_Bool bSeekIdx = pOutlineNds->Seek_Entry( pSrch, &nSttPos );
//
// //if( NO_NUMBERING == nOldLevel ) //#outline level,zhaojianwei
// if( 0 == nOldLevel ) //<-end, zhaojianwei
@@ -138,7 +138,7 @@ void SwNodes::UpdateOutlineNode(SwNode & rNd)
// //ASSERT( !bSeekIdx, "Der Node ist schon als OutlineNode vorhanden" );
//
// //JP 12.03.99: 63293 - Nodes vom RedlineBereich NIE aufnehmen
-// ULONG nNd = rNd.GetIndex();
+// sal_uLong nNd = rNd.GetIndex();
// if( nNd < GetEndOfRedlines().GetIndex() &&
// nNd > GetEndOfRedlines().StartOfSectionNode()->GetIndex() )
// return ;
@@ -207,7 +207,7 @@ void SwNodes::UpdtOutlineIdx( const SwNode& rNd )
return;
const SwNodePtr pSrch = (SwNodePtr)&rNd;
- USHORT nPos;
+ sal_uInt16 nPos;
pOutlineNds->Seek_Entry( pSrch, &nPos );
if( nPos == pOutlineNds->Count() ) // keine zum Updaten vorhanden ?
return;
diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx
index 229b8b7dc36f..5f4ed2c63ce5 100644
--- a/sw/source/core/docnode/ndsect.cxx
+++ b/sw/source/core/docnode/ndsect.cxx
@@ -38,11 +38,13 @@
#include <txtftn.hxx>
#include <fmtclds.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <rootfrm.hxx>
#include <pam.hxx>
#include <ndtxt.hxx>
#include <section.hxx>
-#include <undobj.hxx>
+#include <UndoSection.hxx>
+#include <UndoDelete.hxx>
#include <swundo.hxx>
#include <calc.hxx>
#include <swtable.hxx>
@@ -58,9 +60,7 @@
#include <node2lay.hxx>
#include <doctxm.hxx>
#include <fmtftntx.hxx>
-#ifndef _COMCORE_HRC
#include <comcore.hrc>
-#endif
// --> OD 2005-12-01 #i27138#
#include <viewsh.hxx>
#include <txtfrm.hxx>
@@ -91,8 +91,8 @@ bool lcl_IsInSameTblBox( SwNodes& _rNds,
do
{
if ( _bPrev
- ? !_rNds.GoPrevSection( &aChkIdx, FALSE, FALSE )
- : !_rNds.GoNextSection( &aChkIdx, FALSE, FALSE ) )
+ ? !_rNds.GoPrevSection( &aChkIdx, sal_False, sal_False )
+ : !_rNds.GoNextSection( &aChkIdx, sal_False, sal_False ) )
{
ASSERT( false, "<lcl_IsInSameTblBox(..)> - no previous/next!" );
return false;
@@ -122,8 +122,8 @@ bool lcl_IsInSameTblBox( SwNodes& _rNds,
// dann suche den StartNode der Box
const SwTableSortBoxes& rSortBoxes = pTblNd->GetTable().GetTabSortBoxes();
- ULONG nIdx = _rNd.GetIndex();
- for( USHORT n = 0; n < rSortBoxes.Count(); ++n )
+ sal_uLong nIdx = _rNd.GetIndex();
+ for( sal_uInt16 n = 0; n < rSortBoxes.Count(); ++n )
{
const SwStartNode* pNd = rSortBoxes[ n ]->GetSttNd();
if ( pNd->GetIndex() < nIdx && nIdx < pNd->EndOfSectionIndex() )
@@ -141,14 +141,14 @@ void lcl_CheckEmptyLayFrm( SwNodes& rNds, SwSectionData& rSectionData,
const SwNode& rStt, const SwNode& rEnd )
{
SwNodeIndex aIdx( rStt );
- if( !rNds.GoPrevSection( &aIdx, TRUE, FALSE ) ||
- !CheckNodesRange( rStt, aIdx, TRUE ) ||
+ if( !rNds.GoPrevSection( &aIdx, sal_True, sal_False ) ||
+ !CheckNodesRange( rStt, aIdx, sal_True ) ||
// OD 04.11.2003 #i21457#
!lcl_IsInSameTblBox( rNds, rStt, true ))
{
aIdx = rEnd;
- if( !rNds.GoNextSection( &aIdx, TRUE, FALSE ) ||
- !CheckNodesRange( rEnd, aIdx, TRUE ) ||
+ if( !rNds.GoNextSection( &aIdx, sal_True, sal_False ) ||
+ !CheckNodesRange( rEnd, aIdx, sal_True ) ||
// OD 04.11.2003 #i21457#
!lcl_IsInSameTblBox( rNds, rEnd, false ))
{
@@ -163,7 +163,7 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData,
SfxItemSet const*const pAttr, bool const bUpdate)
{
const SwNode* pPrvNd = 0;
- USHORT nRegionRet = 0;
+ sal_uInt16 nRegionRet = 0;
if( rRange.HasMark() &&
0 == ( nRegionRet = IsInsRegionAvailable( rRange, &pPrvNd ) ))
{
@@ -188,12 +188,12 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData,
}
SwUndoInsSection* pUndoInsSect = 0;
- if( DoesUndo() )
+ bool const bUndo(GetIDocumentUndoRedo().DoesUndo());
+ if (bUndo)
{
- ClearRedo();
pUndoInsSect = new SwUndoInsSection(rRange, rNewData, pAttr, pTOXBase);
- AppendUndo( pUndoInsSect );
- DoUndo( FALSE );
+ GetIDocumentUndoRedo().AppendUndo( pUndoInsSect );
+ GetIDocumentUndoRedo().DoUndo(false);
}
SwSectionFmt* const pFmt = MakeSectionFmt( 0 );
@@ -235,7 +235,7 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData,
pSttPos->nNode.GetNode().GetTxtNode();
if (pTNd)
{
- pUndoInsSect->SaveSplitNode( pTNd, TRUE );
+ pUndoInsSect->SaveSplitNode( pTNd, sal_True );
}
}
@@ -246,7 +246,7 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData,
if (pTNd &&
(pTNd->GetTxt().Len() != pEndPos->nContent.GetIndex()))
{
- pUndoInsSect->SaveSplitNode( pTNd, FALSE );
+ pUndoInsSect->SaveSplitNode( pTNd, sal_False );
}
}
}
@@ -315,7 +315,7 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData,
{
if( pUndoInsSect && pCNd->IsTxtNode() )
{
- pUndoInsSect->SaveSplitNode( (SwTxtNode*)pCNd, TRUE );
+ pUndoInsSect->SaveSplitNode( (SwTxtNode*)pCNd, sal_True );
}
SplitNode( *pPos, false );
pNewSectNode = GetNodes().InsertTextSection(
@@ -355,10 +355,10 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData,
rNewSect.SetCondHidden( aCalc.Calculate( rNewSect.GetCondition() ).GetBool() );
}
- BOOL bUpdateFtn = FALSE;
+ sal_Bool bUpdateFtn = sal_False;
if( GetFtnIdxs().Count() && pAttr )
{
- USHORT nVal = ((SwFmtFtnAtTxtEnd&)pAttr->Get(
+ sal_uInt16 nVal = ((SwFmtFtnAtTxtEnd&)pAttr->Get(
RES_FTN_AT_TXTEND )).GetValue();
if( ( FTNEND_ATTXTEND_OWNNUMSEQ == nVal ||
FTNEND_ATTXTEND_OWNNUMANDFMT == nVal ) ||
@@ -366,7 +366,7 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData,
pAttr->Get( RES_END_AT_TXTEND )).GetValue() ) ||
FTNEND_ATTXTEND_OWNNUMANDFMT == nVal ))
{
- bUpdateFtn = TRUE;
+ bUpdateFtn = sal_True;
}
}
@@ -374,7 +374,7 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData,
{
pUndoInsSect->SetSectNdPos( pNewSectNode->GetIndex() );
pUndoInsSect->SetUpdtFtnFlag( bUpdateFtn );
- DoUndo( TRUE );
+ GetIDocumentUndoRedo().DoUndo(bUndo);
}
if (rNewData.IsLinkType())
@@ -391,10 +391,10 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData,
return &pNewSectNode->GetSection();
}
-USHORT SwDoc::IsInsRegionAvailable( const SwPaM& rRange,
+sal_uInt16 SwDoc::IsInsRegionAvailable( const SwPaM& rRange,
const SwNode** ppSttNd ) const
{
- USHORT nRet = 1;
+ sal_uInt16 nRet = 1;
if( rRange.HasMark() )
{
// teste ob es sich um eine gueltige Selektion handelt
@@ -416,7 +416,7 @@ USHORT SwDoc::IsInsRegionAvailable( const SwPaM& rRange,
pCNd->Len() )
{
SwNodeIndex aIdx( pStt->nNode, -1 );
- ULONG nCmp = pEnd->nNode.GetIndex();
+ sal_uLong nCmp = pEnd->nNode.GetIndex();
const SwStartNode* pPrvNd;
const SwEndNode* pNxtNd;
while( 0 != ( pPrvNd = (pNd = &aIdx.GetNode())->GetSectionNode() ) &&
@@ -523,42 +523,40 @@ SwSectionFmt* SwDoc::MakeSectionFmt( SwSectionFmt *pDerivedFrom )
return pNew;
}
-void SwDoc::DelSectionFmt( SwSectionFmt *pFmt, BOOL bDelNodes )
+void SwDoc::DelSectionFmt( SwSectionFmt *pFmt, sal_Bool bDelNodes )
{
- USHORT nPos = pSectionFmtTbl->GetPos( pFmt );
+ sal_uInt16 nPos = pSectionFmtTbl->GetPos( pFmt );
- StartUndo(UNDO_DELSECTION, NULL);
+ GetIDocumentUndoRedo().StartUndo(UNDO_DELSECTION, NULL);
if( USHRT_MAX != nPos )
{
- const SwNodeIndex* pIdx = pFmt->GetCntnt( FALSE ).GetCntntIdx();
+ const SwNodeIndex* pIdx = pFmt->GetCntnt( sal_False ).GetCntntIdx();
const SfxPoolItem* pFtnEndAtTxtEnd;
if( SFX_ITEM_SET != pFmt->GetItemState(
- RES_FTN_AT_TXTEND, TRUE, &pFtnEndAtTxtEnd ) ||
+ RES_FTN_AT_TXTEND, sal_True, &pFtnEndAtTxtEnd ) ||
SFX_ITEM_SET != pFmt->GetItemState(
- RES_END_AT_TXTEND, TRUE, &pFtnEndAtTxtEnd ))
+ RES_END_AT_TXTEND, sal_True, &pFtnEndAtTxtEnd ))
pFtnEndAtTxtEnd = 0;
const SwSectionNode* pSectNd;
- if( DoesUndo() )
+ if( GetIDocumentUndoRedo().DoesUndo() )
{
- ClearRedo();
if( bDelNodes && pIdx && &GetNodes() == &pIdx->GetNodes() &&
0 != (pSectNd = pIdx->GetNode().GetSectionNode() ))
{
SwNodeIndex aUpdIdx( *pIdx );
- ClearRedo();
SwPaM aPaM( *pSectNd->EndOfSectionNode(), *pSectNd );
- AppendUndo( new SwUndoDelete( aPaM ));
+ GetIDocumentUndoRedo().AppendUndo( new SwUndoDelete( aPaM ));
if( pFtnEndAtTxtEnd )
GetFtnIdxs().UpdateFtn( aUpdIdx );
SetModified();
//#126178# start/end undo have to be pairs!
- EndUndo(UNDO_DELSECTION, NULL);
+ GetIDocumentUndoRedo().EndUndo(UNDO_DELSECTION, NULL);
return ;
}
- AppendUndo( MakeUndoDelSection( *pFmt ) );
+ GetIDocumentUndoRedo().AppendUndo( MakeUndoDelSection( *pFmt ) );
}
else if( bDelNodes && pIdx && &GetNodes() == &pIdx->GetNodes() &&
0 != (pSectNd = pIdx->GetNode().GetSectionNode() ))
@@ -569,7 +567,7 @@ void SwDoc::DelSectionFmt( SwSectionFmt *pFmt, BOOL bDelNodes )
GetFtnIdxs().UpdateFtn( aUpdIdx );
SetModified();
//#126178# start/end undo have to be pairs!
- EndUndo(UNDO_DELSECTION, NULL);
+ GetIDocumentUndoRedo().EndUndo(UNDO_DELSECTION, NULL);
return ;
}
@@ -587,7 +585,7 @@ void SwDoc::DelSectionFmt( SwSectionFmt *pFmt, BOOL bDelNodes )
// zu loeschen!
pSectionFmtTbl->Remove( nPos );
//FEATURE::CONDCOLL
- ULONG nCnt = 0, nSttNd = 0;
+ sal_uLong nCnt = 0, nSttNd = 0;
if( pIdx && &GetNodes() == &pIdx->GetNodes() &&
0 != (pSectNd = pIdx->GetNode().GetSectionNode() ))
{
@@ -613,7 +611,7 @@ void SwDoc::DelSectionFmt( SwSectionFmt *pFmt, BOOL bDelNodes )
//FEATURE::CONDCOLL
}
- EndUndo(UNDO_DELSECTION, NULL);
+ GetIDocumentUndoRedo().EndUndo(UNDO_DELSECTION, NULL);
SetModified();
}
@@ -630,16 +628,16 @@ void SwDoc::UpdateSection(sal_uInt16 const nPos, SwSectionData & rNewData,
if (pSection->DataEquals(rNewData))
{
// die Attribute ueberpruefen
- BOOL bOnlyAttrChg = FALSE;
+ sal_Bool bOnlyAttrChg = sal_False;
if( pAttr && pAttr->Count() )
{
SfxItemIter aIter( *pAttr );
- USHORT nWhich = aIter.GetCurItem()->Which();
- while( TRUE )
+ sal_uInt16 nWhich = aIter.GetCurItem()->Which();
+ while( sal_True )
{
if( pFmt->GetFmtAttr( nWhich ) != *aIter.GetCurItem() )
{
- bOnlyAttrChg = TRUE;
+ bOnlyAttrChg = sal_True;
break;
}
@@ -651,23 +649,17 @@ void SwDoc::UpdateSection(sal_uInt16 const nPos, SwSectionData & rNewData,
if( bOnlyAttrChg )
{
- const BOOL bDoesUndo = DoesUndo();
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( MakeUndoUpdateSection( *pFmt, true ) );
- // --> FME 2004-10-13 #i32968#
- // Inserting columns in the section causes MakeFrmFmt to put two
- // objects of type SwUndoFrmFmt on the undo stack. We don't want them.
- DoUndo( FALSE );
- // <--
+ GetIDocumentUndoRedo().AppendUndo(
+ MakeUndoUpdateSection( *pFmt, true ) );
}
+ // #i32968# Inserting columns in the section causes MakeFrmFmt
+ // to put two objects of type SwUndoFrmFmt on the undo stack.
+ // We don't want them.
+ ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
pFmt->SetFmtAttr( *pAttr );
SetModified();
-
- // --> FME 2004-10-13 #i32968#
- DoUndo( bDoesUndo );
- // <--
}
return;
}
@@ -692,17 +684,13 @@ void SwDoc::UpdateSection(sal_uInt16 const nPos, SwSectionData & rNewData,
}
}
- const BOOL bDoesUndo = DoesUndo();
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( MakeUndoUpdateSection( *pFmt, false ) );
- // --> FME 2004-10-13 #i32968#
- // Inserting columns in the section causes MakeFrmFmt to put two
- // objects of type SwUndoFrmFmt on the undo stack. We don't want them.
- DoUndo( FALSE );
- // <--
+ GetIDocumentUndoRedo().AppendUndo(MakeUndoUpdateSection(*pFmt, false));
}
+ // #i32968# Inserting columns in the section causes MakeFrmFmt to put two
+ // objects of type SwUndoFrmFmt on the undo stack. We don't want them.
+ ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
// #56167# Der LinkFileName koennte auch nur aus Separatoren bestehen
String sCompareString = sfx2::cTokenSeperator;
@@ -720,9 +708,9 @@ void SwDoc::UpdateSection(sal_uInt16 const nPos, SwSectionData & rNewData,
sSectName.Erase();
/// OD 04.10.2002 #102894# - NOTE
- /// In SwSection::operator=(..) class member bCondHiddenFlag is always set to TRUE.
+ /// In SwSection::operator=(..) class member bCondHiddenFlag is always set to sal_True.
/// IMHO this have to be changed, but I can't estimate the consequences:
- /// Either it is set to TRUE using corresponding method <SwSection.SetCondHidden(..)>,
+ /// Either it is set to sal_True using corresponding method <SwSection.SetCondHidden(..)>,
/// or it is set to the value of SwSection which is assigned to it.
/// Discussion with AMA results that the adjustment to the assignment operator
/// could be very risky -> see notes in bug #102894#.
@@ -747,9 +735,9 @@ void SwDoc::UpdateSection(sal_uInt16 const nPos, SwSectionData & rNewData,
/// OD 04.10.2002 #102894#
/// Because on using SwSection::operator=() to set up <pSection>
/// with <rNewData> and the above given note, the hidden condition flag
- /// has to be set to FALSE, if hidden condition flag of <pFmt->GetSection()>
- /// (SwSection before the changes) is FALSE (already saved in <bOldCondHidden>)
- /// and new calculated condition is TRUE.
+ /// has to be set to sal_False, if hidden condition flag of <pFmt->GetSection()>
+ /// (SwSection before the changes) is sal_False (already saved in <bOldCondHidden>)
+ /// and new calculated condition is sal_True.
/// This is necessary, because otherwise the <SetCondHidden> would have
/// no effect.
bool bCalculatedCondHidden =
@@ -770,10 +758,6 @@ void SwDoc::UpdateSection(sal_uInt16 const nPos, SwSectionData & rNewData,
}
SetModified();
-
- // --> FME 2004-10-13 #i32968#
- DoUndo( bDoesUndo );
- // <--
}
/* -----------------19.02.99 09:31-------------------
@@ -786,12 +770,12 @@ void SwDoc::UpdateSection(sal_uInt16 const nPos, SwSectionData & rNewData,
* --------------------------------------------------*/
// und dann waren da noch die Fussnoten:
-void lcl_DeleteFtn( SwSectionNode *pNd, ULONG nStt, ULONG nEnd )
+void lcl_DeleteFtn( SwSectionNode *pNd, sal_uLong nStt, sal_uLong nEnd )
{
SwFtnIdxs& rFtnArr = pNd->GetDoc()->GetFtnIdxs();
if( rFtnArr.Count() )
{
- USHORT nPos;
+ sal_uInt16 nPos;
rFtnArr.SeekEntry( SwNodeIndex( *pNd ), &nPos );
SwTxtFtn* pSrch;
@@ -879,7 +863,7 @@ SwSectionNode* SwNodes::InsertTextSection(SwNodeIndex const& rNdIdx,
// aInsPos is at the moment the Position where my EndNode will be inserted
const SwStartNode* pStartNode = aInsPos.GetNode().StartOfSectionNode();
// This StartNode should be in front of me, but if not, I wanna survive
- ULONG nMyIndex = pSectNd->GetIndex();
+ sal_uLong nMyIndex = pSectNd->GetIndex();
if( pStartNode->GetIndex() > nMyIndex ) // Suspicious!
{
const SwNode* pTemp;
@@ -936,8 +920,13 @@ SwSectionNode* SwNodes::InsertTextSection(SwNodeIndex const& rNdIdx,
// Hier bietet sich als Optimierung an, vorhandene Frames nicht zu
// zerstoeren und wieder neu anzulegen, sondern nur umzuhaengen.
+<<<<<<< local
BOOL bInsFrm = bCreateFrms && !pSectNd->GetSection().IsHidden() &&
GetDoc()->GetCurrentViewShell(); //swmod 071108//swmod 071225
+=======
+ sal_Bool bInsFrm = bCreateFrms && !pSectNd->GetSection().IsHidden() &&
+ GetDoc()->GetRootFrm();
+>>>>>>> other
SwNode2Layout *pNode2Layout = NULL;
if( bInsFrm )
{
@@ -948,10 +937,10 @@ SwSectionNode* SwNodes::InsertTextSection(SwNodeIndex const& rNdIdx,
}
// jetzt noch bei allen im Bereich den richtigen StartNode setzen
- ULONG nEnde = pSectNd->EndOfSectionIndex();
- ULONG nStart = pSectNd->GetIndex()+1;
- ULONG nSkipIdx = ULONG_MAX;
- for( ULONG n = nStart; n < nEnde; ++n )
+ sal_uLong nEnde = pSectNd->EndOfSectionIndex();
+ sal_uLong nStart = pSectNd->GetIndex()+1;
+ sal_uLong nSkipIdx = ULONG_MAX;
+ for( sal_uLong n = nStart; n < nEnde; ++n )
{
SwNode* pNd = (*this)[n];
@@ -991,7 +980,7 @@ SwSectionNode* SwNodes::InsertTextSection(SwNodeIndex const& rNdIdx,
{
if( pNode2Layout )
{
- ULONG nIdx = pSectNd->GetIndex();
+ sal_uLong nIdx = pSectNd->GetIndex();
pNode2Layout->RestoreUpperFrms( pSectNd->GetNodes(), nIdx, nIdx + 1 );
delete pNode2Layout;
}
@@ -1082,10 +1071,28 @@ SwFrm* SwClearDummies( SwFrm* pFrm )
SwSectionNode::~SwSectionNode()
{
+<<<<<<< local
// mba: test if iteration works as clients will be removed in callback
m_pSection->GetFmt()->CallSwClientNotify( SfxSimpleHint( SFX_HINT_DYING ) );
SwDoc* pDoc = GetDoc();
+=======
+ {
+ 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++;
+ }
+ }
+>>>>>>> other
SwSectionFmt* pFmt = m_pSection->GetFmt();
if( pFmt )
@@ -1096,12 +1103,6 @@ SwSectionNode::~SwSectionNode()
pFmt->ResetFmtAttr( RES_CNTNT );
pFmt->UnlockModify();
}
-
- BOOL bUndo = pDoc->DoesUndo();
- // verhinder beim Loeschen aus der Undo/Redo-History einen rekursiven Aufruf
- if( bUndo && &pDoc->GetNodes() != &GetNodes() )
- pDoc->DoUndo( FALSE );
- pDoc->DoUndo( bUndo );
}
@@ -1123,14 +1124,14 @@ void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx )
if( GetSection().IsHidden() || IsCntntHidden() )
{
SwNodeIndex aIdx( *EndOfSectionNode() );
- SwCntntNode* pCNd = rNds.GoNextSection( &aIdx, TRUE, FALSE );
+ SwCntntNode* pCNd = rNds.GoNextSection( &aIdx, sal_True, sal_False );
if( !pCNd )
{
aIdx = *this;
- if( 0 == ( pCNd = rNds.GoPrevSection( &aIdx, TRUE, FALSE )) )
+ if( 0 == ( pCNd = rNds.GoPrevSection( &aIdx, sal_True, sal_False )) )
return ;
}
- pCNd = rNds[ aIdx ]->GetCntntNode();
+ pCNd = aIdx.GetNode().GetCntntNode();
pCNd->MakeFrms( (SwCntntNode&)rIdx.GetNode() );
}
else
@@ -1250,11 +1251,11 @@ void SwSectionNode::MakeFrms( SwNodeIndex* pIdxBehind, SwNodeIndex* pEndIdx )
void SwSectionNode::DelFrms()
{
- ULONG nStt = GetIndex()+1, nEnd = EndOfSectionIndex();
+ sal_uLong nStt = GetIndex()+1, nEnd = EndOfSectionIndex();
if( nStt >= nEnd )
{
// unser Flag muessen wir noch aktualisieren
- // pSection->bHiddenFlag = TRUE;
+ // pSection->bHiddenFlag = sal_True;
return ;
}
@@ -1270,14 +1271,14 @@ void SwSectionNode::DelFrms()
// Fly/TblBox-Frame keinen Lower !!!
{
SwNodeIndex aIdx( *this );
- if( !rNds.GoPrevSection( &aIdx, TRUE, FALSE ) ||
- !CheckNodesRange( *this, aIdx, TRUE ) ||
+ if( !rNds.GoPrevSection( &aIdx, sal_True, sal_False ) ||
+ !CheckNodesRange( *this, aIdx, sal_True ) ||
// OD 04.11.2003 #i21457#
!lcl_IsInSameTblBox( rNds, *this, true ))
{
aIdx = *EndOfSectionNode();
- if( !rNds.GoNextSection( &aIdx, TRUE, FALSE ) ||
- !CheckNodesRange( *EndOfSectionNode(), aIdx, TRUE ) ||
+ if( !rNds.GoNextSection( &aIdx, sal_True, sal_False ) ||
+ !CheckNodesRange( *EndOfSectionNode(), aIdx, sal_True ) ||
// OD 04.11.2003 #i21457#
!lcl_IsInSameTblBox( rNds, *EndOfSectionNode(), false ))
{
@@ -1332,16 +1333,16 @@ SwSectionNode* SwSectionNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) c
pNewSect->SetCondition( GetSection().GetCondition() );
pNewSect->SetLinkFileName( GetSection().GetLinkFileName() );
if( !pNewSect->IsHiddenFlag() && GetSection().IsHidden() )
- pNewSect->SetHidden( TRUE );
+ pNewSect->SetHidden( sal_True );
if( !pNewSect->IsProtectFlag() && GetSection().IsProtect() )
- pNewSect->SetProtect( TRUE );
+ pNewSect->SetProtect( sal_True );
// --> FME 2004-06-22 #114856# edit in readonly sections
if( !pNewSect->IsEditInReadonlyFlag() && GetSection().IsEditInReadonly() )
- pNewSect->SetEditInReadonly( TRUE );
+ pNewSect->SetEditInReadonly( sal_True );
// <--
SwNodeRange aRg( *this, +1, *EndOfSectionNode() ); // (wo stehe in denn nun ??)
- rNds._Copy( aRg, aInsPos, FALSE );
+ rNds._Copy( aRg, aInsPos, sal_False );
// loesche alle Frames vom kopierten Bereich, diese werden beim
// erzeugen des SectionFrames angelegt !
@@ -1353,7 +1354,8 @@ SwSectionNode* SwSectionNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) c
: CREATE_NONE );
// falls als Server aus dem Undo kopiert wird, wieder eintragen
- if (m_pSection->IsServer() && (pDoc->GetUndoNds() == &rNds))
+ if (m_pSection->IsServer()
+ && pDoc->GetIDocumentUndoRedo().IsUndoNodes(rNds))
{
pNewSect->SetRefObject( m_pSection->GetObject() );
pDoc->GetLinkManager().InsertServer( pNewSect->GetObject() );
@@ -1365,12 +1367,12 @@ SwSectionNode* SwSectionNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) c
return pSectNd;
}
-BOOL SwSectionNode::IsCntntHidden() const
+sal_Bool SwSectionNode::IsCntntHidden() const
{
ASSERT( !m_pSection->IsHidden(),
"That's simple: Hidden Section => Hidden Content" );
SwNodeIndex aTmp( *this, 1 );
- ULONG nEnd = EndOfSectionIndex();
+ sal_uLong nEnd = EndOfSectionIndex();
while( aTmp < nEnd )
{
if( aTmp.GetNode().IsSectionNode() )
@@ -1383,12 +1385,12 @@ BOOL SwSectionNode::IsCntntHidden() const
else
{
if( aTmp.GetNode().IsCntntNode() || aTmp.GetNode().IsTableNode() )
- return FALSE; // Nicht versteckter Inhalt wurde gefunden
+ return sal_False; // Nicht versteckter Inhalt wurde gefunden
ASSERT( aTmp.GetNode().IsEndNode(), "EndNode expected" );
}
aTmp++;
}
- return TRUE; // Alles versteckt
+ return sal_True; // Alles versteckt
}
@@ -1416,8 +1418,8 @@ void SwSectionNode::NodesArrChgd()
: pDoc->GetDfltFrmFmt() );
// jetzt noch bei allen im Bereich den richtigen StartNode setzen
- ULONG nStart = GetIndex()+1, nEnde = EndOfSectionIndex();
- for( ULONG n = nStart; n < nEnde; ++n )
+ sal_uLong nStart = GetIndex()+1, nEnde = EndOfSectionIndex();
+ for( sal_uLong n = nStart; n < nEnde; ++n )
// die Verschachtelung der Formate herstellen!
if( 0 != ( pSectNd = rNds[ n ]->GetSectionNode() ) )
{
@@ -1460,22 +1462,22 @@ String SwDoc::GetUniqueSectionName( const String* pChkStr ) const
String aName( aId );
xub_StrLen nNmLen = aName.Len();
- USHORT nNum = 0;
- USHORT nTmp, nFlagSize = ( pSectionFmtTbl->Count() / 8 ) +2;
- BYTE* pSetFlags = new BYTE[ nFlagSize ];
+ sal_uInt16 nNum = 0;
+ sal_uInt16 nTmp, nFlagSize = ( pSectionFmtTbl->Count() / 8 ) +2;
+ sal_uInt8* pSetFlags = new sal_uInt8[ nFlagSize ];
memset( pSetFlags, 0, nFlagSize );
const SwSectionNode* pSectNd;
- USHORT n;
+ sal_uInt16 n;
for( n = 0; n < pSectionFmtTbl->Count(); ++n )
- if( 0 != ( pSectNd = (*pSectionFmtTbl)[ n ]->GetSectionNode( FALSE ) ))
+ if( 0 != ( pSectNd = (*pSectionFmtTbl)[ n ]->GetSectionNode( sal_False ) ))
{
const String& rNm = pSectNd->GetSection().GetSectionName();
if( rNm.Match( aName ) == nNmLen )
{
// Nummer bestimmen und das Flag setzen
- nNum = static_cast<USHORT>(rNm.Copy( nNmLen ).ToInt32());
+ nNum = static_cast<sal_uInt16>(rNm.Copy( nNmLen ).ToInt32());
if( nNum-- && nNum < pSectionFmtTbl->Count() )
pSetFlags[ nNum / 8 ] |= (0x01 << ( nNum & 0x07 ));
}
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index f403dcf09dd6..fbd54bcee102 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -1,3 +1,4 @@
+
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,6 +30,10 @@
#include "precompiled_sw.hxx"
#include <com/sun/star/chart2/XChartDocument.hpp>
+<<<<<<< local
+=======
+
+>>>>>>> other
#include <hintids.hxx>
#include <editeng/lrspitem.hxx>
#include <editeng/brkitem.hxx>
@@ -47,6 +52,8 @@
#include <pagefrm.hxx>
#include <tabcol.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
+#include <UndoManager.hxx>
#include <cntfrm.hxx>
#include <pam.hxx>
#include <swcrsr.hxx>
@@ -58,7 +65,11 @@
#include <fldbas.hxx>
#include <poolfmt.hxx>
#include <tabfrm.hxx>
-#include <undobj.hxx>
+#include <UndoCore.hxx>
+#include <UndoRedline.hxx>
+#include <UndoDelete.hxx>
+#include <UndoTable.hxx>
+#include <hints.hxx>
#include <tblafmt.hxx>
#include <swcache.hxx>
#include <ddefld.hxx>
@@ -110,14 +121,14 @@ const sal_Unicode T2T_PARA = 0x0a;
extern void ClearFEShellTabCols();
// steht im gctable.cxx
-extern BOOL lcl_GC_Line_Border( const SwTableLine*& , void* pPara );
+extern sal_Bool lcl_GC_Line_Border( const SwTableLine*& , void* pPara );
#ifdef DEL_TABLE_REDLINES
class lcl_DelRedlines
{
SwDoc* pDoc;
public:
- lcl_DelRedlines( const SwTableNode& rNd, BOOL bCheckForOwnRedline );
+ lcl_DelRedlines( const SwTableNode& rNd, sal_Bool bCheckForOwnRedline );
lcl_DelRedlines( SwPaM& rPam );
~lcl_DelRedlines() { pDoc->EndUndo(UNDO_EMPTY, NULL); }
@@ -125,24 +136,24 @@ public:
lcl_DelRedlines::lcl_DelRedlines( SwPaM & rPam) : pDoc( rPam.GetDoc() )
{
- pDoc->StartUndo(UNDO_EMPTY, NULL);
+ pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL);
if( !pDoc->IsIgnoreRedline() && pDoc->GetRedlineTbl().Count() )
pDoc->AcceptRedline( rPam, true );
}
#endif
-void lcl_SetDfltBoxAttr( SwFrmFmt& rFmt, BYTE nId )
+void lcl_SetDfltBoxAttr( SwFrmFmt& rFmt, sal_uInt8 nId )
{
- BOOL bTop = FALSE, bBottom = FALSE, bLeft = FALSE, bRight = FALSE;
+ sal_Bool bTop = sal_False, bBottom = sal_False, bLeft = sal_False, bRight = sal_False;
switch ( nId )
{
- case 0: bTop = bBottom = bLeft = TRUE; break;
- case 1: bTop = bBottom = bLeft = bRight = TRUE; break;
- case 2: bBottom = bLeft = TRUE; break;
- case 3: bBottom = bLeft = bRight = TRUE; break;
+ case 0: bTop = bBottom = bLeft = sal_True; break;
+ case 1: bTop = bBottom = bLeft = bRight = sal_True; break;
+ case 2: bBottom = bLeft = sal_True; break;
+ case 3: bBottom = bLeft = bRight = sal_True; break;
}
- const BOOL bHTML = rFmt.getIDocumentSettingAccess()->get(IDocumentSettingAccess::HTML_MODE);
+ const sal_Bool bHTML = rFmt.getIDocumentSettingAccess()->get(IDocumentSettingAccess::HTML_MODE);
Color aCol( bHTML ? COL_GRAY : COL_BLACK );
SvxBorderLine aLine( &aCol, DEF_LINE_WIDTH_0 );
if ( bHTML )
@@ -163,7 +174,7 @@ void lcl_SetDfltBoxAttr( SwFrmFmt& rFmt, BYTE nId )
rFmt.SetFmtAttr( aBox );
}
-void lcl_SetDfltBoxAttr( SwTableBox& rBox, SvPtrarr &rBoxFmtArr, BYTE nId,
+void lcl_SetDfltBoxAttr( SwTableBox& rBox, SvPtrarr &rBoxFmtArr, sal_uInt8 nId,
const SwTableAutoFmt* pAutoFmt = 0 )
{
SvPtrarr* pArr = (SvPtrarr*)rBoxFmtArr[ nId ];
@@ -175,7 +186,7 @@ void lcl_SetDfltBoxAttr( SwTableBox& rBox, SvPtrarr &rBoxFmtArr, BYTE nId,
SwTableBoxFmt* pNewBoxFmt = 0;
SwFrmFmt* pBoxFmt = rBox.GetFrmFmt();
- for( USHORT n = 0; n < pArr->Count(); n += 2 )
+ for( sal_uInt16 n = 0; n < pArr->Count(); n += 2 )
if( pArr->GetObject( n ) == pBoxFmt )
{
pNewBoxFmt = (SwTableBoxFmt*)pArr->GetObject( n + 1 );
@@ -192,7 +203,7 @@ void lcl_SetDfltBoxAttr( SwTableBox& rBox, SvPtrarr &rBoxFmtArr, BYTE nId,
if( pAutoFmt )
pAutoFmt->UpdateToSet( nId, (SfxItemSet&)pNewBoxFmt->GetAttrSet(),
SwTableAutoFmt::UPDATE_BOX,
- pDoc->GetNumberFormatter( TRUE ) );
+ pDoc->GetNumberFormatter( sal_True ) );
else
::lcl_SetDfltBoxAttr( *pNewBoxFmt, nId );
@@ -205,7 +216,7 @@ void lcl_SetDfltBoxAttr( SwTableBox& rBox, SvPtrarr &rBoxFmtArr, BYTE nId,
}
SwTableBoxFmt *lcl_CreateDfltBoxFmt( SwDoc &rDoc, SvPtrarr &rBoxFmtArr,
- USHORT nCols, BYTE nId )
+ sal_uInt16 nCols, sal_uInt8 nId )
{
if ( !rBoxFmtArr[nId] )
{
@@ -221,14 +232,14 @@ SwTableBoxFmt *lcl_CreateDfltBoxFmt( SwDoc &rDoc, SvPtrarr &rBoxFmtArr,
SwTableBoxFmt *lcl_CreateAFmtBoxFmt( SwDoc &rDoc, SvPtrarr &rBoxFmtArr,
const SwTableAutoFmt& rAutoFmt,
- USHORT nCols, BYTE nId )
+ sal_uInt16 nCols, sal_uInt8 nId )
{
if( !rBoxFmtArr[nId] )
{
SwTableBoxFmt* pBoxFmt = rDoc.MakeTableBoxFmt();
rAutoFmt.UpdateToSet( nId, (SfxItemSet&)pBoxFmt->GetAttrSet(),
SwTableAutoFmt::UPDATE_BOX,
- rDoc.GetNumberFormatter( TRUE ) );
+ rDoc.GetNumberFormatter( sal_True ) );
if( USHRT_MAX != nCols )
pBoxFmt->SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE,
USHRT_MAX / nCols, 0 ));
@@ -240,7 +251,7 @@ SwTableBoxFmt *lcl_CreateAFmtBoxFmt( SwDoc &rDoc, SvPtrarr &rBoxFmtArr,
SwTableNode* SwDoc::IsIdxInTbl(const SwNodeIndex& rIdx)
{
SwTableNode* pTableNd = 0;
- ULONG nIndex = rIdx.GetIndex();
+ sal_uLong nIndex = rIdx.GetIndex();
do {
SwNode* pNd = (SwNode*)GetNodes()[ nIndex ]->StartOfSectionNode();
if( 0 != ( pTableNd = pNd->GetTableNode() ) )
@@ -256,20 +267,20 @@ SwTableNode* SwDoc::IsIdxInTbl(const SwNodeIndex& rIdx)
// fuege in der Line, vor der InsPos eine neue Box ein.
-BOOL SwNodes::InsBoxen( SwTableNode* pTblNd,
+sal_Bool SwNodes::InsBoxen( SwTableNode* pTblNd,
SwTableLine* pLine,
SwTableBoxFmt* pBoxFmt,
SwTxtFmtColl* pTxtColl,
const SfxItemSet* pAutoAttr,
- USHORT nInsPos,
- USHORT nCnt )
+ sal_uInt16 nInsPos,
+ sal_uInt16 nCnt )
{
if( !nCnt )
- return FALSE;
+ return sal_False;
ASSERT( pLine, "keine gueltige Zeile" );
// Index hinter die letzte Box der Line
- ULONG nIdxPos = 0;
+ sal_uLong nIdxPos = 0;
SwTableBox *pPrvBox = 0, *pNxtBox = 0;
if( pLine->GetTabBoxes().Count() )
{
@@ -288,7 +299,7 @@ BOOL SwNodes::InsBoxen( SwTableNode* pTblNd,
if( !pPrvBox && !pNxtBox )
{
- BOOL bSetIdxPos = TRUE;
+ sal_Bool bSetIdxPos = sal_True;
if( pTblNd->GetTable().GetTabLines().Count() && !nInsPos )
{
const SwTableLine* pTblLn = pLine;
@@ -301,7 +312,7 @@ BOOL SwNodes::InsBoxen( SwTableNode* pTblNd,
while( ( pNxtBox = pLine->GetTabBoxes()[0])->GetTabLines().Count() )
pLine = pNxtBox->GetTabLines()[0];
nIdxPos = pNxtBox->GetSttIdx();
- bSetIdxPos = FALSE;
+ bSetIdxPos = sal_False;
}
}
if( bSetIdxPos )
@@ -314,7 +325,7 @@ BOOL SwNodes::InsBoxen( SwTableNode* pTblNd,
nIdxPos = pPrvBox->GetSttNd()->EndOfSectionIndex() + 1;
SwNodeIndex aEndIdx( *this, nIdxPos );
- for( USHORT n = 0; n < nCnt; ++n )
+ for( sal_uInt16 n = 0; n < nCnt; ++n )
{
SwStartNode* pSttNd = new SwStartNode( aEndIdx, ND_STARTNODE,
SwTableBoxStartNode );
@@ -324,7 +335,7 @@ BOOL SwNodes::InsBoxen( SwTableNode* pTblNd,
pPrvBox = new SwTableBox( pBoxFmt, *pSttNd, pLine );
SwTableBoxes & rTabBoxes = pLine->GetTabBoxes();
- USHORT nRealInsPos = nInsPos + n;
+ sal_uInt16 nRealInsPos = nInsPos + n;
if (nRealInsPos > rTabBoxes.Count())
nRealInsPos = rTabBoxes.Count();
@@ -348,18 +359,18 @@ BOOL SwNodes::InsBoxen( SwTableNode* pTblNd,
pTNd->ChgFmtColl( pTxtColl );
}
}
- return TRUE;
+ return sal_True;
}
// --------------- einfuegen einer neuen Tabelle --------------
const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts,
- const SwPosition& rPos, USHORT nRows,
- USHORT nCols, sal_Int16 eAdjust,
+ const SwPosition& rPos, sal_uInt16 nRows,
+ sal_uInt16 nCols, sal_Int16 eAdjust,
const SwTableAutoFmt* pTAFmt,
const SvUShorts* pColArr,
- BOOL bCalledFromShell,
- BOOL bNewModel )
+ sal_Bool bCalledFromShell,
+ sal_Bool bNewModel )
{
ASSERT( nRows, "Tabelle ohne Zeile?" );
ASSERT( nCols, "Tabelle ohne Spalten?" );
@@ -378,10 +389,10 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts,
String aTblName = GetUniqueTblName();
- if( DoesUndo() )
+ if( GetIDocumentUndoRedo().DoesUndo() )
{
- ClearRedo();
- AppendUndo( new SwUndoInsTbl( rPos, nCols, nRows, static_cast<USHORT>(eAdjust),
+ GetIDocumentUndoRedo().AppendUndo(
+ new SwUndoInsTbl( rPos, nCols, nRows, static_cast<sal_uInt16>(eAdjust),
rInsTblOpts, pTAFmt, pColArr,
aTblName));
}
@@ -391,12 +402,12 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts,
SwTxtFmtColl *pBodyColl = GetTxtCollFromPool( RES_POOLCOLL_TABLE ),
*pHeadColl = pBodyColl;
- BOOL bDfltBorders = 0 != ( rInsTblOpts.mnInsMode & tabopts::DEFAULT_BORDER );
+ sal_Bool bDfltBorders = 0 != ( rInsTblOpts.mnInsMode & tabopts::DEFAULT_BORDER );
if( (rInsTblOpts.mnInsMode & tabopts::HEADLINE) && (1 != nRows || !bDfltBorders) )
pHeadColl = GetTxtCollFromPool( RES_POOLCOLL_TABLE_HDLN );
- const USHORT nRowsToRepeat =
+ const sal_uInt16 nRowsToRepeat =
tabopts::HEADLINE == (rInsTblOpts.mnInsMode & tabopts::HEADLINE) ?
rInsTblOpts.mnRowsToRepeat :
0;
@@ -428,7 +439,7 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts,
const SwAttrSet & aNdSet = pCntntNd->GetSwAttrSet();
const SfxPoolItem *pItem = NULL;
- if (SFX_ITEM_SET == aNdSet.GetItemState( RES_FRAMEDIR, TRUE, &pItem )
+ if (SFX_ITEM_SET == aNdSet.GetItemState( RES_FRAMEDIR, sal_True, &pItem )
&& pItem != NULL)
{
pTableFmt->SetFmtAttr( *pItem );
@@ -444,12 +455,12 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts,
SwTwips nWidth = USHRT_MAX;
if( pColArr )
{
- USHORT nSttPos = (*pColArr)[ 0 ];
- USHORT nLastPos = (*pColArr)[ USHORT(pColArr->Count()-1)];
+ sal_uInt16 nSttPos = (*pColArr)[ 0 ];
+ sal_uInt16 nLastPos = (*pColArr)[ sal_uInt16(pColArr->Count()-1)];
if( text::HoriOrientation::NONE == eAdjust )
{
- USHORT nFrmWidth = nLastPos;
- nLastPos = (*pColArr)[ USHORT(pColArr->Count()-2)];
+ sal_uInt16 nFrmWidth = nLastPos;
+ nLastPos = (*pColArr)[ sal_uInt16(pColArr->Count()-2)];
pTableFmt->SetFmtAttr( SvxLRSpaceItem( nSttPos, nFrmWidth - nLastPos, 0, 0, RES_LR_SPACE ) );
}
nWidth = nLastPos - nSttPos;
@@ -461,7 +472,7 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts,
}
pTableFmt->SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE, nWidth ));
if( !(rInsTblOpts.mnInsMode & tabopts::SPLIT_LAYOUT) )
- pTableFmt->SetFmtAttr( SwFmtLayoutSplit( FALSE ));
+ pTableFmt->SetFmtAttr( SwFmtLayoutSplit( sal_False ));
// verschiebe ggfs. die harten PageDesc/PageBreak Attribute:
SwCntntNode* pNextNd = GetNodes()[ pTblNd->EndOfSectionIndex()+1 ]
@@ -470,14 +481,14 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts,
{
const SfxItemSet* pNdSet = pNextNd->GetpSwAttrSet();
const SfxPoolItem *pItem;
- if( SFX_ITEM_SET == pNdSet->GetItemState( RES_PAGEDESC, FALSE,
+ if( SFX_ITEM_SET == pNdSet->GetItemState( RES_PAGEDESC, sal_False,
&pItem ) )
{
pTableFmt->SetFmtAttr( *pItem );
pNextNd->ResetAttr( RES_PAGEDESC );
pNdSet = pNextNd->GetpSwAttrSet();
}
- if( pNdSet && SFX_ITEM_SET == pNdSet->GetItemState( RES_BREAK, FALSE,
+ if( pNdSet && SFX_ITEM_SET == pNdSet->GetItemState( RES_BREAK, sal_False,
&pItem ) )
{
pTableFmt->SetFmtAttr( *pItem );
@@ -500,8 +511,8 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts,
}
else
{
- const USHORT nBoxArrLen = pTAFmt ? 16 : 4;
- for( USHORT i = 0; i < nBoxArrLen; ++i )
+ const sal_uInt16 nBoxArrLen = pTAFmt ? 16 : 4;
+ for( sal_uInt16 i = 0; i < nBoxArrLen; ++i )
aBoxFmtArr.Insert( (void*)0, i );
}
// --> OD 2008-02-25 #refactorlists#
@@ -511,19 +522,19 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts,
SwNodeIndex aNdIdx( *pTblNd, 1 ); // auf den ersten Box-StartNode
SwTableLines& rLines = pNdTbl->GetTabLines();
- for( USHORT n = 0; n < nRows; ++n )
+ for( sal_uInt16 n = 0; n < nRows; ++n )
{
SwTableLine* pLine = new SwTableLine( pLineFmt, nCols, 0 );
rLines.C40_INSERT( SwTableLine, pLine, n );
SwTableBoxes& rBoxes = pLine->GetTabBoxes();
- for( USHORT i = 0; i < nCols; ++i )
+ for( sal_uInt16 i = 0; i < nCols; ++i )
{
SwTableBoxFmt *pBoxF;
if( pTAFmt )
{
- BYTE nId = static_cast<BYTE>(!n ? 0 : (( n+1 == nRows )
+ sal_uInt8 nId = static_cast<sal_uInt8>(!n ? 0 : (( n+1 == nRows )
? 12 : (4 * (1 + ((n-1) & 1 )))));
- nId = nId + static_cast<BYTE>( !i ? 0 :
+ nId = nId + static_cast<sal_uInt8>( !i ? 0 :
( i+1 == nCols ? 3 : (1 + ((i-1) & 1))));
pBoxF = ::lcl_CreateAFmtBoxFmt( *this, aBoxFmtArr, *pTAFmt,
nCols, nId );
@@ -541,7 +552,7 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts,
}
else if( bDfltBorders )
{
- BYTE nBoxId = (i < nCols - 1 ? 0 : 1) + (n ? 2 : 0 );
+ sal_uInt8 nBoxId = (i < nCols - 1 ? 0 : 1) + (n ? 2 : 0 );
pBoxF = ::lcl_CreateDfltBoxFmt( *this, aBoxFmtArr, nCols, nBoxId);
}
else
@@ -552,7 +563,7 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts,
// Positionen der Spalten!! (nicht deren Breite!)
if( pColArr )
{
- nWidth = (*pColArr)[ USHORT(i + 1) ] - (*pColArr)[ i ];
+ nWidth = (*pColArr)[ sal_uInt16(i + 1) ] - (*pColArr)[ i ];
if( pBoxF->GetFrmSize().GetWidth() != nWidth )
{
if( pBoxF->GetDepends() ) // neues Format erzeugen!
@@ -589,10 +600,10 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts,
}
SwTableNode* SwNodes::InsertTable( const SwNodeIndex& rNdIdx,
- USHORT nBoxes,
+ sal_uInt16 nBoxes,
SwTxtFmtColl* pCntntTxtColl,
- USHORT nLines,
- USHORT nRepeat,
+ sal_uInt16 nLines,
+ sal_uInt16 nRepeat,
SwTxtFmtColl* pHeadlineTxtColl,
const SwAttrSet * pAttrSet)
{
@@ -611,9 +622,9 @@ SwTableNode* SwNodes::InsertTable( const SwNodeIndex& rNdIdx,
SwNodeIndex aIdx( *pEndNd );
SwTxtFmtColl* pTxtColl = pHeadlineTxtColl;
- for( USHORT nL = 0; nL < nLines; ++nL )
+ for( sal_uInt16 nL = 0; nL < nLines; ++nL )
{
- for( USHORT nB = 0; nB < nBoxes; ++nB )
+ for( sal_uInt16 nB = 0; nB < nBoxes; ++nB )
{
SwStartNode* pSttNd = new SwStartNode( aIdx, ND_STARTNODE,
SwTableBoxStartNode );
@@ -626,17 +637,17 @@ SwTableNode* SwNodes::InsertTable( const SwNodeIndex& rNdIdx,
const SfxPoolItem* pItem = NULL;
if ( NULL != pAttrSet )
{
- static const USHORT aPropagateItems[] = {
+ static const sal_uInt16 aPropagateItems[] = {
RES_PARATR_ADJUST,
RES_CHRATR_FONT, RES_CHRATR_FONTSIZE,
RES_CHRATR_CJK_FONT, RES_CHRATR_CJK_FONTSIZE,
RES_CHRATR_CTL_FONT, RES_CHRATR_CTL_FONTSIZE, 0 };
- const USHORT* pIdx = aPropagateItems;
+ const sal_uInt16* pIdx = aPropagateItems;
while ( *pIdx != 0 )
{
if ( SFX_ITEM_SET != pTmpNd->GetSwAttrSet().GetItemState( *pIdx ) &&
- SFX_ITEM_SET == pAttrSet->GetItemState( *pIdx, TRUE, &pItem ) )
+ SFX_ITEM_SET == pAttrSet->GetItemState( *pIdx, sal_True, &pItem ) )
static_cast<SwCntntNode *>(pTmpNd)->SetAttr(*pItem);
++pIdx;
}
@@ -662,7 +673,7 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts,
// pruefe ob in der Selection eine Tabelle liegt
const SwPosition *pStt = rRange.Start(), *pEnd = rRange.End();
{
- ULONG nCnt = pStt->nNode.GetIndex();
+ sal_uLong nCnt = pStt->nNode.GetIndex();
for( ; nCnt <= pEnd->nNode.GetIndex(); ++nCnt )
if( !GetNodes()[ nCnt ]->IsTxtNode() )
return 0;
@@ -680,15 +691,15 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts,
#endif
SwUndoTxtToTbl* pUndo = 0;
- if( DoesUndo() )
+ if( GetIDocumentUndoRedo().DoesUndo() )
{
- StartUndo( UNDO_TEXTTOTABLE, NULL );
+ GetIDocumentUndoRedo().StartUndo( UNDO_TEXTTOTABLE, NULL );
pUndo = new SwUndoTxtToTbl( aOriginal, rInsTblOpts, cCh,
- static_cast<USHORT>(eAdjust), pTAFmt );
- AppendUndo( pUndo );
+ static_cast<sal_uInt16>(eAdjust), pTAFmt );
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
// das Splitten vom TextNode nicht in die Undohistory aufnehmen
- DoUndo( FALSE );
+ GetIDocumentUndoRedo().DoUndo( false );
}
::PaMCorrAbs( aOriginal, *pEnd );
@@ -698,7 +709,7 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts,
if( pStt->nContent.GetIndex() )
SplitNode( *pStt, false );
- BOOL bEndCntnt = 0 != pEnd->nContent.GetIndex();
+ sal_Bool bEndCntnt = 0 != pEnd->nContent.GetIndex();
// nicht splitten am Ende der Zeile (aber am Ende vom Doc!!)
if( bEndCntnt )
{
@@ -720,14 +731,14 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts,
if( aRg.aEnd.GetIndex() == aRg.aStart.GetIndex() )
{
- ASSERT( FALSE, "Kein Bereich" );
+ ASSERT( sal_False, "Kein Bereich" );
aRg.aEnd++;
}
// Wir gehen jetzt immer ueber die Upper, um die Tabelle einzufuegen:
SwNode2Layout aNode2Layout( aRg.aStart.GetNode() );
- DoUndo( 0 != pUndo );
+ GetIDocumentUndoRedo().DoUndo( 0 != pUndo );
// dann erstelle die Box/Line/Table-Struktur
SwTableBoxFmt* pBoxFmt = MakeTableBoxFmt();
@@ -739,7 +750,7 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts,
// die Tabelle bekommt USHRT_MAX als default SSize
pTableFmt->SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE, USHRT_MAX ));
if( !(rInsTblOpts.mnInsMode & tabopts::SPLIT_LAYOUT) )
- pTableFmt->SetFmtAttr( SwFmtLayoutSplit( FALSE ));
+ pTableFmt->SetFmtAttr( 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
@@ -749,7 +760,7 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts,
const SwAttrSet & aNdSet = pSttCntntNd->GetSwAttrSet();
const SfxPoolItem *pItem = NULL;
- if (SFX_ITEM_SET == aNdSet.GetItemState( RES_FRAMEDIR, TRUE, &pItem )
+ if (SFX_ITEM_SET == aNdSet.GetItemState( RES_FRAMEDIR, sal_True, &pItem )
&& pItem != NULL)
{
pTableFmt->SetFmtAttr( *pItem );
@@ -763,18 +774,18 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts,
SwTable * pNdTbl = &pTblNd->GetTable();
ASSERT( pNdTbl, "kein Tabellen-Node angelegt." )
- const USHORT nRowsToRepeat =
+ const sal_uInt16 nRowsToRepeat =
tabopts::HEADLINE == (rInsTblOpts.mnInsMode & tabopts::HEADLINE) ?
rInsTblOpts.mnRowsToRepeat :
0;
pNdTbl->SetRowsToRepeat( nRowsToRepeat );
- BOOL bUseBoxFmt = FALSE;
+ sal_Bool bUseBoxFmt = sal_False;
if( !pBoxFmt->GetDepends() )
{
// die Formate an den Boxen haben schon die richtige Size, es darf
// also nur noch die richtige Umrandung/AutoFmt gesetzt werden.
- bUseBoxFmt = TRUE;
+ bUseBoxFmt = sal_True;
pTableFmt->SetFmtAttr( pBoxFmt->GetFrmSize() );
delete pBoxFmt;
eAdjust = text::HoriOrientation::NONE;
@@ -786,10 +797,10 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts,
if( pTAFmt || ( rInsTblOpts.mnInsMode & tabopts::DEFAULT_BORDER) )
{
- BYTE nBoxArrLen = pTAFmt ? 16 : 4;
+ sal_uInt8 nBoxArrLen = pTAFmt ? 16 : 4;
SvPtrarr aBoxFmtArr( nBoxArrLen, 0 );
{
- for( BYTE i = 0; i < nBoxArrLen; ++i )
+ for( sal_uInt8 i = 0; i < nBoxArrLen; ++i )
aBoxFmtArr.Insert( (void*)0, i );
}
@@ -801,21 +812,21 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts,
SwTableBoxFmt *pBoxF = 0;
SwTableLines& rLines = pNdTbl->GetTabLines();
- USHORT nRows = rLines.Count();
- for( USHORT n = 0; n < nRows; ++n )
+ sal_uInt16 nRows = rLines.Count();
+ for( sal_uInt16 n = 0; n < nRows; ++n )
{
SwTableBoxes& rBoxes = rLines[ n ]->GetTabBoxes();
- USHORT nCols = rBoxes.Count();
- for( USHORT i = 0; i < nCols; ++i )
+ sal_uInt16 nCols = rBoxes.Count();
+ for( sal_uInt16 i = 0; i < nCols; ++i )
{
SwTableBox* pBox = rBoxes[ i ];
- BOOL bChgSz = FALSE;
+ sal_Bool bChgSz = sal_False;
if( pTAFmt )
{
- BYTE nId = static_cast<BYTE>(!n ? 0 : (( n+1 == nRows )
+ sal_uInt8 nId = static_cast<sal_uInt8>(!n ? 0 : (( n+1 == nRows )
? 12 : (4 * (1 + ((n-1) & 1 )))));
- nId = nId + static_cast<BYTE>(!i ? 0 :
+ nId = nId + static_cast<sal_uInt8>(!i ? 0 :
( i+1 == nCols ? 3 : (1 + ((i-1) & 1))));
if( bUseBoxFmt )
::lcl_SetDfltBoxAttr( *pBox, aBoxFmtArr, nId, pTAFmt );
@@ -834,8 +845,8 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts,
SwTableAutoFmt::UPDATE_CHAR, 0 );
if( aCharSet.Count() )
{
- ULONG nSttNd = pBox->GetSttIdx()+1;
- ULONG nEndNd = pBox->GetSttNd()->EndOfSectionIndex();
+ sal_uLong nSttNd = pBox->GetSttIdx()+1;
+ sal_uLong nEndNd = pBox->GetSttNd()->EndOfSectionIndex();
for( ; nSttNd < nEndNd; ++nSttNd )
{
SwCntntNode* pNd = GetNodes()[ nSttNd ]->GetCntntNode();
@@ -855,7 +866,7 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts,
}
else
{
- BYTE nId = (i < nCols - 1 ? 0 : 1) + (n ? 2 : 0 );
+ sal_uInt8 nId = (i < nCols - 1 ? 0 : 1) + (n ? 2 : 0 );
if( bUseBoxFmt )
::lcl_SetDfltBoxAttr( *pBox, aBoxFmtArr, nId );
else
@@ -877,7 +888,7 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts,
if( bUseBoxFmt )
{
- for( BYTE i = 0; i < nBoxArrLen; ++i )
+ for( sal_uInt8 i = 0; i < nBoxArrLen; ++i )
{
SvPtrarr* pArr = (SvPtrarr*)aBoxFmtArr[ i ];
delete pArr;
@@ -888,11 +899,11 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts,
// JP 03.04.97: Inhalt der Boxen auf Zahlen abpruefen
if( IsInsTblFormatNum() )
{
- for( USHORT nBoxes = pNdTbl->GetTabSortBoxes().Count(); nBoxes; )
- ChkBoxNumFmt( *pNdTbl->GetTabSortBoxes()[ --nBoxes ], FALSE );
+ for( sal_uInt16 nBoxes = pNdTbl->GetTabSortBoxes().Count(); nBoxes; )
+ ChkBoxNumFmt( *pNdTbl->GetTabSortBoxes()[ --nBoxes ], sal_False );
}
- ULONG nIdx = pTblNd->GetIndex();
+ sal_uLong nIdx = pTblNd->GetIndex();
aNode2Layout.RestoreUpperFrms( GetNodes(), nIdx, nIdx + 1 );
{
@@ -904,7 +915,9 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts,
}
if( pUndo )
- EndUndo( UNDO_TEXTTOTABLE, NULL );
+ {
+ GetIDocumentUndoRedo().EndUndo( UNDO_TEXTTOTABLE, NULL );
+ }
SetModified();
SetFieldsDirty(true, NULL, 0);
@@ -929,7 +942,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh,
SwTable * pTable = &pTblNd->GetTable();
SwTableLine* pLine;
SwTableBox* pBox;
- USHORT nBoxes, nLines, nMaxBoxes = 0;
+ sal_uInt16 nBoxes, nLines, nMaxBoxes = 0;
SwNodeIndex aSttIdx( *pTblNd, 1 );
SwNodeIndex aEndIdx( rRange.aEnd, -1 );
@@ -954,14 +967,14 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh,
{
if( *pTxt == cCh )
{
- aPosArr.Insert( static_cast<USHORT>(
- aFInfo.GetCharPos( nChPos+1, FALSE )),
+ aPosArr.Insert( static_cast<sal_uInt16>(
+ aFInfo.GetCharPos( nChPos+1, sal_False )),
aPosArr.Count() );
}
}
aPosArr.Insert( /*aFInfo.GetFrm()->Frm().Left() +*/
- static_cast<USHORT>(aFInfo.GetFrm()->IsVertical() ?
+ static_cast<sal_uInt16>(aFInfo.GetFrm()->IsVertical() ?
aFInfo.GetFrm()->Prt().Bottom() :
aFInfo.GetFrm()->Prt().Right()),
aPosArr.Count() );
@@ -979,7 +992,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh,
// erfolgen, denn sonst stehen sie falsch in der History !!!
// SwRegHistory aRegH( pTxtNd, *pTxtNd, pHistory );
const SfxPoolItem* pItem;
- if( SFX_ITEM_SET == pSet->GetItemState( RES_BREAK, FALSE, &pItem ) )
+ if( SFX_ITEM_SET == pSet->GetItemState( RES_BREAK, sal_False, &pItem ) )
{
if( !nLines )
pTblFmt->SetFmtAttr( *pItem );
@@ -988,7 +1001,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh,
}
if( pSet && SFX_ITEM_SET == pSet->GetItemState(
- RES_PAGEDESC, FALSE, &pItem ) &&
+ RES_PAGEDESC, sal_False, &pItem ) &&
((SwFmtPageDesc*)pItem)->GetPageDesc() )
{
if( !nLines )
@@ -1059,7 +1072,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh,
}
// die Tabelle ausgleichen, leere Sections einfuegen
- USHORT n;
+ sal_uInt16 n;
for( n = 0; n < pTable->GetTabLines().Count(); ++n )
{
@@ -1070,7 +1083,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh,
nBoxes, nMaxBoxes - nBoxes );
if( pUndo )
- for( USHORT i = nBoxes; i < nMaxBoxes; ++i )
+ for( sal_uInt16 i = nBoxes; i < nMaxBoxes; ++i )
pUndo->AddFillBox( *pCurrLine->GetTabBoxes()[ i ] );
// fehlen der 1. Line Boxen, dann kann man das Breiten Array
@@ -1083,13 +1096,13 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh,
if( aPosArr.Count() )
{
SwTableLines& rLns = pTable->GetTabLines();
- USHORT nLastPos = 0;
+ sal_uInt16 nLastPos = 0;
for( n = 0; n < aPosArr.Count(); ++n )
{
SwTableBoxFmt *pNewFmt = pDoc->MakeTableBoxFmt();
pNewFmt->SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE,
aPosArr[ n ] - nLastPos ));
- for( USHORT nTmpLine = 0; nTmpLine < rLns.Count(); ++nTmpLine )
+ for( sal_uInt16 nTmpLine = 0; nTmpLine < rLns.Count(); ++nTmpLine )
//JP 24.06.98: hier muss ein Add erfolgen, da das BoxFormat
// von der rufenden Methode noch gebraucht wird!
pNewFmt->Add( rLns[ nTmpLine ]->GetTabBoxes()[ n ] );
@@ -1134,11 +1147,19 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector<SwNodeRange> >
lcl_DelRedlines aDelRedl( aOriginal );
#endif
- SwUndoTxtToTbl* pUndo = 0;
- if( DoesUndo() )
+// SwUndoTxtToTbl* pUndo = 0;
+ bool const bUndo(GetIDocumentUndoRedo().DoesUndo());
+ if (bUndo)
{
+<<<<<<< local
+=======
+// GetIDocumentUndoRedo().StartUndo( UNDO_TEXTTOTABLE );
+// pUndo = new SwUndoTxtToTbl( aOriginal, rInsTblOpts, cCh, eAdjust, pTAFmt );
+// GetIDocumentUndoRedo().AppendUndo(pUndo);
+
+>>>>>>> other
// das Splitten vom TextNode nicht in die Undohistory aufnehmen
- DoUndo( FALSE );
+ GetIDocumentUndoRedo().DoUndo(false);
}
::PaMCorrAbs( aOriginal, *pEnd );
@@ -1148,7 +1169,7 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector<SwNodeRange> >
if( pStt->nContent.GetIndex() )
SplitNode( *pStt, false );
- BOOL bEndCntnt = 0 != pEnd->nContent.GetIndex();
+ sal_Bool bEndCntnt = 0 != pEnd->nContent.GetIndex();
// nicht splitten am Ende der Zeile (aber am Ende vom Doc!!)
if( bEndCntnt )
{
@@ -1170,14 +1191,14 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector<SwNodeRange> >
if( aRg.aEnd.GetIndex() == aRg.aStart.GetIndex() )
{
- ASSERT( FALSE, "Kein Bereich" );
+ ASSERT( sal_False, "Kein Bereich" );
aRg.aEnd++;
}
// Wir gehen jetzt immer ueber die Upper, um die Tabelle einzufuegen:
SwNode2Layout aNode2Layout( aRg.aStart.GetNode() );
- DoUndo( 0 != pUndo );
+ GetIDocumentUndoRedo().DoUndo(bUndo);
// dann erstelle die Box/Line/Table-Struktur
SwTableBoxFmt* pBoxFmt = MakeTableBoxFmt();
@@ -1188,6 +1209,11 @@ 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 ));
+<<<<<<< local
+=======
+// if( !(rInsTblOpts.mnInsMode & tabopts::SPLIT_LAYOUT) )
+// pTableFmt->SetAttr( SwFmtLayoutSplit( sal_False ));
+>>>>>>> other
/* #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
@@ -1197,7 +1223,7 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector<SwNodeRange> >
const SwAttrSet & aNdSet = pSttCntntNd->GetSwAttrSet();
const SfxPoolItem *pItem = NULL;
- if (SFX_ITEM_SET == aNdSet.GetItemState( RES_FRAMEDIR, TRUE, &pItem )
+ if (SFX_ITEM_SET == aNdSet.GetItemState( RES_FRAMEDIR, sal_True, &pItem )
&& pItem != NULL)
{
pTableFmt->SetFmtAttr( *pItem );
@@ -1210,21 +1236,54 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector<SwNodeRange> >
SwTable * pNdTbl = &pTblNd->GetTable();
ASSERT( pNdTbl, "kein Tabellen-Node angelegt." )
+<<<<<<< local
pNdTbl->RegisterToFormat( *pTableFmt );
+=======
+ pTableFmt->Add( pNdTbl ); // das Frame-Format setzen
+
+// const sal_uInt16 nRowsToRepeat =
+// tabopts::HEADLINE == (rInsTblOpts.mnInsMode & tabopts::HEADLINE) ?
+// rInsTblOpts.mnRowsToRepeat :
+// 0;
+// pNdTbl->SetRowsToRepeat( nRowsToRepeat );
+>>>>>>> other
- BOOL bUseBoxFmt = FALSE;
+ sal_Bool bUseBoxFmt = sal_False;
if( !pBoxFmt->GetDepends() )
{
// die Formate an den Boxen haben schon die richtige Size, es darf
// also nur noch die richtige Umrandung/AutoFmt gesetzt werden.
- bUseBoxFmt = TRUE;
+ bUseBoxFmt = sal_True;
pTableFmt->SetFmtAttr( pBoxFmt->GetFrmSize() );
delete pBoxFmt;
}
+<<<<<<< local
ULONG nIdx = pTblNd->GetIndex();
+=======
+ //Orientation am Fmt der Table setzen
+// pTableFmt->SetAttr( SwFmtHoriOrient( 0, eAdjust ) );
+// pTableFmt->Add( pNdTbl ); // das Frame-Format setzen
+
+
+ sal_uLong nIdx = pTblNd->GetIndex();
+>>>>>>> other
aNode2Layout.RestoreUpperFrms( GetNodes(), nIdx, nIdx + 1 );
+<<<<<<< local
+=======
+ {
+// 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 );
+
+>>>>>>> other
SetModified();
SetFieldsDirty( true, NULL, 0 );
return pNdTbl;
@@ -1327,7 +1386,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodes::TableRanges_t & rTableNodes,
SwTable * pTable = &pTblNd->GetTable();
SwTableLine* pLine;
SwTableBox* pBox;
- USHORT nBoxes, nLines, nMaxBoxes = 0;
+ sal_uInt16 nBoxes, nLines, nMaxBoxes = 0;
// SwHistory* pHistory = pUndo ? &pUndo->GetHistory() : 0;
@@ -1355,7 +1414,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodes::TableRanges_t & rTableNodes,
// erfolgen, denn sonst stehen sie falsch in der History !!!
// SwRegHistory aRegH( pTxtNd, *pTxtNd, pHistory );
const SfxPoolItem* pItem;
- if( SFX_ITEM_SET == pSet->GetItemState( RES_BREAK, FALSE, &pItem ) )
+ if( SFX_ITEM_SET == pSet->GetItemState( RES_BREAK, sal_False, &pItem ) )
{
if( !nLines )
pTblFmt->SetFmtAttr( *pItem );
@@ -1364,7 +1423,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodes::TableRanges_t & rTableNodes,
}
if( pSet && SFX_ITEM_SET == pSet->GetItemState(
- RES_PAGEDESC, FALSE, &pItem ) &&
+ RES_PAGEDESC, sal_False, &pItem ) &&
((SwFmtPageDesc*)pItem)->GetPageDesc() )
{
if( !nLines )
@@ -1434,18 +1493,18 @@ SwTableNode* SwNodes::TextToTable( const SwNodes::TableRanges_t & rTableNodes,
}
// die Tabelle ausgleichen, leere Sections einfuegen
- USHORT n;
+ sal_uInt16 n;
if( aPosArr.Count() )
{
SwTableLines& rLns = pTable->GetTabLines();
- USHORT nLastPos = 0;
+ sal_uInt16 nLastPos = 0;
for( n = 0; n < aPosArr.Count(); ++n )
{
SwTableBoxFmt *pNewFmt = pDoc->MakeTableBoxFmt();
pNewFmt->SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE,
aPosArr[ n ] - nLastPos ));
- for( USHORT nLines2 = 0; nLines2 < rLns.Count(); ++nLines2 )
+ for( sal_uInt16 nLines2 = 0; nLines2 < rLns.Count(); ++nLines2 )
//JP 24.06.98: hier muss ein Add erfolgen, da das BoxFormat
// von der rufenden Methode noch gebraucht wird!
pNewFmt->Add( rLns[ nLines2 ]->GetTabBoxes()[ n ] );
@@ -1469,10 +1528,10 @@ SwTableNode* SwNodes::TextToTable( const SwNodes::TableRanges_t & rTableNodes,
//---------------- Tabelle -> Text -----------------------
-BOOL SwDoc::TableToText( const SwTableNode* pTblNd, sal_Unicode cCh )
+sal_Bool SwDoc::TableToText( const SwTableNode* pTblNd, sal_Unicode cCh )
{
if( !pTblNd )
- return FALSE;
+ return sal_False;
// --> FME 2004-09-28 #i34471#
// If this is trigged by SwUndoTblToTxt::Repeat() nobody ever deleted
@@ -1483,15 +1542,15 @@ BOOL SwDoc::TableToText( const SwTableNode* pTblNd, sal_Unicode cCh )
// <--
#ifdef DEL_TABLE_REDLINES
- lcl_DelRedlines aDelRedl( *pTblNd, FALSE );
+ lcl_DelRedlines aDelRedl( *pTblNd, sal_False );
#endif
SwNodeRange aRg( *pTblNd, 0, *pTblNd->EndOfSectionNode() );
SwUndoTblToTxt* pUndo = 0;
SwNodeRange* pUndoRg = 0;
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
+ GetIDocumentUndoRedo().ClearRedo();
pUndoRg = new SwNodeRange( aRg.aStart, -1, aRg.aEnd, +1 );
pUndo = new SwUndoTblToTxt( pTblNd->GetTable(), cCh );
}
@@ -1500,13 +1559,13 @@ BOOL SwDoc::TableToText( const SwTableNode* pTblNd, sal_Unicode cCh )
aMsgHnt.eFlags = TBL_BOXNAME;
UpdateTblFlds( &aMsgHnt );
- BOOL bRet = GetNodes().TableToText( aRg, cCh, pUndo );
+ sal_Bool bRet = GetNodes().TableToText( aRg, cCh, pUndo );
if( pUndoRg )
{
pUndoRg->aStart++;
pUndoRg->aEnd--;
pUndo->SetRange( *pUndoRg );
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
delete pUndoRg;
}
@@ -1534,9 +1593,9 @@ struct _DelTabPara
// forward deklarieren damit sich die Lines und Boxen rekursiv aufrufen
// koennen.
-BOOL lcl_DelBox( const SwTableBox*&, void *pPara );
+sal_Bool lcl_DelBox( const SwTableBox*&, void *pPara );
-BOOL lcl_DelLine( const SwTableLine*& rpLine, void* pPara )
+sal_Bool lcl_DelLine( const SwTableLine*& rpLine, void* pPara )
{
ASSERT( pPara, "die Parameter fehlen" );
_DelTabPara aPara( *(_DelTabPara*)pPara );
@@ -1544,11 +1603,11 @@ BOOL lcl_DelLine( const SwTableLine*& rpLine, void* pPara )
if( rpLine->GetUpper() ) // gibt es noch eine uebergeordnete Box ??
// dann gebe den letzten TextNode zurueck
((_DelTabPara*)pPara)->pLastNd = aPara.pLastNd;
- return TRUE;
+ return sal_True;
}
-BOOL lcl_DelBox( const SwTableBox*& rpBox, void* pPara )
+sal_Bool lcl_DelBox( const SwTableBox*& rpBox, void* pPara )
{
ASSERT( pPara, "die Parameter fehlen" );
@@ -1568,7 +1627,7 @@ BOOL lcl_DelBox( const SwTableBox*& rpBox, void* pPara )
0 != ( pCurTxtNd = aDelRg.aStart.GetNode().GetTxtNode() ))
{
// Join the current text node with the last from the previous box if possible
- ULONG nNdIdx = aDelRg.aStart.GetIndex();
+ sal_uLong nNdIdx = aDelRg.aStart.GetIndex();
aDelRg.aStart--;
if( pDelPara->pLastNd == &aDelRg.aStart.GetNode() )
{
@@ -1608,19 +1667,19 @@ BOOL lcl_DelBox( const SwTableBox*& rpBox, void* pPara )
if( pDelPara->pLastNd && pDelPara->pLastNd->HasSwAttrSet() )
pDelPara->pLastNd->ResetAttr( RES_PARATR_ADJUST );
}
- return TRUE;
+ return sal_True;
}
-BOOL SwNodes::TableToText( const SwNodeRange& rRange, sal_Unicode cCh,
+sal_Bool SwNodes::TableToText( const SwNodeRange& rRange, sal_Unicode cCh,
SwUndoTblToTxt* pUndo )
{
// ist eine Tabelle selektiert ?
SwTableNode* pTblNd;
if( rRange.aStart.GetIndex() >= rRange.aEnd.GetIndex() ||
- 0 == ( pTblNd = (*this)[ rRange.aStart ]->GetTableNode()) ||
+ 0 == ( pTblNd = rRange.aStart.GetNode().GetTableNode()) ||
&rRange.aEnd.GetNode() != pTblNd->EndOfSectionNode() )
- return FALSE;
+ return sal_False;
// stand die Tabelle ganz alleine in einer Section ?
// dann ueber den Upper der Tabelle die Frames anlegen
@@ -1649,9 +1708,9 @@ BOOL SwNodes::TableToText( const SwNodeRange& rRange, sal_Unicode cCh,
// was ist mit UNDO???
const SfxItemSet& rTblSet = pTblNd->pTable->GetFrmFmt()->GetAttrSet();
const SfxPoolItem *pBreak, *pDesc;
- if( SFX_ITEM_SET != rTblSet.GetItemState( RES_PAGEDESC, FALSE, &pDesc ))
+ if( SFX_ITEM_SET != rTblSet.GetItemState( RES_PAGEDESC, sal_False, &pDesc ))
pDesc = 0;
- if( SFX_ITEM_SET != rTblSet.GetItemState( RES_BREAK, FALSE, &pBreak ))
+ if( SFX_ITEM_SET != rTblSet.GetItemState( RES_BREAK, sal_False, &pBreak ))
pBreak = 0;
if( pBreak || pDesc )
@@ -1667,7 +1726,7 @@ BOOL SwNodes::TableToText( const SwNodeRange& rRange, sal_Unicode cCh,
SectionUp( &aDelRg ); // loesche die Section und damit die Tabelle
// #i28006#
- ULONG nStt = aDelRg.aStart.GetIndex(), nEnd = aDelRg.aEnd.GetIndex();
+ sal_uLong nStt = aDelRg.aStart.GetIndex(), nEnd = aDelRg.aEnd.GetIndex();
if( !pFrmNd )
{
pNode2Layout->RestoreUpperFrms( *this,
@@ -1707,7 +1766,7 @@ BOOL SwNodes::TableToText( const SwNodeRange& rRange, sal_Unicode cCh,
// #i28006# Fly frames have to be restored even if the table was
// #alone in the section
const SwSpzFrmFmts& rFlyArr = *GetDoc()->GetSpzFrmFmts();
- for( USHORT n = 0; n < rFlyArr.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rFlyArr.Count(); ++n )
{
SwFrmFmt *const pFmt = (SwFrmFmt*)rFlyArr[n];
const SwFmtAnchor& rAnchor = pFmt->GetAnchor();
@@ -1722,73 +1781,75 @@ BOOL SwNodes::TableToText( const SwNodeRange& rRange, sal_Unicode cCh,
}
}
- return TRUE;
+ return sal_True;
}
// ----- einfuegen von Spalten/Zeilen ------------------------
-BOOL SwDoc::InsertCol( const SwCursor& rCursor, USHORT nCnt, BOOL bBehind )
+sal_Bool SwDoc::InsertCol( const SwCursor& rCursor, sal_uInt16 nCnt, sal_Bool bBehind )
{
if( !::CheckSplitCells( rCursor, nCnt + 1, nsSwTblSearchType::TBLSEARCH_COL ) )
- return FALSE;
+ return sal_False;
// lasse ueber das Layout die Boxen suchen
SwSelBoxes aBoxes;
::GetTblSel( rCursor, aBoxes, nsSwTblSearchType::TBLSEARCH_COL );
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( aBoxes.Count() )
bRet = InsertCol( aBoxes, nCnt, bBehind );
return bRet;
}
-BOOL SwDoc::InsertCol( const SwSelBoxes& rBoxes, USHORT nCnt, BOOL bBehind )
+sal_Bool SwDoc::InsertCol( const SwSelBoxes& rBoxes, sal_uInt16 nCnt, sal_Bool bBehind )
{
// uebers SwDoc fuer Undo !!
ASSERT( rBoxes.Count(), "keine gueltige Box-Liste" );
SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode();
if( !pTblNd )
- return FALSE;
+ return sal_False;
SwTable& rTbl = pTblNd->GetTable();
if( rTbl.ISA( SwDDETable ))
- return FALSE;
+ return sal_False;
#ifdef DEL_TABLE_REDLINES
- lcl_DelRedlines aDelRedl( *pTblNd, TRUE );
+ lcl_DelRedlines aDelRedl( *pTblNd, sal_True );
#endif
SwTableSortBoxes aTmpLst( 0, 5 );
SwUndoTblNdsChg* pUndo = 0;
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- DoUndo( FALSE );
pUndo = new SwUndoTblNdsChg( UNDO_TABLE_INSCOL, rBoxes, *pTblNd,
- 0, 0, nCnt, bBehind, FALSE );
+ 0, 0, nCnt, bBehind, sal_False );
aTmpLst.Insert( &rTbl.GetTabSortBoxes(), 0, rTbl.GetTabSortBoxes().Count() );
}
- SwTableFmlUpdate aMsgHnt( &rTbl );
- aMsgHnt.eFlags = TBL_BOXPTR;
- UpdateTblFlds( &aMsgHnt );
-
- BOOL bRet = rTbl.InsertCol( this, rBoxes, nCnt, bBehind );
- if( bRet )
+ bool bRet(false);
{
- SetModified();
- ::ClearFEShellTabCols();
- SetFieldsDirty( true, NULL, 0 );
+ ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
+
+ SwTableFmlUpdate aMsgHnt( &rTbl );
+ aMsgHnt.eFlags = TBL_BOXPTR;
+ UpdateTblFlds( &aMsgHnt );
+
+ bRet = rTbl.InsertCol( this, rBoxes, nCnt, bBehind );
+ if (bRet)
+ {
+ SetModified();
+ ::ClearFEShellTabCols();
+ SetFieldsDirty( true, NULL, 0 );
+ }
}
if( pUndo )
{
- DoUndo( TRUE );
if( bRet )
{
- ClearRedo();
pUndo->SaveNewBoxes( *pTblNd, aTmpLst );
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
}
else
delete pUndo;
@@ -1796,64 +1857,66 @@ BOOL SwDoc::InsertCol( const SwSelBoxes& rBoxes, USHORT nCnt, BOOL bBehind )
return bRet;
}
-BOOL SwDoc::InsertRow( const SwCursor& rCursor, USHORT nCnt, BOOL bBehind )
+sal_Bool SwDoc::InsertRow( const SwCursor& rCursor, sal_uInt16 nCnt, sal_Bool bBehind )
{
// lasse ueber das Layout die Boxen suchen
SwSelBoxes aBoxes;
GetTblSel( rCursor, aBoxes, nsSwTblSearchType::TBLSEARCH_ROW );
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( aBoxes.Count() )
bRet = InsertRow( aBoxes, nCnt, bBehind );
return bRet;
}
-BOOL SwDoc::InsertRow( const SwSelBoxes& rBoxes, USHORT nCnt, BOOL bBehind )
+sal_Bool SwDoc::InsertRow( const SwSelBoxes& rBoxes, sal_uInt16 nCnt, sal_Bool bBehind )
{
// uebers SwDoc fuer Undo !!
ASSERT( rBoxes.Count(), "keine gueltige Box-Liste" );
SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode();
if( !pTblNd )
- return FALSE;
+ return sal_False;
SwTable& rTbl = pTblNd->GetTable();
if( rTbl.ISA( SwDDETable ))
- return FALSE;
+ return sal_False;
#ifdef DEL_TABLE_REDLINES
- lcl_DelRedlines aDelRedl( *pTblNd, TRUE );
+ lcl_DelRedlines aDelRedl( *pTblNd, sal_True );
#endif
SwTableSortBoxes aTmpLst( 0, 5 );
SwUndoTblNdsChg* pUndo = 0;
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- DoUndo( FALSE );
pUndo = new SwUndoTblNdsChg( UNDO_TABLE_INSROW,rBoxes, *pTblNd,
- 0, 0, nCnt, bBehind, FALSE );
+ 0, 0, nCnt, bBehind, sal_False );
aTmpLst.Insert( &rTbl.GetTabSortBoxes(), 0, rTbl.GetTabSortBoxes().Count() );
}
- SwTableFmlUpdate aMsgHnt( &rTbl );
- aMsgHnt.eFlags = TBL_BOXPTR;
- UpdateTblFlds( &aMsgHnt );
-
- BOOL bRet = rTbl.InsertRow( this, rBoxes, nCnt, bBehind );
- if( bRet )
+ bool bRet(false);
{
- SetModified();
- ::ClearFEShellTabCols();
- SetFieldsDirty( true, NULL, 0 );
+ ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
+
+ SwTableFmlUpdate aMsgHnt( &rTbl );
+ aMsgHnt.eFlags = TBL_BOXPTR;
+ UpdateTblFlds( &aMsgHnt );
+
+ bRet = rTbl.InsertRow( this, rBoxes, nCnt, bBehind );
+ if (bRet)
+ {
+ SetModified();
+ ::ClearFEShellTabCols();
+ SetFieldsDirty( true, NULL, 0 );
+ }
}
if( pUndo )
{
- DoUndo( TRUE );
if( bRet )
{
- ClearRedo();
pUndo->SaveNewBoxes( *pTblNd, aTmpLst );
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
}
else
delete pUndo;
@@ -1864,13 +1927,13 @@ BOOL SwDoc::InsertRow( const SwSelBoxes& rBoxes, USHORT nCnt, BOOL bBehind )
// ----- loeschen von Spalten/Zeilen ------------------------
-BOOL SwDoc::DeleteRow( const SwCursor& rCursor )
+sal_Bool SwDoc::DeleteRow( const SwCursor& rCursor )
{
// lasse ueber das Layout die Boxen suchen
SwSelBoxes aBoxes;
GetTblSel( rCursor, aBoxes, nsSwTblSearchType::TBLSEARCH_ROW );
if( ::HasProtectedCells( aBoxes ))
- return FALSE;
+ return sal_False;
// die Crsr aus dem Loeschbereich entfernen.
// Der Cursor steht danach:
@@ -1881,7 +1944,7 @@ BOOL SwDoc::DeleteRow( const SwCursor& rCursor )
SwTableNode* pTblNd = rCursor.GetNode()->FindTableNode();
if( pTblNd->GetTable().ISA( SwDDETable ))
- return FALSE;
+ return sal_False;
// suche alle Boxen / Lines
_FndBox aFndBox( 0, 0 );
@@ -1891,7 +1954,7 @@ BOOL SwDoc::DeleteRow( const SwCursor& rCursor )
}
if( !aFndBox.GetLines().Count() )
- return FALSE;
+ return sal_False;
SwEditShell* pESh = GetEditShell();
if( pESh )
@@ -1921,7 +1984,7 @@ BOOL SwDoc::DeleteRow( const SwCursor& rCursor )
pDelBox = pLn->GetTabBoxes()[ pLn->GetTabBoxes().Count() - 1 ];
}
SwTableBox* pNextBox = pDelLine->FindNextBox( pTblNd->GetTable(),
- pDelBox, TRUE );
+ pDelBox, sal_True );
while( pNextBox &&
pNextBox->GetFrmFmt()->GetProtect().IsCntntProtected() )
pNextBox = pNextBox->FindNextBox( pTblNd->GetTable(), pNextBox );
@@ -1933,13 +1996,13 @@ BOOL SwDoc::DeleteRow( const SwCursor& rCursor )
while( !pDelBox->GetSttNd() )
pDelBox = pDelBox->GetTabLines()[0]->GetTabBoxes()[0];
pNextBox = pDelLine->FindPreviousBox( pTblNd->GetTable(),
- pDelBox, TRUE );
+ pDelBox, sal_True );
while( pNextBox &&
pNextBox->GetFrmFmt()->GetProtect().IsCntntProtected() )
pNextBox = pNextBox->FindPreviousBox( pTblNd->GetTable(), pNextBox );
}
- ULONG nIdx;
+ sal_uLong nIdx;
if( pNextBox ) // dann den Cursor hier hinein
nIdx = pNextBox->GetSttIdx() + 1;
else // ansonsten hinter die Tabelle
@@ -1963,20 +2026,20 @@ BOOL SwDoc::DeleteRow( const SwCursor& rCursor )
// dann loesche doch die Zeilen
- StartUndo(UNDO_ROW_DELETE, NULL);
- BOOL bResult = DeleteRowCol( aBoxes );
- EndUndo(UNDO_ROW_DELETE, NULL);
+ GetIDocumentUndoRedo().StartUndo(UNDO_ROW_DELETE, NULL);
+ sal_Bool bResult = DeleteRowCol( aBoxes );
+ GetIDocumentUndoRedo().EndUndo(UNDO_ROW_DELETE, NULL);
return bResult;
}
-BOOL SwDoc::DeleteCol( const SwCursor& rCursor )
+sal_Bool SwDoc::DeleteCol( const SwCursor& rCursor )
{
// lasse ueber das Layout die Boxen suchen
SwSelBoxes aBoxes;
GetTblSel( rCursor, aBoxes, nsSwTblSearchType::TBLSEARCH_COL );
if( ::HasProtectedCells( aBoxes ))
- return FALSE;
+ return sal_False;
// die Crsr muessen noch aus dem Loesch Bereich entfernt
// werden. Setze sie immer hinter/auf die Tabelle; ueber die
@@ -1989,26 +2052,26 @@ BOOL SwDoc::DeleteCol( const SwCursor& rCursor )
}
// dann loesche doch die Spalten
- StartUndo(UNDO_COL_DELETE, NULL);
- BOOL bResult = DeleteRowCol( aBoxes, true );
- EndUndo(UNDO_COL_DELETE, NULL);
+ GetIDocumentUndoRedo().StartUndo(UNDO_COL_DELETE, NULL);
+ sal_Bool bResult = DeleteRowCol( aBoxes, true );
+ GetIDocumentUndoRedo().EndUndo(UNDO_COL_DELETE, NULL);
return bResult;
}
-BOOL SwDoc::DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn )
+sal_Bool SwDoc::DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn )
{
if( ::HasProtectedCells( rBoxes ))
- return FALSE;
+ return sal_False;
// uebers SwDoc fuer Undo !!
ASSERT( rBoxes.Count(), "keine gueltige Box-Liste" );
SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode();
if( !pTblNd )
- return FALSE;
+ return sal_False;
if( pTblNd->GetTable().ISA( SwDDETable ))
- return FALSE;
+ return sal_False;
::ClearFEShellTabCols();
SwSelBoxes aSelBoxes;
@@ -2025,25 +2088,25 @@ BOOL SwDoc::DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn )
}
#ifdef DEL_TABLE_REDLINES
- lcl_DelRedlines aDelRedl( *pTblNd, TRUE );
+ lcl_DelRedlines aDelRedl( *pTblNd, sal_True );
#endif
// soll die gesamte Tabelle geloescht werden ??
- const ULONG nTmpIdx1 = pTblNd->GetIndex();
- const ULONG nTmpIdx2 = aSelBoxes[ aSelBoxes.Count()-1 ]->GetSttNd()->
+ const sal_uLong nTmpIdx1 = pTblNd->GetIndex();
+ const sal_uLong nTmpIdx2 = aSelBoxes[ aSelBoxes.Count()-1 ]->GetSttNd()->
EndOfSectionIndex()+1;
if( pTblNd->GetTable().GetTabSortBoxes().Count() == aSelBoxes.Count() &&
aSelBoxes[0]->GetSttIdx()-1 == nTmpIdx1 &&
nTmpIdx2 == pTblNd->EndOfSectionIndex() )
{
- BOOL bNewTxtNd = FALSE;
+ sal_Bool bNewTxtNd = sal_False;
// steht diese auch noch alleine in einem FlyFrame ?
SwNodeIndex aIdx( *pTblNd, -1 );
const SwStartNode* pSttNd = aIdx.GetNode().GetStartNode();
if( pSttNd )
{
- const ULONG nTblEnd = pTblNd->EndOfSectionIndex() + 1;
- const ULONG nSectEnd = pSttNd->EndOfSectionIndex();
+ const sal_uLong nTblEnd = pTblNd->EndOfSectionIndex() + 1;
+ const sal_uLong nSectEnd = pSttNd->EndOfSectionIndex();
if( nTblEnd == nSectEnd )
{
if( SwFlyStartNode == pSttNd->GetStartNodeType() )
@@ -2053,22 +2116,22 @@ BOOL SwDoc::DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn )
{
// Ok, das ist das gesuchte FlyFormat
DelLayoutFmt( pFmt );
- return TRUE;
+ return sal_True;
}
}
// kein Fly ?? also Kopf- oder Fusszeile: dann immer einen
// TextNode ueberig lassen.
// Undo koennen wir dann vergessen !!
- bNewTxtNd = TRUE;
+ bNewTxtNd = sal_True;
}
}
// kein Fly ?? also Kopf- oder Fusszeile: dann immer einen
// TextNode ueberig lassen.
aIdx++;
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
+ GetIDocumentUndoRedo().ClearRedo();
SwPaM aPaM( *pTblNd->EndOfSectionNode(), aIdx.GetNode() );
if( bNewTxtNd )
@@ -2091,8 +2154,8 @@ BOOL SwDoc::DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn )
}
// harte SeitenUmbrueche am nachfolgenden Node verschieben
- BOOL bSavePageBreak = FALSE, bSavePageDesc = FALSE;
- ULONG nNextNd = pTblNd->EndOfSectionIndex()+1;
+ sal_Bool bSavePageBreak = sal_False, bSavePageDesc = sal_False;
+ sal_uLong nNextNd = pTblNd->EndOfSectionIndex()+1;
SwCntntNode* pNextNd = GetNodes()[ nNextNd ]->GetCntntNode();
if( pNextNd )
{
@@ -2105,17 +2168,17 @@ BOOL SwDoc::DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn )
SwFrmFmt* pTableFmt = pTblNd->GetTable().GetFrmFmt();
const SfxPoolItem *pItem;
if( SFX_ITEM_SET == pTableFmt->GetItemState( RES_PAGEDESC,
- FALSE, &pItem ) )
+ sal_False, &pItem ) )
{
pNextNd->SetAttr( *pItem );
- bSavePageDesc = TRUE;
+ bSavePageDesc = sal_True;
}
if( SFX_ITEM_SET == pTableFmt->GetItemState( RES_BREAK,
- FALSE, &pItem ) )
+ sal_False, &pItem ) )
{
pNextNd->SetAttr( *pItem );
- bSavePageBreak = TRUE;
+ bSavePageBreak = sal_True;
}
}
}
@@ -2124,7 +2187,7 @@ BOOL SwDoc::DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn )
pUndo->SetTblDelLastNd();
pUndo->SetPgBrkFlags( bSavePageBreak, bSavePageDesc );
pUndo->SetTableName(pTblNd->GetTable().GetFrmFmt()->GetName());
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
}
else
{
@@ -2154,11 +2217,11 @@ BOOL SwDoc::DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn )
SwFrmFmt* pTableFmt = pTblNd->GetTable().GetFrmFmt();
const SfxPoolItem *pItem;
if( SFX_ITEM_SET == pTableFmt->GetItemState( RES_PAGEDESC,
- FALSE, &pItem ) )
+ sal_False, &pItem ) )
pNextNd->SetAttr( *pItem );
if( SFX_ITEM_SET == pTableFmt->GetItemState( RES_BREAK,
- FALSE, &pItem ) )
+ sal_False, &pItem ) )
pNextNd->SetAttr( *pItem );
}
@@ -2167,43 +2230,45 @@ BOOL SwDoc::DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn )
}
SetModified();
SetFieldsDirty( true, NULL, 0 );
- return TRUE;
+ return sal_True;
}
SwUndoTblNdsChg* pUndo = 0;
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- DoUndo( FALSE );
pUndo = new SwUndoTblNdsChg( UNDO_TABLE_DELBOX, aSelBoxes, *pTblNd,
- nMin, nMax, 0, FALSE, FALSE );
+ nMin, nMax, 0, sal_False, sal_False );
}
- SwTableFmlUpdate aMsgHnt( &pTblNd->GetTable() );
- aMsgHnt.eFlags = TBL_BOXPTR;
- UpdateTblFlds( &aMsgHnt );
-
- if( rTable.IsNewModel() )
+ bool bRet(false);
{
- if( bColumn )
- rTable.PrepareDeleteCol( nMin, nMax );
- rTable.FindSuperfluousRows( aSelBoxes );
- if( pUndo )
- pUndo->ReNewBoxes( aSelBoxes );
- }
- const BOOL bRet = rTable.DeleteSel( this, aSelBoxes, 0, pUndo, TRUE, TRUE );
- if( bRet )
- {
- SetModified();
- SetFieldsDirty( true, NULL, 0 );
+ ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
+
+ SwTableFmlUpdate aMsgHnt( &pTblNd->GetTable() );
+ aMsgHnt.eFlags = TBL_BOXPTR;
+ UpdateTblFlds( &aMsgHnt );
+
+ if (rTable.IsNewModel())
+ {
+ if (bColumn)
+ rTable.PrepareDeleteCol( nMin, nMax );
+ rTable.FindSuperfluousRows( aSelBoxes );
+ if (pUndo)
+ pUndo->ReNewBoxes( aSelBoxes );
+ }
+ bRet = rTable.DeleteSel( this, aSelBoxes, 0, pUndo, sal_True, sal_True );
+ if (bRet)
+ {
+ SetModified();
+ SetFieldsDirty( true, NULL, 0 );
+ }
}
if( pUndo )
{
- DoUndo( TRUE );
if( bRet )
{
- ClearRedo();
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
}
else
delete pUndo;
@@ -2215,37 +2280,35 @@ BOOL SwDoc::DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn )
// ---------- teilen / zusammenfassen von Boxen in der Tabelle --------
-BOOL SwDoc::SplitTbl( const SwSelBoxes& rBoxes, sal_Bool bVert, USHORT nCnt,
+sal_Bool SwDoc::SplitTbl( const SwSelBoxes& rBoxes, sal_Bool bVert, sal_uInt16 nCnt,
sal_Bool bSameHeight )
{
// uebers SwDoc fuer Undo !!
ASSERT( rBoxes.Count() && nCnt, "keine gueltige Box-Liste" );
SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode();
if( !pTblNd )
- return FALSE;
+ return sal_False;
SwTable& rTbl = pTblNd->GetTable();
if( rTbl.ISA( SwDDETable ))
- return FALSE;
+ return sal_False;
#ifdef DEL_TABLE_REDLINES
- lcl_DelRedlines aDelRedl( *pTblNd, TRUE );
+ lcl_DelRedlines aDelRedl( *pTblNd, sal_True );
#endif
SvULongs aNdsCnts;
SwTableSortBoxes aTmpLst( 0, 5 );
SwUndoTblNdsChg* pUndo = 0;
- BOOL bDoUndo = DoesUndo();
- if( bDoUndo )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- DoUndo( FALSE );
pUndo = new SwUndoTblNdsChg( UNDO_TABLE_SPLIT, rBoxes, *pTblNd, 0, 0,
nCnt, bVert, bSameHeight );
aTmpLst.Insert( &rTbl.GetTabSortBoxes(), 0, rTbl.GetTabSortBoxes().Count() );
if( !bVert )
{
- for( USHORT n = 0; n < rBoxes.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rBoxes.Count(); ++n )
{
const SwStartNode* pSttNd = rBoxes[ n ]->GetSttNd();
aNdsCnts.Insert( pSttNd->EndOfSectionIndex() -
@@ -2254,33 +2317,35 @@ BOOL SwDoc::SplitTbl( const SwSelBoxes& rBoxes, sal_Bool bVert, USHORT nCnt,
}
}
- SwTableFmlUpdate aMsgHnt( &rTbl );
- aMsgHnt.eFlags = TBL_BOXPTR;
- UpdateTblFlds( &aMsgHnt );
+ bool bRet(false);
+ {
+ ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
- BOOL bRet;
- if( bVert )
- bRet = rTbl.SplitCol( this, rBoxes, nCnt );
- else
- bRet = rTbl.SplitRow( this, rBoxes, nCnt, bSameHeight );
+ SwTableFmlUpdate aMsgHnt( &rTbl );
+ aMsgHnt.eFlags = TBL_BOXPTR;
+ UpdateTblFlds( &aMsgHnt );
- if( bRet )
- {
- SetModified();
- SetFieldsDirty( true, NULL, 0 );
+ if (bVert)
+ bRet = rTbl.SplitCol( this, rBoxes, nCnt );
+ else
+ bRet = rTbl.SplitRow( this, rBoxes, nCnt, bSameHeight );
+
+ if (bRet)
+ {
+ SetModified();
+ SetFieldsDirty( true, NULL, 0 );
+ }
}
- DoUndo( bDoUndo );
if( pUndo )
{
if( bRet )
{
- ClearRedo();
if( bVert )
pUndo->SaveNewBoxes( *pTblNd, aTmpLst );
else
pUndo->SaveNewBoxes( *pTblNd, aTmpLst, rBoxes, aNdsCnts );
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
}
else
delete pUndo;
@@ -2290,7 +2355,7 @@ BOOL SwDoc::SplitTbl( const SwSelBoxes& rBoxes, sal_Bool bVert, USHORT nCnt,
}
-USHORT SwDoc::MergeTbl( SwPaM& rPam )
+sal_uInt16 SwDoc::MergeTbl( SwPaM& rPam )
{
// pruefe ob vom aktuellen Crsr der SPoint/Mark in einer Tabelle stehen
SwTableNode* pTblNd = rPam.GetNode()->FindTableNode();
@@ -2299,7 +2364,7 @@ USHORT SwDoc::MergeTbl( SwPaM& rPam )
SwTable& rTable = pTblNd->GetTable();
if( rTable.ISA(SwDDETable) )
return TBLMERGE_NOSELECTION;
- USHORT nRet = TBLMERGE_NOSELECTION;
+ sal_uInt16 nRet = TBLMERGE_NOSELECTION;
if( !rTable.IsNewModel() )
{
nRet =::CheckMergeSel( rPam );
@@ -2309,7 +2374,7 @@ USHORT SwDoc::MergeTbl( SwPaM& rPam )
}
// --> FME 2004-10-08 #i33394#
- StartUndo( UNDO_TABLE_MERGE, NULL );
+ GetIDocumentUndoRedo().StartUndo( UNDO_TABLE_MERGE, NULL );
// <--
#ifdef DEL_TABLE_REDLINES
@@ -2319,9 +2384,9 @@ USHORT SwDoc::MergeTbl( SwPaM& rPam )
RedlineMode_t eOld = GetRedlineMode();
SetRedlineMode_intern((RedlineMode_t)(eOld | nsRedlineMode_t::REDLINE_IGNORE));
- SwUndoTblMerge* pUndo = 0;
- if( DoesUndo() )
- pUndo = new SwUndoTblMerge( rPam );
+ SwUndoTblMerge *const pUndo( (GetIDocumentUndoRedo().DoesUndo())
+ ? new SwUndoTblMerge( rPam )
+ : 0 );
// lasse ueber das Layout die Boxen suchen
SwSelBoxes aBoxes;
@@ -2334,13 +2399,19 @@ USHORT SwDoc::MergeTbl( SwPaM& rPam )
if( pUndo )
{
delete pUndo;
- if( UNDO_REDLINE == GetUndoIds(NULL, NULL) )
+ SwUndoId nLastUndoId(UNDO_EMPTY);
+ if (GetIDocumentUndoRedo().GetLastUndoInfo(0, & nLastUndoId)
+ && (UNDO_REDLINE == nLastUndoId))
{
- SwUndoRedline* pU = (SwUndoRedline*)RemoveLastUndo( UNDO_REDLINE );
+ // FIXME: why is this horrible cleanup necessary?
+ SwUndoRedline *const pU = dynamic_cast<SwUndoRedline*>(
+ GetUndoManager().RemoveLastUndo());
if( pU->GetRedlSaveCount() )
{
- SwUndoIter aUndoIter( &rPam, UNDO_REDLINE );
- pU->Undo( aUndoIter );
+ SwEditShell *const pEditShell(GetEditShell(0));
+ OSL_ASSERT(pEditShell);
+ ::sw::UndoRedoContext context(*this, *pEditShell);
+ static_cast<SfxUndoAction *>(pU)->UndoWithContext(context);
}
delete pU;
}
@@ -2363,7 +2434,7 @@ USHORT SwDoc::MergeTbl( SwPaM& rPam )
SwPaM* pTmp = &rPam;
while( &rPam != ( pTmp = (SwPaM*)pTmp->GetNext() ))
for( int i = 0; i < 2; ++i )
- pTmp->GetBound( (BOOL)i ) = *rPam.GetPoint();
+ pTmp->GetBound( (sal_Bool)i ) = *rPam.GetPoint();
}
// dann fuege sie zusammen
@@ -2377,7 +2448,9 @@ USHORT SwDoc::MergeTbl( SwPaM& rPam )
SetModified();
SetFieldsDirty( true, NULL, 0 );
if( pUndo )
- AppendUndo( pUndo );
+ {
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
+ }
}
else if( pUndo )
delete pUndo;
@@ -2388,7 +2461,7 @@ USHORT SwDoc::MergeTbl( SwPaM& rPam )
::ClearFEShellTabCols();
SetRedlineMode_intern( eOld );
}
- EndUndo( UNDO_TABLE_MERGE, NULL );
+ GetIDocumentUndoRedo().EndUndo( UNDO_TABLE_MERGE, NULL );
return nRet;
}
@@ -2435,7 +2508,7 @@ void SwTableNode::MakeFrms(const SwNodeIndex & rIdx )
ASSERT( pNode, "Kein Contentnode oder Copy-Node und neuer Node identisch.");
- BOOL bBefore = rIdx < GetIndex();
+ sal_Bool bBefore = rIdx < GetIndex();
SwNode2Layout aNode2Layout( *this, rIdx.GetIndex() );
@@ -2502,7 +2575,12 @@ void SwTableNode::DelFrms()
SwTabFrm *pFrm = aIter.First();
while ( pFrm )
{
+<<<<<<< local
BOOL bAgain = FALSE;
+=======
+ sal_Bool bAgain = sal_False;
+ if ( pLast->IsA( TYPE(SwFrm) ) )
+>>>>>>> other
{
if ( !pFrm->IsFollow() )
{
@@ -2526,7 +2604,7 @@ void SwTableNode::DelFrms()
// <--
pFrm->Cut();
delete pFrm;
- bAgain = TRUE;
+ bAgain = sal_True;
}
}
pFrm = bAgain ? aIter.First() : aIter.Next();
@@ -2534,7 +2612,7 @@ void SwTableNode::DelFrms()
}
-void SwTableNode::SetNewTable( SwTable* pNewTable, BOOL bNewFrames )
+void SwTableNode::SetNewTable( SwTable* pNewTable, sal_Bool bNewFrames )
{
DelFrms();
delete pTable;
@@ -2569,7 +2647,11 @@ void SwDoc::GetTabCols( SwTabCols &rFill, const SwCursor* pCrsr,
if( pShCrsr )
aPt = pShCrsr->GetPtPos();
+<<<<<<< local
const SwFrm* pTmpFrm = pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &aPt, 0, FALSE );
+=======
+ const SwFrm* pTmpFrm = pCNd->GetFrm( &aPt, 0, sal_False );
+>>>>>>> other
do {
pTmpFrm = pTmpFrm->GetUpper();
} while ( !pTmpFrm->IsCellFrm() );
@@ -2587,9 +2669,9 @@ void SwDoc::GetTabCols( SwTabCols &rFill, const SwCursor* pCrsr,
//Fix-Punkte setzen, LeftMin in Dokumentkoordinaten die anderen relativ.
SWRECTFN( pTab )
const SwPageFrm* pPage = pTab->FindPageFrm();
- const ULONG nLeftMin = (pTab->Frm().*fnRect->fnGetLeft)() -
+ const sal_uLong nLeftMin = (pTab->Frm().*fnRect->fnGetLeft)() -
(pPage->Frm().*fnRect->fnGetLeft)();
- const ULONG nRightMax = (pTab->Frm().*fnRect->fnGetRight)() -
+ const sal_uLong nRightMax = (pTab->Frm().*fnRect->fnGetRight)() -
(pPage->Frm().*fnRect->fnGetLeft)();
rFill.SetLeftMin ( nLeftMin );
@@ -2618,7 +2700,7 @@ bool FuzzyCompare::operator() ( long s1, long s2 ) const
bool lcl_IsFrmInColumn( const SwCellFrm& rFrm, SwSelBoxes& rBoxes )
{
- for( USHORT i = 0; i < rBoxes.Count(); ++i )
+ for( sal_uInt16 i = 0; i < rBoxes.Count(); ++i )
{
if ( rFrm.GetTabBox() == rBoxes[ i ] )
return true;
@@ -2729,7 +2811,7 @@ void SwDoc::GetTabRows( SwTabCols &rFill, const SwCursor* ,
// calculate hidden flags for entry nUpperBorder/nLowerBorder:
long nTmpVal = nUpperBorder;
- for ( BYTE i = 0; i < 2; ++i )
+ for ( sal_uInt8 i = 0; i < 2; ++i )
{
aHiddenIter = aHidden.find( nTmpVal );
if ( aHiddenIter == aHidden.end() )
@@ -2748,7 +2830,7 @@ void SwDoc::GetTabRows( SwTabCols &rFill, const SwCursor* ,
}
// transfer calculated values from BoundaryMap and HiddenMap into rFill:
- USHORT nIdx = 0;
+ sal_uInt16 nIdx = 0;
for ( aIter = aBoundaries.begin(); aIter != aBoundaries.end(); ++aIter )
{
const long nTabTop = (pTab->*fnRect->fnGetPrtTop)();
@@ -2772,7 +2854,7 @@ void SwDoc::GetTabRows( SwTabCols &rFill, const SwCursor* ,
rFill.SetLastRowAllowedToChange( !pTab->HasFollowFlowLine() );
}
-void SwDoc::SetTabCols( const SwTabCols &rNew, BOOL bCurRowOnly,
+void SwDoc::SetTabCols( const SwTabCols &rNew, sal_Bool bCurRowOnly,
const SwCursor* pCrsr, const SwCellFrm* pBoxFrm )
{
const SwTableBox* pBox = 0;
@@ -2794,7 +2876,11 @@ void SwDoc::SetTabCols( const SwTabCols &rNew, BOOL bCurRowOnly,
if( pShCrsr )
aPt = pShCrsr->GetPtPos();
+<<<<<<< local
const SwFrm* pTmpFrm = pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &aPt, 0, FALSE );
+=======
+ const SwFrm* pTmpFrm = pCNd->GetFrm( &aPt, 0, sal_False );
+>>>>>>> other
do {
pTmpFrm = pTmpFrm->GetUpper();
} while ( !pTmpFrm->IsCellFrm() );
@@ -2833,9 +2919,9 @@ void SwDoc::SetTabCols( const SwTabCols &rNew, BOOL bCurRowOnly,
SwTabCols aOld( rNew.Count() );
const SwPageFrm* pPage = pTab->FindPageFrm();
- const ULONG nLeftMin = (pTab->Frm().*fnRect->fnGetLeft)() -
+ const sal_uLong nLeftMin = (pTab->Frm().*fnRect->fnGetLeft)() -
(pPage->Frm().*fnRect->fnGetLeft)();
- const ULONG nRightMax = (pTab->Frm().*fnRect->fnGetRight)() -
+ const sal_uLong nRightMax = (pTab->Frm().*fnRect->fnGetRight)() -
(pPage->Frm().*fnRect->fnGetLeft)();
//Fix-Punkte setzen, LeftMin in Dokumentkoordinaten die anderen relativ.
@@ -2848,7 +2934,7 @@ void SwDoc::SetTabCols( const SwTabCols &rNew, BOOL bCurRowOnly,
SetTabCols(rTab, rNew, aOld, pBox, bCurRowOnly );
}
-void SwDoc::SetTabRows( const SwTabCols &rNew, BOOL bCurColOnly, const SwCursor*,
+void SwDoc::SetTabRows( const SwTabCols &rNew, sal_Bool bCurColOnly, const SwCursor*,
const SwCellFrm* pBoxFrm )
{
const SwTableBox* pBox;
@@ -2886,17 +2972,17 @@ void SwDoc::SetTabRows( const SwTabCols &rNew, BOOL bCurColOnly, const SwCursor*
GetTabRows( aOld, 0, pBoxFrm );
- StartUndo( UNDO_TABLE_ATTR, NULL );
+ GetIDocumentUndoRedo().StartUndo( UNDO_TABLE_ATTR, NULL );
// check for differences between aOld and rNew:
- const USHORT nCount = rNew.Count();
+ const sal_uInt16 nCount = rNew.Count();
const SwTable* pTable = pTab->GetTable();
ASSERT( pTable, "My colleague told me, this couldn't happen" );
- for ( USHORT i = 0; i <= nCount; ++i )
+ for ( sal_uInt16 i = 0; i <= nCount; ++i )
{
- const USHORT nIdxStt = bVert ? nCount - i : i - 1;
- const USHORT nIdxEnd = bVert ? nCount - i - 1 : i;
+ const sal_uInt16 nIdxStt = bVert ? nCount - i : i - 1;
+ const sal_uInt16 nIdxEnd = bVert ? nCount - i - 1 : i;
const long nOldRowStart = i == 0 ? 0 : aOld[ nIdxStt ];
const long nOldRowEnd = i == nCount ? aOld.GetRight() : aOld[ nIdxEnd ];
@@ -2924,7 +3010,7 @@ void SwDoc::SetTabRows( const SwTabCols &rNew, BOOL bCurColOnly, const SwCursor*
if ( pFrm->IsCellFrm() && pFrm->FindTabFrm() == pTab )
{
const long nLowerBorder = (pFrm->Frm().*fnRect->fnGetBottom)();
- const ULONG nTabTop = (pTab->*fnRect->fnGetPrtTop)();
+ const sal_uLong nTabTop = (pTab->*fnRect->fnGetPrtTop)();
if ( abs( (*fnRect->fnYInc)( nTabTop, nOldRowEnd ) - nLowerBorder ) <= ROWFUZZY )
{
if ( !bCurColOnly || pFrm == pBoxFrm )
@@ -2969,7 +3055,7 @@ void SwDoc::SetTabRows( const SwTabCols &rNew, BOOL bCurColOnly, const SwCursor*
}
}
- EndUndo( UNDO_TABLE_ATTR, NULL );
+ GetIDocumentUndoRedo().EndUndo( UNDO_TABLE_ATTR, NULL );
::ClearFEShellTabCols();
}
@@ -2978,27 +3064,27 @@ void SwDoc::SetTabRows( const SwTabCols &rNew, BOOL bCurColOnly, const SwCursor*
* Direktzugriff fuer UNO
* --------------------------------------------------*/
void SwDoc::SetTabCols(SwTable& rTab, const SwTabCols &rNew, const SwTabCols &rOld,
- const SwTableBox *pStart, BOOL bCurRowOnly )
+ const SwTableBox *pStart, sal_Bool bCurRowOnly )
{
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoAttrTbl( *rTab.GetTableNode(), TRUE ));
+ GetIDocumentUndoRedo().AppendUndo(
+ new SwUndoAttrTbl( *rTab.GetTableNode(), sal_True ));
}
rTab.SetTabCols( rNew, rOld, pStart, bCurRowOnly );
::ClearFEShellTabCols();
SetModified();
}
-void SwDoc::SetRowsToRepeat( SwTable &rTable, USHORT nSet )
+void SwDoc::SetRowsToRepeat( SwTable &rTable, sal_uInt16 nSet )
{
if( nSet == rTable.GetRowsToRepeat() )
return;
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoTblHeadline( rTable, rTable.GetRowsToRepeat() , nSet) );
+ GetIDocumentUndoRedo().AppendUndo(
+ new SwUndoTblHeadline(rTable, rTable.GetRowsToRepeat(), nSet) );
}
SwMsgPoolItem aChg( RES_TBLHEADLINECHG );
@@ -3012,7 +3098,7 @@ void SwDoc::SetRowsToRepeat( SwTable &rTable, USHORT nSet )
// Splittet eine Tabelle in der Grund-Zeile, in der der Index steht.
// Alle GrundZeilen dahinter wandern in eine neue Tabelle/-Node.
-// Ist das Flag bCalcNewSize auf TRUE, wird fuer beide neuen Tabellen
+// Ist das Flag bCalcNewSize auf sal_True, wird fuer beide neuen Tabellen
// die neue Size aus dem Max der Boxen errechnet; vorrausgesetzt,
// die Size ist "absolut" gesetzt (USHRT_MAX)
@@ -3027,13 +3113,13 @@ void SwCollectTblLineBoxes::AddBox( const SwTableBox& rBox )
aPosArr.Insert( nWidth, aPosArr.Count() );
SwTableBox* p = (SwTableBox*)&rBox;
aBoxes.Insert( p, aBoxes.Count() );
- nWidth = nWidth + (USHORT)rBox.GetFrmFmt()->GetFrmSize().GetWidth();
+ nWidth = nWidth + (sal_uInt16)rBox.GetFrmFmt()->GetFrmSize().GetWidth();
}
const SwTableBox* SwCollectTblLineBoxes::GetBoxOfPos( const SwTableBox& rBox )
{
const SwTableBox* pRet = 0;
- USHORT n;
+ sal_uInt16 n;
if( aPosArr.Count() )
{
@@ -3050,15 +3136,15 @@ const SwTableBox* SwCollectTblLineBoxes::GetBoxOfPos( const SwTableBox& rBox )
if( n >= aPosArr.Count() )
--n;
- nWidth = nWidth + (USHORT)rBox.GetFrmFmt()->GetFrmSize().GetWidth();
+ nWidth = nWidth + (sal_uInt16)rBox.GetFrmFmt()->GetFrmSize().GetWidth();
pRet = aBoxes[ n ];
}
return pRet;
}
-BOOL SwCollectTblLineBoxes::Resize( USHORT nOffset, USHORT nOldWidth )
+sal_Bool SwCollectTblLineBoxes::Resize( sal_uInt16 nOffset, sal_uInt16 nOldWidth )
{
- USHORT n;
+ sal_uInt16 n;
if( aPosArr.Count() )
{
@@ -3078,29 +3164,29 @@ BOOL SwCollectTblLineBoxes::Resize( USHORT nOffset, USHORT nOldWidth )
// dann die Positionen der neuen Size anpassen
for( n = 0; n < aPosArr.Count(); ++n )
{
- ULONG nSize = nWidth;
+ sal_uLong nSize = nWidth;
nSize *= ( aPosArr[ n ] - nOffset );
nSize /= nOldWidth;
- aPosArr[ n ] = USHORT( nSize );
+ aPosArr[ n ] = sal_uInt16( nSize );
}
}
return 0 != aPosArr.Count();
}
-BOOL lcl_Line_CollectBox( const SwTableLine*& rpLine, void* pPara )
+sal_Bool lcl_Line_CollectBox( const SwTableLine*& rpLine, void* pPara )
{
SwCollectTblLineBoxes* pSplPara = (SwCollectTblLineBoxes*)pPara;
if( pSplPara->IsGetValues() )
((SwTableLine*)rpLine)->GetTabBoxes().ForEach( &lcl_Box_CollectBox, pPara );
else
((SwTableLine*)rpLine)->GetTabBoxes().ForEach( &lcl_BoxSetSplitBoxFmts, pPara );
- return TRUE;
+ return sal_True;
}
-BOOL lcl_Box_CollectBox( const SwTableBox*& rpBox, void* pPara )
+sal_Bool lcl_Box_CollectBox( const SwTableBox*& rpBox, void* pPara )
{
SwCollectTblLineBoxes* pSplPara = (SwCollectTblLineBoxes*)pPara;
- USHORT nLen = rpBox->GetTabLines().Count();
+ sal_uInt16 nLen = rpBox->GetTabLines().Count();
if( nLen )
{
// dann mit der richtigen Line weitermachen
@@ -3114,13 +3200,13 @@ BOOL lcl_Box_CollectBox( const SwTableBox*& rpBox, void* pPara )
}
else
pSplPara->AddBox( *rpBox );
- return TRUE;
+ return sal_True;
}
-BOOL lcl_BoxSetSplitBoxFmts( const SwTableBox*& rpBox, void* pPara )
+sal_Bool lcl_BoxSetSplitBoxFmts( const SwTableBox*& rpBox, void* pPara )
{
SwCollectTblLineBoxes* pSplPara = (SwCollectTblLineBoxes*)pPara;
- USHORT nLen = rpBox->GetTabLines().Count();
+ sal_uInt16 nLen = rpBox->GetTabLines().Count();
if( nLen )
{
// dann mit der richtigen Line weitermachen
@@ -3151,7 +3237,7 @@ BOOL lcl_BoxSetSplitBoxFmts( const SwTableBox*& rpBox, void* pPara )
}
else
{
-USHORT __FAR_DATA aTableSplitBoxSetRange[] = {
+sal_uInt16 __FAR_DATA aTableSplitBoxSetRange[] = {
RES_LR_SPACE, RES_UL_SPACE,
RES_BACKGROUND, RES_SHADOW,
RES_PROTECT, RES_PROTECT,
@@ -3185,12 +3271,12 @@ USHORT __FAR_DATA aTableSplitBoxSetRange[] = {
pBox->GetSttNd()->CheckSectionCondColl();
}
}
- return TRUE;
+ return sal_True;
}
-BOOL SwDoc::SplitTable( const SwPosition& rPos, USHORT eHdlnMode,
- BOOL bCalcNewSize )
+sal_Bool SwDoc::SplitTable( const SwPosition& rPos, sal_uInt16 eHdlnMode,
+ sal_Bool bCalcNewSize )
{
SwNode* pNd = &rPos.nNode.GetNode();
SwTableNode* pTNd = pNd->FindTableNode();
@@ -3198,7 +3284,7 @@ BOOL SwDoc::SplitTable( const SwPosition& rPos, USHORT eHdlnMode,
return 0;
if( pTNd->GetTable().ISA( SwDDETable ))
- return FALSE;
+ return sal_False;
SwTable& rTbl = pTNd->GetTable();
rTbl.SetHTMLTableLayout( 0 ); // MIB 9.7.97: HTML-Layout loeschen
@@ -3206,11 +3292,13 @@ BOOL SwDoc::SplitTable( const SwPosition& rPos, USHORT eHdlnMode,
SwTableFmlUpdate aMsgHnt( &rTbl );
SwHistory aHistory;
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
+ {
aMsgHnt.pHistory = &aHistory;
+ }
{
- ULONG nSttIdx = pNd->FindTableBoxStartNode()->GetIndex();
+ sal_uLong nSttIdx = pNd->FindTableBoxStartNode()->GetIndex();
// Suche die Grund-Line dieser Box:
SwTableBox* pBox = rTbl.GetTblBox( nSttIdx );
@@ -3238,16 +3326,17 @@ BOOL SwDoc::SplitTable( const SwPosition& rPos, USHORT eHdlnMode,
// TL_CHART2: need to inform chart of probably changed cell names
//pDoc->UpdateCharts( rTbl.GetFrmFmt()->GetName() );
- SwTableNode* pNew = GetNodes().SplitTable( rPos.nNode, FALSE, bCalcNewSize );
+ SwTableNode* pNew = GetNodes().SplitTable( rPos.nNode, sal_False, bCalcNewSize );
if( pNew )
{
SwSaveRowSpan* pSaveRowSp = pNew->GetTable().CleanUpTopRowSpan( rTbl.GetTabLines().Count() );
SwUndoSplitTbl* pUndo = 0;
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( pUndo = new SwUndoSplitTbl( *pNew, pSaveRowSp, eHdlnMode, bCalcNewSize ));
+ pUndo = new SwUndoSplitTbl(
+ *pNew, pSaveRowSp, eHdlnMode, bCalcNewSize);
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
if( aHistory.Count() )
pUndo->SaveFormula( aHistory );
}
@@ -3258,12 +3347,12 @@ BOOL SwDoc::SplitTable( const SwPosition& rPos, USHORT eHdlnMode,
// an der aktuellen als obere
case HEADLINE_BORDERCOPY:
{
- SwCollectTblLineBoxes aPara( FALSE, eHdlnMode );
+ SwCollectTblLineBoxes aPara( sal_False, eHdlnMode );
SwTableLine* pLn = rTbl.GetTabLines()[
rTbl.GetTabLines().Count() - 1 ];
pLn->GetTabBoxes().ForEach( &lcl_Box_CollectBox, &aPara );
- aPara.SetValues( TRUE );
+ aPara.SetValues( sal_True );
pLn = pNew->GetTable().GetTabLines()[ 0 ];
pLn->GetTabBoxes().ForEach( &lcl_BoxSetSplitBoxFmts, &aPara );
@@ -3280,11 +3369,11 @@ BOOL SwDoc::SplitTable( const SwPosition& rPos, USHORT eHdlnMode,
if( HEADLINE_BOXATRCOLLCOPY == eHdlnMode && pUndo )
pHst = pUndo->GetHistory();
- SwCollectTblLineBoxes aPara( TRUE, eHdlnMode, pHst );
+ SwCollectTblLineBoxes aPara( sal_True, eHdlnMode, pHst );
SwTableLine* pLn = rTbl.GetTabLines()[ 0 ];
pLn->GetTabBoxes().ForEach( &lcl_Box_CollectBox, &aPara );
- aPara.SetValues( TRUE );
+ aPara.SetValues( sal_True );
pLn = pNew->GetTable().GetTabLines()[ 0 ];
pLn->GetTabBoxes().ForEach( &lcl_BoxSetSplitBoxFmts, &aPara );
}
@@ -3323,7 +3412,7 @@ BOOL SwDoc::SplitTable( const SwPosition& rPos, USHORT eHdlnMode,
return 0 != pNew;
}
-BOOL lcl_ChgTblSize( SwTable& rTbl )
+sal_Bool lcl_ChgTblSize( SwTable& rTbl )
{
// das Attribut darf nicht ueber das Modify an der
// Tabelle gesetzt werden, denn sonst werden alle
@@ -3332,19 +3421,19 @@ BOOL lcl_ChgTblSize( SwTable& rTbl )
SwFmtFrmSize aTblMaxSz( pFmt->GetFrmSize() );
if( USHRT_MAX == aTblMaxSz.GetWidth() )
- return FALSE;
+ return sal_False;
- BOOL bLocked = pFmt->IsModifyLocked();
+ sal_Bool bLocked = pFmt->IsModifyLocked();
pFmt->LockModify();
aTblMaxSz.SetWidth( 0 );
SwTableLines& rLns = rTbl.GetTabLines();
- for( USHORT nLns = 0; nLns < rLns.Count(); ++nLns )
+ for( sal_uInt16 nLns = 0; nLns < rLns.Count(); ++nLns )
{
SwTwips nMaxLnWidth = 0;
SwTableBoxes& rBoxes = rLns[ nLns ]->GetTabBoxes();
- for( USHORT nBox = 0; nBox < rBoxes.Count(); ++nBox )
+ for( sal_uInt16 nBox = 0; nBox < rBoxes.Count(); ++nBox )
nMaxLnWidth += rBoxes[nBox]->GetFrmFmt()->GetFrmSize().GetWidth();
if( nMaxLnWidth > aTblMaxSz.GetWidth() )
@@ -3354,7 +3443,7 @@ BOOL lcl_ChgTblSize( SwTable& rTbl )
if( !bLocked ) // und gegebenenfalls Lock wieder freigeben
pFmt->UnlockModify();
- return TRUE;
+ return sal_True;
}
class _SplitTable_Para
@@ -3367,7 +3456,7 @@ public:
_SplitTable_Para( SwTableNode* pNew, SwTable& rOld )
: aSrc( 16, 16 ), aDest( 16, 16 ), pNewTblNd( pNew ), rOldTbl( rOld )
{}
- USHORT SrcFmt_GetPos( void* pFmt ) const
+ sal_uInt16 SrcFmt_GetPos( void* pFmt ) const
{ return aSrc.GetPos( pFmt ); }
void DestFmt_Insert( void* pFmt )
@@ -3376,7 +3465,7 @@ public:
void SrcFmt_Insert( void* pFmt )
{ aSrc.Insert( pFmt, aSrc.Count() ); }
- SwFrmFmt* DestFmt_Get( USHORT nPos ) const
+ SwFrmFmt* DestFmt_Get( sal_uInt16 nPos ) const
{ return (SwFrmFmt*)aDest[ nPos ]; }
void ChgBox( SwTableBox* pBox )
@@ -3387,15 +3476,15 @@ public:
};
-BOOL lcl_SplitTable_CpyBox( const SwTableBox*& rpBox, void* pPara );
+sal_Bool lcl_SplitTable_CpyBox( const SwTableBox*& rpBox, void* pPara );
-BOOL lcl_SplitTable_CpyLine( const SwTableLine*& rpLine, void* pPara )
+sal_Bool lcl_SplitTable_CpyLine( const SwTableLine*& rpLine, void* pPara )
{
SwTableLine* pLn = (SwTableLine*)rpLine;
_SplitTable_Para& rPara = *(_SplitTable_Para*)pPara;
SwFrmFmt *pSrcFmt = pLn->GetFrmFmt();
- USHORT nPos = rPara.SrcFmt_GetPos( pSrcFmt );
+ sal_uInt16 nPos = rPara.SrcFmt_GetPos( pSrcFmt );
if( USHRT_MAX == nPos )
{
rPara.DestFmt_Insert( pLn->ClaimFrmFmt() );
@@ -3405,16 +3494,16 @@ BOOL lcl_SplitTable_CpyLine( const SwTableLine*& rpLine, void* pPara )
pLn->ChgFrmFmt( (SwTableLineFmt*)rPara.DestFmt_Get( nPos ) );
pLn->GetTabBoxes().ForEach( &lcl_SplitTable_CpyBox, pPara );
- return TRUE;
+ return sal_True;
}
-BOOL lcl_SplitTable_CpyBox( const SwTableBox*& rpBox, void* pPara )
+sal_Bool lcl_SplitTable_CpyBox( const SwTableBox*& rpBox, void* pPara )
{
SwTableBox* pBox = (SwTableBox*)rpBox;
_SplitTable_Para& rPara = *(_SplitTable_Para*)pPara;
SwFrmFmt *pSrcFmt = pBox->GetFrmFmt();
- USHORT nPos = rPara.SrcFmt_GetPos( pSrcFmt );
+ sal_uInt16 nPos = rPara.SrcFmt_GetPos( pSrcFmt );
if( USHRT_MAX == nPos )
{
rPara.DestFmt_Insert( pBox->ClaimFrmFmt() );
@@ -3427,18 +3516,18 @@ BOOL lcl_SplitTable_CpyBox( const SwTableBox*& rpBox, void* pPara )
rPara.ChgBox( pBox );
else
pBox->GetTabLines().ForEach( &lcl_SplitTable_CpyLine, pPara );
- return TRUE;
+ return sal_True;
}
-SwTableNode* SwNodes::SplitTable( const SwNodeIndex& rPos, BOOL bAfter,
- BOOL bCalcNewSize )
+SwTableNode* SwNodes::SplitTable( const SwNodeIndex& rPos, sal_Bool bAfter,
+ sal_Bool bCalcNewSize )
{
SwNode* pNd = &rPos.GetNode();
SwTableNode* pTNd = pNd->FindTableNode();
if( !pTNd || pNd->IsTableNode() )
return 0;
- ULONG nSttIdx = pNd->FindTableBoxStartNode()->GetIndex();
+ sal_uLong nSttIdx = pNd->FindTableBoxStartNode()->GetIndex();
// Suche die Grund-Line dieser Box:
SwTable& rTbl = pTNd->GetTable();
@@ -3451,7 +3540,7 @@ SwTableNode* SwNodes::SplitTable( const SwNodeIndex& rPos, BOOL bAfter,
pLine = pLine->GetUpper()->GetUpper();
// in pLine steht jetzt die GrundLine.
- USHORT nLinePos = rTbl.GetTabLines().C40_GETPOS( SwTableLine, pLine );
+ sal_uInt16 nLinePos = rTbl.GetTabLines().C40_GETPOS( SwTableLine, pLine );
if( USHRT_MAX == nLinePos ||
( bAfter ? ++nLinePos >= rTbl.GetTabLines().Count() : !nLinePos ))
return 0; // nicht gefunden oder letze Line !!
@@ -3496,20 +3585,20 @@ SwTableNode* SwNodes::SplitTable( const SwNodeIndex& rPos, BOOL bAfter,
SwChartDataProvider *pPCD = rTbl.GetFrmFmt()->getIDocumentChartDataProviderAccess()->GetChartDataProvider();
if( pPCD )
{
- for (USHORT k = nLinePos; k < rTbl.GetTabLines().Count(); ++k)
+ for (sal_uInt16 k = nLinePos; k < rTbl.GetTabLines().Count(); ++k)
{
- USHORT nLineIdx = (rTbl.GetTabLines().Count() - 1) - k + nLinePos;
- USHORT nBoxCnt = rTbl.GetTabLines()[ nLineIdx ]->GetTabBoxes().Count();
- for (USHORT j = 0; j < nBoxCnt; ++j)
+ sal_uInt16 nLineIdx = (rTbl.GetTabLines().Count() - 1) - k + nLinePos;
+ sal_uInt16 nBoxCnt = rTbl.GetTabLines()[ nLineIdx ]->GetTabBoxes().Count();
+ for (sal_uInt16 j = 0; j < nBoxCnt; ++j)
{
- USHORT nIdx = nBoxCnt - 1 - j;
+ sal_uInt16 nIdx = nBoxCnt - 1 - j;
pPCD->DeleteBox( &rTbl, *rTbl.GetTabLines()[ nLineIdx ]->GetTabBoxes()[nIdx] );
}
}
}
//
// ...und loeschen
- USHORT nDeleted = rTbl.GetTabLines().Count() - nLinePos;
+ sal_uInt16 nDeleted = rTbl.GetTabLines().Count() - nLinePos;
rTbl.GetTabLines().Remove( nLinePos, nDeleted );
// und die betr. Boxen verschieben. Dabei die Formate eindeutig
@@ -3544,11 +3633,11 @@ SwTableNode* SwNodes::SplitTable( const SwNodeIndex& rPos, BOOL bAfter,
// und die Umkehrung davon. rPos muss in der Tabelle stehen, die bestehen
// bleibt. Das Flag besagt ob die aktuelle mit der davor oder dahinter
// stehenden vereint wird.
-BOOL SwDoc::MergeTable( const SwPosition& rPos, BOOL bWithPrev, USHORT nMode )
+sal_Bool SwDoc::MergeTable( const SwPosition& rPos, sal_Bool bWithPrev, sal_uInt16 nMode )
{
SwTableNode* pTblNd = rPos.nNode.GetNode().FindTableNode(), *pDelTblNd;
if( !pTblNd )
- return FALSE;
+ return sal_False;
SwNodes& rNds = GetNodes();
if( bWithPrev )
@@ -3556,11 +3645,11 @@ BOOL SwDoc::MergeTable( const SwPosition& rPos, BOOL bWithPrev, USHORT nMode )
else
pDelTblNd = rNds[ pTblNd->EndOfSectionIndex() + 1 ]->GetTableNode();
if( !pDelTblNd )
- return FALSE;
+ return sal_False;
if( pTblNd->GetTable().ISA( SwDDETable ) ||
pDelTblNd->GetTable().ISA( SwDDETable ))
- return FALSE;
+ return sal_False;
// MIB 9.7.97: HTML-Layout loeschen
pTblNd->GetTable().SetHTMLTableLayout( 0 );
@@ -3569,11 +3658,10 @@ BOOL SwDoc::MergeTable( const SwPosition& rPos, BOOL bWithPrev, USHORT nMode )
// beide Tabellen vorhanden, also kanns losgehen
SwUndoMergeTbl* pUndo = 0;
SwHistory* pHistory = 0;
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( pUndo = new SwUndoMergeTbl( *pTblNd, *pDelTblNd,
- bWithPrev, nMode ));
+ pUndo = new SwUndoMergeTbl( *pTblNd, *pDelTblNd, bWithPrev, nMode );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
pHistory = new SwHistory;
}
@@ -3586,7 +3674,7 @@ BOOL SwDoc::MergeTable( const SwPosition& rPos, BOOL bWithPrev, USHORT nMode )
// das eigentliche Mergen
SwNodeIndex aIdx( bWithPrev ? *pTblNd : *pDelTblNd );
- BOOL bRet = rNds.MergeTable( aIdx, !bWithPrev, nMode, pHistory );
+ sal_Bool bRet = rNds.MergeTable( aIdx, !bWithPrev, nMode, pHistory );
if( pHistory )
{
@@ -3602,8 +3690,8 @@ BOOL SwDoc::MergeTable( const SwPosition& rPos, BOOL bWithPrev, USHORT nMode )
return bRet;
}
-BOOL SwNodes::MergeTable( const SwNodeIndex& rPos, BOOL bWithPrev,
- USHORT nMode, SwHistory* )
+sal_Bool SwNodes::MergeTable( const SwNodeIndex& rPos, sal_Bool bWithPrev,
+ sal_uInt16 nMode, SwHistory* )
{
SwTableNode* pDelTblNd = rPos.GetNode().GetTableNode();
ASSERT( pDelTblNd, "wo ist der TableNode geblieben?" );
@@ -3612,7 +3700,7 @@ BOOL SwNodes::MergeTable( const SwNodeIndex& rPos, BOOL bWithPrev,
ASSERT( pTblNd, "wo ist der TableNode geblieben?" );
if( !pDelTblNd || !pTblNd )
- return FALSE;
+ return sal_False;
pDelTblNd->DelFrms();
@@ -3665,12 +3753,12 @@ BOOL SwNodes::MergeTable( const SwNodeIndex& rPos, BOOL bWithPrev,
}
// die Lines und Boxen ruebermoven
- USHORT nOldSize = rTbl.GetTabLines().Count();
+ sal_uInt16 nOldSize = rTbl.GetTabLines().Count();
rTbl.GetTabLines().Insert( &rDelTbl.GetTabLines(), nOldSize );
rDelTbl.GetTabLines().Remove( 0, rDelTbl.GetTabLines().Count() );
rTbl.GetTabSortBoxes().Insert( &rDelTbl.GetTabSortBoxes() );
- rDelTbl.GetTabSortBoxes().Remove( (USHORT)0, rDelTbl.GetTabSortBoxes().Count() );
+ rDelTbl.GetTabSortBoxes().Remove( (sal_uInt16)0, rDelTbl.GetTabSortBoxes().Count() );
// die vordere Tabelle bleibt immer stehen, die hintere wird geloescht
SwEndNode* pTblEndNd = pDelTblNd->EndOfSectionNode();
@@ -3710,7 +3798,7 @@ BOOL SwNodes::MergeTable( const SwNodeIndex& rPos, BOOL bWithPrev,
//Layout updaten
aFndBox.MakeFrms( rTbl );
- return TRUE;
+ return sal_True;
}
// -------------------------------------------------------------------
@@ -3721,8 +3809,8 @@ struct _SetAFmtTabPara
{
SwTableAutoFmt& rTblFmt;
SwUndoTblAutoFmt* pUndo;
- USHORT nEndBox, nCurBox;
- BYTE nAFmtLine, nAFmtBox;
+ sal_uInt16 nEndBox, nCurBox;
+ sal_uInt8 nAFmtLine, nAFmtBox;
_SetAFmtTabPara( const SwTableAutoFmt& rNew )
: rTblFmt( (SwTableAutoFmt&)rNew ), pUndo( 0 ),
@@ -3732,16 +3820,16 @@ struct _SetAFmtTabPara
// forward deklarieren damit sich die Lines und Boxen rekursiv aufrufen
// koennen.
-BOOL lcl_SetAFmtBox( const _FndBox*&, void *pPara );
-BOOL lcl_SetAFmtLine( const _FndLine*&, void *pPara );
+sal_Bool lcl_SetAFmtBox( const _FndBox*&, void *pPara );
+sal_Bool lcl_SetAFmtLine( const _FndLine*&, void *pPara );
-BOOL lcl_SetAFmtLine( const _FndLine*& rpLine, void *pPara )
+sal_Bool lcl_SetAFmtLine( const _FndLine*& rpLine, void *pPara )
{
((_FndLine*&)rpLine)->GetBoxes().ForEach( &lcl_SetAFmtBox, pPara );
- return TRUE;
+ return sal_True;
}
-BOOL lcl_SetAFmtBox( const _FndBox*& rpBox, void *pPara )
+sal_Bool lcl_SetAFmtBox( const _FndBox*& rpBox, void *pPara )
{
_SetAFmtTabPara* pSetPara = (_SetAFmtTabPara*)pPara;
@@ -3752,7 +3840,7 @@ BOOL lcl_SetAFmtBox( const _FndBox*& rpBox, void *pPara )
else if( pSetPara->nCurBox == pSetPara->nEndBox )
pSetPara->nAFmtBox = 3;
else
- pSetPara->nAFmtBox = (BYTE)(1 + ((pSetPara->nCurBox-1) & 1));
+ pSetPara->nAFmtBox = (sal_uInt8)(1 + ((pSetPara->nCurBox-1) & 1));
}
if( rpBox->GetBox()->GetSttNd() )
@@ -3764,16 +3852,16 @@ BOOL lcl_SetAFmtBox( const _FndBox*& rpBox, void *pPara )
SfxItemSet aCharSet( pDoc->GetAttrPool(), RES_CHRATR_BEGIN, RES_PARATR_LIST_END-1 );
// <--
SfxItemSet aBoxSet( pDoc->GetAttrPool(), aTableBoxSetRange );
- BYTE nPos = pSetPara->nAFmtLine * 4 + pSetPara->nAFmtBox;
+ sal_uInt8 nPos = pSetPara->nAFmtLine * 4 + pSetPara->nAFmtBox;
pSetPara->rTblFmt.UpdateToSet( nPos, aCharSet,
SwTableAutoFmt::UPDATE_CHAR, 0 );
pSetPara->rTblFmt.UpdateToSet( nPos, aBoxSet,
SwTableAutoFmt::UPDATE_BOX,
- pDoc->GetNumberFormatter( TRUE ) );
+ pDoc->GetNumberFormatter( sal_True ) );
if( aCharSet.Count() )
{
- ULONG nSttNd = pSetBox->GetSttIdx()+1;
- ULONG nEndNd = pSetBox->GetSttNd()->EndOfSectionIndex();
+ sal_uLong nSttNd = pSetBox->GetSttIdx()+1;
+ sal_uLong nEndNd = pSetBox->GetSttNd()->EndOfSectionIndex();
for( ; nSttNd < nEndNd; ++nSttNd )
{
SwCntntNode* pNd = pDoc->GetNodes()[ nSttNd ]->GetCntntNode();
@@ -3796,17 +3884,17 @@ BOOL lcl_SetAFmtBox( const _FndBox*& rpBox, void *pPara )
if( !rpBox->GetUpper()->GetUpper() ) // eine BaseLine
++pSetPara->nCurBox;
- return TRUE;
+ return sal_True;
}
// AutoFormat fuer die Tabelle/TabellenSelection
-BOOL SwDoc::SetTableAutoFmt( const SwSelBoxes& rBoxes, const SwTableAutoFmt& rNew )
+sal_Bool SwDoc::SetTableAutoFmt( const SwSelBoxes& rBoxes, const SwTableAutoFmt& rNew )
{
ASSERT( rBoxes.Count(), "keine gueltige Box-Liste" );
SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode();
if( !pTblNd )
- return FALSE;
+ return sal_False;
// suche alle Boxen / Lines
_FndBox aFndBox( 0, 0 );
@@ -3815,7 +3903,7 @@ BOOL SwDoc::SetTableAutoFmt( const SwSelBoxes& rBoxes, const SwTableAutoFmt& rNe
pTblNd->GetTable().GetTabLines().ForEach( &_FndLineCopyCol, &aPara );
}
if( !aFndBox.GetLines().Count() )
- return FALSE;
+ return sal_False;
pTblNd->GetTable().SetHTMLTableLayout( 0 );
@@ -3830,18 +3918,19 @@ BOOL SwDoc::SetTableAutoFmt( const SwSelBoxes& rBoxes, const SwTableAutoFmt& rNe
// Undo abschalten, Attribute werden sich vorher gemerkt
SwUndoTblAutoFmt* pUndo = 0;
- if( DoesUndo() )
+ bool const bUndo(GetIDocumentUndoRedo().DoesUndo());
+ if (bUndo)
{
- ClearRedo();
- AppendUndo( pUndo = new SwUndoTblAutoFmt( *pTblNd, rNew ) );
- DoUndo( FALSE );
+ pUndo = new SwUndoTblAutoFmt( *pTblNd, rNew );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
+ GetIDocumentUndoRedo().DoUndo(false);
}
_SetAFmtTabPara aPara( rNew );
_FndLines& rFLns = pFndBox->GetLines();
_FndLine* pLine;
- for( USHORT n = 0; n < rFLns.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rFLns.Count(); ++n )
{
pLine = rFLns[n];
@@ -3854,7 +3943,7 @@ BOOL SwDoc::SetTableAutoFmt( const SwSelBoxes& rBoxes, const SwTableAutoFmt& rNe
else if( n+1 == rFLns.Count() )
aPara.nAFmtLine = 3;
else
- aPara.nAFmtLine = (BYTE)(1 + ((n-1) & 1 ));
+ aPara.nAFmtLine = (sal_uInt8)(1 + ((n-1) & 1 ));
aPara.nAFmtBox = 0;
aPara.nCurBox = 0;
@@ -3866,22 +3955,24 @@ BOOL SwDoc::SetTableAutoFmt( const SwSelBoxes& rBoxes, const SwTableAutoFmt& rNe
}
if( pUndo )
- DoUndo( TRUE );
+ {
+ GetIDocumentUndoRedo().DoUndo(bUndo);
+ }
SetModified();
SetFieldsDirty( true, NULL, 0 );
- return TRUE;
+ return sal_True;
}
// Erfrage wie attributiert ist
-BOOL SwDoc::GetTableAutoFmt( const SwSelBoxes& rBoxes, SwTableAutoFmt& rGet )
+sal_Bool SwDoc::GetTableAutoFmt( const SwSelBoxes& rBoxes, SwTableAutoFmt& rGet )
{
ASSERT( rBoxes.Count(), "keine gueltige Box-Liste" );
SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode();
if( !pTblNd )
- return FALSE;
+ return sal_False;
// suche alle Boxen / Lines
_FndBox aFndBox( 0, 0 );
@@ -3890,7 +3981,7 @@ BOOL SwDoc::GetTableAutoFmt( const SwSelBoxes& rBoxes, SwTableAutoFmt& rGet )
pTblNd->GetTable().GetTabLines().ForEach( &_FndLineCopyCol, &aPara );
}
if( !aFndBox.GetLines().Count() )
- return FALSE;
+ return sal_False;
_FndBox* pFndBox = &aFndBox;
while( 1 == pFndBox->GetLines().Count() &&
@@ -3902,30 +3993,30 @@ BOOL SwDoc::GetTableAutoFmt( const SwSelBoxes& rBoxes, SwTableAutoFmt& rGet )
_FndLines& rFLns = pFndBox->GetLines();
- USHORT aLnArr[4];
+ sal_uInt16 aLnArr[4];
aLnArr[0] = 0;
aLnArr[1] = 1 < rFLns.Count() ? 1 : 0;
aLnArr[2] = 2 < rFLns.Count() ? 2 : aLnArr[1];
aLnArr[3] = rFLns.Count() - 1;
- for( BYTE nLine = 0; nLine < 4; ++nLine )
+ for( sal_uInt8 nLine = 0; nLine < 4; ++nLine )
{
_FndLine& rLine = *rFLns[ aLnArr[ nLine ] ];
- USHORT aBoxArr[4];
+ sal_uInt16 aBoxArr[4];
aBoxArr[0] = 0;
aBoxArr[1] = 1 < rLine.GetBoxes().Count() ? 1 : 0;
aBoxArr[2] = 2 < rLine.GetBoxes().Count() ? 2 : aBoxArr[1];
aBoxArr[3] = rLine.GetBoxes().Count() - 1;
- for( BYTE nBox = 0; nBox < 4; ++nBox )
+ for( sal_uInt8 nBox = 0; nBox < 4; ++nBox )
{
SwTableBox* pFBox = rLine.GetBoxes()[ aBoxArr[ nBox ] ]->GetBox();
// immer auf die 1. runterfallen
while( !pFBox->GetSttNd() )
pFBox = pFBox->GetTabLines()[0]->GetTabBoxes()[0];
- BYTE nPos = nLine * 4 + nBox;
+ sal_uInt8 nPos = nLine * 4 + nBox;
SwNodeIndex aIdx( *pFBox->GetSttNd(), 1 );
SwCntntNode* pCNd = aIdx.GetNode().GetCntntNode();
if( !pCNd )
@@ -3936,11 +4027,11 @@ BOOL SwDoc::GetTableAutoFmt( const SwSelBoxes& rBoxes, SwTableAutoFmt& rGet )
SwTableAutoFmt::UPDATE_CHAR, 0 );
rGet.UpdateFromSet( nPos, pFBox->GetFrmFmt()->GetAttrSet(),
SwTableAutoFmt::UPDATE_BOX,
- GetNumberFormatter( TRUE ) );
+ GetNumberFormatter( sal_True ) );
}
}
- return TRUE;
+ return sal_True;
}
String SwDoc::GetUniqueTblName() const
@@ -3949,10 +4040,10 @@ String SwDoc::GetUniqueTblName() const
String aName( aId );
xub_StrLen nNmLen = aName.Len();
- USHORT nNum, nTmp, nFlagSize = ( pTblFrmFmtTbl->Count() / 8 ) +2;
- USHORT n;
+ sal_uInt16 nNum, nTmp, nFlagSize = ( pTblFrmFmtTbl->Count() / 8 ) +2;
+ sal_uInt16 n;
- BYTE* pSetFlags = new BYTE[ nFlagSize ];
+ sal_uInt8* pSetFlags = new sal_uInt8[ nFlagSize ];
memset( pSetFlags, 0, nFlagSize );
for( n = 0; n < pTblFrmFmtTbl->Count(); ++n )
@@ -3962,7 +4053,7 @@ String SwDoc::GetUniqueTblName() const
pFmt->GetName().Match( aName ) == nNmLen )
{
// Nummer bestimmen und das Flag setzen
- nNum = static_cast<USHORT>(pFmt->GetName().Copy( nNmLen ).ToInt32());
+ nNum = static_cast<sal_uInt16>(pFmt->GetName().Copy( nNmLen ).ToInt32());
if( nNum-- && nNum < pTblFrmFmtTbl->Count() )
pSetFlags[ nNum / 8 ] |= (0x01 << ( nNum & 0x07 ));
}
@@ -3984,7 +4075,7 @@ String SwDoc::GetUniqueTblName() const
return aName += String::CreateFromInt32( ++nNum );
}
-SwTableFmt* SwDoc::FindTblFmtByName( const String& rName, BOOL bAll ) const
+SwTableFmt* SwDoc::FindTblFmtByName( const String& rName, sal_Bool bAll ) const
{
const SwFmt* pRet = 0;
if( bAll )
@@ -3992,7 +4083,7 @@ SwTableFmt* SwDoc::FindTblFmtByName( const String& rName, BOOL bAll ) const
else
{
// dann nur die, die im Doc gesetzt sind
- for( USHORT n = 0; n < pTblFrmFmtTbl->Count(); ++n )
+ for( sal_uInt16 n = 0; n < pTblFrmFmtTbl->Count(); ++n )
{
const SwFrmFmt* pFmt = (*pTblFrmFmtTbl)[ n ];
if( !pFmt->IsDefault() && IsUsed( *pFmt ) &&
@@ -4006,20 +4097,21 @@ SwTableFmt* SwDoc::FindTblFmtByName( const String& rName, BOOL bAll ) const
return (SwTableFmt*)pRet;
}
-BOOL SwDoc::SetColRowWidthHeight( SwTableBox& rAktBox, USHORT eType,
+sal_Bool SwDoc::SetColRowWidthHeight( SwTableBox& rAktBox, sal_uInt16 eType,
SwTwips nAbsDiff, SwTwips nRelDiff )
{
SwTableNode* pTblNd = (SwTableNode*)rAktBox.GetSttNd()->FindTableNode();
SwUndo* pUndo = 0;
if( nsTblChgWidthHeightType::WH_FLAG_INSDEL & eType && pTblNd->GetTable().ISA( SwDDETable ))
- return FALSE;
+ return sal_False;
SwTableFmlUpdate aMsgHnt( &pTblNd->GetTable() );
aMsgHnt.eFlags = TBL_BOXPTR;
UpdateTblFlds( &aMsgHnt );
- BOOL bRet = FALSE;
+ bool const bUndo(GetIDocumentUndoRedo().DoesUndo());
+ sal_Bool bRet = sal_False;
switch( eType & 0xff )
{
case nsTblChgWidthHeightType::WH_COL_LEFT:
@@ -4029,7 +4121,7 @@ BOOL SwDoc::SetColRowWidthHeight( SwTableBox& rAktBox, USHORT eType,
{
bRet = pTblNd->GetTable().SetColWidth( rAktBox,
eType, nAbsDiff, nRelDiff,
- DoesUndo() ? &pUndo : 0 );
+ (bUndo) ? &pUndo : 0 );
}
break;
case nsTblChgWidthHeightType::WH_ROW_TOP:
@@ -4038,15 +4130,14 @@ BOOL SwDoc::SetColRowWidthHeight( SwTableBox& rAktBox, USHORT eType,
case nsTblChgWidthHeightType::WH_CELL_BOTTOM:
bRet = pTblNd->GetTable().SetRowHeight( rAktBox,
eType, nAbsDiff, nRelDiff,
- DoesUndo() ? &pUndo : 0 );
+ (bUndo) ? &pUndo : 0 );
break;
}
+ GetIDocumentUndoRedo().DoUndo(bUndo); // SetColWidth can turn it off
if( pUndo )
{
- ClearRedo();
- AppendUndo( pUndo );
- DoUndo( TRUE ); // im SetColWidth kann es abgeschaltet werden!
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
}
if( bRet )
@@ -4059,30 +4150,30 @@ BOOL SwDoc::SetColRowWidthHeight( SwTableBox& rAktBox, USHORT eType,
}
-void SwDoc::ChkBoxNumFmt( SwTableBox& rBox, BOOL bCallUpdate )
+void SwDoc::ChkBoxNumFmt( SwTableBox& rBox, sal_Bool bCallUpdate )
{
//JP 09.07.97: Optimierung: wenn die Box schon sagt, das es Text
// sein soll, dann bleibt das auch Text!
const SfxPoolItem* pNumFmtItem = 0;
if( SFX_ITEM_SET == rBox.GetFrmFmt()->GetItemState( RES_BOXATR_FORMAT,
- FALSE, &pNumFmtItem ) && GetNumberFormatter()->IsTextFormat(
+ sal_False, &pNumFmtItem ) && GetNumberFormatter()->IsTextFormat(
((SwTblBoxNumFormat*)pNumFmtItem)->GetValue() ))
return ;
SwUndoTblNumFmt* pUndo = 0;
- BOOL bIsEmptyTxtNd, bChgd = TRUE;
+ sal_Bool bIsEmptyTxtNd, bChgd = sal_True;
sal_uInt32 nFmtIdx;
double fNumber;
if( rBox.HasNumCntnt( fNumber, nFmtIdx, bIsEmptyTxtNd ) )
{
if( !rBox.IsNumberChanged() )
- bChgd = FALSE;
+ bChgd = sal_False;
else
{
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- StartUndo( UNDO_TABLE_AUTOFMT, NULL );
+ GetIDocumentUndoRedo().StartUndo( UNDO_TABLE_AUTOFMT, NULL );
pUndo = new SwUndoTblNumFmt( rBox );
pUndo->SetNumFmt( nFmtIdx, fNumber );
}
@@ -4090,16 +4181,16 @@ void SwDoc::ChkBoxNumFmt( SwTableBox& rBox, BOOL bCallUpdate )
SwTableBoxFmt* pBoxFmt = (SwTableBoxFmt*)rBox.GetFrmFmt();
SfxItemSet aBoxSet( GetAttrPool(), RES_BOXATR_FORMAT, RES_BOXATR_VALUE );
- BOOL bSetNumFmt = IsInsTblFormatNum(), bLockModify = TRUE;
+ sal_Bool bSetNumFmt = IsInsTblFormatNum(), bLockModify = sal_True;
if( bSetNumFmt )
{
if( !IsInsTblChangeNumFormat() )
{
if( !pNumFmtItem )
- bSetNumFmt = FALSE;
+ bSetNumFmt = sal_False;
else
{
- ULONG nOldNumFmt = ((SwTblBoxNumFormat*)pNumFmtItem)->
+ sal_uLong nOldNumFmt = ((SwTblBoxNumFormat*)pNumFmtItem)->
GetValue();
SvNumberFormatter* pNumFmtr = GetNumberFormatter();
@@ -4112,7 +4203,7 @@ void SwDoc::ChkBoxNumFmt( SwTableBox& rBox, BOOL bCallUpdate )
else
// eingstelltes und vorgegebenes NumFormat
// stimmen nicht ueberein -> als Text einfuegen
- bLockModify = bSetNumFmt = FALSE;
+ bLockModify = bSetNumFmt = sal_False;
}
}
@@ -4151,20 +4242,20 @@ void SwDoc::ChkBoxNumFmt( SwTableBox& rBox, BOOL bCallUpdate )
const SfxPoolItem* pValueItem = 0, *pFmtItem = 0;
SwTableBoxFmt* pBoxFmt = (SwTableBoxFmt*)rBox.GetFrmFmt();
if( SFX_ITEM_SET == pBoxFmt->GetItemState( RES_BOXATR_FORMAT,
- FALSE, &pFmtItem ) ||
+ sal_False, &pFmtItem ) ||
SFX_ITEM_SET == pBoxFmt->GetItemState( RES_BOXATR_VALUE,
- FALSE, &pValueItem ))
+ sal_False, &pValueItem ))
{
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- StartUndo( UNDO_TABLE_AUTOFMT, NULL );
+ GetIDocumentUndoRedo().StartUndo( UNDO_TABLE_AUTOFMT, NULL );
pUndo = new SwUndoTblNumFmt( rBox );
}
pBoxFmt = (SwTableBoxFmt*)rBox.ClaimFrmFmt();
// alle Zahlenformate entfernen
- USHORT nWhich1 = RES_BOXATR_FORMULA;
+ sal_uInt16 nWhich1 = RES_BOXATR_FORMULA;
if( !bIsEmptyTxtNd )
//JP 15.01.99: dieser Teil wurde doch schon oben abgeprueft!
/* && pFmtItem && !GetNumberFormatter()->
@@ -4180,7 +4271,7 @@ void SwDoc::ChkBoxNumFmt( SwTableBox& rBox, BOOL bCallUpdate )
pBoxFmt->ResetFmtAttr( nWhich1, RES_BOXATR_VALUE );
}
else
- bChgd = FALSE;
+ bChgd = sal_False;
}
if( bChgd )
@@ -4188,8 +4279,8 @@ void SwDoc::ChkBoxNumFmt( SwTableBox& rBox, BOOL bCallUpdate )
if( pUndo )
{
pUndo->SetBox( rBox );
- AppendUndo( pUndo );
- EndUndo( UNDO_END, NULL );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
+ GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
}
const SwTableNode* pTblNd = rBox.GetSttNd()->FindTableNode();
@@ -4209,10 +4300,9 @@ void SwDoc::ChkBoxNumFmt( SwTableBox& rBox, BOOL bCallUpdate )
void SwDoc::SetTblBoxFormulaAttrs( SwTableBox& rBox, const SfxItemSet& rSet )
{
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoTblNumFmt( rBox, &rSet ) );
+ GetIDocumentUndoRedo().AppendUndo( new SwUndoTblNumFmt(rBox, &rSet) );
}
SwFrmFmt* pBoxFmt = rBox.ClaimFrmFmt();
@@ -4235,7 +4325,7 @@ void SwDoc::SetTblBoxFormulaAttrs( SwTableBox& rBox, const SfxItemSet& rSet )
void SwDoc::ClearBoxNumAttrs( const SwNodeIndex& rNode )
{
SwStartNode* pSttNd;
- if( 0 != ( pSttNd = GetNodes()[ rNode ]->
+ if( 0 != ( pSttNd = rNode.GetNode().
FindSttNodeByType( SwTableBoxStartNode )) &&
2 == pSttNd->EndOfSectionIndex() - pSttNd->GetIndex() )
{
@@ -4244,20 +4334,19 @@ void SwDoc::ClearBoxNumAttrs( const SwNodeIndex& rNode )
const SfxPoolItem* pFmtItem = 0;
const SfxItemSet& rSet = pBox->GetFrmFmt()->GetAttrSet();
- if( SFX_ITEM_SET == rSet.GetItemState( RES_BOXATR_FORMAT, FALSE, &pFmtItem ) ||
- SFX_ITEM_SET == rSet.GetItemState( RES_BOXATR_FORMULA, FALSE ) ||
- SFX_ITEM_SET == rSet.GetItemState( RES_BOXATR_VALUE, FALSE ))
+ if( SFX_ITEM_SET == rSet.GetItemState( RES_BOXATR_FORMAT, sal_False, &pFmtItem ) ||
+ SFX_ITEM_SET == rSet.GetItemState( RES_BOXATR_FORMULA, sal_False ) ||
+ SFX_ITEM_SET == rSet.GetItemState( RES_BOXATR_VALUE, sal_False ))
{
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoTblNumFmt( *pBox ) );
+ GetIDocumentUndoRedo().AppendUndo(new SwUndoTblNumFmt(*pBox));
}
SwFrmFmt* pBoxFmt = pBox->ClaimFrmFmt();
//JP 01.09.97: TextFormate bleiben erhalten!
- USHORT nWhich1 = RES_BOXATR_FORMAT;
+ sal_uInt16 nWhich1 = RES_BOXATR_FORMAT;
if( pFmtItem && GetNumberFormatter()->IsTextFormat(
((SwTblBoxNumFormat*)pFmtItem)->GetValue() ))
nWhich1 = RES_BOXATR_FORMULA;
@@ -4279,41 +4368,47 @@ void SwDoc::ClearBoxNumAttrs( const SwNodeIndex& rNode )
// in eine bestehende TblSelektion gefuellt wird.
// Gerufen wird es von: edglss.cxx/fecopy.cxx
-BOOL SwDoc::InsCopyOfTbl( SwPosition& rInsPos, const SwSelBoxes& rBoxes,
- const SwTable* pCpyTbl, BOOL bCpyName, BOOL bCorrPos )
+sal_Bool SwDoc::InsCopyOfTbl( SwPosition& rInsPos, const SwSelBoxes& rBoxes,
+ const SwTable* pCpyTbl, sal_Bool bCpyName, sal_Bool bCorrPos )
{
- BOOL bRet;
+ sal_Bool bRet;
const SwTableNode* pSrcTblNd = pCpyTbl
? pCpyTbl->GetTableNode()
: rBoxes[ 0 ]->GetSttNd()->FindTableNode();
- SwTableNode* pInsTblNd = GetNodes()[ rInsPos.nNode ]->FindTableNode();
+ SwTableNode * pInsTblNd = rInsPos.nNode.GetNode().FindTableNode();
+ bool const bUndo( GetIDocumentUndoRedo().DoesUndo() );
if( !pCpyTbl && !pInsTblNd )
{
SwUndoCpyTbl* pUndo = 0;
- if( DoesUndo() )
+ if (bUndo)
{
- ClearRedo();
+ GetIDocumentUndoRedo().ClearRedo();
pUndo = new SwUndoCpyTbl;
- DoUndo( FALSE );
}
- bRet = pSrcTblNd->GetTable().MakeCopy( this, rInsPos, rBoxes,
- TRUE, bCpyName );
+ {
+ ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
+ bRet = pSrcTblNd->GetTable().MakeCopy( this, rInsPos, rBoxes,
+ sal_True, bCpyName );
+ }
+
if( pUndo )
{
if( !bRet )
+ {
delete pUndo;
+ pUndo = 0;
+ }
else
{
pInsTblNd = GetNodes()[ rInsPos.nNode.GetIndex() - 1 ]->FindTableNode();
pUndo->SetTableSttIdx( pInsTblNd->GetIndex() );
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
}
- DoUndo( TRUE );
}
}
else
@@ -4325,43 +4420,38 @@ BOOL SwDoc::InsCopyOfTbl( SwPosition& rInsPos, const SwSelBoxes& rBoxes,
nsRedlineMode_t::REDLINE_SHOW_DELETE));
SwUndoTblCpyTbl* pUndo = 0;
- if( DoesUndo() )
+ if (bUndo)
{
- ClearRedo();
+ GetIDocumentUndoRedo().ClearRedo();
pUndo = new SwUndoTblCpyTbl;
- DoUndo( FALSE );
+ GetIDocumentUndoRedo().DoUndo(false);
}
SwDoc* pCpyDoc = (SwDoc*)pSrcTblNd->GetDoc();
- SfxObjectShellRef* pRefForDocSh = 0;
- BOOL bDelCpyDoc = pCpyDoc == this;
+ sal_Bool bDelCpyDoc = pCpyDoc == this;
if( bDelCpyDoc )
{
// kopiere die Tabelle erstmal in ein temp. Doc
pCpyDoc = new SwDoc;
pCpyDoc->acquire();
- pRefForDocSh = new SfxObjectShellRef();
- pCpyDoc->SetRefForDocShell( pRefForDocSh );
SwPosition aPos( SwNodeIndex( pCpyDoc->GetNodes().GetEndOfContent() ));
- if( !pSrcTblNd->GetTable().MakeCopy( pCpyDoc, aPos, rBoxes, TRUE, TRUE ))
+ if( !pSrcTblNd->GetTable().MakeCopy( pCpyDoc, aPos, rBoxes, sal_True, sal_True ))
{
- delete pRefForDocSh;
if( pCpyDoc->release() == 0 )
delete pCpyDoc;
if( pUndo )
{
- DoUndo( TRUE );
+ GetIDocumentUndoRedo().DoUndo(bUndo);
delete pUndo;
+ pUndo = 0;
}
- return FALSE;
+ return sal_False;
}
aPos.nNode -= 1; // auf den EndNode der Tabelle
pSrcTblNd = aPos.nNode.GetNode().FindTableNode();
-
- pCpyDoc->SetRefForDocShell( NULL );
}
const SwStartNode* pSttNd = rInsPos.nNode.GetNode().FindTableBoxStartNode();
@@ -4400,7 +4490,6 @@ BOOL SwDoc::InsCopyOfTbl( SwPosition& rInsPos, const SwSelBoxes& rBoxes,
if( bDelCpyDoc )
{
- delete pRefForDocSh;
if( pCpyDoc->release() == 0 )
delete pCpyDoc;
}
@@ -4409,11 +4498,13 @@ BOOL SwDoc::InsCopyOfTbl( SwPosition& rInsPos, const SwSelBoxes& rBoxes,
{
// falls die Tabelle nicht kopiert werden konnte, das Undo-Object
// wieder loeschen
+ GetIDocumentUndoRedo().DoUndo(bUndo);
if( !bRet && pUndo->IsEmpty() )
delete pUndo;
else
- AppendUndo( pUndo );
- DoUndo( TRUE );
+ {
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
+ }
}
if( bCorrPos )
@@ -4434,20 +4525,21 @@ BOOL SwDoc::InsCopyOfTbl( SwPosition& rInsPos, const SwSelBoxes& rBoxes,
-BOOL SwDoc::_UnProtectTblCells( SwTable& rTbl )
+sal_Bool SwDoc::_UnProtectTblCells( SwTable& rTbl )
{
- BOOL bChgd = FALSE;
- SwUndoAttrTbl* pUndo = DoesUndo() ? new SwUndoAttrTbl( *rTbl.GetTableNode() )
- : 0;
+ sal_Bool bChgd = sal_False;
+ SwUndoAttrTbl *const pUndo = (GetIDocumentUndoRedo().DoesUndo())
+ ? new SwUndoAttrTbl( *rTbl.GetTableNode() )
+ : 0;
SwTableSortBoxes& rSrtBox = rTbl.GetTabSortBoxes();
- for( USHORT i = rSrtBox.Count(); i; )
+ for( sal_uInt16 i = rSrtBox.Count(); i; )
{
SwFrmFmt *pBoxFmt = rSrtBox[ --i ]->GetFrmFmt();
if( pBoxFmt->GetProtect().IsCntntProtected() )
{
pBoxFmt->ResetFmtAttr( RES_PROTECT );
- bChgd = TRUE;
+ bChgd = sal_True;
}
}
@@ -4455,8 +4547,7 @@ BOOL SwDoc::_UnProtectTblCells( SwTable& rTbl )
{
if( bChgd )
{
- ClearRedo();
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
}
else
delete pUndo;
@@ -4465,9 +4556,9 @@ BOOL SwDoc::_UnProtectTblCells( SwTable& rTbl )
}
-BOOL SwDoc::UnProtectCells( const String& rName )
+sal_Bool SwDoc::UnProtectCells( const String& rName )
{
- BOOL bChgd = FALSE;
+ sal_Bool bChgd = sal_False;
SwTableFmt* pFmt = FindTblFmtByName( rName );
if( pFmt )
{
@@ -4479,23 +4570,23 @@ BOOL SwDoc::UnProtectCells( const String& rName )
return bChgd;
}
-BOOL SwDoc::UnProtectCells( const SwSelBoxes& rBoxes )
+sal_Bool SwDoc::UnProtectCells( const SwSelBoxes& rBoxes )
{
- BOOL bChgd = FALSE;
+ sal_Bool bChgd = sal_False;
if( rBoxes.Count() )
{
- SwUndoAttrTbl* pUndo = DoesUndo()
+ SwUndoAttrTbl *const pUndo = (GetIDocumentUndoRedo().DoesUndo())
? new SwUndoAttrTbl( *rBoxes[0]->GetSttNd()->FindTableNode() )
: 0;
SvPtrarr aFmts( 16 ), aNewFmts( 16 );
- for( USHORT i = rBoxes.Count(); i; )
+ for( sal_uInt16 i = rBoxes.Count(); i; )
{
SwTableBox* pBox = rBoxes[ --i ];
SwFrmFmt* pBoxFmt = pBox->GetFrmFmt();
if( pBoxFmt->GetProtect().IsCntntProtected() )
{
- USHORT nFnd = aFmts.GetPos( pBoxFmt );
+ sal_uInt16 nFnd = aFmts.GetPos( pBoxFmt );
if( USHRT_MAX != nFnd )
pBox->ChgFrmFmt( (SwTableBoxFmt*)aNewFmts[ nFnd ] );
else
@@ -4505,7 +4596,7 @@ BOOL SwDoc::UnProtectCells( const SwSelBoxes& rBoxes )
pBoxFmt->ResetFmtAttr( RES_PROTECT );
aNewFmts.Insert( pBoxFmt, aNewFmts.Count() );
}
- bChgd = TRUE;
+ bChgd = sal_True;
}
}
@@ -4513,8 +4604,7 @@ BOOL SwDoc::UnProtectCells( const SwSelBoxes& rBoxes )
{
if( bChgd )
{
- ClearRedo();
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
}
else
delete pUndo;
@@ -4523,26 +4613,26 @@ BOOL SwDoc::UnProtectCells( const SwSelBoxes& rBoxes )
return bChgd;
}
-BOOL SwDoc::UnProtectTbls( const SwPaM& rPam )
+sal_Bool SwDoc::UnProtectTbls( const SwPaM& rPam )
{
- StartUndo(UNDO_EMPTY, NULL);
+ GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL);
- BOOL bChgd = FALSE, bHasSel = rPam.HasMark() ||
+ sal_Bool bChgd = sal_False, bHasSel = rPam.HasMark() ||
rPam.GetNext() != (SwPaM*)&rPam;
SwFrmFmts& rFmts = *GetTblFrmFmts();
SwTable* pTbl;
const SwTableNode* pTblNd;
- for( USHORT n = rFmts.Count(); n ; )
+ for( sal_uInt16 n = rFmts.Count(); n ; )
if( 0 != (pTbl = SwTable::FindTable( rFmts[ --n ] )) &&
0 != (pTblNd = pTbl->GetTableNode() ) &&
pTblNd->GetNodes().IsDocNodes() )
{
- ULONG nTblIdx = pTblNd->GetIndex();
+ sal_uLong nTblIdx = pTblNd->GetIndex();
// dann ueberpruefe ob Tabelle in der Selection liegt
if( bHasSel )
{
- int bFound = FALSE;
+ int bFound = sal_False;
SwPaM* pTmp = (SwPaM*)&rPam;
do {
const SwPosition *pStt = pTmp->Start(),
@@ -4559,18 +4649,18 @@ BOOL SwDoc::UnProtectTbls( const SwPaM& rPam )
bChgd |= _UnProtectTblCells( *pTbl );
}
- EndUndo(UNDO_EMPTY, NULL);
+ GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, NULL);
if( bChgd )
SetModified();
return bChgd;
}
-BOOL SwDoc::HasTblAnyProtection( const SwPosition* pPos,
+sal_Bool SwDoc::HasTblAnyProtection( const SwPosition* pPos,
const String* pTblName,
- BOOL* pFullTblProtection )
+ sal_Bool* pFullTblProtection )
{
- BOOL bHasProtection = FALSE;
+ sal_Bool bHasProtection = sal_False;
SwTable* pTbl = 0;
if( pTblName )
pTbl = SwTable::FindTable( FindTblFmtByName( *pTblName ) );
@@ -4584,22 +4674,22 @@ BOOL SwDoc::HasTblAnyProtection( const SwPosition* pPos,
if( pTbl )
{
SwTableSortBoxes& rSrtBox = pTbl->GetTabSortBoxes();
- for( USHORT i = rSrtBox.Count(); i; )
+ for( sal_uInt16 i = rSrtBox.Count(); i; )
{
SwFrmFmt *pBoxFmt = rSrtBox[ --i ]->GetFrmFmt();
if( pBoxFmt->GetProtect().IsCntntProtected() )
{
if( !bHasProtection )
{
- bHasProtection = TRUE;
+ bHasProtection = sal_True;
if( !pFullTblProtection )
break;
- *pFullTblProtection = TRUE;
+ *pFullTblProtection = sal_True;
}
}
else if( bHasProtection && pFullTblProtection )
{
- *pFullTblProtection = FALSE;
+ *pFullTblProtection = sal_False;
break;
}
}
@@ -4609,14 +4699,14 @@ BOOL SwDoc::HasTblAnyProtection( const SwPosition* pPos,
#ifdef DEL_TABLE_REDLINES
lcl_DelRedlines::lcl_DelRedlines( const SwTableNode& rNd,
- BOOL bCheckForOwnRedline )
+ sal_Bool bCheckForOwnRedline )
: pDoc( (SwDoc*)rNd.GetNodes().GetDoc() )
{
pDoc->StartUndo(UNDO_EMPTY, NULL);
const SwRedlineTbl& rTbl = pDoc->GetRedlineTbl();
if( !pDoc->IsIgnoreRedline() && rTbl.Count() )
{
- BOOL bDelete = TRUE;
+ sal_Bool bDelete = sal_True;
if( bCheckForOwnRedline )
{
sal_uInt16 nRedlPos = pDoc->GetRedlinePos( rNd, USHRT_MAX );
@@ -4635,7 +4725,7 @@ lcl_DelRedlines::lcl_DelRedlines( const SwTableNode& rNd,
if( pEnd->nNode >= nEndNd &&
pRedline->GetAuthor() == pDoc->GetRedlineAuthor() )
{
- bDelete = FALSE;
+ bDelete = sal_False;
break;
}
}
diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx
index 8842e0e758de..559109ae3e0b 100644
--- a/sw/source/core/docnode/ndtbl1.cxx
+++ b/sw/source/core/docnode/ndtbl1.cxx
@@ -28,6 +28,10 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+<<<<<<< local
+=======
+
+>>>>>>> other
#include "hintids.hxx"
#include <editeng/lrspitem.hxx>
#include <editeng/boxitem.hxx>
@@ -44,7 +48,8 @@
#include <cntfrm.hxx>
#include <txtfrm.hxx>
#include <svx/svxids.hrc>
-#include "doc.hxx"
+#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include "pam.hxx"
#include "swcrsr.hxx"
#include "viscrs.hxx"
@@ -54,8 +59,13 @@
#include "swtblfmt.hxx"
#include "docary.hxx"
#include "ndindex.hxx"
+<<<<<<< local
#include "undobj.hxx"
#include "switerator.hxx"
+=======
+#include <UndoTable.hxx>
+
+>>>>>>> other
using namespace ::com::sun::star;
@@ -65,30 +75,30 @@ extern void ClearFEShellTabCols();
//siehe auch swtable.cxx
#define COLFUZZY 20L
-inline BOOL IsSame( long nA, long nB ) { return Abs(nA-nB) <= COLFUZZY; }
+inline sal_Bool IsSame( long nA, long nB ) { return Abs(nA-nB) <= COLFUZZY; }
class SwTblFmtCmp
{
public:
SwFrmFmt *pOld,
*pNew;
- INT16 nType;
+ sal_Int16 nType;
- SwTblFmtCmp( SwFrmFmt *pOld, SwFrmFmt *pNew, INT16 nType );
+ SwTblFmtCmp( SwFrmFmt *pOld, SwFrmFmt *pNew, sal_Int16 nType );
- static SwFrmFmt *FindNewFmt( SvPtrarr &rArr, SwFrmFmt*pOld, INT16 nType );
+ static SwFrmFmt *FindNewFmt( SvPtrarr &rArr, SwFrmFmt*pOld, sal_Int16 nType );
static void Delete( SvPtrarr &rArr );
};
-SwTblFmtCmp::SwTblFmtCmp( SwFrmFmt *pO, SwFrmFmt *pN, INT16 nT )
+SwTblFmtCmp::SwTblFmtCmp( SwFrmFmt *pO, SwFrmFmt *pN, sal_Int16 nT )
: pOld ( pO ), pNew ( pN ), nType( nT )
{
}
-SwFrmFmt *SwTblFmtCmp::FindNewFmt( SvPtrarr &rArr, SwFrmFmt *pOld, INT16 nType )
+SwFrmFmt *SwTblFmtCmp::FindNewFmt( SvPtrarr &rArr, SwFrmFmt *pOld, sal_Int16 nType )
{
- for ( USHORT i = 0; i < rArr.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rArr.Count(); ++i )
{
SwTblFmtCmp *pCmp = (SwTblFmtCmp*)rArr[i];
if ( pCmp->pOld == pOld && pCmp->nType == nType )
@@ -99,14 +109,14 @@ SwFrmFmt *SwTblFmtCmp::FindNewFmt( SvPtrarr &rArr, SwFrmFmt *pOld, INT16 nType )
void SwTblFmtCmp::Delete( SvPtrarr &rArr )
{
- for ( USHORT i = 0; i < rArr.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rArr.Count(); ++i )
delete (SwTblFmtCmp*)rArr[i];
}
void lcl_GetStartEndCell( const SwCursor& rCrsr,
SwLayoutFrm *&prStart, SwLayoutFrm *&prEnd )
{
- ASSERT( rCrsr.GetCntntNode() && rCrsr.GetCntntNode( FALSE ),
+ ASSERT( rCrsr.GetCntntNode() && rCrsr.GetCntntNode( sal_False ),
"Tabselection nicht auf Cnt." );
Point aPtPos, aMkPos;
@@ -119,7 +129,7 @@ void lcl_GetStartEndCell( const SwCursor& rCrsr,
// robust:
SwCntntNode* pPointNd = rCrsr.GetCntntNode();
- SwCntntNode* pMarkNd = rCrsr.GetCntntNode(FALSE);
+ SwCntntNode* pMarkNd = rCrsr.GetCntntNode(sal_False);
SwFrm* pPointFrm = pPointNd ? pPointNd->getLayoutFrm( pPointNd->GetDoc()->GetCurrentLayout(), &aPtPos ) : 0;
SwFrm* pMarkFrm = pMarkNd ? pMarkNd->getLayoutFrm( pMarkNd->GetDoc()->GetCurrentLayout(), &aMkPos ) : 0;
@@ -128,8 +138,8 @@ void lcl_GetStartEndCell( const SwCursor& rCrsr,
prEnd = pMarkFrm ? pMarkFrm->GetUpper() : 0;
}
-BOOL lcl_GetBoxSel( const SwCursor& rCursor, SwSelBoxes& rBoxes,
- BOOL bAllCrsr = FALSE )
+sal_Bool lcl_GetBoxSel( const SwCursor& rCursor, SwSelBoxes& rBoxes,
+ sal_Bool bAllCrsr = sal_False )
{
const SwTableCursor* pTblCrsr =
dynamic_cast<const SwTableCursor*>(&rCursor);
@@ -175,17 +185,17 @@ inline void InsertLine( SvPtrarr& rLineArr, SwTableLine* pLine )
//-----------------------------------------------------------------------------
-BOOL lcl_IsAnLower( const SwTableLine *pLine, const SwTableLine *pAssumed )
+sal_Bool lcl_IsAnLower( const SwTableLine *pLine, const SwTableLine *pAssumed )
{
const SwTableLine *pTmp = pAssumed->GetUpper() ?
pAssumed->GetUpper()->GetUpper() : 0;
while ( pTmp )
{
if ( pTmp == pLine )
- return TRUE;
+ return sal_True;
pTmp = pTmp->GetUpper() ? pTmp->GetUpper()->GetUpper() : 0;
}
- return FALSE;
+ return sal_False;
}
//-----------------------------------------------------------------------------
@@ -193,20 +203,20 @@ struct LinesAndTable
{
SvPtrarr &rLines;
const SwTable &rTable;
- BOOL bInsertLines;
+ sal_Bool bInsertLines;
LinesAndTable( SvPtrarr &rL, const SwTable &rTbl ) :
- rLines( rL ), rTable( rTbl ), bInsertLines( TRUE ) {}
+ rLines( rL ), rTable( rTbl ), bInsertLines( sal_True ) {}
};
-BOOL _FindLine( const _FndLine*& rpLine, void* pPara );
+sal_Bool _FindLine( const _FndLine*& rpLine, void* pPara );
-BOOL _FindBox( const _FndBox*& rpBox, void* pPara )
+sal_Bool _FindBox( const _FndBox*& rpBox, void* pPara )
{
if ( rpBox->GetLines().Count() )
{
- ((LinesAndTable*)pPara)->bInsertLines = TRUE;
+ ((LinesAndTable*)pPara)->bInsertLines = sal_True;
((_FndBox*)rpBox)->GetLines().ForEach( _FindLine, pPara );
if ( ((LinesAndTable*)pPara)->bInsertLines )
{
@@ -215,24 +225,24 @@ BOOL _FindBox( const _FndBox*& rpBox, void* pPara )
: ((LinesAndTable*)pPara)->rTable.GetTabLines();
if ( rpBox->GetLines().Count() == rLines.Count() )
{
- for ( USHORT i = 0; i < rLines.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rLines.Count(); ++i )
::InsertLine( ((LinesAndTable*)pPara)->rLines,
(SwTableLine*)rLines[i] );
}
else
- ((LinesAndTable*)pPara)->bInsertLines = FALSE;
+ ((LinesAndTable*)pPara)->bInsertLines = sal_False;
}
}
else if ( rpBox->GetBox() )
::InsertLine( ((LinesAndTable*)pPara)->rLines,
(SwTableLine*)rpBox->GetBox()->GetUpper() );
- return TRUE;
+ return sal_True;
}
-BOOL _FindLine( const _FndLine*& rpLine, void* pPara )
+sal_Bool _FindLine( const _FndLine*& rpLine, void* pPara )
{
((_FndLine*)rpLine)->GetBoxes().ForEach( _FindBox, pPara );
- return TRUE;
+ return sal_True;
}
void lcl_CollectLines( SvPtrarr &rArr, const SwCursor& rCursor, bool bRemoveLines )
@@ -259,10 +269,10 @@ void lcl_CollectLines( SvPtrarr &rArr, const SwCursor& rCursor, bool bRemoveLine
// (Not for row split)
if ( bRemoveLines )
{
- for ( USHORT i = 0; i < rArr.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rArr.Count(); ++i )
{
SwTableLine *pUpLine = (SwTableLine*)rArr[i];
- for ( USHORT k = 0; k < rArr.Count(); ++k )
+ for ( sal_uInt16 k = 0; k < rArr.Count(); ++k )
{
if ( k != i && ::lcl_IsAnLower( pUpLine, (SwTableLine*)rArr[k] ) )
{
@@ -300,7 +310,7 @@ void lcl_ProcessRowSize( SvPtrarr &rFmtCmp, SwTableLine *pLine, const SwFmtFrmSi
{
lcl_ProcessRowAttr( rFmtCmp, pLine, rNew );
SwTableBoxes &rBoxes = pLine->GetTabBoxes();
- for ( USHORT i = 0; i < rBoxes.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rBoxes.Count(); ++i )
::lcl_ProcessBoxSize( rFmtCmp, rBoxes[i], rNew );
}
@@ -313,7 +323,7 @@ void lcl_ProcessBoxSize( SvPtrarr &rFmtCmp, SwTableBox *pBox, const SwFmtFrmSize
{
SwFmtFrmSize aSz( rNew );
aSz.SetHeight( rNew.GetHeight() ? rNew.GetHeight() / rLines.Count() : 0 );
- for ( USHORT i = 0; i < rLines.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rLines.Count(); ++i )
::lcl_ProcessRowSize( rFmtCmp, rLines[i], aSz );
}
}
@@ -333,15 +343,14 @@ void SwDoc::SetRowSplit( const SwCursor& rCursor, const SwFmtRowSplit &rNew )
if( aRowArr.Count() )
{
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoAttrTbl( *pTblNd ));
+ GetIDocumentUndoRedo().AppendUndo(new SwUndoAttrTbl(*pTblNd));
}
- SvPtrarr aFmtCmp( Max( BYTE(255), BYTE(aRowArr.Count()) ), 255 );
+ SvPtrarr aFmtCmp( Max( sal_uInt8(255), sal_uInt8(aRowArr.Count()) ), 255 );
- for( USHORT i = 0; i < aRowArr.Count(); ++i )
+ for( sal_uInt16 i = 0; i < aRowArr.Count(); ++i )
::lcl_ProcessRowAttr( aFmtCmp, (SwTableLine*)aRowArr[i], rNew );
SwTblFmtCmp::Delete( aFmtCmp );
@@ -369,7 +378,7 @@ void SwDoc::GetRowSplit( const SwCursor& rCursor, SwFmtRowSplit *& rpSz ) const
rpSz = &(SwFmtRowSplit&)((SwTableLine*)aRowArr[0])->
GetFrmFmt()->GetRowSplit();
- for ( USHORT i = 1; i < aRowArr.Count() && rpSz; ++i )
+ for ( sal_uInt16 i = 1; i < aRowArr.Count() && rpSz; ++i )
{
if ( (*rpSz).GetValue() != ((SwTableLine*)aRowArr[i])->GetFrmFmt()->GetRowSplit().GetValue() )
rpSz = 0;
@@ -394,14 +403,13 @@ void SwDoc::SetRowHeight( const SwCursor& rCursor, const SwFmtFrmSize &rNew )
if( aRowArr.Count() )
{
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoAttrTbl( *pTblNd ));
+ GetIDocumentUndoRedo().AppendUndo(new SwUndoAttrTbl(*pTblNd));
}
- SvPtrarr aFmtCmp( Max( BYTE(255), BYTE(aRowArr.Count()) ), 255 );
- for ( USHORT i = 0; i < aRowArr.Count(); ++i )
+ SvPtrarr aFmtCmp( Max( sal_uInt8(255), sal_uInt8(aRowArr.Count()) ), 255 );
+ for ( sal_uInt16 i = 0; i < aRowArr.Count(); ++i )
::lcl_ProcessRowSize( aFmtCmp, (SwTableLine*)aRowArr[i], rNew );
SwTblFmtCmp::Delete( aFmtCmp );
@@ -429,7 +437,7 @@ void SwDoc::GetRowHeight( const SwCursor& rCursor, SwFmtFrmSize *& rpSz ) const
rpSz = &(SwFmtFrmSize&)((SwTableLine*)aRowArr[0])->
GetFrmFmt()->GetFrmSize();
- for ( USHORT i = 1; i < aRowArr.Count() && rpSz; ++i )
+ for ( sal_uInt16 i = 1; i < aRowArr.Count() && rpSz; ++i )
{
if ( *rpSz != ((SwTableLine*)aRowArr[i])->GetFrmFmt()->GetFrmSize() )
rpSz = 0;
@@ -440,9 +448,9 @@ void SwDoc::GetRowHeight( const SwCursor& rCursor, SwFmtFrmSize *& rpSz ) const
}
}
-BOOL SwDoc::BalanceRowHeight( const SwCursor& rCursor, BOOL bTstOnly )
+sal_Bool SwDoc::BalanceRowHeight( const SwCursor& rCursor, sal_Bool bTstOnly )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
SwTableNode* pTblNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode();
if( pTblNd )
{
@@ -454,7 +462,7 @@ BOOL SwDoc::BalanceRowHeight( const SwCursor& rCursor, BOOL bTstOnly )
if( !bTstOnly )
{
long nHeight = 0;
- USHORT i;
+ sal_uInt16 i;
for ( i = 0; i < aRowArr.Count(); ++i )
{
@@ -468,20 +476,20 @@ BOOL SwDoc::BalanceRowHeight( const SwCursor& rCursor, BOOL bTstOnly )
}
SwFmtFrmSize aNew( ATT_MIN_SIZE, 0, nHeight );
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoAttrTbl( *pTblNd ));
+ GetIDocumentUndoRedo().AppendUndo(
+ new SwUndoAttrTbl(*pTblNd));
}
- SvPtrarr aFmtCmp( Max( BYTE(255), BYTE(aRowArr.Count()) ), 255 );
+ SvPtrarr aFmtCmp( Max( sal_uInt8(255), sal_uInt8(aRowArr.Count()) ), 255 );
for( i = 0; i < aRowArr.Count(); ++i )
::lcl_ProcessRowSize( aFmtCmp, (SwTableLine*)aRowArr[i], aNew );
SwTblFmtCmp::Delete( aFmtCmp );
SetModified();
}
- bRet = TRUE;
+ bRet = sal_True;
}
}
return bRet;
@@ -500,15 +508,14 @@ void SwDoc::SetRowBackground( const SwCursor& rCursor, const SvxBrushItem &rNew
if( aRowArr.Count() )
{
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoAttrTbl( *pTblNd ));
+ GetIDocumentUndoRedo().AppendUndo(new SwUndoAttrTbl(*pTblNd));
}
- SvPtrarr aFmtCmp( Max( BYTE(255), BYTE(aRowArr.Count()) ), 255 );
+ SvPtrarr aFmtCmp( Max( sal_uInt8(255), sal_uInt8(aRowArr.Count()) ), 255 );
- for( USHORT i = 0; i < aRowArr.Count(); ++i )
+ for( sal_uInt16 i = 0; i < aRowArr.Count(); ++i )
::lcl_ProcessRowAttr( aFmtCmp, (SwTableLine*)aRowArr[i], rNew );
SwTblFmtCmp::Delete( aFmtCmp );
@@ -520,9 +527,9 @@ void SwDoc::SetRowBackground( const SwCursor& rCursor, const SvxBrushItem &rNew
/******************************************************************************
* SwTwips SwDoc::GetRowBackground() const
******************************************************************************/
-BOOL SwDoc::GetRowBackground( const SwCursor& rCursor, SvxBrushItem &rToFill ) const
+sal_Bool SwDoc::GetRowBackground( const SwCursor& rCursor, SvxBrushItem &rToFill ) const
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
SwTableNode* pTblNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode();
if( pTblNd )
{
@@ -533,11 +540,11 @@ BOOL SwDoc::GetRowBackground( const SwCursor& rCursor, SvxBrushItem &rToFill ) c
{
rToFill = ((SwTableLine*)aRowArr[0])->GetFrmFmt()->GetBackground();
- bRet = TRUE;
- for ( USHORT i = 1; i < aRowArr.Count(); ++i )
+ bRet = sal_True;
+ for ( sal_uInt16 i = 1; i < aRowArr.Count(); ++i )
if ( rToFill != ((SwTableLine*)aRowArr[i])->GetFrmFmt()->GetBackground() )
{
- bRet = FALSE;
+ bRet = sal_False;
break;
}
}
@@ -596,10 +603,9 @@ void SwDoc::SetTabBorders( const SwCursor& rCursor, const SfxItemSet& rSet )
if( aUnions.Count() )
{
SwTable& rTable = pTblNd->GetTable();
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoAttrTbl( *pTblNd ));
+ GetIDocumentUndoRedo().AppendUndo( new SwUndoAttrTbl(*pTblNd) );
}
SvPtrarr aFmtCmp( 255, 255 );
@@ -612,13 +618,13 @@ void SwDoc::SetTabBorders( const SwCursor& rCursor, const SfxItemSet& rSet )
const SvxBorderLine* pBottom = 0;
const SvxBorderLine* pHori = 0;
const SvxBorderLine* pVert = 0;
- BOOL bHoriValid = TRUE, bVertValid = TRUE,
- bTopValid = TRUE, bBottomValid = TRUE,
- bLeftValid = TRUE, bRightValid = TRUE;
+ sal_Bool bHoriValid = sal_True, bVertValid = sal_True,
+ bTopValid = sal_True, bBottomValid = sal_True,
+ bLeftValid = sal_True, bRightValid = sal_True;
// JP 21.07.95: die Flags im BoxInfo-Item entscheiden, wann eine
// BorderLine gueltig ist!!
- if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_BORDER_INNER, FALSE,
+ if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_BORDER_INNER, sal_False,
(const SfxPoolItem**)&pSetBoxInfo) )
{
pHori = pSetBoxInfo->GetHori();
@@ -634,7 +640,7 @@ void SwDoc::SetTabBorders( const SwCursor& rCursor, const SfxItemSet& rSet )
bRightValid = pSetBoxInfo->IsValid(VALID_RIGHT);
}
- if( SFX_ITEM_SET == rSet.GetItemState( RES_BOX, FALSE,
+ if( SFX_ITEM_SET == rSet.GetItemState( RES_BOX, sal_False,
(const SfxPoolItem**)&pSetBox) )
{
pLeft = pSetBox->GetLeft();
@@ -645,17 +651,17 @@ void SwDoc::SetTabBorders( const SwCursor& rCursor, const SfxItemSet& rSet )
else
{
// nicht gesetzt, also keine gueltigen Werte
- bTopValid = bBottomValid = bLeftValid = bRightValid = FALSE;
+ bTopValid = bBottomValid = bLeftValid = bRightValid = sal_False;
pSetBox = 0;
}
- BOOL bFirst = TRUE;
- for ( USHORT i = 0; i < aUnions.Count(); ++i )
+ sal_Bool bFirst = sal_True;
+ for ( sal_uInt16 i = 0; i < aUnions.Count(); ++i )
{
SwSelUnion *pUnion = aUnions[i];
SwTabFrm *pTab = pUnion->GetTable();
const SwRect &rUnion = pUnion->GetUnion();
- const BOOL bLast = i == aUnions.Count() - 1 ? TRUE : FALSE;
+ const sal_Bool bLast = i == aUnions.Count() - 1 ? sal_True : sal_False;
SvPtrarr aCellArr( 255, 255 );
::lcl_CollectCells( aCellArr, pUnion->GetUnion(), pTab );
@@ -668,7 +674,7 @@ void SwDoc::SetTabBorders( const SwCursor& rCursor, const SfxItemSet& rSet )
//handelt doch keine Aussenkanten sein.
//Aussenkanten werden links, rechts, oben und unten gesetzt.
//Innenkanten werden nur oben und links gesetzt.
- for ( USHORT j = 0; j < aCellArr.Count(); ++j )
+ for ( sal_uInt16 j = 0; j < aCellArr.Count(); ++j )
{
SwCellFrm *pCell = (SwCellFrm*)aCellArr[j];
const sal_Bool bVert = pTab->IsVertical();
@@ -706,7 +712,7 @@ void SwDoc::SetTabBorders( const SwCursor& rCursor, const SfxItemSet& rSet )
SvxBoxItem aBox( pCell->GetFmt()->GetBox() );
- INT16 nType = 0;
+ sal_Int16 nType = 0;
//Obere Kante
if( bTopValid )
@@ -770,10 +776,10 @@ void SwDoc::SetTabBorders( const SwCursor& rCursor, const SfxItemSet& rSet )
if( pSetBox )
{
- static USHORT __READONLY_DATA aBorders[] = {
+ static sal_uInt16 __READONLY_DATA aBorders[] = {
BOX_LINE_BOTTOM, BOX_LINE_TOP,
BOX_LINE_RIGHT, BOX_LINE_LEFT };
- const USHORT* pBrd = aBorders;
+ const sal_uInt16* pBrd = aBorders;
for( int k = 0; k < 4; ++k, ++pBrd )
aBox.SetDistance( pSetBox->GetDistance( *pBrd ), *pBrd );
}
@@ -791,7 +797,7 @@ void SwDoc::SetTabBorders( const SwCursor& rCursor, const SfxItemSet& rSet )
}
}
- bFirst = FALSE;
+ bFirst = sal_False;
}
SwHTMLTableLayout *pTableLayout = rTable.GetHTMLTableLayout();
@@ -801,7 +807,7 @@ void SwDoc::SetTabBorders( const SwCursor& rCursor, const SfxItemSet& rSet )
SwTabFrm* pTabFrm = pFrm->ImplFindTabFrm();
pTableLayout->BordersChanged(
- pTableLayout->GetBrowseWidthByTabFrm( *pTabFrm ), TRUE );
+ pTableLayout->GetBrowseWidthByTabFrm( *pTabFrm ), sal_True );
}
SwTblFmtCmp::Delete( aFmtCmp );
::ClearFEShellTabCols();
@@ -828,7 +834,7 @@ void lcl_SetLineStyle( SvxBorderLine *pToSet,
}
void SwDoc::SetTabLineStyle( const SwCursor& rCursor,
- const Color* pColor, BOOL bSetLine,
+ const Color* pColor, sal_Bool bSetLine,
const SvxBorderLine* pBorderLine )
{
SwCntntNode* pCntNd = rCursor.GetPoint()->nNode.GetNode().GetCntntNode();
@@ -845,20 +851,19 @@ void SwDoc::SetTabLineStyle( const SwCursor& rCursor,
if( aUnions.Count() )
{
SwTable& rTable = pTblNd->GetTable();
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoAttrTbl( *pTblNd ));
+ GetIDocumentUndoRedo().AppendUndo(new SwUndoAttrTbl(*pTblNd));
}
- for( USHORT i = 0; i < aUnions.Count(); ++i )
+ for( sal_uInt16 i = 0; i < aUnions.Count(); ++i )
{
SwSelUnion *pUnion = aUnions[i];
SwTabFrm *pTab = pUnion->GetTable();
SvPtrarr aCellArr( 255, 255 );
::lcl_CollectCells( aCellArr, pUnion->GetUnion(), pTab );
- for ( USHORT j = 0; j < aCellArr.Count(); ++j )
+ for ( sal_uInt16 j = 0; j < aCellArr.Count(); ++j )
{
SwCellFrm *pCell = ( SwCellFrm* )aCellArr[j];
@@ -898,7 +903,7 @@ void SwDoc::SetTabLineStyle( const SwCursor& rCursor,
SwTabFrm* pTabFrm = pFrm->ImplFindTabFrm();
pTableLayout->BordersChanged(
- pTableLayout->GetBrowseWidthByTabFrm( *pTabFrm ), TRUE );
+ pTableLayout->GetBrowseWidthByTabFrm( *pTabFrm ), sal_True );
}
::ClearFEShellTabCols();
SetModified();
@@ -923,28 +928,28 @@ void SwDoc::GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet ) const
SvxBoxItem aSetBox ((const SvxBoxItem &) rSet.Get(RES_BOX ));
SvxBoxInfoItem aSetBoxInfo((const SvxBoxInfoItem&) rSet.Get(SID_ATTR_BORDER_INNER));
- BOOL bTopSet = FALSE,
- bBottomSet = FALSE,
- bLeftSet = FALSE,
- bRightSet = FALSE,
- bHoriSet = FALSE,
- bVertSet = FALSE,
- bDistanceSet = FALSE;
+ sal_Bool bTopSet = sal_False,
+ bBottomSet = sal_False,
+ bLeftSet = sal_False,
+ bRightSet = sal_False,
+ bHoriSet = sal_False,
+ bVertSet = sal_False,
+ bDistanceSet = sal_False;
aSetBoxInfo.ResetFlags();
- for ( USHORT i = 0; i < aUnions.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < aUnions.Count(); ++i )
{
SwSelUnion *pUnion = aUnions[i];
const SwTabFrm *pTab = pUnion->GetTable();
const SwRect &rUnion = pUnion->GetUnion();
- const BOOL bFirst = i == 0 ? TRUE : FALSE;
- const BOOL bLast = i == aUnions.Count() - 1 ? TRUE : FALSE;
+ const sal_Bool bFirst = i == 0 ? sal_True : sal_False;
+ const sal_Bool bLast = i == aUnions.Count() - 1 ? sal_True : sal_False;
SvPtrarr aCellArr( 255, 255 );
::lcl_CollectCells( aCellArr, rUnion, (SwTabFrm*)pTab );
- for ( USHORT j = 0; j < aCellArr.Count(); ++j )
+ for ( sal_uInt16 j = 0; j < aCellArr.Count(); ++j )
{
const SwCellFrm *pCell = (const SwCellFrm*)aCellArr[j];
const sal_Bool bVert = pTab->IsVertical();
@@ -981,14 +986,14 @@ void SwDoc::GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet ) const
if (aSetBoxInfo.IsValid(VALID_TOP))
{
if ( !bTopSet )
- { bTopSet = TRUE;
+ { bTopSet = sal_True;
aSetBox.SetLine( rBox.GetTop(), BOX_LINE_TOP );
}
else if ((aSetBox.GetTop() && rBox.GetTop() &&
!(*aSetBox.GetTop() == *rBox.GetTop())) ||
- ((!aSetBox.GetTop()) ^ (!rBox.GetTop()))) // XOR-Ausdruck ist TRUE, wenn genau einer der beiden Pointer 0 ist
+ ((!aSetBox.GetTop()) ^ (!rBox.GetTop()))) // XOR-Ausdruck ist sal_True, wenn genau einer der beiden Pointer 0 ist
{
- aSetBoxInfo.SetValid(VALID_TOP, FALSE );
+ aSetBoxInfo.SetValid(VALID_TOP, sal_False );
aSetBox.SetLine( 0, BOX_LINE_TOP );
}
}
@@ -1000,14 +1005,14 @@ void SwDoc::GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet ) const
if (aSetBoxInfo.IsValid(VALID_LEFT))
{
if ( !bLeftSet )
- { bLeftSet = TRUE;
+ { bLeftSet = sal_True;
aSetBox.SetLine( rBox.GetLeft(), BOX_LINE_LEFT );
}
else if ((aSetBox.GetLeft() && rBox.GetLeft() &&
!(*aSetBox.GetLeft() == *rBox.GetLeft())) ||
((!aSetBox.GetLeft()) ^ (!rBox.GetLeft())))
{
- aSetBoxInfo.SetValid(VALID_LEFT, FALSE );
+ aSetBoxInfo.SetValid(VALID_LEFT, sal_False );
aSetBox.SetLine( 0, BOX_LINE_LEFT );
}
}
@@ -1017,13 +1022,13 @@ void SwDoc::GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet ) const
if (aSetBoxInfo.IsValid(VALID_VERT))
{
if ( !bVertSet )
- { bVertSet = TRUE;
+ { bVertSet = sal_True;
aSetBoxInfo.SetLine( rBox.GetLeft(), BOXINFO_LINE_VERT );
}
else if ((aSetBoxInfo.GetVert() && rBox.GetLeft() &&
!(*aSetBoxInfo.GetVert() == *rBox.GetLeft())) ||
((!aSetBoxInfo.GetVert()) ^ (!rBox.GetLeft())))
- { aSetBoxInfo.SetValid( VALID_VERT, FALSE );
+ { aSetBoxInfo.SetValid( VALID_VERT, sal_False );
aSetBoxInfo.SetLine( 0, BOXINFO_LINE_VERT );
}
}
@@ -1033,13 +1038,13 @@ void SwDoc::GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet ) const
if ( aSetBoxInfo.IsValid(VALID_RIGHT) && bRightOver )
{
if ( !bRightSet )
- { bRightSet = TRUE;
+ { bRightSet = sal_True;
aSetBox.SetLine( rBox.GetRight(), BOX_LINE_RIGHT );
}
else if ((aSetBox.GetRight() && rBox.GetRight() &&
!(*aSetBox.GetRight() == *rBox.GetRight())) ||
(!aSetBox.GetRight() ^ !rBox.GetRight()))
- { aSetBoxInfo.SetValid( VALID_RIGHT, FALSE );
+ { aSetBoxInfo.SetValid( VALID_RIGHT, sal_False );
aSetBox.SetLine( 0, BOX_LINE_RIGHT );
}
}
@@ -1050,13 +1055,13 @@ void SwDoc::GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet ) const
if ( aSetBoxInfo.IsValid(VALID_BOTTOM) )
{
if ( !bBottomSet )
- { bBottomSet = TRUE;
+ { bBottomSet = sal_True;
aSetBox.SetLine( rBox.GetBottom(), BOX_LINE_BOTTOM );
}
else if ((aSetBox.GetBottom() && rBox.GetBottom() &&
!(*aSetBox.GetBottom() == *rBox.GetBottom())) ||
(!aSetBox.GetBottom() ^ !rBox.GetBottom()))
- { aSetBoxInfo.SetValid( VALID_BOTTOM, FALSE );
+ { aSetBoxInfo.SetValid( VALID_BOTTOM, sal_False );
aSetBox.SetLine( 0, BOX_LINE_BOTTOM );
}
}
@@ -1068,14 +1073,14 @@ void SwDoc::GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet ) const
if (aSetBoxInfo.IsValid(VALID_HORI))
{
if ( !bHoriSet )
- { bHoriSet = TRUE;
+ { bHoriSet = sal_True;
aSetBoxInfo.SetLine( rBox.GetBottom(), BOXINFO_LINE_HORI );
}
else if ((aSetBoxInfo.GetHori() && rBox.GetBottom() &&
!(*aSetBoxInfo.GetHori() == *rBox.GetBottom())) ||
((!aSetBoxInfo.GetHori()) ^ (!rBox.GetBottom())))
{
- aSetBoxInfo.SetValid( VALID_HORI, FALSE );
+ aSetBoxInfo.SetValid( VALID_HORI, sal_False );
aSetBoxInfo.SetLine( 0, BOXINFO_LINE_HORI );
}
}
@@ -1084,14 +1089,14 @@ void SwDoc::GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet ) const
// Abstand zum Text
if (aSetBoxInfo.IsValid(VALID_DISTANCE))
{
- static USHORT __READONLY_DATA aBorders[] = {
+ static sal_uInt16 __READONLY_DATA aBorders[] = {
BOX_LINE_BOTTOM, BOX_LINE_TOP,
BOX_LINE_RIGHT, BOX_LINE_LEFT };
- const USHORT* pBrd = aBorders;
+ const sal_uInt16* pBrd = aBorders;
if( !bDistanceSet ) // bei 1. Durchlauf erstmal setzen
{
- bDistanceSet = TRUE;
+ bDistanceSet = sal_True;
for( int k = 0; k < 4; ++k, ++pBrd )
aSetBox.SetDistance( rBox.GetDistance( *pBrd ),
*pBrd );
@@ -1102,8 +1107,8 @@ void SwDoc::GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet ) const
if( aSetBox.GetDistance( *pBrd ) !=
rBox.GetDistance( *pBrd ) )
{
- aSetBoxInfo.SetValid( VALID_DISTANCE, FALSE );
- aSetBox.SetDistance( (USHORT) 0 );
+ aSetBoxInfo.SetValid( VALID_DISTANCE, sal_False );
+ aSetBox.SetDistance( (sal_uInt16) 0 );
break;
}
}
@@ -1125,17 +1130,16 @@ void SwDoc::SetBoxAttr( const SwCursor& rCursor, const SfxPoolItem &rNew )
{
SwTableNode* pTblNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode();
SwSelBoxes aBoxes;
- if( pTblNd && ::lcl_GetBoxSel( rCursor, aBoxes, TRUE ) )
+ if( pTblNd && ::lcl_GetBoxSel( rCursor, aBoxes, sal_True ) )
{
SwTable& rTable = pTblNd->GetTable();
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoAttrTbl( *pTblNd ));
+ GetIDocumentUndoRedo().AppendUndo( new SwUndoAttrTbl(*pTblNd) );
}
- SvPtrarr aFmtCmp( Max( BYTE(255), BYTE(aBoxes.Count()) ), 255 );
- for ( USHORT i = 0; i < aBoxes.Count(); ++i )
+ SvPtrarr aFmtCmp( Max( sal_uInt8(255), sal_uInt8(aBoxes.Count()) ), 255 );
+ for ( sal_uInt16 i = 0; i < aBoxes.Count(); ++i )
{
SwTableBox *pBox = aBoxes[i];
@@ -1158,7 +1162,7 @@ void SwDoc::SetBoxAttr( const SwCursor& rCursor, const SfxPoolItem &rNew )
SwTabFrm* pTabFrm = pFrm->ImplFindTabFrm();
pTableLayout->Resize(
- pTableLayout->GetBrowseWidthByTabFrm( *pTabFrm ), TRUE );
+ pTableLayout->GetBrowseWidthByTabFrm( *pTabFrm ), sal_True );
}
SwTblFmtCmp::Delete( aFmtCmp );
SetModified();
@@ -1172,17 +1176,17 @@ void SwDoc::SetBoxAttr( const SwCursor& rCursor, const SfxPoolItem &rNew )
#* Update : JP 29.04.98
#***********************************************************************/
-BOOL SwDoc::GetBoxAttr( const SwCursor& rCursor, SfxPoolItem& rToFill ) const
+sal_Bool SwDoc::GetBoxAttr( const SwCursor& rCursor, SfxPoolItem& rToFill ) const
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
SwTableNode* pTblNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode();
SwSelBoxes aBoxes;
if( pTblNd && lcl_GetBoxSel( rCursor, aBoxes ))
{
- bRet = TRUE;
- BOOL bOneFound = FALSE;
- const USHORT nWhich = rToFill.Which();
- for( USHORT i = 0; i < aBoxes.Count(); ++i )
+ bRet = sal_True;
+ sal_Bool bOneFound = sal_False;
+ const sal_uInt16 nWhich = rToFill.Which();
+ for( sal_uInt16 i = 0; i < aBoxes.Count(); ++i )
{
switch ( nWhich )
{
@@ -1193,10 +1197,10 @@ BOOL SwDoc::GetBoxAttr( const SwCursor& rCursor, SfxPoolItem& rToFill ) const
if( !bOneFound )
{
(SvxBrushItem&)rToFill = rBack;
- bOneFound = TRUE;
+ bOneFound = sal_True;
}
else if( rToFill != rBack )
- bRet = FALSE;
+ bRet = sal_False;
}
break;
@@ -1207,14 +1211,14 @@ BOOL SwDoc::GetBoxAttr( const SwCursor& rCursor, SfxPoolItem& rToFill ) const
if( !bOneFound )
{
(SvxFrameDirectionItem&)rToFill = rDir;
- bOneFound = TRUE;
+ bOneFound = sal_True;
}
else if( rToFill != rDir )
- bRet = FALSE;
+ bRet = sal_False;
}
}
- if ( FALSE == bRet )
+ if ( sal_False == bRet )
break;
}
}
@@ -1227,7 +1231,7 @@ BOOL SwDoc::GetBoxAttr( const SwCursor& rCursor, SfxPoolItem& rToFill ) const
#* Datum : MA 18. Dec. 96
#* Update : JP 29.04.98
#***********************************************************************/
-void SwDoc::SetBoxAlign( const SwCursor& rCursor, USHORT nAlign )
+void SwDoc::SetBoxAlign( const SwCursor& rCursor, sal_uInt16 nAlign )
{
ASSERT( nAlign == text::VertOrientation::NONE ||
nAlign == text::VertOrientation::CENTER ||
@@ -1236,18 +1240,18 @@ void SwDoc::SetBoxAlign( const SwCursor& rCursor, USHORT nAlign )
SetBoxAttr( rCursor, aVertOri );
}
-USHORT SwDoc::GetBoxAlign( const SwCursor& rCursor ) const
+sal_uInt16 SwDoc::GetBoxAlign( const SwCursor& rCursor ) const
{
- USHORT nAlign = USHRT_MAX;
+ sal_uInt16 nAlign = USHRT_MAX;
SwTableNode* pTblNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode();
SwSelBoxes aBoxes;
if( pTblNd && ::lcl_GetBoxSel( rCursor, aBoxes ))
- for( USHORT i = 0; i < aBoxes.Count(); ++i )
+ for( sal_uInt16 i = 0; i < aBoxes.Count(); ++i )
{
const SwFmtVertOrient &rOri =
aBoxes[i]->GetFrmFmt()->GetVertOrient();
if( USHRT_MAX == nAlign )
- nAlign = static_cast<USHORT>(rOri.GetVertOrient());
+ nAlign = static_cast<sal_uInt16>(rOri.GetVertOrient());
else if( rOri.GetVertOrient() != nAlign )
{
nAlign = USHRT_MAX;
@@ -1264,7 +1268,7 @@ USHORT SwDoc::GetBoxAlign( const SwCursor& rCursor ) const
#* Datum : MA 20. Feb. 95
#* Update : JP 29.04.98
#***********************************************************************/
-USHORT lcl_CalcCellFit( const SwLayoutFrm *pCell )
+sal_uInt16 lcl_CalcCellFit( const SwLayoutFrm *pCell )
{
SwTwips nRet = 0;
const SwFrm *pFrm = pCell->Lower(); //Die ganze Zelle.
@@ -1290,7 +1294,7 @@ USHORT lcl_CalcCellFit( const SwLayoutFrm *pCell )
//Um Rechenungenauikeiten, die spaeter bei SwTable::SetTabCols enstehen,
//auszugleichen, addieren wir noch ein bischen.
nRet += COLFUZZY;
- return (USHORT)Max( long(MINLAY), nRet );
+ return (sal_uInt16)Max( long(MINLAY), nRet );
}
/*Die Zelle ist in der Selektion, wird aber nicht von den TabCols beschrieben.
@@ -1307,15 +1311,15 @@ USHORT lcl_CalcCellFit( const SwLayoutFrm *pCell )
void lcl_CalcSubColValues( SvUShorts &rToFill, const SwTabCols &rCols,
const SwLayoutFrm *pCell, const SwLayoutFrm *pTab,
- BOOL bWishValues )
+ sal_Bool bWishValues )
{
- const USHORT nWish = bWishValues ?
+ const sal_uInt16 nWish = bWishValues ?
::lcl_CalcCellFit( pCell ) :
- MINLAY + USHORT(pCell->Frm().Width() - pCell->Prt().Width());
+ MINLAY + sal_uInt16(pCell->Frm().Width() - pCell->Prt().Width());
SWRECTFN( pTab )
- for ( USHORT i = 0 ; i <= rCols.Count(); ++i )
+ for ( sal_uInt16 i = 0 ; i <= rCols.Count(); ++i )
{
long nColLeft = i == 0 ? rCols.GetLeft() : rCols[i-1];
long nColRight = i == rCols.Count() ? rCols.GetRight() : rCols[i];
@@ -1323,7 +1327,7 @@ void lcl_CalcSubColValues( SvUShorts &rToFill, const SwTabCols &rCols,
nColRight += rCols.GetLeftMin();
//Werte auf die Verhaeltnisse der Tabelle (Follows) anpassen.
- if ( rCols.GetLeftMin() != USHORT((pTab->Frm().*fnRect->fnGetLeft)()) )
+ if ( rCols.GetLeftMin() != sal_uInt16((pTab->Frm().*fnRect->fnGetLeft)()) )
{
const long nDiff = (pTab->Frm().*fnRect->fnGetLeft)() - rCols.GetLeftMin();
nColLeft += nDiff;
@@ -1343,8 +1347,8 @@ void lcl_CalcSubColValues( SvUShorts &rToFill, const SwTabCols &rCols,
if ( nWidth && pCell->Frm().Width() )
{
long nTmp = nWidth * nWish / pCell->Frm().Width();
- if ( USHORT(nTmp) > rToFill[i] )
- rToFill[i] = USHORT(nTmp);
+ if ( sal_uInt16(nTmp) > rToFill[i] )
+ rToFill[i] = sal_uInt16(nTmp);
}
}
}
@@ -1353,27 +1357,27 @@ void lcl_CalcSubColValues( SvUShorts &rToFill, const SwTabCols &rCols,
*Es wird nicht ueber die Eintrage in den TabCols itereriert, sondern
*quasi ueber die Zwischenraeume, die ja die Zellen beschreiben.
*
- *bWishValues == TRUE: Es werden zur aktuellen Selektion bzw. zur aktuellen
+ *bWishValues == sal_True: Es werden zur aktuellen Selektion bzw. zur aktuellen
* Zelle die Wunschwerte aller betroffen Zellen ermittelt.
* Sind mehrere Zellen in einer Spalte, so wird der
* groesste Wunschwert als Ergebnis geliefert.
* Fuer die TabCol-Eintraege, zu denen keine Zellen
* ermittelt wurden, werden 0-en eingetragen.
*
- *bWishValues == FALSE: Die Selektion wird senkrecht ausgedehnt. Zu jeder
+ *bWishValues == sal_False: Die Selektion wird senkrecht ausgedehnt. Zu jeder
* Spalte in den TabCols, die sich mit der Selektion
* schneidet wird der Minimalwert ermittelt.
*/
void lcl_CalcColValues( SvUShorts &rToFill, const SwTabCols &rCols,
const SwLayoutFrm *pStart, const SwLayoutFrm *pEnd,
- BOOL bWishValues )
+ sal_Bool bWishValues )
{
SwSelUnions aUnions;
::MakeSelUnions( aUnions, pStart, pEnd,
bWishValues ? nsSwTblSearchType::TBLSEARCH_NONE : nsSwTblSearchType::TBLSEARCH_COL );
- for ( USHORT i2 = 0; i2 < aUnions.Count(); ++i2 )
+ for ( sal_uInt16 i2 = 0; i2 < aUnions.Count(); ++i2 )
{
SwSelUnion *pSelUnion = aUnions[i2];
const SwTabFrm *pTab = pSelUnion->GetTable();
@@ -1390,11 +1394,11 @@ void lcl_CalcColValues( SvUShorts &rToFill, const SwTabCols &rCols,
const long nCLeft = (pCell->Frm().*fnRect->fnGetLeft)();
const long nCRight = (pCell->Frm().*fnRect->fnGetRight)();
- BOOL bNotInCols = TRUE;
+ sal_Bool bNotInCols = sal_True;
- for ( USHORT i = 0; i <= rCols.Count(); ++i )
+ for ( sal_uInt16 i = 0; i <= rCols.Count(); ++i )
{
- USHORT nFit = rToFill[i];
+ sal_uInt16 nFit = rToFill[i];
long nColLeft = i == 0 ? rCols.GetLeft() : rCols[i-1];
long nColRight = i == rCols.Count() ? rCols.GetRight() : rCols[i];
@@ -1411,7 +1415,7 @@ void lcl_CalcColValues( SvUShorts &rToFill, const SwTabCols &rCols,
//Werte auf die Verhaeltnisse der Tabelle (Follows) anpassen.
long nLeftA = nColLeft;
long nRightA = nColRight;
- if ( rCols.GetLeftMin() != USHORT((pTab->Frm().*fnRect->fnGetLeft)()) )
+ if ( rCols.GetLeftMin() != sal_uInt16((pTab->Frm().*fnRect->fnGetLeft)()) )
{
const long nDiff = (pTab->Frm().*fnRect->fnGetLeft)() - rCols.GetLeftMin();
nLeftA += nDiff;
@@ -1421,15 +1425,15 @@ void lcl_CalcColValues( SvUShorts &rToFill, const SwTabCols &rCols,
//Wir wollen nicht allzu genau hinsehen.
if ( ::IsSame(nCLeft, nLeftA) && ::IsSame(nCRight, nRightA))
{
- bNotInCols = FALSE;
+ bNotInCols = sal_False;
if ( bWishValues )
{
- const USHORT nWish = ::lcl_CalcCellFit( pCell );
+ const sal_uInt16 nWish = ::lcl_CalcCellFit( pCell );
if ( nWish > nFit )
nFit = nWish;
}
else
- { const USHORT nMin = MINLAY + USHORT(pCell->Frm().Width() -
+ { const sal_uInt16 nMin = MINLAY + sal_uInt16(pCell->Frm().Width() -
pCell->Prt().Width());
if ( !nFit || nMin < nFit )
nFit = nMin;
@@ -1449,7 +1453,7 @@ void lcl_CalcColValues( SvUShorts &rToFill, const SwTabCols &rCols,
}
-void SwDoc::AdjustCellWidth( const SwCursor& rCursor, BOOL bBalance )
+void SwDoc::AdjustCellWidth( const SwCursor& rCursor, sal_Bool bBalance )
{
// pruefe ob vom aktuellen Crsr der Point/Mark in einer Tabelle stehen
SwCntntNode* pCntNd = rCursor.GetPoint()->nNode.GetNode().GetCntntNode();
@@ -1474,17 +1478,17 @@ void SwDoc::AdjustCellWidth( const SwCursor& rCursor, BOOL bBalance )
if ( ! aTabCols.Count() )
return;
- const BYTE nTmp = (BYTE)Max( USHORT(255), USHORT(aTabCols.Count() + 1) );
+ const sal_uInt8 nTmp = (sal_uInt8)Max( sal_uInt16(255), sal_uInt16(aTabCols.Count() + 1) );
SvUShorts aWish( nTmp, nTmp ),
aMins( nTmp, nTmp );
- USHORT i;
+ sal_uInt16 i;
for ( i = 0; i <= aTabCols.Count(); ++i )
{
- aWish.Insert( USHORT(0), aWish.Count() );
- aMins.Insert( USHORT(0), aMins.Count() );
+ aWish.Insert( sal_uInt16(0), aWish.Count() );
+ aMins.Insert( sal_uInt16(0), aMins.Count() );
}
- ::lcl_CalcColValues( aWish, aTabCols, pStart, pEnd, TRUE );
+ ::lcl_CalcColValues( aWish, aTabCols, pStart, pEnd, sal_True );
//Es ist Robuster wenn wir die Min-Werte fuer die ganze Tabelle berechnen.
const SwTabFrm *pTab = pStart->ImplFindTabFrm();
@@ -1492,25 +1496,25 @@ void SwDoc::AdjustCellWidth( const SwCursor& rCursor, BOOL bBalance )
pEnd = (SwLayoutFrm*)pTab->FindLastCntnt()->GetUpper();
while( !pEnd->IsCellFrm() )
pEnd = pEnd->GetUpper();
- ::lcl_CalcColValues( aMins, aTabCols, pStart, pEnd, FALSE );
+ ::lcl_CalcColValues( aMins, aTabCols, pStart, pEnd, sal_False );
if( bBalance )
{
//Alle Spalten, die makiert sind haben jetzt einen Wunschwert
//eingtragen. Wir addieren die aktuellen Werte, teilen das Ergebnis
//durch die Anzahl und haben eine Wunschwert fuer den ausgleich.
- USHORT nWish = 0, nCnt = 0;
+ sal_uInt16 nWish = 0, nCnt = 0;
for ( i = 0; i <= aTabCols.Count(); ++i )
{
int nDiff = aWish[i];
if ( nDiff )
{
if ( i == 0 )
- nWish = static_cast<USHORT>( nWish + aTabCols[i] - aTabCols.GetLeft() );
+ nWish = static_cast<sal_uInt16>( nWish + aTabCols[i] - aTabCols.GetLeft() );
else if ( i == aTabCols.Count() )
- nWish = static_cast<USHORT>(nWish + aTabCols.GetRight() - aTabCols[i-1] );
+ nWish = static_cast<sal_uInt16>(nWish + aTabCols.GetRight() - aTabCols[i-1] );
else
- nWish = static_cast<USHORT>(nWish + aTabCols[i] - aTabCols[i-1] );
+ nWish = static_cast<sal_uInt16>(nWish + aTabCols[i] - aTabCols[i-1] );
++nCnt;
}
}
@@ -1520,14 +1524,14 @@ void SwDoc::AdjustCellWidth( const SwCursor& rCursor, BOOL bBalance )
aWish[i] = nWish;
}
- const USHORT nOldRight = static_cast<USHORT>(aTabCols.GetRight());
+ const sal_uInt16 nOldRight = static_cast<sal_uInt16>(aTabCols.GetRight());
//Um die Impl. einfach zu gestalten, aber trotzdem in den meissten Faellen
//den Platz richtig auszunutzen laufen wir zweimal.
//Problem: Erste Spalte wird breiter, die anderen aber erst danach
//schmaler. Die Wunschbreite der ersten Spalte wuerde abgelehnt, weil
//mit ihr die max. Breite der Tabelle ueberschritten wuerde.
- for ( USHORT k= 0; k < 2; ++k )
+ for ( sal_uInt16 k= 0; k < 2; ++k )
{
for ( i = 0; i <= aTabCols.Count(); ++i )
{
@@ -1560,20 +1564,20 @@ void SwDoc::AdjustCellWidth( const SwCursor& rCursor, BOOL bBalance )
nDiff -= nTmpD;
nTabRight -= nTmpD;
}
- for ( USHORT i2 = i; i2 < aTabCols.Count(); ++i2 )
+ for ( sal_uInt16 i2 = i; i2 < aTabCols.Count(); ++i2 )
aTabCols[i2] += nDiff;
aTabCols.SetRight( nTabRight );
}
}
}
- const USHORT nNewRight = static_cast<USHORT>(aTabCols.GetRight());
+ const sal_uInt16 nNewRight = static_cast<sal_uInt16>(aTabCols.GetRight());
SwFrmFmt *pFmt = pTblNd->GetTable().GetFrmFmt();
const sal_Int16 nOriHori = pFmt->GetHoriOrient().GetHoriOrient();
//So, die richtige Arbeit koennen wir jetzt der SwTable ueberlassen.
- SetTabCols( aTabCols, FALSE, 0, (SwCellFrm*)pBoxFrm );
+ SetTabCols( aTabCols, sal_False, 0, (SwCellFrm*)pBoxFrm );
// i54248: lijian/fme
// alignment might have been changed in SetTabCols, restore old value:
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index 767697208bfd..7c62f31f7eef 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -157,7 +157,7 @@ int Put( boost::shared_ptr<const SfxItemSet>& mrpAttrSet, const SwCntntNode& rNo
// --> FME 2007-4-12 #i76273# Robust: Save the style name items:
SfxItemSet* pStyleNames = 0;
- if ( SFX_ITEM_SET == rSet.GetItemState( RES_FRMATR_STYLE_NAME, FALSE ) )
+ if ( SFX_ITEM_SET == rSet.GetItemState( RES_FRMATR_STYLE_NAME, sal_False ) )
{
pStyleNames = new SfxItemSet( *aNewSet.GetPool(), RES_FRMATR_STYLE_NAME, RES_FRMATR_CONDITIONAL_STYLE_NAME );
pStyleNames->Put( aNewSet );
@@ -207,7 +207,7 @@ int Put_BC( boost::shared_ptr<const SfxItemSet>& mrpAttrSet,
// --> FME 2007-4-12 #i76273# Robust: Save the style name items:
SfxItemSet* pStyleNames = 0;
- if ( SFX_ITEM_SET == rSet.GetItemState( RES_FRMATR_STYLE_NAME, FALSE ) )
+ if ( SFX_ITEM_SET == rSet.GetItemState( RES_FRMATR_STYLE_NAME, sal_False ) )
{
pStyleNames = new SfxItemSet( *aNewSet.GetPool(), RES_FRMATR_STYLE_NAME, RES_FRMATR_CONDITIONAL_STYLE_NAME );
pStyleNames->Put( aNewSet );
@@ -235,28 +235,28 @@ int Put_BC( boost::shared_ptr<const SfxItemSet>& mrpAttrSet,
return nRet;
}
-USHORT ClearItem_BC( boost::shared_ptr<const SfxItemSet>& mrpAttrSet,
- const SwCntntNode& rNode, USHORT nWhich,
+sal_uInt16 ClearItem_BC( boost::shared_ptr<const SfxItemSet>& mrpAttrSet,
+ const SwCntntNode& rNode, sal_uInt16 nWhich,
SwAttrSet* pOld, SwAttrSet* pNew )
{
SwAttrSet aNewSet( (SwAttrSet&)*mrpAttrSet );
if( rNode.GetModifyAtAttr() )
aNewSet.SetModifyAtAttr( &rNode );
- const USHORT nRet = aNewSet.ClearItem_BC( nWhich, pOld, pNew );
+ const sal_uInt16 nRet = aNewSet.ClearItem_BC( nWhich, pOld, pNew );
if ( nRet )
GetNewAutoStyle( mrpAttrSet, rNode, aNewSet );
return nRet;
}
-USHORT ClearItem_BC( boost::shared_ptr<const SfxItemSet>& mrpAttrSet,
+sal_uInt16 ClearItem_BC( boost::shared_ptr<const SfxItemSet>& mrpAttrSet,
const SwCntntNode& rNode,
- USHORT nWhich1, USHORT nWhich2,
+ sal_uInt16 nWhich1, sal_uInt16 nWhich2,
SwAttrSet* pOld, SwAttrSet* pNew )
{
SwAttrSet aNewSet( (SwAttrSet&)*mrpAttrSet );
if( rNode.GetModifyAtAttr() )
aNewSet.SetModifyAtAttr( &rNode );
- const USHORT nRet = aNewSet.ClearItem_BC( nWhich1, nWhich2, pOld, pNew );
+ const sal_uInt16 nRet = aNewSet.ClearItem_BC( nWhich1, nWhich2, pOld, pNew );
if ( nRet )
GetNewAutoStyle( mrpAttrSet, rNode, aNewSet );
return nRet;
@@ -289,13 +289,13 @@ USHORT ClearItem_BC( boost::shared_ptr<const SfxItemSet>& mrpAttrSet,
*******************************************************************/
-USHORT SwNode::GetSectionLevel() const
+sal_uInt16 SwNode::GetSectionLevel() const
{
// EndNode einer Grund-Section ?? diese sind immer 0 !!
if( IsEndNode() && 0 == pStartOfSection->StartOfSectionIndex() )
return 0;
- USHORT nLevel;
+ sal_uInt16 nLevel;
const SwNode* pNode = IsStartNode() ? this : pStartOfSection;
for( nLevel = 1; 0 != pNode->StartOfSectionIndex(); ++nLevel )
pNode = pNode->pStartOfSection;
@@ -334,10 +334,10 @@ USHORT SwNode::GetSectionLevel() const
long SwNode::nSerial = 0;
#endif
-SwNode::SwNode( const SwNodeIndex &rWhere, const BYTE nNdType )
+SwNode::SwNode( const SwNodeIndex &rWhere, const sal_uInt8 nNdType )
: nNodeType( nNdType ), pStartOfSection( 0 )
{
- bSetNumLSpace = bIgnoreDontExpand = FALSE;
+ bSetNumLSpace = bIgnoreDontExpand = sal_False;
nAFmtNumLvl = 0;
SwNodes& rNodes = (SwNodes&)rWhere.GetNodes();
@@ -368,10 +368,10 @@ SwNode::SwNode( const SwNodeIndex &rWhere, const BYTE nNdType )
#endif
}
-SwNode::SwNode( SwNodes& rNodes, ULONG nPos, const BYTE nNdType )
+SwNode::SwNode( SwNodes& rNodes, sal_uLong nPos, const sal_uInt8 nNdType )
: nNodeType( nNdType ), pStartOfSection( 0 )
{
- bSetNumLSpace = bIgnoreDontExpand = FALSE;
+ bSetNumLSpace = bIgnoreDontExpand = sal_False;
nAFmtNumLvl = 0;
SwNode* pInsNd = this; // der MAC kann this nicht einfuegen !!
@@ -425,9 +425,9 @@ SwTableNode* SwNode::FindTableNode()
// liegt der Node im Sichtbarenbereich der Shell ?
-BOOL SwNode::IsInVisibleArea( ViewShell* pSh ) const
+sal_Bool SwNode::IsInVisibleArea( ViewShell* pSh ) const
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
const SwCntntNode* pNd;
if( ND_STARTNODE & nNodeType )
@@ -443,6 +443,12 @@ BOOL SwNode::IsInVisibleArea( ViewShell* pSh ) const
else
pNd = GetCntntNode();
+<<<<<<< local
+=======
+ const SwFrm* pFrm;
+ if( pNd && 0 != ( pFrm = pNd->GetFrm( 0, 0, sal_False ) ) )
+ {
+>>>>>>> other
if( !pSh )
// dann die Shell vom Doc besorgen:
GetDoc()->GetEditShell( &pSh );
@@ -461,14 +467,14 @@ BOOL SwNode::IsInVisibleArea( ViewShell* pSh ) const
} while ( pFrm && !pFrm->IsValid() );
if( !pFrm || pSh->VisArea().IsOver( pFrm->Frm() ) )
- bRet = TRUE;
+ bRet = sal_True;
}
}
return bRet;
}
-BOOL SwNode::IsInProtectSect() const
+sal_Bool SwNode::IsInProtectSect() const
{
const SwNode* pNd = ND_SECTIONNODE == nNodeType ? pStartOfSection : this;
const SwSectionNode* pSectNd = pNd->FindSectionNode();
@@ -478,12 +484,12 @@ BOOL SwNode::IsInProtectSect() const
// befindet sich der Node in irgendetwas geschuetzten ?
// (Bereich/Rahmen/Tabellenzellen/... incl. des Ankers bei
// Rahmen/Fussnoten/..)
-BOOL SwNode::IsProtect() const
+sal_Bool SwNode::IsProtect() const
{
const SwNode* pNd = ND_SECTIONNODE == nNodeType ? pStartOfSection : this;
const SwStartNode* pSttNd = pNd->FindSectionNode();
if( pSttNd && ((SwSectionNode*)pSttNd)->GetSection().IsProtectFlag() )
- return TRUE;
+ return sal_True;
if( 0 != ( pSttNd = FindTableBoxStartNode() ) )
{
@@ -495,18 +501,18 @@ BOOL SwNode::IsProtect() const
GetTblBox( pSttNd->GetIndex() );
//Robust #149568
if( pBox && pBox->GetFrmFmt()->GetProtect().IsCntntProtected() )
- return TRUE;
+ return sal_True;
}
SwFrmFmt* pFlyFmt = GetFlyFmt();
if( pFlyFmt )
{
if( pFlyFmt->GetProtect().IsCntntProtected() )
- return TRUE;
+ return sal_True;
const SwFmtAnchor& rAnchor = pFlyFmt->GetAnchor();
return rAnchor.GetCntntAnchor()
? rAnchor.GetCntntAnchor()->nNode.GetNode().IsProtect()
- : FALSE;
+ : sal_False;
}
if( 0 != ( pSttNd = FindFootnoteStartNode() ) )
@@ -517,13 +523,13 @@ BOOL SwNode::IsProtect() const
return pTFtn->GetTxtNode().IsProtect();
}
- return FALSE;
+ return sal_False;
}
// suche den PageDesc, mit dem dieser Node formatiert ist. Wenn das
// Layout vorhanden ist wird ueber das gesucht, ansonsten gibt es nur
// die harte Tour ueber die Nodes nach vorne suchen!!
-const SwPageDesc* SwNode::FindPageDesc( BOOL bCalcLay,
+const SwPageDesc* SwNode::FindPageDesc( sal_Bool bCalcLay,
sal_uInt32* pPgDescNdIdx ) const
{
// OD 18.03.2003 #106329#
@@ -581,7 +587,7 @@ const SwPageDesc* SwNode::FindPageDesc( BOOL bCalcLay,
// dann erstmal den richtigen Anker finden
const SwFrmFmt* pFmt = 0;
const SwSpzFrmFmts& rFmts = *pDoc->GetSpzFrmFmts();
- USHORT n;
+ sal_uInt16 n;
for( n = 0; n < rFmts.Count(); ++n )
{
@@ -635,7 +641,7 @@ const SwPageDesc* SwNode::FindPageDesc( BOOL bCalcLay,
if( n >= rFmts.Count() )
{
ASSERT( !this, "Fly-Section aber kein Format gefunden" );
- return FALSE;
+ return sal_False;
}
}
}
@@ -658,7 +664,7 @@ const SwPageDesc* SwNode::FindPageDesc( BOOL bCalcLay,
0 != ( pSttNd = pNd->FindFooterStartNode() ))
{
// dann in den PageDescs diesen StartNode suchen
- USHORT nId;
+ sal_uInt16 nId;
UseOnPage eAskUse;
if( SwHeaderStartNode == pSttNd->GetStartNodeType())
{
@@ -671,7 +677,7 @@ const SwPageDesc* SwNode::FindPageDesc( BOOL bCalcLay,
eAskUse = nsUseOnPage::PD_FOOTERSHARE;
}
- for( USHORT n = pDoc->GetPageDescCnt(); n && !pPgDesc; )
+ for( sal_uInt16 n = pDoc->GetPageDescCnt(); n && !pPgDesc; )
{
const SwPageDesc& rPgDsc = pDoc->GetPageDesc( --n );
const SwFrmFmt* pFmt = &rPgDsc.GetMaster();
@@ -706,7 +712,7 @@ const SwPageDesc* SwNode::FindPageDesc( BOOL bCalcLay,
// der Anker kann nur im Bodytext sein
const SwTxtFtn* pTxtFtn;
const SwFtnIdxs& rFtnArr = pDoc->GetFtnIdxs();
- for( USHORT n = 0; n < rFtnArr.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rFtnArr.Count(); ++n )
if( 0 != ( pTxtFtn = rFtnArr[ n ])->GetStartNode() &&
(SwNode*)pSttNd ==
&pTxtFtn->GetStartNode()->GetNode() )
@@ -789,7 +795,7 @@ SwFrmFmt* SwNode::GetFlyFmt() const
{
// dann gibts noch harten steinigen Weg uebers Dokument:
const SwSpzFrmFmts& rFrmFmtTbl = *GetDoc()->GetSpzFrmFmts();
- for( USHORT n = 0; n < rFrmFmtTbl.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rFrmFmtTbl.Count(); ++n )
{
SwFrmFmt* pFmt = rFrmFmtTbl[n];
const SwFmtCntnt& rCntnt = pFmt->GetCntnt();
@@ -828,21 +834,21 @@ SwStartNode* SwNode::FindSttNodeByType( SwStartNodeType eTyp )
return eTyp == pTmp->GetStartNodeType() ? pTmp : 0;
}
-const SwTxtNode* SwNode::FindOutlineNodeOfLevel( BYTE nLvl ) const
+const SwTxtNode* SwNode::FindOutlineNodeOfLevel( sal_uInt8 nLvl ) const
{
const SwTxtNode* pRet = 0;
const SwOutlineNodes& rONds = GetNodes().GetOutLineNds();
if( MAXLEVEL > nLvl && rONds.Count() )
{
- USHORT nPos;
+ sal_uInt16 nPos;
SwNode* pNd = (SwNode*)this;
- BOOL bCheckFirst = FALSE;
+ sal_Bool bCheckFirst = sal_False;
if( !rONds.Seek_Entry( pNd, &nPos ))
{
if( nPos )
nPos = nPos-1;
else
- bCheckFirst = TRUE;
+ bCheckFirst = sal_True;
}
if( bCheckFirst )
@@ -855,8 +861,13 @@ const SwTxtNode* SwNode::FindOutlineNodeOfLevel( BYTE nLvl ) const
const SwCntntNode* pCNd = GetCntntNode();
Point aPt( 0, 0 );
+<<<<<<< local
const SwFrm* pFrm = pRet->getLayoutFrm( pRet->GetDoc()->GetCurrentLayout(), &aPt, 0, FALSE ),
* pMyFrm = pCNd ? pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &aPt, 0, FALSE ) : 0;
+=======
+ const SwFrm* pFrm = pRet->GetFrm( &aPt, 0, sal_False ),
+ * pMyFrm = pCNd ? pCNd->GetFrm( &aPt, 0, sal_False ) : 0;
+>>>>>>> other
const SwPageFrm* pPgFrm = pFrm ? pFrm->FindPageFrm() : 0;
if( pPgFrm && pMyFrm &&
pPgFrm->Frm().Top() > pMyFrm->Frm().Top() )
@@ -889,11 +900,11 @@ inline sal_Bool IsValidNextPrevNd( const SwNode& rNd )
ND_TABLENODE == rNd.StartOfSectionNode()->GetNodeType() );
}
-BYTE SwNode::HasPrevNextLayNode() const
+sal_uInt8 SwNode::HasPrevNextLayNode() const
{
// assumption: <this> node is a node inside the document nodes array section.
- BYTE nRet = 0;
+ sal_uInt8 nRet = 0;
if( IsValidNextPrevNd( *this ))
{
SwNodeIndex aIdx( *this, -1 );
@@ -945,7 +956,7 @@ BYTE SwNode::HasPrevNextLayNode() const
*******************************************************************/
-SwStartNode::SwStartNode( const SwNodeIndex &rWhere, const BYTE nNdType,
+SwStartNode::SwStartNode( const SwNodeIndex &rWhere, const sal_uInt8 nNdType,
SwStartNodeType eSttNd )
: SwNode( rWhere, nNdType ), eSttNdTyp( eSttNd )
{
@@ -953,7 +964,7 @@ SwStartNode::SwStartNode( const SwNodeIndex &rWhere, const BYTE nNdType,
pEndOfSection = (SwEndNode*)this;
}
-SwStartNode::SwStartNode( SwNodes& rNodes, ULONG nPos )
+SwStartNode::SwStartNode( SwNodes& rNodes, sal_uLong nPos )
: SwNode( rNodes, nPos, ND_STARTNODE ), eSttNdTyp( SwNormalStartNode )
{
// erstmal temporaer, bis der EndNode eingefuegt wird.
@@ -965,7 +976,7 @@ void SwStartNode::CheckSectionCondColl() const
{
//FEATURE::CONDCOLL
SwNodeIndex aIdx( *this );
- ULONG nEndIdx = EndOfSectionIndex();
+ sal_uLong nEndIdx = EndOfSectionIndex();
const SwNodes& rNds = GetNodes();
SwCntntNode* pCNd;
while( 0 != ( pCNd = rNds.GoNext( &aIdx )) && pCNd->GetIndex() < nEndIdx )
@@ -1011,7 +1022,7 @@ SwEndNode::SwEndNode( const SwNodeIndex &rWhere, SwStartNode& rSttNd )
pStartOfSection->pEndOfSection = this;
}
-SwEndNode::SwEndNode( SwNodes& rNds, ULONG nPos, SwStartNode& rSttNd )
+SwEndNode::SwEndNode( SwNodes& rNds, sal_uLong nPos, SwStartNode& rSttNd )
: SwNode( rNds, nPos, ND_ENDNODE )
{
pStartOfSection = &rSttNd;
@@ -1025,7 +1036,7 @@ SwEndNode::SwEndNode( SwNodes& rNds, ULONG nPos, SwStartNode& rSttNd )
// --------------------
-SwCntntNode::SwCntntNode( const SwNodeIndex &rWhere, const BYTE nNdType,
+SwCntntNode::SwCntntNode( const SwNodeIndex &rWhere, const sal_uInt8 nNdType,
SwFmtColl *pColl )
: SwModify( pColl ), // CrsrsShell, FrameFmt,
SwNode( rWhere, nNdType ),
@@ -1055,7 +1066,7 @@ SwCntntNode::~SwCntntNode()
void SwCntntNode::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue )
{
- USHORT nWhich = pOldValue ? pOldValue->Which() :
+ sal_uInt16 nWhich = pOldValue ? pOldValue->Which() :
pNewValue ? pNewValue->Which() : 0 ;
switch( nWhich )
@@ -1112,7 +1123,7 @@ void SwCntntNode::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewV
if( GetNodes().IsDocNodes() && IsTxtNode() )
{
if( SFX_ITEM_SET == ((SwAttrSetChg*)pOldValue)->GetChgSet()->GetItemState(
- RES_CHRATR_HIDDEN, FALSE ) )
+ RES_CHRATR_HIDDEN, sal_False ) )
{
((SwTxtNode*)this)->SetCalcHiddenCharFlags();
}
@@ -1122,7 +1133,7 @@ void SwCntntNode::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewV
case RES_UPDATE_ATTR:
if( GetNodes().IsDocNodes() && IsTxtNode() )
{
- const USHORT nTmp = ((SwUpdateAttr*)pNewValue)->nWhichAttr;
+ const sal_uInt16 nTmp = ((SwUpdateAttr*)pNewValue)->nWhichAttr;
if ( RES_ATTRSET_CHG == nTmp )
{
// anybody wants to do some optimization here?
@@ -1135,31 +1146,43 @@ void SwCntntNode::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewV
NotifyClients( pOldValue, pNewValue );
}
-BOOL SwCntntNode::InvalidateNumRule()
+sal_Bool SwCntntNode::InvalidateNumRule()
{
SwNumRule* pRule = 0;
const SfxPoolItem* pItem;
if( GetNodes().IsDocNodes() &&
- 0 != ( pItem = GetNoCondAttr( RES_PARATR_NUMRULE, TRUE )) &&
+ 0 != ( pItem = GetNoCondAttr( RES_PARATR_NUMRULE, sal_True )) &&
((SwNumRuleItem*)pItem)->GetValue().Len() &&
0 != (pRule = GetDoc()->FindNumRulePtr(
((SwNumRuleItem*)pItem)->GetValue() ) ) )
{
- pRule->SetInvalidRule( TRUE );
+ pRule->SetInvalidRule( sal_True );
}
return 0 != pRule;
}
+<<<<<<< local
SwCntntFrm *SwCntntNode::getLayoutFrm( const SwRootFrm* _pRoot,
const Point* pPoint, const SwPosition *pPos, const BOOL bCalcFrm ) const
+=======
+
+SwCntntFrm *SwCntntNode::GetFrm( const Point* pPoint,
+ const SwPosition *pPos,
+ const sal_Bool bCalcFrm ) const
+>>>>>>> other
{
return (SwCntntFrm*) ::GetFrmOfModify( _pRoot, *(SwModify*)this, FRM_CNTNT,
pPoint, pPos, bCalcFrm );
}
+<<<<<<< local
SwRect SwCntntNode::FindLayoutRect( const BOOL bPrtArea, const Point* pPoint,
const BOOL bCalcFrm ) const
+=======
+SwRect SwCntntNode::FindLayoutRect( const sal_Bool bPrtArea, const Point* pPoint,
+ const sal_Bool bCalcFrm ) const
+>>>>>>> other
{
SwRect aRet;
SwCntntFrm* pFrm = (SwCntntFrm*)::GetFrmOfModify( 0, *(SwModify*)this,
@@ -1169,8 +1192,8 @@ SwRect SwCntntNode::FindLayoutRect( const BOOL bPrtArea, const Point* pPoint,
return aRet;
}
-SwRect SwCntntNode::FindPageFrmRect( const BOOL bPrtArea, const Point* pPoint,
- const BOOL bCalcFrm ) const
+SwRect SwCntntNode::FindPageFrmRect( const sal_Bool bPrtArea, const Point* pPoint,
+ const sal_Bool bCalcFrm ) const
{
SwRect aRet;
SwFrm* pFrm = ::GetFrmOfModify( 0, *(SwModify*)this,
@@ -1201,7 +1224,7 @@ SwFmtColl *SwCntntNode::ChgFmtColl( SwFmtColl *pNewColl )
//FEATURE::CONDCOLL
// HACK: hier muss die entsprechend der neuen Vorlage die Bedingungen
// neu ueberprueft werden!
- if( TRUE /*pNewColl */ )
+ if( sal_True /*pNewColl */ )
{
SetCondFmtColl( 0 );
}
@@ -1217,15 +1240,15 @@ SwFmtColl *SwCntntNode::ChgFmtColl( SwFmtColl *pNewColl )
if ( IsInCache() )
{
SwFrm::GetCache().Delete( this );
- SetInCache( FALSE );
+ SetInCache( sal_False );
}
return pOldColl;
}
-BOOL SwCntntNode::GoNext(SwIndex * pIdx, USHORT nMode ) const
+sal_Bool SwCntntNode::GoNext(SwIndex * pIdx, sal_uInt16 nMode ) const
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
if( pIdx->GetIndex() < Len() )
{
if( !IsTxtNode() )
@@ -1257,23 +1280,23 @@ BOOL SwCntntNode::GoNext(SwIndex * pIdx, USHORT nMode ) const
if( 1 == nDone )
*pIdx = nPos;
else
- bRet = FALSE;
+ bRet = sal_False;
}
else if( nPos < rTNd.GetTxt().Len() )
(*pIdx)++;
else
- bRet = FALSE;
+ bRet = sal_False;
}
}
else
- bRet = FALSE;
+ bRet = sal_False;
return bRet;
}
-BOOL SwCntntNode::GoPrevious(SwIndex * pIdx, USHORT nMode ) const
+sal_Bool SwCntntNode::GoPrevious(SwIndex * pIdx, sal_uInt16 nMode ) const
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
if( pIdx->GetIndex() > 0 )
{
if( !IsTxtNode() )
@@ -1305,16 +1328,16 @@ BOOL SwCntntNode::GoPrevious(SwIndex * pIdx, USHORT nMode ) const
if( 1 == nDone )
*pIdx = nPos;
else
- bRet = FALSE;
+ bRet = sal_False;
}
else if( nPos )
(*pIdx)--;
else
- bRet = FALSE;
+ bRet = sal_False;
}
}
else
- bRet = FALSE;
+ bRet = sal_False;
return bRet;
}
@@ -1377,7 +1400,64 @@ void SwCntntNode::DelFrms()
if( !GetDepends() )
return;
+<<<<<<< local
SwCntntFrm::DelFrms(*this);
+=======
+ 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;
+ }
+>>>>>>> other
if( IsTxtNode() )
{
((SwTxtNode*)this)->SetWrong( NULL );
@@ -1409,7 +1489,7 @@ SwCntntNode *SwCntntNode::JoinPrev()
// erfrage vom Modify Informationen
-BOOL SwCntntNode::GetInfo( SfxPoolItem& rInfo ) const
+sal_Bool SwCntntNode::GetInfo( SfxPoolItem& rInfo ) const
{
switch( rInfo.Which() )
{
@@ -1417,7 +1497,7 @@ BOOL SwCntntNode::GetInfo( SfxPoolItem& rInfo ) const
if( &GetNodes() == ((SwAutoFmtGetDocNode&)rInfo).pNodes )
{
((SwAutoFmtGetDocNode&)rInfo).pCntntNode = this;
- return FALSE;
+ return sal_False;
}
break;
// --> OD 2008-02-19 #refactorlists#
@@ -1426,7 +1506,7 @@ BOOL SwCntntNode::GetInfo( SfxPoolItem& rInfo ) const
// if( IsTxtNode())
// {
// SwTxtNode * pTxtNode = (SwTxtNode*)this;
-// pItem = (SwNumRuleItem*)GetNoCondAttr(RES_PARATR_NUMRULE, TRUE );
+// pItem = (SwNumRuleItem*)GetNoCondAttr(RES_PARATR_NUMRULE, sal_True );
// if (0 != pItem &&
// pItem->GetValue().Len() &&
@@ -1437,20 +1517,20 @@ BOOL SwCntntNode::GetInfo( SfxPoolItem& rInfo ) const
// }
// }
-// return TRUE;
+// return sal_True;
// <--
case RES_FINDNEARESTNODE:
if( ((SwFmtPageDesc&)GetAttr( RES_PAGEDESC )).GetPageDesc() )
((SwFindNearestNode&)rInfo).CheckNode( *this );
- return TRUE;
+ return sal_True;
case RES_CONTENT_VISIBLE:
{
((SwPtrMsgPoolItem&)rInfo).pObject =
SwIterator<SwFrm,SwCntntNode>::FirstElement(*this);
}
- return FALSE;
+ return sal_False;
}
return SwModify::GetInfo( rInfo );
@@ -1458,7 +1538,7 @@ BOOL SwCntntNode::GetInfo( SfxPoolItem& rInfo ) const
// setze ein Attribut
-BOOL SwCntntNode::SetAttr(const SfxPoolItem& rAttr )
+sal_Bool SwCntntNode::SetAttr(const SfxPoolItem& rAttr )
{
if( !GetpSwAttrSet() ) // lasse von den entsprechenden Nodes die
NewAttrSet( GetDoc()->GetAttrPool() ); // AttrSets anlegen
@@ -1468,10 +1548,10 @@ BOOL SwCntntNode::SetAttr(const SfxPoolItem& rAttr )
if ( IsInCache() )
{
SwFrm::GetCache().Delete( this );
- SetInCache( FALSE );
+ SetInCache( sal_False );
}
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
// wenn Modify gelockt ist, werden keine Modifies verschickt
if( IsModifyLocked() ||
( !GetDepends() && RES_PARATR_NUMRULE != rAttr.Which() ))
@@ -1493,16 +1573,16 @@ BOOL SwCntntNode::SetAttr(const SfxPoolItem& rAttr )
}
#include <svl/itemiter.hxx>
-BOOL SwCntntNode::SetAttr( const SfxItemSet& rSet )
+sal_Bool SwCntntNode::SetAttr( const SfxItemSet& rSet )
{
if ( IsInCache() )
{
SwFrm::GetCache().Delete( this );
- SetInCache( FALSE );
+ SetInCache( sal_False );
}
const SfxPoolItem* pFnd = 0;
- if( SFX_ITEM_SET == rSet.GetItemState( RES_AUTO_STYLE, FALSE, &pFnd ) )
+ if( SFX_ITEM_SET == rSet.GetItemState( RES_AUTO_STYLE, sal_False, &pFnd ) )
{
ASSERT( rSet.Count() == 1, "SetAutoStyle mixed with other attributes?!" );
const SwFmtAutoFmt* pTmp = static_cast<const SwFmtAutoFmt*>(pFnd);
@@ -1531,24 +1611,24 @@ BOOL SwCntntNode::SetAttr( const SfxItemSet& rSet )
// the string is empty.
const SfxPoolItem* pNameItem = 0;
if ( 0 != GetCondFmtColl() ||
- SFX_ITEM_SET != mpAttrSet->GetItemState( RES_FRMATR_STYLE_NAME, FALSE, &pNameItem ) ||
+ SFX_ITEM_SET != mpAttrSet->GetItemState( RES_FRMATR_STYLE_NAME, sal_False, &pNameItem ) ||
0 == static_cast<const SfxStringItem*>(pNameItem)->GetValue().Len() )
AttrSetHandleHelper::SetParent( mpAttrSet, *this, &GetAnyFmtColl(), GetFmtColl() );
else
const_cast<SfxItemSet*>(mpAttrSet.get())->SetParent( &GetFmtColl()->GetAttrSet() );
}
- return TRUE;
+ return sal_True;
}
if( !GetpSwAttrSet() ) // lasse von den entsprechenden Nodes die
NewAttrSet( GetDoc()->GetAttrPool() ); // AttrSets anlegen
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
// wenn Modify gelockt ist, werden keine Modifies verschickt
if ( IsModifyLocked() ||
( !GetDepends() &&
- SFX_ITEM_SET != rSet.GetItemState( RES_PARATR_NUMRULE, FALSE ) ) )
+ SFX_ITEM_SET != rSet.GetItemState( RES_PARATR_NUMRULE, sal_False ) ) )
{
// einige Sonderbehandlungen fuer Attribute
bRet = 0 != AttrSetHandleHelper::Put( mpAttrSet, *this, rSet );
@@ -1571,24 +1651,24 @@ BOOL SwCntntNode::SetAttr( const SfxItemSet& rSet )
// Nimmt den Hint mit nWhich aus dem Delta-Array
-BOOL SwCntntNode::ResetAttr( USHORT nWhich1, USHORT nWhich2 )
+sal_Bool SwCntntNode::ResetAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 )
{
if( !GetpSwAttrSet() )
- return FALSE;
+ return sal_False;
if ( IsInCache() )
{
SwFrm::GetCache().Delete( this );
- SetInCache( FALSE );
+ SetInCache( sal_False );
}
// wenn Modify gelockt ist, werden keine Modifies verschickt
if( IsModifyLocked() )
{
- USHORT nDel = 0;
+ sal_uInt16 nDel = 0;
if ( !nWhich2 || nWhich2 < nWhich1 )
{
- std::vector<USHORT> aClearWhichIds;
+ std::vector<sal_uInt16> aClearWhichIds;
aClearWhichIds.push_back( nWhich1 );
nDel = ClearItemsFromAttrSet( aClearWhichIds );
}
@@ -1606,7 +1686,7 @@ BOOL SwCntntNode::ResetAttr( USHORT nWhich1, USHORT nWhich2 )
SwAttrSet aOld( *GetpSwAttrSet()->GetPool(), GetpSwAttrSet()->GetRanges() ),
aNew( *GetpSwAttrSet()->GetPool(), GetpSwAttrSet()->GetRanges() );
- BOOL bRet = 0 != AttrSetHandleHelper::ClearItem_BC( mpAttrSet, *this, nWhich1, nWhich2, &aOld, &aNew );
+ sal_Bool bRet = 0 != AttrSetHandleHelper::ClearItem_BC( mpAttrSet, *this, nWhich1, nWhich2, &aOld, &aNew );
if( bRet )
{
@@ -1619,23 +1699,23 @@ BOOL SwCntntNode::ResetAttr( USHORT nWhich1, USHORT nWhich2 )
}
return bRet;
}
-BOOL SwCntntNode::ResetAttr( const SvUShorts& rWhichArr )
+sal_Bool SwCntntNode::ResetAttr( const SvUShorts& rWhichArr )
{
if( !GetpSwAttrSet() )
- return FALSE;
+ return sal_False;
if ( IsInCache() )
{
SwFrm::GetCache().Delete( this );
- SetInCache( FALSE );
+ SetInCache( sal_False );
}
// wenn Modify gelockt ist, werden keine Modifies verschickt
- USHORT nDel = 0;
+ sal_uInt16 nDel = 0;
if( IsModifyLocked() )
{
- std::vector<USHORT> aClearWhichIds;
- for( USHORT n = 0, nEnd = rWhichArr.Count(); n < nEnd; ++n )
+ std::vector<sal_uInt16> aClearWhichIds;
+ for( sal_uInt16 n = 0, nEnd = rWhichArr.Count(); n < nEnd; ++n )
aClearWhichIds.push_back( rWhichArr[ n ] );
nDel = ClearItemsFromAttrSet( aClearWhichIds );
@@ -1645,7 +1725,7 @@ BOOL SwCntntNode::ResetAttr( const SvUShorts& rWhichArr )
SwAttrSet aOld( *GetpSwAttrSet()->GetPool(), GetpSwAttrSet()->GetRanges() ),
aNew( *GetpSwAttrSet()->GetPool(), GetpSwAttrSet()->GetRanges() );
- for( USHORT n = 0, nEnd = rWhichArr.Count(); n < nEnd; ++n )
+ for( sal_uInt16 n = 0, nEnd = rWhichArr.Count(); n < nEnd; ++n )
if( AttrSetHandleHelper::ClearItem_BC( mpAttrSet, *this, rWhichArr[ n ], &aOld, &aNew ))
++nDel;
@@ -1662,7 +1742,7 @@ BOOL SwCntntNode::ResetAttr( const SvUShorts& rWhichArr )
}
-USHORT SwCntntNode::ResetAllAttr()
+sal_uInt16 SwCntntNode::ResetAllAttr()
{
if( !GetpSwAttrSet() )
return 0;
@@ -1670,15 +1750,15 @@ USHORT SwCntntNode::ResetAllAttr()
if ( IsInCache() )
{
SwFrm::GetCache().Delete( this );
- SetInCache( FALSE );
+ SetInCache( sal_False );
}
// wenn Modify gelockt ist, werden keine Modifies verschickt
if( IsModifyLocked() )
{
- std::vector<USHORT> aClearWhichIds;
+ std::vector<sal_uInt16> aClearWhichIds;
aClearWhichIds.push_back(0);
- USHORT nDel = ClearItemsFromAttrSet( aClearWhichIds );
+ sal_uInt16 nDel = ClearItemsFromAttrSet( aClearWhichIds );
if( !GetpSwAttrSet()->Count() ) // leer, dann loeschen
mpAttrSet.reset(); // DELETEZ( mpAttrSet );
return nDel;
@@ -1686,7 +1766,7 @@ USHORT SwCntntNode::ResetAllAttr()
SwAttrSet aOld( *GetpSwAttrSet()->GetPool(), GetpSwAttrSet()->GetRanges() ),
aNew( *GetpSwAttrSet()->GetPool(), GetpSwAttrSet()->GetRanges() );
- BOOL bRet = 0 != AttrSetHandleHelper::ClearItem_BC( mpAttrSet, *this, 0, &aOld, &aNew );
+ sal_Bool bRet = 0 != AttrSetHandleHelper::ClearItem_BC( mpAttrSet, *this, 0, &aOld, &aNew );
if( bRet )
{
@@ -1701,28 +1781,28 @@ USHORT SwCntntNode::ResetAllAttr()
}
-BOOL SwCntntNode::GetAttr( SfxItemSet& rSet, BOOL bInParent ) const
+sal_Bool SwCntntNode::GetAttr( SfxItemSet& rSet, sal_Bool bInParent ) const
{
if( rSet.Count() )
rSet.ClearItem();
const SwAttrSet& rAttrSet = GetSwAttrSet();
if( bInParent )
- return rSet.Set( rAttrSet, TRUE ) ? TRUE : FALSE;
+ return rSet.Set( rAttrSet, sal_True ) ? sal_True : sal_False;
rSet.Put( rAttrSet );
- return rSet.Count() ? TRUE : FALSE;
+ return rSet.Count() ? sal_True : sal_False;
}
-USHORT SwCntntNode::ClearItemsFromAttrSet( const std::vector<USHORT>& rWhichIds )
+sal_uInt16 SwCntntNode::ClearItemsFromAttrSet( const std::vector<sal_uInt16>& rWhichIds )
{
- USHORT nRet = 0;
+ sal_uInt16 nRet = 0;
if ( 0 == rWhichIds.size() )
return nRet;
ASSERT( GetpSwAttrSet(), "no item set" )
SwAttrSet aNewAttrSet( *GetpSwAttrSet() );
- for ( std::vector<USHORT>::const_iterator aIter = rWhichIds.begin();
+ for ( std::vector<sal_uInt16>::const_iterator aIter = rWhichIds.begin();
aIter != rWhichIds.end();
++aIter )
{
@@ -1734,14 +1814,14 @@ USHORT SwCntntNode::ClearItemsFromAttrSet( const std::vector<USHORT>& rWhichIds
return nRet;
}
-const SfxPoolItem* SwCntntNode::GetNoCondAttr( USHORT nWhich,
- BOOL bInParents ) const
+const SfxPoolItem* SwCntntNode::GetNoCondAttr( sal_uInt16 nWhich,
+ sal_Bool bInParents ) const
{
const SfxPoolItem* pFnd = 0;
if( pCondColl && pCondColl->GetRegisteredIn() )
{
if( !GetpSwAttrSet() || ( SFX_ITEM_SET != GetpSwAttrSet()->GetItemState(
- nWhich, FALSE, &pFnd ) && bInParents ))
+ nWhich, sal_False, &pFnd ) && bInParents ))
((SwFmt*)GetRegisteredIn())->GetItemState( nWhich, bInParents, &pFnd );
}
// --> OD 2005-10-25 #126347# - undo change of issue #i51029#
@@ -1761,7 +1841,7 @@ const SfxPoolItem* SwCntntNode::GetNoCondAttr( USHORT nWhich,
int SwCntntNode::CanJoinNext( SwNodeIndex* pIdx ) const
{
const SwNodes& rNds = GetNodes();
- BYTE nNdType = GetNodeType();
+ sal_uInt8 nNdType = GetNodeType();
SwNodeIndex aIdx( *this, 1 );
const SwNode* pNd = this;
@@ -1771,7 +1851,7 @@ int SwCntntNode::CanJoinNext( SwNodeIndex* pIdx ) const
aIdx++;
if( pNd->GetNodeType() != nNdType || rNds.Count()-1 == aIdx.GetIndex() )
- return FALSE;
+ return sal_False;
if( IsTxtNode() )
{ // Do not merge strings if the result exceeds the allowed string length
const SwTxtNode* pTxtNd = static_cast<const SwTxtNode*>(this);
@@ -1779,11 +1859,11 @@ int SwCntntNode::CanJoinNext( SwNodeIndex* pIdx ) const
pTxtNd = static_cast<const SwTxtNode*>(pNd);
nSum += pTxtNd->GetTxt().Len();
if( nSum > STRING_LEN )
- return FALSE;
+ return sal_False;
}
if( pIdx )
*pIdx = aIdx;
- return TRUE;
+ return sal_True;
}
@@ -1791,7 +1871,7 @@ int SwCntntNode::CanJoinNext( SwNodeIndex* pIdx ) const
// in pIdx kann die 2. Position returnt werden.
int SwCntntNode::CanJoinPrev( SwNodeIndex* pIdx ) const
{
- BYTE nNdType = GetNodeType();
+ sal_uInt8 nNdType = GetNodeType();
SwNodeIndex aIdx( *this, -1 );
const SwNode* pNd = this;
@@ -1801,10 +1881,10 @@ int SwCntntNode::CanJoinPrev( SwNodeIndex* pIdx ) const
aIdx--;
if( pNd->GetNodeType() != nNdType || 0 == aIdx.GetIndex() )
- return FALSE;
+ return sal_False;
if( pIdx )
*pIdx = aIdx;
- return TRUE;
+ return sal_True;
}
@@ -1837,13 +1917,13 @@ void SwCntntNode::SetCondFmtColl( SwFmtColl* pColl )
if( IsInCache() )
{
SwFrm::GetCache().Delete( this );
- SetInCache( FALSE );
+ SetInCache( sal_False );
}
}
}
-BOOL SwCntntNode::IsAnyCondition( SwCollCondition& rTmp ) const
+sal_Bool SwCntntNode::IsAnyCondition( SwCollCondition& rTmp ) const
{
const SwNodes& rNds = GetNodes();
{
@@ -1878,7 +1958,7 @@ BOOL SwCntntNode::IsAnyCondition( SwCollCondition& rTmp ) const
const SwTxtFtn* pTxtFtn;
const SwNode* pSrchNd = pSttNd;
- for( USHORT n = 0; n < rFtnArr.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rFtnArr.Count(); ++n )
if( 0 != ( pTxtFtn = rFtnArr[ n ])->GetStartNode() &&
pSrchNd == &pTxtFtn->GetStartNode()->GetNode() )
{
@@ -1897,7 +1977,7 @@ BOOL SwCntntNode::IsAnyCondition( SwCollCondition& rTmp ) const
if( nCond )
{
rTmp.SetCondition( (Master_CollConditions)nCond, 0 );
- return TRUE;
+ return sal_True;
}
pSttNd = pSttNd->GetIndex()
? pSttNd->StartOfSectionNode()
@@ -1906,7 +1986,7 @@ BOOL SwCntntNode::IsAnyCondition( SwCollCondition& rTmp ) const
}
{
- USHORT nPos;
+ sal_uInt16 nPos;
const SwOutlineNodes& rOutlNds = rNds.GetOutLineNds();
if( rOutlNds.Count() )
{
@@ -1920,13 +2000,13 @@ BOOL SwCntntNode::IsAnyCondition( SwCollCondition& rTmp ) const
if( pOutlNd->IsOutline())
{
rTmp.SetCondition( PARA_IN_OUTLINE, pOutlNd->GetAttrOutlineLevel() - 1 );
- return TRUE;
+ return sal_True;
}
}
}
}
- return FALSE;
+ return sal_False;
}
@@ -1986,7 +2066,11 @@ short SwCntntNode::GetTextDirection( const SwPosition& rPos,
// --> OD 2007-01-10 #i72024#
// No format of the frame, because this can cause recursive layout actions
+<<<<<<< local
SwFrm* pFrm = getLayoutFrm( GetDoc()->GetCurrentLayout(), &aPt, &rPos, FALSE );
+=======
+ SwFrm* pFrm = GetFrm( &aPt, &rPos, sal_False );
+>>>>>>> other
// <--
if ( pFrm )
@@ -2069,10 +2153,10 @@ IDocumentListItems& SwNode::getIDocumentListItems()
}
// <--
-BOOL SwNode::IsInRedlines() const
+sal_Bool SwNode::IsInRedlines() const
{
const SwDoc * pDoc = GetDoc();
- BOOL bResult = FALSE;
+ sal_Bool bResult = sal_False;
if (pDoc != NULL)
bResult = pDoc->IsInRedlines(*this);
diff --git a/sw/source/core/docnode/node2lay.cxx b/sw/source/core/docnode/node2lay.cxx
index d7ac37dc4bd8..70ceb1e0d4ab 100644
--- a/sw/source/core/docnode/node2lay.cxx
+++ b/sw/source/core/docnode/node2lay.cxx
@@ -51,32 +51,33 @@ class SwNode2LayImpl
SwIterator<SwFrm,SwModify>* pIter;
SwModify* pMod;
SvPtrarr *pUpperFrms;// Zum Einsammeln der Upper
- ULONG nIndex; // Der Index des einzufuegenden Nodes
- BOOL bMaster : 1; // TRUE => nur Master , FALSE => nur Frames ohne Follow
- BOOL bInit : 1; // Ist am SwClient bereits ein First()-Aufruf erfolgt?
+ sal_uLong nIndex; // Der Index des einzufuegenden Nodes
+ sal_Bool bMaster : 1; // sal_True => nur Master , sal_False => nur Frames ohne Follow
+ sal_Bool bInit : 1; // Ist am SwClient bereits ein First()-Aufruf erfolgt?
public:
- SwNode2LayImpl( const SwNode& rNode, ULONG nIdx, BOOL bSearch );
+ SwNode2LayImpl( const SwNode& rNode, sal_uLong nIdx, sal_Bool bSearch );
~SwNode2LayImpl() { delete pIter; delete pUpperFrms; }
SwFrm* NextFrm(); // liefert den naechsten "sinnvollen" Frame
SwLayoutFrm* UpperFrm( SwFrm* &rpFrm, const SwNode &rNode );
void SaveUpperFrms(); // Speichert (und lockt ggf.) die pUpper
// Fuegt unter jeden pUpper des Arrays einen Frame ein.
- void RestoreUpperFrms( SwNodes& rNds, ULONG nStt, ULONG nEnd );
+ void RestoreUpperFrms( SwNodes& rNds, sal_uLong nStt, sal_uLong nEnd );
SwFrm* GetFrm( const Point* pDocPos = 0,
const SwPosition *pPos = 0,
- const BOOL bCalcFrm = TRUE ) const;
+ const sal_Bool bCalcFrm = sal_True ) const;
};
/* -----------------25.02.99 10:38-------------------
* Hauptaufgabe des Ctor: Das richtige SwModify zu ermitteln,
* ueber das iteriert wird.
- * Uebergibt man bSearch == TRUE, so wird der naechste Cntnt- oder TableNode
+ * Uebergibt man bSearch == sal_True, so wird der naechste Cntnt- oder TableNode
* gesucht, der Frames besitzt ( zum Einsammeln der pUpper ), ansonsten wird
* erwartet, das rNode bereits auf einem solchen Cntnt- oder TableNode sitzt,
* vor oder hinter den eingefuegt werden soll.
* --------------------------------------------------*/
+<<<<<<< local
SwNode* GoNextWithFrm(const SwNodes& rNodes, SwNodeIndex *pIdx)
{
if( pIdx->GetIndex() >= rNodes.Count() - 1 )
@@ -144,6 +145,10 @@ SwNode* GoPreviousWithFrm(SwNodeIndex *pIdx)
SwNode2LayImpl::SwNode2LayImpl( const SwNode& rNode, ULONG nIdx, BOOL bSearch )
: pUpperFrms( NULL ), nIndex( nIdx ), bInit( FALSE )
+=======
+SwNode2LayImpl::SwNode2LayImpl( const SwNode& rNode, sal_uLong nIdx, sal_Bool bSearch )
+ : pUpperFrms( NULL ), nIndex( nIdx ), bInit( sal_False )
+>>>>>>> other
{
const SwNode* pNd;
if( bSearch || rNode.IsSectionNode() )
@@ -156,13 +161,18 @@ SwNode2LayImpl::SwNode2LayImpl( const SwNode& rNode, ULONG nIdx, BOOL bSearch )
pNd = GoPreviousWithFrm( &aTmp );
if( !bSearch && pNd && rNode.GetIndex() > pNd->GetIndex() )
pNd = NULL; // Nicht ueber den Bereich hinausschiessen
- bMaster = FALSE;
+ bMaster = sal_False;
}
else
{
SwNodeIndex aTmp( rNode, -1 );
+<<<<<<< local
pNd = GoNextWithFrm( rNode.GetNodes(), &aTmp );
bMaster = TRUE;
+=======
+ pNd = rNode.GetNodes().GoNextWithFrm( &aTmp );
+ bMaster = sal_True;
+>>>>>>> other
if( !bSearch && pNd && rNode.EndOfSectionIndex() < pNd->GetIndex() )
pNd = NULL; // Nicht ueber den Bereich hinausschiessen
}
@@ -205,11 +215,16 @@ SwFrm* SwNode2LayImpl::NextFrm()
{
SwFrm* pRet;
if( !pIter )
- return FALSE;
+ return sal_False;
if( !bInit )
{
+<<<<<<< local
pRet = pIter->First();
bInit = TRUE;
+=======
+ pRet = (SwFrm*)pIter->First(TYPE(SwFrm));
+ bInit = sal_True;
+>>>>>>> other
}
else
pRet = pIter->Next();
@@ -345,19 +360,19 @@ SwLayoutFrm* SwNode2LayImpl::UpperFrm( SwFrm* &rpFrm, const SwNode &rNode )
return pUpper;
}
-void SwNode2LayImpl::RestoreUpperFrms( SwNodes& rNds, ULONG nStt, ULONG nEnd )
+void SwNode2LayImpl::RestoreUpperFrms( SwNodes& rNds, sal_uLong nStt, sal_uLong nEnd )
{
ASSERT( pUpperFrms, "RestoreUpper without SaveUpper?" )
SwNode* pNd;
SwDoc *pDoc = rNds.GetDoc();
- BOOL bFirst = TRUE;
+ sal_Bool bFirst = sal_True;
for( ; nStt < nEnd; ++nStt )
{
SwFrm* pNew = 0;
SwFrm* pNxt;
SwLayoutFrm* pUp;
if( (pNd = rNds[nStt])->IsCntntNode() )
- for( USHORT n = 0; n < pUpperFrms->Count(); )
+ for( sal_uInt16 n = 0; n < pUpperFrms->Count(); )
{
pNxt = (SwFrm*)(*pUpperFrms)[n++];
if( bFirst && pNxt && pNxt->IsSctFrm() )
@@ -372,7 +387,7 @@ void SwNode2LayImpl::RestoreUpperFrms( SwNodes& rNds, ULONG nStt, ULONG nEnd )
(*pUpperFrms)[n-2] = pNew;
}
else if( pNd->IsTableNode() )
- for( USHORT x = 0; x < pUpperFrms->Count(); )
+ for( sal_uInt16 x = 0; x < pUpperFrms->Count(); )
{
pNxt = (SwFrm*)(*pUpperFrms)[x++];
if( bFirst && pNxt && pNxt->IsSctFrm() )
@@ -391,21 +406,21 @@ void SwNode2LayImpl::RestoreUpperFrms( SwNodes& rNds, ULONG nStt, ULONG nEnd )
else if( pNd->IsSectionNode() )
{
nStt = pNd->EndOfSectionIndex();
- for( USHORT x = 0; x < pUpperFrms->Count(); )
+ for( sal_uInt16 x = 0; x < pUpperFrms->Count(); )
{
pNxt = (SwFrm*)(*pUpperFrms)[x++];
if( bFirst && pNxt && pNxt->IsSctFrm() )
((SwSectionFrm*)pNxt)->UnlockJoin();
pUp = (SwLayoutFrm*)(*pUpperFrms)[x++];
ASSERT( pUp->GetUpper() || pUp->IsFlyFrm(), "Lost Upper" );
- ::_InsertCnt( pUp, pDoc, pNd->GetIndex(), FALSE, nStt+1, pNxt );
+ ::_InsertCnt( pUp, pDoc, pNd->GetIndex(), sal_False, nStt+1, pNxt );
pNxt = pUp->GetLastLower();
(*pUpperFrms)[x-2] = pNxt;
}
}
- bFirst = FALSE;
+ bFirst = sal_False;
}
- for( USHORT x = 0; x < pUpperFrms->Count(); ++x )
+ for( sal_uInt16 x = 0; x < pUpperFrms->Count(); ++x )
{
SwFrm* pTmp = (SwFrm*)(*pUpperFrms)[++x];
if( pTmp->IsFtnFrm() )
@@ -424,24 +439,24 @@ void SwNode2LayImpl::RestoreUpperFrms( SwNodes& rNds, ULONG nStt, ULONG nEnd )
SwFrm* SwNode2LayImpl::GetFrm( const Point* pDocPos,
const SwPosition *pPos,
- const BOOL bCalcFrm ) const
+ const sal_Bool bCalcFrm ) const
{
// 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, ULONG nIdx )
+SwNode2Layout::SwNode2Layout( const SwNode& rNd, sal_uLong nIdx )
{
- pImpl = new SwNode2LayImpl( rNd, nIdx, FALSE );
+ pImpl = new SwNode2LayImpl( rNd, nIdx, sal_False );
}
SwNode2Layout::SwNode2Layout( const SwNode& rNd )
{
- pImpl = new SwNode2LayImpl( rNd, rNd.GetIndex(), TRUE );
+ pImpl = new SwNode2LayImpl( rNd, rNd.GetIndex(), sal_True );
pImpl->SaveUpperFrms();
}
-void SwNode2Layout::RestoreUpperFrms( SwNodes& rNds, ULONG nStt, ULONG nEnd )
+void SwNode2Layout::RestoreUpperFrms( SwNodes& rNds, sal_uLong nStt, sal_uLong nEnd )
{
ASSERT( pImpl, "RestoreUpperFrms without SaveUpperFrms" );
pImpl->RestoreUpperFrms( rNds, nStt, nEnd );
@@ -464,7 +479,7 @@ SwNode2Layout::~SwNode2Layout()
SwFrm* SwNode2Layout::GetFrm( const Point* pDocPos,
const SwPosition *pPos,
- const BOOL bCalcFrm ) const
+ const sal_Bool bCalcFrm ) const
{
return pImpl->GetFrm( pDocPos, pPos, bCalcFrm );
}
diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index 724fa0fae14a..cce5bcb586f1 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -29,8 +29,10 @@
#include "precompiled_sw.hxx"
#include <stdlib.h>
+
#include <node.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <pam.hxx>
#include <txtfld.hxx>
#include <fmtfld.hxx>
@@ -50,8 +52,8 @@
#include <docsh.hxx>
#include <svl/smplhint.hxx>
-extern BOOL CheckNodesRange( const SwNodeIndex& rStt,
- const SwNodeIndex& rEnd, BOOL bChkSection );
+extern sal_Bool CheckNodesRange( const SwNodeIndex& rStt,
+ const SwNodeIndex& rEnd, sal_Bool bChkSection );
SV_DECL_PTRARR(SwSttNdPtrs,SwStartNode*,2,2)
@@ -64,7 +66,7 @@ SV_DECL_PTRARR(SwSttNdPtrs,SwStartNode*,2,2)
// Funktion zum bestimmen des hoechsten Levels innerhalb des Bereiches
-USHORT HighestLevel( SwNodes & rNodes, const SwNodeRange & rRange );
+sal_uInt16 HighestLevel( SwNodes & rNodes, const SwNodeRange & rRange );
//-----------------------------------------------------------------------
@@ -78,11 +80,11 @@ USHORT HighestLevel( SwNodes & rNodes, const SwNodeRange & rRange );
SwNodes::SwNodes( SwDoc* pDocument )
: pRoot( 0 ), pMyDoc( pDocument )
{
- bInNodesDel = bInDelUpdOutl = bInDelUpdNum = FALSE;
+ bInNodesDel = bInDelUpdOutl = bInDelUpdNum = sal_False;
ASSERT( pMyDoc, "in welchem Doc stehe ich denn?" );
- ULONG nPos = 0;
+ sal_uLong nPos = 0;
SwStartNode* pSttNd = new SwStartNode( *this, nPos++ );
pEndOfPostIts = new SwEndNode( *this, nPos++, *pSttNd );
@@ -129,7 +131,7 @@ SwNodes::~SwNodes()
{
SwNode *pNode;
SwNodeIndex aNdIdx( *this );
- while( TRUE )
+ while( sal_True )
{
pNode = &aNdIdx.GetNode();
if( pNode == pEndOfContent )
@@ -144,8 +146,8 @@ SwNodes::~SwNodes()
delete pEndOfContent;
}
-void SwNodes::ChgNode( SwNodeIndex& rDelPos, ULONG nSz,
- SwNodeIndex& rInsPos, BOOL bNewFrms )
+void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz,
+ SwNodeIndex& rInsPos, sal_Bool bNewFrms )
{
// im UndoBereich brauchen wir keine Frames
SwNodes& rNds = rInsPos.GetNodes();
@@ -153,13 +155,13 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, ULONG nSz,
//JP 03.02.99: alle Felder als invalide erklaeren, aktu. erfolgt im
// Idle-Handler des Docs
- if( GetDoc()->SetFieldsDirty( TRUE, &rDelPos.GetNode(), nSz ) &&
+ if( GetDoc()->SetFieldsDirty( sal_True, &rDelPos.GetNode(), nSz ) &&
rNds.GetDoc() != GetDoc() )
rNds.GetDoc()->SetFieldsDirty( true, NULL, 0 );
//JP 12.03.99: 63293 - Nodes vom RedlineBereich NIE aufnehmen
- ULONG nNd = rInsPos.GetIndex();
- BOOL bInsOutlineIdx = !(
+ sal_uLong nNd = rInsPos.GetIndex();
+ sal_Bool bInsOutlineIdx = !(
rNds.GetEndOfRedlines().StartOfSectionNode()->GetIndex() < nNd &&
nNd < rNds.GetEndOfRedlines().GetIndex() );
@@ -167,9 +169,9 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, ULONG nSz,
{
// wird von vorne nach hinten gemovt, so wird nach vorne immer
// nachgeschoben, d.H. die Loeschposition ist immer gleich
- USHORT nDiff = rDelPos.GetIndex() < rInsPos.GetIndex() ? 0 : 1;
+ sal_uInt16 nDiff = rDelPos.GetIndex() < rInsPos.GetIndex() ? 0 : 1;
- for( ULONG n = rDelPos.GetIndex(); nSz; n += nDiff, --nSz )
+ for( sal_uLong n = rDelPos.GetIndex(); nSz; n += nDiff, --nSz )
{
SwNodeIndex aDelIdx( *this, n );
SwNode& rNd = aDelIdx.GetNode();
@@ -226,15 +228,18 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, ULONG nSz,
}
else
{
- int bSavePersData = GetDoc()->GetUndoNds() == &rNds;
- int bRestPersData = GetDoc()->GetUndoNds() == this;
+ bool bSavePersData(GetDoc()->GetIDocumentUndoRedo().IsUndoNodes(rNds));
+ bool bRestPersData(GetDoc()->GetIDocumentUndoRedo().IsUndoNodes(*this));
SwDoc* pDestDoc = rNds.GetDoc() != GetDoc() ? rNds.GetDoc() : 0;
+ OSL_ENSURE(!pDestDoc, "SwNodes::ChgNode(): "
+ "the code to handle text fields here looks broken\n"
+ "if the target is in a different document.");
if( !bRestPersData && !bSavePersData && pDestDoc )
- bSavePersData = bRestPersData = TRUE;
+ bSavePersData = bRestPersData = sal_True;
String sNumRule;
SwNodeIndex aInsPos( rInsPos );
- for( ULONG n = 0; n < nSz; n++ )
+ for( sal_uLong n = 0; n < nSz; n++ )
{
SwNode* pNd = &rDelPos.GetNode();
@@ -262,7 +267,7 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, ULONG nSz,
sNumRule = pNumRule->GetName();
SwNumRule* pDestRule = pDestDoc->FindNumRulePtr( sNumRule );
if( pDestRule )
- pDestRule->SetInvalidRule( TRUE );
+ pDestRule->SetInvalidRule( sal_True );
else
pDestDoc->MakeNumRule( sNumRule, pNumRule );
}
@@ -278,7 +283,7 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, ULONG nSz,
// <--
}
- RemoveNode( rDelPos.GetIndex(), 1, FALSE ); // Indizies verschieben !!
+ RemoveNode( rDelPos.GetIndex(), 1, sal_False ); // Indizies verschieben !!
SwCntntNode * pCNd = pNd->GetCntntNode();
rNds.InsertNode( pNd, aInsPos );
@@ -305,10 +310,12 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, ULONG nSz,
// Sonderbehandlung fuer die Felder!
if( pHts && pHts->Count() )
{
- int bToUndo = &pDestDoc->GetNodes() != &rNds;
- for( USHORT i = pHts->Count(); i; )
+ // this looks fishy if pDestDoc != 0
+ bool const bToUndo = !pDestDoc &&
+ GetDoc()->GetIDocumentUndoRedo().IsUndoNodes(rNds);
+ for( sal_uInt16 i = pHts->Count(); i; )
{
- USHORT nDelMsg = 0;
+ sal_uInt16 nDelMsg = 0;
SwTxtAttr * const pAttr = pHts->GetTextHint( --i );
switch ( pAttr->Which() )
{
@@ -408,7 +415,7 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, ULONG nSz,
{
ASSERT( !this, "ob das so richtig ist ??" );
aFrmNdIdx = rNds.GetEndOfContent();
- pFrmNd = rNds.GoPrevSection( &aFrmNdIdx, TRUE, FALSE );
+ pFrmNd = rNds.GoPrevSection( &aFrmNdIdx, sal_True, sal_False );
if( pFrmNd && !((SwCntntNode*)pFrmNd)->GetDepends() )
pFrmNd = 0;
@@ -457,14 +464,14 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, ULONG nSz,
|*
***********************************************************************/
-BOOL SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
- const SwNodeIndex& aIndex, BOOL bNewFrms )
+sal_Bool SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
+ const SwNodeIndex& aIndex, sal_Bool bNewFrms )
{
SwNode * pAktNode;
if( aIndex == 0 ||
( (pAktNode = &aIndex.GetNode())->GetStartNode() &&
!pAktNode->StartOfSectionIndex() ))
- return FALSE;
+ return sal_False;
SwNodeRange aRg( aRange );
@@ -487,18 +494,18 @@ BOOL SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
// wird im selben Array's verschoben, dann ueberpruefe die Einfuegepos.
if( aRg.aStart >= aRg.aEnd )
- return FALSE;
+ return sal_False;
if( this == &rNodes )
{
if( ( aIndex.GetIndex()-1 >= aRg.aStart.GetIndex() &&
aIndex.GetIndex()-1 < aRg.aEnd.GetIndex()) ||
( aIndex.GetIndex()-1 == aRg.aEnd.GetIndex() ) )
- return FALSE;
+ return sal_False;
}
- USHORT nLevel = 0; // Level-Counter
- ULONG nInsPos = 0; // Cnt fuer das TmpArray
+ sal_uInt16 nLevel = 0; // Level-Counter
+ sal_uLong nInsPos = 0; // Cnt fuer das TmpArray
// das Array bildet einen Stack, es werden alle StartOfSelction's gesichert
SwSttNdPtrs aSttNdStack( 1, 5 );
@@ -507,7 +514,7 @@ BOOL SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
SwNodeIndex aIdx( aIndex );
/*
--- JP 17.11.94: sollte ueberholt sein, wird im ChgNode schon erledigt!
- BOOL bCorrNum = pSect && pSect->aStart.GetIndex() == aIdx.GetIndex();
+ sal_Bool bCorrNum = pSect && pSect->aStart.GetIndex() == aIdx.GetIndex();
*/
SwStartNode* pStartNode = aIdx.GetNode().pStartOfSection;
@@ -516,8 +523,8 @@ BOOL SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
SwNodeRange aOrigInsPos( aIdx, -1, aIdx ); // Originale Insert Pos
//JP 16.01.98: SectionNodes: DelFrms/MakeFrms beim obersten SectionNode!
- USHORT nSectNdCnt = 0;
- BOOL bSaveNewFrms = bNewFrms;
+ sal_uInt16 nSectNdCnt = 0;
+ sal_Bool bSaveNewFrms = bNewFrms;
// bis alles verschoben ist
while( aRg.aStart < aRg.aEnd )
@@ -546,8 +553,8 @@ BOOL SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
aRg.aEnd -= nInsPos;
//JP 12.03.99: 63293 - Nodes vom RedlineBereich NIE aufnehmen
- ULONG nNd = aIdx.GetIndex();
- BOOL bInsOutlineIdx = !( rNodes.GetEndOfRedlines().
+ sal_uLong nNd = aIdx.GetIndex();
+ sal_Bool bInsOutlineIdx = !( rNodes.GetEndOfRedlines().
StartOfSectionNode()->GetIndex() < nNd &&
nNd < rNodes.GetEndOfRedlines().GetIndex() );
@@ -559,7 +566,7 @@ BOOL SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
// dann bewege alle Start/End/ContentNodes. Loesche
// bei den ContentNodes auch die Frames !!
pTblNd->pStartOfSection = aIdx.GetNode().pStartOfSection;
- for( ULONG n = 0; n < nInsPos; ++n )
+ for( sal_uLong n = 0; n < nInsPos; ++n )
{
SwNodeIndex aMvIdx( aRg.aEnd, 1 );
SwCntntNode* pCNd = 0;
@@ -606,7 +613,7 @@ BOOL SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
// (Array kopieren und alle gefunden wieder loeschen;
// erleichtert das suchen!!)
SwNodeIndex aMvIdx( aRg.aEnd, 1 );
- for( ULONG n = 0; n < nInsPos; ++n )
+ for( sal_uLong n = 0; n < nInsPos; ++n )
{
SwNode* pNd = &aMvIdx.GetNode();
/* if( bNewFrms )
@@ -617,7 +624,7 @@ BOOL SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
((SwSectionNode*)pNd)->DelFrms();
}
*/
- //BOOL bOutlNd = pNd->IsTxtNode() && NO_NUMBERING !=//#outline level,zhaojianwei
+ //sal_Bool bOutlNd = pNd->IsTxtNode() && NO_NUMBERING !=//#outline level,zhaojianwei
// ((SwTxtNode*)pNd)->GetTxtColl()->GetOutlineLevel();
const bool bOutlNd = pNd->IsTxtNode() &&
0 != ((SwTxtNode*)pNd)->GetAttrOutlineLevel();//<-end,zhaojianwei
@@ -626,7 +633,7 @@ BOOL SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
if( bOutlNd )
pOutlineNds->Remove( pNd );
- RemoveNode( aMvIdx.GetIndex(), 1, FALSE );
+ RemoveNode( aMvIdx.GetIndex(), 1, sal_False );
pNd->pStartOfSection = pSttNode;
rNodes.InsertNode( pNd, aIdx );
@@ -658,7 +665,8 @@ BOOL SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
}
}
- if( GetDoc()->GetUndoNds() == &rNodes )
+ if (GetDoc()->GetIDocumentUndoRedo().IsUndoNodes(
+ rNodes))
{
SwFrmFmt* pTblFmt = pTblNd->GetTable().GetFrmFmt();
SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT,
@@ -695,8 +703,8 @@ BOOL SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
// noch den EndNode erzeugen
new SwEndNode( aIdx, *pTmp );
}
- else if( (const SwNodes*)&rNodes ==
- GetDoc()->GetUndoNds() )
+ else if (GetDoc()->GetIDocumentUndoRedo().IsUndoNodes(
+ rNodes))
{
// im UndoNodes-Array spendieren wir einen
// Platzhalter
@@ -712,7 +720,7 @@ BOOL SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
aRg.aEnd--;
aIdx--;
- } while( FALSE );
+ } while( sal_False );
}
else
{
@@ -727,14 +735,14 @@ BOOL SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
if( bNewFrms && pSctNd )
pSctNd->DelFrms();
- RemoveNode( aRg.aEnd.GetIndex(), 1, FALSE ); // EndNode loeschen
- ULONG nSttPos = pSttNd->GetIndex();
+ RemoveNode( aRg.aEnd.GetIndex(), 1, sal_False ); // EndNode loeschen
+ sal_uLong nSttPos = pSttNd->GetIndex();
// dieser StartNode wird spaeter wieder entfernt!
SwStartNode* pTmpSttNd = new SwStartNode( *this, nSttPos+1 );
pTmpSttNd->pStartOfSection = pSttNd->pStartOfSection;
- RemoveNode( nSttPos, 1, FALSE ); // SttNode loeschen
+ RemoveNode( nSttPos, 1, sal_False ); // SttNode loeschen
pSttNd->pStartOfSection = aIdx.GetNode().pStartOfSection;
rNodes.InsertNode( pSttNd, aIdx );
@@ -752,7 +760,7 @@ BOOL SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
{
pSctNd->NodesArrChgd();
++nSectNdCnt;
- bNewFrms = FALSE;
+ bNewFrms = sal_False;
}
}
}
@@ -762,7 +770,7 @@ BOOL SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
case ND_SECTIONNODE:
if( !nLevel &&
- ( (const SwNodes*)&rNodes == GetDoc()->GetUndoNds() ) )
+ GetDoc()->GetIDocumentUndoRedo().IsUndoNodes(rNodes))
{
// dann muss an der akt. InsPos ein SectionDummyNode
// eingefuegt werden
@@ -811,7 +819,7 @@ BOOL SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
aRg.aEnd++;
{
SwNodeIndex aCntIdx( aRg.aEnd );
- for( ULONG n = 0; n < nInsPos; n++, aCntIdx++)
+ for( sal_uLong n = 0; n < nInsPos; n++, aCntIdx++)
aCntIdx.GetNode().pStartOfSection = pTmpStt;
}
@@ -847,8 +855,8 @@ BOOL SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
nInsPos = 0;
// loesche nur noch den Pointer aus dem Nodes-Array.
-// RemoveNode( aRg.aEnd.GetIndex(), 1, FALSE );
- RemoveNode( aRg.aEnd.GetIndex(), 1, TRUE );
+// RemoveNode( aRg.aEnd.GetIndex(), 1, sal_False );
+ RemoveNode( aRg.aEnd.GetIndex(), 1, sal_True );
aRg.aEnd--;
SwSectionNode* pSectNd = aSttNdStack[ nLevel ]->GetSectionNode();
@@ -889,7 +897,7 @@ BOOL SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
break;
case ND_SECTIONDUMMY:
- if( (const SwNodes*)this == GetDoc()->GetUndoNds() )
+ if (GetDoc()->GetIDocumentUndoRedo().IsUndoNodes(*this))
{
if( &rNodes == this ) // innerhalb vom UndoNodesArray
{
@@ -918,13 +926,13 @@ BOOL SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
}
}
else {
- ASSERT( FALSE, "wie kommt diser Node ins Nodes-Array??" );
+ ASSERT( sal_False, "wie kommt diser Node ins Nodes-Array??" );
}
aRg.aEnd--;
break;
default:
- ASSERT( FALSE, "was ist das fuer ein Node??" );
+ ASSERT( sal_False, "was ist das fuer ein Node??" );
break;
}
@@ -973,7 +981,7 @@ extern Writer* GetDebugWriter(const String&);
}
#endif
- return TRUE;
+ return sal_True;
}
@@ -1119,8 +1127,8 @@ void SwNodes::SectionUp(SwNodeRange *pRange)
{
// dann wurde paarig aufgehoben, also nur die im Berich neu anpassen
SwStartNode* pTmpSttNd = pAktNode->pStartOfSection;
- RemoveNode( pRange->aStart.GetIndex(), 1, TRUE );
- RemoveNode( pRange->aEnd.GetIndex(), 1, TRUE );
+ RemoveNode( pRange->aStart.GetIndex(), 1, sal_True );
+ RemoveNode( pRange->aEnd.GetIndex(), 1, sal_True );
SwNodeIndex aTmpIdx( pRange->aStart );
while( aTmpIdx < pRange->aEnd )
@@ -1236,7 +1244,7 @@ void SwNodes::SectionUpDown( const SwNodeIndex & aStart, const SwNodeIndex & aEn
|* SwIndex &rIndex bezeichnet die Position, an der
|* geloescht wird
|* rIndex ist nach Aufruf der Funktion unveraendert (Kopie?!)
-|* USHORT nNodes bezeichnet die Anzahl der zu loeschenden
+|* sal_uInt16 nNodes bezeichnet die Anzahl der zu loeschenden
|* Nodes; ist auf 1 defaulted
|*
|* Debug-Funktionen
@@ -1250,12 +1258,12 @@ void SwNodes::SectionUpDown( const SwNodeIndex & aStart, const SwNodeIndex & aEn
|* VER0100 vb 901214
|*
*******************************************************************/
-void SwNodes::Delete(const SwNodeIndex &rIndex, ULONG nNodes)
+void SwNodes::Delete(const SwNodeIndex &rIndex, sal_uLong nNodes)
{
- USHORT nLevel = 0; // Level-Counter
+ sal_uInt16 nLevel = 0; // Level-Counter
SwNode * pAktNode;
- ULONG nCnt = Count() - rIndex.GetIndex() - 1;
+ sal_uLong nCnt = Count() - rIndex.GetIndex() - 1;
if( nCnt > nNodes ) nCnt = nNodes;
if( nCnt == 0 ) // keine Anzahl -> return
@@ -1281,9 +1289,9 @@ void SwNodes::Delete(const SwNodeIndex &rIndex, ULONG nNodes)
// so ist aEnd <= aStart
aRg.aStart--;
- BOOL bSaveInNodesDel = bInNodesDel;
- bInNodesDel = TRUE;
- BOOL bUpdateOutline = FALSE;
+ sal_Bool bSaveInNodesDel = bInNodesDel;
+ bInNodesDel = sal_True;
+ sal_Bool bUpdateOutline = sal_False;
// bis alles geloescht ist
while( aRg.aStart < aRg.aEnd )
@@ -1300,7 +1308,7 @@ void SwNodes::Delete(const SwNodeIndex &rIndex, ULONG nNodes)
pTblNd->DelFrms();
SwNode *pNd, *pChkNd = pAktNode->pStartOfSection;
- USHORT nIdxPos;
+ sal_uInt16 nIdxPos;
do {
pNd = &aRg.aEnd.GetNode();
@@ -1313,7 +1321,7 @@ void SwNodes::Delete(const SwNodeIndex &rIndex, ULONG nNodes)
{
// loesche die Gliederungs-Indizies.
pOutlineNds->Remove( nIdxPos );
- bUpdateOutline = TRUE;
+ bUpdateOutline = sal_True;
}
((SwTxtNode*)pNd)->InvalidateNumRule();
}
@@ -1328,7 +1336,7 @@ void SwNodes::Delete(const SwNodeIndex &rIndex, ULONG nNodes)
}
else
{
- RemoveNode( aRg.aEnd.GetIndex()+1, nCnt, TRUE ); // loesche
+ RemoveNode( aRg.aEnd.GetIndex()+1, nCnt, sal_True ); // loesche
nCnt = 0;
aRg.aEnd--; // vor den EndNode
nLevel++;
@@ -1342,13 +1350,13 @@ void SwNodes::Delete(const SwNodeIndex &rIndex, ULONG nNodes)
{
// loesche jetzt das Array
aRg.aEnd++;
- RemoveNode( aRg.aEnd.GetIndex(), nCnt, TRUE );
+ RemoveNode( aRg.aEnd.GetIndex(), nCnt, sal_True );
nCnt = 0;
}
}
else // es werden alle Nodes Innerhalb eines Start- und
{ // End-Nodes geloescht, loesche mit Start/EndNode
- RemoveNode( aRg.aEnd.GetIndex(), nCnt + 2, TRUE ); // loesche Array
+ RemoveNode( aRg.aEnd.GetIndex(), nCnt + 2, sal_True ); // loesche Array
nCnt = 0;
nLevel--;
}
@@ -1375,7 +1383,7 @@ void SwNodes::Delete(const SwNodeIndex &rIndex, ULONG nNodes)
if( pTxtNd->IsOutline())
{ // loesche die Gliederungs-Indizies.
pOutlineNds->Remove( pTxtNd );
- bUpdateOutline = TRUE;
+ bUpdateOutline = sal_True;
}
pTxtNd->InvalidateNumRule();
}
@@ -1389,7 +1397,7 @@ void SwNodes::Delete(const SwNodeIndex &rIndex, ULONG nNodes)
aRg.aEnd++;
if( nCnt != 0 )
- RemoveNode( aRg.aEnd.GetIndex(), nCnt, TRUE ); // loesche den Rest
+ RemoveNode( aRg.aEnd.GetIndex(), nCnt, sal_True ); // loesche den Rest
// loesche alle leeren Start-/End-Node-Paare
while( aRg.aEnd.GetNode().GetEndNode() &&
@@ -1409,14 +1417,14 @@ void SwNodes::Delete(const SwNodeIndex &rIndex, ULONG nNodes)
if( bUpdateOutline || bInDelUpdOutl )
{
UpdtOutlineIdx( aRg.aEnd.GetNode() );
- bInDelUpdOutl = FALSE;
+ bInDelUpdOutl = sal_False;
}
}
else
{
if( bUpdateOutline )
- bInDelUpdOutl = TRUE;
+ bInDelUpdOutl = sal_True;
}
}
@@ -1454,15 +1462,14 @@ void SwNodes::Delete(const SwNodeIndex &rIndex, ULONG nNodes)
|* VER0100 vb 901214
|*
*******************************************************************/
-USHORT SwNodes::GetSectionLevel(const SwNodeIndex &rIdx) const {
+sal_uInt16 SwNodes::GetSectionLevel(const SwNodeIndex &rIdx) const {
// Sonderbehandlung 1. Node
if(rIdx == 0) return 1;
/*
* Keine Rekursion! - hier wird das SwNode::GetSectionLevel
* aufgerufen
*/
- return (*this)[rIdx]->GetSectionLevel();
-
+ return rIdx.GetNode().GetSectionLevel();
}
void SwNodes::GoStartOfSection(SwNodeIndex *pIdx) const
@@ -1527,7 +1534,7 @@ SwCntntNode* SwNodes::GoPrevious(SwNodeIndex *pIdx) const
/*************************************************************************
|*
-|* BOOL SwNodes::CheckNodesRange()
+|* sal_Bool SwNodes::CheckNodesRange()
|*
|* Beschreibung
|* Teste ob der uebergene SRange nicht ueber die Grenzen der
@@ -1540,37 +1547,37 @@ SwCntntNode* SwNodes::GoPrevious(SwNodeIndex *pIdx) const
|*
|* Parameter SwIndex & Start-Index vom Bereich
|* SwIndex & End-Index vom Bereich
-|* BOOL TRUE: Start+End in gleicher Section!
-|* FALSE: Start+End in verschiedenen Sect.
-|* Return-Wert BOOL TRUE: gueltiger SRange
-|* FALSE: ungueltiger SRange
+|* sal_Bool sal_True: Start+End in gleicher Section!
+|* sal_False: Start+End in verschiedenen Sect.
+|* Return-Wert sal_Bool sal_True: gueltiger SRange
+|* sal_False: ungueltiger SRange
|*
|* Ersterstellung JP 23.04.91
|* Letzte Aenderung JP 18.06.92
|*
*************************************************************************/
-inline int TstIdx( ULONG nSttIdx, ULONG nEndIdx, ULONG nStt, ULONG nEnd )
+inline int TstIdx( sal_uLong nSttIdx, sal_uLong nEndIdx, sal_uLong nStt, sal_uLong nEnd )
{
return nStt < nSttIdx && nEnd >= nSttIdx &&
nStt < nEndIdx && nEnd >= nEndIdx;
}
-BOOL SwNodes::CheckNodesRange( const SwNodeIndex& rStt, const SwNodeIndex& rEnd ) const
+sal_Bool SwNodes::CheckNodesRange( const SwNodeIndex& rStt, const SwNodeIndex& rEnd ) const
{
- ULONG nStt = rStt.GetIndex(), nEnd = rEnd.GetIndex();
+ sal_uLong nStt = rStt.GetIndex(), nEnd = rEnd.GetIndex();
if( TstIdx( nStt, nEnd, pEndOfContent->StartOfSectionIndex(),
- pEndOfContent->GetIndex() )) return TRUE;
+ pEndOfContent->GetIndex() )) return sal_True;
if( TstIdx( nStt, nEnd, pEndOfAutotext->StartOfSectionIndex(),
- pEndOfAutotext->GetIndex() )) return TRUE;
+ pEndOfAutotext->GetIndex() )) return sal_True;
if( TstIdx( nStt, nEnd, pEndOfPostIts->StartOfSectionIndex(),
- pEndOfPostIts->GetIndex() )) return TRUE;
+ pEndOfPostIts->GetIndex() )) return sal_True;
if( TstIdx( nStt, nEnd, pEndOfInserts->StartOfSectionIndex(),
- pEndOfInserts->GetIndex() )) return TRUE;
+ pEndOfInserts->GetIndex() )) return sal_True;
if( TstIdx( nStt, nEnd, pEndOfRedlines->StartOfSectionIndex(),
- pEndOfRedlines->GetIndex() )) return TRUE;
+ pEndOfRedlines->GetIndex() )) return sal_True;
- return FALSE; // liegt irgendwo dazwischen, FEHLER
+ return sal_False; // liegt irgendwo dazwischen, FEHLER
}
@@ -1582,16 +1589,16 @@ BOOL SwNodes::CheckNodesRange( const SwNodeIndex& rStt, const SwNodeIndex& rEnd
|* Loesche aus den NodesArray ab einer Position entsprechend Node's.
|*
|* Parameter SwIndex & Der Startpunkt im Nodes-Array
-|* USHORT die Anzahl
+|* sal_uInt16 die Anzahl
|*
|* Ersterstellung JP 23.04.91
|* Letzte Aenderung JP 23.04.91
|*
*************************************************************************/
-void SwNodes::DelNodes( const SwNodeIndex & rStart, ULONG nCnt )
+void SwNodes::DelNodes( const SwNodeIndex & rStart, sal_uLong nCnt )
{
int bUpdateNum = 0;
- ULONG nSttIdx = rStart.GetIndex();
+ sal_uLong nSttIdx = rStart.GetIndex();
if( !nSttIdx && nCnt == GetEndOfContent().GetIndex()+1 )
{
@@ -1608,17 +1615,17 @@ void SwNodes::DelNodes( const SwNodeIndex & rStart, ULONG nCnt )
while( *ppEndNdArr )
{
nSttIdx = (*ppEndNdArr)->StartOfSectionIndex() + 1;
- ULONG nEndIdx = (*ppEndNdArr)->GetIndex();
+ sal_uLong nEndIdx = (*ppEndNdArr)->GetIndex();
if( nSttIdx != nEndIdx )
- RemoveNode( nSttIdx, nEndIdx - nSttIdx, TRUE );
+ RemoveNode( nSttIdx, nEndIdx - nSttIdx, sal_True );
++ppEndNdArr;
}
}
else
{
- for( ULONG n = nSttIdx, nEnd = nSttIdx + nCnt; n < nEnd; ++n )
+ for( sal_uLong n = nSttIdx, nEnd = nSttIdx + nCnt; n < nEnd; ++n )
{
SwNode* pNd = (*this)[ n ];
@@ -1626,7 +1633,7 @@ void SwNodes::DelNodes( const SwNodeIndex & rStart, ULONG nCnt )
//NO_NUMBERING != ((SwTxtNode*)pNd)->GetTxtColl()->GetOutlineLevel() )//#outline level,zhaojianwei
0 != ((SwTxtNode*)pNd)->GetAttrOutlineLevel() ) //<-end,zhaojianwei
{ // loesche die Gliederungs-Indizies.
- USHORT nIdxPos;
+ sal_uInt16 nIdxPos;
if( pOutlineNds->Seek_Entry( pNd, &nIdxPos ))
{
pOutlineNds->Remove( nIdxPos );
@@ -1639,7 +1646,7 @@ void SwNodes::DelNodes( const SwNodeIndex & rStart, ULONG nCnt )
((SwCntntNode*)pNd)->DelFrms();
}
}
- RemoveNode( nSttIdx, nCnt, TRUE );
+ RemoveNode( nSttIdx, nCnt, sal_True );
// rufe noch das Update fuer die Gliederungsnumerierung auf
if( bUpdateNum )
@@ -1650,14 +1657,14 @@ void SwNodes::DelNodes( const SwNodeIndex & rStart, ULONG nCnt )
/*************************************************************************
|*
-|* USHORT HighestLevel( SwNodes & rNodes, const SwNodeRange & rRange )
+|* sal_uInt16 HighestLevel( SwNodes & rNodes, const SwNodeRange & rRange )
|*
|* Beschreibung
|* Berechne den hoehsten Level innerhalb des Bereiches
|*
|* Parameter SwNodes & das Node-Array
|* SwNodeRange & der zu ueberpruefende Bereich
-|* Return USHORT der hoechste Level
+|* Return sal_uInt16 der hoechste Level
|*
|* Ersterstellung JP 24.04.91
|* Letzte Aenderung JP 24.04.91
@@ -1666,12 +1673,12 @@ void SwNodes::DelNodes( const SwNodeIndex & rStart, ULONG nCnt )
struct HighLevel
{
- USHORT nLevel, nTop;
- HighLevel( USHORT nLv ) : nLevel( nLv ), nTop( nLv ) {}
+ sal_uInt16 nLevel, nTop;
+ HighLevel( sal_uInt16 nLv ) : nLevel( nLv ), nTop( nLv ) {}
};
-BOOL _HighestLevel( const SwNodePtr& rpNode, void * pPara )
+sal_Bool _HighestLevel( const SwNodePtr& rpNode, void * pPara )
{
HighLevel * pHL = (HighLevel*)pPara;
if( rpNode->GetStartNode() )
@@ -1680,11 +1687,11 @@ BOOL _HighestLevel( const SwNodePtr& rpNode, void * pPara )
pHL->nLevel--;
if( pHL->nTop > pHL->nLevel )
pHL->nTop = pHL->nLevel;
- return TRUE;
+ return sal_True;
}
-USHORT HighestLevel( SwNodes & rNodes, const SwNodeRange & rRange )
+sal_uInt16 HighestLevel( SwNodes & rNodes, const SwNodeRange & rRange )
{
HighLevel aPara( rNodes.GetSectionLevel( rRange.aStart ));
rNodes.ForEach( rRange.aStart, rRange.aEnd, _HighestLevel, &aPara );
@@ -1717,10 +1724,10 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes )
SwNodeIndex aEndIdx( pEnd->nNode );
SwNodeIndex aSttIdx( pStt->nNode );
- SwTxtNode* const pSrcNd = (*this)[ aSttIdx ]->GetTxtNode();
- SwTxtNode* pDestNd = rNodes[ rPos.nNode ]->GetTxtNode();
- BOOL bSplitDestNd = TRUE;
- BOOL bCopyCollFmt = pDestNd && !pDestNd->GetTxt().Len();
+ SwTxtNode *const pSrcNd = aSttIdx.GetNode().GetTxtNode();
+ SwTxtNode * pDestNd = rPos.nNode.GetNode().GetTxtNode();
+ sal_Bool bSplitDestNd = sal_True;
+ sal_Bool bCopyCollFmt = pDestNd && !pDestNd->GetTxt().Len();
if( pSrcNd )
{
@@ -1731,27 +1738,27 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes )
pDestNd = rNodes.MakeTxtNode( rPos.nNode, pSrcNd->GetTxtColl() );
rPos.nNode--;
rPos.nContent.Assign( pDestNd, 0 );
- bCopyCollFmt = TRUE;
+ bCopyCollFmt = sal_True;
}
bSplitDestNd = pDestNd->Len() > rPos.nContent.GetIndex() ||
pEnd->nNode.GetNode().IsTxtNode();
// verschiebe jetzt noch den Inhalt in den neuen Node
- BOOL bOneNd = pStt->nNode == pEnd->nNode;
+ sal_Bool bOneNd = pStt->nNode == pEnd->nNode;
const xub_StrLen nLen =
( (bOneNd) ? pEnd->nContent.GetIndex() : pSrcNd->Len() )
- pStt->nContent.GetIndex();
if( !pEnd->nNode.GetNode().IsCntntNode() )
{
- bOneNd = TRUE;
- ULONG nSttNdIdx = pStt->nNode.GetIndex() + 1;
- const ULONG nEndNdIdx = pEnd->nNode.GetIndex();
+ bOneNd = sal_True;
+ sal_uLong nSttNdIdx = pStt->nNode.GetIndex() + 1;
+ const sal_uLong nEndNdIdx = pEnd->nNode.GetIndex();
for( ; nSttNdIdx < nEndNdIdx; ++nSttNdIdx )
{
if( (*this)[ nSttNdIdx ]->IsCntntNode() )
{
- bOneNd = FALSE;
+ bOneNd = sal_False;
break;
}
}
@@ -1763,15 +1770,13 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes )
{
if( !rPos.nContent.GetIndex() )
{
- bCopyCollFmt = TRUE;
+ bCopyCollFmt = sal_True;
}
if( rNodes.IsDocNodes() )
{
SwDoc* const pInsDoc = pDestNd->GetDoc();
- const bool bIsUndo = pInsDoc->DoesUndo();
- pInsDoc->DoUndo( false );
+ ::sw::UndoGuard const ug(pInsDoc->GetIDocumentUndoRedo());
pInsDoc->SplitNode( rPos, false );
- pInsDoc->DoUndo( bIsUndo );
}
else
{
@@ -1782,7 +1787,7 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes )
{
aEndIdx--;
}
- bSplitDestNd = TRUE;
+ bSplitDestNd = sal_True;
pDestNd = rNodes[ rPos.nNode.GetIndex() - 1 ]->GetTxtNode();
if( nLen )
@@ -1799,11 +1804,9 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes )
if( bCopyCollFmt )
{
SwDoc* const pInsDoc = pDestNd->GetDoc();
- const bool bIsUndo = pInsDoc->DoesUndo();
- pInsDoc->DoUndo( false );
+ ::sw::UndoGuard const undoGuard(pInsDoc->GetIDocumentUndoRedo());
pSrcNd->CopyCollFmt( *pDestNd );
- pInsDoc->DoUndo( bIsUndo );
- bCopyCollFmt = FALSE;
+ bCopyCollFmt = sal_False;
}
if( bOneNd ) // das wars schon
@@ -1838,10 +1841,8 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes )
if( rNodes.IsDocNodes() )
{
SwDoc* const pInsDoc = pDestNd->GetDoc();
- const bool bIsUndo = pInsDoc->DoesUndo();
- pInsDoc->DoUndo( false );
+ ::sw::UndoGuard const ug(pInsDoc->GetIDocumentUndoRedo());
pInsDoc->SplitNode( rPos, false );
- pInsDoc->DoUndo( bIsUndo );
}
else
{
@@ -1857,10 +1858,10 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes )
}
}
// am Ende steht noch ein leerer Text Node herum.
- bSplitDestNd = TRUE;
+ bSplitDestNd = sal_True;
}
- SwTxtNode* const pEndSrcNd = (*this)[ aEndIdx ]->GetTxtNode();
+ SwTxtNode* const pEndSrcNd = aEndIdx.GetNode().GetTxtNode();
if ( pEndSrcNd )
{
{
@@ -1879,7 +1880,7 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes )
}
else
{
- pDestNd = rNodes[ rPos.nNode ]->GetTxtNode();
+ pDestNd = rPos.nNode.GetNode().GetTxtNode();
}
if( pDestNd && pEnd->nContent.GetIndex() )
@@ -1893,10 +1894,8 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes )
if( bCopyCollFmt )
{
SwDoc* const pInsDoc = pDestNd->GetDoc();
- const bool bIsUndo = pInsDoc->DoesUndo();
- pInsDoc->DoUndo( false );
+ ::sw::UndoGuard const ug(pInsDoc->GetIDocumentUndoRedo());
pEndSrcNd->CopyCollFmt( *pDestNd );
- pInsDoc->DoUndo( bIsUndo );
}
}
}
@@ -1916,7 +1915,7 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes )
if( aEndIdx != aSttIdx )
{
// verschiebe jetzt die Nodes in das NodesArary
- const ULONG nSttDiff = aSttIdx.GetIndex() - pStt->nNode.GetIndex();
+ const sal_uLong nSttDiff = aSttIdx.GetIndex() - pStt->nNode.GetIndex();
SwNodeRange aRg( aSttIdx, aEndIdx );
_MoveNodes( aRg, rNodes, rPos.nNode );
// falls ins gleiche Nodes-Array verschoben wurde, stehen die
@@ -1936,7 +1935,7 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes )
ASSERT( bSuccess, "Move() - no ContentNode here" );
(void) bSuccess;
}
- pStt->nContent.Assign( (*this)[ pStt->nNode ]->GetCntntNode(),
+ pStt->nContent.Assign( pStt->nNode.GetNode().GetCntntNode(),
pStt->nContent.GetIndex() );
// der PaM wird korrigiert, denn falls ueber Nodegrenzen verschoben
// wurde, so stehen sie in unterschielichen Nodes. Auch die Selektion
@@ -1962,13 +1961,13 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes )
|*
*************************************************************************/
-inline BYTE MaxLvl( BYTE nMin, BYTE nMax, short nNew )
+inline sal_uInt8 MaxLvl( sal_uInt8 nMin, sal_uInt8 nMax, short nNew )
{
- return (BYTE)(nNew < nMin ? nMin : nNew > nMax ? nMax : nNew);
+ return (sal_uInt8)(nNew < nMin ? nMin : nNew > nMax ? nMax : nNew);
}
void SwNodes::_CopyNodes( const SwNodeRange& rRange,
- const SwNodeIndex& rIndex, BOOL bNewFrms, BOOL bTblInsDummyNode ) const
+ const SwNodeIndex& rIndex, sal_Bool bNewFrms, sal_Bool bTblInsDummyNode ) const
{
SwDoc* pDoc = rIndex.GetNode().GetDoc();
@@ -1981,7 +1980,7 @@ void SwNodes::_CopyNodes( const SwNodeRange& rRange,
SwNodeRange aRg( rRange );
// "einfache" StartNodes oder EndNodes ueberspringen
- while( ND_STARTNODE == (pAktNode = (*this)[ aRg.aStart ])->GetNodeType()
+ while( ND_STARTNODE == (pAktNode = & aRg.aStart.GetNode())->GetNodeType()
|| ( pAktNode->IsEndNode() &&
!pAktNode->pStartOfSection->IsSectionNode() ) )
aRg.aStart++;
@@ -1993,7 +1992,7 @@ void SwNodes::_CopyNodes( const SwNodeRange& rRange,
// special section nodes and then one before the first.
if (aRg.aEnd.GetNode().StartOfSectionIndex() != 0)
{
- while( (( pAktNode = (*this)[ aRg.aEnd ])->GetStartNode() &&
+ while( ((pAktNode = & aRg.aEnd.GetNode())->GetStartNode() &&
!pAktNode->IsSectionNode() ) ||
( pAktNode->IsEndNode() &&
ND_STARTNODE == pAktNode->pStartOfSection->GetNodeType()) )
@@ -2019,9 +2018,9 @@ void SwNodes::_CopyNodes( const SwNodeRange& rRange,
SwNodeIndex aInsPos( rIndex );
SwNodeIndex aOrigInsPos( rIndex, -1 ); // Originale Insert Pos
- USHORT nLevel = 0; // Level-Counter
+ sal_uInt16 nLevel = 0; // Level-Counter
- for( ULONG nNodeCnt = aRg.aEnd.GetIndex() - aRg.aStart.GetIndex();
+ for( sal_uLong nNodeCnt = aRg.aEnd.GetIndex() - aRg.aStart.GetIndex();
nNodeCnt > 0; --nNodeCnt )
{
pAktNode = &aRg.aStart.GetNode();
@@ -2054,7 +2053,7 @@ void SwNodes::_CopyNodes( const SwNodeRange& rRange,
SwStartNode* pSttNd = aRg.aStart.GetNode().GetStartNode();
_CopyNodes( SwNodeRange( *pSttNd, + 1,
*pSttNd->EndOfSectionNode() ),
- aInsPos, bNewFrms, FALSE );
+ aInsPos, bNewFrms, sal_False );
// fuer den Box-EndNode einen DummyNode einfuegen?
if( bTblInsDummyNode )
@@ -2141,23 +2140,23 @@ void SwNodes::_CopyNodes( const SwNodeRange& rRange,
break;
case ND_SECTIONDUMMY:
- if( (const SwNodes*)this == GetDoc()->GetUndoNds() )
+ if (GetDoc()->GetIDocumentUndoRedo().IsUndoNodes(*this))
{
// dann muss an der akt. InsPos auch ein SectionNode
// (Start/Ende) stehen; dann diesen ueberspringen.
// Andernfalls nicht weiter beachten.
- SwNode* pTmpNd = pDoc->GetNodes()[ aInsPos ];
+ SwNode *const pTmpNd = & aInsPos.GetNode();
if( pTmpNd->IsSectionNode() ||
pTmpNd->StartOfSectionNode()->IsSectionNode() )
aInsPos++; // ueberspringen
}
else {
- ASSERT( FALSE, "wie kommt diser Node ins Nodes-Array??" );
+ ASSERT( sal_False, "wie kommt diser Node ins Nodes-Array??" );
}
break;
default:
- ASSERT( FALSE, "weder Start-/End-/Content-Node, unbekannter Typ" );
+ ASSERT( sal_False, "weder Start-/End-/Content-Node, unbekannter Typ" );
}
aRg.aStart++;
}
@@ -2185,7 +2184,7 @@ void SwNodes::_DelDummyNodes( const SwNodeRange& rRg )
while( aIdx.GetIndex() < rRg.aEnd.GetIndex() )
{
if( ND_SECTIONDUMMY == aIdx.GetNode().GetNodeType() )
- RemoveNode( aIdx.GetIndex(), 1, TRUE );
+ RemoveNode( aIdx.GetIndex(), 1, sal_True );
else
aIdx++;
}
@@ -2212,27 +2211,28 @@ SwStartNode* SwNodes::MakeTextSection( const SwNodeIndex & rWhere,
}
// zum naechsten Content-Node, der nicht geschuetzt oder versteckt ist
- // (beides auf FALSE ==> GoNext/GoPrevious!!!)
+ // (beides auf sal_False ==> GoNext/GoPrevious!!!)
SwCntntNode* SwNodes::GoNextSection( SwNodeIndex * pIdx,
int bSkipHidden, int bSkipProtect ) const
{
- int bFirst = TRUE;
+ int bFirst = sal_True;
SwNodeIndex aTmp( *pIdx );
const SwNode* pNd;
while( aTmp < Count() - 1 )
{
- if( ND_SECTIONNODE == ( pNd = (*this)[aTmp])->GetNodeType() )
+ pNd = & aTmp.GetNode();
+ if (ND_SECTIONNODE == pNd->GetNodeType())
{
const SwSection& rSect = ((SwSectionNode*)pNd)->GetSection();
if( (bSkipHidden && rSect.IsHiddenFlag()) ||
(bSkipProtect && rSect.IsProtectFlag()) )
// dann diese Section ueberspringen
aTmp = *pNd->EndOfSectionNode();
- bFirst = FALSE;
+ bFirst = sal_False;
}
else if( bFirst )
{
- bFirst = FALSE;
+ bFirst = sal_False;
if( pNd->pStartOfSection->IsSectionNode() )
{
const SwSection& rSect = ((SwSectionNode*)pNd->
@@ -2260,7 +2260,7 @@ SwCntntNode* SwNodes::GoNextSection( SwNodeIndex * pIdx,
}
}
aTmp++;
- bFirst = FALSE;
+ bFirst = sal_False;
}
return 0;
}
@@ -2268,12 +2268,13 @@ SwCntntNode* SwNodes::GoNextSection( SwNodeIndex * pIdx,
SwCntntNode* SwNodes::GoPrevSection( SwNodeIndex * pIdx,
int bSkipHidden, int bSkipProtect ) const
{
- int bFirst = TRUE;
+ int bFirst = sal_True;
SwNodeIndex aTmp( *pIdx );
const SwNode* pNd;
while( aTmp > 0 )
{
- if( ND_ENDNODE == ( pNd = (*this)[aTmp])->GetNodeType() )
+ pNd = & aTmp.GetNode();
+ if (ND_ENDNODE == pNd->GetNodeType())
{
if( pNd->pStartOfSection->IsSectionNode() )
{
@@ -2284,11 +2285,11 @@ SwCntntNode* SwNodes::GoPrevSection( SwNodeIndex * pIdx,
// dann diese Section ueberspringen
aTmp = *pNd->StartOfSectionNode();
}
- bFirst = FALSE;
+ bFirst = sal_False;
}
else if( bFirst )
{
- bFirst = FALSE;
+ bFirst = sal_False;
if( pNd->pStartOfSection->IsSectionNode() )
{
const SwSection& rSect = ((SwSectionNode*)pNd->
@@ -2362,8 +2363,8 @@ SwNode* SwNodes::FindPrvNxtFrmNode( SwNodeIndex& rFrmIdx,
rFrmIdx = aIdx;
// suche nach vorne/hinten nach einem Content Node
- else if( 0 != ( pFrmNd = GoPrevSection( &aIdx, TRUE, FALSE )) &&
- ::CheckNodesRange( aIdx, rFrmIdx, TRUE ) &&
+ else if( 0 != ( pFrmNd = GoPrevSection( &aIdx, sal_True, sal_False )) &&
+ ::CheckNodesRange( aIdx, rFrmIdx, sal_True ) &&
// nach vorne nie aus der Tabelle hinaus!
pFrmNd->FindTableNode() == pTableNd &&
// Bug 37652: nach hinten nie aus der Tabellenzelle hinaus!
@@ -2384,8 +2385,8 @@ SwNode* SwNodes::FindPrvNxtFrmNode( SwNodeIndex& rFrmIdx,
// JP 19.09.93: aber nie die Section dafuer verlassen !!
if( ( pEnd && ( pFrmNd = &aIdx.GetNode())->IsCntntNode() ) ||
- ( 0 != ( pFrmNd = GoNextSection( &aIdx, TRUE, FALSE )) &&
- ::CheckNodesRange( aIdx, rFrmIdx, TRUE ) &&
+ ( 0 != ( pFrmNd = GoNextSection( &aIdx, sal_True, sal_False )) &&
+ ::CheckNodesRange( aIdx, rFrmIdx, sal_True ) &&
( pFrmNd->FindTableNode() == pTableNd &&
// Bug 37652: nach hinten nie aus der Tabellenzelle hinaus!
(!pFrmNd->FindTableNode() || pFrmNd->FindTableBoxStartNode()
@@ -2465,9 +2466,9 @@ struct _TempBigPtrEntry : public BigPtrEntry
};
-void SwNodes::RemoveNode( ULONG nDelPos, ULONG nSz, BOOL bDel )
+void SwNodes::RemoveNode( sal_uLong nDelPos, sal_uLong nSz, sal_Bool bDel )
{
- ULONG nEnd = nDelPos + nSz;
+ sal_uLong nEnd = nDelPos + nSz;
SwNode* pNew = (*this)[ nEnd ];
if( pRoot )
@@ -2475,7 +2476,7 @@ void SwNodes::RemoveNode( ULONG nDelPos, ULONG nSz, BOOL bDel )
SwNodeIndex *p = pRoot;
while( p )
{
- ULONG nIdx = p->GetIndex();
+ sal_uLong nIdx = p->GetIndex();
SwNodeIndex* pNext = p->pNext;
if( nDelPos <= nIdx && nIdx < nEnd )
(*p) = *pNew;
@@ -2486,7 +2487,7 @@ void SwNodes::RemoveNode( ULONG nDelPos, ULONG nSz, BOOL bDel )
p = pRoot->pPrev;
while( p )
{
- ULONG nIdx = p->GetIndex();
+ sal_uLong nIdx = p->GetIndex();
SwNodeIndex* pPrev = p->pPrev;
if( nDelPos <= nIdx && nIdx < nEnd )
(*p) = *pNew;
@@ -2496,7 +2497,7 @@ void SwNodes::RemoveNode( ULONG nDelPos, ULONG nSz, BOOL bDel )
}
{
- for (ULONG nCnt = 0; nCnt < nSz; nCnt++)
+ for (sal_uLong nCnt = 0; nCnt < nSz; nCnt++)
{
SwTxtNode * pTxtNd = ((*this)[ nDelPos + nCnt ])->GetTxtNode();
@@ -2512,7 +2513,7 @@ void SwNodes::RemoveNode( ULONG nDelPos, ULONG nSz, BOOL bDel )
if( bDel )
{
- ULONG nCnt = nSz;
+ sal_uLong nCnt = nSz;
SwNode *pDel = (*this)[ nDelPos+nCnt-1 ], *pPrev = (*this)[ nDelPos+nCnt-2 ];
// temp. Object setzen
@@ -2529,7 +2530,7 @@ void SwNodes::RemoveNode( ULONG nDelPos, ULONG nSz, BOOL bDel )
{
delete pDel;
pDel = pPrev;
- ULONG nPrevNdIdx = pPrev->GetIndex();
+ sal_uLong nPrevNdIdx = pPrev->GetIndex();
BigPtrArray::Replace( nPrevNdIdx+1, pTempEntry );
if( nCnt )
pPrev = (*this)[ nPrevNdIdx - 1 ];
@@ -2584,7 +2585,7 @@ void SwNodes::InsertNode( const SwNodePtr pNode,
}
void SwNodes::InsertNode( const SwNodePtr pNode,
- ULONG nPos )
+ sal_uLong nPos )
{
const ElementPtr pIns = pNode;
BigPtrArray::Insert( pIns, nPos );
@@ -2616,7 +2617,7 @@ SwNode * SwNodes::DocumentSectionEndNode(SwNode * pNode) const
//SwNode * SwNodes::operator[](int n) const
//{
-// return operator[]((ULONG) n);
+// return operator[]((sal_uLong) n);
//}
// <-#112139#
diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx
index 7479335fc535..69160d5603eb 100644
--- a/sw/source/core/docnode/section.cxx
+++ b/sw/source/core/docnode/section.cxx
@@ -29,6 +29,10 @@
#include "precompiled_sw.hxx"
#include <stdlib.h>
+<<<<<<< local
+=======
+
+>>>>>>> other
#include <hintids.hxx>
#include <svl/intitem.hxx>
#include <svl/stritem.hxx>
@@ -44,6 +48,7 @@
#include <fmtpdsc.hxx>
#include <errhdl.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <node.hxx>
#include <pam.hxx>
#include <frmtool.hxx>
@@ -80,7 +85,7 @@ class SwIntrnlSectRefLink : public SwBaseLink
{
SwSectionFmt& rSectFmt;
public:
- SwIntrnlSectRefLink( SwSectionFmt& rFmt, USHORT nUpdateType, USHORT nFmt )
+ SwIntrnlSectRefLink( SwSectionFmt& rFmt, sal_uInt16 nUpdateType, sal_uInt16 nFmt )
: SwBaseLink( nUpdateType, nFmt ),
rSectFmt( rFmt )
{}
@@ -90,7 +95,7 @@ public:
const uno::Any & rValue );
virtual const SwNode* GetAnchor() const;
- virtual BOOL IsInRange( ULONG nSttNd, ULONG nEndNd, xub_StrLen nStt = 0,
+ virtual sal_Bool IsInRange( sal_uLong nSttNd, sal_uLong nEndNd, xub_StrLen nStt = 0,
xub_StrLen nEnd = STRING_NOTFOUND ) const;
// --> OD 2007-02-14 #b6521322#
@@ -272,10 +277,8 @@ SwSection::~SwSection()
{
// Bug: 28191 - nicht ins Undo aufnehmen, sollte schon vorher
// geschehen sein!!
- BOOL bUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
pDoc->DelSectionFmt( pFmt ); // und loeschen
- pDoc->DoUndo( bUndo );
}
}
if (m_RefObj.Is())
@@ -359,15 +362,15 @@ void SwSection::ImplSetHiddenFlag(bool const bTmpHidden, bool const bCondition)
}
}
-BOOL SwSection::CalcHiddenFlag() const
+sal_Bool SwSection::CalcHiddenFlag() const
{
const SwSection* pSect = this;
do {
if( pSect->IsHidden() && pSect->IsCondHidden() )
- return TRUE;
+ return sal_True;
} while( 0 != ( pSect = pSect->GetParent()) );
- return FALSE;
+ return sal_False;
}
bool SwSection::IsProtect() const
@@ -407,7 +410,7 @@ void SwSection::SetProtect(bool const bFlag)
if (pFormat)
{
SvxProtectItem aItem( RES_PROTECT );
- aItem.SetCntntProtect( (BOOL)bFlag );
+ aItem.SetCntntProtect( (sal_Bool)bFlag );
pFormat->SetFmtAttr( aItem );
// note: this will call m_Data.SetProtectFlag via Modify!
}
@@ -425,7 +428,7 @@ void SwSection::SetEditInReadonly(bool const bFlag)
if (pFormat)
{
SwFmtEditInReadonly aItem;
- aItem.SetValue( (BOOL)bFlag );
+ aItem.SetValue( (sal_Bool)bFlag );
pFormat->SetFmtAttr( aItem );
// note: this will call m_Data.SetEditInReadonlyFlag via Modify!
}
@@ -449,7 +452,7 @@ void SwSection::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
const SfxPoolItem* pItem;
if( SFX_ITEM_SET == pNewSet->GetItemState(
- RES_PROTECT, FALSE, &pItem ) )
+ RES_PROTECT, sal_False, &pItem ) )
{
m_Data.SetProtectFlag( static_cast<SvxProtectItem const*>(pItem)
->IsCntntProtected() );
@@ -459,7 +462,7 @@ void SwSection::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
// --> FME 2004-06-22 #114856# edit in readonly sections
if( SFX_ITEM_SET == pNewSet->GetItemState(
- RES_EDIT_IN_READONLY, FALSE, &pItem ) )
+ RES_EDIT_IN_READONLY, sal_False, &pItem ) )
{
m_Data.SetEditInReadonlyFlag(
static_cast<SwFmtEditInReadonly const*>(pItem)->GetValue());
@@ -469,9 +472,9 @@ void SwSection::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
// <--
if( SFX_ITEM_SET == pNewSet->GetItemState(
- RES_FTN_AT_TXTEND, FALSE, &pItem ) ||
+ RES_FTN_AT_TXTEND, sal_False, &pItem ) ||
SFX_ITEM_SET == pNewSet->GetItemState(
- RES_END_AT_TXTEND, FALSE, &pItem ))
+ RES_END_AT_TXTEND, sal_False, &pItem ))
{
bUpdateFtn = true;
}
@@ -555,7 +558,7 @@ void SwSection::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
if( bUpdateFtn )
{
- SwSectionNode* pSectNd = GetFmt()->GetSectionNode( FALSE );
+ SwSectionNode* pSectNd = GetFmt()->GetSectionNode( sal_False );
if( pSectNd )
pSectNd->GetDoc()->GetFtnIdxs().UpdateFtn(SwNodeIndex( *pSectNd ));
}
@@ -635,7 +638,7 @@ void SwSection::MakeChildLinksVisible( const SwSectionNode& rSectNd )
{
const SwNode* pNd;
const ::sfx2::SvBaseLinks& rLnks = rSectNd.GetDoc()->GetLinkManager().GetLinks();
- for( USHORT n = rLnks.Count(); n; )
+ for( sal_uInt16 n = rLnks.Count(); n; )
{
::sfx2::SvBaseLink* pBLnk = &(*rLnks[ --n ]);
if( pBLnk && !pBLnk->IsVisible() &&
@@ -652,7 +655,7 @@ void SwSection::MakeChildLinksVisible( const SwSectionNode& rSectNd )
// steht nur noch in einer normalen Section, also
// wieder anzeigen
if( !pParent )
- pBLnk->SetVisible( TRUE );
+ pBLnk->SetVisible( sal_True );
}
}
}
@@ -680,7 +683,7 @@ SwSectionFmt::~SwSectionFmt()
if( !GetDoc()->IsInDtor() )
{
SwSectionNode* pSectNd;
- const SwNodeIndex* pIdx = GetCntnt( FALSE ).GetCntntIdx();
+ const SwNodeIndex* pIdx = GetCntnt( sal_False ).GetCntntIdx();
if( pIdx && &GetDoc()->GetNodes() == &pIdx->GetNodes() &&
0 != (pSectNd = pIdx->GetNode().GetSectionNode() ))
{
@@ -701,10 +704,26 @@ SwSectionFmt::~SwSectionFmt()
rSect.SetHidden(false);
}
}
+<<<<<<< local
// mba: test iteration; objects are removed while iterating
CallSwClientNotify( SfxSimpleHint(SFX_HINT_DYING) );
+=======
+ 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++;
+ }
+>>>>>>> other
// hebe die Section doch mal auf
SwNodeRange aRg( *pSectNd, 0, *pSectNd->EndOfSectionNode() );
GetDoc()->GetNodes().SectionUp( &aRg );
@@ -718,16 +737,27 @@ SwSectionFmt::~SwSectionFmt()
SwSection * SwSectionFmt::GetSection() const
{
+<<<<<<< local
return SwIterator<SwSection,SwSectionFmt>::FirstElement( *this );
+=======
+ if( GetDepends() )
+ {
+ SwClientIter aIter( *(SwSectionFmt*)this );
+ return (SwSectionPtr)aIter.First( TYPE(SwSection) );
+ }
+
+ ASSERT( sal_False, "keine Section als Client." )
+ return 0;
+>>>>>>> other
}
-extern void lcl_DeleteFtn( SwSectionNode *pNd, ULONG nStt, ULONG nEnd );
+extern void lcl_DeleteFtn( SwSectionNode *pNd, sal_uLong nStt, sal_uLong nEnd );
//Vernichtet alle Frms in aDepend (Frms werden per PTR_CAST erkannt).
void SwSectionFmt::DelFrms()
{
SwSectionNode* pSectNd;
- const SwNodeIndex* pIdx = GetCntnt(FALSE).GetCntntIdx();
+ const SwNodeIndex* pIdx = GetCntnt(sal_False).GetCntntIdx();
if( pIdx && &GetDoc()->GetNodes() == &pIdx->GetNodes() &&
0 != (pSectNd = pIdx->GetNode().GetSectionNode() ))
{
@@ -740,12 +770,41 @@ void SwSectionFmt::DelFrms()
SwSectionFmt *pLast = aIter.First();
while ( pLast )
{
+<<<<<<< local
pLast->DelFrms();
pLast = aIter.Next();
+=======
+ if ( pLast->IsA( TYPE(SwFrm) ) )
+ {
+ SwSectionFrm *pFrm = (SwSectionFrm*)pLast;
+ SwSectionFrm::MoveCntntAndDelete( pFrm, sal_False );
+ pLast = aIter.GoStart();
+ }
+ else
+ {
+ pLast = aIter++;
+ }
+>>>>>>> other
}
+<<<<<<< local
ULONG nEnde = pSectNd->EndOfSectionIndex();
ULONG nStart = pSectNd->GetIndex()+1;
+=======
+ // Then delete frames of the nested <SwSectionFmt> instances
+ pLast = aIter.GoStart();
+ while ( pLast )
+ {
+ if ( pLast->IsA( TYPE(SwSectionFmt) ) )
+ {
+ ((SwSectionFmt*)pLast)->DelFrms();
+ }
+ pLast = aIter++;
+ }
+ // <--
+ sal_uLong nEnde = pSectNd->EndOfSectionIndex();
+ sal_uLong nStart = pSectNd->GetIndex()+1;
+>>>>>>> other
lcl_DeleteFtn( pSectNd, nStart, nEnde );
}
if( pIdx )
@@ -756,7 +815,7 @@ void SwSectionFmt::DelFrms()
//zu weiteren Folgefehlern, die mit Laufzeitkosten geloest werden
//muesten. #56977# #55001# #56135#
SwNodeIndex aNextNd( *pIdx );
- SwCntntNode* pCNd = GetDoc()->GetNodes().GoNextSection( &aNextNd, TRUE, FALSE );
+ SwCntntNode* pCNd = GetDoc()->GetNodes().GoNextSection( &aNextNd, sal_True, sal_False );
if( pCNd )
{
const SfxPoolItem& rItem = pCNd->GetSwAttrSet().Get( RES_PAGEDESC );
@@ -770,7 +829,7 @@ void SwSectionFmt::DelFrms()
void SwSectionFmt::MakeFrms()
{
SwSectionNode* pSectNd;
- const SwNodeIndex* pIdx = GetCntnt(FALSE).GetCntntIdx();
+ const SwNodeIndex* pIdx = GetCntnt(sal_False).GetCntntIdx();
if( pIdx && &GetDoc()->GetNodes() == &pIdx->GetNodes() &&
0 != (pSectNd = pIdx->GetNode().GetSectionNode() ))
@@ -782,8 +841,8 @@ void SwSectionFmt::MakeFrms()
void SwSectionFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
- BOOL bClients = FALSE;
- USHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
+ sal_Bool bClients = sal_False;
+ sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
switch( nWhich )
{
case RES_ATTRSET_CHG:
@@ -793,7 +852,7 @@ void SwSectionFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
SfxItemSet* pOldSet = ((SwAttrSetChg*)pOld)->GetChgSet();
const SfxPoolItem *pItem;
if( SFX_ITEM_SET == pNewSet->GetItemState(
- RES_PROTECT, FALSE, &pItem ))
+ RES_PROTECT, sal_False, &pItem ))
{
ModifyBroadcast( (SfxPoolItem*)pItem, (SfxPoolItem*)pItem );
pNewSet->ClearItem( RES_PROTECT );
@@ -802,7 +861,7 @@ void SwSectionFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
// --> FME 2004-06-22 #114856# edit in readonly sections
if( SFX_ITEM_SET == pNewSet->GetItemState(
- RES_EDIT_IN_READONLY, FALSE, &pItem ) )
+ RES_EDIT_IN_READONLY, sal_False, &pItem ) )
{
ModifyBroadcast( (SfxPoolItem*)pItem, (SfxPoolItem*)pItem );
pNewSet->ClearItem( RES_EDIT_IN_READONLY );
@@ -811,14 +870,14 @@ void SwSectionFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
// <--
if( SFX_ITEM_SET == pNewSet->GetItemState(
- RES_FTN_AT_TXTEND, FALSE, &pItem ))
+ RES_FTN_AT_TXTEND, sal_False, &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, FALSE, &pItem ))
+ RES_END_AT_TXTEND, sal_False, &pItem ))
{
ModifyBroadcast( (SfxPoolItem*)&pOldSet->Get( RES_END_AT_TXTEND ), (SfxPoolItem*)pItem );
pNewSet->ClearItem( RES_END_AT_TXTEND );
@@ -831,7 +890,7 @@ void SwSectionFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
case RES_SECTION_RESETHIDDENFLAG:
case RES_FTN_AT_TXTEND:
- case RES_END_AT_TXTEND : bClients = TRUE;
+ case RES_END_AT_TXTEND : bClients = sal_True;
// no break !!
case RES_SECTION_HIDDEN:
case RES_SECTION_NOT_HIDDEN:
@@ -890,7 +949,7 @@ void SwSectionFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
}
// erfrage vom Format Informationen
-BOOL SwSectionFmt::GetInfo( SfxPoolItem& rInfo ) const
+sal_Bool SwSectionFmt::GetInfo( SfxPoolItem& rInfo ) const
{
switch( rInfo.Which() )
{
@@ -901,7 +960,7 @@ BOOL SwSectionFmt::GetInfo( SfxPoolItem& rInfo ) const
if( pNd )
((SwFindNearestNode&)rInfo).CheckNode( *pNd );
}
- return TRUE;
+ return sal_True;
case RES_CONTENT_VISIBLE:
{
@@ -919,7 +978,7 @@ BOOL SwSectionFmt::GetInfo( SfxPoolItem& rInfo ) const
}
((SwPtrMsgPoolItem&)rInfo).pObject = pFrm;
}
- return FALSE;
+ return sal_False;
}
return SwModify::GetInfo( rInfo );
}
@@ -938,11 +997,11 @@ extern "C" {
const SwSectionFmt* pFSectFmt = (*(SwSectionPtr*)pFirst)->GetFmt();
const SwSectionFmt* pSSectFmt = (*(SwSectionPtr*)pSecond)->GetFmt();
ASSERT( pFSectFmt && pSSectFmt &&
- pFSectFmt->GetCntnt(FALSE).GetCntntIdx() &&
- pSSectFmt->GetCntnt(FALSE).GetCntntIdx(),
+ pFSectFmt->GetCntnt(sal_False).GetCntntIdx() &&
+ pSSectFmt->GetCntnt(sal_False).GetCntntIdx(),
"ungueltige Sections" );
- return (int)((long)pFSectFmt->GetCntnt(FALSE).GetCntntIdx()->GetIndex()) -
- pSSectFmt->GetCntnt(FALSE).GetCntntIdx()->GetIndex();
+ return (int)((long)pFSectFmt->GetCntnt(sal_False).GetCntntIdx()->GetIndex()) -
+ pSSectFmt->GetCntnt(sal_False).GetCntntIdx()->GetIndex();
}
int
@@ -965,9 +1024,9 @@ extern "C" {
}
// alle Sections, die von dieser abgeleitet sind
-USHORT SwSectionFmt::GetChildSections( SwSections& rArr,
+sal_uInt16 SwSectionFmt::GetChildSections( SwSections& rArr,
SectionSort eSort,
- BOOL bAllSections ) const
+ sal_Bool bAllSections ) const
{
rArr.Remove( 0, rArr.Count() );
@@ -977,7 +1036,11 @@ USHORT SwSectionFmt::GetChildSections( SwSections& rArr,
const SwNodeIndex* pIdx;
for( SwSectionFmt* pLast = aIter.First(); pLast; pLast = aIter.Next() )
if( bAllSections ||
+<<<<<<< local
( 0 != ( pIdx = pLast->GetCntnt(FALSE).
+=======
+ ( 0 != ( pIdx = ((SwSectionFmt*)pLast)->GetCntnt(sal_False).
+>>>>>>> other
GetCntntIdx()) && &pIdx->GetNodes() == &GetDoc()->GetNodes() ))
{
const SwSection* Dummy = pLast->GetSection();
@@ -1011,9 +1074,9 @@ USHORT SwSectionFmt::GetChildSections( SwSections& rArr,
// erfrage, ob sich die Section im Nodes-Array oder UndoNodes-Array
// befindet.
-BOOL SwSectionFmt::IsInNodesArr() const
+sal_Bool SwSectionFmt::IsInNodesArr() const
{
- const SwNodeIndex* pIdx = GetCntnt(FALSE).GetCntntIdx();
+ const SwNodeIndex* pIdx = GetCntnt(sal_False).GetCntntIdx();
return pIdx && &pIdx->GetNodes() == &GetDoc()->GetNodes();
}
@@ -1075,7 +1138,7 @@ void SwSectionFmt::UpdateParent() // Parent wurde veraendert
if( bIsHidden == pSection->IsHiddenFlag() )
{
- SwMsgPoolItem aMsgItem( static_cast<USHORT>(bIsHidden
+ SwMsgPoolItem aMsgItem( static_cast<sal_uInt16>(bIsHidden
? RES_SECTION_HIDDEN
: RES_SECTION_NOT_HIDDEN ) );
pLast->ModifyNotification( &aMsgItem, &aMsgItem );
@@ -1109,7 +1172,7 @@ void SwSectionFmt::UpdateParent() // Parent wurde veraendert
SwSectionNode* SwSectionFmt::GetSectionNode(bool const bAlways)
{
- const SwNodeIndex* pIdx = GetCntnt(FALSE).GetCntntIdx();
+ const SwNodeIndex* pIdx = GetCntnt(sal_False).GetCntntIdx();
if( pIdx && ( bAlways || &pIdx->GetNodes() == &GetDoc()->GetNodes() ))
return pIdx->GetNode().GetSectionNode();
return 0;
@@ -1147,7 +1210,7 @@ bool SwSectionFmt::IsInUndo() const
bool SwSectionFmt::IsInContent() const
{
- SwNodeIndex const*const pIdx = GetCntnt(FALSE).GetCntntIdx();
+ SwNodeIndex const*const pIdx = GetCntnt(sal_False).GetCntntIdx();
OSL_ENSURE(pIdx, "SwSectionFmt::IsInContent: no index?");
return (pIdx) ? !GetDoc()->IsInHeaderFooter(*pIdx) : true;
}
@@ -1191,7 +1254,7 @@ void lcl_BreakSectionLinksInSect( const SwSectionNode& rSectNd )
}
const ::sfx2::SvBaseLink* pOwnLink( &(rSectNd.GetSection().GetBaseLink() ) );
const ::sfx2::SvBaseLinks& rLnks = rSectNd.GetDoc()->GetLinkManager().GetLinks();
- for ( USHORT n = rLnks.Count(); n > 0; )
+ for ( sal_uInt16 n = rLnks.Count(); n > 0; )
{
SwIntrnlSectRefLink* pSectLnk = dynamic_cast<SwIntrnlSectRefLink*>(&(*rLnks[ --n ]));
if ( pSectLnk && pSectLnk != pOwnLink &&
@@ -1225,7 +1288,7 @@ void lcl_UpdateLinksInSect( SwBaseLink& rUpdLnk, SwSectionNode& rSectNd )
aValue <<= ::rtl::OUString( sName ); // beliebiger Name
const ::sfx2::SvBaseLinks& rLnks = pDoc->GetLinkManager().GetLinks();
- for( USHORT n = rLnks.Count(); n; )
+ for( sal_uInt16 n = rLnks.Count(); n; )
{
::sfx2::SvBaseLink* pLnk = &(*rLnks[ --n ]);
if( pLnk && pLnk != &rUpdLnk &&
@@ -1264,13 +1327,14 @@ void lcl_UpdateLinksInSect( SwBaseLink& rUpdLnk, SwSectionNode& rSectNd )
// Der Return-Wert gibt an, was mit der Shell zu geschehen hat:
// 0 - Fehler, konnte DocShell nicht finden
// 1 - DocShell ist ein existieren Document
-// 2 - DocShell wurde neu angelegt, muss also wieder geschlossen werden
+// 2 - DocShell wurde neu angelegt, muss also wieder geschlossen werden ( will be assigned to xLockRef additionaly )
int lcl_FindDocShell( SfxObjectShellRef& xDocSh,
+ SfxObjectShellLock& xLockRef,
const String& rFileName,
const String& rPasswd,
String& rFilter,
- INT16 nVersion,
+ sal_Int16 nVersion,
SwDocShell* pDestSh )
{
if( !rFileName.Len() )
@@ -1285,7 +1349,7 @@ int lcl_FindDocShell( SfxObjectShellRef& xDocSh,
TypeId aType( TYPE(SwDocShell) );
SfxObjectShell* pShell = pDestSh;
- BOOL bFirst = 0 != pShell;
+ sal_Bool bFirst = 0 != pShell;
if( !bFirst )
// keine DocShell uebergeben, also beginne mit der ersten aus der
@@ -1300,7 +1364,7 @@ int lcl_FindDocShell( SfxObjectShellRef& xDocSh,
{
const SfxPoolItem* pItem;
if( ( SFX_ITEM_SET == pMed->GetItemSet()->GetItemState(
- SID_VERSION, FALSE, &pItem ) )
+ SID_VERSION, sal_False, &pItem ) )
? (nVersion == ((SfxInt16Item*)pItem)->GetValue())
: !nVersion )
{
@@ -1312,7 +1376,7 @@ int lcl_FindDocShell( SfxObjectShellRef& xDocSh,
if( bFirst )
{
- bFirst = FALSE;
+ bFirst = sal_False;
pShell = SfxObjectShell::GetFirst( &aType );
}
else
@@ -1321,7 +1385,7 @@ int lcl_FindDocShell( SfxObjectShellRef& xDocSh,
// 2. selbst die Date oeffnen
SfxMedium* pMed = new SfxMedium( aTmpObj.GetMainURL(
- INetURLObject::NO_DECODE ), STREAM_READ, TRUE );
+ INetURLObject::NO_DECODE ), STREAM_READ, sal_True );
if( INET_PROT_FILE == aTmpObj.GetProtocol() )
pMed->DownLoad(); // nur mal das Medium anfassen (DownLoaden)
@@ -1345,14 +1409,16 @@ int lcl_FindDocShell( SfxObjectShellRef& xDocSh,
pMed->GetItemSet()->Put( SfxStringItem( SID_PASSWORD, rPasswd ));
if( !pSfxFlt )
- aMatcher.DetectFilter( *pMed, &pSfxFlt, FALSE, FALSE );
+ aMatcher.DetectFilter( *pMed, &pSfxFlt, sal_False, sal_False );
if( pSfxFlt )
{
// ohne Filter geht gar nichts
pMed->SetFilter( pSfxFlt );
- xDocSh = new SwDocShell( SFX_CREATE_MODE_INTERNAL );
+ // if the new shell is created, SfxObjectShellLock should be used to let it be closed later for sure
+ xLockRef = new SwDocShell( SFX_CREATE_MODE_INTERNAL );
+ xDocSh = (SfxObjectShell*)xLockRef;
if( xDocSh->DoLoad( pMed ) )
return 2;
}
@@ -1368,10 +1434,10 @@ int lcl_FindDocShell( SfxObjectShellRef& xDocSh,
void SwIntrnlSectRefLink::DataChanged( const String& rMimeType,
const uno::Any & rValue )
{
- SwSectionNode* pSectNd = rSectFmt.GetSectionNode( FALSE );
+ SwSectionNode* pSectNd = rSectFmt.GetSectionNode( sal_False );
SwDoc* pDoc = rSectFmt.GetDoc();
- ULONG nDataFormat = SotExchange::GetFormatIdFromMimeType( rMimeType );
+ sal_uLong nDataFormat = SotExchange::GetFormatIdFromMimeType( rMimeType );
if( !pSectNd || !pDoc || pDoc->IsInDtor() || ChkNoDataFlag() ||
sfx2::LinkManager::RegisterStatusInfoId() == nDataFormat )
@@ -1389,10 +1455,10 @@ void SwIntrnlSectRefLink::DataChanged( const String& rMimeType,
// <--
// Undo immer abschalten
- BOOL bWasUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
- BOOL bWasVisibleLinks = pDoc->IsVisibleLinks();
- pDoc->SetVisibleLinks( FALSE );
+ bool const bWasUndo = pDoc->GetIDocumentUndoRedo().DoesUndo();
+ pDoc->GetIDocumentUndoRedo().DoUndo(false);
+ sal_Bool bWasVisibleLinks = pDoc->IsVisibleLinks();
+ pDoc->SetVisibleLinks( sal_False );
SwPaM* pPam;
ViewShell* pVSh = 0;
@@ -1412,7 +1478,7 @@ void SwIntrnlSectRefLink::DataChanged( const String& rMimeType,
SwPosition aPos( aIdx, SwIndex( pNewNd, 0 ));
aPos.nNode--;
- pDoc->CorrAbs( aIdx, aEndIdx, aPos, TRUE );
+ pDoc->CorrAbs( aIdx, aEndIdx, aPos, sal_True );
pPam = new SwPaM( aPos );
@@ -1449,6 +1515,7 @@ void SwIntrnlSectRefLink::DataChanged( const String& rMimeType,
RedlineMode_t eOldRedlineMode = nsRedlineMode_t::REDLINE_NONE;
SfxObjectShellRef xDocSh;
+ SfxObjectShellLock xLockRef;
int nRet;
if( !sFileName.Len() )
{
@@ -1457,7 +1524,7 @@ void SwIntrnlSectRefLink::DataChanged( const String& rMimeType,
}
else
{
- nRet = lcl_FindDocShell( xDocSh, sFileName,
+ nRet = lcl_FindDocShell( xDocSh, xLockRef, sFileName,
rSection.GetLinkFilePassword(),
sFilter, 0, pDoc->GetDocShell() );
if( nRet )
@@ -1480,7 +1547,7 @@ void SwIntrnlSectRefLink::DataChanged( const String& rMimeType,
{
const SfxPoolItem* pItem;
if( SFX_ITEM_SET == xDocSh->GetMedium()->GetItemSet()->
- GetItemState( SID_PASSWORD, FALSE, &pItem ) )
+ GetItemState( SID_PASSWORD, sal_False, &pItem ) )
rSection.SetLinkFilePassword(
((SfxStringItem*)pItem)->GetValue() );
}
@@ -1490,7 +1557,7 @@ void SwIntrnlSectRefLink::DataChanged( const String& rMimeType,
if( sRange.Len() )
{
// Rekursionen abfangen
- BOOL bRecursion = FALSE;
+ sal_Bool bRecursion = sal_False;
if( pSrcDoc == pDoc )
{
SwServerObjectRef refObj( (SwServerObject*)
@@ -1532,13 +1599,13 @@ void SwIntrnlSectRefLink::DataChanged( const String& rMimeType,
if ( pSrcDoc != pDoc &&
rSection.IsProtectFlag() )
{
- pSrcDoc->GetLinkManager().UpdateAllLinks( FALSE, TRUE, FALSE, 0 );
+ pSrcDoc->GetLinkManager().UpdateAllLinks( sal_False, sal_True, sal_False, 0 );
}
// <--
if( pCpyRg )
{
SwNodeIndex& rInsPos = pPam->GetPoint()->nNode;
- BOOL bCreateFrm = rInsPos.GetIndex() <=
+ sal_Bool bCreateFrm = rInsPos.GetIndex() <=
pDoc->GetNodes().GetEndOfExtras().GetIndex() ||
rInsPos.GetNode().FindTableNode();
@@ -1559,7 +1626,7 @@ void SwIntrnlSectRefLink::DataChanged( const String& rMimeType,
pPam->Move( fnMoveBackward, fnGoNode );
pPam->SetMark(); // beide SwPositions ummelden!
- pDoc->CorrAbs( aSave, *pPam->GetPoint(), 0, TRUE );
+ pDoc->CorrAbs( aSave, *pPam->GetPoint(), 0, sal_True );
pDoc->GetNodes().Delete( aSave, 1 );
}
delete pCpyRg;
@@ -1620,15 +1687,15 @@ void SwIntrnlSectRefLink::DataChanged( const String& rMimeType,
if( pESh )
{
- pESh->Pop( FALSE );
+ pESh->Pop( sal_False );
pPam = 0; // pam is deleted before
}
}
- // Alle UndoActions entfernen und Undo wieder einschalten
- pDoc->DelAllUndoObj();
- pDoc->DoUndo( bWasUndo );
+ // remove all undo actions and turn undo on again
+ pDoc->GetIDocumentUndoRedo().DelAllUndoObj();
+ pDoc->GetIDocumentUndoRedo().DoUndo(bWasUndo);
pDoc->SetVisibleLinks( bWasVisibleLinks );
pDoc->UnlockExpFlds();
@@ -1652,7 +1719,7 @@ void SwIntrnlSectRefLink::Closed()
// kennzeichnen und das Flag umsetzen
const SwSectionFmts& rFmts = pDoc->GetSections();
- for( USHORT n = rFmts.Count(); n; )
+ for( sal_uInt16 n = rFmts.Count(); n; )
if( rFmts[ --n ] == &rSectFmt )
{
ViewShell* pSh;
@@ -1677,7 +1744,7 @@ void SwIntrnlSectRefLink::Closed()
pDoc->UpdateSection( n, aSectionData );
// alle in der Section liegenden Links werden sichtbar
- SwSectionNode* pSectNd = rSectFmt.GetSectionNode( FALSE );
+ SwSectionNode* pSectNd = rSectFmt.GetSectionNode( sal_False );
if( pSectNd )
pSectNd->GetSection().MakeChildLinksVisible( *pSectNd );
@@ -1699,7 +1766,7 @@ void SwSection::CreateLink( LinkCreateType eCreateType )
if (!pFmt || (CONTENT_SECTION == m_Data.GetType()))
return ;
- USHORT nUpdateType = sfx2::LINKUPDATE_ALWAYS;
+ sal_uInt16 nUpdateType = sfx2::LINKUPDATE_ALWAYS;
if (!m_RefLink.Is())
{
@@ -1734,7 +1801,7 @@ void SwSection::CreateLink( LinkCreateType eCreateType )
String sFltr( sCmd.GetToken( 1, sfx2::cTokenSeperator ) );
String sRange( sCmd.GetToken( 2, sfx2::cTokenSeperator ) );
pFmt->GetDoc()->GetLinkManager().InsertFileLink( *pLnk,
- static_cast<USHORT>(m_Data.GetType()),
+ static_cast<sal_uInt16>(m_Data.GetType()),
sCmd.GetToken( 0, sfx2::cTokenSeperator ),
( sFltr.Len() ? &sFltr : 0 ),
( sRange.Len() ? &sRange : 0 ) );
@@ -1790,14 +1857,14 @@ void SwSection::BreakLink()
const SwNode* SwIntrnlSectRefLink::GetAnchor() const
{
- return rSectFmt.GetSectionNode( FALSE );
+ return rSectFmt.GetSectionNode( sal_False );
}
-BOOL SwIntrnlSectRefLink::IsInRange( ULONG nSttNd, ULONG nEndNd,
+sal_Bool SwIntrnlSectRefLink::IsInRange( sal_uLong nSttNd, sal_uLong nEndNd,
xub_StrLen , xub_StrLen ) const
{
- SwStartNode* pSttNd = rSectFmt.GetSectionNode( FALSE );
+ SwStartNode* pSttNd = rSectFmt.GetSectionNode( sal_False );
return pSttNd &&
nSttNd < pSttNd->GetIndex() &&
pSttNd->EndOfSectionIndex() < nEndNd;
diff --git a/sw/source/core/docnode/swbaslnk.cxx b/sw/source/core/docnode/swbaslnk.cxx
index 5dc653e18e63..5ca378199a64 100644
--- a/sw/source/core/docnode/swbaslnk.cxx
+++ b/sw/source/core/docnode/swbaslnk.cxx
@@ -66,7 +66,7 @@
using namespace com::sun::star;
-BOOL SetGrfFlySize( const Size& rGrfSz, const Size& rFrmSz, SwGrfNode* pGrfNd );
+sal_Bool SetGrfFlySize( const Size& rGrfSz, const Size& rFrmSz, SwGrfNode* pGrfNd );
TYPEINIT1( SwBaseLink, ::sfx2::SvBaseLink );
@@ -108,11 +108,11 @@ void SwBaseLink::DataChanged( const String& rMimeType,
SwDoc* pDoc = pCntntNode->GetDoc();
if( pDoc->IsInDtor() || ChkNoDataFlag() || bIgnoreDataChanged )
{
- bIgnoreDataChanged = FALSE;
+ bIgnoreDataChanged = sal_False;
return ;
}
- ULONG nFmt = SotExchange::GetFormatIdFromMimeType( rMimeType );
+ sal_uLong nFmt = SotExchange::GetFormatIdFromMimeType( rMimeType );
if( pCntntNode->IsNoTxtNode() &&
nFmt == sfx2::LinkManager::RegisterStatusInfoId() )
@@ -121,7 +121,7 @@ void SwBaseLink::DataChanged( const String& rMimeType,
::rtl::OUString sState;
if( rValue.hasValue() && ( rValue >>= sState ))
{
- USHORT nEvent = 0;
+ sal_uInt16 nEvent = 0;
switch( sState.toInt32() )
{
case sfx2::LinkManager::STATE_LOAD_OK: nEvent = SVX_EVENT_IMAGE_LOAD; break;
@@ -140,10 +140,10 @@ void SwBaseLink::DataChanged( const String& rMimeType,
return; // das wars!
}
- BOOL bUpdate = FALSE;
- BOOL bGraphicArrived = FALSE;
- BOOL bGraphicPieceArrived = FALSE;
- BOOL bDontNotify = FALSE;
+ sal_Bool bUpdate = sal_False;
+ sal_Bool bGraphicArrived = sal_False;
+ sal_Bool bGraphicPieceArrived = sal_False;
+ sal_Bool bDontNotify = sal_False;
Size aGrfSz, aFrmFmtSz;
if( pCntntNode->IsGrfNode() )
@@ -183,12 +183,12 @@ void SwBaseLink::DataChanged( const String& rMimeType,
// gesetzt ist, dann muss "unten" der Teil von
// bGraphicArrived durchlaufen werden!
// (ansonten wird die Grafik in deft. Size gepaintet)
- bGraphicArrived = TRUE;
- bGraphicPieceArrived = FALSE;
+ bGraphicArrived = sal_True;
+ bGraphicPieceArrived = sal_False;
}
rGrfObj.SetGraphic( aGrf, rGrfObj.GetLink() );
- bUpdate = TRUE;
+ bUpdate = sal_True;
// Bug 33999: damit der Node den Transparent-Status
// richtig gesetzt hat, ohne auf die Grafik
@@ -207,7 +207,7 @@ void SwBaseLink::DataChanged( const String& rMimeType,
((SwGrfNode*)pCntntNode)->SetTwipSize( Size(0,0) );
}
else if( pCntntNode->IsOLENode() )
- bUpdate = TRUE;
+ bUpdate = sal_True;
ViewShell *pSh = 0;
SwEditShell* pESh = pDoc->GetEditShell( &pSh );
@@ -218,20 +218,25 @@ void SwBaseLink::DataChanged( const String& rMimeType,
if ( (!pSh || !pSh->ActionPend()) && (!pESh || !pESh->ActionPend()) )
{
SwMsgPoolItem aMsgHint( RES_GRAPHIC_PIECE_ARRIVED );
+<<<<<<< local
pCntntNode->ModifyNotification( &aMsgHint, &aMsgHint );
bUpdate = FALSE;
+=======
+ pCntntNode->Modify( &aMsgHint, &aMsgHint );
+ bUpdate = sal_False;
+>>>>>>> other
}
}
- static BOOL bInNotifyLinks = FALSE;
+ static sal_Bool bInNotifyLinks = sal_False;
if( bUpdate && !bDontNotify && (!bSwapIn || bGraphicArrived) &&
!bInNotifyLinks)
{
- BOOL bLockView = FALSE;
+ sal_Bool bLockView = sal_False;
if( pSh )
{
bLockView = pSh->IsViewLocked();
- pSh->LockView( TRUE );
+ pSh->LockView( sal_True );
}
if( pESh )
@@ -239,16 +244,16 @@ void SwBaseLink::DataChanged( const String& rMimeType,
else if( pSh )
pSh->StartAction();
- SwMsgPoolItem aMsgHint( static_cast<USHORT>(
+ SwMsgPoolItem aMsgHint( static_cast<sal_uInt16>(
bGraphicArrived ? RES_GRAPHIC_ARRIVED : RES_UPDATE_ATTR ) );
if ( bGraphicArrived )
{
//Alle benachrichtigen, die am gleichen Link horchen.
- bInNotifyLinks = TRUE;
+ bInNotifyLinks = sal_True;
const ::sfx2::SvBaseLinks& rLnks = pDoc->GetLinkManager().GetLinks();
- for( USHORT n = rLnks.Count(); n; )
+ for( sal_uInt16 n = rLnks.Count(); n; )
{
::sfx2::SvBaseLink* pLnk = &(*rLnks[ --n ]);
if( pLnk && OBJECT_CLIENT_GRF == pLnk->GetObjType() &&
@@ -261,9 +266,9 @@ void SwBaseLink::DataChanged( const String& rMimeType,
( !bSwapIn ||
GRAPHIC_DEFAULT == pGrfNd->GetGrfObj().GetType()))
{
- pBLink->bIgnoreDataChanged = FALSE;
+ pBLink->bIgnoreDataChanged = sal_False;
pBLink->DataChanged( rMimeType, rValue );
- pBLink->bIgnoreDataChanged = TRUE;
+ pBLink->bIgnoreDataChanged = sal_True;
pGrfNd->SetGrafikArrived( ((SwGrfNode*)pCntntNode)->
IsGrafikArrived() );
@@ -279,7 +284,7 @@ void SwBaseLink::DataChanged( const String& rMimeType,
}
}
- bInNotifyLinks = FALSE;
+ bInNotifyLinks = sal_False;
}
else
{
@@ -289,8 +294,8 @@ void SwBaseLink::DataChanged( const String& rMimeType,
if( pESh )
{
- const BOOL bEndActionByVirDev = pESh->IsEndActionByVirDev();
- pESh->SetEndActionByVirDev( TRUE );
+ const sal_Bool bEndActionByVirDev = pESh->IsEndActionByVirDev();
+ pESh->SetEndActionByVirDev( sal_True );
pESh->EndAllAction();
pESh->SetEndActionByVirDev( bEndActionByVirDev );
}
@@ -298,13 +303,13 @@ void SwBaseLink::DataChanged( const String& rMimeType,
pSh->EndAction();
if( pSh && !bLockView )
- pSh->LockView( FALSE );
+ pSh->LockView( sal_False );
}
}
-BOOL SetGrfFlySize( const Size& rGrfSz, const Size& rFrmSz, SwGrfNode* pGrfNd )
+sal_Bool SetGrfFlySize( const Size& rGrfSz, const Size& rFrmSz, SwGrfNode* pGrfNd )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
ViewShell *pSh;
CurrShell *pCurr = 0;
if ( pGrfNd->GetDoc()->GetEditShell( &pSh ) )
@@ -342,7 +347,7 @@ BOOL SetGrfFlySize( const Size& rGrfSz, const Size& rFrmSz, SwGrfNode* pGrfNd )
SwFmtFrmSize aAttr( rOldAttr );
aAttr.SetSize( aCalcSz );
pFmt->SetFmtAttr( aAttr );
- bRet = TRUE;
+ bRet = sal_True;
}
if( !aSz.Width() )
@@ -354,19 +359,19 @@ BOOL SetGrfFlySize( const Size& rGrfSz, const Size& rFrmSz, SwGrfNode* pGrfNd )
SwNode *pANd;
SwTableNode *pTblNd;
if( pAPos &&
- 0 != (pANd = pDoc->GetNodes()[pAPos->nNode]) &&
+ 0 != (pANd = & pAPos->nNode.GetNode()) &&
0 != (pTblNd = pANd->FindTableNode()) )
{
- const BOOL bLastGrf = !pTblNd->GetTable().DecGrfsThatResize();
+ const sal_Bool bLastGrf = !pTblNd->GetTable().DecGrfsThatResize();
SwHTMLTableLayout *pLayout =
pTblNd->GetTable().GetHTMLTableLayout();
if( pLayout )
{
- const USHORT nBrowseWidth =
+ const sal_uInt16 nBrowseWidth =
pLayout->GetBrowseWidthByTable( *pDoc );
if ( nBrowseWidth )
{
- pLayout->Resize( nBrowseWidth, TRUE, TRUE,
+ pLayout->Resize( nBrowseWidth, sal_True, sal_True,
bLastGrf ? HTMLTABLE_RESIZE_NOW
: 500 );
}
@@ -386,11 +391,11 @@ BOOL SetGrfFlySize( const Size& rGrfSz, const Size& rFrmSz, SwGrfNode* pGrfNd )
}
-BOOL SwBaseLink::SwapIn( BOOL bWaitForData, BOOL bNativFormat )
+sal_Bool SwBaseLink::SwapIn( sal_Bool bWaitForData, sal_Bool bNativFormat )
{
- bSwapIn = TRUE;
+ bSwapIn = sal_True;
- BOOL bRes;
+ sal_Bool bRes;
if( !GetObj() && ( bNativFormat || ( !IsSynchron() && bWaitForData ) ))
{
@@ -418,27 +423,43 @@ BOOL SwBaseLink::SwapIn( BOOL bWaitForData, BOOL bNativFormat )
if( bWaitForData && !GetObj() )
{
ASSERT( !this, "das SvxFileObject wurde in einem GetData geloescht!" );
- bRes = FALSE;
+ bRes = sal_False;
}
else if( 0 != ( bRes = aValue.hasValue() ) )
{
//JP 14.04.99: Bug 64820 - das Flag muss beim SwapIn natuerlich
// zurueckgesetzt werden. Die Daten sollen ja neu
// uebernommen werden
- bIgnoreDataChanged = FALSE;
+ bIgnoreDataChanged = sal_False;
DataChanged( aMimeType, aValue );
}
}
else if( !IsSynchron() && bWaitForData )
{
- SetSynchron( TRUE );
+ SetSynchron( sal_True );
bRes = Update();
- SetSynchron( FALSE );
+ SetSynchron( sal_False );
}
else
bRes = Update();
+<<<<<<< local
bSwapIn = FALSE;
+=======
+ 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();
+// // <--
+// }
+ // <--
+>>>>>>> other
return bRes;
}
@@ -478,7 +499,7 @@ const SwNode* SwBaseLink::GetAnchor() const
return 0;
}
-BOOL SwBaseLink::IsRecursion( const SwBaseLink* pChkLnk ) const
+sal_Bool SwBaseLink::IsRecursion( const SwBaseLink* pChkLnk ) const
{
SwServerObjectRef aRef( (SwServerObject*)GetObj() );
if( aRef.Is() )
@@ -488,14 +509,14 @@ BOOL SwBaseLink::IsRecursion( const SwBaseLink* pChkLnk ) const
// handelt es sich um eine Rekursion.
return aRef->IsLinkInServer( pChkLnk );
}
- return FALSE;
+ return sal_False;
}
-BOOL SwBaseLink::IsInRange( ULONG, ULONG, xub_StrLen, xub_StrLen ) const
+sal_Bool SwBaseLink::IsInRange( sal_uLong, sal_uLong, xub_StrLen, xub_StrLen ) const
{
// Grafik oder OLE-Links nicht,
// Felder oder Sections haben eigene Ableitung!
- return FALSE;
+ return sal_False;
}
SwBaseLink::~SwBaseLink()
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index 44643550139f..588deed2e69a 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -181,8 +181,8 @@ SwContact* GetUserCall( const SdrObject* pObj )
return static_cast<SwContact*>(pObj->GetUserCall());
}
-// liefert TRUE falls das SrdObject ein Marquee-Object (Lauftext) ist
-BOOL IsMarqueeTextObj( const SdrObject& rObj )
+// liefert sal_True falls das SrdObject ein Marquee-Object (Lauftext) ist
+sal_Bool IsMarqueeTextObj( const SdrObject& rObj )
{
SdrTextAniKind eTKind;
return SdrInventor == rObj.GetObjInventor() &&
@@ -253,7 +253,7 @@ void SwContact::MoveObjToVisibleLayer( SdrObject* _pDrawObj )
if ( pAnchoredObj->GetPageFrm() )
{
::Notify_Background( _pDrawObj, pAnchoredObj->GetPageFrm(),
- pAnchoredObj->GetObjRect(), PREP_FLY_ARRIVE, TRUE );
+ pAnchoredObj->GetObjRect(), PREP_FLY_ARRIVE, sal_True );
}
pAnchoredObj->InvalidateObjPos();
@@ -287,7 +287,7 @@ void SwContact::MoveObjToInvisibleLayer( SdrObject* _pDrawObj )
if ( pAnchoredObj && pAnchoredObj->GetPageFrm() )
{
::Notify_Background( _pDrawObj, pAnchoredObj->GetPageFrm(),
- pAnchoredObj->GetObjRect(), PREP_FLY_LEAVE, TRUE );
+ pAnchoredObj->GetObjRect(), PREP_FLY_LEAVE, sal_True );
}
}
// <--
@@ -366,7 +366,7 @@ void SwContact::_MoveObjToLayer( const bool _bToVisible,
static_cast<SdrObjGroup*>(_pDrawObj)->GetSubList();
if ( pLst )
{
- for ( USHORT i = 0; i < pLst->GetObjCount(); ++i )
+ for ( sal_uInt16 i = 0; i < pLst->GetObjCount(); ++i )
{
_MoveObjToLayer( _bToVisible, pLst->GetObj( i ) );
}
@@ -546,6 +546,91 @@ void SwFlyDrawContact::SetMaster( SdrObject* _pNewMaster )
/*************************************************************************
|*
+<<<<<<< local
+=======
+|* 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;
+}
+
+/*************************************************************************
+|*
+>>>>>>> other
|* SwFlyDrawContact::Modify()
|*
|* Ersterstellung OK 08.11.94 10:21
@@ -656,7 +741,7 @@ bool CheckControlLayer( const SdrObject *pObj )
if ( pObj->ISA( SdrObjGroup ) )
{
const SdrObjList *pLst = ((SdrObjGroup*)pObj)->GetSubList();
- for ( USHORT i = 0; i < pLst->GetObjCount(); ++i )
+ for ( sal_uInt16 i = 0; i < pLst->GetObjCount(); ++i )
{
if ( ::CheckControlLayer( pLst->GetObj( i ) ) )
{
@@ -677,7 +762,7 @@ SwDrawContact::SwDrawContact( SwFrmFmt* pToRegisterIn, SdrObject* pObj ) :
// --> OD 2006-01-18 #129959#
mbUserCallActive( false ),
// Note: value of <meEventTypeOfCurrentUserCall> isn't of relevance, because
- // <mbUserCallActive> is FALSE.
+ // <mbUserCallActive> is sal_False.
meEventTypeOfCurrentUserCall( SDRUSERCALL_MOVEONLY )
// <--
{
@@ -1093,7 +1178,7 @@ void SwDrawContact::NotifyBackgrdOfAllVirtObjs( const Rectangle* pOldBoundRect )
aOldRect.Pos() += pDrawVirtObj->GetOffset();
if( aOldRect.HasArea() )
::Notify_Background( pDrawVirtObj, pPage,
- aOldRect, PREP_FLY_LEAVE,TRUE);
+ aOldRect, PREP_FLY_LEAVE,sal_True);
}
// --> OD 2004-10-21 #i34640# - include spacing for wrapping
SwRect aRect( pDrawVirtObj->GetAnchoredObj()->GetObjRectWithSpaces() );
@@ -1105,7 +1190,7 @@ void SwDrawContact::NotifyBackgrdOfAllVirtObjs( const Rectangle* pOldBoundRect )
// <--
if ( pPg )
::Notify_Background( pDrawVirtObj, pPg, aRect,
- PREP_FLY_ARRIVE, TRUE );
+ PREP_FLY_ARRIVE, sal_True );
}
::ClrContourCache( pDrawVirtObj );
}
@@ -1135,7 +1220,7 @@ void lcl_NotifyBackgroundOfObj( SwDrawContact& _rDrawContact,
SwPageFrm* pOldPageFrm = (SwPageFrm*)::FindPage( aOldRect, pPageFrm );
// <--
::Notify_Background( &_rObj, pOldPageFrm, aOldRect,
- PREP_FLY_LEAVE, TRUE);
+ PREP_FLY_LEAVE, sal_True);
}
}
// --> OD 2004-10-21 #i34640# - include spacing for wrapping
@@ -1145,7 +1230,7 @@ void lcl_NotifyBackgroundOfObj( SwDrawContact& _rDrawContact,
{
pPageFrm = (SwPageFrm*)::FindPage( aNewRect, pPageFrm );
::Notify_Background( &_rObj, pPageFrm, aNewRect,
- PREP_FLY_ARRIVE, TRUE );
+ PREP_FLY_ARRIVE, sal_True );
}
ClrContourCache( &_rObj );
}
@@ -1548,12 +1633,12 @@ namespace
{
static const SwFmtAnchor* lcl_getAnchorFmt( const SfxPoolItem& _rItem )
{
- USHORT nWhich = _rItem.Which();
+ sal_uInt16 nWhich = _rItem.Which();
const SwFmtAnchor* pAnchorFmt = NULL;
if ( RES_ATTRSET_CHG == nWhich )
{
static_cast<const SwAttrSetChg&>(_rItem).GetChgSet()->
- GetItemState( RES_ANCHOR, FALSE, (const SfxPoolItem**)&pAnchorFmt );
+ GetItemState( RES_ANCHOR, sal_False, (const SfxPoolItem**)&pAnchorFmt );
}
else if ( RES_ANCHOR == nWhich )
{
@@ -1578,14 +1663,14 @@ void SwDrawContact::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
ASSERT( !mbDisconnectInProgress,
"<SwDrawContact::Modify(..)> called during disconnection.");
- USHORT nWhich = pNew ? pNew->Which() : 0;
+ sal_uInt16 nWhich = pNew ? pNew->Which() : 0;
const SwFmtAnchor* pNewAnchorFmt = pNew ? lcl_getAnchorFmt( *pNew ) : NULL;
if ( pNewAnchorFmt )
{
// JP 10.04.95: nicht auf ein Reset Anchor reagieren !!!!!
if ( SFX_ITEM_SET ==
- GetFmt()->GetAttrSet().GetItemState( RES_ANCHOR, FALSE ) )
+ GetFmt()->GetAttrSet().GetItemState( RES_ANCHOR, sal_False ) )
{
// OD 10.10.2003 #112299# - no connect to layout during disconnection
if ( !mbDisconnectInProgress )
@@ -1639,11 +1724,11 @@ void SwDrawContact::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
RES_WRAP_INFLUENCE_ON_OBJPOS == nWhich ||
( RES_ATTRSET_CHG == nWhich &&
( SFX_ITEM_SET == ((SwAttrSetChg*)pNew)->GetChgSet()->GetItemState(
- RES_SURROUND, FALSE ) ||
+ RES_SURROUND, sal_False ) ||
SFX_ITEM_SET == ((SwAttrSetChg*)pNew)->GetChgSet()->GetItemState(
- RES_OPAQUE, FALSE ) ||
+ RES_OPAQUE, sal_False ) ||
SFX_ITEM_SET == ((SwAttrSetChg*)pNew)->GetChgSet()->GetItemState(
- RES_WRAP_INFLUENCE_ON_OBJPOS, FALSE ) ) ) )
+ RES_WRAP_INFLUENCE_ON_OBJPOS, sal_False ) ) ) )
{
lcl_NotifyBackgroundOfObj( *this, *GetMaster(), 0L );
NotifyBackgrdOfAllVirtObjs( 0L );
@@ -1655,15 +1740,15 @@ void SwDrawContact::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
RES_FOLLOW_TEXT_FLOW == nWhich ||
( RES_ATTRSET_CHG == nWhich &&
( SFX_ITEM_SET == ((SwAttrSetChg*)pNew)->GetChgSet()->GetItemState(
- RES_LR_SPACE, FALSE ) ||
+ RES_LR_SPACE, sal_False ) ||
SFX_ITEM_SET == ((SwAttrSetChg*)pNew)->GetChgSet()->GetItemState(
- RES_UL_SPACE, FALSE ) ||
+ RES_UL_SPACE, sal_False ) ||
SFX_ITEM_SET == ((SwAttrSetChg*)pNew)->GetChgSet()->GetItemState(
- RES_HORI_ORIENT, FALSE ) ||
+ RES_HORI_ORIENT, sal_False ) ||
SFX_ITEM_SET == ((SwAttrSetChg*)pNew)->GetChgSet()->GetItemState(
- RES_VERT_ORIENT, FALSE ) ||
+ RES_VERT_ORIENT, sal_False ) ||
SFX_ITEM_SET == ((SwAttrSetChg*)pNew)->GetChgSet()->GetItemState(
- RES_FOLLOW_TEXT_FLOW, FALSE ) ) ) )
+ RES_FOLLOW_TEXT_FLOW, sal_False ) ) ) )
{
lcl_NotifyBackgroundOfObj( *this, *GetMaster(), 0L );
NotifyBackgrdOfAllVirtObjs( 0L );
@@ -1778,7 +1863,7 @@ void SwDrawContact::DisconnectFromLayout( bool _bMoveMasterToInvisibleLayer )
for( SdrView* pView = aIter.FirstView(); pView;
pView = aIter.NextView() )
{
- pView->MarkObj( GetMaster(), pView->GetSdrPageView(), TRUE );
+ pView->MarkObj( GetMaster(), pView->GetSdrPageView(), sal_True );
}
// OD 25.06.2003 #108784# - Instead of removing 'master' object from
@@ -1917,14 +2002,18 @@ void SwDrawContact::ConnectToLayout( const SwFmtAnchor* pAnch )
{
case FLY_AT_PAGE:
{
+<<<<<<< local
USHORT nPgNum = pAnch->GetPageNum();
ViewShell *pShell = pDrawFrmFmt->getIDocumentLayoutAccess()->GetCurrentViewShell();
if( !pShell )
break;
SwRootFrm* pRoot = pShell->GetLayout();
+=======
+ sal_uInt16 nPgNum = pAnch->GetPageNum();
+>>>>>>> other
SwPageFrm *pPage = static_cast<SwPageFrm*>(pRoot->Lower());
- for ( USHORT i = 1; i < nPgNum && pPage; ++i )
+ for ( sal_uInt16 i = 1; i < nPgNum && pPage; ++i )
{
pPage = static_cast<SwPageFrm*>(pPage->GetNext());
}
@@ -2054,7 +2143,7 @@ void SwDrawContact::ConnectToLayout( const SwFmtAnchor* pAnch )
}
break;
default:
- ASSERT( FALSE, "Unknown Anchor." )
+ ASSERT( sal_False, "Unknown Anchor." )
break;
}
if ( GetAnchorFrm() )
@@ -2585,7 +2674,7 @@ SdrHdl* SwDrawVirtObj::GetHdl(sal_uInt32 nHdlNum) const
return pHdl;
}
-SdrHdl* SwDrawVirtObj::GetPlusHdl(const SdrHdl& rHdl, USHORT nPlNum) const
+SdrHdl* SwDrawVirtObj::GetPlusHdl(const SdrHdl& rHdl, sal_uInt16 nPlNum) const
{
SdrHdl* pHdl = rRefObj.GetPlusHdl(rHdl, nPlNum);
pHdl->SetPos(pHdl->GetPos() + GetOffset());
diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx
index 80303f49de13..6f3301eedfb2 100644
--- a/sw/source/core/draw/dflyobj.cxx
+++ b/sw/source/core/draw/dflyobj.cxx
@@ -43,6 +43,7 @@
#include "cntfrm.hxx"
#include "frmatr.hxx"
#include "doc.hxx"
+#include <IDocumentUndoRedo.hxx>
#include "dview.hxx"
#include "dflyobj.hxx"
#include "flyfrm.hxx"
@@ -74,7 +75,7 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star;
-static BOOL bInResize = FALSE;
+static sal_Bool bInResize = sal_False;
TYPEINIT1( SwFlyDrawObj, SdrObject )
TYPEINIT1( SwVirtFlyDrawObj, SdrVirtObj )
@@ -159,19 +160,19 @@ SwFlyDrawObj::~SwFlyDrawObj()
|*
*************************************************************************/
-UINT32 __EXPORT SwFlyDrawObj::GetObjInventor() const
+sal_uInt32 __EXPORT SwFlyDrawObj::GetObjInventor() const
{
return SWGInventor;
}
-UINT16 __EXPORT SwFlyDrawObj::GetObjIdentifier() const
+sal_uInt16 __EXPORT SwFlyDrawObj::GetObjIdentifier() const
{
return SwFlyDrawObjIdentifier;
}
-UINT16 __EXPORT SwFlyDrawObj::GetObjVersion() const
+sal_uInt16 __EXPORT SwFlyDrawObj::GetObjVersion() const
{
return SwDrawFirst;
}
@@ -430,7 +431,7 @@ SwVirtFlyDrawObj::SwVirtFlyDrawObj(SdrObject& rNew, SwFlyFrm* pFly) :
pFlyFrm( pFly )
{
//#110094#-1
- // bNotPersistent = bNeedColorRestore = bWriterFlyFrame = TRUE;
+ // bNotPersistent = bNeedColorRestore = bWriterFlyFrame = sal_True;
const SvxProtectItem &rP = pFlyFrm->GetFmt()->GetProtect();
bMovProt = rP.IsPosProtected();
bSizProt = rP.IsSizeProtected();
@@ -523,13 +524,13 @@ void SwVirtFlyDrawObj::wrap_DoPaintObject() const
void __EXPORT SwVirtFlyDrawObj::TakeObjInfo( SdrObjTransformInfoRec& rInfo ) const
{
rInfo.bSelectAllowed = rInfo.bMoveAllowed =
- rInfo.bResizeFreeAllowed = rInfo.bResizePropAllowed = TRUE;
+ rInfo.bResizeFreeAllowed = rInfo.bResizePropAllowed = sal_True;
rInfo.bRotateFreeAllowed = rInfo.bRotate90Allowed =
rInfo.bMirrorFreeAllowed = rInfo.bMirror45Allowed =
rInfo.bMirror90Allowed = rInfo.bShearAllowed =
rInfo.bCanConvToPath = rInfo.bCanConvToPoly =
- rInfo.bCanConvToPathLineToArea = rInfo.bCanConvToPolyLineToArea = FALSE;
+ rInfo.bCanConvToPathLineToArea = rInfo.bCanConvToPolyLineToArea = sal_False;
}
@@ -701,7 +702,7 @@ void __EXPORT SwVirtFlyDrawObj::NbcMove(const Size& rSiz)
RES_VERT_ORIENT, RES_HORI_ORIENT );
SwFmtHoriOrient aHori( pFmt->GetHoriOrient() );
SwFmtVertOrient aVert( pFmt->GetVertOrient() );
- BOOL bPut = FALSE;
+ sal_Bool bPut = sal_False;
if( !GetFlyFrm()->IsFlyLayFrm() &&
::GetHtmlMode(pFmt->GetDoc()->GetDocShell()) )
@@ -710,7 +711,7 @@ void __EXPORT SwVirtFlyDrawObj::NbcMove(const Size& rSiz)
//Einzig einen Snap auf Links/Rechts bzw. Linker-/Rechter-Rand koennen
//wir versuchen.
const SwFrm* pAnch = GetFlyFrm()->GetAnchorFrm();
- BOOL bNextLine = FALSE;
+ sal_Bool bNextLine = sal_False;
if( !GetFlyFrm()->IsAutoPos() || text::RelOrientation::PAGE_FRAME != aHori.GetRelationOrient() )
{
@@ -721,9 +722,9 @@ void __EXPORT SwVirtFlyDrawObj::NbcMove(const Size& rSiz)
}
else
{
- bNextLine = TRUE;
+ bNextLine = sal_True;
//Horizontale Ausrichtung:
- const BOOL bLeftFrm =
+ const sal_Bool bLeftFrm =
aFlyRect.Left() < pAnch->Frm().Left() + pAnch->Prt().Left(),
bLeftPrt = aFlyRect.Left() + aFlyRect.Width() <
pAnch->Frm().Left() + pAnch->Prt().Width()/2;
@@ -734,7 +735,7 @@ void __EXPORT SwVirtFlyDrawObj::NbcMove(const Size& rSiz)
}
else
{
- const BOOL bRightFrm = aFlyRect.Left() >
+ const sal_Bool bRightFrm = aFlyRect.Left() >
pAnch->Frm().Left() + pAnch->Prt().Width();
aHori.SetHoriOrient( text::HoriOrientation::RIGHT );
aHori.SetRelationOrient( bRightFrm ? text::RelOrientation::FRAME : text::RelOrientation::PRINT_AREA );
@@ -744,7 +745,7 @@ void __EXPORT SwVirtFlyDrawObj::NbcMove(const Size& rSiz)
}
//Vertikale Ausrichtung bleibt grundsaetzlich schlicht erhalten,
//nur bei nicht automatischer Ausrichtung wird umgeschaltet.
- BOOL bRelChar = text::RelOrientation::CHAR == eRelVert;
+ sal_Bool bRelChar = text::RelOrientation::CHAR == eRelVert;
aVert.SetVertOrient( eVert != text::VertOrientation::NONE ? eVert :
GetFlyFrm()->IsFlyInCntFrm() ? text::VertOrientation::CHAR_CENTER :
bRelChar && bNextLine ? text::VertOrientation::CHAR_TOP : text::VertOrientation::TOP );
@@ -753,7 +754,7 @@ void __EXPORT SwVirtFlyDrawObj::NbcMove(const Size& rSiz)
else
aVert.SetRelationOrient( text::RelOrientation::PRINT_AREA );
aSet.Put( aVert );
- bPut = TRUE;
+ bPut = sal_True;
}
//Automatische Ausrichtungen wollen wir moeglichst nicht verlieren.
@@ -764,14 +765,14 @@ void __EXPORT SwVirtFlyDrawObj::NbcMove(const Size& rSiz)
aHori.SetHoriOrient( eHori );
aHori.SetRelationOrient( eRelHori );
aSet.Put( aHori );
- bPut = TRUE;
+ bPut = sal_True;
}
if ( text::VertOrientation::NONE != eVert )
{
aVert.SetVertOrient( eVert );
aVert.SetRelationOrient( eRelVert );
aSet.Put( aVert );
- bPut = TRUE;
+ bPut = sal_True;
}
}
if ( bPut )
@@ -809,7 +810,7 @@ void __EXPORT SwVirtFlyDrawObj::NbcResize(const Point& rRef,
const SwFmtCol& rCol = rAttrs.GetAttrSet().GetCol();
if ( rCol.GetColumns().Count() > 1 )
{
- for ( USHORT i = 0; i < rCol.GetColumns().Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rCol.GetColumns().Count(); ++i )
{
nMin += rCol.GetColumns()[i]->GetLeft() +
rCol.GetColumns()[i]->GetRight() +
@@ -847,10 +848,10 @@ void __EXPORT SwVirtFlyDrawObj::NbcResize(const Point& rRef,
}
if ( aFrmSz.GetWidthPercent() && aFrmSz.GetWidthPercent() != 0xFF &&
aOldFrmSz.GetWidth() != aFrmSz.GetWidth() )
- aFrmSz.SetWidthPercent( BYTE(aSz.Width() * 100L / nRelWidth + 0.5) );
+ aFrmSz.SetWidthPercent( sal_uInt8(aSz.Width() * 100L / nRelWidth + 0.5) );
if ( aFrmSz.GetHeightPercent() && aFrmSz.GetHeightPercent() != 0xFF &&
aOldFrmSz.GetHeight() != aFrmSz.GetHeight() )
- aFrmSz.SetHeightPercent( BYTE(aSz.Height() * 100L / nRelHeight + 0.5) );
+ aFrmSz.SetHeightPercent( sal_uInt8(aSz.Height() * 100L / nRelHeight + 0.5) );
pFmt->GetDoc()->SetAttr( aFrmSz, *pFmt );
}
}
@@ -874,9 +875,9 @@ void __EXPORT SwVirtFlyDrawObj::NbcResize(const Point& rRef,
}
else if ( aOutRect.TopLeft() != aNewPos )
aOutRect.SetPos( aNewPos );
- bInResize = TRUE;
+ bInResize = sal_True;
NbcMove( Size( 0, 0 ) );
- bInResize = FALSE;
+ bInResize = sal_False;
}
}
@@ -885,7 +886,7 @@ void __EXPORT SwVirtFlyDrawObj::Move(const Size& rSiz)
{
NbcMove( rSiz );
SetChanged();
- GetFmt()->GetDoc()->SetNoDrawUndoObj( TRUE );
+ GetFmt()->GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(false);
}
@@ -894,7 +895,7 @@ void __EXPORT SwVirtFlyDrawObj::Resize(const Point& rRef,
{
NbcResize( rRef, xFact, yFact );
SetChanged();
- GetFmt()->GetDoc()->SetNoDrawUndoObj( TRUE );
+ GetFmt()->GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(false);
}
diff --git a/sw/source/core/draw/dpage.cxx b/sw/source/core/draw/dpage.cxx
index 0db338657a24..bdca839d9a89 100644
--- a/sw/source/core/draw/dpage.cxx
+++ b/sw/source/core/draw/dpage.cxx
@@ -63,7 +63,7 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::drawing;
using namespace ::com::sun::star::frame;
-SwDPage::SwDPage(SwDrawDocument& rNewModel, BOOL bMasterPage) :
+SwDPage::SwDPage(SwDrawDocument& rNewModel, sal_Bool bMasterPage) :
FmFormPage(rNewModel, 0, bMasterPage),
pGridLst( 0 ),
rDoc(rNewModel.GetDoc())
@@ -85,7 +85,7 @@ SwDPage::~SwDPage()
|*
*************************************************************************/
-SdrObject* SwDPage::ReplaceObject( SdrObject* pNewObj, ULONG nObjNum )
+SdrObject* SwDPage::ReplaceObject( SdrObject* pNewObj, sal_uLong nObjNum )
{
SdrObject *pOld = GetObj( nObjNum );
ASSERT( pOld, "Oups, Object not replaced" );
@@ -156,10 +156,10 @@ const SdrPageGridFrameList* SwDPage::GetGridFrameList(
return pGridLst;
}
-BOOL SwDPage::RequestHelp( Window* pWindow, SdrView* pView,
+sal_Bool SwDPage::RequestHelp( Window* pWindow, SdrView* pView,
const HelpEvent& rEvt )
{
- BOOL bWeiter = TRUE;
+ sal_Bool bWeiter = sal_True;
if( rEvt.GetMode() & ( HELPMODE_QUICK | HELPMODE_BALLOON ))
{
@@ -210,7 +210,7 @@ BOOL SwDPage::RequestHelp( Window* pWindow, SdrView* pView,
if ( sTxt.Len() )
{
// --> OD 2007-07-26 #i80029#
- BOOL bExecHyperlinks = rDoc.GetDocShell()->IsReadOnly();
+ sal_Bool bExecHyperlinks = rDoc.GetDocShell()->IsReadOnly();
if ( !bExecHyperlinks )
{
SvtSecurityOptions aSecOpts;
@@ -235,7 +235,7 @@ BOOL SwDPage::RequestHelp( Window* pWindow, SdrView* pView,
Rectangle aRect( rEvt.GetMousePosPixel(), Size(1,1) );
Help::ShowQuickHelp( pWindow, aRect, sTxt );
}
- bWeiter = FALSE;
+ bWeiter = sal_False;
}
}
}
diff --git a/sw/source/core/draw/drawdoc.cxx b/sw/source/core/draw/drawdoc.cxx
index 650edcfceaed..be94db96d47f 100644
--- a/sw/source/core/draw/drawdoc.cxx
+++ b/sw/source/core/draw/drawdoc.cxx
@@ -68,11 +68,11 @@ const String GetPalettePath()
SwDrawDocument::SwDrawDocument( SwDoc* pD ) :
FmFormModel( ::GetPalettePath(), &pD->GetAttrPool(),
- pD->GetDocShell(), TRUE ),
+ pD->GetDocShell(), sal_True ),
pDoc( pD )
{
SetScaleUnit( MAP_TWIP );
- SetSwapGraphics( TRUE );
+ SetSwapGraphics( sal_True );
SwDocShell* pDocSh = pDoc->GetDocShell();
if ( pDocSh )
@@ -102,7 +102,7 @@ SwDrawDocument::SwDrawDocument( SwDoc* pD ) :
SfxItemPool* pSdrPool = pD->GetAttrPool().GetSecondaryPool();
if( pSdrPool )
{
- const USHORT aWhichRanges[] =
+ const sal_uInt16 aWhichRanges[] =
{
RES_CHRATR_BEGIN, RES_CHRATR_END,
RES_PARATR_BEGIN, RES_PARATR_END,
@@ -110,11 +110,11 @@ SwDrawDocument::SwDrawDocument( SwDoc* pD ) :
};
SfxItemPool& rDocPool = pD->GetAttrPool();
- USHORT nEdtWhich, nSlotId;
+ sal_uInt16 nEdtWhich, nSlotId;
const SfxPoolItem* pItem;
- for( const USHORT* pRangeArr = aWhichRanges;
+ for( const sal_uInt16* pRangeArr = aWhichRanges;
*pRangeArr; pRangeArr += 2 )
- for( USHORT nW = *pRangeArr, nEnd = *(pRangeArr+1);
+ for( sal_uInt16 nW = *pRangeArr, nEnd = *(pRangeArr+1);
nW < nEnd; ++nW )
if( 0 != (pItem = rDocPool.GetPoolDefaultItem( nW )) &&
0 != (nSlotId = rDocPool.GetSlotId( nW ) ) &&
@@ -131,7 +131,7 @@ SwDrawDocument::SwDrawDocument( SwDoc* pD ) :
SetForbiddenCharsTable( pD->getForbiddenCharacterTable() );
// #87795# Implementation for asian compression
- SetCharCompressType( static_cast<UINT16>(pD->getCharacterCompressionType() ));
+ SetCharCompressType( static_cast<sal_uInt16>(pD->getCharacterCompressionType() ));
}
/*************************************************************************
@@ -196,7 +196,7 @@ SvStream* SwDrawDocument::GetDocumentStream( SdrDocumentStreamInfo& rInfo ) cons
pRet = utl::UcbStreamHelper::CreateStream( xStream );
if( pRet )
{
- rInfo.mbDeleteAfterUse = TRUE;
+ rInfo.mbDeleteAfterUse = sal_True;
rInfo.mxStorageRef = xPictureStorage;
}
}
diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx
index 207e3f0d4f68..9bcc18ee8c44 100644
--- a/sw/source/core/draw/dview.cxx
+++ b/sw/source/core/draw/dview.cxx
@@ -52,6 +52,7 @@
#include <ndole.hxx>
#include <fmtanchr.hxx>
#include "shellres.hxx"
+#include <IDocumentUndoRedo.hxx>
// #i7672#
#include <editeng/outliner.hxx>
@@ -77,17 +78,17 @@ class SwSdrHdl : public SdrHdl
public:
SwSdrHdl(const Point& rPnt, bool bTopRight ) :
SdrHdl( rPnt, bTopRight ? HDL_ANCHOR_TR : HDL_ANCHOR ) {}
- virtual BOOL IsFocusHdl() const;
+ virtual sal_Bool IsFocusHdl() const;
};
-BOOL SwSdrHdl::IsFocusHdl() const
+sal_Bool SwSdrHdl::IsFocusHdl() const
{
if( HDL_ANCHOR == eKind || HDL_ANCHOR_TR == eKind )
- return TRUE;
+ return sal_True;
return SdrHdl::IsFocusHdl();
}
-const SwFrm *lcl_FindAnchor( const SdrObject *pObj, BOOL bAll )
+const SwFrm *lcl_FindAnchor( const SdrObject *pObj, sal_Bool bAll )
{
const SwVirtFlyDrawObj *pVirt = pObj->ISA(SwVirtFlyDrawObj) ?
(SwVirtFlyDrawObj*)pObj : 0;
@@ -120,18 +121,18 @@ SwDrawView::SwDrawView( SwViewImp &rI, SdrModel *pMd, OutputDevice *pOutDev) :
FmFormView( (FmFormModel*)pMd, pOutDev ),
rImp( rI )
{
- SetPageVisible( FALSE );
- SetBordVisible( FALSE );
- SetGridVisible( FALSE );
- SetHlplVisible( FALSE );
- SetGlueVisible( FALSE );
- SetFrameDragSingles( TRUE );
- SetVirtualObjectBundling( TRUE );
- SetSwapAsynchron( TRUE );
-
- EnableExtendedKeyInputDispatcher( FALSE );
- EnableExtendedMouseEventDispatcher( FALSE );
- EnableExtendedCommandEventDispatcher( FALSE );
+ SetPageVisible( sal_False );
+ SetBordVisible( sal_False );
+ SetGridVisible( sal_False );
+ SetHlplVisible( sal_False );
+ SetGlueVisible( sal_False );
+ SetFrameDragSingles( sal_True );
+ SetVirtualObjectBundling( sal_True );
+ SetSwapAsynchron( sal_True );
+
+ EnableExtendedKeyInputDispatcher( sal_False );
+ EnableExtendedMouseEventDispatcher( sal_False );
+ EnableExtendedCommandEventDispatcher( sal_False );
SetHitTolerancePixel( GetMarkHdlSizePixel()/2 );
@@ -153,7 +154,7 @@ sal_Bool SwDrawView::IsAntiAliasing() const
//////////////////////////////////////////////////////////////////////////////
-SdrObject* impLocalHitCorrection(SdrObject* pRetval, const Point& rPnt, USHORT nTol, const SdrMarkList &rMrkList)
+SdrObject* impLocalHitCorrection(SdrObject* pRetval, const Point& rPnt, sal_uInt16 nTol, const SdrMarkList &rMrkList)
{
if(!nTol)
{
@@ -212,7 +213,7 @@ SdrObject* impLocalHitCorrection(SdrObject* pRetval, const Point& rPnt, USHORT n
return pRetval;
}
-SdrObject* SwDrawView::CheckSingleSdrObjectHit(const Point& rPnt, USHORT nTol, SdrObject* pObj, SdrPageView* pPV, ULONG nOptions, const SetOfByte* pMVisLay) const
+SdrObject* SwDrawView::CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObject* pObj, SdrPageView* pPV, sal_uLong nOptions, const SetOfByte* pMVisLay) const
{
// call parent
SdrObject* pRetval = FmFormView::CheckSingleSdrObjectHit(rPnt, nTol, pObj, pPV, nOptions, pMVisLay);
@@ -296,7 +297,7 @@ SdrObject* SwDrawView::GetMaxToTopObj( SdrObject* pObj ) const
{
if ( GetUserCall(pObj) )
{
- const SwFrm *pAnch = ::lcl_FindAnchor( pObj, FALSE );
+ const SwFrm *pAnch = ::lcl_FindAnchor( pObj, sal_False );
if ( pAnch )
{
//Das oberste Obj innerhalb des Ankers darf nicht ueberholt
@@ -307,15 +308,15 @@ SdrObject* SwDrawView::GetMaxToTopObj( SdrObject* pObj ) const
const SwPageFrm *pPage = pFly->FindPageFrm();
if ( pPage->GetSortedObjs() )
{
- UINT32 nOrdNum = 0;
- for ( USHORT i = 0; i < pPage->GetSortedObjs()->Count(); ++i )
+ sal_uInt32 nOrdNum = 0;
+ for ( sal_uInt16 i = 0; i < pPage->GetSortedObjs()->Count(); ++i )
{
const SdrObject *pO =
(*pPage->GetSortedObjs())[i]->GetDrawObj();
if ( pO->GetOrdNumDirect() > nOrdNum )
{
- const SwFrm *pTmpAnch = ::lcl_FindAnchor( pO, FALSE );
+ const SwFrm *pTmpAnch = ::lcl_FindAnchor( pO, sal_False );
if ( pFly->IsAnLower( pTmpAnch ) )
{
nOrdNum = pO->GetOrdNumDirect();
@@ -352,7 +353,7 @@ SdrObject* SwDrawView::GetMaxToBtmObj(SdrObject* pObj) const
{
if ( GetUserCall(pObj) )
{
- const SwFrm *pAnch = ::lcl_FindAnchor( pObj, FALSE );
+ const SwFrm *pAnch = ::lcl_FindAnchor( pObj, sal_False );
if ( pAnch )
{
//Der Fly des Ankers darf nicht "unterflogen" werden.
@@ -376,22 +377,22 @@ SdrObject* SwDrawView::GetMaxToBtmObj(SdrObject* pObj) const
|*
*************************************************************************/
-inline BOOL lcl_IsChild( SdrObject *pParent, SdrObject *pChild )
+inline sal_Bool lcl_IsChild( SdrObject *pParent, SdrObject *pChild )
{
if ( pParent->ISA(SwVirtFlyDrawObj) )
{
- const SwFrm *pAnch = lcl_FindAnchor( pChild, FALSE );
+ const SwFrm *pAnch = lcl_FindAnchor( pChild, sal_False );
if ( pAnch && ((SwVirtFlyDrawObj*)pParent)->GetFlyFrm()->IsAnLower( pAnch ))
{
- return TRUE;
+ return sal_True;
}
}
- return FALSE;
+ return sal_False;
}
inline SdrObject *lcl_FindParent( SdrObject *pObj )
{
- const SwFrm *pAnch = lcl_FindAnchor( pObj, FALSE );
+ const SwFrm *pAnch = lcl_FindAnchor( pObj, sal_False );
if ( pAnch && pAnch->IsInFly() )
return (SdrObject*)pAnch->FindFlyFrm()->GetVirtDrawObj();
return 0;
@@ -424,7 +425,7 @@ sal_uInt32 SwDrawView::_GetMaxChildOrdNum( const SwFlyFrm& _rParentObj,
}
if ( pObj->GetOrdNum() > nMaxChildOrdNum &&
- _rParentObj.IsAnLower( lcl_FindAnchor( pObj, TRUE ) ) )
+ _rParentObj.IsAnLower( lcl_FindAnchor( pObj, sal_True ) ) )
{
nMaxChildOrdNum = pObj->GetOrdNum();
break;
@@ -525,8 +526,8 @@ void SwDrawView::_MoveRepeatedObjs( const SwAnchoredObject& _rMovedAnchoredObj,
}
// --> OD 2004-08-20 #110810# - adjustment and re-factoring of method
-void SwDrawView::ObjOrderChanged( SdrObject* pObj, ULONG nOldPos,
- ULONG nNewPos )
+void SwDrawView::ObjOrderChanged( SdrObject* pObj, sal_uLong nOldPos,
+ sal_uLong nNewPos )
{
// --> OD 2004-08-17 #110810# - nothing to do for group members
if ( pObj->GetUpGroup() )
@@ -650,7 +651,7 @@ void SwDrawView::ObjOrderChanged( SdrObject* pObj, ULONG nOldPos,
// If object is anchored inside a invisible part of the document
// (e.g. page header, whose page style isn't applied, or hidden
// section), no anchor frame exists.
- const SwFrm* pTmpAnchorFrm = lcl_FindAnchor( pTmpObj, TRUE );
+ const SwFrm* pTmpAnchorFrm = lcl_FindAnchor( pTmpObj, sal_True );
const SwFlyFrm* pTmpParentObj = pTmpAnchorFrm
? pTmpAnchorFrm->FindFlyFrm() : 0L;
// <--
@@ -704,7 +705,7 @@ void SwDrawView::ObjOrderChanged( SdrObject* pObj, ULONG nOldPos,
// If object is anchored inside a invisible part of the document
// (e.g. page header, whose page style isn't applied, or hidden
// section), no anchor frame exists.
- const SwFrm* pTmpAnchorFrm = lcl_FindAnchor( pTmpObj, TRUE );
+ const SwFrm* pTmpAnchorFrm = lcl_FindAnchor( pTmpObj, sal_True );
const SwFlyFrm* pTmpParentObj = pTmpAnchorFrm
? pTmpAnchorFrm->FindFlyFrm() : 0L;
// <--
@@ -764,11 +765,11 @@ void SwDrawView::ObjOrderChanged( SdrObject* pObj, ULONG nOldPos,
*************************************************************************/
-BOOL SwDrawView::TakeDragLimit( SdrDragMode eMode,
+sal_Bool SwDrawView::TakeDragLimit( SdrDragMode eMode,
Rectangle& rRect ) const
{
const SdrMarkList &rMrkList = GetMarkedObjectList();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( 1 == rMrkList.GetMarkCount() )
{
const SdrObject *pObj = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
@@ -776,7 +777,7 @@ BOOL SwDrawView::TakeDragLimit( SdrDragMode eMode,
if( ::CalcClipRect( pObj, aRect, eMode == SDRDRAG_MOVE ) )
{
rRect = aRect.SVRect();
- bRet = TRUE;
+ bRet = sal_True;
}
}
return bRet;
@@ -804,7 +805,7 @@ const SwFrm* SwDrawView::CalcAnchor()
//der aktuelle Anker. Nur suchen wenn wir gerade draggen.
const SwFrm* pAnch;
Rectangle aMyRect;
- const BOOL bFly = pObj->ISA(SwVirtFlyDrawObj);
+ const sal_Bool bFly = pObj->ISA(SwVirtFlyDrawObj);
if ( bFly )
{
pAnch = ((SwVirtFlyDrawObj*)pObj)->GetFlyFrm()->GetAnchorFrm();
@@ -964,9 +965,9 @@ void SwDrawView::CheckPossibilities()
//OLE-Objekte konnen selbst einen Resize-Schutz wuenschen (StarMath)
const SdrMarkList &rMrkList = GetMarkedObjectList();
- BOOL bProtect = FALSE,
- bSzProtect = FALSE;
- for ( USHORT i = 0; !bProtect && i < rMrkList.GetMarkCount(); ++i )
+ sal_Bool bProtect = sal_False,
+ bSzProtect = sal_False;
+ for ( sal_uInt16 i = 0; !bProtect && i < rMrkList.GetMarkCount(); ++i )
{
const SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
const SwFrm *pFrm = NULL;
@@ -989,7 +990,7 @@ void SwDrawView::CheckPossibilities()
// can be selected.
// TODO/LATER: retrieve Aspect - from where?!
- bSzProtect |= ( embed::EmbedMisc::EMBED_NEVERRESIZE & xObj->getStatus( embed::Aspects::MSOLE_CONTENT ) ) ? TRUE : FALSE;
+ bSzProtect |= ( embed::EmbedMisc::EMBED_NEVERRESIZE & xObj->getStatus( embed::Aspects::MSOLE_CONTENT ) ) ? sal_True : sal_False;
// <--
@@ -1019,12 +1020,12 @@ void SwDrawView::CheckPossibilities()
{
ASSERT( false,
"<SwDrawView::CheckPossibilities()> - missing frame format" );
- bProtect = TRUE;
+ bProtect = sal_True;
}
else if ((FLY_AS_CHAR == pFrmFmt->GetAnchor().GetAnchorId()) &&
rMrkList.GetMarkCount() > 1 )
{
- bProtect = TRUE;
+ bProtect = sal_True;
}
}
}
@@ -1083,10 +1084,16 @@ void SwDrawView::ReplaceMarkedDrawVirtObjs( SdrMarkView& _rMarkView )
void SwDrawView::DeleteMarked()
{
SwDoc* pDoc = Imp().GetShell()->GetDoc();
+<<<<<<< local
SwRootFrm *pTmpRoot = pDoc->GetCurrentLayout();//swmod 080317
if ( pTmpRoot )
pTmpRoot->StartAllAction();
pDoc->StartUndo(UNDO_EMPTY, NULL);
+=======
+ if ( pDoc->GetRootFrm() )
+ pDoc->GetRootFrm()->StartAllAction();
+ pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL);
+>>>>>>> other
// OD 18.06.2003 #108784# - replace marked <SwDrawVirtObj>-objects by its
// reference objects.
{
@@ -1105,8 +1112,14 @@ void SwDrawView::DeleteMarked()
FmFormView::DeleteMarked();
::FrameNotify( Imp().GetShell(), FLY_DRAG_END );
}
+<<<<<<< local
pDoc->EndUndo(UNDO_EMPTY, NULL);
if( pTmpRoot )
pTmpRoot->EndAllAction(); //swmod 080218
+=======
+ pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, NULL);
+ if( pDoc->GetRootFrm() )
+ pDoc->GetRootFrm()->EndAllAction();
+>>>>>>> other
}
diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx
index b7e92570df42..dad951e3848a 100644
--- a/sw/source/core/edit/acorrect.cxx
+++ b/sw/source/core/edit/acorrect.cxx
@@ -32,9 +32,7 @@
#define _STD_VAR_ARRAYS
#include <hintids.hxx>
-#ifndef _SVX_SVXIDS_HRC
#include <svx/svxids.hrc>
-#endif
#include <editeng/langitem.hxx>
#include <fmtinfmt.hxx>
#include <txtatr.hxx>
@@ -96,17 +94,19 @@ void _PaMIntoCrsrShellRing::RemoveFromRing( SwPaM& rPam, Ring* pPrev )
SwAutoCorrDoc::SwAutoCorrDoc( SwEditShell& rEditShell, SwPaM& rPam,
sal_Unicode cIns )
- : rEditSh( rEditShell ), rCrsr( rPam ), pIdx( 0 ),
- nUndoId( UNDO_EMPTY ),
- bUndoIdInitialized( cIns ? false : true )
+ : rEditSh( rEditShell ), rCrsr( rPam ), pIdx( 0 )
+ , m_nEndUndoCounter(0)
+ , bUndoIdInitialized( cIns ? false : true )
{
}
SwAutoCorrDoc::~SwAutoCorrDoc()
{
- if( UNDO_EMPTY != nUndoId )
- rEditSh.EndUndo( nUndoId );
+ for (int i = 0; i < m_nEndUndoCounter; ++i)
+ {
+ rEditSh.EndUndo();
+ }
delete pIdx;
}
@@ -126,7 +126,7 @@ void SwAutoCorrDoc::DeleteSel( SwPaM& rDelPam )
}
}
-BOOL SwAutoCorrDoc::Delete( xub_StrLen nStt, xub_StrLen nEnd )
+sal_Bool SwAutoCorrDoc::Delete( xub_StrLen nStt, xub_StrLen nEnd )
{
const SwNodeIndex& rNd = rCrsr.GetPoint()->nNode;
SwPaM aSel( rNd, nStt, rNd, nEnd );
@@ -134,11 +134,11 @@ BOOL SwAutoCorrDoc::Delete( xub_StrLen nStt, xub_StrLen nEnd )
if( bUndoIdInitialized )
bUndoIdInitialized = true;
- return TRUE;
+ return sal_True;
}
-BOOL SwAutoCorrDoc::Insert( xub_StrLen nPos, const String& rTxt )
+sal_Bool SwAutoCorrDoc::Insert( xub_StrLen nPos, const String& rTxt )
{
SwPaM aPam( rCrsr.GetPoint()->nNode.GetNode(), nPos );
rEditSh.GetDoc()->InsertString( aPam, rTxt );
@@ -146,13 +146,16 @@ BOOL SwAutoCorrDoc::Insert( xub_StrLen nPos, const String& rTxt )
{
bUndoIdInitialized = true;
if( 1 == rTxt.Len() )
- rEditSh.StartUndo( nUndoId = UNDO_AUTOCORRECT );
+ {
+ rEditSh.StartUndo( UNDO_AUTOCORRECT );
+ ++m_nEndUndoCounter;
+ }
}
- return TRUE;
+ return sal_True;
}
-BOOL SwAutoCorrDoc::Replace( xub_StrLen nPos, const String& rTxt )
+sal_Bool SwAutoCorrDoc::Replace( xub_StrLen nPos, const String& rTxt )
{
SwPaM* pPam = &rCrsr;
if( pPam->GetPoint()->nContent.GetIndex() != nPos )
@@ -164,7 +167,7 @@ BOOL SwAutoCorrDoc::Replace( xub_StrLen nPos, const String& rTxt )
SwTxtNode * const pNd = pPam->GetNode()->GetTxtNode();
if ( !pNd )
{
- return FALSE;
+ return sal_False;
}
// text attributes with dummy characters must not be replaced!
@@ -215,26 +218,29 @@ BOOL SwAutoCorrDoc::Replace( xub_StrLen nPos, const String& rTxt )
{
bUndoIdInitialized = true;
if( 1 == rTxt.Len() )
- rEditSh.StartUndo( nUndoId = UNDO_AUTOCORRECT );
+ {
+ rEditSh.StartUndo( UNDO_AUTOCORRECT );
+ ++m_nEndUndoCounter;
+ }
}
}
if( pPam != &rCrsr )
delete pPam;
- return TRUE;
+ return sal_True;
}
-BOOL SwAutoCorrDoc::SetAttr( xub_StrLen nStt, xub_StrLen nEnd, USHORT nSlotId,
+sal_Bool SwAutoCorrDoc::SetAttr( xub_StrLen nStt, xub_StrLen nEnd, sal_uInt16 nSlotId,
SfxPoolItem& rItem )
{
const SwNodeIndex& rNd = rCrsr.GetPoint()->nNode;
SwPaM aPam( rNd, nStt, rNd, nEnd );
SfxItemPool& rPool = rEditSh.GetDoc()->GetAttrPool();
- USHORT nWhich = rPool.GetWhich( nSlotId, FALSE );
+ sal_uInt16 nWhich = rPool.GetWhich( nSlotId, sal_False );
if( nWhich )
{
rItem.SetWhich( nWhich );
@@ -252,7 +258,7 @@ BOOL SwAutoCorrDoc::SetAttr( xub_StrLen nStt, xub_StrLen nEnd, USHORT nSlotId,
-BOOL SwAutoCorrDoc::SetINetAttr( xub_StrLen nStt, xub_StrLen nEnd, const String& rURL )
+sal_Bool SwAutoCorrDoc::SetINetAttr( xub_StrLen nStt, xub_StrLen nEnd, const String& rURL )
{
const SwNodeIndex& rNd = rCrsr.GetPoint()->nNode;
SwPaM aPam( rNd, nStt, rNd, nEnd );
@@ -263,17 +269,17 @@ BOOL SwAutoCorrDoc::SetINetAttr( xub_StrLen nStt, xub_StrLen nEnd, const String&
rEditSh.GetDoc()->SetFmtItemByAutoFmt( aPam, aSet );
if( bUndoIdInitialized )
bUndoIdInitialized = true;
- return TRUE;
+ return sal_True;
}
// returne den Text eines vorherigen Absatzes.
// Dieser darf nicht leer sein!
// Gibt es diesen nicht oder gibt es davor nur Leere, dann returne 0
// Das Flag gibt an:
- // TRUE: den, vor der normalen Einfuegeposition (TRUE)
- // FALSE: den, in den das korrigierte Wort eingfuegt wurde.
+ // sal_True: den, vor der normalen Einfuegeposition (sal_True)
+ // sal_False: den, in den das korrigierte Wort eingfuegt wurde.
// (Muss nicht der gleiche Absatz sein!!!!)
-const String* SwAutoCorrDoc::GetPrevPara( BOOL bAtNormalPos )
+const String* SwAutoCorrDoc::GetPrevPara( sal_Bool bAtNormalPos )
{
const String* pStr = 0;
@@ -298,7 +304,7 @@ const String* SwAutoCorrDoc::GetPrevPara( BOOL bAtNormalPos )
}
-BOOL SwAutoCorrDoc::ChgAutoCorrWord( xub_StrLen & rSttPos, xub_StrLen nEndPos,
+sal_Bool SwAutoCorrDoc::ChgAutoCorrWord( xub_StrLen & rSttPos, xub_StrLen nEndPos,
SvxAutoCorrect& rACorrect,
const String** ppPara )
{
@@ -310,16 +316,16 @@ BOOL SwAutoCorrDoc::ChgAutoCorrWord( xub_StrLen & rSttPos, xub_StrLen nEndPos,
SwTxtNode* pTxtNd = rCrsr.GetNode()->GetTxtNode();
ASSERT( pTxtNd, "wo ist denn der TextNode?" );
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( nEndPos == rSttPos )
return bRet;
- LanguageType eLang = GetLanguage(nEndPos, FALSE);
+ LanguageType eLang = GetLanguage(nEndPos, sal_False);
if(LANGUAGE_SYSTEM == eLang)
eLang = (LanguageType)GetAppLanguage();
//JP 22.04.99: Bug 63883 - Sonderbehandlung fuer Punkte.
- BOOL bLastCharIsPoint = nEndPos < pTxtNd->GetTxt().Len() &&
+ sal_Bool bLastCharIsPoint = nEndPos < pTxtNd->GetTxt().Len() &&
'.' == pTxtNd->GetTxt().GetChar( nEndPos );
const SvxAutocorrWord* pFnd = rACorrect.SearchWordsInList(
@@ -338,13 +344,13 @@ BOOL SwAutoCorrDoc::ChgAutoCorrWord( xub_StrLen & rSttPos, xub_StrLen nEndPos,
{
// replace the selection
pDoc->ReplaceRange( aPam, pFnd->GetLong(), false);
- bRet = TRUE;
+ bRet = sal_True;
}
}
else
{
- SwTextBlocks aTBlks( rACorrect.GetAutoCorrFileName( eLang, FALSE, TRUE ));
- USHORT nPos = aTBlks.GetIndex( pFnd->GetShort() );
+ SwTextBlocks aTBlks( rACorrect.GetAutoCorrFileName( eLang, sal_False, sal_True ));
+ sal_uInt16 nPos = aTBlks.GetIndex( pFnd->GetShort() );
if( USHRT_MAX != nPos && aTBlks.BeginGetDoc( nPos ) )
{
DeleteSel( aPam );
@@ -387,7 +393,7 @@ BOOL SwAutoCorrDoc::ChgAutoCorrWord( xub_StrLen & rSttPos, xub_StrLen nEndPos,
(*pIdx)++;
pTxtNd = pIdx->GetNode().GetTxtNode();
}
- bRet = TRUE;
+ bRet = sal_True;
}
aTBlks.EndGetDoc();
}
@@ -405,17 +411,17 @@ BOOL SwAutoCorrDoc::ChgAutoCorrWord( xub_StrLen & rSttPos, xub_StrLen nEndPos,
// - FnCptlSttSntnc
// gerufen. Dann koennen die Worte ggfs. in die Ausnahmelisten
// aufgenommen werden.
-void SwAutoCorrDoc::SaveCpltSttWord( ULONG nFlag, xub_StrLen nPos,
+void SwAutoCorrDoc::SaveCpltSttWord( sal_uLong nFlag, xub_StrLen nPos,
const String& rExceptWord,
sal_Unicode cChar )
{
- ULONG nNode = pIdx ? pIdx->GetIndex() : rCrsr.GetPoint()->nNode.GetIndex();
- LanguageType eLang = GetLanguage(nPos, FALSE);
+ sal_uLong nNode = pIdx ? pIdx->GetIndex() : rCrsr.GetPoint()->nNode.GetIndex();
+ LanguageType eLang = GetLanguage(nPos, sal_False);
rEditSh.GetDoc()->SetAutoCorrExceptWord( new SwAutoCorrExceptWord( nFlag,
nNode, nPos, rExceptWord, cChar, eLang ));
}
-LanguageType SwAutoCorrDoc::GetLanguage( xub_StrLen nPos, BOOL bPrevPara ) const
+LanguageType SwAutoCorrDoc::GetLanguage( xub_StrLen nPos, sal_Bool bPrevPara ) const
{
LanguageType eRet = LANGUAGE_SYSTEM;
@@ -449,12 +455,12 @@ void SwAutoCorrExceptWord::CheckChar( const SwPosition& rPos, sal_Unicode cChr )
}
-BOOL SwAutoCorrExceptWord::CheckDelChar( const SwPosition& rPos )
+sal_Bool SwAutoCorrExceptWord::CheckDelChar( const SwPosition& rPos )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( !bDeleted && rPos.nNode.GetIndex() == nNode &&
rPos.nContent.GetIndex() == nCntnt )
- bDeleted = bRet = TRUE;
+ bDeleted = bRet = sal_True;
return bRet;
}
@@ -488,8 +494,8 @@ void SwDontExpandItem::RestoreDontExpandItems( const SwPosition& rPos )
if( pTxtNd->GetpSwpHints() && pTxtNd->GetpSwpHints()->Count() )
{
- const USHORT nSize = pTxtNd->GetpSwpHints()->Count();
- USHORT n;
+ const sal_uInt16 nSize = pTxtNd->GetpSwpHints()->Count();
+ sal_uInt16 n;
xub_StrLen nAttrStart;
const xub_StrLen* pAttrEnd;
@@ -509,13 +515,13 @@ void SwDontExpandItem::RestoreDontExpandItems( const SwPosition& rPos )
{
const SfxPoolItem* pItem;
if( !pDontExpItems || SFX_ITEM_SET != pDontExpItems->
- GetItemState( pHt->Which(), FALSE, &pItem ) ||
+ GetItemState( pHt->Which(), sal_False, &pItem ) ||
*pItem != pHt->GetAttr() )
{
// das Attribut war vorher nicht in dieser Form im Absatz
// gesetzt, also kann es nur durchs einfuegen/kopieren erzeugt
// worden sein. Damit ist es ein Kandiadat fuers DontExpand
- pHt->SetDontExpand( TRUE );
+ pHt->SetDontExpand( sal_True );
}
}
}
diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index b98f77386086..b24a59b0b873 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -36,7 +36,11 @@
#include <hintids.hxx>
#include <svl/svstdarr.hxx>
+
#include <unotools/charclass.hxx>
+
+#include <vcl/msgbox.hxx>
+
#include <editeng/boxitem.hxx>
#include <editeng/lrspitem.hxx>
#include <editeng/brkitem.hxx>
@@ -46,12 +50,13 @@
#include <editeng/langitem.hxx>
#include <editeng/cscoitem.hxx>
#include <editeng/unolingu.hxx>
-
#include <editeng/acorrcfg.hxx>
+
#include <swwait.hxx>
#include <fmtpdsc.hxx>
#include <fmtanchr.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <docary.hxx>
#include <editsh.hxx>
#include <index.hxx>
@@ -72,13 +77,8 @@
#include <frmatr.hxx>
#include <charatr.hxx>
#include <mdiexp.hxx>
-#ifndef _STATSTR_HRC
#include <statstr.hrc>
-#endif
-#ifndef _COMCORE_HRC
#include <comcore.hrc>
-#endif
-#include <vcl/msgbox.hxx>
#include <numrule.hxx>
using namespace ::com::sun::star;
@@ -101,7 +101,7 @@ SvxSwAutoFmtFlags* SwEditShell::pAutoFmtFlags = 0;
// Anzahl von Num-/Bullet-Absatzvorlagen. MAXLEVEL wird demnaechst auf
// x erhoeht, die Anzahl Vorlagen aber nicht (Ueberbleibsel aus <= 4.0)
-const USHORT cnNumBullColls = 4;
+const sal_uInt16 cnNumBullColls = 4;
class SwAutoFormat
{
@@ -115,12 +115,12 @@ class SwAutoFormat
SwTxtNode* pAktTxtNd; // der akt. TextNode
SwTxtFrm* pAktTxtFrm; // Frame vom akt. TextNode
CharClass* pCharClass; // Character classification
- ULONG nEndNdIdx; // fuer die Prozent-Anzeige
+ sal_uLong nEndNdIdx; // fuer die Prozent-Anzeige
LanguageType eCharClassLang;
- USHORT nLastHeadLvl, nLastCalcHeadLvl;
- USHORT nLastEnumLvl, nLastCalcEnumLvl;
- USHORT nRedlAutoFmtSeqId;
+ sal_uInt16 nLastHeadLvl, nLastCalcHeadLvl;
+ sal_uInt16 nLastEnumLvl, nLastCalcEnumLvl;
+ sal_uInt16 nRedlAutoFmtSeqId;
enum
{
@@ -150,11 +150,11 @@ class SwAutoFormat
IS_ENDE
} eStat;
- BOOL bEnde : 1;
- BOOL bEmptyLine : 1;
- BOOL bMoreLines : 1;
+ sal_Bool bEnde : 1;
+ sal_Bool bEmptyLine : 1;
+ sal_Bool bMoreLines : 1;
- static BOOL m_bAskForCancelUndoWhileBufferOverflow;
+ static sal_Bool m_bAskForCancelUndoWhileBufferOverflow;
static short m_nActionWhileAutoformatUndoBufferOverflow;
@@ -171,25 +171,25 @@ class SwAutoFormat
}
- BOOL IsSpace( const sal_Unicode c ) const
- { return (' ' == c || '\t' == c || 0x0a == c|| 0x3000 == c /* Jap. space */) ? TRUE : FALSE; }
+ sal_Bool IsSpace( const sal_Unicode c ) const
+ { return (' ' == c || '\t' == c || 0x0a == c|| 0x3000 == c /* Jap. space */) ? sal_True : sal_False; }
- void SetColl( USHORT nId, BOOL bHdLineOrText = FALSE );
+ void SetColl( sal_uInt16 nId, sal_Bool bHdLineOrText = sal_False );
String GoNextPara();
- BOOL HasObjects( const SwNode& rNd );
+ sal_Bool HasObjects( const SwNode& rNd );
// TxtNode Methoden
const SwTxtNode* GetNextNode() const;
- BOOL IsEmptyLine( const SwTxtNode& rNd ) const
+ sal_Bool IsEmptyLine( const SwTxtNode& rNd ) const
{ return 0 == rNd.GetTxt().Len() ||
rNd.GetTxt().Len() == GetLeadingBlanks( rNd.GetTxt() ); }
- BOOL IsOneLine( const SwTxtNode& ) const;
- BOOL IsFastFullLine( const SwTxtNode& ) const;
- BOOL IsNoAlphaLine( const SwTxtNode&) const;
- BOOL IsEnumericChar( const SwTxtNode&) const;
- BOOL IsBlanksInString( const SwTxtNode&) const;
- USHORT CalcLevel( const SwTxtNode&, USHORT *pDigitLvl = 0 ) const;
+ sal_Bool IsOneLine( const SwTxtNode& ) const;
+ sal_Bool IsFastFullLine( const SwTxtNode& ) const;
+ sal_Bool IsNoAlphaLine( const SwTxtNode&) const;
+ sal_Bool IsEnumericChar( const SwTxtNode&) const;
+ sal_Bool IsBlanksInString( const SwTxtNode&) const;
+ sal_uInt16 CalcLevel( const SwTxtNode&, sal_uInt16 *pDigitLvl = 0 ) const;
xub_StrLen GetBigIndent( xub_StrLen& rAktSpacePos ) const;
String& DelLeadingBlanks( String& rStr ) const;
@@ -197,8 +197,8 @@ class SwAutoFormat
xub_StrLen GetLeadingBlanks( const String& rStr ) const;
xub_StrLen GetTrailingBlanks( const String& rStr ) const;
- BOOL IsFirstCharCapital( const SwTxtNode& rNd ) const;
- USHORT GetDigitLevel( const SwTxtNode& rTxtNd, xub_StrLen& rPos,
+ sal_Bool IsFirstCharCapital( const SwTxtNode& rNd ) const;
+ sal_uInt16 GetDigitLevel( const SwTxtNode& rTxtNd, xub_StrLen& rPos,
String* pPreFix = 0, String* pPostFix = 0,
String* pNumTypes = 0 ) const;
// hole den FORMATIERTEN TextFrame
@@ -207,26 +207,26 @@ class SwAutoFormat
void BuildIndent();
void BuildText();
void BuildTextIndent();
- void BuildEnum( USHORT nLvl, USHORT nDigitLevel );
+ void BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel );
void BuildNegIndent( SwTwips nSpaces );
- void BuildHeadLine( USHORT nLvl );
+ void BuildHeadLine( sal_uInt16 nLvl );
- BOOL HasSelBlanks( SwPaM& rPam ) const;
- BOOL HasBreakAttr( const SwTxtNode& ) const;
+ sal_Bool HasSelBlanks( SwPaM& rPam ) const;
+ sal_Bool HasBreakAttr( const SwTxtNode& ) const;
void DeleteSel( SwPaM& rPam );
- BOOL DeleteAktNxtPara( const String& rNxtPara );
+ sal_Bool DeleteAktNxtPara( const String& rNxtPara );
// loesche im Node Anfang oder/und Ende
- void DeleteAktPara( BOOL bStart = TRUE, BOOL nEnd = TRUE );
- void DelEmptyLine( BOOL bTstNextPara = TRUE );
+ void DeleteAktPara( sal_Bool bStart = sal_True, sal_Bool nEnd = sal_True );
+ void DelEmptyLine( sal_Bool bTstNextPara = sal_True );
// loesche bei mehrzeiligen Absaetzen die "linken" und/oder
// "rechten" Raender
- void DelMoreLinesBlanks( BOOL bWithLineBreaks = FALSE );
+ void DelMoreLinesBlanks( sal_Bool bWithLineBreaks = sal_False );
// loesche den vorherigen Absatz
void DelPrevPara();
// dann lasse doch mal das AutoCorrect auf den akt. TextNode los
void AutoCorrect( xub_StrLen nSttPos = 0 );
- BOOL CanJoin( const SwTxtNode* pTxtNd ) const
+ sal_Bool CanJoin( const SwTxtNode* pTxtNd ) const
{
return !bEnde && pTxtNd &&
!IsEmptyLine( *pTxtNd ) &&
@@ -238,16 +238,16 @@ class SwAutoFormat
}
// ist ein Punkt am Ende ??
- BOOL IsSentenceAtEnd( const SwTxtNode& rTxtNd ) const;
+ sal_Bool IsSentenceAtEnd( const SwTxtNode& rTxtNd ) const;
- BOOL DoUnderline();
- BOOL DoTable();
+ sal_Bool DoUnderline();
+ sal_Bool DoTable();
- void _SetRedlineTxt( USHORT nId );
- BOOL SetRedlineTxt( USHORT nId )
- { if( aFlags.bWithRedlining ) _SetRedlineTxt( nId ); return TRUE; }
- BOOL ClearRedlineTxt()
- { if( aFlags.bWithRedlining ) pDoc->SetAutoFmtRedlineComment(0); return TRUE; }
+ void _SetRedlineTxt( sal_uInt16 nId );
+ sal_Bool SetRedlineTxt( sal_uInt16 nId )
+ { if( aFlags.bWithRedlining ) _SetRedlineTxt( nId ); return sal_True; }
+ sal_Bool ClearRedlineTxt()
+ { if( aFlags.bWithRedlining ) pDoc->SetAutoFmtRedlineComment(0); return sal_True; }
public:
SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags,
@@ -257,7 +257,7 @@ public:
}
};
-BOOL SwAutoFormat::m_bAskForCancelUndoWhileBufferOverflow = TRUE;
+sal_Bool SwAutoFormat::m_bAskForCancelUndoWhileBufferOverflow = sal_True;
short SwAutoFormat::m_nActionWhileAutoformatUndoBufferOverflow = RET_YES;
const sal_Unicode* StrChr( const sal_Unicode* pSrc, sal_Unicode c )
@@ -291,10 +291,10 @@ void SwAutoFormat::_GetCharClass( LanguageType eLang )
eCharClassLang = eLang;
}
-void SwAutoFormat::_SetRedlineTxt( USHORT nActionId )
+void SwAutoFormat::_SetRedlineTxt( sal_uInt16 nActionId )
{
String sTxt;
- USHORT nSeqNo = 0;
+ sal_uInt16 nSeqNo = 0;
if( STR_AUTOFMTREDL_END > nActionId )
{
sTxt = *ViewShell::GetShellRes()->GetAutoFmtNameLst()[ nActionId ];
@@ -334,14 +334,14 @@ String SwAutoFormat::GoNextPara()
//has to be checed twice before and after incrementation
if( aNdIdx.GetIndex() >= aEndNdIdx.GetIndex() )
{
- bEnde = TRUE;
+ bEnde = sal_True;
return aEmptyStr;
}
aNdIdx++;
if( aNdIdx.GetIndex() >= aEndNdIdx.GetIndex() )
{
- bEnde = TRUE;
+ bEnde = sal_True;
return aEmptyStr;
}
else
@@ -353,7 +353,7 @@ String SwAutoFormat::GoNextPara()
// EndNode : Ende erreicht, beenden
if( pNewNd->IsEndNode() )
{
- bEnde = TRUE;
+ bEnde = sal_True;
return aEmptyStr;
}
else if( pNewNd->IsTableNode() )
@@ -375,20 +375,20 @@ String SwAutoFormat::GoNextPara()
return pAktTxtNd->GetTxt();
}
-BOOL SwAutoFormat::HasObjects( const SwNode& rNd )
+sal_Bool SwAutoFormat::HasObjects( const SwNode& rNd )
{
// haengt irgend etwas absatzgebundenes am Absatz?
// z.B. Rahmen, DrawObjecte, ..
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
const SwSpzFrmFmts& rFmts = *pDoc->GetSpzFrmFmts();
- for( USHORT n = 0; n < rFmts.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rFmts.Count(); ++n )
{
const SwFmtAnchor& rAnchor = rFmts[ n ]->GetAnchor();
if ((FLY_AT_PAGE != rAnchor.GetAnchorId()) &&
rAnchor.GetCntntAnchor() &&
&rAnchor.GetCntntAnchor()->nNode.GetNode() == &rNd )
{
- bRet = TRUE;
+ bRet = sal_True;
break;
}
}
@@ -403,16 +403,16 @@ const SwTxtNode* SwAutoFormat::GetNextNode() const
}
-BOOL SwAutoFormat::IsOneLine( const SwTxtNode& rNd ) const
+sal_Bool SwAutoFormat::IsOneLine( const SwTxtNode& rNd ) const
{
SwTxtFrmInfo aFInfo( GetFrm( rNd ) );
return aFInfo.IsOneLine();
}
-BOOL SwAutoFormat::IsFastFullLine( const SwTxtNode& rNd ) const
+sal_Bool SwAutoFormat::IsFastFullLine( const SwTxtNode& rNd ) const
{
- BOOL bRet = aFlags.bRightMargin;
+ sal_Bool bRet = aFlags.bRightMargin;
if( bRet )
{
SwTxtFrmInfo aFInfo( GetFrm( rNd ) );
@@ -422,24 +422,24 @@ BOOL SwAutoFormat::IsFastFullLine( const SwTxtNode& rNd ) const
}
-BOOL SwAutoFormat::IsEnumericChar( const SwTxtNode& rNd ) const
+sal_Bool SwAutoFormat::IsEnumericChar( const SwTxtNode& rNd ) const
{
const String& rTxt = rNd.GetTxt();
String sTmp( rTxt );
xub_StrLen nBlnks = GetLeadingBlanks( sTmp );
xub_StrLen nLen = rTxt.Len() - nBlnks;
if( !nLen )
- return FALSE;
+ return sal_False;
// -, +, * getrennt durch Blank ??
if( 2 < nLen && IsSpace( rTxt.GetChar( nBlnks + 1 ) ) )
{
if( StrChr( pBulletChar, rTxt.GetChar( nBlnks ) ) )
- return TRUE;
+ return sal_True;
// sollte an der Position ein Symbolfont existieren ?
SwTxtFrmInfo aFInfo( GetFrm( rNd ) );
if( aFInfo.IsBullet( nBlnks ))
- return TRUE;
+ return sal_True;
}
// 1.) / 1. / 1.1.1 / (1). / (1) / ....
@@ -447,7 +447,7 @@ BOOL SwAutoFormat::IsEnumericChar( const SwTxtNode& rNd ) const
}
-BOOL SwAutoFormat::IsBlanksInString( const SwTxtNode& rNd ) const
+sal_Bool SwAutoFormat::IsBlanksInString( const SwTxtNode& rNd ) const
{
// suche im String mehr als 5 Blanks/Tabs
String sTmp( rNd.GetTxt() );
@@ -463,7 +463,7 @@ BOOL SwAutoFormat::IsBlanksInString( const SwTxtNode& rNd ) const
while( *pTmp && IsSpace( *++pTmp ))
;
if( 5 <= pTmp - pStt )
- return TRUE;
+ return sal_True;
}
else
++pTmp;
@@ -471,13 +471,13 @@ BOOL SwAutoFormat::IsBlanksInString( const SwTxtNode& rNd ) const
else
++pTmp;
}
- return FALSE;
+ return sal_False;
}
-USHORT SwAutoFormat::CalcLevel( const SwTxtNode& rNd, USHORT *pDigitLvl ) const
+sal_uInt16 SwAutoFormat::CalcLevel( const SwTxtNode& rNd, sal_uInt16 *pDigitLvl ) const
{
- USHORT nLvl = 0, nBlnk = 0;
+ sal_uInt16 nLvl = 0, nBlnk = 0;
const String& rTxt = rNd.GetTxt();
if( pDigitLvl )
*pDigitLvl = USHRT_MAX;
@@ -534,11 +534,11 @@ xub_StrLen SwAutoFormat::GetBigIndent( xub_StrLen& rAktSpacePos ) const
}
-BOOL SwAutoFormat::IsNoAlphaLine( const SwTxtNode& rNd ) const
+sal_Bool SwAutoFormat::IsNoAlphaLine( const SwTxtNode& rNd ) const
{
const String& rStr = rNd.GetTxt();
if( !rStr.Len() )
- return FALSE;
+ return sal_False;
// oder besser: ueber die Anzahl von Alpha/Num- und !AN-Zeichen
// bestimmen.
xub_StrLen nANChar = 0, nBlnk = 0;
@@ -550,18 +550,18 @@ BOOL SwAutoFormat::IsNoAlphaLine( const SwTxtNode& rNd ) const
else if( rCC.isLetterNumeric( rStr, n ))
++nANChar;
- // sind zu 75% keine Alpha-Nummerische-Zeichen, dann TRUE
- ULONG nLen = rStr.Len() - nBlnk;
- nLen = ( nLen * 3 ) / 4; // long overflow, if the strlen > USHORT
+ // sind zu 75% keine Alpha-Nummerische-Zeichen, dann sal_True
+ sal_uLong nLen = rStr.Len() - nBlnk;
+ nLen = ( nLen * 3 ) / 4; // long overflow, if the strlen > sal_uInt16
return xub_StrLen(nLen) < (rStr.Len() - nANChar - nBlnk);
}
-BOOL SwAutoFormat::DoUnderline()
+sal_Bool SwAutoFormat::DoUnderline()
{
if( !aFlags.bSetBorder )
- return FALSE;
+ return sal_False;
const sal_Unicode* pStr = pAktTxtNd->GetTxt().GetBuffer();
int eState = 0;
@@ -581,12 +581,12 @@ BOOL SwAutoFormat::DoUnderline()
case '~': eTmp = 5; break;
case '#': eTmp = 6; break;
default:
- return FALSE;
+ return sal_False;
}
if( 0 == eState )
eState = eTmp;
else if( eState != eTmp )
- return FALSE;
+ return sal_False;
++nCnt;
}
++pStr;
@@ -595,7 +595,7 @@ BOOL SwAutoFormat::DoUnderline()
if( 2 < nCnt )
{
// dann unterstreiche mal den vorherigen Absatz, wenn es diesen gibt!
- DelEmptyLine( FALSE );
+ DelEmptyLine( sal_False );
aDelPam.SetMark();
aDelPam.GetMark()->nContent = 0;
//JP 19.03.96: kein Underline sondern eine Umrandung setzen!
@@ -635,7 +635,7 @@ BOOL SwAutoFormat::DoUnderline()
RES_PARATR_CONNECT_BORDER, RES_PARATR_CONNECT_BORDER,
RES_BOX, RES_BOX,
0);
- aSet.Put( SwParaConnectBorderItem( FALSE ) );
+ aSet.Put( SwParaConnectBorderItem( sal_False ) );
SvxBoxItem aBox( RES_BOX );
aBox.SetLine( &aLine, BOX_LINE_BOTTOM );
aBox.SetDistance( 42 ); // ~0,75 mm
@@ -648,11 +648,11 @@ BOOL SwAutoFormat::DoUnderline()
}
-BOOL SwAutoFormat::DoTable()
+sal_Bool SwAutoFormat::DoTable()
{
if( !aFlags.bCreateTable || !aFlags.bAFmtByInput ||
pAktTxtNd->FindTableNode() )
- return FALSE;
+ return sal_False;
const String& rTmp = pAktTxtNd->GetTxt();
xub_StrLen nSttPlus = GetLeadingBlanks( rTmp );
@@ -662,7 +662,7 @@ BOOL SwAutoFormat::DoTable()
if( 2 > nEndPlus - nSttPlus ||
( '+' != ( cChar = rTmp.GetChar( nSttPlus )) && '|' != cChar ) ||
( '+' != ( cChar = rTmp.GetChar( nEndPlus - 1)) && '|' != cChar ))
- return FALSE;
+ return sal_False;
SwTxtFrmInfo aInfo( pAktTxtFrm );
@@ -683,11 +683,11 @@ BOOL SwAutoFormat::DoTable()
case '+':
case '|':
- aPosArr.Insert( static_cast<USHORT>(aInfo.GetCharPos(n)), aPosArr.Count() );
+ aPosArr.Insert( static_cast<sal_uInt16>(aInfo.GetCharPos(n)), aPosArr.Count() );
break;
default:
- return FALSE;
+ return sal_False;
}
if( ++n == nEndPlus )
break;
@@ -698,7 +698,7 @@ BOOL SwAutoFormat::DoTable()
if( 1 < aPosArr.Count() )
{
// Ausrichtung vom Textnode besorgen:
- USHORT nColCnt = aPosArr.Count() - 1;
+ sal_uInt16 nColCnt = aPosArr.Count() - 1;
SwTwips nSttPos = aPosArr[ 0 ];
sal_Int16 eHori;
switch( pAktTxtNd->GetSwAttrSet().GetAdjust().GetAdjust() )
@@ -712,7 +712,7 @@ BOOL SwAutoFormat::DoTable()
eHori = text::HoriOrientation::NONE;
// dann muss als letztes noch die akt. FrameBreite
// ins Array
- aPosArr.Insert( static_cast<USHORT>(pAktTxtFrm->Frm().Width()), aPosArr.Count() );
+ aPosArr.Insert( static_cast<sal_uInt16>(pAktTxtFrm->Frm().Width()), aPosArr.Count() );
}
else
eHori = text::HoriOrientation::LEFT;
@@ -782,7 +782,7 @@ xub_StrLen SwAutoFormat::GetTrailingBlanks( const String& rStr ) const
}
-BOOL SwAutoFormat::IsFirstCharCapital( const SwTxtNode& rNd ) const
+sal_Bool SwAutoFormat::IsFirstCharCapital( const SwTxtNode& rNd ) const
{
const String& rTxt = rNd.GetTxt();
for( xub_StrLen n = 0, nEnd = rTxt.Len(); n < nEnd; ++n )
@@ -795,11 +795,11 @@ BOOL SwAutoFormat::IsFirstCharCapital( const SwTxtNode& rNd ) const
0 != ( i18n::KCharacterType::UPPER &
nCharType );
}
- return FALSE;
+ return sal_False;
}
-USHORT SwAutoFormat::GetDigitLevel( const SwTxtNode& rNd, xub_StrLen& rPos,
+sal_uInt16 SwAutoFormat::GetDigitLevel( const SwTxtNode& rNd, xub_StrLen& rPos,
String* pPreFix, String* pPostFix, String* pNumTypes ) const
{
// Teste auf 1.) / 1. / 1.1.1 / (1). / (1) / ....
@@ -807,11 +807,11 @@ USHORT SwAutoFormat::GetDigitLevel( const SwTxtNode& rNd, xub_StrLen& rPos,
xub_StrLen nPos = rPos;
int eScan = NONE;
- USHORT nStart = 0;
- BYTE nDigitLvl = 0, nDigitCnt = 0;
+ sal_uInt16 nStart = 0;
+ sal_uInt8 nDigitLvl = 0, nDigitCnt = 0;
//count number of parenthesis to assure a sensible order is found
- USHORT nOpeningParentheses = 0;
- USHORT nClosingParentheses = 0;
+ sal_uInt16 nOpeningParentheses = 0;
+ sal_uInt16 nClosingParentheses = 0;
CharClass& rCC = GetCharClass( rNd.GetSwAttrSet().GetLanguage().GetLanguage() );
@@ -851,7 +851,7 @@ USHORT SwAutoFormat::GetDigitLevel( const SwTxtNode& rNd, xub_StrLen& rPos,
}
else if( rCC.isAlpha( rTxt, nPos ) )
{
- BOOL bIsUpper =
+ sal_Bool bIsUpper =
0 != ( i18n::KCharacterType::UPPER &
rCC.getCharacterType( rTxt, nPos ));
sal_Unicode cLow = rCC.toLower( rTxt, nPos, 1 ).GetChar(0), cNumTyp;
@@ -930,8 +930,8 @@ USHORT SwAutoFormat::GetDigitLevel( const SwTxtNode& rNd, xub_StrLen& rPos,
else
{
// roemische Zahlen: checke ob das gueltige Zeichen sind
- USHORT nVal;
- BOOL bError = FALSE;
+ sal_uInt16 nVal;
+ sal_Bool bError = sal_False;
switch( cLow )
{
case 'm': nVal = 1000; goto CHECK_ROMAN_1;
@@ -950,43 +950,43 @@ CHECK_ROMAN_1:
if( nMod5 == ((3 * nVal) + n10 ) ||
nMod5 == ((4 * nVal) + n10 ) ||
nLast == n10 )
- nStart = static_cast<USHORT>(nStart + (n10 * 8));
+ nStart = static_cast<sal_uInt16>(nStart + (n10 * 8));
else if( nMod5 == 0 ||
nMod5 == (1 * nVal) ||
nMod5 == (2 * nVal) )
nStart = nStart + nVal;
else
- bError = TRUE;
+ bError = sal_True;
}
break;
CHECK_ROMAN_5:
{
if( ( nStart / nVal ) & 1 )
- bError = TRUE;
+ bError = sal_True;
else
{
int nMod = nStart % nVal;
int n10 = nVal / 5;
if( n10 == nMod )
- nStart = static_cast<USHORT>(nStart + (3 * n10));
+ nStart = static_cast<sal_uInt16>(nStart + (3 * n10));
else if( 0 == nMod )
nStart = nStart + nVal;
else
- bError = TRUE;
+ bError = sal_True;
}
}
break;
case 'i':
if( nStart % 5 >= 3 )
- bError = TRUE;
+ bError = sal_True;
else
nStart += 1;
break;
default:
- bError = TRUE;
+ bError = sal_True;
}
if( bError )
@@ -1041,7 +1041,7 @@ CHECK_ROMAN_5:
}
-void SwAutoFormat::SetColl( USHORT nId, BOOL bHdLineOrText )
+void SwAutoFormat::SetColl( sal_uInt16 nId, sal_Bool bHdLineOrText )
{
aDelPam.DeleteMark();
aDelPam.GetPoint()->nNode = aNdIdx;
@@ -1064,7 +1064,7 @@ void SwAutoFormat::SetColl( USHORT nId, BOOL bHdLineOrText )
// sonst nur den Blocksatz
SvxAdjustItem* pAdj;
if( SFX_ITEM_SET == aSet.GetItemState( RES_PARATR_ADJUST,
- FALSE, (const SfxPoolItem**)&pAdj ))
+ sal_False, (const SfxPoolItem**)&pAdj ))
{
SvxAdjust eAdj = pAdj->GetAdjust();
if( bHdLineOrText ? (SVX_ADJUST_RIGHT != eAdj &&
@@ -1078,7 +1078,7 @@ void SwAutoFormat::SetColl( USHORT nId, BOOL bHdLineOrText )
}
-BOOL SwAutoFormat::HasSelBlanks( SwPaM& rPam ) const
+sal_Bool SwAutoFormat::HasSelBlanks( SwPaM& rPam ) const
{
// noch ein Blank am Anfang oder Ende ?
// nicht loeschen, wird wieder eingefuegt.
@@ -1101,38 +1101,38 @@ BOOL SwAutoFormat::HasSelBlanks( SwPaM& rPam ) const
// ( ' ' == ( cCh = pTxtNd->GetTxt()[ nBlnkPos ] ) || '\t' == cCh ))
pPos->nContent++;
else
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
-BOOL SwAutoFormat::HasBreakAttr( const SwTxtNode& rTxtNd ) const
+sal_Bool SwAutoFormat::HasBreakAttr( const SwTxtNode& rTxtNd ) const
{
const SfxItemSet* pSet = rTxtNd.GetpSwAttrSet();
if( !pSet )
- return FALSE;
+ return sal_False;
const SfxPoolItem* pItem;
- if( SFX_ITEM_SET == pSet->GetItemState( RES_BREAK, FALSE, &pItem )
+ if( SFX_ITEM_SET == pSet->GetItemState( RES_BREAK, sal_False, &pItem )
&& SVX_BREAK_NONE != ((SvxFmtBreakItem*)pItem)->GetBreak() )
- return TRUE;
+ return sal_True;
- if( SFX_ITEM_SET == pSet->GetItemState( RES_PAGEDESC, FALSE, &pItem )
+ if( SFX_ITEM_SET == pSet->GetItemState( RES_PAGEDESC, sal_False, &pItem )
&& ((SwFmtPageDesc*)pItem)->GetPageDesc()
&& nsUseOnPage::PD_NONE != ((SwFmtPageDesc*)pItem)->GetPageDesc()->GetUseOn() )
- return TRUE;
- return FALSE;
+ return sal_True;
+ return sal_False;
}
// ist ein Punkt am Ende ??
-BOOL SwAutoFormat::IsSentenceAtEnd( const SwTxtNode& rTxtNd ) const
+sal_Bool SwAutoFormat::IsSentenceAtEnd( const SwTxtNode& rTxtNd ) const
{
const String& rStr = rTxtNd.GetTxt();
xub_StrLen n = rStr.Len();
if( !n )
- return TRUE;
+ return sal_True;
while( --n && IsSpace( rStr.GetChar( n ) ) )
;
@@ -1141,7 +1141,7 @@ BOOL SwAutoFormat::IsSentenceAtEnd( const SwTxtNode& rTxtNd ) const
// loesche im Node Anfang oder/und Ende
-void SwAutoFormat::DeleteAktPara( BOOL bStart, BOOL bEnd )
+void SwAutoFormat::DeleteAktPara( sal_Bool bStart, sal_Bool bEnd )
{
if( aFlags.bAFmtByInput
? aFlags.bAFmtByInpDelSpacesAtSttEnd
@@ -1200,7 +1200,7 @@ void SwAutoFormat::DeleteSel( SwPaM& rDelPam )
pEditShell->DeleteSel( rDelPam );
}
-BOOL SwAutoFormat::DeleteAktNxtPara( const String& rNxtPara )
+sal_Bool SwAutoFormat::DeleteAktNxtPara( const String& rNxtPara )
{
// Loesche Blanks am Ende vom akt. und am Anfang vom naechsten
aDelPam.DeleteMark();
@@ -1223,7 +1223,7 @@ BOOL SwAutoFormat::DeleteAktNxtPara( const String& rNxtPara )
// noch ein Blank am Anfang oder Ende ?
// nicht loeschen, wird wieder eingefuegt.
- BOOL bHasBlnks = HasSelBlanks( aDelPam );
+ sal_Bool bHasBlnks = HasSelBlanks( aDelPam );
if( *aDelPam.GetPoint() != *aDelPam.GetMark() )
DeleteSel( aDelPam );
@@ -1233,7 +1233,7 @@ BOOL SwAutoFormat::DeleteAktNxtPara( const String& rNxtPara )
}
-void SwAutoFormat::DelEmptyLine( BOOL bTstNextPara )
+void SwAutoFormat::DelEmptyLine( sal_Bool bTstNextPara )
{
SetRedlineTxt( STR_AUTOFMTREDL_DEL_EMPTY_PARA );
// Loesche Blanks den leeren Absatz
@@ -1243,7 +1243,7 @@ void SwAutoFormat::DelEmptyLine( BOOL bTstNextPara )
aDelPam.SetMark();
aDelPam.GetMark()->nNode--;
- SwTxtNode* pTNd = aDelPam.GetNode( FALSE )->GetTxtNode();
+ SwTxtNode* pTNd = aDelPam.GetNode( sal_False )->GetTxtNode();
if( pTNd )
// erstmal den vorherigen Textnode benutzen.
aDelPam.GetMark()->nContent.Assign( pTNd, pTNd->GetTxt().Len() );
@@ -1252,7 +1252,7 @@ void SwAutoFormat::DelEmptyLine( BOOL bTstNextPara )
// dann versuche den naechsten (am Anfang vom Dok, Tabellen-Zellen,
// Rahmen, ...
aDelPam.GetMark()->nNode += 2;
- pTNd = aDelPam.GetNode( FALSE )->GetTxtNode();
+ pTNd = aDelPam.GetNode( sal_False )->GetTxtNode();
if( pTNd )
{
aDelPam.GetMark()->nContent.Assign( pTNd, 0 );
@@ -1273,7 +1273,7 @@ void SwAutoFormat::DelEmptyLine( BOOL bTstNextPara )
}
-void SwAutoFormat::DelMoreLinesBlanks( BOOL bWithLineBreaks )
+void SwAutoFormat::DelMoreLinesBlanks( sal_Bool bWithLineBreaks )
{
if( aFlags.bAFmtByInput
? aFlags.bAFmtByInpDelSpacesBetweenLines
@@ -1292,7 +1292,7 @@ void SwAutoFormat::DelMoreLinesBlanks( BOOL bWithLineBreaks )
pNxt = (SwPaM*)aDelPam.GetNext();
if( pNxt->HasMark() && *pNxt->GetPoint() != *pNxt->GetMark() )
{
- BOOL bHasBlnks = HasSelBlanks( *pNxt );
+ sal_Bool bHasBlnks = HasSelBlanks( *pNxt );
DeleteSel( *pNxt );
if( !bHasBlnks )
{
@@ -1303,7 +1303,7 @@ void SwAutoFormat::DelMoreLinesBlanks( BOOL bWithLineBreaks )
if( pNxt == &aDelPam )
break;
delete pNxt;
- } while( TRUE );
+ } while( sal_True );
aDelPam.DeleteMark();
}
@@ -1335,9 +1335,9 @@ void SwAutoFormat::BuildIndent()
SetRedlineTxt( STR_AUTOFMTREDL_SET_TMPL_INDENT );
// lese alle nachfolgenden Absaetze die zu diesem Einzug gehoeren
- BOOL bBreak = TRUE;
+ sal_Bool bBreak = sal_True;
if( bMoreLines )
- DelMoreLinesBlanks( TRUE );
+ DelMoreLinesBlanks( sal_True );
else
bBreak = !IsFastFullLine( *pAktTxtNd ) ||
IsBlanksInString( *pAktTxtNd ) ||
@@ -1364,7 +1364,7 @@ void SwAutoFormat::BuildIndent()
!CalcLevel( *pNxtNd ) );
}
}
- DeleteAktPara( TRUE, TRUE );
+ DeleteAktPara( sal_True, sal_True );
AutoCorrect();
}
@@ -1373,16 +1373,16 @@ void SwAutoFormat::BuildTextIndent()
{
SetRedlineTxt( STR_AUTOFMTREDL_SET_TMPL_TEXT_INDENT);
// lese alle nachfolgenden Absaetze die zu diesem Einzug gehoeren
- BOOL bBreak = TRUE;
+ sal_Bool bBreak = sal_True;
if( bMoreLines )
- DelMoreLinesBlanks( TRUE );
+ DelMoreLinesBlanks( sal_True );
else
bBreak = !IsFastFullLine( *pAktTxtNd ) ||
IsBlanksInString( *pAktTxtNd ) ||
IsSentenceAtEnd( *pAktTxtNd );
if( aFlags.bAFmtByInput )
- pAktTxtNd->SetAutoFmtLvl( (BYTE)CalcLevel( *pAktTxtNd ) );
+ pAktTxtNd->SetAutoFmtLvl( (sal_uInt8)CalcLevel( *pAktTxtNd ) );
SetColl( RES_POOLCOLL_TEXT_MOVE );
if( !bBreak )
@@ -1403,7 +1403,7 @@ void SwAutoFormat::BuildTextIndent()
pNxtNd = GetNextNode();
}
}
- DeleteAktPara( TRUE, TRUE );
+ DeleteAktPara( sal_True, sal_True );
AutoCorrect();
}
@@ -1413,14 +1413,14 @@ void SwAutoFormat::BuildText()
SetRedlineTxt( STR_AUTOFMTREDL_SET_TMPL_TEXT );
// lese alle nachfolgenden Absaetze die zu diesem Text
// ohne Einzug gehoeren
- BOOL bBreak = TRUE;
+ sal_Bool bBreak = sal_True;
if( bMoreLines )
DelMoreLinesBlanks();
else
bBreak = !IsFastFullLine( *pAktTxtNd ) ||
IsBlanksInString( *pAktTxtNd ) ||
IsSentenceAtEnd( *pAktTxtNd );
- SetColl( RES_POOLCOLL_TEXT, TRUE );
+ SetColl( RES_POOLCOLL_TEXT, sal_True );
if( !bBreak )
{
SetRedlineTxt( STR_AUTOFMTREDL_DEL_MORELINES );
@@ -1442,16 +1442,16 @@ void SwAutoFormat::BuildText()
break;
}
}
- DeleteAktPara( TRUE, TRUE );
+ DeleteAktPara( sal_True, sal_True );
AutoCorrect();
}
-void SwAutoFormat::BuildEnum( USHORT nLvl, USHORT nDigitLevel )
+void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel )
{
SetRedlineTxt( STR_AUTOFMTREDL_SET_NUMBULET );
- BOOL bBreak = TRUE;
+ sal_Bool bBreak = sal_True;
// als erstes den akt. Einzug bestimmen und die Framebreite bestimmen
SwTwips nFrmWidth = pAktTxtFrm->Prt().Width();;
@@ -1474,9 +1474,9 @@ void SwAutoFormat::BuildEnum( USHORT nLvl, USHORT nDigitLevel )
IsSentenceAtEnd( *pAktTxtNd );
sal_Bool bRTL = pEditShell->IsInRightToLeftText();
// SetColl( RES_POOLCOLL_NUM_LEVEL1 + ( nLvl * 4 ) );
- DeleteAktPara( TRUE, TRUE );
+ DeleteAktPara( sal_True, sal_True );
- BOOL bChgBullet = FALSE, bChgEnum = FALSE;
+ sal_Bool bChgBullet = sal_False, bChgEnum = sal_False;
xub_StrLen nAutoCorrPos = 0;
// falls die Numerierung gesetzt werden, die akt. besorgen
@@ -1506,7 +1506,7 @@ void SwAutoFormat::BuildEnum( USHORT nLvl, USHORT nDigitLevel )
{
SwCharFmt* pCFmt = pDoc->GetCharFmtFromPool(
RES_POOLCHR_BUL_LEVEL );
- bChgBullet = TRUE;
+ bChgBullet = sal_True;
// wurde das Format schon mal angepasst?
if( !aRule.GetNumFmt( nLvl ) )
{
@@ -1532,11 +1532,11 @@ void SwAutoFormat::BuildEnum( USHORT nLvl, USHORT nDigitLevel )
// <--
}
- USHORT nAbsPos = lBullIndent;
- USHORT nSpaceSteps = nLvl
- ? USHORT(nLeftTxtPos / nLvl)
+ sal_uInt16 nAbsPos = lBullIndent;
+ sal_uInt16 nSpaceSteps = nLvl
+ ? sal_uInt16(nLeftTxtPos / nLvl)
: lBullIndent;
- for( BYTE n = 0; n < MAXLEVEL; ++n, nAbsPos = nAbsPos + nSpaceSteps )
+ for( sal_uInt8 n = 0; n < MAXLEVEL; ++n, nAbsPos = nAbsPos + nSpaceSteps )
{
SwNumFmt aFmt( aRule.Get( n ) );
aFmt.SetBulletFont( pBullFnt );
@@ -1553,7 +1553,7 @@ void SwAutoFormat::BuildEnum( USHORT nLvl, USHORT nDigitLevel )
if( n == nLvl &&
nFrmWidth < ( nSpaceSteps * MAXLEVEL ) )
- nSpaceSteps = static_cast<USHORT>(( nFrmWidth - nLeftTxtPos ) /
+ nSpaceSteps = static_cast<sal_uInt16>(( nFrmWidth - nLeftTxtPos ) /
( MAXLEVEL - nLvl ));
}
}
@@ -1561,8 +1561,8 @@ void SwAutoFormat::BuildEnum( USHORT nLvl, USHORT nDigitLevel )
}
else
{
- bChgBullet = TRUE;
- SetColl( static_cast<USHORT>(RES_POOLCOLL_BUL_LEVEL1 + ( Min( nLvl, cnNumBullColls ) * 4 )) );
+ bChgBullet = sal_True;
+ SetColl( static_cast<sal_uInt16>(RES_POOLCOLL_BUL_LEVEL1 + ( Min( nLvl, cnNumBullColls ) * 4 )) );
}
}
else
@@ -1577,13 +1577,13 @@ void SwAutoFormat::BuildEnum( USHORT nLvl, USHORT nDigitLevel )
if( USHRT_MAX != ( nDigitLevel = GetDigitLevel( *pAktTxtNd, nTxtStt,
&aPreFix, &aPostFix, &aNumTypes )) )
{
- bChgEnum = TRUE;
+ bChgEnum = sal_True;
// Ebene 0 und Einrueckung dann wird die Ebene durch den linken
// Einzug und der default NumEinrueckung bestimmt.
if( !nDigitLevel && nLeftTxtPos )
- nLvl = Min( USHORT( nLeftTxtPos / lNumIndent ),
- USHORT( MAXLEVEL - 1 ) );
+ nLvl = Min( sal_uInt16( nLeftTxtPos / lNumIndent ),
+ sal_uInt16( MAXLEVEL - 1 ) );
else
nLvl = nDigitLevel;
}
@@ -1597,7 +1597,7 @@ void SwAutoFormat::BuildEnum( USHORT nLvl, USHORT nDigitLevel )
if( !nDigitLevel )
{
SwNumFmt aFmt( aRule.Get( nLvl ) );
- aFmt.SetStart( static_cast<USHORT>(aPreFix.GetToken( 1,
+ aFmt.SetStart( static_cast<sal_uInt16>(aPreFix.GetToken( 1,
(sal_Unicode)1 ).ToInt32()));
aFmt.SetPrefix( aPreFix.GetToken( 0, (sal_Unicode)1 ));
aFmt.SetSuffix( aPostFix.GetToken( 0, (sal_Unicode)1 ));
@@ -1615,13 +1615,13 @@ void SwAutoFormat::BuildEnum( USHORT nLvl, USHORT nDigitLevel )
}
else
{
- USHORT nSpaceSteps = nLvl ? USHORT(nLeftTxtPos / nLvl) : 0;
- BYTE n;
+ sal_uInt16 nSpaceSteps = nLvl ? sal_uInt16(nLeftTxtPos / nLvl) : 0;
+ sal_uInt8 n;
for( n = 0; n <= nLvl; ++n )
{
SwNumFmt aFmt( aRule.Get( n ) );
- aFmt.SetStart( static_cast<USHORT>(aPreFix.GetToken( n+1,
+ aFmt.SetStart( static_cast<sal_uInt16>(aPreFix.GetToken( n+1,
(sal_Unicode)1 ).ToInt32() ));
if( !n )
aFmt.SetPrefix( aPreFix.GetToken( n, (sal_Unicode)1 ));
@@ -1630,7 +1630,7 @@ void SwAutoFormat::BuildEnum( USHORT nLvl, USHORT nDigitLevel )
if( n < aNumTypes.Len() )
aFmt.SetNumberingType((aNumTypes.GetChar( n ) - '0'));
- aFmt.SetAbsLSpace( USHORT( nSpaceSteps * n )
+ aFmt.SetAbsLSpace( sal_uInt16( nSpaceSteps * n )
+ lNumIndent );
if( !aFmt.GetCharFmt() )
@@ -1642,16 +1642,16 @@ void SwAutoFormat::BuildEnum( USHORT nLvl, USHORT nDigitLevel )
}
// passt alles vollstaendig in den Frame?
- BOOL bDefStep = nFrmWidth < (nSpaceSteps * MAXLEVEL);
+ sal_Bool bDefStep = nFrmWidth < (nSpaceSteps * MAXLEVEL);
for( ; n < MAXLEVEL; ++n )
{
SwNumFmt aFmt( aRule.Get( n ) );
aFmt.SetIncludeUpperLevels( MAXLEVEL );
if( bDefStep )
- aFmt.SetAbsLSpace( USHORT( (nLeftTxtPos +
- SwNumRule::GetNumIndent(static_cast<BYTE>(n-nLvl)))));
+ aFmt.SetAbsLSpace( sal_uInt16( (nLeftTxtPos +
+ SwNumRule::GetNumIndent(static_cast<sal_uInt8>(n-nLvl)))));
else
- aFmt.SetAbsLSpace( USHORT( nSpaceSteps * n )
+ aFmt.SetAbsLSpace( sal_uInt16( nSpaceSteps * n )
+ lNumIndent );
aRule.Set( n, aFmt );
}
@@ -1659,9 +1659,9 @@ void SwAutoFormat::BuildEnum( USHORT nLvl, USHORT nDigitLevel )
}
}
else if( !aFlags.bAFmtByInput )
- SetColl( static_cast<USHORT>(RES_POOLCOLL_NUM_LEVEL1 + ( Min( nLvl, cnNumBullColls ) * 4 ) ));
+ SetColl( static_cast<sal_uInt16>(RES_POOLCOLL_NUM_LEVEL1 + ( Min( nLvl, cnNumBullColls ) * 4 ) ));
else
- bChgEnum = FALSE;
+ bChgEnum = sal_False;
}
if( bChgEnum || bChgBullet )
@@ -1675,11 +1675,11 @@ void SwAutoFormat::BuildEnum( USHORT nLvl, USHORT nDigitLevel )
{
aDelPam.SetMark();
aDelPam.GetMark()->nNode++;
- aDelPam.GetNode(FALSE)->GetTxtNode()->SetAttrListLevel( nLvl );
+ aDelPam.GetNode(sal_False)->GetTxtNode()->SetAttrListLevel( nLvl );
}
pAktTxtNd->SetAttrListLevel(nLvl);
- pAktTxtNd->SetNumLSpace( TRUE );
+ pAktTxtNd->SetNumLSpace( sal_True );
// --> OD 2008-03-17 #refactorlists#
// start new list
@@ -1758,7 +1758,7 @@ void SwAutoFormat::BuildEnum( USHORT nLvl, USHORT nDigitLevel )
if(!pNxtNd || pCurrNode == pNxtNd)
break;
}
- DeleteAktPara( FALSE, TRUE );
+ DeleteAktPara( sal_False, sal_True );
AutoCorrect( nAutoCorrPos );
}
@@ -1771,28 +1771,28 @@ void SwAutoFormat::BuildNegIndent( SwTwips nSpaces )
// Einrueckung in der 2.Zeile)
// lese alle nachfolgenden Absaetze die zu dieser Aufzaehlung gehoeren
- BOOL bBreak = TRUE;
+ sal_Bool bBreak = sal_True;
xub_StrLen nSpacePos, nTxtPos = GetBigIndent( nSpacePos );
if( bMoreLines )
- DelMoreLinesBlanks( TRUE );
+ DelMoreLinesBlanks( sal_True );
else
bBreak = !IsFastFullLine( *pAktTxtNd ) ||
( !nTxtPos && IsBlanksInString( *pAktTxtNd )) ||
IsSentenceAtEnd( *pAktTxtNd );
- SetColl( static_cast<USHORT>( nTxtPos
+ SetColl( static_cast<sal_uInt16>( nTxtPos
? RES_POOLCOLL_CONFRONTATION
: RES_POOLCOLL_TEXT_NEGIDENT ) );
if( nTxtPos )
{
const String& rStr = pAktTxtNd->GetTxt();
- BOOL bInsTab = TRUE;
+ sal_Bool bInsTab = sal_True;
if( '\t' == rStr.GetChar( nSpacePos+1 )) // ein Tab, das belassen wir
{
--nSpacePos;
- bInsTab = FALSE;
+ bInsTab = sal_False;
}
xub_StrLen nSpaceStt = nSpacePos;
@@ -1803,7 +1803,7 @@ void SwAutoFormat::BuildNegIndent( SwTwips nSpaces )
if( bInsTab && '\t' == rStr.GetChar( nSpaceStt ) ) // ein Tab, das belassen wir
{
++nSpaceStt;
- bInsTab = FALSE;
+ bInsTab = sal_False;
}
@@ -1846,12 +1846,12 @@ void SwAutoFormat::BuildNegIndent( SwTwips nSpaces )
pNxtNd = GetNextNode();
}
}
- DeleteAktPara( TRUE, TRUE );
+ DeleteAktPara( sal_True, sal_True );
AutoCorrect();
}
-void SwAutoFormat::BuildHeadLine( USHORT nLvl )
+void SwAutoFormat::BuildHeadLine( sal_uInt16 nLvl )
{
if( aFlags.bWithRedlining )
{
@@ -1863,14 +1863,14 @@ void SwAutoFormat::BuildHeadLine( USHORT nLvl )
pDoc->SetAutoFmtRedlineComment( &sTxt );
}
- SetColl( static_cast<USHORT>(RES_POOLCOLL_HEADLINE1 + nLvl ), TRUE );
+ SetColl( static_cast<sal_uInt16>(RES_POOLCOLL_HEADLINE1 + nLvl ), sal_True );
if( aFlags.bAFmtByInput )
{
SwTxtFmtColl& rNxtColl = pAktTxtNd->GetTxtColl()->GetNextTxtFmtColl();
DelPrevPara();
- DeleteAktPara( TRUE, FALSE );
+ DeleteAktPara( sal_True, sal_False );
DeleteAktNxtPara( aEmptyStr );
aDelPam.DeleteMark();
@@ -1880,7 +1880,7 @@ void SwAutoFormat::BuildHeadLine( USHORT nLvl )
}
else
{
- DeleteAktPara( TRUE, TRUE );
+ DeleteAktPara( sal_True, sal_True );
AutoCorrect();
}
}
@@ -1906,7 +1906,7 @@ void SwAutoFormat::AutoCorrect( xub_StrLen nPos )
if( nPos >= pTxt->Len() )
return;
- BOOL bGetLanguage = aFlags.bChgOrdinalNumber ||
+ sal_Bool bGetLanguage = aFlags.bChgOrdinalNumber ||
aFlags.bChgToEnEmDash || aFlags.bSetINetAttr ||
aFlags.bCptlSttWrd || aFlags.bCptlSttSntnc ||
aFlags.bAddNonBrkSpace;
@@ -1921,7 +1921,7 @@ void SwAutoFormat::AutoCorrect( xub_StrLen nPos )
SwTxtFrmInfo aFInfo( 0 );
xub_StrLen nSttPos, nLastBlank = nPos;
- BOOL bFirst = aFlags.bCptlSttSntnc, bFirstSent = bFirst;
+ sal_Bool bFirst = aFlags.bCptlSttSntnc, bFirstSent = bFirst;
sal_Unicode cChar = 0;
CharClass& rAppCC = GetAppCharClass();
@@ -1944,17 +1944,17 @@ void SwAutoFormat::AutoCorrect( xub_StrLen nPos )
{
SetRedlineTxt( STR_AUTOFMTREDL_TYPO );
aDelPam.GetPoint()->nContent = nPos;
- BOOL bSetHardBlank = FALSE;
+ sal_Bool bSetHardBlank = sal_False;
String sReplace( pATst->GetQuote( aACorrDoc,
- nPos, cChar, TRUE ));
+ nPos, cChar, sal_True ));
aDelPam.SetMark();
aDelPam.GetPoint()->nContent = nPos+1;
if( 2 == sReplace.Len() && ' ' == sReplace.GetChar( 1 ))
{
sReplace.Erase( 1 );
- bSetHardBlank = TRUE;
+ bSetHardBlank = sal_True;
}
pDoc->ReplaceRange( aDelPam, sReplace, false );
@@ -1977,7 +1977,7 @@ void SwAutoFormat::AutoCorrect( xub_StrLen nPos )
}
}
- int bCallACorr = FALSE;
+ int bCallACorr = sal_False;
int bBreak = 0;
if( nPos && IsSpace( pTxt->GetChar( nPos-1 )))
nLastBlank = nPos;
@@ -1995,15 +1995,15 @@ void SwAutoFormat::AutoCorrect( xub_StrLen nPos )
if( !aFInfo.IsBullet( nPos ))
{
SetRedlineTxt( STR_AUTOFMTREDL_TYPO );
- BOOL bSetHardBlank = FALSE;
+ sal_Bool bSetHardBlank = sal_False;
aDelPam.GetPoint()->nContent = nPos;
String sReplace( pATst->GetQuote( aACorrDoc,
- nPos, cChar, FALSE ));
+ nPos, cChar, sal_False ));
if( 2 == sReplace.Len() && ' ' == sReplace.GetChar( 0 ))
{
sReplace.Erase( 0, 1 );
- bSetHardBlank = TRUE;
+ bSetHardBlank = sal_True;
}
aDelPam.SetMark();
@@ -2088,7 +2088,7 @@ void SwAutoFormat::AutoCorrect( xub_StrLen nPos )
case '!':
case '?':
if( aFlags.bCptlSttSntnc )
- bFirstSent = TRUE;
+ bFirstSent = sal_True;
//alle Wortrenner loesen die Autokorrektur aus!
// break;
default:
@@ -2107,15 +2107,15 @@ void SwAutoFormat::AutoCorrect( xub_StrLen nPos )
if( nPos == nSttPos )
{
if( ++nPos == pTxt->Len() )
- bCallACorr = TRUE;
+ bCallACorr = sal_True;
}
else
- bCallACorr = TRUE;
+ bCallACorr = sal_True;
if( bCallACorr )
{
- bCallACorr = FALSE;
+ bCallACorr = sal_False;
aDelPam.GetPoint()->nContent = nPos;
SetRedlineTxt( STR_AUTOFMTREDL_USE_REPLACE );
if( aFlags.bAutoCorrect &&
@@ -2168,12 +2168,12 @@ void SwAutoFormat::AutoCorrect( xub_StrLen nPos )
if( aFlags.bCptlSttSntnc && bFirst )
{
SetRedlineTxt( STR_AUTOFMTREDL_CPTL_STT_SENT );
- pATst->FnCptlSttSntnc( aACorrDoc, *pTxt, TRUE, nSttPos, nPos, eLang);
- bFirst = FALSE;
+ pATst->FnCptlSttSntnc( aACorrDoc, *pTxt, sal_True, nSttPos, nPos, eLang);
+ bFirst = sal_False;
}
bFirst = bFirstSent;
- bFirstSent = FALSE;
+ bFirstSent = sal_False;
if( aFlags.bWithRedlining )
{
@@ -2206,14 +2206,14 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags,
"Kein Bereich angegeben" );
if( aFlags.bSetNumRule && !aFlags.bAFmtByInput )
- aFlags.bSetNumRule = FALSE;
+ aFlags.bSetNumRule = sal_False;
- BOOL bReplaceStyles = !aFlags.bAFmtByInput || aFlags.bReplaceStyles;
+ sal_Bool bReplaceStyles = !aFlags.bAFmtByInput || aFlags.bReplaceStyles;
const SwTxtNode* pNxtNd = 0;
- BOOL bNxtEmpty = FALSE;
- BOOL bNxtAlpha = FALSE;
- USHORT nNxtLevel = 0;
+ sal_Bool bNxtEmpty = sal_False;
+ sal_Bool bNxtAlpha = sal_False;
+ sal_uInt16 nNxtLevel = 0;
// setze den Bereich zum Autoformatieren
if( pSttNd )
@@ -2230,9 +2230,9 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags,
IsNoAlphaLine( *pNxtNd );
}
else
- bEmptyLine = TRUE; // am Dokument Anfang
+ bEmptyLine = sal_True; // am Dokument Anfang
- bEnde = FALSE;
+ bEnde = sal_False;
// setze die Werte fuer die Prozent-Anzeige
nEndNdIdx = aEndNdIdx.GetIndex();
@@ -2245,7 +2245,7 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags,
RedlineMode_t eRedlMode = pDoc->GetRedlineMode(), eOldMode = eRedlMode;
if( aFlags.bWithRedlining )
{
- pDoc->SetAutoFmtRedline( TRUE );
+ pDoc->SetAutoFmtRedline( sal_True );
eRedlMode = (RedlineMode_t)(nsRedlineMode_t::REDLINE_ON | nsRedlineMode_t::REDLINE_SHOW_INSERT);
}
else
@@ -2253,16 +2253,16 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags,
pDoc->SetRedlineMode( eRedlMode );
// save undo state (might be turned off)
- sal_Bool bUndoState = pDoc->DoesUndo();
+ bool const bUndoState = pDoc->GetIDocumentUndoRedo().DoesUndo();
// wenn mehrere Zeilen, dann erstmal nicht mit
// dem nachfolgenden Absatz zusammenfassen.
- bMoreLines = FALSE;
+ bMoreLines = sal_False;
nLastCalcHeadLvl = nLastCalcEnumLvl = 0;
nLastHeadLvl = nLastEnumLvl = USHRT_MAX;
- USHORT nLevel = 0;
- USHORT nDigitLvl = 0;
+ sal_uInt16 nLevel = 0;
+ sal_uInt16 nDigitLvl = 0;
// defaulten
SwTxtFrmInfo aFInfo( 0 );
@@ -2271,51 +2271,6 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags,
eStat = READ_NEXT_PARA;
while( !bEnde )
{
- // #95884# limit redline array size to prevent overflow and to conserve
- // memory
- if( pDoc->HasTooManyUndos() )
- {
- DBG_ASSERT( bUndoState, "undo overflow without undo?" );
-
- //ask user
- short nResult = m_nActionWhileAutoformatUndoBufferOverflow; // TODO: #102007# read the last decision of the user from configuration
- if(m_bAskForCancelUndoWhileBufferOverflow) // #102007# TODO: read the last decision of the user from configuration
- {
- Window* pParent = pEditShell?pEditShell->GetWin():NULL;
- WarningBox aWarning( pParent,SW_RES(MSG_DISABLE_UNDO_QUESTION));
- aWarning.SetDefaultCheckBoxText();
- USHORT nDefaultButton = nResult==RET_YES?BUTTONID_YES:(nResult==RET_NO?BUTTONID_NO:BUTTONID_CANCEL);
- aWarning.SetFocusButton(nDefaultButton);
- nResult = aWarning.Execute();
- m_bAskForCancelUndoWhileBufferOverflow = !aWarning.GetCheckBoxState();
- m_nActionWhileAutoformatUndoBufferOverflow = nResult;
- // TODO: #102007# store m_bAskForCancelUndoWhileBufferOverflow in configuration
- // TODO: #102007# store m_nActionWhileAutoformatUndoBufferOverflow in configuration
- }
-
- DBG_ASSERT( (nResult == RET_YES) || (nResult == RET_CANCEL) || (nResult == RET_NO),
- "unexpected result" );
-
- if( nResult == RET_YES )
- {
- // turn off undo and continue
- pDoc->DoUndo( sal_False );
- pDoc->DelAllUndoObj();
- }
- else if( nResult == RET_NO )
- {
- //stop autoformatting and keep changes
- eStat = IS_ENDE;
- }
- else if( nResult == RET_CANCEL )
- {
- //cancel autoformatting and undo changes
- eStat = IS_ENDE;
-
- // TODO: #102004# undo changes
- }
- }
-
switch( eStat )
{
case READ_NEXT_PARA:
@@ -2330,8 +2285,8 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags,
{
if( aFlags.bDelEmptyNode && !HasObjects( *pAktTxtNd ) )
{
- bEmptyLine = TRUE;
- ULONG nOldCnt = pDoc->GetNodes().Count();
+ bEmptyLine = sal_True;
+ sal_uLong nOldCnt = pDoc->GetNodes().Count();
DelEmptyLine();
// wurde wiklich ein Node geloescht ?
if( nOldCnt != pDoc->GetNodes().Count() )
@@ -2351,7 +2306,7 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags,
{
//JP 30.09.96: das DoTable() verlaesst sich auf das
// Pop und Move - Crsr nach dem AutoFormat!
- pEdShell->Pop( FALSE );
+ pEdShell->Pop( sal_False );
*pEdShell->GetCrsr() = aDelPam;
pEdShell->Push();
@@ -2364,8 +2319,8 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags,
// geloescht werden!
if( !DoUnderline() && bReplaceStyles )
{
- SetColl( RES_POOLCOLL_STANDARD, TRUE );
- bEmptyLine = TRUE;
+ SetColl( RES_POOLCOLL_STANDARD, sal_True );
+ bEmptyLine = sal_True;
}
eStat = READ_NEXT_PARA;
}
@@ -2378,12 +2333,12 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags,
if( pAktTxtNd->GetNumRule() )
{
// in Numerierung nichts machen, zum naechsten
- bEmptyLine = FALSE;
+ bEmptyLine = sal_False;
eStat = READ_NEXT_PARA;
// loesche alle Blanks am Anfang/Ende
// und alle mitten drin
//JP 29.04.98: erstmal nur alle "mitten drin".
- DelMoreLinesBlanks( FALSE );
+ DelMoreLinesBlanks( sal_False );
break;
}
@@ -2392,7 +2347,7 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags,
// erstmal: wurden schon mal entsprechende Vorlagen
// vergeben, so behalte die bei, gehe zum
// naechsten Node.
- USHORT nPoolId = pAktTxtNd->GetTxtColl()->GetPoolFmtId();
+ sal_uInt16 nPoolId = pAktTxtNd->GetTxtColl()->GetPoolFmtId();
if( IsPoolUserFmt( nPoolId )
? !aFlags.bChgUserColl
: ( RES_POOLCOLL_STANDARD != nPoolId &&
@@ -2411,7 +2366,7 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags,
short nSz;
SvxLRSpaceItem* pLRSpace;
if( SFX_ITEM_SET == pAktTxtNd->GetSwAttrSet().
- GetItemState( RES_LR_SPACE, TRUE,
+ GetItemState( RES_LR_SPACE, sal_True,
(const SfxPoolItem**)&pLRSpace ) &&
( 0 != (nSz = pLRSpace->GetTxtFirstLineOfst()) ||
0 != pLRSpace->GetTxtLeft() ) )
@@ -2431,7 +2386,7 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags,
// nie zusammenfassen, so belassen
// (Opt. vielleicht als Ausnahmen nur Einzug)
- bMoreLines = TRUE;
+ bMoreLines = sal_True;
if( bReplaceStyles )
{
@@ -2458,9 +2413,9 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags,
nNxtLevel = CalcLevel( *pNxtNd );
if( !bEmptyLine && HasBreakAttr( *pAktTxtNd ) )
- bEmptyLine = TRUE;
+ bEmptyLine = sal_True;
if( !bNxtEmpty && HasBreakAttr( *pNxtNd ) )
- bNxtEmpty = TRUE;
+ bNxtEmpty = sal_True;
// fuer z.B. selbst definierte Einzuege oder
// rechts/zentierte Ausrichtung
@@ -2469,8 +2424,8 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags,
}
else
{
- bNxtEmpty = FALSE; // TRUE;
- bNxtAlpha = FALSE;
+ bNxtEmpty = sal_False; // sal_True;
+ bNxtAlpha = sal_False;
nNxtLevel = 0;
}
eStat = !bMoreLines ? IS_ONE_LINE : TST_ENUMERIC;
@@ -2487,7 +2442,7 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags,
if( !DelLeadingBlanks( sClrStr ).Len() )
{
- bEmptyLine = TRUE;
+ bEmptyLine = sal_True;
eStat = READ_NEXT_PARA;
break; // naechsten Absatz lesen
}
@@ -2497,7 +2452,7 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags,
IsBlanksInString( *pAktTxtNd ) )
break;
- bEmptyLine = FALSE;
+ bEmptyLine = sal_False;
String sEndClrStr( sClrStr );
xub_StrLen nLen = DelTrailingBlanks( sEndClrStr ).Len();
@@ -2566,7 +2521,7 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags,
case TST_ENUMERIC:
{
- bEmptyLine = FALSE;
+ bEmptyLine = sal_False;
if( IsEnumericChar( *pAktTxtNd ))
{
if( nLevel >= MAXLEVEL )
@@ -2663,12 +2618,12 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags,
// erstmal: wurden schon mal entsprechende Vorlagen
// vergeben, so behalte die bei, gehe zum
// naechsten Node.
- bEmptyLine = FALSE;
+ bEmptyLine = sal_False;
eStat = READ_NEXT_PARA;
// loesche alle Blanks am Anfang/Ende
// und alle mitten drin
//JP 29.04.98: erstmal nur alle "mitten drin".
- DelMoreLinesBlanks( FALSE );
+ DelMoreLinesBlanks( sal_False );
// behandel die harte Attributierung
if( pAktTxtNd->HasSwAttrSet() )
@@ -2677,7 +2632,7 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags,
SvxLRSpaceItem* pLRSpace;
if( bReplaceStyles &&
SFX_ITEM_SET == pAktTxtNd->GetSwAttrSet().
- GetItemState( RES_LR_SPACE, FALSE,
+ GetItemState( RES_LR_SPACE, sal_False,
(const SfxPoolItem**)&pLRSpace ) &&
( 0 != (nSz = pLRSpace->GetTxtFirstLineOfst()) ||
0 != pLRSpace->GetTxtLeft() ) )
@@ -2699,17 +2654,17 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags,
break;
case IS_ENDE:
- bEnde = TRUE;
+ bEnde = sal_True;
break;
}
}
if( aFlags.bWithRedlining )
- pDoc->SetAutoFmtRedline( FALSE );
+ pDoc->SetAutoFmtRedline( sal_False );
pDoc->SetRedlineMode( eOldMode );
// restore undo (in case it has been changed)
- pDoc->DoUndo( bUndoState );
+ pDoc->GetIDocumentUndoRedo().DoUndo(bUndoState);
// Prozent-Anzeige wieder abschalten
if( !aFlags.bAFmtByInput )
@@ -2729,7 +2684,7 @@ void SwEditShell::AutoFormat( const SvxSwAutoFmtFlags* pAFlags )
{
aAFFlags = *pAFlags;
if( !aAFFlags.bAFmtByInput )
- pWait = new SwWait( *GetDoc()->GetDocShell(), TRUE );
+ pWait = new SwWait( *GetDoc()->GetDocShell(), sal_True );
}
SwPaM* pCrsr = GetCrsr();
@@ -2765,13 +2720,13 @@ void SwEditShell::AutoFmtBySplitNode()
StartAllAction();
StartUndo( UNDO_AUTOFORMAT );
- BOOL bRange = FALSE;
+ sal_Bool bRange = sal_False;
pCrsr->SetMark();
SwIndex* pCntnt = &pCrsr->GetMark()->nContent;
if( pCntnt->GetIndex() )
{
*pCntnt = 0;
- bRange = TRUE;
+ bRange = sal_True;
}
else
{
@@ -2782,7 +2737,7 @@ void SwEditShell::AutoFmtBySplitNode()
{
pCntnt->Assign( pTxtNd, 0 );
pCrsr->GetMark()->nNode = aNdIdx;
- bRange = TRUE;
+ bRange = sal_True;
}
}
@@ -2797,7 +2752,7 @@ void SwEditShell::AutoFmtBySplitNode()
//JP 30.09.96: das DoTable() verlaesst sich auf das PopCrsr
// und MoveCrsr!
- Pop( FALSE );
+ Pop( sal_False );
pCrsr = GetCrsr();
}
pCrsr->DeleteMark();
diff --git a/sw/source/core/edit/edatmisc.cxx b/sw/source/core/edit/edatmisc.cxx
index 6fda3a164c32..386814eda008 100644
--- a/sw/source/core/edit/edatmisc.cxx
+++ b/sw/source/core/edit/edatmisc.cxx
@@ -28,9 +28,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <editsh.hxx>
#include <doc.hxx> // fuer aNodes
+#include <IDocumentUndoRedo.hxx>
#include <pam.hxx> // fuer SwPaM
#include <edimp.hxx> // fuer MACROS
#include <swundo.hxx> // fuer die UndoIds
@@ -47,9 +47,11 @@ void SwEditShell::ResetAttr( const SvUShortsSort* pAttrs )
{
SET_CURR_SHELL( this );
StartAllAction();
- BOOL bUndoGroup = GetCrsr()->GetNext() != GetCrsr();
+ sal_Bool bUndoGroup = GetCrsr()->GetNext() != GetCrsr();
if( bUndoGroup )
- GetDoc()->StartUndo(UNDO_RESETATTR, NULL);
+ {
+ GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_RESETATTR, NULL);
+ }
FOREACHPAM_START(this)
// if ( PCURCRSR->HasMark() )
@@ -57,7 +59,9 @@ void SwEditShell::ResetAttr( const SvUShortsSort* pAttrs )
FOREACHPAM_END()
if( bUndoGroup )
- GetDoc()->EndUndo(UNDO_RESETATTR, NULL);
+ {
+ GetDoc()->GetIDocumentUndoRedo().EndUndo(UNDO_RESETATTR, NULL);
+ }
CallChgLnk();
EndAllAction();
}
@@ -71,12 +75,14 @@ void SwEditShell::GCAttr()
// Sonst Probleme im MouseBut.DownHdl - Bug 35562
// StartAllAction();
FOREACHPAM_START(this)
- SwTxtNode *pTxtNode;
if ( !PCURCRSR->HasMark() )
{
- if( 0 != (pTxtNode = GetDoc()->GetNodes()[
- PCURCRSR->GetPoint()->nNode]->GetTxtNode()))
+ SwTxtNode *const pTxtNode =
+ PCURCRSR->GetPoint()->nNode.GetNode().GetTxtNode();
+ if (pTxtNode)
+ {
pTxtNode->GCAttr();
+ }
}
else
{
@@ -118,22 +124,22 @@ void SwEditShell::SetDefault( const SfxItemSet& rSet )
// Erfrage das Default Attribut in diesem Dokument.
-const SfxPoolItem& SwEditShell::GetDefault( USHORT nFmtHint ) const
+const SfxPoolItem& SwEditShell::GetDefault( sal_uInt16 nFmtHint ) const
{
return GetDoc()->GetDefault( nFmtHint );
}
-void SwEditShell::SetAttr( const SfxPoolItem& rHint, USHORT nFlags )
+void SwEditShell::SetAttr( const SfxPoolItem& rHint, sal_uInt16 nFlags )
{
SET_CURR_SHELL( this );
StartAllAction();
SwPaM* pCrsr = GetCrsr();
if( pCrsr->GetNext() != pCrsr ) // Ring von Cursorn
{
- BOOL bIsTblMode = IsTableMode();
- GetDoc()->StartUndo(UNDO_INSATTR, NULL);
+ sal_Bool bIsTblMode = IsTableMode();
+ GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_INSATTR, NULL);
FOREACHPAM_START(this)
if( PCURCRSR->HasMark() && ( bIsTblMode ||
@@ -143,7 +149,7 @@ void SwEditShell::SetAttr( const SfxPoolItem& rHint, USHORT nFlags )
}
FOREACHPAM_END()
- GetDoc()->EndUndo(UNDO_INSATTR, NULL);
+ GetDoc()->GetIDocumentUndoRedo().EndUndo(UNDO_INSATTR, NULL);
}
else
{
@@ -155,15 +161,15 @@ void SwEditShell::SetAttr( const SfxPoolItem& rHint, USHORT nFlags )
}
-void SwEditShell::SetAttr( const SfxItemSet& rSet, USHORT nFlags )
+void SwEditShell::SetAttr( const SfxItemSet& rSet, sal_uInt16 nFlags )
{
SET_CURR_SHELL( this );
StartAllAction();
SwPaM* pCrsr = GetCrsr();
if( pCrsr->GetNext() != pCrsr ) // Ring von Cursorn
{
- BOOL bIsTblMode = IsTableMode();
- GetDoc()->StartUndo(UNDO_INSATTR, NULL);
+ sal_Bool bIsTblMode = IsTableMode();
+ GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_INSATTR, NULL);
FOREACHPAM_START(this)
if( PCURCRSR->HasMark() && ( bIsTblMode ||
@@ -173,7 +179,7 @@ void SwEditShell::SetAttr( const SfxItemSet& rSet, USHORT nFlags )
}
FOREACHPAM_END()
- GetDoc()->EndUndo(UNDO_INSATTR, NULL);
+ GetDoc()->GetIDocumentUndoRedo().EndUndo(UNDO_INSATTR, NULL);
}
else
{
diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx
index a5578d2f91d8..8a5891093315 100644
--- a/sw/source/core/edit/edattr.cxx
+++ b/sw/source/core/edit/edattr.cxx
@@ -64,21 +64,21 @@
// wenn Selektion groesser Max Nodes oder mehr als Max Selektionen
// => keine Attribute
-const USHORT& getMaxLookup()
+const sal_uInt16& getMaxLookup()
{
- static const USHORT nMaxLookup = 1000;
+ static const sal_uInt16 nMaxLookup = 1000;
return nMaxLookup;
}
// --> OD 2008-01-16 #newlistlevelattrs#
-BOOL SwEditShell::GetCurAttr( SfxItemSet& rSet,
+sal_Bool SwEditShell::GetCurAttr( SfxItemSet& rSet,
const bool bMergeIndentValuesOfNumRule ) const
// <--
{
if( GetCrsrCnt() > getMaxLookup() )
{
rSet.InvalidateAllItems();
- return FALSE;
+ return sal_False;
}
SfxItemSet aSet( *rSet.GetPool(), rSet.GetRanges() );
@@ -100,7 +100,7 @@ BOOL SwEditShell::GetCurAttr( SfxItemSet& rSet,
if (pNumRule)
{
const String & aCharFmtName =
- pNumRule->Get(static_cast<USHORT>(pTxtNd->GetActualListLevel())).GetCharFmtName();
+ pNumRule->Get(static_cast<sal_uInt16>(pTxtNd->GetActualListLevel())).GetCharFmtName();
SwCharFmt * pCharFmt =
GetDoc()->FindCharFmtByName(aCharFmtName);
@@ -112,14 +112,14 @@ BOOL SwEditShell::GetCurAttr( SfxItemSet& rSet,
continue;
}
- ULONG nSttNd = PCURCRSR->GetMark()->nNode.GetIndex(),
+ sal_uLong nSttNd = PCURCRSR->GetMark()->nNode.GetIndex(),
nEndNd = PCURCRSR->GetPoint()->nNode.GetIndex();
xub_StrLen nSttCnt = PCURCRSR->GetMark()->nContent.GetIndex(),
nEndCnt = PCURCRSR->GetPoint()->nContent.GetIndex();
if( nSttNd > nEndNd || ( nSttNd == nEndNd && nSttCnt > nEndCnt ))
{
- ULONG nTmp = nSttNd; nSttNd = nEndNd; nEndNd = nTmp;
+ sal_uLong nTmp = nSttNd; nSttNd = nEndNd; nEndNd = nTmp;
nTmp = nSttCnt; nSttCnt = nEndCnt; nEndCnt = (xub_StrLen)nTmp;
}
@@ -127,12 +127,12 @@ BOOL SwEditShell::GetCurAttr( SfxItemSet& rSet,
{
rSet.ClearItem();
rSet.InvalidateAllItems();
- return FALSE;
+ return sal_False;
}
// beim 1.Node traegt der Node die Werte in den GetSet ein (Initial)
// alle weiteren Nodes werden zum GetSet zu gemergt
- for( ULONG n = nSttNd; n <= nEndNd; ++n )
+ for( sal_uLong n = nSttNd; n <= nEndNd; ++n )
{
SwNode* pNd = GetDoc()->GetNodes()[ n ];
switch( pNd->GetNodeType() )
@@ -144,7 +144,7 @@ BOOL SwEditShell::GetCurAttr( SfxItemSet& rSet,
: ((SwTxtNode*)pNd)->GetTxt().Len();
// --> OD 2008-01-16 #newlistlevelattrs#
((SwTxtNode*)pNd)->GetAttr( *pSet, nStt, nEnd,
- FALSE, TRUE,
+ sal_False, sal_True,
bMergeIndentValuesOfNumRule );
// <--
}
@@ -171,7 +171,7 @@ BOOL SwEditShell::GetCurAttr( SfxItemSet& rSet,
FOREACHPAM_END()
- return TRUE;
+ return sal_True;
}
SwTxtFmtColl* SwEditShell::GetCurTxtFmtColl() const
@@ -183,14 +183,14 @@ SwTxtFmtColl* SwEditShell::GetCurTxtFmtColl() const
FOREACHPAM_START(this)
- ULONG nSttNd = PCURCRSR->GetMark()->nNode.GetIndex(),
+ sal_uLong nSttNd = PCURCRSR->GetMark()->nNode.GetIndex(),
nEndNd = PCURCRSR->GetPoint()->nNode.GetIndex();
xub_StrLen nSttCnt = PCURCRSR->GetMark()->nContent.GetIndex(),
nEndCnt = PCURCRSR->GetPoint()->nContent.GetIndex();
if( nSttNd > nEndNd || ( nSttNd == nEndNd && nSttCnt > nEndCnt ))
{
- ULONG nTmp = nSttNd; nSttNd = nEndNd; nEndNd = nTmp;
+ sal_uLong nTmp = nSttNd; nSttNd = nEndNd; nEndNd = nTmp;
nTmp = nSttCnt; nSttCnt = nEndCnt; nEndCnt = (xub_StrLen)nTmp;
}
@@ -200,7 +200,7 @@ SwTxtFmtColl* SwEditShell::GetCurTxtFmtColl() const
break;
}
- for( ULONG n = nSttNd; n <= nEndNd; ++n )
+ for( sal_uLong n = nSttNd; n <= nEndNd; ++n )
{
SwNode* pNd = GetDoc()->GetNodes()[ n ];
if( pNd->IsTxtNode() )
@@ -218,13 +218,13 @@ SwTxtFmtColl* SwEditShell::GetCurTxtFmtColl() const
-BOOL SwEditShell::GetCurFtn( SwFmtFtn* pFillFtn )
+sal_Bool SwEditShell::GetCurFtn( SwFmtFtn* pFillFtn )
{
// der Cursor muss auf dem akt. Fussnoten-Anker stehen:
SwPaM* pCrsr = GetCrsr();
SwTxtNode* pTxtNd = pCrsr->GetNode()->GetTxtNode();
if( !pTxtNd )
- return FALSE;
+ return sal_False;
SwTxtAttr *const pFtn = pTxtNd->GetTxtAttrForCharAt(
pCrsr->GetPoint()->nContent.GetIndex(), RES_TXTATR_FTN);
@@ -258,11 +258,11 @@ bool SwEditShell::SetCurFtn( const SwFmtFtn& rFillFtn )
-/*USHORT SwEditShell::GetFtnCnt( BOOL bEndNotes = FALSE ) const
+/*sal_uInt16 SwEditShell::GetFtnCnt( sal_Bool bEndNotes = sal_False ) const
{
const SwFtnIdxs &rIdxs = pDoc->GetFtnIdxs();
- USHORT nCnt = 0;
- for ( USHORT i = 0; i < rIdxs.Count(); ++i )
+ sal_uInt16 nCnt = 0;
+ for ( sal_uInt16 i = 0; i < rIdxs.Count(); ++i )
{
const SwFmtFtn &rFtn = rIdxs[i]->GetFtn();
if ( bEndNotes == rFtn.IsEndNote() )
@@ -275,23 +275,23 @@ bool SwEditShell::SetCurFtn( const SwFmtFtn& rFillFtn )
bool SwEditShell::HasFtns( bool bEndNotes ) const
{
const SwFtnIdxs &rIdxs = pDoc->GetFtnIdxs();
- for ( USHORT i = 0; i < rIdxs.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rIdxs.Count(); ++i )
{
const SwFmtFtn &rFtn = rIdxs[i]->GetFtn();
if ( bEndNotes == rFtn.IsEndNote() )
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// gebe Liste aller Fussnoten und deren Anfangstexte
-USHORT SwEditShell::GetSeqFtnList( SwSeqFldList& rList, bool bEndNotes )
+sal_uInt16 SwEditShell::GetSeqFtnList( SwSeqFldList& rList, bool bEndNotes )
{
if( rList.Count() )
rList.Remove( 0, rList.Count() );
- USHORT n, nFtnCnt = pDoc->GetFtnIdxs().Count();
+ sal_uInt16 n, nFtnCnt = pDoc->GetFtnIdxs().Count();
SwTxtFtn* pTxtFtn;
for( n = 0; n < nFtnCnt; ++n )
{
@@ -329,28 +329,28 @@ USHORT SwEditShell::GetSeqFtnList( SwSeqFldList& rList, bool bEndNotes )
// linken Rand ueber Objectleiste einstellen (aenhlich dem Stufen von
// Numerierungen)
-BOOL SwEditShell::IsMoveLeftMargin( BOOL bRight, BOOL bModulus ) const
+sal_Bool SwEditShell::IsMoveLeftMargin( sal_Bool bRight, sal_Bool bModulus ) const
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
const SvxTabStopItem& rTabItem = (SvxTabStopItem&)GetDoc()->
GetDefault( RES_PARATR_TABSTOP );
- USHORT nDefDist = static_cast<USHORT>(rTabItem.Count() ? rTabItem[0].GetTabPos() : 1134);
+ sal_uInt16 nDefDist = static_cast<sal_uInt16>(rTabItem.Count() ? rTabItem[0].GetTabPos() : 1134);
if( !nDefDist )
- return FALSE;
+ return sal_False;
FOREACHPAM_START(this)
- ULONG nSttNd = PCURCRSR->GetMark()->nNode.GetIndex(),
+ sal_uLong nSttNd = PCURCRSR->GetMark()->nNode.GetIndex(),
nEndNd = PCURCRSR->GetPoint()->nNode.GetIndex();
if( nSttNd > nEndNd )
{
- ULONG nTmp = nSttNd; nSttNd = nEndNd; nEndNd = nTmp;
+ sal_uLong nTmp = nSttNd; nSttNd = nEndNd; nEndNd = nTmp;
}
SwCntntNode* pCNd;
- for( ULONG n = nSttNd; bRet && n <= nEndNd; ++n )
+ for( sal_uLong n = nSttNd; bRet && n <= nEndNd; ++n )
if( 0 != ( pCNd = GetDoc()->GetNodes()[ n ]->GetTxtNode() ))
{
const SvxLRSpaceItem& rLS = (SvxLRSpaceItem&)
@@ -363,13 +363,13 @@ BOOL SwEditShell::IsMoveLeftMargin( BOOL bRight, BOOL bModulus ) const
SwFrm* pFrm = pCNd->getLayoutFrm( GetLayout() );
if ( pFrm )
{
- const USHORT nFrmWidth = static_cast<USHORT>( pFrm->IsVertical() ?
+ const sal_uInt16 nFrmWidth = static_cast<sal_uInt16>( pFrm->IsVertical() ?
pFrm->Frm().Height() :
pFrm->Frm().Width() );
bRet = nFrmWidth > ( nNext + MM50 );
}
else
- bRet = FALSE;
+ bRet = sal_False;
}
}
@@ -380,7 +380,7 @@ BOOL SwEditShell::IsMoveLeftMargin( BOOL bRight, BOOL bModulus ) const
return bRet;
}
-void SwEditShell::MoveLeftMargin( BOOL bRight, BOOL bModulus )
+void SwEditShell::MoveLeftMargin( sal_Bool bRight, sal_Bool bModulus )
{
StartAllAction();
StartUndo( UNDO_START );
@@ -390,7 +390,7 @@ void SwEditShell::MoveLeftMargin( BOOL bRight, BOOL bModulus )
{
SwPamRanges aRangeArr( *pCrsr );
SwPaM aPam( *pCrsr->GetPoint() );
- for( USHORT n = 0; n < aRangeArr.Count(); ++n )
+ for( sal_uInt16 n = 0; n < aRangeArr.Count(); ++n )
GetDoc()->MoveLeftMargin( aRangeArr.SetPam( n, aPam ),
bRight, bModulus );
}
@@ -402,9 +402,9 @@ void SwEditShell::MoveLeftMargin( BOOL bRight, BOOL bModulus )
}
-inline USHORT lcl_SetScriptFlags( USHORT nType )
+inline sal_uInt16 lcl_SetScriptFlags( sal_uInt16 nType )
{
- USHORT nRet;
+ sal_uInt16 nRet;
switch( nType )
{
case ::com::sun::star::i18n::ScriptType::LATIN: nRet = SCRIPTTYPE_LATIN; break;
@@ -415,17 +415,17 @@ inline USHORT lcl_SetScriptFlags( USHORT nType )
return nRet;
}
-BOOL lcl_IsNoEndTxtAttrAtPos( const SwTxtNode& rTNd, xub_StrLen nPos,
- USHORT &rScrpt, BOOL bInSelection, BOOL bNum )
+sal_Bool lcl_IsNoEndTxtAttrAtPos( const SwTxtNode& rTNd, xub_StrLen nPos,
+ sal_uInt16 &rScrpt, sal_Bool bInSelection, sal_Bool bNum )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
const String& rTxt = rTNd.GetTxt();
String sExp;
// consider numbering
if ( bNum )
{
- bRet = FALSE;
+ bRet = sal_False;
// --> OD 2008-03-19 #refactorlists#
if ( rTNd.IsInList() )
@@ -433,7 +433,7 @@ BOOL lcl_IsNoEndTxtAttrAtPos( const SwTxtNode& rTNd, xub_StrLen nPos,
ASSERT( rTNd.GetNumRule(),
"<lcl_IsNoEndTxtAttrAtPos(..)> - no list style found at text node. Serious defect -> please inform OD." );
const SwNumRule* pNumRule = rTNd.GetNumRule();
- const SwNumFmt &rNumFmt = pNumRule->Get( static_cast<USHORT>(rTNd.GetActualListLevel()) );
+ const SwNumFmt &rNumFmt = pNumRule->Get( static_cast<sal_uInt16>(rTNd.GetActualListLevel()) );
if( SVX_NUM_BITMAP != rNumFmt.GetNumberingType() )
{
if ( SVX_NUM_CHAR_SPECIAL == rNumFmt.GetNumberingType() )
@@ -450,7 +450,7 @@ BOOL lcl_IsNoEndTxtAttrAtPos( const SwTxtNode& rTNd, xub_StrLen nPos,
const SwTxtAttr* const pAttr = rTNd.GetTxtAttrForCharAt( nPos );
if (pAttr)
{
- bRet = TRUE; // all other than fields can be
+ bRet = sal_True; // all other than fields can be
// defined as weak-script ?
if ( RES_TXTATR_FIELD == pAttr->Which() )
{
@@ -469,7 +469,7 @@ BOOL lcl_IsNoEndTxtAttrAtPos( const SwTxtNode& rTNd, xub_StrLen nPos,
xub_StrLen n;
if( bInSelection )
{
- USHORT nScript;
+ sal_uInt16 nScript;
for( n = 0; n < nEnd; n = (xub_StrLen)
pBreakIt->GetBreakIter()->endOfScript( sExp, n, nScript ))
{
@@ -487,9 +487,9 @@ BOOL lcl_IsNoEndTxtAttrAtPos( const SwTxtNode& rTNd, xub_StrLen nPos,
// returns the scripttpye of the selection
-USHORT SwEditShell::GetScriptType() const
+sal_uInt16 SwEditShell::GetScriptType() const
{
- USHORT nRet = 0;
+ sal_uInt16 nRet = 0;
//if( pBreakIt->GetBreakIter().is() )
{
FOREACHPAM_START(this)
@@ -516,7 +516,7 @@ USHORT SwEditShell::GetScriptType() const
nPos = aIdx.GetIndex();
}
- USHORT nScript;
+ sal_uInt16 nScript;
if ( pTNd->GetTxt().Len() )
{
@@ -525,15 +525,15 @@ USHORT SwEditShell::GetScriptType() const
pBreakIt->GetBreakIter()->getScriptType( pTNd->GetTxt(), nPos );
}
else
- nScript = GetI18NScriptTypeOfLanguage( (USHORT)GetAppLanguage() );
+ nScript = GetI18NScriptTypeOfLanguage( (sal_uInt16)GetAppLanguage() );
- if( !lcl_IsNoEndTxtAttrAtPos( *pTNd, nPos, nRet, FALSE, FALSE ))
+ if( !lcl_IsNoEndTxtAttrAtPos( *pTNd, nPos, nRet, sal_False, sal_False ))
nRet |= lcl_SetScriptFlags( nScript );
}
}
else if ( pBreakIt->GetBreakIter().is() )
{
- ULONG nEndIdx = pEnd->nNode.GetIndex();
+ sal_uLong nEndIdx = pEnd->nNode.GetIndex();
SwNodeIndex aIdx( pStt->nNode );
for( ; aIdx.GetIndex() <= nEndIdx; aIdx++ )
if( aIdx.GetNode().IsTxtNode() )
@@ -555,7 +555,7 @@ USHORT SwEditShell::GetScriptType() const
if( nEndPos > rTxt.Len() )
nEndPos = rTxt.Len();
- USHORT nScript;
+ sal_uInt16 nScript;
while( nChg < nEndPos )
{
nScript = pScriptInfo ?
@@ -563,7 +563,7 @@ USHORT SwEditShell::GetScriptType() const
pBreakIt->GetBreakIter()->getScriptType(
rTxt, nChg );
- if( !lcl_IsNoEndTxtAttrAtPos( *pTNd, nChg, nRet, TRUE,
+ if( !lcl_IsNoEndTxtAttrAtPos( *pTNd, nChg, nRet, sal_True,
0 == nChg && rTxt.Len() == nEndPos ) )
nRet |= lcl_SetScriptFlags( nScript );
@@ -600,12 +600,12 @@ USHORT SwEditShell::GetScriptType() const
}
-USHORT SwEditShell::GetCurLang() const
+sal_uInt16 SwEditShell::GetCurLang() const
{
const SwPaM* pCrsr = GetCrsr();
const SwPosition& rPos = *pCrsr->GetPoint();
const SwTxtNode* pTNd = rPos.nNode.GetNode().GetTxtNode();
- USHORT nLang;
+ sal_uInt16 nLang;
if( pTNd )
{
//JP 24.9.2001: if exist no selection, then get the language before
@@ -620,14 +620,14 @@ USHORT SwEditShell::GetCurLang() const
return nLang;
}
-USHORT SwEditShell::GetScalingOfSelectedText() const
+sal_uInt16 SwEditShell::GetScalingOfSelectedText() const
{
const SwPaM* pCrsr = GetCrsr();
const SwPosition* pStt = pCrsr->Start();
const SwTxtNode* pTNd = pStt->nNode.GetNode().GetTxtNode();
ASSERT( pTNd, "no textnode available" );
- USHORT nScaleWidth;
+ sal_uInt16 nScaleWidth;
if( pTNd )
{
xub_StrLen nStt = pStt->nContent.GetIndex(), nEnd;
diff --git a/sw/source/core/edit/eddel.cxx b/sw/source/core/edit/eddel.cxx
index 8a0ead2da3ce..3289c07f1928 100644
--- a/sw/source/core/edit/eddel.cxx
+++ b/sw/source/core/edit/eddel.cxx
@@ -31,6 +31,7 @@
#include <hintids.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <editsh.hxx>
#include <cntfrm.hxx>
#include <pam.hxx>
@@ -39,7 +40,6 @@
#include <IMark.hxx>
#include <docary.hxx>
#include <SwRewriter.hxx>
-#include <undobj.hxx>
#include <globals.hrc>
#include <comcore.hrc>
@@ -49,7 +49,7 @@
* Loeschen
************************************************************/
-void SwEditShell::DeleteSel( SwPaM& rPam, BOOL* pUndo )
+void SwEditShell::DeleteSel( SwPaM& rPam, sal_Bool* pUndo )
{
// nur bei Selektion
if( !rPam.HasMark() || *rPam.GetPoint() == *rPam.GetMark())
@@ -63,13 +63,13 @@ void SwEditShell::DeleteSel( SwPaM& rPam, BOOL* pUndo )
// selektierten Boxen suchen in den Inhalt loeschen
if( rPam.GetNode()->FindTableNode() &&
rPam.GetNode()->StartOfSectionNode() !=
- rPam.GetNode(FALSE)->StartOfSectionNode() )
+ rPam.GetNode(sal_False)->StartOfSectionNode() )
{
// in Tabellen das Undo gruppieren
if( pUndo && !*pUndo )
{
- GetDoc()->StartUndo( UNDO_START, NULL );
- *pUndo = TRUE;
+ GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
+ *pUndo = sal_True;
}
SwPaM aDelPam( *rPam.Start() );
const SwPosition* pEndSelPos = rPam.End();
@@ -123,13 +123,13 @@ long SwEditShell::Delete()
{
StartAllAction();
- BOOL bUndo = GetCrsr()->GetNext() != GetCrsr();
+ sal_Bool bUndo = GetCrsr()->GetNext() != GetCrsr();
if( bUndo ) // mehr als eine Selection ?
{
SwRewriter aRewriter;
aRewriter.AddRule(UNDO_ARG1, String(SW_RES(STR_MULTISEL)));
- GetDoc()->StartUndo( UNDO_DELETE, &aRewriter );
+ GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_DELETE, &aRewriter);
}
FOREACHPAM_START(this)
@@ -138,7 +138,9 @@ long SwEditShell::Delete()
// falls eine Undo-Klammerung, dann hier beenden
if( bUndo )
- GetDoc()->EndUndo( UNDO_DELETE, NULL );
+ {
+ GetDoc()->GetIDocumentUndoRedo().EndUndo(UNDO_END, 0);
+ }
EndAllAction();
nRet = 1;
}
@@ -159,7 +161,7 @@ long SwEditShell::Copy( SwEditShell* pDestShell )
{
SwPosition * pPos = 0;
boost::shared_ptr<SwPosition> pInsertPos;
- USHORT nMove = 0;
+ sal_uInt16 nMove = 0;
FOREACHPAM_START(this)
if( !pPos )
@@ -180,7 +182,7 @@ long SwEditShell::Copy( SwEditShell* pDestShell )
if( nMove )
{
SwCursor aCrsr( *pPos, 0, false);
- if( aCrsr.UpDown( FALSE, nMove, 0, 0 ) )
+ if( aCrsr.UpDown( sal_False, nMove, 0, 0 ) )
{
pInsertPos.reset( new SwPosition( *aCrsr.GetPoint() ) );
aInsertList.push_back( pInsertPos );
@@ -194,20 +196,20 @@ long SwEditShell::Copy( SwEditShell* pDestShell )
// Check if a selection would be copied into itself
if( pDestShell->GetDoc() == GetDoc() &&
*PCURCRSR->Start() <= *pTmp && *pTmp < *PCURCRSR->End() )
- return FALSE;
+ return sal_False;
FOREACHPAM_END()
}
pDestShell->StartAllAction();
SwPosition *pPos = 0;
- BOOL bRet = FALSE;
- BOOL bFirstMove = TRUE;
+ sal_Bool bRet = sal_False;
+ sal_Bool bFirstMove = sal_True;
SwNodeIndex aSttNdIdx( pDestShell->GetDoc()->GetNodes() );
xub_StrLen nSttCntIdx = 0;
// For block selection this list is filled with the insert positions
std::list< boost::shared_ptr<SwPosition> >::iterator pNextInsert = aInsertList.begin();
- pDestShell->GetDoc()->StartUndo( UNDO_START, NULL );
+ pDestShell->GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
FOREACHPAM_START(this)
if( !pPos )
@@ -243,7 +245,7 @@ long SwEditShell::Copy( SwEditShell* pDestShell )
// Anfangs-Position vom neuen Bereich merken
aSttNdIdx = pPos->nNode.GetIndex()-1;
nSttCntIdx = pPos->nContent.GetIndex();
- bFirstMove = FALSE;
+ bFirstMove = sal_False;
}
const bool bSuccess( GetDoc()->CopyRange( *PCURCRSR, *pPos, false ) );
@@ -253,7 +255,7 @@ long SwEditShell::Copy( SwEditShell* pDestShell )
SwPaM aInsertPaM(*pPos, SwPosition(aSttNdIdx));
pDestShell->GetDoc()->MakeUniqueNumRules(aInsertPaM);
- bRet = TRUE;
+ bRet = sal_True;
FOREACHPAM_END()
@@ -281,15 +283,15 @@ long SwEditShell::Copy( SwEditShell* pDestShell )
ASSERT( pCmp->GetPoint()->nContent.GetIdxReg()
== pCmp->GetCntntNode(), "Point im falschen Node" );
ASSERT( pCmp->GetMark()->nContent.GetIdxReg()
- == pCmp->GetCntntNode(FALSE), "Mark im falschen Node" );
- BOOL bTst = *pCmp->GetPoint() == *pCmp->GetMark();
+ == pCmp->GetCntntNode(sal_False), "Mark im falschen Node" );
+ sal_Bool bTst = *pCmp->GetPoint() == *pCmp->GetMark();
(void) bTst;
} while( pDestShell->GetCrsr() != ( pCmp = (SwPaM*)pCmp->GetNext() ) );
}
#endif
// Undo-Klammerung hier beenden
- pDestShell->GetDoc()->EndUndo( UNDO_END, NULL );
+ pDestShell->GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
pDestShell->EndAllAction();
pDestShell->SaveTblBoxCntnt( pDestShell->GetCrsr()->GetPoint() );
@@ -304,15 +306,15 @@ long SwEditShell::Copy( SwEditShell* pDestShell )
// ein ( nicht \& )
// z.B.: Fnd: "zzz", Repl: "xx\t\\t..&..\&"
// --> "xx\t<Tab>..zzz..&"
-BOOL SwEditShell::Replace( const String& rNewStr, BOOL bRegExpRplc )
+sal_Bool SwEditShell::Replace( const String& rNewStr, sal_Bool bRegExpRplc )
{
SET_CURR_SHELL( this );
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( !HasReadonlySel() )
{
StartAllAction();
- GetDoc()->StartUndo(UNDO_EMPTY, NULL);
+ GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL);
FOREACHPAM_START(this)
if( PCURCRSR->HasMark() && *PCURCRSR->GetMark() != *PCURCRSR->GetPoint() )
@@ -324,7 +326,7 @@ BOOL SwEditShell::Replace( const String& rNewStr, BOOL bRegExpRplc )
FOREACHPAM_END()
// Undo-Klammerung hier beenden
- GetDoc()->EndUndo(UNDO_EMPTY, NULL);
+ GetDoc()->GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, NULL);
EndAllAction();
}
return bRet;
@@ -332,9 +334,9 @@ BOOL SwEditShell::Replace( const String& rNewStr, BOOL bRegExpRplc )
// Special-Methode fuer JOE's- Wizzards
-BOOL SwEditShell::DelFullPara()
+sal_Bool SwEditShell::DelFullPara()
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( !IsTableMode() )
{
SwPaM* pCrsr = GetCrsr();
diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx
index c3dc53f1ba26..838abeb659bd 100644
--- a/sw/source/core/edit/edfcol.cxx
+++ b/sw/source/core/edit/edfcol.cxx
@@ -33,6 +33,7 @@
#include <editeng/brkitem.hxx>
#include <editsh.hxx>
#include <doc.hxx> // fuer SwTxtFmtColls
+#include <IDocumentUndoRedo.hxx>
#include <edimp.hxx> // fuer MACROS
#include <ndtxt.hxx>
#include <paratr.hxx>
@@ -41,7 +42,7 @@
#include <viewopt.hxx>
// <--
#include <SwRewriter.hxx>
-#include <undobj.hxx>
+#include <numrule.hxx>
#include <swundo.hxx>
/*************************************
@@ -56,13 +57,13 @@ SwTxtFmtColl& SwEditShell::GetDfltTxtFmtColl() const
}
-USHORT SwEditShell::GetTxtFmtCollCount() const
+sal_uInt16 SwEditShell::GetTxtFmtCollCount() const
{
return GetDoc()->GetTxtFmtColls()->Count();
}
-SwTxtFmtColl& SwEditShell::GetTxtFmtColl( USHORT nFmtColl) const
+SwTxtFmtColl& SwEditShell::GetTxtFmtColl( sal_uInt16 nFmtColl) const
{
return *((*(GetDoc()->GetTxtFmtColls()))[nFmtColl]);
}
@@ -77,7 +78,7 @@ void SwEditShell::SetTxtFmtColl( SwTxtFmtColl *pFmt,
SwRewriter aRewriter;
aRewriter.AddRule(UNDO_ARG1, pLocal->GetName());
- GetDoc()->StartUndo(UNDO_SETFMTCOLL, &aRewriter);
+ GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_SETFMTCOLL, &aRewriter);
FOREACHPAM_START(this)
if( !PCURCRSR->HasReadonlySel(
@@ -87,7 +88,7 @@ void SwEditShell::SetTxtFmtColl( SwTxtFmtColl *pFmt,
GetDoc()->SetTxtFmtColl( *PCURCRSR, pLocal, true, bResetListAttrs );
FOREACHPAM_END()
- GetDoc()->EndUndo(UNDO_SETFMTCOLL, NULL);
+ GetDoc()->GetIDocumentUndoRedo().EndUndo(UNDO_SETFMTCOLL, &aRewriter);
EndAllAction();
}
// <--
@@ -101,14 +102,14 @@ SwTxtFmtColl* SwEditShell::MakeTxtFmtColl(const String& rFmtCollName,
pParent = &GetTxtFmtColl(0);
if ( (pColl=GetDoc()->MakeTxtFmtColl(rFmtCollName, pParent)) == 0 )
{
- ASSERT( FALSE, "MakeTxtFmtColl failed" )
+ ASSERT( sal_False, "MakeTxtFmtColl failed" )
}
return pColl;
}
-void SwEditShell::FillByEx(SwTxtFmtColl* pColl, BOOL bReset)
+void SwEditShell::FillByEx(SwTxtFmtColl* pColl, sal_Bool bReset)
{
if( bReset )
{
@@ -130,10 +131,10 @@ void SwEditShell::FillByEx(SwTxtFmtColl* pColl, BOOL bReset)
// AutoNumRules NICHT in die Vorlagen uebernehmen
const SfxPoolItem* pItem;
const SwNumRule* pRule = 0;
- if( SFX_ITEM_SET == pSet->GetItemState( RES_BREAK, FALSE ) ||
- SFX_ITEM_SET == pSet->GetItemState( RES_PAGEDESC,FALSE ) ||
+ if( SFX_ITEM_SET == pSet->GetItemState( RES_BREAK, sal_False ) ||
+ SFX_ITEM_SET == pSet->GetItemState( RES_PAGEDESC,sal_False ) ||
( SFX_ITEM_SET == pSet->GetItemState( RES_PARATR_NUMRULE,
- FALSE, &pItem ) && 0 != (pRule = GetDoc()->FindNumRulePtr(
+ sal_False, &pItem ) && 0 != (pRule = GetDoc()->FindNumRulePtr(
((SwNumRuleItem*)pItem)->GetValue() )) &&
pRule && pRule->IsAutoRule() )
)
@@ -143,7 +144,7 @@ void SwEditShell::FillByEx(SwTxtFmtColl* pColl, BOOL bReset)
aSet.ClearItem( RES_PAGEDESC );
if( pRule || (SFX_ITEM_SET == pSet->GetItemState( RES_PARATR_NUMRULE,
- FALSE, &pItem ) && 0 != (pRule = GetDoc()->FindNumRulePtr(
+ sal_False, &pItem ) && 0 != (pRule = GetDoc()->FindNumRulePtr(
((SwNumRuleItem*)pItem)->GetValue() )) &&
pRule && pRule->IsAutoRule() ))
aSet.ClearItem( RES_PARATR_NUMRULE );
diff --git a/sw/source/core/edit/edfld.cxx b/sw/source/core/edit/edfld.cxx
index a49f2a26af86..29979805948a 100644
--- a/sw/source/core/edit/edfld.cxx
+++ b/sw/source/core/edit/edfld.cxx
@@ -53,10 +53,10 @@
wenn 0 alle zaehlen
--------------------------------------------------------------------*/
-USHORT SwEditShell::GetFldTypeCount(USHORT nResId, BOOL bUsed ) const
+sal_uInt16 SwEditShell::GetFldTypeCount(sal_uInt16 nResId, sal_Bool bUsed ) const
{
const SwFldTypes* pFldTypes = GetDoc()->GetFldTypes();
- const USHORT nSize = pFldTypes->Count();
+ const sal_uInt16 nSize = pFldTypes->Count();
if(nResId == USHRT_MAX)
{
@@ -64,8 +64,8 @@ USHORT SwEditShell::GetFldTypeCount(USHORT nResId, BOOL bUsed ) const
return nSize;
else
{
- USHORT nUsed = 0;
- for ( USHORT i = 0; i < nSize; i++ )
+ sal_uInt16 nUsed = 0;
+ for ( sal_uInt16 i = 0; i < nSize; i++ )
{
if(IsUsed(*(*pFldTypes)[i]))
nUsed++;
@@ -75,8 +75,8 @@ USHORT SwEditShell::GetFldTypeCount(USHORT nResId, BOOL bUsed ) const
}
// Alle Typen mit gleicher ResId
- USHORT nIdx = 0;
- for(USHORT i = 0; i < nSize; ++i)
+ sal_uInt16 nIdx = 0;
+ for(sal_uInt16 i = 0; i < nSize; ++i)
{ // Gleiche ResId -> Index erhoehen
SwFieldType& rFldType = *((*pFldTypes)[i]);
if(rFldType.Which() == nResId)
@@ -89,10 +89,10 @@ USHORT SwEditShell::GetFldTypeCount(USHORT nResId, BOOL bUsed ) const
Beschreibung: Feldtypen zu einer ResId finden
wenn 0 alle finden
--------------------------------------------------------------------*/
-SwFieldType* SwEditShell::GetFldType(USHORT nFld, USHORT nResId, BOOL bUsed ) const
+SwFieldType* SwEditShell::GetFldType(sal_uInt16 nFld, sal_uInt16 nResId, sal_Bool bUsed ) const
{
const SwFldTypes* pFldTypes = GetDoc()->GetFldTypes();
- const USHORT nSize = pFldTypes->Count();
+ const sal_uInt16 nSize = pFldTypes->Count();
if(nResId == USHRT_MAX && nFld < nSize)
{
@@ -100,7 +100,7 @@ SwFieldType* SwEditShell::GetFldType(USHORT nFld, USHORT nResId, BOOL bUsed ) co
return (*pFldTypes)[nFld];
else
{
- USHORT i, nUsed = 0;
+ sal_uInt16 i, nUsed = 0;
for ( i = 0; i < nSize; i++ )
{
if(IsUsed(*(*pFldTypes)[i]))
@@ -114,8 +114,8 @@ SwFieldType* SwEditShell::GetFldType(USHORT nFld, USHORT nResId, BOOL bUsed ) co
}
}
- USHORT nIdx = 0;
- for(USHORT i = 0; i < nSize; ++i)
+ sal_uInt16 nIdx = 0;
+ for(sal_uInt16 i = 0; i < nSize; ++i)
{ // Gleiche ResId -> Index erhoehen
SwFieldType* pFldType = (*pFldTypes)[i];
if(pFldType->Which() == nResId)
@@ -134,7 +134,7 @@ SwFieldType* SwEditShell::GetFldType(USHORT nFld, USHORT nResId, BOOL bUsed ) co
/*--------------------------------------------------------------------
Beschreibung: Den ersten Typen mit ResId und Namen finden
--------------------------------------------------------------------*/
-SwFieldType* SwEditShell::GetFldType(USHORT nResId, const String& rName) const
+SwFieldType* SwEditShell::GetFldType(sal_uInt16 nResId, const String& rName) const
{
return GetDoc()->GetFldType( nResId, rName, false );
}
@@ -142,7 +142,7 @@ SwFieldType* SwEditShell::GetFldType(USHORT nResId, const String& rName) const
/*--------------------------------------------------------------------
Beschreibung: Feldtypen loeschen
--------------------------------------------------------------------*/
-void SwEditShell::RemoveFldType(USHORT nFld, USHORT nResId)
+void SwEditShell::RemoveFldType(sal_uInt16 nFld, sal_uInt16 nResId)
{
if( USHRT_MAX == nResId )
{
@@ -151,9 +151,9 @@ void SwEditShell::RemoveFldType(USHORT nFld, USHORT nResId)
}
const SwFldTypes* pFldTypes = GetDoc()->GetFldTypes();
- const USHORT nSize = pFldTypes->Count();
- USHORT nIdx = 0;
- for( USHORT i = 0; i < nSize; ++i )
+ const sal_uInt16 nSize = pFldTypes->Count();
+ sal_uInt16 nIdx = 0;
+ for( sal_uInt16 i = 0; i < nSize; ++i )
// Gleiche ResId -> Index erhoehen
if( (*pFldTypes)[i]->Which() == nResId &&
nIdx++ == nFld )
@@ -166,15 +166,15 @@ void SwEditShell::RemoveFldType(USHORT nFld, USHORT nResId)
/*--------------------------------------------------------------------
Beschreibung: FieldType ueber Name loeschen
--------------------------------------------------------------------*/
-void SwEditShell::RemoveFldType(USHORT nResId, const String& rStr)
+void SwEditShell::RemoveFldType(sal_uInt16 nResId, const String& rStr)
{
const SwFldTypes* pFldTypes = GetDoc()->GetFldTypes();
- const USHORT nSize = pFldTypes->Count();
+ const sal_uInt16 nSize = pFldTypes->Count();
const CharClass& rCC = GetAppCharClass();
String aTmp( rCC.lower( rStr ));
- for(USHORT i = 0; i < nSize; ++i)
+ for(sal_uInt16 i = 0; i < nSize; ++i)
{
// Gleiche ResId -> Index erhoehen
SwFieldType* pFldType = (*pFldTypes)[i];
@@ -201,7 +201,12 @@ void SwEditShell::FieldToText( SwFieldType* pType )
Push();
SwPaM* pPaM = GetCrsr();
+<<<<<<< local
SwFieldHint aHint( pPaM );
+=======
+ sal_Bool bDDEFld = RES_DDEFLD == pType->Which();
+ // Modify-Object gefunden, trage alle Felder ins Array ein
+>>>>>>> other
SwClientIter aIter( *pType );
for ( SwClient* pClient = aIter.GoStart(); pClient; aIter++ )
{
@@ -209,7 +214,7 @@ void SwEditShell::FieldToText( SwFieldType* pType )
pClient->SwClientNotifyCall( *pType, aHint );
}
- Pop( FALSE );
+ Pop( sal_False );
EndAllAction();
EndUndo( UNDO_DELETE );
}
@@ -335,7 +340,7 @@ void SwEditShell::UpdateFlds( SwField &rFld )
// Cursor-Position.
SwMsgPoolItem* pMsgHnt = 0;
SwRefMarkFldUpdate aRefMkHt( GetOut() );
- USHORT nFldWhich = rFld.GetTyp()->Which();
+ sal_uInt16 nFldWhich = rFld.GetTyp()->Which();
if( RES_GETREFFLD == nFldWhich )
pMsgHnt = &aRefMkHt;
@@ -356,14 +361,14 @@ void SwEditShell::UpdateFlds( SwField &rFld )
pTxtFld = lcl_FindInputFld( GetDoc(), rFld);
if (pTxtFld != 0)
- GetDoc()->UpdateFld(pTxtFld, rFld, pMsgHnt, TRUE); // #111840#
+ GetDoc()->UpdateFld(pTxtFld, rFld, pMsgHnt, sal_True); // #111840#
}
- // bOkay (statt return wg. EndAllAction) wird FALSE,
+ // bOkay (statt return wg. EndAllAction) wird sal_False,
// 1) wenn nur ein Pam mehr als ein Feld enthaelt oder
// 2) bei gemischten Feldtypen
- BOOL bOkay = TRUE;
- BOOL bTblSelBreak = FALSE;
+ sal_Bool bOkay = sal_True;
+ sal_Bool bTblSelBreak = sal_False;
SwMsgPoolItem aHint( RES_TXTATR_FIELD ); // Such-Hint
FOREACHPAM_START(this) // fuer jeden PaM
@@ -386,11 +391,11 @@ void SwEditShell::UpdateFlds( SwField &rFld )
// Suche nach SwTxtFld ...
while( bOkay
&& pCurStt->nContent != pCurEnd->nContent
- && aPam.Find( aHint, FALSE, fnMoveForward, &aCurPam ) )
+ && aPam.Find( aHint, sal_False, fnMoveForward, &aCurPam ) )
{
// wenn nur ein Pam mehr als ein Feld enthaelt ...
if( aPam.Start()->nContent != pCurStt->nContent )
- bOkay = FALSE;
+ bOkay = sal_False;
if( 0 != (pTxtFld = GetDocTxtFld( pCurStt )) )
{
@@ -400,10 +405,10 @@ void SwEditShell::UpdateFlds( SwField &rFld )
// bei gemischten Feldtypen
if( pCurFld->GetTyp()->Which() !=
rFld.GetTyp()->Which() )
- bOkay = FALSE;
+ bOkay = sal_False;
bTblSelBreak = GetDoc()->UpdateFld(pTxtFld, rFld,
- pMsgHnt, FALSE); // #111840#
+ pMsgHnt, sal_False); // #111840#
}
// Der Suchbereich wird um den gefundenen Bereich
// verkuerzt.
@@ -454,7 +459,7 @@ void SwEditShell::ChangeDBFields( const SvStringsDtor& rOldNames,
/*--------------------------------------------------------------------
Beschreibung: Alle Expression-Felder erneuern
--------------------------------------------------------------------*/
-void SwEditShell::UpdateExpFlds(BOOL bCloseDB)
+void SwEditShell::UpdateExpFlds(sal_Bool bCloseDB)
{
SET_CURR_SHELL( this );
StartAllAction();
@@ -493,30 +498,30 @@ void SwEditShell::SetFldUpdateFlags( SwFldUpdateFlags eFlags )
getIDocumentSettingAccess()->setFieldUpdateFlags( eFlags );
}
-SwFldUpdateFlags SwEditShell::GetFldUpdateFlags(BOOL bDocSettings) const
+SwFldUpdateFlags SwEditShell::GetFldUpdateFlags(sal_Bool bDocSettings) const
{
return getIDocumentSettingAccess()->getFieldUpdateFlags( !bDocSettings );
}
-void SwEditShell::SetFixFields( BOOL bOnlyTimeDate,
+void SwEditShell::SetFixFields( sal_Bool bOnlyTimeDate,
const DateTime* pNewDateTime )
{
SET_CURR_SHELL( this );
- BOOL bUnLockView = !IsViewLocked();
- LockView( TRUE );
+ sal_Bool bUnLockView = !IsViewLocked();
+ LockView( sal_True );
StartAllAction();
GetDoc()->SetFixFields( bOnlyTimeDate, pNewDateTime );
EndAllAction();
if( bUnLockView )
- LockView( FALSE );
+ LockView( sal_False );
}
-void SwEditShell::SetLabelDoc( BOOL bFlag )
+void SwEditShell::SetLabelDoc( sal_Bool bFlag )
{
GetDoc()->set(IDocumentSettingAccess::LABEL_DOCUMENT, bFlag );
}
-BOOL SwEditShell::IsLabelDoc() const
+sal_Bool SwEditShell::IsLabelDoc() const
{
return getIDocumentSettingAccess()->get(IDocumentSettingAccess::LABEL_DOCUMENT);
}
@@ -530,14 +535,14 @@ void SwEditShell::ChangeAuthorityData(const SwAuthEntry* pNewData)
/* -----------------------------03.08.2001 12:04------------------------------
---------------------------------------------------------------------------*/
-BOOL SwEditShell::IsAnyDatabaseFieldInDoc()const
+sal_Bool SwEditShell::IsAnyDatabaseFieldInDoc()const
{
const SwFldTypes * pFldTypes = GetDoc()->GetFldTypes();
- const USHORT nSize = pFldTypes->Count();
- for(USHORT i = 0; i < nSize; ++i)
+ const sal_uInt16 nSize = pFldTypes->Count();
+ for(sal_uInt16 i = 0; i < nSize; ++i)
{
SwFieldType& rFldType = *((*pFldTypes)[i]);
- USHORT nWhich = rFldType.Which();
+ sal_uInt16 nWhich = rFldType.Which();
if(IsUsed(rFldType))
{
switch(nWhich)
@@ -552,13 +557,18 @@ BOOL SwEditShell::IsAnyDatabaseFieldInDoc()const
while(pFld)
{
if(pFld->IsFldInDoc())
+<<<<<<< local
return TRUE;
pFld = aIter.Next();
+=======
+ return sal_True;
+ pFld = (SwFmtFld*)aIter.Next();
+>>>>>>> other
}
}
break;
}
}
}
- return FALSE;
+ return sal_False;
}
diff --git a/sw/source/core/edit/edfldexp.cxx b/sw/source/core/edit/edfldexp.cxx
index 821daba8a500..53ae433308cc 100644
--- a/sw/source/core/edit/edfldexp.cxx
+++ b/sw/source/core/edit/edfldexp.cxx
@@ -45,21 +45,28 @@
using namespace com::sun::star;
using ::rtl::OUString;
+<<<<<<< local
BOOL SwEditShell::IsFieldDataSourceAvailable(String& rUsedDataSource) const
+=======
+/* -----------------28.11.2002 17:53-----------------
+ *
+ * --------------------------------------------------*/
+sal_Bool SwEditShell::IsFieldDataSourceAvailable(String& rUsedDataSource) const
+>>>>>>> other
{
const SwFldTypes * pFldTypes = GetDoc()->GetFldTypes();
- const USHORT nSize = pFldTypes->Count();
+ const sal_uInt16 nSize = pFldTypes->Count();
uno::Reference< lang::XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() );
if( !xMgr.is() )
- return FALSE;
+ return sal_False;
uno::Reference<uno::XInterface> xInstance = xMgr->createInstance( OUString::createFromAscii( "com.sun.star.sdb.DatabaseContext" ));
uno::Reference<container::XNameAccess> xDBContext(xInstance, uno::UNO_QUERY) ;
if(!xDBContext.is())
- return FALSE;
- for(USHORT i = 0; i < nSize; ++i)
+ return sal_False;
+ for(sal_uInt16 i = 0; i < nSize; ++i)
{
SwFieldType& rFldType = *((*pFldTypes)[i]);
- USHORT nWhich = rFldType.Which();
+ sal_uInt16 nWhich = rFldType.Which();
if(IsUsed(rFldType))
{
switch(nWhich)
@@ -81,7 +88,7 @@ BOOL SwEditShell::IsFieldDataSourceAvailable(String& rUsedDataSource) const
catch(uno::Exception const &)
{
rUsedDataSource = rData.sDataSource;
- return FALSE;
+ return sal_False;
}
}
pFld = aIter.Next();
@@ -91,7 +98,7 @@ BOOL SwEditShell::IsFieldDataSourceAvailable(String& rUsedDataSource) const
}
}
}
- return TRUE;
+ return sal_True;
}
diff --git a/sw/source/core/edit/edfmt.cxx b/sw/source/core/edit/edfmt.cxx
index a23f6ae784ae..225a1df48c74 100644
--- a/sw/source/core/edit/edfmt.cxx
+++ b/sw/source/core/edit/edfmt.cxx
@@ -48,13 +48,13 @@
// OPT: inline
-USHORT SwEditShell::GetCharFmtCount() const
+sal_uInt16 SwEditShell::GetCharFmtCount() const
{
return GetDoc()->GetCharFmts()->Count();
}
-SwCharFmt& SwEditShell::GetCharFmt(USHORT nFmt) const
+SwCharFmt& SwEditShell::GetCharFmt(sal_uInt16 nFmt) const
{
return *((*(GetDoc()->GetCharFmts()))[nFmt]);
}
@@ -67,14 +67,14 @@ SwCharFmt* SwEditShell::GetCurCharFmt() const
RES_TXTATR_CHARFMT );
const SfxPoolItem* pItem;
if( GetCurAttr( aSet ) && SFX_ITEM_SET ==
- aSet.GetItemState( RES_TXTATR_CHARFMT, FALSE, &pItem ) )
+ aSet.GetItemState( RES_TXTATR_CHARFMT, sal_False, &pItem ) )
pFmt = ((SwFmtCharFmt*)pItem)->GetCharFmt();
return pFmt;
}
-void SwEditShell::FillByEx(SwCharFmt* pCharFmt, BOOL bReset)
+void SwEditShell::FillByEx(SwCharFmt* pCharFmt, sal_Bool bReset)
{
if ( bReset )
{
@@ -128,12 +128,12 @@ void SwEditShell::FillByEx(SwCharFmt* pCharFmt, BOOL bReset)
}
// Frm
-USHORT SwEditShell::GetTblFrmFmtCount(BOOL bUsed) const
+sal_uInt16 SwEditShell::GetTblFrmFmtCount(sal_Bool bUsed) const
{
return GetDoc()->GetTblFrmFmtCount(bUsed);
}
-SwFrmFmt& SwEditShell::GetTblFrmFmt(USHORT nFmt, BOOL bUsed ) const
+SwFrmFmt& SwEditShell::GetTblFrmFmt(sal_uInt16 nFmt, sal_Bool bUsed ) const
{
return GetDoc()->GetTblFrmFmt(nFmt, bUsed );
}
@@ -157,31 +157,31 @@ SwCharFmt* SwEditShell::MakeCharFmt( const String& rName,
// inlines im Product
-SwTxtFmtColl* SwEditShell::GetTxtCollFromPool( USHORT nId )
+SwTxtFmtColl* SwEditShell::GetTxtCollFromPool( sal_uInt16 nId )
{
return GetDoc()->GetTxtCollFromPool( nId );
}
// return das geforderte automatische Format - Basis-Klasse !
-SwFmt* SwEditShell::GetFmtFromPool( USHORT nId )
+SwFmt* SwEditShell::GetFmtFromPool( sal_uInt16 nId )
{
return GetDoc()->GetFmtFromPool( nId );
}
-SwPageDesc* SwEditShell::GetPageDescFromPool( USHORT nId )
+SwPageDesc* SwEditShell::GetPageDescFromPool( sal_uInt16 nId )
{
return GetDoc()->GetPageDescFromPool( nId );
}
-BOOL SwEditShell::IsUsed( const SwModify& rModify ) const
+sal_Bool SwEditShell::IsUsed( const SwModify& rModify ) const
{
return pDoc->IsUsed( rModify );
}
-const SwFlyFrmFmt* SwEditShell::FindFlyByName( const String& rName, BYTE nNdTyp ) const
+const SwFlyFrmFmt* SwEditShell::FindFlyByName( const String& rName, sal_uInt8 nNdTyp ) const
{
return pDoc->FindFlyByName(rName, nNdTyp);
}
diff --git a/sw/source/core/edit/edglbldc.cxx b/sw/source/core/edit/edglbldc.cxx
index 6f884f244326..d07b5b7a1e6c 100644
--- a/sw/source/core/edit/edglbldc.cxx
+++ b/sw/source/core/edit/edglbldc.cxx
@@ -28,8 +28,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <editsh.hxx>
#include <pam.hxx>
#include <ndtxt.hxx>
@@ -43,25 +43,27 @@
SV_IMPL_OP_PTRARR_SORT( SwGlblDocContents, SwGlblDocContentPtr )
-BOOL SwEditShell::IsGlobalDoc() const
+sal_Bool SwEditShell::IsGlobalDoc() const
{
return getIDocumentSettingAccess()->get(IDocumentSettingAccess::GLOBAL_DOCUMENT);
}
-void SwEditShell::SetGlblDocSaveLinks( BOOL bFlag )
+void SwEditShell::SetGlblDocSaveLinks( sal_Bool bFlag )
{
getIDocumentSettingAccess()->set(IDocumentSettingAccess::GLOBAL_DOCUMENT_SAVE_LINKS, bFlag);
if( !GetDoc()->IsModified() ) // Bug 57028
- GetDoc()->SetUndoNoResetModified();
+ {
+ GetDoc()->GetIDocumentUndoRedo().SetUndoNoResetModified();
+ }
GetDoc()->SetModified();
}
-BOOL SwEditShell::IsGlblDocSaveLinks() const
+sal_Bool SwEditShell::IsGlblDocSaveLinks() const
{
return getIDocumentSettingAccess()->get(IDocumentSettingAccess::GLOBAL_DOCUMENT_SAVE_LINKS);
}
-USHORT SwEditShell::GetGlobalDocContent( SwGlblDocContents& rArr ) const
+sal_uInt16 SwEditShell::GetGlobalDocContent( SwGlblDocContents& rArr ) const
{
if( rArr.Count() )
rArr.DeleteAndDestroy( 0, rArr.Count() );
@@ -72,7 +74,7 @@ USHORT SwEditShell::GetGlobalDocContent( SwGlblDocContents& rArr ) const
// dann alle gelinkten Bereiche auf der obersten Ebene
SwDoc* pMyDoc = GetDoc();
const SwSectionFmts& rSectFmts = pMyDoc->GetSections();
- USHORT n;
+ sal_uInt16 n;
for( n = rSectFmts.Count(); n; )
{
@@ -99,7 +101,7 @@ USHORT SwEditShell::GetGlobalDocContent( SwGlblDocContents& rArr ) const
// und als letztes die Dummies (sonstiger Text) einfuegen
SwNode* pNd;
- ULONG nSttIdx = pMyDoc->GetNodes().GetEndOfExtras().GetIndex() + 2;
+ sal_uLong nSttIdx = pMyDoc->GetNodes().GetEndOfExtras().GetIndex() + 2;
for( n = 0; n < rArr.Count(); ++n )
{
const SwGlblDocContent& rNew = *rArr[ n ];
@@ -125,7 +127,7 @@ USHORT SwEditShell::GetGlobalDocContent( SwGlblDocContents& rArr ) const
// sollte man das Ende auch noch setzen??
if( rArr.Count() )
{
- ULONG nNdEnd = pMyDoc->GetNodes().GetEndOfContent().GetIndex();
+ sal_uLong nNdEnd = pMyDoc->GetNodes().GetEndOfContent().GetIndex();
for( ; nSttIdx < nNdEnd; ++nSttIdx )
if( ( pNd = pMyDoc->GetNodes()[ nSttIdx ])->IsCntntNode()
|| pNd->IsSectionNode() || pNd->IsTableNode() )
@@ -145,11 +147,11 @@ USHORT SwEditShell::GetGlobalDocContent( SwGlblDocContents& rArr ) const
return rArr.Count();
}
-BOOL SwEditShell::InsertGlobalDocContent( const SwGlblDocContent& rInsPos,
+sal_Bool SwEditShell::InsertGlobalDocContent( const SwGlblDocContent& rInsPos,
SwSectionData & rNew)
{
if( !getIDocumentSettingAccess()->get(IDocumentSettingAccess::GLOBAL_DOCUMENT) )
- return FALSE;
+ return sal_False;
SET_CURR_SHELL( this );
StartAllAction();
@@ -161,15 +163,15 @@ BOOL SwEditShell::InsertGlobalDocContent( const SwGlblDocContent& rInsPos,
SwPosition& rPos = *pCrsr->GetPoint();
rPos.nNode = rInsPos.GetDocPos();
- BOOL bEndUndo = FALSE;
+ sal_Bool bEndUndo = sal_False;
SwDoc* pMyDoc = GetDoc();
- SwTxtNode* pTxtNd = pMyDoc->GetNodes()[ rPos.nNode ]->GetTxtNode();
+ SwTxtNode *const pTxtNd = rPos.nNode.GetNode().GetTxtNode();
if( pTxtNd )
rPos.nContent.Assign( pTxtNd, 0 );
else
{
- bEndUndo = TRUE;
- pMyDoc->StartUndo( UNDO_START, NULL );
+ bEndUndo = sal_True;
+ pMyDoc->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
rPos.nNode--;
pMyDoc->AppendTxtNode( rPos );
pCrsr->SetMark();
@@ -178,17 +180,19 @@ BOOL SwEditShell::InsertGlobalDocContent( const SwGlblDocContent& rInsPos,
InsertSection( rNew );
if( bEndUndo )
- pMyDoc->EndUndo( UNDO_END, NULL );
+ {
+ pMyDoc->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
+ }
EndAllAction();
- return TRUE;
+ return sal_True;
}
-BOOL SwEditShell::InsertGlobalDocContent( const SwGlblDocContent& rInsPos,
+sal_Bool SwEditShell::InsertGlobalDocContent( const SwGlblDocContent& rInsPos,
const SwTOXBase& rTOX )
{
if( !getIDocumentSettingAccess()->get(IDocumentSettingAccess::GLOBAL_DOCUMENT) )
- return FALSE;
+ return sal_False;
SET_CURR_SHELL( this );
StartAllAction();
@@ -200,7 +204,7 @@ BOOL SwEditShell::InsertGlobalDocContent( const SwGlblDocContent& rInsPos,
SwPosition& rPos = *pCrsr->GetPoint();
rPos.nNode = rInsPos.GetDocPos();
- BOOL bEndUndo = FALSE;
+ sal_Bool bEndUndo = sal_False;
SwDoc* pMyDoc = GetDoc();
SwTxtNode* pTxtNd = rPos.nNode.GetNode().GetTxtNode();
if( pTxtNd && pTxtNd->GetTxt().Len() && rPos.nNode.GetIndex() + 1 !=
@@ -208,8 +212,8 @@ BOOL SwEditShell::InsertGlobalDocContent( const SwGlblDocContent& rInsPos,
rPos.nContent.Assign( pTxtNd, 0 );
else
{
- bEndUndo = TRUE;
- pMyDoc->StartUndo( UNDO_START, NULL );
+ bEndUndo = sal_True;
+ pMyDoc->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
rPos.nNode--;
pMyDoc->AppendTxtNode( rPos );
}
@@ -217,16 +221,18 @@ BOOL SwEditShell::InsertGlobalDocContent( const SwGlblDocContent& rInsPos,
InsertTableOf( rTOX );
if( bEndUndo )
- pMyDoc->EndUndo( UNDO_END, NULL );
+ {
+ pMyDoc->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
+ }
EndAllAction();
- return TRUE;
+ return sal_True;
}
-BOOL SwEditShell::InsertGlobalDocContent( const SwGlblDocContent& rInsPos )
+sal_Bool SwEditShell::InsertGlobalDocContent( const SwGlblDocContent& rInsPos )
{
if( !getIDocumentSettingAccess()->get(IDocumentSettingAccess::GLOBAL_DOCUMENT) )
- return FALSE;
+ return sal_False;
SET_CURR_SHELL( this );
StartAllAction();
@@ -242,14 +248,14 @@ BOOL SwEditShell::InsertGlobalDocContent( const SwGlblDocContent& rInsPos )
SwDoc* pMyDoc = GetDoc();
pMyDoc->AppendTxtNode( rPos );
EndAllAction();
- return TRUE;
+ return sal_True;
}
-BOOL SwEditShell::DeleteGlobalDocContent( const SwGlblDocContents& rArr ,
- USHORT nDelPos )
+sal_Bool SwEditShell::DeleteGlobalDocContent( const SwGlblDocContents& rArr ,
+ sal_uInt16 nDelPos )
{
if( !getIDocumentSettingAccess()->get(IDocumentSettingAccess::GLOBAL_DOCUMENT) )
- return FALSE;
+ return sal_False;
SET_CURR_SHELL( this );
StartAllAction();
@@ -263,7 +269,7 @@ BOOL SwEditShell::DeleteGlobalDocContent( const SwGlblDocContents& rArr ,
SwDoc* pMyDoc = GetDoc();
const SwGlblDocContent& rDelPos = *rArr[ nDelPos ];
- ULONG nDelIdx = rDelPos.GetDocPos();
+ sal_uLong nDelIdx = rDelPos.GetDocPos();
if( 1 == rArr.Count() )
{
// ein Node muss aber da bleiben!
@@ -293,32 +299,32 @@ BOOL SwEditShell::DeleteGlobalDocContent( const SwGlblDocContents& rArr ,
case GLBLDOC_TOXBASE:
{
SwTOXBaseSection* pTOX = (SwTOXBaseSection*)rDelPos.GetTOX();
- pMyDoc->DeleteTOX( *pTOX, TRUE );
+ pMyDoc->DeleteTOX( *pTOX, sal_True );
}
break;
case GLBLDOC_SECTION:
{
SwSectionFmt* pSectFmt = (SwSectionFmt*)rDelPos.GetSection()->GetFmt();
- pMyDoc->DelSectionFmt( pSectFmt, TRUE );
+ pMyDoc->DelSectionFmt( pSectFmt, sal_True );
}
break;
}
EndUndo( UNDO_END );
EndAllAction();
- return TRUE;
+ return sal_True;
}
-BOOL SwEditShell::MoveGlobalDocContent( const SwGlblDocContents& rArr ,
- USHORT nFromPos, USHORT nToPos,
- USHORT nInsPos )
+sal_Bool SwEditShell::MoveGlobalDocContent( const SwGlblDocContents& rArr ,
+ sal_uInt16 nFromPos, sal_uInt16 nToPos,
+ sal_uInt16 nInsPos )
{
if( !getIDocumentSettingAccess()->get(IDocumentSettingAccess::GLOBAL_DOCUMENT) ||
nFromPos >= rArr.Count() || nToPos > rArr.Count() ||
nInsPos > rArr.Count() || nFromPos >= nToPos ||
( nFromPos <= nInsPos && nInsPos <= nToPos ) )
- return FALSE;
+ return sal_False;
SET_CURR_SHELL( this );
StartAllAction();
@@ -349,10 +355,10 @@ BOOL SwEditShell::MoveGlobalDocContent( const SwGlblDocContents& rArr ,
return bRet;
}
-BOOL SwEditShell::GotoGlobalDocContent( const SwGlblDocContent& rPos )
+sal_Bool SwEditShell::GotoGlobalDocContent( const SwGlblDocContent& rPos )
{
if( !getIDocumentSettingAccess()->get(IDocumentSettingAccess::GLOBAL_DOCUMENT) )
- return FALSE;
+ return sal_False;
SET_CURR_SHELL( this );
SttCrsrMove();
@@ -365,17 +371,17 @@ BOOL SwEditShell::GotoGlobalDocContent( const SwGlblDocContent& rPos )
rCrsrPos.nNode = rPos.GetDocPos();
SwDoc* pMyDoc = GetDoc();
- SwCntntNode* pCNd = pMyDoc->GetNodes()[ rCrsrPos.nNode ]->GetCntntNode();
+ SwCntntNode * pCNd = rCrsrPos.nNode.GetNode().GetCntntNode();
if( !pCNd )
pCNd = pMyDoc->GetNodes().GoNext( &rCrsrPos.nNode );
rCrsrPos.nContent.Assign( pCNd, 0 );
EndCrsrMove();
- return TRUE;
+ return sal_True;
}
-SwGlblDocContent::SwGlblDocContent( ULONG nPos )
+SwGlblDocContent::SwGlblDocContent( sal_uLong nPos )
{
eType = GLBLDOC_UNKNOWN;
PTR.pTOX = 0;
diff --git a/sw/source/core/edit/edglss.cxx b/sw/source/core/edit/edglss.cxx
index 50709990f0ff..56996558b306 100644
--- a/sw/source/core/edit/edglss.cxx
+++ b/sw/source/core/edit/edglss.cxx
@@ -64,8 +64,8 @@ void SwEditShell::InsertGlossary( SwTextBlocks& rGlossary, const String& rStr )
******************************************************************************/
-USHORT SwEditShell::MakeGlossary( SwTextBlocks& rBlks, const String& rName, const String& rShortName,
- BOOL bSaveRelFile, const String* pOnlyTxt )
+sal_uInt16 SwEditShell::MakeGlossary( SwTextBlocks& rBlks, const String& rName, const String& rShortName,
+ sal_Bool bSaveRelFile, const String* pOnlyTxt )
{
SwDoc* pGDoc = rBlks.GetDoc();
@@ -77,7 +77,7 @@ USHORT SwEditShell::MakeGlossary( SwTextBlocks& rBlks, const String& rName, cons
}
rBlks.SetBaseURL( sBase );
- USHORT nRet;
+ sal_uInt16 nRet;
if( pOnlyTxt )
nRet = rBlks.PutText( rShortName, rName, *pOnlyTxt );
@@ -92,17 +92,17 @@ USHORT SwEditShell::MakeGlossary( SwTextBlocks& rBlks, const String& rName, cons
nRet = rBlks.PutDoc();
}
else
- nRet = (USHORT) -1;
+ nRet = (sal_uInt16) -1;
}
return nRet;
}
-USHORT SwEditShell::SaveGlossaryDoc( SwTextBlocks& rBlock,
+sal_uInt16 SwEditShell::SaveGlossaryDoc( SwTextBlocks& rBlock,
const String& rName,
const String& rShortName,
- BOOL bSaveRelFile,
- BOOL bOnlyTxt )
+ sal_Bool bSaveRelFile,
+ sal_Bool bOnlyTxt )
{
StartAllAction();
@@ -116,7 +116,7 @@ USHORT SwEditShell::SaveGlossaryDoc( SwTextBlocks& rBlock,
sBase = aURL.GetMainURL( INetURLObject::NO_DECODE );
}
rBlock.SetBaseURL( sBase );
- USHORT nRet = USHRT_MAX;
+ sal_uInt16 nRet = USHRT_MAX;
if( bOnlyTxt )
{
@@ -179,7 +179,7 @@ USHORT SwEditShell::SaveGlossaryDoc( SwTextBlocks& rBlock,
******************************************************************************/
-BOOL SwEditShell::_CopySelToDoc( SwDoc* pInsDoc, SwNodeIndex* pSttNd )
+sal_Bool SwEditShell::_CopySelToDoc( SwDoc* pInsDoc, SwNodeIndex* pSttNd )
{
ASSERT( pInsDoc, "kein Ins.Dokument" );
@@ -196,7 +196,7 @@ BOOL SwEditShell::_CopySelToDoc( SwDoc* pInsDoc, SwNodeIndex* pSttNd )
(*pSttNd)--;
}
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
SET_CURR_SHELL( this );
pInsDoc->LockExpFlds();
@@ -215,22 +215,22 @@ BOOL SwEditShell::_CopySelToDoc( SwDoc* pInsDoc, SwNodeIndex* pSttNd )
->GetSttNd()->FindTableNode() ))
{
// teste ob der TabellenName kopiert werden kann
- BOOL bCpyTblNm = aBoxes.Count() == pTblNd->GetTable().GetTabSortBoxes().Count();
+ sal_Bool bCpyTblNm = aBoxes.Count() == pTblNd->GetTable().GetTabSortBoxes().Count();
if( bCpyTblNm )
{
const String& rTblName = pTblNd->GetTable().GetFrmFmt()->GetName();
const SwFrmFmts& rTblFmts = *pInsDoc->GetTblFrmFmts();
- for( USHORT n = rTblFmts.Count(); n; )
+ for( sal_uInt16 n = rTblFmts.Count(); n; )
if( rTblFmts[ --n ]->GetName() == rTblName )
{
- bCpyTblNm = FALSE;
+ bCpyTblNm = sal_False;
break;
}
}
- bRet = pInsDoc->InsCopyOfTbl( aPos, aBoxes, 0, bCpyTblNm, FALSE );
+ bRet = pInsDoc->InsCopyOfTbl( aPos, aBoxes, 0, bCpyTblNm, sal_False );
}
else
- bRet = FALSE;
+ bRet = sal_False;
}
else
{
@@ -276,13 +276,13 @@ BOOL SwEditShell::_CopySelToDoc( SwDoc* pInsDoc, SwNodeIndex* pSttNd )
/*------------------------------------------------------------------------
Beschreibung: Text innerhalb der Selektion erfragen
- Returnwert: liefert FALSE, wenn der selektierte Bereich
+ Returnwert: liefert sal_False, wenn der selektierte Bereich
zu gross ist, um in den Stringpuffer kopiert zu werden.
------------------------------------------------------------------------*/
-BOOL SwEditShell::GetSelectedText( String &rBuf, int nHndlParaBrk )
+sal_Bool SwEditShell::GetSelectedText( String &rBuf, int nHndlParaBrk )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
GetCrsr(); // ggfs. alle Cursor erzeugen lassen
if( IsSelOnePara() )
{
@@ -304,7 +304,7 @@ BOOL SwEditShell::GetSelectedText( String &rBuf, int nHndlParaBrk )
RTL_CONSTASCII_STRINGPARAM( "\015\012" ));
#endif
}
- bRet = TRUE;
+ bRet = sal_True;
}
else if( IsSelection() )
{
@@ -320,18 +320,18 @@ BOOL SwEditShell::GetSelectedText( String &rBuf, int nHndlParaBrk )
{
// Selektierte Bereiche in ein ASCII Dokument schreiben
SwWriter aWriter( aStream, *this);
- xWrt->SetShowProgress( FALSE );
+ xWrt->SetShowProgress( sal_False );
switch( nHndlParaBrk )
{
case GETSELTXT_PARABRK_TO_BLANK:
- xWrt->bASCII_ParaAsBlanc = TRUE;
- xWrt->bASCII_NoLastLineEnd = TRUE;
+ xWrt->bASCII_ParaAsBlanc = sal_True;
+ xWrt->bASCII_NoLastLineEnd = sal_True;
break;
case GETSELTXT_PARABRK_TO_ONLYCR:
- xWrt->bASCII_ParaAsCR = TRUE;
- xWrt->bASCII_NoLastLineEnd = TRUE;
+ xWrt->bASCII_ParaAsCR = sal_True;
+ xWrt->bASCII_NoLastLineEnd = sal_True;
break;
}
@@ -339,7 +339,7 @@ BOOL SwEditShell::GetSelectedText( String &rBuf, int nHndlParaBrk )
SwAsciiOptions aAsciiOpt( xWrt->GetAsciiOptions() );
aAsciiOpt.SetCharSet( RTL_TEXTENCODING_UCS2 );
xWrt->SetAsciiOptions( aAsciiOpt );
- xWrt->bUCS2_WithStartChar = FALSE;
+ xWrt->bUCS2_WithStartChar = sal_False;
long lLen;
if( !IsError( aWriter.Write( xWrt ) ) &&
@@ -364,7 +364,7 @@ BOOL SwEditShell::GetSelectedText( String &rBuf, int nHndlParaBrk )
}
}
- return TRUE;
+ return sal_True;
}
diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx
index 8701dd9bfe32..3dc20356dee7 100644
--- a/sw/source/core/edit/editsh.cxx
+++ b/sw/source/core/edit/editsh.cxx
@@ -27,6 +27,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
#include <hintids.hxx>
#include <tools/list.hxx>
#include <tools/urlobj.hxx>
@@ -41,6 +42,7 @@
#include <frmfmt.hxx>
#include <charfmt.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <docary.hxx>
#include <editsh.hxx>
#include <frame.hxx>
@@ -78,7 +80,7 @@ SV_IMPL_PTRARR(SwGetINetAttrs, SwGetINetAttr*)
******************************************************************************/
-void SwEditShell::Insert( sal_Unicode c, BOOL bOnlyCurrCrsr )
+void SwEditShell::Insert( sal_Unicode c, sal_Bool bOnlyCurrCrsr )
{
StartAllAction();
FOREACHPAM_START(this)
@@ -128,7 +130,7 @@ void SwEditShell::Insert2(const String &rStr, const bool bForceExpandHints )
// calculate cursor bidi level
SwCursor* pTmpCrsr = _GetCrsr();
- const BOOL bDoNotSetBidiLevel = ! pTmpCrsr ||
+ const sal_Bool bDoNotSetBidiLevel = ! pTmpCrsr ||
( 0 != dynamic_cast<SwUnoCrsr*>(pTmpCrsr) );
if ( ! bDoNotSetBidiLevel )
@@ -145,7 +147,7 @@ void SwEditShell::Insert2(const String &rStr, const bool bForceExpandHints )
SwScriptInfo* pSI = SwScriptInfo::GetScriptInfo( ((SwTxtNode&)rNode),
sal_True );
- BYTE nLevel = 0;
+ sal_uInt8 nLevel = 0;
if ( ! pSI )
{
// seems to be an empty paragraph.
@@ -169,7 +171,7 @@ void SwEditShell::Insert2(const String &rStr, const bool bForceExpandHints )
}
}
- SetInFrontOfLabel( FALSE ); // #i27615#
+ SetInFrontOfLabel( sal_False ); // #i27615#
EndAllAction();
}
@@ -186,7 +188,7 @@ void SwEditShell::Overwrite(const String &rStr)
FOREACHPAM_START(this)
if( !GetDoc()->Overwrite(*PCURCRSR, rStr ) )
{
- ASSERT( FALSE, "Doc->Overwrite(Str) failed." )
+ ASSERT( sal_False, "Doc->Overwrite(Str) failed." )
}
SaveTblBoxCntnt( PCURCRSR->GetPoint() );
FOREACHPAM_END()
@@ -198,10 +200,10 @@ void SwEditShell::Overwrite(const String &rStr)
* long SwEditShell::SplitNode()
******************************************************************************/
-long SwEditShell::SplitNode( BOOL bAutoFormat, BOOL bCheckTableStart )
+long SwEditShell::SplitNode( sal_Bool bAutoFormat, sal_Bool bCheckTableStart )
{
StartAllAction();
- GetDoc()->StartUndo(UNDO_EMPTY, NULL);
+ GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL);
FOREACHPAM_START(this)
// eine Tabellen Zelle wird jetzt zu einer normalen Textzelle!
@@ -209,7 +211,7 @@ long SwEditShell::SplitNode( BOOL bAutoFormat, BOOL bCheckTableStart )
GetDoc()->SplitNode( *PCURCRSR->GetPoint(), bCheckTableStart );
FOREACHPAM_END()
- GetDoc()->EndUndo(UNDO_EMPTY, NULL);
+ GetDoc()->GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, NULL);
if( bAutoFormat )
AutoFmtBySplitNode();
@@ -227,14 +229,14 @@ sal_Bool SwEditShell::AppendTxtNode()
{
sal_Bool bRet = sal_False;
StartAllAction();
- GetDoc()->StartUndo(UNDO_EMPTY, NULL);
+ GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL);
FOREACHPAM_START(this)
GetDoc()->ClearBoxNumAttrs( PCURCRSR->GetPoint()->nNode );
bRet = GetDoc()->AppendTxtNode( *PCURCRSR->GetPoint()) || bRet;
FOREACHPAM_END()
- GetDoc()->EndUndo(UNDO_EMPTY, NULL);
+ GetDoc()->GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, NULL);
ClearTblBoxCntnt();
@@ -265,7 +267,7 @@ SwGrfNode * SwEditShell::_GetGrfNode() const
******************************************************************************/
// --> OD 2005-02-09 #119353# - robust
-const Graphic* SwEditShell::GetGraphic( BOOL bWait ) const
+const Graphic* SwEditShell::GetGraphic( sal_Bool bWait ) const
{
SwGrfNode* pGrfNode = _GetGrfNode();
// --> OD 2005-02-09 #119353# - robust
@@ -274,7 +276,7 @@ const Graphic* SwEditShell::GetGraphic( BOOL bWait ) const
{
pGrf = &(pGrfNode->GetGrf());
// --> OD 2007-03-01 #i73788#
- // no load of linked graphic, if its not needed now (bWait = FALSE).
+ // no load of linked graphic, if its not needed now (bWait = sal_False).
if ( bWait )
{
if( pGrf->IsSwapOut() ||
@@ -304,7 +306,7 @@ const Graphic* SwEditShell::GetGraphic( BOOL bWait ) const
// <--
}
-BOOL SwEditShell::IsGrfSwapOut( BOOL bOnlyLinked ) const
+sal_Bool SwEditShell::IsGrfSwapOut( sal_Bool bOnlyLinked ) const
{
SwGrfNode *pGrfNode = _GetGrfNode();
return pGrfNode &&
@@ -323,10 +325,10 @@ const GraphicObject* SwEditShell::GetGraphicObj() const
// <--
}
-USHORT SwEditShell::GetGraphicType() const
+sal_uInt16 SwEditShell::GetGraphicType() const
{
SwGrfNode *pGrfNode = _GetGrfNode();
- return static_cast<USHORT>(pGrfNode ? pGrfNode->GetGrfObj().GetType() : GRAPHIC_NONE);
+ return static_cast<sal_uInt16>(pGrfNode ? pGrfNode->GetGrfObj().GetType() : GRAPHIC_NONE);
}
/******************************************************************************
@@ -335,7 +337,7 @@ USHORT SwEditShell::GetGraphicType() const
* oder auf die gleiche Graphic zeigt)
******************************************************************************/
-BOOL SwEditShell::GetGrfSize(Size& rSz) const
+sal_Bool SwEditShell::GetGrfSize(Size& rSz) const
{
SwNoTxtNode* pNoTxtNd;
SwPaM* pCurrentCrsr = GetCrsr();
@@ -344,9 +346,9 @@ BOOL SwEditShell::GetGrfSize(Size& rSz) const
&& 0 != ( pNoTxtNd = pCurrentCrsr->GetNode()->GetNoTxtNode() ) )
{
rSz = pNoTxtNd->GetTwipSize();
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
/******************************************************************************
@@ -435,8 +437,13 @@ void SwEditShell::ClearAutomaticContour()
if( pNd->HasAutomaticContour() )
{
StartAllAction();
+<<<<<<< local
pNd->SetContour( NULL, FALSE );
SwFlyFrm *pFly = (SwFlyFrm*)pNd->getLayoutFrm(GetLayout())->GetUpper();
+=======
+ pNd->SetContour( NULL, sal_False );
+ SwFlyFrm *pFly = (SwFlyFrm*)pNd->GetFrm()->GetUpper();
+>>>>>>> other
const SwFmtSurround &rSur = pFly->GetFmt()->GetSurround();
pFly->GetFmt()->NotifyClients( (SwFmtSurround*)&rSur, (SwFmtSurround*)&rSur );
GetDoc()->SetModified();
@@ -467,7 +474,7 @@ svt::EmbeddedObjectRef& SwEditShell::GetOLEObject() const
}
-BOOL SwEditShell::HasOLEObj( const String &rName ) const
+sal_Bool SwEditShell::HasOLEObj( const String &rName ) const
{
SwStartNode *pStNd;
SwNodeIndex aIdx( *GetNodes().GetEndOfAutotext().StartOfSectionNode(), 1 );
@@ -477,12 +484,17 @@ BOOL SwEditShell::HasOLEObj( const String &rName ) const
SwNode& rNd = aIdx.GetNode();
if( rNd.IsOLENode() &&
rName == ((SwOLENode&)rNd).GetChartTblName() &&
+<<<<<<< local
((SwOLENode&)rNd).getLayoutFrm( GetLayout() ) )
return TRUE;
+=======
+ ((SwOLENode&)rNd).GetFrm() )
+ return sal_True;
+>>>>>>> other
aIdx.Assign( *pStNd->EndOfSectionNode(), + 1 );
}
- return FALSE;
+ return sal_False;
}
@@ -542,7 +554,7 @@ const SwFmtRefMark* SwEditShell::GetRefMark( const String& rName ) const
}
// returne die Namen aller im Doc gesetzten Referenzen
-USHORT SwEditShell::GetRefMarks( SvStringsDtor* pStrings ) const
+sal_uInt16 SwEditShell::GetRefMarks( SvStringsDtor* pStrings ) const
{
return GetDoc()->GetRefMarks( pStrings );
}
@@ -552,7 +564,7 @@ USHORT SwEditShell::GetRefMarks( SvStringsDtor* pStrings ) const
******************************************************************************/
-String SwEditShell::GetDropTxt( const USHORT nChars ) const
+String SwEditShell::GetDropTxt( const sal_uInt16 nChars ) const
{
/**
* pb: made changes for #i74939#
@@ -566,7 +578,7 @@ String SwEditShell::GetDropTxt( const USHORT nChars ) const
{
// if a multi selection exists, search for the first line
// -> it is the cursor with the lowest index
- ULONG nIndex = pCrsr->GetMark()->nNode.GetIndex();
+ sal_uLong nIndex = pCrsr->GetMark()->nNode.GetIndex();
bool bPrev = true;
SwPaM* pLast = pCrsr;
SwPaM* pTemp = pCrsr;
@@ -577,7 +589,7 @@ String SwEditShell::GetDropTxt( const USHORT nChars ) const
if ( bPrev )
{
pTemp = pPrev2;
- ULONG nTemp = pPrev2->GetMark()->nNode.GetIndex();
+ sal_uLong nTemp = pPrev2->GetMark()->nNode.GetIndex();
if ( nTemp < nIndex )
{
nIndex = nTemp;
@@ -610,7 +622,7 @@ void SwEditShell::ReplaceDropTxt( const String &rStr )
SwPaM aPam( rNd, rStr.Len(), rNd, 0 );
if( !GetDoc()->Overwrite( aPam, rStr ) )
{
- ASSERT( FALSE, "Doc->Overwrite(Str) failed." );
+ ASSERT( sal_False, "Doc->Overwrite(Str) failed." );
}
EndAllAction();
@@ -644,7 +656,7 @@ String SwEditShell::Calculate()
rCC.toLower( aStr );
sal_Unicode ch;
- BOOL bValidFlds = FALSE;
+ sal_Bool bValidFlds = sal_False;
xub_StrLen nPos = 0;
while( nPos < aStr.Len() )
@@ -672,7 +684,7 @@ String SwEditShell::Calculate()
GetDoc()->FldsToCalc( aCalc,
pStart->nNode.GetIndex(),
pStart->nContent.GetIndex() );
- bValidFlds = TRUE;
+ bValidFlds = sal_True;
}
(( aFormel += '(' ) +=
aCalc.GetStrResult( aCalc.VarLook( sVar )
@@ -722,9 +734,9 @@ Graphic SwEditShell::GetIMapGraphic() const
GRAPHIC_DEFAULT == rGrf.GetType() ) )
{
#ifdef DBG_UTIL
- ASSERT( ((SwGrfNode*)pNd)->SwapIn( TRUE ) || !TRUE, "Grafik konnte nicht geladen werden" );
+ ASSERT( ((SwGrfNode*)pNd)->SwapIn( sal_True ) || !sal_True, "Grafik konnte nicht geladen werden" );
#else
- ((SwGrfNode*)pNd)->SwapIn( TRUE );
+ ((SwGrfNode*)pNd)->SwapIn( sal_True );
#endif
}
aRet = rGrf;
@@ -744,14 +756,14 @@ Graphic SwEditShell::GetIMapGraphic() const
}
-BOOL SwEditShell::InsertURL( const SwFmtINetFmt& rFmt, const String& rStr, BOOL bKeepSelection )
+sal_Bool SwEditShell::InsertURL( const SwFmtINetFmt& rFmt, const String& rStr, sal_Bool bKeepSelection )
{
// URL und Hinweistext (direkt oder via Selektion) notwendig
if( !rFmt.GetValue().Len() || ( !rStr.Len() && !HasSelection() ) )
- return FALSE;
+ return sal_False;
StartAllAction();
- GetDoc()->StartUndo( UNDO_UI_INSERT_URLTXT, NULL);
- BOOL bInsTxt = TRUE;
+ GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_UI_INSERT_URLTXT, NULL);
+ sal_Bool bInsTxt = sal_True;
if( rStr.Len() )
{
@@ -759,33 +771,33 @@ BOOL SwEditShell::InsertURL( const SwFmtINetFmt& rFmt, const String& rStr, BOOL
if( pCrsr->HasMark() && *pCrsr->GetPoint() != *pCrsr->GetMark() )
{
// Selection vorhanden, MehrfachSelektion?
- BOOL bDelTxt = TRUE;
+ sal_Bool bDelTxt = sal_True;
if( pCrsr->GetNext() == pCrsr )
{
// einfach Selection -> Text ueberpruefen
String sTxt( GetSelTxt() );
sTxt.EraseTrailingChars();
if( sTxt == rStr )
- bDelTxt = bInsTxt = FALSE;
+ bDelTxt = bInsTxt = sal_False;
}
else if( rFmt.GetValue() == rStr ) // Name und URL gleich?
- bDelTxt = bInsTxt = FALSE;
+ bDelTxt = bInsTxt = sal_False;
if( bDelTxt )
Delete();
}
else if( pCrsr->GetNext() != pCrsr && rFmt.GetValue() == rStr )
- bInsTxt = FALSE;
+ bInsTxt = sal_False;
if( bInsTxt )
{
Insert2( rStr );
SetMark();
- ExtendSelection( FALSE, rStr.Len() );
+ ExtendSelection( sal_False, rStr.Len() );
}
}
else
- bInsTxt = FALSE;
+ bInsTxt = sal_False;
SetAttr( rFmt );
if (bInsTxt && !IsCrsrPtAtEnd())
@@ -794,20 +806,20 @@ BOOL SwEditShell::InsertURL( const SwFmtINetFmt& rFmt, const String& rStr, BOOL
ClearMark();
if( bInsTxt )
DontExpandFmt();
- GetDoc()->EndUndo( UNDO_UI_INSERT_URLTXT, NULL );
+ GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_UI_INSERT_URLTXT, NULL );
EndAllAction();
- return TRUE;
+ return sal_True;
}
-USHORT SwEditShell::GetINetAttrs( SwGetINetAttrs& rArr )
+sal_uInt16 SwEditShell::GetINetAttrs( SwGetINetAttrs& rArr )
{
if( rArr.Count() )
rArr.DeleteAndDestroy( 0, rArr.Count() );
const SwTxtNode* pTxtNd;
const SwCharFmts* pFmts = GetDoc()->GetCharFmts();
- for( USHORT n = pFmts->Count(); 1 < n; )
+ for( sal_uInt16 n = pFmts->Count(); 1 < n; )
{
SwIterator<SwTxtINetFmt,SwCharFmt> aIter(*(*pFmts)[--n]);
for( SwTxtINetFmt* pFnd = aIter.First(); pFnd; pFnd = aIter.Next() )
@@ -836,9 +848,9 @@ USHORT SwEditShell::GetINetAttrs( SwGetINetAttrs& rArr )
// ist der Cursor in eine INetAttribut, dann wird das komplett
// geloescht; inclusive des Hinweistextes (wird beim Drag&Drop gebraucht)
-BOOL SwEditShell::DelINetAttrWithText()
+sal_Bool SwEditShell::DelINetAttrWithText()
{
- BOOL bRet = SelectTxtAttr( RES_TXTATR_INETFMT, FALSE );
+ sal_Bool bRet = SelectTxtAttr( RES_TXTATR_INETFMT, sal_False );
if( bRet )
DeleteSel( *GetCrsr() );
return bRet;
@@ -846,12 +858,12 @@ BOOL SwEditShell::DelINetAttrWithText()
// setzen an den Textzeichenattributen das DontExpand-Flag
-BOOL SwEditShell::DontExpandFmt()
+sal_Bool SwEditShell::DontExpandFmt()
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( !IsTableMode() && GetDoc()->DontExpandFmt( *GetCrsr()->GetPoint() ))
{
- bRet = TRUE;
+ bRet = sal_True;
CallChgLnk();
}
return bRet;
@@ -862,17 +874,17 @@ SvNumberFormatter* SwEditShell::GetNumberFormatter()
return GetDoc()->GetNumberFormatter();
}
-BOOL SwEditShell::RemoveInvisibleContent()
+sal_Bool SwEditShell::RemoveInvisibleContent()
{
StartAllAction();
- BOOL bRet = GetDoc()->RemoveInvisibleContent();
+ sal_Bool bRet = GetDoc()->RemoveInvisibleContent();
EndAllAction();
return bRet;
}
-BOOL SwEditShell::ConvertFieldsToText()
+sal_Bool SwEditShell::ConvertFieldsToText()
{
StartAllAction();
- BOOL bRet = GetDoc()->ConvertFieldsToText();
+ sal_Bool bRet = GetDoc()->ConvertFieldsToText();
EndAllAction();
return bRet;
}
@@ -889,8 +901,8 @@ void SwEditShell::SetNumberingRestart()
else
MakeFindRange(DOCPOS_OTHERSTART, DOCPOS_OTHEREND, pCrsr); //extra content
SwPosition* pSttPos = pCrsr->Start(), *pEndPos = pCrsr->End();
- ULONG nCurrNd = pSttPos->nNode.GetIndex();
- ULONG nEndNd = pEndPos->nNode.GetIndex();
+ sal_uLong nCurrNd = pSttPos->nNode.GetIndex();
+ sal_uLong nEndNd = pEndPos->nNode.GetIndex();
if( nCurrNd <= nEndNd )
{
SwCntntFrm* pCntFrm;
@@ -920,7 +932,7 @@ void SwEditShell::SetNumberingRestart()
pTxtNd->IsCountedInList() &&
!pTxtNd->IsListRestart() &&
pTxtNd->GetNum()->GetNumber() ==
- pNumRule->Get( static_cast<USHORT>(pTxtNd->GetActualListLevel()) ).GetStart() )
+ pNumRule->Get( static_cast<sal_uInt16>(pTxtNd->GetActualListLevel()) ).GetStart() )
{
//now set a the start value as attribute
SwPosition aCurrentNode(*pNd);
@@ -947,20 +959,20 @@ void SwEditShell::SetNumberingRestart()
}
- Pop(FALSE);
+ Pop(sal_False);
EndAllAction();
}
-USHORT SwEditShell::GetLineCount( BOOL bActPos )
+sal_uInt16 SwEditShell::GetLineCount( sal_Bool bActPos )
{
- USHORT nRet = 0;
+ sal_uInt16 nRet = 0;
CalcLayout();
SwPaM* pPam = GetCrsr();
SwNodeIndex& rPtIdx = pPam->GetPoint()->nNode;
SwNodeIndex aStart( rPtIdx );
SwCntntNode* pCNd;
SwCntntFrm *pCntFrm = 0;
- ULONG nTmpPos;
+ sal_uLong nTmpPos;
if( !bActPos )
aStart = 0;
@@ -979,7 +991,7 @@ USHORT SwEditShell::GetLineCount( BOOL bActPos )
pTmp = pCNd->FindFootnoteStartNode();
else
{ // Footer/Header
- const USHORT nTyp = FRM_HEADER | FRM_FOOTER;
+ const sal_uInt16 nTyp = FRM_HEADER | FRM_FOOTER;
SwFrm* pFrm = pCntFrm;
while( pFrm && !(pFrm->GetType() & nTyp) )
pFrm = pFrm->GetUpper();
@@ -996,7 +1008,7 @@ USHORT SwEditShell::GetLineCount( BOOL bActPos )
}
while( 0 != ( pCNd = GetDoc()->GetNodes().GoNextSection(
- &aStart, TRUE, FALSE )) && ( !bActPos || aStart <= rPtIdx ) )
+ &aStart, sal_True, sal_False )) && ( !bActPos || aStart <= rPtIdx ) )
{
if( 0 != ( pCntFrm = pCNd->getLayoutFrm( GetLayout() ) ) && pCntFrm->IsTxtFrm() )
{
@@ -1066,12 +1078,12 @@ void SwEditShell::SetLineNumberInfo(const SwLineNumberInfo& rInfo)
EndAllAction();
}
-USHORT SwEditShell::GetLinkUpdMode(BOOL bDocSettings) const
+sal_uInt16 SwEditShell::GetLinkUpdMode(sal_Bool bDocSettings) const
{
return getIDocumentSettingAccess()->getLinkUpdateMode( !bDocSettings );
}
-void SwEditShell::SetLinkUpdMode( USHORT nMode )
+void SwEditShell::SetLinkUpdMode( sal_uInt16 nMode )
{
getIDocumentSettingAccess()->setLinkUpdateMode( nMode );
}
@@ -1087,7 +1099,7 @@ SwExtTextInput* SwEditShell::CreateExtTextInput(LanguageType eInputLanguage)
return pRet;
}
-String SwEditShell::DeleteExtTextInput( SwExtTextInput* pDel, BOOL bInsText )
+String SwEditShell::DeleteExtTextInput( SwExtTextInput* pDel, sal_Bool bInsText )
{
if( !pDel )
{
@@ -1167,14 +1179,14 @@ void SwEditShell::TransliterateText( sal_uInt32 nType )
SwPaM* pCrsr = GetCrsr();
if( pCrsr->GetNext() != pCrsr )
{
- GetDoc()->StartUndo(UNDO_EMPTY, NULL);
+ GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL);
FOREACHPAM_START( this )
if( PCURCRSR->HasMark() )
GetDoc()->TransliterateText( *PCURCRSR, aTrans );
FOREACHPAM_END()
- GetDoc()->EndUndo(UNDO_EMPTY, NULL);
+ GetDoc()->GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, NULL);
}
else
GetDoc()->TransliterateText( *pCrsr, aTrans );
diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx
index 938ce6c36ae5..3e7e240ff9b0 100644
--- a/sw/source/core/edit/edlingu.cxx
+++ b/sw/source/core/edit/edlingu.cxx
@@ -47,6 +47,7 @@
#include <charatr.hxx>
#include <editsh.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <rootfrm.hxx> // SwRootFrm
#include <pam.hxx>
#include <swundo.hxx> // fuer die UndoIds
@@ -119,8 +120,8 @@ public:
// the content positions of each portion need to be saved
struct SpellContentPosition
{
- USHORT nLeft;
- USHORT nRight;
+ sal_uInt16 nLeft;
+ sal_uInt16 nRight;
};
typedef std::vector<SpellContentPosition> SpellContentPositions;
class SwSpellIter : public SwLinguIter
@@ -711,7 +712,7 @@ bool SwEditShell::HasLastSentenceGotGrammarChecked() const
* SwEditShell::HasConvIter
*************************************************************************/
-BOOL SwEditShell::HasConvIter() const
+sal_Bool SwEditShell::HasConvIter() const
{
return 0 != pConvIter;
}
@@ -720,7 +721,7 @@ BOOL SwEditShell::HasConvIter() const
* SwEditShell::HasHyphIter
*************************************************************************/
-BOOL SwEditShell::HasHyphIter() const
+sal_Bool SwEditShell::HasHyphIter() const
{
return 0 != pHyphIter;
}
@@ -732,7 +733,7 @@ BOOL SwEditShell::HasHyphIter() const
void SwEditShell::SetLinguRange( SwDocPositions eStart, SwDocPositions eEnd )
{
SwPaM *pCrsr = GetCrsr();
- MakeFindRange( static_cast<USHORT>(eStart), static_cast<USHORT>(eEnd), pCrsr );
+ MakeFindRange( static_cast<sal_uInt16>(eStart), static_cast<sal_uInt16>(eEnd), pCrsr );
if( *pCrsr->GetPoint() > *pCrsr->GetMark() )
pCrsr->Exchange();
}
@@ -1047,7 +1048,7 @@ uno::Reference< XSpellAlternatives >
Sequence< PropertyValue > aPropVals(1);
PropertyValue &rVal = aPropVals.getArray()[0];
rVal.Name = C2U( UPN_MAX_NUMBER_OF_SUGGESTIONS );
- rVal.Value <<= (INT16) 7;
+ rVal.Value <<= (sal_Int16) 7;
xSpellAlt = xSpell->spell( aWord, eActLang, aPropVals );
}
@@ -1061,7 +1062,7 @@ uno::Reference< XSpellAlternatives >
xub_StrLen nLineStart = GetCrsr()->GetPoint()->nContent.GetIndex();
RightMargin();
xub_StrLen nLineEnd = GetCrsr()->GetPoint()->nContent.GetIndex();
- Pop(FALSE);
+ Pop(sal_False);
// make sure the selection build later from the
// data below does not include footnotes and other
@@ -1092,16 +1093,20 @@ uno::Reference< XSpellAlternatives >
rContent = nWordStart;
SwRect aStartRect;
SwCrsrMoveState aState;
- aState.bRealWidth = TRUE;
+ aState.bRealWidth = sal_True;
SwCntntNode* pCntntNode = pCrsr->GetCntntNode();
+<<<<<<< local
SwCntntFrm *pCntntFrame = pCntntNode->getLayoutFrm( GetLayout(), pPt, pCrsr->GetPoint(), FALSE);
+=======
+ SwCntntFrm *pCntntFrame = pCntntNode->GetFrm(pPt, pCrsr->GetPoint(), sal_False);
+>>>>>>> other
pCntntFrame->GetCharRect( aStartRect, *pCrsr->GetPoint(), &aState );
rContent = nWordEnd;
SwRect aEndRect;
pCntntFrame->GetCharRect( aEndRect, *pCrsr->GetPoint(),&aState );
rSelectRect = aStartRect.Union( aEndRect );
- Pop(FALSE);
+ Pop(sal_False);
}
}
}
@@ -1201,7 +1206,7 @@ bool SwEditShell::GetGrammarCorrection(
xub_StrLen nLineStart = GetCrsr()->GetPoint()->nContent.GetIndex();
RightMargin();
xub_StrLen nLineEnd = GetCrsr()->GetPoint()->nContent.GetIndex();
- Pop(FALSE);
+ Pop(sal_False);
#if OSL_DEBUG_LEVEL > 1
// pNode->GetGrammarCheck()->Invalidate( 0, STRING_LEN );
@@ -1236,16 +1241,20 @@ bool SwEditShell::GetGrammarCorrection(
rContent = nWordStart;
SwRect aStartRect;
SwCrsrMoveState aState;
- aState.bRealWidth = TRUE;
+ aState.bRealWidth = sal_True;
SwCntntNode* pCntntNode = pCrsr->GetCntntNode();
+<<<<<<< local
SwCntntFrm *pCntntFrame = pCntntNode->getLayoutFrm( GetLayout(), pPt, pCrsr->GetPoint(), FALSE);
+=======
+ SwCntntFrm *pCntntFrame = pCntntNode->GetFrm(pPt, pCrsr->GetPoint(), sal_False);
+>>>>>>> other
pCntntFrame->GetCharRect( aStartRect, *pCrsr->GetPoint(), &aState );
rContent = nWordEnd;
SwRect aEndRect;
pCntntFrame->GetCharRect( aEndRect, *pCrsr->GetPoint(),&aState );
rSelectRect = aStartRect.Union( aEndRect );
- Pop(FALSE);
+ Pop(sal_False);
}
}
}
@@ -1328,7 +1337,7 @@ void SwEditShell::ApplyChangedSentence(const ::svx::SpellPortions& rNewPortions,
// iterate over the new portions, beginning at the end to take advantage of the previously
// saved content positions
- pDoc->StartUndo( UNDO_OVERWRITE, NULL );
+ pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_OVERWRITE, NULL );
StartAction();
SwPaM *pCrsr = GetCrsr();
@@ -1372,8 +1381,8 @@ void SwEditShell::ApplyChangedSentence(const ::svx::SpellPortions& rNewPortions,
pCrsr->SetMark();
pCrsr->GetPoint()->nContent = aCurrentOldPosition->nLeft;
pCrsr->GetMark()->nContent = aCurrentOldPosition->nRight;
- USHORT nScriptType = GetI18NScriptTypeOfLanguage( aCurrentNewPortion->eLanguage );
- USHORT nLangWhichId = RES_CHRATR_LANGUAGE;
+ sal_uInt16 nScriptType = GetI18NScriptTypeOfLanguage( aCurrentNewPortion->eLanguage );
+ sal_uInt16 nLangWhichId = RES_CHRATR_LANGUAGE;
switch(nScriptType)
{
case SCRIPTTYPE_ASIAN : nLangWhichId = RES_CHRATR_CJK_LANGUAGE; break;
@@ -1421,8 +1430,8 @@ void SwEditShell::ApplyChangedSentence(const ::svx::SpellPortions& rNewPortions,
while(aCurrentNewPortion != rNewPortions.end())
{
//set the language attribute
- USHORT nScriptType = GetScriptType();
- USHORT nLangWhichId = RES_CHRATR_LANGUAGE;
+ sal_uInt16 nScriptType = GetScriptType();
+ sal_uInt16 nLangWhichId = RES_CHRATR_LANGUAGE;
switch(nScriptType)
{
case SCRIPTTYPE_ASIAN : nLangWhichId = RES_CHRATR_CJK_LANGUAGE; break;
@@ -1445,7 +1454,7 @@ void SwEditShell::ApplyChangedSentence(const ::svx::SpellPortions& rNewPortions,
// restore cursor to the end of the sentence
// (will work also if the sentence length has changed,
// since cursors get updated automatically!)
- Pop( FALSE );
+ Pop( sal_False );
// collapse cursor to the end of the modified sentence
*pCrsr->Start() = *pCrsr->End();
@@ -1457,7 +1466,7 @@ void SwEditShell::ApplyChangedSentence(const ::svx::SpellPortions& rNewPortions,
// set continuation position for spell/grammar checking to the end of this sentence
pSpellIter->SetCurr( new SwPosition( *pCrsr->Start() ) );
- pDoc->EndUndo( UNDO_OVERWRITE, NULL );
+ pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_OVERWRITE, NULL );
EndAction();
}
}
@@ -1476,7 +1485,7 @@ SpellContentPositions lcl_CollectDeletedRedlines(SwEditShell* pSh)
const SwPosition* pStartPos = pCrsr->Start();
const SwTxtNode* pTxtNode = pCrsr->GetNode()->GetTxtNode();
- USHORT nAct = pDoc->GetRedlinePos( *pTxtNode, USHRT_MAX );
+ sal_uInt16 nAct = pDoc->GetRedlinePos( *pTxtNode, USHRT_MAX );
const xub_StrLen nStartIndex = pStartPos->nContent.GetIndex();
for ( ; nAct < pDoc->GetRedlineTbl().Count(); nAct++ )
{
@@ -1618,7 +1627,7 @@ bool SwSpellIter::SpellSentence(::svx::SpellPortions& rPortions, bool bIsGrammar
//the cursor has to be collapsed on the left to go to the start of the sentence - if sentence ends inside of the error
pCrsr->DeleteMark();
pCrsr->SetMark();
- BOOL bStartSent = 0 != pMySh->GoStartSentence();
+ sal_Bool bStartSent = 0 != pMySh->GoStartSentence();
SpellContentPositions aDeletedRedlines = lcl_CollectDeletedRedlines(pMySh);
if(bStartSent)
{
@@ -1757,8 +1766,8 @@ void SwSpellIter::ToSentenceStart()
-----------------------------------------------------------------------*/
LanguageType lcl_GetLanguage(SwEditShell& rSh)
{
- USHORT nScriptType = rSh.GetScriptType();
- USHORT nLangWhichId = RES_CHRATR_LANGUAGE;
+ sal_uInt16 nScriptType = rSh.GetScriptType();
+ sal_uInt16 nLangWhichId = RES_CHRATR_LANGUAGE;
switch(nScriptType)
{
@@ -1875,9 +1884,9 @@ void SwSpellIter::AddPortion(uno::Reference< XSpellAlternatives > xAlt,
{
const SwTxtAttr* pTxtAttr = pTxtNode->GetTxtAttrForCharAt(
pCrsr->GetMark()->nContent.GetIndex() );
- const USHORT nWhich = pTxtAttr
+ const sal_uInt16 nWhich = pTxtAttr
? pTxtAttr->Which()
- : static_cast<USHORT>(RES_TXTATR_END);
+ : static_cast<sal_uInt16>(RES_TXTATR_END);
switch (nWhich)
{
case RES_TXTATR_FIELD:
diff --git a/sw/source/core/edit/ednumber.cxx b/sw/source/core/edit/ednumber.cxx
index ea1088f36f69..d740090d4694 100644
--- a/sw/source/core/edit/ednumber.cxx
+++ b/sw/source/core/edit/ednumber.cxx
@@ -33,6 +33,7 @@
#include <editsh.hxx>
#include <edimp.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <ndtxt.hxx>
#include <paratr.hxx>
#include <swundo.hxx>
@@ -56,7 +57,7 @@ void SwPamRanges::Insert( const SwNodeIndex& rIdx1, const SwNodeIndex& rIdx2 )
if( aRg.nEnd < aRg.nStart )
{ aRg.nStart = aRg.nEnd; aRg.nEnd = rIdx1.GetIndex(); }
- USHORT nPos = 0;
+ sal_uInt16 nPos = 0;
const SwPamRange* pTmp;
if( Count() && Seek_Entry( aRg, &nPos )) // suche Insert Position
{
@@ -70,9 +71,9 @@ void SwPamRanges::Insert( const SwNodeIndex& rIdx1, const SwNodeIndex& rIdx2 )
return; // ende, weil schon alle zusammengefasst waren
}
- BOOL bEnde;
+ sal_Bool bEnde;
do {
- bEnde = TRUE;
+ bEnde = sal_True;
// mit dem Vorgaenger zusammenfassen ??
if( nPos > 0 )
@@ -81,7 +82,7 @@ void SwPamRanges::Insert( const SwNodeIndex& rIdx1, const SwNodeIndex& rIdx2 )
|| pTmp->nEnd+1 == aRg.nStart )
{
aRg.nStart = pTmp->nStart;
- bEnde = FALSE;
+ bEnde = sal_False;
Remove( --nPos, 1 ); // zusammenfassen
}
// SSelection im Bereich ??
@@ -95,7 +96,7 @@ void SwPamRanges::Insert( const SwNodeIndex& rIdx1, const SwNodeIndex& rIdx2 )
pTmp->nStart == aRg.nEnd+1 )
{
aRg.nEnd = pTmp->nEnd;
- bEnde = FALSE;
+ bEnde = sal_False;
Remove( nPos, 1 ); // zusammenfassen
}
@@ -110,7 +111,7 @@ void SwPamRanges::Insert( const SwNodeIndex& rIdx1, const SwNodeIndex& rIdx2 )
-SwPaM& SwPamRanges::SetPam( USHORT nArrPos, SwPaM& rPam )
+SwPaM& SwPamRanges::SetPam( sal_uInt16 nArrPos, SwPaM& rPam )
{
ASSERT_ID( nArrPos < Count(), ERR_VAR_IDX );
const SwPamRange& rTmp = *(GetData() + nArrPos );
@@ -145,20 +146,20 @@ const SwNumRule* SwEditShell::GetOutlineNumRule() const
// Absaetze ohne Numerierung, aber mit Einzuegen
-BOOL SwEditShell::NoNum()
+sal_Bool SwEditShell::NoNum()
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
StartAllAction();
SwPaM* pCrsr = GetCrsr();
if( pCrsr->GetNext() != pCrsr ) // Mehrfachselektion ?
{
- GetDoc()->StartUndo( UNDO_START, NULL );
+ GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
SwPamRanges aRangeArr( *pCrsr );
SwPaM aPam( *pCrsr->GetPoint() );
- for( USHORT n = 0; n < aRangeArr.Count(); ++n )
+ for( sal_uInt16 n = 0; n < aRangeArr.Count(); ++n )
bRet = bRet && GetDoc()->NoNum( aRangeArr.SetPam( n, aPam ));
- GetDoc()->EndUndo( UNDO_END, NULL );
+ GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
}
else
bRet = GetDoc()->NoNum( *pCrsr );
@@ -169,9 +170,9 @@ BOOL SwEditShell::NoNum()
// Loeschen, Splitten der Aufzaehlungsliste
// -> #i29560#
-BOOL SwEditShell::HasNumber() const
+sal_Bool SwEditShell::HasNumber() const
{
- BOOL bResult = FALSE;
+ sal_Bool bResult = sal_False;
const SwTxtNode * pTxtNd =
GetCrsr()->GetPoint()->nNode.GetNode().GetTxtNode();
@@ -186,7 +187,7 @@ BOOL SwEditShell::HasNumber() const
pTxtNd->GetNumRule() == GetDoc()->GetOutlineNumRule() &&
!pTxtNd->IsCountedInList() )
{
- bResult = FALSE;
+ bResult = sal_False;
}
// <--
}
@@ -194,9 +195,9 @@ BOOL SwEditShell::HasNumber() const
return bResult;
}
-BOOL SwEditShell::HasBullet() const
+sal_Bool SwEditShell::HasBullet() const
{
- BOOL bResult = FALSE;
+ sal_Bool bResult = sal_False;
const SwTxtNode * pTxtNd =
GetCrsr()->GetPoint()->nNode.GetNode().GetTxtNode();
@@ -217,14 +218,14 @@ void SwEditShell::DelNumRules()
SwPaM* pCrsr = GetCrsr();
if( pCrsr->GetNext() != pCrsr ) // Mehrfachselektion ?
{
- GetDoc()->StartUndo( UNDO_START, NULL );
+ GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
SwPamRanges aRangeArr( *pCrsr );
SwPaM aPam( *pCrsr->GetPoint() );
- for( USHORT n = 0; n < aRangeArr.Count(); ++n )
+ for( sal_uInt16 n = 0; n < aRangeArr.Count(); ++n )
{
GetDoc()->DelNumRules( aRangeArr.SetPam( n, aPam ) );
}
- GetDoc()->EndUndo( UNDO_END, NULL );
+ GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
}
else
GetDoc()->DelNumRules( *pCrsr );
@@ -235,7 +236,7 @@ void SwEditShell::DelNumRules()
// --> OD 2005-10-24 #126346# - cursor can not be anymore in
// front of a label, because numbering/bullet is deleted.
- SetInFrontOfLabel( FALSE );
+ SetInFrontOfLabel( sal_False );
// <--
GetDoc()->SetModified();
@@ -245,22 +246,22 @@ void SwEditShell::DelNumRules()
// Hoch-/Runterstufen
-BOOL SwEditShell::NumUpDown( BOOL bDown )
+sal_Bool SwEditShell::NumUpDown( sal_Bool bDown )
{
StartAllAction();
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
SwPaM* pCrsr = GetCrsr();
if( pCrsr->GetNext() == pCrsr ) // keine Mehrfachselektion ?
bRet = GetDoc()->NumUpDown( *pCrsr, bDown );
else
{
- GetDoc()->StartUndo( UNDO_START, NULL );
+ GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
SwPamRanges aRangeArr( *pCrsr );
SwPaM aPam( *pCrsr->GetPoint() );
- for( USHORT n = 0; n < aRangeArr.Count(); ++n )
+ for( sal_uInt16 n = 0; n < aRangeArr.Count(); ++n )
bRet = bRet && GetDoc()->NumUpDown( aRangeArr.SetPam( n, aPam ), bDown );
- GetDoc()->EndUndo( UNDO_END, NULL );
+ GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
}
GetDoc()->SetModified();
@@ -275,9 +276,9 @@ BOOL SwEditShell::NumUpDown( BOOL bDown )
return bRet;
}
// -> #i23726#
-BOOL SwEditShell::IsFirstOfNumRule() const
+sal_Bool SwEditShell::IsFirstOfNumRule() const
{
- BOOL bResult = FALSE;
+ sal_Bool bResult = sal_False;
SwPaM * pCrsr = GetCrsr();
if (pCrsr->GetNext() == pCrsr)
@@ -288,9 +289,9 @@ BOOL SwEditShell::IsFirstOfNumRule() const
return bResult;
}
-BOOL SwEditShell::IsFirstOfNumRule(const SwPaM & rPaM) const
+sal_Bool SwEditShell::IsFirstOfNumRule(const SwPaM & rPaM) const
{
- BOOL bResult = FALSE;
+ sal_Bool bResult = sal_False;
SwPosition aPos(*rPaM.GetPoint());
bResult = GetDoc()->IsFirstOfNumRule(aPos);
@@ -346,7 +347,7 @@ void SwEditShell::SetIndent(short nIndent, const SwPosition & rPos)
// nLevel = nReferenceLevel;
SwNumRule aRule(*pCurNumRule);
-// aRule.ChangeIndent(nIndent, nLevel, nReferenceLevel, FALSE);
+// aRule.ChangeIndent(nIndent, nLevel, nReferenceLevel, sal_False);
if ( IsFirstOfNumRule() )
{
aRule.SetIndentOfFirstListLevelAndChangeOthers( nIndent );
@@ -354,7 +355,7 @@ void SwEditShell::SetIndent(short nIndent, const SwPosition & rPos)
else if ( pTxtNode->GetActualListLevel() >= 0 )
{
aRule.SetIndent( nIndent,
- static_cast<USHORT>(pTxtNode->GetActualListLevel()) );
+ static_cast<sal_uInt16>(pTxtNode->GetActualListLevel()) );
}
// <--
@@ -370,7 +371,7 @@ void SwEditShell::SetIndent(short nIndent, const SwPosition & rPos)
}
// <- #i23725#
-BOOL SwEditShell::MoveParagraph( long nOffset )
+sal_Bool SwEditShell::MoveParagraph( long nOffset )
{
StartAllAction();
@@ -382,7 +383,7 @@ BOOL SwEditShell::MoveParagraph( long nOffset )
pCrsr->DeleteMark();
}
- BOOL bRet = GetDoc()->MoveParagraph( *pCrsr, nOffset );
+ sal_Bool bRet = GetDoc()->MoveParagraph( *pCrsr, nOffset );
GetDoc()->SetModified();
EndAllAction();
@@ -409,11 +410,11 @@ void SwEditShell::GetCurrentOutlineLevels( sal_uInt8& rUpper, sal_uInt8& rLower
aCrsr.SetMark();
if( pCrsr->HasMark() )
*aCrsr.GetPoint() = *pCrsr->End();
- GetDoc()->GotoNextNum( *aCrsr.GetPoint(), FALSE,
+ GetDoc()->GotoNextNum( *aCrsr.GetPoint(), sal_False,
&rUpper, &rLower );
}
-BOOL SwEditShell::MoveNumParas( BOOL bUpperLower, BOOL bUpperLeft )
+sal_Bool SwEditShell::MoveNumParas( sal_Bool bUpperLower, sal_Bool bUpperLeft )
{
StartAllAction();
@@ -425,9 +426,9 @@ BOOL SwEditShell::MoveNumParas( BOOL bUpperLower, BOOL bUpperLeft )
if( pCrsr->HasMark() )
*aCrsr.GetPoint() = *pCrsr->End();
- BOOL bRet = FALSE;
- BYTE nUpperLevel, nLowerLevel;
- if( GetDoc()->GotoNextNum( *aCrsr.GetPoint(), FALSE,
+ sal_Bool bRet = sal_False;
+ sal_uInt8 nUpperLevel, nLowerLevel;
+ if( GetDoc()->GotoNextNum( *aCrsr.GetPoint(), sal_False,
&nUpperLevel, &nLowerLevel ))
{
if( bUpperLower )
@@ -439,12 +440,12 @@ BOOL SwEditShell::MoveNumParas( BOOL bUpperLower, BOOL bUpperLeft )
if( bUpperLeft ) // verschiebe nach oben
{
SwPosition aPos( *aCrsr.GetMark() );
- if( GetDoc()->GotoPrevNum( aPos, FALSE ) )
+ if( GetDoc()->GotoPrevNum( aPos, sal_False ) )
nOffset = aPos.nNode.GetIndex() -
aCrsr.GetMark()->nNode.GetIndex();
else
{
- ULONG nStt = aPos.nNode.GetIndex(), nIdx = nStt - 1;
+ sal_uLong nStt = aPos.nNode.GetIndex(), nIdx = nStt - 1;
while( nIdx && (
( pNd = GetDoc()->GetNodes()[ nIdx ])->IsSectionNode() ||
( pNd->IsEndNode() && pNd->StartOfSectionNode()->IsSectionNode())))
@@ -455,11 +456,11 @@ BOOL SwEditShell::MoveNumParas( BOOL bUpperLower, BOOL bUpperLeft )
}
else // verschiebe nach unten
{
- const SwNumRule* pOrig = aCrsr.GetNode(FALSE)->GetTxtNode()->GetNumRule();
+ const SwNumRule* pOrig = aCrsr.GetNode(sal_False)->GetTxtNode()->GetNumRule();
if( aCrsr.GetNode()->IsTxtNode() &&
pOrig == aCrsr.GetNode()->GetTxtNode()->GetNumRule() )
{
- ULONG nStt = aCrsr.GetPoint()->nNode.GetIndex(), nIdx = nStt+1;
+ sal_uLong nStt = aCrsr.GetPoint()->nNode.GetIndex(), nIdx = nStt+1;
while (nIdx < GetDoc()->GetNodes().Count()-1)
{
@@ -507,23 +508,23 @@ BOOL SwEditShell::MoveNumParas( BOOL bUpperLower, BOOL bUpperLeft )
return bRet;
}
-BOOL SwEditShell::OutlineUpDown( short nOffset )
+sal_Bool SwEditShell::OutlineUpDown( short nOffset )
{
StartAllAction();
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
SwPaM* pCrsr = GetCrsr();
if( pCrsr->GetNext() == pCrsr ) // keine Mehrfachselektion ?
bRet = GetDoc()->OutlineUpDown( *pCrsr, nOffset );
else
{
- GetDoc()->StartUndo( UNDO_START, NULL );
+ GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
SwPamRanges aRangeArr( *pCrsr );
SwPaM aPam( *pCrsr->GetPoint() );
- for( USHORT n = 0; n < aRangeArr.Count(); ++n )
+ for( sal_uInt16 n = 0; n < aRangeArr.Count(); ++n )
bRet = bRet && GetDoc()->OutlineUpDown(
aRangeArr.SetPam( n, aPam ), nOffset );
- GetDoc()->EndUndo( UNDO_END, NULL );
+ GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
}
GetDoc()->SetModified();
EndAllAction();
@@ -531,25 +532,25 @@ BOOL SwEditShell::OutlineUpDown( short nOffset )
}
-BOOL SwEditShell::MoveOutlinePara( short nOffset )
+sal_Bool SwEditShell::MoveOutlinePara( short nOffset )
{
StartAllAction();
- BOOL bRet = GetDoc()->MoveOutlinePara( *GetCrsr(), nOffset );
+ sal_Bool bRet = GetDoc()->MoveOutlinePara( *GetCrsr(), nOffset );
EndAllAction();
return bRet;
}
// Outlines and SubOutline are ReadOnly?
-BOOL SwEditShell::IsProtectedOutlinePara() const
+sal_Bool SwEditShell::IsProtectedOutlinePara() const
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
const SwNode& rNd = GetCrsr()->Start()->nNode.GetNode();
if( rNd.IsTxtNode() )
{
const SwOutlineNodes& rOutlNd = GetDoc()->GetNodes().GetOutLineNds();
SwNodePtr pNd = (SwNodePtr)&rNd;
- BOOL bFirst = TRUE;
- USHORT nPos;
+ sal_Bool bFirst = sal_True;
+ sal_uInt16 nPos;
int nLvl(0);
if( !rOutlNd.Seek_Entry( pNd, &nPos ) && nPos )
--nPos;
@@ -559,7 +560,7 @@ BOOL SwEditShell::IsProtectedOutlinePara() const
SwNodePtr pTmpNd = rOutlNd[ nPos ];
// --> OD 2008-04-02 #refactorlists#
-// BYTE nTmpLvl = GetRealLevel( pTmpNd->GetTxtNode()->
+// sal_uInt8 nTmpLvl = GetRealLevel( pTmpNd->GetTxtNode()->
// GetTxtColl()->GetOutlineLevel() );
// int nTmpLvl = pTmpNd->GetTxtNode()->GetOutlineLevel();//#outline level,zhaojianwei
int nTmpLvl = pTmpNd->GetTxtNode()->GetAttrOutlineLevel();
@@ -570,14 +571,14 @@ BOOL SwEditShell::IsProtectedOutlinePara() const
if( bFirst )
{
nLvl = nTmpLvl;
- bFirst = FALSE;
+ bFirst = sal_False;
}
else if( nLvl >= nTmpLvl )
break;
if( pTmpNd->IsProtect() )
{
- bRet = TRUE;
+ bRet = sal_True;
break;
}
}
@@ -598,7 +599,7 @@ BOOL SwEditShell::IsProtectedOutlinePara() const
* 2) outline must not be within table
* 3) if bCopy is set, outline must not be write protected
*/
-BOOL lcl_IsOutlineMoveAndCopyable( const SwDoc* pDoc, USHORT nIdx, bool bCopy )
+sal_Bool lcl_IsOutlineMoveAndCopyable( const SwDoc* pDoc, sal_uInt16 nIdx, bool bCopy )
{
const SwNodes& rNds = pDoc->GetNodes();
const SwNode* pNd = rNds.GetOutLineNds()[ nIdx ];
@@ -607,20 +608,20 @@ BOOL lcl_IsOutlineMoveAndCopyable( const SwDoc* pDoc, USHORT nIdx, bool bCopy )
( bCopy || !pNd->IsProtect() ); // 3) write
}
-BOOL SwEditShell::IsOutlineMovable( USHORT nIdx ) const
+sal_Bool SwEditShell::IsOutlineMovable( sal_uInt16 nIdx ) const
{
return lcl_IsOutlineMoveAndCopyable( GetDoc(), nIdx, false );
}
-BOOL SwEditShell::IsOutlineCopyable( USHORT nIdx ) const
+sal_Bool SwEditShell::IsOutlineCopyable( sal_uInt16 nIdx ) const
{
return lcl_IsOutlineMoveAndCopyable( GetDoc(), nIdx, true );
}
-BOOL SwEditShell::NumOrNoNum( BOOL bNumOn, BOOL bChkStart ) // #115901#
+sal_Bool SwEditShell::NumOrNoNum( sal_Bool bNumOn, sal_Bool bChkStart ) // #115901#
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
SwPaM* pCrsr = GetCrsr();
if( pCrsr->GetNext() == pCrsr && !pCrsr->HasMark() &&
( !bChkStart || !pCrsr->GetPoint()->nContent.GetIndex()) )
@@ -633,10 +634,10 @@ BOOL SwEditShell::NumOrNoNum( BOOL bNumOn, BOOL bChkStart ) // #115901#
return bRet;
}
-BOOL SwEditShell::IsNoNum( BOOL bChkStart ) const
+sal_Bool SwEditShell::IsNoNum( sal_Bool bChkStart ) const
{
// ein Backspace im Absatz ohne Nummer wird zum Delete
- BOOL bResult = FALSE;
+ sal_Bool bResult = sal_False;
SwPaM* pCrsr = GetCrsr();
if (pCrsr->GetNext() == pCrsr && !pCrsr->HasMark() &&
@@ -654,11 +655,11 @@ BOOL SwEditShell::IsNoNum( BOOL bChkStart ) const
}
// --> OD 2008-02-29 #refactorlists# - removed <pHasChilds>
-BYTE SwEditShell::GetNumLevel() const
+sal_uInt8 SwEditShell::GetNumLevel() const
{
// gebe die akt. Ebene zurueck, auf der sich der Point vom Cursor befindet
- //BYTE nLevel = NO_NUMBERING; //#outline level,zhaojianwei
- BYTE nLevel = MAXLEVEL; //end,zhaojianwei
+ //sal_uInt8 nLevel = NO_NUMBERING; //#outline level,zhaojianwei
+ sal_uInt8 nLevel = MAXLEVEL; //end,zhaojianwei
SwPaM* pCrsr = GetCrsr();
const SwTxtNode* pTxtNd = pCrsr->GetNode()->GetTxtNode();
@@ -676,7 +677,7 @@ BYTE SwEditShell::GetNumLevel() const
const int nListLevelOfTxtNode( pTxtNd->GetActualListLevel() );
if ( nListLevelOfTxtNode >= 0 )
{
- nLevel = static_cast<BYTE>( nListLevelOfTxtNode );
+ nLevel = static_cast<sal_uInt8>( nListLevelOfTxtNode );
}
// <--
}
@@ -698,13 +699,14 @@ void SwEditShell::SetCurNumRule( const SwNumRule& rRule,
{
StartAllAction();
+ GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
+
SwPaM* pCrsr = GetCrsr();
if( pCrsr->GetNext() != pCrsr ) // Mehrfachselektion ?
{
- GetDoc()->StartUndo( UNDO_START, NULL );
SwPamRanges aRangeArr( *pCrsr );
SwPaM aPam( *pCrsr->GetPoint() );
- for( USHORT n = 0; n < aRangeArr.Count(); ++n )
+ for( sal_uInt16 n = 0; n < aRangeArr.Count(); ++n )
{
aRangeArr.SetPam( n, aPam );
// --> OD 2008-02-08 #newlistlevelattrs#
@@ -715,26 +717,22 @@ void SwEditShell::SetCurNumRule( const SwNumRule& rRule,
// <--
GetDoc()->SetCounted( aPam, true );
}
- GetDoc()->EndUndo( UNDO_END, NULL );
}
else
{
- GetDoc()->StartUndo( UNDO_START, NULL );
-
// --> OD 2008-02-08 #newlistlevelattrs#
// --> OD 2008-03-17 #refactorlists#
GetDoc()->SetNumRule( *pCrsr, rRule,
bCreateNewList, sContinuedListId,
sal_True, bResetIndentAttrs );
GetDoc()->SetCounted( *pCrsr, true );
-
- GetDoc()->EndUndo( UNDO_END, NULL );
}
+ GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
EndAllAction();
}
-String SwEditShell::GetUniqueNumRuleName( const String* pChkStr, BOOL bAutoNum ) const
+String SwEditShell::GetUniqueNumRuleName( const String* pChkStr, sal_Bool bAutoNum ) const
{
return GetDoc()->GetUniqueNumRuleName( pChkStr, bAutoNum );
}
@@ -746,27 +744,27 @@ void SwEditShell::ChgNumRuleFmts( const SwNumRule& rRule )
EndAllAction();
}
-BOOL SwEditShell::ReplaceNumRule( const String& rOldRule, const String& rNewRule )
+sal_Bool SwEditShell::ReplaceNumRule( const String& rOldRule, const String& rNewRule )
{
StartAllAction();
- BOOL bRet = GetDoc()->ReplaceNumRule( *GetCrsr()->GetPoint(), rOldRule, rNewRule );
+ sal_Bool bRet = GetDoc()->ReplaceNumRule( *GetCrsr()->GetPoint(), rOldRule, rNewRule );
EndAllAction();
return bRet;
}
-void SwEditShell::SetNumRuleStart( BOOL bFlag )
+void SwEditShell::SetNumRuleStart( sal_Bool bFlag )
{
StartAllAction();
SwPaM* pCrsr = GetCrsr();
if( pCrsr->GetNext() != pCrsr ) // Mehrfachselektion ?
{
- GetDoc()->StartUndo( UNDO_START, NULL );
+ GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
SwPamRanges aRangeArr( *pCrsr );
SwPaM aPam( *pCrsr->GetPoint() );
- for( USHORT n = 0; n < aRangeArr.Count(); ++n )
+ for( sal_uInt16 n = 0; n < aRangeArr.Count(); ++n )
GetDoc()->SetNumRuleStart( *aRangeArr.SetPam( n, aPam ).GetPoint(), bFlag );
- GetDoc()->EndUndo( UNDO_END, NULL );
+ GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
}
else
GetDoc()->SetNumRuleStart( *pCrsr->GetPoint(), bFlag );
@@ -774,28 +772,28 @@ void SwEditShell::SetNumRuleStart( BOOL bFlag )
EndAllAction();
}
-BOOL SwEditShell::IsNumRuleStart() const
+sal_Bool SwEditShell::IsNumRuleStart() const
{
- BOOL bResult = FALSE;
+ sal_Bool bResult = sal_False;
const SwTxtNode* pTxtNd = GetCrsr()->GetNode()->GetTxtNode();
if( pTxtNd )
- bResult = pTxtNd->IsListRestart() ? TRUE : FALSE;
+ bResult = pTxtNd->IsListRestart() ? sal_True : sal_False;
return bResult;
}
-void SwEditShell::SetNodeNumStart( USHORT nStt )
+void SwEditShell::SetNodeNumStart( sal_uInt16 nStt )
{
StartAllAction();
SwPaM* pCrsr = GetCrsr();
if( pCrsr->GetNext() != pCrsr ) // Mehrfachselektion ?
{
- GetDoc()->StartUndo( UNDO_START, NULL );
+ GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
SwPamRanges aRangeArr( *pCrsr );
SwPaM aPam( *pCrsr->GetPoint() );
- for( USHORT n = 0; n < aRangeArr.Count(); ++n )
+ for( sal_uInt16 n = 0; n < aRangeArr.Count(); ++n )
GetDoc()->SetNodeNumStart( *aRangeArr.SetPam( n, aPam ).GetPoint(), nStt );
- GetDoc()->EndUndo( UNDO_END, NULL );
+ GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
}
else
GetDoc()->SetNodeNumStart( *pCrsr->GetPoint(), nStt );
@@ -803,7 +801,7 @@ void SwEditShell::SetNodeNumStart( USHORT nStt )
EndAllAction();
}
-USHORT SwEditShell::GetNodeNumStart() const
+sal_uInt16 SwEditShell::GetNodeNumStart() const
{
const SwTxtNode* pTxtNd = GetCrsr()->GetNode()->GetTxtNode();
// --> OD 2008-02-28 #refactorlists#
@@ -812,7 +810,7 @@ USHORT SwEditShell::GetNodeNumStart() const
// return USHRT_MAX, if no list restart value is found.
if ( pTxtNd && pTxtNd->HasAttrListRestartValue() )
{
- return static_cast<USHORT>(pTxtNd->GetAttrListRestartValue());
+ return static_cast<sal_uInt16>(pTxtNd->GetAttrListRestartValue());
}
return USHRT_MAX;
// <--
diff --git a/sw/source/core/edit/edredln.cxx b/sw/source/core/edit/edredln.cxx
index b78dfb761ebe..0dd6b9b3ec79 100644
--- a/sw/source/core/edit/edredln.cxx
+++ b/sw/source/core/edit/edredln.cxx
@@ -39,12 +39,12 @@
#include "frmtool.hxx"
-USHORT SwEditShell::GetRedlineMode() const
+sal_uInt16 SwEditShell::GetRedlineMode() const
{
return GetDoc()->GetRedlineMode();
}
-void SwEditShell::SetRedlineMode( USHORT eMode )
+void SwEditShell::SetRedlineMode( sal_uInt16 eMode )
{
if( eMode != GetDoc()->GetRedlineMode() )
{
@@ -55,17 +55,17 @@ void SwEditShell::SetRedlineMode( USHORT eMode )
}
}
-BOOL SwEditShell::IsRedlineOn() const
+sal_Bool SwEditShell::IsRedlineOn() const
{
return GetDoc()->IsRedlineOn();
}
-USHORT SwEditShell::GetRedlineCount() const
+sal_uInt16 SwEditShell::GetRedlineCount() const
{
return GetDoc()->GetRedlineTbl().Count();
}
-const SwRedline& SwEditShell::GetRedline( USHORT nPos ) const
+const SwRedline& SwEditShell::GetRedline( sal_uInt16 nPos ) const
{
return *GetDoc()->GetRedlineTbl()[ nPos ];
}
@@ -82,22 +82,22 @@ void lcl_InvalidateAll( ViewShell* pSh )
} while ( pSh != pStop );
}
-BOOL SwEditShell::AcceptRedline( USHORT nPos )
+sal_Bool SwEditShell::AcceptRedline( sal_uInt16 nPos )
{
SET_CURR_SHELL( this );
StartAllAction();
- BOOL bRet = GetDoc()->AcceptRedline( nPos, true );
+ sal_Bool bRet = GetDoc()->AcceptRedline( nPos, true );
if( !nPos && !::IsExtraData( GetDoc() ) )
lcl_InvalidateAll( this );
EndAllAction();
return bRet;
}
-BOOL SwEditShell::RejectRedline( USHORT nPos )
+sal_Bool SwEditShell::RejectRedline( sal_uInt16 nPos )
{
SET_CURR_SHELL( this );
StartAllAction();
- BOOL bRet = GetDoc()->RejectRedline( nPos, true );
+ sal_Bool bRet = GetDoc()->RejectRedline( nPos, true );
if( !nPos && !::IsExtraData( GetDoc() ) )
lcl_InvalidateAll( this );
EndAllAction();
@@ -105,9 +105,9 @@ BOOL SwEditShell::RejectRedline( USHORT nPos )
}
// Kommentar am Redline setzen
-BOOL SwEditShell::SetRedlineComment( const String& rS )
+sal_Bool SwEditShell::SetRedlineComment( const String& rS )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
FOREACHPAM_START(this)
bRet = bRet || GetDoc()->SetRedlineComment( *PCURCRSR, rS );
FOREACHPAM_END()
@@ -136,11 +136,11 @@ void SwEditShell::UpdateRedlineAttr()
// suche das Redline zu diesem Data und returne die Pos im Array
// USHRT_MAX wird returnt, falls nicht vorhanden
-USHORT SwEditShell::FindRedlineOfData( const SwRedlineData& rData ) const
+sal_uInt16 SwEditShell::FindRedlineOfData( const SwRedlineData& rData ) const
{
const SwRedlineTbl& rTbl = GetDoc()->GetRedlineTbl();
- for( USHORT i = 0, nCnt = rTbl.Count(); i < nCnt; ++i )
+ for( sal_uInt16 i = 0, nCnt = rTbl.Count(); i < nCnt; ++i )
if( &rTbl[ i ]->GetRedlineData() == &rData )
return i;
return USHRT_MAX;
diff --git a/sw/source/core/edit/edsect.cxx b/sw/source/core/edit/edsect.cxx
index f177101e9bfc..a31122b631f4 100644
--- a/sw/source/core/edit/edsect.cxx
+++ b/sw/source/core/edit/edsect.cxx
@@ -28,9 +28,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-#include <doc.hxx>
#include <editsh.hxx>
+#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <pam.hxx>
#include <docary.hxx>
#include <swundo.hxx> // fuer die UndoIds
@@ -50,7 +50,7 @@ SwEditShell::InsertSection(
if( !IsTableMode() )
{
StartAllAction();
- GetDoc()->StartUndo( UNDO_INSSECTION, NULL );
+ GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_INSSECTION, NULL );
FOREACHPAM_START(this)
SwSection const*const pNew =
@@ -59,25 +59,24 @@ SwEditShell::InsertSection(
pRet = pNew;
FOREACHPAM_END()
- // Undo-Klammerung hier beenden
- GetDoc()->EndUndo( UNDO_INSSECTION, NULL );
+ GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_INSSECTION, NULL );
EndAllAction();
}
return pRet;
}
-BOOL SwEditShell::IsInsRegionAvailable() const
+sal_Bool SwEditShell::IsInsRegionAvailable() const
{
if( IsTableMode() )
- return FALSE;
+ return sal_False;
SwPaM* pCrsr = GetCrsr();
if( pCrsr->GetNext() != pCrsr )
- return FALSE;
+ return sal_False;
if( pCrsr->HasMark() )
return 0 != GetDoc()->IsInsRegionAvailable( *pCrsr );
- return TRUE;
+ return sal_True;
}
@@ -95,7 +94,7 @@ const SwSection* SwEditShell::GetCurrSection() const
* Bereich innerhalb der Fussnote sein.
* --------------------------------------------------*/
-const SwSection* SwEditShell::GetAnySection( BOOL bOutOfTab, const Point* pPt ) const
+const SwSection* SwEditShell::GetAnySection( sal_Bool bOutOfTab, const Point* pPt ) const
{
SwFrm *pFrm;
if ( pPt )
@@ -107,7 +106,7 @@ const SwSection* SwEditShell::GetAnySection( BOOL bOutOfTab, const Point* pPt )
pFrm = pNd->getLayoutFrm( GetLayout(), pPt );
}
else
- pFrm = GetCurrFrm( FALSE );
+ pFrm = GetCurrFrm( sal_False );
if( bOutOfTab && pFrm )
pFrm = pFrm->FindTabFrm();
@@ -125,17 +124,17 @@ const SwSection* SwEditShell::GetAnySection( BOOL bOutOfTab, const Point* pPt )
return NULL;
}
-USHORT SwEditShell::GetSectionFmtCount() const
+sal_uInt16 SwEditShell::GetSectionFmtCount() const
{
return GetDoc()->GetSections().Count();
}
-BOOL SwEditShell::IsAnySectionInDoc( BOOL bChkReadOnly, BOOL bChkHidden, BOOL bChkTOX ) const
+sal_Bool SwEditShell::IsAnySectionInDoc( sal_Bool bChkReadOnly, sal_Bool bChkHidden, sal_Bool bChkTOX ) const
{
const SwSectionFmts& rFmts = GetDoc()->GetSections();
- USHORT nCnt = rFmts.Count();
- USHORT n;
+ sal_uInt16 nCnt = rFmts.Count();
+ sal_uInt16 n;
for( n = 0; n < nCnt; ++n )
{
@@ -156,19 +155,19 @@ BOOL SwEditShell::IsAnySectionInDoc( BOOL bChkReadOnly, BOOL bChkHidden, BOOL bC
return n != nCnt;
}
-USHORT SwEditShell::GetSectionFmtPos( const SwSectionFmt& rFmt ) const
+sal_uInt16 SwEditShell::GetSectionFmtPos( const SwSectionFmt& rFmt ) const
{
SwSectionFmt* pFmt = (SwSectionFmt*)&rFmt;
return GetDoc()->GetSections().GetPos( pFmt );
}
-const SwSectionFmt& SwEditShell::GetSectionFmt( USHORT nFmt ) const
+const SwSectionFmt& SwEditShell::GetSectionFmt( sal_uInt16 nFmt ) const
{
return *GetDoc()->GetSections()[ nFmt ];
}
-void SwEditShell::DelSectionFmt( USHORT nFmt )
+void SwEditShell::DelSectionFmt( sal_uInt16 nFmt )
{
StartAllAction();
GetDoc()->DelSectionFmt( GetDoc()->GetSections()[ nFmt ] );
@@ -251,7 +250,7 @@ void SwEditShell::_SetSectionAttr( SwSectionFmt& rSectFmt,
const SfxItemSet& rSet )
{
StartAllAction();
- if(SFX_ITEM_SET == rSet.GetItemState(RES_CNTNT, FALSE))
+ if(SFX_ITEM_SET == rSet.GetItemState(RES_CNTNT, sal_False))
{
SfxItemSet aSet(rSet);
aSet.ClearItem(RES_CNTNT);
@@ -268,9 +267,9 @@ void SwEditShell::_SetSectionAttr( SwSectionFmt& rSectFmt,
// search inside the cursor selection for full selected sections.
// if any part of section in the selection return 0.
// if more than one in the selection return the count
-USHORT SwEditShell::GetFullSelectedSectionCount() const
+sal_uInt16 SwEditShell::GetFullSelectedSectionCount() const
{
- USHORT nRet = 0;
+ sal_uInt16 nRet = 0;
FOREACHPAM_START(this)
const SwPosition* pStt = PCURCRSR->Start(),
diff --git a/sw/source/core/edit/edtab.cxx b/sw/source/core/edit/edtab.cxx
index 76a37e4e8627..f67442d1be4b 100644
--- a/sw/source/core/edit/edtab.cxx
+++ b/sw/source/core/edit/edtab.cxx
@@ -35,9 +35,7 @@
#define _SVSTDARR_ULONGS
#include <svl/svstdarr.hxx>
-#ifndef _APP_HXX //autogen
#include <vcl/svapp.hxx>
-#endif
#include <vcl/window.hxx>
#include <editeng/boxitem.hxx>
#include <swwait.hxx>
@@ -45,6 +43,7 @@
#include <frmatr.hxx>
#include <editsh.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <cntfrm.hxx>
#include <pam.hxx>
#include <ndtxt.hxx>
@@ -67,14 +66,14 @@ using namespace ::com::sun::star::uno;
extern void ClearFEShellTabCols();
const SwTable& SwEditShell::InsertTable( const SwInsertTableOptions& rInsTblOpts,
- USHORT nRows, USHORT nCols,
+ sal_uInt16 nRows, sal_uInt16 nCols,
sal_Int16 eAdj,
const SwTableAutoFmt* pTAFmt )
{
StartAllAction();
SwPosition* pPos = GetCrsr()->GetPoint();
- BOOL bEndUndo = 0 != pPos->nContent.GetIndex();
+ sal_Bool bEndUndo = 0 != pPos->nContent.GetIndex();
if( bEndUndo )
{
StartUndo( UNDO_START );
@@ -87,7 +86,7 @@ const SwTable& SwEditShell::InsertTable( const SwInsertTableOptions& rInsTblOpts
const SwTable *pTable = GetDoc()->InsertTable( rInsTblOpts, *pPos,
nRows, nCols,
eAdj, pTAFmt,
- 0, TRUE );
+ 0, sal_True );
if( bEndUndo )
EndUndo( UNDO_END );
@@ -95,13 +94,13 @@ const SwTable& SwEditShell::InsertTable( const SwInsertTableOptions& rInsTblOpts
return *pTable;
}
-BOOL SwEditShell::TextToTable( const SwInsertTableOptions& rInsTblOpts,
+sal_Bool SwEditShell::TextToTable( const SwInsertTableOptions& rInsTblOpts,
sal_Unicode cCh,
sal_Int16 eAdj,
const SwTableAutoFmt* pTAFmt )
{
- SwWait aWait( *GetDoc()->GetDocShell(), TRUE );
- BOOL bRet = FALSE;
+ SwWait aWait( *GetDoc()->GetDocShell(), sal_True );
+ sal_Bool bRet = sal_False;
StartAllAction();
FOREACHPAM_START(this)
if( PCURCRSR->HasMark() )
@@ -112,10 +111,10 @@ BOOL SwEditShell::TextToTable( const SwInsertTableOptions& rInsTblOpts,
return bRet;
}
-BOOL SwEditShell::TableToText( sal_Unicode cCh )
+sal_Bool SwEditShell::TableToText( sal_Unicode cCh )
{
- SwWait aWait( *GetDoc()->GetDocShell(), TRUE );
- BOOL bRet = FALSE;
+ SwWait aWait( *GetDoc()->GetDocShell(), sal_True );
+ sal_Bool bRet = sal_False;
SwPaM* pCrsr = GetCrsr();
const SwTableNode* pTblNd =
GetDoc()->IsIdxInTbl( pCrsr->GetPoint()->nNode );
@@ -156,23 +155,23 @@ BOOL SwEditShell::TableToText( sal_Unicode cCh )
return bRet;
}
-BOOL SwEditShell::IsTextToTableAvailable() const
+sal_Bool SwEditShell::IsTextToTableAvailable() const
{
- BOOL bOnlyText = FALSE;
+ sal_Bool bOnlyText = sal_False;
FOREACHPAM_START(this)
if( PCURCRSR->HasMark() && *PCURCRSR->GetPoint() != *PCURCRSR->GetMark() )
{
- bOnlyText = TRUE;
+ bOnlyText = sal_True;
// pruefe ob in der Selection eine Tabelle liegt
- ULONG nStt = PCURCRSR->GetMark()->nNode.GetIndex(),
+ sal_uLong nStt = PCURCRSR->GetMark()->nNode.GetIndex(),
nEnd = PCURCRSR->GetPoint()->nNode.GetIndex();
- if( nStt > nEnd ) { ULONG n = nStt; nStt = nEnd; nEnd = n; }
+ if( nStt > nEnd ) { sal_uLong n = nStt; nStt = nEnd; nEnd = n; }
for( ; nStt <= nEnd; ++nStt )
if( !GetDoc()->GetNodes()[ nStt ]->IsTxtNode() )
{
- bOnlyText = FALSE;
+ bOnlyText = sal_False;
break;
}
@@ -186,14 +185,14 @@ BOOL SwEditShell::IsTextToTableAvailable() const
void SwEditShell::InsertDDETable( const SwInsertTableOptions& rInsTblOpts,
SwDDEFieldType* pDDEType,
- USHORT nRows, USHORT nCols,
+ sal_uInt16 nRows, sal_uInt16 nCols,
sal_Int16 eAdj )
{
SwPosition* pPos = GetCrsr()->GetPoint();
StartAllAction();
- BOOL bEndUndo = 0 != pPos->nContent.GetIndex();
+ sal_Bool bEndUndo = 0 != pPos->nContent.GetIndex();
if( bEndUndo )
{
StartUndo( UNDO_START );
@@ -259,12 +258,14 @@ void SwEditShell::SetTblChgMode( TblChgMode eMode )
{
((SwTable&)pTblNd->GetTable()).SetTblChgMode( eMode );
if( !GetDoc()->IsModified() ) // Bug 57028
- GetDoc()->SetUndoNoResetModified();
+ {
+ GetDoc()->GetIDocumentUndoRedo().SetUndoNoResetModified();
+ }
GetDoc()->SetModified();
}
}
-BOOL SwEditShell::GetTblBoxFormulaAttrs( SfxItemSet& rSet ) const
+sal_Bool SwEditShell::GetTblBoxFormulaAttrs( SfxItemSet& rSet ) const
{
SwSelBoxes aBoxes;
if( IsTableMode() )
@@ -281,10 +282,10 @@ BOOL SwEditShell::GetTblBoxFormulaAttrs( SfxItemSet& rSet ) const
SwTableBox *pBox = (SwTableBox*)((SwCellFrm*)pFrm)->GetTabBox();
aBoxes.Insert( pBox );
}
- } while( FALSE );
+ } while( sal_False );
}
- for( USHORT n = 0; n < aBoxes.Count(); ++n )
+ for( sal_uInt16 n = 0; n < aBoxes.Count(); ++n )
{
const SwTableBox* pSelBox = aBoxes[ n ];
const SwTableBoxFmt* pTblFmt = (SwTableBoxFmt*)pSelBox->GetFrmFmt();
@@ -323,7 +324,7 @@ void SwEditShell::SetTblBoxFormulaAttrs( const SfxItemSet& rSet )
SwTableBox *pBox = (SwTableBox*)((SwCellFrm*)pFrm)->GetTabBox();
aBoxes.Insert( pBox );
}
- } while( FALSE );
+ } while( sal_False );
}
// beim setzen einer Formel keine Ueberpruefung mehr vornehmen!
@@ -331,17 +332,17 @@ void SwEditShell::SetTblBoxFormulaAttrs( const SfxItemSet& rSet )
ClearTblBoxCntnt();
StartAllAction();
- GetDoc()->StartUndo( UNDO_START, NULL );
- for( USHORT n = 0; n < aBoxes.Count(); ++n )
+ GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
+ for( sal_uInt16 n = 0; n < aBoxes.Count(); ++n )
GetDoc()->SetTblBoxFormulaAttrs( *aBoxes[ n ], rSet );
- GetDoc()->EndUndo( UNDO_END, NULL );
+ GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
EndAllAction();
}
-BOOL SwEditShell::IsTableBoxTextFormat() const
+sal_Bool SwEditShell::IsTableBoxTextFormat() const
{
if( IsTableMode() )
- return FALSE;
+ return sal_False;
SwTableBox *pBox = 0;
{
@@ -354,25 +355,25 @@ BOOL SwEditShell::IsTableBoxTextFormat() const
}
if( !pBox )
- return FALSE;
+ return sal_False;
sal_uInt32 nFmt;
const SfxPoolItem* pItem;
if( SFX_ITEM_SET == pBox->GetFrmFmt()->GetAttrSet().GetItemState(
- RES_BOXATR_FORMAT, TRUE, &pItem ))
+ RES_BOXATR_FORMAT, sal_True, &pItem ))
{
nFmt = ((SwTblBoxNumFormat*)pItem)->GetValue();
return GetDoc()->GetNumberFormatter()->IsTextFormat( nFmt ) ||
NUMBERFORMAT_TEXT == nFmt;
}
- ULONG nNd = pBox->IsValidNumTxtNd();
+ sal_uLong nNd = pBox->IsValidNumTxtNd();
if( ULONG_MAX == nNd )
- return TRUE;
+ return sal_True;
const String& rTxt = GetDoc()->GetNodes()[ nNd ]->GetTxtNode()->GetTxt();
if( !rTxt.Len() )
- return FALSE;
+ return sal_False;
double fVal;
return !GetDoc()->GetNumberFormatter()->IsNumberFormat( rTxt, nFmt, fVal );
@@ -393,57 +394,57 @@ String SwEditShell::GetTableBoxText() const
pBox = (SwTableBox*)((SwCellFrm*)pFrm)->GetTabBox();
}
- ULONG nNd;
+ sal_uLong nNd;
if( pBox && ULONG_MAX != ( nNd = pBox->IsValidNumTxtNd() ) )
sRet = GetDoc()->GetNodes()[ nNd ]->GetTxtNode()->GetTxt();
}
return sRet;
}
-BOOL SwEditShell::SplitTable( USHORT eMode )
+sal_Bool SwEditShell::SplitTable( sal_uInt16 eMode )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
SwPaM *pCrsr = GetCrsr();
if( pCrsr->GetNode()->FindTableNode() )
{
StartAllAction();
- GetDoc()->StartUndo(UNDO_EMPTY, NULL);
+ GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL);
- bRet = GetDoc()->SplitTable( *pCrsr->GetPoint(), eMode, TRUE );
+ bRet = GetDoc()->SplitTable( *pCrsr->GetPoint(), eMode, sal_True );
- GetDoc()->EndUndo(UNDO_EMPTY, NULL);
+ GetDoc()->GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, NULL);
ClearFEShellTabCols();
EndAllAction();
}
return bRet;
}
-BOOL SwEditShell::MergeTable( BOOL bWithPrev, USHORT nMode )
+sal_Bool SwEditShell::MergeTable( sal_Bool bWithPrev, sal_uInt16 nMode )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
SwPaM *pCrsr = GetCrsr();
if( pCrsr->GetNode()->FindTableNode() )
{
StartAllAction();
- GetDoc()->StartUndo(UNDO_EMPTY, NULL);
+ GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL);
bRet = GetDoc()->MergeTable( *pCrsr->GetPoint(), bWithPrev, nMode );
- GetDoc()->EndUndo(UNDO_EMPTY, NULL);
+ GetDoc()->GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, NULL);
ClearFEShellTabCols();
EndAllAction();
}
return bRet;
}
-BOOL SwEditShell::CanMergeTable( BOOL bWithPrev, BOOL* pChkNxtPrv ) const
+sal_Bool SwEditShell::CanMergeTable( sal_Bool bWithPrev, sal_Bool* pChkNxtPrv ) const
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
const SwPaM *pCrsr = GetCrsr();
const SwTableNode* pTblNd = pCrsr->GetNode()->FindTableNode();
if( pTblNd && !pTblNd->GetTable().ISA( SwDDETable ))
{
- BOOL bNew = pTblNd->GetTable().IsNewModel();
+ sal_Bool bNew = pTblNd->GetTable().IsNewModel();
const SwNodes& rNds = GetDoc()->GetNodes();
if( pChkNxtPrv )
{
@@ -453,13 +454,13 @@ BOOL SwEditShell::CanMergeTable( BOOL bWithPrev, BOOL* pChkNxtPrv ) const
// --> FME 2004-09-17 #117418# Consider table in table case
pChkNd->EndOfSectionIndex() == pTblNd->GetIndex() - 1 )
// <--
- *pChkNxtPrv = TRUE, bRet = TRUE; // mit Prev ist moeglich
+ *pChkNxtPrv = sal_True, bRet = sal_True; // mit Prev ist moeglich
else
{
pChkNd = rNds[ pTblNd->EndOfSectionIndex() + 1 ]->GetTableNode();
if( pChkNd && !pChkNd->GetTable().ISA( SwDDETable ) &&
bNew == pChkNd->GetTable().IsNewModel() )
- *pChkNxtPrv = FALSE, bRet = TRUE; // mit Next ist moeglich
+ *pChkNxtPrv = sal_False, bRet = sal_True; // mit Next ist moeglich
}
}
else
@@ -485,7 +486,7 @@ BOOL SwEditShell::CanMergeTable( BOOL bWithPrev, BOOL* pChkNxtPrv ) const
}
// setze das InsertDB als Tabelle Undo auf:
-void SwEditShell::AppendUndoForInsertFromDB( BOOL bIsTable )
+void SwEditShell::AppendUndoForInsertFromDB( sal_Bool bIsTable )
{
GetDoc()->AppendUndoForInsertFromDB( *GetCrsr(), bIsTable );
}
diff --git a/sw/source/core/edit/edtox.cxx b/sw/source/core/edit/edtox.cxx
index 90fb4ad5cc81..b09b57d50b9a 100644
--- a/sw/source/core/edit/edtox.cxx
+++ b/sw/source/core/edit/edtox.cxx
@@ -27,38 +27,40 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
#include <com/sun/star/util/SearchOptions.hpp>
#include <com/sun/star/util/SearchFlags.hpp>
#include <com/sun/star/i18n/TransliterationModules.hpp>
-
#include <tools/urlobj.hxx>
-#include <svtools/txtcmp.hxx>
-#ifndef SVTOOLS_FSTATHELPER_HXX
+
#include <svl/fstathelper.hxx>
-#endif
+
+#include <svtools/txtcmp.hxx>
+
#include <sfx2/docfile.hxx>
-#include "editeng/unolingu.hxx"
+
+#include <xmloff/odffields.hxx>
+
+#include <editeng/unolingu.hxx>
+
#include <swtypes.hxx>
#include <editsh.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <pam.hxx>
#include <viewopt.hxx>
#include <ndtxt.hxx>
#include <errhdl.hxx>
#include <swundo.hxx>
-#include <undobj.hxx>
#include <txttxmrk.hxx>
#include <edimp.hxx>
#include <tox.hxx>
#include <doctxm.hxx>
#include <docary.hxx>
#include <mdiexp.hxx>
-#ifndef _STATSTR_HRC
#include <statstr.hrc>
-#endif
#include <bookmrk.hxx>
-#include <xmloff/odffields.hxx>
using namespace ::com::sun::star;
@@ -73,7 +75,7 @@ using namespace ::com::sun::star::util;
void SwEditShell::Insert(const SwTOXMark& rMark)
{
- BOOL bInsAtPos = rMark.IsAlternativeText();
+ sal_Bool bInsAtPos = rMark.IsAlternativeText();
StartAllAction();
FOREACHPAM_START(this)
@@ -111,7 +113,7 @@ void SwEditShell::DeleteTOXMark( SwTOXMark* pMark )
Beschreibung: Alle Verzeichnismarkierungen am SPoint zusammensuchen
--------------------------------------------------------------------*/
-USHORT SwEditShell::GetCurTOXMarks(SwTOXMarks& rMarks) const
+sal_uInt16 SwEditShell::GetCurTOXMarks(SwTOXMarks& rMarks) const
{
return GetDoc()->GetCurTOXMark( *GetCrsr()->Start(), rMarks );
}
@@ -119,7 +121,7 @@ USHORT SwEditShell::GetCurTOXMarks(SwTOXMarks& rMarks) const
/* -----------------01.09.99 16:05-------------------
--------------------------------------------------*/
-BOOL SwEditShell::IsTOXBaseReadonly(const SwTOXBase& rTOXBase) const
+sal_Bool SwEditShell::IsTOXBaseReadonly(const SwTOXBase& rTOXBase) const
{
ASSERT( rTOXBase.ISA( SwTOXBaseSection ), "no TOXBaseSection!" );
const SwTOXBaseSection& rTOXSect = (const SwTOXBaseSection&)rTOXBase;
@@ -128,7 +130,7 @@ BOOL SwEditShell::IsTOXBaseReadonly(const SwTOXBase& rTOXBase) const
/* -----------------18.10.99 15:53-------------------
--------------------------------------------------*/
-void SwEditShell::SetTOXBaseReadonly(const SwTOXBase& rTOXBase, BOOL bReadonly)
+void SwEditShell::SetTOXBaseReadonly(const SwTOXBase& rTOXBase, sal_Bool bReadonly)
{
ASSERT( rTOXBase.ISA( SwTOXBaseSection ), "no TOXBaseSection!" );
const SwTOXBaseSection& rTOXSect = (const SwTOXBaseSection&)rTOXBase;
@@ -143,7 +145,7 @@ void SwEditShell::SetTOXBaseReadonly(const SwTOXBase& rTOXBase, BOOL bReadonly)
/* -----------------02.09.99 07:47-------------------
--------------------------------------------------*/
-const SwTOXBase* SwEditShell::GetDefaultTOXBase( TOXTypes eTyp, BOOL bCreate )
+const SwTOXBase* SwEditShell::GetDefaultTOXBase( TOXTypes eTyp, sal_Bool bCreate )
{
return GetDoc()->GetDefaultTOXBase( eTyp, bCreate );
}
@@ -170,7 +172,7 @@ void SwEditShell::InsertTableOf( const SwTOXBase& rTOX, const SfxItemSet* pSet )
// Einfuegen des Verzeichnisses
const SwTOXBaseSection* pTOX = pDoc->InsertTableOf(
- *GetCrsr()->GetPoint(), rTOX, pSet, TRUE );
+ *GetCrsr()->GetPoint(), rTOX, pSet, sal_True );
ASSERT(pTOX, "Kein aktuelles Verzeichnis");
// Formatierung anstossen
@@ -191,9 +193,9 @@ void SwEditShell::InsertTableOf( const SwTOXBase& rTOX, const SfxItemSet* pSet )
Beschreibung: Verzeichnisinhalt erneuern
--------------------------------------------------------------------*/
-BOOL SwEditShell::UpdateTableOf( const SwTOXBase& rTOX, const SfxItemSet* pSet )
+sal_Bool SwEditShell::UpdateTableOf( const SwTOXBase& rTOX, const SfxItemSet* pSet )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
ASSERT( rTOX.ISA( SwTOXBaseSection ), "keine TOXBaseSection!" );
SwTOXBaseSection* pTOX = (SwTOXBaseSection*)&rTOX;
@@ -204,14 +206,14 @@ BOOL SwEditShell::UpdateTableOf( const SwTOXBase& rTOX, const SfxItemSet* pSet )
SwDoc* pMyDoc = GetDoc();
SwDocShell* pDocSh = pMyDoc->GetDocShell();
- BOOL bInIndex = pTOX == GetCurTOX();
+ sal_Bool bInIndex = pTOX == GetCurTOX();
SET_CURR_SHELL( this );
StartAllAction();
::StartProgress( STR_STATSTR_TOX_UPDATE, 0, 0, pDocSh );
::SetProgressText( STR_STATSTR_TOX_UPDATE, pDocSh );
- pMyDoc->StartUndo(UNDO_TOXCHANGE, NULL);
+ pMyDoc->GetIDocumentUndoRedo().StartUndo(UNDO_TOXCHANGE, NULL);
// Verzeichnisrumpf erzeugen
pTOX->Update(pSet);
@@ -226,7 +228,7 @@ BOOL SwEditShell::UpdateTableOf( const SwTOXBase& rTOX, const SfxItemSet* pSet )
// Seitennummern eintragen
pTOX->UpdatePageNum();
- pMyDoc->EndUndo(UNDO_TOXCHANGE, NULL);
+ pMyDoc->GetIDocumentUndoRedo().EndUndo(UNDO_TOXCHANGE, NULL);
::EndProgress( pDocSh );
EndAllAction();
@@ -244,7 +246,7 @@ const SwTOXBase* SwEditShell::GetCurTOX() const
return GetDoc()->GetCurTOX( *GetCrsr()->GetPoint() );
}
-BOOL SwEditShell::DeleteTOX( const SwTOXBase& rTOXBase, BOOL bDelNodes )
+sal_Bool SwEditShell::DeleteTOX( const SwTOXBase& rTOXBase, sal_Bool bDelNodes )
{
return GetDoc()->DeleteTOX( (SwTOXBase&)rTOXBase, bDelNodes );
}
@@ -253,7 +255,7 @@ BOOL SwEditShell::DeleteTOX( const SwTOXBase& rTOXBase, BOOL bDelNodes )
Beschreibung: Typen der Verzeichnisse verwalten
--------------------------------------------------------------------*/
-const SwTOXType* SwEditShell::GetTOXType(TOXTypes eTyp, USHORT nId) const
+const SwTOXType* SwEditShell::GetTOXType(TOXTypes eTyp, sal_uInt16 nId) const
{
return pDoc->GetTOXType(eTyp, nId);
}
@@ -262,17 +264,17 @@ const SwTOXType* SwEditShell::GetTOXType(TOXTypes eTyp, USHORT nId) const
Beschreibung: Schluessel fuer Stichwortverzeichnisse verwalten
--------------------------------------------------------------------*/
-USHORT SwEditShell::GetTOIKeys( SwTOIKeyType eTyp, SvStringsSort& rArr ) const
+sal_uInt16 SwEditShell::GetTOIKeys( SwTOIKeyType eTyp, SvStringsSort& rArr ) const
{
return GetDoc()->GetTOIKeys( eTyp, rArr );
}
-USHORT SwEditShell::GetTOXCount() const
+sal_uInt16 SwEditShell::GetTOXCount() const
{
const SwSectionFmts& rFmts = GetDoc()->GetSections();
- USHORT nRet = 0;
- for( USHORT n = rFmts.Count(); n; )
+ sal_uInt16 nRet = 0;
+ for( sal_uInt16 n = rFmts.Count(); n; )
{
const SwSection* pSect = rFmts[ --n ]->GetSection();
if( TOX_CONTENT_SECTION == pSect->GetType() &&
@@ -283,10 +285,10 @@ USHORT SwEditShell::GetTOXCount() const
}
-const SwTOXBase* SwEditShell::GetTOX( USHORT nPos ) const
+const SwTOXBase* SwEditShell::GetTOX( sal_uInt16 nPos ) const
{
const SwSectionFmts& rFmts = GetDoc()->GetSections();
- for( USHORT n = 0, nCnt = 0; n < rFmts.Count(); ++n )
+ for( sal_uInt16 n = 0, nCnt = 0; n < rFmts.Count(); ++n )
{
const SwSection* pSect = rFmts[ n ]->GetSection();
if( TOX_CONTENT_SECTION == pSect->GetType() &&
@@ -302,13 +304,13 @@ const SwTOXBase* SwEditShell::GetTOX( USHORT nPos ) const
// nach einlesen einer Datei alle Verzeichnisse updaten
-void SwEditShell::SetUpdateTOX( BOOL bFlag )
+void SwEditShell::SetUpdateTOX( sal_Bool bFlag )
{
GetDoc()->SetUpdateTOX( bFlag );
}
-BOOL SwEditShell::IsUpdateTOX() const
+sal_Bool SwEditShell::IsUpdateTOX() const
{
return GetDoc()->IsUpdateTOX();
}
@@ -333,8 +335,8 @@ void SwEditShell::SetTOIAutoMarkURL(const String& rSet)
void SwEditShell::ApplyAutoMark()
{
StartAllAction();
- BOOL bDoesUndo = DoesUndo();
- DoUndo(FALSE);
+ sal_Bool bDoesUndo = DoesUndo();
+ DoUndo(sal_False);
//1. remove all automatic generated index entries if AutoMarkURL has a
// length and the file exists
//2. load file
@@ -358,7 +360,7 @@ void SwEditShell::ApplyAutoMark()
}
//2.
- SfxMedium aMedium( sAutoMarkURL, STREAM_STD_READ, TRUE );
+ SfxMedium aMedium( sAutoMarkURL, STREAM_STD_READ, sal_True );
SvStream& rStrm = *aMedium.GetInStream();
const String sZero('0');
Push();
@@ -369,16 +371,16 @@ void SwEditShell::ApplyAutoMark()
//
//SearchAlgorithms eSrchType = SearchAlgorithms_ABSOLUTE;
//OUString aSrchStr = rText;
- BOOL bCaseSensitive = TRUE;
- BOOL bWordOnly = FALSE;
- BOOL bSrchInSel = FALSE;
- BOOL bLEV_Relaxed = TRUE;
- INT32 nLEV_Other = 2; // -> changedChars;
- INT32 nLEV_Longer = 3; //! -> deletedChars;
- INT32 nLEV_Shorter = 1; //! -> insertedChars;
- INT32 nTransliterationFlags = 0;
+ sal_Bool bCaseSensitive = sal_True;
+ sal_Bool bWordOnly = sal_False;
+ sal_Bool bSrchInSel = sal_False;
+ sal_Bool bLEV_Relaxed = sal_True;
+ sal_Int32 nLEV_Other = 2; // -> changedChars;
+ sal_Int32 nLEV_Longer = 3; //! -> deletedChars;
+ sal_Int32 nLEV_Shorter = 1; //! -> insertedChars;
+ sal_Int32 nTransliterationFlags = 0;
//
- INT32 nSrchFlags = 0;
+ sal_Int32 nSrchFlags = 0;
if (!bCaseSensitive)
{
nSrchFlags |= SearchFlags::ALL_IGNORE_CASE;
@@ -447,13 +449,13 @@ void SwEditShell::ApplyAutoMark()
aSearchOpt.searchString = sToSelect;
KillPams();
- BOOL bCancel;
+ sal_Bool bCancel;
// todo/mba: assuming that notes shouldn't be searched
- BOOL bSearchInNotes = FALSE;
- ULONG nRet = Find( aSearchOpt, bSearchInNotes, DOCPOS_START, DOCPOS_END, bCancel,
+ sal_Bool bSearchInNotes = sal_False;
+ sal_uLong nRet = Find( aSearchOpt, bSearchInNotes, DOCPOS_START, DOCPOS_END, bCancel,
(FindRanges)(FND_IN_SELALL|FND_IN_BODYONLY),
- FALSE );
+ sal_False );
if(nRet)
{
@@ -466,8 +468,8 @@ void SwEditShell::ApplyAutoMark()
}
if(sAlternative.Len())
pTmpMark->SetAlternativeText(sAlternative);
- pTmpMark->SetMainEntry(FALSE);
- pTmpMark->SetAutoGenerated(TRUE);
+ pTmpMark->SetMainEntry(sal_False);
+ pTmpMark->SetAutoGenerated(sal_True);
//4.
SwEditShell::Insert(*pTmpMark);
}
@@ -475,7 +477,7 @@ void SwEditShell::ApplyAutoMark()
}
}
KillPams();
- Pop(FALSE);
+ Pop(sal_False);
}
DoUndo(bDoesUndo);
EndAllAction();
diff --git a/sw/source/core/edit/edundo.cxx b/sw/source/core/edit/edundo.cxx
index 58bc6965c40b..f30db42a4460 100644
--- a/sw/source/core/edit/edundo.cxx
+++ b/sw/source/core/edit/edundo.cxx
@@ -28,18 +28,20 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <svx/svdview.hxx>
+
#include <editsh.hxx>
#include <fesh.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <pam.hxx>
-#include <undobj.hxx>
+#include <UndoCore.hxx>
#include <swundo.hxx>
#include <dcontact.hxx>
#include <flyfrm.hxx>
#include <frmfmt.hxx>
#include <viewimp.hxx>
+#include <docsh.hxx>
/** helper function to select all objects in an SdrMarkList;
@@ -47,16 +49,64 @@
void lcl_SelectSdrMarkList( SwEditShell* pShell,
const SdrMarkList* pSdrMarkList );
+bool SwEditShell::CursorsLocked() const
+{
+
+ return GetDoc()->GetDocShell()->GetModel()->hasControllersLocked();
+}
+
+void
+SwEditShell::HandleUndoRedoContext(::sw::UndoRedoContext & rContext)
+{
+ // do nothing if somebody has locked controllers!
+ if (CursorsLocked())
+ {
+ return;
+ }
+
+ SwFrmFmt * pSelFmt(0);
+ SdrMarkList * pMarkList(0);
+ rContext.GetSelections(pSelFmt, pMarkList);
+
+ if (pSelFmt) // select frame
+ {
+ if (RES_DRAWFRMFMT == pSelFmt->Which())
+ {
+ SdrObject* pSObj = pSelFmt->FindSdrObject();
+ static_cast<SwFEShell*>(this)->SelectObj(
+ pSObj->GetCurrentBoundRect().Center() );
+ }
+ else
+ {
+ Point aPt;
+ SwFlyFrm *const pFly =
+ static_cast<SwFlyFrmFmt*>(pSelFmt)->GetFrm(& aPt, false);
+ if (pFly)
+ {
+ static_cast<SwFEShell*>(this)->SelectFlyFrm(*pFly, true);
+ }
+ }
+ }
+ else if (pMarkList)
+ {
+ lcl_SelectSdrMarkList( this, pMarkList );
+ }
+ else if (GetCrsr()->GetNext() != GetCrsr())
+ {
+ // current cursor is the last one:
+ // go around the ring, to the first cursor
+ GoNextCrsr();
+ }
+}
-BOOL SwEditShell::Undo( SwUndoId nUndoId, USHORT nCnt )
+bool SwEditShell::Undo(sal_uInt16 const nCount)
{
SET_CURR_SHELL( this );
// #105332# current undo state was not saved
- BOOL bRet = FALSE;
- BOOL bSaveDoesUndo = GetDoc()->DoesUndo();
+ ::sw::UndoGuard const undoGuard(GetDoc()->GetIDocumentUndoRedo());
+ sal_Bool bRet = sal_False;
- GetDoc()->DoUndo( FALSE );
StartAllAction();
{
// eigentlich muesste ja nur der aktuelle Cursor berarbeitet
@@ -69,8 +119,9 @@ BOOL SwEditShell::Undo( SwUndoId nUndoId, USHORT nCnt )
// JP 02.04.98: Cursor merken - beim Auto-Format/-Korrektur
// soll dieser wieder an die Position
- SwUndoId nLastUndoId = GetDoc()->GetUndoIds(NULL, NULL);
- BOOL bRestoreCrsr = 1 == nCnt && ( UNDO_AUTOFORMAT == nLastUndoId ||
+ SwUndoId nLastUndoId(UNDO_EMPTY);
+ GetDoc()->GetIDocumentUndoRedo().GetLastUndoInfo(0, & nLastUndoId);
+ bool bRestoreCrsr = 1 == nCount && (UNDO_AUTOFORMAT == nLastUndoId ||
UNDO_AUTOCORRECT == nLastUndoId );
Push();
@@ -80,51 +131,19 @@ BOOL SwEditShell::Undo( SwUndoId nUndoId, USHORT nCnt )
RedlineMode_t eOld = GetDoc()->GetRedlineMode();
- SwUndoIter aUndoIter( GetCrsr(), nUndoId );
- while( nCnt-- )
- {
- do {
-
- bRet = GetDoc()->Undo( aUndoIter ) || bRet;
-
- if( !aUndoIter.IsNextUndo() )
- break;
-
- // es geht weiter, also erzeuge einen neuen Cursor wenn
- // der alte schon eine Selection hat
- // JP 02.04.98: aber nicht wenns ein Autoformat ist
- if( !bRestoreCrsr && HasSelection() )
- {
- CreateCrsr();
- aUndoIter.pAktPam = GetCrsr();
- }
- } while( TRUE );
- }
-
- Pop( !bRestoreCrsr );
-
- if( aUndoIter.pSelFmt ) // dann erzeuge eine Rahmen-Selection
- {
- if( RES_DRAWFRMFMT == aUndoIter.pSelFmt->Which() )
+ try {
+ for (sal_uInt16 i = 0; i < nCount; ++i)
{
- SdrObject* pSObj = aUndoIter.pSelFmt->FindSdrObject();
- ((SwFEShell*)this)->SelectObj( pSObj->GetCurrentBoundRect().Center() );
+ bRet = GetDoc()->GetIDocumentUndoRedo().Undo()
+ || bRet;
}
- else
- {
- Point aPt;
- SwFlyFrm* pFly = ((SwFlyFrmFmt*)aUndoIter.pSelFmt)->GetFrm(
- &aPt, FALSE );
- if( pFly )
- ((SwFEShell*)this)->SelectFlyFrm( *pFly, TRUE );
- }
- }
- else if( aUndoIter.pMarkList )
- {
- lcl_SelectSdrMarkList( this, aUndoIter.pMarkList );
+ } catch (::com::sun::star::uno::Exception & e) {
+ OSL_TRACE("SwEditShell::Undo(): exception caught:\n %s",
+ ::rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)
+ .getStr());
}
- else if( GetCrsr()->GetNext() != GetCrsr() ) // gehe nach einem
- GoNextCrsr(); // Undo zur alten Undo-Position !!
+
+ Pop( !bRestoreCrsr );
GetDoc()->SetRedlineMode( eOld );
GetDoc()->CompressRedlines();
@@ -134,21 +153,18 @@ BOOL SwEditShell::Undo( SwUndoId nUndoId, USHORT nCnt )
}
EndAllAction();
- // #105332# undo state was not restored but set to FALSE everytime
- GetDoc()->DoUndo( bSaveDoesUndo );
return bRet;
}
-USHORT SwEditShell::Redo( USHORT nCnt )
+bool SwEditShell::Redo(sal_uInt16 const nCount)
{
SET_CURR_SHELL( this );
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
// #105332# undo state was not saved
- BOOL bSaveDoesUndo = GetDoc()->DoesUndo();
+ ::sw::UndoGuard const undoGuard(GetDoc()->GetIDocumentUndoRedo());
- GetDoc()->DoUndo( FALSE );
StartAllAction();
{
@@ -166,51 +182,17 @@ USHORT SwEditShell::Redo( USHORT nCnt )
RedlineMode_t eOld = GetDoc()->GetRedlineMode();
- SwUndoIter aUndoIter( GetCrsr(), UNDO_EMPTY );
- while( nCnt-- )
- {
- do {
-
- bRet = GetDoc()->Redo( aUndoIter ) || bRet;
-
- if( !aUndoIter.IsNextUndo() )
- break;
-
- // es geht weiter, also erzeugen einen neuen Cursor wenn
- // der alte schon eine SSelection hat
- if( HasSelection() )
- {
- CreateCrsr();
- aUndoIter.pAktPam = GetCrsr();
- }
- } while( TRUE );
- }
-
- if( aUndoIter.IsUpdateAttr() )
- UpdateAttr();
-
- if( aUndoIter.pSelFmt ) // dann erzeuge eine Rahmen-Selection
- {
- if( RES_DRAWFRMFMT == aUndoIter.pSelFmt->Which() )
+ try {
+ for (sal_uInt16 i = 0; i < nCount; ++i)
{
- SdrObject* pSObj = aUndoIter.pSelFmt->FindSdrObject();
- ((SwFEShell*)this)->SelectObj( pSObj->GetCurrentBoundRect().Center() );
+ bRet = GetDoc()->GetIDocumentUndoRedo().Redo()
+ || bRet;
}
- else
- {
- Point aPt;
- SwFlyFrm* pFly = ((SwFlyFrmFmt*)aUndoIter.pSelFmt)->GetFrm(
- &aPt, FALSE );
- if( pFly )
- ((SwFEShell*)this)->SelectFlyFrm( *pFly, TRUE );
- }
- }
- else if( aUndoIter.pMarkList )
- {
- lcl_SelectSdrMarkList( this, aUndoIter.pMarkList );
+ } catch (::com::sun::star::uno::Exception & e) {
+ OSL_TRACE("SwEditShell::Redo(): exception caught:\n %s",
+ ::rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)
+ .getStr());
}
- else if( GetCrsr()->GetNext() != GetCrsr() ) // gehe nach einem
- GoNextCrsr(); // Redo zur alten Undo-Position !!
GetDoc()->SetRedlineMode( eOld );
GetDoc()->CompressRedlines();
@@ -221,41 +203,31 @@ USHORT SwEditShell::Redo( USHORT nCnt )
EndAllAction();
- // #105332# undo state was not restored but set FALSE everytime
- GetDoc()->DoUndo( bSaveDoesUndo );
return bRet;
}
-USHORT SwEditShell::Repeat( USHORT nCount )
+bool SwEditShell::Repeat(sal_uInt16 const nCount)
{
SET_CURR_SHELL( this );
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
StartAllAction();
- SwUndoIter aUndoIter( GetCrsr(), UNDO_EMPTY );
- bRet = GetDoc()->Repeat( aUndoIter, nCount ) || bRet;
+ try {
+ ::sw::RepeatContext context(*GetDoc(), *GetCrsr());
+ bRet = GetDoc()->GetIDocumentUndoRedo().Repeat( context, nCount )
+ || bRet;
+ } catch (::com::sun::star::uno::Exception & e) {
+ OSL_TRACE("SwEditShell::Repeat(): exception caught:\n %s",
+ ::rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)
+ .getStr());
+ }
EndAllAction();
return bRet;
}
- // abfragen/setzen der Anzahl von wiederherstellbaren Undo-Actions
-
-USHORT SwEditShell::GetUndoActionCount()
-{
- return SwDoc::GetUndoActionCount();
-}
-
-
-void SwEditShell::SetUndoActionCount( USHORT nNew )
-{
- SwDoc::SetUndoActionCount( nNew );
-}
-
-
-
void lcl_SelectSdrMarkList( SwEditShell* pShell,
const SdrMarkList* pSdrMarkList )
@@ -266,6 +238,7 @@ void lcl_SelectSdrMarkList( SwEditShell* pShell,
if( pShell->ISA( SwFEShell ) )
{
SwFEShell* pFEShell = static_cast<SwFEShell*>( pShell );
+<<<<<<< local
bool bFirst = true;
for( USHORT i = 0; i < pSdrMarkList->GetMarkCount(); ++i )
{
@@ -276,6 +249,12 @@ void lcl_SelectSdrMarkList( SwEditShell* pShell,
bFirst = false;
}
}
+=======
+ for( sal_uInt16 i = 0; i < pSdrMarkList->GetMarkCount(); ++i )
+ pFEShell->SelectObj( Point(),
+ (i==0) ? 0 : SW_ADD_SELECT,
+ pSdrMarkList->GetMark( i )->GetMarkedSdrObj() );
+>>>>>>> other
// the old implementation would always unselect
// objects, even if no new ones were selected. If this
diff --git a/sw/source/core/edit/edws.cxx b/sw/source/core/edit/edws.cxx
index 81088bcc0e56..1a681ad2cf29 100644
--- a/sw/source/core/edit/edws.cxx
+++ b/sw/source/core/edit/edws.cxx
@@ -28,12 +28,11 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-
-
#include <vcl/window.hxx>
+
#include <editsh.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <pam.hxx>
#include <docary.hxx>
#include <acorrect.hxx>
@@ -59,7 +58,7 @@ SwEditShell::SwEditShell( SwEditShell& rEdSH, Window *pWindow )
SwEditShell::SwEditShell( SwDoc& rDoc, Window *pWindow, const SwViewOption *pOptions )
: SwCrsrShell( rDoc, pWindow, pOptions )
{
- GetDoc()->DoUndo(true);
+ GetDoc()->GetIDocumentUndoRedo().DoUndo(true);
}
@@ -98,7 +97,7 @@ void SwEditShell::ResetModified()
void SwEditShell::SetUndoNoResetModified()
{
GetDoc()->SetModified();
- GetDoc()->SetUndoNoResetModified();
+ GetDoc()->GetIDocumentUndoRedo().SetUndoNoResetModified();
}
/******************************************************************************
@@ -261,24 +260,24 @@ void SwEditShell::InsertTOXType(const SwTOXType& rTyp)
void SwEditShell::DoUndo( sal_Bool bOn )
-{ GetDoc()->DoUndo( bOn ); }
+{ GetDoc()->GetIDocumentUndoRedo().DoUndo( bOn ); }
sal_Bool SwEditShell::DoesUndo() const
-{ return GetDoc()->DoesUndo(); }
+{ return GetDoc()->GetIDocumentUndoRedo().DoesUndo(); }
void SwEditShell::DoGroupUndo( sal_Bool bOn )
-{ GetDoc()->DoGroupUndo( bOn ); }
+{ GetDoc()->GetIDocumentUndoRedo().DoGroupUndo( bOn ); }
sal_Bool SwEditShell::DoesGroupUndo() const
-{ return GetDoc()->DoesGroupUndo(); }
+{ return GetDoc()->GetIDocumentUndoRedo().DoesGroupUndo(); }
void SwEditShell::DelAllUndoObj()
{
- GetDoc()->DelAllUndoObj();
+ GetDoc()->GetIDocumentUndoRedo().DelAllUndoObj();
}
// Zusammenfassen von Kontinuierlichen Insert/Delete/Overwrite von
@@ -289,44 +288,25 @@ void SwEditShell::DelAllUndoObj()
SwUndoId SwEditShell::StartUndo( SwUndoId eUndoId,
const SwRewriter *pRewriter )
-{ return GetDoc()->StartUndo( eUndoId, pRewriter ); }
+{ return GetDoc()->GetIDocumentUndoRedo().StartUndo( eUndoId, pRewriter ); }
// schliesst Klammerung der nUndoId, nicht vom UI benutzt
SwUndoId SwEditShell::EndUndo(SwUndoId eUndoId,
const SwRewriter *pRewriter)
-{ return GetDoc()->EndUndo(eUndoId, pRewriter); }
-
-// liefert die Id der letzten undofaehigen Aktion zurueck
-// fuellt ggf. VARARR mit sdbcx::User-UndoIds
-
-
-SwUndoId SwEditShell::GetUndoIds(String* pStr,SwUndoIds *pUndoIds) const
-{ return GetDoc()->GetUndoIds(pStr,pUndoIds); }
-
-String SwEditShell::GetUndoIdsStr(String* pStr,SwUndoIds *pUndoIds) const
-{ return GetDoc()->GetUndoIdsStr(pStr,pUndoIds); }
-
-// liefert die Id der letzten Redofaehigen Aktion zurueck
-// fuellt ggf. VARARR mit RedoIds
-
-
-SwUndoId SwEditShell::GetRedoIds(String* pStr,SwUndoIds *pRedoIds) const
-{ return GetDoc()->GetRedoIds(pStr,pRedoIds); }
-
-String SwEditShell::GetRedoIdsStr(String* pStr,SwUndoIds *pRedoIds) const
-{ return GetDoc()->GetRedoIdsStr(pStr,pRedoIds); }
+{ return GetDoc()->GetIDocumentUndoRedo().EndUndo(eUndoId, pRewriter); }
-// liefert die Id der letzten Repeatfaehigen Aktion zurueck
-// fuellt ggf. VARARR mit RedoIds
+bool SwEditShell::GetLastUndoInfo(::rtl::OUString *const o_pStr,
+ SwUndoId *const o_pId) const
+{ return GetDoc()->GetIDocumentUndoRedo().GetLastUndoInfo(o_pStr, o_pId); }
-SwUndoId SwEditShell::GetRepeatIds(String* pStr, SwUndoIds *pRedoIds) const
-{ return GetDoc()->GetRepeatIds(pStr,pRedoIds); }
+bool SwEditShell::GetFirstRedoInfo(::rtl::OUString *const o_pStr) const
+{ return GetDoc()->GetIDocumentUndoRedo().GetFirstRedoInfo(o_pStr); }
-String SwEditShell::GetRepeatIdsStr(String* pStr, SwUndoIds *pRedoIds) const
-{ return GetDoc()->GetRepeatIdsStr(pStr,pRedoIds); }
+SwUndoId SwEditShell::GetRepeatInfo(::rtl::OUString *const o_pStr) const
+{ return GetDoc()->GetIDocumentUndoRedo().GetRepeatInfo(o_pStr); }
diff --git a/sw/source/core/except/dbgloop.cxx b/sw/source/core/except/dbgloop.cxx
index c48c9e5d53bb..0cf08c601422 100644
--- a/sw/source/core/except/dbgloop.cxx
+++ b/sw/source/core/except/dbgloop.cxx
@@ -49,7 +49,7 @@ void DbgLoopStack::Reset()
{
nPtr = 0;
pDbg = 0;
- for( USHORT i = 0; i < DBG_MAX_STACK; ++i )
+ for( sal_uInt16 i = 0; i < DBG_MAX_STACK; ++i )
aCount[i] = 0;
}
@@ -103,7 +103,7 @@ void DbgLoopStack::Pop()
void DbgLoopStack::Print( SvStream &rOS ) const
{
rOS << "POS: " << nPtr << '\n';
- USHORT i;
+ sal_uInt16 i;
for( i = 0; i < DBG_MAX_STACK; ++i )
rOS << i << " ";
rOS << '\n';
@@ -121,7 +121,7 @@ void DbgLoopStack::Print( SvStream &rOS ) const
#include <stdlib.h>
-void AssertFail( const char *pErr, const char *pFile, USHORT nLine )
+void AssertFail( const char *pErr, const char *pFile, sal_uInt16 nLine )
{
cout << pErr << '\n';
PrintLoopStack( cout );
@@ -137,12 +137,12 @@ public:
void Test::Run() const
{
cout << "---" << '\n';
- for( USHORT i = 0; i < 10; ++i )
+ for( sal_uInt16 i = 0; i < 10; ++i )
{
cout << "i" << i;
DBG_LOOP;
PrintLoopStack( cout );
- for( USHORT j = 0; j < 10; ++j )
+ for( sal_uInt16 j = 0; j < 10; ++j )
{
cout << " j" << j;
DBG_LOOP;
diff --git a/sw/source/core/except/errhdl.cxx b/sw/source/core/except/errhdl.cxx
index 03b5ebf45422..3e2a2dfd0966 100644
--- a/sw/source/core/except/errhdl.cxx
+++ b/sw/source/core/except/errhdl.cxx
@@ -44,8 +44,8 @@
#define CVBREAK
#endif
-BOOL bAssertFail = FALSE; // ist gerade eine Assertbox oben ?
-BOOL bAssert = FALSE; // TRUE, wenn mal ein ASSERT kam.
+sal_Bool bAssertFail = sal_False; // ist gerade eine Assertbox oben ?
+sal_Bool bAssert = sal_False; // sal_True, wenn mal ein ASSERT kam.
/*------------------------------------------------------------------------
Ausgabe einer Fehlermeldung inkl. Bedingung, Dateiname und Zeilennummer
@@ -54,18 +54,18 @@ BOOL bAssert = FALSE; // TRUE, wenn mal ein ASSERT kam.
Parameter:
char *pError Fehlermeldung
char *pFileName Filename in dem der Fehler auftrat
- USHORT nLine Zeilennummer in dem der Fehler auftrat
+ sal_uInt16 nLine Zeilennummer in dem der Fehler auftrat
------------------------------------------------------------------------*/
-void AssertFail( const sal_Char* pError, const sal_Char* pFileName, USHORT nLine )
+void AssertFail( const sal_Char* pError, const sal_Char* pFileName, sal_uInt16 nLine )
{
CVBREAK;
// NOTE4("ASSERT: %s at %d: %s\n", pFileName, nLine, pError);
- bAssert = TRUE;
+ bAssert = sal_True;
if( !bAssertFail && GetpApp() && GetpApp()->IsInMain() )
{
- bAssertFail = TRUE;
+ bAssertFail = sal_True;
ByteString aErr;
aErr = "Assertion failed\n==================\nFILE : ";
aErr += pFileName;
@@ -75,7 +75,7 @@ void AssertFail( const sal_Char* pError, const sal_Char* pFileName, USHORT nLine
aErr += pError;
ByteString aTmp( getenv( "SW_NOBEEP" ) );
- if ( aTmp != "TRUE" )
+ if ( aTmp != "sal_True" )
Sound::Beep(SOUND_ERROR);
#if defined( UNX ) && !defined( DBG_UTIL )
@@ -83,7 +83,7 @@ void AssertFail( const sal_Char* pError, const sal_Char* pFileName, USHORT nLine
#else
DbgError( aErr.GetBuffer() );
#endif
- bAssertFail = FALSE;
+ bAssertFail = sal_False;
}
else
{
@@ -100,12 +100,12 @@ void AssertFail( const sal_Char* pError, const sal_Char* pFileName, USHORT nLine
wo der Fehler auftrat.
Die Funktion wird durch das ASSERT Makro gerufen!
Parameter:
- USHORT nErrorId Id fuer Fehlermeldung
+ sal_uInt16 nErrorId Id fuer Fehlermeldung
char *pFileName Filename in dem der Fehler auftrat
- USHORT nLine Zeilennummer in dem der Fehler auftrat
+ sal_uInt16 nLine Zeilennummer in dem der Fehler auftrat
------------------------------------------------------------------------*/
-void AssertFail( USHORT nErrorId, const sal_Char* pFileName, USHORT nLine )
+void AssertFail( sal_uInt16 nErrorId, const sal_Char* pFileName, sal_uInt16 nLine )
{
// Umsetzung der ErrorId in eine Fehlermeldung
static const sal_Char
diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx
index b32f01074038..d12f65a38d16 100644
--- a/sw/source/core/fields/authfld.cxx
+++ b/sw/source/core/fields/authfld.cxx
@@ -76,16 +76,16 @@ SV_IMPL_PTRARR( SortKeyArr, TOXSortKeyPtr )
SwAuthEntry::SwAuthEntry(const SwAuthEntry& rCopy)
: nRefCount(0)
{
- for(USHORT i = 0; i < AUTH_FIELD_END; i++)
+ for(sal_uInt16 i = 0; i < AUTH_FIELD_END; i++)
aAuthFields[i] = rCopy.aAuthFields[i];
}
// --------------------------------------------------------
-BOOL SwAuthEntry::operator==(const SwAuthEntry& rComp)
+sal_Bool SwAuthEntry::operator==(const SwAuthEntry& rComp)
{
- for(USHORT i = 0; i < AUTH_FIELD_END; i++)
+ for(sal_uInt16 i = 0; i < AUTH_FIELD_END; i++)
if(aAuthFields[i] != rComp.aAuthFields[i])
- return FALSE;
- return TRUE;
+ return sal_False;
+ return sal_True;
}
// --------------------------------------------------------
SwAuthorityFieldType::SwAuthorityFieldType(SwDoc* pDoc)
@@ -96,8 +96,8 @@ SwAuthorityFieldType::SwAuthorityFieldType(SwDoc* pDoc)
m_pSortKeyArr(new SortKeyArr(3, 3)),
m_cPrefix('['),
m_cSuffix(']'),
- m_bIsSequence(FALSE),
- m_bSortByDocument(TRUE),
+ m_bIsSequence(sal_False),
+ m_bSortByDocument(sal_True),
m_eLanguage((LanguageType)::GetAppLanguage())
{
}
@@ -114,7 +114,7 @@ SwAuthorityFieldType::SwAuthorityFieldType( const SwAuthorityFieldType& rFType)
m_eLanguage(rFType.m_eLanguage),
m_sSortAlgorithm(rFType.m_sSortAlgorithm)
{
- for(USHORT i = 0; i < rFType.m_pSortKeyArr->Count(); i++)
+ for(sal_uInt16 i = 0; i < rFType.m_pSortKeyArr->Count(); i++)
m_pSortKeyArr->Insert((*rFType.m_pSortKeyArr)[i], i);
}
@@ -135,16 +135,16 @@ SwFieldType* SwAuthorityFieldType::Copy() const
void SwAuthorityFieldType::RemoveField(long nHandle)
{
#ifdef DBG_UTIL
- BOOL bRemoved = FALSE;
+ sal_Bool bRemoved = sal_False;
#endif
- for(USHORT j = 0; j < m_pDataArr->Count(); j++)
+ for(sal_uInt16 j = 0; j < m_pDataArr->Count(); j++)
{
SwAuthEntry* pTemp = m_pDataArr->GetObject(j);
long nRet = (long)(void*)pTemp;
if(nRet == nHandle)
{
#ifdef DBG_UTIL
- bRemoved = TRUE;
+ bRemoved = sal_True;
#endif
pTemp->RemoveRef();
if(!pTemp->GetRefCount())
@@ -165,11 +165,11 @@ long SwAuthorityFieldType::AddField(const String& rFieldContents)
{
long nRet = 0;
SwAuthEntry* pEntry = new SwAuthEntry;
- for( USHORT i = 0; i < AUTH_FIELD_END; ++i )
+ for( sal_uInt16 i = 0; i < AUTH_FIELD_END; ++i )
pEntry->SetAuthorField( (ToxAuthorityField)i,
rFieldContents.GetToken( i, TOX_STYLE_DELIMITER ));
- for(USHORT j = 0; j < m_pDataArr->Count() && pEntry; j++)
+ for(sal_uInt16 j = 0; j < m_pDataArr->Count() && pEntry; j++)
{
SwAuthEntry* pTemp = m_pDataArr->GetObject(j);
if(*pTemp == *pEntry)
@@ -191,16 +191,21 @@ long SwAuthorityFieldType::AddField(const String& rFieldContents)
return nRet;
}
+<<<<<<< local
BOOL SwAuthorityFieldType::AddField(long nHandle)
+=======
+ --------------------------------------------------*/
+sal_Bool SwAuthorityFieldType::AddField(long nHandle)
+>>>>>>> other
{
- BOOL bRet = FALSE;
- for( USHORT j = 0; j < m_pDataArr->Count(); j++ )
+ sal_Bool bRet = sal_False;
+ for( sal_uInt16 j = 0; j < m_pDataArr->Count(); j++ )
{
SwAuthEntry* pTemp = m_pDataArr->GetObject(j);
long nTmp = (long)(void*)pTemp;
if( nTmp == nHandle )
{
- bRet = TRUE;
+ bRet = sal_True;
pTemp->AddRef();
//re-generate positions of the fields
DelSequenceArray();
@@ -214,7 +219,7 @@ BOOL SwAuthorityFieldType::AddField(long nHandle)
const SwAuthEntry* SwAuthorityFieldType::GetEntryByHandle(long nHandle) const
{
const SwAuthEntry* pRet = 0;
- for(USHORT j = 0; j < m_pDataArr->Count(); j++)
+ for(sal_uInt16 j = 0; j < m_pDataArr->Count(); j++)
{
const SwAuthEntry* pTemp = m_pDataArr->GetObject(j);
long nTmp = (long)(void*)pTemp;
@@ -231,7 +236,7 @@ const SwAuthEntry* SwAuthorityFieldType::GetEntryByHandle(long nHandle) const
void SwAuthorityFieldType::GetAllEntryIdentifiers(
SvStringsDtor& rToFill )const
{
- for(USHORT j = 0; j < m_pDataArr->Count(); j++)
+ for(sal_uInt16 j = 0; j < m_pDataArr->Count(); j++)
{
SwAuthEntry* pTemp = m_pDataArr->GetObject(j);
rToFill.Insert( new String( pTemp->GetAuthorField(
@@ -243,7 +248,7 @@ const SwAuthEntry* SwAuthorityFieldType::GetEntryByIdentifier(
const String& rIdentifier)const
{
const SwAuthEntry* pRet = 0;
- for( USHORT j = 0; j < m_pDataArr->Count(); ++j )
+ for( sal_uInt16 j = 0; j < m_pDataArr->Count(); ++j )
{
const SwAuthEntry* pTemp = m_pDataArr->GetObject(j);
if( rIdentifier == pTemp->GetAuthorField( AUTH_FIELD_IDENTIFIER ))
@@ -258,13 +263,13 @@ const SwAuthEntry* SwAuthorityFieldType::GetEntryByIdentifier(
bool SwAuthorityFieldType::ChangeEntryContent(const SwAuthEntry* pNewEntry)
{
bool bChanged = false;
- for( USHORT j = 0; j < m_pDataArr->Count(); ++j )
+ for( sal_uInt16 j = 0; j < m_pDataArr->Count(); ++j )
{
SwAuthEntry* pTemp = m_pDataArr->GetObject(j);
if(pTemp->GetAuthorField(AUTH_FIELD_IDENTIFIER) ==
pNewEntry->GetAuthorField(AUTH_FIELD_IDENTIFIER))
{
- for(USHORT i = 0; i < AUTH_FIELD_END; i++)
+ for(sal_uInt16 i = 0; i < AUTH_FIELD_END; i++)
pTemp->SetAuthorField((ToxAuthorityField) i,
pNewEntry->GetAuthorField((ToxAuthorityField)i));
bChanged = true;
@@ -277,9 +282,9 @@ bool SwAuthorityFieldType::ChangeEntryContent(const SwAuthEntry* pNewEntry)
/*-------------------------------------------------------------------------
appends a new entry (if new) and returns the array position
-----------------------------------------------------------------------*/
-USHORT SwAuthorityFieldType::AppendField( const SwAuthEntry& rInsert )
+sal_uInt16 SwAuthorityFieldType::AppendField( const SwAuthEntry& rInsert )
{
- USHORT nRet = 0;
+ sal_uInt16 nRet = 0;
for( nRet = 0; nRet < m_pDataArr->Count(); ++nRet )
{
SwAuthEntry* pTemp = m_pDataArr->GetObject( nRet );
@@ -297,7 +302,14 @@ USHORT SwAuthorityFieldType::AppendField( const SwAuthEntry& rInsert )
return nRet;
}
+<<<<<<< local
long SwAuthorityFieldType::GetHandle(USHORT nPos)
+=======
+/*-- 11.10.99 08:49:24---------------------------------------------------
+
+ -----------------------------------------------------------------------*/
+long SwAuthorityFieldType::GetHandle(sal_uInt16 nPos)
+>>>>>>> other
{
long nRet = 0;
if( nPos < m_pDataArr->Count() )
@@ -308,7 +320,12 @@ long SwAuthorityFieldType::GetHandle(USHORT nPos)
return nRet;
}
+<<<<<<< local
USHORT SwAuthorityFieldType::GetSequencePos(long nHandle)
+=======
+ --------------------------------------------------*/
+sal_uInt16 SwAuthorityFieldType::GetSequencePos(long nHandle)
+>>>>>>> other
{
//find the field in a sorted array of handles,
#ifdef DBG_UTIL
@@ -381,7 +398,7 @@ USHORT SwAuthorityFieldType::GetSequencePos(long nHandle)
}
}
- for(USHORT i = 0; i < aSortArr.Count(); i++)
+ for(sal_uInt16 i = 0; i < aSortArr.Count(); i++)
{
const SwTOXSortTabBase& rBase = *aSortArr[i];
SwFmtFld& rFmtFld = ((SwTOXAuthority&)rBase).GetFldFmt();
@@ -391,8 +408,8 @@ USHORT SwAuthorityFieldType::GetSequencePos(long nHandle)
aSortArr.DeleteAndDestroy(0, aSortArr.Count());
}
//find nHandle
- USHORT nRet = 0;
- for(USHORT i = 0; i < m_pSequArr->Count(); i++)
+ sal_uInt16 nRet = 0;
+ for(sal_uInt16 i = 0; i < m_pSequArr->Count(); i++)
{
if((*m_pSequArr)[i] == nHandle)
{
@@ -404,7 +421,12 @@ USHORT SwAuthorityFieldType::GetSequencePos(long nHandle)
return nRet;
}
+<<<<<<< local
BOOL SwAuthorityFieldType::QueryValue( Any& rVal, USHORT nWhichId ) const
+=======
+ ---------------------------------------------------------------------------*/
+sal_Bool SwAuthorityFieldType::QueryValue( Any& rVal, sal_uInt16 nWhichId ) const
+>>>>>>> other
{
switch( nWhichId )
{
@@ -456,12 +478,17 @@ BOOL SwAuthorityFieldType::QueryValue( Any& rVal, USHORT nWhichId ) const
default:
DBG_ERROR("illegal property");
}
- return TRUE;
+ return sal_True;
}
+<<<<<<< local
BOOL SwAuthorityFieldType::PutValue( const Any& rAny, USHORT nWhichId )
+=======
+ ---------------------------------------------------------------------------*/
+sal_Bool SwAuthorityFieldType::PutValue( const Any& rAny, sal_uInt16 nWhichId )
+>>>>>>> other
{
- sal_Bool bRet = TRUE;
+ sal_Bool bRet = sal_True;
String sTmp;
switch( nWhichId )
{
@@ -514,7 +541,7 @@ BOOL SwAuthorityFieldType::PutValue( const Any& rAny, USHORT nWhichId )
if(nVal >= 0 && nVal < AUTH_FIELD_END)
pSortKey->eField = (ToxAuthorityField) nVal;
else
- bRet = FALSE;
+ bRet = sal_False;
}
else if(pValue[j].Name.equalsAsciiL(SW_PROP_NAME(UNO_NAME_IS_SORT_ASCENDING)))
{
@@ -539,12 +566,22 @@ void SwAuthorityFieldType::Modify( const SfxPoolItem* pOld, const SfxPoolItem *p
NotifyClients( pOld, pNew );
}
+<<<<<<< local
USHORT SwAuthorityFieldType::GetSortKeyCount() const
+=======
+ --------------------------------------------------*/
+sal_uInt16 SwAuthorityFieldType::GetSortKeyCount() const
+>>>>>>> other
{
return m_pSortKeyArr->Count();
}
+<<<<<<< local
const SwTOXSortKey* SwAuthorityFieldType::GetSortKey(USHORT nIdx) const
+=======
+ --------------------------------------------------*/
+const SwTOXSortKey* SwAuthorityFieldType::GetSortKey(sal_uInt16 nIdx) const
+>>>>>>> other
{
SwTOXSortKey* pRet = 0;
if(m_pSortKeyArr->Count() > nIdx)
@@ -553,11 +590,16 @@ const SwTOXSortKey* SwAuthorityFieldType::GetSortKey(USHORT nIdx) const
return pRet;
}
+<<<<<<< local
void SwAuthorityFieldType::SetSortKeys(USHORT nKeyCount, SwTOXSortKey aKeys[])
+=======
+ --------------------------------------------------*/
+void SwAuthorityFieldType::SetSortKeys(sal_uInt16 nKeyCount, SwTOXSortKey aKeys[])
+>>>>>>> other
{
m_pSortKeyArr->DeleteAndDestroy(0, m_pSortKeyArr->Count());
- USHORT nArrIdx = 0;
- for(USHORT i = 0; i < nKeyCount; i++)
+ sal_uInt16 nArrIdx = 0;
+ for(sal_uInt16 i = 0; i < nKeyCount; i++)
if(aKeys[i].eField < AUTH_FIELD_END)
m_pSortKeyArr->Insert(new SwTOXSortKey(aKeys[i]), nArrIdx++);
}
@@ -671,13 +713,18 @@ const char* aFieldNames[] =
"ISBN"
};
+<<<<<<< local
BOOL SwAuthorityField::QueryValue( Any& rAny, USHORT /*nWhichId*/ ) const
+=======
+ ---------------------------------------------------------------------------*/
+sal_Bool SwAuthorityField::QueryValue( Any& rAny, sal_uInt16 /*nWhichId*/ ) const
+>>>>>>> other
{
if(!GetTyp())
- return FALSE;
+ return sal_False;
const SwAuthEntry* pAuthEntry = ((SwAuthorityFieldType*)GetTyp())->GetEntryByHandle(m_nHandle);
if(!pAuthEntry)
- return FALSE;
+ return sal_False;
Sequence <PropertyValue> aRet(AUTH_FIELD_END);
PropertyValue* pValues = aRet.getArray();
for(sal_Int16 i = 0; i < AUTH_FIELD_END; i++)
@@ -690,7 +737,7 @@ BOOL SwAuthorityField::QueryValue( Any& rAny, USHORT /*nWhichId*/ ) const
pValues[i].Value <<= OUString(rField);
}
rAny <<= aRet;
- return FALSE;
+ return sal_False;
}
sal_Int16 lcl_Find(const OUString& rFieldName)
@@ -701,14 +748,14 @@ sal_Int16 lcl_Find(const OUString& rFieldName)
return -1;
}
//----------------------------------------------------------------------------
-BOOL SwAuthorityField::PutValue( const Any& rAny, USHORT /*nWhichId*/ )
+sal_Bool SwAuthorityField::PutValue( const Any& rAny, sal_uInt16 /*nWhichId*/ )
{
if(!GetTyp() || !((SwAuthorityFieldType*)GetTyp())->GetEntryByHandle(m_nHandle))
- return FALSE;
+ return sal_False;
Sequence <PropertyValue> aParam;
if(!(rAny >>= aParam))
- return FALSE;
+ return sal_False;
String sToSet;
sToSet.Fill(AUTH_FIELD_ISBN, TOX_STYLE_DELIMITER);
@@ -734,7 +781,7 @@ BOOL SwAuthorityField::PutValue( const Any& rAny, USHORT /*nWhichId*/ )
((SwAuthorityFieldType*)GetTyp())->RemoveField(m_nHandle);
m_nHandle = ((SwAuthorityFieldType*)GetTyp())->AddField(sToSet);
- return FALSE;
+ return sal_False;
}
SwFieldType* SwAuthorityField::ChgTyp( SwFieldType* pFldTyp )
@@ -745,7 +792,7 @@ SwFieldType* SwAuthorityField::ChgTyp( SwFieldType* pFldTyp )
{
const SwAuthEntry* pEntry = pSrcTyp->GetEntryByHandle( m_nHandle );
- USHORT nHdlPos = pDstTyp->AppendField( *pEntry );
+ sal_uInt16 nHdlPos = pDstTyp->AppendField( *pEntry );
pSrcTyp->RemoveField( m_nHandle );
m_nHandle = pDstTyp->GetHandle( nHdlPos );
pDstTyp->AddField( m_nHandle );
diff --git a/sw/source/core/fields/cellfml.cxx b/sw/source/core/fields/cellfml.cxx
index 888aba6de0f1..efca89a4609d 100644
--- a/sw/source/core/fields/cellfml.cxx
+++ b/sw/source/core/fields/cellfml.cxx
@@ -54,13 +54,13 @@
const sal_Unicode cRelTrenner = ',';
const sal_Unicode cRelKennung = ''; // CTRL-R
-const USHORT cMAXSTACKSIZE = 50;
+const sal_uInt16 cMAXSTACKSIZE = 50;
const SwFrm* lcl_GetBoxFrm( const SwTableBox& rBox );
long lcl_GetLongBoxNum( String& rStr );
const SwTableBox* lcl_RelToBox( const SwTable&, const SwTableBox*, const String& );
String lcl_BoxNmToRel( const SwTable&, const SwTableNode&,
- const String& , const String& , BOOL );
+ const String& , const String& , sal_Bool );
/*************************************************************************
@@ -110,7 +110,7 @@ double SwTableBox::GetValue( SwTblCalcPara& rCalcPara ) const
const SfxPoolItem* pItem;
if( SFX_ITEM_SET == GetFrmFmt()->GetItemState(
- RES_BOXATR_FORMULA, FALSE, &pItem ) )
+ RES_BOXATR_FORMULA, sal_False, &pItem ) )
{
rCalcPara.rCalc.SetCalcError( CALC_NOERR ); // wieder zuruecksetzen
if( !((SwTblBoxFormula*)pItem)->IsValid() )
@@ -137,7 +137,7 @@ double SwTableBox::GetValue( SwTblCalcPara& rCalcPara ) const
break;
}
else if( SFX_ITEM_SET == pBox->GetFrmFmt()->GetItemState(
- RES_BOXATR_VALUE, FALSE, &pItem ) )
+ RES_BOXATR_VALUE, sal_False, &pItem ) )
{
rCalcPara.rCalc.SetCalcError( CALC_NOERR ); // wieder zuruecksetzen
nRet = ((SwTblBoxValue*)pItem)->GetValue();
@@ -235,7 +235,7 @@ double SwTableBox::GetValue( SwTblCalcPara& rCalcPara ) const
}
// ?? sonst ist das ein Fehler
- } while( FALSE );
+ } while( sal_False );
if( !rCalcPara.IsStackOverFlow() )
{
@@ -266,15 +266,15 @@ SwTblCalcPara::~SwTblCalcPara()
delete pBoxStk;
}
-BOOL SwTblCalcPara::CalcWithStackOverflow()
+sal_Bool SwTblCalcPara::CalcWithStackOverflow()
{
// falls ein StackUeberlauf erkannt wurde, sollte mit
// der letzten Box noch mal aufgesetzt werden. Irgend
// ein Weg sollte dann
- USHORT nSaveMaxSize = nMaxSize;
+ sal_uInt16 nSaveMaxSize = nMaxSize;
nMaxSize = cMAXSTACKSIZE - 5;
- USHORT nCnt = 0;
+ sal_uInt16 nCnt = 0;
SwTableBoxes aStackOverFlows;
do {
SwTableBox* pBox = (SwTableBox*)pLastTblBox;
@@ -291,7 +291,7 @@ BOOL SwTblCalcPara::CalcWithStackOverflow()
// falls Rekursionen erkannt wurden
nStackCnt = 0;
rCalc.SetCalcError( CALC_NOERR );
- pBoxStk->Remove( USHORT(0), pBoxStk->Count() );
+ pBoxStk->Remove( sal_uInt16(0), pBoxStk->Count() );
while( !rCalc.IsCalcError() && nCnt )
{
@@ -311,7 +311,7 @@ SwTableFormula::SwTableFormula( const String& rFormel )
: sFormel( rFormel )
{
eNmType = EXTRNL_NAME;
- bValidValue = FALSE;
+ bValidValue = sal_False;
}
SwTableFormula::~SwTableFormula()
@@ -353,7 +353,7 @@ void SwTableFormula::_MakeFormel( const SwTable& rTbl, String& rNewStr,
rNewStr += '(';
bool bDelim = false;
- for( USHORT n = 0; n < aBoxes.Count() &&
+ for( sal_uInt16 n = 0; n < aBoxes.Count() &&
!pCalcPara->rCalc.IsCalcError(); ++n )
{
const SwTableBox* pTblBox = aBoxes[n];
@@ -363,7 +363,7 @@ void SwTableFormula::_MakeFormel( const SwTable& rTbl, String& rNewStr,
rNewStr += cListDelim;
bDelim = true;
rNewStr += pCalcPara->rCalc.GetStrResult(
- pTblBox->GetValue( *pCalcPara ), FALSE );
+ pTblBox->GetValue( *pCalcPara ), sal_False );
}
}
rNewStr += ')';
@@ -375,7 +375,7 @@ void SwTableFormula::_MakeFormel( const SwTable& rTbl, String& rNewStr,
if ( pSttBox->getRowSpan() >= 1 )
{
rNewStr += pCalcPara->rCalc.GetStrResult(
- pSttBox->GetValue( *pCalcPara ), FALSE );
+ pSttBox->GetValue( *pCalcPara ), sal_False );
}
}
else
@@ -611,7 +611,7 @@ String SwTableFormula::ScanString( FnScanFormel fnFormel, const SwTable& rTbl,
void* pPara ) const
{
String aStr;
- USHORT nFml = 0, nStt = 0, nEnd = 0, nTrenner;
+ sal_uInt16 nFml = 0, nStt = 0, nEnd = 0, nTrenner;
do {
// falls der Formel ein Name vorangestellt ist, diese Tabelle
@@ -691,7 +691,7 @@ String SwTableFormula::ScanString( FnScanFormel fnFormel, const SwTable& rTbl,
}
nFml = nEnd+1;
- } while( TRUE );
+ } while( sal_True );
return aStr;
}
@@ -699,7 +699,7 @@ const SwTable* SwTableFormula::FindTable( SwDoc& rDoc, const String& rNm ) const
{
const SwFrmFmts& rTblFmts = *rDoc.GetTblFrmFmts();
const SwTable* pTmpTbl, *pRet = 0;
- for( USHORT nFmtCnt = rTblFmts.Count(); nFmtCnt; )
+ for( sal_uInt16 nFmtCnt = rTblFmts.Count(); nFmtCnt; )
{
SwFrmFmt* pFmt = rTblFmts[ --nFmtCnt ];
// falls wir von Sw3Writer gerufen werden, dann ist dem
@@ -724,16 +724,37 @@ const SwTable* SwTableFormula::FindTable( SwDoc& rDoc, const String& rNm ) const
const SwFrm* lcl_GetBoxFrm( const SwTableBox& rBox )
{
+<<<<<<< local
+=======
+/*
+
+ // 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() <
+ }
+*/
+
+>>>>>>> other
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 !!
+<<<<<<< local
return pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &aPt, NULL, FALSE );
+=======
+ return pCNd->GetFrm( &aPt, NULL, sal_False );
+>>>>>>> other
}
long lcl_GetLongBoxNum( String& rStr )
{
- USHORT nPos;
+ sal_uInt16 nPos;
long nRet;
if( STRING_NOTFOUND == ( nPos = rStr.Search( cRelTrenner ) ))
{
@@ -776,8 +797,8 @@ const SwTableBox* lcl_RelToBox( const SwTable& rTbl,
pBox = pLine->GetUpper();
pLine = pBox->GetUpper();
}
- USHORT nSttBox = pLine->GetTabBoxes().GetPos( pBox );
- USHORT nSttLine = rTbl.GetTabLines().GetPos( pLine );
+ sal_uInt16 nSttBox = pLine->GetTabBoxes().GetPos( pBox );
+ sal_uInt16 nSttLine = rTbl.GetTabLines().GetPos( pLine );
long nBoxOffset = lcl_GetLongBoxNum( sGetName ) + nSttBox;
long nLineOffset = lcl_GetLongBoxNum( sGetName ) + nSttLine;
@@ -789,13 +810,13 @@ const SwTableBox* lcl_RelToBox( const SwTable& rTbl,
if( nLineOffset >= long(pLines->Count()) )
return 0;
- pLine = (*pLines)[ USHORT(nLineOffset) ];
+ pLine = (*pLines)[ sal_uInt16(nLineOffset) ];
// dann suche die Box
pBoxes = &pLine->GetTabBoxes();
if( nBoxOffset >= long(pBoxes->Count()) )
return 0;
- pBox = (*pBoxes)[ USHORT(nBoxOffset) ];
+ pBox = (*pBoxes)[ sal_uInt16(nBoxOffset) ];
while( sGetName.Len() )
{
@@ -836,7 +857,7 @@ const SwTableBox* lcl_RelToBox( const SwTable& rTbl,
String lcl_BoxNmToRel( const SwTable& rTbl, const SwTableNode& rTblNd,
const String& rRefBoxNm, const String& rGetStr,
- BOOL bExtrnlNm )
+ sal_Bool bExtrnlNm )
{
String sCpy( rRefBoxNm );
String sTmp( rGetStr );
@@ -853,8 +874,8 @@ String lcl_BoxNmToRel( const SwTable& rTbl, const SwTableNode& rTblNd,
// die externe Darstellung bei:
if( &rTbl == &rTblNd.GetTable() )
{
- long nBox = SwTable::_GetBoxNum( sTmp, TRUE );
- nBox -= SwTable::_GetBoxNum( sCpy, TRUE );
+ long nBox = SwTable::_GetBoxNum( sTmp, sal_True );
+ nBox -= SwTable::_GetBoxNum( sCpy, sal_True );
long nLine = SwTable::_GetBoxNum( sTmp );
nLine -= SwTable::_GetBoxNum( sCpy );
@@ -878,11 +899,11 @@ String lcl_BoxNmToRel( const SwTable& rTbl, const SwTableNode& rTblNd,
return sTmp;
}
-USHORT SwTableFormula::GetBoxesOfFormula( const SwTable& rTbl,
+sal_uInt16 SwTableFormula::GetBoxesOfFormula( const SwTable& rTbl,
SwSelBoxes& rBoxes )
{
if( rBoxes.Count() )
- rBoxes.Remove( USHORT(0), rBoxes.Count() );
+ rBoxes.Remove( sal_uInt16(0), rBoxes.Count() );
BoxNmToPtr( &rTbl );
ScanString( &SwTableFormula::_GetFmlBoxes, rTbl, &rBoxes );
@@ -966,7 +987,7 @@ void SwTableFormula::GetBoxes( const SwTableBox& rSttBox,
break;
// dann mal die Tabellenkoepfe raus:
- for( USHORT n = 0; n < rBoxes.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rBoxes.Count(); ++n )
{
pLine = rBoxes[n]->GetUpper();
while( pLine->GetUpper() )
@@ -975,7 +996,7 @@ void SwTableFormula::GetBoxes( const SwTableBox& rSttBox,
if( pTbl->IsHeadline( *pLine ) )
rBoxes.Remove( n--, 1 );
}
- } while( FALSE );
+ } while( sal_False );
}
}
@@ -983,7 +1004,7 @@ void SwTableFormula::GetBoxes( const SwTableBox& rSttBox,
void SwTableFormula::_HasValidBoxes( const SwTable& rTbl, String& ,
String& rFirstBox, String* pLastBox, void* pPara ) const
{
- BOOL* pBValid = (BOOL*)pPara;
+ sal_Bool* pBValid = (sal_Bool*)pPara;
if( *pBValid ) // einmal falsch, immer falsch
{
SwTableBox* pSttBox = 0, *pEndBox = 0;
@@ -1024,13 +1045,13 @@ void SwTableFormula::_HasValidBoxes( const SwTable& rTbl, String& ,
if( ( pLastBox &&
( !pEndBox || !rTbl.GetTabSortBoxes().Seek_Entry( pEndBox ) ) ) ||
( !pSttBox || !rTbl.GetTabSortBoxes().Seek_Entry( pSttBox ) ) )
- *pBValid = FALSE;
+ *pBValid = sal_False;
}
}
-BOOL SwTableFormula::HasValidBoxes() const
+sal_Bool SwTableFormula::HasValidBoxes() const
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
const SwNode* pNd = GetNodeOfFormula();
if( pNd && 0 != ( pNd = pNd->FindTableNode() ) )
ScanString( &SwTableFormula::_HasValidBoxes,
@@ -1039,9 +1060,9 @@ BOOL SwTableFormula::HasValidBoxes() const
}
-USHORT SwTableFormula::GetLnPosInTbl( const SwTable& rTbl, const SwTableBox* pBox )
+sal_uInt16 SwTableFormula::GetLnPosInTbl( const SwTable& rTbl, const SwTableBox* pBox )
{
- USHORT nRet = USHRT_MAX;
+ sal_uInt16 nRet = USHRT_MAX;
if( pBox )
{
const SwTableLine* pLn = pBox->GetUpper();
@@ -1065,8 +1086,8 @@ void SwTableFormula::_SplitMergeBoxNm( const SwTable& rTbl, String& rNewStr,
String* pTblNmBox = pLastBox ? pLastBox : &rFirstBox;
- USHORT nLastBoxLen = pTblNmBox->Len();
- USHORT nTrenner = pTblNmBox->Search( '.' );
+ sal_uInt16 nLastBoxLen = pTblNmBox->Len();
+ sal_uInt16 nTrenner = pTblNmBox->Search( '.' );
if( STRING_NOTFOUND != nTrenner &&
// falls im Namen schon die Punkte enthalten sind,
// treten diese immer paarig auf!!! (A1.1.1 !!)
@@ -1087,13 +1108,13 @@ void SwTableFormula::_SplitMergeBoxNm( const SwTable& rTbl, String& rNewStr,
if( rTblUpd.pTbl != &rTbl ) // es ist nicht die akt.
(rNewStr += rTblUpd.pTbl->GetFrmFmt()->GetName() )
+= '.'; // den neuen Tabellen Namen setzen
- rTblUpd.bModified = TRUE;
+ rTblUpd.bModified = sal_True;
}
else if( pFnd != rTblUpd.pTbl ||
( rTblUpd.pTbl != &rTbl && &rTbl != rTblUpd.DATA.pDelTbl))
(rNewStr += sTblNm ) += '.'; // den Tabellen Namen behalten
else
- rTblUpd.bModified = TRUE;
+ rTblUpd.bModified = sal_True;
}
else
(rNewStr += sTblNm ) += '.'; // den Tabellen Namen behalten
@@ -1138,12 +1159,12 @@ void SwTableFormula::_SplitMergeBoxNm( const SwTable& rTbl, String& rNewStr,
if( TBL_SPLITTBL == rTblUpd.eFlags )
{
// wo liegen die Boxen, in der "alten" oder in der neuen Tabelle?
- BOOL bInNewTbl = FALSE;
+ sal_Bool bInNewTbl = sal_False;
if( pLastBox )
{
// das ist die "erste" Box in der Selektion. Die bestimmt ob die
// Formel in der alten oder neuen Tabelle steht.
- USHORT nEndLnPos = SwTableFormula::GetLnPosInTbl( *pTbl, pEndBox ),
+ sal_uInt16 nEndLnPos = SwTableFormula::GetLnPosInTbl( *pTbl, pEndBox ),
nSttLnPos = SwTableFormula::GetLnPosInTbl( *pTbl, pSttBox );
if( USHRT_MAX != nSttLnPos && USHRT_MAX != nEndLnPos &&
@@ -1158,7 +1179,7 @@ void SwTableFormula::_SplitMergeBoxNm( const SwTable& rTbl, String& rNewStr,
{
// das ist aufjedenfall eine ungueltige Formel, also fuers
// Undo auf Modified setzen
- rTblUpd.bModified = TRUE;
+ rTblUpd.bModified = sal_True;
if( pEndBox )
bInNewTbl = USHRT_MAX != nEndLnPos &&
rTblUpd.nSplitLine <= nEndLnPos &&
@@ -1167,7 +1188,7 @@ void SwTableFormula::_SplitMergeBoxNm( const SwTable& rTbl, String& rNewStr,
}
else
{
- USHORT nSttLnPos = SwTableFormula::GetLnPosInTbl( *pTbl, pSttBox );
+ sal_uInt16 nSttLnPos = SwTableFormula::GetLnPosInTbl( *pTbl, pSttBox );
// dann landet das Teil in der neuen Tabelle?
bInNewTbl = USHRT_MAX != nSttLnPos &&
rTblUpd.nSplitLine <= nSttLnPos &&
@@ -1179,7 +1200,7 @@ void SwTableFormula::_SplitMergeBoxNm( const SwTable& rTbl, String& rNewStr,
{
if( !bInNewTbl )
{
- rTblUpd.bModified = TRUE;
+ rTblUpd.bModified = sal_True;
( rNewStr += rTblUpd.pTbl->GetFrmFmt()->GetName() ) += '.';
}
else if( sTblNm.Len() )
@@ -1187,7 +1208,7 @@ void SwTableFormula::_SplitMergeBoxNm( const SwTable& rTbl, String& rNewStr,
}
else if( bInNewTbl )
{
- rTblUpd.bModified = TRUE;
+ rTblUpd.bModified = sal_True;
( rNewStr += *rTblUpd.DATA.pNewTblNm ) += '.';
}
else if( sTblNm.Len() )
diff --git a/sw/source/core/fields/chpfld.cxx b/sw/source/core/fields/chpfld.cxx
index bfc14af1a7aa..837ae47d9174 100644
--- a/sw/source/core/fields/chpfld.cxx
+++ b/sw/source/core/fields/chpfld.cxx
@@ -152,17 +152,17 @@ void SwChapterField::ChangeExpansion(const SwTxtNode &rTxtNd, sal_Bool bSrchNum)
do {
if( pONd && pONd->GetTxtColl() )
{
- BYTE nPrevLvl = nLevel;
+ sal_uInt8 nPrevLvl = nLevel;
// --> OD 2008-04-02 #refactorlists#
// nLevel = GetRealLevel( pONd->GetTxtColl()->
// GetOutlineLevel() );
//ASSERT( pONd->GetOutlineLevel() >= 0 && pONd->GetOutlineLevel() < MAXLEVEL, //#outline level,zhaojianwei
// "<SwChapterField::ChangeExpansion(..)> - outline node with inconsistent outline level. Serious defect -> please inform OD." );
- //nLevel = static_cast<BYTE>(pONd->GetOutlineLevel());
+ //nLevel = static_cast<sal_uInt8>(pONd->GetOutlineLevel());
ASSERT( pONd->GetAttrOutlineLevel() >= 0 && pONd->GetAttrOutlineLevel() <= MAXLEVEL,
"<SwChapterField::ChangeExpansion(..)> - outline node with inconsistent outline level. Serious defect -> please inform OD." );
- nLevel = static_cast<BYTE>(pONd->GetAttrOutlineLevel()); //<-end,zhaojianwei
+ nLevel = static_cast<sal_uInt8>(pONd->GetAttrOutlineLevel()); //<-end,zhaojianwei
// <--
if( nPrevLvl < nLevel )
@@ -197,7 +197,7 @@ void SwChapterField::ChangeExpansion(const SwTxtNode &rTxtNd, sal_Bool bSrchNum)
SwNumRule* pRule( pTxtNd->GetNumRule() );
if ( pTxtNd->IsCountedInList() && pRule )
{
- const SwNumFmt& rNFmt = pRule->Get( static_cast<USHORT>(pTxtNd->GetActualListLevel()) );
+ const SwNumFmt& rNFmt = pRule->Get( static_cast<sal_uInt16>(pTxtNd->GetActualListLevel()) );
sPost = rNFmt.GetSuffix();
sPre = rNFmt.GetPrefix();
}
@@ -229,7 +229,7 @@ void SwChapterField::ChangeExpansion(const SwTxtNode &rTxtNd, sal_Bool bSrchNum)
/*-----------------05.03.98 16:19-------------------
--------------------------------------------------*/
-BOOL SwChapterField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
+sal_Bool SwChapterField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
{
@@ -265,9 +265,9 @@ BOOL SwChapterField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
/*-----------------05.03.98 16:19-------------------
--------------------------------------------------*/
-BOOL SwChapterField::PutValue( const uno::Any& rAny, USHORT nWhichId )
+sal_Bool SwChapterField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
switch( nWhichId )
{
case FIELD_PROP_BYTE1:
@@ -277,7 +277,7 @@ BOOL SwChapterField::PutValue( const uno::Any& rAny, USHORT nWhichId )
if(nTmp >= 0 && nTmp < MAXLEVEL)
nLevel = nTmp;
else
- bRet = FALSE;
+ bRet = sal_False;
break;
}
@@ -303,7 +303,7 @@ BOOL SwChapterField::PutValue( const uno::Any& rAny, USHORT nWhichId )
default:
DBG_ERROR("illegal property");
- bRet = FALSE;
+ bRet = sal_False;
}
return bRet;
}
diff --git a/sw/source/core/fields/dbfld.cxx b/sw/source/core/fields/dbfld.cxx
index 9a26fff02c02..faddd9a1b8b4 100644
--- a/sw/source/core/fields/dbfld.cxx
+++ b/sw/source/core/fields/dbfld.cxx
@@ -62,7 +62,7 @@ String lcl_DBTrennConv(const String& aContent)
{
String sTmp(aContent);
sal_Unicode* pStr = sTmp.GetBufferAccess();
- for( USHORT i = sTmp.Len(); i; --i, ++pStr )
+ for( sal_uInt16 i = sTmp.Len(); i; --i, ++pStr )
if( DB_DELIM == *pStr )
*pStr = '.';
return sTmp;
@@ -113,7 +113,7 @@ void SwDBFieldType::ReleaseRef()
if (--nRefCnt <= 0)
{
- USHORT nPos = GetDoc()->GetFldTypes()->GetPos(this);
+ sal_uInt16 nPos = GetDoc()->GetFldTypes()->GetPos(this);
if (nPos != USHRT_MAX)
{
@@ -123,7 +123,14 @@ void SwDBFieldType::ReleaseRef()
}
}
+<<<<<<< local
BOOL SwDBFieldType::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
+=======
+/* -----------------24.02.99 14:51-------------------
+ *
+ * --------------------------------------------------*/
+sal_Bool SwDBFieldType::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+>>>>>>> other
{
switch( nWhichId )
{
@@ -142,10 +149,17 @@ BOOL SwDBFieldType::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
default:
DBG_ERROR("illegal property");
}
- return TRUE;
+ return sal_True;
}
+<<<<<<< local
BOOL SwDBFieldType::PutValue( const uno::Any& rAny, USHORT nWhichId )
+=======
+/* -----------------24.02.99 14:51-------------------
+ *
+ * --------------------------------------------------*/
+sal_Bool SwDBFieldType::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+>>>>>>> other
{
switch( nWhichId )
{
@@ -185,18 +199,18 @@ BOOL SwDBFieldType::PutValue( const uno::Any& rAny, USHORT nWhichId )
default:
DBG_ERROR("illegal property");
}
- return TRUE;
+ return sal_True;
}
/*--------------------------------------------------------------------
Beschreibung: SwDBField
--------------------------------------------------------------------*/
-SwDBField::SwDBField(SwDBFieldType* pTyp, ULONG nFmt)
+SwDBField::SwDBField(SwDBFieldType* pTyp, sal_uLong nFmt)
: SwValueField(pTyp, nFmt),
nSubType(0),
- bIsInBodyTxt(TRUE),
- bValidValue(FALSE),
- bInitialized(FALSE)
+ bIsInBodyTxt(sal_True),
+ bValidValue(sal_False),
+ bInitialized(sal_False)
{
if (GetTyp())
((SwDBFieldType*)GetTyp())->AddRef();
@@ -292,7 +306,7 @@ String SwDBField::GetFieldName() const
//------------------------------------------------------------------------------
-void SwDBField::ChgValue( double d, BOOL bVal )
+void SwDBField::ChgValue( double d, sal_Bool bVal )
{
bValidValue = bVal;
SetValue(d);
@@ -324,7 +338,7 @@ void SwDBField::Evaluate()
SwNewDBMgr* pMgr = GetDoc()->GetNewDBMgr();
// erstmal loeschen
- bValidValue = FALSE;
+ bValidValue = sal_False;
double nValue = DBL_MAX;
const SwDBData& aTmpData = GetDBData();
@@ -353,7 +367,7 @@ void SwDBField::Evaluate()
if (*pDocFormatter->GetNullDate() != aStandard)
nValue += (aStandard - *pDocFormatter->GetNullDate());
}
- bValidValue = TRUE;
+ bValidValue = sal_True;
SetValue(nValue);
aContent = ((SwValueFieldType*)GetTyp())->ExpandValue(nValue, GetFormat(), GetLanguage());
}
@@ -368,15 +382,15 @@ void SwDBField::Evaluate()
SvNumberFormatter* pFormatter = GetDoc()->GetNumberFormatter();
if (nFmt && nFmt != SAL_MAX_UINT32 && !pFormatter->IsTextFormat(nFmt))
- bValidValue = TRUE; // Wegen Bug #60339 nicht mehr bei allen Strings
+ bValidValue = sal_True; // Wegen Bug #60339 nicht mehr bei allen Strings
}
else
{
- // Bei Strings TRUE wenn Laenge > 0 sonst FALSE
+ // Bei Strings sal_True wenn Laenge > 0 sonst sal_False
SetValue(aContent.Len() ? 1 : 0);
}
}
- bInitialized = TRUE;
+ bInitialized = sal_True;
}
/*--------------------------------------------------------------------
@@ -392,7 +406,7 @@ const String& SwDBField::GetPar1() const
Beschreibung:
--------------------------------------------------------------------*/
-USHORT SwDBField::GetSubType() const
+sal_uInt16 SwDBField::GetSubType() const
{
return nSubType;
}
@@ -401,19 +415,24 @@ USHORT SwDBField::GetSubType() const
Beschreibung:
--------------------------------------------------------------------*/
-void SwDBField::SetSubType(USHORT nType)
+void SwDBField::SetSubType(sal_uInt16 nType)
{
nSubType = nType;
}
+<<<<<<< local
BOOL SwDBField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
+=======
+--------------------------------------------------*/
+sal_Bool SwDBField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+>>>>>>> other
{
switch( nWhichId )
{
case FIELD_PROP_BOOL1:
{
- BOOL bTemp = 0 == (GetSubType()&nsSwExtendedSubType::SUB_OWN_FMT);
+ sal_Bool bTemp = 0 == (GetSubType()&nsSwExtendedSubType::SUB_OWN_FMT);
rAny.setValue(&bTemp, ::getBooleanCppuType());
}
break;
@@ -435,11 +454,16 @@ BOOL SwDBField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
default:
DBG_ERROR("illegal property");
}
- return TRUE;
+ return sal_True;
}
+<<<<<<< local
BOOL SwDBField::PutValue( const uno::Any& rAny, USHORT nWhichId )
+=======
+--------------------------------------------------*/
+sal_Bool SwDBField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+>>>>>>> other
{
switch( nWhichId )
{
@@ -451,10 +475,10 @@ BOOL SwDBField::PutValue( const uno::Any& rAny, USHORT nWhichId )
break;
case FIELD_PROP_BOOL2:
{
- USHORT nSubTyp = GetSubType();
+ sal_uInt16 nSubTyp = GetSubType();
sal_Bool bVisible = sal_False;
if(!(rAny >>= bVisible))
- return FALSE;
+ return sal_False;
if(bVisible)
nSubTyp &= ~nsSwExtendedSubType::SUB_INVISIBLE;
else
@@ -495,14 +519,14 @@ BOOL SwDBField::PutValue( const uno::Any& rAny, USHORT nWhichId )
default:
DBG_ERROR("illegal property");
}
- return TRUE;
+ return sal_True;
}
/*--------------------------------------------------------------------
Beschreibung: Basisklasse fuer alle weiteren Datenbankfelder
--------------------------------------------------------------------*/
-SwDBNameInfField::SwDBNameInfField(SwFieldType* pTyp, const SwDBData& rDBData, ULONG nFmt) :
+SwDBNameInfField::SwDBNameInfField(SwFieldType* pTyp, const SwDBData& rDBData, sal_uLong nFmt) :
SwField(pTyp, nFmt),
aDBData(rDBData),
nSubType(0)
@@ -542,7 +566,14 @@ String SwDBNameInfField::GetFieldName() const
return lcl_DBTrennConv(sStr);
}
+<<<<<<< local
BOOL SwDBNameInfField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
+=======
+/*-----------------06.03.98 16:55-------------------
+
+--------------------------------------------------*/
+sal_Bool SwDBNameInfField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+>>>>>>> other
{
switch( nWhichId )
{
@@ -564,10 +595,15 @@ BOOL SwDBNameInfField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
default:
DBG_ERROR("illegal property");
}
- return TRUE;
+ return sal_True;
}
+<<<<<<< local
BOOL SwDBNameInfField::PutValue( const uno::Any& rAny, USHORT nWhichId )
+=======
+--------------------------------------------------*/
+sal_Bool SwDBNameInfField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+>>>>>>> other
{
switch( nWhichId )
{
@@ -582,10 +618,10 @@ BOOL SwDBNameInfField::PutValue( const uno::Any& rAny, USHORT nWhichId )
break;
case FIELD_PROP_BOOL2:
{
- USHORT nSubTyp = GetSubType();
+ sal_uInt16 nSubTyp = GetSubType();
sal_Bool bVisible = sal_False;
if(!(rAny >>= bVisible))
- return FALSE;
+ return sal_False;
if(bVisible)
nSubTyp &= ~nsSwExtendedSubType::SUB_INVISIBLE;
else
@@ -596,15 +632,25 @@ BOOL SwDBNameInfField::PutValue( const uno::Any& rAny, USHORT nWhichId )
default:
DBG_ERROR("illegal property");
}
- return TRUE;
+ return sal_True;
}
+<<<<<<< local
USHORT SwDBNameInfField::GetSubType() const
+=======
+ --------------------------------------------------*/
+sal_uInt16 SwDBNameInfField::GetSubType() const
+>>>>>>> other
{
return nSubType;
}
+<<<<<<< local
void SwDBNameInfField::SetSubType(USHORT nType)
+=======
+ --------------------------------------------------*/
+void SwDBNameInfField::SetSubType(sal_uInt16 nType)
+>>>>>>> other
{
nSubType = nType;
}
@@ -633,7 +679,7 @@ SwDBNextSetField::SwDBNextSetField(SwDBNextSetFieldType* pTyp,
const String& rCond,
const String& ,
const SwDBData& rDBData) :
- SwDBNameInfField(pTyp, rDBData), aCond(rCond), bCondValid(TRUE)
+ SwDBNameInfField(pTyp, rDBData), aCond(rCond), bCondValid(sal_True)
{}
//------------------------------------------------------------------------------
@@ -679,9 +725,14 @@ void SwDBNextSetField::SetPar1(const String& rStr)
aCond = rStr;
}
+<<<<<<< local
BOOL SwDBNextSetField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
+=======
+--------------------------------------------------*/
+sal_Bool SwDBNextSetField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+>>>>>>> other
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
switch( nWhichId )
{
case FIELD_PROP_PAR3:
@@ -693,9 +744,14 @@ BOOL SwDBNextSetField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
return bRet;
}
+<<<<<<< local
BOOL SwDBNextSetField::PutValue( const uno::Any& rAny, USHORT nWhichId )
+=======
+--------------------------------------------------*/
+sal_Bool SwDBNextSetField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+>>>>>>> other
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
switch( nWhichId )
{
case FIELD_PROP_PAR3:
@@ -735,7 +791,7 @@ SwDBNumSetField::SwDBNumSetField(SwDBNumSetFieldType* pTyp,
SwDBNameInfField(pTyp, rDBData),
aCond(rCond),
aPar2(rDBNum),
- bCondValid(TRUE)
+ bCondValid(sal_True)
{}
//------------------------------------------------------------------------------
@@ -764,7 +820,7 @@ void SwDBNumSetField::Evaluate(SwDoc* pDoc)
if( bCondValid && pMgr && pMgr->IsInMerge() &&
pMgr->IsDataSourceOpen(aTmpData.sDataSource, aTmpData.sCommand, sal_True))
{ // Bedingug OK -> aktuellen Set einstellen
- pMgr->ToRecordId(Max((USHORT)aPar2.ToInt32(), USHORT(1))-1);
+ pMgr->ToRecordId(Max((sal_uInt16)aPar2.ToInt32(), sal_uInt16(1))-1);
}
}
@@ -796,9 +852,14 @@ void SwDBNumSetField::SetPar2(const String& rStr)
aPar2 = rStr;
}
+<<<<<<< local
BOOL SwDBNumSetField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
+=======
+--------------------------------------------------*/
+sal_Bool SwDBNumSetField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+>>>>>>> other
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
switch( nWhichId )
{
case FIELD_PROP_PAR3:
@@ -813,9 +874,14 @@ BOOL SwDBNumSetField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
return bRet;
}
+<<<<<<< local
BOOL SwDBNumSetField::PutValue( const uno::Any& rAny, USHORT nWhichId )
+=======
+--------------------------------------------------*/
+sal_Bool SwDBNumSetField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+>>>>>>> other
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
switch( nWhichId )
{
case FIELD_PROP_PAR3:
@@ -845,7 +911,7 @@ SwDBNameFieldType::SwDBNameFieldType(SwDoc* pDocument)
}
//------------------------------------------------------------------------------
-String SwDBNameFieldType::Expand(ULONG ) const
+String SwDBNameFieldType::Expand(sal_uLong ) const
{
const SwDBData aData = pDoc->GetDBData();
String sRet(aData.sDataSource);
@@ -867,7 +933,7 @@ SwFieldType* SwDBNameFieldType::Copy() const
Beschreibung: Name der angedockten DB
--------------------------------------------------------------------*/
-SwDBNameField::SwDBNameField(SwDBNameFieldType* pTyp, const SwDBData& rDBData, ULONG nFmt)
+SwDBNameField::SwDBNameField(SwDBNameFieldType* pTyp, const SwDBData& rDBData, sal_uLong nFmt)
: SwDBNameInfField(pTyp, rDBData, nFmt)
{}
@@ -893,12 +959,22 @@ SwField* SwDBNameField::Copy() const
}
+<<<<<<< local
BOOL SwDBNameField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
+=======
+--------------------------------------------------*/
+sal_Bool SwDBNameField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+>>>>>>> other
{
return SwDBNameInfField::QueryValue(rAny, nWhichId );
}
+<<<<<<< local
BOOL SwDBNameField::PutValue( const uno::Any& rAny, USHORT nWhichId )
+=======
+--------------------------------------------------*/
+sal_Bool SwDBNameField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+>>>>>>> other
{
return SwDBNameInfField::PutValue(rAny, nWhichId );
}
@@ -927,7 +1003,7 @@ SwFieldType* SwDBSetNumberFieldType::Copy() const
SwDBSetNumberField::SwDBSetNumberField(SwDBSetNumberFieldType* pTyp,
const SwDBData& rDBData,
- ULONG nFmt)
+ sal_uLong nFmt)
: SwDBNameInfField(pTyp, rDBData, nFmt), nNumber(0)
{}
@@ -938,7 +1014,12 @@ String SwDBSetNumberField::Expand() const
if(0 !=(GetSubType() & nsSwExtendedSubType::SUB_INVISIBLE) || nNumber == 0)
return aEmptyStr;
else
+<<<<<<< local
return FormatNumber((USHORT)nNumber, GetFormat());
+=======
+ return FormatNumber((sal_uInt16)nNumber, GetFormat());
+ //return(nNumber == 0 ? aEmptyStr : FormatNumber(nNumber, GetFormat()));
+>>>>>>> other
}
//------------------------------------------------------------------------------
@@ -967,9 +1048,14 @@ SwField* SwDBSetNumberField::Copy() const
return pTmp;
}
+<<<<<<< local
BOOL SwDBSetNumberField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
+=======
+--------------------------------------------------*/
+sal_Bool SwDBSetNumberField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+>>>>>>> other
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
switch( nWhichId )
{
case FIELD_PROP_USHORT1:
@@ -984,16 +1070,21 @@ BOOL SwDBSetNumberField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
return bRet;
}
+<<<<<<< local
BOOL SwDBSetNumberField::PutValue( const uno::Any& rAny, USHORT nWhichId )
+=======
+--------------------------------------------------*/
+sal_Bool SwDBSetNumberField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+>>>>>>> other
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
switch( nWhichId )
{
case FIELD_PROP_USHORT1:
{
sal_Int16 nSet = 0;
rAny >>= nSet;
- if(nSet < (INT16) SVX_NUMBER_NONE )
+ if(nSet < (sal_Int16) SVX_NUMBER_NONE )
SetFormat(nSet);
else {
//exception(wrong_value)
diff --git a/sw/source/core/fields/ddefld.cxx b/sw/source/core/fields/ddefld.cxx
index c4473b8510bc..af709c5e9450 100644
--- a/sw/source/core/fields/ddefld.cxx
+++ b/sw/source/core/fields/ddefld.cxx
@@ -56,7 +56,7 @@ class SwIntrnlRefLink : public SwBaseLink
{
SwDDEFieldType& rFldType;
public:
- SwIntrnlRefLink( SwDDEFieldType& rType, USHORT nUpdateType, USHORT nFmt )
+ SwIntrnlRefLink( SwDDEFieldType& rType, sal_uInt16 nUpdateType, sal_uInt16 nFmt )
: SwBaseLink( nUpdateType, nFmt ),
rFldType( rType )
{}
@@ -66,7 +66,7 @@ public:
const uno::Any & rValue );
virtual const SwNode* GetAnchor() const;
- virtual BOOL IsInRange( ULONG nSttNd, ULONG nEndNd, xub_StrLen nStt = 0,
+ virtual sal_Bool IsInRange( sal_uLong nSttNd, sal_uLong nEndNd, xub_StrLen nStt = 0,
xub_StrLen nEnd = STRING_NOTFOUND ) const;
};
@@ -93,7 +93,7 @@ void SwIntrnlRefLink::DataChanged( const String& rMimeType,
if( n && 0x0d == sStr.GetChar( n-1 ) )
--n;
- BOOL bDel = n != sStr.Len();
+ sal_Bool bDel = n != sStr.Len();
if( bDel )
sStr.Erase( n );
@@ -119,7 +119,7 @@ void SwIntrnlRefLink::DataChanged( const String& rMimeType,
// dann suchen wir uns mal alle Felder. Wird kein gueltiges
// gefunden, dann Disconnecten wir uns!
SwMsgPoolItem aUpdateDDE( RES_UPDATEDDETBL );
- int bCallModify = FALSE;
+ int bCallModify = sal_False;
rFldType.LockModify();
SwClientIter aIter( rFldType ); // TODO
@@ -137,8 +137,13 @@ void SwIntrnlRefLink::DataChanged( const String& rMimeType,
else if( pSh )
pSh->StartAction();
}
+<<<<<<< local
pLast->ModifyNotification( 0, &aUpdateDDE );
bCallModify = TRUE;
+=======
+ pLast->Modify( 0, &aUpdateDDE );
+ bCallModify = sal_True;
+>>>>>>> other
}
} while( 0 != ( pLast = aIter++ ));
@@ -206,7 +211,7 @@ const SwNode* SwIntrnlRefLink::GetAnchor() const
return pNd;
}
-BOOL SwIntrnlRefLink::IsInRange( ULONG nSttNd, ULONG nEndNd,
+sal_Bool SwIntrnlRefLink::IsInRange( sal_uLong nSttNd, sal_uLong nEndNd,
xub_StrLen nStt, xub_StrLen nEnd ) const
{
// hier sollte irgend ein Anchor aus dem normalen Nodes-Array reichen
@@ -225,7 +230,7 @@ BOOL SwIntrnlRefLink::IsInRange( ULONG nSttNd, ULONG nEndNd,
if( pTblNd->GetNodes().IsDocNodes() &&
nSttNd < pTblNd->EndOfSectionIndex() &&
nEndNd > pTblNd->GetIndex() )
- return TRUE;
+ return sal_True;
}
else if( ((SwFmtFld*)pLast)->GetTxtFld() )
{
@@ -233,24 +238,24 @@ BOOL SwIntrnlRefLink::IsInRange( ULONG nSttNd, ULONG nEndNd,
const SwTxtNode* pNd = pTFld->GetpTxtNode();
if( pNd && pNds == &pNd->GetNodes() )
{
- ULONG nNdPos = pNd->GetIndex();
+ sal_uLong nNdPos = pNd->GetIndex();
if( nSttNd <= nNdPos && nNdPos <= nEndNd &&
( nNdPos != nSttNd || *pTFld->GetStart() >= nStt ) &&
( nNdPos != nEndNd || *pTFld->GetStart() < nEnd ))
- return TRUE;
+ return sal_True;
}
}
} while( 0 != ( pLast = aIter++ ));
- return FALSE;
+ return sal_False;
}
SwDDEFieldType::SwDDEFieldType(const String& rName,
- const String& rCmd, USHORT nUpdateType )
+ const String& rCmd, sal_uInt16 nUpdateType )
: SwFieldType( RES_DDEFLD ),
aName( rName ), pDoc( 0 ), nRefCnt( 0 )
{
- bCRLFFlag = bDeleted = FALSE;
+ bCRLFFlag = bDeleted = sal_False;
refLink = new SwIntrnlRefLink( *this, nUpdateType, FORMAT_STRING );
SetCmd( rCmd );
}
@@ -329,9 +334,9 @@ void SwDDEFieldType::_RefCntChgd()
/* -----------------------------28.08.00 16:23--------------------------------
---------------------------------------------------------------------------*/
-BOOL SwDDEFieldType::QueryValue( uno::Any& rVal, USHORT nWhichId ) const
+sal_Bool SwDDEFieldType::QueryValue( uno::Any& rVal, sal_uInt16 nWhichId ) const
{
- BYTE nPart = 0;
+ sal_uInt8 nPart = 0;
switch( nWhichId )
{
case FIELD_PROP_PAR2: nPart = 3; break;
@@ -339,7 +344,7 @@ BOOL SwDDEFieldType::QueryValue( uno::Any& rVal, USHORT nWhichId ) const
case FIELD_PROP_SUBTYPE: nPart = 1; break;
case FIELD_PROP_BOOL1:
{
- sal_Bool bSet = GetType() == sfx2::LINKUPDATE_ALWAYS ? TRUE : FALSE;
+ sal_Bool bSet = GetType() == sfx2::LINKUPDATE_ALWAYS ? sal_True : sal_False;
rVal.setValue(&bSet, ::getBooleanCppuType());
}
break;
@@ -351,21 +356,21 @@ BOOL SwDDEFieldType::QueryValue( uno::Any& rVal, USHORT nWhichId ) const
}
if( nPart )
rVal <<= OUString(GetCmd().GetToken(nPart-1, sfx2::cTokenSeperator));
- return TRUE;
+ return sal_True;
}
/* -----------------------------28.08.00 16:23--------------------------------
---------------------------------------------------------------------------*/
-BOOL SwDDEFieldType::PutValue( const uno::Any& rVal, USHORT nWhichId )
+sal_Bool SwDDEFieldType::PutValue( const uno::Any& rVal, sal_uInt16 nWhichId )
{
- BYTE nPart = 0;
+ sal_uInt8 nPart = 0;
switch( nWhichId )
{
case FIELD_PROP_PAR2: nPart = 3; break;
case FIELD_PROP_PAR4: nPart = 2; break;
case FIELD_PROP_SUBTYPE: nPart = 1; break;
case FIELD_PROP_BOOL1:
- SetType( static_cast<USHORT>(*(sal_Bool*)rVal.getValue() ?
+ SetType( static_cast<sal_uInt16>(*(sal_Bool*)rVal.getValue() ?
sfx2::LINKUPDATE_ALWAYS :
sfx2::LINKUPDATE_ONCALL ) );
break;
@@ -387,7 +392,7 @@ BOOL SwDDEFieldType::PutValue( const uno::Any& rVal, USHORT nWhichId )
sCmd.SetToken( nPart-1, sfx2::cTokenSeperator, ::GetString( rVal, sTmp ) );
SetCmd( sCmd );
}
- return TRUE;
+ return sal_True;
}
/* ---------------------------------------------------------------------------
diff --git a/sw/source/core/fields/ddetbl.cxx b/sw/source/core/fields/ddetbl.cxx
index fb9bdaaaaeb5..98b018a3a850 100644
--- a/sw/source/core/fields/ddetbl.cxx
+++ b/sw/source/core/fields/ddetbl.cxx
@@ -46,13 +46,13 @@ TYPEINIT1( SwDDETable, SwTable );
// Constructor movet alle Lines/Boxen aus der SwTable zu sich.
// Die SwTable ist danach Leer und muss geloescht werden.
SwDDETable::SwDDETable( SwTable& rTable, SwDDEFieldType* pDDEType,
- BOOL bUpdate )
+ sal_Bool bUpdate )
: SwTable( rTable ), aDepend( this, pDDEType )
{
// Kopiere/move die Daten der Tabelle
aSortCntBoxes.Insert( &rTable.GetTabSortBoxes(), 0,
rTable.GetTabSortBoxes().Count() ); // move die Inh. Boxen
- rTable.GetTabSortBoxes().Remove( (USHORT)0, rTable.GetTabSortBoxes().Count() );
+ rTable.GetTabSortBoxes().Remove( (sal_uInt16)0, rTable.GetTabSortBoxes().Count() );
aLines.Insert( &rTable.GetTabLines(),0 ); // move die Lines
rTable.GetTabLines().Remove( 0, rTable.GetTabLines().Count() );
@@ -126,11 +126,11 @@ void SwDDETable::ChangeContent()
String aExpand = pDDEType->GetExpansion();
aExpand.EraseAllChars( '\r' );
- for( USHORT n = 0; n < aLines.Count(); ++n )
+ for( sal_uInt16 n = 0; n < aLines.Count(); ++n )
{
String aLine = aExpand.GetToken( n, '\n' );
SwTableLine* pLine = aLines[ n ];
- for( USHORT i = 0; i < pLine->GetTabBoxes().Count(); ++i )
+ for( sal_uInt16 i = 0; i < pLine->GetTabBoxes().Count(); ++i )
{
SwTableBox* pBox = pLine->GetTabBoxes()[ i ];
ASSERT( pBox->GetSttIdx(), "keine InhaltsBox" );
@@ -159,7 +159,7 @@ SwDDEFieldType* SwDDETable::GetDDEFldType()
return (SwDDEFieldType*)aDepend.GetRegisteredIn();
}
-BOOL SwDDETable::NoDDETable()
+sal_Bool SwDDETable::NoDDETable()
{
// suche den TabellenNode
ASSERT( GetFrmFmt(), "Kein FrameFormat" );
@@ -167,11 +167,11 @@ BOOL SwDDETable::NoDDETable()
// Stehen wir im richtigen NodesArray (Wegen UNDO)
if( !aLines.Count() )
- return FALSE;
+ return sal_False;
ASSERT( GetTabSortBoxes().Count(), "Tabelle ohne Inhalt?" );
SwNode* pNd = (SwNode*)GetTabSortBoxes()[0]->GetSttNd();
if( !pNd->GetNodes().IsDocNodes() )
- return FALSE;
+ return sal_False;
SwTableNode* pTblNd = pNd->FindTableNode();
ASSERT( pTblNd, "wo steht denn die Tabelle ?");
@@ -181,7 +181,7 @@ BOOL SwDDETable::NoDDETable()
// Kopiere/move die Daten der Tabelle
pNewTbl->GetTabSortBoxes().Insert( &GetTabSortBoxes(), 0,
GetTabSortBoxes().Count() ); // move die Inh. Boxen
- GetTabSortBoxes().Remove( (USHORT)0, GetTabSortBoxes().Count() );
+ GetTabSortBoxes().Remove( (sal_uInt16)0, GetTabSortBoxes().Count() );
pNewTbl->GetTabLines().Insert( &GetTabLines(),0 ); // move die Lines
GetTabLines().Remove( 0, GetTabLines().Count() );
@@ -191,7 +191,7 @@ BOOL SwDDETable::NoDDETable()
pTblNd->SetNewTable( pNewTbl ); // setze die Tabelle
- return TRUE;
+ return sal_True;
}
diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx
index dcaea13af7eb..0f84d40c5c1c 100644
--- a/sw/source/core/fields/docufld.cxx
+++ b/sw/source/core/fields/docufld.cxx
@@ -247,7 +247,14 @@ sal_uInt16 SwPageNumberField::GetSubType() const
return nSubType;
}
+<<<<<<< local
BOOL SwPageNumberField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
+=======
+/*-----------------05.03.98 10:25-------------------
+
+--------------------------------------------------*/
+sal_Bool SwPageNumberField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+>>>>>>> other
{
switch( nWhichId )
{
@@ -278,9 +285,14 @@ BOOL SwPageNumberField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
return sal_True;
}
+<<<<<<< local
BOOL SwPageNumberField::PutValue( const uno::Any& rAny, USHORT nWhichId )
+=======
+--------------------------------------------------*/
+sal_Bool SwPageNumberField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+>>>>>>> other
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
sal_Int16 nSet = 0;
switch( nWhichId )
{
@@ -312,7 +324,7 @@ BOOL SwPageNumberField::PutValue( const uno::Any& rAny, USHORT nWhichId )
nSubType = PG_NEXT;
break;
default:
- bRet = FALSE;
+ bRet = sal_False;
}
break;
case FIELD_PROP_PAR1:
@@ -333,7 +345,7 @@ SwAuthorFieldType::SwAuthorFieldType()
{
}
-String SwAuthorFieldType::Expand(ULONG nFmt) const
+String SwAuthorFieldType::Expand(sal_uLong nFmt) const
{
String sRet;
SvtUserOptions& rOpt = SW_MOD()->GetUserOptions();
@@ -376,7 +388,14 @@ SwField* SwAuthorField::Copy() const
return pTmp;
}
+<<<<<<< local
BOOL SwAuthorField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
+=======
+/*-----------------05.03.98 11:15-------------------
+
+--------------------------------------------------*/
+sal_Bool SwAuthorField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+>>>>>>> other
{
sal_Bool bVal;
switch( nWhichId )
@@ -401,7 +420,12 @@ BOOL SwAuthorField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
return sal_True;
}
+<<<<<<< local
BOOL SwAuthorField::PutValue( const uno::Any& rAny, USHORT nWhichId )
+=======
+--------------------------------------------------*/
+sal_Bool SwAuthorField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+>>>>>>> other
{
switch( nWhichId )
{
@@ -436,7 +460,7 @@ SwFileNameFieldType::SwFileNameFieldType(SwDoc *pDocument)
pDoc = pDocument;
}
-String SwFileNameFieldType::Expand(ULONG nFmt) const
+String SwFileNameFieldType::Expand(sal_uLong nFmt) const
{
String aRet;
const SwDocShell* pDShell = pDoc->GetDocShell();
@@ -517,7 +541,14 @@ SwField* SwFileNameField::Copy() const
return pTmp;
}
+<<<<<<< local
BOOL SwFileNameField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
+=======
+/*-----------------05.03.98 08:59-------------------
+
+--------------------------------------------------*/
+sal_Bool SwFileNameField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+>>>>>>> other
{
switch( nWhichId )
{
@@ -543,7 +574,7 @@ BOOL SwFileNameField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
case FIELD_PROP_BOOL2:
{
- BOOL bVal = IsFixed();
+ sal_Bool bVal = IsFixed();
rAny.setValue(&bVal, ::getBooleanCppuType());
}
break;
@@ -557,7 +588,12 @@ BOOL SwFileNameField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
return sal_True;
}
+<<<<<<< local
BOOL SwFileNameField::PutValue( const uno::Any& rAny, USHORT nWhichId )
+=======
+--------------------------------------------------*/
+sal_Bool SwFileNameField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+>>>>>>> other
{
switch( nWhichId )
{
@@ -568,7 +604,7 @@ BOOL SwFileNameField::PutValue( const uno::Any& rAny, USHORT nWhichId )
// here only a int16
sal_Int32 nType = 0;
rAny >>= nType;
- BOOL bFixed = IsFixed();
+ sal_Bool bFixed = IsFixed();
switch( nType )
{
case text::FilenameDisplayFormat::PATH:
@@ -614,7 +650,7 @@ SwTemplNameFieldType::SwTemplNameFieldType(SwDoc *pDocument)
pDoc = pDocument;
}
-String SwTemplNameFieldType::Expand(ULONG nFmt) const
+String SwTemplNameFieldType::Expand(sal_uLong nFmt) const
{
ASSERT( nFmt < FF_END, "Expand: kein guelt. Fmt!" );
@@ -688,7 +724,14 @@ SwField* SwTemplNameField::Copy() const
return pTmp;
}
+<<<<<<< local
BOOL SwTemplNameField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
+=======
+/*-----------------05.03.98 08:59-------------------
+
+--------------------------------------------------*/
+sal_Bool SwTemplNameField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+>>>>>>> other
{
switch ( nWhichId )
{
@@ -714,7 +757,12 @@ BOOL SwTemplNameField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
return sal_True;
}
+<<<<<<< local
BOOL SwTemplNameField::PutValue( const uno::Any& rAny, USHORT nWhichId )
+=======
+--------------------------------------------------*/
+sal_Bool SwTemplNameField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+>>>>>>> other
{
switch ( nWhichId )
{
@@ -838,7 +886,14 @@ void SwDocStatField::ChangeExpansion( const SwFrm* pFrm )
pFrm->FindPageFrm()->GetPageDesc()->GetNumType().GetNumberingType() );
}
+<<<<<<< local
BOOL SwDocStatField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
+=======
+/*-----------------05.03.98 11:38-------------------
+
+--------------------------------------------------*/
+sal_Bool SwDocStatField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+>>>>>>> other
{
switch ( nWhichId )
{
@@ -851,9 +906,14 @@ BOOL SwDocStatField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
return sal_True;
}
+<<<<<<< local
BOOL SwDocStatField::PutValue( const uno::Any& rAny, USHORT nWhichId )
+=======
+--------------------------------------------------*/
+sal_Bool SwDocStatField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+>>>>>>> other
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
switch ( nWhichId )
{
case FIELD_PROP_USHORT2:
@@ -865,7 +925,7 @@ BOOL SwDocStatField::PutValue( const uno::Any& rAny, USHORT nWhichId )
nSet != SVX_NUM_BITMAP)
{
SetFormat(nSet);
- bRet = TRUE;
+ bRet = sal_True;
}
}
break;
@@ -892,7 +952,7 @@ SwFieldType* SwDocInfoFieldType::Copy() const
return pTyp;
}
-void lcl_GetLocalDataWrapper( ULONG nLang,
+void lcl_GetLocalDataWrapper( sal_uLong nLang,
const LocaleDataWrapper **ppAppLocalData,
const LocaleDataWrapper **ppLocalData )
{
@@ -1227,7 +1287,7 @@ void SwDocInfoField::SetLanguage(sal_uInt16 nLng)
/* ---------------------------------------------------------------------------
---------------------------------------------------------------------------*/
-BOOL SwDocInfoField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
+sal_Bool SwDocInfoField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
{
@@ -1277,7 +1337,7 @@ BOOL SwDocInfoField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
/* ---------------------------------------------------------------------------
---------------------------------------------------------------------------*/
-BOOL SwDocInfoField::PutValue( const uno::Any& rAny, USHORT nWhichId )
+sal_Bool SwDocInfoField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
sal_Int32 nValue = 0;
switch( nWhichId )
@@ -1572,7 +1632,7 @@ sal_uInt16 SwHiddenTxtField::GetSubType() const
/* ---------------------------------------------------------------------------
---------------------------------------------------------------------------*/
-BOOL SwHiddenTxtField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
+sal_Bool SwHiddenTxtField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
const String* pOut = 0;
switch( nWhichId )
@@ -1605,7 +1665,7 @@ BOOL SwHiddenTxtField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
/* ---------------------------------------------------------------------------
---------------------------------------------------------------------------*/
-BOOL SwHiddenTxtField::PutValue( const uno::Any& rAny, USHORT nWhichId )
+sal_Bool SwHiddenTxtField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
switch( nWhichId )
{
@@ -1626,7 +1686,7 @@ BOOL SwHiddenTxtField::PutValue( const uno::Any& rAny, USHORT nWhichId )
break;
case FIELD_PROP_PAR4:
::GetString( rAny, aContent);
- bValid = TRUE;
+ bValid = sal_True;
break;
default:
DBG_ERROR("illegal property");
@@ -1710,7 +1770,12 @@ SwField* SwHiddenParaField::Copy() const
return pFld;
}
+<<<<<<< local
BOOL SwHiddenParaField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
+=======
+--------------------------------------------------*/
+sal_Bool SwHiddenParaField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+>>>>>>> other
{
switch ( nWhichId )
{
@@ -1730,7 +1795,12 @@ BOOL SwHiddenParaField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
return sal_True;
}
+<<<<<<< local
BOOL SwHiddenParaField::PutValue( const uno::Any& rAny, USHORT nWhichId )
+=======
+--------------------------------------------------*/
+sal_Bool SwHiddenParaField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+>>>>>>> other
{
switch ( nWhichId )
{
@@ -1870,7 +1940,14 @@ sal_uInt32 SwPostItField::GetNumberOfParagraphs() const
return (mpText) ? mpText->Count() : 1;
}
+<<<<<<< local
BOOL SwPostItField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
+=======
+/*-----------------05.03.98 13:42-------------------
+
+--------------------------------------------------*/
+sal_Bool SwPostItField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+>>>>>>> other
{
switch( nWhichId )
{
@@ -1930,7 +2007,15 @@ BOOL SwPostItField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
return sal_True;
}
+<<<<<<< local
BOOL SwPostItField::PutValue( const uno::Any& rAny, USHORT nWhichId )
+=======
+
+/*-----------------05.03.98 13:42-------------------
+
+--------------------------------------------------*/
+sal_Bool SwPostItField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+>>>>>>> other
{
switch( nWhichId )
{
@@ -1961,7 +2046,7 @@ BOOL SwPostItField::PutValue( const uno::Any& rAny, USHORT nWhichId )
{
util::DateTime aDateTimeValue;
if(!(rAny >>= aDateTimeValue))
- return FALSE;
+ return sal_False;
aDateTime.Set100Sec(aDateTimeValue.HundredthSeconds);
aDateTime.SetSec(aDateTimeValue.Seconds);
aDateTime.SetMin(aDateTimeValue.Minutes);
@@ -2071,7 +2156,14 @@ void SwExtUserField::SetSubType(sal_uInt16 nSub)
nType = nSub;
}
+<<<<<<< local
BOOL SwExtUserField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
+=======
+/*-----------------05.03.98 14:14-------------------
+
+--------------------------------------------------*/
+sal_Bool SwExtUserField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+>>>>>>> other
{
switch( nWhichId )
{
@@ -2097,7 +2189,12 @@ BOOL SwExtUserField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
return sal_True;
}
+<<<<<<< local
BOOL SwExtUserField::PutValue( const uno::Any& rAny, USHORT nWhichId )
+=======
+--------------------------------------------------*/
+sal_Bool SwExtUserField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+>>>>>>> other
{
switch( nWhichId )
{
@@ -2186,7 +2283,14 @@ void SwRefPageSetField::SetPar2(const String& rStr)
SetOffset( (short) rStr.ToInt32() );
}
+<<<<<<< local
BOOL SwRefPageSetField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
+=======
+/*-----------------05.03.98 14:52-------------------
+
+--------------------------------------------------*/
+sal_Bool SwRefPageSetField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+>>>>>>> other
{
switch( nWhichId )
{
@@ -2202,7 +2306,12 @@ BOOL SwRefPageSetField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
return sal_True;
}
+<<<<<<< local
BOOL SwRefPageSetField::PutValue( const uno::Any& rAny, USHORT nWhichId )
+=======
+--------------------------------------------------*/
+sal_Bool SwRefPageSetField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+>>>>>>> other
{
switch( nWhichId )
{
@@ -2449,7 +2558,12 @@ void SwRefPageGetField::ChangeExpansion( const SwFrm* pFrm,
}
}
+<<<<<<< local
BOOL SwRefPageGetField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
+=======
+--------------------------------------------------*/
+sal_Bool SwRefPageGetField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+>>>>>>> other
{
switch( nWhichId )
{
@@ -2465,7 +2579,12 @@ BOOL SwRefPageGetField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
return sal_True;
}
+<<<<<<< local
BOOL SwRefPageGetField::PutValue( const uno::Any& rAny, USHORT nWhichId )
+=======
+--------------------------------------------------*/
+sal_Bool SwRefPageGetField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+>>>>>>> other
{
switch( nWhichId )
{
@@ -2580,7 +2699,14 @@ void SwJumpEditField::SetPar2(const String& rStr)
sHelp = rStr;
}
+<<<<<<< local
BOOL SwJumpEditField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
+=======
+/*-----------------05.03.98 15:00-------------------
+
+--------------------------------------------------*/
+sal_Bool SwJumpEditField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+>>>>>>> other
{
switch( nWhichId )
{
@@ -2612,7 +2738,12 @@ BOOL SwJumpEditField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
return sal_True;
}
+<<<<<<< local
BOOL SwJumpEditField::PutValue( const uno::Any& rAny, USHORT nWhichId )
+=======
+--------------------------------------------------*/
+sal_Bool SwJumpEditField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+>>>>>>> other
{
switch( nWhichId )
{
@@ -2690,8 +2821,8 @@ void SwCombinedCharField::SetPar1(const String& rStr)
sCharacters = rStr.Copy( 0, MAX_COMBINED_CHARACTERS );
}
-BOOL SwCombinedCharField::QueryValue( uno::Any& rAny,
- USHORT nWhichId ) const
+sal_Bool SwCombinedCharField::QueryValue( uno::Any& rAny,
+ sal_uInt16 nWhichId ) const
{
switch( nWhichId )
{
@@ -2704,8 +2835,8 @@ BOOL SwCombinedCharField::QueryValue( uno::Any& rAny,
return sal_True;
}
-BOOL SwCombinedCharField::PutValue( const uno::Any& rAny,
- USHORT nWhichId )
+sal_Bool SwCombinedCharField::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 6c489fece1e9..425566999b5e 100644
--- a/sw/source/core/fields/expfld.cxx
+++ b/sw/source/core/fields/expfld.cxx
@@ -72,15 +72,23 @@ using ::rtl::OUString;
SV_IMPL_PTRARR( _SwSeqFldList, _SeqFldLstElem* )
//-----------------------------------------------------------------------------
-sal_Int16 lcl_SubTypeToAPI(USHORT nSubType)
+sal_Int16 lcl_SubTypeToAPI(sal_uInt16 nSubType)
{
sal_Int16 nRet = 0;
switch(nSubType)
{
- case nsSwGetSetExpType::GSE_EXPR : nRet = SetVariableType::VAR /*0*/; break;
- case nsSwGetSetExpType::GSE_SEQ : nRet = SetVariableType::SEQUENCE /*1*/; break;
- case nsSwGetSetExpType::GSE_FORMULA : nRet = SetVariableType::FORMULA /*2*/; break;
- case nsSwGetSetExpType::GSE_STRING : nRet = SetVariableType::STRING /*3*/; break;
+ case nsSwGetSetExpType::GSE_EXPR:
+ nRet = SetVariableType::VAR; // 0
+ break;
+ case nsSwGetSetExpType::GSE_SEQ:
+ nRet = SetVariableType::SEQUENCE; // 1
+ break;
+ case nsSwGetSetExpType::GSE_FORMULA:
+ nRet = SetVariableType::FORMULA; // 2
+ break;
+ case nsSwGetSetExpType::GSE_STRING:
+ nRet = SetVariableType::STRING; // 3
+ break;
}
return nRet;
}
@@ -105,7 +113,7 @@ sal_Int32 lcl_APIToSubType(const uno::Any& rAny)
//-----------------------------------------------------------------------------
-void ReplacePoint( String& rTmpName, BOOL bWithCommandType )
+void ReplacePoint( String& rTmpName, sal_Bool bWithCommandType )
{
// replace first and last (if bWithCommandType: last two) dot Ersten und letzten Punkt ersetzen, da in Tabellennamen Punkte erlaubt sind
// since table names may contain dots
@@ -249,7 +257,7 @@ const SwTxtNode* GetBodyTxtNode( const SwDoc& rDoc, SwPosition& rPos,
{
Point aPt( pLayout->Frm().Pos() );
aPt.Y()++; // aus dem Header raus
- pCntFrm = pPgFrm->GetCntntPos( aPt, FALSE, TRUE, FALSE );
+ pCntFrm = pPgFrm->GetCntntPos( aPt, sal_False, sal_True, sal_False );
pTxtNode = GetFirstTxtNode( rDoc, rPos, pCntFrm, aPt );
}
}
@@ -289,9 +297,9 @@ void SwGetExpFieldType::Modify( const SfxPoolItem*, const SfxPoolItem* pNew )
--------------------------------------------------------------------*/
SwGetExpField::SwGetExpField(SwGetExpFieldType* pTyp, const String& rFormel,
- USHORT nSub, ULONG nFmt)
+ sal_uInt16 nSub, sal_uLong nFmt)
: SwFormulaField( pTyp, nFmt, 0.0 ),
- bIsInBodyTxt( TRUE ),
+ bIsInBodyTxt( sal_True ),
nSubType(nSub),
bLateInitialization( false )
{
@@ -309,7 +317,7 @@ String SwGetExpField::Expand() const
String SwGetExpField::GetFieldName() const
{
String aStr( SwFieldType::GetTypeStr(
- static_cast<USHORT>(((nsSwGetSetExpType::GSE_FORMULA & nSubType) != 0)
+ static_cast<sal_uInt16>(((nsSwGetSetExpType::GSE_FORMULA & nSubType) != 0)
? TYP_FORMELFLD
: TYP_GETFLD ) ));
aStr += ' ';
@@ -370,7 +378,7 @@ void SwGetExpField::ChangeExpansion( const SwFrm& rFrm, const SwTxtFld& rFld )
if(GetSubType() & nsSwGetSetExpType::GSE_STRING)
{
SwHash** ppHashTbl;
- USHORT nSize;
+ sal_uInt16 nSize;
rDoc.FldsToExpand( ppHashTbl, nSize, aEndFld );
LookString( ppHashTbl, nSize, GetFormula(), sExpand );
::DeleteHashTable( ppHashTbl, nSize ); // HashTabelle loeschen
@@ -400,17 +408,17 @@ void SwGetExpField::SetPar2(const String& rStr)
SetFormula(rStr);
}
-USHORT SwGetExpField::GetSubType() const
+sal_uInt16 SwGetExpField::GetSubType() const
{
return nSubType;
}
-void SwGetExpField::SetSubType(USHORT nType)
+void SwGetExpField::SetSubType(sal_uInt16 nType)
{
nSubType = nType;
}
-void SwGetExpField::SetLanguage(USHORT nLng)
+void SwGetExpField::SetLanguage(sal_uInt16 nLng)
{
if (nSubType & nsSwExtendedSubType::SUB_CMD)
SwField::SetLanguage(nLng);
@@ -418,7 +426,14 @@ void SwGetExpField::SetLanguage(USHORT nLng)
SwValueField::SetLanguage(nLng);
}
+<<<<<<< local
BOOL SwGetExpField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
+=======
+/*-----------------07.03.98 16:08-------------------
+
+--------------------------------------------------*/
+sal_Bool SwGetExpField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+>>>>>>> other
{
switch( nWhichId )
{
@@ -442,7 +457,7 @@ BOOL SwGetExpField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
break;
case FIELD_PROP_BOOL2:
{
- BOOL bTmp = 0 != (nSubType & nsSwExtendedSubType::SUB_CMD);
+ sal_Bool bTmp = 0 != (nSubType & nsSwExtendedSubType::SUB_CMD);
rAny.setValue(&bTmp, ::getBooleanCppuType());
}
break;
@@ -452,10 +467,15 @@ BOOL SwGetExpField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
default:
return SwField::QueryValue(rAny, nWhichId);
}
- return TRUE;
+ return sal_True;
}
+<<<<<<< local
BOOL SwGetExpField::PutValue( const uno::Any& rAny, USHORT nWhichId )
+=======
+--------------------------------------------------*/
+sal_Bool SwGetExpField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+>>>>>>> other
{
sal_Int32 nTmp = 0;
String sTmp;
@@ -470,7 +490,7 @@ BOOL SwGetExpField::PutValue( const uno::Any& rAny, USHORT nWhichId )
break;
case FIELD_PROP_USHORT1:
rAny >>= nTmp;
- nSubType = static_cast<USHORT>(nTmp);
+ nSubType = static_cast<sal_uInt16>(nTmp);
break;
case FIELD_PROP_PAR1:
SetFormula( ::GetString( rAny, sTmp ));
@@ -478,7 +498,7 @@ BOOL SwGetExpField::PutValue( const uno::Any& rAny, USHORT nWhichId )
case FIELD_PROP_SUBTYPE:
nTmp = lcl_APIToSubType(rAny);
if( nTmp >=0 )
- SetSubType( static_cast<USHORT>((GetSubType() & 0xff00) | nTmp));
+ SetSubType( static_cast<sal_uInt16>((GetSubType() & 0xff00) | nTmp));
break;
case FIELD_PROP_BOOL2:
if(*(sal_Bool*) rAny.getValue())
@@ -492,19 +512,27 @@ BOOL SwGetExpField::PutValue( const uno::Any& rAny, USHORT nWhichId )
default:
return SwField::PutValue(rAny, nWhichId);
}
- return TRUE;
+ return sal_True;
}
+<<<<<<< local
SwSetExpFieldType::SwSetExpFieldType( SwDoc* pDc, const String& rName, USHORT nTyp )
+=======
+/*-----------------JP: 17.06.93 -------------------
+ Set-Expression-Type
+ --------------------------------------------------*/
+
+SwSetExpFieldType::SwSetExpFieldType( SwDoc* pDc, const String& rName, sal_uInt16 nTyp )
+>>>>>>> other
: SwValueFieldType( pDc, RES_SETEXPFLD ),
sName( rName ),
pOutlChgNd( 0 ),
sDelim( String::CreateFromAscii( "." ) ),
nType(nTyp), nLevel( UCHAR_MAX ),
- bDeleted( FALSE )
+ bDeleted( sal_False )
{
if( ( nsSwGetSetExpType::GSE_SEQ | nsSwGetSetExpType::GSE_STRING ) & nType )
- EnableFormat(FALSE); // Numberformatter nicht einsetzen
+ EnableFormat(sal_False); // Numberformatter nicht einsetzen
}
SwFieldType* SwSetExpFieldType::Copy() const
@@ -527,14 +555,14 @@ void SwSetExpFieldType::Modify( const SfxPoolItem*, const SfxPoolItem* )
return; // nicht weiter expandieren
}
-void SwSetExpFieldType::SetSeqFormat(ULONG nFmt)
+void SwSetExpFieldType::SetSeqFormat(sal_uLong nFmt)
{
SwIterator<SwFmtFld,SwFieldType> aIter(*this);
for( SwFmtFld* pFld = aIter.First(); pFld; pFld = aIter.Next() )
pFld->GetFld()->ChangeFormat( nFmt );
}
-ULONG SwSetExpFieldType::GetSeqFormat()
+sal_uLong SwSetExpFieldType::GetSeqFormat()
{
if( !GetDepends() )
return SVX_NUM_ARABIC;
@@ -543,15 +571,15 @@ ULONG SwSetExpFieldType::GetSeqFormat()
return pFld->GetFormat();
}
-USHORT SwSetExpFieldType::SetSeqRefNo( SwSetExpField& rFld )
+sal_uInt16 SwSetExpFieldType::SetSeqRefNo( SwSetExpField& rFld )
{
if( !GetDepends() || !(nsSwGetSetExpType::GSE_SEQ & nType) )
return USHRT_MAX;
-extern void InsertSort( SvUShorts& rArr, USHORT nIdx, USHORT* pInsPos = 0 );
+extern void InsertSort( SvUShorts& rArr, sal_uInt16 nIdx, sal_uInt16* pInsPos = 0 );
SvUShorts aArr( 64 );
- USHORT n;
+ sal_uInt16 n;
// dann testmal, ob die Nummer schon vergeben ist oder ob eine neue
// bestimmt werden muss.
@@ -565,7 +593,7 @@ extern void InsertSort( SvUShorts& rArr, USHORT nIdx, USHORT* pInsPos = 0 );
// teste erstmal ob die Nummer schon vorhanden ist:
- USHORT nNum = rFld.GetSeqNumber();
+ sal_uInt16 nNum = rFld.GetSeqNumber();
if( USHRT_MAX != nNum )
{
for( n = 0; n < aArr.Count(); ++n )
@@ -587,7 +615,7 @@ extern void InsertSort( SvUShorts& rArr, USHORT nIdx, USHORT* pInsPos = 0 );
return n;
}
-USHORT SwSetExpFieldType::GetSeqFldList( SwSeqFldList& rList )
+sal_uInt16 SwSetExpFieldType::GetSeqFldList( SwSeqFldList& rList )
{
if( rList.Count() )
rList.Remove( 0, rList.Count() );
@@ -624,7 +652,7 @@ void SwSetExpFieldType::SetChapter( SwSetExpField& rFld, const SwNode& rNd )
const SwNodeNum & aNum = *(pTxtNd->GetNum());
// nur die Nummer besorgen, ohne Pre-/Post-fixstrings
- String sNumber( pRule->MakeNumString(aNum, FALSE ));
+ String sNumber( pRule->MakeNumString(aNum, sal_False ));
if( sNumber.Len() )
rFld.ChgExpStr( ( sNumber += sDelim ) += rFld.GetExpStr() );
@@ -638,7 +666,14 @@ void SwSetExpFieldType::SetChapter( SwSetExpField& rFld, const SwNode& rNd )
}
}
+<<<<<<< local
BOOL SwSetExpFieldType::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
+=======
+/* -----------------24.03.99 09:44-------------------
+ *
+ * --------------------------------------------------*/
+sal_Bool SwSetExpFieldType::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+>>>>>>> other
{
switch( nWhichId )
{
@@ -660,10 +695,10 @@ BOOL SwSetExpFieldType::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
default:
DBG_ERROR("illegal property");
}
- return TRUE;
+ return sal_True;
}
-BOOL SwSetExpFieldType::PutValue( const uno::Any& rAny, USHORT nWhichId )
+sal_Bool SwSetExpFieldType::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
switch( nWhichId )
{
@@ -671,7 +706,7 @@ BOOL SwSetExpFieldType::PutValue( const uno::Any& rAny, USHORT nWhichId )
{
sal_Int32 nSet = lcl_APIToSubType(rAny);
if(nSet >=0)
- SetType(static_cast<USHORT>(nSet));
+ SetType(static_cast<sal_uInt16>(nSet));
}
break;
case FIELD_PROP_PAR2:
@@ -697,10 +732,10 @@ BOOL SwSetExpFieldType::PutValue( const uno::Any& rAny, USHORT nWhichId )
default:
DBG_ERROR("illegal property");
}
- return TRUE;
+ return sal_True;
}
-BOOL SwSeqFldList::InsertSort( _SeqFldLstElem* pNew )
+sal_Bool SwSeqFldList::InsertSort( _SeqFldLstElem* pNew )
{
sal_Unicode* p = pNew->sDlgEntry.GetBufferAccess();
while( *p )
@@ -710,16 +745,16 @@ BOOL SwSeqFldList::InsertSort( _SeqFldLstElem* pNew )
++p;
}
- USHORT nPos;
- BOOL bRet = SeekEntry( *pNew, &nPos );
+ sal_uInt16 nPos;
+ sal_Bool bRet = SeekEntry( *pNew, &nPos );
if( !bRet )
C40_INSERT( _SeqFldLstElem, pNew, nPos );
return bRet;
}
-BOOL SwSeqFldList::SeekEntry( const _SeqFldLstElem& rNew, USHORT* pP )
+sal_Bool SwSeqFldList::SeekEntry( const _SeqFldLstElem& rNew, sal_uInt16* pP )
{
- USHORT nO = Count(), nM, nU = 0;
+ sal_uInt16 nO = Count(), nM, nU = 0;
if( nO > 0 )
{
CollatorWrapper & rCaseColl = ::GetAppCaseCollator(),
@@ -731,7 +766,7 @@ BOOL SwSeqFldList::SeekEntry( const _SeqFldLstElem& rNew, USHORT* pP )
const String& rTmp2 = rNew.sDlgEntry;
xub_StrLen nFndPos2 = 0;
String sNum2( rTmp2.GetToken( 0, ' ', nFndPos2 ));
- BOOL bIsNum2IsNumeric = rCC.isAsciiNumeric( sNum2 );
+ sal_Bool bIsNum2IsNumeric = rCC.isAsciiNumeric( sNum2 );
sal_Int32 nNum2 = bIsNum2IsNumeric ? sNum2.ToInt32() : 0;
nO--;
@@ -760,7 +795,7 @@ BOOL SwSeqFldList::SeekEntry( const _SeqFldLstElem& rNew, USHORT* pP )
if( 0 == nCmp )
{
if( pP ) *pP = nM;
- return TRUE;
+ return sal_True;
}
else if( 0 < nCmp )
nU = nM + 1;
@@ -771,7 +806,7 @@ BOOL SwSeqFldList::SeekEntry( const _SeqFldLstElem& rNew, USHORT* pP )
}
}
if( pP ) *pP = nU;
- return FALSE;
+ return sal_False;
}
/*--------------------------------------------------------------------
@@ -779,13 +814,13 @@ BOOL SwSeqFldList::SeekEntry( const _SeqFldLstElem& rNew, USHORT* pP )
--------------------------------------------------------------------*/
SwSetExpField::SwSetExpField(SwSetExpFieldType* pTyp, const String& rFormel,
- ULONG nFmt)
+ sal_uLong nFmt)
: SwFormulaField( pTyp, nFmt, 0.0 ), nSeqNo( USHRT_MAX ),
nSubType(0)
{
SetFormula(rFormel);
// SubType ignorieren !!!
- bInput = FALSE;
+ bInput = sal_False;
if( IsSequenceFld() )
{
SwValueField::SetValue(1.0);
@@ -828,7 +863,7 @@ String SwSetExpField::GetFieldName() const
? TYP_SETINPFLD
: TYP_SETFLD );
- String aStr( SwFieldType::GetTypeStr( static_cast<USHORT>(nStrType) ) );
+ String aStr( SwFieldType::GetTypeStr( static_cast<sal_uInt16>(nStrType) ) );
aStr += ' ';
aStr += GetTyp()->GetName();
@@ -857,7 +892,7 @@ SwField* SwSetExpField::Copy() const
return pTmp;
}
-void SwSetExpField::SetSubType(USHORT nSub)
+void SwSetExpField::SetSubType(sal_uInt16 nSub)
{
((SwSetExpFieldType*)GetTyp())->SetType(nSub & 0xff);
nSubType = nSub & 0xff00;
@@ -865,7 +900,7 @@ void SwSetExpField::SetSubType(USHORT nSub)
DBG_ASSERT( (nSub & 0xff) != 3, "SubType ist illegal!" );
}
-USHORT SwSetExpField::GetSubType() const
+sal_uInt16 SwSetExpField::GetSubType() const
{
return ((SwSetExpFieldType*)GetTyp())->GetType() | nSubType;
}
@@ -875,7 +910,7 @@ void SwSetExpField::SetValue( const double& rAny )
SwValueField::SetValue(rAny);
if( IsSequenceFld() )
- sExpand = FormatNumber( (USHORT)GetValue(), GetFormat() );
+ sExpand = FormatNumber( (sal_uInt16)GetValue(), GetFormat() );
else
sExpand = ((SwValueFieldType*)GetTyp())->ExpandValue( rAny,
GetFormat(), GetLanguage());
@@ -903,9 +938,9 @@ xub_StrLen SwGetExpField::GetReferenceTextPos( const SwFmtFld& rFmt, SwDoc& rDoc
if(sNodeText.Len())
{
//now check if sNodeText starts with a non-alphanumeric character plus a blank
- USHORT nSrcpt = pBreakIt->GetRealScriptOfText( sNodeText, 0 );
+ sal_uInt16 nSrcpt = pBreakIt->GetRealScriptOfText( sNodeText, 0 );
- static USHORT nIds[] =
+ static sal_uInt16 nIds[] =
{
RES_CHRATR_LANGUAGE, RES_CHRATR_LANGUAGE,
RES_CHRATR_FONT, RES_CHRATR_FONT,
@@ -925,7 +960,7 @@ xub_StrLen SwGetExpField::GetReferenceTextPos( const SwFmtFld& rFmt, SwDoc& rDoc
GetWhichOfScript( RES_CHRATR_LANGUAGE, nSrcpt )) ).GetLanguage();
CharClass aCC( SvxCreateLocale( eLang ));
sal_Unicode c0 = sNodeText.GetChar(0);
- BOOL bIsAlphaNum = aCC.isAlphaNumeric( sNodeText, 0 );
+ sal_Bool bIsAlphaNum = aCC.isAlphaNumeric( sNodeText, 0 );
if( !bIsAlphaNum ||
(c0 == ' ' || c0 == '\t'))
{
@@ -952,7 +987,7 @@ const String& SwSetExpField::GetPar1() const
String SwSetExpField::GetPar2() const
{
- USHORT nType = ((SwSetExpFieldType*)GetTyp())->GetType();
+ sal_uInt16 nType = ((SwSetExpFieldType*)GetTyp())->GetType();
if (nType & nsSwGetSetExpType::GSE_STRING)
return GetFormula();
@@ -961,7 +996,7 @@ String SwSetExpField::GetPar2() const
void SwSetExpField::SetPar2(const String& rStr)
{
- USHORT nType = ((SwSetExpFieldType*)GetTyp())->GetType();
+ sal_uInt16 nType = ((SwSetExpFieldType*)GetTyp())->GetType();
if( !(nType & nsSwGetSetExpType::GSE_SEQ) || rStr.Len() )
{
@@ -992,7 +1027,7 @@ SwFieldType* SwInputFieldType::Copy() const
--------------------------------------------------------------------*/
SwInputField::SwInputField(SwInputFieldType* pTyp, const String& rContent,
- const String& rPrompt, USHORT nSub, ULONG nFmt) :
+ const String& rPrompt, sal_uInt16 nSub, sal_uLong nFmt) :
SwField(pTyp, nFmt), aContent(rContent), aPText(rPrompt), nSubType(nSub)
{
}
@@ -1038,7 +1073,14 @@ String SwInputField::Expand() const
return sRet;
}
+<<<<<<< local
BOOL SwInputField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
+=======
+/*-----------------06.03.98 11:12-------------------
+
+--------------------------------------------------*/
+sal_Bool SwInputField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+>>>>>>> other
{
switch( nWhichId )
{
@@ -1057,10 +1099,15 @@ BOOL SwInputField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
default:
DBG_ERROR("illegal property");
}
- return TRUE;
+ return sal_True;
}
+<<<<<<< local
BOOL SwInputField::PutValue( const uno::Any& rAny, USHORT nWhichId )
+=======
+--------------------------------------------------*/
+sal_Bool SwInputField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+>>>>>>> other
{
switch( nWhichId )
{
@@ -1079,7 +1126,7 @@ BOOL SwInputField::PutValue( const uno::Any& rAny, USHORT nWhichId )
default:
DBG_ERROR("illegal property");
}
- return TRUE;
+ return sal_True;
}
/*--------------------------------------------------------------------
Beschreibung: Bedingung setzen
@@ -1129,22 +1176,27 @@ String SwInputField::GetToolTip() const
return aToolTip;
}
-BOOL SwInputField::isFormField() const
+sal_Bool SwInputField::isFormField() const
{
return aHelp.Len() > 0 || aToolTip.Len() > 0;
}
-USHORT SwInputField::GetSubType() const
+sal_uInt16 SwInputField::GetSubType() const
{
return nSubType;
}
-void SwInputField::SetSubType(USHORT nSub)
+void SwInputField::SetSubType(sal_uInt16 nSub)
{
nSubType = nSub;
}
+<<<<<<< local
BOOL SwSetExpField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
+=======
+--------------------------------------------------*/
+sal_Bool SwSetExpField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+>>>>>>> other
{
switch( nWhichId )
{
@@ -1171,7 +1223,7 @@ BOOL SwSetExpField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
//I18N - if the formula contains only "TypeName+1"
//and it's one of the initially created sequence fields
//then the localized names has to be replaced by a programmatic name
- OUString sMyFormula = SwXFieldMaster::LocalizeFormula(*this, GetFormula(), TRUE);
+ OUString sMyFormula = SwXFieldMaster::LocalizeFormula(*this, GetFormula(), sal_True);
rAny <<= OUString( sMyFormula );
}
break;
@@ -1190,13 +1242,13 @@ BOOL SwSetExpField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
break;
case FIELD_PROP_BOOL3:
{
- BOOL bTmp = 0 != (nSubType & nsSwExtendedSubType::SUB_CMD);
+ sal_Bool bTmp = 0 != (nSubType & nsSwExtendedSubType::SUB_CMD);
rAny.setValue(&bTmp, ::getBooleanCppuType());
}
break;
case FIELD_PROP_BOOL1:
{
- BOOL bTmp = GetInputFlag();
+ sal_Bool bTmp = GetInputFlag();
rAny.setValue(&bTmp, ::getBooleanCppuType());
}
break;
@@ -1206,10 +1258,15 @@ BOOL SwSetExpField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
default:
return SwField::QueryValue(rAny, nWhichId);
}
- return TRUE;
+ return sal_True;
}
+<<<<<<< local
BOOL SwSetExpField::PutValue( const uno::Any& rAny, USHORT nWhichId )
+=======
+--------------------------------------------------*/
+sal_Bool SwSetExpField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+>>>>>>> other
{
sal_Int32 nTmp32 = 0;
sal_Int16 nTmp16 = 0;
@@ -1252,7 +1309,7 @@ BOOL SwSetExpField::PutValue( const uno::Any& rAny, USHORT nWhichId )
//I18N - if the formula contains only "TypeName+1"
//and it's one of the initially created sequence fields
//then the localized names has to be replaced by a programmatic name
- OUString sMyFormula = SwXFieldMaster::LocalizeFormula(*this, uTmp, FALSE);
+ OUString sMyFormula = SwXFieldMaster::LocalizeFormula(*this, uTmp, sal_False);
SetFormula( sMyFormula );
}
break;
@@ -1266,7 +1323,7 @@ BOOL SwSetExpField::PutValue( const uno::Any& rAny, USHORT nWhichId )
case FIELD_PROP_SUBTYPE:
nTmp32 = lcl_APIToSubType(rAny);
if(nTmp32 >= 0)
- SetSubType(static_cast<USHORT>((GetSubType() & 0xff00) | nTmp32));
+ SetSubType(static_cast<sal_uInt16>((GetSubType() & 0xff00) | nTmp32));
break;
case FIELD_PROP_PAR3:
::GetString( rAny, aPText );
@@ -1286,7 +1343,7 @@ BOOL SwSetExpField::PutValue( const uno::Any& rAny, USHORT nWhichId )
default:
return SwField::PutValue(rAny, nWhichId);
}
- return TRUE;
+ return sal_True;
}
diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx
index 6ffe675c760a..47c6a0e4be12 100644
--- a/sw/source/core/fields/fldbas.cxx
+++ b/sw/source/core/fields/fldbas.cxx
@@ -57,7 +57,7 @@
using namespace ::com::sun::star;
using namespace nsSwDocInfoSubType;
-USHORT lcl_GetLanguageOfFormat( USHORT nLng, ULONG nFmt,
+sal_uInt16 lcl_GetLanguageOfFormat( sal_uInt16 nLng, sal_uLong nFmt,
const SvNumberFormatter& rFormatter )
{
if( nLng == LANGUAGE_NONE ) // wegen Bug #60010
@@ -85,7 +85,7 @@ SvStringsDtor* SwFieldType::pFldNames = 0;
DBG_NAME(SwFieldType)
- USHORT __FAR_DATA aTypeTab[] = {
+ sal_uInt16 __FAR_DATA aTypeTab[] = {
/* RES_DBFLD */ TYP_DBFLD,
/* RES_USERFLD */ TYP_USERFLD,
/* RES_FILENAMEFLD */ TYP_FILENAMEFLD,
@@ -131,7 +131,7 @@ DBG_NAME(SwFieldType)
-const String& SwFieldType::GetTypeStr(USHORT nTypeId)
+const String& SwFieldType::GetTypeStr(sal_uInt16 nTypeId)
{
if( !pFldNames )
_GetFldName();
@@ -148,7 +148,7 @@ const String& SwFieldType::GetTypeStr(USHORT nTypeId)
jedes Dokument einmalig ist.
--------------------------------------------------*/
-SwFieldType::SwFieldType( USHORT nWhichId )
+SwFieldType::SwFieldType( sal_uInt16 nWhichId )
: SwModify(0),
nWhich( nWhichId )
{
@@ -169,13 +169,13 @@ const String& SwFieldType::GetName() const
return aEmptyStr;
}
-BOOL SwFieldType::QueryValue( uno::Any&, USHORT ) const
+sal_Bool SwFieldType::QueryValue( uno::Any&, sal_uInt16 ) const
{
- return FALSE;
+ return sal_False;
}
-BOOL SwFieldType::PutValue( const uno::Any& , USHORT )
+sal_Bool SwFieldType::PutValue( const uno::Any& , sal_uInt16 )
{
- return FALSE;
+ return sal_False;
}
/*--------------------------------------------------------------------
@@ -184,9 +184,9 @@ BOOL SwFieldType::PutValue( const uno::Any& , USHORT )
Felder sind n-mal vorhanden, Feldtypen nur einmal
--------------------------------------------------------------------*/
-SwField::SwField(SwFieldType* pTyp, sal_uInt32 nFmt, USHORT nLng) :
+SwField::SwField(SwFieldType* pTyp, sal_uInt32 nFmt, sal_uInt16 nLng) :
nLang(nLng),
- bIsAutomaticLanguage(TRUE),
+ bIsAutomaticLanguage(sal_True),
nFormat(nFmt)
{
ASSERT( pTyp, "SwField: ungueltiger SwFieldType" );
@@ -202,7 +202,7 @@ SwField::~SwField()
--------------------------------------------------------------------*/
#ifdef DBG_UTIL
-USHORT SwField::Which() const
+sal_uInt16 SwField::Which() const
{
ASSERT(pType, "Kein Typ vorhanden");
return pType->Which();
@@ -213,20 +213,20 @@ USHORT SwField::Which() const
Beschreibung:
--------------------------------------------------------------------*/
-USHORT SwField::GetTypeId() const
+sal_uInt16 SwField::GetTypeId() const
{
- USHORT nRet;
+ sal_uInt16 nRet;
switch( pType->Which() )
{
case RES_DATETIMEFLD:
if (GetSubType() & FIXEDFLD)
- nRet = static_cast<USHORT>(GetSubType() & DATEFLD ? TYP_FIXDATEFLD : TYP_FIXTIMEFLD);
+ nRet = static_cast<sal_uInt16>(GetSubType() & DATEFLD ? TYP_FIXDATEFLD : TYP_FIXTIMEFLD);
else
- nRet = static_cast<USHORT>(GetSubType() & DATEFLD ? TYP_DATEFLD : TYP_TIMEFLD);
+ nRet = static_cast<sal_uInt16>(GetSubType() & DATEFLD ? TYP_DATEFLD : TYP_TIMEFLD);
break;
case RES_GETEXPFLD:
- nRet = static_cast<USHORT>(nsSwGetSetExpType::GSE_FORMULA & GetSubType() ? TYP_FORMELFLD : TYP_GETFLD);
+ nRet = static_cast<sal_uInt16>(nsSwGetSetExpType::GSE_FORMULA & GetSubType() ? TYP_FORMELFLD : TYP_GETFLD);
break;
case RES_HIDDENTXTFLD:
@@ -265,10 +265,10 @@ USHORT SwField::GetTypeId() const
String SwField::GetFieldName() const
{
- USHORT nTypeId = GetTypeId();
+ sal_uInt16 nTypeId = GetTypeId();
if (RES_DATETIMEFLD == GetTyp()->Which())
{
- nTypeId = static_cast<USHORT>(
+ nTypeId = static_cast<sal_uInt16>(
((GetSubType() & DATEFLD) != 0) ? TYP_DATEFLD : TYP_TIMEFLD);
}
String sRet = SwFieldType::GetTypeStr( nTypeId );
@@ -305,39 +305,39 @@ void SwField::SetPar1(const String& )
void SwField::SetPar2(const String& )
{}
-USHORT SwField::GetSubType() const
+sal_uInt16 SwField::GetSubType() const
{
// ASSERT(0, "Sorry Not implemented");
return 0;
}
-void SwField::SetSubType(USHORT )
+void SwField::SetSubType(sal_uInt16 )
{
// ASSERT(0, "Sorry Not implemented");
}
-BOOL SwField::QueryValue( uno::Any& rVal, USHORT nWhichId ) const
+sal_Bool SwField::QueryValue( uno::Any& rVal, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
{
case FIELD_PROP_BOOL4:
{
- BOOL bFixed = !bIsAutomaticLanguage;
+ sal_Bool bFixed = !bIsAutomaticLanguage;
rVal.setValue(&bFixed, ::getCppuBooleanType());
}
break;
default:
DBG_ERROR("illegal property");
}
- return TRUE;
+ return sal_True;
}
-BOOL SwField::PutValue( const uno::Any& rVal, USHORT nWhichId )
+sal_Bool SwField::PutValue( const uno::Any& rVal, sal_uInt16 nWhichId )
{
switch( nWhichId )
{
case FIELD_PROP_BOOL4:
{
- BOOL bFixed = FALSE;
+ sal_Bool bFixed = sal_False;
if(rVal >>= bFixed)
bIsAutomaticLanguage = !bFixed;
}
@@ -345,7 +345,7 @@ BOOL SwField::PutValue( const uno::Any& rVal, USHORT nWhichId )
default:
DBG_ERROR("illegal property");
}
- return TRUE;
+ return sal_True;
}
@@ -366,9 +366,9 @@ SwFieldType* SwField::ChgTyp( SwFieldType* pNewType )
}
// hat das Feld eine Action auf dem ClickHandler ? (z.B. INetFelder,..)
-BOOL SwField::HasClickHdl() const
+sal_Bool SwField::HasClickHdl() const
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
switch( pType->Which() )
{
case RES_INTERNETFLD:
@@ -377,7 +377,7 @@ BOOL SwField::HasClickHdl() const
case RES_MACROFLD:
case RES_INPUTFLD:
case RES_DROPDOWN :
- bRet = TRUE;
+ bRet = sal_True;
break;
case RES_SETEXPFLD:
@@ -387,7 +387,7 @@ BOOL SwField::HasClickHdl() const
return bRet;
}
-void SwField::SetLanguage(USHORT nLng)
+void SwField::SetLanguage(sal_uInt16 nLng)
{
nLang = nLng;
}
@@ -397,14 +397,14 @@ void SwField::ChangeFormat(sal_uInt32 n)
nFormat = n;
}
-BOOL SwField::IsFixed() const
+sal_Bool SwField::IsFixed() const
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
switch( pType->Which() )
{
case RES_FIXDATEFLD:
case RES_FIXTIMEFLD:
- bRet = TRUE;
+ bRet = sal_True;
break;
case RES_DATETIMEFLD:
@@ -449,7 +449,7 @@ SwField * SwField::CopyField() const
Beschreibung: Numerierung expandieren
--------------------------------------------------------------------*/
-String FormatNumber(USHORT nNum, sal_uInt32 nFormat)
+String FormatNumber(sal_uInt16 nNum, sal_uInt32 nFormat)
{
if(SVX_NUM_PAGEDESC == nFormat)
return String::CreateFromInt32( nNum );
@@ -465,10 +465,10 @@ String FormatNumber(USHORT nNum, sal_uInt32 nFormat)
Beschreibung: CTOR SwValueFieldType
--------------------------------------------------------------------*/
-SwValueFieldType::SwValueFieldType( SwDoc* pDocPtr, USHORT nWhichId )
+SwValueFieldType::SwValueFieldType( SwDoc* pDocPtr, sal_uInt16 nWhichId )
: SwFieldType(nWhichId),
pDoc(pDocPtr),
- bUseFormat(TRUE)
+ bUseFormat(sal_True)
{
}
@@ -484,7 +484,7 @@ SwValueFieldType::SwValueFieldType( const SwValueFieldType& rTyp )
--------------------------------------------------------------------*/
String SwValueFieldType::ExpandValue( const double& rVal,
- sal_uInt32 nFmt, USHORT nLng) const
+ sal_uInt32 nFmt, sal_uInt16 nLng) const
{
if (rVal >= DBL_MAX) // FehlerString fuer Calculator
return ViewShell::GetShellRes()->aCalc_Error;
@@ -494,7 +494,7 @@ String SwValueFieldType::ExpandValue( const double& rVal,
Color* pCol = 0;
// wegen Bug #60010
- USHORT nFmtLng = ::lcl_GetLanguageOfFormat( nLng, nFmt, *pFormatter );
+ sal_uInt16 nFmtLng = ::lcl_GetLanguageOfFormat( nLng, nFmt, *pFormatter );
if( nFmt < SV_COUNTRY_LANGUAGE_OFFSET && LANGUAGE_SYSTEM != nFmtLng )
{
@@ -553,7 +553,7 @@ void SwValueFieldType::DoubleToString( String &rValue, const double &rVal,
--------------------------------------------------------------------*/
void SwValueFieldType::DoubleToString( String &rValue, const double &rVal,
- USHORT nLng ) const
+ sal_uInt16 nLng ) const
{
SvNumberFormatter* pFormatter = pDoc->GetNumberFormatter();
@@ -571,7 +571,7 @@ void SwValueFieldType::DoubleToString( String &rValue, const double &rVal,
--------------------------------------------------------------------*/
SwValueField::SwValueField( SwValueFieldType* pFldType, sal_uInt32 nFmt,
- USHORT nLng, const double fVal )
+ sal_uInt16 nLng, const double fVal )
: SwField(pFldType, nFmt, nLng),
fValue(fVal)
{
@@ -616,7 +616,7 @@ SwFieldType* SwValueField::ChgTyp( SwFieldType* pNewType )
sal_uInt32 SwValueField::GetSystemFormat(SvNumberFormatter* pFormatter, sal_uInt32 nFmt)
{
const SvNumberformat* pEntry = pFormatter->GetEntry(nFmt);
- USHORT nLng = SvxLocaleToLanguage( SvtSysLocale().GetLocaleData().getLocale() );
+ sal_uInt16 nLng = SvxLocaleToLanguage( SvtSysLocale().GetLocaleData().getLocale() );
if (pEntry && nLng != pEntry->GetLanguage())
{
@@ -647,7 +647,7 @@ sal_uInt32 SwValueField::GetSystemFormat(SvNumberFormatter* pFormatter, sal_uInt
Beschreibung: Sprache im Format anpassen
--------------------------------------------------------------------*/
-void SwValueField::SetLanguage( USHORT nLng )
+void SwValueField::SetLanguage( sal_uInt16 nLng )
{
if( IsAutomaticLanguage() &&
((SwValueFieldType *)GetTyp())->UseFormat() &&
@@ -655,7 +655,7 @@ void SwValueField::SetLanguage( USHORT nLng )
{
// wegen Bug #60010
SvNumberFormatter* pFormatter = GetDoc()->GetNumberFormatter();
- USHORT nFmtLng = ::lcl_GetLanguageOfFormat( nLng, GetFormat(),
+ sal_uInt16 nFmtLng = ::lcl_GetLanguageOfFormat( nLng, GetFormat(),
*pFormatter );
if( (GetFormat() >= SV_COUNTRY_LANGUAGE_OFFSET ||
@@ -735,7 +735,7 @@ void SwFormulaField::SetFormula(const String& rStr)
{
sFormula = rStr;
- ULONG nFmt(GetFormat());
+ sal_uLong nFmt(GetFormat());
if( nFmt && SAL_MAX_UINT32 != nFmt )
{
diff --git a/sw/source/core/fields/flddat.cxx b/sw/source/core/fields/flddat.cxx
index f932a1110820..253477f118e0 100644
--- a/sw/source/core/fields/flddat.cxx
+++ b/sw/source/core/fields/flddat.cxx
@@ -60,7 +60,7 @@ SwFieldType* SwDateTimeFieldType::Copy() const
Beschreibung: Datum/Zeit-Feld
--------------------------------------------------------------------*/
-SwDateTimeField::SwDateTimeField(SwDateTimeFieldType* pInitType, USHORT nSub, ULONG nFmt, USHORT nLng)
+SwDateTimeField::SwDateTimeField(SwDateTimeFieldType* pInitType, sal_uInt16 nSub, sal_uLong nFmt, sal_uInt16 nLng)
: SwValueField(pInitType, nFmt, nLng, 0.0),
nSubType(nSub),
nOffset(0)
@@ -123,7 +123,7 @@ SwField* SwDateTimeField::Copy() const
Beschreibung:
--------------------------------------------------------------------*/
-USHORT SwDateTimeField::GetSubType() const
+sal_uInt16 SwDateTimeField::GetSubType() const
{
return nSubType;
}
@@ -132,7 +132,7 @@ USHORT SwDateTimeField::GetSubType() const
Beschreibung:
--------------------------------------------------------------------*/
-void SwDateTimeField::SetSubType(USHORT nType)
+void SwDateTimeField::SetSubType(sal_uInt16 nType)
{
nSubType = nType;
}
@@ -196,7 +196,7 @@ double SwDateTimeField::GetValue() const
Beschreibung:
--------------------------------------------------------------------*/
-Date SwDateTimeField::GetDate(BOOL bUseOffset) const
+Date SwDateTimeField::GetDate(sal_Bool bUseOffset) const
{
SvNumberFormatter* pFormatter = GetDoc()->GetNumberFormatter();
Date* pNullDate = pFormatter->GetNullDate();
@@ -215,7 +215,7 @@ Date SwDateTimeField::GetDate(BOOL bUseOffset) const
Beschreibung:
--------------------------------------------------------------------*/
-Time SwDateTimeField::GetTime(BOOL bUseOffset) const
+Time SwDateTimeField::GetTime(sal_Bool bUseOffset) const
{
double fDummy;
double fFract = modf(GetValue(), &fDummy);
@@ -229,19 +229,19 @@ Time SwDateTimeField::GetTime(BOOL bUseOffset) const
/*-----------------04.03.98 11:05-------------------
--------------------------------------------------*/
-BOOL SwDateTimeField::QueryValue( uno::Any& rVal, USHORT nWhichId ) const
+sal_Bool SwDateTimeField::QueryValue( uno::Any& rVal, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
{
case FIELD_PROP_BOOL1:
{
- BOOL bTmp = IsFixed();
+ sal_Bool bTmp = IsFixed();
rVal.setValue(&bTmp, ::getCppuBooleanType());
}
break;
case FIELD_PROP_BOOL2:
{
- BOOL bTmp = IsDate();
+ sal_Bool bTmp = IsDate();
rVal.setValue(&bTmp, ::getCppuBooleanType());
}
break;
@@ -269,12 +269,12 @@ BOOL SwDateTimeField::QueryValue( uno::Any& rVal, USHORT nWhichId ) const
default:
return SwField::QueryValue(rVal, nWhichId);
}
- return TRUE;
+ return sal_True;
}
/*-----------------04.03.98 11:05-------------------
--------------------------------------------------*/
-BOOL SwDateTimeField::PutValue( const uno::Any& rVal, USHORT nWhichId )
+sal_Bool SwDateTimeField::PutValue( const uno::Any& rVal, sal_uInt16 nWhichId )
{
sal_Int32 nTmp = 0;
switch( nWhichId )
@@ -301,7 +301,7 @@ BOOL SwDateTimeField::PutValue( const uno::Any& rVal, USHORT nWhichId )
{
util::DateTime aDateTimeValue;
if(!(rVal >>= aDateTimeValue))
- return FALSE;
+ return sal_False;
DateTime aDateTime;
aDateTime.Set100Sec(aDateTimeValue.HundredthSeconds);
aDateTime.SetSec(aDateTimeValue.Seconds);
@@ -316,6 +316,6 @@ BOOL SwDateTimeField::PutValue( const uno::Any& rVal, USHORT nWhichId )
default:
return SwField::PutValue(rVal, nWhichId);
}
- return TRUE;
+ return sal_True;
}
diff --git a/sw/source/core/fields/flddropdown.cxx b/sw/source/core/fields/flddropdown.cxx
index 15b35c7999de..44e625edfccb 100644
--- a/sw/source/core/fields/flddropdown.cxx
+++ b/sw/source/core/fields/flddropdown.cxx
@@ -172,7 +172,7 @@ const String & SwDropDownField::GetToolTip() const
return aToolTip;
}
-BOOL SwDropDownField::SetSelectedItem(const String & rItem)
+sal_Bool SwDropDownField::SetSelectedItem(const String & rItem)
{
vector<String>::const_iterator aIt =
std::find(aValues.begin(), aValues.end(), rItem);
@@ -200,7 +200,7 @@ void SwDropDownField::SetToolTip(const String & rToolTip)
aToolTip = rToolTip;
}
-BOOL SwDropDownField::QueryValue(::uno::Any &rVal, USHORT nWhich) const
+sal_Bool SwDropDownField::QueryValue(::uno::Any &rVal, sal_uInt16 nWhich) const
{
nWhich &= ~CONVERT_TWIPS;
switch( nWhich )
@@ -228,8 +228,8 @@ BOOL SwDropDownField::QueryValue(::uno::Any &rVal, USHORT nWhich) const
return sal_True;
}
-BOOL SwDropDownField::PutValue(const uno::Any &rVal,
- USHORT nWhich)
+sal_Bool SwDropDownField::PutValue(const uno::Any &rVal,
+ sal_uInt16 nWhich)
{
switch( nWhich )
{
diff --git a/sw/source/core/fields/fldlst.cxx b/sw/source/core/fields/fldlst.cxx
index 2d55cdf70fa4..092f2d70d1f7 100644
--- a/sw/source/core/fields/fldlst.cxx
+++ b/sw/source/core/fields/fldlst.cxx
@@ -45,21 +45,21 @@
Beschreibung: Sortieren der Input-Eintraege
--------------------------------------------------------------------*/
-SwInputFieldList::SwInputFieldList( SwEditShell* pShell, BOOL bBuildTmpLst )
+SwInputFieldList::SwInputFieldList( SwEditShell* pShell, sal_Bool bBuildTmpLst )
: pSh(pShell)
{
// Hier die Liste aller Eingabefelder sortiert erstellen
pSrtLst = new _SetGetExpFlds();
const SwFldTypes& rFldTypes = *pSh->GetDoc()->GetFldTypes();
- const USHORT nSize = rFldTypes.Count();
+ const sal_uInt16 nSize = rFldTypes.Count();
// Alle Typen abklappern
- for(USHORT i=0; i < nSize; ++i)
+ for(sal_uInt16 i=0; i < nSize; ++i)
{
SwFieldType* pFldType = (SwFieldType*)rFldTypes[ i ];
- USHORT nType = pFldType->Which();
+ sal_uInt16 nType = pFldType->Which();
if( RES_SETEXPFLD == nType || RES_INPUTFLD == nType || RES_DROPDOWN == nType )
{
@@ -103,13 +103,13 @@ SwInputFieldList::~SwInputFieldList()
Beschreibung: Felder aus der Liste in sortierter Reihenfolge
--------------------------------------------------------------------*/
-USHORT SwInputFieldList::Count() const
+sal_uInt16 SwInputFieldList::Count() const
{
return pSrtLst->Count();
}
-SwField* SwInputFieldList::GetField(USHORT nId)
+SwField* SwInputFieldList::GetField(sal_uInt16 nId)
{
const SwTxtFld* pTxtFld = (*pSrtLst)[ nId ]->GetFld();
ASSERT( pTxtFld, "kein TextFld" );
@@ -128,14 +128,14 @@ void SwInputFieldList::PushCrsr()
void SwInputFieldList::PopCrsr()
{
- pSh->Pop(FALSE);
+ pSh->Pop(sal_False);
}
/*--------------------------------------------------------------------
Beschreibung: Position eines Feldes ansteuern
--------------------------------------------------------------------*/
-void SwInputFieldList::GotoFieldPos(USHORT nId)
+void SwInputFieldList::GotoFieldPos(sal_uInt16 nId)
{
pSh->StartAllAction();
(*pSrtLst)[ nId ]->GetPosOfContent( *pSh->GetCrsr()->GetPoint() );
@@ -145,17 +145,17 @@ void SwInputFieldList::GotoFieldPos(USHORT nId)
// vergleiche TmpLst mit akt Feldern. Alle neue kommen in die SortLst
// damit sie geupdatet werden koennen. Returnt die Anzahl.
// (Fuer Textbausteine: nur seine Input-Felder aktualisieren)
-USHORT SwInputFieldList::BuildSortLst()
+sal_uInt16 SwInputFieldList::BuildSortLst()
{
const SwFldTypes& rFldTypes = *pSh->GetDoc()->GetFldTypes();
- USHORT nSize = rFldTypes.Count();
+ sal_uInt16 nSize = rFldTypes.Count();
// Alle Typen abklappern
- for( USHORT i = 0; i < nSize; ++i )
+ for( sal_uInt16 i = 0; i < nSize; ++i )
{
SwFieldType* pFldType = (SwFieldType*)rFldTypes[ i ];
- USHORT nType = pFldType->Which();
+ sal_uInt16 nType = pFldType->Which();
if( RES_SETEXPFLD == nType || RES_INPUTFLD == nType )
{
@@ -175,7 +175,7 @@ USHORT SwInputFieldList::BuildSortLst()
VoidPtr pTmp = (VoidPtr)pTxtFld;
// nicht in der TempListe vorhanden, also in die SortListe
// aufnehemen
- USHORT nFndPos = aTmpLst.GetPos( pTmp );
+ sal_uInt16 nFndPos = aTmpLst.GetPos( pTmp );
if( USHRT_MAX == nFndPos )
{
SwNodeIndex aIdx( rTxtNode );
@@ -204,7 +204,7 @@ void SwInputFieldList::RemoveUnselectedFlds()
FOREACHPAM_START(pSh)
{
- for (USHORT i = 0; i < Count();)
+ for (sal_uInt16 i = 0; i < Count();)
{
_SetGetExpFld* pFld = (*pSrtLst)[i];
SwPosition aPos(*PCURCRSR->GetPoint());
diff --git a/sw/source/core/fields/macrofld.cxx b/sw/source/core/fields/macrofld.cxx
index f77bcf1fd457..17926457ea3f 100644
--- a/sw/source/core/fields/macrofld.cxx
+++ b/sw/source/core/fields/macrofld.cxx
@@ -63,7 +63,7 @@ SwFieldType* SwMacroFieldType::Copy() const
SwMacroField::SwMacroField(SwMacroFieldType* pInitType,
const String& rLibAndName, const String& rTxt) :
- SwField(pInitType), aMacro(rLibAndName), aText(rTxt), bIsScriptURL(FALSE)
+ SwField(pInitType), aMacro(rLibAndName), aText(rTxt), bIsScriptURL(sal_False)
{
bIsScriptURL = isScriptURL(aMacro);
}
@@ -96,9 +96,9 @@ String SwMacroField::GetLibName() const
if (aMacro.Len())
{
- USHORT nPos = aMacro.Len();
+ sal_uInt16 nPos = aMacro.Len();
- for (USHORT i = 0; i < 3 && nPos > 0; i++)
+ for (sal_uInt16 i = 0; i < 3 && nPos > 0; i++)
while (aMacro.GetChar(--nPos) != '.' && nPos > 0) ;
return aMacro.Copy(0, nPos );
@@ -118,9 +118,9 @@ String SwMacroField::GetMacroName() const
}
else
{
- USHORT nPos = aMacro.Len();
+ sal_uInt16 nPos = aMacro.Len();
- for (USHORT i = 0; i < 3 && nPos > 0; i++)
+ for (sal_uInt16 i = 0; i < 3 && nPos > 0; i++)
while (aMacro.GetChar(--nPos) != '.' && nPos > 0) ;
return aMacro.Copy( ++nPos );
@@ -175,7 +175,7 @@ String SwMacroField::GetPar2() const
/*-----------------05.03.98 13:38-------------------
--------------------------------------------------*/
-BOOL SwMacroField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
+sal_Bool SwMacroField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
{
@@ -194,12 +194,12 @@ BOOL SwMacroField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
default:
DBG_ERROR("illegal property");
}
- return TRUE;
+ return sal_True;
}
/*-----------------05.03.98 13:38-------------------
--------------------------------------------------*/
-BOOL SwMacroField::PutValue( const uno::Any& rAny, USHORT nWhichId )
+sal_Bool SwMacroField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
String sTmp;
switch( nWhichId )
@@ -221,7 +221,7 @@ BOOL SwMacroField::PutValue( const uno::Any& rAny, USHORT nWhichId )
DBG_ERROR("illegal property");
}
- return TRUE;
+ return sal_True;
}
// create an internally used macro name from the library and macro name parts
@@ -237,7 +237,7 @@ void SwMacroField::CreateMacroString(
rMacro += rMacroName;
}
-BOOL SwMacroField::isScriptURL( const String& str )
+sal_Bool SwMacroField::isScriptURL( const String& str )
{
uno::Reference< lang::XMultiServiceFactory > xSMgr =
::comphelper::getProcessServiceFactory();
@@ -254,8 +254,8 @@ BOOL SwMacroField::isScriptURL( const String& str )
if ( xUrl.is() )
{
- return TRUE;
+ return sal_True;
}
}
- return FALSE;
+ return sal_False;
}
diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx
index 722430f757d4..d83a38c777e6 100644
--- a/sw/source/core/fields/reffld.cxx
+++ b/sw/source/core/fields/reffld.cxx
@@ -75,7 +75,7 @@ using namespace ::com::sun::star::text;
using namespace ::com::sun::star::lang;
using ::rtl::OUString;
-extern void InsertSort( SvUShorts& rArr, USHORT nIdx, USHORT* pInsPos = 0 );
+extern void InsertSort( SvUShorts& rArr, sal_uInt16 nIdx, sal_uInt16* pInsPos = 0 );
void lcl_GetLayTree( const SwFrm* pFrm, SvPtrarr& rArr )
{
@@ -101,11 +101,16 @@ void lcl_GetLayTree( const SwFrm* pFrm, SvPtrarr& rArr )
}
-BOOL IsFrameBehind( const SwTxtNode& rMyNd, USHORT nMySttPos,
- const SwTxtNode& rBehindNd, USHORT nSttPos )
+sal_Bool IsFrameBehind( const SwTxtNode& rMyNd, sal_uInt16 nMySttPos,
+ const SwTxtNode& rBehindNd, sal_uInt16 nSttPos )
{
+<<<<<<< local
const SwTxtFrm *pMyFrm = (SwTxtFrm*)rMyNd.getLayoutFrm( rMyNd.GetDoc()->GetCurrentLayout(), 0,0,FALSE),
*pFrm = (SwTxtFrm*)rBehindNd.getLayoutFrm( rBehindNd.GetDoc()->GetCurrentLayout(), 0,0,FALSE);
+=======
+ const SwTxtFrm *pMyFrm = (SwTxtFrm*)rMyNd.GetFrm(0,0,sal_False),
+ *pFrm = (SwTxtFrm*)rBehindNd.GetFrm(0,0,sal_False);
+>>>>>>> other
while( pFrm && !pFrm->IsInside( nSttPos ) )
pFrm = (SwTxtFrm*)pFrm->GetFollow();
@@ -113,15 +118,15 @@ BOOL IsFrameBehind( const SwTxtNode& rMyNd, USHORT nMySttPos,
pMyFrm = (SwTxtFrm*)pMyFrm->GetFollow();
if( !pFrm || !pMyFrm || pFrm == pMyFrm )
- return FALSE;
+ return sal_False;
SvPtrarr aRefArr( 10, 10 ), aArr( 10, 10 );
::lcl_GetLayTree( pFrm, aRefArr );
::lcl_GetLayTree( pMyFrm, aArr );
- USHORT nRefCnt = aRefArr.Count() - 1, nCnt = aArr.Count() - 1;
- BOOL bVert = FALSE;
- BOOL bR2L = FALSE;
+ sal_uInt16 nRefCnt = aRefArr.Count() - 1, nCnt = aArr.Count() - 1;
+ sal_Bool bVert = sal_False;
+ sal_Bool bR2L = sal_False;
// solange bis ein Frame ungleich ist ?
while( nRefCnt && nCnt && aRefArr[ nRefCnt ] == aArr[ nCnt ] )
@@ -145,7 +150,7 @@ BOOL IsFrameBehind( const SwTxtNode& rMyNd, USHORT nMySttPos,
const SwFrm* pFldFrm = (const SwFrm*)aArr[ nCnt ];
// unterschiedliche Frames, dann ueberpruefe deren Y-/X-Position
- BOOL bRefIsLower = FALSE;
+ sal_Bool bRefIsLower = sal_False;
if( ( FRM_COLUMN | FRM_CELL ) & pFldFrm->GetType() ||
( FRM_COLUMN | FRM_CELL ) & pRefFrm->GetType() )
{
@@ -210,8 +215,8 @@ BOOL IsFrameBehind( const SwTxtNode& rMyNd, USHORT nMySttPos,
SwGetRefField::SwGetRefField( SwGetRefFieldType* pFldType,
- const String& rSetRef, USHORT nSubTyp,
- USHORT nSeqenceNo, ULONG nFmt )
+ const String& rSetRef, sal_uInt16 nSubTyp,
+ sal_uInt16 nSeqenceNo, sal_uLong nFmt )
: SwField( pFldType, nFmt ),
sSetRefName( rSetRef ),
nSubType( nSubTyp ),
@@ -228,12 +233,12 @@ String SwGetRefField::GetDescription() const
return SW_RES(STR_REFERENCE);
}
-USHORT SwGetRefField::GetSubType() const
+sal_uInt16 SwGetRefField::GetSubType() const
{
return nSubType;
}
-void SwGetRefField::SetSubType( USHORT n )
+void SwGetRefField::SetSubType( sal_uInt16 n )
{
nSubType = n;
}
@@ -254,7 +259,7 @@ bool SwGetRefField::IsRefToNumItemCrossRefBookmark() const
const SwTxtNode* SwGetRefField::GetReferencedTxtNode() const
{
SwDoc* pDoc = dynamic_cast<SwGetRefFieldType*>(GetTyp())->GetDoc();
- USHORT nDummy = USHRT_MAX;
+ sal_uInt16 nDummy = USHRT_MAX;
return SwGetRefFieldType::FindAnchor( pDoc, sSetRefName, nSubType, nSeqNo, &nDummy );
}
// <--
@@ -287,8 +292,8 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr )
sTxt.Erase();
SwDoc* pDoc = ((SwGetRefFieldType*)GetTyp())->GetDoc();
- USHORT nStt = USHRT_MAX;
- USHORT nEnd = USHRT_MAX;
+ sal_uInt16 nStt = USHRT_MAX;
+ sal_uInt16 nEnd = USHRT_MAX;
SwTxtNode* pTxtNd = SwGetRefFieldType::FindAnchor( pDoc, sSetRefName,
nSubType, nSeqNo, &nStt, &nEnd );
if ( !pTxtNd )
@@ -355,7 +360,7 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr )
case REF_ENDNOTE:
{
// die Nummer oder den NumString besorgen
- USHORT n, nFtnCnt = pDoc->GetFtnIdxs().Count();
+ sal_uInt16 n, nFtnCnt = pDoc->GetFtnIdxs().Count();
SwTxtFtn* pFtnIdx;
for( n = 0; n < nFtnCnt; ++n )
if( nSeqNo == (pFtnIdx = pDoc->GetFtnIdxs()[ n ])->GetSeqRefNo() )
@@ -391,14 +396,18 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr )
case REF_PAGE:
case REF_PAGE_PGDESC:
{
+<<<<<<< local
const SwTxtFrm* pFrm = (SwTxtFrm*)pTxtNd->getLayoutFrm( pDoc->GetCurrentLayout(), 0,0,FALSE),
+=======
+ const SwTxtFrm* pFrm = (SwTxtFrm*)pTxtNd->GetFrm(0,0,sal_False),
+>>>>>>> other
*pSave = pFrm;
while( pFrm && !pFrm->IsInside( nStt ) )
pFrm = (SwTxtFrm*)pFrm->GetFollow();
if( pFrm || 0 != ( pFrm = pSave ))
{
- USHORT nPageNo = pFrm->GetVirtPageNum();
+ sal_uInt16 nPageNo = pFrm->GetVirtPageNum();
const SwPageFrm *pPage;
if( REF_PAGE_PGDESC == GetFormat() &&
0 != ( pPage = pFrm->FindPageFrm() ) &&
@@ -419,7 +428,7 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr )
SwChapterFieldType aFldTyp;
SwChapterField aFld( &aFldTyp, 0 );
aFld.SetLevel( MAXLEVEL - 1 );
- aFld.ChangeExpansion( pFrm, pTxtNd, TRUE );
+ aFld.ChangeExpansion( pFrm, pTxtNd, sal_True );
sTxt = aFld.GetNumber();
}
}
@@ -576,7 +585,14 @@ String SwGetRefField::GetPar2() const
return Expand();
}
+<<<<<<< local
BOOL SwGetRefField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
+=======
+/*-----------------06.03.98 13:34-------------------
+
+--------------------------------------------------*/
+sal_Bool SwGetRefField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+>>>>>>> other
{
switch( nWhichId )
{
@@ -645,10 +661,15 @@ BOOL SwGetRefField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
default:
DBG_ERROR("illegal property");
}
- return TRUE;
+ return sal_True;
}
+<<<<<<< local
BOOL SwGetRefField::PutValue( const uno::Any& rAny, USHORT nWhichId )
+=======
+--------------------------------------------------*/
+sal_Bool SwGetRefField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+>>>>>>> other
{
String sTmp;
switch( nWhichId )
@@ -672,7 +693,7 @@ BOOL SwGetRefField::PutValue( const uno::Any& rAny, USHORT nWhichId )
case ReferenceFieldPart::NUMBER_NO_CONTEXT: nPart = REF_NUMBER_NO_CONTEXT; break;
case ReferenceFieldPart::NUMBER_FULL_CONTEXT: nPart = REF_NUMBER_FULL_CONTEXT; break;
// <--
- default: return FALSE;
+ default: return sal_False;
}
SetFormat(nPart);
}
@@ -720,7 +741,7 @@ BOOL SwGetRefField::PutValue( const uno::Any& rAny, USHORT nWhichId )
default:
DBG_ERROR("illegal property");
}
- return TRUE;
+ return sal_True;
}
void SwGetRefField::ConvertProgrammaticToUIName()
@@ -733,7 +754,7 @@ void SwGetRefField::ConvertProgrammaticToUIName()
if(!pDoc->GetFldType(RES_SETEXPFLD, rPar1, false))
{
sal_uInt16 nPoolId = SwStyleNameMapper::GetPoolIdFromProgName( rPar1, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
- USHORT nResId = USHRT_MAX;
+ sal_uInt16 nResId = USHRT_MAX;
switch( nPoolId )
{
case RES_POOLCOLL_LABEL_ABB:
@@ -796,8 +817,8 @@ void SwGetRefFieldType::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew
}
SwTxtNode* SwGetRefFieldType::FindAnchor( SwDoc* pDoc, const String& rRefMark,
- USHORT nSubType, USHORT nSeqNo,
- USHORT* pStt, USHORT* pEnd )
+ sal_uInt16 nSubType, sal_uInt16 nSeqNo,
+ sal_uInt16* pStt, sal_uInt16* pEnd )
{
ASSERT( pStt, "warum wird keine StartPos abgefragt?" );
@@ -849,7 +870,7 @@ SwTxtNode* SwGetRefFieldType::FindAnchor( SwDoc* pDoc, const String& rRefMark,
const ::sw::mark::IMark* pBkmk = ppMark->get();
const SwPosition* pPos = &pBkmk->GetMarkStart();
- pTxtNd = pDoc->GetNodes()[ pPos->nNode ]->GetTxtNode();
+ pTxtNd = pPos->nNode.GetNode().GetTxtNode();
*pStt = pPos->nContent.GetIndex();
if(pEnd)
{
@@ -880,7 +901,7 @@ SwTxtNode* SwGetRefFieldType::FindAnchor( SwDoc* pDoc, const String& rRefMark,
case REF_FOOTNOTE:
case REF_ENDNOTE:
{
- USHORT n, nFtnCnt = pDoc->GetFtnIdxs().Count();
+ sal_uInt16 n, nFtnCnt = pDoc->GetFtnIdxs().Count();
SwTxtFtn* pFtnIdx;
for( n = 0; n < nFtnCnt; ++n )
if( nSeqNo == (pFtnIdx = pDoc->GetFtnIdxs()[ n ])->GetSeqRefNo() )
@@ -910,24 +931,24 @@ struct _RefIdsMap
String aName;
SvUShortsSort aIds, aDstIds, aIdsMap;
SvUShorts aMap;
- BOOL bInit;
+ sal_Bool bInit;
_RefIdsMap( const String& rName )
: aName( rName ), aIds( 16, 16 ), aIdsMap( 16, 16 ), aMap( 16, 16 ),
- bInit( FALSE )
+ bInit( sal_False )
{}
void Check( SwDoc& rDoc, SwDoc& rDestDoc, SwGetRefField& rFld,
- BOOL bField = TRUE );
+ sal_Bool bField = sal_True );
- BOOL IsInit() const { return bInit; }
+ sal_Bool IsInit() const { return bInit; }
};
SV_DECL_PTRARR_DEL( _RefIdsMaps, _RefIdsMap*, 5, 5 )
SV_IMPL_PTRARR( _RefIdsMaps, _RefIdsMap* )
void _RefIdsMap::Check( SwDoc& rDoc, SwDoc& rDestDoc, SwGetRefField& rFld,
- BOOL bField )
+ sal_Bool bField )
{
if( !bInit )
@@ -957,19 +978,19 @@ void _RefIdsMap::Check( SwDoc& rDoc, SwDoc& rDestDoc, SwGetRefField& rFld,
}
else
{
- USHORT n;
+ sal_uInt16 n;
for( n = rDestDoc.GetFtnIdxs().Count(); n; )
aIds.Insert( rDestDoc.GetFtnIdxs()[ --n ]->GetSeqRefNo() );
for( n = rDoc.GetFtnIdxs().Count(); n; )
aDstIds.Insert( rDoc.GetFtnIdxs()[ --n ]->GetSeqRefNo() );
}
- bInit = TRUE;
+ bInit = sal_True;
}
// dann teste mal, ob die Nummer schon vergeben ist
// oder ob eine neue bestimmt werden muss.
- USHORT nPos, nSeqNo = rFld.GetSeqNo();
+ sal_uInt16 nPos, nSeqNo = rFld.GetSeqNo();
if( aIds.Seek_Entry( nSeqNo ) && aDstIds.Seek_Entry( nSeqNo ))
{
// ist schon vergeben, also muss eine neue
@@ -978,7 +999,7 @@ void _RefIdsMap::Check( SwDoc& rDoc, SwDoc& rDestDoc, SwGetRefField& rFld,
rFld.SetSeqNo( aMap[ nPos ] );
else
{
- USHORT n;
+ sal_uInt16 n;
for( n = 0; n < aIds.Count(); ++n )
if( n != aIds[ n ] )
@@ -1007,7 +1028,7 @@ void _RefIdsMap::Check( SwDoc& rDoc, SwDoc& rDestDoc, SwGetRefField& rFld,
else
{
SwTxtFtn* pFtnIdx;
- for( USHORT i = 0, nCnt = rDoc.GetFtnIdxs().Count(); i < nCnt; ++i )
+ for( sal_uInt16 i = 0, nCnt = rDoc.GetFtnIdxs().Count(); i < nCnt; ++i )
if( nSeqNo == (pFtnIdx = rDoc.GetFtnIdxs()[ i ])->GetSeqRefNo() )
{
pFtnIdx->SetSeqNo( n );
@@ -1045,7 +1066,7 @@ void SwGetRefFieldType::MergeWithOtherDoc( SwDoc& rDestDoc )
case REF_SEQUENCEFLD:
{
_RefIdsMap* pMap = 0;
- for( USHORT n = aFldMap.Count(); n; )
+ for( sal_uInt16 n = aFldMap.Count(); n; )
if( aFldMap[ --n ]->aName == rRefFld.GetSetRefName() )
{
pMap = aFldMap[ n ];
@@ -1057,13 +1078,13 @@ void SwGetRefFieldType::MergeWithOtherDoc( SwDoc& rDestDoc )
aFldMap.C40_INSERT( _RefIdsMap, pMap, aFldMap.Count() );
}
- pMap->Check( *pDoc, rDestDoc, rRefFld, TRUE );
+ pMap->Check( *pDoc, rDestDoc, rRefFld, sal_True );
}
break;
case REF_FOOTNOTE:
case REF_ENDNOTE:
- aFntMap.Check( *pDoc, rDestDoc, rRefFld, FALSE );
+ aFntMap.Check( *pDoc, rDestDoc, rRefFld, sal_False );
break;
}
}
diff --git a/sw/source/core/fields/scrptfld.cxx b/sw/source/core/fields/scrptfld.cxx
index f9d8258edcec..22c6ba695a05 100644
--- a/sw/source/core/fields/scrptfld.cxx
+++ b/sw/source/core/fields/scrptfld.cxx
@@ -60,7 +60,7 @@ SwFieldType* SwScriptFieldType::Copy() const
SwScriptField::SwScriptField( SwScriptFieldType* pInitType,
const String& rType, const String& rCode,
- BOOL bURL )
+ sal_Bool bURL )
: SwField( pInitType ), sType( rType ), sCode( rCode ), bCodeURL( bURL )
{
}
@@ -111,7 +111,7 @@ String SwScriptField::GetPar2() const
/*-----------------05.03.98 15:00-------------------
--------------------------------------------------*/
-BOOL SwScriptField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
+sal_Bool SwScriptField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
{
@@ -127,12 +127,12 @@ BOOL SwScriptField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
default:
DBG_ERROR("illegal property");
}
- return TRUE;
+ return sal_True;
}
/*-----------------05.03.98 15:00-------------------
--------------------------------------------------*/
-BOOL SwScriptField::PutValue( const uno::Any& rAny, USHORT nWhichId )
+sal_Bool SwScriptField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
switch( nWhichId )
{
@@ -148,6 +148,6 @@ BOOL SwScriptField::PutValue( const uno::Any& rAny, USHORT nWhichId )
default:
DBG_ERROR("illegal property");
}
- return TRUE;
+ return sal_True;
}
diff --git a/sw/source/core/fields/tblcalc.cxx b/sw/source/core/fields/tblcalc.cxx
index 8c0cc509a669..0f2b22dbdee8 100644
--- a/sw/source/core/fields/tblcalc.cxx
+++ b/sw/source/core/fields/tblcalc.cxx
@@ -70,7 +70,7 @@ void SwTblField::CalcField( SwTblCalcPara& rCalcPara )
SwTblField::SwTblField( SwTblFieldType* pInitType, const String& rFormel,
- USHORT nType, ULONG nFmt )
+ sal_uInt16 nType, sal_uLong nFmt )
: SwValueField( pInitType, nFmt ), SwTableFormula( rFormel ),
sExpand( '0' ), nSubType(nType)
{
@@ -147,12 +147,12 @@ String SwTblField::Expand() const
return aStr;
}
-USHORT SwTblField::GetSubType() const
+sal_uInt16 SwTblField::GetSubType() const
{
return nSubType;
}
-void SwTblField::SetSubType(USHORT nType)
+void SwTblField::SetSubType(sal_uInt16 nType)
{
nSubType = nType;
}
@@ -181,14 +181,21 @@ void SwTblField::SetPar2(const String& rStr)
}
+<<<<<<< local
BOOL SwTblField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
+=======
+/*-----------------04.03.98 10:33-------------------
+
+--------------------------------------------------*/
+sal_Bool SwTblField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+>>>>>>> other
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
switch ( nWhichId )
{
case FIELD_PROP_PAR2:
{
- USHORT nOldSubType = nSubType;
+ sal_uInt16 nOldSubType = nSubType;
SwTblField* pThis = (SwTblField*)this;
pThis->nSubType |= nsSwExtendedSubType::SUB_CMD;
rAny <<= rtl::OUString( Expand() );
@@ -197,7 +204,7 @@ BOOL SwTblField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
break;
case FIELD_PROP_BOOL1:
{
- BOOL bFormula = 0 != (nsSwExtendedSubType::SUB_CMD & nSubType);
+ sal_Bool bFormula = 0 != (nsSwExtendedSubType::SUB_CMD & nSubType);
rAny.setValue(&bFormula, ::getBooleanCppuType());
}
break;
@@ -213,9 +220,14 @@ BOOL SwTblField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
return bRet;
}
+<<<<<<< local
BOOL SwTblField::PutValue( const uno::Any& rAny, USHORT nWhichId )
+=======
+--------------------------------------------------*/
+sal_Bool SwTblField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+>>>>>>> other
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
String sTmp;
switch ( nWhichId )
{
diff --git a/sw/source/core/fields/usrfld.cxx b/sw/source/core/fields/usrfld.cxx
index 5bf26f17788f..2d5249d73e01 100644
--- a/sw/source/core/fields/usrfld.cxx
+++ b/sw/source/core/fields/usrfld.cxx
@@ -28,16 +28,16 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <svl/zforlist.hxx>
#include <svl/zformat.hxx>
-#include <svx/svdmodel.hxx>
+#include <svx/svdmodel.hxx>
#include <calbck.hxx>
#include <calc.hxx>
#include <usrfld.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <editsh.hxx>
#include <dpage.hxx>
#include <unofldmid.h>
@@ -129,19 +129,19 @@ void SwUserField::SetSubType(sal_uInt16 nSub)
/*-----------------09.03.98 08:04-------------------
--------------------------------------------------*/
-BOOL SwUserField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
+sal_Bool SwUserField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
{
case FIELD_PROP_BOOL2:
{
- BOOL bTmp = 0 != (nSubType & nsSwExtendedSubType::SUB_CMD);
+ sal_Bool bTmp = 0 != (nSubType & nsSwExtendedSubType::SUB_CMD);
rAny.setValue(&bTmp, ::getBooleanCppuType());
}
break;
case FIELD_PROP_BOOL1:
{
- BOOL bTmp = 0 == (nSubType & nsSwExtendedSubType::SUB_INVISIBLE);
+ sal_Bool bTmp = 0 == (nSubType & nsSwExtendedSubType::SUB_INVISIBLE);
rAny.setValue(&bTmp, ::getBooleanCppuType());
}
break;
@@ -156,7 +156,7 @@ BOOL SwUserField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
/*-----------------09.03.98 08:04-------------------
--------------------------------------------------*/
-sal_Bool SwUserField::PutValue( const uno::Any& rAny, USHORT nWhichId )
+sal_Bool SwUserField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
switch( nWhichId )
{
@@ -302,14 +302,16 @@ void SwUserFieldType::SetContent( const String& rStr, sal_uInt32 nFmt )
sal_Bool bModified = GetDoc()->IsModified();
GetDoc()->SetModified();
if( !bModified ) // Bug 57028
- GetDoc()->SetUndoNoResetModified();
+ {
+ GetDoc()->GetIDocumentUndoRedo().SetUndoNoResetModified();
+ }
}
}
/*-----------------04.03.98 17:05-------------------
--------------------------------------------------*/
-BOOL SwUserFieldType::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
+sal_Bool SwUserFieldType::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
{
@@ -321,7 +323,7 @@ BOOL SwUserFieldType::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
break;
case FIELD_PROP_BOOL1:
{
- BOOL bExpression = 0 != (nsSwGetSetExpType::GSE_EXPR&nType);
+ sal_Bool bExpression = 0 != (nsSwGetSetExpType::GSE_EXPR&nType);
rAny.setValue(&bExpression, ::getBooleanCppuType());
}
break;
@@ -333,7 +335,7 @@ BOOL SwUserFieldType::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
/*-----------------04.03.98 17:05-------------------
--------------------------------------------------*/
-BOOL SwUserFieldType::PutValue( const uno::Any& rAny, USHORT nWhichId )
+sal_Bool SwUserFieldType::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
switch( nWhichId )
{
diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx
index 8d27b1057a59..d7087ed03dd2 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -68,6 +68,7 @@
#include <txtflcnt.hxx>
#include <fesh.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <rootfrm.hxx>
#include <ndtxt.hxx>
#include <pam.hxx>
@@ -100,11 +101,11 @@ using namespace ::com::sun::star;
|
|*************************************************************************/
-BOOL SwFEShell::Copy( SwDoc* pClpDoc, const String* pNewClpTxt )
+sal_Bool SwFEShell::Copy( SwDoc* pClpDoc, const String* pNewClpTxt )
{
ASSERT( pClpDoc, "kein Clipboard-Dokument" );
- pClpDoc->DoUndo( FALSE ); // immer auf FALSE !!
+ pClpDoc->GetIDocumentUndoRedo().DoUndo(false); // always false!
// steht noch Inhalt im ClpDocument, dann muss dieser geloescht werden
SwNodeIndex aSttIdx( pClpDoc->GetNodes().GetEndOfExtras(), 2 );
@@ -120,7 +121,7 @@ BOOL SwFEShell::Copy( SwDoc* pClpDoc, const String* pNewClpTxt )
}
// stehen noch FlyFrames rum, loesche auch diese
- for( USHORT n = 0; n < pClpDoc->GetSpzFrmFmts()->Count(); ++n )
+ for( sal_uInt16 n = 0; n < pClpDoc->GetSpzFrmFmts()->Count(); ++n )
{
SwFlyFrmFmt* pFly = (SwFlyFrmFmt*)(*pClpDoc->GetSpzFrmFmts())[n];
pClpDoc->DelLayoutFmt( pFly );
@@ -133,12 +134,12 @@ BOOL SwFEShell::Copy( SwDoc* pClpDoc, const String* pNewClpTxt )
if( pNewClpTxt )
{
pTxtNd->InsertText( *pNewClpTxt, SwIndex( pTxtNd ) );
- return TRUE; // das wars.
+ return sal_True; // das wars.
}
pClpDoc->LockExpFlds();
pClpDoc->SetRedlineMode_intern( nsRedlineMode_t::REDLINE_DELETE_REDLINES );
- BOOL bRet;
+ sal_Bool bRet;
// soll ein FlyFrame kopiert werden ?
if( IsFrmSelected() )
@@ -167,7 +168,7 @@ BOOL SwFEShell::Copy( SwDoc* pClpDoc, const String* pNewClpTxt )
SwSpzFrmFmts& rSpzFrmFmts = *(SwSpzFrmFmts*)pClpDoc->GetSpzFrmFmts();
if( rSpzFrmFmts[ 0 ] != pFlyFmt )
{
- USHORT nPos = rSpzFrmFmts.GetPos( pFlyFmt );
+ sal_uInt16 nPos = rSpzFrmFmts.GetPos( pFlyFmt );
ASSERT( nPos != USHRT_MAX, "Fly steht nicht im Spz-Array" );
rSpzFrmFmts.Remove( nPos );
@@ -191,13 +192,13 @@ BOOL SwFEShell::Copy( SwDoc* pClpDoc, const String* pNewClpTxt )
pTxtNd->EraseText( rIdx, 1 );
}
}
- bRet = TRUE;
+ bRet = sal_True;
}
else if ( IsObjSelected() )
{
SwPosition aPos( aSttIdx, SwIndex( pTxtNd, 0 ));
const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
- for ( USHORT i = 0; i < rMrkList.GetMarkCount(); ++i )
+ for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i )
{
SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
@@ -211,7 +212,7 @@ BOOL SwFEShell::Copy( SwDoc* pClpDoc, const String* pNewClpTxt )
aSet.Put( aAnchor );
SdrObject *const pNew =
- pClpDoc->CloneSdrObj( *pObj, FALSE, TRUE );
+ pClpDoc->CloneSdrObj( *pObj, sal_False, sal_True );
SwPaM aTemp(aPos);
pClpDoc->Insert(aTemp, *pNew, &aSet, NULL);
@@ -232,7 +233,7 @@ BOOL SwFEShell::Copy( SwDoc* pClpDoc, const String* pNewClpTxt )
pClpDoc->CopyLayoutFmt( *pFmt, aAnchor, true, true );
}
}
- bRet = TRUE;
+ bRet = sal_True;
}
else
bRet = _CopySelToDoc( pClpDoc, 0 ); // kopiere die Selectionen
@@ -261,17 +262,21 @@ const Point &lcl_FindBasePos( const SwFrm *pFrm, const Point &rPt )
return pFrm->Frm().Pos();
}
-BOOL lcl_SetAnchor( const SwPosition& rPos, const SwNode& rNd, SwFlyFrm* pFly,
+sal_Bool lcl_SetAnchor( const SwPosition& rPos, const SwNode& rNd, SwFlyFrm* pFly,
const Point& rInsPt, SwFEShell& rDestShell, SwFmtAnchor& rAnchor,
- Point& rNewPos, BOOL bCheckFlyRecur )
+ Point& rNewPos, sal_Bool bCheckFlyRecur )
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
rAnchor.SetAnchor( &rPos );
+<<<<<<< local
SwCntntFrm* pTmpFrm = rNd.GetCntntNode()->getLayoutFrm( rDestShell.GetLayout(), &rInsPt, 0, FALSE );
+=======
+ SwCntntFrm* pTmpFrm = rNd.GetCntntNode()->GetFrm( &rInsPt, 0, sal_False );
+>>>>>>> other
SwFlyFrm *pTmpFly = pTmpFrm->FindFlyFrm();
if( pTmpFly && bCheckFlyRecur && pFly->IsUpperOf( *pTmpFly ) )
{
- bRet = FALSE;
+ bRet = sal_False;
}
else if ( FLY_AT_FLY == rAnchor.GetAnchorId() )
{
@@ -295,15 +300,15 @@ BOOL lcl_SetAnchor( const SwPosition& rPos, const SwNode& rNd, SwFlyFrm* pFly,
return bRet;
}
-BOOL SwFEShell::CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt,
- const Point& rInsPt, BOOL bIsMove, BOOL bSelectInsert )
+sal_Bool SwFEShell::CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt,
+ const Point& rInsPt, sal_Bool bIsMove, sal_Bool bSelectInsert )
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
//Die Liste muss kopiert werden, weil unten die neuen Objekte
//selektiert werden.
const SdrMarkList aMrkList( Imp()->GetDrawView()->GetMarkedObjectList() );
- ULONG nMarkCount = aMrkList.GetMarkCount();
+ sal_uLong nMarkCount = aMrkList.GetMarkCount();
if( !pDestShell->Imp()->GetDrawView() )
// sollte mal eine erzeugt werden
pDestShell->MakeDrawView();
@@ -317,7 +322,7 @@ BOOL SwFEShell::CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt,
SwDoc* pDestDoc = pDestShell->GetDoc();
Size aSiz( rInsPt.X() - rSttPt.X(), rInsPt.Y() - rSttPt.Y() );
- for( USHORT i = 0; i < nMarkCount; ++i )
+ for( sal_uInt16 i = 0; i < nMarkCount; ++i )
{
SdrObject *pObj = aMrkList.GetMark( i )->GetMarkedSdrObj();
@@ -325,7 +330,7 @@ BOOL SwFEShell::CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt,
SwFrmFmt *pFmt = pContact->GetFmt();
const SwFmtAnchor& rAnchor = pFmt->GetAnchor();
- BOOL bInsWithFmt = TRUE;
+ sal_Bool bInsWithFmt = sal_True;
if( pDestDrwView->IsGroupEntered() )
{
@@ -336,10 +341,10 @@ BOOL SwFEShell::CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt,
{
SdrObject* pNew = pDestDoc->CloneSdrObj( *pObj, bIsMove &&
- GetDoc() == pDestDoc, FALSE );
+ GetDoc() == pDestDoc, sal_False );
pNew->NbcMove( aSiz );
pDestDrwView->InsertObjectAtView( pNew, *pDestPgView );
- bInsWithFmt = FALSE;
+ bInsWithFmt = sal_False;
}
}
@@ -364,21 +369,21 @@ BOOL SwFEShell::CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt,
GetLayout()->GetCrsrOfst( &aPos, aPt, &aState );
const SwNode *pNd;
if( (pNd = &aPos.nNode.GetNode())->IsNoTxtNode() )
- bRet = FALSE;
+ bRet = sal_False;
else
bRet = ::lcl_SetAnchor( aPos, *pNd, 0, rInsPt,
- *pDestShell, aAnchor, aNewAnch, FALSE );
+ *pDestShell, aAnchor, aNewAnch, sal_False );
}
else
{
SwPaM *pCrsr = pDestShell->GetCrsr();
if( pCrsr->GetNode()->IsNoTxtNode() )
- bRet = FALSE;
+ bRet = sal_False;
else
bRet = ::lcl_SetAnchor( *pCrsr->GetPoint(),
*pCrsr->GetNode(), 0, rInsPt,
*pDestShell, aAnchor,
- aNewAnch, FALSE );
+ aNewAnch, sal_False );
}
}
else if ( FLY_AT_PAGE == aAnchor.GetAnchorId() )
@@ -398,7 +403,7 @@ BOOL SwFEShell::CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt,
SfxItemSet aSet( pDestDoc->GetAttrPool(),aFrmFmtSetRange);
aSet.Put( aAnchor );
SdrObject* pNew = pDestDoc->CloneSdrObj( *pObj, bIsMove &&
- GetDoc() == pDestDoc, TRUE );
+ GetDoc() == pDestDoc, sal_True );
pFmt = pDestDoc->Insert( *pDestShell->GetCrsr(),
*pNew, &aSet, NULL );
}
@@ -440,8 +445,8 @@ BOOL SwFEShell::CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt,
const SdrMarkList aList( pSrcDrwView->GetMarkedObjectList() );
pSrcDrwView->UnmarkAll();
- ULONG nMrkCnt = aMrkList.GetMarkCount();
- USHORT i;
+ sal_uLong nMrkCnt = aMrkList.GetMarkCount();
+ sal_uInt16 i;
for ( i = 0; i < nMrkCnt; ++i )
{
SdrObject *pObj = aMrkList.GetMark( i )->GetMarkedSdrObj();
@@ -462,10 +467,10 @@ BOOL SwFEShell::CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt,
return bRet;
}
-BOOL SwFEShell::Copy( SwFEShell* pDestShell, const Point& rSttPt,
- const Point& rInsPt, BOOL bIsMove, BOOL bSelectInsert )
+sal_Bool SwFEShell::Copy( SwFEShell* pDestShell, const Point& rSttPt,
+ const Point& rInsPt, sal_Bool bIsMove, sal_Bool bSelectInsert )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
ASSERT( pDestShell, "Copy ohne DestShell." );
ASSERT( this == pDestShell || !pDestShell->IsObjSelected(),
@@ -477,10 +482,10 @@ BOOL SwFEShell::Copy( SwFEShell* pDestShell, const Point& rSttPt,
pDestShell->GetDoc()->LockExpFlds();
// Referenzen sollen verschoben werden.
- BOOL bCopyIsMove = pDoc->IsCopyIsMove();
+ sal_Bool bCopyIsMove = pDoc->IsCopyIsMove();
if( bIsMove )
// am Doc ein Flag setzen, damit in den TextNodes
- pDoc->SetCopyIsMove( TRUE );
+ pDoc->SetCopyIsMove( sal_True );
RedlineMode_t eOldRedlMode = pDestShell->GetDoc()->GetRedlineMode();
pDestShell->GetDoc()->SetRedlineMode_intern( (RedlineMode_t)(eOldRedlMode | nsRedlineMode_t::REDLINE_DELETE_REDLINES));
@@ -496,7 +501,7 @@ BOOL SwFEShell::Copy( SwFEShell* pDestShell, const Point& rSttPt,
SwFlyFrm* pFly = FindFlyFrm();
SwFrmFmt* pFlyFmt = pFly->GetFmt();
SwFmtAnchor aAnchor( pFlyFmt->GetAnchor() );
- bRet = TRUE;
+ bRet = sal_True;
Point aNewAnch;
if ((FLY_AT_PARA == aAnchor.GetAnchorId()) ||
@@ -515,25 +520,25 @@ BOOL SwFEShell::Copy( SwFEShell* pDestShell, const Point& rSttPt,
GetLayout()->GetCrsrOfst( &aPos, aPt, &aState );
const SwNode *pNd;
if( (pNd = &aPos.nNode.GetNode())->IsNoTxtNode() )
- bRet = FALSE;
+ bRet = sal_False;
else
{ //Nicht in sich selbst kopieren
const SwNodeIndex *pTmp = pFlyFmt->GetCntnt().GetCntntIdx();
if ( aPos.nNode > *pTmp && aPos.nNode <
pTmp->GetNode().EndOfSectionIndex() )
{
- bRet = FALSE;
+ bRet = sal_False;
}
else
bRet = ::lcl_SetAnchor( aPos, *pNd, pFly, rInsPt,
- *pDestShell, aAnchor, aNewAnch, TRUE );
+ *pDestShell, aAnchor, aNewAnch, sal_True );
}
}
else
{
const SwPaM *pCrsr = pDestShell->GetCrsr();
if( pCrsr->GetNode()->IsNoTxtNode() )
- bRet = FALSE;
+ bRet = sal_False;
else
bRet = ::lcl_SetAnchor( *pCrsr->GetPoint(), *pCrsr->GetNode(),
pFly, rInsPt, *pDestShell, aAnchor,
@@ -575,12 +580,12 @@ BOOL SwFEShell::Copy( SwFEShell* pDestShell, const Point& rSttPt,
// kopiert wird
if( bSelectInsert )
{
- SwFlyFrm* pFlyFrm = ((SwFlyFrmFmt*)pFlyFmt)->GetFrm( &aPt, FALSE );
+ SwFlyFrm* pFlyFrm = ((SwFlyFrmFmt*)pFlyFmt)->GetFrm( &aPt, sal_False );
if( pFlyFrm )
{
//JP 12.05.98: sollte das nicht im SelectFlyFrm stehen???
pDestShell->Imp()->GetDrawView()->UnmarkAll();
- pDestShell->SelectFlyFrm( *pFlyFrm, TRUE );
+ pDestShell->SelectFlyFrm( *pFlyFrm, sal_True );
}
}
@@ -612,12 +617,12 @@ BOOL SwFEShell::Copy( SwFEShell* pDestShell, const Point& rSttPt,
Point aPt( rInsPt );
GetLayout()->GetCrsrOfst( pDstPos, aPt );
if( !pDstPos->nNode.GetNode().IsNoTxtNode() )
- bRet = TRUE;
+ bRet = sal_True;
}
else if( !pDestShell->GetCrsr()->GetNode()->IsNoTxtNode() )
{
pDstPos = new SwPosition( *pDestShell->GetCrsr()->GetPoint() );
- bRet = TRUE;
+ bRet = sal_True;
}
if( bRet )
@@ -648,7 +653,7 @@ BOOL SwFEShell::Copy( SwFEShell* pDestShell, const Point& rSttPt,
}
else
{
- bRet = TRUE;
+ bRet = sal_True;
if( this == pDestShell )
{
// gleiche Shell? Dann erfrage die Position an der
@@ -659,7 +664,7 @@ BOOL SwFEShell::Copy( SwFEShell* pDestShell, const Point& rSttPt,
bRet = !aPos.nNode.GetNode().IsNoTxtNode();
}
else if( pDestShell->GetCrsr()->GetNode()->IsNoTxtNode() )
- bRet = FALSE;
+ bRet = sal_False;
if( bRet )
bRet = 0 != SwEditShell::Copy( pDestShell );
@@ -673,7 +678,7 @@ BOOL SwFEShell::Copy( SwFEShell* pDestShell, const Point& rSttPt,
{
// alte Actions beenden; die Tabellen-Frames werden angelegt und
// eine SSelection kann erzeugt werden
- USHORT nActCnt;
+ sal_uInt16 nActCnt;
for( nActCnt = 0; pDestShell->ActionPend(); ++nActCnt )
pDestShell->EndAllAction();
@@ -703,11 +708,11 @@ namespace {
typedef std::pair< PaMPtr, PositionPtr > Insertion;
}
-BOOL SwFEShell::Paste( SwDoc* pClpDoc, BOOL bIncludingPageFrames )
+sal_Bool SwFEShell::Paste( SwDoc* pClpDoc, sal_Bool bIncludingPageFrames )
{
SET_CURR_SHELL( this );
ASSERT( pClpDoc, "kein Clipboard-Dokument" );
- const USHORT nStartPageNumber = GetPhyPageNum();
+ const sal_uInt16 nStartPageNumber = GetPhyPageNum();
// dann bis zum Ende vom Nodes Array
SwNodeIndex aIdx( pClpDoc->GetNodes().GetEndOfExtras(), 2 );
SwPaM aCpyPam( aIdx ); //DocStart
@@ -731,9 +736,9 @@ BOOL SwFEShell::Paste( SwDoc* pClpDoc, BOOL bIncludingPageFrames )
aCpyPam.SetMark();
aCpyPam.Move( fnMoveForward, fnGoDoc );
- BOOL bRet = TRUE, bDelTbl = TRUE;
+ sal_Bool bRet = sal_True, bDelTbl = sal_True;
StartAllAction();
- GetDoc()->StartUndo( UNDO_INSGLOSSARY, NULL );
+ GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_INSGLOSSARY, NULL );
GetDoc()->LockExpFlds();
// When the clipboard content has been created by a rectangular selection
@@ -768,7 +773,7 @@ BOOL SwFEShell::Paste( SwDoc* pClpDoc, BOOL bIncludingPageFrames )
SwPosition aStartPos( *pStartCursor->GetPoint() );
SwPosition aInsertPos( aStartPos ); // first insertion position
bool bCompletePara = false;
- USHORT nMove = 0;
+ sal_uInt16 nMove = 0;
while( nCount )
{
--nCount;
@@ -786,7 +791,7 @@ BOOL SwFEShell::Paste( SwDoc* pClpDoc, BOOL bIncludingPageFrames )
SwCursor aCrsr( aStartPos, 0, false);
// Check if we find another insert position by moving
// down the last given position
- if( aCrsr.UpDown( FALSE, ++nMove, 0, 0 ) )
+ if( aCrsr.UpDown( sal_False, ++nMove, 0, 0 ) )
aInsertPos = *aCrsr.GetPoint();
else // if there is no paragraph we have to create it
bCompletePara = nCount > 0;
@@ -854,7 +859,7 @@ BOOL SwFEShell::Paste( SwDoc* pClpDoc, BOOL bIncludingPageFrames )
{
SwPosition aDestPos( *PCURCRSR->GetPoint() );
- BOOL bParkTblCrsr = FALSE;
+ sal_Bool bParkTblCrsr = sal_False;
const SwStartNode* pSttNd = PCURCRSR->GetNode()->FindTableBoxStartNode();
// TABLE IN TABLE: Tabelle in Tabelle kopieren
@@ -864,7 +869,7 @@ BOOL SwFEShell::Paste( SwDoc* pClpDoc, BOOL bIncludingPageFrames )
{
GetTblSel( *this, aBoxes );
ParkTblCrsr();
- bParkTblCrsr = TRUE;
+ bParkTblCrsr = sal_True;
}
else if( !PCURCRSR->HasMark() && PCURCRSR->GetNext() == PCURCRSR &&
( !pSrcNd->GetTable().IsTblComplex() ||
@@ -890,7 +895,7 @@ BOOL SwFEShell::Paste( SwDoc* pClpDoc, BOOL bIncludingPageFrames )
}
bRet = GetDoc()->InsCopyOfTbl( aDestPos, aBoxes, &pSrcNd->GetTable(),
- FALSE, FALSE );
+ sal_False, sal_False );
if( bParkTblCrsr )
GetCrsr();
@@ -917,9 +922,9 @@ BOOL SwFEShell::Paste( SwDoc* pClpDoc, BOOL bIncludingPageFrames )
if( !Imp()->GetDrawView() )
MakeDrawView();
- for ( USHORT i = 0; i < pClpDoc->GetSpzFrmFmts()->Count(); ++i )
+ for ( sal_uInt16 i = 0; i < pClpDoc->GetSpzFrmFmts()->Count(); ++i )
{
- BOOL bInsWithFmt = TRUE;
+ sal_Bool bInsWithFmt = sal_True;
const SwFrmFmt& rCpyFmt = *(*pClpDoc->GetSpzFrmFmts())[i];
if( Imp()->GetDrawView()->IsGroupEntered() &&
@@ -930,7 +935,7 @@ BOOL SwFEShell::Paste( SwDoc* pClpDoc, BOOL bIncludingPageFrames )
if( pSdrObj )
{
SdrObject* pNew = GetDoc()->CloneSdrObj( *pSdrObj,
- FALSE, FALSE );
+ sal_False, sal_False );
// Insert object sets any anchor position to 0.
// Therefore we calculate the absolute position here
@@ -965,7 +970,7 @@ BOOL SwFEShell::Paste( SwDoc* pClpDoc, BOOL bIncludingPageFrames )
pNew->NbcSetAnchorPos( aGrpAnchor );
pNew->SetSnapRect( aSnapRect );
- bInsWithFmt = FALSE;
+ bInsWithFmt = sal_False;
}
}
@@ -993,7 +998,7 @@ BOOL SwFEShell::Paste( SwDoc* pClpDoc, BOOL bIncludingPageFrames )
{
Point aPt;
lcl_SetAnchor( *PCURCRSR->GetPoint(), *PCURCRSR->GetNode(),
- 0, aPt, *this, aAnchor, aPt, FALSE );
+ 0, aPt, *this, aAnchor, aPt, sal_False );
}
SwFrmFmt * pNew = GetDoc()->CopyLayoutFmt( rCpyFmt, aAnchor, true, true );
@@ -1004,9 +1009,9 @@ BOOL SwFEShell::Paste( SwDoc* pClpDoc, BOOL bIncludingPageFrames )
{
const Point aPt( GetCrsrDocPos() );
SwFlyFrm* pFlyFrm = ((SwFlyFrmFmt*)pNew)->
- GetFrm( &aPt, FALSE );
+ GetFrm( &aPt, sal_False );
if( pFlyFrm )
- SelectFlyFrm( *pFlyFrm, TRUE );
+ SelectFlyFrm( *pFlyFrm, sal_True );
// immer nur den ersten Fly-Frame nehmen; die anderen
// wurden ueber Fly in Fly ins ClipBoard kopiert !
break;
@@ -1042,7 +1047,7 @@ BOOL SwFEShell::Paste( SwDoc* pClpDoc, BOOL bIncludingPageFrames )
if( bDelTbl && IsTableMode() )
{
SwEditShell::Delete();
- bDelTbl = FALSE;
+ bDelTbl = sal_False;
}
SwPosition& rInsPos = *PCURCRSR->GetPoint();
@@ -1090,9 +1095,9 @@ BOOL SwFEShell::Paste( SwDoc* pClpDoc, BOOL bIncludingPageFrames )
if( !Imp()->GetDrawView() )
MakeDrawView();
- for ( USHORT i = 0; i < pClpDoc->GetSpzFrmFmts()->Count(); ++i )
+ for ( sal_uInt16 i = 0; i < pClpDoc->GetSpzFrmFmts()->Count(); ++i )
{
- BOOL bInsWithFmt = TRUE;
+ sal_Bool bInsWithFmt = sal_True;
const SwFrmFmt& rCpyFmt = *(*pClpDoc->GetSpzFrmFmts())[i];
if( bInsWithFmt )
{
@@ -1112,14 +1117,14 @@ BOOL SwFEShell::Paste( SwDoc* pClpDoc, BOOL bIncludingPageFrames )
FOREACHPAM_END()
}
- GetDoc()->EndUndo( UNDO_INSGLOSSARY, NULL );
+ GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_INSGLOSSARY, NULL );
// wurden neue Tabellenformeln eingefuegt ?
if( pTblFldTyp->GetDepends() )
{
// alte Actions beenden; die Tabellen-Frames werden angelegt und
// eine Selection kann erzeugt werden
- USHORT nActCnt;
+ sal_uInt16 nActCnt;
for( nActCnt = 0; ActionPend(); ++nActCnt )
EndAllAction();
@@ -1136,25 +1141,25 @@ BOOL SwFEShell::Paste( SwDoc* pClpDoc, BOOL bIncludingPageFrames )
/*-- 14.06.2004 13:31:17---------------------------------------------------
-----------------------------------------------------------------------*/
-BOOL SwFEShell::PastePages( SwFEShell& rToFill, USHORT nStartPage, USHORT nEndPage)
+sal_Bool SwFEShell::PastePages( SwFEShell& rToFill, sal_uInt16 nStartPage, sal_uInt16 nEndPage)
{
Push();
if(!GotoPage(nStartPage))
{
Pop(sal_False);
- return FALSE;
+ return sal_False;
}
MovePage( fnPageCurr, fnPageStart );
SwPaM aCpyPam( *GetCrsr()->GetPoint() );
String sStartingPageDesc = GetPageDesc( GetCurPageDesc()).GetName();
- SwPageDesc* pDesc = rToFill.FindPageDescByName( sStartingPageDesc, TRUE );
+ SwPageDesc* pDesc = rToFill.FindPageDescByName( sStartingPageDesc, sal_True );
if( pDesc )
rToFill.ChgCurPageDesc( *pDesc );
if(!GotoPage(nEndPage))
{
Pop(sal_False);
- return FALSE;
+ return sal_False;
}
//if the page starts with a table a paragraph has to be inserted before
SwNode* pTableNode = aCpyPam.GetNode()->FindTableNode();
@@ -1201,7 +1206,7 @@ BOOL SwFEShell::PastePages( SwFEShell& rToFill, USHORT nStartPage, USHORT nEndPa
if( !rToFill.Imp()->GetDrawView() )
rToFill.MakeDrawView();
- for ( USHORT i = 0; i < GetDoc()->GetSpzFrmFmts()->Count(); ++i )
+ for ( sal_uInt16 i = 0; i < GetDoc()->GetSpzFrmFmts()->Count(); ++i )
{
const SwFrmFmt& rCpyFmt = *(*GetDoc()->GetSpzFrmFmts())[i];
SwFmtAnchor aAnchor( rCpyFmt.GetAnchor() );
@@ -1220,14 +1225,14 @@ BOOL SwFEShell::PastePages( SwFEShell& rToFill, USHORT nStartPage, USHORT nEndPa
Pop(sal_False);
EndAllAction();
- return TRUE;
+ return sal_True;
}
-BOOL SwFEShell::GetDrawObjGraphic( ULONG nFmt, Graphic& rGrf ) const
+sal_Bool SwFEShell::GetDrawObjGraphic( sal_uLong nFmt, Graphic& rGrf ) const
{
ASSERT( Imp()->HasDrawView(), "GetDrawObjGraphic without DrawView?" );
const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
- BOOL bConvert = TRUE;
+ sal_Bool bConvert = sal_True;
if( rMrkList.GetMarkCount() )
{
if( rMrkList.GetMarkCount() == 1 &&
@@ -1246,7 +1251,7 @@ BOOL SwFEShell::GetDrawObjGraphic( ULONG nFmt, Graphic& rGrf ) const
if( GRAPHIC_BITMAP != aGrf.GetType() )
{
rGrf = aGrf;
- bConvert = FALSE;
+ bConvert = sal_False;
}
else if( GetWin() )
{
@@ -1255,7 +1260,7 @@ BOOL SwFEShell::GetDrawObjGraphic( ULONG nFmt, Graphic& rGrf ) const
GetGrfSize( aSz );
VirtualDevice aVirtDev;
- aVirtDev.EnableOutput( FALSE );
+ aVirtDev.EnableOutput( sal_False );
MapMode aTmp( GetWin()->GetMapMode() );
aTmp.SetOrigin( aPt );
@@ -1273,7 +1278,7 @@ BOOL SwFEShell::GetDrawObjGraphic( ULONG nFmt, Graphic& rGrf ) const
else if( GRAPHIC_BITMAP == aGrf.GetType() )
{
rGrf = aGrf;
- bConvert = FALSE;
+ bConvert = sal_False;
}
else
{
@@ -1293,7 +1298,7 @@ BOOL SwFEShell::GetDrawObjGraphic( ULONG nFmt, Graphic& rGrf ) const
else
{
rGrf = aGrf;
- bConvert = FALSE;
+ bConvert = sal_False;
}
}
}
@@ -1347,7 +1352,7 @@ void lcl_ConvertSdrOle2ObjsToSdrGrafObjs( SdrModel* _pModel )
}
}
// <--
-void SwFEShell::Paste( SvStream& rStrm, USHORT nAction, const Point* pPt )
+void SwFEShell::Paste( SvStream& rStrm, sal_uInt16 nAction, const Point* pPt )
{
SET_CURR_SHELL( this );
StartAllAction();
@@ -1462,7 +1467,7 @@ void SwFEShell::Paste( SvStream& rStrm, USHORT nAction, const Point* pPt )
pFmt = GetDoc()->Insert( *GetCrsr(), *pNewObj, &aFrmSet, NULL );
}
else
- pView->ReplaceObjectAtView( pOldObj, *Imp()->GetPageView(), pNewObj, TRUE );
+ pView->ReplaceObjectAtView( pOldObj, *Imp()->GetPageView(), pNewObj, sal_True );
}
break;
@@ -1470,7 +1475,7 @@ void SwFEShell::Paste( SvStream& rStrm, USHORT nAction, const Point* pPt )
{
SfxItemSet aSet( GetAttrPool() );
aSet.Put(pClpObj->GetMergedItemSet());
- pView->SetAttributes( aSet, FALSE );
+ pView->SetAttributes( aSet, sal_False );
}
break;
@@ -1484,7 +1489,7 @@ void SwFEShell::Paste( SvStream& rStrm, USHORT nAction, const Point* pPt )
if( SW_PASTESDR_INSERT == nAction )
{
- GetDoc()->SetNoDrawUndoObj( TRUE );
+ ::sw::DrawUndoGuard drawUndoGuard(GetDoc()->GetIDocumentUndoRedo());
sal_Bool bDesignMode = pView->IsDesignMode();
if( !bDesignMode )
@@ -1497,11 +1502,11 @@ void SwFEShell::Paste( SvStream& rStrm, USHORT nAction, const Point* pPt )
// <--
pView->Paste( *pModel, aPos );
- ULONG nCnt = pView->GetMarkedObjectList().GetMarkCount();
+ sal_uLong nCnt = pView->GetMarkedObjectList().GetMarkCount();
if( nCnt )
{
const Point aNull( 0, 0 );
- for( ULONG i=0; i < nCnt; ++i )
+ for( sal_uLong i=0; i < nCnt; ++i )
{
SdrObject *pObj = pView->GetMarkedObjectList().GetMark(i)->GetMarkedSdrObj();
pObj->ImpSetAnchorPos( aNull );
@@ -1525,20 +1530,19 @@ void SwFEShell::Paste( SvStream& rStrm, USHORT nAction, const Point* pPt )
if( !bDesignMode )
pView->SetDesignMode( sal_False );
}
- GetDoc()->SetNoDrawUndoObj( FALSE );
}
EndUndo();
EndAllAction();
delete pModel;
}
-BOOL SwFEShell::Paste( const Graphic &rGrf )
+sal_Bool SwFEShell::Paste( const Graphic &rGrf )
{
SET_CURR_SHELL( this );
SdrObject* pObj;
SdrView *pView = Imp()->GetDrawView();
- BOOL bRet = 1 == pView->GetMarkedObjectList().GetMarkCount() &&
+ sal_Bool bRet = 1 == pView->GetMarkedObjectList().GetMarkCount() &&
(pObj = pView->GetMarkedObjectList().GetMark( 0 )->GetMarkedSdrObj())->IsClosedObj() &&
!pObj->ISA( SdrOle2Obj );
@@ -1548,7 +1552,7 @@ BOOL SwFEShell::Paste( const Graphic &rGrf )
SfxItemSet aSet( GetAttrPool(), XATTR_FILLSTYLE, XATTR_FILLBITMAP );
aSet.Put( XFillStyleItem( XFILL_BITMAP ));
aSet.Put( XFillBitmapItem( aEmptyStr, aXOBitmap ));
- pView->SetAttributes( aSet, FALSE );
+ pView->SetAttributes( aSet, sal_False );
}
return bRet;
}
diff --git a/sw/source/core/frmedt/fedesc.cxx b/sw/source/core/frmedt/fedesc.cxx
index 4d90a916feee..30737bb8209f 100644
--- a/sw/source/core/frmedt/fedesc.cxx
+++ b/sw/source/core/frmedt/fedesc.cxx
@@ -28,11 +28,12 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <tools/ref.hxx>
#include <hintids.hxx>
-#include <tools/ref.hxx>
#include <fesh.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <pagefrm.hxx>
#include <rootfrm.hxx>
#include <cntfrm.hxx>
@@ -42,6 +43,7 @@
#include <tabfrm.hxx>
#include <edimp.hxx>
#include <SwStyleNameMapper.hxx>
+
/*************************************************************************
|*
|* SwFEShell::GetPageDescCnt()
@@ -51,7 +53,7 @@
|*
|*************************************************************************/
-USHORT SwFEShell::GetPageDescCnt() const
+sal_uInt16 SwFEShell::GetPageDescCnt() const
{
return GetDoc()->GetPageDescCnt();
}
@@ -70,10 +72,10 @@ void SwFEShell::ChgCurPageDesc( const SwPageDesc& rDesc )
#ifdef DBG_UTIL
//Die SS veraendert keinen PageDesc, sondern setzt nur das Attribut.
//Der Pagedesc muss im Dokument vorhanden sein!
- BOOL bFound = FALSE;
- for ( USHORT nTst = 0; nTst < GetPageDescCnt(); ++nTst )
+ sal_Bool bFound = sal_False;
+ for ( sal_uInt16 nTst = 0; nTst < GetPageDescCnt(); ++nTst )
if ( &rDesc == &GetPageDesc( nTst ) )
- bFound = TRUE;
+ bFound = sal_True;
ASSERT( bFound, "ChgCurPageDesc mit ungueltigem Descriptor." );
#endif
@@ -81,7 +83,7 @@ void SwFEShell::ChgCurPageDesc( const SwPageDesc& rDesc )
SwPageFrm *pPage = GetCurrFrm()->FindPageFrm();
const SwFrm *pFlow = 0;
- USHORT nPageNmOffset = 0;
+ sal_uInt16 nPageNmOffset = 0;
ASSERT( !GetCrsr()->HasMark(), "ChgCurPageDesc nur ohne Selektion!");
@@ -138,17 +140,17 @@ void SwFEShell::ChgCurPageDesc( const SwPageDesc& rDesc )
|*
|*************************************************************************/
-void SwFEShell::ChgPageDesc( USHORT i, const SwPageDesc &rChged )
+void SwFEShell::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged )
{
StartAllAction();
SET_CURR_SHELL( this );
//Fix i64842: because Undo has a very special way to handle header/footer content
// we have to copy the page descriptor before calling ChgPageDesc.
- const sal_Bool bDoesUndo( GetDoc()->DoesUndo() );
SwPageDesc aDesc( rChged );
- GetDoc()->DoUndo( sal_False );
- GetDoc()->CopyPageDesc(rChged, aDesc);
- GetDoc()->DoUndo( bDoesUndo );
+ {
+ ::sw::UndoGuard const undoGuard(GetDoc()->GetIDocumentUndoRedo());
+ GetDoc()->CopyPageDesc(rChged, aDesc);
+ }
GetDoc()->ChgPageDesc( i, aDesc );
EndAllActionAndCall();
}
@@ -162,19 +164,19 @@ void SwFEShell::ChgPageDesc( USHORT i, const SwPageDesc &rChged )
|
|*************************************************************************/
-const SwPageDesc& SwFEShell::GetPageDesc( USHORT i ) const
+const SwPageDesc& SwFEShell::GetPageDesc( sal_uInt16 i ) const
{
return const_cast<const SwDoc *>(GetDoc())->GetPageDesc( i );
}
SwPageDesc* SwFEShell::FindPageDescByName( const String& rName,
- BOOL bGetFromPool,
- USHORT* pPos )
+ sal_Bool bGetFromPool,
+ sal_uInt16* pPos )
{
SwPageDesc* pDesc = GetDoc()->FindPageDescByName( rName, pPos );
if( !pDesc && bGetFromPool )
{
- USHORT nPoolId = SwStyleNameMapper::GetPoolIdFromUIName( rName, nsSwGetPoolIdFromName::GET_POOLID_PAGEDESC );
+ sal_uInt16 nPoolId = SwStyleNameMapper::GetPoolIdFromUIName( rName, nsSwGetPoolIdFromName::GET_POOLID_PAGEDESC );
if( USHRT_MAX != nPoolId &&
0 != (pDesc = GetDoc()->GetPageDescFromPool( nPoolId ))
&& pPos )
@@ -184,7 +186,7 @@ SwPageDesc* SwFEShell::FindPageDescByName( const String& rName,
return pDesc;
}
-USHORT SwFEShell::GetMousePageDesc( const Point &rPt ) const
+sal_uInt16 SwFEShell::GetMousePageDesc( const Point &rPt ) const
{
if( GetLayout() )
{
@@ -195,7 +197,7 @@ USHORT SwFEShell::GetMousePageDesc( const Point &rPt ) const
while( pPage->GetNext() && rPt.Y() > pPage->Frm().Bottom() )
pPage = static_cast<const SwPageFrm*>( pPage->GetNext() );
SwDoc *pMyDoc = GetDoc();
- for ( USHORT i = 0; i < GetDoc()->GetPageDescCnt(); ++i )
+ for ( sal_uInt16 i = 0; i < GetDoc()->GetPageDescCnt(); ++i )
{
if ( pPage->GetPageDesc() == &const_cast<const SwDoc *>(pMyDoc)
->GetPageDesc(i) )
@@ -206,7 +208,7 @@ USHORT SwFEShell::GetMousePageDesc( const Point &rPt ) const
return 0;
}
-USHORT SwFEShell::GetCurPageDesc( const BOOL bCalcFrm ) const
+sal_uInt16 SwFEShell::GetCurPageDesc( const sal_Bool bCalcFrm ) const
{
const SwFrm *pFrm = GetCurrFrm( bCalcFrm );
if ( pFrm )
@@ -215,7 +217,7 @@ USHORT SwFEShell::GetCurPageDesc( const BOOL bCalcFrm ) const
if ( pPage )
{
SwDoc *pMyDoc = GetDoc();
- for ( USHORT i = 0; i < GetDoc()->GetPageDescCnt(); ++i )
+ for ( sal_uInt16 i = 0; i < GetDoc()->GetPageDescCnt(); ++i )
{
if ( pPage->GetPageDesc() == &const_cast<const SwDoc *>(pMyDoc)
->GetPageDesc(i) )
@@ -238,14 +240,23 @@ const SwPageDesc* SwFEShell::GetSelectedPageDescs() const
FOREACHPAM_START(this)
if( 0 != (pCNd = PCURCRSR->GetCntntNode() ) &&
+<<<<<<< local
0 != ( pPtFrm = pCNd->getLayoutFrm( GetLayout(), &aNulPt, 0, FALSE )) )
+=======
+ 0 != ( pPtFrm = pCNd->GetFrm( &aNulPt, 0, sal_False )) )
+>>>>>>> other
pPtFrm = pPtFrm->FindPageFrm();
else
pPtFrm = 0;
if( PCURCRSR->HasMark() &&
+<<<<<<< local
0 != (pCNd = PCURCRSR->GetCntntNode( FALSE ) ) &&
0 != ( pMkFrm = pCNd->getLayoutFrm( GetLayout(), &aNulPt, 0, FALSE )) )
+=======
+ 0 != (pCNd = PCURCRSR->GetCntntNode( sal_False ) ) &&
+ 0 != ( pMkFrm = pCNd->GetFrm( &aNulPt, 0, sal_False )) )
+>>>>>>> other
pMkFrm = pMkFrm->FindPageFrm();
else
pMkFrm = pPtFrm;
diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index 76a69eb63478..2e423dc11069 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -55,6 +55,7 @@
#include <viewimp.hxx>
#include <viscrs.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <dview.hxx>
#include <dflyobj.hxx>
#include <dcontact.hxx>
@@ -123,10 +124,10 @@ sal_Bool lcl_SetNewFlyPos( const SwNode& rNode, SwFmtAnchor& rAnchor,
return bRet;
}
-BOOL lcl_FindAnchorPos( SwDoc& rDoc, const Point& rPt, const SwFrm& rFrm,
+sal_Bool lcl_FindAnchorPos( SwDoc& rDoc, const Point& rPt, const SwFrm& rFrm,
SfxItemSet& rSet )
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
SwFmtAnchor aNewAnch( (SwFmtAnchor&)rSet.Get( RES_ANCHOR ) );
RndStdIds nNew = aNewAnch.GetAnchorId();
const SwFrm *pNewAnch;
@@ -146,7 +147,7 @@ BOOL lcl_FindAnchorPos( SwDoc& rDoc, const Point& rPt, const SwFrm& rFrm,
pNewAnch = ::FindAnchor( pFrm, aTmpPnt );
if( pNewAnch->IsProtected() )
{
- bRet = FALSE;
+ bRet = sal_False;
break;
}
@@ -491,7 +492,11 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, sal_Bool bMoveIt )
SwPosition aPos( GetDoc()->GetNodes().GetEndOfExtras() );
Point aTmpPnt( rAbsPos );
GetLayout()->GetCrsrOfst( &aPos, aTmpPnt, &aState );
+<<<<<<< local
pTxtFrm = aPos.nNode.GetNode().GetCntntNode()->getLayoutFrm( GetLayout(),0,&aPos,FALSE );
+=======
+ pTxtFrm = aPos.nNode.GetNode().GetCntntNode()->GetFrm(0,&aPos,sal_False );
+>>>>>>> other
}
const SwFrm *pNewAnch;
if( pTxtFrm )
@@ -617,7 +622,7 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, sal_Bool bMoveIt )
//TODO: That doesn't seem to be intended
if( Color(COL_TRANSPARENT) != GetOut()->GetLineColor() )
{
- ASSERT( FALSE, "Hey, Joe: Where's my Null Pen?" );
+ ASSERT( sal_False, "Hey, Joe: Where's my Null Pen?" );
GetOut()->SetLineColor( Color(COL_TRANSPARENT) );
}
#endif
@@ -707,7 +712,7 @@ const SwFrmFmt *SwFEShell::NewFlyFrm( const SfxItemSet& rSet, sal_Bool bAnchVali
SwFlyFrmFmt *pRet;
if( bMoveCntnt )
{
- GetDoc()->StartUndo( UNDO_INSLAYFMT, NULL );
+ GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_INSLAYFMT, NULL );
SwFmtAnchor* pOldAnchor = 0;
sal_Bool bHOriChgd = sal_False, bVOriChgd = sal_False;
SwFmtVertOrient aOldV;
@@ -765,9 +770,18 @@ const SwFrmFmt *SwFEShell::NewFlyFrm( const SfxItemSet& rSet, sal_Bool bAnchVali
// das verschieben von TabelleSelektion ist noch nicht
// Undofaehig - also darf das UmAnkern auch nicht
// aufgezeichnet werden.
- sal_Bool bDoesUndo = GetDoc()->DoesUndo();
- if( bDoesUndo && UNDO_INSLAYFMT == GetDoc()->GetUndoIds(NULL, NULL) )
- GetDoc()->DoUndo( sal_False );
+ bool const bDoesUndo =
+ GetDoc()->GetIDocumentUndoRedo().DoesUndo();
+ SwUndoId nLastUndoId(UNDO_EMPTY);
+ if (bDoesUndo &&
+ GetDoc()->GetIDocumentUndoRedo().GetLastUndoInfo(0,
+ & nLastUndoId))
+ {
+ if (UNDO_INSLAYFMT == nLastUndoId)
+ {
+ GetDoc()->GetIDocumentUndoRedo().DoUndo(false);
+ }
+ }
((SfxItemSet&)rSet).Put( *pOldAnchor );
@@ -777,17 +791,17 @@ const SwFrmFmt *SwFEShell::NewFlyFrm( const SfxItemSet& rSet, sal_Bool bAnchVali
((SfxItemSet&)rSet).Put( aOldV );
GetDoc()->SetFlyFrmAttr( *pRet, (SfxItemSet&)rSet );
- GetDoc()->DoUndo( bDoesUndo );
+ GetDoc()->GetIDocumentUndoRedo().DoUndo(bDoesUndo);
}
delete pOldAnchor;
}
- GetDoc()->EndUndo( UNDO_INSLAYFMT, NULL );
+ GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_INSLAYFMT, NULL );
}
else
/* #109161# If called from a shell try to propagate an
existing adjust item from rPos to the content node of the
new frame. */
- pRet = GetDoc()->MakeFlySection( eRndId, &rPos, &rSet, pParent, TRUE );
+ pRet = GetDoc()->MakeFlySection( eRndId, &rPos, &rSet, pParent, sal_True );
if( pRet )
{
@@ -1458,7 +1472,7 @@ Size SwFEShell::RequestObjectResize( const SwRect &rRect, const uno::Reference <
{
// search for a sequence field:
const SfxPoolItem* pItem;
- for( USHORT n = 0, nEnd = pHts->Count(); n < nEnd; ++n )
+ for( sal_uInt16 n = 0, nEnd = pHts->Count(); n < nEnd; ++n )
if( RES_TXTATR_FIELD == ( pItem =
&(*pHts)[ n ]->GetAttr())->Which() &&
TYP_SEQFLD == ((SwFmtFld*)pItem)->GetFld()->GetTypeId() )
@@ -1640,8 +1654,8 @@ const SwFrmFmt* SwFEShell::IsURLGrfAtPos( const Point& rPt, String* pURL,
const SwFmtURL &rURL = pFly->GetFmt()->GetURL();
if( rURL.GetURL().Len() || rURL.GetMap() )
{
- BOOL bSetTargetFrameName = pTargetFrameName != 0;
- BOOL bSetDescription = pDescription != 0;
+ sal_Bool bSetTargetFrameName = pTargetFrameName != 0;
+ sal_Bool bSetDescription = pDescription != 0;
if ( rURL.GetMap() )
{
IMapObject *pObject = pFly->GetFmt()->GetIMapObject( rPt, pFly );
@@ -1970,13 +1984,13 @@ sal_Bool SwFEShell::ReplaceSdrObj( const String& rGrfName, const String& rFltNam
return bRet;
}
-static USHORT SwFmtGetPageNum(const SwFlyFrmFmt * pFmt)
+static sal_uInt16 SwFmtGetPageNum(const SwFlyFrmFmt * pFmt)
{
ASSERT(pFmt != NULL, "invalid argument");
SwFlyFrm * pFrm = pFmt->GetFrm();
- USHORT aResult;
+ sal_uInt16 aResult;
if (pFrm != NULL)
aResult = pFrm->GetPhyPageNum();
@@ -1990,7 +2004,7 @@ static USHORT SwFmtGetPageNum(const SwFlyFrmFmt * pFmt)
void SwFEShell::GetConnectableFrmFmts(SwFrmFmt & rFmt,
const String & rReference,
- BOOL bSuccessors,
+ sal_Bool bSuccessors,
::std::vector< String > & aPrevPageVec,
::std::vector< String > & aThisPageVec,
::std::vector< String > & aNextPageVec,
@@ -2050,7 +2064,7 @@ void SwFEShell::GetConnectableFrmFmts(SwFrmFmt & rFmt,
aRestVec.clear();
/* number of page rFmt resides on */
- USHORT nPageNum = SwFmtGetPageNum((SwFlyFrmFmt *) &rFmt);
+ sal_uInt16 nPageNum = SwFmtGetPageNum((SwFlyFrmFmt *) &rFmt);
::std::vector< const SwFrmFmt * >::const_iterator aIt;
@@ -2062,7 +2076,7 @@ void SwFEShell::GetConnectableFrmFmts(SwFrmFmt & rFmt,
itself */
if (aString != rReference && aString != rFmt.GetName())
{
- USHORT nNum1 =
+ sal_uInt16 nNum1 =
SwFmtGetPageNum((SwFlyFrmFmt *) *aIt);
if (nNum1 == nPageNum -1)
@@ -2215,7 +2229,7 @@ void SwFEShell::AlignFormulaToBaseline( const uno::Reference < embed::XEmbeddedO
}
catch ( uno::Exception& )
{
- ASSERT( FALSE , "Baseline could not be retrieved from Starmath!" );
+ ASSERT( sal_False , "Baseline could not be retrieved from Starmath!" );
}
}
}
diff --git a/sw/source/core/frmedt/feflyole.cxx b/sw/source/core/frmedt/feflyole.cxx
index c78fb22d7421..1138859bcc47 100644
--- a/sw/source/core/frmedt/feflyole.cxx
+++ b/sw/source/core/frmedt/feflyole.cxx
@@ -68,9 +68,9 @@ SwFlyFrm *SwFEShell::FindFlyFrm( const uno::Reference < embed::XEmbeddedObject >
if ( !pFly )
{
//Kein Fly oder der falsche selektiert. Ergo muessen wir leider suchen.
- BOOL bExist = FALSE;
+ sal_Bool bExist = sal_False;
SwStartNode *pStNd;
- ULONG nSttIdx = GetNodes().GetEndOfAutotext().StartOfSectionIndex() + 1,
+ sal_uLong nSttIdx = GetNodes().GetEndOfAutotext().StartOfSectionIndex() + 1,
nEndIdx = GetNodes().GetEndOfAutotext().GetIndex();
while( nSttIdx < nEndIdx &&
0 != (pStNd = GetNodes()[ nSttIdx ]->GetStartNode()) )
@@ -79,8 +79,13 @@ SwFlyFrm *SwFEShell::FindFlyFrm( const uno::Reference < embed::XEmbeddedObject >
if ( pNd->IsOLENode() &&
((SwOLENode*)pNd)->GetOLEObj().GetOleRef() == xObj )
{
+<<<<<<< local
bExist = TRUE;
SwFrm *pFrm = ((SwOLENode*)pNd)->getLayoutFrm( GetLayout() );
+=======
+ bExist = sal_True;
+ SwFrm *pFrm = ((SwOLENode*)pNd)->GetFrm();
+>>>>>>> other
if ( pFrm )
pFly = pFrm->FindFlyFrm();
break;
@@ -122,13 +127,13 @@ void SwFEShell::MakeObjVisible( const uno::Reference < embed::XEmbeddedObject >&
}
}
-BOOL SwFEShell::FinishOLEObj() // Server wird beendet
+sal_Bool SwFEShell::FinishOLEObj() // Server wird beendet
{
SfxInPlaceClient* pIPClient = GetSfxViewShell()->GetIPClient();
if ( !pIPClient )
- return FALSE;
+ return sal_False;
- BOOL bRet = pIPClient->IsObjectInPlaceActive();
+ sal_Bool bRet = pIPClient->IsObjectInPlaceActive();
if( bRet )
{
uno::Reference < embed::XEmbeddedObject > xObj = pIPClient->GetObject();
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index f6492d2be4b9..88a9983af88f 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -70,6 +70,7 @@
#include "pagefrm.hxx"
#include "sectfrm.hxx"
#include "doc.hxx"
+#include <IDocumentUndoRedo.hxx>
#include "dview.hxx"
#include "dflyobj.hxx"
#include "dcontact.hxx"
@@ -95,7 +96,7 @@
using namespace com::sun::star;
//Tattergrenze fuer Drawing-SS
-#define MINMOVE ((USHORT)GetOut()->PixelToLogic(Size(Imp()->GetDrawView()->GetMarkHdlSizePixel()/2,0)).Width())
+#define MINMOVE ((sal_uInt16)GetOut()->PixelToLogic(Size(Imp()->GetDrawView()->GetMarkHdlSizePixel()/2,0)).Width())
SwFlyFrm *GetFlyFromMarked( const SdrMarkList *pLst, ViewShell *pSh )
{
@@ -119,12 +120,12 @@ void lcl_GrabCursor( SwFEShell* pSh, SwFlyFrm* pOldSelFly)
{
// dann das evt. gesetzte Macro rufen
pSh->GetFlyMacroLnk().Call( (void*)pFlyFmt );
-extern BOOL bNoInterrupt; // in swapp.cxx
+extern sal_Bool bNoInterrupt; // in swapp.cxx
// wir in dem Makro ein Dialog gestartet, dann kommt das
// MouseButtonUp zu diesem und nicht zu uns. Dadurch ist
// Flag bei uns immer gesetzt und schaltet nie die auf die
// entsp. Shell um !!!!!!!
- bNoInterrupt = FALSE;
+ bNoInterrupt = sal_False;
}
else if( !pFlyFmt || RES_DRAWFRMFMT == pFlyFmt->Which() )
{
@@ -133,7 +134,7 @@ extern BOOL bNoInterrupt; // in swapp.cxx
pSh->KillPams();
pSh->ClearMark();
// <--
- pSh->SetCrsr( pSh->Imp()->GetDrawView()->GetAllMarkedRect().TopLeft(), TRUE);
+ pSh->SetCrsr( pSh->Imp()->GetDrawView()->GetAllMarkedRect().TopLeft(), sal_True);
}
}
@@ -142,7 +143,7 @@ extern BOOL bNoInterrupt; // in swapp.cxx
|* SwFEShell::SelectObj()
*************************************************************************/
-BOOL SwFEShell::SelectObj( const Point& rPt, BYTE nFlag, SdrObject *pObj )
+sal_Bool SwFEShell::SelectObj( const Point& rPt, sal_uInt8 nFlag, SdrObject *pObj )
{
SwDrawView *pDView = Imp()->GetDrawView();
if(!pDView)
@@ -153,16 +154,16 @@ BOOL SwFEShell::SelectObj( const Point& rPt, BYTE nFlag, SdrObject *pObj )
//durchkommen
const SdrMarkList &rMrkList = pDView->GetMarkedObjectList();
- const BOOL bHadSelection = rMrkList.GetMarkCount() ? TRUE : FALSE;
- const BOOL bAddSelect = 0 != (SW_ADD_SELECT & nFlag);
- const BOOL bEnterGroup = 0 != (SW_ENTER_GROUP & nFlag);
+ const sal_Bool bHadSelection = rMrkList.GetMarkCount() ? sal_True : sal_False;
+ const sal_Bool bAddSelect = 0 != (SW_ADD_SELECT & nFlag);
+ const sal_Bool bEnterGroup = 0 != (SW_ENTER_GROUP & nFlag);
SwFlyFrm* pOldSelFly = 0;
const Point aOldPos( pDView->GetAllMarkedRect().TopLeft() );
if( bHadSelection )
{
//Unmark rufen wenn !bAddSelect oder wenn ein Fly selektiert ist.
- BOOL bUnmark = !bAddSelect;
+ sal_Bool bUnmark = !bAddSelect;
if ( rMrkList.GetMarkCount() == 1 )
{
@@ -170,7 +171,7 @@ BOOL SwFEShell::SelectObj( const Point& rPt, BYTE nFlag, SdrObject *pObj )
pOldSelFly = ::GetFlyFromMarked( &rMrkList, this );
if ( pOldSelFly )
{
- const USHORT nType = GetCntType();
+ const sal_uInt16 nType = GetCntType();
if( nType != CNT_TXT || (SW_LEAVE_FRAME & nFlag) ||
( pOldSelFly->GetFmt()->GetProtect().IsCntntProtected()
&& !IsReadOnlyAvailable() ))
@@ -182,18 +183,18 @@ BOOL SwFEShell::SelectObj( const Point& rPt, BYTE nFlag, SdrObject *pObj )
//linke obere Ecke gesetzt.
Point aPt( pOldSelFly->Frm().Pos() );
aPt.X() -= 1;
- BOOL bUnLockView = !IsViewLocked();
- LockView( TRUE );
- SetCrsr( aPt, TRUE );
+ sal_Bool bUnLockView = !IsViewLocked();
+ LockView( sal_True );
+ SetCrsr( aPt, sal_True );
if( bUnLockView )
- LockView( FALSE );
+ LockView( sal_False );
}
if ( nType & CNT_GRF &&
((SwNoTxtFrm*)pOldSelFly->Lower())->HasAnimation() )
{
GetWin()->Invalidate( pOldSelFly->Frm().SVRect() );
}
- bUnmark = TRUE;
+ bUnmark = sal_True;
}
}
if ( bUnmark )
@@ -215,16 +216,16 @@ BOOL SwFEShell::SelectObj( const Point& rPt, BYTE nFlag, SdrObject *pObj )
pDView->MarkObj( rPt, MINMOVE, bAddSelect, bEnterGroup );
}
- const BOOL bRet = 0 != rMrkList.GetMarkCount();
+ const sal_Bool bRet = 0 != rMrkList.GetMarkCount();
if ( rMrkList.GetMarkCount() > 1 )
{
//Ganz dumm ist es, wenn Zeichenobjekte Selektiert waren und
//nun ein Fly hinzuselektiert wird.
- for ( USHORT i = 0; i < rMrkList.GetMarkCount(); ++i )
+ for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i )
{
SdrObject *pTmpObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
- BOOL bForget = pTmpObj->ISA(SwVirtFlyDrawObj);
+ sal_Bool bForget = pTmpObj->ISA(SwVirtFlyDrawObj);
if( bForget )
{
pDView->UnmarkAll();
@@ -246,7 +247,7 @@ BOOL SwFEShell::SelectObj( const Point& rPt, BYTE nFlag, SdrObject *pObj )
}
}
else if ( !pOldSelFly && bHadSelection )
- SetCrsr( aOldPos, TRUE);
+ SetCrsr( aOldPos, sal_True);
if( bRet || !bHadSelection )
CallChgLnk();
@@ -260,7 +261,7 @@ BOOL SwFEShell::SelectObj( const Point& rPt, BYTE nFlag, SdrObject *pObj )
/*************************************************************************
|*
-|* sal_Bool SwFEShell::MoveAnchor( USHORT nDir )
+|* sal_Bool SwFEShell::MoveAnchor( sal_uInt16 nDir )
|*
|* Description: MoveAnchor( nDir ) looked for an another Anchor for
|* the selected drawing object (or fly frame) in the given direction.
@@ -284,7 +285,7 @@ BOOL SwFEShell::SelectObj( const Point& rPt, BYTE nFlag, SdrObject *pObj )
( aPt1.Y() == aPt2.Y() && ( aPt1.X() < aPt2.X() || \
( aPt1.X() == aPt2.X() && bOld ) ) ) )
-sal_Bool SwFEShell::MoveAnchor( USHORT nDir )
+sal_Bool SwFEShell::MoveAnchor( sal_uInt16 nDir )
{
const SdrMarkList* pMrkList;
if( !Imp()->GetDrawView() ||
@@ -419,7 +420,7 @@ sal_Bool SwFEShell::MoveAnchor( USHORT nDir )
Point aCenter( pOld->Frm().Left() + pOld->Frm().Width()/2,
pOld->Frm().Top() + pOld->Frm().Height()/2 );
Point aBest;
- for( i = 0; (USHORT)i<pPage->GetSortedObjs()->Count(); ++i )
+ for( i = 0; (sal_uInt16)i<pPage->GetSortedObjs()->Count(); ++i )
{
SwAnchoredObject* pAnchObj =
(*pPage->GetSortedObjs())[i];
@@ -543,9 +544,9 @@ const SdrMarkList* SwFEShell::_GetMarkList() const
return pMarkList;
}
-USHORT SwFEShell::GetSelFrmType() const
+sal_uInt16 SwFEShell::GetSelFrmType() const
{
- USHORT eType;
+ sal_uInt16 eType;
// get marked frame list, and check if anything is selected
const SdrMarkList* pMarkList = _GetMarkList();
@@ -617,7 +618,7 @@ void SwFEShell::ScrollTo( const Point &rPt )
|*
*************************************************************************/
-void SwFEShell::SetDragMode( UINT16 eDragMode )
+void SwFEShell::SetDragMode( sal_uInt16 eDragMode )
{
if ( Imp()->HasDrawView() )
Imp()->GetDrawView()->SetDragMode( (SdrDragMode)eDragMode );
@@ -629,7 +630,7 @@ void SwFEShell::SetDragMode( UINT16 eDragMode )
|*
*************************************************************************/
-long SwFEShell::BeginDrag( const Point* pPt, BOOL )
+long SwFEShell::BeginDrag( const Point* pPt, sal_Bool )
{
SdrView *pView = Imp()->GetDrawView();
if ( pView && pView->AreObjectsMarked() )
@@ -648,7 +649,7 @@ long SwFEShell::BeginDrag( const Point* pPt, BOOL )
|*
*************************************************************************/
-long SwFEShell::Drag( const Point *pPt, BOOL )
+long SwFEShell::Drag( const Point *pPt, sal_Bool )
{
ASSERT( Imp()->HasDrawView(), "Drag without DrawView?" );
if ( Imp()->GetDrawView()->IsDragObj() )
@@ -668,7 +669,7 @@ long SwFEShell::Drag( const Point *pPt, BOOL )
|*
*************************************************************************/
-long SwFEShell::EndDrag( const Point *, BOOL )
+long SwFEShell::EndDrag( const Point *, sal_Bool )
{
ASSERT( Imp()->HasDrawView(), "EndDrag without DrawView?" );
SdrView *pView = Imp()->GetDrawView();
@@ -694,8 +695,8 @@ long SwFEShell::EndDrag( const Point *, BOOL )
pView->EndDragObj();
// DrawUndo-Action auf FlyFrames werden nicht gespeichert
// Die Fly aendern das Flag
- GetDoc()->SetNoDrawUndoObj( FALSE );
- ChgAnchor( 0, TRUE );
+ GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(true);
+ ChgAnchor( 0, sal_True );
EndUndo( UNDO_END );
@@ -786,10 +787,10 @@ void lcl_NotifyNeighbours( const SdrMarkList *pLst )
//3. Rahmen die dem Rahmen ausweichen bzw. wichen muessen benachrichtigt werden.
//4. Auch Zeichenobjekte koennen Rahmen verdraengen
- for( USHORT j = 0; j < pLst->GetMarkCount(); ++j )
+ for( sal_uInt16 j = 0; j < pLst->GetMarkCount(); ++j )
{
SwPageFrm *pPage;
- BOOL bCheckNeighbours = FALSE;
+ sal_Bool bCheckNeighbours = sal_False;
sal_Int16 aHori = text::HoriOrientation::NONE;
SwRect aRect;
SdrObject *pO = pLst->GetMark( 0 )->GetMarkedSdrObj();
@@ -802,7 +803,7 @@ void lcl_NotifyNeighbours( const SdrMarkList *pLst )
if( text::HoriOrientation::NONE != aHori && text::HoriOrientation::CENTER != aHori &&
pFly->IsFlyAtCntFrm() )
{
- bCheckNeighbours = TRUE;
+ bCheckNeighbours = sal_True;
pFly->InvalidatePos();
pFly->Frm().Pos().Y() += 1;
}
@@ -858,7 +859,7 @@ void lcl_NotifyNeighbours( const SdrMarkList *pLst )
}
}
-void SwFEShell::SelectionToTop( BOOL bTop )
+void SwFEShell::SelectionToTop( sal_Bool bTop )
{
ASSERT( Imp()->HasDrawView(), "SelectionToTop without DrawView?" );
const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
@@ -878,7 +879,7 @@ void SwFEShell::SelectionToTop( BOOL bTop )
EndAllAction();
}
-void SwFEShell::SelectionToBottom( BOOL bBottom )
+void SwFEShell::SelectionToBottom( sal_Bool bBottom )
{
ASSERT( Imp()->HasDrawView(), "SelectionToBottom without DrawView?" );
const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
@@ -912,7 +913,7 @@ short SwFEShell::GetLayerId() const
if ( Imp()->HasDrawView() )
{
const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
- for ( USHORT i = 0; i < rMrkList.GetMarkCount(); ++i )
+ for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i )
{
const SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
if( !pObj )
@@ -949,7 +950,7 @@ void SwFEShell::ChangeOpaque( SdrLayerID nLayerId )
const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
const IDocumentDrawModelAccess* pIDDMA = getIDocumentDrawModelAccess();
// OD 25.06.2003 #108784# - correct type of <nControls>
- for ( USHORT i = 0; i < rMrkList.GetMarkCount(); ++i )
+ for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i )
{
SdrObject* pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
if( !pObj )
@@ -997,18 +998,18 @@ void SwFEShell::SelectionToHell()
|*
*************************************************************************/
-USHORT SwFEShell::IsObjSelected() const
+sal_uInt16 SwFEShell::IsObjSelected() const
{
if ( IsFrmSelected() || !Imp()->HasDrawView() )
return 0;
else
- return USHORT( Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount() );
+ return sal_uInt16( Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount() );
}
-BOOL SwFEShell::IsFrmSelected() const
+sal_Bool SwFEShell::IsFrmSelected() const
{
if ( !Imp()->HasDrawView() )
- return FALSE;
+ return sal_False;
else
return 0 != ::GetFlyFromMarked( &Imp()->GetDrawView()->GetMarkedObjectList(),
(ViewShell*)this );
@@ -1066,7 +1067,7 @@ void SwFEShell::EndTextEdit()
DelSelectedObj();
if ( aSave.GetMarkCount() )
{
- for ( USHORT i = 0; i < aSave.GetMarkCount(); ++i )
+ for ( sal_uInt16 i = 0; i < aSave.GetMarkCount(); ++i )
pView->MarkObj( aSave.GetMark( i )->GetMarkedSdrObj(),
Imp()->GetPageView() );
}
@@ -1122,7 +1123,7 @@ bool SwFEShell::IsObjSelectable( const Point& rPt )
{
SdrObject* pObj;
SdrPageView* pPV;
- USHORT nOld = pDView->GetHitTolerancePixel();
+ sal_uInt16 nOld = pDView->GetHitTolerancePixel();
pDView->SetHitTolerancePixel( pDView->GetMarkHdlSizePixel()/2 );
bRet = 0 != pDView->PickObj( rPt, pDView->getHitTolLog(), pObj, pPV, SDRSEARCH_PICKMARKABLE );
@@ -1243,18 +1244,18 @@ sal_Bool SwFEShell::ShouldObjectBeSelected(const Point& rPt)
* Beinhaltet das Objekt ein Control oder Gruppen,
* die nur aus Controls bestehen
* --------------------------------------------------*/
-BOOL lcl_IsControlGroup( const SdrObject *pObj )
+sal_Bool lcl_IsControlGroup( const SdrObject *pObj )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if(pObj->ISA(SdrUnoObj))
- bRet = TRUE;
+ bRet = sal_True;
else if( pObj->ISA( SdrObjGroup ) )
{
- bRet = TRUE;
+ bRet = sal_True;
const SdrObjList *pLst = ((SdrObjGroup*)pObj)->GetSubList();
- for ( USHORT i = 0; i < pLst->GetObjCount(); ++i )
+ for ( sal_uInt16 i = 0; i < pLst->GetObjCount(); ++i )
if( !::lcl_IsControlGroup( pLst->GetObj( i ) ) )
- return FALSE;
+ return sal_False;
}
return bRet;
}
@@ -1279,7 +1280,7 @@ namespace
};
}
-const SdrObject* SwFEShell::GetBestObject( BOOL bNext, USHORT /*GOTOOBJ_...*/ eType, BOOL bFlat, const ::svx::ISdrObjectFilter* pFilter )
+const SdrObject* SwFEShell::GetBestObject( sal_Bool bNext, sal_uInt16 /*GOTOOBJ_...*/ eType, sal_Bool bFlat, const ::svx::ISdrObjectFilter* pFilter )
{
if( !Imp()->HasDrawView() )
return NULL;
@@ -1292,12 +1293,12 @@ const SdrObject* SwFEShell::GetBestObject( BOOL bNext, USHORT /*GOTOOBJ_...*/ eT
Point aTopPos( nTmp, nTmp );
Point aCurPos;
Point aPos;
- BOOL bNoDraw = 0 == (GOTOOBJ_DRAW_ANY & eType);
- BOOL bNoFly = 0 == (GOTOOBJ_FLY_ANY & eType);
+ sal_Bool bNoDraw = 0 == (GOTOOBJ_DRAW_ANY & eType);
+ sal_Bool bNoFly = 0 == (GOTOOBJ_FLY_ANY & eType);
if( !bNoFly && bNoDraw )
{
- SwFlyFrm *pFly = GetCurrFrm( FALSE )->FindFlyFrm();
+ SwFlyFrm *pFly = GetCurrFrm( sal_False )->FindFlyFrm();
if( pFly )
pBest = pFly->GetVirtDrawObj();
}
@@ -1350,7 +1351,7 @@ const SdrObject* SwFEShell::GetBestObject( BOOL bNext, USHORT /*GOTOOBJ_...*/ eT
while ( aObjIter.IsMore() )
{
SdrObject* pObj = aObjIter.Next();
- BOOL bFlyFrm = pObj->ISA(SwVirtFlyDrawObj);
+ sal_Bool bFlyFrm = pObj->ISA(SwVirtFlyDrawObj);
if( ( bNoFly && bFlyFrm ) ||
( bNoDraw && !bFlyFrm ) ||
( eType == GOTOOBJ_DRAW_SIMPLE && lcl_IsControlGroup( pObj ) ) ||
@@ -1456,14 +1457,14 @@ const SdrObject* SwFEShell::GetBestObject( BOOL bNext, USHORT /*GOTOOBJ_...*/ eT
return pBest;
}
-BOOL SwFEShell::GotoObj( BOOL bNext, USHORT /*GOTOOBJ_...*/ eType )
+sal_Bool SwFEShell::GotoObj( sal_Bool bNext, sal_uInt16 /*GOTOOBJ_...*/ eType )
{
const SdrObject* pBest = GetBestObject( bNext, eType );
if ( !pBest )
- return FALSE;
+ return sal_False;
- BOOL bFlyFrm = pBest->ISA(SwVirtFlyDrawObj);
+ sal_Bool bFlyFrm = pBest->ISA(SwVirtFlyDrawObj);
if( bFlyFrm )
{
SwVirtFlyDrawObj *pO = (SwVirtFlyDrawObj*)pBest;
@@ -1479,7 +1480,7 @@ BOOL SwFEShell::GotoObj( BOOL bNext, USHORT /*GOTOOBJ_...*/ eType )
MakeVisible( pBest->GetCurrentBoundRect() );
}
CallChgLnk();
- return TRUE;
+ return sal_True;
}
/*************************************************************************
@@ -1488,9 +1489,9 @@ BOOL SwFEShell::GotoObj( BOOL bNext, USHORT /*GOTOOBJ_...*/ eType )
|*
*************************************************************************/
-BOOL SwFEShell::BeginCreate( UINT16 /*SdrObjKind ?*/ eSdrObjectKind, const Point &rPos )
+sal_Bool SwFEShell::BeginCreate( sal_uInt16 /*SdrObjKind ?*/ eSdrObjectKind, const Point &rPos )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if ( !Imp()->HasDrawView() )
Imp()->MakeDrawView();
@@ -1512,10 +1513,10 @@ BOOL SwFEShell::BeginCreate( UINT16 /*SdrObjKind ?*/ eSdrObjectKind, const Poin
return bRet;
}
-BOOL SwFEShell::BeginCreate( UINT16 /*SdrObjKind ?*/ eSdrObjectKind, UINT32 eObjInventor,
+sal_Bool SwFEShell::BeginCreate( sal_uInt16 /*SdrObjKind ?*/ eSdrObjectKind, sal_uInt32 eObjInventor,
const Point &rPos )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if ( !Imp()->HasDrawView() )
Imp()->MakeDrawView();
@@ -1553,34 +1554,36 @@ void SwFEShell::MoveCreate( const Point &rPos )
|*
*************************************************************************/
-BOOL SwFEShell::EndCreate( UINT16 eSdrCreateCmd )
+sal_Bool SwFEShell::EndCreate( sal_uInt16 eSdrCreateCmd )
{
// 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?" );
if( !Imp()->GetDrawView()->IsGroupEntered() )
- GetDoc()->SetNoDrawUndoObj( TRUE );
- BOOL bCreate = Imp()->GetDrawView()->EndCreateObj(
+ {
+ GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(false);
+ }
+ sal_Bool bCreate = Imp()->GetDrawView()->EndCreateObj(
SdrCreateCmd( eSdrCreateCmd ) );
- GetDoc()->SetNoDrawUndoObj( FALSE );
+ GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(true);
if ( !bCreate )
{
::FrameNotify( this, FLY_DRAG_END );
- return FALSE;
+ return sal_False;
}
if ( (SdrCreateCmd)eSdrCreateCmd == SDRCREATE_NEXTPOINT )
{
::FrameNotify( this, FLY_DRAG );
- return TRUE;
+ return sal_True;
}
return ImpEndCreate();
}
-BOOL SwFEShell::ImpEndCreate()
+sal_Bool SwFEShell::ImpEndCreate()
{
ASSERT( Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount() == 1,
"Neues Object nicht selektiert." );
@@ -1594,7 +1597,7 @@ BOOL SwFEShell::ImpEndCreate()
Imp()->GetDrawView()->DeleteMarked();
Imp()->GetDrawView()->UnmarkAll();
::FrameNotify( this, FLY_DRAG_END );
- return FALSE;
+ return sal_False;
}
if( rSdrObj.GetUpGroup() )
@@ -1605,7 +1608,7 @@ BOOL SwFEShell::ImpEndCreate()
rSdrObj.NbcSetRelativePos( aTmpPos - aNewAnchor );
rSdrObj.NbcSetAnchorPos( aNewAnchor );
::FrameNotify( this, FLY_DRAG );
- return TRUE;
+ return sal_True;
}
LockPaint();
@@ -1618,14 +1621,14 @@ BOOL SwFEShell::ImpEndCreate()
//Fremde Identifier sollen in den Default laufen.
//Ueberschneidungen sind moeglich!!
- UINT16 nIdent = SdrInventor == rSdrObj.GetObjInventor()
+ sal_uInt16 nIdent = SdrInventor == rSdrObj.GetObjInventor()
? rSdrObj.GetObjIdentifier()
: 0xFFFF;
//Default fuer Controls ist Zeichengebunden, Absatzgebunden sonst.
SwFmtAnchor aAnch;
const SwFrm *pAnch = 0;
- BOOL bCharBound = FALSE;
+ sal_Bool bCharBound = sal_False;
if( rSdrObj.ISA( SdrUnoObj ) )
{
SwPosition aPos( GetDoc()->GetNodes() );
@@ -1641,7 +1644,7 @@ BOOL SwFEShell::ImpEndCreate()
pAnch->GetCharRect( aTmp, aPos );
//Der Crsr darf nicht zu weit entfernt sein.
- bCharBound = TRUE;
+ bCharBound = sal_True;
Rectangle aRect( aTmp.SVRect() );
aRect.Left() -= MM50*2;
aRect.Top() -= MM50*2;
@@ -1649,7 +1652,7 @@ BOOL SwFEShell::ImpEndCreate()
aRect.Bottom()+= MM50*2;
if( !aRect.IsOver( rBound ) && !::GetHtmlMode( GetDoc()->GetDocShell() ))
- bCharBound = FALSE;
+ bCharBound = sal_False;
//Bindung in Kopf-/Fusszeilen ist ebenfalls nicht erlaubt.
if( bCharBound )
@@ -1684,7 +1687,11 @@ BOOL SwFEShell::ImpEndCreate()
// die naechste nicht READONLY Position suchen?
bAtPage = true;
+<<<<<<< local
pAnch = aPos.nNode.GetNode().GetCntntNode()->getLayoutFrm( GetLayout(), &aPoint, 0, FALSE );
+=======
+ pAnch = aPos.nNode.GetNode().GetCntntNode()->GetFrm( &aPoint, 0, sal_False );
+>>>>>>> other
if( !bAtPage )
{
@@ -1789,29 +1796,29 @@ BOOL SwFEShell::ImpEndCreate()
//Erzeugtes Object wegwerfen, so kann der Fly am elegentesten
//ueber vorhandene SS erzeugt werden.
- GetDoc()->SetNoDrawUndoObj( TRUE ); // siehe oben
+ GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(false); // see above
// --> OD 2005-08-08 #i52858# - method name changed
SdrPage *pPg = getIDocumentDrawModelAccess()->GetOrCreateDrawModel()->GetPage( 0 );
// <--
if( !pPg )
{
SdrModel* pTmpSdrModel = getIDocumentDrawModelAccess()->GetDrawModel();
- pPg = pTmpSdrModel->AllocPage( FALSE );
+ pPg = pTmpSdrModel->AllocPage( sal_False );
pTmpSdrModel->InsertPage( pPg );
}
pPg->RecalcObjOrdNums();
SdrObject* pRemovedObject = pPg->RemoveObject( rSdrObj.GetOrdNumDirect() );
SdrObject::Free( pRemovedObject );
- GetDoc()->SetNoDrawUndoObj( FALSE );
+ GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(true);
SwFlyFrm* pFlyFrm;
- if( NewFlyFrm( aSet, TRUE ) &&
+ if( NewFlyFrm( aSet, sal_True ) &&
::GetHtmlMode( GetDoc()->GetDocShell() ) &&
0 != ( pFlyFrm = FindFlyFrm() ))
{
SfxItemSet aHtmlSet( GetDoc()->GetAttrPool(), RES_VERT_ORIENT, RES_HORI_ORIENT );
//Horizontale Ausrichtung:
- const BOOL bLeftFrm = aFlyRect.Left() <
+ const sal_Bool bLeftFrm = aFlyRect.Left() <
pAnch->Frm().Left() + pAnch->Prt().Left(),
bLeftPrt = aFlyRect.Left() + aFlyRect.Width() <
pAnch->Frm().Left() + pAnch->Prt().Width()/2;
@@ -1822,7 +1829,7 @@ BOOL SwFEShell::ImpEndCreate()
}
else
{
- const BOOL bRightFrm = aFlyRect.Left() >
+ const sal_Bool bRightFrm = aFlyRect.Left() >
pAnch->Frm().Left() + pAnch->Prt().Width();
aHori.SetHoriOrient( text::HoriOrientation::RIGHT );
aHori.SetRelationOrient( bRightFrm ? text::RelOrientation::FRAME : text::RelOrientation::PRINT_AREA );
@@ -1903,12 +1910,12 @@ BOOL SwFEShell::ImpEndCreate()
if ( pMarkObj )
{
Imp()->GetDrawView()->MarkObj( pMarkObj, Imp()->GetPageView(),
- FALSE, FALSE );
+ sal_False, sal_False );
}
else
{
Imp()->GetDrawView()->MarkObj( &rSdrObj, Imp()->GetPageView(),
- FALSE, FALSE );
+ sal_False, sal_False );
}
}
}
@@ -1918,7 +1925,7 @@ BOOL SwFEShell::ImpEndCreate()
KillPams();
EndAllActionAndCall();
UnlockPaint();
- return TRUE;
+ return sal_True;
}
@@ -1941,9 +1948,9 @@ void SwFEShell::BreakCreate()
|*
*************************************************************************/
-BOOL SwFEShell::IsDrawCreate() const
+sal_Bool SwFEShell::IsDrawCreate() const
{
- return Imp()->HasDrawView() ? Imp()->GetDrawView()->IsCreateObj() : FALSE;
+ return Imp()->HasDrawView() ? Imp()->GetDrawView()->IsCreateObj() : sal_False;
}
/*************************************************************************
@@ -1952,7 +1959,7 @@ BOOL SwFEShell::IsDrawCreate() const
|*
*************************************************************************/
-BOOL SwFEShell::BeginMark( const Point &rPos )
+sal_Bool SwFEShell::BeginMark( const Point &rPos )
{
if ( !Imp()->HasDrawView() )
Imp()->MakeDrawView();
@@ -1967,7 +1974,7 @@ BOOL SwFEShell::BeginMark( const Point &rPos )
return pDView->BegMarkObj( rPos );
}
else
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -2001,9 +2008,9 @@ void SwFEShell::MoveMark( const Point &rPos )
|*
*************************************************************************/
-BOOL SwFEShell::EndMark()
+sal_Bool SwFEShell::EndMark()
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
ASSERT( Imp()->HasDrawView(), "EndMark without DrawView?" );
if (Imp()->GetDrawView()->IsMarkObj())
@@ -2012,7 +2019,7 @@ BOOL SwFEShell::EndMark()
if ( bRet )
{
- BOOL bShowHdl = FALSE;
+ sal_Bool bShowHdl = sal_False;
SwDrawView* pDView = Imp()->GetDrawView();
//Rahmen werden auf diese Art nicht Selektiert, es sein denn es
//ist nur ein Rahmen.
@@ -2020,7 +2027,7 @@ BOOL SwFEShell::EndMark()
SwFlyFrm* pOldSelFly = ::GetFlyFromMarked( &rMrkList, this );
if ( rMrkList.GetMarkCount() > 1 )
- for ( USHORT i = 0; i < rMrkList.GetMarkCount(); ++i )
+ for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i )
{
SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
if( pObj->ISA(SwVirtFlyDrawObj) )
@@ -2028,7 +2035,7 @@ BOOL SwFEShell::EndMark()
if ( !bShowHdl )
{
//HMHpDView->HideMarkHdl();
- bShowHdl = TRUE;
+ bShowHdl = sal_True;
}
rMrkList.DeleteMark( i );
--i; //keinen auslassen.
@@ -2045,7 +2052,7 @@ BOOL SwFEShell::EndMark()
if ( rMrkList.GetMarkCount() )
::lcl_GrabCursor(this, pOldSelFly);
else
- bRet = FALSE;
+ bRet = sal_False;
}
if ( bRet )
::FrameNotify( this, FLY_DRAG_START );
@@ -2084,7 +2091,7 @@ short SwFEShell::GetAnchorId() const
if ( Imp()->HasDrawView() )
{
const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
- for ( USHORT i = 0; i < rMrkList.GetMarkCount(); ++i )
+ for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i )
{
SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
if ( pObj->ISA(SwVirtFlyDrawObj) )
@@ -2114,7 +2121,7 @@ short SwFEShell::GetAnchorId() const
|*
*************************************************************************/
-void SwFEShell::ChgAnchor( int eAnchorId, BOOL bSameOnly, BOOL bPosCorr )
+void SwFEShell::ChgAnchor( int eAnchorId, sal_Bool bSameOnly, sal_Bool bPosCorr )
{
ASSERT( Imp()->HasDrawView(), "ChgAnchor without DrawView?" );
const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
@@ -2215,12 +2222,12 @@ Point SwFEShell::GetObjAbsPos() const
|*
*************************************************************************/
-BOOL SwFEShell::IsGroupSelected()
+sal_Bool SwFEShell::IsGroupSelected()
{
if ( IsObjSelected() )
{
const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
- for ( USHORT i = 0; i < rMrkList.GetMarkCount(); ++i )
+ for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i )
{
SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
// OD 30.06.2003 #108784# - consider 'virtual' drawing objects.
@@ -2232,11 +2239,11 @@ BOOL SwFEShell::IsGroupSelected()
FLY_AS_CHAR != ((SwDrawContact*)GetUserCall(pObj))->
GetFmt()->GetAnchor().GetAnchorId() )
{
- return TRUE;
+ return sal_True;
}
}
}
- return FALSE;
+ return sal_False;
}
// OD 27.06.2003 #108784# - change return type.
@@ -2252,7 +2259,7 @@ bool SwFEShell::IsGroupAllowed() const
const SdrObject* pUpGroup = 0L;
const SwFrm* pHeaderFooterFrm = 0L;
const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
- for ( USHORT i = 0; bIsGroupAllowed && i < rMrkList.GetMarkCount(); ++i )
+ for ( sal_uInt16 i = 0; bIsGroupAllowed && i < rMrkList.GetMarkCount(); ++i )
{
const SdrObject* pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
if ( i )
@@ -2369,7 +2376,7 @@ void SwFEShell::UnGroupSelection()
|*
*************************************************************************/
-void SwFEShell::MirrorSelection( BOOL bHorizontal )
+void SwFEShell::MirrorSelection( sal_Bool bHorizontal )
{
SdrView *pView = Imp()->GetDrawView();
if ( IsObjSelected() && pView->IsMirrorAllowed() )
@@ -2383,10 +2390,10 @@ void SwFEShell::MirrorSelection( BOOL bHorizontal )
// springe zum benannten Rahmen (Grafik/OLE)
-BOOL SwFEShell::GotoFly( const String& rName, FlyCntType eType, BOOL bSelFrm )
+sal_Bool SwFEShell::GotoFly( const String& rName, FlyCntType eType, sal_Bool bSelFrm )
{
- BOOL bRet = FALSE;
-static BYTE __READONLY_DATA aChkArr[ 4 ] = {
+ sal_Bool bRet = sal_False;
+static sal_uInt8 __READONLY_DATA aChkArr[ 4 ] = {
/* FLYCNTTYPE_ALL */ 0,
/* FLYCNTTYPE_FRM */ ND_TEXTNODE,
/* FLYCNTTYPE_GRF */ ND_GRFNODE,
@@ -2427,19 +2434,19 @@ static BYTE __READONLY_DATA aChkArr[ 4 ] = {
GetCrsrDocPos() = rChrRect.Pos();
}
}
- bRet = TRUE;
+ bRet = sal_True;
}
}
return bRet;
}
-USHORT SwFEShell::GetFlyCount( FlyCntType eType ) const
+sal_uInt16 SwFEShell::GetFlyCount( FlyCntType eType ) const
{
return GetDoc()->GetFlyCount(eType);
}
-const SwFrmFmt* SwFEShell::GetFlyNum(USHORT nIdx, FlyCntType eType ) const
+const SwFrmFmt* SwFEShell::GetFlyNum(sal_uInt16 nIdx, FlyCntType eType ) const
{
return GetDoc()->GetFlyNum(nIdx, eType );
}
@@ -2458,14 +2465,14 @@ void SwFEShell::MakeSelVisible()
//Welcher Schutz ist am selektierten Objekt gesetzt?
-BYTE SwFEShell::IsSelObjProtected( USHORT eType ) const
+sal_uInt8 SwFEShell::IsSelObjProtected( sal_uInt16 eType ) const
{
int nChk = 0;
const bool bParent = (eType & FLYPROTECT_PARENT);
if( Imp()->HasDrawView() )
{
const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
- for( ULONG i = rMrkList.GetMarkCount(); i; )
+ for( sal_uLong i = rMrkList.GetMarkCount(); i; )
{
SdrObject *pObj = rMrkList.GetMark( --i )->GetMarkedSdrObj();
if( !bParent )
@@ -2504,7 +2511,7 @@ BYTE SwFEShell::IsSelObjProtected( USHORT eType ) const
}
nChk &= eType;
if( nChk == eType )
- return static_cast<BYTE>(eType);
+ return static_cast<sal_uInt8>(eType);
}
const SwFrm* pAnch;
if( pObj->ISA(SwVirtFlyDrawObj) )
@@ -2515,19 +2522,19 @@ BYTE SwFEShell::IsSelObjProtected( USHORT eType ) const
pAnch = pTmp ? pTmp->GetAnchorFrm( pObj ) : NULL;
}
if( pAnch && pAnch->IsProtected() )
- return static_cast<BYTE>(eType);
+ return static_cast<sal_uInt8>(eType);
}
}
- return static_cast<BYTE>(nChk);
+ return static_cast<sal_uInt8>(nChk);
}
-BOOL SwFEShell::GetObjAttr( SfxItemSet &rSet ) const
+sal_Bool SwFEShell::GetObjAttr( SfxItemSet &rSet ) const
{
if ( !IsObjSelected() )
- return FALSE;
+ return sal_False;
const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
- for ( USHORT i = 0; i < rMrkList.GetMarkCount(); ++i )
+ for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i )
{
SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
SwDrawContact *pContact = (SwDrawContact*)GetUserCall(pObj);
@@ -2542,23 +2549,23 @@ BOOL SwFEShell::GetObjAttr( SfxItemSet &rSet ) const
}
// <--
}
- return TRUE;
+ return sal_True;
}
-BOOL SwFEShell::SetObjAttr( const SfxItemSet& rSet )
+sal_Bool SwFEShell::SetObjAttr( const SfxItemSet& rSet )
{
SET_CURR_SHELL( this );
if ( !rSet.Count() )
{ ASSERT( !this, "SetObjAttr, empty set." );
- return FALSE;
+ return sal_False;
}
StartAllAction();
StartUndo( UNDO_INSATTR );
const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
- for ( USHORT i = 0; i < rMrkList.GetMarkCount(); ++i )
+ for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i )
{
SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
SwDrawContact *pContact = (SwDrawContact*)GetUserCall(pObj);
@@ -2568,15 +2575,15 @@ BOOL SwFEShell::SetObjAttr( const SfxItemSet& rSet )
EndUndo( UNDO_INSATTR );
EndAllActionAndCall();
GetDoc()->SetModified();
- return TRUE;
+ return sal_True;
}
-BOOL SwFEShell::IsAlignPossible() const
+sal_Bool SwFEShell::IsAlignPossible() const
{
- USHORT nCnt;
+ sal_uInt16 nCnt;
if ( 0 < (nCnt = IsObjSelected()) )
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
if ( nCnt == 1 )
{
SdrObject *pO = Imp()->GetDrawView()->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj();
@@ -2587,7 +2594,7 @@ BOOL SwFEShell::IsAlignPossible() const
if ( bRet )
return Imp()->GetDrawView()->IsAlignPossible();
}
- return FALSE;
+ return sal_False;
}
@@ -2597,7 +2604,7 @@ void SwFEShell::CheckUnboundObjects()
SET_CURR_SHELL( this );
const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
- for ( USHORT i = 0; i < rMrkList.GetMarkCount(); ++i )
+ for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i )
{
SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
if ( !GetUserCall(pObj) )
@@ -2618,14 +2625,14 @@ void SwFEShell::CheckUnboundObjects()
//Fremde Identifier sollen in den Default laufen.
//Ueberschneidungen sind moeglich!!
- UINT16 nIdent =
+ sal_uInt16 nIdent =
Imp()->GetDrawView()->GetCurrentObjInventor() == SdrInventor ?
Imp()->GetDrawView()->GetCurrentObjIdentifier() : 0xFFFF;
SwFmtAnchor aAnch;
const SwFrm *pAnch = 0;
{
- pAnch = ::FindAnchor( pPage, aPt, TRUE );
+ pAnch = ::FindAnchor( pPage, aPt, sal_True );
SwPosition aPos( *((SwCntntFrm*)pAnch)->GetNode() );
aAnch.SetType( FLY_AT_PARA );
aAnch.SetAnchor( &aPos );
@@ -2685,7 +2692,7 @@ int SwFEShell::Chainable( SwRect &rRect, const SwFrmFmt &rSource,
SdrObject* pObj;
SdrPageView* pPView;
SwDrawView *pDView = (SwDrawView*)Imp()->GetDrawView();
- const USHORT nOld = pDView->GetHitTolerancePixel();
+ const sal_uInt16 nOld = pDView->GetHitTolerancePixel();
pDView->SetHitTolerancePixel( 0 );
if( pDView->PickObj( rPt, pDView->getHitTolLog(), pObj, pPView, SDRSEARCH_PICKMARKABLE ) &&
pObj->ISA(SwVirtFlyDrawObj) )
@@ -2718,7 +2725,7 @@ int SwFEShell::Chain( SwFrmFmt &rSource, const Point &rPt )
SdrObject* pObj;
SdrPageView* pPView;
SwDrawView *pDView = (SwDrawView*)Imp()->GetDrawView();
- const USHORT nOld = pDView->GetHitTolerancePixel();
+ const sal_uInt16 nOld = pDView->GetHitTolerancePixel();
pDView->SetHitTolerancePixel( 0 );
pDView->PickObj( rPt, pDView->getHitTolLog(), pObj, pPView, SDRSEARCH_PICKMARKABLE );
pDView->SetHitTolerancePixel( nOld );
@@ -2756,15 +2763,15 @@ void SwFEShell::HideChainMarker()
void SwFEShell::SetChainMarker()
{
- BOOL bDelFrom = TRUE,
- bDelTo = TRUE;
+ sal_Bool bDelFrom = sal_True,
+ bDelTo = sal_True;
if ( IsFrmSelected() )
{
SwFlyFrm *pFly = FindFlyFrm();
if ( pFly->GetPrevLink() )
{
- bDelFrom = FALSE;
+ bDelFrom = sal_False;
const SwFrm *pPre = pFly->GetPrevLink();
Point aStart( pPre->Frm().Right(), pPre->Frm().Bottom());
@@ -2777,7 +2784,7 @@ void SwFEShell::SetChainMarker()
}
if ( pFly->GetNextLink() )
{
- bDelTo = FALSE;
+ bDelTo = sal_False;
const SwFlyFrm *pNxt = pFly->GetNextLink();
Point aStart( pFly->Frm().Right(), pFly->Frm().Bottom());
@@ -2824,9 +2831,19 @@ long SwFEShell::GetSectionWidth( SwFmt& rFmt ) const
return pSct->Frm().Width();
return 0;
}
+<<<<<<< local
+=======
+/* -----------------------------2002/06/24 15:07------------------------------
+>>>>>>> other
+<<<<<<< local
void SwFEShell::CreateDefaultShape( UINT16 /*SdrObjKind ?*/ eSdrObjectKind, const Rectangle& rRect,
USHORT nSlotId)
+=======
+ ---------------------------------------------------------------------------*/
+void SwFEShell::CreateDefaultShape( sal_uInt16 /*SdrObjKind ?*/ eSdrObjectKind, const Rectangle& rRect,
+ sal_uInt16 nSlotId)
+>>>>>>> other
{
SdrView* pDrawView = GetDrawView();
SdrModel* pDrawModel = pDrawView->GetModel();
@@ -2954,7 +2971,7 @@ void SwFEShell::CreateDefaultShape( UINT16 /*SdrObjKind ?*/ eSdrObjectKind, cons
}
else if(pObj->ISA(SdrCaptionObj))
{
- BOOL bVerticalText = ( SID_DRAW_TEXT_VERTICAL == nSlotId ||
+ sal_Bool bVerticalText = ( SID_DRAW_TEXT_VERTICAL == nSlotId ||
SID_DRAW_CAPTION_VERTICAL == nSlotId );
((SdrTextObj*)pObj)->SetVerticalWriting(bVerticalText);
if(bVerticalText)
@@ -2982,8 +2999,8 @@ void SwFEShell::CreateDefaultShape( UINT16 /*SdrObjKind ?*/ eSdrObjectKind, cons
if(bVertical)
{
SfxItemSet aSet(pDrawModel->GetItemPool());
- aSet.Put(SdrTextAutoGrowWidthItem(TRUE));
- aSet.Put(SdrTextAutoGrowHeightItem(FALSE));
+ aSet.Put(SdrTextAutoGrowWidthItem(sal_True));
+ aSet.Put(SdrTextAutoGrowHeightItem(sal_False));
aSet.Put(SdrTextVertAdjustItem(SDRTEXTVERTADJUST_TOP));
aSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_RIGHT));
pText->SetMergedItemSet(aSet);
@@ -2992,12 +3009,12 @@ void SwFEShell::CreateDefaultShape( UINT16 /*SdrObjKind ?*/ eSdrObjectKind, cons
if(bMarquee)
{
SfxItemSet aSet(pDrawModel->GetItemPool(), SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST);
- aSet.Put( SdrTextAutoGrowWidthItem( FALSE ) );
- aSet.Put( SdrTextAutoGrowHeightItem( FALSE ) );
+ aSet.Put( SdrTextAutoGrowWidthItem( sal_False ) );
+ aSet.Put( SdrTextAutoGrowHeightItem( sal_False ) );
aSet.Put( SdrTextAniKindItem( SDRTEXTANI_SLIDE ) );
aSet.Put( SdrTextAniDirectionItem( SDRTEXTANI_LEFT ) );
aSet.Put( SdrTextAniCountItem( 1 ) );
- aSet.Put( SdrTextAniAmountItem( (INT16)GetWin()->PixelToLogic(Size(2,1)).Width()) );
+ aSet.Put( SdrTextAniAmountItem( (sal_Int16)GetWin()->PixelToLogic(Size(2,1)).Width()) );
pObj->SetMergedItemSetAndBroadcast(aSet);
}
}
diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx
index 399c2f5ee8cf..26dc11c4b4f1 100644
--- a/sw/source/core/frmedt/fetab.cxx
+++ b/sw/source/core/frmedt/fetab.cxx
@@ -80,8 +80,8 @@ using namespace ::com::sun::star;
//siehe auch swtable.cxx
#define COLFUZZY 20L
-inline BOOL IsSame( long nA, long nB ) { return Abs(nA-nB) <= COLFUZZY; }
-inline BOOL IsNear( long nA, long nB, long nTolerance ) { return Abs( nA - nB ) <= nTolerance; }
+inline sal_Bool IsSame( long nA, long nB ) { return Abs(nA-nB) <= COLFUZZY; }
+inline sal_Bool IsNear( long nA, long nB, long nTolerance ) { return Abs( nA - nB ) <= nTolerance; }
// table column cache
SwTabCols *pLastCols = 0;
@@ -100,17 +100,17 @@ class TblWait
{
SwWait *pWait;
public:
- TblWait( USHORT nCnt, SwFrm *pFrm, SwDocShell &rDocShell, USHORT nCnt2 = 0);
+ TblWait( sal_uInt16 nCnt, SwFrm *pFrm, SwDocShell &rDocShell, sal_uInt16 nCnt2 = 0);
~TblWait() { delete pWait; }
};
-TblWait::TblWait( USHORT nCnt, SwFrm *pFrm, SwDocShell &rDocShell, USHORT nCnt2):
+TblWait::TblWait( sal_uInt16 nCnt, SwFrm *pFrm, SwDocShell &rDocShell, sal_uInt16 nCnt2):
pWait( 0 )
{
- BOOL bWait = 20 < nCnt || 20 < nCnt2 || (pFrm &&
+ sal_Bool bWait = 20 < nCnt || 20 < nCnt2 || (pFrm &&
20 < pFrm->ImplFindTabFrm()->GetTable()->GetTabLines().Count());
if( bWait )
- pWait = new SwWait( rDocShell, TRUE );
+ pWait = new SwWait( rDocShell, sal_True );
}
@@ -205,18 +205,18 @@ void SwFEShell::ParkCursorInTab()
#* Datum : MA 03. May. 93
#* Update : MA 19. Apr. 95
#***********************************************************************/
-BOOL SwFEShell::InsertRow( USHORT nCnt, BOOL bBehind )
+sal_Bool SwFEShell::InsertRow( sal_uInt16 nCnt, sal_Bool bBehind )
{
// pruefe ob vom aktuellen Crsr der Point/Mark in einer Tabelle stehen
SwFrm *pFrm = GetCurrFrm();
if( !pFrm || !pFrm->IsInTab() )
- return FALSE;
+ return sal_False;
if( pFrm->ImplFindTabFrm()->GetTable()->ISA( SwDDETable ))
{
ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR,
ERRCODE_MSG_INFO | ERRCODE_BUTTON_DEF_OK );
- return FALSE;
+ return sal_False;
}
SET_CURR_SHELL( this );
@@ -228,7 +228,7 @@ BOOL SwFEShell::InsertRow( USHORT nCnt, BOOL bBehind )
TblWait( nCnt, pFrm, *GetDoc()->GetDocShell(), aBoxes.Count() );
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if ( aBoxes.Count() )
bRet = GetDoc()->InsertRow( aBoxes, nCnt, bBehind );
@@ -236,18 +236,18 @@ BOOL SwFEShell::InsertRow( USHORT nCnt, BOOL bBehind )
return bRet;
}
-BOOL SwFEShell::InsertCol( USHORT nCnt, BOOL bBehind )
+sal_Bool SwFEShell::InsertCol( sal_uInt16 nCnt, sal_Bool bBehind )
{
// pruefe ob vom aktuellen Crsr der Point/Mark in einer Tabelle stehen
SwFrm *pFrm = GetCurrFrm();
if( !pFrm || !pFrm->IsInTab() )
- return FALSE;
+ return sal_False;
if( pFrm->ImplFindTabFrm()->GetTable()->ISA( SwDDETable ))
{
ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR,
ERRCODE_MSG_INFO | ERRCODE_BUTTON_DEF_OK );
- return FALSE;
+ return sal_False;
}
SET_CURR_SHELL( this );
@@ -256,7 +256,7 @@ BOOL SwFEShell::InsertCol( USHORT nCnt, BOOL bBehind )
{
ErrorHandler::HandleError( ERR_TBLINSCOL_ERROR,
ERRCODE_MSG_INFO | ERRCODE_BUTTON_DEF_OK );
- return FALSE;
+ return sal_False;
}
StartAllAction();
@@ -266,7 +266,7 @@ BOOL SwFEShell::InsertCol( USHORT nCnt, BOOL bBehind )
TblWait( nCnt, pFrm, *GetDoc()->GetDocShell(), aBoxes.Count() );
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( aBoxes.Count() )
bRet = GetDoc()->InsertCol( aBoxes, nCnt, bBehind );
@@ -284,11 +284,11 @@ BOOL SwFEShell::InsertCol( USHORT nCnt, BOOL bBehind )
/**
Determines if the current cursor is in the last row of the table.
*/
-BOOL SwFEShell::IsLastCellInRow() const
+sal_Bool SwFEShell::IsLastCellInRow() const
{
SwTabCols aTabCols;
GetTabCols( aTabCols );
- BOOL bResult = FALSE;
+ sal_Bool bResult = sal_False;
if (IsTableRightToLeft())
/* If the table is right-to-left the last row is the most left one. */
@@ -300,25 +300,25 @@ BOOL SwFEShell::IsLastCellInRow() const
return bResult;
}
-BOOL SwFEShell::DeleteCol()
+sal_Bool SwFEShell::DeleteCol()
{
// pruefe ob vom aktuellen Crsr der SPoint/Mark in einer Tabelle stehen
SwFrm *pFrm = GetCurrFrm();
if( !pFrm || !pFrm->IsInTab() )
- return FALSE;
+ return sal_False;
if( pFrm->ImplFindTabFrm()->GetTable()->ISA( SwDDETable ))
{
ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR,
ERRCODE_MSG_INFO | ERRCODE_BUTTON_DEF_OK );
- return FALSE;
+ return sal_False;
}
SET_CURR_SHELL( this );
StartAllAction();
// lasse ueber das Layout die Boxen suchen
- BOOL bRet;
+ sal_Bool bRet;
SwSelBoxes aBoxes;
GetTblSel( *this, aBoxes, nsSwTblSearchType::TBLSEARCH_COL );
if ( aBoxes.Count() )
@@ -340,31 +340,31 @@ BOOL SwFEShell::DeleteCol()
}
else
- bRet = FALSE;
+ bRet = sal_False;
EndAllActionAndCall();
return bRet;
}
-BOOL SwFEShell::DeleteRow()
+sal_Bool SwFEShell::DeleteRow()
{
// pruefe ob vom aktuellen Crsr der SPoint/Mark in einer Tabelle stehen
SwFrm *pFrm = GetCurrFrm();
if( !pFrm || !pFrm->IsInTab() )
- return FALSE;
+ return sal_False;
if( pFrm->ImplFindTabFrm()->GetTable()->ISA( SwDDETable ))
{
ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR,
ERRCODE_MSG_INFO | ERRCODE_BUTTON_DEF_OK );
- return FALSE;
+ return sal_False;
}
SET_CURR_SHELL( this );
StartAllAction();
// lasse ueber das Layout die Boxen suchen
- BOOL bRet;
+ sal_Bool bRet;
SwSelBoxes aBoxes;
GetTblSel( *this, aBoxes, nsSwTblSearchType::TBLSEARCH_ROW );
@@ -390,7 +390,7 @@ BOOL SwFEShell::DeleteRow()
if( !aFndBox.GetLines().Count() )
{
EndAllActionAndCall();
- return FALSE;
+ return sal_False;
}
KillPams();
@@ -416,7 +416,7 @@ BOOL SwFEShell::DeleteRow()
pDelBox = pLn->GetTabBoxes()[ pLn->GetTabBoxes().Count() - 1 ];
}
SwTableBox* pNextBox = pDelLine->FindNextBox( pTblNd->GetTable(),
- pDelBox, TRUE );
+ pDelBox, sal_True );
while( pNextBox &&
pNextBox->GetFrmFmt()->GetProtect().IsCntntProtected() )
pNextBox = pNextBox->FindNextBox( pTblNd->GetTable(), pNextBox );
@@ -428,13 +428,13 @@ BOOL SwFEShell::DeleteRow()
while( !pDelBox->GetSttNd() )
pDelBox = pDelBox->GetTabLines()[0]->GetTabBoxes()[0];
pNextBox = pDelLine->FindPreviousBox( pTblNd->GetTable(),
- pDelBox, TRUE );
+ pDelBox, sal_True );
while( pNextBox &&
pNextBox->GetFrmFmt()->GetProtect().IsCntntProtected() )
pNextBox = pNextBox->FindPreviousBox( pTblNd->GetTable(), pNextBox );
}
- ULONG nIdx;
+ sal_uLong nIdx;
if( pNextBox ) // dann den Cursor hier hinein
nIdx = pNextBox->GetSttIdx() + 1;
else // ansonsten hinter die Tabelle
@@ -461,7 +461,7 @@ BOOL SwFEShell::DeleteRow()
EndUndo(UNDO_ROW_DELETE);
}
else
- bRet = FALSE;
+ bRet = sal_False;
EndAllActionAndCall();
return bRet;
@@ -474,10 +474,10 @@ BOOL SwFEShell::DeleteRow()
#* Update : MA 19. Apr. 95
#***********************************************************************/
-USHORT SwFEShell::MergeTab()
+sal_uInt16 SwFEShell::MergeTab()
{
// pruefe ob vom aktuellen Crsr der SPoint/Mark in einer Tabelle stehen
- USHORT nRet = TBLMERGE_NOSELECTION;
+ sal_uInt16 nRet = TBLMERGE_NOSELECTION;
if( IsTableMode() )
{
SwShellTableCrsr* pTableCrsr = GetTableCrsr();
@@ -505,18 +505,18 @@ USHORT SwFEShell::MergeTab()
return nRet;
}
-BOOL SwFEShell::SplitTab( BOOL bVert, USHORT nCnt, BOOL bSameHeight )
+sal_Bool SwFEShell::SplitTab( sal_Bool bVert, sal_uInt16 nCnt, sal_Bool bSameHeight )
{
// pruefe ob vom aktuellen Crsr der SPoint/Mark in einer Tabelle stehen
SwFrm *pFrm = GetCurrFrm();
if( !pFrm || !pFrm->IsInTab() )
- return FALSE;
+ return sal_False;
if( pFrm->ImplFindTabFrm()->GetTable()->ISA( SwDDETable ))
{
ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR,
ERRCODE_MSG_INFO | ERRCODE_BUTTON_DEF_OK );
- return FALSE;
+ return sal_False;
}
SET_CURR_SHELL( this );
@@ -525,11 +525,11 @@ BOOL SwFEShell::SplitTab( BOOL bVert, USHORT nCnt, BOOL bSameHeight )
{
ErrorHandler::HandleError( ERR_TBLSPLIT_ERROR,
ERRCODE_MSG_INFO | ERRCODE_BUTTON_DEF_OK );
- return FALSE;
+ return sal_False;
}
StartAllAction();
// lasse ueber das Layout die Boxen suchen
- BOOL bRet;
+ sal_Bool bRet;
SwSelBoxes aBoxes;
GetTblSel( *this, aBoxes );
if( aBoxes.Count() )
@@ -543,7 +543,7 @@ BOOL SwFEShell::SplitTab( BOOL bVert, USHORT nCnt, BOOL bSameHeight )
DELETEZ( pLastRows );
}
else
- bRet = FALSE;
+ bRet = sal_False;
EndAllActionAndCall();
return bRet;
}
@@ -561,16 +561,16 @@ void SwFEShell::_GetTabCols( SwTabCols &rToFill, const SwFrm *pBox ) const
if ( pLastCols )
{
//Paar Kleinigkeiten muessen wir schon noch sicherstellen
- BOOL bDel = TRUE;
+ sal_Bool bDel = sal_True;
if ( pColumnCacheLastTable == pTab->GetTable() )
{
- bDel = FALSE;
+ bDel = sal_False;
SWRECTFN( pTab )
const SwPageFrm* pPage = pTab->FindPageFrm();
- const ULONG nLeftMin = (pTab->Frm().*fnRect->fnGetLeft)() -
+ const sal_uLong nLeftMin = (pTab->Frm().*fnRect->fnGetLeft)() -
(pPage->Frm().*fnRect->fnGetLeft)();
- const ULONG nRightMax = (pTab->Frm().*fnRect->fnGetRight)() -
+ const sal_uLong nRightMax = (pTab->Frm().*fnRect->fnGetRight)() -
(pPage->Frm().*fnRect->fnGetLeft)();
if ( pColumnCacheLastTabFrm != pTab )
@@ -590,25 +590,25 @@ void SwFEShell::_GetTabCols( SwTabCols &rToFill, const SwFrm *pBox ) const
pColumnCacheLastTabFrm = pTab;
}
else
- bDel = TRUE;
+ bDel = sal_True;
}
if ( !bDel &&
- pLastCols->GetLeftMin () == (USHORT)nLeftMin &&
- pLastCols->GetLeft () == (USHORT)(pTab->Prt().*fnRect->fnGetLeft)() &&
- pLastCols->GetRight () == (USHORT)(pTab->Prt().*fnRect->fnGetRight)()&&
- pLastCols->GetRightMax() == (USHORT)nRightMax - pLastCols->GetLeftMin() )
+ pLastCols->GetLeftMin () == (sal_uInt16)nLeftMin &&
+ pLastCols->GetLeft () == (sal_uInt16)(pTab->Prt().*fnRect->fnGetLeft)() &&
+ pLastCols->GetRight () == (sal_uInt16)(pTab->Prt().*fnRect->fnGetRight)()&&
+ pLastCols->GetRightMax() == (sal_uInt16)nRightMax - pLastCols->GetLeftMin() )
{
if ( pColumnCacheLastCellFrm != pBox )
{
pTab->GetTable()->GetTabCols( *pLastCols,
- ((SwCellFrm*)pBox)->GetTabBox(), TRUE);
+ ((SwCellFrm*)pBox)->GetTabBox(), sal_True);
pColumnCacheLastCellFrm = pBox;
}
rToFill = *pLastCols;
}
else
- bDel = TRUE;
+ bDel = sal_True;
}
if ( bDel )
DELETEZ(pLastCols);
@@ -625,7 +625,7 @@ void SwFEShell::_GetTabCols( SwTabCols &rToFill, const SwFrm *pBox ) const
#if OSL_DEBUG_LEVEL > 1
SwTabColsEntry aEntry;
- for ( USHORT i = 0; i < rToFill.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rToFill.Count(); ++i )
{
aEntry = rToFill.GetEntry( i );
(void)aEntry;
@@ -645,10 +645,10 @@ void SwFEShell::_GetTabRows( SwTabCols &rToFill, const SwFrm *pBox ) const
if ( pLastRows )
{
//Paar Kleinigkeiten muessen wir schon noch sicherstellen
- BOOL bDel = TRUE;
+ sal_Bool bDel = sal_True;
if ( pRowCacheLastTable == pTab->GetTable() )
{
- bDel = FALSE;
+ bDel = sal_False;
SWRECTFN( pTab )
const SwPageFrm* pPage = pTab->FindPageFrm();
const long nLeftMin = ( bVert ?
@@ -660,7 +660,7 @@ void SwFEShell::_GetTabRows( SwTabCols &rToFill, const SwFrm *pBox ) const
if ( pRowCacheLastTabFrm != pTab ||
pRowCacheLastCellFrm != pBox )
- bDel = TRUE;
+ bDel = sal_True;
if ( !bDel &&
pLastRows->GetLeftMin () == nLeftMin &&
@@ -671,7 +671,7 @@ void SwFEShell::_GetTabRows( SwTabCols &rToFill, const SwFrm *pBox ) const
rToFill = *pLastRows;
}
else
- bDel = TRUE;
+ bDel = sal_True;
}
if ( bDel )
DELETEZ(pLastRows);
@@ -693,7 +693,7 @@ void SwFEShell::_GetTabRows( SwTabCols &rToFill, const SwFrm *pBox ) const
#* Datum : MA 03. May. 93
#* Update : MA 18. May. 93
#***********************************************************************/
-void SwFEShell::SetTabCols( const SwTabCols &rNew, BOOL bCurRowOnly )
+void SwFEShell::SetTabCols( const SwTabCols &rNew, sal_Bool bCurRowOnly )
{
SwFrm *pBox = GetCurrFrm();
if( !pBox || !pBox->IsInTab() )
@@ -739,7 +739,7 @@ void SwFEShell::GetTabRows( SwTabCols &rToFill ) const
/*-- 19.01.2004 08:56:44---------------------------------------------------
-----------------------------------------------------------------------*/
-void SwFEShell::SetTabRows( const SwTabCols &rNew, BOOL bCurColOnly )
+void SwFEShell::SetTabRows( const SwTabCols &rNew, sal_Bool bCurColOnly )
{
SwFrm *pBox = GetCurrFrm();
if( !pBox || !pBox->IsInTab() )
@@ -767,7 +767,7 @@ void SwFEShell::GetMouseTabRows( SwTabCols &rToFill, const Point &rPt ) const
/*-- 19.01.2004 08:59:45---------------------------------------------------
-----------------------------------------------------------------------*/
-void SwFEShell::SetMouseTabRows( const SwTabCols &rNew, BOOL bCurColOnly, const Point &rPt )
+void SwFEShell::SetMouseTabRows( const SwTabCols &rNew, sal_Bool bCurColOnly, const Point &rPt )
{
const SwFrm *pBox = GetBox( rPt );
if( pBox )
@@ -822,12 +822,12 @@ void SwFEShell::GetRowHeight( SwFmtFrmSize *& rpSz ) const
GetDoc()->GetRowHeight( *getShellCrsr( false ), rpSz );
}
-BOOL SwFEShell::BalanceRowHeight( BOOL bTstOnly )
+sal_Bool SwFEShell::BalanceRowHeight( sal_Bool bTstOnly )
{
SET_CURR_SHELL( this );
if( !bTstOnly )
StartAllAction();
- BOOL bRet = GetDoc()->BalanceRowHeight( *getShellCrsr( false ), bTstOnly );
+ sal_Bool bRet = GetDoc()->BalanceRowHeight( *getShellCrsr( false ), bTstOnly );
if( !bTstOnly )
EndAllActionAndCall();
return bRet;
@@ -847,7 +847,7 @@ void SwFEShell::SetRowBackground( const SvxBrushItem &rNew )
/******************************************************************************
* SwTwips SwFEShell::GetRowBackground() const
******************************************************************************/
-BOOL SwFEShell::GetRowBackground( SvxBrushItem &rToFill ) const
+sal_Bool SwFEShell::GetRowBackground( SvxBrushItem &rToFill ) const
{
return GetDoc()->GetRowBackground( *getShellCrsr( false ), rToFill );
}
@@ -867,7 +867,7 @@ void SwFEShell::SetTabBorders( const SfxItemSet& rSet )
EndAllActionAndCall();
}
-void SwFEShell::SetTabLineStyle( const Color* pColor, BOOL bSetLine,
+void SwFEShell::SetTabLineStyle( const Color* pColor, sal_Bool bSetLine,
const SvxBorderLine* pBorderLine )
{
SET_CURR_SHELL( this );
@@ -897,7 +897,7 @@ void SwFEShell::SetBoxBackground( const SvxBrushItem &rNew )
EndAllActionAndCall();
}
-BOOL SwFEShell::GetBoxBackground( SvxBrushItem &rToFill ) const
+sal_Bool SwFEShell::GetBoxBackground( SvxBrushItem &rToFill ) const
{
return GetDoc()->GetBoxAttr( *getShellCrsr( false ), rToFill );
}
@@ -916,7 +916,7 @@ void SwFEShell::SetBoxDirection( const SvxFrameDirectionItem& rNew )
EndAllActionAndCall();
}
-BOOL SwFEShell::GetBoxDirection( SvxFrameDirectionItem& rToFill ) const
+sal_Bool SwFEShell::GetBoxDirection( SvxFrameDirectionItem& rToFill ) const
{
return GetDoc()->GetBoxAttr( *getShellCrsr( false ), rToFill );
}
@@ -927,7 +927,7 @@ BOOL SwFEShell::GetBoxDirection( SvxFrameDirectionItem& rToFill ) const
#* Datum : MA 18. Dec. 96
#* Update : JP 29.04.98
#***********************************************************************/
-void SwFEShell::SetBoxAlign( USHORT nAlign )
+void SwFEShell::SetBoxAlign( sal_uInt16 nAlign )
{
SET_CURR_SHELL( this );
StartAllAction();
@@ -935,7 +935,7 @@ void SwFEShell::SetBoxAlign( USHORT nAlign )
EndAllActionAndCall();
}
-USHORT SwFEShell::GetBoxAlign() const
+sal_uInt16 SwFEShell::GetBoxAlign() const
{
return GetDoc()->GetBoxAlign( *getShellCrsr( false ) );
}
@@ -973,7 +973,7 @@ void SwFEShell::GetTabBackground( SvxBrushItem &rToFill ) const
#* Datum : MA 18. May. 93
#* Update : MA 20. Jul. 93
#***********************************************************************/
-BOOL SwFEShell::HasWholeTabSelection() const
+sal_Bool SwFEShell::HasWholeTabSelection() const
{
//Ist die ganze Tabelle Selektiert?
if ( IsTableMode() )
@@ -989,24 +989,24 @@ BOOL SwFEShell::HasWholeTabSelection() const
== pTblNd->EndOfSectionIndex() );
}
}
- return FALSE;
+ return sal_False;
}
-BOOL SwFEShell::HasBoxSelection() const
+sal_Bool SwFEShell::HasBoxSelection() const
{
if(!IsCrsrInTbl())
- return FALSE;
+ return sal_False;
//Ist die ganze Tabelle Selektiert?
if( IsTableMode() )
- return TRUE;
+ return sal_True;
SwPaM* pPam = GetCrsr();
// leere Boxen gelten auch ohne Selektion als selektiert
// if( !pPam->HasMark() )
-// return FALSE;
- BOOL bChg = FALSE;
+// return sal_False;
+ sal_Bool bChg = sal_False;
if( pPam->GetPoint() == pPam->End())
{
- bChg = TRUE;
+ bChg = sal_True;
pPam->Exchange();
}
SwNode* pNd;
@@ -1017,7 +1017,7 @@ BOOL SwFEShell::HasBoxSelection() const
pNd->EndOfSectionIndex())
{
SwNodeIndex aIdx( *pNd->EndOfSectionNode(), -1 );
- SwCntntNode* pCNd = GetDoc()->GetNodes()[ aIdx ]->GetCntntNode();
+ SwCntntNode* pCNd = aIdx.GetNode().GetCntntNode();
if( !pCNd )
{
pCNd = GetDoc()->GetNodes().GoPrevious( &aIdx );
@@ -1027,12 +1027,12 @@ BOOL SwFEShell::HasBoxSelection() const
{
if( bChg )
pPam->Exchange();
- return TRUE;
+ return sal_True;
}
}
if( bChg )
pPam->Exchange();
- return FALSE;
+ return sal_False;
}
/***********************************************************************
@@ -1044,7 +1044,7 @@ BOOL SwFEShell::HasBoxSelection() const
void SwFEShell::ProtectCells()
{
SvxProtectItem aProt( RES_PROTECT );
- aProt.SetCntntProtect( TRUE );
+ aProt.SetCntntProtect( sal_True );
SET_CURR_SHELL( this );
StartAllAction();
@@ -1096,16 +1096,16 @@ void SwFEShell::UnProtectTbls()
EndAllActionAndCall();
}
-BOOL SwFEShell::HasTblAnyProtection( const String* pTblName,
- BOOL* pFullTblProtection )
+sal_Bool SwFEShell::HasTblAnyProtection( const String* pTblName,
+ sal_Bool* pFullTblProtection )
{
return GetDoc()->HasTblAnyProtection( GetCrsr()->GetPoint(), pTblName,
pFullTblProtection );
}
-BOOL SwFEShell::CanUnProtectCells() const
+sal_Bool SwFEShell::CanUnProtectCells() const
{
- BOOL bUnProtectAvailable = FALSE;
+ sal_Bool bUnProtectAvailable = sal_False;
const SwTableNode *pTblNd = IsCrsrInTbl();
if( pTblNd && !pTblNd->IsProtect() )
{
@@ -1134,7 +1134,7 @@ BOOL SwFEShell::CanUnProtectCells() const
#* Class : SwFEShell
#* Methoden : GetRowsToRepeat(), SetRowsToRepeat()
#***********************************************************************/
-USHORT SwFEShell::GetRowsToRepeat() const
+sal_uInt16 SwFEShell::GetRowsToRepeat() const
{
const SwFrm *pFrm = GetCurrFrm();
const SwTabFrm *pTab = pFrm ? pFrm->FindTabFrm() : 0;
@@ -1143,13 +1143,13 @@ USHORT SwFEShell::GetRowsToRepeat() const
return 0;
}
-void SwFEShell::SetRowsToRepeat( USHORT nSet )
+void SwFEShell::SetRowsToRepeat( sal_uInt16 nSet )
{
SwFrm *pFrm = GetCurrFrm();
SwTabFrm *pTab = pFrm ? pFrm->FindTabFrm() : 0;
if( pTab && pTab->GetTable()->GetRowsToRepeat() != nSet )
{
- SwWait aWait( *GetDoc()->GetDocShell(), TRUE );
+ SwWait aWait( *GetDoc()->GetDocShell(), sal_True );
SET_CURR_SHELL( this );
StartAllAction();
GetDoc()->SetRowsToRepeat( *pTab->GetTable(), nSet );
@@ -1159,15 +1159,19 @@ void SwFEShell::SetRowsToRepeat( USHORT nSet )
/*-- 30.06.2004 08:46:35---------------------------------------------------
returns the number of rows consecutively selected from top
-----------------------------------------------------------------------*/
-USHORT lcl_GetRowNumber( const SwPosition& rPos )
+sal_uInt16 lcl_GetRowNumber( const SwPosition& rPos )
{
- USHORT nRet = USHRT_MAX;
+ sal_uInt16 nRet = USHRT_MAX;
Point aTmpPt;
const SwCntntNode *pNd;
const SwCntntFrm *pFrm;
if( 0 != ( pNd = rPos.nNode.GetNode().GetCntntNode() ))
+<<<<<<< local
pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), &aTmpPt, &rPos, FALSE );
+=======
+ pFrm = pNd->GetFrm( &aTmpPt, &rPos, sal_False );
+>>>>>>> other
else
pFrm = 0;
@@ -1180,7 +1184,7 @@ USHORT lcl_GetRowNumber( const SwPosition& rPos )
const SwTabFrm* pTabFrm = (const SwTabFrm*)pRow->GetUpper();
const SwTableLine* pTabLine = static_cast<const SwRowFrm*>(pRow)->GetTabLine();
- USHORT nI = 0;
+ sal_uInt16 nI = 0;
while ( nI < pTabFrm->GetTable()->GetTabLines().Count() )
{
if ( pTabFrm->GetTable()->GetTabLines()[ nI ] == pTabLine )
@@ -1194,11 +1198,11 @@ USHORT lcl_GetRowNumber( const SwPosition& rPos )
return nRet;
}
-USHORT SwFEShell::GetRowSelectionFromTop() const
+sal_uInt16 SwFEShell::GetRowSelectionFromTop() const
{
- USHORT nRet = 0;
+ sal_uInt16 nRet = 0;
const SwPaM* pPaM = IsTableMode() ? GetTableCrsr() : _GetCrsr();
- const USHORT nPtLine = lcl_GetRowNumber( *pPaM->GetPoint() );
+ const sal_uInt16 nPtLine = lcl_GetRowNumber( *pPaM->GetPoint() );
if ( !IsTableMode() )
{
@@ -1206,7 +1210,7 @@ USHORT SwFEShell::GetRowSelectionFromTop() const
}
else
{
- const USHORT nMkLine = lcl_GetRowNumber( *pPaM->GetMark() );
+ const sal_uInt16 nMkLine = lcl_GetRowNumber( *pPaM->GetMark() );
if ( ( nPtLine == 0 && nMkLine != USHRT_MAX ) ||
( nMkLine == 0 && nPtLine != USHRT_MAX ) )
@@ -1227,9 +1231,9 @@ USHORT SwFEShell::GetRowSelectionFromTop() const
* returns true if the current frame is localed inside a table headline OR
* inside the first line of a table!!!
*/
-BOOL SwFEShell::CheckHeadline( bool bRepeat ) const
+sal_Bool SwFEShell::CheckHeadline( bool bRepeat ) const
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if ( !IsTableMode() )
{
SwFrm *pFrm = GetCurrFrm(); // DONE MULTIIHEADER
@@ -1257,7 +1261,7 @@ BOOL SwFEShell::CheckHeadline( bool bRepeat ) const
#* Update : MA 27. Jul. 95
#***********************************************************************/
-void SwFEShell::AdjustCellWidth( BOOL bBalance )
+void SwFEShell::AdjustCellWidth( sal_Bool bBalance )
{
SET_CURR_SHELL( this );
StartAllAction();
@@ -1270,14 +1274,14 @@ void SwFEShell::AdjustCellWidth( BOOL bBalance )
EndAllActionAndCall();
}
-BOOL SwFEShell::IsAdjustCellWidthAllowed( BOOL bBalance ) const
+sal_Bool SwFEShell::IsAdjustCellWidthAllowed( sal_Bool bBalance ) const
{
//Es muss mindestens eine Zelle mit Inhalt in der Selektion enthalten
//sein.
SwFrm *pFrm = GetCurrFrm();
if( !pFrm || !pFrm->IsInTab() )
- return FALSE;
+ return sal_False;
SwSelBoxes aBoxes;
::GetTblSelCrs( *this, aBoxes );
@@ -1294,7 +1298,7 @@ BOOL SwFEShell::IsAdjustCellWidthAllowed( BOOL bBalance ) const
aBoxes.Insert( pBox );
}
- for ( USHORT i = 0; i < aBoxes.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < aBoxes.Count(); ++i )
{
SwTableBox *pBox = aBoxes[i];
if ( pBox->GetSttNd() )
@@ -1307,21 +1311,21 @@ BOOL SwFEShell::IsAdjustCellWidthAllowed( BOOL bBalance ) const
while ( pCNd )
{
if ( pCNd->GetTxt().Len() )
- return TRUE;
+ return sal_True;
++aIdx;
- pCNd = GetDoc()->GetNodes()[ aIdx ]->GetTxtNode();
+ pCNd = aIdx.GetNode().GetTxtNode();
}
}
}
- return FALSE;
+ return sal_False;
}
// AutoFormat fuer die Tabelle/TabellenSelection
-BOOL SwFEShell::SetTableAutoFmt( const SwTableAutoFmt& rNew )
+sal_Bool SwFEShell::SetTableAutoFmt( const SwTableAutoFmt& rNew )
{
SwTableNode *pTblNd = (SwTableNode*)IsCrsrInTbl();
if( !pTblNd || pTblNd->GetTable().IsTblComplex() )
- return FALSE;
+ return sal_False;
SwSelBoxes aBoxes;
@@ -1334,14 +1338,14 @@ BOOL SwFEShell::SetTableAutoFmt( const SwTableAutoFmt& rNew )
else
{
const SwTableSortBoxes& rTBoxes = pTblNd->GetTable().GetTabSortBoxes();
- for( USHORT n = 0; n < rTBoxes.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rTBoxes.Count(); ++n )
{
SwTableBox* pBox = rTBoxes[ n ];
aBoxes.Insert( pBox );
}
}
- BOOL bRet;
+ sal_Bool bRet;
if( aBoxes.Count() )
{
SET_CURR_SHELL( this );
@@ -1352,15 +1356,15 @@ BOOL SwFEShell::SetTableAutoFmt( const SwTableAutoFmt& rNew )
EndAllActionAndCall();
}
else
- bRet = FALSE;
+ bRet = sal_False;
return bRet;
}
-BOOL SwFEShell::GetTableAutoFmt( SwTableAutoFmt& rGet )
+sal_Bool SwFEShell::GetTableAutoFmt( SwTableAutoFmt& rGet )
{
const SwTableNode *pTblNd = IsCrsrInTbl();
if( !pTblNd || pTblNd->GetTable().IsTblComplex() )
- return FALSE;
+ return sal_False;
SwSelBoxes aBoxes;
@@ -1373,7 +1377,7 @@ BOOL SwFEShell::GetTableAutoFmt( SwTableAutoFmt& rGet )
else
{
const SwTableSortBoxes& rTBoxes = pTblNd->GetTable().GetTabSortBoxes();
- for( USHORT n = 0; n < rTBoxes.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rTBoxes.Count(); ++n )
{
SwTableBox* pBox = rTBoxes[ n ];
aBoxes.Insert( pBox );
@@ -1389,25 +1393,25 @@ BOOL SwFEShell::GetTableAutoFmt( SwTableAutoFmt& rGet )
#* Datum : MA 03. May. 93
#* Update : MA 19. Apr. 95
#***********************************************************************/
-BOOL SwFEShell::DeleteTblSel()
+sal_Bool SwFEShell::DeleteTblSel()
{
// pruefe ob vom aktuellen Crsr der SPoint/Mark in einer Tabelle stehen
SwFrm *pFrm = GetCurrFrm();
if( !pFrm || !pFrm->IsInTab() )
- return FALSE;
+ return sal_False;
if( pFrm->ImplFindTabFrm()->GetTable()->ISA( SwDDETable ))
{
ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR,
ERRCODE_MSG_INFO | ERRCODE_BUTTON_DEF_OK );
- return FALSE;
+ return sal_False;
}
SET_CURR_SHELL( this );
StartAllAction();
// lasse ueber das Layout die Boxen suchen
- BOOL bRet;
+ sal_Bool bRet;
SwSelBoxes aBoxes;
GetTblSelCrs( *this, aBoxes );
if( aBoxes.Count() )
@@ -1427,7 +1431,7 @@ BOOL SwFEShell::DeleteTblSel()
DELETEZ( pLastRows );
}
else
- bRet = FALSE;
+ bRet = sal_False;
EndAllActionAndCall();
return bRet;
}
@@ -1440,10 +1444,10 @@ BOOL SwFEShell::DeleteTblSel()
|* Letzte Aenderung MA 21. May. 95
|
|*************************************************************************/
-USHORT SwFEShell::GetCurTabColNum() const
+sal_uInt16 SwFEShell::GetCurTabColNum() const
{
//!!!GetCurMouseTabColNum() mitpflegen!!!!
- USHORT nRet = 0;
+ sal_uInt16 nRet = 0;
SwFrm *pFrm = GetCurrFrm();
ASSERT( pFrm, "Crsr geparkt?" );
@@ -1472,7 +1476,7 @@ USHORT SwFEShell::GetCurTabColNum() const
if ( !::IsSame( nX, nRight ) )
{
nX = nRight - nX + aTabCols.GetLeft();
- for ( USHORT i = 0; i < aTabCols.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < aTabCols.Count(); ++i )
if ( ::IsSame( nX, aTabCols[i] ) )
{
nRet = i + 1;
@@ -1489,7 +1493,7 @@ USHORT SwFEShell::GetCurTabColNum() const
if ( !::IsSame( nX, nLeft + aTabCols.GetLeft() ) )
{
- for ( USHORT i = 0; i < aTabCols.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < aTabCols.Count(); ++i )
if ( ::IsSame( nX, nLeft + aTabCols[i] ) )
{
nRet = i + 1;
@@ -1756,7 +1760,7 @@ const SwFrm* SwFEShell::GetBox( const Point &rPt, bool* pbRow, bool* pbCol ) con
//Erst die Flys checken.
if ( pPage->GetSortedObjs() )
{
- for ( USHORT i = 0; !pFrm && i < pPage->GetSortedObjs()->Count(); ++i )
+ for ( sal_uInt16 i = 0; !pFrm && i < pPage->GetSortedObjs()->Count(); ++i )
{
SwAnchoredObject* pObj = (*pPage->GetSortedObjs())[i];
if ( pObj->ISA(SwFlyFrm) )
@@ -1915,7 +1919,7 @@ bool SwFEShell::SelTblRowCol( const Point& rPt, const Point* pEnd, bool bRowDrag
bool pbCol[2] = { 0, 0 };
// pEnd is set during dragging.
- for ( USHORT i = 0; i < ( pEnd ? 2 : 1 ); ++i )
+ for ( sal_uInt16 i = 0; i < ( pEnd ? 2 : 1 ); ++i )
{
const SwCellFrm* pFrm =
static_cast<const SwCellFrm*>(GetBox( paPt[i], &pbRow[i], &pbCol[i] ) );
@@ -1967,7 +1971,7 @@ bool SwFEShell::SelTblRowCol( const Point& rPt, const Point* pEnd, bool bRowDrag
*pCrsr->GetPoint() = *ppPos[0];
pCrsr->GetPtPos() = paPt[0];
- if ( !pCrsr->IsInProtectTable( FALSE, TRUE ) )
+ if ( !pCrsr->IsInProtectTable( sal_False, sal_True ) )
{
bool bNewSelection = true;
@@ -1981,7 +1985,7 @@ bool SwFEShell::SelTblRowCol( const Point& rPt, const Point* pEnd, bool bRowDrag
*pCrsr->GetPoint() = *ppPos[1];
pCrsr->GetPtPos() = paPt[1];
- if ( pCrsr->IsInProtectTable( FALSE, FALSE ) )
+ if ( pCrsr->IsInProtectTable( sal_False, sal_False ) )
{
pCrsr->RestoreSavePos();
bNewSelection = false;
@@ -2030,9 +2034,9 @@ bool SwFEShell::SelTblRowCol( const Point& rPt, const Point* pEnd, bool bRowDrag
|* Last change AMA 12. Jun. 02
|
|*************************************************************************/
-BYTE SwFEShell::WhichMouseTabCol( const Point &rPt ) const
+sal_uInt8 SwFEShell::WhichMouseTabCol( const Point &rPt ) const
{
- BYTE nRet = SW_TABCOL_NONE;
+ sal_uInt8 nRet = SW_TABCOL_NONE;
bool bRow = false;
bool bCol = false;
bool bSelect = false;
@@ -2122,9 +2126,9 @@ SwTxtNode * SwFEShell::GetNumRuleNodeAtPos( const Point &rPt)
return pResult;
}
-BOOL SwFEShell::IsNumLabel( const Point &rPt, int nMaxOffset )
+sal_Bool SwFEShell::IsNumLabel( const Point &rPt, int nMaxOffset )
{
- BOOL bResult = FALSE;
+ sal_Bool bResult = sal_False;
SwContentAtPos aCntntAtPos
(SwContentAtPos::SW_NUMLABEL);
@@ -2133,7 +2137,7 @@ BOOL SwFEShell::IsNumLabel( const Point &rPt, int nMaxOffset )
{
if ((nMaxOffset >= 0 && aCntntAtPos.nDist <= nMaxOffset) ||
(nMaxOffset < 0))
- bResult = TRUE;
+ bResult = sal_True;
}
return bResult;
@@ -2184,7 +2188,7 @@ void SwFEShell::GetMouseTabCols( SwTabCols &rToFill, const Point &rPt ) const
_GetTabCols( rToFill, pBox );
}
-void SwFEShell::SetMouseTabCols( const SwTabCols &rNew, BOOL bCurRowOnly,
+void SwFEShell::SetMouseTabCols( const SwTabCols &rNew, sal_Bool bCurRowOnly,
const Point &rPt )
{
const SwFrm *pBox = GetBox( rPt );
@@ -2205,16 +2209,16 @@ void SwFEShell::SetMouseTabCols( const SwTabCols &rNew, BOOL bCurRowOnly,
|* Letzte Aenderung MA 04. Jul. 95
|
|*************************************************************************/
-USHORT SwFEShell::GetCurMouseColNum( const Point &rPt,
+sal_uInt16 SwFEShell::GetCurMouseColNum( const Point &rPt,
SwGetCurColNumPara* pPara ) const
{
return _GetCurColNum( GetBox( rPt ), pPara );
}
-USHORT SwFEShell::GetCurMouseTabColNum( const Point &rPt ) const
+sal_uInt16 SwFEShell::GetCurMouseTabColNum( const Point &rPt ) const
{
//!!!GetCurTabColNum() mitpflegen!!!!
- USHORT nRet = 0;
+ sal_uInt16 nRet = 0;
const SwFrm *pFrm = GetBox( rPt );
ASSERT( pFrm, "Table not found" );
@@ -2230,7 +2234,7 @@ USHORT SwFEShell::GetCurMouseTabColNum( const Point &rPt ) const
if ( !::IsSame( nX, nLeft + aTabCols.GetLeft() ) )
{
- for ( USHORT i = 0; i < aTabCols.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < aTabCols.Count(); ++i )
if ( ::IsSame( nX, nLeft + aTabCols[i] ) )
{
nRet = i + 1;
@@ -2308,18 +2312,18 @@ bool lcl_GoTableRow( SwCrsrShell* pShell, bool bUp )
}
// aender eine Zellenbreite/-Hoehe/Spaltenbreite/Zeilenhoehe
-BOOL SwFEShell::SetColRowWidthHeight( USHORT eType, USHORT nDiff )
+sal_Bool SwFEShell::SetColRowWidthHeight( sal_uInt16 eType, sal_uInt16 nDiff )
{
SwFrm *pFrm = GetCurrFrm();
if( !pFrm || !pFrm->IsInTab() )
- return FALSE;
+ return sal_False;
if( nsTblChgWidthHeightType::WH_FLAG_INSDEL & eType &&
pFrm->ImplFindTabFrm()->GetTable()->ISA( SwDDETable ))
{
ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR,
ERRCODE_MSG_INFO | ERRCODE_BUTTON_DEF_OK );
- return FALSE;
+ return sal_False;
}
SET_CURR_SHELL( this );
@@ -2349,7 +2353,7 @@ BOOL SwFEShell::SetColRowWidthHeight( USHORT eType, USHORT nDiff )
if( (eType & (nsTblChgWidthHeightType::WH_FLAG_BIGGER | nsTblChgWidthHeightType::WH_FLAG_INSDEL)) ==
(nsTblChgWidthHeightType::WH_FLAG_BIGGER | nsTblChgWidthHeightType::WH_FLAG_INSDEL) )
{
- nDiff = USHORT((pFrm->Frm().*fnRect->fnGetWidth)());
+ nDiff = sal_uInt16((pFrm->Frm().*fnRect->fnGetWidth)());
// we must move the cursor outside the current cell before
// deleting the cells.
@@ -2379,7 +2383,7 @@ BOOL SwFEShell::SetColRowWidthHeight( USHORT eType, USHORT nDiff )
nLogDiff /= nPrtWidth;
/** The cells are destroyed in here */
- BOOL bRet = GetDoc()->SetColRowWidthHeight(
+ sal_Bool bRet = GetDoc()->SetColRowWidthHeight(
*(SwTableBox*)((SwCellFrm*)pFrm)->GetTabBox(),
eType, nDiff, nLogDiff );
@@ -2415,44 +2419,44 @@ BOOL SwFEShell::SetColRowWidthHeight( USHORT eType, USHORT nDiff )
return bRet;
}
-BOOL lcl_IsFormulaSelBoxes( const SwTable& rTbl, const SwTblBoxFormula& rFml,
+sal_Bool lcl_IsFormulaSelBoxes( const SwTable& rTbl, const SwTblBoxFormula& rFml,
SwCellFrms& rCells )
{
SwTblBoxFormula aTmp( rFml );
SwSelBoxes aBoxes;
- for( USHORT nSelBoxes = aTmp.GetBoxesOfFormula( rTbl,aBoxes ); nSelBoxes; )
+ for( sal_uInt16 nSelBoxes = aTmp.GetBoxesOfFormula( rTbl,aBoxes ); nSelBoxes; )
{
SwTableBox* pBox = aBoxes[ --nSelBoxes ];
- USHORT i;
+ sal_uInt16 i;
for( i = 0; i < rCells.Count(); ++i )
if( rCells[ i ]->GetTabBox() == pBox )
break; // gefunden
if( i == rCells.Count() )
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
// erfrage die Formel fuer die Autosumme
-BOOL SwFEShell::GetAutoSum( String& rFml ) const
+sal_Bool SwFEShell::GetAutoSum( String& rFml ) const
{
SwFrm *pFrm = GetCurrFrm();
SwTabFrm *pTab = pFrm ? pFrm->ImplFindTabFrm() : 0;
if( !pTab )
- return FALSE;
+ return sal_False;
rFml = String::CreateFromAscii( sCalc_Sum );
SwCellFrms aCells;
if( ::GetAutoSumSel( *this, aCells ))
{
- USHORT nW = 0, nInsPos = 0;
- for( USHORT n = aCells.Count(); n; )
+ sal_uInt16 nW = 0, nInsPos = 0;
+ for( sal_uInt16 n = aCells.Count(); n; )
{
SwCellFrm* pCFrm = aCells[ --n ];
- USHORT nBoxW = pCFrm->GetTabBox()->IsFormulaOrValueBox();
+ sal_uInt16 nBoxW = pCFrm->GetTabBox()->IsFormulaOrValueBox();
if( !nBoxW )
break;
@@ -2471,7 +2475,7 @@ BOOL SwFEShell::GetAutoSum( String& rFml ) const
{
nW = RES_BOXATR_VALUE;
// alle vorhierigen Leere wieder mit aufnehmen !
- for( USHORT i = aCells.Count(); n+1 < i; )
+ for( sal_uInt16 i = aCells.Count(); n+1 < i; )
{
String sTmp( String::CreateFromAscii(
RTL_CONSTASCII_STRINGPARAM( "|<" )) );
@@ -2509,7 +2513,7 @@ BOOL SwFEShell::GetAutoSum( String& rFml ) const
nW = RES_BOXATR_VALUE;
rFml.Erase( nInsPos );
// alle vorhierigen Leere wieder mit aufnehmen !
- for( USHORT i = aCells.Count(); n+1 < i; )
+ for( sal_uInt16 i = aCells.Count(); n+1 < i; )
{
String sTmp( String::CreateFromAscii(
RTL_CONSTASCII_STRINGPARAM( "|<" )) );
@@ -2544,7 +2548,7 @@ BOOL SwFEShell::GetAutoSum( String& rFml ) const
// TabellenSelektion erzeugen??
SwTblBoxFormula aTmp( rFml );
SwSelBoxes aBoxes;
- for( USHORT nSelBoxes = aTmp.GetBoxesOfFormula( rTbl,aBoxes );
+ for( sal_uInt16 nSelBoxes = aTmp.GetBoxesOfFormula( rTbl,aBoxes );
nSelBoxes; )
{
}
@@ -2552,16 +2556,16 @@ BOOL SwFEShell::GetAutoSum( String& rFml ) const
}
}
- return TRUE;
+ return sal_True;
}
/* -----------------------------22.08.2002 12:50------------------------------
---------------------------------------------------------------------------*/
-BOOL SwFEShell::IsTableRightToLeft() const
+sal_Bool SwFEShell::IsTableRightToLeft() const
{
SwFrm *pFrm = GetCurrFrm();
if( !pFrm || !pFrm->IsInTab() )
- return FALSE;
+ return sal_False;
return pFrm->ImplFindTabFrm()->IsRightToLeft();
}
@@ -2569,22 +2573,22 @@ BOOL SwFEShell::IsTableRightToLeft() const
/* -----------------------------22.08.2002 12:50------------------------------
---------------------------------------------------------------------------*/
-BOOL SwFEShell::IsMouseTableRightToLeft(const Point &rPt) const
+sal_Bool SwFEShell::IsMouseTableRightToLeft(const Point &rPt) const
{
SwFrm *pFrm = (SwFrm *)GetBox( rPt );
const SwTabFrm* pTabFrm = pFrm ? pFrm->ImplFindTabFrm() : 0;
ASSERT( pTabFrm, "Table not found" );
- return pTabFrm ? pTabFrm->IsRightToLeft() : FALSE;
+ return pTabFrm ? pTabFrm->IsRightToLeft() : sal_False;
}
/* -----------------------------11.02.2004 12:50------------------------------
---------------------------------------------------------------------------*/
-BOOL SwFEShell::IsTableVertical() const
+sal_Bool SwFEShell::IsTableVertical() const
{
SwFrm *pFrm = GetCurrFrm();
if( !pFrm || !pFrm->IsInTab() )
- return FALSE;
+ return sal_False;
return pFrm->ImplFindTabFrm()->IsVertical();
}
diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx
index 5c3c18988501..68105ee81b26 100644
--- a/sw/source/core/frmedt/fews.cxx
+++ b/sw/source/core/frmedt/fews.cxx
@@ -101,7 +101,7 @@ void SwFEShell::EndAllActionAndCall()
#* Update : MA 02. May. 95
#***********************************************************************/
-Point SwFEShell::GetCntntPos( const Point& rPoint, BOOL bNext ) const
+Point SwFEShell::GetCntntPos( const Point& rPoint, sal_Bool bNext ) const
{
SET_CURR_SHELL( (ViewShell*)this );
return GetLayout()->GetNextPrevCntntPos( rPoint, bNext );
@@ -140,10 +140,10 @@ const SwRect& SwFEShell::GetAnyCurRect( CurRectType eType, const Point* pPt,
if( !pFrm )
return GetLayout()->Frm();
- BOOL bFrm = TRUE;
+ sal_Bool bFrm = sal_True;
switch ( eType )
{
- case RECT_PAGE_PRT: bFrm = FALSE; /* no break */
+ case RECT_PAGE_PRT: bFrm = sal_False; /* no break */
case RECT_PAGE : pFrm = pFrm->FindPageFrm();
break;
@@ -152,7 +152,7 @@ const SwRect& SwFEShell::GetAnyCurRect( CurRectType eType, const Point* pPt,
pFrm->Calc();
break;
- case RECT_FLY_PRT_EMBEDDED: bFrm = FALSE; /* no break */
+ case RECT_FLY_PRT_EMBEDDED: bFrm = sal_False; /* no break */
case RECT_FLY_EMBEDDED: pFrm = xObj.is() ? FindFlyFrm( xObj )
: pFrm->IsFlyFrm()
? pFrm
@@ -163,22 +163,22 @@ const SwRect& SwFEShell::GetAnyCurRect( CurRectType eType, const Point* pPt,
case RECT_OUTTABSECTION : if( pFrm->IsInTab() )
pFrm = pFrm->FindTabFrm();
else {
- ASSERT( FALSE, "Missing Table" );
+ ASSERT( sal_False, "Missing Table" );
}
/* KEIN BREAK */
case RECT_SECTION_PRT:
case RECT_SECTION: if( pFrm->IsInSct() )
pFrm = pFrm->FindSctFrm();
else {
- ASSERT( FALSE, "Missing section" );
+ ASSERT( sal_False, "Missing section" );
}
if( RECT_OUTTABSECTION_PRT == eType ||
RECT_SECTION_PRT == eType )
- bFrm = FALSE;
+ bFrm = sal_False;
break;
- case RECT_HEADERFOOTER_PRT: bFrm = FALSE; /* no break */
+ case RECT_HEADERFOOTER_PRT: bFrm = sal_False; /* no break */
case RECT_HEADERFOOTER: if( 0 == (pFrm = pFrm->FindFooterOrHeader()) )
return GetLayout()->Frm();
break;
@@ -191,7 +191,7 @@ const SwRect& SwFEShell::GetAnyCurRect( CurRectType eType, const Point* pPt,
}
-USHORT SwFEShell::GetPageNumber( const Point &rPoint ) const
+sal_uInt16 SwFEShell::GetPageNumber( const Point &rPoint ) const
{
const SwFrm *pPage = GetLayout()->Lower();
while ( pPage && !pPage->Frm().IsInside( rPoint ) )
@@ -203,13 +203,13 @@ USHORT SwFEShell::GetPageNumber( const Point &rPoint ) const
}
-BOOL SwFEShell::GetPageNumber( long nYPos, BOOL bAtCrsrPos, USHORT& rPhyNum, USHORT& rVirtNum, String &rDisplay) const
+sal_Bool SwFEShell::GetPageNumber( long nYPos, sal_Bool bAtCrsrPos, sal_uInt16& rPhyNum, sal_uInt16& rVirtNum, String &rDisplay) const
{
const SwFrm *pPage;
if ( bAtCrsrPos ) //Seite vom Crsr besorgen
{
- pPage = GetCurrFrm( FALSE );
+ pPage = GetCurrFrm( sal_False );
if ( pPage )
pPage = pPage->FindPageFrm();
}
@@ -248,7 +248,7 @@ BOOL SwFEShell::GetPageNumber( long nYPos, BOOL bAtCrsrPos, USHORT& rPhyNum, USH
bool SwFEShell::IsDirectlyInSection() const
{
- SwFrm* pFrm = GetCurrFrm( FALSE );
+ SwFrm* pFrm = GetCurrFrm( sal_False );
return pFrm && pFrm->GetUpper() && pFrm->GetUpper()->IsSctFrm();
}
@@ -261,9 +261,9 @@ bool SwFEShell::IsDirectlyInSection() const
|*
*************************************************************************/
-USHORT SwFEShell::GetFrmType( const Point *pPt, BOOL bStopAtFly ) const
+sal_uInt16 SwFEShell::GetFrmType( const Point *pPt, sal_Bool bStopAtFly ) const
{
- USHORT nReturn = FRMTYPE_NONE;
+ sal_uInt16 nReturn = FRMTYPE_NONE;
const SwFrm *pFrm;
if ( pPt )
{
@@ -274,7 +274,7 @@ USHORT SwFEShell::GetFrmType( const Point *pPt, BOOL bStopAtFly ) const
pFrm = pNd->getLayoutFrm( GetLayout(), pPt );
}
else
- pFrm = GetCurrFrm( FALSE );
+ pFrm = GetCurrFrm( sal_False );
while ( pFrm )
{
switch ( pFrm->GetType() )
@@ -337,7 +337,7 @@ USHORT SwFEShell::GetFrmType( const Point *pPt, BOOL bStopAtFly ) const
|*
*************************************************************************/
-void SwFEShell::ShGetFcs( BOOL bUpdate )
+void SwFEShell::ShGetFcs( sal_Bool bUpdate )
{
::SetShell( this );
SwCrsrShell::ShGetFcs( bUpdate );
@@ -372,7 +372,7 @@ void SwFEShell::ShLooseFcs()
|*
*************************************************************************/
-USHORT SwFEShell::GetPhyPageNum()
+sal_uInt16 SwFEShell::GetPhyPageNum()
{
SwFrm *pFrm = GetCurrFrm();
if ( pFrm )
@@ -380,7 +380,7 @@ USHORT SwFEShell::GetPhyPageNum()
return 0;
}
-USHORT SwFEShell::GetVirtPageNum( const BOOL bCalcFrm )
+sal_uInt16 SwFEShell::GetVirtPageNum( const sal_Bool bCalcFrm )
{
SwFrm *pFrm = GetCurrFrm( bCalcFrm );
if ( pFrm )
@@ -393,14 +393,14 @@ USHORT SwFEShell::GetVirtPageNum( const BOOL bCalcFrm )
|* void lcl_SetAPageOffset()
|* void SwFEShell::SetNewPageOffset()
|* void SwFEShell::SetPageOffset()
-|* USHORT SwFEShell::GetPageOffset() const
+|* sal_uInt16 SwFEShell::GetPageOffset() const
|*
|* Ersterstellung OK 07.07.93 08:20
|* Letzte Aenderung MA 30. Mar. 95
|*
*************************************************************************/
-void lcl_SetAPageOffset( USHORT nOffset, SwPageFrm* pPage, SwFEShell* pThis )
+void lcl_SetAPageOffset( sal_uInt16 nOffset, SwPageFrm* pPage, SwFEShell* pThis )
{
pThis->StartAllAction();
ASSERT( pPage->FindFirstBodyCntnt(),
@@ -409,7 +409,7 @@ void lcl_SetAPageOffset( USHORT nOffset, SwPageFrm* pPage, SwFEShell* pThis )
SwFmtPageDesc aDesc( pPage->GetPageDesc() );
aDesc.SetNumOffset( nOffset );
- SwFrm *pFrm = pThis->GetCurrFrm( FALSE );
+ SwFrm *pFrm = pThis->GetCurrFrm( sal_False );
if ( pFrm->IsInTab() )
pThis->GetDoc()->SetAttr( aDesc, *pFrm->FindTabFrm()->GetFmt() );
else
@@ -420,17 +420,22 @@ void lcl_SetAPageOffset( USHORT nOffset, SwPageFrm* pPage, SwFEShell* pThis )
pThis->EndAllAction();
}
-void SwFEShell::SetNewPageOffset( USHORT nOffset )
+void SwFEShell::SetNewPageOffset( sal_uInt16 nOffset )
{
- GetLayout()->SetVirtPageNum( TRUE );
- const SwPageFrm *pPage = GetCurrFrm( FALSE )->FindPageFrm();
+ GetLayout()->SetVirtPageNum( sal_True );
+ const SwPageFrm *pPage = GetCurrFrm( sal_False )->FindPageFrm();
lcl_SetAPageOffset( nOffset, (SwPageFrm*)pPage, this );
}
-void SwFEShell::SetPageOffset( USHORT nOffset )
+void SwFEShell::SetPageOffset( sal_uInt16 nOffset )
{
+<<<<<<< local
const SwPageFrm *pPage = GetCurrFrm( FALSE )->FindPageFrm();
const SwRootFrm* pDocLayout = GetLayout();
+=======
+ const SwPageFrm *pPage = GetCurrFrm( sal_False )->FindPageFrm();
+ const SwRootFrm* pLayout = GetLayout();
+>>>>>>> other
while ( pPage )
{
const SwFrm *pFlow = pPage->FindFirstBodyCntnt();
@@ -441,7 +446,11 @@ void SwFEShell::SetPageOffset( USHORT nOffset )
const SwFmtPageDesc& rPgDesc = pFlow->GetAttrSet()->GetPageDesc();
if ( rPgDesc.GetNumOffset() )
{
+<<<<<<< local
pDocLayout->SetVirtPageNum( TRUE );
+=======
+ pLayout->SetVirtPageNum( sal_True );
+>>>>>>> other
lcl_SetAPageOffset( nOffset, (SwPageFrm*)pPage, this );
break;
}
@@ -450,7 +459,7 @@ void SwFEShell::SetPageOffset( USHORT nOffset )
}
}
-USHORT SwFEShell::GetPageOffset() const
+sal_uInt16 SwFEShell::GetPageOffset() const
{
const SwPageFrm *pPage = GetCurrFrm()->FindPageFrm();
while ( pPage )
@@ -460,7 +469,7 @@ USHORT SwFEShell::GetPageOffset() const
{
if ( pFlow->IsInTab() )
pFlow = pFlow->FindTabFrm();
- const USHORT nOffset = pFlow->GetAttrSet()->GetPageDesc().GetNumOffset();
+ const sal_uInt16 nOffset = pFlow->GetAttrSet()->GetPageDesc().GetNumOffset();
if ( nOffset )
return nOffset;
}
@@ -480,18 +489,18 @@ USHORT SwFEShell::GetPageOffset() const
void SwFEShell::InsertLabel( const SwLabelType eType, const String &rTxt, const String& rSeparator,
const String& rNumberSeparator,
- const BOOL bBefore, const USHORT nId,
+ const sal_Bool bBefore, const sal_uInt16 nId,
const String& rCharacterStyle,
- const BOOL bCpyBrd )
+ const sal_Bool bCpyBrd )
{
//NodeIndex der CrsrPosition besorgen, den Rest kann das Dokument
//selbst erledigen.
- SwCntntFrm *pCnt = LTYPE_DRAW==eType ? 0 : GetCurrFrm( FALSE );
+ SwCntntFrm *pCnt = LTYPE_DRAW==eType ? 0 : GetCurrFrm( sal_False );
if( LTYPE_DRAW==eType || pCnt )
{
StartAllAction();
- ULONG nIdx = 0;
+ sal_uLong nIdx = 0;
SwFlyFrmFmt* pFlyFmt = 0;
switch( eType )
{
@@ -525,7 +534,7 @@ void SwFEShell::InsertLabel( const SwLabelType eType, const String &rTxt, const
// local list to perform the corresponding action for each object
std::vector<SdrObject*> aDrawObjs;
{
- for ( USHORT i = 0; i < rMrkList.GetMarkCount(); ++i )
+ for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i )
{
SdrObject* pDrawObj = rMrkList.GetMark(i)->GetMarkedSdrObj();
if( pDrawObj )
@@ -562,7 +571,7 @@ void SwFEShell::InsertLabel( const SwLabelType eType, const String &rTxt, const
SwFlyFrm* pFrm;
const Point aPt( GetCrsrDocPos() );
if( pFlyFmt && 0 != ( pFrm = pFlyFmt->GetFrm( &aPt )))
- SelectFlyFrm( *pFrm, TRUE );
+ SelectFlyFrm( *pFrm, sal_True );
EndAllActionAndCall();
}
@@ -576,19 +585,19 @@ void SwFEShell::InsertLabel( const SwLabelType eType, const String &rTxt, const
#* Update : ??
#***********************************************************************/
-BOOL SwFEShell::Sort(const SwSortOptions& rOpt)
+sal_Bool SwFEShell::Sort(const SwSortOptions& rOpt)
{
if( !HasSelection() )
- return FALSE;
+ return sal_False;
SET_CURR_SHELL( this );
- BOOL bRet;
+ sal_Bool bRet;
StartAllAction();
if(IsTableMode())
{
// Tabelle sortieren
// pruefe ob vom aktuellen Crsr der SPoint/Mark in einer Tabelle stehen
- SwFrm *pFrm = GetCurrFrm( FALSE );
+ SwFrm *pFrm = GetCurrFrm( sal_False );
ASSERT( pFrm->FindTabFrm(), "Crsr nicht in Tabelle." );
// lasse ueber das Layout die Boxen suchen
@@ -619,7 +628,7 @@ BOOL SwFEShell::Sort(const SwSortOptions& rOpt)
SwPosition* pEnd = pPam->End();
SwNodeIndex aPrevIdx( pStart->nNode, -1 );
- ULONG nOffset = pEnd->nNode.GetIndex() - pStart->nNode.GetIndex();
+ sal_uLong nOffset = pEnd->nNode.GetIndex() - pStart->nNode.GetIndex();
xub_StrLen nCntStt = pStart->nContent.GetIndex();
// Das Sortieren
@@ -655,10 +664,10 @@ BOOL SwFEShell::Sort(const SwSortOptions& rOpt)
|
|*************************************************************************/
-USHORT SwFEShell::_GetCurColNum( const SwFrm *pFrm,
+sal_uInt16 SwFEShell::_GetCurColNum( const SwFrm *pFrm,
SwGetCurColNumPara* pPara ) const
{
- USHORT nRet = 0;
+ sal_uInt16 nRet = 0;
while ( pFrm )
{
pFrm = pFrm->GetUpper();
@@ -698,15 +707,15 @@ USHORT SwFEShell::_GetCurColNum( const SwFrm *pFrm,
return nRet;
}
-USHORT SwFEShell::GetCurColNum( SwGetCurColNumPara* pPara ) const
+sal_uInt16 SwFEShell::GetCurColNum( SwGetCurColNumPara* pPara ) const
{
ASSERT( GetCurrFrm(), "Crsr geparkt?" );
return _GetCurColNum( GetCurrFrm(), pPara );
}
-USHORT SwFEShell::GetCurOutColNum( SwGetCurColNumPara* pPara ) const
+sal_uInt16 SwFEShell::GetCurOutColNum( SwGetCurColNumPara* pPara ) const
{
- USHORT nRet = 0;
+ sal_uInt16 nRet = 0;
SwFrm* pFrm = GetCurrFrm();
ASSERT( pFrm, "Crsr geparkt?" );
if( pFrm )
@@ -722,13 +731,13 @@ USHORT SwFEShell::GetCurOutColNum( SwGetCurColNumPara* pPara ) const
SwFEShell::SwFEShell( SwDoc& rDoc, Window *pWindow, const SwViewOption *pOptions )
: SwEditShell( rDoc, pWindow, pOptions ),
- pChainFrom( 0 ), pChainTo( 0 ), bCheckForOLEInCaption( FALSE )
+ pChainFrom( 0 ), pChainTo( 0 ), bCheckForOLEInCaption( sal_False )
{
}
SwFEShell::SwFEShell( SwEditShell& rShell, Window *pWindow )
: SwEditShell( rShell, pWindow ),
- pChainFrom( 0 ), pChainTo( 0 ), bCheckForOLEInCaption( FALSE )
+ pChainFrom( 0 ), pChainTo( 0 ), bCheckForOLEInCaption( sal_False )
{
}
@@ -780,8 +789,8 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
_bMirror = _bMirror && !pPage->OnRightPage();
Point aPos;
- BOOL bVertic = FALSE;
- BOOL bRTL = FALSE;
+ sal_Bool bVertic = sal_False;
+ sal_Bool bRTL = sal_False;
if ((FLY_AT_PAGE == _nAnchorId) || (FLY_AT_FLY == _nAnchorId)) // LAYER_IMPL
{
@@ -808,7 +817,7 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
if( bVert )
{
- bVertic = TRUE;
+ bVertic = sal_True;
_bMirror = false; // no mirroring in vertical environment
switch ( _eHoriRelOrient )
{
@@ -1108,7 +1117,7 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
0;
if( bVert )
{
- bVertic = TRUE;
+ bVertic = sal_True;
_bMirror = false;
switch ( _eHoriRelOrient )
@@ -1247,10 +1256,10 @@ Size SwFEShell::GetGraphicDefaultSize() const
/* -----------------------------12.08.2002 12:51------------------------------
---------------------------------------------------------------------------*/
-BOOL SwFEShell::IsFrmVertical(BOOL bEnvironment, BOOL& bRTL) const
+sal_Bool SwFEShell::IsFrmVertical(sal_Bool bEnvironment, sal_Bool& bRTL) const
{
- BOOL bVert = FALSE;
- bRTL = FALSE;
+ sal_Bool bVert = sal_False;
+ bRTL = sal_False;
if ( Imp()->HasDrawView() )
{
diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx
index 36683730e760..a1e38d87f194 100644
--- a/sw/source/core/frmedt/tblsel.cxx
+++ b/sw/source/core/frmedt/tblsel.cxx
@@ -28,15 +28,17 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-#include <hintids.hxx>
#include <editeng/boxitem.hxx>
#include <editeng/protitem.hxx>
+
+#include <hintids.hxx>
#include <fmtanchr.hxx>
#include <fmtfsize.hxx>
#include <frmatr.hxx>
#include <tblsel.hxx>
#include <crsrsh.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <docary.hxx>
#include <pam.hxx>
#include <ndtxt.hxx>
@@ -50,7 +52,7 @@
#include <rootfrm.hxx>
#include <viscrs.hxx>
#include <swtblfmt.hxx>
-#include <undobj.hxx>
+#include <UndoTable.hxx>
#include <mvsave.hxx>
#include <sectfrm.hxx>
#include <frmtool.hxx>
@@ -75,11 +77,11 @@
_SV_IMPL_SORTAR_ALG( SwSelBoxes, SwTableBoxPtr )
-BOOL SwSelBoxes::Seek_Entry( const SwTableBoxPtr rSrch, USHORT* pFndPos ) const
+sal_Bool SwSelBoxes::Seek_Entry( const SwTableBoxPtr rSrch, sal_uInt16* pFndPos ) const
{
- ULONG nIdx = rSrch->GetSttIdx();
+ sal_uLong nIdx = rSrch->GetSttIdx();
- USHORT nO = Count(), nM, nU = 0;
+ sal_uInt16 nO = Count(), nM, nU = 0;
if( nO > 0 )
{
nO--;
@@ -90,7 +92,7 @@ BOOL SwSelBoxes::Seek_Entry( const SwTableBoxPtr rSrch, USHORT* pFndPos ) const
{
if( pFndPos )
*pFndPos = nM;
- return TRUE;
+ return sal_True;
}
else if( (*this)[ nM ]->GetSttIdx() < nIdx )
nU = nM + 1;
@@ -98,7 +100,7 @@ BOOL SwSelBoxes::Seek_Entry( const SwTableBoxPtr rSrch, USHORT* pFndPos ) const
{
if( pFndPos )
*pFndPos = nU;
- return FALSE;
+ return sal_False;
}
else
nO = nM - 1;
@@ -106,7 +108,7 @@ BOOL SwSelBoxes::Seek_Entry( const SwTableBoxPtr rSrch, USHORT* pFndPos ) const
}
if( pFndPos )
*pFndPos = nU;
- return FALSE;
+ return sal_False;
}
@@ -116,21 +118,21 @@ struct _CmpLPt
{
Point aPos;
const SwTableBox* pSelBox;
- BOOL bVert;
+ sal_Bool bVert;
- _CmpLPt( const Point& rPt, const SwTableBox* pBox, BOOL bVertical );
+ _CmpLPt( const Point& rPt, const SwTableBox* pBox, sal_Bool bVertical );
- BOOL operator==( const _CmpLPt& rCmp ) const
- { return X() == rCmp.X() && Y() == rCmp.Y() ? TRUE : FALSE; }
+ sal_Bool operator==( const _CmpLPt& rCmp ) const
+ { return X() == rCmp.X() && Y() == rCmp.Y() ? sal_True : sal_False; }
- BOOL operator<( const _CmpLPt& rCmp ) const
+ sal_Bool operator<( const _CmpLPt& rCmp ) const
{
if ( bVert )
return X() > rCmp.X() || ( X() == rCmp.X() && Y() < rCmp.Y() )
- ? TRUE : FALSE;
+ ? sal_True : sal_False;
else
return Y() < rCmp.Y() || ( Y() == rCmp.Y() && X() < rCmp.X() )
- ? TRUE : FALSE;
+ ? sal_True : sal_False;
}
long X() const { return aPos.X(); }
@@ -181,7 +183,7 @@ const SwLayoutFrm *lcl_FindNextCellFrm( const SwLayoutFrm *pLay )
void GetTblSelCrs( const SwCrsrShell &rShell, SwSelBoxes& rBoxes )
{
if( rBoxes.Count() )
- rBoxes.Remove( USHORT(0), rBoxes.Count() );
+ rBoxes.Remove( sal_uInt16(0), rBoxes.Count() );
if( rShell.IsTableMode() && ((SwCrsrShell&)rShell).UpdateTblSelBoxes())
rBoxes.Insert( &rShell.GetTableCrsr()->GetBoxes() );
}
@@ -189,7 +191,7 @@ void GetTblSelCrs( const SwCrsrShell &rShell, SwSelBoxes& rBoxes )
void GetTblSelCrs( const SwTableCursor& rTblCrsr, SwSelBoxes& rBoxes )
{
if( rBoxes.Count() )
- rBoxes.Remove( USHORT(0), rBoxes.Count() );
+ rBoxes.Remove( sal_uInt16(0), rBoxes.Count() );
if( rTblCrsr.IsChgd() || !rTblCrsr.GetBoxesCount() )
{
@@ -215,7 +217,7 @@ void GetTblSel( const SwCursor& rCrsr, SwSelBoxes& rBoxes,
const SwTblSearchType eSearchType )
{
//Start- und Endzelle besorgen und den naechsten fragen.
- ASSERT( rCrsr.GetCntntNode() && rCrsr.GetCntntNode( FALSE ),
+ ASSERT( rCrsr.GetCntntNode() && rCrsr.GetCntntNode( sal_False ),
"Tabselection nicht auf Cnt." );
// Zeilen-Selektion:
@@ -243,31 +245,31 @@ void GetTblSel( const SwCursor& rCrsr, SwSelBoxes& rBoxes,
const SwTable& rTbl = pTblNd->GetTable();
const SwTableLines& rLines = rTbl.GetTabLines();
- const SwNode* pMarkNode = rCrsr.GetNode( FALSE );
- const ULONG nMarkSectionStart = pMarkNode->StartOfSectionIndex();
+ const SwNode* pMarkNode = rCrsr.GetNode( sal_False );
+ const sal_uLong nMarkSectionStart = pMarkNode->StartOfSectionIndex();
const SwTableBox* pMarkBox = rTbl.GetTblBox( nMarkSectionStart );
ASSERT( pMarkBox, "Point in table, mark outside?" )
const SwTableLine* pLine = pMarkBox ? pMarkBox->GetUpper() : 0;
- USHORT nSttPos = rLines.GetPos( pLine );
+ sal_uInt16 nSttPos = rLines.GetPos( pLine );
ASSERT( USHRT_MAX != nSttPos, "Wo ist meine Zeile in der Tabelle?" );
- pLine = rTbl.GetTblBox( rCrsr.GetNode( TRUE )->StartOfSectionIndex() )->GetUpper();
- USHORT nEndPos = rLines.GetPos( pLine );
+ pLine = rTbl.GetTblBox( rCrsr.GetNode( sal_True )->StartOfSectionIndex() )->GetUpper();
+ sal_uInt16 nEndPos = rLines.GetPos( pLine );
ASSERT( USHRT_MAX != nEndPos, "Wo ist meine Zeile in der Tabelle?" );
// pb: #i20193# if tableintable then nSttPos == nEndPos == USHRT_MAX
if ( nSttPos != USHRT_MAX && nEndPos != USHRT_MAX )
{
if( nEndPos < nSttPos ) // vertauschen
{
- USHORT nTmp = nSttPos; nSttPos = nEndPos; nEndPos = nTmp;
+ sal_uInt16 nTmp = nSttPos; nSttPos = nEndPos; nEndPos = nTmp;
}
int bChkProtected = nsSwTblSearchType::TBLSEARCH_PROTECT & eSearchType;
for( ; nSttPos <= nEndPos; ++nSttPos )
{
pLine = rLines[ nSttPos ];
- for( USHORT n = pLine->GetTabBoxes().Count(); n ; )
+ for( sal_uInt16 n = pLine->GetTabBoxes().Count(); n ; )
{
SwTableBox* pBox = pLine->GetTabBoxes()[ --n ];
// Zellenschutzt beachten ??
@@ -289,8 +291,13 @@ void GetTblSel( const SwCursor& rCrsr, SwSelBoxes& rBoxes,
}
const SwCntntNode *pCntNd = rCrsr.GetCntntNode();
const SwLayoutFrm *pStart = pCntNd ?
+<<<<<<< local
pCntNd->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(), &aPtPos )->GetUpper() : 0;
pCntNd = rCrsr.GetCntntNode(FALSE);
+=======
+ pCntNd->GetFrm( &aPtPos )->GetUpper() : 0;
+ pCntNd = rCrsr.GetCntntNode(sal_False);
+>>>>>>> other
const SwLayoutFrm *pEnd = pCntNd ?
pCntNd->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(), &aMkPos )->GetUpper() : 0;
if( pStart && pEnd )
@@ -312,14 +319,14 @@ void GetTblSel( const SwLayoutFrm* pStart, const SwLayoutFrm* pEnd,
int bChkProtected = nsSwTblSearchType::TBLSEARCH_PROTECT & eSearchType;
- BOOL bTblIsValid;
+ sal_Bool bTblIsValid;
// --> FME 2006-01-25 #i55421# Reduced value 10
int nLoopMax = 10; //JP 28.06.99: max 100 loops - Bug 67292
// <--
- USHORT i;
+ sal_uInt16 i;
do {
- bTblIsValid = TRUE;
+ bTblIsValid = sal_True;
//Zuerst lassen wir uns die Tabellen und die Rechtecke heraussuchen.
SwSelUnions aUnions;
@@ -341,7 +348,7 @@ void GetTblSel( const SwLayoutFrm* pStart, const SwLayoutFrm* pEnd,
const SwTabFrm *pTable = pUnion->GetTable();
if( !pTable->IsValid() && nLoopMax )
{
- bTblIsValid = FALSE;
+ bTblIsValid = sal_False;
break;
}
@@ -354,7 +361,7 @@ void GetTblSel( const SwLayoutFrm* pStart, const SwLayoutFrm* pEnd,
{
if( !pRow->IsValid() && nLoopMax )
{
- bTblIsValid = FALSE;
+ bTblIsValid = sal_False;
break;
}
@@ -366,7 +373,7 @@ void GetTblSel( const SwLayoutFrm* pStart, const SwLayoutFrm* pEnd,
{
if( !pCell->IsValid() && nLoopMax )
{
- bTblIsValid = FALSE;
+ bTblIsValid = sal_False;
break;
}
@@ -476,24 +483,24 @@ void GetTblSel( const SwLayoutFrm* pStart, const SwLayoutFrm* pEnd,
rBoxes.Remove( i, rBoxes.Count() );
--nLoopMax;
- } while( TRUE );
+ } while( sal_True );
ASSERT( nLoopMax, "das Layout der Tabelle wurde nicht valide!" );
}
-BOOL ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd,
+sal_Bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd,
SwChartLines* pGetCLines )
{
const SwTableNode* pTNd = rSttNd.FindTableNode();
if( !pTNd )
- return FALSE;
+ return sal_False;
Point aNullPos;
SwNodeIndex aIdx( rSttNd );
const SwCntntNode* pCNd = aIdx.GetNode().GetCntntNode();
if( !pCNd )
- pCNd = aIdx.GetNodes().GoNextSection( &aIdx, FALSE, FALSE );
+ pCNd = aIdx.GetNodes().GoNextSection( &aIdx, sal_False, sal_False );
// #109394# if table is invisible, return
// (layout needed for forming table selection further down, so we can't
@@ -501,8 +508,13 @@ 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)
+<<<<<<< local
if ( !pCNd || pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout() ) == NULL )
return FALSE;
+=======
+ if ( !pCNd || pCNd->GetFrm() == NULL )
+ return sal_False;
+>>>>>>> other
const SwLayoutFrm *pStart = pCNd ? pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &aNullPos )->GetUpper() : 0;
ASSERT( pStart, "ohne Frame geht gar nichts" );
@@ -510,29 +522,29 @@ BOOL ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd,
aIdx = rEndNd;
pCNd = aIdx.GetNode().GetCntntNode();
if( !pCNd )
- pCNd = aIdx.GetNodes().GoNextSection( &aIdx, FALSE, FALSE );
+ 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->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout() ) == NULL )
{
- return FALSE;
+ return sal_False;
}
const SwLayoutFrm *pEnd = pCNd ? pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &aNullPos )->GetUpper() : 0;
ASSERT( pEnd, "ohne Frame geht gar nichts" );
- BOOL bTblIsValid, bValidChartSel;
+ sal_Bool bTblIsValid, bValidChartSel;
// --> FME 2006-01-25 #i55421# Reduced value 10
int nLoopMax = 10; //JP 28.06.99: max 100 loops - Bug 67292
// <--
- USHORT i = 0;
+ sal_uInt16 i = 0;
do {
- bTblIsValid = TRUE;
- bValidChartSel = TRUE;
+ bTblIsValid = sal_True;
+ bValidChartSel = sal_True;
- USHORT nRowCells = USHRT_MAX;
+ sal_uInt16 nRowCells = USHRT_MAX;
//Zuerst lassen wir uns die Tabellen und die Rechtecke heraussuchen.
SwSelUnions aUnions;
@@ -550,7 +562,7 @@ BOOL ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd,
if( !pTable->IsValid() && nLoopMax )
{
- bTblIsValid = FALSE;
+ bTblIsValid = sal_False;
break;
}
@@ -565,7 +577,7 @@ BOOL ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd,
{
if( !pRow->IsValid() && nLoopMax )
{
- bTblIsValid = FALSE;
+ bTblIsValid = sal_False;
break;
}
@@ -578,7 +590,7 @@ BOOL ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd,
{
if( !pCell->IsValid() && nLoopMax )
{
- bTblIsValid = FALSE;
+ bTblIsValid = sal_False;
break;
}
@@ -620,7 +632,7 @@ BOOL ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd,
_Sort_CellFrm( *(SwCellFrm*)pCell) );
else
{
- bValidChartSel = FALSE;
+ bValidChartSel = sal_False;
break;
}
}
@@ -659,7 +671,7 @@ BOOL ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd,
nRowCells = nCellCnt;
else if( nRowCells != nCellCnt )
{
- bValidChartSel = FALSE;
+ bValidChartSel = sal_False;
break;
}
}
@@ -682,7 +694,7 @@ BOOL ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd,
}
else
{
- bValidChartSel = FALSE;
+ bValidChartSel = sal_False;
break;
}
}
@@ -691,7 +703,7 @@ BOOL ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd,
if( USHRT_MAX == nRowCells )
nRowCells = nCellCnt;
else if( nRowCells != nCellCnt )
- bValidChartSel = FALSE;
+ bValidChartSel = sal_False;
}
if( bValidChartSel && pGetCLines )
@@ -704,7 +716,7 @@ BOOL ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd,
if( (rCF.pFrm->Frm().*fnRect->fnGetTop)() != nYPos )
{
pBoxes = new SwChartBoxes( 255 < nRowCells
- ? 255 : (BYTE)nRowCells);
+ ? 255 : (sal_uInt8)nRowCells);
pGetCLines->C40_INSERT( SwChartBoxes, pBoxes, pGetCLines->Count() );
nYPos = (rCF.pFrm->Frm().*fnRect->fnGetTop)();
}
@@ -733,7 +745,7 @@ BOOL ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd,
--nLoopMax;
if( pGetCLines )
pGetCLines->DeleteAndDestroy( 0, pGetCLines->Count() );
- } while( TRUE );
+ } while( sal_True );
ASSERT( nLoopMax, "das Layout der Tabelle wurde nicht valide!" );
@@ -744,7 +756,7 @@ BOOL ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd,
}
-BOOL IsFrmInTblSel( const SwRect& rUnion, const SwFrm* pCell )
+sal_Bool IsFrmInTblSel( const SwRect& rUnion, const SwFrm* pCell )
{
ASSERT( pCell->IsCellFrm(), "Frame ohne Gazelle" );
@@ -754,7 +766,7 @@ BOOL IsFrmInTblSel( const SwRect& rUnion, const SwFrm* pCell )
(( rUnion.Top() <= pCell->Frm().Top()+20 &&
rUnion.Bottom() > pCell->Frm().Top() ) ||
( rUnion.Top() >= pCell->Frm().Top() &&
- rUnion.Bottom() < pCell->Frm().Bottom() )) ? TRUE : FALSE );
+ rUnion.Bottom() < pCell->Frm().Bottom() )) ? sal_True : sal_False );
return (
rUnion.Top() <= pCell->Frm().Top() &&
@@ -764,10 +776,10 @@ BOOL IsFrmInTblSel( const SwRect& rUnion, const SwFrm* pCell )
rUnion.Right() > pCell->Frm().Left() ) ||
( rUnion.Left() >= pCell->Frm().Left() &&
- rUnion.Right() < pCell->Frm().Right() )) ? TRUE : FALSE );
+ rUnion.Right() < pCell->Frm().Right() )) ? sal_True : sal_False );
}
-BOOL GetAutoSumSel( const SwCrsrShell& rShell, SwCellFrms& rBoxes )
+sal_Bool GetAutoSumSel( const SwCrsrShell& rShell, SwCellFrms& rBoxes )
{
SwShellCrsr* pCrsr = rShell.pCurCrsr;
if ( rShell.IsTableMode() )
@@ -775,7 +787,11 @@ BOOL GetAutoSumSel( const SwCrsrShell& rShell, SwCellFrms& rBoxes )
const SwLayoutFrm *pStart = pCrsr->GetCntntNode()->getLayoutFrm( rShell.GetLayout(),
&pCrsr->GetPtPos() )->GetUpper(),
+<<<<<<< local
*pEnd = pCrsr->GetCntntNode(FALSE)->getLayoutFrm( rShell.GetLayout(),
+=======
+ *pEnd = pCrsr->GetCntntNode(sal_False)->GetFrm(
+>>>>>>> other
&pCrsr->GetMkPos() )->GetUpper();
const SwLayoutFrm* pSttCell = pStart;
@@ -788,8 +804,8 @@ BOOL GetAutoSumSel( const SwCrsrShell& rShell, SwCellFrms& rBoxes )
// default erstmal nach oben testen, dann nach links
::MakeSelUnions( aUnions, pStart, pEnd, nsSwTblSearchType::TBLSEARCH_COL );
- BOOL bTstRow = TRUE, bFound = FALSE;
- USHORT i;
+ sal_Bool bTstRow = sal_True, bFound = sal_False;
+ sal_uInt16 i;
// 1. teste ob die darueber liegende Box Value/Formel enhaelt:
for( i = 0; i < aUnions.Count(); ++i )
@@ -813,8 +829,8 @@ BOOL GetAutoSumSel( const SwCrsrShell& rShell, SwCellFrms& rBoxes )
{
if( pCell == pSttCell )
{
- USHORT nWhichId = 0;
- for( USHORT n = rBoxes.Count(); n; )
+ sal_uInt16 nWhichId = 0;
+ for( sal_uInt16 n = rBoxes.Count(); n; )
if( USHRT_MAX != ( nWhichId = rBoxes[ --n ]
->GetTabBox()->IsFormulaOrValueBox() ))
break;
@@ -822,7 +838,7 @@ BOOL GetAutoSumSel( const SwCrsrShell& rShell, SwCellFrms& rBoxes )
// alle Boxen zusammen, nicht mehr die Zeile
// pruefen, wenn eine Formel oder Value gefunden wurde
bTstRow = 0 == nWhichId || USHRT_MAX == nWhichId;
- bFound = TRUE;
+ bFound = sal_True;
break;
}
@@ -856,7 +872,7 @@ BOOL GetAutoSumSel( const SwCrsrShell& rShell, SwCellFrms& rBoxes )
// 2. teste ob die links liegende Box Value/Formel enhaelt:
if( bTstRow )
{
- bFound = FALSE;
+ bFound = sal_False;
rBoxes.Remove( 0, rBoxes.Count() );
aUnions.DeleteAndDestroy( 0, aUnions.Count() );
@@ -882,8 +898,8 @@ BOOL GetAutoSumSel( const SwCrsrShell& rShell, SwCellFrms& rBoxes )
{
if( pCell == pSttCell )
{
- USHORT nWhichId = 0;
- for( USHORT n = rBoxes.Count(); n; )
+ sal_uInt16 nWhichId = 0;
+ for( sal_uInt16 n = rBoxes.Count(); n; )
if( USHRT_MAX != ( nWhichId = rBoxes[ --n ]
->GetTabBox()->IsFormulaOrValueBox() ))
break;
@@ -891,7 +907,7 @@ BOOL GetAutoSumSel( const SwCrsrShell& rShell, SwCellFrms& rBoxes )
// alle Boxen zusammen, nicht mehr die Zeile
// pruefen, wenn eine Formel oder Value gefunden wurde
bFound = 0 != nWhichId && USHRT_MAX != nWhichId;
- bTstRow = FALSE;
+ bTstRow = sal_False;
break;
}
@@ -925,25 +941,25 @@ BOOL GetAutoSumSel( const SwCrsrShell& rShell, SwCellFrms& rBoxes )
return bFound;
}
-BOOL HasProtectedCells( const SwSelBoxes& rBoxes )
+sal_Bool HasProtectedCells( const SwSelBoxes& rBoxes )
{
- BOOL bRet = FALSE;
- for( USHORT n = 0, nCnt = rBoxes.Count(); n < nCnt; ++n )
+ sal_Bool bRet = sal_False;
+ for( sal_uInt16 n = 0, nCnt = rBoxes.Count(); n < nCnt; ++n )
if( rBoxes[ n ]->GetFrmFmt()->GetProtect().IsCntntProtected() )
{
- bRet = TRUE;
+ bRet = sal_True;
break;
}
return bRet;
}
-_CmpLPt::_CmpLPt( const Point& rPt, const SwTableBox* pBox, BOOL bVertical )
+_CmpLPt::_CmpLPt( const Point& rPt, const SwTableBox* pBox, sal_Bool bVertical )
: aPos( rPt ), pSelBox( pBox ), bVert( bVertical )
{}
void lcl_InsTblBox( SwTableNode* pTblNd, SwDoc* pDoc, SwTableBox* pBox,
- USHORT nInsPos, USHORT nCnt = 1 )
+ sal_uInt16 nInsPos, sal_uInt16 nCnt = 1 )
{
ASSERT( pBox->GetSttNd(), "Box ohne Start-Node" );
SwCntntNode* pCNd = pDoc->GetNodes()[ pBox->GetSttIdx() + 1 ]
@@ -961,25 +977,25 @@ void lcl_InsTblBox( SwTableNode* pTblNd, SwDoc* pDoc, SwTableBox* pBox,
nInsPos, nCnt );
}
-BOOL IsEmptyBox( const SwTableBox& rBox, SwPaM& rPam )
+sal_Bool IsEmptyBox( const SwTableBox& rBox, SwPaM& rPam )
{
rPam.GetPoint()->nNode = *rBox.GetSttNd()->EndOfSectionNode();
rPam.Move( fnMoveBackward, fnGoCntnt );
rPam.SetMark();
rPam.GetPoint()->nNode = *rBox.GetSttNd();
rPam.Move( fnMoveForward, fnGoCntnt );
- BOOL bRet = *rPam.GetMark() == *rPam.GetPoint()
+ sal_Bool bRet = *rPam.GetMark() == *rPam.GetPoint()
&& ( rBox.GetSttNd()->GetIndex() + 1 == rPam.GetPoint()->nNode.GetIndex() );
if( bRet )
{
// dann teste mal auf absatzgebundenen Flys
const SwSpzFrmFmts& rFmts = *rPam.GetDoc()->GetSpzFrmFmts();
- ULONG nSttIdx = rPam.GetPoint()->nNode.GetIndex(),
+ sal_uLong nSttIdx = rPam.GetPoint()->nNode.GetIndex(),
nEndIdx = rBox.GetSttNd()->EndOfSectionIndex(),
nIdx;
- for( USHORT n = 0; n < rFmts.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rFmts.Count(); ++n )
{
const SwFmtAnchor& rAnchor = rFmts[n]->GetAnchor();
const SwPosition* pAPos = rAnchor.GetCntntAnchor();
@@ -989,7 +1005,7 @@ BOOL IsEmptyBox( const SwTableBox& rBox, SwPaM& rPam )
nSttIdx <= ( nIdx = pAPos->nNode.GetIndex() ) &&
nIdx < nEndIdx )
{
- bRet = FALSE;
+ bRet = sal_False;
break;
}
}
@@ -1002,10 +1018,10 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
SwTableBox** ppMergeBox, SwUndoTblMerge* pUndo )
{
if( rBoxes.Count() )
- rBoxes.Remove( USHORT(0), rBoxes.Count() );
+ rBoxes.Remove( sal_uInt16(0), rBoxes.Count() );
//Zuerst lassen wir uns die Tabellen und die Rechtecke heraussuchen.
- ASSERT( rPam.GetCntntNode() && rPam.GetCntntNode( FALSE ),
+ ASSERT( rPam.GetCntntNode() && rPam.GetCntntNode( sal_False ),
"Tabselection nicht auf Cnt." );
//JP 24.09.96: Merge mit wiederholenden TabellenHeadline funktioniert nicht
@@ -1013,12 +1029,18 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
// das die 1. Headline mit drin ist.
// Point aPt( rShell.GetCharRect().Pos() );
Point aPt( 0, 0 );
+<<<<<<< local
const SwCntntNode* pCntNd = rPam.GetCntntNode();
const SwLayoutFrm *pStart = pCntNd->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(),
&aPt )->GetUpper();
pCntNd = rPam.GetCntntNode(FALSE);
const SwLayoutFrm *pEnd = rPam.GetCntntNode(FALSE)->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(),
+=======
+ const SwLayoutFrm *pStart = rPam.GetCntntNode()->GetFrm(
+ &aPt )->GetUpper(),
+ *pEnd = rPam.GetCntntNode(sal_False)->GetFrm(
+>>>>>>> other
&aPt )->GetUpper();
SwSelUnions aUnions;
@@ -1037,7 +1059,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
SWRECTFN( pStart->GetUpper() )
- for ( USHORT i = 0; i < aUnions.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < aUnions.Count(); ++i )
{
const SwTabFrm *pTabFrm = aUnions[i]->GetTable();
@@ -1069,7 +1091,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
{
if( ( rUnion.Right() + COLFUZZY ) < pCell->Frm().Right() )
{
- USHORT nInsPos = pBox->GetUpper()->
+ sal_uInt16 nInsPos = pBox->GetUpper()->
GetTabBoxes().C40_GETPOS( SwTableBox, pBox )+1;
lcl_InsTblBox( pTblNd, pDoc, pBox, nInsPos );
pBox->ClaimFrmFmt();
@@ -1113,7 +1135,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
else if( ( rUnion.Left() - COLFUZZY ) >= pCell->Frm().Left() &&
( rUnion.Right() + COLFUZZY ) < pCell->Frm().Right() )
{
- USHORT nInsPos = pBox->GetUpper()->GetTabBoxes().
+ sal_uInt16 nInsPos = pBox->GetUpper()->GetTabBoxes().
C40_GETPOS( SwTableBox, pBox )+1;
lcl_InsTblBox( pTblNd, pDoc, pBox, nInsPos, 2 );
pBox->ClaimFrmFmt();
@@ -1133,7 +1155,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
{
const SfxPoolItem* pItem;
if( SFX_ITEM_SET == pBox->GetFrmFmt()->GetAttrSet()
- .GetItemState( RES_BOX, FALSE, &pItem ))
+ .GetItemState( RES_BOX, sal_False, &pItem ))
{
SvxBoxItem aBox( *(SvxBoxItem*)pItem );
aBox.SetLine( 0, BOX_LINE_RIGHT );
@@ -1172,7 +1194,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
{
// dann muss eine neue Box einfuegt und die
// Breiten angepasst werden
- USHORT nInsPos = pBox->GetUpper()->GetTabBoxes().
+ sal_uInt16 nInsPos = pBox->GetUpper()->GetTabBoxes().
C40_GETPOS( SwTableBox, pBox )+1;
lcl_InsTblBox( pTblNd, pDoc, pBox, nInsPos, 1 );
@@ -1229,7 +1251,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
// 1. Loesung: gehe ueber das Array und
// alle auf der gleichen Y-Ebene werden mit Blanks getrennt
// alle anderen werden als Absaetze getrennt.
- BOOL bCalcWidth = TRUE;
+ sal_Bool bCalcWidth = sal_True;
const SwTableBox* pFirstBox = aPosArr[ 0 ].pSelBox;
// JP 27.03.98: Optimierung - falls die Boxen einer Line leer sind,
@@ -1241,8 +1263,8 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
#if defined( DEL_ONLY_EMPTY_LINES )
nWidth = pFirstBox->GetFrmFmt()->GetFrmSize().GetWidth();
- BOOL bEmptyLine = TRUE;
- USHORT n, nSttPos = 0;
+ sal_Bool bEmptyLine = sal_True;
+ sal_uInt16 n, nSttPos = 0;
for( n = 0; n < aPosArr.Count(); ++n )
{
@@ -1250,14 +1272,14 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
if( n && aPosArr[ n - 1 ].Y() == rPt.Y() ) // gleiche Ebene ?
{
if( bEmptyLine && !IsEmptyBox( *rPt.pSelBox, aPam ))
- bEmptyLine = FALSE;
+ bEmptyLine = sal_False;
if( bCalcWidth )
nWidth += rPt.pSelBox->GetFrmFmt()->GetFrmSize().GetWidth();
}
else
{
if( bCalcWidth && n )
- bCalcWidth = FALSE; // eine Zeile fertig
+ bCalcWidth = sal_False; // eine Zeile fertig
if( bEmptyLine && nSttPos < n )
{
@@ -1265,7 +1287,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
// nicht mit Blanks aufgefuellt und als Absatz
// eingefuegt werden.
if( pUndo )
- for( USHORT i = nSttPos; i < n; ++i )
+ for( sal_uInt16 i = nSttPos; i < n; ++i )
pUndo->SaveCollection( *aPosArr[ i ].pSelBox );
aPosArr.Remove( nSttPos, n - nSttPos );
@@ -1280,21 +1302,21 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
if( bEmptyLine && nSttPos < n )
{
if( pUndo )
- for( USHORT i = nSttPos; i < n; ++i )
+ for( sal_uInt16 i = nSttPos; i < n; ++i )
pUndo->SaveCollection( *aPosArr[ i ].pSelBox );
aPosArr.Remove( nSttPos, n - nSttPos );
}
#elsif defined( DEL_EMPTY_BOXES_AT_START_AND_END )
nWidth = pFirstBox->GetFrmFmt()->GetFrmSize().GetWidth();
- USHORT n, nSttPos = 0, nSEndPos = 0, nESttPos = 0;
+ sal_uInt16 n, nSttPos = 0, nSEndPos = 0, nESttPos = 0;
for( n = 0; n < aPosArr.Count(); ++n )
{
const _CmpLPt& rPt = aPosArr[ n ];
if( n && aPosArr[ n - 1 ].Y() == rPt.Y() ) // gleiche Ebene ?
{
- BOOL bEmptyBox = IsEmptyBox( *rPt.pSelBox, aPam );
+ sal_Bool bEmptyBox = IsEmptyBox( *rPt.pSelBox, aPam );
if( bEmptyBox )
{
if( nSEndPos == n ) // der Anfang ist leer
@@ -1309,7 +1331,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
else
{
if( bCalcWidth && n )
- bCalcWidth = FALSE; // eine Zeile fertig
+ bCalcWidth = sal_False; // eine Zeile fertig
// zuerst die vom Anfang
if( nSttPos < nSEndPos )
@@ -1317,10 +1339,10 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
// dann ist der vorder Teil der Line leer und braucht
// nicht mit Blanks aufgefuellt werden.
if( pUndo )
- for( USHORT i = nSttPos; i < nSEndPos; ++i )
+ for( sal_uInt16 i = nSttPos; i < nSEndPos; ++i )
pUndo->SaveCollection( *aPosArr[ i ].pSelBox );
- USHORT nCnt = nSEndPos - nSttPos;
+ sal_uInt16 nCnt = nSEndPos - nSttPos;
aPosArr.Remove( nSttPos, nCnt );
nESttPos -= nCnt;
n -= nCnt;
@@ -1331,10 +1353,10 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
// dann ist der vorder Teil der Line leer und braucht
// nicht mit Blanks aufgefuellt werden.
if( pUndo )
- for( USHORT i = nESttPos; i < n; ++i )
+ for( sal_uInt16 i = nESttPos; i < n; ++i )
pUndo->SaveCollection( *aPosArr[ i ].pSelBox );
- USHORT nCnt = n - nESttPos;
+ sal_uInt16 nCnt = n - nESttPos;
aPosArr.Remove( nESttPos, nCnt );
n -= nCnt;
}
@@ -1353,10 +1375,10 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
// dann ist der vorder Teil der Line leer und braucht
// nicht mit Blanks aufgefuellt werden.
if( pUndo )
- for( USHORT i = nSttPos; i < nSEndPos; ++i )
+ for( sal_uInt16 i = nSttPos; i < nSEndPos; ++i )
pUndo->SaveCollection( *aPosArr[ i ].pSelBox );
- USHORT nCnt = nSEndPos - nSttPos;
+ sal_uInt16 nCnt = nSEndPos - nSttPos;
aPosArr.Remove( nSttPos, nCnt );
nESttPos -= nCnt;
n -= nCnt;
@@ -1366,10 +1388,10 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
// dann ist der vorder Teil der Line leer und braucht
// nicht mit Blanks aufgefuellt werden.
if( pUndo )
- for( USHORT i = nESttPos; i < n; ++i )
+ for( sal_uInt16 i = nESttPos; i < n; ++i )
pUndo->SaveCollection( *aPosArr[ i ].pSelBox );
- USHORT nCnt = n - nESttPos;
+ sal_uInt16 nCnt = n - nESttPos;
aPosArr.Remove( nESttPos, nCnt );
}
#else
@@ -1382,7 +1404,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
aPosArr[ 0 ].Y() ) :
0;
- for( USHORT n = 0; n < aPosArr.Count(); ++n )
+ for( sal_uInt16 n = 0; n < aPosArr.Count(); ++n )
{
const _CmpLPt& rPt = aPosArr[ n ];
if( bCalcWidth )
@@ -1390,7 +1412,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
if( nY == ( bVert ? rPt.X() : rPt.Y() ) ) // gleiche Ebene ?
nWidth += rPt.pSelBox->GetFrmFmt()->GetFrmSize().GetWidth();
else
- bCalcWidth = FALSE; // eine Zeile fertig
+ bCalcWidth = sal_False; // eine Zeile fertig
}
if( IsEmptyBox( *rPt.pSelBox, aPam ) )
@@ -1409,7 +1431,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
{
SwTableBox* pTmpBox = rBoxes[0];
SwTableLine* pInsLine = pTmpBox->GetUpper();
- USHORT nInsPos = pInsLine->GetTabBoxes().C40_GETPOS( SwTableBox, pTmpBox );
+ sal_uInt16 nInsPos = pInsLine->GetTabBoxes().C40_GETPOS( SwTableBox, pTmpBox );
lcl_InsTblBox( pTblNd, pDoc, pTmpBox, nInsPos );
(*ppMergeBox) = pInsLine->GetTabBoxes()[ nInsPos ];
@@ -1440,23 +1462,28 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
SwPaM aPam( aInsPos );
- for( USHORT n = 0; n < aPosArr.Count(); ++n )
+ for( sal_uInt16 n = 0; n < aPosArr.Count(); ++n )
{
const _CmpLPt& rPt = aPosArr[ n ];
aPam.GetPoint()->nNode.Assign( *rPt.pSelBox->GetSttNd()->
EndOfSectionNode(), -1 );
SwCntntNode* pCNd = aPam.GetCntntNode();
- USHORT nL = pCNd ? pCNd->Len() : 0;
+ sal_uInt16 nL = pCNd ? pCNd->Len() : 0;
aPam.GetPoint()->nContent.Assign( pCNd, nL );
SwNodeIndex aSttNdIdx( *rPt.pSelBox->GetSttNd(), 1 );
// ein Node muss in der Box erhalten bleiben (sonst wird beim
// Move die gesamte Section geloescht)
+ bool const bUndo(pDoc->GetIDocumentUndoRedo().DoesUndo());
if( pUndo )
- pDoc->DoUndo( FALSE );
+ {
+ pDoc->GetIDocumentUndoRedo().DoUndo(false);
+ }
pDoc->AppendTxtNode( *aPam.GetPoint() );
if( pUndo )
- pDoc->DoUndo( TRUE );
+ {
+ pDoc->GetIDocumentUndoRedo().DoUndo(bUndo);
+ }
SwNodeRange aRg( aSttNdIdx, aPam.GetPoint()->nNode );
rInsPosNd++;
if( pUndo )
@@ -1469,7 +1496,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
// wo steht jetzt aInsPos ??
if( bCalcWidth )
- bCalcWidth = FALSE; // eine Zeile fertig
+ bCalcWidth = sal_False; // eine Zeile fertig
// den initialen TextNode ueberspringen
rInsPosNd.Assign( pDoc->GetNodes(),
@@ -1495,51 +1522,57 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
}
-static BOOL lcl_CheckCol( const _FndBox*& rpFndBox, void* pPara );
+static sal_Bool lcl_CheckCol( const _FndBox*& rpFndBox, void* pPara );
-static BOOL lcl_CheckRow( const _FndLine*& rpFndLine, void* pPara )
+static sal_Bool lcl_CheckRow( const _FndLine*& rpFndLine, void* pPara )
{
((_FndLine*)rpFndLine)->GetBoxes().ForEach( &lcl_CheckCol, pPara );
- return *(BOOL*)pPara;
+ return *(sal_Bool*)pPara;
}
-static BOOL lcl_CheckCol( const _FndBox*& rpFndBox, void* pPara )
+static sal_Bool lcl_CheckCol( const _FndBox*& rpFndBox, void* pPara )
{
if( !rpFndBox->GetBox()->GetSttNd() )
{
if( rpFndBox->GetLines().Count() !=
rpFndBox->GetBox()->GetTabLines().Count() )
- *((BOOL*)pPara) = FALSE;
+ *((sal_Bool*)pPara) = sal_False;
else
((_FndBox*)rpFndBox)->GetLines().ForEach( &lcl_CheckRow, pPara );
}
// Box geschuetzt ??
else if( rpFndBox->GetBox()->GetFrmFmt()->GetProtect().IsCntntProtected() )
- *((BOOL*)pPara) = FALSE;
- return *(BOOL*)pPara;
+ *((sal_Bool*)pPara) = sal_False;
+ return *(sal_Bool*)pPara;
}
-USHORT CheckMergeSel( const SwPaM& rPam )
+sal_uInt16 CheckMergeSel( const SwPaM& rPam )
{
SwSelBoxes aBoxes;
//JP 24.09.96: Merge mit wiederholenden TabellenHeadline funktioniert nicht
// richtig. Warum nicht Point 0,0 benutzen? Dann ist garantiert,
// das die 1. Headline mit drin ist.
Point aPt;
+<<<<<<< local
const SwCntntNode* pCntNd = rPam.GetCntntNode();
const SwLayoutFrm *pStart = pCntNd->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(),
&aPt )->GetUpper();
pCntNd = rPam.GetCntntNode(FALSE);
const SwLayoutFrm *pEnd = rPam.GetCntntNode(FALSE)->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(),
+=======
+ const SwLayoutFrm *pStart = rPam.GetCntntNode()->GetFrm(
+ &aPt )->GetUpper(),
+ *pEnd = rPam.GetCntntNode(sal_False)->GetFrm(
+>>>>>>> other
&aPt )->GetUpper();
GetTblSel( pStart, pEnd, aBoxes, 0 );
return CheckMergeSel( aBoxes );
}
-USHORT CheckMergeSel( const SwSelBoxes& rBoxes )
+sal_uInt16 CheckMergeSel( const SwSelBoxes& rBoxes )
{
- USHORT eRet = TBLMERGE_NOSELECTION;
+ sal_uInt16 eRet = TBLMERGE_NOSELECTION;
if( rBoxes.Count() )
{
eRet = TBLMERGE_OK;
@@ -1551,7 +1584,7 @@ USHORT CheckMergeSel( const SwSelBoxes& rBoxes )
&_FndLineCopyCol, &aPara );
if( aFndBox.GetLines().Count() )
{
- BOOL bMergeSelOk = TRUE;
+ sal_Bool bMergeSelOk = sal_True;
_FndBox* pFndBox = &aFndBox;
_FndLine* pFndLine = 0;
while( pFndBox && 1 == pFndBox->GetLines().Count() )
@@ -1631,7 +1664,7 @@ void lcl_FindStartEndRow( const SwLayoutFrm *&rpStart,
aEndArr.Insert( p, 0 );
}
- for( USHORT n = 0; n < aEndArr.Count() && n < aSttArr.Count(); ++n )
+ for( sal_uInt16 n = 0; n < aEndArr.Count() && n < aSttArr.Count(); ++n )
if( aSttArr[ n ] != aEndArr[ n ] )
{
// first unequal line or box - all odds are
@@ -1856,14 +1889,14 @@ void MakeSelUnions( SwSelUnions& rUnions, const SwLayoutFrm *pStart,
const SwTabFrm *pEndTable = pEnd->FindTabFrm();
if( !pTable || !pEndTable )
return;
- BOOL bExchange = FALSE;
+ sal_Bool bExchange = sal_False;
if ( pTable != pEndTable )
{
if ( !pTable->IsAnFollow( pEndTable ) )
{
ASSERT( pEndTable->IsAnFollow( pTable ), "Tabkette verknotet." );
- bExchange = TRUE;
+ bExchange = sal_True;
}
}
else
@@ -1875,10 +1908,10 @@ void MakeSelUnions( SwSelUnions& rUnions, const SwLayoutFrm *pStart,
{
if( (pStart->Frm().*fnRect->fnGetLeft)() >
(pEnd->Frm().*fnRect->fnGetLeft)() )
- bExchange = TRUE;
+ bExchange = sal_True;
}
else if( bVert == ( nSttTop < nEndTop ) )
- bExchange = TRUE;
+ bExchange = sal_True;
}
if ( bExchange )
{
@@ -2036,7 +2069,7 @@ void MakeSelUnions( SwSelUnions& rUnions, const SwLayoutFrm *pStart,
}
}
-BOOL CheckSplitCells( const SwCrsrShell& rShell, USHORT nDiv,
+sal_Bool CheckSplitCells( const SwCrsrShell& rShell, sal_uInt16 nDiv,
const SwTblSearchType eSearchType )
{
if( !rShell.IsTableMode() )
@@ -2045,13 +2078,13 @@ BOOL CheckSplitCells( const SwCrsrShell& rShell, USHORT nDiv,
return CheckSplitCells( *rShell.getShellCrsr(false), nDiv, eSearchType );
}
-BOOL CheckSplitCells( const SwCursor& rCrsr, USHORT nDiv,
+sal_Bool CheckSplitCells( const SwCursor& rCrsr, sal_uInt16 nDiv,
const SwTblSearchType eSearchType )
{
if( 1 >= nDiv )
- return FALSE;
+ return sal_False;
- USHORT nMinValue = nDiv * MINLAY;
+ sal_uInt16 nMinValue = nDiv * MINLAY;
//Start- und Endzelle besorgen und den naechsten fragen.
Point aPtPos, aMkPos;
@@ -2061,12 +2094,18 @@ BOOL CheckSplitCells( const SwCursor& rCrsr, USHORT nDiv,
aPtPos = pShCrsr->GetPtPos();
aMkPos = pShCrsr->GetMkPos();
}
+<<<<<<< local
const SwCntntNode* pCntNd = rCrsr.GetCntntNode();
const SwLayoutFrm *pStart = pCntNd->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(),
&aPtPos )->GetUpper();
pCntNd = rCrsr.GetCntntNode(FALSE);
const SwLayoutFrm *pEnd = rCrsr.GetCntntNode(FALSE)->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(),
+=======
+ const SwLayoutFrm *pStart = rCrsr.GetCntntNode()->GetFrm(
+ &aPtPos )->GetUpper(),
+ *pEnd = rCrsr.GetCntntNode(sal_False)->GetFrm(
+>>>>>>> other
&aMkPos )->GetUpper();
SWRECTFN( pStart->GetUpper() )
@@ -2077,7 +2116,7 @@ BOOL CheckSplitCells( const SwCursor& rCrsr, USHORT nDiv,
::MakeSelUnions( aUnions, pStart, pEnd, eSearchType );
//Jetzt zu jedem Eintrag die Boxen herausfischen und uebertragen.
- for ( USHORT i = 0; i < aUnions.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < aUnions.Count(); ++i )
{
SwSelUnion *pUnion = aUnions[i];
const SwTabFrm *pTable = pUnion->GetTable();
@@ -2099,7 +2138,7 @@ BOOL CheckSplitCells( const SwCursor& rCrsr, USHORT nDiv,
if( ::IsFrmInTblSel( pUnion->GetUnion(), pCell ) )
{
if( (pCell->Frm().*fnRect->fnGetWidth)() < nMinValue )
- return FALSE;
+ return sal_False;
}
if ( pCell->GetNext() )
@@ -2115,7 +2154,7 @@ BOOL CheckSplitCells( const SwCursor& rCrsr, USHORT nDiv,
pRow = (const SwLayoutFrm*)pRow->GetNext();
}
}
- return TRUE;
+ return sal_True;
}
// -------------------------------------------------------------------
@@ -2142,7 +2181,7 @@ void lcl_InsertRow( SwTableLine &rLine, SwLayoutFrm *pUpper, SwFrm *pSibling )
}
-BOOL _FndBoxCopyCol( const SwTableBox*& rpBox, void* pPara )
+sal_Bool _FndBoxCopyCol( const SwTableBox*& rpBox, void* pPara )
{
_FndPara* pFndPara = (_FndPara*)pPara;
_FndBox* pFndBox = new _FndBox( (SwTableBox*)rpBox, pFndPara->pFndLine );
@@ -2153,25 +2192,25 @@ BOOL _FndBoxCopyCol( const SwTableBox*& rpBox, void* pPara )
if( !pFndBox->GetLines().Count() )
{
delete pFndBox;
- return TRUE;
+ return sal_True;
}
}
else
{
SwTableBoxPtr pSrch = (SwTableBoxPtr)rpBox;
- USHORT nFndPos;
+ sal_uInt16 nFndPos;
if( !pFndPara->rBoxes.Seek_Entry( pSrch, &nFndPos ))
{
delete pFndBox;
- return TRUE;
+ return sal_True;
}
}
pFndPara->pFndLine->GetBoxes().C40_INSERT( _FndBox, pFndBox,
pFndPara->pFndLine->GetBoxes().Count() );
- return TRUE;
+ return sal_True;
}
-BOOL _FndLineCopyCol( const SwTableLine*& rpLine, void* pPara )
+sal_Bool _FndLineCopyCol( const SwTableLine*& rpLine, void* pPara )
{
_FndPara* pFndPara = (_FndPara*)pPara;
_FndLine* pFndLine = new _FndLine( (SwTableLine*)rpLine, pFndPara->pFndBox );
@@ -2184,7 +2223,7 @@ BOOL _FndLineCopyCol( const SwTableLine*& rpLine, void* pPara )
}
else
delete pFndLine;
- return TRUE;
+ return sal_True;
}
void _FndBox::SetTableLines( const SwSelBoxes &rBoxes, const SwTable &rTable )
@@ -2196,15 +2235,15 @@ void _FndBox::SetTableLines( const SwSelBoxes &rBoxes, const SwTable &rTable )
//Line im Array der SwTable. Damit die 0 fuer 'keine Line' verwand werden
//kann werden die Positionen um 1 nach oben versetzt!
- USHORT nStPos = USHRT_MAX;
- USHORT nEndPos= 0;
+ sal_uInt16 nStPos = USHRT_MAX;
+ sal_uInt16 nEndPos= 0;
- for ( USHORT i = 0; i < rBoxes.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rBoxes.Count(); ++i )
{
SwTableLine *pLine = rBoxes[i]->GetUpper();
while ( pLine->GetUpper() )
pLine = pLine->GetUpper()->GetUpper();
- const USHORT nPos = rTable.GetTabLines().GetPos(
+ const sal_uInt16 nPos = rTable.GetTabLines().GetPos(
(const SwTableLine*&)pLine ) + 1;
ASSERT( nPos != USHRT_MAX, "TableLine not found." );
@@ -2234,7 +2273,7 @@ void _FndBox::SetTableLines( const SwTable &rTable )
return;
SwTableLine* pTmpLine = GetLines()[0]->GetLine();
- USHORT nPos = rTable.GetTabLines().C40_GETPOS( SwTableLine, pTmpLine );
+ sal_uInt16 nPos = rTable.GetTabLines().C40_GETPOS( SwTableLine, pTmpLine );
ASSERT( USHRT_MAX != nPos, "Line steht nicht in der Tabelle" );
if( nPos )
pLineBefore = rTable.GetTabLines()[ nPos - 1 ];
@@ -2248,7 +2287,7 @@ void _FndBox::SetTableLines( const SwTable &rTable )
inline void UnsetFollow( SwFlowFrm *pTab )
{
- pTab->bIsFollow = FALSE;
+ pTab->bIsFollow = sal_False;
}
void _FndBox::DelFrms( SwTable &rTable )
@@ -2259,8 +2298,8 @@ void _FndBox::DelFrms( SwTable &rTable )
//Wird ein Master vernichtet, so muss der Follow Master werden.
//Ein TabFrm muss immer uebrigbleiben.
- USHORT nStPos = 0;
- USHORT nEndPos= rTable.GetTabLines().Count() - 1;
+ sal_uInt16 nStPos = 0;
+ sal_uInt16 nEndPos= rTable.GetTabLines().Count() - 1;
if( rTable.IsNewModel() && pLineBefore )
rTable.CheckRowSpan( pLineBefore, true );
if ( pLineBefore )
@@ -2280,7 +2319,7 @@ void _FndBox::DelFrms( SwTable &rTable )
--nEndPos;
}
- for ( USHORT i = nStPos; i <= nEndPos; ++i)
+ for ( sal_uInt16 i = nStPos; i <= nEndPos; ++i)
{
SwFrmFmt *pFmt = rTable.GetTabLines()[i]->GetFrmFmt();
SwIterator<SwRowFrm,SwFmt> aIter( *pFmt );
@@ -2288,12 +2327,12 @@ void _FndBox::DelFrms( SwTable &rTable )
{
if ( pFrm->GetTabLine() == rTable.GetTabLines()[i] )
{
- BOOL bDel = TRUE;
+ sal_Bool bDel = sal_True;
SwTabFrm *pUp = !pFrm->GetPrev() && !pFrm->GetNext() ?
(SwTabFrm*)pFrm->GetUpper() : 0;
if ( !pUp )
{
- const USHORT nRepeat =
+ const sal_uInt16 nRepeat =
((SwTabFrm*)pFrm->GetUpper())->GetTable()->GetRowsToRepeat();
if ( nRepeat > 0 &&
((SwTabFrm*)pFrm->GetUpper())->IsFollow() )
@@ -2327,7 +2366,7 @@ void _FndBox::DelFrms( SwTable &rTable )
// flag from pUp to pPrev. pUp may still have the
// flag set although there is not more follow flow
// line associated with pUp.
- pPrev->SetFollowFlowLine( FALSE );
+ pPrev->SetFollowFlowLine( sal_False );
// <--
}
else if ( pFollow )
@@ -2353,7 +2392,7 @@ void _FndBox::DelFrms( SwTable &rTable )
}
}
delete pUp;
- bDel = FALSE;//Die Row wird mit in den Abgrund
+ bDel = sal_False;//Die Row wird mit in den Abgrund
//gerissen.
}
}
@@ -2367,7 +2406,7 @@ void _FndBox::DelFrms( SwTable &rTable )
// We do not delete the follow flow line,
// this will be done automatically in the
// next turn.
- ((SwTabFrm*)pTabFrm)->SetFollowFlowLine( FALSE );
+ ((SwTabFrm*)pTabFrm)->SetFollowFlowLine( sal_False );
}
pFrm->Cut();
@@ -2378,7 +2417,7 @@ void _FndBox::DelFrms( SwTable &rTable )
}
}
-BOOL lcl_IsLineOfTblFrm( const SwTabFrm& rTable, const SwFrm& rChk )
+sal_Bool lcl_IsLineOfTblFrm( const SwTabFrm& rTable, const SwFrm& rChk )
{
const SwTabFrm* pTblFrm = rChk.FindTabFrm();
if( pTblFrm->IsFollow() )
@@ -2404,8 +2443,8 @@ void lcl_UpdateRepeatedHeadlines( SwTabFrm& rTabFrm, bool bCalcLowers )
// Insert fresh set of headlines:
pLower = (SwRowFrm*)rTabFrm.Lower();
SwTable& rTable = *rTabFrm.GetTable();
- const USHORT nRepeat = rTable.GetRowsToRepeat();
- for ( USHORT nIdx = 0; nIdx < nRepeat; ++nIdx )
+ const sal_uInt16 nRepeat = rTable.GetRowsToRepeat();
+ for ( sal_uInt16 nIdx = 0; nIdx < nRepeat; ++nIdx )
{
SwRowFrm* pHeadline = new SwRowFrm( *rTable.GetTabLines()[ nIdx ], &rTabFrm );
pHeadline->SetRepeatedHeadline( true );
@@ -2423,8 +2462,8 @@ void _FndBox::MakeFrms( SwTable &rTable )
//wieder neu erzeugt werden.
//Und Zwar fuer alle Auspraegungen der Tabelle (mehrere z.B. im Kopf/Fuss).
- USHORT nStPos = 0;
- USHORT nEndPos= rTable.GetTabLines().Count() - 1;
+ sal_uInt16 nStPos = 0;
+ sal_uInt16 nEndPos= rTable.GetTabLines().Count() - 1;
if ( pLineBefore )
{
nStPos = rTable.GetTabLines().GetPos(
@@ -2453,9 +2492,15 @@ void _FndBox::MakeFrms( SwTable &rTable )
i >= 0 && !pSibling; --i )
{
SwTableLine *pLine = pLineBehind ? pLineBehind :
+<<<<<<< local
rTable.GetTabLines()[static_cast<USHORT>(i)];
SwIterator<SwRowFrm,SwFmt> aIter( *pLine->GetFrmFmt() );
pSibling = aIter.First();
+=======
+ rTable.GetTabLines()[static_cast<sal_uInt16>(i)];
+ SwClientIter aIter( *pLine->GetFrmFmt() );
+ pSibling = (SwFrm*)aIter.First( TYPE(SwFrm) );
+>>>>>>> other
while ( pSibling && (
pSibling->GetTabLine() != pLine ||
!lcl_IsLineOfTblFrm( *pTable, *pSibling ) ||
@@ -2479,8 +2524,8 @@ void _FndBox::MakeFrms( SwTable &rTable )
// ???? oder das der Letzte Follow der Tabelle ????
pUpperFrm = pTable;
- for ( i = nStPos; (USHORT)i <= nEndPos; ++i )
- ::lcl_InsertRow( *rTable.GetTabLines()[static_cast<USHORT>(i)],
+ for ( i = nStPos; (sal_uInt16)i <= nEndPos; ++i )
+ ::lcl_InsertRow( *rTable.GetTabLines()[static_cast<sal_uInt16>(i)],
(SwLayoutFrm*)pUpperFrm, pSibling );
if ( pUpperFrm->IsTabFrm() )
((SwTabFrm*)pUpperFrm)->SetCalcLowers();
@@ -2493,23 +2538,23 @@ void _FndBox::MakeFrms( SwTable &rTable )
}
}
-void _FndBox::MakeNewFrms( SwTable &rTable, const USHORT nNumber,
- const BOOL bBehind )
+void _FndBox::MakeNewFrms( SwTable &rTable, const sal_uInt16 nNumber,
+ const sal_Bool bBehind )
{
//Frms fuer neu eingefuege Zeilen erzeugen.
- //bBehind == TRUE: vor pLineBehind
- // == FALSE: hinter pLineBefore
- const USHORT nBfPos = pLineBefore ?
+ //bBehind == sal_True: vor pLineBehind
+ // == sal_False: hinter pLineBefore
+ const sal_uInt16 nBfPos = pLineBefore ?
rTable.GetTabLines().GetPos( (const SwTableLine*&)pLineBefore ) :
USHRT_MAX;
- const USHORT nBhPos = pLineBehind ?
+ const sal_uInt16 nBhPos = pLineBehind ?
rTable.GetTabLines().GetPos( (const SwTableLine*&)pLineBehind ) :
USHRT_MAX;
//nNumber: wie oft ist eingefuegt worden.
//nCnt: wieviele sind nNumber mal eingefuegt worden.
- const USHORT nCnt =
+ const sal_uInt16 nCnt =
((nBhPos != USHRT_MAX ? nBhPos : rTable.GetTabLines().Count()) -
(nBfPos != USHRT_MAX ? nBfPos + 1 : 0)) / (nNumber + 1);
@@ -2549,10 +2594,10 @@ void _FndBox::MakeNewFrms( SwTable &rTable, const USHORT nNumber,
pTable = pTable->GetFollow();
pUpperFrm = pTable;
}
- const USHORT nMax = nBhPos != USHRT_MAX ?
+ const sal_uInt16 nMax = nBhPos != USHRT_MAX ?
nBhPos : rTable.GetTabLines().Count();
- USHORT i = nBfPos != USHRT_MAX ? nBfPos + 1 + nCnt : nCnt;
+ sal_uInt16 i = nBfPos != USHRT_MAX ? nBfPos + 1 + nCnt : nCnt;
for ( ; i < nMax; ++i )
::lcl_InsertRow( *rTable.GetTabLines()[i], pUpperFrm, pSibling );
@@ -2561,7 +2606,7 @@ void _FndBox::MakeNewFrms( SwTable &rTable, const USHORT nNumber,
}
else //davor einfuegen
{
- USHORT i;
+ sal_uInt16 i;
// We are looking for the frame that is behind the row frame
// that should be inserted.
@@ -2597,7 +2642,7 @@ void _FndBox::MakeNewFrms( SwTable &rTable, const USHORT nNumber,
if ( pLineBefore )
pSibling = (SwRowFrm*) pSibling->GetNext();
- USHORT nMax = nBhPos != USHRT_MAX ?
+ sal_uInt16 nMax = nBhPos != USHRT_MAX ?
nBhPos - nCnt :
rTable.GetTabLines().Count() - nCnt;
@@ -2613,7 +2658,7 @@ void _FndBox::MakeNewFrms( SwTable &rTable, const USHORT nNumber,
//Die Headlines mussen ggf. auch verarbeitet werden. Um gut arbeitenden
//Code nicht zu zerfasern wird hier nochmals iteriert.
- const USHORT nRowsToRepeat = rTable.GetRowsToRepeat();
+ const sal_uInt16 nRowsToRepeat = rTable.GetRowsToRepeat();
if ( nRowsToRepeat > 0 &&
( ( !bBehind && ( nBfPos == USHRT_MAX || nBfPos + 1 < nRowsToRepeat ) ) ||
( bBehind && ( ( nBfPos == USHRT_MAX && nRowsToRepeat > 1 ) || nBfPos + 2 < nRowsToRepeat ) ) ) )
@@ -2634,14 +2679,14 @@ void _FndBox::MakeNewFrms( SwTable &rTable, const USHORT nNumber,
}
}
-BOOL _FndBox::AreLinesToRestore( const SwTable &rTable ) const
+sal_Bool _FndBox::AreLinesToRestore( const SwTable &rTable ) const
{
//Lohnt es sich MakeFrms zu rufen?
if ( !pLineBefore && !pLineBehind && rTable.GetTabLines().Count() )
- return TRUE;
+ return sal_True;
- USHORT nBfPos;
+ sal_uInt16 nBfPos;
if(pLineBefore)
{
const SwTableLine* rLBefore = (const SwTableLine*)pLineBefore;
@@ -2650,7 +2695,7 @@ BOOL _FndBox::AreLinesToRestore( const SwTable &rTable ) const
else
nBfPos = USHRT_MAX;
- USHORT nBhPos;
+ sal_uInt16 nBhPos;
if(pLineBehind)
{
const SwTableLine* rLBehind = (const SwTableLine*)pLineBehind;
@@ -2661,8 +2706,8 @@ BOOL _FndBox::AreLinesToRestore( const SwTable &rTable ) const
if ( nBfPos == nBhPos ) //Duerfte eigentlich nie vorkommen.
{
- ASSERT( FALSE, "Table, Loeschen auf keinem Bereich !?!" );
- return FALSE;
+ ASSERT( sal_False, "Table, Loeschen auf keinem Bereich !?!" );
+ return sal_False;
}
if ( rTable.GetRowsToRepeat() > 0 )
@@ -2682,19 +2727,19 @@ BOOL _FndBox::AreLinesToRestore( const SwTable &rTable ) const
// Some adjacent lines at the beginning of the table have been deleted:
if ( nBfPos == USHRT_MAX && nBhPos == 0 )
- return FALSE;
+ return sal_False;
// Some adjacent lines at the end of the table have been deleted:
if ( nBhPos == USHRT_MAX && nBfPos == (rTable.GetTabLines().Count() - 1) )
- return FALSE;
+ return sal_False;
// Some adjacent lines in the middle of the table have been deleted:
if ( nBfPos != USHRT_MAX && nBhPos != USHRT_MAX && (nBfPos + 1) == nBhPos )
- return FALSE;
+ return sal_False;
// The structure of the deleted lines is more complex due to split lines.
// A call of MakeFrms() is necessary.
- return TRUE;
+ return sal_True;
}
diff --git a/sw/source/core/graphic/grfatr.cxx b/sw/source/core/graphic/grfatr.cxx
index 8e4e9f77aba8..85c9a028e5af 100644
--- a/sw/source/core/graphic/grfatr.cxx
+++ b/sw/source/core/graphic/grfatr.cxx
@@ -79,19 +79,19 @@ int SwMirrorGrf::operator==( const SfxPoolItem& rItem) const
((SwMirrorGrf&)rItem).IsGrfToggle() == IsGrfToggle();
}
-BOOL lcl_IsHoriOnEvenPages(int nEnum, BOOL bToggle)
+sal_Bool lcl_IsHoriOnEvenPages(int nEnum, sal_Bool bToggle)
{
- BOOL bEnum = nEnum == RES_MIRROR_GRAPH_VERT ||
+ sal_Bool bEnum = nEnum == RES_MIRROR_GRAPH_VERT ||
nEnum == RES_MIRROR_GRAPH_BOTH;
return bEnum != bToggle;
}
-BOOL lcl_IsHoriOnOddPages(int nEnum)
+sal_Bool lcl_IsHoriOnOddPages(int nEnum)
{
- BOOL bEnum = nEnum == RES_MIRROR_GRAPH_VERT ||
+ sal_Bool bEnum = nEnum == RES_MIRROR_GRAPH_VERT ||
nEnum == RES_MIRROR_GRAPH_BOTH;
return bEnum;
}
-BOOL SwMirrorGrf::QueryValue( uno::Any& rVal, BYTE nMemberId ) const
+sal_Bool SwMirrorGrf::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{
sal_Bool bRet = sal_True,
bVal;
@@ -117,7 +117,7 @@ BOOL SwMirrorGrf::QueryValue( uno::Any& rVal, BYTE nMemberId ) const
return bRet;
}
-BOOL SwMirrorGrf::PutValue( const uno::Any& rVal, BYTE nMemberId )
+sal_Bool SwMirrorGrf::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
sal_Bool bRet = sal_True;
sal_Bool bVal = *(sal_Bool*)rVal.getValue();
@@ -128,17 +128,17 @@ BOOL SwMirrorGrf::PutValue( const uno::Any& rVal, BYTE nMemberId )
case MID_MIRROR_HORZ_EVEN_PAGES:
case MID_MIRROR_HORZ_ODD_PAGES:
{
- BOOL bIsVert = GetValue() == RES_MIRROR_GRAPH_HOR ||
+ sal_Bool bIsVert = GetValue() == RES_MIRROR_GRAPH_HOR ||
GetValue() == RES_MIRROR_GRAPH_BOTH;
- BOOL bOnOddPages = nMemberId == MID_MIRROR_HORZ_EVEN_PAGES ?
+ sal_Bool bOnOddPages = nMemberId == MID_MIRROR_HORZ_EVEN_PAGES ?
lcl_IsHoriOnOddPages(GetValue()) : bVal;
- BOOL bOnEvenPages = nMemberId == MID_MIRROR_HORZ_ODD_PAGES ?
+ sal_Bool bOnEvenPages = nMemberId == MID_MIRROR_HORZ_ODD_PAGES ?
lcl_IsHoriOnEvenPages(GetValue(), IsGrfToggle()) : bVal;
MirrorGraph nEnum = bOnOddPages ?
bIsVert ? RES_MIRROR_GRAPH_BOTH : RES_MIRROR_GRAPH_VERT :
bIsVert ? RES_MIRROR_GRAPH_HOR : RES_MIRROR_GRAPH_DONT;
- BOOL bToggle = bOnOddPages != bOnEvenPages;
- SetValue(static_cast<USHORT>(nEnum));
+ sal_Bool bToggle = bOnOddPages != bOnEvenPages;
+ SetValue(static_cast<sal_uInt16>(nEnum));
SetGrfToggle( bToggle );
}
break;
@@ -198,28 +198,28 @@ int SwRotationGrf::operator==( const SfxPoolItem& rCmp ) const
}
-BOOL SwRotationGrf::QueryValue( uno::Any& rVal, BYTE ) const
+sal_Bool SwRotationGrf::QueryValue( uno::Any& rVal, sal_uInt8 ) const
{
// SfxUInt16Item::QueryValue returns sal_Int32 in Any now... (srx642w)
// where we still want this to be a sal_Int16
rVal <<= (sal_Int16)GetValue();
- return TRUE;
+ return sal_True;
}
-BOOL SwRotationGrf::PutValue( const uno::Any& rVal, BYTE )
+sal_Bool SwRotationGrf::PutValue( const uno::Any& rVal, sal_uInt8 )
{
// SfxUInt16Item::QueryValue returns sal_Int32 in Any now... (srx642w)
// where we still want this to be a sal_Int16
sal_Int16 nValue = 0;
if (rVal >>= nValue)
{
- // UINT16 argument needed
- SetValue( (UINT16) nValue );
- return TRUE;
+ // sal_uInt16 argument needed
+ SetValue( (sal_uInt16) nValue );
+ return sal_True;
}
DBG_ERROR( "SwRotationGrf::PutValue - Wrong type!" );
- return FALSE;
+ return sal_False;
}
// ------------------------------------------------------------------
@@ -270,13 +270,13 @@ int SwGammaGrf::operator==( const SfxPoolItem& rCmp ) const
nValue == ((SwGammaGrf&)rCmp).GetValue();
}
-BOOL SwGammaGrf::QueryValue( uno::Any& rVal, BYTE ) const
+sal_Bool SwGammaGrf::QueryValue( uno::Any& rVal, sal_uInt8 ) const
{
rVal <<= nValue;
return sal_True;
}
-BOOL SwGammaGrf::PutValue( const uno::Any& rVal, BYTE )
+sal_Bool SwGammaGrf::PutValue( const uno::Any& rVal, sal_uInt8 )
{
return rVal >>= nValue;
}
@@ -295,24 +295,24 @@ SfxPoolItem* SwTransparencyGrf::Clone( SfxItemPool * ) const
return new SwTransparencyGrf( *this );
}
// ------------------------------------------------------------------
-BOOL SwTransparencyGrf::QueryValue( uno::Any& rVal,
- BYTE ) const
+sal_Bool SwTransparencyGrf::QueryValue( uno::Any& rVal,
+ sal_uInt8 ) const
{
DBG_ASSERT(ISA(SfxByteItem),"Put/QueryValue should be removed!");
sal_Int16 nRet = GetValue();
DBG_ASSERT( 0 <= nRet && nRet <= 100, "value out of range" );
rVal <<= nRet;
- return TRUE;
+ return sal_True;
}
// ------------------------------------------------------------------
-BOOL SwTransparencyGrf::PutValue( const uno::Any& rVal,
- BYTE )
+sal_Bool SwTransparencyGrf::PutValue( const uno::Any& rVal,
+ sal_uInt8 )
{
//temporary conversion until this is a SfxInt16Item!
DBG_ASSERT(ISA(SfxByteItem),"Put/QueryValue should be removed!");
sal_Int16 nVal = 0;
if(!(rVal >>= nVal) || nVal < -100 || nVal > 100)
- return FALSE;
+ return sal_False;
if(nVal < 0)
{
// for compatibility with old documents
@@ -322,8 +322,8 @@ BOOL SwTransparencyGrf::PutValue( const uno::Any& rVal,
nVal += 128;
}
DBG_ASSERT( 0 <= nVal && nVal <= 100, "value out of range" );
- SetValue(static_cast<BYTE>(nVal));
- return TRUE;
+ SetValue(static_cast<sal_uInt8>(nVal));
+ return sal_True;
}
// ------------------------------------------------------------------
@@ -333,7 +333,7 @@ SfxPoolItem* SwDrawModeGrf::Clone( SfxItemPool * ) const
return new SwDrawModeGrf( *this );
}
-USHORT SwDrawModeGrf::GetValueCount() const
+sal_uInt16 SwDrawModeGrf::GetValueCount() const
{
// GRAPHICDRAWMODE_STANDARD = 0,
// GRAPHICDRAWMODE_GREYS = 1,
@@ -342,24 +342,24 @@ USHORT SwDrawModeGrf::GetValueCount() const
return GRAPHICDRAWMODE_WATERMARK + 1;
}
-BOOL SwDrawModeGrf::QueryValue( uno::Any& rVal,
- BYTE ) const
+sal_Bool SwDrawModeGrf::QueryValue( uno::Any& rVal,
+ sal_uInt8 ) const
{
drawing::ColorMode eRet = (drawing::ColorMode)GetEnumValue();
rVal <<= eRet;
- return TRUE;
+ return sal_True;
}
-BOOL SwDrawModeGrf::PutValue( const uno::Any& rVal,
- BYTE )
+sal_Bool SwDrawModeGrf::PutValue( const uno::Any& rVal,
+ sal_uInt8 )
{
sal_Int32 eVal = SWUnoHelper::GetEnumAsInt32( rVal );
if(eVal >= 0 && eVal <= GRAPHICDRAWMODE_WATERMARK)
{
- SetEnumValue((USHORT)eVal);
- return TRUE;
+ SetEnumValue((sal_uInt16)eVal);
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index 0f6c29015dfc..a66f0b708d80 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -84,10 +84,10 @@ SwGrfNode::SwGrfNode(
{
aGrfObj.SetSwapStreamHdl( LINK( this, SwGrfNode, SwapGraphic ) );
bInSwapIn = bChgTwipSize = bChgTwipSizeFromPixel = bLoadLowResGrf =
- bFrameInPaint = bScaleImageMap = FALSE;
+ bFrameInPaint = bScaleImageMap = sal_False;
- bGrafikArrived = TRUE;
- ReRead(rGrfName,rFltName, pGraphic, 0, FALSE);
+ bGrafikArrived = sal_True;
+ ReRead(rGrfName,rFltName, pGraphic, 0, sal_False);
}
SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere,
@@ -104,8 +104,8 @@ SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere,
if( rGrfObj.HasUserData() && rGrfObj.IsSwappedOut() )
aGrfObj.SetSwapState();
bInSwapIn = bChgTwipSize = bChgTwipSizeFromPixel= bLoadLowResGrf =
- bFrameInPaint = bScaleImageMap = FALSE;
- bGrafikArrived = TRUE;
+ bFrameInPaint = bScaleImageMap = sal_False;
+ bGrafikArrived = sal_True;
}
// Konstruktor fuer den SW/G-Reader. Dieser ctor wird verwendet,
@@ -128,8 +128,8 @@ SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere,
aGrfObj.SetGraphic( aGrf, rGrfName );
bInSwapIn = bChgTwipSize = bChgTwipSizeFromPixel = bLoadLowResGrf =
- bFrameInPaint = bScaleImageMap = FALSE;
- bGrafikArrived = TRUE;
+ bFrameInPaint = bScaleImageMap = sal_False;
+ bGrafikArrived = sal_True;
InsertLink( rGrfName, rFltName );
if( IsLinkedFile() )
@@ -144,12 +144,12 @@ SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere,
}
}
-BOOL SwGrfNode::ReRead(
+sal_Bool SwGrfNode::ReRead(
const String& rGrfName, const String& rFltName,
const Graphic* pGraphic, const GraphicObject* pGrfObj,
- BOOL bNewGrf )
+ sal_Bool bNewGrf )
{
- BOOL bReadGrf = FALSE, bSetTwipSize = TRUE;
+ sal_Bool bReadGrf = sal_False, bSetTwipSize = sal_True;
ASSERT( pGraphic || pGrfObj || rGrfName.Len(),
"GraphicNode without a name, Graphic or GraphicObject" );
@@ -166,7 +166,7 @@ BOOL SwGrfNode::ReRead(
String sCmd( rGrfName );
if( rFltName.Len() )
{
- USHORT nNewType;
+ sal_uInt16 nNewType;
if( rFltName.EqualsAscii( "DDE" ))
nNewType = OBJECT_CLIENT_DDE;
else
@@ -193,7 +193,7 @@ BOOL SwGrfNode::ReRead(
if( pGraphic )
{
aGrfObj.SetGraphic( *pGraphic, rGrfName );
- bReadGrf = TRUE;
+ bReadGrf = sal_True;
}
else if( pGrfObj )
{
@@ -201,7 +201,7 @@ BOOL SwGrfNode::ReRead(
if( pGrfObj->HasUserData() && pGrfObj->IsSwappedOut() )
aGrfObj.SetSwapState();
aGrfObj.SetLink( rGrfName );
- bReadGrf = TRUE;
+ bReadGrf = sal_True;
}
else
{
@@ -228,7 +228,7 @@ BOOL SwGrfNode::ReRead(
((SwBaseLink*)&refLink)->SwapIn();
}
}
- bSetTwipSize = FALSE;
+ bSetTwipSize = sal_False;
}
}
else if( pGraphic && !rGrfName.Len() )
@@ -238,7 +238,7 @@ BOOL SwGrfNode::ReRead(
DelStreamName();
aGrfObj.SetGraphic( *pGraphic );
- bReadGrf = TRUE;
+ bReadGrf = sal_True;
}
else if( pGrfObj && !rGrfName.Len() )
{
@@ -249,12 +249,12 @@ BOOL SwGrfNode::ReRead(
aGrfObj = *pGrfObj;
if( pGrfObj->HasUserData() && pGrfObj->IsSwappedOut() )
aGrfObj.SetSwapState();
- bReadGrf = TRUE;
+ bReadGrf = sal_True;
}
// Import einer Grafik:
// Ist die Grafik bereits geladen?
else if( !bNewGrf && GRAPHIC_NONE != aGrfObj.GetType() )
- return TRUE;
+ return sal_True;
else
{
@@ -269,7 +269,7 @@ BOOL SwGrfNode::ReRead(
if( pGraphic )
{
aGrfObj.SetGraphic( *pGraphic, rGrfName );
- bReadGrf = TRUE;
+ bReadGrf = sal_True;
// Verbindung herstellen ohne ein Update; Grafik haben wir!
((SwBaseLink*)&refLink)->Connect();
}
@@ -277,7 +277,7 @@ BOOL SwGrfNode::ReRead(
{
aGrfObj = *pGrfObj;
aGrfObj.SetLink( rGrfName );
- bReadGrf = TRUE;
+ bReadGrf = sal_True;
// Verbindung herstellen ohne ein Update; Grafik haben wir!
((SwBaseLink*)&refLink)->Connect();
}
@@ -364,7 +364,7 @@ SwGrfNode * SwNodes::MakeGrfNode( const SwNodeIndex & rWhere,
const Graphic* pGraphic,
SwGrfFmtColl* pGrfColl,
SwAttrSet* pAutoAttr,
- BOOL bDelayed )
+ sal_Bool bDelayed )
{
ASSERT( pGrfColl, "MakeGrfNode: Formatpointer ist 0." );
SwGrfNode *pNode;
@@ -395,7 +395,7 @@ Size SwGrfNode::GetTwipSize() const
-BOOL SwGrfNode::ImportGraphic( SvStream& rStrm )
+sal_Bool SwGrfNode::ImportGraphic( SvStream& rStrm )
{
Graphic aGraphic;
if( !GraphicFilter::GetGraphicFilter()->ImportGraphic( aGraphic, String(), rStrm ) )
@@ -404,10 +404,10 @@ BOOL SwGrfNode::ImportGraphic( SvStream& rStrm )
aGrfObj.SetGraphic( aGraphic );
aGrfObj.SetUserData( aUserData );
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// Returnwert:
@@ -415,13 +415,13 @@ BOOL SwGrfNode::ImportGraphic( SvStream& rStrm )
// 0 : nicht geladen
// 1 : Einlesen erfolgreich
-short SwGrfNode::SwapIn( BOOL bWaitForData )
+short SwGrfNode::SwapIn( sal_Bool bWaitForData )
{
if( bInSwapIn ) // nicht rekuriv!!
return !aGrfObj.IsSwappedOut();
short nRet = 0;
- bInSwapIn = TRUE;
+ bInSwapIn = sal_True;
SwBaseLink* pLink = (SwBaseLink*)(::sfx2::SvBaseLink*) refLink;
if( pLink )
@@ -500,7 +500,7 @@ short SwGrfNode::SwapIn( BOOL bWaitForData )
if( !nGrfSize.Width() && !nGrfSize.Height() )
SetTwipSize( ::GetGraphicSizeTwip( aGrfObj.GetGraphic(), 0 ) );
}
- bInSwapIn = FALSE;
+ bInSwapIn = sal_False;
return nRet;
}
@@ -528,12 +528,12 @@ short SwGrfNode::SwapOut()
}
-BOOL SwGrfNode::GetFileFilterNms( String* pFileNm, String* pFilterNm ) const
+sal_Bool SwGrfNode::GetFileFilterNms( String* pFileNm, String* pFilterNm ) const
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( refLink.Is() && refLink->GetLinkManager() )
{
- USHORT nType = refLink->GetObjType();
+ sal_uInt16 nType = refLink->GetObjType();
if( OBJECT_CLIENT_GRF == nType )
bRet = refLink->GetLinkManager()->GetDisplayNames(
refLink, 0, pFileNm, 0, pFilterNm );
@@ -547,7 +547,7 @@ BOOL SwGrfNode::GetFileFilterNms( String* pFileNm, String* pFilterNm ) const
( *pFileNm += sTopic ) += sfx2::cTokenSeperator;
*pFileNm += sItem;
pFilterNm->AssignAscii( RTL_CONSTASCII_STRINGPARAM( "DDE" ));
- bRet = TRUE;
+ bRet = sal_True;
}
}
}
@@ -558,18 +558,18 @@ BOOL SwGrfNode::GetFileFilterNms( String* pFileNm, String* pFilterNm ) const
// Eine Grafik Undo-faehig machen. Falls sie sich bereits in
// einem Storage befindet, muss sie geladen werden.
-BOOL SwGrfNode::SavePersistentData()
+sal_Bool SwGrfNode::SavePersistentData()
{
if( refLink.Is() )
{
ASSERT( !bInSwapIn, "SavePersistentData: stehe noch im SwapIn" );
GetDoc()->GetLinkManager().Remove( refLink );
- return TRUE;
+ return sal_True;
}
// Erst mal reinswappen, falls sie im Storage ist
if( HasStreamName() && !SwapIn() )
- return FALSE;
+ return sal_False;
// --> OD 2005-04-19 #i44367#
// Do not delete graphic file in storage, because the graphic file could
@@ -586,11 +586,11 @@ BOOL SwGrfNode::SavePersistentData()
// <--
// Und in TempFile rausswappen
- return (BOOL) SwapOut();
+ return (sal_Bool) SwapOut();
}
-BOOL SwGrfNode::RestorePersistentData()
+sal_Bool SwGrfNode::RestorePersistentData()
{
if( refLink.Is() )
{
@@ -600,7 +600,7 @@ BOOL SwGrfNode::RestorePersistentData()
if( getIDocumentLayoutAccess()->GetCurrentLayout() ) //swmod 080218
refLink->Update();
}
- return TRUE;
+ return sal_True;
}
@@ -614,7 +614,7 @@ void SwGrfNode::InsertLink( const String& rGrfName, const String& rFltName )
refLink->SetVisible( pIDLA->IsVisibleLinks() );
if( rFltName.EqualsAscii( "DDE" ))
{
- USHORT nTmp = 0;
+ sal_uInt16 nTmp = 0;
String sApp, sTopic, sItem;
sApp = rGrfName.GetToken( 0, sfx2::cTokenSeperator, nTmp );
sTopic = rGrfName.GetToken( 0, sfx2::cTokenSeperator, nTmp );
@@ -624,7 +624,7 @@ void SwGrfNode::InsertLink( const String& rGrfName, const String& rFltName )
}
else
{
- BOOL bSync = rFltName.EqualsAscii( "SYNCHRON" );
+ sal_Bool bSync = rFltName.EqualsAscii( "SYNCHRON" );
refLink->SetSynchron( bSync );
refLink->SetContentType( SOT_FORMATSTR_ID_SVXB );
@@ -644,11 +644,11 @@ void SwGrfNode::ReleaseLink()
// erst die Grafik reinswappen!
// if( aGraphic.IsSwapOut() || !refLink->IsSynchron() )
{
- bInSwapIn = TRUE;
+ bInSwapIn = sal_True;
SwBaseLink* pLink = (SwBaseLink*)(::sfx2::SvBaseLink*) refLink;
//TODO pLink->setInputStream(getInputStream());
- pLink->SwapIn( TRUE, TRUE );
- bInSwapIn = FALSE;
+ pLink->SwapIn( sal_True, sal_True );
+ bInSwapIn = sal_False;
}
getIDocumentLinksAdministration()->GetLinkManager().Remove( refLink );
refLink.Clear();
@@ -666,7 +666,7 @@ void SwGrfNode::SetTwipSize( const Size& rSz )
ScaleImageMap();
// Image-Map nicht noch einmal skalieren
- SetScaleImageMap( FALSE );
+ SetScaleImageMap( sal_False );
}
}
@@ -685,7 +685,7 @@ void SwGrfNode::ScaleImageMap()
if ( !aURL.GetMap() )
return;
- BOOL bScale = FALSE;
+ sal_Bool bScale = sal_False;
Fraction aScaleX( 1, 1 );
Fraction aScaleY( 1, 1 );
@@ -704,7 +704,7 @@ void SwGrfNode::ScaleImageMap()
if( nGrfSize.Width() != nWidth )
{
aScaleX = Fraction( nGrfSize.Width(), nWidth );
- bScale = TRUE;
+ bScale = sal_True;
}
}
if( !rFrmSize.GetHeightPercent() )
@@ -719,7 +719,7 @@ void SwGrfNode::ScaleImageMap()
if( nGrfSize.Height() != nHeight )
{
aScaleY = Fraction( nGrfSize.Height(), nHeight );
- bScale = TRUE;
+ bScale = sal_True;
}
}
@@ -965,9 +965,9 @@ IMPL_LINK( SwGrfNode, SwapGraphic, GraphicObject*, pGrfObj )
// then make it by your self
if( !bInSwapIn )
{
- BOOL bIsModifyLocked = IsModifyLocked();
+ sal_Bool bIsModifyLocked = IsModifyLocked();
LockModify();
- SwapIn( FALSE );
+ SwapIn( sal_False );
if( !bIsModifyLocked )
UnlockModify();
}
@@ -1032,7 +1032,7 @@ void DelAllGrfCacheEntries( SwDoc* pDoc )
const ::sfx2::SvBaseLinks& rLnks = rLnkMgr.GetLinks();
SwGrfNode* pGrfNd;
String sFileNm;
- for( USHORT n = rLnks.Count(); n; )
+ for( sal_uInt16 n = rLnks.Count(); n; )
{
::sfx2::SvBaseLink* pLnk = &(*rLnks[ --n ]);
if( pLnk && OBJECT_CLIENT_GRF == pLnk->GetObjType() &&
@@ -1055,7 +1055,7 @@ GraphicAttr& SwGrfNode::GetGraphicAttr( GraphicAttr& rGA,
rGA.SetDrawMode( (GraphicDrawMode)rSet.GetDrawModeGrf().GetValue() );
const SwMirrorGrf & rMirror = rSet.GetMirrorGrf();
- ULONG nMirror = BMP_MIRROR_NONE;
+ sal_uLong nMirror = BMP_MIRROR_NONE;
if( rMirror.IsGrfToggle() && pFrm && !pFrm->FindPageFrm()->OnRightPage() )
{
switch( rMirror.GetValue() )
@@ -1096,15 +1096,15 @@ GraphicAttr& SwGrfNode::GetGraphicAttr( GraphicAttr& rGA,
rGA.SetInvert( rSet.GetInvertGrf().GetValue() );
const sal_uInt16 nTrans = rSet.GetTransparencyGrf().GetValue();
- rGA.SetTransparency( (BYTE) FRound(
- Min( nTrans, (USHORT) 100 ) * 2.55 ) );
+ rGA.SetTransparency( (sal_uInt8) FRound(
+ Min( nTrans, (sal_uInt16) 100 ) * 2.55 ) );
return rGA;
}
-BOOL SwGrfNode::IsTransparent() const
+sal_Bool SwGrfNode::IsTransparent() const
{
- BOOL bRet = aGrfObj.IsTransparent();
+ sal_Bool bRet = aGrfObj.IsTransparent();
if( !bRet ) // ask the attribut
bRet = 0 != GetSwAttrSet().GetTransparencyGrf().GetValue();
@@ -1112,9 +1112,9 @@ BOOL SwGrfNode::IsTransparent() const
}
-BOOL SwGrfNode::IsSelected() const
+sal_Bool SwGrfNode::IsSelected() const
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
const SwEditShell* pESh = GetDoc()->GetEditShell();
if( pESh )
{
@@ -1124,7 +1124,7 @@ BOOL SwGrfNode::IsSelected() const
if( pV->ISA( SwEditShell ) && pN == &((SwCrsrShell*)pV)
->GetCrsr()->GetPoint()->nNode.GetNode() )
{
- bRet = TRUE;
+ bRet = sal_True;
break;
}
}
diff --git a/sw/source/core/inc/GetMetricVal.hxx b/sw/source/core/inc/GetMetricVal.hxx
index f738ff9cdffc..0d897cfa395a 100644
--- a/sw/source/core/inc/GetMetricVal.hxx
+++ b/sw/source/core/inc/GetMetricVal.hxx
@@ -33,14 +33,14 @@
#define CM_05 1 // 0.5 centimeter or 1/4 inch
#define CM_01 2 // 0.1 centimeter or 1/20 inch
-inline USHORT GetMetricVal( int n )
+inline sal_uInt16 GetMetricVal( int n )
{
#ifdef USE_MEASUREMENT
- USHORT nVal = MEASURE_METRIC == SvtSysLocale().GetLocaleData().getMeasurementSystemEnum()
+ sal_uInt16 nVal = MEASURE_METRIC == SvtSysLocale().GetLocaleData().getMeasurementSystemEnum()
? 567 // 1 cm
: 770; // 1/2 Inch
#else
- USHORT nVal = 567; // 1 cm
+ sal_uInt16 nVal = 567; // 1 cm
#endif
if( CM_01 == n )
diff --git a/sw/source/core/inc/SwPortionHandler.hxx b/sw/source/core/inc/SwPortionHandler.hxx
index 50a45e2ab0f3..11888f67a8ae 100644
--- a/sw/source/core/inc/SwPortionHandler.hxx
+++ b/sw/source/core/inc/SwPortionHandler.hxx
@@ -60,8 +60,8 @@ public:
* model string.
*/
virtual void Text(
- USHORT nLength, /// length of this portion in the model string
- USHORT nType /// type of this portion
+ sal_uInt16 nLength, /// length of this portion in the model string
+ sal_uInt16 nType /// type of this portion
) = 0;
/** special portion. This method is called for every non-text
@@ -70,9 +70,9 @@ public:
* the text which is displayed, and the type of the portion.
*/
virtual void Special(
- USHORT nLength, /// length of this portion in the model string
+ sal_uInt16 nLength, /// length of this portion in the model string
const String& rText, /// text which is painted on-screen
- USHORT nType /// type of this portion
+ sal_uInt16 nType /// type of this portion
) = 0;
/** line break. This method is called whenever a line break in the
@@ -89,7 +89,7 @@ public:
* Skip() between portions is not allowed.
*/
virtual void Skip(
- USHORT nLength /// number of 'model string' characters to be skipped
+ sal_uInt16 nLength /// number of 'model string' characters to be skipped
) = 0;
/** end of paragraph. This method is to be called when all the
diff --git a/sw/source/core/inc/SwUndoFmt.hxx b/sw/source/core/inc/SwUndoFmt.hxx
new file mode 100644
index 000000000000..1df5436e7ad2
--- /dev/null
+++ b/sw/source/core/inc/SwUndoFmt.hxx
@@ -0,0 +1,253 @@
+/*************************************************************************
+ *
+ * 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 SW_UNDO_TXT_FMT_COLL_HXX
+#define SW_UNDO_TXT_FMT_COLL_HXX
+
+#include <undobj.hxx>
+#include <swundo.hxx>
+#include <numrule.hxx>
+
+
+class SwDoc;
+class SwTxtFmtColl;
+class String;
+class SwRewriter;
+class SfxItemSet;
+
+class SwUndoFmtCreate : public SwUndo
+{
+protected:
+ SwFmt * pNew;
+ String sDerivedFrom;
+ SwDoc * pDoc;
+ mutable String sNewName;
+ SfxItemSet * pNewSet;
+ sal_uInt16 nId; // FmtId related
+ sal_Bool bAuto;
+
+public:
+
+ SwUndoFmtCreate(SwUndoId nUndoId, SwFmt * pNew, SwFmt * pDerivedFrom,
+ SwDoc * pDoc);
+ virtual ~SwUndoFmtCreate();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+
+ virtual SwRewriter GetRewriter() const;
+
+ virtual SwFmt * Create(SwFmt * pDerivedFrom) = 0;
+ virtual void Delete() = 0;
+ virtual SwFmt * Find(const String & rName) const = 0;
+};
+
+class SwUndoFmtDelete : public SwUndo
+{
+protected:
+ String sDerivedFrom;
+ SwDoc * pDoc;
+ String sOldName;
+ SfxItemSet aOldSet;
+ sal_uInt16 nId; // FmtId related
+ sal_Bool bAuto;
+
+public:
+ SwUndoFmtDelete(SwUndoId nUndoId, SwFmt * pOld, SwDoc * pDoc);
+ ~SwUndoFmtDelete();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+
+ virtual SwRewriter GetRewriter() const;
+
+ virtual SwFmt * Create(SwFmt * pDerivedFrom) = 0;
+ virtual void Delete(SwFmt * pFmt) = 0;
+ virtual SwFmt * Find(const String & rName) const = 0;
+};
+
+class SwUndoRenameFmt : public SwUndo
+{
+protected:
+ String sOldName, sNewName;
+ SwDoc * pDoc;
+// SwUndoId nId;
+
+public:
+ SwUndoRenameFmt(SwUndoId nUndoId, const String & sOldName,
+ const String & sNewName,
+ SwDoc * pDoc);
+ ~SwUndoRenameFmt();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+
+ SwRewriter GetRewriter() const;
+
+ virtual SwFmt * Find(const String & rName) const = 0;
+};
+
+class SwUndoTxtFmtCollCreate : public SwUndoFmtCreate
+{
+public:
+ SwUndoTxtFmtCollCreate(SwTxtFmtColl * pNew, SwTxtFmtColl * pDerivedFrom,
+ SwDoc * pDoc);
+
+ virtual SwFmt * Create(SwFmt * pDerivedFrom);
+ virtual void Delete();
+ virtual SwFmt * Find(const String & rName) const;
+};
+
+class SwUndoTxtFmtCollDelete : public SwUndoFmtDelete
+{
+public:
+ SwUndoTxtFmtCollDelete(SwTxtFmtColl * pOld, SwDoc * pDoc);
+
+ virtual SwFmt * Create(SwFmt * pDerivedFrom);
+ virtual void Delete(SwFmt * pFmt);
+ virtual SwFmt * Find(const String & rName) const;
+};
+
+class SwUndoRenameFmtColl : public SwUndoRenameFmt
+{
+public:
+ SwUndoRenameFmtColl(const String & sOldName,
+ const String & sNewName,
+ SwDoc * pDoc);
+
+ virtual SwFmt * Find(const String & rName) const;
+};
+
+class SwUndoCharFmtCreate : public SwUndoFmtCreate
+{
+public:
+ SwUndoCharFmtCreate(SwCharFmt * pNew, SwCharFmt * pDerivedFrom,
+ SwDoc * pDoc);
+
+ virtual SwFmt * Create(SwFmt * pDerivedFrom);
+ virtual void Delete();
+ virtual SwFmt * Find(const String & rName) const;
+};
+
+class SwUndoCharFmtDelete : public SwUndoFmtDelete
+{
+public:
+ SwUndoCharFmtDelete(SwCharFmt * pOld, SwDoc * pDoc);
+
+ virtual SwFmt * Create(SwFmt * pDerivedFrom);
+ virtual void Delete(SwFmt * pFmt);
+ virtual SwFmt * Find(const String & rName) const;
+};
+
+class SwUndoRenameCharFmt : public SwUndoRenameFmt
+{
+public:
+ SwUndoRenameCharFmt(const String & sOldName,
+ const String & sNewName,
+ SwDoc * pDoc);
+
+ virtual SwFmt * Find(const String & rName) const;
+};
+
+class SwUndoFrmFmtCreate : public SwUndoFmtCreate
+{
+ sal_Bool bAuto;
+
+public:
+ SwUndoFrmFmtCreate(SwFrmFmt * pNew, SwFrmFmt * pDerivedFrom,
+ SwDoc * pDoc);
+
+ virtual SwFmt * Create(SwFmt * pDerivedFrom);
+ virtual void Delete();
+ virtual SwFmt * Find(const String & rName) const;
+};
+
+class SwUndoFrmFmtDelete : public SwUndoFmtDelete
+{
+public:
+ SwUndoFrmFmtDelete(SwFrmFmt * pOld, SwDoc * pDoc);
+
+ virtual SwFmt * Create(SwFmt * pDerivedFrom);
+ virtual void Delete(SwFmt * pFmt);
+ virtual SwFmt * Find(const String & rName) const;
+};
+
+class SwUndoRenameFrmFmt : public SwUndoRenameFmt
+{
+public:
+ SwUndoRenameFrmFmt(const String & sOldName,
+ const String & sNewName,
+ SwDoc * pDoc);
+
+ virtual SwFmt * Find(const String & rName) const;
+};
+
+class SwUndoNumruleCreate : public SwUndo
+{
+ const SwNumRule * pNew;
+ mutable SwNumRule aNew;
+ SwDoc * pDoc;
+ mutable bool bInitialized;
+
+public:
+ SwUndoNumruleCreate(const SwNumRule * pNew, SwDoc * pDoc);
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+
+ SwRewriter GetRewriter() const;
+};
+
+class SwUndoNumruleDelete : public SwUndo
+{
+ SwNumRule aOld;
+ SwDoc * pDoc;
+
+public:
+ SwUndoNumruleDelete(const SwNumRule & aRule, SwDoc * pDoc);
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+
+ SwRewriter GetRewriter() const;
+};
+
+class SwUndoNumruleRename : public SwUndo
+{
+ String aOldName, aNewName;
+ SwDoc * pDoc;
+
+ public:
+ SwUndoNumruleRename(const String & aOldName, const String & aNewName,
+ SwDoc * pDoc);
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+
+ SwRewriter GetRewriter() const;
+};
+
+#endif // SW_UNDO_TXT_FMT_COLL_HXX
diff --git a/sw/source/core/inc/SwUndoPageDesc.hxx b/sw/source/core/inc/SwUndoPageDesc.hxx
new file mode 100644
index 000000000000..1de717a453d6
--- /dev/null
+++ b/sw/source/core/inc/SwUndoPageDesc.hxx
@@ -0,0 +1,93 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef SW_UNDO_PAGE_DESC_HXX
+#define SW_UNDO_PAGE_DESC_HXX
+
+#include <undobj.hxx>
+#include <pagedesc.hxx>
+
+class SwDoc;
+class SwPageDesc;
+
+
+class SwUndoPageDesc : public SwUndo
+{
+ SwPageDescExt aOld, aNew;
+ SwDoc * pDoc;
+ bool bExchange;
+
+ // To avoid duplication of (header/footer)content nodes for simple page desc changes
+ void ExchangeContentNodes( SwPageDesc& rSource, SwPageDesc &rDest );
+
+public:
+ SwUndoPageDesc(const SwPageDesc & aOld, const SwPageDesc & aNew,
+ SwDoc * pDoc);
+ virtual ~SwUndoPageDesc();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+
+ virtual SwRewriter GetRewriter() const;
+};
+
+class SwUndoPageDescCreate : public SwUndo
+{
+ const SwPageDesc * pDesc; // #116530#
+ SwPageDescExt aNew;
+ SwDoc * pDoc;
+
+ void DoImpl();
+
+public:
+ SwUndoPageDescCreate(const SwPageDesc * pNew, SwDoc * pDoc); // #116530#
+ virtual ~SwUndoPageDescCreate();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ virtual SwRewriter GetRewriter() const;
+};
+
+class SwUndoPageDescDelete : public SwUndo
+{
+ SwPageDescExt aOld;
+ SwDoc * pDoc;
+
+ void DoImpl();
+
+public:
+ SwUndoPageDescDelete(const SwPageDesc & aOld, SwDoc * pDoc);
+ virtual ~SwUndoPageDescDelete();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ virtual SwRewriter GetRewriter() const;
+};
+#endif // _SW_UNDO_PAGE_DESC_CHANGE_HXX
diff --git a/sw/source/core/inc/SwUndoTOXChange.hxx b/sw/source/core/inc/SwUndoTOXChange.hxx
new file mode 100644
index 000000000000..5fa221b23979
--- /dev/null
+++ b/sw/source/core/inc/SwUndoTOXChange.hxx
@@ -0,0 +1,49 @@
+/*************************************************************************
+ *
+ * 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 SW_UNDO_TOX_CHANGE_HXX
+#define SW_UNDO_TOX_CHANGE_HXX
+
+#include <undobj.hxx>
+#include <tox.hxx>
+
+class SwUndoTOXChange : public SwUndo
+{
+ SwTOXBase * pTOX, aOld, aNew;
+
+ void UpdateTOXBaseSection();
+ void DoImpl();
+
+public:
+ SwUndoTOXChange(SwTOXBase * pTOX, const SwTOXBase & rNew);
+ virtual ~SwUndoTOXChange();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+};
+
+#endif // SW_UNDO_TOX_CHANGE_HXX
diff --git a/sw/source/core/inc/SwXMLTextBlocks.hxx b/sw/source/core/inc/SwXMLTextBlocks.hxx
index bf88111742b3..8e487a21fc85 100644
--- a/sw/source/core/inc/SwXMLTextBlocks.hxx
+++ b/sw/source/core/inc/SwXMLTextBlocks.hxx
@@ -42,10 +42,10 @@ class SwImpBlocks;
class SwXMLTextBlocks : public SwImpBlocks
{
protected:
- BOOL bAutocorrBlock;
- BOOL bBlock;
+ sal_Bool bAutocorrBlock;
+ sal_Bool bBlock;
SfxObjectShellRef xDocShellRef;
- USHORT nFlags;
+ sal_uInt16 nFlags;
String aPackageName;
SfxMediumRef xMedium;
@@ -60,50 +60,50 @@ public:
short nCurBlk;
SwXMLTextBlocks( const String& rFile );
SwXMLTextBlocks( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >&, const String& rFile );
- void AddName( const String&, const String&, const String&, BOOL bOnlyTxt = FALSE );
- virtual void AddName( const String&, const String&, BOOL bOnlyTxt = FALSE );
+ void AddName( const String&, const String&, const String&, sal_Bool bOnlyTxt = sal_False );
+ virtual void AddName( const String&, const String&, sal_Bool bOnlyTxt = sal_False );
void GeneratePackageName ( const String& rShort, String& rPackageName );
virtual ~SwXMLTextBlocks();
- //virtual BOOL IsOld() const;
- virtual ULONG Delete( USHORT );
- virtual ULONG Rename( USHORT, const String&, const String& );
- virtual ULONG CopyBlock( SwImpBlocks& rImp, String& rShort, const String& rLong);
+ //virtual sal_Bool IsOld() const;
+ virtual sal_uLong Delete( sal_uInt16 );
+ virtual sal_uLong Rename( sal_uInt16, const String&, const String& );
+ virtual sal_uLong CopyBlock( SwImpBlocks& rImp, String& rShort, const String& rLong);
virtual void ClearDoc();
- virtual ULONG GetDoc( USHORT );
- virtual ULONG BeginPutDoc( const String&, const String& );
- virtual ULONG PutDoc();
- virtual ULONG GetText( USHORT, String& );
- virtual ULONG PutText( const String&, const String&, const String& );
- virtual ULONG MakeBlockList();
+ virtual sal_uLong GetDoc( sal_uInt16 );
+ virtual sal_uLong BeginPutDoc( const String&, const String& );
+ virtual sal_uLong PutDoc();
+ virtual sal_uLong GetText( sal_uInt16, String& );
+ virtual sal_uLong PutText( const String&, const String&, const String& );
+ virtual sal_uLong MakeBlockList();
virtual short GetFileType ( void ) const;
- virtual ULONG OpenFile( BOOL bReadOnly = TRUE );
+ virtual sal_uLong OpenFile( sal_Bool bReadOnly = sal_True );
virtual void CloseFile();
- static BOOL IsFileUCBStorage( const String & rFileName);
+ static sal_Bool IsFileUCBStorage( const String & rFileName);
// Methods for the new Autocorrecter
- ULONG GetText( const String& rShort, String& );
+ sal_uLong GetText( const String& rShort, String& );
- virtual BOOL IsOnlyTextBlock( const String& rShort ) const;
- virtual BOOL IsOnlyTextBlock( USHORT nIdx ) const;
- virtual void SetIsTextOnly( const String& rShort, BOOL bNewValue );
- virtual void SetIsTextOnly( USHORT nIdx, BOOL bNewValue );
+ virtual sal_Bool IsOnlyTextBlock( const String& rShort ) const;
+ virtual sal_Bool IsOnlyTextBlock( sal_uInt16 nIdx ) const;
+ virtual void SetIsTextOnly( const String& rShort, sal_Bool bNewValue );
+ virtual void SetIsTextOnly( sal_uInt16 nIdx, sal_Bool bNewValue );
- virtual ULONG GetMacroTable( USHORT, SvxMacroTableDtor& rMacroTbl,
+ virtual sal_uLong GetMacroTable( sal_uInt16, SvxMacroTableDtor& rMacroTbl,
sal_Bool bFileAlreadyOpen = sal_False );
- virtual ULONG SetMacroTable( USHORT nIdx,
+ virtual sal_uLong SetMacroTable( sal_uInt16 nIdx,
const SvxMacroTableDtor& rMacroTable,
sal_Bool bFileAlreadyOpen = sal_False );
- virtual BOOL PutMuchEntries( BOOL bOn );
+ virtual sal_Bool PutMuchEntries( sal_Bool bOn );
public:
SwDoc* GetDoc() const { return pDoc; }
//void SetDoc( SwDoc * pNewDoc);
- ULONG StartPutBlock( const String& rShort, const String& rPackageName );
- ULONG PutBlock( SwPaM& rPaM, const String& rLong );
- ULONG GetBlockText( const String& rShort, String& rText );
- ULONG PutBlockText( const String& rShort, const String& rName, const String& rText, const String& rPackageName );
+ sal_uLong StartPutBlock( const String& rShort, const String& rPackageName );
+ sal_uLong PutBlock( SwPaM& rPaM, const String& rLong );
+ sal_uLong GetBlockText( const String& rShort, String& rText );
+ sal_uLong PutBlockText( const String& rShort, const String& rName, const String& rText, const String& rPackageName );
void MakeBlockText( const String& rText );
};
diff --git a/sw/source/core/inc/UndoAttribute.hxx b/sw/source/core/inc/UndoAttribute.hxx
new file mode 100644
index 000000000000..84423605b5d0
--- /dev/null
+++ b/sw/source/core/inc/UndoAttribute.hxx
@@ -0,0 +1,288 @@
+/*************************************************************************
+ *
+ * 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 SW_UNDO_ATTRIBUTE_HXX
+#define SW_UNDO_ATTRIBUTE_HXX
+
+#include <undobj.hxx>
+
+#include <memory>
+
+#ifndef _SVSTDARR_HXX
+#define _SVSTDARR_USHORTS
+#define _SVSTDARR_ULONGS
+#define _SVSTDARR_BOOLS
+#define _SVSTDARR_BYTES
+#define _SVSTDARR_USHORTSSORT
+#include <svl/svstdarr.hxx>
+#endif
+#include <svl/itemset.hxx>
+
+#include <swtypes.hxx>
+#include <calbck.hxx>
+
+
+class SvxTabStopItem;
+class SwFmt;
+class SwFtnInfo;
+class SwEndNoteInfo;
+
+
+class SwUndoAttr : public SwUndo, private SwUndRng
+{
+ SfxItemSet m_AttrSet; // attributes for Redo
+ const ::std::auto_ptr<SwHistory> m_pHistory; // History for Undo
+ ::std::auto_ptr<SwRedlineData> m_pRedlineData; // Redlining
+ ::std::auto_ptr<SwRedlineSaveDatas> m_pRedlineSaveData;
+ sal_uLong m_nNodeIndex; // Offset: for Redlining
+ const SetAttrMode m_nInsertFlags; // insert flags
+
+ void RemoveIdx( SwDoc& rDoc );
+
+public:
+ SwUndoAttr( const SwPaM&, const SfxItemSet &, const SetAttrMode nFlags );
+ SwUndoAttr( const SwPaM&, const SfxPoolItem&, const SetAttrMode nFlags );
+
+ virtual ~SwUndoAttr();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ void SaveRedlineData( const SwPaM& rPam, sal_Bool bInsCntnt );
+
+ SwHistory& GetHistory() { return *m_pHistory; }
+
+};
+
+class SwUndoResetAttr : public SwUndo, private SwUndRng
+{
+ const ::std::auto_ptr<SwHistory> m_pHistory;
+ SvUShortsSort m_Ids;
+ const sal_uInt16 m_nFormatId; // Format-Id for Redo
+
+public:
+ SwUndoResetAttr( const SwPaM&, sal_uInt16 nFmtId );
+ SwUndoResetAttr( const SwPosition&, sal_uInt16 nFmtId );
+
+ virtual ~SwUndoResetAttr();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ void SetAttrs( const SvUShortsSort& rArr );
+
+ SwHistory& GetHistory() { return *m_pHistory; }
+
+};
+
+class SwUndoFmtAttr : public SwUndo
+{
+ friend class SwUndoDefaultAttr;
+ SwFmt * m_pFmt;
+ ::std::auto_ptr<SfxItemSet> m_pOldSet; // old attributes
+ sal_uLong m_nNodeIndex;
+ const sal_uInt16 m_nFmtWhich;
+ const bool m_bSaveDrawPt;
+
+ bool IsFmtInDoc( SwDoc* ); //is the attribute format still in the Doc?
+ void SaveFlyAnchor( bool bSaveDrawPt = false );
+ // --> OD 2004-10-26 #i35443# - Add return value, type <bool>.
+ // Return value indicates, if anchor attribute is restored.
+ // Notes: - If anchor attribute is restored, all other existing attributes
+ // are also restored.
+ // - Anchor attribute isn't restored successfully, if it contains
+ // an invalid anchor position and all other existing attributes
+ // aren't restored.
+ // This situation occurs for undo of styles.
+ bool RestoreFlyAnchor(::sw::UndoRedoContext & rContext);
+ // <--
+ // --> OD 2008-02-27 #refactorlists# - removed <rAffectedItemSet>
+ void Init();
+ // <--
+
+public:
+ // register at the Format and save old attributes
+ // --> OD 2008-02-27 #refactorlists# - removed <rNewSet>
+ SwUndoFmtAttr( const SfxItemSet& rOldSet,
+ SwFmt& rFmt,
+ bool bSaveDrawPt = true );
+ // <--
+ SwUndoFmtAttr( const SfxPoolItem& rItem,
+ SwFmt& rFmt,
+ bool bSaveDrawPt = true );
+
+ virtual ~SwUndoFmtAttr();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ virtual SwRewriter GetRewriter() const;
+
+ void PutAttr( const SfxPoolItem& rItem );
+ SwFmt* GetFmt( SwDoc& rDoc ); // checks if it is still in the Doc!
+};
+
+// --> OD 2008-02-12 #newlistlevelattrs#
+class SwUndoFmtResetAttr : public SwUndo
+{
+ public:
+ SwUndoFmtResetAttr( SwFmt& rChangedFormat,
+ const sal_uInt16 nWhichId );
+ ~SwUndoFmtResetAttr();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+
+ private:
+ // format at which a certain attribute is reset.
+ SwFmt * const m_pChangedFormat;
+ // which ID of the reset attribute
+ const sal_uInt16 m_nWhichId;
+ // old attribute which has been reset - needed for undo.
+ ::std::auto_ptr<SfxPoolItem> m_pOldItem;
+};
+// <--
+
+class SwUndoDontExpandFmt : public SwUndo
+{
+ const sal_uLong m_nNodeIndex;
+ const xub_StrLen m_nContentIndex;
+
+public:
+ SwUndoDontExpandFmt( const SwPosition& rPos );
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+};
+
+// helper class to receive changed attribute sets
+class SwUndoFmtAttrHelper : public SwClient
+{
+ ::std::auto_ptr<SwUndoFmtAttr> m_pUndo;
+ const bool m_bSaveDrawPt;
+
+public:
+ SwUndoFmtAttrHelper( SwFmt& rFmt, bool bSaveDrawPt = true );
+
+ virtual void Modify( SfxPoolItem*, SfxPoolItem* );
+
+ SwUndoFmtAttr* GetUndo() const { return m_pUndo.get(); }
+ // release the undo object (so it is not deleted here), and return it
+ SwUndoFmtAttr* ReleaseUndo() { return m_pUndo.release(); }
+};
+
+
+class SwUndoMoveLeftMargin : public SwUndo, private SwUndRng
+{
+ const ::std::auto_ptr<SwHistory> m_pHistory;
+ const bool m_bModulus;
+
+public:
+ SwUndoMoveLeftMargin( const SwPaM&, sal_Bool bRight, sal_Bool bModulus );
+
+ virtual ~SwUndoMoveLeftMargin();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ SwHistory& GetHistory() { return *m_pHistory; }
+
+};
+
+
+//--------------------------------------------------------------------
+
+class SwUndoDefaultAttr : public SwUndo
+{
+ ::std::auto_ptr<SfxItemSet> m_pOldSet; // the old attributes
+ ::std::auto_ptr<SvxTabStopItem> m_pTabStop;
+
+public:
+ // registers at the format and saves old attributes
+ SwUndoDefaultAttr( const SfxItemSet& rOldSet );
+
+ virtual ~SwUndoDefaultAttr();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+};
+
+
+//--------------------------------------------------------------------
+
+class SwUndoChangeFootNote : public SwUndo, private SwUndRng
+{
+ const ::std::auto_ptr<SwHistory> m_pHistory;
+ const String m_Text;
+ const sal_uInt16 m_nNumber;
+ const bool m_bEndNote;
+
+public:
+ SwUndoChangeFootNote( const SwPaM& rRange, const String& rTxt,
+ sal_uInt16 nNum, bool bIsEndNote );
+ virtual ~SwUndoChangeFootNote();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ SwHistory& GetHistory() { return *m_pHistory; }
+};
+
+class SwUndoFootNoteInfo : public SwUndo
+{
+ ::std::auto_ptr<SwFtnInfo> m_pFootNoteInfo;
+
+public:
+ SwUndoFootNoteInfo( const SwFtnInfo &rInfo );
+
+ virtual ~SwUndoFootNoteInfo();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+};
+
+class SwUndoEndNoteInfo : public SwUndo
+{
+ ::std::auto_ptr<SwEndNoteInfo> m_pEndNoteInfo;
+
+public:
+ SwUndoEndNoteInfo( const SwEndNoteInfo &rInfo );
+
+ virtual ~SwUndoEndNoteInfo();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+};
+
+#endif // SW_UNDO_ATTRIBUTE_HXX
+
diff --git a/sw/source/core/inc/UndoBookmark.hxx b/sw/source/core/inc/UndoBookmark.hxx
new file mode 100644
index 000000000000..87d774d0c43e
--- /dev/null
+++ b/sw/source/core/inc/UndoBookmark.hxx
@@ -0,0 +1,83 @@
+/*************************************************************************
+ *
+ * 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 SW_UNDO_BOOKMARK_HXX
+#define SW_UNDO_BOOKMARK_HXX
+
+#include <undobj.hxx>
+
+
+class SwHistoryBookmark;
+
+namespace sw {
+ namespace mark {
+ class IMark;
+ }
+}
+
+
+class SwUndoBookmark : public SwUndo
+{
+ const ::std::auto_ptr<SwHistoryBookmark> m_pHistoryBookmark;
+
+protected:
+ SwUndoBookmark( SwUndoId nUndoId, const ::sw::mark::IMark& );
+
+ void SetInDoc( SwDoc* );
+ void ResetInDoc( SwDoc* );
+
+public:
+ virtual ~SwUndoBookmark();
+
+ // #111827#
+ /**
+ Returns the rewriter for this undo object.
+
+ The rewriter contains the following rule:
+
+ $1 -> <name of bookmark>
+
+ <name of bookmark> is the name of the bookmark whose
+ insertion/deletion is recorded by this undo object.
+
+ @return the rewriter for this undo object
+ */
+ virtual SwRewriter GetRewriter() const;
+};
+
+
+class SwUndoInsBookmark : public SwUndoBookmark
+{
+public:
+ SwUndoInsBookmark( const ::sw::mark::IMark& );
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+};
+
+#endif // SW_UNDO_BOOKMARK_HXX
+
diff --git a/sw/source/core/inc/UndoCore.hxx b/sw/source/core/inc/UndoCore.hxx
new file mode 100644
index 000000000000..41e89dcdd518
--- /dev/null
+++ b/sw/source/core/inc/UndoCore.hxx
@@ -0,0 +1,263 @@
+/*************************************************************************
+ *
+ * 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 SW_UNDOCORE_HXX
+#define SW_UNDOCORE_HXX
+
+#include <undobj.hxx>
+
+#include <calbck.hxx>
+
+
+class SfxItemSet;
+class SwFmtColl;
+class SwFmtAnchor;
+class SdrMarkList;
+class SwUndoDelete;
+class SwRedlineSaveData;
+
+namespace sw {
+ class UndoManager;
+ class IShellCursorSupplier;
+}
+
+
+typedef SwRedlineSaveData* SwRedlineSaveDataPtr;
+SV_DECL_PTRARR_DEL( SwRedlineSaveDatas, SwRedlineSaveDataPtr, 8, 8 )
+
+
+namespace sw {
+
+class SW_DLLPRIVATE UndoRedoContext
+ : public SfxUndoContext
+{
+public:
+ UndoRedoContext(SwDoc & rDoc, IShellCursorSupplier & rCursorSupplier)
+ : m_rDoc(rDoc)
+ , m_rCursorSupplier(rCursorSupplier)
+ , m_pSelFmt(0)
+ , m_pMarkList(0)
+ { }
+
+ SwDoc & GetDoc() const { return m_rDoc; }
+
+ IShellCursorSupplier & GetCursorSupplier() { return m_rCursorSupplier; }
+
+ void SetSelections(SwFrmFmt *const pSelFmt, SdrMarkList *const pMarkList)
+ {
+ m_pSelFmt = pSelFmt;
+ m_pMarkList = pMarkList;
+ }
+ void GetSelections(SwFrmFmt *& o_rpSelFmt, SdrMarkList *& o_rpMarkList)
+ {
+ o_rpSelFmt = m_pSelFmt;
+ o_rpMarkList = m_pMarkList;
+ }
+
+private:
+ SwDoc & m_rDoc;
+ IShellCursorSupplier & m_rCursorSupplier;
+ SwFrmFmt * m_pSelFmt;
+ SdrMarkList * m_pMarkList;
+};
+
+class SW_DLLPRIVATE RepeatContext
+ : public SfxRepeatTarget
+{
+public:
+ RepeatContext(SwDoc & rDoc, SwPaM & rPaM)
+ : m_rDoc(rDoc)
+ , m_pCurrentPaM(& rPaM)
+ , m_bDeleteRepeated(false)
+ { }
+
+ SwDoc & GetDoc() const { return m_rDoc; }
+
+ SwPaM & GetRepeatPaM()
+ {
+ return *m_pCurrentPaM;
+ }
+
+private:
+ friend class ::sw::UndoManager;
+ friend class ::SwUndoDelete;
+
+ SwDoc & m_rDoc;
+ SwPaM * m_pCurrentPaM;
+ bool m_bDeleteRepeated; /// has a delete action been repeated?
+};
+
+} // namespace sw
+
+
+
+class SwUndoFmtColl : public SwUndo, private SwUndRng
+{
+ String aFmtName;
+ SwHistory* pHistory;
+ SwFmtColl* pFmtColl;
+ // --> OD 2008-04-15 #refactorlists# - for correct <ReDo(..)> and <Repeat(..)>
+ // boolean, which indicates that the attributes are reseted at the nodes
+ // before the format has been applied.
+ const bool mbReset;
+ // boolean, which indicates that the list attributes had been reseted at
+ // the nodes before the format has been applied.
+ const bool mbResetListAttrs;
+ // <--
+
+ void DoSetFmtColl(SwDoc & rDoc, SwPaM & rPaM);
+
+public:
+ // --> OD 2008-04-15 #refactorlists#
+// SwUndoFmtColl( const SwPaM&, SwFmtColl* );
+ SwUndoFmtColl( const SwPaM&, SwFmtColl*,
+ const bool bReset,
+ const bool bResetListAttrs );
+ // <--
+ virtual ~SwUndoFmtColl();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ // #111827#
+ /**
+ Returns the rewriter for this undo object.
+
+ The rewriter contains one rule:
+
+ $1 -> <name of format collection>
+
+ <name of format collection> is the name of the format
+ collection that is applied by the action recorded by this undo
+ object.
+
+ @return the rewriter for this undo object
+ */
+ virtual SwRewriter GetRewriter() const;
+
+ SwHistory* GetHistory() { return pHistory; }
+
+};
+
+
+class SwUndoSetFlyFmt : public SwUndo, public SwClient
+{
+ SwFrmFmt* pFrmFmt; // das gespeicherte FlyFormat
+ SwFrmFmt* pOldFmt; // die alte Fly Vorlage
+ SwFrmFmt* pNewFmt; // die neue Fly Vorlage
+ SfxItemSet* pItemSet; // die zurueck-/ gesetzten Attribute
+ sal_uLong nOldNode, nNewNode;
+ xub_StrLen nOldCntnt, nNewCntnt;
+ sal_uInt16 nOldAnchorTyp, nNewAnchorTyp;
+ sal_Bool bAnchorChgd;
+
+ void PutAttr( sal_uInt16 nWhich, const SfxPoolItem* pItem );
+ void Modify( SfxPoolItem*, SfxPoolItem* );
+ void GetAnchor( SwFmtAnchor& rAnhor, sal_uLong nNode, xub_StrLen nCntnt );
+
+public:
+ SwUndoSetFlyFmt( SwFrmFmt& rFlyFmt, SwFrmFmt& rNewFrmFmt );
+ virtual ~SwUndoSetFlyFmt();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+
+ virtual SwRewriter GetRewriter() const;
+};
+
+
+//------------ Undo von verschieben/stufen von Gliederung ----------------
+
+class SwUndoOutlineLeftRight : public SwUndo, private SwUndRng
+{
+ short nOffset;
+public:
+ SwUndoOutlineLeftRight( const SwPaM& rPam, short nOffset );
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+};
+
+
+//--------------------------------------------------------------------
+
+// -> #111827#
+const int nUndoStringLength = 20;
+
+/**
+ Shortens a string to a maximum length.
+
+ @param rStr the string to be shortened
+ @param nLength the maximum length for rStr
+ @param rFillStr string to replace cut out characters with
+
+ If rStr has less than nLength characters it will be returned unaltered.
+
+ If rStr has more than nLength characters the following algorithm
+ generates the shortened string:
+
+ frontLength = (nLength - length(rFillStr)) / 2
+ rearLength = nLength - length(rFillStr) - frontLength
+ shortenedString = concat(<first frontLength characters of rStr,
+ rFillStr,
+ <last rearLength characters of rStr>)
+
+ Preconditions:
+ - nLength - length(rFillStr) >= 2
+
+ @return the shortened string
+ */
+String
+ShortenString(const String & rStr, xub_StrLen nLength, const String & rFillStr);
+// <- #111827#
+
+// #16487#
+/**
+ Denotes special characters in a string.
+
+ The rStr is split into parts containing special characters and
+ parts not containing special characters. In a part containing
+ special characters all characters are equal. These parts are
+ maximal.
+
+ @param rStr the string to denote in
+
+ The resulting string is generated by concatenating the found
+ parts. The parts without special characters are surrounded by
+ "'". The parts containing special characters are denoted as "n x",
+ where n is the length of the part and x is the representation of
+ the special character (i. e. "tab(s)").
+
+ @return the denoted string
+*/
+String DenoteSpecialCharacters(const String & rStr);
+
+
+#endif // SW_UNDOCORE_HXX
+
diff --git a/sw/source/core/inc/UndoDelete.hxx b/sw/source/core/inc/UndoDelete.hxx
new file mode 100644
index 000000000000..7bdfb79c633d
--- /dev/null
+++ b/sw/source/core/inc/UndoDelete.hxx
@@ -0,0 +1,115 @@
+/*************************************************************************
+ *
+ * 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 SW_UNDO_DELETE_HXX
+#define SW_UNDO_DELETE_HXX
+
+#include <undobj.hxx>
+
+#include <tools/mempool.hxx>
+
+
+class SwRedlineSaveDatas;
+class SwTxtNode;
+
+namespace sfx2 {
+ class MetadatableUndo;
+}
+
+
+class SwUndoDelete
+ : public SwUndo
+ , private SwUndRng
+ , private SwUndoSaveCntnt
+{
+ SwNodeIndex* pMvStt; // Position of Nodes in UndoNodes-Array
+ String *pSttStr, *pEndStr;
+ SwRedlineData* pRedlData;
+ SwRedlineSaveDatas* pRedlSaveData;
+ ::boost::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndoStart;
+ ::boost::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndoEnd;
+
+ String sTableName;
+
+ sal_uLong nNode;
+ sal_uLong nNdDiff; // difference of Nodes before/after Delete
+ sal_uLong nSectDiff; // diff. of Nodes before/after Move w/ SectionNodes
+ sal_uLong nReplaceDummy; // diff. to a temporary dummy object
+ sal_uInt16 nSetPos;
+
+ sal_Bool bGroup : 1; // TRUE: is already Grouped; see CanGrouping()
+ sal_Bool bBackSp : 1; // TRUE: if Grouped and preceding content deleted
+ sal_Bool bJoinNext: 1; // TRUE: if range is selected forwards
+ sal_Bool bTblDelLastNd : 1; // TRUE: TextNode following Table inserted/deleted
+ sal_Bool bDelFullPara : 1; // TRUE: entire Nodes were deleted
+ sal_Bool bResetPgDesc : 1; // TRUE: reset PgDsc on following node
+ sal_Bool bResetPgBrk : 1; // TRUE: reset PgBreak on following node
+ sal_Bool bFromTableCopy : 1; // TRUE: called by SwUndoTblCpyTbl
+
+ sal_Bool SaveCntnt( const SwPosition* pStt, const SwPosition* pEnd,
+ SwTxtNode* pSttTxtNd, SwTxtNode* pEndTxtNd );
+public:
+ SwUndoDelete( SwPaM&,
+ sal_Bool bFullPara = sal_False, sal_Bool bCalledByTblCpy = sal_False );
+ virtual ~SwUndoDelete();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ // #111827#
+ /**
+ Returns rewriter for this undo object.
+
+ The rewriter consists of the following rule:
+
+ $1 -> '<deleted text>'
+
+ <deleted text> is shortened to nUndoStringLength characters.
+
+ @return rewriter for this undo object
+ */
+ virtual SwRewriter GetRewriter() const;
+
+ sal_Bool CanGrouping( SwDoc*, const SwPaM& );
+
+ void SetTblDelLastNd() { bTblDelLastNd = sal_True; }
+
+ // for PageDesc/PageBreak Attributes of a table
+ void SetPgBrkFlags( sal_Bool bPageBreak, sal_Bool bPageDesc )
+ { bResetPgDesc = bPageDesc; bResetPgBrk = bPageBreak; }
+
+ void SetTableName(const String & rName);
+
+ // SwUndoTblCpyTbl needs this information:
+ sal_Bool IsDelFullPara() const { return bDelFullPara; }
+
+ DECL_FIXEDMEMPOOL_NEWDEL(SwUndoDelete)
+};
+
+#endif // SW_UNDO_DELETE_HXX
+
diff --git a/sw/source/core/inc/UndoDraw.hxx b/sw/source/core/inc/UndoDraw.hxx
new file mode 100644
index 000000000000..9d490901c02b
--- /dev/null
+++ b/sw/source/core/inc/UndoDraw.hxx
@@ -0,0 +1,150 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef SW_UNDO_DRAW_HXX
+#define SW_UNDO_DRAW_HXX
+
+#include <undobj.hxx>
+
+#include <svx/svdundo.hxx>
+
+
+struct SwUndoGroupObjImpl;
+class SdrMark;
+class SdrMarkList;
+class SdrObject;
+class SdrObjGroup;
+class SdrUndoAction;
+class SwDrawFrmFmt;
+
+
+
+//--------------------------------------------------------------------
+// ----------- Undo for Draw Objects ---------------------------------
+
+class SwSdrUndo : public SwUndo
+{
+ SdrUndoAction* pSdrUndo;
+ SdrMarkList* pMarkList; // MarkList for all selected SdrObjects
+public:
+ SwSdrUndo( SdrUndoAction* , const SdrMarkList* pMarkList );
+
+ virtual ~SwSdrUndo();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+
+ String GetComment() const;
+};
+
+class SwUndoDrawGroup : public SwUndo
+{
+ SwUndoGroupObjImpl* pObjArr;
+ sal_uInt16 nSize;
+ sal_Bool bDelFmt;
+
+public:
+ SwUndoDrawGroup( sal_uInt16 nCnt );
+
+ virtual ~SwUndoDrawGroup();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+
+ void AddObj( sal_uInt16 nPos, SwDrawFrmFmt*, SdrObject* );
+ void SetGroupFmt( SwDrawFrmFmt* );
+};
+
+// --> OD 2006-11-01 #130889#
+// Action "ungroup drawing object" is now splitted into three parts - see
+// method <SwDoc::UnGroupSelection(..)>:
+// - creation for <SwDrawFrmFmt> instances for the group members of the
+// selected group objects
+// - intrinsic ungroup of the selected group objects
+// - creation of <SwDrawContact> instances for the former group members and
+// connection to the Writer layout.
+// Thus, two undo actions (instances of <SwUndo>) are needed:
+// - Existing class <SwUndoDrawUnGroup> takes over the part for the formats.
+// - New class <SwUndoDrawUnGroupConnectToLayout> takes over the part for
+// contact object.
+class SwUndoDrawUnGroup : public SwUndo
+{
+ SwUndoGroupObjImpl* pObjArr;
+ sal_uInt16 nSize;
+ sal_Bool bDelFmt;
+
+public:
+ SwUndoDrawUnGroup( SdrObjGroup* );
+
+ virtual ~SwUndoDrawUnGroup();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+
+ void AddObj( sal_uInt16 nPos, SwDrawFrmFmt* );
+};
+
+// --> OD 2006-11-01 #130889#
+class SwUndoDrawUnGroupConnectToLayout : public SwUndo
+{
+ private:
+ std::vector< std::pair< SwDrawFrmFmt*, SdrObject* > > aDrawFmtsAndObjs;
+
+ public:
+ SwUndoDrawUnGroupConnectToLayout();
+
+ virtual ~SwUndoDrawUnGroupConnectToLayout();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+
+ void AddFmtAndObj( SwDrawFrmFmt* pDrawFrmFmt,
+ SdrObject* pDrawObject );
+};
+// <--
+
+
+class SwUndoDrawDelete : public SwUndo
+{
+ SwUndoGroupObjImpl* pObjArr;
+ SdrMarkList* pMarkLst; // MarkList for all selected SdrObjects
+ sal_uInt16 nSize;
+ sal_Bool bDelFmt;
+
+public:
+ SwUndoDrawDelete( sal_uInt16 nCnt );
+
+ virtual ~SwUndoDrawDelete();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+
+ void AddObj( sal_uInt16 nPos, SwDrawFrmFmt*, const SdrMark& );
+};
+
+#endif // SW_UNDO_DRAW_HXX
+
diff --git a/sw/source/core/inc/UndoInsert.hxx b/sw/source/core/inc/UndoInsert.hxx
new file mode 100644
index 000000000000..a39ba329fdc1
--- /dev/null
+++ b/sw/source/core/inc/UndoInsert.hxx
@@ -0,0 +1,235 @@
+/*************************************************************************
+ *
+ * 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 SW_UNDO_INSERT_HXX
+#define SW_UNDO_INSERT_HXX
+
+#include <undobj.hxx>
+
+#include <tools/mempool.hxx>
+
+#include <swtypes.hxx>
+#include <IDocumentContentOperations.hxx>
+
+
+class Graphic;
+class SwGrfNode;
+class SwUndoDelete;
+class SwUndoFmtAttr;
+
+
+class SwUndoInsert: public SwUndo, private SwUndoSaveCntnt
+{
+ SwPosition *pPos; // Inhalt fuers Redo
+ String *pTxt, *pUndoTxt;
+ SwRedlineData* pRedlData;
+ sal_uLong nNode;
+ xub_StrLen nCntnt, nLen;
+ sal_Bool bIsWordDelim : 1;
+ sal_Bool bIsAppend : 1;
+
+ const IDocumentContentOperations::InsertFlags m_nInsertFlags;
+
+ friend class SwDoc; // eigentlich nur SwDoc::Insert( String )
+ sal_Bool CanGrouping( sal_Unicode cIns );
+ sal_Bool CanGrouping( const SwPosition& rPos );
+
+ SwDoc * pDoc;
+
+ void Init(const SwNodeIndex & rNode);
+ String * GetTxtFromDoc() const;
+
+public:
+ SwUndoInsert( const SwNodeIndex& rNode, xub_StrLen nCntnt, xub_StrLen nLen,
+ const IDocumentContentOperations::InsertFlags nInsertFlags,
+ sal_Bool bWDelim = sal_True );
+ SwUndoInsert( const SwNodeIndex& rNode );
+ virtual ~SwUndoInsert();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ // #111827#
+ /**
+ Returns rewriter for this undo object.
+
+ The returned rewriter has the following rule:
+
+ $1 -> '<inserted text>'
+
+ <inserted text> is shortened to a length of nUndoStringLength.
+
+ @return rewriter for this undo object
+ */
+ virtual SwRewriter GetRewriter() const;
+
+
+ DECL_FIXEDMEMPOOL_NEWDEL(SwUndoInsert)
+};
+
+
+//--------------------------------------------------------------------
+
+SwRewriter SW_DLLPRIVATE
+MakeUndoReplaceRewriter(sal_uLong const ocurrences,
+ ::rtl::OUString const& sOld, ::rtl::OUString const& sNew);
+
+class SwUndoReplace
+ : public SwUndo
+{
+public:
+ SwUndoReplace(SwPaM const& rPam,
+ ::rtl::OUString const& rInsert, bool const bRegExp);
+
+ virtual ~SwUndoReplace();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+
+ // #111827#
+ /**
+ Returns the rewriter of this undo object.
+
+ If this undo object represents several replacements the
+ rewriter contains the following rules:
+
+ $1 -> <number of replacements>
+ $2 -> occurrences of
+ $3 -> <replaced text>
+
+ If this undo object represents one replacement the rewriter
+ contains these rules:
+
+ $1 -> <replaced text>
+ $2 -> "->" (STR_YIELDS)
+ $3 -> <replacing text>
+
+ @return the rewriter of this undo object
+ */
+ virtual SwRewriter GetRewriter() const;
+
+ void SetEnd( const SwPaM& rPam );
+
+private:
+ class Impl;
+ ::std::auto_ptr<Impl> m_pImpl;
+};
+
+
+//--------------------------------------------------------------------
+
+class SwUndoReRead : public SwUndo
+{
+ Graphic *pGrf;
+ String *pNm, *pFltr;
+ sal_uLong nPos;
+ sal_uInt16 nMirr;
+
+ void SaveGraphicData( const SwGrfNode& );
+ void SetAndSave( ::sw::UndoRedoContext & );
+
+public:
+ SwUndoReRead( const SwPaM& rPam, const SwGrfNode& pGrfNd );
+
+ virtual ~SwUndoReRead();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+};
+
+//--------------------------------------------------------------------
+
+class SwUndoInsertLabel : public SwUndo
+{
+ union {
+ struct {
+ // fuer NoTxtFrms
+ SwUndoInsLayFmt* pUndoFly;
+ SwUndoFmtAttr* pUndoAttr;
+ } OBJECT;
+ struct {
+ // fuer Tabelle/TextRahmen
+ SwUndoDelete* pUndoInsNd;
+ sal_uLong nNode;
+ } NODE;
+ };
+
+ String sText;
+ // --> PB 2005-01-06 #i39983# the separator is drawn with a character style
+ String sSeparator;
+ // <--
+ String sNumberSeparator;
+ String sCharacterStyle;
+ // OD 2004-04-15 #i26791# - re-store of drawing object position no longer needed
+ sal_uInt16 nFldId;
+ SwLabelType eType;
+ sal_uInt8 nLayerId; // fuer Zeichen-Objekte
+ sal_Bool bBefore :1;
+ sal_Bool bUndoKeep :1;
+ sal_Bool bCpyBrd :1;
+
+public:
+ SwUndoInsertLabel( const SwLabelType eTyp, const String &rText,
+ // --> PB 2005-01-06 #i39983# the separator is drawn with a character style
+ const String& rSeparator,
+ // <--
+ const String& rNumberSeparator, //#i61007# order of captions
+ const sal_Bool bBefore, const sal_uInt16 nId,
+ const String& rCharacterStyle,
+ const sal_Bool bCpyBrd );
+ virtual ~SwUndoInsertLabel();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ // #111827#
+ /**
+ Returns the rewriter of this undo object.
+
+ The rewriter contains this rule:
+
+ $1 -> '<text of inserted label>'
+
+ <text of inserted label> is shortened to nUndoStringLength
+ characters.
+
+ @return the rewriter of this undo object
+ */
+ virtual SwRewriter GetRewriter() const;
+
+ void SetNodePos( sal_uLong nNd )
+ { if( LTYPE_OBJECT != eType ) NODE.nNode = nNd; }
+
+ void SetUndoKeep() { bUndoKeep = sal_True; }
+ void SetFlys( SwFrmFmt& rOldFly, SfxItemSet& rChgSet, SwFrmFmt& rNewFly );
+ void SetDrawObj( sal_uInt8 nLayerId );
+};
+
+#endif // SW_UNDO_INSERT_HXX
+
diff --git a/sw/source/core/inc/UndoManager.hxx b/sw/source/core/inc/UndoManager.hxx
new file mode 100644
index 000000000000..0f734d17abfa
--- /dev/null
+++ b/sw/source/core/inc/UndoManager.hxx
@@ -0,0 +1,124 @@
+/*************************************************************************
+ *
+ * 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 SW_UNDO_MANAGER_HXX
+#define SW_UNDO_MANAGER_HXX
+
+#include <IDocumentUndoRedo.hxx>
+
+#include <memory>
+
+#include <svl/undo.hxx>
+
+
+class IDocumentDrawModelAccess;
+class IDocumentRedlineAccess;
+class IDocumentState;
+
+
+namespace sw {
+
+class UndoManager
+ : public IDocumentUndoRedo
+ , public SfxUndoManager
+{
+public:
+
+ UndoManager(::std::auto_ptr<SwNodes> pUndoNodes,
+ IDocumentDrawModelAccess & rDrawModelAccess,
+ IDocumentRedlineAccess & rRedlineAccess,
+ IDocumentState & rState);
+
+ /** IDocumentUndoRedo */
+ virtual void DoUndo(bool const bDoUndo);
+ virtual bool DoesUndo() const;
+ virtual void DoGroupUndo(bool const bDoUndo);
+ virtual bool DoesGroupUndo() const;
+ virtual void DoDrawUndo(bool const bDoUndo);
+ virtual bool DoesDrawUndo() const;
+ virtual void SetUndoNoModifiedPosition();
+ virtual void LockUndoNoModifiedPosition();
+ virtual void UnLockUndoNoModifiedPosition();
+ virtual void SetUndoNoResetModified();
+ virtual bool IsUndoNoResetModified() const;
+// virtual bool Undo();
+ virtual SwUndoId StartUndo(SwUndoId const eUndoId,
+ SwRewriter const*const pRewriter);
+ virtual SwUndoId EndUndo(SwUndoId const eUndoId,
+ SwRewriter const*const pRewriter);
+ virtual void DelAllUndoObj();
+ virtual bool GetLastUndoInfo(::rtl::OUString *const o_pStr,
+ SwUndoId *const o_pId) const;
+ virtual SwUndoComments_t GetUndoComments() const;
+// virtual bool Redo();
+ virtual bool GetFirstRedoInfo(::rtl::OUString *const o_pStr) const;
+ virtual SwUndoComments_t GetRedoComments() const;
+ virtual bool Repeat(::sw::RepeatContext & rContext,
+ sal_uInt16 const nRepeatCnt);
+ virtual SwUndoId GetRepeatInfo(::rtl::OUString *const o_pStr) const;
+ virtual void AppendUndo(SwUndo *const pUndo);
+ virtual void ClearRedo();
+ virtual bool IsUndoNodes(SwNodes const& rNodes) const;
+
+ // ::svl::IUndoManager
+ virtual void AddUndoAction(SfxUndoAction *pAction,
+ sal_Bool bTryMerg = sal_False);
+ virtual sal_Bool Undo();
+ virtual sal_Bool Redo();
+ virtual void EnableUndo(bool bEnable);
+
+ SwUndo * RemoveLastUndo();
+ SwUndo * GetLastUndo();
+
+ SwNodes const& GetUndoNodes() const;
+ SwNodes & GetUndoNodes();
+
+private:
+ IDocumentDrawModelAccess & m_rDrawModelAccess;
+ IDocumentRedlineAccess & m_rRedlineAccess;
+ IDocumentState & m_rState;
+
+ /// Undo nodes array: content not currently in document
+ ::std::auto_ptr<SwNodes> m_pUndoNodes;
+
+ bool m_bGroupUndo : 1; // TRUE: Undo grouping enabled
+ bool m_bDrawUndo : 1; // TRUE: Draw Undo enabled
+ bool m_bLockUndoNoModifiedPosition : 1;
+ /// position in Undo-Array at which Doc was saved (and is not modified)
+ UndoStackMark m_UndoSaveMark;
+
+ typedef enum { UNDO = true, REDO = false } UndoOrRedo_t;
+ bool impl_DoUndoRedo(UndoOrRedo_t const undoOrRedo);
+
+ // UGLY: should not be called
+ using SfxUndoManager::Repeat;
+};
+
+} // namespace sw
+
+#endif // SW_UNDO_MANAGER_HXX
+
diff --git a/sw/source/core/inc/UndoNumbering.hxx b/sw/source/core/inc/UndoNumbering.hxx
new file mode 100644
index 000000000000..8680dcaa3e59
--- /dev/null
+++ b/sw/source/core/inc/UndoNumbering.hxx
@@ -0,0 +1,154 @@
+/*************************************************************************
+ *
+ * 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 SW_UNDO_NUMBERING_HXX
+#define SW_UNDO_NUMBERING_HXX
+
+#include <undobj.hxx>
+
+#ifndef _SVSTDARR_HXX
+#define _SVSTDARR_USHORTS
+#define _SVSTDARR_ULONGS
+#define _SVSTDARR_BOOLS
+#define _SVSTDARR_BYTES
+#define _SVSTDARR_USHORTSSORT
+#include <svl/svstdarr.hxx>
+#endif
+
+#include <numrule.hxx>
+
+
+//--------------------------------------------------------------------
+//----------- Undo for Numbering -------------------------------------
+
+class SwUndoInsNum : public SwUndo, private SwUndRng
+{
+ SwNumRule aNumRule;
+ SwHistory* pHistory;
+ sal_uLong nSttSet;
+ SwNumRule* pOldNumRule;
+ String sReplaceRule;
+ sal_uInt16 nLRSavePos;
+public:
+ SwUndoInsNum( const SwPaM& rPam, const SwNumRule& rRule );
+ SwUndoInsNum( const SwNumRule& rOldRule, const SwNumRule& rNewRule,
+ SwUndoId nUndoId = UNDO_INSFMTATTR );
+ SwUndoInsNum( const SwPosition& rPos, const SwNumRule& rRule,
+ const String& rReplaceRule );
+
+ virtual ~SwUndoInsNum();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ virtual SwRewriter GetRewriter() const;
+
+ SwHistory* GetHistory(); // will be created if necessary
+ void SetSttNum( sal_uLong nNdIdx ) { nSttSet = nNdIdx; }
+ void SaveOldNumRule( const SwNumRule& rOld );
+
+ void SetLRSpaceEndPos();
+
+};
+
+class SwUndoDelNum : public SwUndo, private SwUndRng
+{
+ SvULongs aNodeIdx;
+ SvBytes aLevels;
+ SvBools aRstLRSpaces;
+ SwHistory* pHistory;
+public:
+ SwUndoDelNum( const SwPaM& rPam );
+
+ virtual ~SwUndoDelNum();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ void AddNode( const SwTxtNode& rNd, sal_Bool bResetLRSpace );
+ SwHistory* GetHistory() { return pHistory; }
+
+};
+
+class SwUndoMoveNum : public SwUndo, private SwUndRng
+{
+ sal_uLong nNewStt;
+ long nOffset;
+public:
+ SwUndoMoveNum( const SwPaM& rPam, long nOffset, sal_Bool bIsOutlMv = sal_False );
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ void SetStartNode( sal_uLong nValue ) { nNewStt = nValue; }
+};
+
+class SwUndoNumUpDown : public SwUndo, private SwUndRng
+{
+ short nOffset;
+public:
+ SwUndoNumUpDown( const SwPaM& rPam, short nOffset );
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+};
+
+class SwUndoNumOrNoNum : public SwUndo
+{
+ sal_uLong nIdx;
+ sal_Bool mbNewNum, mbOldNum;
+
+public:
+ SwUndoNumOrNoNum( const SwNodeIndex& rIdx, sal_Bool mbOldNum,
+ sal_Bool mbNewNum );
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+};
+
+class SwUndoNumRuleStart : public SwUndo
+{
+ sal_uLong nIdx;
+ sal_uInt16 nOldStt, nNewStt;
+ sal_Bool bSetSttValue : 1;
+ sal_Bool bFlag : 1;
+public:
+ SwUndoNumRuleStart( const SwPosition& rPos, sal_Bool bDelete );
+ SwUndoNumRuleStart( const SwPosition& rPos, sal_uInt16 nStt );
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+};
+
+#endif // SW_UNDO_NUMBERING_HXX
+
diff --git a/sw/source/core/inc/UndoOverwrite.hxx b/sw/source/core/inc/UndoOverwrite.hxx
new file mode 100644
index 000000000000..151de9b344c1
--- /dev/null
+++ b/sw/source/core/inc/UndoOverwrite.hxx
@@ -0,0 +1,105 @@
+/*************************************************************************
+ *
+ * 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 SW_UNDO_OVERWRITE_HXX
+#define SW_UNDO_OVERWRITE_HXX
+
+#include <undobj.hxx>
+
+#include <com/sun/star/uno/Sequence.h>
+
+
+class SwRedlineSaveDatas;
+class SwTxtNode;
+
+namespace utl {
+ class TransliterationWrapper;
+}
+
+
+class SwUndoOverwrite: public SwUndo, private SwUndoSaveCntnt
+{
+ String aDelStr, aInsStr;
+ SwRedlineSaveDatas* pRedlSaveData;
+ sal_uLong nSttNode;
+ xub_StrLen nSttCntnt;
+ sal_Bool bInsChar : 1; // no Overwrite, but Insert
+ sal_Bool bGroup : 1; // TRUE: is already grouped; evaluated in CanGrouping()
+
+public:
+ SwUndoOverwrite( SwDoc*, SwPosition&, sal_Unicode cIns );
+
+ virtual ~SwUndoOverwrite();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ // #111827#
+ /**
+ Returns the rewriter of this undo object.
+
+ The rewriter contains the following rule:
+
+ $1 -> '<overwritten text>'
+
+ <overwritten text> is shortened to nUndoStringLength characters.
+
+ @return the rewriter of this undo object
+ */
+ virtual SwRewriter GetRewriter() const;
+
+ sal_Bool CanGrouping( SwDoc*, SwPosition&, sal_Unicode cIns );
+};
+
+//--------------------------------------------------------------------
+
+struct _UndoTransliterate_Data;
+class SwUndoTransliterate : public SwUndo, public SwUndRng
+{
+ std::vector< _UndoTransliterate_Data * > aChanges;
+ sal_uInt32 nType;
+
+ void DoTransliterate(SwDoc & rDoc, SwPaM & rPam);
+
+public:
+ SwUndoTransliterate( const SwPaM& rPam,
+ const utl::TransliterationWrapper& rTrans );
+
+ virtual ~SwUndoTransliterate();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ void AddChanges( SwTxtNode& rTNd, xub_StrLen nStart, xub_StrLen nLen,
+ ::com::sun::star::uno::Sequence <sal_Int32>& rOffsets );
+ sal_Bool HasData() const { return aChanges.size() > 0; }
+};
+
+#endif // SW_UNDO_OVERWRITE_HXX
+
diff --git a/sw/source/core/inc/UndoRedline.hxx b/sw/source/core/inc/UndoRedline.hxx
new file mode 100644
index 000000000000..57b0df0867b9
--- /dev/null
+++ b/sw/source/core/inc/UndoRedline.hxx
@@ -0,0 +1,145 @@
+/*************************************************************************
+ *
+ * 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 SW_UNDO_REDLINE_HXX
+#define SW_UNDO_REDLINE_HXX
+
+#include <undobj.hxx>
+
+
+struct SwSortOptions;
+class SwRedline;
+class SwRedlineSaveDatas;
+class SwUndoDelete;
+
+
+//--------------------------------------------------------------------
+
+class SwUndoRedline : public SwUndo, public SwUndRng
+{
+protected:
+ SwRedlineData* pRedlData;
+ SwRedlineSaveDatas* pRedlSaveData;
+ SwUndoId nUserId;
+ sal_Bool bHiddenRedlines;
+
+ virtual void UndoRedlineImpl(SwDoc & rDoc, SwPaM & rPam);
+ virtual void RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam);
+
+public:
+ SwUndoRedline( SwUndoId nUserId, const SwPaM& rRange );
+
+ virtual ~SwUndoRedline();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+
+ SwUndoId GetUserId() const { return nUserId; }
+ sal_uInt16 GetRedlSaveCount() const;
+};
+
+class SwUndoRedlineDelete : public SwUndoRedline
+{
+ sal_Bool bCanGroup : 1;
+ sal_Bool bIsDelim : 1;
+ sal_Bool bIsBackspace : 1;
+
+ virtual void UndoRedlineImpl(SwDoc & rDoc, SwPaM & rPam);
+ virtual void RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam);
+
+public:
+ SwUndoRedlineDelete( const SwPaM& rRange, SwUndoId nUserId = UNDO_EMPTY );
+
+ sal_Bool CanGrouping( const SwUndoRedlineDelete& rPrev );
+
+ // SwUndoTblCpyTbl needs this information:
+ long NodeDiff() const { return nSttNode - nEndNode; }
+ xub_StrLen ContentStart() const { return nSttCntnt; }
+};
+
+class SwUndoRedlineSort : public SwUndoRedline
+{
+ SwSortOptions* pOpt;
+ sal_uLong nSaveEndNode, nOffset;
+ xub_StrLen nSaveEndCntnt;
+
+ virtual void UndoRedlineImpl(SwDoc & rDoc, SwPaM & rPam);
+ virtual void RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam);
+
+public:
+ SwUndoRedlineSort( const SwPaM& rRange, const SwSortOptions& rOpt );
+
+ virtual ~SwUndoRedlineSort();
+
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ void SetSaveRange( const SwPaM& rRange );
+ void SetOffset( const SwNodeIndex& rIdx );
+};
+
+class SwUndoAcceptRedline : public SwUndoRedline
+{
+private:
+ virtual void RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam);
+
+public:
+ SwUndoAcceptRedline( const SwPaM& rRange );
+
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+};
+
+class SwUndoRejectRedline : public SwUndoRedline
+{
+private:
+ virtual void RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam);
+
+public:
+ SwUndoRejectRedline( const SwPaM& rRange );
+
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+};
+
+//--------------------------------------------------------------------
+
+class SwUndoCompDoc : public SwUndo, public SwUndRng
+{
+ SwRedlineData* pRedlData;
+ SwUndoDelete* pUnDel, *pUnDel2;
+ SwRedlineSaveDatas* pRedlSaveData;
+ sal_Bool bInsert;
+public:
+ SwUndoCompDoc( const SwPaM& rRg, sal_Bool bIns );
+ SwUndoCompDoc( const SwRedline& rRedl );
+
+ virtual ~SwUndoCompDoc();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+};
+
+#endif // SW_UNDO_REDLINE_HXX
+
diff --git a/sw/source/core/inc/UndoSection.hxx b/sw/source/core/inc/UndoSection.hxx
new file mode 100644
index 000000000000..bc6c8dd9fbfc
--- /dev/null
+++ b/sw/source/core/inc/UndoSection.hxx
@@ -0,0 +1,82 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef SW_UNDO_SECTION_HXX
+#define SW_UNDO_SECTION_HXX
+
+#include <undobj.hxx>
+
+#include <memory>
+
+#include <swdllapi.h>
+
+
+class SfxItemSet;
+class SwTxtNode;
+class SwSectionData;
+class SwSectionFmt;
+class SwTOXBase;
+
+
+//------------ Undo of Insert-/Delete-Section ----------------------
+
+class SwUndoInsSection : public SwUndo, private SwUndRng
+{
+private:
+ const ::std::auto_ptr<SwSectionData> m_pSectionData;
+ const ::std::auto_ptr<SwTOXBase> m_pTOXBase; /// set iff section is TOX
+ const ::std::auto_ptr<SfxItemSet> m_pAttrSet;
+ ::std::auto_ptr<SwHistory> m_pHistory;
+ ::std::auto_ptr<SwRedlineData> m_pRedlData;
+ sal_uLong m_nSectionNodePos;
+ bool m_bSplitAtStart : 1;
+ bool m_bSplitAtEnd : 1;
+ bool m_bUpdateFtn : 1;
+
+ void Join( SwDoc& rDoc, sal_uLong nNode );
+
+public:
+ SwUndoInsSection(SwPaM const&, SwSectionData const&,
+ SfxItemSet const*const pSet, SwTOXBase const*const pTOXBase);
+
+ virtual ~SwUndoInsSection();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ void SetSectNdPos(sal_uLong const nPos) { m_nSectionNodePos = nPos; }
+ void SaveSplitNode(SwTxtNode *const pTxtNd, bool const bAtStart);
+ void SetUpdtFtnFlag(bool const bFlag) { m_bUpdateFtn = bFlag; }
+};
+
+SW_DLLPRIVATE SwUndo * MakeUndoDelSection(SwSectionFmt const&);
+
+SW_DLLPRIVATE SwUndo * MakeUndoUpdateSection(SwSectionFmt const&, bool const);
+
+#endif // SW_UNDO_SECTION_HXX
+
diff --git a/sw/source/core/inc/UndoSort.hxx b/sw/source/core/inc/UndoSort.hxx
new file mode 100644
index 000000000000..b1cab7246aad
--- /dev/null
+++ b/sw/source/core/inc/UndoSort.hxx
@@ -0,0 +1,97 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef SW_UNDO_SORT_HXX
+#define SW_UNDO_SORT_HXX
+
+#include <undobj.hxx>
+
+
+struct SwSortOptions;
+class SwTableNode;
+class SwUndoAttrTbl;
+
+
+/*--------------------------------------------------------------------
+ Undo for Sorting
+ --------------------------------------------------------------------*/
+
+struct SwSortUndoElement
+{
+ union {
+ struct {
+ sal_uLong nKenn;
+ sal_uLong nSource, nTarget;
+ } TXT;
+ struct {
+ String *pSource, *pTarget;
+ } TBL;
+ } SORT_TXT_TBL;
+
+ SwSortUndoElement( const String& aS, const String& aT )
+ {
+ SORT_TXT_TBL.TBL.pSource = new String( aS );
+ SORT_TXT_TBL.TBL.pTarget = new String( aT );
+ }
+ SwSortUndoElement( sal_uLong nS, sal_uLong nT )
+ {
+ SORT_TXT_TBL.TXT.nSource = nS;
+ SORT_TXT_TBL.TXT.nTarget = nT;
+ SORT_TXT_TBL.TXT.nKenn = 0xffffffff;
+ }
+ ~SwSortUndoElement();
+};
+
+SV_DECL_PTRARR_DEL(SwSortList, SwSortUndoElement*, 10,30)
+SV_DECL_PTRARR(SwUndoSortList, SwNodeIndex*, 10,30)
+
+class SwUndoSort : public SwUndo, private SwUndRng
+{
+ SwSortOptions* pSortOpt;
+ SwSortList aSortList;
+ SwUndoAttrTbl* pUndoTblAttr;
+ SwRedlineData* pRedlData;
+ sal_uLong nTblNd;
+
+public:
+ SwUndoSort( const SwPaM&, const SwSortOptions& );
+ SwUndoSort( sal_uLong nStt, sal_uLong nEnd, const SwTableNode&,
+ const SwSortOptions&, sal_Bool bSaveTable );
+
+ virtual ~SwUndoSort();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ void Insert( const String& rOrgPos, const String& rNewPos );
+ void Insert( sal_uLong nOrgPos, sal_uLong nNewPos );
+
+};
+
+#endif // SW_UNDO_SORT_HXX
+
diff --git a/sw/source/core/inc/UndoSplitMove.hxx b/sw/source/core/inc/UndoSplitMove.hxx
new file mode 100644
index 000000000000..f58e71517f78
--- /dev/null
+++ b/sw/source/core/inc/UndoSplitMove.hxx
@@ -0,0 +1,96 @@
+/*************************************************************************
+ *
+ * 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 SW_UNDO_MOVE_HXX
+#define SW_UNDO_MOVE_HXX
+
+#include <undobj.hxx>
+
+
+class SwUndoSplitNode: public SwUndo
+{
+ SwHistory* pHistory;
+ SwRedlineData* pRedlData;
+ sal_uLong nNode;
+ xub_StrLen nCntnt;
+ sal_Bool bTblFlag : 1;
+ sal_Bool bChkTblStt : 1;
+
+public:
+ SwUndoSplitNode( SwDoc* pDoc, const SwPosition& rPos, sal_Bool bChkTbl );
+
+ virtual ~SwUndoSplitNode();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ void SetTblFlag() { bTblFlag = sal_True; }
+};
+
+
+class SwUndoMove : public SwUndo, private SwUndRng, private SwUndoSaveCntnt
+{
+ // nDest.. - destination range of move (after move!)
+ // nIns.. - source Position of move (after move!)
+ // nMv.. - destination position of move (before move!); for REDO
+ sal_uLong nDestSttNode, nDestEndNode, nInsPosNode, nMvDestNode;
+ xub_StrLen nDestSttCntnt, nDestEndCntnt, nInsPosCntnt, nMvDestCntnt;
+
+ sal_uInt16 nFtnStt; // StartPos of Footnotes in History
+
+ sal_Bool bJoinNext : 1,
+ bJoinPrev : 1,
+ bMoveRange : 1;
+
+ bool bMoveRedlines; // use DOC_MOVEREDLINES when calling SwDoc::Move
+
+ void DelFtn( const SwPaM& );
+
+public:
+ SwUndoMove( const SwPaM&, const SwPosition& );
+ SwUndoMove( SwDoc* pDoc, const SwNodeRange&, const SwNodeIndex& );
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+
+ /// set the destination range after the move
+ void SetDestRange( const SwPaM&, const SwPosition&, sal_Bool, sal_Bool );
+ void SetDestRange( const SwNodeIndex& rStt, const SwNodeIndex& rEnd,
+ const SwNodeIndex& rInsPos );
+
+ sal_Bool IsMoveRange() const { return bMoveRange; }
+ sal_uLong GetEndNode() const { return nEndNode; }
+ sal_uLong GetDestSttNode() const { return nDestSttNode; }
+ xub_StrLen GetDestSttCntnt() const { return nDestSttCntnt; }
+
+ void SetMoveRedlines( bool b ) { bMoveRedlines = b; }
+
+};
+
+#endif // SW_UNDO_MOVE_HXX
+
diff --git a/sw/source/core/inc/UndoTable.hxx b/sw/source/core/inc/UndoTable.hxx
new file mode 100644
index 000000000000..40032e9dfa86
--- /dev/null
+++ b/sw/source/core/inc/UndoTable.hxx
@@ -0,0 +1,391 @@
+/*************************************************************************
+ *
+ * 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 SW_UNDO_TABLE_HXX
+#define SW_UNDO_TABLE_HXX
+
+#include <undobj.hxx>
+
+#ifndef _SVSTDARR_HXX
+#define _SVSTDARR_USHORTS
+#define _SVSTDARR_ULONGS
+#define _SVSTDARR_BOOLS
+#define _SVSTDARR_BYTES
+#define _SVSTDARR_USHORTSSORT
+#include <svl/svstdarr.hxx>
+#endif
+
+#include <swtypes.hxx>
+#include <itabenum.hxx>
+
+
+class SfxItemSet;
+
+struct SwSaveRowSpan;
+class _SaveTable;
+class SwDDEFieldType;
+class SwUndoSaveSections;
+class SwUndoMoves;
+class SwUndoDelete;
+class SwSelBoxes;
+class SwTblToTxtSaves;
+class SwTable;
+class SwTableBox;
+class SwStartNode;
+class SwTableNode;
+class SwTableAutoFmt;
+class SwTableSortBoxes;
+
+
+class SwUndoInsTbl : public SwUndo
+{
+ String sTblNm;
+ SwInsertTableOptions aInsTblOpts;
+ SwDDEFieldType* pDDEFldType;
+ SvUShorts* pColWidth;
+ SwRedlineData* pRedlData;
+ SwTableAutoFmt* pAutoFmt;
+ sal_uLong nSttNode;
+ sal_uInt16 nRows, nCols;
+ sal_uInt16 nAdjust;
+
+public:
+ SwUndoInsTbl( const SwPosition&, sal_uInt16 nCols, sal_uInt16 nRows,
+ sal_uInt16 eAdjust, const SwInsertTableOptions& rInsTblOpts,
+ const SwTableAutoFmt* pTAFmt, const SvUShorts* pColArr,
+ const String & rName);
+
+ virtual ~SwUndoInsTbl();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ virtual SwRewriter GetRewriter() const;
+
+};
+
+class SwUndoTxtToTbl : public SwUndo, public SwUndRng
+{
+ String sTblNm;
+ SwInsertTableOptions aInsTblOpts;
+ SvULongs* pDelBoxes;
+ SwTableAutoFmt* pAutoFmt;
+ SwHistory* pHistory;
+ sal_Unicode cTrenner;
+ sal_uInt16 nAdjust;
+ sal_Bool bSplitEnd : 1;
+
+public:
+ SwUndoTxtToTbl( const SwPaM&, const SwInsertTableOptions&, sal_Unicode,
+ sal_uInt16,
+ const SwTableAutoFmt* pAFmt );
+
+ virtual ~SwUndoTxtToTbl();
+
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ SwHistory& GetHistory(); // will be created if necessary
+ void AddFillBox( const SwTableBox& rBox );
+};
+
+class SwUndoTblToTxt : public SwUndo
+{
+ String sTblNm;
+ SwDDEFieldType* pDDEFldType;
+ _SaveTable* pTblSave;
+ SwTblToTxtSaves* pBoxSaves;
+ SwHistory* pHistory;
+ sal_uLong nSttNd, nEndNd;
+ sal_uInt16 nAdjust;
+ sal_Unicode cTrenner;
+ sal_uInt16 nHdlnRpt;
+ sal_Bool bCheckNumFmt : 1;
+
+public:
+ SwUndoTblToTxt( const SwTable& rTbl, sal_Unicode cCh );
+
+ virtual ~SwUndoTblToTxt();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ void SetRange( const SwNodeRange& );
+ void AddBoxPos( SwDoc& rDoc, sal_uLong nNdIdx, sal_uLong nEndIdx,
+ xub_StrLen nCntntIdx = STRING_MAXLEN);
+};
+
+class SwUndoAttrTbl : public SwUndo
+{
+ sal_uLong nSttNode;
+ _SaveTable* pSaveTbl;
+ sal_Bool bClearTabCol : 1;
+public:
+ SwUndoAttrTbl( const SwTableNode& rTblNd, sal_Bool bClearTabCols = sal_False );
+
+ virtual ~SwUndoAttrTbl();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+};
+
+class SwUndoTblNumFmt;
+
+class SwUndoTblAutoFmt : public SwUndo
+{
+ sal_uLong nSttNode;
+ _SaveTable* pSaveTbl;
+ ::std::vector< ::boost::shared_ptr<SwUndoTblNumFmt> > m_Undos;
+ sal_Bool bSaveCntntAttr;
+
+ void UndoRedo(bool const bUndo, ::sw::UndoRedoContext & rContext);
+
+public:
+ SwUndoTblAutoFmt( const SwTableNode& rTblNd, const SwTableAutoFmt& );
+
+ virtual ~SwUndoTblAutoFmt();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+
+ void SaveBoxCntnt( const SwTableBox& rBox );
+};
+
+class SwUndoTblNdsChg : public SwUndo
+{
+ _SaveTable* pSaveTbl;
+ SvULongs aBoxes;
+
+ union {
+ SvULongs* pNewSttNds;
+ SwUndoSaveSections* pDelSects;
+ } Ptrs;
+ SvBools aMvBoxes; // for SplitRow (split Nodes of Box)
+ long nMin, nMax; // for redo of delete column
+ sal_uLong nSttNode, nCurrBox;
+ sal_uInt16 nCount, nRelDiff, nAbsDiff, nSetColType;
+ sal_Bool bFlag;
+ sal_Bool bSameHeight; // only used for SplitRow
+public:
+ SwUndoTblNdsChg( SwUndoId UndoId,
+ const SwSelBoxes& rBoxes,
+ const SwTableNode& rTblNd,
+ long nMn, long nMx,
+ sal_uInt16 nCnt, sal_Bool bFlg, sal_Bool bSameHeight );
+
+ // for SetColWidth
+ SwUndoTblNdsChg( SwUndoId UndoId, const SwSelBoxes& rBoxes,
+ const SwTableNode& rTblNd );
+
+ virtual ~SwUndoTblNdsChg();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+
+ void SaveNewBoxes( const SwTableNode& rTblNd, const SwTableSortBoxes& rOld );
+ void SaveNewBoxes( const SwTableNode& rTblNd, const SwTableSortBoxes& rOld,
+ const SwSelBoxes& rBoxes, const SvULongs& rNodeCnts );
+ void SaveSection( SwStartNode* pSttNd );
+ void ReNewBoxes( const SwSelBoxes& rBoxes );
+
+
+ void SetColWidthParam( sal_uLong nBoxIdx, sal_uInt16 nMode, sal_uInt16 nType,
+ SwTwips nAbsDif, SwTwips nRelDif )
+ {
+ nCurrBox = nBoxIdx;
+ nCount = nMode;
+ nSetColType = nType;
+ nAbsDiff = (sal_uInt16)nAbsDif;
+ nRelDiff = (sal_uInt16)nRelDif;
+ }
+
+};
+
+class SwUndoTblMerge : public SwUndo, private SwUndRng
+{
+ sal_uLong nTblNode;
+ _SaveTable* pSaveTbl;
+ SvULongs aBoxes, aNewSttNds;
+ SwUndoMoves* pMoves;
+ SwHistory* pHistory;
+
+public:
+ SwUndoTblMerge( const SwPaM& rTblSel );
+
+ virtual ~SwUndoTblMerge();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+
+ void MoveBoxCntnt( SwDoc* pDoc, SwNodeRange& rRg, SwNodeIndex& rPos );
+
+ void SetSelBoxes( const SwSelBoxes& rBoxes );
+
+ void AddNewBox( sal_uLong nSttNdIdx )
+ { aNewSttNds.Insert( nSttNdIdx, aNewSttNds.Count() ); }
+
+ void SaveCollection( const SwTableBox& rBox );
+
+};
+
+
+class SwUndoTblNumFmt : public SwUndo
+{
+ SfxItemSet *pBoxSet;
+ SwHistory* pHistory;
+ String aStr, aNewFml;
+
+ sal_uLong nFmtIdx, nNewFmtIdx;
+ double fNum, fNewNum;
+ sal_uLong nNode;
+ sal_uLong nNdPos;
+
+ sal_Bool bNewFmt : 1;
+ sal_Bool bNewFml : 1;
+ sal_Bool bNewValue : 1;
+
+public:
+ SwUndoTblNumFmt( const SwTableBox& rBox, const SfxItemSet* pNewSet = 0 );
+
+ virtual ~SwUndoTblNumFmt();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+
+ void SetNumFmt( sal_uLong nNewNumFmtIdx, const double& rNewNumber )
+ { nFmtIdx = nNewNumFmtIdx; fNum = rNewNumber; }
+ void SetBox( const SwTableBox& rBox );
+};
+
+class _UndoTblCpyTbl_Entries;
+
+class SwUndoTblCpyTbl : public SwUndo
+{
+ _UndoTblCpyTbl_Entries* pArr;
+ SwUndoTblNdsChg* pInsRowUndo;
+
+ //b6341295: When redlining is active, PrepareRedline has to create the
+ //redlining attributes for the new and the old table cell content
+ SwUndo* PrepareRedline( SwDoc* pDoc, const SwTableBox& rBox,
+ const SwPosition& rPos, bool& rJoin, bool bRedo );
+public:
+ SwUndoTblCpyTbl();
+
+ virtual ~SwUndoTblCpyTbl();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+
+ void AddBoxBefore( const SwTableBox& rBox, sal_Bool bDelCntnt );
+ void AddBoxAfter( const SwTableBox& rBox, const SwNodeIndex& rIdx,
+ sal_Bool bDelCntnt );
+
+ sal_Bool IsEmpty() const;
+ sal_Bool InsertRow( SwTable& rTbl, const SwSelBoxes& rBoxes, sal_uInt16 nCnt );
+};
+
+class SwUndoCpyTbl : public SwUndo
+{
+ SwUndoDelete* pDel;
+ sal_uLong nTblNode;
+public:
+ SwUndoCpyTbl();
+
+ virtual ~SwUndoCpyTbl();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+
+ void SetTableSttIdx( sal_uLong nIdx ) { nTblNode = nIdx; }
+};
+
+class SwUndoSplitTbl : public SwUndo
+{
+ sal_uLong nTblNode, nOffset;
+ SwSaveRowSpan* mpSaveRowSpan; // stores row span values at the splitting row
+ _SaveTable* pSavTbl;
+ SwHistory* pHistory;
+ sal_uInt16 nMode, nFmlEnd;
+ sal_Bool bCalcNewSize;
+public:
+ SwUndoSplitTbl( const SwTableNode& rTblNd, SwSaveRowSpan* pRowSp,
+ sal_uInt16 nMode, sal_Bool bCalcNewSize );
+
+ virtual ~SwUndoSplitTbl();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ void SetTblNodeOffset( sal_uLong nIdx ) { nOffset = nIdx - nTblNode; }
+ SwHistory* GetHistory() { return pHistory; }
+ void SaveFormula( SwHistory& rHistory );
+};
+
+class SwUndoMergeTbl : public SwUndo
+{
+ String aName;
+ sal_uLong nTblNode;
+ _SaveTable* pSavTbl, *pSavHdl;
+ SwHistory* pHistory;
+ sal_uInt16 nMode;
+ sal_Bool bWithPrev;
+public:
+ SwUndoMergeTbl( const SwTableNode& rTblNd, const SwTableNode& rDelTblNd,
+ sal_Bool bWithPrev, sal_uInt16 nMode );
+
+ virtual ~SwUndoMergeTbl();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ void SaveFormula( SwHistory& rHistory );
+};
+
+
+//--------------------------------------------------------------------
+
+class SwUndoTblHeadline : public SwUndo
+{
+ sal_uLong nTblNd;
+ sal_uInt16 nOldHeadline;
+ sal_uInt16 nNewHeadline;
+public:
+ SwUndoTblHeadline( const SwTable&, sal_uInt16 nOldHdl, sal_uInt16 nNewHdl );
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+};
+
+#endif // SW_UNDO_TABLE_HXX
+
diff --git a/sw/source/core/inc/acorrect.hxx b/sw/source/core/inc/acorrect.hxx
index bc2d2d4cb1f3..d52d3a70f4b5 100644
--- a/sw/source/core/inc/acorrect.hxx
+++ b/sw/source/core/inc/acorrect.hxx
@@ -56,7 +56,7 @@ class SwAutoCorrDoc : public SvxAutoCorrDoc
SwEditShell& rEditSh;
SwPaM& rCrsr;
SwNodeIndex* pIdx;
- SwUndoId nUndoId;
+ int m_nEndUndoCounter;
bool bUndoIdInitialized;
void DeleteSel( SwPaM& rDelPam );
@@ -65,25 +65,25 @@ public:
SwAutoCorrDoc( SwEditShell& rEditShell, SwPaM& rPam, sal_Unicode cIns = 0 );
~SwAutoCorrDoc();
- virtual BOOL Delete( xub_StrLen nStt, xub_StrLen nEnd );
- virtual BOOL Insert( xub_StrLen nPos, const String& rTxt );
- virtual BOOL Replace( xub_StrLen nPos, const String& rTxt );
+ 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 BOOL SetAttr( xub_StrLen nStt, xub_StrLen nEnd, USHORT nSlotId,
+ virtual sal_Bool SetAttr( xub_StrLen nStt, xub_StrLen nEnd, sal_uInt16 nSlotId,
SfxPoolItem& );
- virtual BOOL SetINetAttr( xub_StrLen nStt, xub_StrLen nEnd, const String& rURL );
+ virtual sal_Bool SetINetAttr( xub_StrLen nStt, xub_StrLen nEnd, const String& rURL );
// returne den Text eines vorherigen Absatzes.
// Dieser darf nicht leer sein!
// Gibt es diesen nicht oder gibt es davor nur Leere, dann returne 0
// Das Flag gibt an:
- // TRUE: den, vor der normalen Einfuegeposition (TRUE)
- // FALSE: den, in den das korrigierte Wort eingfuegt wurde.
+ // sal_True: den, vor der normalen Einfuegeposition (sal_True)
+ // sal_False: den, in den das korrigierte Wort eingfuegt wurde.
// (Muss nicht der gleiche Absatz sein!!!!)
- virtual const String* GetPrevPara( BOOL bAtNormalPos );
+ virtual const String* GetPrevPara( sal_Bool bAtNormalPos );
- virtual BOOL ChgAutoCorrWord( xub_StrLen& rSttPos, xub_StrLen nEndPos,
+ virtual sal_Bool ChgAutoCorrWord( xub_StrLen& rSttPos, xub_StrLen nEndPos,
SvxAutoCorrect& rACorrect,
const String** ppPara );
@@ -92,30 +92,30 @@ public:
// - FnCptlSttSntnc
// gerufen. Dann koennen die Worte ggfs. in die Ausnahmelisten
// aufgenommen werden.
- virtual void SaveCpltSttWord( ULONG nFlag, xub_StrLen nPos,
+ virtual void SaveCpltSttWord( sal_uLong nFlag, xub_StrLen nPos,
const String& rExceptWord, sal_Unicode cChar );
- virtual LanguageType GetLanguage( xub_StrLen nPos, BOOL bPrevPara ) const;
+ virtual LanguageType GetLanguage( xub_StrLen nPos, sal_Bool bPrevPara ) const;
};
class SwAutoCorrExceptWord
{
String sWord;
- ULONG nFlags, nNode;
+ sal_uLong nFlags, nNode;
xub_StrLen nCntnt;
sal_Unicode cChar;
LanguageType eLanguage;
- BOOL bDeleted;
+ sal_Bool bDeleted;
public:
- SwAutoCorrExceptWord( ULONG nAFlags, ULONG nNd, xub_StrLen nContent,
+ SwAutoCorrExceptWord( sal_uLong nAFlags, sal_uLong nNd, xub_StrLen nContent,
const String& rWord, sal_Unicode cChr,
LanguageType eLang )
: sWord(rWord), nFlags(nAFlags), nNode(nNd), nCntnt(nContent),
- cChar(cChr), eLanguage(eLang), bDeleted(FALSE)
+ cChar(cChr), eLanguage(eLang), bDeleted(sal_False)
{}
- BOOL IsDeleted() const { return bDeleted; }
+ sal_Bool IsDeleted() const { return bDeleted; }
void CheckChar( const SwPosition& rPos, sal_Unicode cChar );
- BOOL CheckDelChar( const SwPosition& rPos );
+ sal_Bool CheckDelChar( const SwPosition& rPos );
};
diff --git a/sw/source/core/inc/anchoredobjectposition.hxx b/sw/source/core/inc/anchoredobjectposition.hxx
index 581225061553..966b1a43f428 100644
--- a/sw/source/core/inc/anchoredobjectposition.hxx
+++ b/sw/source/core/inc/anchoredobjectposition.hxx
@@ -444,7 +444,7 @@ namespace objectpositioning
bool _DrawAsideFly( const SwFlyFrm* _pFly,
const SwRect& _rObjRect,
const SwFrm* _pObjContext,
- const ULONG _nObjIndex,
+ const sal_uLong _nObjIndex,
const bool _bEvenPage,
const sal_Int16 _eHoriOrient,
const sal_Int16 _eRelOrient
diff --git a/sw/source/core/inc/blink.hxx b/sw/source/core/inc/blink.hxx
index 8f8b086fef3b..11f11d6d188a 100644
--- a/sw/source/core/inc/blink.hxx
+++ b/sw/source/core/inc/blink.hxx
@@ -41,9 +41,9 @@ class SwBlinkPortion
Point aPos;
const SwLinePortion *pPor;
const SwRootFrm *pFrm;
- USHORT nDir;
+ sal_uInt16 nDir;
public:
- SwBlinkPortion( const SwLinePortion* pPortion, USHORT nDirection )
+ SwBlinkPortion( const SwLinePortion* pPortion, sal_uInt16 nDirection )
{ pPor = pPortion; nDir = nDirection; }
SwBlinkPortion( const SwBlinkPortion* pBlink, const SwLinePortion* pPort )
{ pPor = pPort; pFrm = pBlink->pFrm; aPos = pBlink->aPos; nDir = pBlink->nDir; }
@@ -52,10 +52,10 @@ public:
void SetRootFrm( const SwRootFrm* pNew ){ pFrm = pNew; }
const SwRootFrm* GetRootFrm() const{ return pFrm; }
const SwLinePortion *GetPortion() const{ return pPor; }
- USHORT GetDirection() const { return nDir; }
- BOOL operator<( const SwBlinkPortion& rBlinkPortion ) const
+ sal_uInt16 GetDirection() const { return nDir; }
+ sal_Bool operator<( const SwBlinkPortion& rBlinkPortion ) const
{ return (long)pPor < (long)rBlinkPortion.pPor; }
- BOOL operator==( const SwBlinkPortion& rBlinkPortion ) const
+ sal_Bool operator==( const SwBlinkPortion& rBlinkPortion ) const
{ return (long)pPor == (long)rBlinkPortion.pPor; }
};
@@ -66,7 +66,7 @@ class SwBlink
{
SwBlinkList aList;
AutoTimer aTimer;
- BOOL bVisible;
+ sal_Bool bVisible;
public:
SwBlink();
~SwBlink();
@@ -74,11 +74,11 @@ public:
DECL_LINK( Blinker, Timer * );
void Insert( const Point& rPoint, const SwLinePortion* pPor,
- const SwTxtFrm *pTxtFrm, USHORT nDir );
+ const SwTxtFrm *pTxtFrm, sal_uInt16 nDir );
void Replace( const SwLinePortion* pOld, const SwLinePortion* pNew );
void Delete( const SwLinePortion* pPor );
void FrmDelete( const SwRootFrm* pRoot );
- inline BOOL IsVisible() const { return bVisible ; }
+ inline sal_Bool IsVisible() const { return bVisible ; }
};
// Blink-Manager, globale Variable, in Blink.Cxx angelegt
diff --git a/sw/source/core/inc/cellfrm.hxx b/sw/source/core/inc/cellfrm.hxx
index 86a2c1f655e1..317e70aa22c1 100644
--- a/sw/source/core/inc/cellfrm.hxx
+++ b/sw/source/core/inc/cellfrm.hxx
@@ -47,9 +47,17 @@ public:
SwCellFrm( const SwTableBox &, SwFrm*, bool bInsertContent = true );
~SwCellFrm();
+<<<<<<< local
virtual BOOL GetCrsrOfst( SwPosition *, Point&, SwCrsrMoveState* = 0 ) const;
virtual void Paint( SwRect const&, SwPrintData const*const pPrintData = NULL ) const;
virtual void CheckDirection( BOOL bVert );
+=======
+ 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 );
+>>>>>>> other
// --> OD 2010-02-17 #i103961#
virtual void Cut();
diff --git a/sw/source/core/inc/cntfrm.hxx b/sw/source/core/inc/cntfrm.hxx
index cb8d7baf386c..88c8f68c17f5 100644
--- a/sw/source/core/inc/cntfrm.hxx
+++ b/sw/source/core/inc/cntfrm.hxx
@@ -37,7 +37,7 @@ class SwAttrSetChg;
class SwTxtFrm;
//Implementiert in cntfrm.cxx, wird von cntfrm.cxx und crsrsh.cxx angezogen
-extern BOOL GetFrmInPage( const SwCntntFrm*, SwWhichPage, SwPosPage, SwPaM* );
+extern sal_Bool GetFrmInPage( const SwCntntFrm*, SwWhichPage, SwPosPage, SwPaM* );
class SwCntntFrm: public SwFrm, public SwFlowFrm
{
@@ -46,27 +46,37 @@ class SwCntntFrm: public SwFrm, public SwFlowFrm
// --> OD 2007-11-26 #b6614158#
// parameter <bObjsInNewUpper>, indicating that objects are existing in
// remaining area of new upper
- BOOL _WouldFit( SwTwips nSpace,
+ sal_Bool _WouldFit( SwTwips nSpace,
SwLayoutFrm *pNewUpper,
- BOOL bTstMove,
+ sal_Bool bTstMove,
const bool bObjsInNewUpper );
// <--
virtual void MakeAll();
+<<<<<<< local
void _UpdateAttr( const SfxPoolItem*, const SfxPoolItem*, BYTE &,
+=======
+ void _UpdateAttr( SfxPoolItem*, SfxPoolItem*, sal_uInt8 &,
+>>>>>>> other
SwAttrSetChg *pa = 0, SwAttrSetChg *pb = 0 );
- virtual BOOL ShouldBwdMoved( SwLayoutFrm *pNewUpper, BOOL, BOOL& );
+ virtual sal_Bool ShouldBwdMoved( SwLayoutFrm *pNewUpper, sal_Bool, sal_Bool& );
const SwCntntFrm* ImplGetNextCntntFrm( bool bFwd ) const;
protected:
- BOOL MakePrtArea( const SwBorderAttrs & );
+ sal_Bool MakePrtArea( const SwBorderAttrs & );
+<<<<<<< local
virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
virtual SwTwips ShrinkFrm( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE );
virtual SwTwips GrowFrm ( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE );
+=======
+ virtual void Modify( SfxPoolItem*, 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 );
+>>>>>>> other
SwCntntFrm( SwCntntNode * const, SwFrm* );
@@ -79,32 +89,32 @@ public:
inline SwCntntNode *GetNode();
inline const SwCntntNode *GetNode() const;
- USHORT GetSectionLevel();
+ sal_uInt16 GetSectionLevel();
inline const SwCntntFrm *GetFollow() const;
inline SwCntntFrm *GetFollow();
SwTxtFrm* FindMaster() const;
//Layoutabhaengiges Cursortravelling
- virtual BOOL LeftMargin( SwPaM * ) const;
- virtual BOOL RightMargin( SwPaM *, BOOL bAPI = FALSE ) const;
- virtual BOOL UnitUp( SwPaM *, const SwTwips nOffset = 0,
- BOOL bSetInReadOnly = FALSE ) const;
- virtual BOOL UnitDown( SwPaM *, const SwTwips nOffset = 0,
- BOOL bSetInReadOnly = FALSE ) const;
- inline BOOL StartNextPage( SwPaM * ) const;
- inline BOOL StartPrevPage( SwPaM * ) const;
- inline BOOL StartCurrPage( SwPaM * ) const;
- inline BOOL EndCurrPage( SwPaM * ) const;
- inline BOOL EndNextPage( SwPaM * ) const;
- inline BOOL EndPrevPage( SwPaM * ) const;
+ virtual sal_Bool LeftMargin( SwPaM * ) const;
+ virtual sal_Bool RightMargin( SwPaM *, sal_Bool bAPI = sal_False ) const;
+ virtual sal_Bool UnitUp( SwPaM *, const SwTwips nOffset = 0,
+ sal_Bool bSetInReadOnly = sal_False ) const;
+ virtual sal_Bool UnitDown( SwPaM *, const SwTwips nOffset = 0,
+ sal_Bool bSetInReadOnly = sal_False ) const;
+ inline sal_Bool StartNextPage( SwPaM * ) const;
+ inline sal_Bool StartPrevPage( SwPaM * ) const;
+ inline sal_Bool StartCurrPage( SwPaM * ) const;
+ inline sal_Bool EndCurrPage( SwPaM * ) const;
+ inline sal_Bool EndNextPage( SwPaM * ) const;
+ inline sal_Bool EndPrevPage( SwPaM * ) const;
// nMaxHeight is the required height
// bSplit indicates, that the paragraph has to be split
// bTst indicates, that we are currently doing a test formatting
virtual sal_Bool WouldFit( SwTwips &nMaxHeight, sal_Bool &bSplit, sal_Bool bTst );
- BOOL MoveFtnCntFwd( BOOL, SwFtnBossFrm* );//von MoveFwd gerufen bei Ftn-Inhalt
+ sal_Bool MoveFtnCntFwd( sal_Bool, SwFtnBossFrm* );//von MoveFwd gerufen bei Ftn-Inhalt
inline SwCntntFrm* GetNextCntntFrm() const;
inline SwCntntFrm* GetPrevCntntFrm() const;
diff --git a/sw/source/core/inc/dbg_lay.hxx b/sw/source/core/inc/dbg_lay.hxx
index 1edb60f2cba9..3885d9d7dda5 100644
--- a/sw/source/core/inc/dbg_lay.hxx
+++ b/sw/source/core/inc/dbg_lay.hxx
@@ -73,27 +73,27 @@ class SwImplEnterLeave;
class SwProtocol
{
- static ULONG nRecord;
+ static sal_uLong nRecord;
static SwImplProtocol* pImpl;
- static BOOL Start() { return 0 != ( PROT_INIT & nRecord ); }
+ static sal_Bool Start() { return 0 != ( PROT_INIT & nRecord ); }
public:
- static ULONG Record() { return nRecord; }
- static void SetRecord( ULONG nNew ) { nRecord = nNew; }
- static BOOL Record( ULONG nFunc ) { return 0 != (( nFunc | PROT_INIT ) & nRecord); }
- static void Record( const SwFrm* pFrm, ULONG nFunction, ULONG nAction, void* pParam );
+ static sal_uLong Record() { return nRecord; }
+ static void SetRecord( sal_uLong nNew ) { nRecord = nNew; }
+ static sal_Bool Record( sal_uLong nFunc ) { return 0 != (( nFunc | PROT_INIT ) & nRecord); }
+ static void Record( const SwFrm* pFrm, sal_uLong nFunction, sal_uLong nAction, void* pParam );
static void Init();
static void Stop();
- static void SnapShot( const SwFrm* pFrm, ULONG nFlags );
- static void GetVar( const USHORT nNo, long& rVar );
+ static void SnapShot( const SwFrm* pFrm, sal_uLong nFlags );
+ static void GetVar( const sal_uInt16 nNo, long& rVar );
};
class SwEnterLeave
{
SwImplEnterLeave* pImpl;
- void Ctor( const SwFrm* pFrm, ULONG nFunc, ULONG nAct, void* pPar );
+ void Ctor( const SwFrm* pFrm, sal_uLong nFunc, sal_uLong nAct, void* pPar );
void Dtor();
public:
- SwEnterLeave( const SwFrm* pFrm, ULONG nFunc, ULONG nAct, void* pPar )
+ SwEnterLeave( const SwFrm* pFrm, sal_uLong nFunc, sal_uLong nAct, void* pPar )
{ if( SwProtocol::Record( nFunc ) ) Ctor( pFrm, nFunc, nAct, pPar ); else pImpl = NULL; }
~SwEnterLeave() { if( pImpl ) Dtor(); }
};
diff --git a/sw/source/core/inc/dbgloop.hxx b/sw/source/core/inc/dbgloop.hxx
index a89761a57c46..bfa17b466828 100644
--- a/sw/source/core/inc/dbgloop.hxx
+++ b/sw/source/core/inc/dbgloop.hxx
@@ -39,8 +39,8 @@ class SvStream;
class DbgLoopStack
{
- USHORT aCount[DBG_MAX_STACK];
- USHORT nPtr;
+ sal_uInt16 aCount[DBG_MAX_STACK];
+ sal_uInt16 nPtr;
const void *pDbg;
void Reset();
public:
diff --git a/sw/source/core/inc/dflyobj.hxx b/sw/source/core/inc/dflyobj.hxx
index 47e8fb700809..23216709a50a 100644
--- a/sw/source/core/inc/dflyobj.hxx
+++ b/sw/source/core/inc/dflyobj.hxx
@@ -32,12 +32,12 @@ class SwFlyFrm;
class SwFrmFmt;
class SdrObjMacroHitRec;
-const UINT32 SWGInventor = UINT32('S')*0x00000001+
- UINT32('W')*0x00000100+
- UINT32('G')*0x00010000;
+const sal_uInt32 SWGInventor = sal_uInt32('S')*0x00000001+
+ sal_uInt32('W')*0x00000100+
+ sal_uInt32('G')*0x00010000;
-const UINT16 SwFlyDrawObjIdentifier = 0x0001;
-const UINT16 SwDrawFirst = 0x0001;
+const sal_uInt16 SwFlyDrawObjIdentifier = 0x0001;
+const sal_uInt16 SwDrawFirst = 0x0001;
//---------------------------------------
//SwFlyDrawObj, Die DrawObjekte fuer Flys.
@@ -60,9 +60,9 @@ public:
//Damit eine Instanz dieser Klasse beim laden erzeugt werden kann
//(per Factory).
- virtual UINT32 GetObjInventor() const;
- virtual UINT16 GetObjIdentifier() const;
- virtual UINT16 GetObjVersion() const;
+ virtual sal_uInt32 GetObjInventor() const;
+ virtual sal_uInt16 GetObjIdentifier() const;
+ virtual sal_uInt16 GetObjVersion() const;
};
//---------------------------------------
diff --git a/sw/source/core/inc/docfld.hxx b/sw/source/core/inc/docfld.hxx
index a8740639f603..dbce10e51db0 100644
--- a/sw/source/core/inc/docfld.hxx
+++ b/sw/source/core/inc/docfld.hxx
@@ -47,7 +47,7 @@ struct SwPosition;
// Update an den Expression Feldern
class _SetGetExpFld
{
- ULONG nNode;
+ sal_uLong nNode;
xub_StrLen nCntnt;
union {
const SwTxtFld* pTxtFld;
@@ -84,11 +84,11 @@ public:
_SetGetExpFld( const SwFlyFrmFmt& rFlyFmt, const SwPosition* pPos = 0 );
- BOOL operator==( const _SetGetExpFld& rFld ) const
+ sal_Bool operator==( const _SetGetExpFld& rFld ) const
{ return nNode == rFld.nNode && nCntnt == rFld.nCntnt &&
( !CNTNT.pTxtFld || !rFld.CNTNT.pTxtFld ||
CNTNT.pTxtFld == rFld.CNTNT.pTxtFld ); }
- BOOL operator<( const _SetGetExpFld& rFld ) const;
+ sal_Bool operator<( const _SetGetExpFld& rFld ) const;
const SwTxtFld* GetFld() const
{ return TEXTFIELD == eSetGetExpFldType ? CNTNT.pTxtFld : 0; }
@@ -103,7 +103,7 @@ public:
const SwFlyFrmFmt* GetFlyFmt() const
{ return FLYFRAME == eSetGetExpFldType ? CNTNT.pFlyFmt : 0; }
- ULONG GetNode() const { return nNode; }
+ sal_uLong GetNode() const { return nNode; }
xub_StrLen GetCntnt() const { return nCntnt; }
const void* GetPointer() const { return CNTNT.pTxtFld; }
@@ -138,8 +138,8 @@ struct SwCalcFldType : public SwHash
// Suche nach dem String, der unter dem Namen in der HashTabelle abgelegt
// wurde
-void LookString( SwHash** ppTbl, USHORT nSize, const String& rName,
- String& rRet, USHORT* pPos = 0 );
+void LookString( SwHash** ppTbl, sal_uInt16 nSize, const String& rName,
+ String& rRet, sal_uInt16* pPos = 0 );
// --------
@@ -157,14 +157,14 @@ class SwDocUpdtFld
long nFldUpdtPos; // ab dieser Position mit Update starten
SwCntntNode* pCNode; // der TxtNode zur UpdatePos.
- ULONG nNodes; // sollte die NodesAnzahl unterschiedlich sein
- BYTE nFldLstGetMode;
+ sal_uLong nNodes; // sollte die NodesAnzahl unterschiedlich sein
+ sal_uInt8 nFldLstGetMode;
- BOOL bInUpdateFlds : 1; // zur Zeit laeuft ein UpdateFlds,
- BOOL bFldsDirty : 1; // irgendwelche Felder sind ungueltig
+ sal_Bool bInUpdateFlds : 1; // zur Zeit laeuft ein UpdateFlds,
+ sal_Bool bFldsDirty : 1; // irgendwelche Felder sind ungueltig
void _MakeFldList( SwDoc& pDoc, int eGetMode );
- void GetBodyNode( const SwTxtFld& , USHORT nFldWhich );
+ void GetBodyNode( const SwTxtFld& , sal_uInt16 nFldWhich );
void GetBodyNode( const SwSectionNode&);
public:
SwDocUpdtFld();
@@ -174,16 +174,16 @@ public:
void MakeFldList( SwDoc& rDoc, int bAll, int eGetMode );
- void InsDelFldInFldLst( BOOL bIns, const SwTxtFld& rFld );
+ void InsDelFldInFldLst( sal_Bool bIns, const SwTxtFld& rFld );
void InsertFldType( const SwFieldType& rType );
void RemoveFldType( const SwFieldType& rType );
- BOOL IsInUpdateFlds() const { return bInUpdateFlds; }
- void SetInUpdateFlds( BOOL b ) { bInUpdateFlds = b; }
+ sal_Bool IsInUpdateFlds() const { return bInUpdateFlds; }
+ void SetInUpdateFlds( sal_Bool b ) { bInUpdateFlds = b; }
- BOOL IsFieldsDirty() const { return bFldsDirty; }
- void SetFieldsDirty( BOOL b ) { bFldsDirty = b; }
+ sal_Bool IsFieldsDirty() const { return bFldsDirty; }
+ void SetFieldsDirty( sal_Bool b ) { bFldsDirty = b; }
SwHash** GetFldTypeTable() const { return (SwHash**)aFldTypeTable; }
};
diff --git a/sw/source/core/inc/docsort.hxx b/sw/source/core/inc/docsort.hxx
index 984166322b71..5d87e37e9219 100644
--- a/sw/source/core/inc/docsort.hxx
+++ b/sw/source/core/inc/docsort.hxx
@@ -62,11 +62,11 @@ SV_DECL_PTRARR(SwMovedBoxes, SwMovedBoxPtr, 10, 10 )
--------------------------------------------------------------------*/
void MoveCol(SwDoc* pDoc, const FlatFndBox& rBox,
- USHORT nS, USHORT nT, SwMovedBoxes& rMovedList, SwUndoSort* pUD=0);
+ sal_uInt16 nS, sal_uInt16 nT, SwMovedBoxes& rMovedList, SwUndoSort* pUD=0);
void MoveRow(SwDoc* pDoc, const FlatFndBox& rBox,
- USHORT nS, USHORT nT, SwMovedBoxes& rMovedList, SwUndoSort* pUD=0);
+ sal_uInt16 nS, sal_uInt16 nT, SwMovedBoxes& rMovedList, SwUndoSort* pUD=0);
void MoveCell(SwDoc* pDoc, const SwTableBox* pSource,
- const SwTableBox* pTar, BOOL bMovedBefore, SwUndoSort* pUD=0);
+ const SwTableBox* pTar, sal_Bool bMovedBefore, SwUndoSort* pUD=0);
/*-------------------------------------------------------------------
Beschreibung: Elemente zum Sortieren von Text und Tabellen-Inhalt
@@ -87,11 +87,11 @@ struct SwSortElement
virtual ~SwSortElement();
- virtual String GetKey(USHORT nKey ) const = 0;
- virtual double GetValue(USHORT nKey ) const;
+ virtual String GetKey(sal_uInt16 nKey ) const = 0;
+ virtual double GetValue(sal_uInt16 nKey ) const;
- BOOL operator==(const SwSortElement& );
- BOOL operator<(const SwSortElement& );
+ sal_Bool operator==(const SwSortElement& );
+ sal_Bool operator<(const SwSortElement& );
double StrToDouble(const String& rStr) const;
};
@@ -103,13 +103,13 @@ struct SwSortElement
struct SwSortTxtElement : public SwSortElement
{
// fuer Text
- ULONG nOrg;
+ sal_uLong nOrg;
SwNodeIndex aPos;
SwSortTxtElement( const SwNodeIndex& rPos );
virtual ~SwSortTxtElement();
- virtual String GetKey( USHORT nKey ) const;
+ virtual String GetKey( sal_uInt16 nKey ) const;
};
/*--------------------------------------------------------------------
@@ -118,13 +118,13 @@ struct SwSortTxtElement : public SwSortElement
struct SwSortBoxElement : public SwSortElement
{
- USHORT nRow;
+ sal_uInt16 nRow;
- SwSortBoxElement( USHORT nRC );
+ SwSortBoxElement( sal_uInt16 nRC );
virtual ~SwSortBoxElement();
- virtual String GetKey( USHORT nKey ) const;
- virtual double GetValue( USHORT nKey ) const;
+ virtual String GetKey( sal_uInt16 nKey ) const;
+ virtual double GetValue( sal_uInt16 nKey ) const;
};
@@ -139,38 +139,38 @@ public:
FlatFndBox(SwDoc* pDocPtr, const _FndBox& rBox);
~FlatFndBox();
- BOOL IsSymmetric() const { return bSym; }
- USHORT GetRows() const { return nRows; }
- USHORT GetCols() const { return nCols; }
+ sal_Bool IsSymmetric() const { return bSym; }
+ sal_uInt16 GetRows() const { return nRows; }
+ sal_uInt16 GetCols() const { return nCols; }
- const _FndBox* GetBox(USHORT nCol, USHORT nRow) const;
+ const _FndBox* GetBox(sal_uInt16 nCol, sal_uInt16 nRow) const;
- inline BOOL HasItemSets() const;
- const SfxItemSet* GetItemSet(USHORT nCol, USHORT nRow) const;
+ inline sal_Bool HasItemSets() const;
+ const SfxItemSet* GetItemSet(sal_uInt16 nCol, sal_uInt16 nRow) const;
private:
- BOOL CheckLineSymmetry(const _FndBox& rBox);
- BOOL CheckBoxSymmetry(const _FndLine& rLn);
- USHORT GetColCount(const _FndBox& rBox);
- USHORT GetRowCount(const _FndBox& rBox);
- void FillFlat(const _FndBox&, BOOL bLastBox=FALSE);
+ sal_Bool CheckLineSymmetry(const _FndBox& rBox);
+ sal_Bool CheckBoxSymmetry(const _FndLine& rLn);
+ sal_uInt16 GetColCount(const _FndBox& rBox);
+ sal_uInt16 GetRowCount(const _FndBox& rBox);
+ void FillFlat(const _FndBox&, sal_Bool bLastBox=sal_False);
SwDoc* pDoc;
const _FndBox& rBoxRef;
_FndBoxPtr* pArr;
SfxItemSet** ppItemSets;
- USHORT nRows;
- USHORT nCols;
+ sal_uInt16 nRows;
+ sal_uInt16 nCols;
- USHORT nRow;
- USHORT nCol;
+ sal_uInt16 nRow;
+ sal_uInt16 nCol;
- BOOL bSym;
+ sal_Bool bSym;
};
-inline BOOL FlatFndBox::HasItemSets() const { return 0 != ppItemSets; }
+inline sal_Bool FlatFndBox::HasItemSets() const { return 0 != ppItemSets; }
#endif // _NDSORT_HXX
diff --git a/sw/source/core/inc/doctxm.hxx b/sw/source/core/inc/doctxm.hxx
index cb03e0531000..5e3adfb1fd3d 100644
--- a/sw/source/core/inc/doctxm.hxx
+++ b/sw/source/core/inc/doctxm.hxx
@@ -74,8 +74,8 @@ class SwTOXBaseSection : public SwTOXBase, public SwSection
// Textrumpf generieren
// OD 18.03.2003 #106329# - add parameter <_TOXSectNdIdx> and <_pDefaultPageDesc>
- void GenerateText( USHORT nArrayIdx,
- USHORT nCount,
+ void GenerateText( sal_uInt16 nArrayIdx,
+ sal_uInt16 nCount,
SvStringsDtor&,
const sal_uInt32 _nTOXSectNdIdx,
const SwPageDesc* _pDefaultPageDesc );
@@ -89,11 +89,11 @@ class SwTOXBaseSection : public SwTOXBase, public SwSection
// Bereich fuer Stichwort einfuegen suchen
Range GetKeyRange( const String& rStr, const String& rStrReading,
- const SwTOXSortTabBase& rNew, USHORT nLevel,
+ const SwTOXSortTabBase& rNew, sal_uInt16 nLevel,
const Range& rRange );
// returne die TextCollection ueber den Namen / aus Format-Pool
- SwTxtFmtColl* GetTxtFmtColl( USHORT nLevel );
+ SwTxtFmtColl* GetTxtFmtColl( sal_uInt16 nLevel );
public:
SwTOXBaseSection(SwTOXBase const& rBase, SwSectionFmt & rFmt);
@@ -107,7 +107,7 @@ public:
void UpdatePageNum(); // Seitennummern einfuegen
TYPEINFO(); // fuers rtti
- BOOL SetPosAtStartEnd( SwPosition& rPos, BOOL bAtStart = TRUE ) const;
+ sal_Bool SetPosAtStartEnd( SwPosition& rPos, sal_Bool bAtStart = sal_True ) const;
};
/* -----------------02.09.99 07:52-------------------
diff --git a/sw/source/core/inc/drawdev.hxx b/sw/source/core/inc/drawdev.hxx
index 714208a4b6c9..7b851403355b 100644
--- a/sw/source/core/inc/drawdev.hxx
+++ b/sw/source/core/inc/drawdev.hxx
@@ -53,21 +53,21 @@ public:
// Ausgabemethoden
inline void DrawText( const Point& rStart, const String& rTxt,
- const USHORT nIdx = 0,
- const USHORT nLen = STRING_LEN );
- inline void DrawStretchText( const Point& rStart, USHORT nWidth,
+ const sal_uInt16 nIdx = 0,
+ const sal_uInt16 nLen = STRING_LEN );
+ inline void DrawStretchText( const Point& rStart, sal_uInt16 nWidth,
const String& rTxt,
- const USHORT nIdx = 0,
- const USHORT nLen = STRING_LEN );
+ const sal_uInt16 nIdx = 0,
+ const sal_uInt16 nLen = STRING_LEN );
inline void DrawTextArray( const Point& rStart,
const String& rTxt,
long *pKernArray = 0,
- const USHORT nIdx = 0,
- const USHORT nLen = STRING_LEN);
+ const sal_uInt16 nIdx = 0,
+ const sal_uInt16 nLen = STRING_LEN);
inline void DrawLine( const Point& rStart, const Point& rEnd );
inline void DrawRect( const SwRect& rRect,
- const USHORT nHorzRount = 0,
- const USHORT nVertRound = 0 );
+ const sal_uInt16 nHorzRount = 0,
+ const sal_uInt16 nVertRound = 0 );
inline const Point *GetOrigin() const {return pPos; }
};
@@ -77,7 +77,7 @@ public:
*************************************************************************/
inline void SwDrawDev::DrawText( const Point& rStart, const String& rTxt,
- const USHORT nIdx, const USHORT nLen )
+ const sal_uInt16 nIdx, const sal_uInt16 nLen )
{
if( !pPos )
pOut->DrawText( rStart, rTxt, nIdx, nLen );
@@ -89,8 +89,8 @@ inline void SwDrawDev::DrawText( const Point& rStart, const String& rTxt,
* SwDrawDev::DrawStretchText
*************************************************************************/
-inline void SwDrawDev::DrawStretchText( const Point& rStart, USHORT nWidth,
- const String& rTxt, const USHORT nIdx, const USHORT nLen )
+inline void SwDrawDev::DrawStretchText( const Point& rStart, sal_uInt16 nWidth,
+ const String& rTxt, const sal_uInt16 nIdx, const sal_uInt16 nLen )
{
if( !pPos )
pOut->DrawStretchText( rStart, nWidth, rTxt, nIdx, nLen );
@@ -103,7 +103,7 @@ inline void SwDrawDev::DrawStretchText( const Point& rStart, USHORT nWidth,
*************************************************************************/
inline void SwDrawDev::DrawTextArray( const Point& rStart, const String& rTxt,
- long *pKernArray, const USHORT nIdx, const USHORT nLen )
+ long *pKernArray, const sal_uInt16 nIdx, const sal_uInt16 nLen )
{
if( !pPos )
pOut->DrawTextArray( rStart, rTxt, pKernArray, nIdx, nLen );
@@ -128,7 +128,7 @@ inline void SwDrawDev::DrawLine( const Point& rStart, const Point& rEnd )
*************************************************************************/
inline void SwDrawDev::DrawRect( const SwRect& rRect,
- const USHORT nHorzRound, const USHORT nVertRound )
+ const sal_uInt16 nHorzRound, const sal_uInt16 nVertRound )
{
SwRect aRect( rRect );
if( pPos )
diff --git a/sw/source/core/inc/drawfont.hxx b/sw/source/core/inc/drawfont.hxx
index ab25e5435aa7..ba16257d3189 100644
--- a/sw/source/core/inc/drawfont.hxx
+++ b/sw/source/core/inc/drawfont.hxx
@@ -69,25 +69,25 @@ class SwDrawTextInfo
xub_StrLen nIdx;
xub_StrLen nLen;
xub_StrLen nOfst;
- USHORT nWidth;
- USHORT nAscent;
- USHORT nCompress;
+ sal_uInt16 nWidth;
+ sal_uInt16 nAscent;
+ sal_uInt16 nCompress;
long nSperren;
long nSpace;
long nKern;
xub_StrLen nNumberOfBlanks;
- BYTE nCursorBidiLevel;
- BOOL bBullet : 1;
- BOOL bUpper : 1; // Fuer Kapitaelchen: Grossbuchstaben-Flag
- BOOL bDrawSpace : 1; // Fuer Kapitaelchen: Unter/Durchstreichung
- BOOL bGreyWave : 1; // Graue Wellenlinie beim extended TextInput
- BOOL bSpaceStop : 1; // For underlining we need to know, if a portion
+ sal_uInt8 nCursorBidiLevel;
+ sal_Bool bBullet : 1;
+ sal_Bool bUpper : 1; // Fuer Kapitaelchen: Grossbuchstaben-Flag
+ sal_Bool bDrawSpace : 1; // Fuer Kapitaelchen: Unter/Durchstreichung
+ sal_Bool bGreyWave : 1; // Graue Wellenlinie beim extended TextInput
+ sal_Bool bSpaceStop : 1; // For underlining we need to know, if a portion
// is right in front of a hole portion or a
// fix margin portion.
- BOOL bSnapToGrid : 1; // Does paragraph snap to grid?
- BOOL bIgnoreFrmRTL : 1; // Paint text as if text has LTR direction, used for
+ sal_Bool bSnapToGrid : 1; // Does paragraph snap to grid?
+ sal_Bool bIgnoreFrmRTL : 1; // Paint text as if text has LTR direction, used for
// line numbering
- BOOL bPosMatchesBounds :1; // GetCrsrOfst should not return the next
+ sal_Bool bPosMatchesBounds :1; // GetCrsrOfst should not return the next
// position if screen position is inside second
// half of bound rect, used for Accessibility
@@ -95,27 +95,27 @@ class SwDrawTextInfo
public:
#ifdef DBG_UTIL
- BOOL bPos : 1; // These flags should control, that the appropriate
- BOOL bWrong : 1; // Set-function has been called before calling
- BOOL bGrammarCheck : 1; // the Get-function of a member
- BOOL bSize : 1;
- BOOL bFnt : 1;
- BOOL bHyph : 1;
- BOOL bLeft : 1;
- BOOL bRight : 1;
- BOOL bKana : 1;
- BOOL bOfst : 1;
- BOOL bAscent: 1;
- BOOL bSperr : 1;
- BOOL bSpace : 1;
- BOOL bNumberOfBlanks : 1;
- BOOL bUppr : 1;
- BOOL bDrawSp: 1;
+ sal_Bool bPos : 1; // These flags should control, that the appropriate
+ sal_Bool bWrong : 1; // Set-function has been called before calling
+ sal_Bool bGrammarCheck : 1; // the Get-function of a member
+ sal_Bool bSize : 1;
+ sal_Bool bFnt : 1;
+ sal_Bool bHyph : 1;
+ sal_Bool bLeft : 1;
+ sal_Bool bRight : 1;
+ sal_Bool bKana : 1;
+ sal_Bool bOfst : 1;
+ sal_Bool bAscent: 1;
+ sal_Bool bSperr : 1;
+ sal_Bool bSpace : 1;
+ sal_Bool bNumberOfBlanks : 1;
+ sal_Bool bUppr : 1;
+ sal_Bool bDrawSp: 1;
#endif
SwDrawTextInfo( ViewShell *pS, OutputDevice &rO, const SwScriptInfo* pSI,
const XubString &rSt, xub_StrLen nI, xub_StrLen nL,
- USHORT nW = 0, BOOL bB = FALSE )
+ sal_uInt16 nW = 0, sal_Bool bB = sal_False )
{
pFrm = NULL;
pSh = pS;
@@ -131,11 +131,11 @@ public:
nCursorBidiLevel = 0;
bBullet = bB;
pUnderFnt = 0;
- bGreyWave = FALSE;
- bSpaceStop = FALSE;
- bSnapToGrid = FALSE;
- bIgnoreFrmRTL = FALSE;
- bPosMatchesBounds = FALSE;
+ bGreyWave = sal_False;
+ bSpaceStop = sal_False;
+ bSnapToGrid = sal_False;
+ bIgnoreFrmRTL = sal_False;
+ bPosMatchesBounds = sal_False;
// These values are initialized but, they have to be
// set explicitly via their Set-function before they may
@@ -154,15 +154,15 @@ public:
nAscent = 0;
nSperren = 0;
nSpace = 0;
- bUpper = FALSE;
- bDrawSpace = FALSE;
+ bUpper = sal_False;
+ bDrawSpace = sal_False;
#ifdef DBG_UTIL
// these flags control, whether the matching member variables have
// been set by using the Set-function before they may be accessed
// by their Get-function:
bPos = bWrong = bGrammarCheck = bSize = bFnt = bAscent = bSpace = bNumberOfBlanks = bUppr =
- bDrawSp = bLeft = bRight = bKana = bOfst = bHyph = bSperr = FALSE;
+ bDrawSp = bLeft = bRight = bKana = bOfst = bHyph = bSperr = sal_False;
#endif
}
@@ -286,18 +286,18 @@ public:
return nKanaDiff;
}
- USHORT GetWidth() const
+ sal_uInt16 GetWidth() const
{
return nWidth;
}
- USHORT GetAscent() const
+ sal_uInt16 GetAscent() const
{
ASSERT( bAscent, "DrawTextInfo: Undefined Ascent" );
return nAscent;
}
- USHORT GetKanaComp() const
+ sal_uInt16 GetKanaComp() const
{
return nCompress;
}
@@ -325,49 +325,49 @@ public:
return nNumberOfBlanks;
}
- BYTE GetCursorBidiLevel() const
+ sal_uInt8 GetCursorBidiLevel() const
{
return nCursorBidiLevel;
}
- BOOL GetBullet() const
+ sal_Bool GetBullet() const
{
return bBullet;
}
- BOOL GetUpper() const
+ sal_Bool GetUpper() const
{
ASSERT( bUppr, "DrawTextInfo: Undefined Upperflag" );
return bUpper;
}
- BOOL GetDrawSpace() const
+ sal_Bool GetDrawSpace() const
{
ASSERT( bDrawSp, "DrawTextInfo: Undefined DrawSpaceflag" );
return bDrawSpace;
}
- BOOL GetGreyWave() const
+ sal_Bool GetGreyWave() const
{
return bGreyWave;
}
- BOOL IsSpaceStop() const
+ sal_Bool IsSpaceStop() const
{
return bSpaceStop;
}
- BOOL SnapToGrid() const
+ sal_Bool SnapToGrid() const
{
return bSnapToGrid;
}
- BOOL IsIgnoreFrmRTL() const
+ sal_Bool IsIgnoreFrmRTL() const
{
return bIgnoreFrmRTL;
}
- BOOL IsPosMatchesBounds() const
+ sal_Bool IsPosMatchesBounds() const
{
return bPosMatchesBounds;
}
@@ -381,7 +381,7 @@ public:
{
pPos = &rNew;
#ifdef DBG_UTIL
- bPos = TRUE;
+ bPos = sal_True;
#endif
}
@@ -389,7 +389,7 @@ public:
{
pHyphPos = pNew;
#ifdef DBG_UTIL
- bHyph = TRUE;
+ bHyph = sal_True;
#endif
}
@@ -402,7 +402,7 @@ public:
{
pWrong = pNew;
#ifdef DBG_UTIL
- bWrong = TRUE;
+ bWrong = sal_True;
#endif
}
@@ -410,7 +410,7 @@ public:
{
pGrammarCheck = pNew;
#ifdef DBG_UTIL
- bGrammarCheck = TRUE;
+ bGrammarCheck = sal_True;
#endif
}
@@ -423,7 +423,7 @@ public:
{
pSize = &rNew;
#ifdef DBG_UTIL
- bSize = TRUE;
+ bSize = sal_True;
#endif
}
@@ -431,7 +431,7 @@ public:
{
pFnt = pNew;
#ifdef DBG_UTIL
- bFnt = TRUE;
+ bFnt = sal_True;
#endif
}
@@ -449,7 +449,7 @@ public:
{
nOfst = nNew;
#ifdef DBG_UTIL
- bOfst = TRUE;
+ bOfst = sal_True;
#endif
}
@@ -457,7 +457,7 @@ public:
{
nLeft = nNew;
#ifdef DBG_UTIL
- bLeft = TRUE;
+ bLeft = sal_True;
#endif
}
@@ -465,7 +465,7 @@ public:
{
nRight = nNew;
#ifdef DBG_UTIL
- bRight = TRUE;
+ bRight = sal_True;
#endif
}
@@ -473,20 +473,20 @@ public:
{
nKanaDiff = nNew;
#ifdef DBG_UTIL
- bKana = TRUE;
+ bKana = sal_True;
#endif
}
- void SetWidth( USHORT nNew )
+ void SetWidth( sal_uInt16 nNew )
{
nWidth = nNew;
}
- void SetAscent( USHORT nNew )
+ void SetAscent( sal_uInt16 nNew )
{
nAscent = nNew;
#ifdef DBG_UTIL
- bAscent = TRUE;
+ bAscent = sal_True;
#endif
}
@@ -508,20 +508,20 @@ public:
nSperren = 0;
}
#ifdef DBG_UTIL
- bSpace = TRUE;
- bSperr = TRUE;
+ bSpace = sal_True;
+ bSperr = sal_True;
#endif
}
void SetNumberOfBlanks( xub_StrLen nNew )
{
#ifdef DBG_UTIL
- bNumberOfBlanks = TRUE;
+ bNumberOfBlanks = sal_True;
#endif
nNumberOfBlanks = nNew;
}
- void SetCursorBidiLevel( BYTE nNew )
+ void SetCursorBidiLevel( sal_uInt8 nNew )
{
nCursorBidiLevel = nNew;
}
@@ -531,7 +531,7 @@ public:
nCompress = nNew;
}
- void SetBullet( BOOL bNew )
+ void SetBullet( sal_Bool bNew )
{
bBullet = bNew;
}
@@ -541,48 +541,48 @@ public:
pUnderFnt = pULFnt;
}
- void SetUpper( BOOL bNew )
+ void SetUpper( sal_Bool bNew )
{
bUpper = bNew;
#ifdef DBG_UTIL
- bUppr = TRUE;
+ bUppr = sal_True;
#endif
}
- void SetDrawSpace( BOOL bNew )
+ void SetDrawSpace( sal_Bool bNew )
{
bDrawSpace = bNew;
#ifdef DBG_UTIL
- bDrawSp = TRUE;
+ bDrawSp = sal_True;
#endif
}
- void SetGreyWave( BOOL bNew )
+ void SetGreyWave( sal_Bool bNew )
{
bGreyWave = bNew;
}
- void SetSpaceStop( BOOL bNew )
+ void SetSpaceStop( sal_Bool bNew )
{
bSpaceStop = bNew;
}
- void SetSnapToGrid( BOOL bNew )
+ void SetSnapToGrid( sal_Bool bNew )
{
bSnapToGrid = bNew;
}
- void SetIgnoreFrmRTL( BOOL bNew )
+ void SetIgnoreFrmRTL( sal_Bool bNew )
{
bIgnoreFrmRTL = bNew;
}
- void SetPosMatchesBounds( BOOL bNew )
+ void SetPosMatchesBounds( sal_Bool bNew )
{
bPosMatchesBounds = bNew;
}
- void Shift( USHORT nDir );
+ void Shift( sal_uInt16 nDir );
// sets a new color at the output device if necessary
// if a font is passed as argument, the change if made to the font
diff --git a/sw/source/core/inc/dview.hxx b/sw/source/core/inc/dview.hxx
index 0414ebd41be3..60021d8fef84 100644
--- a/sw/source/core/inc/dview.hxx
+++ b/sw/source/core/inc/dview.hxx
@@ -89,7 +89,7 @@ protected:
// overloaded to allow extra handling when picking SwVirtFlyDrawObj's
using FmFormView::CheckSingleSdrObjectHit;
- virtual SdrObject* CheckSingleSdrObjectHit(const Point& rPnt, USHORT nTol, SdrObject* pObj, SdrPageView* pPV, ULONG nOptions, const SetOfByte* pMVisLay) const;
+ virtual SdrObject* CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObject* pObj, SdrPageView* pPV, sal_uLong nOptions, const SetOfByte* pMVisLay) const;
public:
SwDrawView( SwViewImp &rI, SdrModel *pMd, OutputDevice* pOutDev=NULL );
@@ -103,9 +103,9 @@ public:
// Overload to resue edit background color in active text edit view (OutlinerView)
virtual void ModelHasChanged();
- virtual void ObjOrderChanged( SdrObject* pObj, ULONG nOldPos,
- ULONG nNewPos );
- virtual BOOL TakeDragLimit(SdrDragMode eMode, Rectangle& rRect) const;
+ virtual void ObjOrderChanged( SdrObject* pObj, sal_uLong nOldPos,
+ sal_uLong nNewPos );
+ virtual sal_Bool TakeDragLimit(SdrDragMode eMode, Rectangle& rRect) const;
virtual void MakeVisible( const Rectangle&, Window &rWin );
virtual void CheckPossibilities();
diff --git a/sw/source/core/inc/flowfrm.hxx b/sw/source/core/inc/flowfrm.hxx
index 634a1fbb53a1..d1290c66e989 100644
--- a/sw/source/core/inc/flowfrm.hxx
+++ b/sw/source/core/inc/flowfrm.hxx
@@ -82,12 +82,12 @@ class SwFlowFrm
//Hilfsfunktionen fuer MoveSubTree()
static SwLayoutFrm *CutTree( SwFrm* );
- static BOOL PasteTree( SwFrm *, SwLayoutFrm *, SwFrm *, SwFrm* );
+ static sal_Bool PasteTree( SwFrm *, SwLayoutFrm *, SwFrm *, SwFrm* );
//Wird fuer das Zusammenspiel von _GetPrevxxx und MoveBwd gebraucht, damit
//mehrere Blaetter gleichzeitig uebersprungen werden koennen.
//Wird auch vom MoveBwd des TabFrm ausgewertet!
- static BOOL bMoveBwdJump;
+ static sal_Bool bMoveBwdJump;
/** helper method to determine previous frame for calculation of the
upper space
@@ -125,37 +125,37 @@ protected:
SwFlowFrm *pFollow;
- BOOL bIsFollow :1; //Ist's ein Follow
- BOOL bLockJoin :1; //Join (und damit deleten) verboten wenn TRUE!
- BOOL bUndersized:1; // wir sind kleiner als gewuenscht
- BOOL bFtnAtEnd :1; // For sectionfrms only: footnotes at the end of section
- BOOL bEndnAtEnd :1; // " " " : endnotes at the end of section
- BOOL bCntntLock :1; // " " " : content locked
- BOOL bOwnFtnNum :1; // " " " : special numbering of footnotes
- BOOL bFtnLock :1; // " " " : ftn, don't leave this section bwd
- BOOL bFlyLock :1; // Stop positioning of at-character flyframes
+ sal_Bool bIsFollow :1; //Ist's ein Follow
+ sal_Bool bLockJoin :1; //Join (und damit deleten) verboten wenn sal_True!
+ sal_Bool bUndersized:1; // wir sind kleiner als gewuenscht
+ sal_Bool bFtnAtEnd :1; // For sectionfrms only: footnotes at the end of section
+ sal_Bool bEndnAtEnd :1; // " " " : endnotes at the end of section
+ sal_Bool bCntntLock :1; // " " " : content locked
+ sal_Bool bOwnFtnNum :1; // " " " : special numbering of footnotes
+ sal_Bool bFtnLock :1; // " " " : ftn, don't leave this section bwd
+ sal_Bool bFlyLock :1; // Stop positioning of at-character flyframes
//Prueft ob Vorwaertsfluss noch Sinn macht Endloswanderschaften (unterbinden)
- inline BOOL IsFwdMoveAllowed();
+ inline sal_Bool IsFwdMoveAllowed();
// --> OD 2005-03-08 #i44049# - method <CalcCntnt(..)> has to check this property.
friend void CalcCntnt( SwLayoutFrm *pLay, bool bNoColl, bool bNoCalcFollow );
// <--
- BOOL IsKeepFwdMoveAllowed(); //Wie oben, Move fuer Keep.
+ sal_Bool IsKeepFwdMoveAllowed(); //Wie oben, Move fuer Keep.
//Prueft ob ein Obj das Umlauf wuenscht ueberlappt.
//eine Null bedeutet, kein Objekt ueberlappt,
// 1 heisst, Objekte, die am FlowFrm selbst verankert sind, ueberlappen
// 2 heisst, Objekte, die woanders verankert sind, ueberlappen
// 3 heistt, beiderlei verankerte Objekte ueberlappen
- BYTE BwdMoveNecessary( const SwPageFrm *pPage, const SwRect &rRect );
+ sal_uInt8 BwdMoveNecessary( const SwPageFrm *pPage, const SwRect &rRect );
- void LockJoin() { bLockJoin = TRUE; }
- void UnlockJoin() { bLockJoin = FALSE; }
+ void LockJoin() { bLockJoin = sal_True; }
+ void UnlockJoin() { bLockJoin = sal_False; }
- BOOL CheckMoveFwd( BOOL &rbMakePage, BOOL bKeep, BOOL bMovedBwd );
- BOOL MoveFwd( BOOL bMakePage, BOOL bPageBreak, BOOL bMoveAlways = FALSE );
- virtual BOOL ShouldBwdMoved( SwLayoutFrm *pNewUpper, BOOL bHead, BOOL &rReformat )=0;
- BOOL MoveBwd( BOOL &rbReformat );
+ sal_Bool CheckMoveFwd( sal_Bool &rbMakePage, sal_Bool bKeep, sal_Bool bMovedBwd );
+ sal_Bool MoveFwd( sal_Bool bMakePage, sal_Bool bPageBreak, sal_Bool bMoveAlways = sal_False );
+ virtual sal_Bool ShouldBwdMoved( SwLayoutFrm *pNewUpper, sal_Bool bHead, sal_Bool &rReformat )=0;
+ sal_Bool MoveBwd( sal_Bool &rbReformat );
public:
SwFlowFrm( SwFrm &rFrm );
@@ -163,48 +163,48 @@ public:
const SwFrm *GetFrm() const { return &rThis; }
SwFrm *GetFrm() { return &rThis; }
- static BOOL IsMoveBwdJump() { return bMoveBwdJump; }
- static void SetMoveBwdJump( BOOL bNew ){ bMoveBwdJump = bNew; }
+ static sal_Bool IsMoveBwdJump() { return bMoveBwdJump; }
+ static void SetMoveBwdJump( sal_Bool bNew ){ bMoveBwdJump = bNew; }
- inline void SetUndersized( const BOOL bNew ) { bUndersized = bNew; }
- inline BOOL IsUndersized() const { return bUndersized; }
+ inline void SetUndersized( const sal_Bool bNew ) { bUndersized = bNew; }
+ inline sal_Bool IsUndersized() const { return bUndersized; }
- BOOL IsPrevObjMove() const;
+ sal_Bool IsPrevObjMove() const;
//Die Kette mit minimalen Operationen und Benachrichtigungen unter den
//neuen Parent Moven.
void MoveSubTree( SwLayoutFrm* pParent, SwFrm* pSibling = 0 );
- BOOL HasFollow() const { return pFollow ? TRUE : FALSE; }
- BOOL IsFollow() const { return bIsFollow; }
- inline void _SetIsFollow( BOOL bSet ) { bIsFollow = bSet; }
+ sal_Bool HasFollow() const { return pFollow ? sal_True : sal_False; }
+ sal_Bool IsFollow() const { return bIsFollow; }
+ inline void _SetIsFollow( sal_Bool bSet ) { bIsFollow = bSet; }
const SwFlowFrm *GetFollow() const { return pFollow; }
SwFlowFrm *GetFollow() { return pFollow; }
- BOOL IsAnFollow( const SwFlowFrm *pFlow ) const;
+ sal_Bool IsAnFollow( const SwFlowFrm *pFlow ) const;
inline void SetFollow( SwFlowFrm *pNew ) { pFollow = pNew; }
sal_Bool IsJoinLocked() const { return bLockJoin; }
sal_Bool IsAnyJoinLocked() const { return bLockJoin || HasLockedFollow(); }
- BOOL IsFtnAtEnd() const { return bFtnAtEnd; }
- BOOL IsEndnAtEnd() const { return bEndnAtEnd; }
- BOOL IsAnyNoteAtEnd() const { return bFtnAtEnd || bEndnAtEnd; }
- BOOL AreNotesAtEnd() const { return bFtnAtEnd && bEndnAtEnd; }
+ sal_Bool IsFtnAtEnd() const { return bFtnAtEnd; }
+ sal_Bool IsEndnAtEnd() const { return bEndnAtEnd; }
+ sal_Bool IsAnyNoteAtEnd() const { return bFtnAtEnd || bEndnAtEnd; }
+ sal_Bool AreNotesAtEnd() const { return bFtnAtEnd && bEndnAtEnd; }
- BOOL IsPageBreak( BOOL bAct ) const;
- BOOL IsColBreak( BOOL bAct ) const;
+ sal_Bool IsPageBreak( sal_Bool bAct ) const;
+ sal_Bool IsColBreak( sal_Bool bAct ) const;
//Ist ein Keep zu beruecksichtigen (Breaks!)
- BOOL IsKeep( const SwAttrSet& rAttrs, bool bBreakCheck = false ) const;
+ sal_Bool IsKeep( const SwAttrSet& rAttrs, bool bBreakCheck = false ) const;
sal_Bool HasLockedFollow() const;
- BOOL HasParaSpaceAtPages( BOOL bSct ) const;
+ sal_Bool HasParaSpaceAtPages( sal_Bool bSct ) const;
/** method to determine the upper space hold by the frame
OD 2004-03-12 #i11860# - add 3rd parameter <_bConsiderGrid> to get
the upper space with and without considering the page grid
- (default value: <TRUE>)
+ (default value: <sal_True>)
@author ?
*/
@@ -249,14 +249,14 @@ public:
void CheckKeep();
- void SetFtnLock( BOOL bNew ){ bFtnLock = bNew; }
- BOOL IsFtnLock() const { return bFtnLock; }
- void SetFlyLock( BOOL bNew ){ bFlyLock = bNew; }
- BOOL IsFlyLock() const { return bFlyLock; }
- void SetOwnFtnNum( BOOL bNew ){ bOwnFtnNum = bNew; }
- BOOL IsOwnFtnNum() const { return bOwnFtnNum; }
- void SetCntntLock( BOOL bNew ){ bCntntLock = bNew; }
- BOOL IsCntntLocked() const { return bCntntLock; }
+ void SetFtnLock( sal_Bool bNew ){ bFtnLock = bNew; }
+ sal_Bool IsFtnLock() const { return bFtnLock; }
+ void SetFlyLock( sal_Bool bNew ){ bFlyLock = bNew; }
+ sal_Bool IsFlyLock() const { return bFlyLock; }
+ void SetOwnFtnNum( sal_Bool bNew ){ bOwnFtnNum = bNew; }
+ sal_Bool IsOwnFtnNum() const { return bOwnFtnNum; }
+ void SetCntntLock( sal_Bool bNew ){ bCntntLock = bNew; }
+ sal_Bool IsCntntLocked() const { return bCntntLock; }
//casten einen Frm auf einen FlowFrm - wenns denn einer ist, sonst 0
//Diese Methoden muessen fuer neue Ableitungen geaendert werden!
@@ -264,7 +264,7 @@ public:
static const SwFlowFrm *CastFlowFrm( const SwFrm *pFrm );
};
-inline BOOL SwFlowFrm::IsFwdMoveAllowed()
+inline sal_Bool SwFlowFrm::IsFwdMoveAllowed()
{
return rThis.GetIndPrev() != 0;
}
diff --git a/sw/source/core/inc/flyfrm.hxx b/sw/source/core/inc/flyfrm.hxx
index 0b957911cd8b..bd57549a41c5 100644
--- a/sw/source/core/inc/flyfrm.hxx
+++ b/sw/source/core/inc/flyfrm.hxx
@@ -50,24 +50,33 @@ class SwFmt;
//fuer Ankerwechsel benoetigt.
//implementiert in layout/flycnt.cxx
const SwCntntFrm *FindAnchor( const SwFrm *pOldAnch, const Point &rNew,
- const BOOL bBody = FALSE );
+ const sal_Bool bBody = sal_False );
// berechnet das Rechteck, in dem das Objekt bewegt bzw. resized werden darf
-BOOL CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, BOOL bMove = TRUE );
+sal_Bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, sal_Bool bMove = sal_True );
//allg. Basisklasse fuer alle Freifliegenden Rahmen
// OD 2004-03-22 #i26791# - inherit also from <SwAnchoredFlyFrm>
class SwFlyFrm : public SwLayoutFrm, public SwAnchoredObject
{
//darf Locken. Definiert in frmtool.cxx
+<<<<<<< local
friend void AppendObjs ( const SwSpzFrmFmts *, ULONG, SwFrm *, SwPageFrm * );
+=======
+ friend void AppendObjs ( const SwSpzFrmFmts *, sal_uLong, SwFrm *, SwPageFrm * );
+ friend void AppendAllObjs( const SwSpzFrmFmts * );
+>>>>>>> other
friend void Notify( SwFlyFrm *, SwPageFrm *pOld, const SwRect &rOld,
const SwRect* pOldPrt );
- void InitDrawObj( BOOL bNotify ); //Wird von den CToren gerufen.
+ void InitDrawObj( sal_Bool bNotify ); //Wird von den CToren gerufen.
void FinitDrawObj(); //Wird vom CTor gerufen.
+<<<<<<< local
void _UpdateAttr( const SfxPoolItem*, const SfxPoolItem*, BYTE &,
+=======
+ void _UpdateAttr( SfxPoolItem*, SfxPoolItem*, sal_uInt8 &,
+>>>>>>> other
SwAttrSetChg *pa = 0, SwAttrSetChg *pb = 0 );
using SwLayoutFrm::CalcRel;
@@ -84,7 +93,7 @@ protected:
// Point aRelPos; //Die Relative Position zum Master
private:
- BOOL bLocked :1; //Cntnt-gebundene Flys muessen derart blockiert werden
+ sal_Bool bLocked :1; //Cntnt-gebundene Flys muessen derart blockiert werden
//koennen, dass sie nicht Formatiert werden; :MakeAll
//returnt dann sofort. Dies ist bei Seitenwechseln
//waehrend der Formatierung notwendig.
@@ -92,31 +101,31 @@ private:
//sonst der Anker formatiert wird obwohl die Root noch
//nicht korrekt an der Shell haengt und weil sonst
//initial zuviel Formatiert wuerde.
- BOOL bNotifyBack:1; //TRUE wenn am Ende eines MakeAll() der Background
+ sal_Bool bNotifyBack:1; //sal_True wenn am Ende eines MakeAll() der Background
//vom NotifyDTor benachrichtigt werden muss.
protected:
- BOOL bInvalid :1; //Pos, PrtArea od. SSize wurden Invalidiert, sie werden
+ sal_Bool bInvalid :1; //Pos, PrtArea od. SSize wurden Invalidiert, sie werden
//gleich wieder Validiert, denn sie muessen _immer_
//gueltig sein. Damit in LayAction korrekt gearbeitet
//werden kann muss hier festgehalten werden, dass sie
//invalidiert wurden. Ausnahmen bestaetigen die Regelt!
- BOOL bMinHeight:1; //TRUE wenn die vom Attribut vorgegebene Hoehe eine
+ sal_Bool bMinHeight:1; //sal_True wenn die vom Attribut vorgegebene Hoehe eine
//eine Minimalhoehe ist (der Frm also bei Bedarf
//darueberhinaus wachsen kann).
- BOOL bHeightClipped :1; //TRUE wenn der Fly nicht die Pos/Size anhand der Attrs
- BOOL bWidthClipped :1; //formatieren konnte, weil z.B. nicht genug Raum vorh.
+ sal_Bool bHeightClipped :1; //sal_True wenn der Fly nicht die Pos/Size anhand der Attrs
+ sal_Bool bWidthClipped :1; //formatieren konnte, weil z.B. nicht genug Raum vorh.
//war.
- BOOL bFormatHeightOnly :1; //Damit nach einer Anpassung der Breite
+ sal_Bool bFormatHeightOnly :1; //Damit nach einer Anpassung der Breite
//(CheckClip) nur das Format aufgerufen wird;
//nicht aber die Breite anhand der Attribute
//wieder bestimmt wird.
- BOOL bInCnt :1; // FLY_AS_CHAR, anchored as character
- BOOL bAtCnt :1; // FLY_AT_PARA, anchored at paragraph
- BOOL bLayout :1; // FLY_AT_PAGE, FLY_AT_FLY, at page or at frame
- BOOL bAutoPosition :1; // FLY_AT_CHAR, anchored at character
- BOOL bNoShrink :1; // temporary forbud of shrinking to avoid loops
- BOOL bLockDeleteContent :1; // If the flag is set, the content of the
+ sal_Bool bInCnt :1; // FLY_AS_CHAR, anchored as character
+ sal_Bool bAtCnt :1; // FLY_AT_PARA, anchored at paragraph
+ sal_Bool bLayout :1; // FLY_AT_PAGE, FLY_AT_FLY, at page or at frame
+ sal_Bool bAutoPosition :1; // FLY_AT_CHAR, anchored at character
+ sal_Bool bNoShrink :1; // temporary forbud of shrinking to avoid loops
+ sal_Bool bLockDeleteContent :1; // If the flag is set, the content of the
// fly frame is not deleted if moved to
// invisible layer.
@@ -127,11 +136,11 @@ protected:
virtual void Format( const SwBorderAttrs *pAttrs = 0 );
void MakePrtArea( const SwBorderAttrs &rAttrs );
- void Lock() { bLocked = TRUE; }
- void Unlock() { bLocked = FALSE; }
+ void Lock() { bLocked = sal_True; }
+ void Unlock() { bLocked = sal_False; }
- void SetMinHeight() { bMinHeight = TRUE; }
- void ResetMinHeight(){ bMinHeight = FALSE; }
+ void SetMinHeight() { bMinHeight = sal_True; }
+ void ResetMinHeight(){ bMinHeight = sal_False; }
Size CalcRel( const SwFmtFrmSize &rSz ) const;
SwTwips CalcAutoWidth() const;
@@ -159,24 +168,24 @@ public:
virtual ~SwFlyFrm();
// erfrage vom Client Informationen
- virtual BOOL GetInfo( SfxPoolItem& ) const;
+ virtual sal_Bool GetInfo( SfxPoolItem& ) const;
virtual void Paint( SwRect const&,
SwPrintData const*const pPrintData = NULL ) const;
virtual Size ChgSize( const Size& aNewSize );
- virtual BOOL GetCrsrOfst( SwPosition *, Point&,
+ virtual sal_Bool GetCrsrOfst( SwPosition *, Point&,
SwCrsrMoveState* = 0 ) const;
- virtual void CheckDirection( BOOL bVert );
+ virtual void CheckDirection( sal_Bool bVert );
virtual void Cut();
#ifdef DBG_UTIL
virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 );
#endif
- SwTwips _Shrink( SwTwips, BOOL bTst );
- SwTwips _Grow ( SwTwips, BOOL bTst );
+ SwTwips _Shrink( SwTwips, sal_Bool bTst );
+ SwTwips _Grow ( SwTwips, sal_Bool bTst );
void _Invalidate( SwPageFrm *pPage = 0 );
- BOOL FrmSizeChg( const SwFmtFrmSize & );
+ sal_Bool FrmSizeChg( const SwFmtFrmSize & );
SwFlyFrm *GetPrevLink() const { return pPrevLink; }
SwFlyFrm *GetNextLink() const { return pNextLink; }
@@ -192,33 +201,33 @@ public:
void NotifyDrawObj();
void ChgRelPos( const Point &rAbsPos );
- BOOL IsInvalid() const { return bInvalid; }
- void Invalidate() const { ((SwFlyFrm*)this)->bInvalid = TRUE; }
- void Validate() const { ((SwFlyFrm*)this)->bInvalid = FALSE; }
-
- BOOL IsMinHeight() const { return bMinHeight; }
- BOOL IsLocked() const { return bLocked; }
- BOOL IsAutoPos() const { return bAutoPosition; }
- BOOL IsFlyInCntFrm() const { return bInCnt; }
- BOOL IsFlyFreeFrm() const { return bAtCnt || bLayout; }
- BOOL IsFlyLayFrm() const { return bLayout; }
- BOOL IsFlyAtCntFrm() const { return bAtCnt; }
-
- BOOL IsNotifyBack() const { return bNotifyBack; }
- void SetNotifyBack() { bNotifyBack = TRUE; }
- void ResetNotifyBack() { bNotifyBack = FALSE; }
- BOOL IsNoShrink() const { return bNoShrink; }
- void SetNoShrink( BOOL bNew ) { bNoShrink = bNew; }
- BOOL IsLockDeleteContent() const { return bLockDeleteContent; }
- void SetLockDeleteContent( BOOL bNew ) { bLockDeleteContent = bNew; }
-
-
- BOOL IsClipped() const { return bHeightClipped || bWidthClipped; }
- BOOL IsHeightClipped() const { return bHeightClipped; }
- BOOL IsWidthClipped() const { return bWidthClipped; }
-
- BOOL IsLowerOf( const SwLayoutFrm* pUpper ) const;
- inline BOOL IsUpperOf( const SwFlyFrm& _rLower ) const
+ sal_Bool IsInvalid() const { return bInvalid; }
+ void Invalidate() const { ((SwFlyFrm*)this)->bInvalid = sal_True; }
+ void Validate() const { ((SwFlyFrm*)this)->bInvalid = sal_False; }
+
+ sal_Bool IsMinHeight() const { return bMinHeight; }
+ sal_Bool IsLocked() const { return bLocked; }
+ sal_Bool IsAutoPos() const { return bAutoPosition; }
+ sal_Bool IsFlyInCntFrm() const { return bInCnt; }
+ sal_Bool IsFlyFreeFrm() const { return bAtCnt || bLayout; }
+ sal_Bool IsFlyLayFrm() const { return bLayout; }
+ sal_Bool IsFlyAtCntFrm() const { return bAtCnt; }
+
+ sal_Bool IsNotifyBack() const { return bNotifyBack; }
+ void SetNotifyBack() { bNotifyBack = sal_True; }
+ void ResetNotifyBack() { bNotifyBack = sal_False; }
+ sal_Bool IsNoShrink() const { return bNoShrink; }
+ void SetNoShrink( sal_Bool bNew ) { bNoShrink = bNew; }
+ sal_Bool IsLockDeleteContent() const { return bLockDeleteContent; }
+ void SetLockDeleteContent( sal_Bool bNew ) { bLockDeleteContent = bNew; }
+
+
+ sal_Bool IsClipped() const { return bHeightClipped || bWidthClipped; }
+ sal_Bool IsHeightClipped() const { return bHeightClipped; }
+ sal_Bool IsWidthClipped() const { return bWidthClipped; }
+
+ sal_Bool IsLowerOf( const SwLayoutFrm* pUpper ) const;
+ inline sal_Bool IsUpperOf( const SwFlyFrm& _rLower ) const
{
return _rLower.IsLowerOf( this );
}
@@ -227,12 +236,12 @@ public:
// OD 16.04.2003 #i13147# - add parameter <_bForPaint> to avoid load of
// the graphic during paint. Default value: sal_False
- BOOL GetContour( PolyPolygon& rContour,
+ sal_Bool GetContour( PolyPolygon& rContour,
const sal_Bool _bForPaint = sal_False ) const;
//Auf dieser Shell painten (PreView, Print-Flag usw. rekursiv beachten)?.
- static BOOL IsPaint( SdrObject *pObj, const ViewShell *pSh );
+ static sal_Bool IsPaint( SdrObject *pObj, const ViewShell *pSh );
/** SwFlyFrm::IsBackgroundTransparent - for feature #99657#
diff --git a/sw/source/core/inc/flyfrms.hxx b/sw/source/core/inc/flyfrms.hxx
index b76aadb871ad..a0a2d9dd1619 100644
--- a/sw/source/core/inc/flyfrms.hxx
+++ b/sw/source/core/inc/flyfrms.hxx
@@ -184,8 +184,8 @@ class SwFlyInCntFrm : public SwFlyFrm
Point aRef; //Relativ zu diesem Point wird die AbsPos berechnet.
long nLine; //Zeilenhoehe, Ref.Y() - nLine == Zeilenanfang.
- BOOL bInvalidLayout :1;
- BOOL bInvalidCntnt :1;
+ sal_Bool bInvalidLayout :1;
+ sal_Bool bInvalidCntnt :1;
protected:
virtual void NotifyBackground( SwPageFrm *pPage,
@@ -212,9 +212,9 @@ public:
inline void InvalidateCntnt() const;
inline void ValidateLayout() const;
inline void ValidateCntnt() const;
- BOOL IsInvalid() const { return (bInvalidLayout || bInvalidCntnt); }
- BOOL IsInvalidLayout() const { return bInvalidLayout; }
- BOOL IsInvalidCntnt() const { return bInvalidCntnt; }
+ sal_Bool IsInvalid() const { return (bInvalidLayout || bInvalidCntnt); }
+ sal_Bool IsInvalidLayout() const { return bInvalidLayout; }
+ sal_Bool IsInvalidCntnt() const { return bInvalidCntnt; }
//BP 26.11.93: vgl. tabfrm.hxx, gilt bestimmt aber fuer andere auch...
@@ -239,19 +239,19 @@ public:
inline void SwFlyInCntFrm::InvalidateLayout() const
{
- ((SwFlyInCntFrm*)this)->bInvalidLayout = TRUE;
+ ((SwFlyInCntFrm*)this)->bInvalidLayout = sal_True;
}
inline void SwFlyInCntFrm::InvalidateCntnt() const
{
- ((SwFlyInCntFrm*)this)->bInvalidCntnt = TRUE;
+ ((SwFlyInCntFrm*)this)->bInvalidCntnt = sal_True;
}
inline void SwFlyInCntFrm::ValidateLayout() const
{
- ((SwFlyInCntFrm*)this)->bInvalidLayout = FALSE;
+ ((SwFlyInCntFrm*)this)->bInvalidLayout = sal_False;
}
inline void SwFlyInCntFrm::ValidateCntnt() const
{
- ((SwFlyInCntFrm*)this)->bInvalidCntnt = FALSE;
+ ((SwFlyInCntFrm*)this)->bInvalidCntnt = sal_False;
}
#endif
diff --git a/sw/source/core/inc/fntcache.hxx b/sw/source/core/inc/fntcache.hxx
index f49a69b5e992..c95fc3f0a8bc 100644
--- a/sw/source/core/inc/fntcache.hxx
+++ b/sw/source/core/inc/fntcache.hxx
@@ -66,7 +66,7 @@ public:
// Font-Cache, globale Variable, in txtinit.Cxx angelegt/zerstoert
extern SwFntCache *pFntCache;
extern SwFntObj *pLastFont;
-extern BYTE *pMagicNo;
+extern sal_uInt8 *pMagicNo;
extern Color *pWaveCol;
/*************************************************************************
@@ -83,16 +83,16 @@ class SwFntObj : public SwCacheObj
Font *pScrFont;
Font *pPrtFont;
OutputDevice* pPrinter;
- USHORT nGuessedLeading;
- USHORT nExtLeading;
- USHORT nScrAscent;
- USHORT nPrtAscent;
- USHORT nScrHeight;
- USHORT nPrtHeight;
- USHORT nPropWidth;
- USHORT nZoom;
- BOOL bSymbol : 1;
- BOOL bPaintBlank : 1;
+ sal_uInt16 nGuessedLeading;
+ sal_uInt16 nExtLeading;
+ sal_uInt16 nScrAscent;
+ sal_uInt16 nPrtAscent;
+ sal_uInt16 nScrHeight;
+ sal_uInt16 nPrtHeight;
+ sal_uInt16 nPropWidth;
+ sal_uInt16 nZoom;
+ sal_Bool bSymbol : 1;
+ sal_Bool bPaintBlank : 1;
static long nPixWidth;
static MapMode *pPixMap;
@@ -100,8 +100,8 @@ class SwFntObj : public SwCacheObj
// SMARTTAGS
void calcLinePos(SwDrawTextInfo& rInf, Point& aStart, Point& aEnd, xub_StrLen nStart,
- xub_StrLen nWrLen, xub_StrLen nCnt, const BOOL bSwitchH2V, const BOOL bSwitchL2R,
- long nHalfSpace, long* pKernArray, const BOOL bBidiPor);
+ xub_StrLen nWrLen, xub_StrLen nCnt, const sal_Bool bSwitchH2V, const sal_Bool bSwitchL2R,
+ long nHalfSpace, long* pKernArray, const sal_Bool bBidiPor);
public:
DECL_FIXEDMEMPOOL_NEWDEL(SwFntObj)
@@ -115,20 +115,20 @@ public:
inline Font *GetFont() { return &aFont; }
inline const Font *GetFont() const { return &aFont; }
- inline USHORT GetGuessedLeading() const { return nGuessedLeading; }
- inline USHORT GetExtLeading() const { return nExtLeading; }
+ inline sal_uInt16 GetGuessedLeading() const { return nGuessedLeading; }
+ inline sal_uInt16 GetExtLeading() const { return nExtLeading; }
- USHORT GetFontAscent( const ViewShell *pSh, const OutputDevice& rOut );
- USHORT GetFontHeight( const ViewShell *pSh, const OutputDevice& rOut );
- USHORT GetFontLeading( const ViewShell *pSh, const OutputDevice& rOut );
+ sal_uInt16 GetFontAscent( const ViewShell *pSh, const OutputDevice& rOut );
+ sal_uInt16 GetFontHeight( const ViewShell *pSh, const OutputDevice& rOut );
+ sal_uInt16 GetFontLeading( const ViewShell *pSh, const OutputDevice& rOut );
void GuessLeading( const ViewShell& rSh, const FontMetric& rMet );
void SetDevFont( const ViewShell *pSh, OutputDevice& rOut );
inline OutputDevice* GetPrt() const { return pPrinter; }
- inline USHORT GetZoom() const { return nZoom; }
- inline USHORT GetPropWidth() const { return nPropWidth; }
- inline BOOL IsSymbol() const { return bSymbol; }
+ inline sal_uInt16 GetZoom() const { return nZoom; }
+ inline sal_uInt16 GetPropWidth() const { return nPropWidth; }
+ inline sal_Bool IsSymbol() const { return bSymbol; }
void DrawText( SwDrawTextInfo &rInf );
Size GetTextSize( SwDrawTextInfo &rInf );
@@ -150,9 +150,9 @@ protected:
virtual SwCacheObj *NewObj( );
public:
- SwFntAccess( const void * &rMagic, USHORT &rIndex, const void *pOwner,
+ SwFntAccess( const void * &rMagic, sal_uInt16 &rIndex, const void *pOwner,
ViewShell *pShell,
- BOOL bCheck = FALSE );
+ sal_Bool bCheck = sal_False );
inline SwFntObj* Get() { return (SwFntObj*) SwCacheAccess::Get(); };
};
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index 7e9a9d99c8e4..62ed01cce55d 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -135,8 +135,8 @@ class SwAnchoredObject;
class SwFrm;
typedef long (SwFrm:: *SwFrmGet)() const;
-typedef BOOL (SwFrm:: *SwFrmMax)( long );
-typedef void (SwFrm:: *SwFrmMakePos)( const SwFrm*, const SwFrm*, BOOL );
+typedef sal_Bool (SwFrm:: *SwFrmMax)( long );
+typedef void (SwFrm:: *SwFrmMakePos)( const SwFrm*, const SwFrm*, sal_Bool );
typedef long (*SwOperator)( long, long );
typedef void (SwFrm:: *SwFrmSet)( long, long );
@@ -344,9 +344,13 @@ class SwFrm: public SwClient, public SfxBroadcaster
SwCntntFrm* _FindPrevCnt( const bool _bInSameFtn = false );
+<<<<<<< local
void _UpdateAttrFrm( const SfxPoolItem*, const SfxPoolItem*, BYTE & );
+=======
+ void _UpdateAttrFrm( SfxPoolItem*, SfxPoolItem*, sal_uInt8 & );
+>>>>>>> other
SwFrm* _GetIndNext();
- void SetDirFlags( BOOL bVert );
+ void SetDirFlags( sal_Bool bVert );
SwFrm( SwFrm & ); //Kopieren ist nicht erlaubt.
@@ -358,52 +362,56 @@ protected:
SwRect aFrm; //Absolute Dokumentposition und groesse des Frm
SwRect aPrt; //Position der PrtArea rel zum Frm und groesse der PrtArea
- USHORT bFlag01: 1;
- USHORT bFlag02: 1;
- USHORT bFlag03: 1;
- USHORT bFlag04: 1;
- USHORT bFlag05: 1;
- USHORT bReverse: 1; // Next line above/at the right side instead
+ sal_uInt16 bFlag01: 1;
+ sal_uInt16 bFlag02: 1;
+ sal_uInt16 bFlag03: 1;
+ sal_uInt16 bFlag04: 1;
+ sal_uInt16 bFlag05: 1;
+ sal_uInt16 bReverse: 1; // Next line above/at the right side instead
// under/at the left side of the previous line.
- USHORT bInvalidR2L: 1;
- USHORT bDerivedR2L: 1;
- USHORT bRightToLeft: 1;
- USHORT bInvalidVert: 1;
- USHORT bDerivedVert: 1;
- USHORT bVertical: 1;
- USHORT nType: 4; //Who am I?
-
- BOOL bValidPos: 1;
- BOOL bValidPrtArea: 1;
- BOOL bValidSize: 1;
- BOOL bValidLineNum: 1;
- BOOL bFixSize: 1;
- BOOL bUnUsed1: 1;
- BOOL bCompletePaint: 1; //Frame wird ganz gepaintet wenn TRUE, auch
+ sal_uInt16 bInvalidR2L: 1;
+ sal_uInt16 bDerivedR2L: 1;
+ sal_uInt16 bRightToLeft: 1;
+ sal_uInt16 bInvalidVert: 1;
+ sal_uInt16 bDerivedVert: 1;
+ sal_uInt16 bVertical: 1;
+ sal_uInt16 nType: 4; //Who am I?
+
+ sal_Bool bValidPos: 1;
+ sal_Bool bValidPrtArea: 1;
+ sal_Bool bValidSize: 1;
+ sal_Bool bValidLineNum: 1;
+ sal_Bool bFixSize: 1;
+ sal_Bool bUnUsed1: 1;
+ sal_Bool bCompletePaint: 1; //Frame wird ganz gepaintet wenn sal_True, auch
//wenn der Inhalt nur teilw. veraendert ist;
- //Bei CntntFrms wird ausschliesslich wenn TRUE
+ //Bei CntntFrms wird ausschliesslich wenn sal_True
//der Border (von Action) gemalt.
- BOOL bRetouche: 1; //Der Frame ist fuer Retusche verantwortlich
- //wenn TRUE.
+ sal_Bool bRetouche: 1; //Der Frame ist fuer Retusche verantwortlich
+ //wenn sal_True.
public:
- BOOL bUnUsed2: 1;
+ sal_Bool bUnUsed2: 1;
protected:
- BOOL bInfInvalid: 1; //InfoFlags sind Invalid.
- BOOL bInfBody: 1; //Frm steht im DokumentBody.
- BOOL bInfTab: 1; //Frm steht in einer Tabelle.
- BOOL bInfFly: 1; //Frm steht in einem Fly.
- BOOL bInfFtn: 1; //Frm steht in einer Fussnote.
- BOOL bInfSct: 1; //Frm steht in einem Bereich.
- BOOL bColLocked: 1; //Grow/Shrink sperren bei spaltigen Section-
+ sal_Bool bInfInvalid: 1; //InfoFlags sind Invalid.
+ sal_Bool bInfBody: 1; //Frm steht im DokumentBody.
+ sal_Bool bInfTab: 1; //Frm steht in einer Tabelle.
+ sal_Bool bInfFly: 1; //Frm steht in einem Fly.
+ sal_Bool bInfFtn: 1; //Frm steht in einer Fussnote.
+ sal_Bool bInfSct: 1; //Frm steht in einem Bereich.
+ sal_Bool bColLocked: 1; //Grow/Shrink sperren bei spaltigen Section-
//oder Fly-Frames, wird im Format gesetzt
- void ColLock() { bColLocked = TRUE; }
- void ColUnlock() { bColLocked = FALSE; }
+ void ColLock() { bColLocked = sal_True; }
+ void ColUnlock() { bColLocked = sal_False; }
+<<<<<<< local
// Only used by SwRootFrm Ctor to get 'this' into mpRoot...
void setRootFrm( SwRootFrm* pRoot ) { mpRoot = pRoot; }
SwPageFrm *InsertPage( SwPageFrm *pSibling, BOOL bFtn );
+=======
+ SwPageFrm *InsertPage( SwPageFrm *pSibling, sal_Bool bFtn );
+>>>>>>> other
void PrepareMake();
void OptPrepareMake();
void MakePos();
@@ -415,19 +423,19 @@ protected:
// <--
virtual void MakeAll() = 0;
//Adjustierung der Frames einer Seite
- SwTwips AdjustNeighbourhood( SwTwips nDiff, BOOL bTst = FALSE );
+ SwTwips AdjustNeighbourhood( SwTwips nDiff, sal_Bool bTst = sal_False );
//Aendern nur die Framesize, nicht die PrtArea-SSize
- virtual SwTwips ShrinkFrm( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE ) = 0;
- virtual SwTwips GrowFrm ( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE ) = 0;
+ 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 GetRegisteredInNonConst(); }
const SwModify *GetDep() const { return GetRegisteredIn(); }
SwFrm( SwModify*, SwFrm* );
- void CheckDir( UINT16 nDir, BOOL bVert, BOOL bOnlyBiDi, BOOL bBrowse );
+ void CheckDir( sal_uInt16 nDir, sal_Bool bVert, sal_Bool bOnlyBiDi, sal_Bool bBrowse );
/** enumeration for the different invalidations
@@ -452,7 +460,7 @@ protected:
OD 2004-05-19 #i28701#
Method has *only* to contain actions, which has to be performed on
- *every* assignment of the corresponding flag to <FALSE>.
+ *every* assignment of the corresponding flag to <sal_False>.
@author OD
*/
@@ -465,15 +473,15 @@ protected:
public:
TYPEINFO(); //Bereits in Basisklasse Client drin.
- USHORT GetType() const { return 0x1 << nType; }
+ sal_uInt16 GetType() const { return 0x1 << nType; }
static SwCache &GetCache() { return *pCache; }
static SwCache *GetCachePtr() { return pCache; }
static void SetCache( SwCache *pNew ) { pCache = pNew; }
//Aendern die PrtArea-SSize und die FrmSize.
- SwTwips Shrink( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE );
- SwTwips Grow ( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE );
+ SwTwips Shrink( SwTwips, sal_Bool bTst = sal_False, sal_Bool bInfo = sal_False );
+ SwTwips Grow ( SwTwips, sal_Bool bTst = sal_False, sal_Bool bInfo = sal_False );
//Wir brauchen unterschiedliche Methoden (wg. Performance) fuer das
//Einfuegenin den Layout Baum:
@@ -490,7 +498,7 @@ public:
//For internal use only; wer es anders macht wird
//in einen Sack gesteckt und muss zwei Tage drin hocken bleiben.
//Fuert Spezialbehandlung fuer _Get[Next|Prev]Leaf() durch (Tabellen).
- SwLayoutFrm *GetLeaf( MakePageType eMakePage, BOOL bFwd );
+ SwLayoutFrm *GetLeaf( MakePageType eMakePage, sal_Bool bFwd );
SwLayoutFrm *GetNextLeaf ( MakePageType eMakePage );
SwLayoutFrm *GetNextFtnLeaf( MakePageType eMakePage );
SwLayoutFrm *GetNextSctLeaf( MakePageType eMakePage );
@@ -499,10 +507,10 @@ public:
SwLayoutFrm *GetPrevFtnLeaf( MakePageType eMakeFtn = MAKEPAGE_FTN );
SwLayoutFrm *GetPrevSctLeaf( MakePageType eMakeFtn = MAKEPAGE_FTN );
SwLayoutFrm *GetPrevCellLeaf( MakePageType eMakeFtn = MAKEPAGE_FTN );
- const SwLayoutFrm *GetLeaf ( MakePageType eMakePage, BOOL bFwd,
+ const SwLayoutFrm *GetLeaf ( MakePageType eMakePage, sal_Bool bFwd,
const SwFrm *pAnch ) const;
- BOOL WrongPageDesc( SwPageFrm* pNew );
+ sal_Bool WrongPageDesc( SwPageFrm* pNew );
// --> OD 2004-07-02 #i28701# - new methods to append/remove drawing objects
void AppendDrawObj( SwAnchoredObject& _rNewObj );
@@ -521,37 +529,37 @@ public:
virtual void PaintBorder( const SwRect&, const SwPageFrm *pPage,
const SwBorderAttrs & ) const;
void PaintBaBo( const SwRect&, const SwPageFrm *pPage = 0,
- const BOOL bLowerBorder = FALSE ) const;
+ const sal_Bool bLowerBorder = sal_False ) const;
void PaintBackground( const SwRect&, const SwPageFrm *pPage,
const SwBorderAttrs &,
- const BOOL bLowerMode = FALSE,
- const BOOL bLowerBorder = FALSE ) const;
+ const sal_Bool bLowerMode = sal_False,
+ const sal_Bool bLowerBorder = sal_False ) const;
void PaintBorderLine( const SwRect&, const SwRect&, const SwPageFrm*,
const Color *pColor ) const;
//Retouche, nicht im Bereich des uebergebenen Rect!
void Retouche( const SwPageFrm *pPage, const SwRect &rRect ) const;
- BOOL GetBackgroundBrush( const SvxBrushItem*& rpBrush,
+ sal_Bool GetBackgroundBrush( const SvxBrushItem*& rpBrush,
const Color*& rpColor,
SwRect &rOrigRect,
- BOOL bLowerMode ) const;
+ sal_Bool bLowerMode ) const;
inline void SetCompletePaint() const;
inline void ResetCompletePaint() const;
- inline BOOL IsCompletePaint() const { return bCompletePaint; }
+ inline sal_Bool IsCompletePaint() const { return bCompletePaint; }
inline void SetRetouche() const;
inline void ResetRetouche() const;
- inline BOOL IsRetouche() const { return bRetouche; }
+ inline sal_Bool IsRetouche() const { return bRetouche; }
void SetInfFlags(); //Setzen der InfoFlags
- inline void InvalidateInfFlags() { bInfInvalid = TRUE; }
- inline BOOL IsInDocBody() const; //Benutzen die InfoFlags.
- inline BOOL IsInFtn() const; //ggf. werden die Flags ermittelt.
- inline BOOL IsInTab() const;
- inline BOOL IsInFly() const;
- inline BOOL IsInSct() const;
+ inline void InvalidateInfFlags() { bInfInvalid = sal_True; }
+ inline sal_Bool IsInDocBody() const; //Benutzen die InfoFlags.
+ inline sal_Bool IsInFtn() const; //ggf. werden die Flags ermittelt.
+ inline sal_Bool IsInTab() const;
+ inline sal_Bool IsInFly() const;
+ inline sal_Bool IsInSct() const;
// If frame is inside a split table row, this function returns
// the corresponding row frame in the follow table.
@@ -563,18 +571,18 @@ public:
bool IsInBalancedSection() const;
- inline BOOL IsReverse() const { return bReverse; }
- inline void SetReverse( BOOL bNew ){ bReverse = bNew ? 1 : 0; }
- inline BOOL IsVertical() const;
- inline BOOL GetVerticalFlag() const;
- inline void SetVertical( BOOL bNew ){ bVertical = bNew ? 1 : 0; }
- inline void SetDerivedVert( BOOL bNew ){ bDerivedVert = bNew ? 1 : 0; }
- inline void SetInvalidVert( BOOL bNew) { bInvalidVert = bNew ? 1 : 0; }
- inline BOOL IsRightToLeft() const;
- inline BOOL GetRightToLeftFlag() const;
- inline void SetRightToLeft( BOOL bNew ){ bRightToLeft = bNew ? 1 : 0; }
- inline void SetDerivedR2L( BOOL bNew ) { bDerivedR2L = bNew ? 1 : 0; }
- inline void SetInvalidR2L( BOOL bNew ) { bInvalidR2L = bNew ? 1 : 0; }
+ inline sal_Bool IsReverse() const { return bReverse; }
+ inline void SetReverse( sal_Bool bNew ){ bReverse = bNew ? 1 : 0; }
+ inline sal_Bool IsVertical() const;
+ inline sal_Bool GetVerticalFlag() const;
+ inline void SetVertical( sal_Bool bNew ){ bVertical = bNew ? 1 : 0; }
+ 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;
+ inline sal_Bool GetRightToLeftFlag() const;
+ 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
@@ -583,7 +591,7 @@ public:
/** determine, if frame is moveable in given environment
OD 08.08.2003 #110978#
- method replaced 'old' method <BOOL IsMoveable() const>.
+ method replaced 'old' method <sal_Bool IsMoveable() const>.
Determines, if frame is moveable in given environment. if no environment
is given (parameter _pLayoutFrm == 0L), the movability in the actual
environment (<this->GetUpper()) is checked.
@@ -596,26 +604,26 @@ public:
@return boolean, indicating, if frame is moveable in given environment
*/
-// BOOL IsMoveable() const;
+// sal_Bool IsMoveable() const;
bool IsMoveable( const SwLayoutFrm* _pLayoutFrm = 0L ) const;
//Ist es fuer den (Txt)Frm in der aktuellen Umgebung erlaubt eine
//Fussnote einzufuegen (nicht z.B. in wiederholten TabellenHeadlines).
- BOOL IsFtnAllowed() const;
+ sal_Bool IsFtnAllowed() const;
virtual void Format( const SwBorderAttrs *pAttrs = 0 );
- virtual void CheckDirection( BOOL bVert );
+ virtual void CheckDirection( sal_Bool bVert );
void ReinitializeFrmSizeAttrFlags();
const SwAttrSet *GetAttrSet() const;
- inline BOOL HasFixSize() const { return bFixSize; }
- inline void SetFixSize( BOOL bNew ) { bFixSize = bNew; }
+ inline sal_Bool HasFixSize() const { return bFixSize; }
+ inline void SetFixSize( sal_Bool bNew ) { bFixSize = bNew; }
//Prueft alle Seiten ab der Uebergebenen und korrigiert ggf.
- static void CheckPageDescs( SwPageFrm *pStart, BOOL bNotifyFields = TRUE );
+ static void CheckPageDescs( SwPageFrm *pStart, sal_Bool bNotifyFields = sal_True );
//Koennen 0 liefern, einmal const einmal nicht
SwFrm *GetNext() { return pNext; }
@@ -624,7 +632,7 @@ public:
SwRootFrm *getRootFrm(){ return mpRoot; }
SwPageFrm *FindPageFrm();
SwFrm *FindColFrm();
- SwFtnBossFrm *FindFtnBossFrm( BOOL bFootnotes = FALSE );
+ SwFtnBossFrm *FindFtnBossFrm( sal_Bool bFootnotes = sal_False );
SwTabFrm *ImplFindTabFrm();
SwFtnFrm *ImplFindFtnFrm();
SwFlyFrm *ImplFindFlyFrm();
@@ -645,7 +653,12 @@ public:
// <--
inline SwFrm *FindPrev();
inline const SwPageFrm *FindPageFrm() const;
+<<<<<<< local
inline const SwFtnBossFrm *FindFtnBossFrm( BOOL bFtn = FALSE ) const;
+=======
+ inline const SwRootFrm *FindRootFrm() const;
+ inline const SwFtnBossFrm *FindFtnBossFrm( sal_Bool bFtn = sal_False ) const;
+>>>>>>> other
inline const SwFrm *FindColFrm() const;
inline const SwFrm *FindFooterOrHeader() const;
inline const SwTabFrm *FindTabFrm() const;
@@ -697,10 +710,10 @@ public:
{ return ( pNext || !IsInSct() ) ? pNext : _GetIndNext(); }
const SwFrm* GetIndNext() const { return ((SwFrm*)this)->GetIndNext(); }
- USHORT GetPhyPageNum() const; //Seitennummer ohne Offset
- USHORT GetVirtPageNum() const; //Seitenummer mit Offset
- BOOL OnRightPage() const { return 0 != GetPhyPageNum() % 2; };
- BOOL WannaRightPage() const;
+ sal_uInt16 GetPhyPageNum() const; //Seitennummer ohne Offset
+ sal_uInt16 GetVirtPageNum() const; //Seitenummer mit Offset
+ sal_Bool OnRightPage() const { return 0 != GetPhyPageNum() % 2; };
+ sal_Bool WannaRightPage() const;
inline const SwLayoutFrm *GetPrevLayoutLeaf() const;
@@ -721,7 +734,7 @@ public:
const SwRect PaintArea() const;
// The UnionFrm is the union of frm- and prt-area, normally identical
// to the frm-area except the case of negative prt-margins.
- const SwRect UnionFrm( BOOL bBorder = FALSE ) const;
+ const SwRect UnionFrm( sal_Bool bBorder = sal_False ) const;
//Der Zugriff auf die Member wird hier ausnahmsweiste gestattet,
//dies soll aber nicht dazu dienen die Werte wahllos zu veraendern;
@@ -735,13 +748,13 @@ public:
virtual void Cut() = 0;
virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 ) = 0;
- void ValidateLineNum() { bValidLineNum = TRUE; }
+ void ValidateLineNum() { bValidLineNum = sal_True; }
- BOOL GetValidPosFlag() const { return bValidPos; }
- BOOL GetValidPrtAreaFlag()const { return bValidPrtArea; }
- BOOL GetValidSizeFlag() const { return bValidSize; }
- BOOL GetValidLineNumFlag()const { return bValidLineNum; }
- BOOL IsValid() const { return bValidPos && bValidSize && bValidPrtArea; }
+ sal_Bool GetValidPosFlag() const { return bValidPos; }
+ sal_Bool GetValidPrtAreaFlag()const { return bValidPrtArea; }
+ sal_Bool GetValidSizeFlag() const { return bValidSize; }
+ sal_Bool GetValidLineNumFlag()const { return bValidLineNum; }
+ sal_Bool IsValid() const { return bValidPos && bValidSize && bValidPrtArea; }
//Invalideren nur den Frm
// OD 2004-05-19 #i28701# - add call to method <_ActionOnInvalidation(..)>
@@ -754,7 +767,7 @@ public:
{
if ( bValidSize && _InvalidationAllowed( INVALID_SIZE ) )
{
- bValidSize = FALSE;
+ bValidSize = sal_False;
_ActionOnInvalidation( INVALID_SIZE );
}
}
@@ -762,7 +775,7 @@ public:
{
if ( bValidPrtArea && _InvalidationAllowed( INVALID_PRTAREA ) )
{
- bValidPrtArea = FALSE;
+ bValidPrtArea = sal_False;
_ActionOnInvalidation( INVALID_PRTAREA );
}
}
@@ -770,7 +783,7 @@ public:
{
if ( bValidPos && _InvalidationAllowed( INVALID_POS ) )
{
- bValidPos = FALSE;
+ bValidPos = sal_False;
_ActionOnInvalidation( INVALID_POS );
}
}
@@ -778,7 +791,7 @@ public:
{
if ( bValidLineNum && _InvalidationAllowed( INVALID_LINENUM ) )
{
- bValidLineNum = FALSE;
+ bValidLineNum = sal_False;
_ActionOnInvalidation( INVALID_LINENUM );
}
}
@@ -787,7 +800,7 @@ public:
if ( ( bValidSize || bValidPrtArea || bValidPos ) &&
_InvalidationAllowed( INVALID_ALL ) )
{
- bValidSize = bValidPrtArea = bValidPos = FALSE;
+ bValidSize = bValidPrtArea = bValidPos = sal_False;
_ActionOnInvalidation( INVALID_ALL );
}
}
@@ -803,8 +816,8 @@ public:
void ImplInvalidatePos();
void ImplInvalidateLineNum();
- inline void InvalidateNextPos( BOOL bNoFtn = FALSE );
- void ImplInvalidateNextPos( BOOL bNoFtn = FALSE );
+ inline void InvalidateNextPos( sal_Bool bNoFtn = sal_False );
+ void ImplInvalidateNextPos( sal_Bool bNoFtn = sal_False );
/** method to invalidate printing area of next frame
@@ -818,9 +831,9 @@ public:
virtual bool FillSelection( SwSelectionList& rList, const SwRect& rRect ) const;
- virtual BOOL GetCrsrOfst( SwPosition *, Point&,
+ virtual sal_Bool GetCrsrOfst( SwPosition *, Point&,
SwCrsrMoveState* = 0 ) const;
- virtual BOOL GetCharRect( SwRect &, const SwPosition&,
+ virtual sal_Bool GetCharRect( SwRect &, const SwPosition&,
SwCrsrMoveState* = 0 ) const;
virtual void Paint( SwRect const&,
SwPrintData const*const pPrintData = NULL ) const;
@@ -829,43 +842,43 @@ public:
// Wer den void* falsch Casted ist selbst schuld!
// Auf jedenfall muss der void* auf 0 geprueft werden.
virtual void Prepare( const PrepareHint ePrep = PREP_CLEAR,
- const void *pVoid = 0, BOOL bNotify = TRUE );
-
- //TRUE wenn's die richtige Klasse ist, FALSE sonst
- inline BOOL IsLayoutFrm() const;
- inline BOOL IsRootFrm() const;
- inline BOOL IsPageFrm() const;
- inline BOOL IsColumnFrm() const;
- inline BOOL IsFtnBossFrm() const; // Fussnotenbosse sind PageFrms und ColumnFrms
- inline BOOL IsHeaderFrm() const;
- inline BOOL IsFooterFrm() const;
- inline BOOL IsFtnContFrm() const;
- inline BOOL IsFtnFrm() const;
- inline BOOL IsBodyFrm() const;
- inline BOOL IsColBodyFrm() const; // in layfrm.hxx implementiert, BodyFrm unterhalb ColumnFrm
- inline BOOL IsPageBodyFrm() const; // in layfrm.hxx implementiert, BodyFrm unterhalb PageFrm
- inline BOOL IsFlyFrm() const;
- inline BOOL IsSctFrm() const;
- inline BOOL IsTabFrm() const;
- inline BOOL IsRowFrm() const;
- inline BOOL IsCellFrm() const;
- inline BOOL IsCntntFrm() const;
- inline BOOL IsTxtFrm() const;
- inline BOOL IsNoTxtFrm() const;
- inline BOOL IsFlowFrm() const; //Frms deren PrtArea von den Nachbarn
+ const void *pVoid = 0, sal_Bool bNotify = sal_True );
+
+ //sal_True wenn's die richtige Klasse ist, sal_False sonst
+ inline sal_Bool IsLayoutFrm() const;
+ inline sal_Bool IsRootFrm() const;
+ inline sal_Bool IsPageFrm() const;
+ inline sal_Bool IsColumnFrm() const;
+ inline sal_Bool IsFtnBossFrm() const; // Fussnotenbosse sind PageFrms und ColumnFrms
+ inline sal_Bool IsHeaderFrm() const;
+ inline sal_Bool IsFooterFrm() const;
+ inline sal_Bool IsFtnContFrm() const;
+ inline sal_Bool IsFtnFrm() const;
+ inline sal_Bool IsBodyFrm() const;
+ inline sal_Bool IsColBodyFrm() const; // in layfrm.hxx implementiert, BodyFrm unterhalb ColumnFrm
+ inline sal_Bool IsPageBodyFrm() const; // in layfrm.hxx implementiert, BodyFrm unterhalb PageFrm
+ inline sal_Bool IsFlyFrm() const;
+ inline sal_Bool IsSctFrm() const;
+ inline sal_Bool IsTabFrm() const;
+ inline sal_Bool IsRowFrm() const;
+ inline sal_Bool IsCellFrm() const;
+ inline sal_Bool IsCntntFrm() const;
+ inline sal_Bool IsTxtFrm() const;
+ inline sal_Bool IsNoTxtFrm() const;
+ inline sal_Bool IsFlowFrm() const; //Frms deren PrtArea von den Nachbarn
//abhaengen und die halt im Inhaltsfluss
//stehen.
- inline BOOL IsRetoucheFrm() const; //Frms die Retouchefaehig sind bzw. die
+ inline sal_Bool IsRetoucheFrm() const; //Frms die Retouchefaehig sind bzw. die
//u.U. hinter sich Retouchieren muessen.
- inline BOOL IsAccessibleFrm() const;
+ inline sal_Bool IsAccessibleFrm() const;
void PrepareCrsr(); //Die CrsrShell darf.
//Ist der Frm (bzw. die Section in der er steht) geschuetzt?
//Auch Fly in Fly in ... und Fussnoten
- BOOL IsProtected() const;
+ sal_Bool IsProtected() const;
- BOOL IsColLocked() const { return bColLocked; }
+ sal_Bool IsColLocked() const { return bColLocked; }
virtual ~SwFrm();
@@ -886,16 +899,16 @@ public:
long GetPrtBottom() const;
long GetPrtRight() const;
long GetPrtTop() const;
- BOOL SetMinLeft( long );
- BOOL SetMaxBottom( long );
- BOOL SetMaxRight( long );
- BOOL SetMinTop( long );
- void MakeBelowPos( const SwFrm*, const SwFrm*, BOOL );
- void MakeUpperPos( const SwFrm*, const SwFrm*, BOOL );
- void MakeLeftPos( const SwFrm*, const SwFrm*, BOOL );
- void MakeRightPos( const SwFrm*, const SwFrm*, BOOL );
- inline BOOL IsNeighbourFrm() const
- { return GetType() & FRM_NEIGHBOUR ? TRUE : FALSE; }
+ sal_Bool SetMinLeft( long );
+ sal_Bool SetMaxBottom( long );
+ sal_Bool SetMaxRight( long );
+ sal_Bool SetMinTop( long );
+ void MakeBelowPos( const SwFrm*, const SwFrm*, sal_Bool );
+ void MakeUpperPos( const SwFrm*, const SwFrm*, sal_Bool );
+ void MakeLeftPos( const SwFrm*, const SwFrm*, sal_Bool );
+ void MakeRightPos( const SwFrm*, const SwFrm*, sal_Bool );
+ inline sal_Bool IsNeighbourFrm() const
+ { return GetType() & FRM_NEIGHBOUR ? sal_True : sal_False; }
// --> OD 2006-05-10 #i65250#
inline sal_uInt32 GetFrmId() const { return mnFrmId; }
@@ -910,78 +923,82 @@ public:
bool IsInCoveredCell() const;
// FME 2007-08-30 #i81146# new loop control
+<<<<<<< local
void ValidateThisAndAllLowers( const USHORT nStage );
bool KnowsFormat( const SwFmt& rFmt ) const;
void RegisterToFormat( SwFmt& rFmt );
+=======
+ void ValidateThisAndAllLowers( const sal_uInt16 nStage );
+>>>>>>> other
};
-inline BOOL SwFrm::IsInDocBody() const
+inline sal_Bool SwFrm::IsInDocBody() const
{
if ( bInfInvalid )
((SwFrm*)this)->SetInfFlags();
return bInfBody;
}
-inline BOOL SwFrm::IsInFtn() const
+inline sal_Bool SwFrm::IsInFtn() const
{
if ( bInfInvalid )
((SwFrm*)this)->SetInfFlags();
return bInfFtn;
}
-inline BOOL SwFrm::IsInTab() const
+inline sal_Bool SwFrm::IsInTab() const
{
if ( bInfInvalid )
((SwFrm*)this)->SetInfFlags();
return bInfTab;
}
-inline BOOL SwFrm::IsInFly() const
+inline sal_Bool SwFrm::IsInFly() const
{
if ( bInfInvalid )
((SwFrm*)this)->SetInfFlags();
return bInfFly;
}
-inline BOOL SwFrm::IsInSct() const
+inline sal_Bool SwFrm::IsInSct() const
{
if ( bInfInvalid )
((SwFrm*)this)->SetInfFlags();
return bInfSct;
}
-BOOL SwFrm::IsVertical() const
+sal_Bool SwFrm::IsVertical() const
{
if( bInvalidVert )
- ((SwFrm*)this)->SetDirFlags( TRUE );
+ ((SwFrm*)this)->SetDirFlags( sal_True );
return bVertical != 0;
}
-BOOL SwFrm::GetVerticalFlag() const
+sal_Bool SwFrm::GetVerticalFlag() const
{
return bVertical != 0;
}
-inline BOOL SwFrm::IsRightToLeft() const
+inline sal_Bool SwFrm::IsRightToLeft() const
{
if( bInvalidR2L )
- ((SwFrm*)this)->SetDirFlags( FALSE );
+ ((SwFrm*)this)->SetDirFlags( sal_False );
return bRightToLeft != 0;
}
-BOOL SwFrm::GetRightToLeftFlag() const
+sal_Bool SwFrm::GetRightToLeftFlag() const
{
return bRightToLeft != 0;
}
inline void SwFrm::SetCompletePaint() const
{
- ((SwFrm*)this)->bCompletePaint = TRUE;
+ ((SwFrm*)this)->bCompletePaint = sal_True;
}
inline void SwFrm::ResetCompletePaint() const
{
- ((SwFrm*)this)->bCompletePaint = FALSE;
+ ((SwFrm*)this)->bCompletePaint = sal_False;
}
inline void SwFrm::SetRetouche() const
{
- ((SwFrm*)this)->bRetouche = TRUE;
+ ((SwFrm*)this)->bRetouche = sal_True;
}
inline void SwFrm::ResetRetouche() const
{
- ((SwFrm*)this)->bRetouche = FALSE;
+ ((SwFrm*)this)->bRetouche = sal_False;
}
inline SwLayoutFrm *SwFrm::GetNextLayoutLeaf()
@@ -1031,14 +1048,14 @@ inline void SwFrm::InvalidateAll()
{
if ( bValidPrtArea && bValidSize && bValidPos )
ImplInvalidatePos();
- bValidPrtArea = bValidSize = bValidPos = FALSE;
+ bValidPrtArea = bValidSize = bValidPos = sal_False;
// OD 2004-05-19 #i28701#
_ActionOnInvalidation( INVALID_ALL );
}
}
-inline void SwFrm::InvalidateNextPos( BOOL bNoFtn )
+inline void SwFrm::InvalidateNextPos( sal_Bool bNoFtn )
{
if ( pNext && !pNext->IsSctFrm() )
pNext->InvalidatePos();
@@ -1088,7 +1105,7 @@ inline SwTabFrm *SwFrm::FindTabFrm()
{
return IsInTab() ? ImplFindTabFrm() : 0;
}
-inline const SwFtnBossFrm *SwFrm::FindFtnBossFrm( BOOL bFtn ) const
+inline const SwFtnBossFrm *SwFrm::FindFtnBossFrm( sal_Bool bFtn ) const
{
return ((SwFrm*)this)->FindFtnBossFrm( bFtn );
}
@@ -1169,88 +1186,88 @@ inline const SwFrm *SwFrm::FindPrev() const
}
-inline BOOL SwFrm::IsLayoutFrm() const
+inline sal_Bool SwFrm::IsLayoutFrm() const
{
- return GetType() & FRM_LAYOUT ? TRUE : FALSE;
+ return GetType() & FRM_LAYOUT ? sal_True : sal_False;
}
-inline BOOL SwFrm::IsRootFrm() const
+inline sal_Bool SwFrm::IsRootFrm() const
{
return nType == FRMC_ROOT;
}
-inline BOOL SwFrm::IsPageFrm() const
+inline sal_Bool SwFrm::IsPageFrm() const
{
return nType == FRMC_PAGE;
}
-inline BOOL SwFrm::IsColumnFrm() const
+inline sal_Bool SwFrm::IsColumnFrm() const
{
return nType == FRMC_COLUMN;
}
-inline BOOL SwFrm::IsFtnBossFrm() const
+inline sal_Bool SwFrm::IsFtnBossFrm() const
{
- return GetType() & FRM_FTNBOSS ? TRUE : FALSE;
+ return GetType() & FRM_FTNBOSS ? sal_True : sal_False;
}
-inline BOOL SwFrm::IsHeaderFrm() const
+inline sal_Bool SwFrm::IsHeaderFrm() const
{
return nType == FRMC_HEADER;
}
-inline BOOL SwFrm::IsFooterFrm() const
+inline sal_Bool SwFrm::IsFooterFrm() const
{
return nType == FRMC_FOOTER;
}
-inline BOOL SwFrm::IsFtnContFrm() const
+inline sal_Bool SwFrm::IsFtnContFrm() const
{
return nType == FRMC_FTNCONT;
}
-inline BOOL SwFrm::IsFtnFrm() const
+inline sal_Bool SwFrm::IsFtnFrm() const
{
return nType == FRMC_FTN;
}
-inline BOOL SwFrm::IsBodyFrm() const
+inline sal_Bool SwFrm::IsBodyFrm() const
{
return nType == FRMC_BODY;
}
-inline BOOL SwFrm::IsFlyFrm() const
+inline sal_Bool SwFrm::IsFlyFrm() const
{
return nType == FRMC_FLY;
}
-inline BOOL SwFrm::IsSctFrm() const
+inline sal_Bool SwFrm::IsSctFrm() const
{
return nType == FRMC_SECTION;
}
-inline BOOL SwFrm::IsTabFrm() const
+inline sal_Bool SwFrm::IsTabFrm() const
{
return nType == FRMC_TAB;
}
-inline BOOL SwFrm::IsRowFrm() const
+inline sal_Bool SwFrm::IsRowFrm() const
{
return nType == FRMC_ROW;
}
-inline BOOL SwFrm::IsCellFrm() const
+inline sal_Bool SwFrm::IsCellFrm() const
{
return nType == FRMC_CELL;
}
-inline BOOL SwFrm::IsCntntFrm() const
+inline sal_Bool SwFrm::IsCntntFrm() const
{
- return GetType() & FRM_CNTNT ? TRUE : FALSE;
+ return GetType() & FRM_CNTNT ? sal_True : sal_False;
}
-inline BOOL SwFrm::IsTxtFrm() const
+inline sal_Bool SwFrm::IsTxtFrm() const
{
return nType == FRMC_TXT;
}
-inline BOOL SwFrm::IsNoTxtFrm() const
+inline sal_Bool SwFrm::IsNoTxtFrm() const
{
return nType == FRMC_NOTXT;
}
-inline BOOL SwFrm::IsFlowFrm() const
+inline sal_Bool SwFrm::IsFlowFrm() const
{
- return GetType() & 0xCA00 ? TRUE : FALSE; //TabFrm, CntntFrm, SectionFrm
+ return GetType() & 0xCA00 ? sal_True : sal_False; //TabFrm, CntntFrm, SectionFrm
}
-inline BOOL SwFrm::IsRetoucheFrm() const
+inline sal_Bool SwFrm::IsRetoucheFrm() const
{
- return GetType() & 0xCA40 ? TRUE : FALSE; //TabFrm, CntntFrm, SectionFrm, Ftnfrm
+ return GetType() & 0xCA40 ? sal_True : sal_False; //TabFrm, CntntFrm, SectionFrm, Ftnfrm
}
-inline BOOL SwFrm::IsAccessibleFrm() const
+inline sal_Bool SwFrm::IsAccessibleFrm() const
{
- return GetType() & FRM_ACCESSIBLE ? TRUE : FALSE;
+ return GetType() & FRM_ACCESSIBLE ? sal_True : sal_False;
}
#endif
diff --git a/sw/source/core/inc/frminf.hxx b/sw/source/core/inc/frminf.hxx
index a39490a9b663..347592a8c5f4 100644
--- a/sw/source/core/inc/frminf.hxx
+++ b/sw/source/core/inc/frminf.hxx
@@ -49,22 +49,22 @@ public:
inline SwTxtFrmInfo( const SwTxtFrm *pTxtFrm ) : pFrm(pTxtFrm) { }
// Passt der Absatz in eine Zeile?
- BOOL IsOneLine() const;
+ sal_Bool IsOneLine() const;
// Ist die Zeile zu X% gefuellt?
- BOOL IsFilled( const BYTE nPercent ) const;
+ sal_Bool IsFilled( const sal_uInt8 nPercent ) const;
// Wo beginnt der Text (ohne whitespaces)? (rel. im Frame !!)
SwTwips GetLineStart() const;
//returne die mittel Position des n. Charakters
- SwTwips GetCharPos( xub_StrLen nChar, BOOL bCenter = TRUE ) const;
+ SwTwips GetCharPos( xub_StrLen nChar, sal_Bool bCenter = sal_True ) const;
// Sammelt die whitespaces am Zeilenbeginn und -ende im Pam
- void GetSpaces( SwPaM &rPam, BOOL bWithLineBreak ) const;
+ void GetSpaces( SwPaM &rPam, sal_Bool bWithLineBreak ) const;
// Ist an der ersten Textposition ein Bullet/Symbol etc?
- BOOL IsBullet( xub_StrLen nTxtPos ) const;
+ sal_Bool IsBullet( xub_StrLen nTxtPos ) const;
// Ermittelt Erstzeileneinzug
SwTwips GetFirstIndent() const;
@@ -75,7 +75,7 @@ public:
{ pFrm = pNew; return *this; }
// liegt eine Gegenueberstellung vor? (returnt Pos im Frame)
- USHORT GetBigIndent( xub_StrLen& rFndPos,
+ sal_uInt16 GetBigIndent( xub_StrLen& rFndPos,
const SwTxtFrm *pNextFrm = 0 ) const;
};
diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx
index bfc14d2b8185..d5157954b9bb 100644
--- a/sw/source/core/inc/frmtool.hxx
+++ b/sw/source/core/inc/frmtool.hxx
@@ -68,7 +68,7 @@ struct SwFindRowSpanCacheObj;
// OD 05.08.2002 #99657# - add 6th parameter to indicate that method should
// consider background transparency, saved in the color of the brush item
void MA_FASTCALL DrawGraphic( const SvxBrushItem *, OutputDevice *,
- const SwRect &rOrg, const SwRect &rOut, const BYTE nGrfNum = GRFNUM_NO,
+ const SwRect &rOrg, const SwRect &rOut, const sal_uInt8 nGrfNum = GRFNUM_NO,
const sal_Bool bConsiderBackgroundTransparency = sal_False );
// OD 24.01.2003 #106593# - method to align rectangle
@@ -85,14 +85,14 @@ void SwAlignGrfRect( SwRect *pGrfRect, const OutputDevice &rOut );
SwFlyFrm *GetFlyFromMarked( const SdrMarkList *pLst, ViewShell *pSh );
//Nicht gleich die math.lib anziehen.
-ULONG MA_FASTCALL SqRt( BigInt nX );
+sal_uLong MA_FASTCALL SqRt( BigInt nX );
SwFrm *SaveCntnt( SwLayoutFrm *pLay, SwFrm *pStart );
void RestoreCntnt( SwFrm *pSav, SwLayoutFrm *pParent, SwFrm *pSibling, bool bGrow );
//CntntNodes besorgen, CntntFrms erzeugen und in den LayFrm haengen.
-void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc, ULONG nIndex,
- BOOL bPages = FALSE, ULONG nEndIndex = 0,
+void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc, sal_uLong nIndex,
+ sal_Bool bPages = sal_False, sal_uLong nEndIndex = 0,
SwFrm *pPrv = 0 );
//Erzeugen der Frames fuer einen bestimmten Bereich, verwendet _InsertCnt
@@ -100,10 +100,10 @@ void MakeFrms( SwDoc *pDoc, const SwNodeIndex &rSttIdx,
const SwNodeIndex &rEndIdx );
//Um z.B. fuer Tabelleheadlines das Erzeugen der Flys in _InsertCnt zu unterbinden.
-extern BOOL bDontCreateObjects;
+extern sal_Bool bDontCreateObjects;
//Fuer FlyCnts, siehe SwFlyAtCntFrm::MakeAll()
-extern BOOL bSetCompletePaintOnInvalidate;
+extern sal_Bool bSetCompletePaintOnInvalidate;
//Fuer Tabelleneinstellung per Tastatur.
long MA_FASTCALL CalcRowRstHeight( SwLayoutFrm *pRow );
@@ -111,7 +111,7 @@ long MA_FASTCALL CalcHeightWidthFlys( const SwFrm *pFrm ); //MA_FLY_HEIGHT
//Neue Seite einsetzen
SwPageFrm * MA_FASTCALL InsertNewPage( SwPageDesc &rDesc, SwFrm *pUpper,
- BOOL bOdd, BOOL bInsertEmpty, BOOL bFtn,
+ sal_Bool bOdd, sal_Bool bInsertEmpty, sal_Bool bFtn,
SwFrm *pSibling );
//Flys bei der Seite anmelden.
@@ -125,26 +125,30 @@ void Notify_Background( const SdrObject* pObj,
SwPageFrm* pPage,
const SwRect& rRect,
const PrepareHint eHint,
- const BOOL bInva );
+ const sal_Bool bInva );
const SwFrm* GetVirtualUpper( const SwFrm* pFrm, const Point& rPos );
-BOOL Is_Lower_Of( const SwFrm *pCurrFrm, const SdrObject* pObj );
+sal_Bool Is_Lower_Of( const SwFrm *pCurrFrm, const SdrObject* pObj );
-const SwFrm *FindKontext( const SwFrm *pFrm, USHORT nAdditionalKontextTyp );
+const SwFrm *FindKontext( const SwFrm *pFrm, sal_uInt16 nAdditionalKontextTyp );
-BOOL IsFrmInSameKontext( const SwFrm *pInnerFrm, const SwFrm *pFrm );
+sal_Bool IsFrmInSameKontext( const SwFrm *pInnerFrm, const SwFrm *pFrm );
const SwFrm * MA_FASTCALL FindPage( const SwRect &rRect, const SwFrm *pPage );
// JP 07.05.98: wird von SwCntntNode::GetFrm und von SwFlyFrm::GetFrm
// gerufen
+<<<<<<< local
SwFrm* GetFrmOfModify( const SwRootFrm* pLayout, SwModify const&, USHORT const nFrmType, const Point* = 0,
+=======
+SwFrm* GetFrmOfModify( SwModify const&, sal_uInt16 const nFrmType, const Point* = 0,
+>>>>>>> other
const SwPosition *pPos = 0,
- const BOOL bCalcFrm = FALSE );
+ const sal_Bool bCalcFrm = sal_False );
//Sollen ExtraDaten (Reline-Strich, Zeilennummern) gepaintet werden?
-BOOL IsExtraData( const SwDoc *pDoc );
+sal_Bool IsExtraData( const SwDoc *pDoc );
// OD 14.03.2003 #i11760# - method declaration <CalcCntnt(..)>
void CalcCntnt( SwLayoutFrm *pLay,
@@ -163,9 +167,9 @@ protected:
const SwRect aPrt;
SwTwips mnFlyAnchorOfst;
SwTwips mnFlyAnchorOfstNoWrap;
- BOOL bHadFollow;
- BOOL bInvaKeep;
- BOOL bValidSize;
+ sal_Bool bHadFollow;
+ sal_Bool bInvaKeep;
+ sal_Bool bValidSize;
protected:
// --> OD 2005-07-29 #i49383#
bool mbFrmDeleted;
@@ -177,7 +181,7 @@ public:
const SwRect &Frm() const { return aFrm; }
const SwRect &Prt() const { return aPrt; }
- void SetInvaKeep() { bInvaKeep = TRUE; }
+ void SetInvaKeep() { bInvaKeep = sal_True; }
// --> OD 2005-07-29 #i49383#
void FrmDeleted()
{
@@ -188,15 +192,15 @@ public:
class SwLayNotify : public SwFrmNotify
{
- BOOL bLowersComplete;
+ sal_Bool bLowersComplete;
SwLayoutFrm *GetLay() { return (SwLayoutFrm*)pFrm; }
public:
SwLayNotify( SwLayoutFrm *pLayFrm );
~SwLayNotify();
- void SetLowersComplete( BOOL b ) { bLowersComplete = b; }
- BOOL IsLowersComplete() { return bLowersComplete; }
+ void SetLowersComplete( sal_Bool b ) { bLowersComplete = b; }
+ sal_Bool IsLowersComplete() { return bLowersComplete; }
};
class SwFlyNotify : public SwLayNotify
@@ -260,36 +264,36 @@ class SwBorderAttrs : public SwCacheObj
const SvxShadowItem &rShadow;
const Size aFrmSize; //Die FrmSize
- BOOL bBorderDist :1; //Ist's ein Frm der auch ohne Linie
+ sal_Bool bBorderDist :1; //Ist's ein Frm der auch ohne Linie
//einen Abstand haben kann?
//Mit den Folgenden Bools werden die gecache'ten Werte fuer UNgueltig
//erklaert - bis sie einmal berechnet wurden.
- BOOL bTopLine :1;
- BOOL bBottomLine :1;
- BOOL bLeftLine :1;
- BOOL bRightLine :1;
- BOOL bTop :1;
- BOOL bBottom :1;
- BOOL bLine :1;
-
- BOOL bIsLine :1; //Umrandung an mind. einer Kante?
-
- BOOL bCacheGetLine :1; //GetTopLine(), GetBottomLine() cachen?
- BOOL bCachedGetTopLine :1; //GetTopLine() gecached?
- BOOL bCachedGetBottomLine :1; //GetBottomLine() gecached?
+ sal_Bool bTopLine :1;
+ sal_Bool bBottomLine :1;
+ sal_Bool bLeftLine :1;
+ sal_Bool bRightLine :1;
+ sal_Bool bTop :1;
+ sal_Bool bBottom :1;
+ sal_Bool bLine :1;
+
+ sal_Bool bIsLine :1; //Umrandung an mind. einer Kante?
+
+ sal_Bool bCacheGetLine :1; //GetTopLine(), GetBottomLine() cachen?
+ sal_Bool bCachedGetTopLine :1; //GetTopLine() gecached?
+ sal_Bool bCachedGetBottomLine :1; //GetBottomLine() gecached?
// OD 21.05.2003 #108789# - booleans indicating, if values <bJoinedWithPrev>
// and <bJoinedWithNext> are cached and valid.
// Caching depends on value of <bCacheGetLine>.
- mutable BOOL bCachedJoinedWithPrev :1;
- mutable BOOL bCachedJoinedWithNext :1;
+ mutable sal_Bool bCachedJoinedWithPrev :1;
+ mutable sal_Bool bCachedJoinedWithNext :1;
// OD 21.05.2003 #108789# - booleans indicating, if borders are joined
// with previous/next frame.
- BOOL bJoinedWithPrev :1;
- BOOL bJoinedWithNext :1;
+ sal_Bool bJoinedWithPrev :1;
+ sal_Bool bJoinedWithNext :1;
//Die gecache'ten Werte, undefiniert bis sie einmal berechnet wurden.
- USHORT nTopLine,
+ sal_uInt16 nTopLine,
nBottomLine,
nLeftLine,
nRightLine,
@@ -328,12 +332,12 @@ class SwBorderAttrs : public SwCacheObj
// OD 21.05.2003 #108789# - internal helper method for methods
// <_CalcJoinedWithPrev> and <_CalcJoinedWithNext>.
- BOOL _JoinWithCmp( const SwFrm& _rCallerFrm,
+ sal_Bool _JoinWithCmp( const SwFrm& _rCallerFrm,
const SwFrm& _rCmpFrm ) const;
//Rechte und linke Linie sowie LRSpace gleich?
// OD 21.05.2003 #108789# - change name of 1st parameter - "rAttrs" -> "rCmpAttrs".
- BOOL CmpLeftRight( const SwBorderAttrs &rCmpAttrs,
+ sal_Bool CmpLeftRight( const SwBorderAttrs &rCmpAttrs,
const SwFrm *pCaller,
const SwFrm *pCmp ) const;
@@ -349,37 +353,37 @@ public:
inline const SvxBoxItem &GetBox() const { return rBox; }
inline const SvxShadowItem &GetShadow() const { return rShadow; }
- inline USHORT CalcTopLine() const;
- inline USHORT CalcBottomLine() const;
- inline USHORT CalcLeftLine() const;
- inline USHORT CalcRightLine() const;
- inline USHORT CalcTop() const;
- inline USHORT CalcBottom() const;
+ inline sal_uInt16 CalcTopLine() const;
+ inline sal_uInt16 CalcBottomLine() const;
+ inline sal_uInt16 CalcLeftLine() const;
+ inline sal_uInt16 CalcRightLine() const;
+ inline sal_uInt16 CalcTop() const;
+ inline sal_uInt16 CalcBottom() const;
long CalcLeft( const SwFrm *pCaller ) const;
long CalcRight( const SwFrm *pCaller ) const;
- inline BOOL IsLine() const;
+ inline sal_Bool IsLine() const;
inline const Size &GetSize() const { return aFrmSize; }
- inline BOOL IsBorderDist() const { return bBorderDist; }
+ inline sal_Bool IsBorderDist() const { return bBorderDist; }
//Sollen obere bzw. untere Umrandung fuer den Frm ausgewertet werden?
// OD 2004-02-26 #i25029# - add optional 2nd parameter <_pPrevFrm>
// If set, its value is taken for testing, if borders/shadow have to joined
// with previous frame.
- inline USHORT GetTopLine ( const SwFrm& _rFrm,
+ inline sal_uInt16 GetTopLine ( const SwFrm& _rFrm,
const SwFrm* _pPrevFrm = 0L ) const;
- inline USHORT GetBottomLine( const SwFrm& _rFrm ) const;
- inline void SetGetCacheLine( BOOL bNew ) const;
+ inline sal_uInt16 GetBottomLine( const SwFrm& _rFrm ) const;
+ inline void SetGetCacheLine( sal_Bool bNew ) const;
// OD 21.05.2003 #108789# - accessors for cached values <bJoinedWithPrev>
// and <bJoinedWithPrev>
// OD 2004-02-26 #i25029# - add optional 2nd parameter <_pPrevFrm>
// If set, its value is taken for testing, if borders/shadow have to joined
// with previous frame.
- BOOL JoinedWithPrev( const SwFrm& _rFrm,
+ sal_Bool JoinedWithPrev( const SwFrm& _rFrm,
const SwFrm* _pPrevFrm = 0L ) const;
- BOOL JoinedWithNext( const SwFrm& _rFrm ) const;
+ sal_Bool JoinedWithNext( const SwFrm& _rFrm ) const;
};
class SwBorderAttrAccess : public SwCacheAccess
@@ -403,9 +407,9 @@ class SwOrderIter
{
const SwPageFrm *pPage;
const SdrObject *pCurrent;
- const BOOL bFlysOnly;
+ const sal_Bool bFlysOnly;
public:
- SwOrderIter( const SwPageFrm *pPage, BOOL bFlysOnly = TRUE );
+ SwOrderIter( const SwPageFrm *pPage, sal_Bool bFlysOnly = sal_True );
void Current( const SdrObject *pNew ) { pCurrent = pNew; }
const SdrObject *Current() const { return pCurrent; }
@@ -419,22 +423,22 @@ public:
class StackHack
{
- static BYTE nCnt;
- static BOOL bLocked;
+ static sal_uInt8 nCnt;
+ static sal_Bool bLocked;
public:
StackHack()
{
if ( ++StackHack::nCnt > 50 )
- StackHack::bLocked = TRUE;
+ StackHack::bLocked = sal_True;
}
~StackHack()
{
if ( --StackHack::nCnt < 5 )
- StackHack::bLocked = FALSE;
+ StackHack::bLocked = sal_False;
}
- static BOOL IsLocked() { return StackHack::bLocked; }
- static BYTE Count() { return StackHack::nCnt; }
+ static sal_Bool IsLocked() { return StackHack::bLocked; }
+ static sal_uInt8 Count() { return StackHack::nCnt; }
};
@@ -442,7 +446,7 @@ public:
// OD 2004-02-26 #i25029# - add optional 2nd parameter <_pPrevFrm>
// If set, its value is taken for testing, if borders/shadow have to joined
// with previous frame.
-inline USHORT SwBorderAttrs::GetTopLine ( const SwFrm& _rFrm,
+inline sal_uInt16 SwBorderAttrs::GetTopLine ( const SwFrm& _rFrm,
const SwFrm* _pPrevFrm ) const
{
if ( !bCachedGetTopLine || _pPrevFrm )
@@ -451,60 +455,60 @@ inline USHORT SwBorderAttrs::GetTopLine ( const SwFrm& _rFrm,
}
return nGetTopLine;
}
-inline USHORT SwBorderAttrs::GetBottomLine( const SwFrm& _rFrm ) const
+inline sal_uInt16 SwBorderAttrs::GetBottomLine( const SwFrm& _rFrm ) const
{
if ( !bCachedGetBottomLine )
const_cast<SwBorderAttrs*>(this)->_GetBottomLine( _rFrm );
return nGetBottomLine;
}
-inline void SwBorderAttrs::SetGetCacheLine( BOOL bNew ) const
+inline void SwBorderAttrs::SetGetCacheLine( sal_Bool bNew ) const
{
((SwBorderAttrs*)this)->bCacheGetLine = bNew;
((SwBorderAttrs*)this)->bCachedGetBottomLine =
- ((SwBorderAttrs*)this)->bCachedGetTopLine = FALSE;
+ ((SwBorderAttrs*)this)->bCachedGetTopLine = sal_False;
// OD 21.05.2003 #108789# - invalidate cache for values <bJoinedWithPrev>
// and <bJoinedWithNext>.
- bCachedJoinedWithPrev = FALSE;
- bCachedJoinedWithNext = FALSE;
+ bCachedJoinedWithPrev = sal_False;
+ bCachedJoinedWithNext = sal_False;
}
-inline USHORT SwBorderAttrs::CalcTopLine() const
+inline sal_uInt16 SwBorderAttrs::CalcTopLine() const
{
if ( bTopLine )
((SwBorderAttrs*)this)->_CalcTopLine();
return nTopLine;
}
-inline USHORT SwBorderAttrs::CalcBottomLine() const
+inline sal_uInt16 SwBorderAttrs::CalcBottomLine() const
{
if ( bBottomLine )
((SwBorderAttrs*)this)->_CalcBottomLine();
return nBottomLine;
}
-inline USHORT SwBorderAttrs::CalcLeftLine() const
+inline sal_uInt16 SwBorderAttrs::CalcLeftLine() const
{
if ( bLeftLine )
((SwBorderAttrs*)this)->_CalcLeftLine();
return nLeftLine;
}
-inline USHORT SwBorderAttrs::CalcRightLine() const
+inline sal_uInt16 SwBorderAttrs::CalcRightLine() const
{
if ( bRightLine )
((SwBorderAttrs*)this)->_CalcRightLine();
return nRightLine;
}
-inline USHORT SwBorderAttrs::CalcTop() const
+inline sal_uInt16 SwBorderAttrs::CalcTop() const
{
if ( bTop )
((SwBorderAttrs*)this)->_CalcTop();
return nTop;
}
-inline USHORT SwBorderAttrs::CalcBottom() const
+inline sal_uInt16 SwBorderAttrs::CalcBottom() const
{
if ( bBottom )
((SwBorderAttrs*)this)->_CalcBottom();
return nBottom;
}
-inline BOOL SwBorderAttrs::IsLine() const
+inline sal_Bool SwBorderAttrs::IsLine() const
{
if ( bLine )
((SwBorderAttrs*)this)->_IsLine();
diff --git a/sw/source/core/inc/ftnboss.hxx b/sw/source/core/inc/ftnboss.hxx
index 49c803609020..e993951d7143 100644
--- a/sw/source/core/inc/ftnboss.hxx
+++ b/sw/source/core/inc/ftnboss.hxx
@@ -64,7 +64,7 @@ class SwFtnBossFrm: public SwLayoutFrm
SwFtnContFrm *MakeFtnCont();
SwFtnFrm *FindFirstFtn();
- BYTE _NeighbourhoodAdjustment( const SwFrm* pFrm ) const;
+ sal_uInt8 _NeighbourhoodAdjustment( const SwFrm* pFrm ) const;
protected:
void InsertFtn( SwFtnFrm * );
@@ -78,16 +78,16 @@ public:
//Fussnotenschnittstelle
void AppendFtn( SwCntntFrm *, SwTxtFtn * );
- void RemoveFtn( const SwCntntFrm *, const SwTxtFtn *, BOOL bPrep = TRUE );
+ void RemoveFtn( const SwCntntFrm *, const SwTxtFtn *, sal_Bool bPrep = sal_True );
static SwFtnFrm *FindFtn( const SwCntntFrm *, const SwTxtFtn * );
SwFtnContFrm *FindFtnCont();
inline const SwFtnContFrm *FindFtnCont() const;
const SwFtnFrm *FindFirstFtn( SwCntntFrm* ) const;
- SwFtnContFrm *FindNearestFtnCont( BOOL bDontLeave = FALSE );
+ SwFtnContFrm *FindNearestFtnCont( sal_Bool bDontLeave = sal_False );
void ChangeFtnRef( const SwCntntFrm *pOld, const SwTxtFtn *,
SwCntntFrm *pNew );
- void RearrangeFtns( const SwTwips nDeadLine, const BOOL bLock = FALSE,
+ void RearrangeFtns( const SwTwips nDeadLine, const sal_Bool bLock = sal_False,
const SwTxtFtn *pAttr = 0 );
//SS damit der Textformatierer Temporaer die Fussnotenhoehe begrenzen
@@ -117,11 +117,11 @@ public:
SwFtnBossFrm* _pOld,
SvPtrarr& _rFtnArr,
const sal_Bool _bCollectOnlyPreviousFtns = sal_False );
- void _MoveFtns( SvPtrarr &rFtnArr, BOOL bCalc = FALSE );
+ void _MoveFtns( SvPtrarr &rFtnArr, sal_Bool bCalc = sal_False );
void MoveFtns( const SwCntntFrm *pSrc, SwCntntFrm *pDest,
SwTxtFtn *pAttr );
// Sollte AdjustNeighbourhood gerufen werden (oder Grow/Shrink)?
- BYTE NeighbourhoodAdjustment( const SwFrm* pFrm ) const
+ sal_uInt8 NeighbourhoodAdjustment( const SwFrm* pFrm ) const
{ return IsPageFrm() ? NA_ONLY_ADJUST : _NeighbourhoodAdjustment( pFrm ); }
};
diff --git a/sw/source/core/inc/ftnfrm.hxx b/sw/source/core/inc/ftnfrm.hxx
index 7dc72c081f56..c70493b3a6ca 100644
--- a/sw/source/core/inc/ftnfrm.hxx
+++ b/sw/source/core/inc/ftnfrm.hxx
@@ -47,8 +47,8 @@ public:
const SwFtnFrm* FindFootNote() const;
- virtual SwTwips ShrinkFrm( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE );
- virtual SwTwips GrowFrm ( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE );
+ 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 );
virtual void Format( const SwBorderAttrs *pAttrs = 0 );
virtual void PaintBorder( const SwRect &, const SwPageFrm *pPage,
const SwBorderAttrs & ) const;
@@ -66,15 +66,15 @@ class SwFtnFrm: public SwLayoutFrm
SwCntntFrm *pRef; //In diesem CntntFrm steht die Fussnotenref.
SwTxtFtn *pAttr; //Fussnotenattribut (zum wiedererkennen)
- BOOL bBackMoveLocked : 1; //Absaetze in dieser Fussnote duerfen derzeit
+ sal_Bool bBackMoveLocked : 1; //Absaetze in dieser Fussnote duerfen derzeit
//nicht rueckwaerts fliessen.
// --> OD 2005-05-18 #i49383# - control unlock of position of lower anchored objects.
bool mbUnlockPosOfLowerObjs : 1;
// <--
#ifdef DBG_UTIL
protected:
- virtual SwTwips ShrinkFrm( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE );
- virtual SwTwips GrowFrm ( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE );
+ 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 );
#endif
@@ -84,7 +84,7 @@ public:
virtual void Cut();
virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 );
- BOOL operator<( const SwTxtFtn* pTxtFtn ) const;
+ sal_Bool operator<( const SwTxtFtn* pTxtFtn ) const;
#ifndef DBG_UTIL
const SwCntntFrm *GetRef() const { return pRef; }
@@ -113,13 +113,13 @@ public:
void InvalidateNxtFtnCnts( SwPageFrm* pPage );
- void LockBackMove() { bBackMoveLocked = TRUE; }
- void UnlockBackMove() { bBackMoveLocked = FALSE;}
- BOOL IsBackMoveLocked() { return bBackMoveLocked; }
+ void LockBackMove() { bBackMoveLocked = sal_True; }
+ void UnlockBackMove() { bBackMoveLocked = sal_False;}
+ sal_Bool IsBackMoveLocked() { return bBackMoveLocked; }
// Verhindert, dass der letzte Inhalt den SwFtnFrm mitloescht (Cut())
- inline void ColLock() { bColLocked = TRUE; }
- inline void ColUnlock() { bColLocked = FALSE; }
+ inline void ColLock() { bColLocked = sal_True; }
+ inline void ColUnlock() { bColLocked = sal_False; }
// --> OD 2005-05-18 #i49383#
inline void UnlockPosOfLowerObjs()
diff --git a/sw/source/core/inc/hffrm.hxx b/sw/source/core/inc/hffrm.hxx
index 95cbe84ebe68..0158f04e7dc5 100644
--- a/sw/source/core/inc/hffrm.hxx
+++ b/sw/source/core/inc/hffrm.hxx
@@ -37,14 +37,18 @@ class SwHeadFootFrm : public SwLayoutFrm
protected:
void FormatSize(SwTwips nUL, const SwBorderAttrs * pAttrs);
void FormatPrt(SwTwips & nUL, const SwBorderAttrs * pAttrs);
- inline BOOL GetEatSpacing() const; // in hffrm.cxx
+ inline sal_Bool GetEatSpacing() const; // in hffrm.cxx
public:
+<<<<<<< local
SwHeadFootFrm(SwFrmFmt * pFrm, SwFrm*, USHORT aType);
+=======
+ SwHeadFootFrm(SwFrmFmt * pFrm, sal_uInt16 aType);
+>>>>>>> other
virtual void Format( const SwBorderAttrs *pAttrs = 0 );
virtual SwTwips GrowFrm( SwTwips,
- BOOL bTst = FALSE, BOOL bInfo = FALSE );
+ sal_Bool bTst = sal_False, sal_Bool bInfo = sal_False );
virtual SwTwips ShrinkFrm( SwTwips,
- BOOL bTst = FALSE, BOOL bInfo = FALSE );
+ sal_Bool bTst = sal_False, sal_Bool bInfo = sal_False );
};
class SwHeaderFrm: public SwHeadFootFrm
diff --git a/sw/source/core/inc/layact.hxx b/sw/source/core/inc/layact.hxx
index 2186ccac0d2d..749d5d424fe3 100644
--- a/sw/source/core/inc/layact.hxx
+++ b/sw/source/core/inc/layact.hxx
@@ -71,36 +71,36 @@ class SwLayAction
//Wenn ein Absatz - oder was auch immer - bei der Formatierung mehr
//als eine Seite rueckwaerts floss traegt er seine neue Seitennummer
//hier ein. Die Steuerung der InternalAction kann dann geeignet reagieren.
- USHORT nPreInvaPage;
+ sal_uInt16 nPreInvaPage;
- ULONG nStartTicks; //Startzeitpunkt der Aktion, vergeht zu viel Zeit kann
+ sal_uLong nStartTicks; //Startzeitpunkt der Aktion, vergeht zu viel Zeit kann
//der WaitCrsr per CheckWaitCrsr() eingeschaltet werden.
- USHORT nInputType; //Bei welchem Input soll die Verarbeitung abgebrochen
+ sal_uInt16 nInputType; //Bei welchem Input soll die Verarbeitung abgebrochen
//werden?
- USHORT nEndPage; //StatBar Steuerung.
- USHORT nCheckPageNum; //CheckPageDesc() wurde verzoegert wenn != USHRT_MAX
+ sal_uInt16 nEndPage; //StatBar Steuerung.
+ sal_uInt16 nCheckPageNum; //CheckPageDesc() wurde verzoegert wenn != USHRT_MAX
//ab dieser Seite Checken.
- BOOL bPaint; //Painten oder nur Formatieren?
- BOOL bComplete; //Alles bis zum sichtbaren Bereich Formatieren oder
+ sal_Bool bPaint; //Painten oder nur Formatieren?
+ sal_Bool bComplete; //Alles bis zum sichtbaren Bereich Formatieren oder
//oder nur den sichtbaren Bereich?
- BOOL bCalcLayout; //Vollstaendige Reformatierung?
- BOOL bAgain; //Zur automatisch wiederholten Action wenn Seiten
+ sal_Bool bCalcLayout; //Vollstaendige Reformatierung?
+ sal_Bool bAgain; //Zur automatisch wiederholten Action wenn Seiten
//geloscht werden.
- BOOL bNextCycle; //Wiederaufsetzen bei der ersten Ungueltigen Seite.
- BOOL bInput; //Zum Abbrechen der Verarbeitung wenn ein Input anliegt.
- BOOL bIdle; //True wenn die Layaction vom Idler ausgeloest wurde.
- BOOL bReschedule; //Soll das Reschedule - abhaengig vom Progress -
+ sal_Bool bNextCycle; //Wiederaufsetzen bei der ersten Ungueltigen Seite.
+ sal_Bool bInput; //Zum Abbrechen der Verarbeitung wenn ein Input anliegt.
+ sal_Bool bIdle; //True wenn die Layaction vom Idler ausgeloest wurde.
+ sal_Bool bReschedule; //Soll das Reschedule - abhaengig vom Progress -
//gerufen werden?
- BOOL bCheckPages; //CheckPageDescs() ausfuehren oder verzoegern.
- BOOL bUpdateExpFlds;//Wird gesetzt wenn nach dem Formatierien noch eine
+ sal_Bool bCheckPages; //CheckPageDescs() ausfuehren oder verzoegern.
+ sal_Bool bUpdateExpFlds;//Wird gesetzt wenn nach dem Formatierien noch eine
//Runde fuer den ExpFld laufen muss.
- BOOL bBrowseActionStop; //Action fruehzeitig beenden (per bInput) und den
+ sal_Bool bBrowseActionStop; //Action fruehzeitig beenden (per bInput) und den
//Rest dem Idler ueberlassen.
- BOOL bWaitAllowed; //Wartecursor erlaubt?
- BOOL bPaintExtraData; //Anzeige von Zeilennumerierung o. ae. eingeschaltet?
- BOOL bActionInProgress; // wird in Action() anfangs gesetzt und zum Schluss geloescht
+ sal_Bool bWaitAllowed; //Wartecursor erlaubt?
+ sal_Bool bPaintExtraData; //Anzeige von Zeilennumerierung o. ae. eingeschaltet?
+ sal_Bool bActionInProgress; // wird in Action() anfangs gesetzt und zum Schluss geloescht
// OD 14.04.2003 #106346# - new flag for content formatting on interrupt.
sal_Bool mbFormatCntntOnInterrupt;
@@ -109,28 +109,28 @@ class SwLayAction
void PaintCntnt( const SwCntntFrm *, const SwPageFrm *,
const SwRect &rOldRect, long nOldBottom );
- BOOL PaintWithoutFlys( const SwRect &, const SwCntntFrm *,
+ sal_Bool PaintWithoutFlys( const SwRect &, const SwCntntFrm *,
const SwPageFrm * );
- inline BOOL _PaintCntnt( const SwCntntFrm *, const SwPageFrm *,
+ inline sal_Bool _PaintCntnt( const SwCntntFrm *, const SwPageFrm *,
const SwRect & );
- BOOL FormatLayout( SwLayoutFrm *, BOOL bAddRect = TRUE );
- BOOL FormatLayoutTab( SwTabFrm *, BOOL bAddRect = TRUE );
- BOOL FormatCntnt( const SwPageFrm* pPage );
+ sal_Bool FormatLayout( SwLayoutFrm *, sal_Bool bAddRect = sal_True );
+ sal_Bool FormatLayoutTab( SwTabFrm *, sal_Bool bAddRect = sal_True );
+ sal_Bool FormatCntnt( const SwPageFrm* pPage );
void _FormatCntnt( const SwCntntFrm* pCntnt,
const SwPageFrm* pPage );
- BOOL IsShortCut( SwPageFrm *& );
+ sal_Bool IsShortCut( SwPageFrm *& );
- BOOL TurboAction();
- BOOL _TurboAction( const SwCntntFrm * );
+ sal_Bool TurboAction();
+ sal_Bool _TurboAction( const SwCntntFrm * );
void InternalAction();
SwPageFrm *CheckFirstVisPage( SwPageFrm *pPage );
- BOOL RemoveEmptyBrowserPages();
+ sal_Bool RemoveEmptyBrowserPages();
inline void CheckIdleEnd();
- inline ULONG GetStartTicks() { return nStartTicks; }
+ inline sal_uLong GetStartTicks() { return nStartTicks; }
#endif
@@ -139,63 +139,63 @@ public:
~SwLayAction();
#ifdef _LAYACT_CXX
- void SetIdle ( BOOL bNew ) { bIdle = bNew; }
- void SetCheckPages ( BOOL bNew ) { bCheckPages = bNew; }
- void SetBrowseActionStop(BOOL bNew ) { bBrowseActionStop = bNew; }
- void SetNextCycle ( BOOL bNew ) { bNextCycle = bNew; }
-
- BOOL IsWaitAllowed() const { return bWaitAllowed; }
- BOOL IsNextCycle() const { return bNextCycle; }
- BOOL IsInput() const { return bInput; }
- BOOL IsWait() const { return 0 != pWait; }
- BOOL IsPaint() const { return bPaint; }
- BOOL IsIdle() const { return bIdle; }
- BOOL IsReschedule() const { return bReschedule; }
- BOOL IsPaintExtraData() const { return bPaintExtraData;}
- BOOL IsStopPrt() const;
- BOOL IsInterrupt() const { return IsInput() || IsStopPrt(); }
-
- USHORT GetInputType() const { return nInputType; }
+ void SetIdle ( sal_Bool bNew ) { bIdle = bNew; }
+ void SetCheckPages ( sal_Bool bNew ) { bCheckPages = bNew; }
+ void SetBrowseActionStop(sal_Bool bNew ) { bBrowseActionStop = bNew; }
+ void SetNextCycle ( sal_Bool bNew ) { bNextCycle = bNew; }
+
+ sal_Bool IsWaitAllowed() const { return bWaitAllowed; }
+ sal_Bool IsNextCycle() const { return bNextCycle; }
+ sal_Bool IsInput() const { return bInput; }
+ sal_Bool IsWait() const { return 0 != pWait; }
+ sal_Bool IsPaint() const { return bPaint; }
+ sal_Bool IsIdle() const { return bIdle; }
+ sal_Bool IsReschedule() const { return bReschedule; }
+ sal_Bool IsPaintExtraData() const { return bPaintExtraData;}
+ sal_Bool IsStopPrt() const;
+ sal_Bool IsInterrupt() const { return IsInput() || IsStopPrt(); }
+
+ sal_uInt16 GetInputType() const { return nInputType; }
#endif
//Einstellen der Action auf das gewuenschte Verhalten.
- void SetPaint ( BOOL bNew ) { bPaint = bNew; }
- void SetComplete ( BOOL bNew ) { bComplete = bNew; }
- void SetStatBar ( BOOL bNew );
- void SetInputType ( USHORT nNew ) { nInputType = nNew; }
- void SetCalcLayout ( BOOL bNew ) { bCalcLayout = bNew; }
- void SetReschedule ( BOOL bNew ) { bReschedule = bNew; }
- void SetWaitAllowed ( BOOL bNew ) { bWaitAllowed = bNew; }
-
- void SetAgain() { bAgain = TRUE; }
- void SetUpdateExpFlds() {bUpdateExpFlds = TRUE; }
+ void SetPaint ( sal_Bool bNew ) { bPaint = bNew; }
+ void SetComplete ( sal_Bool bNew ) { bComplete = bNew; }
+ void SetStatBar ( sal_Bool bNew );
+ void SetInputType ( sal_uInt16 nNew ) { nInputType = nNew; }
+ void SetCalcLayout ( sal_Bool bNew ) { bCalcLayout = bNew; }
+ void SetReschedule ( sal_Bool bNew ) { bReschedule = bNew; }
+ void SetWaitAllowed ( sal_Bool bNew ) { bWaitAllowed = bNew; }
+
+ void SetAgain() { bAgain = sal_True; }
+ void SetUpdateExpFlds() {bUpdateExpFlds = sal_True; }
void SetProgress(SfxProgress * _pProgress = NULL)
{ pProgress = _pProgress; }
- inline void SetCheckPageNum( USHORT nNew );
- inline void SetCheckPageNumDirect( USHORT nNew ) { nCheckPageNum = nNew; }
+ inline void SetCheckPageNum( sal_uInt16 nNew );
+ inline void SetCheckPageNumDirect( sal_uInt16 nNew ) { nCheckPageNum = nNew; }
void Action(); //Jetzt gehts loos...
void Reset(); //Zurueck auf CTor-Defaults.
- BOOL IsAgain() const { return bAgain; }
- BOOL IsComplete() const { return bComplete; }
- BOOL IsExpFlds() const { return bUpdateExpFlds; }
- BOOL IsCalcLayout() const { return bCalcLayout; }
- BOOL IsCheckPages() const { return bCheckPages; }
- BOOL IsBrowseActionStop() const { return bBrowseActionStop; }
- BOOL IsActionInProgress() const { return bActionInProgress; }
+ sal_Bool IsAgain() const { return bAgain; }
+ sal_Bool IsComplete() const { return bComplete; }
+ sal_Bool IsExpFlds() const { return bUpdateExpFlds; }
+ sal_Bool IsCalcLayout() const { return bCalcLayout; }
+ sal_Bool IsCheckPages() const { return bCheckPages; }
+ sal_Bool IsBrowseActionStop() const { return bBrowseActionStop; }
+ sal_Bool IsActionInProgress() const { return bActionInProgress; }
- USHORT GetCheckPageNum() const { return nCheckPageNum; }
+ sal_uInt16 GetCheckPageNum() const { return nCheckPageNum; }
//Auch andere sollen den Wartecrsr einschalten koennen.
void CheckWaitCrsr();
// --> OD 2004-06-09 #i28701# - method is now public;
// delete 2nd parameter, because its not used;
- BOOL FormatLayoutFly( SwFlyFrm * );
+ sal_Bool FormatLayoutFly( SwFlyFrm * );
// --> OD 2004-06-09 #i28701# - method is now public
- BOOL _FormatFlyCntnt( const SwFlyFrm * );
+ sal_Bool _FormatFlyCntnt( const SwFlyFrm * );
};
@@ -206,11 +206,11 @@ class SwLayIdle
SwViewImp *pImp; // Hier Meldet sich der Idler an und ab.
SwCntntNode *pCntntNode; // Hier wird die aktuelle Cursorposition
xub_StrLen nTxtPos; // zwischengespeichert.
- BOOL bPageValid; // Konnte die Seite alles validiert werden?
- BOOL bAllValid; // Konnte alles validiert werden?
+ sal_Bool bPageValid; // Konnte die Seite alles validiert werden?
+ sal_Bool bAllValid; // Konnte alles validiert werden?
#ifdef DBG_UTIL
- BOOL bIndicator;
+ sal_Bool bIndicator;
#endif
#ifdef _LAYACT_CXX
@@ -220,8 +220,8 @@ class SwLayIdle
#endif
enum IdleJobType{ ONLINE_SPELLING, AUTOCOMPLETE_WORDS, WORD_COUNT, SMART_TAGS }; // SMARTTAGS
- BOOL _DoIdleJob( const SwCntntFrm*, IdleJobType );
- BOOL DoIdleJob( IdleJobType, BOOL bVisAreaOnly );
+ sal_Bool _DoIdleJob( const SwCntntFrm*, IdleJobType );
+ sal_Bool DoIdleJob( IdleJobType, sal_Bool bVisAreaOnly );
#endif
@@ -230,7 +230,7 @@ public:
~SwLayIdle();
};
-inline void SwLayAction::SetCheckPageNum( USHORT nNew )
+inline void SwLayAction::SetCheckPageNum( sal_uInt16 nNew )
{
if ( nNew < nCheckPageNum )
nCheckPageNum = nNew;
diff --git a/sw/source/core/inc/laycache.hxx b/sw/source/core/inc/laycache.hxx
index 2376a5fbb480..0f14067d0bda 100644
--- a/sw/source/core/inc/laycache.hxx
+++ b/sw/source/core/inc/laycache.hxx
@@ -51,7 +51,7 @@ class SvStream;
class SwLayoutCache
{
SwLayCacheImpl *pImpl;
- USHORT nLockCount;
+ sal_uInt16 nLockCount;
public:
SwLayoutCache() : pImpl( NULL ), nLockCount( 0 ) {}
~SwLayoutCache();
@@ -61,7 +61,7 @@ public:
void ClearImpl();
sal_Bool IsLocked() const { return nLockCount > 0; }
- USHORT& GetLockCount() { return nLockCount; }
+ sal_uInt16& GetLockCount() { return nLockCount; }
SwLayCacheImpl *LockImpl()
{ if( nLockCount & 0x8000 ) return NULL;
if ( pImpl )
diff --git a/sw/source/core/inc/layfrm.hxx b/sw/source/core/inc/layfrm.hxx
index 109b7cd23cf2..e782d19ae78f 100644
--- a/sw/source/core/inc/layfrm.hxx
+++ b/sw/source/core/inc/layfrm.hxx
@@ -60,10 +60,10 @@ protected:
SwFrm *pLower;
- virtual SwTwips ShrinkFrm( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE );
- virtual SwTwips GrowFrm ( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE );
+ 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 );
- long CalcRel( const SwFmtFrmSize &rSz, BOOL bWidth ) const;
+ long CalcRel( const SwFmtFrmSize &rSz, sal_Bool bWidth ) const;
public:
// --> OD 2004-06-29 #i28701#
@@ -76,10 +76,10 @@ public:
//Proportionale Groessenanpassung der untergeordneten.
void ChgLowersProp( const Size& rOldSize );
- void AdjustColumns( const SwFmtCol *pCol, BOOL bAdjustAttributes );
+ void AdjustColumns( const SwFmtCol *pCol, sal_Bool bAdjustAttributes );
void ChgColumns( const SwFmtCol &rOld, const SwFmtCol &rNew,
- const BOOL bChgFtn = FALSE );
+ const sal_Bool bChgFtn = sal_False );
//Painted die Column-Trennlinien fuer die innenliegenden Columns.
@@ -88,7 +88,7 @@ public:
virtual bool FillSelection( SwSelectionList& rList, const SwRect& rRect ) const;
- virtual BOOL GetCrsrOfst( SwPosition *, Point&,
+ virtual sal_Bool GetCrsrOfst( SwPosition *, Point&,
SwCrsrMoveState* = 0 ) const;
virtual void Cut();
@@ -96,11 +96,11 @@ public:
//sucht den dichtesten Cntnt zum SPoint, wird bei Seiten, Flys und Cells
//benutzt wenn GetCrsrOfst versagt hat.
- const SwCntntFrm* GetCntntPos( Point &rPoint, const BOOL bDontLeave,
- const BOOL bBodyOnly = FALSE,
- const BOOL bCalc = FALSE,
+ const SwCntntFrm* GetCntntPos( Point &rPoint, const sal_Bool bDontLeave,
+ const sal_Bool bBodyOnly = sal_False,
+ const sal_Bool bCalc = sal_False,
const SwCrsrMoveState *pCMS = 0,
- const BOOL bDefaultExpand = TRUE ) const;
+ const sal_Bool bDefaultExpand = sal_True ) const;
SwLayoutFrm( SwFrmFmt*, SwFrm* );
~SwLayoutFrm();
@@ -122,17 +122,17 @@ public:
const SwFrm *ContainsAny( const bool _bInvestigateFtnForSections = false ) const;
inline SwFrm *ContainsAny( const bool _bInvestigateFtnForSections = false );
// <--
- BOOL IsAnLower( const SwFrm * ) const;
+ sal_Bool IsAnLower( const SwFrm * ) const;
virtual const SwFrmFmt *GetFmt() const;
virtual SwFrmFmt *GetFmt();
void SetFrmFmt( SwFrmFmt* );
//Verschieben der Ftns aller Lower - ab dem StartCntnt.
- //TRUE wenn mindestens eine Ftn verschoben wurde.
+ //sal_True wenn mindestens eine Ftn verschoben wurde.
//Ruft das Update der Seitennummer wenn bFtnNums gesetzt ist.
- BOOL MoveLowerFtns( SwCntntFrm *pStart, SwFtnBossFrm *pOldBoss,
- SwFtnBossFrm *pNewBoss, const BOOL bFtnNums );
+ sal_Bool MoveLowerFtns( SwCntntFrm *pStart, SwFtnBossFrm *pOldBoss,
+ SwFtnBossFrm *pNewBoss, const sal_Bool bFtnNums );
// --> OD 2004-07-01 #i28701# - change purpose of method and its name
// --> OD 2005-03-11 #i44016# - add parameter <_bUnlockPosOfObjs> to
@@ -192,12 +192,12 @@ inline SwFrm* SwLayoutFrm::ContainsAny( const bool _bInvestigateFtnForSections )
// <--
// Diese SwFrm-inlines sind hier, damit frame.hxx nicht layfrm.hxx includen muss
-inline BOOL SwFrm::IsColBodyFrm() const
+inline sal_Bool SwFrm::IsColBodyFrm() const
{
return nType == FRMC_BODY && GetUpper()->IsColumnFrm();
}
-inline BOOL SwFrm::IsPageBodyFrm() const
+inline sal_Bool SwFrm::IsPageBodyFrm() const
{
return nType == FRMC_BODY && GetUpper()->IsPageFrm();
}
diff --git a/sw/source/core/inc/layouter.hxx b/sw/source/core/inc/layouter.hxx
index 4429e716578f..db506d302642 100644
--- a/sw/source/core/inc/layouter.hxx
+++ b/sw/source/core/inc/layouter.hxx
@@ -66,7 +66,7 @@ class SwLayouter
SwEndnoter* pEndnoter;
SwLooping* pLooping;
void _CollectEndnotes( SwSectionFrm* pSect );
- BOOL StartLooping( SwPageFrm* pPage );
+ sal_Bool StartLooping( SwPageFrm* pPage );
// --> OD 2004-06-23 #i28701#
SwMovedFwdFrmsByObjPos* mpMovedFwdFrms;
@@ -126,15 +126,15 @@ public:
~SwLayouter();
void InsertEndnotes( SwSectionFrm* pSect );
void CollectEndnote( SwFtnFrm* pFtn );
- BOOL HasEndnotes() const;
+ sal_Bool HasEndnotes() const;
- void LoopControl( SwPageFrm* pPage, BYTE nLoop );
+ void LoopControl( SwPageFrm* pPage, sal_uInt8 nLoop );
void EndLoopControl();
void LoopingLouieLight( const SwDoc& rDoc, const SwTxtFrm& rFrm );
static void CollectEndnotes( SwDoc* pDoc, SwSectionFrm* pSect );
- static BOOL Collecting( SwDoc* pDoc, SwSectionFrm* pSect, SwFtnFrm* pFtn );
- static BOOL StartLoopControl( SwDoc* pDoc, SwPageFrm *pPage );
+ static sal_Bool Collecting( SwDoc* pDoc, SwSectionFrm* pSect, SwFtnFrm* pFtn );
+ static sal_Bool StartLoopControl( SwDoc* pDoc, SwPageFrm *pPage );
// --> OD 2004-06-23 #i28701#
static void ClearMovedFwdFrms( const SwDoc& _rDoc );
diff --git a/sw/source/core/inc/mvsave.hxx b/sw/source/core/inc/mvsave.hxx
index 67434e14928a..9269606f2031 100644
--- a/sw/source/core/inc/mvsave.hxx
+++ b/sw/source/core/inc/mvsave.hxx
@@ -74,8 +74,8 @@ namespace sw { namespace mark
bool m_bSavePos;
bool m_bSaveOtherPos;
IDocumentMarkAccess::MarkType m_eOrigBkmType;
- ULONG m_nNode1;
- ULONG m_nNode2;
+ sal_uLong m_nNode1;
+ sal_uLong m_nNode2;
xub_StrLen m_nCntnt1;
xub_StrLen m_nCntnt2;
::boost::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndo;
@@ -90,11 +90,11 @@ void _DelBookmarks(const SwNodeIndex& rStt,
::std::vector< ::sw::mark::SaveBookmark> * SaveBkmk =0,
const SwIndex* pSttIdx =0,
const SwIndex* pEndIdx =0);
-void _SaveCntntIdx( SwDoc* pDoc, ULONG nNode, xub_StrLen nCntnt,
- SvULongs& rSaveArr, BYTE nSaveFly = 0 );
+void _SaveCntntIdx( SwDoc* pDoc, sal_uLong nNode, xub_StrLen nCntnt,
+ SvULongs& rSaveArr, sal_uInt8 nSaveFly = 0 );
void _RestoreCntntIdx( SwDoc* pDoc, SvULongs& rSaveArr,
- ULONG nNode, xub_StrLen nOffset = 0,
- BOOL bAuto = FALSE );
+ sal_uLong nNode, xub_StrLen nOffset = 0,
+ sal_Bool bAuto = sal_False );
void _RestoreCntntIdx( SvULongs& rSaveArr, const SwNode& rNd,
xub_StrLen nLen, xub_StrLen nCorrLen );
@@ -103,11 +103,11 @@ void _RestoreCntntIdx( SvULongs& rSaveArr, const SwNode& rNd,
* location. */
struct _SaveFly
{
- ULONG nNdDiff; /// relative node difference
+ sal_uLong nNdDiff; /// relative node difference
SwFrmFmt* pFrmFmt; /// the fly's frame format
sal_Bool bInsertPosition; /// if true, anchor _at_ insert position
- _SaveFly( ULONG nNodeDiff, SwFrmFmt* pFmt, sal_Bool bInsert )
+ _SaveFly( sal_uLong nNodeDiff, SwFrmFmt* pFmt, sal_Bool bInsert )
: nNdDiff( nNodeDiff ), pFrmFmt( pFmt ), bInsertPosition( bInsert )
{ }
};
@@ -129,16 +129,16 @@ class SwDataChanged
const SwPaM* pPam;
const SwPosition* pPos;
SwDoc* pDoc;
- ULONG nNode;
+ sal_uLong nNode;
xub_StrLen nCntnt;
- USHORT nType; // Insert/Move/Delete/... (UndoIds)
+ sal_uInt16 nType; // Insert/Move/Delete/... (UndoIds)
public:
- SwDataChanged( const SwPaM& rPam, USHORT nType );
- SwDataChanged( SwDoc* pDoc, const SwPosition& rPos, USHORT nType );
+ SwDataChanged( const SwPaM& rPam, sal_uInt16 nType );
+ SwDataChanged( SwDoc* pDoc, const SwPosition& rPos, sal_uInt16 nType );
~SwDataChanged();
- ULONG GetNode() const { return nNode; }
+ sal_uLong GetNode() const { return nNode; }
xub_StrLen GetCntnt() const { return nCntnt; }
};
@@ -164,18 +164,18 @@ class _ZSortFly
{
const SwFrmFmt* pFmt;
const SwFmtAnchor* pAnchor;
- UINT32 nOrdNum;
+ sal_uInt32 nOrdNum;
public:
_ZSortFly( const SwFrmFmt* pFrmFmt, const SwFmtAnchor* pFlyAnchor,
- UINT32 nArrOrdNum );
+ sal_uInt32 nArrOrdNum );
_ZSortFly& operator=( const _ZSortFly& rCpy )
{
pFmt = rCpy.pFmt, pAnchor = rCpy.pAnchor, nOrdNum = rCpy.nOrdNum;
return *this;
}
- int operator==( const _ZSortFly& ) const { return FALSE; }
+ int operator==( const _ZSortFly& ) const { return sal_False; }
int operator<( const _ZSortFly& rCmp ) const
{ return nOrdNum < rCmp.nOrdNum; }
diff --git a/sw/source/core/inc/node2lay.hxx b/sw/source/core/inc/node2lay.hxx
index 6743458f91dc..c70a084c1b85 100644
--- a/sw/source/core/inc/node2lay.hxx
+++ b/sw/source/core/inc/node2lay.hxx
@@ -67,15 +67,15 @@ public:
SwNode2Layout( const SwNode& rNd );
// Dieser Ctor ist fuer das Einfuegen vor oder hinter rNd gedacht,
// nIdx ist der Index des einzufuegenden Nodes
- SwNode2Layout( const SwNode& rNd, ULONG nIdx );
+ SwNode2Layout( const SwNode& rNd, sal_uLong nIdx );
~SwNode2Layout();
SwFrm* NextFrm();
SwLayoutFrm* UpperFrm( SwFrm* &rpFrm, const SwNode& rNode );
- void RestoreUpperFrms( SwNodes& rNds, ULONG nStt, ULONG nEnd );
+ void RestoreUpperFrms( SwNodes& rNds, sal_uLong nStt, sal_uLong nEnd );
SwFrm *GetFrm( const Point* pDocPos = 0,
const SwPosition *pPos = 0,
- const BOOL bCalcFrm = TRUE ) const;
+ const sal_Bool bCalcFrm = sal_True ) const;
};
#endif
diff --git a/sw/source/core/inc/noteurl.hxx b/sw/source/core/inc/noteurl.hxx
index bf23966d1a3d..647e46511991 100644
--- a/sw/source/core/inc/noteurl.hxx
+++ b/sw/source/core/inc/noteurl.hxx
@@ -48,7 +48,7 @@ public:
const String& GetURL() const { return aURL; }
const String& GetTarget() const { return aTarget; }
const SwRect& GetRect() const { return aRect; }
- BOOL operator==( const SwURLNote& rSwURLNote ) const
+ sal_Bool operator==( const SwURLNote& rSwURLNote ) const
{ return aRect == rSwURLNote.aRect; }
};
@@ -60,10 +60,10 @@ class SwNoteURL
SwURLNoteList aList;
public:
SwNoteURL() {}
- USHORT Count() const { return aList.Count(); }
+ sal_uInt16 Count() const { return aList.Count(); }
void InsertURLNote( const String& rURL, const String& rTarget,
const SwRect& rRect );
- const SwURLNote& GetURLNote( USHORT nPos ) const
+ const SwURLNote& GetURLNote( sal_uInt16 nPos ) const
{ return *aList.GetObject( nPos ); }
void FillImageMap( ImageMap* pMap, const Point& rPos, const MapMode& rMap );
};
diff --git a/sw/source/core/inc/notxtfrm.hxx b/sw/source/core/inc/notxtfrm.hxx
index 421584f5a827..b460d7465f3c 100644
--- a/sw/source/core/inc/notxtfrm.hxx
+++ b/sw/source/core/inc/notxtfrm.hxx
@@ -58,21 +58,21 @@ public:
virtual void Paint( SwRect const&,
SwPrintData const*const pPrintData = NULL ) const;
- virtual BOOL GetCharRect( SwRect &, const SwPosition&,
+ virtual sal_Bool GetCharRect( SwRect &, const SwPosition&,
SwCrsrMoveState* = 0) const;
- BOOL GetCrsrOfst(SwPosition* pPos, Point& aPoint,
+ sal_Bool GetCrsrOfst(SwPosition* pPos, Point& aPoint,
SwCrsrMoveState* = 0) const;
const Size &GetGrfSize() const { return GetSize(); }
- void GetGrfArea( SwRect &rRect, SwRect * = 0, BOOL bMirror = TRUE ) const;
+ void GetGrfArea( SwRect &rRect, SwRect * = 0, sal_Bool bMirror = sal_True ) const;
- BOOL IsTransparent() const;
+ sal_Bool IsTransparent() const;
void StopAnimation( OutputDevice* = 0 ) const;
- BOOL HasAnimation() const;
+ sal_Bool HasAnimation() const;
// Routinen fuer den Grafik-Cache
- USHORT GetWeight() { return nWeight; }
+ sal_uInt16 GetWeight() { return nWeight; }
};
#endif
diff --git a/sw/source/core/inc/pagefrm.hxx b/sw/source/core/inc/pagefrm.hxx
index fc1489c7af3f..0672251a8323 100644
--- a/sw/source/core/inc/pagefrm.hxx
+++ b/sw/source/core/inc/pagefrm.hxx
@@ -68,21 +68,21 @@ class SwPageFrm: public SwFtnBossFrm
SwPageDesc *pDesc; //PageDesc der die Seite beschreibt.
- USHORT nPhyPageNum; //Physikalische Seitennummer.
-
- BOOL bInvalidCntnt :1;
- BOOL bInvalidLayout :1;
- BOOL bInvalidFlyCntnt :1;
- BOOL bInvalidFlyLayout :1;
- BOOL bInvalidFlyInCnt :1;
- BOOL bFtnPage :1; //Diese Seite ist fuer Dokumentende-Fussnoten.
- BOOL bEmptyPage :1; //Dies ist eine explizite Leerseite
- BOOL bEndNotePage :1; //'Fussnotenseite' fuer Endnoten
- BOOL bInvalidSpelling :1; //Das Online-Spelling ist gefordert
- BOOL bInvalidSmartTags :1; //checking for smarttags is needed // SMARTTAGS
- BOOL bInvalidAutoCmplWrds :1; //Auto-Complete Wordliste aktualisieren
- BOOL bInvalidWordCount :1;
- BOOL bHasGrid :1; // Grid for Asian layout
+ sal_uInt16 nPhyPageNum; //Physikalische Seitennummer.
+
+ sal_Bool bInvalidCntnt :1;
+ sal_Bool bInvalidLayout :1;
+ sal_Bool bInvalidFlyCntnt :1;
+ sal_Bool bInvalidFlyLayout :1;
+ sal_Bool bInvalidFlyInCnt :1;
+ sal_Bool bFtnPage :1; //Diese Seite ist fuer Dokumentende-Fussnoten.
+ sal_Bool bEmptyPage :1; //Dies ist eine explizite Leerseite
+ sal_Bool bEndNotePage :1; //'Fussnotenseite' fuer Endnoten
+ sal_Bool bInvalidSpelling :1; //Das Online-Spelling ist gefordert
+ sal_Bool bInvalidSmartTags :1; //checking for smarttags is needed // SMARTTAGS
+ sal_Bool bInvalidAutoCmplWrds :1; //Auto-Complete Wordliste aktualisieren
+ sal_Bool bInvalidWordCount :1;
+ sal_Bool bHasGrid :1; // Grid for Asian layout
// OD 2004-05-17 #i28701# - boolean, indicating that layout of page frame
// is in progress.
@@ -92,7 +92,11 @@ class SwPageFrm: public SwFtnBossFrm
static const sal_Int8 mnBorderPxWidth;
static const sal_Int8 mnShadowPxWidth;
+<<<<<<< local
void _UpdateAttr( const SfxPoolItem*, const SfxPoolItem*, BYTE &,
+=======
+ void _UpdateAttr( SfxPoolItem*, SfxPoolItem*, sal_uInt8 &,
+>>>>>>> other
SwAttrSetChg *pa = 0, SwAttrSetChg *pb = 0 );
// Anpassen der max. Fussnotenhoehen in den einzelnen Spalten
@@ -229,13 +233,13 @@ public:
//Spezialisiertes GetCntntPos() fuer Felder in Rahmen.
void GetCntntPosition( const Point &rPt, SwPosition &rPos ) const;
- BOOL IsEmptyPage() const { return bEmptyPage; } //explizite Leerseite.
+ sal_Bool IsEmptyPage() const { return bEmptyPage; } //explizite Leerseite.
void UpdateFtnNum();
//Immer nach dem Paste rufen. Erzeugt die Seitengeb. Rahmen und Formatiert
//generischen Inhalt.
- void PreparePage( BOOL bFtn );
+ void PreparePage( sal_Bool bFtn );
//Schickt an alle ContentFrames ein Prepare wg. geaenderter Registervorlage
void PrepareRegisterChg();
@@ -250,17 +254,17 @@ public:
void PlaceFly( SwFlyFrm* pFly, SwFlyFrmFmt* pFmt );
// <--
- virtual BOOL GetCrsrOfst( SwPosition *, Point&,
+ virtual sal_Bool GetCrsrOfst( SwPosition *, Point&,
SwCrsrMoveState* = 0 ) const;
// erfrage vom Client Informationen
- virtual BOOL GetInfo( SfxPoolItem& ) const;
+ virtual sal_Bool GetInfo( SfxPoolItem& ) const;
virtual void Cut();
virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 );
- virtual void CheckDirection( BOOL bVert );
- void CheckGrid( BOOL bInvalidate );
+ virtual void CheckDirection( sal_Bool bVert );
+ void CheckGrid( sal_Bool bInvalidate );
void PaintGrid( OutputDevice* pOut, SwRect &rRect ) const;
- BOOL HasGrid() const { return bHasGrid; }
+ sal_Bool HasGrid() const { return bHasGrid; }
//Zeilennummern usw malen
void RefreshExtraData( const SwRect & ) const;
@@ -269,13 +273,13 @@ public:
void RefreshSubsidiary( const SwRect& ) const;
//Fussnotenschnittstelle
- BOOL IsFtnPage() const { return bFtnPage; }
- BOOL IsEndNotePage() const { return bEndNotePage; }
- void SetFtnPage( BOOL b ) { bFtnPage = b; }
- void SetEndNotePage( BOOL b ) { bEndNotePage = b; }
+ sal_Bool IsFtnPage() const { return bFtnPage; }
+ sal_Bool IsEndNotePage() const { return bEndNotePage; }
+ void SetFtnPage( sal_Bool b ) { bFtnPage = b; }
+ void SetEndNotePage( sal_Bool b ) { bEndNotePage = b; }
- inline USHORT GetPhyPageNum() const { return nPhyPageNum;}
- inline void SetPhyPageNum( USHORT nNum ) { nPhyPageNum = nNum;}
+ inline sal_uInt16 GetPhyPageNum() const { return nPhyPageNum;}
+ inline void SetPhyPageNum( sal_uInt16 nNum ) { nPhyPageNum = nNum;}
inline void DecrPhyPageNum() { --nPhyPageNum; }
inline void IncrPhyPageNum() { ++nPhyPageNum; }
@@ -299,17 +303,17 @@ public:
inline void ValidateSmartTags() const; // SMARTTAGS
inline void ValidateAutoCompleteWords() const;
inline void ValidateWordCount() const;
- inline BOOL IsInvalid() const;
- inline BOOL IsInvalidFly() const;
- BOOL IsInvalidFlyLayout() const { return bInvalidFlyLayout; }
- BOOL IsInvalidFlyCntnt() const { return bInvalidFlyCntnt; }
- BOOL IsInvalidFlyInCnt() const { return bInvalidFlyInCnt; }
- BOOL IsInvalidLayout() const { return bInvalidLayout; }
- BOOL IsInvalidCntnt() const { return (bInvalidCntnt || bInvalidFlyInCnt); }
- BOOL IsInvalidSpelling() const { return bInvalidSpelling; }
- BOOL IsInvalidSmartTags() const { return bInvalidSmartTags; } // SMARTTAGS
- BOOL IsInvalidAutoCompleteWords() const { return bInvalidAutoCmplWrds; }
- BOOL IsInvalidWordCount() const { return bInvalidWordCount; }
+ inline sal_Bool IsInvalid() const;
+ inline sal_Bool IsInvalidFly() const;
+ sal_Bool IsInvalidFlyLayout() const { return bInvalidFlyLayout; }
+ sal_Bool IsInvalidFlyCntnt() const { return bInvalidFlyCntnt; }
+ sal_Bool IsInvalidFlyInCnt() const { return bInvalidFlyInCnt; }
+ sal_Bool IsInvalidLayout() const { return bInvalidLayout; }
+ sal_Bool IsInvalidCntnt() const { return (bInvalidCntnt || bInvalidFlyInCnt); }
+ sal_Bool IsInvalidSpelling() const { return bInvalidSpelling; }
+ sal_Bool IsInvalidSmartTags() const { return bInvalidSmartTags; } // SMARTTAGS
+ sal_Bool IsInvalidAutoCompleteWords() const { return bInvalidAutoCmplWrds; }
+ sal_Bool IsInvalidWordCount() const { return bInvalidWordCount; }
/** SwPageFrm::GetDrawBackgrdColor - for #102450#
@@ -387,7 +391,7 @@ public:
SwRect& _orBorderAndShadowBoundRect,
const bool bRightSidebar );
- static void PaintNotesSidebar(const SwRect& _rPageRect, ViewShell* _pViewShell, USHORT nPageNum, bool bRight);
+ static void PaintNotesSidebar(const SwRect& _rPageRect, ViewShell* _pViewShell, sal_uInt16 nPageNum, bool bRight);
static void PaintNotesSidebarArrows(const Point &aMiddleFirst, const Point &aMiddleSecond, ViewShell* _pViewShell, const Color aColorUp, const Color aColorDown);
/**
mod #6i193#
@@ -447,84 +451,84 @@ inline const SwCntntFrm *SwPageFrm::FindLastBodyCntnt() const
}
inline void SwPageFrm::InvalidateFlyLayout() const
{
- ((SwPageFrm*)this)->bInvalidFlyLayout = TRUE;
+ ((SwPageFrm*)this)->bInvalidFlyLayout = sal_True;
}
inline void SwPageFrm::InvalidateFlyCntnt() const
{
- ((SwPageFrm*)this)->bInvalidFlyCntnt = TRUE;
+ ((SwPageFrm*)this)->bInvalidFlyCntnt = sal_True;
}
inline void SwPageFrm::InvalidateFlyInCnt() const
{
- ((SwPageFrm*)this)->bInvalidFlyInCnt = TRUE;
+ ((SwPageFrm*)this)->bInvalidFlyInCnt = sal_True;
}
inline void SwPageFrm::InvalidateLayout() const
{
- ((SwPageFrm*)this)->bInvalidLayout = TRUE;
+ ((SwPageFrm*)this)->bInvalidLayout = sal_True;
}
inline void SwPageFrm::InvalidateCntnt() const
{
- ((SwPageFrm*)this)->bInvalidCntnt = TRUE;
+ ((SwPageFrm*)this)->bInvalidCntnt = sal_True;
}
inline void SwPageFrm::InvalidateSpelling() const
{
- ((SwPageFrm*)this)->bInvalidSpelling = TRUE;
+ ((SwPageFrm*)this)->bInvalidSpelling = sal_True;
}
// SMARTTAGS
inline void SwPageFrm::InvalidateSmartTags() const
{
- ((SwPageFrm*)this)->bInvalidSmartTags = TRUE;
+ ((SwPageFrm*)this)->bInvalidSmartTags = sal_True;
}
inline void SwPageFrm::InvalidateAutoCompleteWords() const
{
- ((SwPageFrm*)this)->bInvalidAutoCmplWrds = TRUE;
+ ((SwPageFrm*)this)->bInvalidAutoCmplWrds = sal_True;
}
inline void SwPageFrm::InvalidateWordCount() const
{
- ((SwPageFrm*)this)->bInvalidWordCount = TRUE;
+ ((SwPageFrm*)this)->bInvalidWordCount = sal_True;
}
inline void SwPageFrm::ValidateFlyLayout() const
{
- ((SwPageFrm*)this)->bInvalidFlyLayout = FALSE;
+ ((SwPageFrm*)this)->bInvalidFlyLayout = sal_False;
}
inline void SwPageFrm::ValidateFlyCntnt() const
{
- ((SwPageFrm*)this)->bInvalidFlyCntnt = FALSE;
+ ((SwPageFrm*)this)->bInvalidFlyCntnt = sal_False;
}
inline void SwPageFrm::ValidateFlyInCnt() const
{
- ((SwPageFrm*)this)->bInvalidFlyInCnt = FALSE;
+ ((SwPageFrm*)this)->bInvalidFlyInCnt = sal_False;
}
inline void SwPageFrm::ValidateLayout() const
{
- ((SwPageFrm*)this)->bInvalidLayout = FALSE;
+ ((SwPageFrm*)this)->bInvalidLayout = sal_False;
}
inline void SwPageFrm::ValidateCntnt() const
{
- ((SwPageFrm*)this)->bInvalidCntnt = FALSE;
+ ((SwPageFrm*)this)->bInvalidCntnt = sal_False;
}
inline void SwPageFrm::ValidateSpelling() const
{
- ((SwPageFrm*)this)->bInvalidSpelling = FALSE;
+ ((SwPageFrm*)this)->bInvalidSpelling = sal_False;
}
// SMARTTAGS
inline void SwPageFrm::ValidateSmartTags() const
{
- ((SwPageFrm*)this)->bInvalidSmartTags = FALSE;
+ ((SwPageFrm*)this)->bInvalidSmartTags = sal_False;
}
inline void SwPageFrm::ValidateAutoCompleteWords() const
{
- ((SwPageFrm*)this)->bInvalidAutoCmplWrds = FALSE;
+ ((SwPageFrm*)this)->bInvalidAutoCmplWrds = sal_False;
}
inline void SwPageFrm::ValidateWordCount() const
{
- ((SwPageFrm*)this)->bInvalidWordCount = FALSE;
+ ((SwPageFrm*)this)->bInvalidWordCount = sal_False;
}
-inline BOOL SwPageFrm::IsInvalid() const
+inline sal_Bool SwPageFrm::IsInvalid() const
{
return (bInvalidCntnt || bInvalidLayout || bInvalidFlyInCnt);
}
-inline BOOL SwPageFrm::IsInvalidFly() const
+inline sal_Bool SwPageFrm::IsInvalidFly() const
{
return bInvalidFlyLayout || bInvalidFlyCntnt;
}
diff --git a/sw/source/core/inc/pamtyp.hxx b/sw/source/core/inc/pamtyp.hxx
index e549011f18af..9ca795584eb1 100644
--- a/sw/source/core/inc/pamtyp.hxx
+++ b/sw/source/core/inc/pamtyp.hxx
@@ -44,39 +44,39 @@ void GoStartDoc( SwPosition*);
void GoEndDoc( SwPosition*);
void GoStartSection( SwPosition*);
void GoEndSection( SwPosition*);
-BOOL GoInDoc( SwPaM&, SwMoveFn);
-BOOL GoInSection( SwPaM&, SwMoveFn);
-BOOL GoInNode( SwPaM&, SwMoveFn);
-BOOL GoInCntnt( SwPaM&, SwMoveFn);
-BOOL GoInCntntCells( SwPaM&, SwMoveFn);
-BOOL GoInCntntSkipHidden( SwPaM&, SwMoveFn);
-BOOL GoInCntntCellsSkipHidden( SwPaM&, SwMoveFn);
-const SwTxtAttr* GetFrwrdTxtHint( const SwpHints&, USHORT&, xub_StrLen );
-const SwTxtAttr* GetBkwrdTxtHint( const SwpHints&, USHORT&, xub_StrLen );
-
-BOOL GoNext(SwNode* pNd, SwIndex * pIdx, USHORT nMode );
-BOOL GoPrevious(SwNode* pNd, SwIndex * pIdx, USHORT nMode );
-SW_DLLPUBLIC SwCntntNode* GoNextNds( SwNodeIndex * pIdx, BOOL );
-SwCntntNode* GoPreviousNds( SwNodeIndex * pIdx, BOOL );
+sal_Bool GoInDoc( SwPaM&, SwMoveFn);
+sal_Bool GoInSection( SwPaM&, SwMoveFn);
+sal_Bool GoInNode( SwPaM&, SwMoveFn);
+sal_Bool GoInCntnt( SwPaM&, SwMoveFn);
+sal_Bool GoInCntntCells( SwPaM&, SwMoveFn);
+sal_Bool GoInCntntSkipHidden( SwPaM&, SwMoveFn);
+sal_Bool GoInCntntCellsSkipHidden( SwPaM&, SwMoveFn);
+const SwTxtAttr* GetFrwrdTxtHint( const SwpHints&, sal_uInt16&, xub_StrLen );
+const SwTxtAttr* GetBkwrdTxtHint( const SwpHints&, sal_uInt16&, xub_StrLen );
+
+sal_Bool GoNext(SwNode* pNd, SwIndex * pIdx, sal_uInt16 nMode );
+sal_Bool GoPrevious(SwNode* pNd, SwIndex * pIdx, sal_uInt16 nMode );
+SW_DLLPUBLIC SwCntntNode* GoNextNds( SwNodeIndex * pIdx, sal_Bool );
+SwCntntNode* GoPreviousNds( SwNodeIndex * pIdx, sal_Bool );
// --------- Funktionsdefinitionen fuer die SwCrsrShell --------------
-BOOL GoPrevPara( SwPaM&, SwPosPara);
-BOOL GoCurrPara( SwPaM&, SwPosPara);
-BOOL GoNextPara( SwPaM&, SwPosPara);
-BOOL GoPrevSection( SwPaM&, SwPosSection);
-BOOL GoCurrSection( SwPaM&, SwPosSection);
-BOOL GoNextSection( SwPaM&, SwPosSection);
+sal_Bool GoPrevPara( SwPaM&, SwPosPara);
+sal_Bool GoCurrPara( SwPaM&, SwPosPara);
+sal_Bool GoNextPara( SwPaM&, SwPosPara);
+sal_Bool GoPrevSection( SwPaM&, SwPosSection);
+sal_Bool GoCurrSection( SwPaM&, SwPosSection);
+sal_Bool GoNextSection( SwPaM&, SwPosSection);
// ------------ Typedefiniton fuer Funktionen ----------------------
-typedef BOOL (*GoNd)( SwNode*, SwIndex*, USHORT );
-typedef SwCntntNode* (*GoNds)( SwNodeIndex*, BOOL );
+typedef sal_Bool (*GoNd)( SwNode*, SwIndex*, sal_uInt16 );
+typedef SwCntntNode* (*GoNds)( SwNodeIndex*, sal_Bool );
typedef void (*GoDoc)( SwPosition* );
typedef void (*GoSection)( SwPosition* );
-typedef BOOL (SwPosition:: *CmpOp)( const SwPosition& ) const;
-typedef const SwTxtAttr* (*GetHint)( const SwpHints&, USHORT&, xub_StrLen );
+typedef sal_Bool (SwPosition:: *CmpOp)( const SwPosition& ) const;
+typedef const SwTxtAttr* (*GetHint)( const SwpHints&, sal_uInt16&, xub_StrLen );
typedef int (utl::TextSearch:: *SearchTxt)( const String&, xub_StrLen*,
xub_StrLen*, ::com::sun::star::util::SearchResult* );
typedef void (SwNodes:: *MvSection)( SwNodeIndex * ) const;
@@ -95,7 +95,7 @@ struct SwMoveFnCollection
};
// --------- Funktionsdefinitionen fuers Suchen --------------
-SwCntntNode* GetNode( SwPaM&, BOOL&, SwMoveFn, BOOL bInReadOnly = FALSE );
+SwCntntNode* GetNode( SwPaM&, sal_Bool&, SwMoveFn, sal_Bool bInReadOnly = sal_False );
diff --git a/sw/source/core/inc/rolbck.hxx b/sw/source/core/inc/rolbck.hxx
new file mode 100644
index 000000000000..c94383c83377
--- /dev/null
+++ b/sw/source/core/inc/rolbck.hxx
@@ -0,0 +1,453 @@
+/*************************************************************************
+ *
+ * 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 _ROLBCK_HXX
+#define _ROLBCK_HXX
+
+#include <tools/solar.h>
+#ifndef _SVSTDARR_HXX
+#define _SVSTDARR_USHORTS
+#define _SVSTDARR_USHORTSSORT
+#include <svl/svstdarr.hxx>
+#endif
+#include <svl/itemset.hxx>
+
+//Nur die History anziehen, um das docnew.cxx gegen die CLOOK's zu behaupten.
+
+namespace sfx2 {
+ class MetadatableUndo;
+}
+
+class SwDoc;
+class SwFmt;
+class SwFmtColl;
+class SwHistoryHint;
+class SwTxtAttr;
+class SfxPoolItem;
+class SwTxtNode;
+class SwUndoSaveSection;
+class SwTxtFtn;
+class SwTxtFlyCnt;
+class SwUndoDelLayFmt;
+class SwFlyFrmFmt;
+class SwFmtFld;
+class SwTxtFld;
+class SwFieldType;
+class SwTxtTOXMark;
+class SwTxtRefMark;
+class SwFrmFmt;
+class SwpHints;
+class SwFmtChain;
+class SwNode;
+class SwCharFmt;
+
+#ifndef ROLBCK_HISTORY_ONLY
+
+#include <tox.hxx>
+
+#include <SwNumberTreeTypes.hxx>
+// --> OD 2007-10-17 #i81002#
+#include <IDocumentMarkAccess.hxx>
+// <--
+
+#include <memory>
+
+
+enum HISTORY_HINT {
+ HSTRY_SETFMTHNT,
+ HSTRY_RESETFMTHNT,
+ HSTRY_SETTXTHNT,
+ HSTRY_SETTXTFLDHNT,
+ HSTRY_SETREFMARKHNT,
+ HSTRY_SETTOXMARKHNT,
+ HSTRY_RESETTXTHNT,
+ HSTRY_SETFTNHNT,
+ HSTRY_CHGFMTCOLL,
+ HSTRY_FLYCNT,
+ HSTRY_BOOKMARK,
+ HSTRY_SETATTRSET,
+ HSTRY_RESETATTRSET,
+ HSTRY_CHGFLYANCHOR,
+ HSTRY_CHGFLYCHAIN,
+ HSTRY_CHGCHARFMT, // #i27615#
+ HSTRY_END
+};
+
+class SwHistoryHint
+{
+ const HISTORY_HINT m_eWhichId;
+
+public:
+ SwHistoryHint( HISTORY_HINT eWhich ) : m_eWhichId( eWhich ) {}
+ virtual ~SwHistoryHint() {}
+ virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet ) = 0;
+ HISTORY_HINT Which() const { return m_eWhichId; }
+ virtual String GetDescription() const;
+};
+
+class SwHistorySetFmt : public SwHistoryHint
+{
+ ::std::auto_ptr<SfxPoolItem> m_pAttr;
+ const sal_uLong m_nNodeIndex;
+
+public:
+ SwHistorySetFmt( const SfxPoolItem* pFmtHt, sal_uLong nNode );
+ virtual ~SwHistorySetFmt();
+ virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet );
+ virtual String GetDescription() const;
+
+};
+
+class SwHistoryResetFmt : public SwHistoryHint
+{
+ const sal_uLong m_nNodeIndex;
+ const sal_uInt16 m_nWhich;
+
+public:
+ // --> OD 2008-02-27 #refactorlists# - removed <rDoc>
+ SwHistoryResetFmt( const SfxPoolItem* pFmtHt, sal_uLong nNodeIdx );
+ // <--
+ virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet );
+
+};
+
+class SwHistorySetTxt : public SwHistoryHint
+{
+ ::std::auto_ptr<SfxPoolItem> m_pAttr;
+ const sal_uLong m_nNodeIndex;
+ const xub_StrLen m_nStart;
+ const xub_StrLen m_nEnd;
+
+public:
+ SwHistorySetTxt( SwTxtAttr* pTxtHt, sal_uLong nNode );
+ virtual ~SwHistorySetTxt();
+ virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet );
+
+};
+
+class SwHistorySetTxtFld : public SwHistoryHint
+{
+ //!! beware of the order for the declation of the auto_ptrs.
+ //!! If they get destroyed in the wrong order sw may crash (namely mail-merge as well)
+ ::std::auto_ptr<SwFieldType> m_pFldType;
+ const ::std::auto_ptr<SwFmtFld> m_pFld;
+
+ sal_uLong m_nNodeIndex;
+ xub_StrLen m_nPos;
+ sal_uInt16 m_nFldWhich;
+
+public:
+ SwHistorySetTxtFld( SwTxtFld* pTxtFld, sal_uLong nNode );
+ virtual ~SwHistorySetTxtFld();
+ virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet );
+
+ virtual String GetDescription() const;
+
+};
+
+class SwHistorySetRefMark : public SwHistoryHint
+{
+ const String m_RefName;
+ const sal_uLong m_nNodeIndex;
+ const xub_StrLen m_nStart;
+ const xub_StrLen m_nEnd;
+
+public:
+ SwHistorySetRefMark( SwTxtRefMark* pTxtHt, sal_uLong nNode );
+ virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet );
+
+};
+
+class SwHistorySetTOXMark : public SwHistoryHint
+{
+ SwTOXMark m_TOXMark;
+ const String m_TOXName;
+ const TOXTypes m_eTOXTypes;
+ const sal_uLong m_nNodeIndex;
+ const xub_StrLen m_nStart;
+ const xub_StrLen m_nEnd;
+
+public:
+ SwHistorySetTOXMark( SwTxtTOXMark* pTxtHt, sal_uLong nNode );
+ virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet );
+ int IsEqual( const SwTOXMark& rCmp ) const;
+
+};
+
+class SwHistoryResetTxt : public SwHistoryHint
+{
+ const sal_uLong m_nNodeIndex;
+ const xub_StrLen m_nStart;
+ const xub_StrLen m_nEnd;
+ const sal_uInt16 m_nAttr;
+
+public:
+ SwHistoryResetTxt( sal_uInt16 nWhich, xub_StrLen nStt, xub_StrLen nEnd,
+ sal_uLong nNode );
+ virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet );
+
+ sal_uInt16 GetWhich() const { return m_nAttr; }
+ sal_uLong GetNode() const { return m_nNodeIndex; }
+ xub_StrLen GetCntnt() const { return m_nStart; }
+
+};
+
+class SwHistorySetFootnote : public SwHistoryHint
+{
+ const ::std::auto_ptr<SwUndoSaveSection> m_pUndo;
+ const String m_FootnoteNumber;
+ sal_uLong m_nNodeIndex;
+ const xub_StrLen m_nStart;
+ const bool m_bEndNote;
+
+public:
+ SwHistorySetFootnote( SwTxtFtn* pTxtFtn, sal_uLong nNode );
+ SwHistorySetFootnote( const SwTxtFtn& );
+ virtual ~SwHistorySetFootnote();
+ virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet );
+
+ virtual String GetDescription() const;
+
+};
+
+class SwHistoryChangeFmtColl : public SwHistoryHint
+{
+ SwFmtColl * const m_pColl;
+ const sal_uLong m_nNodeIndex;
+ const sal_uInt8 m_nNodeType;
+
+public:
+ SwHistoryChangeFmtColl( SwFmtColl* pColl, sal_uLong nNode, sal_uInt8 nNodeWhich );
+ virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet );
+
+};
+
+class SwHistoryTxtFlyCnt : public SwHistoryHint
+{
+ ::std::auto_ptr<SwUndoDelLayFmt> m_pUndo;
+
+public:
+ SwHistoryTxtFlyCnt( SwFrmFmt* const pFlyFmt );
+ virtual ~SwHistoryTxtFlyCnt();
+ virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet );
+ SwUndoDelLayFmt* GetUDelLFmt() { return m_pUndo.get(); }
+
+};
+
+class SwHistoryBookmark : public SwHistoryHint
+{
+ public:
+ SwHistoryBookmark(const ::sw::mark::IMark& rBkmk,
+ bool bSavePos, bool bSaveOtherPos);
+ virtual void SetInDoc(SwDoc * pDoc, bool);
+
+ bool IsEqualBookmark(const ::sw::mark::IMark& rBkmk);
+ const ::rtl::OUString& GetName() const;
+
+
+ private:
+ const ::rtl::OUString m_aName;
+ ::rtl::OUString m_aShortName;
+ KeyCode m_aKeycode;
+ const sal_uLong m_nNode;
+ const sal_uLong m_nOtherNode;
+ const xub_StrLen m_nCntnt;
+ const xub_StrLen m_nOtherCntnt;
+ const bool m_bSavePos;
+ const bool m_bSaveOtherPos;
+ const bool m_bHadOtherPos;
+ const IDocumentMarkAccess::MarkType m_eBkmkType;
+ ::boost::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndo;
+};
+
+class SwHistorySetAttrSet : public SwHistoryHint
+{
+ SfxItemSet m_OldSet;
+ SvUShorts m_ResetArray;
+ const sal_uLong m_nNodeIndex;
+
+public:
+ SwHistorySetAttrSet( const SfxItemSet& rSet, sal_uLong nNode,
+ const SvUShortsSort& rSetArr );
+ virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet );
+
+};
+
+
+class SwHistoryResetAttrSet : public SwHistoryHint
+{
+ const sal_uLong m_nNodeIndex;
+ const xub_StrLen m_nStart;
+ const xub_StrLen m_nEnd;
+ SvUShorts m_Array;
+
+public:
+ SwHistoryResetAttrSet( const SfxItemSet& rSet, sal_uLong nNode,
+ xub_StrLen nStt = STRING_MAXLEN,
+ xub_StrLen nEnd = STRING_MAXLEN );
+ virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet );
+
+ const SvUShorts& GetArr() const { return m_Array; }
+ sal_uLong GetNode() const { return m_nNodeIndex; }
+ xub_StrLen GetCntnt() const { return m_nStart; }
+
+};
+
+class SwHistoryChangeFlyAnchor : public SwHistoryHint
+{
+ SwFrmFmt & m_rFmt;
+ const sal_uLong m_nOldNodeIndex;
+ const xub_StrLen m_nOldContentIndex;
+
+public:
+ SwHistoryChangeFlyAnchor( SwFrmFmt& rFmt );
+ virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet );
+};
+
+class SwHistoryChangeFlyChain : public SwHistoryHint
+{
+ SwFlyFrmFmt * const m_pPrevFmt;
+ SwFlyFrmFmt * const m_pNextFmt;
+ SwFlyFrmFmt * const m_pFlyFmt;
+
+public:
+ SwHistoryChangeFlyChain( SwFlyFrmFmt& rFmt, const SwFmtChain& rAttr );
+ virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet );
+};
+
+// #i27615#
+class SwHistoryChangeCharFmt : public SwHistoryHint
+{
+ const SfxItemSet m_OldSet;
+ const String m_Fmt;
+
+public:
+ SwHistoryChangeCharFmt( const SfxItemSet& rSet, const String & sFmt);
+ virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet );
+
+};
+
+
+#endif
+
+typedef SwHistoryHint* SwHistoryHintPtr;
+SV_DECL_PTRARR_DEL( SwpHstry, SwHistoryHintPtr, 0, 2 )
+
+class SwHistory
+{
+ friend class SwDoc; // actually only SwDoc::DelUndoObj may access
+ friend class SwUndoWriter; // for Undo/Redo Writer
+ friend class SwRegHistory; // for inserting History attributes
+
+ SwpHstry m_SwpHstry;
+ sal_uInt16 m_nEndDiff;
+
+public:
+ SwHistory( sal_uInt16 nInitSz = 0, sal_uInt16 nGrowSz = 2 );
+ ~SwHistory();
+
+ // delete History from nStart to array end
+ void Delete( sal_uInt16 nStart = 0 );
+ // call and delete all objects between nStart and array end
+ bool Rollback( SwDoc* pDoc, sal_uInt16 nStart = 0 );
+ // call all objects between nStart and TmpEnd; store nStart as TmpEnd
+ bool TmpRollback( SwDoc* pDoc, sal_uInt16 nStart, bool ToFirst = true );
+
+ // --> OD 2008-02-27 #refactorlists# - removed <rDoc>
+ void Add( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue,
+ sal_uLong nNodeIdx );
+ // <--
+ void Add( SwTxtAttr* pTxtHt, sal_uLong nNodeIdx, bool bNewAttr = true );
+ void Add( SwFmtColl*, sal_uLong nNodeIdx, sal_uInt8 nWhichNd );
+ void Add( const ::sw::mark::IMark&, bool bSavePos, bool bSaveOtherPos );
+ void Add( SwFrmFmt& rFmt );
+ void Add( SwFlyFrmFmt&, sal_uInt16& rSetPos );
+ void Add( const SwTxtFtn& );
+ void Add( const SfxItemSet & rSet, const SwCharFmt & rCharFmt); // #i27615#
+
+ sal_uInt16 Count() const { return m_SwpHstry.Count(); }
+ sal_uInt16 GetTmpEnd() const { return m_SwpHstry.Count() - m_nEndDiff; }
+ sal_uInt16 SetTmpEnd( sal_uInt16 nTmpEnd ); // return previous value
+ SwHistoryHint * operator[]( sal_uInt16 nPos ) { return m_SwpHstry[nPos]; }
+ SwHistoryHint const* operator[]( sal_uInt16 nPos ) const
+ { return m_SwpHstry[nPos]; }
+
+ // for SwUndoDelete::Undo/Redo
+ void Move( sal_uInt16 nPos, SwHistory *pIns,
+ sal_uInt16 nStart = 0, sal_uInt16 nEnd = USHRT_MAX )
+ {
+ m_SwpHstry.Insert( &pIns->m_SwpHstry, nPos, nStart, nEnd );
+ pIns->m_SwpHstry.Remove( nStart, (nEnd == USHRT_MAX)
+ ? pIns->Count() - nStart
+ : nEnd );
+ }
+
+ // helper methods for recording attribute in History
+ // used by Undo classes (Delete/Overwrite/Inserts)
+ void CopyAttr( SwpHints* pHts, sal_uLong nNodeIdx, xub_StrLen nStart,
+ xub_StrLen nEnd, bool bFields );
+ // --> OD 2008-02-27 #refactorlists# - removed <rDoc>
+ void CopyFmtAttr( const SfxItemSet& rSet, sal_uLong nNodeIdx );
+ // <--
+};
+
+#ifndef ROLBCK_HISTORY_ONLY
+
+class SwRegHistory : public SwClient
+{
+private:
+ SvUShortsSort m_WhichIdSet;
+ SwHistory * const m_pHistory;
+ sal_uLong m_nNodeIndex;
+
+ void _MakeSetWhichIds();
+
+protected:
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew );
+
+public:
+ // --> OD 2008-02-27 #refactorlists# - removed <rDoc>
+ SwRegHistory( SwHistory* pHst );
+ // <--
+ SwRegHistory( const SwNode& rNd, SwHistory* pHst );
+ SwRegHistory( SwModify* pRegIn, const SwNode& rNd, SwHistory* pHst );
+
+ /// @return true iff at least 1 item was inserted
+ bool InsertItems( const SfxItemSet& rSet,
+ xub_StrLen const nStart, xub_StrLen const nEnd,
+ SetAttrMode const nFlags );
+
+ void AddHint( SwTxtAttr* pHt, const bool bNew = false );
+
+ void RegisterInModify( SwModify* pRegIn, const SwNode& rNd );
+ void ChangeNodeIndex( sal_uLong nNew ) { m_nNodeIndex = nNew; }
+};
+
+#endif
+
+
+#endif // _ROLBCK_HXX
+
diff --git a/sw/source/core/inc/rootfrm.hxx b/sw/source/core/inc/rootfrm.hxx
index ffd2afb8f051..401c5271a5e6 100644
--- a/sw/source/core/inc/rootfrm.hxx
+++ b/sw/source/core/inc/rootfrm.hxx
@@ -79,7 +79,7 @@ class SwRootFrm: public SwLayoutFrm
// for pages located at the outer borders
SwRect maPagesArea; // the area covered by the pages
long mnViewWidth; // the current page layout bases on this view width
- USHORT mnColumns; // the current page layout bases on this number of columns
+ sal_uInt16 mnColumns; // the current page layout bases on this number of columns
bool mbBookMode; // the current page layout is in book view
bool mbSidebarChanged; // the notes sidebar state has changed
// <--
@@ -87,19 +87,19 @@ class SwRootFrm: public SwLayoutFrm
bool mbNeedGrammarCheck; // true when sth needs to be checked (not necessarily started yet!)
static SwLayVout *pVout;
- static BOOL bInPaint; //Schutz gegen doppelte Paints.
- static BOOL bNoVirDev; //Bei SystemPaints kein virt. Device
-
- BOOL bCheckSuperfluous :1; //Leere Seiten suchen?
- BOOL bIdleFormat :1; //Idle-Formatierer anwerfen?
- BOOL bBrowseWidthValid :1; //Ist nBrowseWidth gueltig?
- BOOL bDummy2 :1; //Unbenutzt
- BOOL bTurboAllowed :1;
- BOOL bAssertFlyPages :1; //Ggf. weitere Seiten fuer Flys einfuegen?
- BOOL bDummy :1; //Unbenutzt
- BOOL bIsVirtPageNum :1; //gibt es eine virtuelle Seitennummer ?
- BOOL bIsNewLayout :1; //Layout geladen oder neu erzeugt.
- BOOL bCallbackActionEnabled:1; //Keine Action in Benachrichtung erwuenscht
+ static sal_Bool bInPaint; //Schutz gegen doppelte Paints.
+ static sal_Bool bNoVirDev; //Bei SystemPaints kein virt. Device
+
+ sal_Bool bCheckSuperfluous :1; //Leere Seiten suchen?
+ sal_Bool bIdleFormat :1; //Idle-Formatierer anwerfen?
+ sal_Bool bBrowseWidthValid :1; //Ist nBrowseWidth gueltig?
+ sal_Bool bDummy2 :1; //Unbenutzt
+ sal_Bool bTurboAllowed :1;
+ sal_Bool bAssertFlyPages :1; //Ggf. weitere Seiten fuer Flys einfuegen?
+ sal_Bool bDummy :1; //Unbenutzt
+ sal_Bool bIsVirtPageNum :1; //gibt es eine virtuelle Seitennummer ?
+ sal_Bool bIsNewLayout :1; //Layout geladen oder neu erzeugt.
+ sal_Bool bCallbackActionEnabled:1; //Keine Action in Benachrichtung erwuenscht
//siehe dcontact.cxx, ::Changed()
//Fuer den BrowseMode. nBrowseWidth ist die Aeussere Kante des am weitesten
@@ -148,7 +148,7 @@ class SwRootFrm: public SwLayoutFrm
SwDestroyList* pDestroy;
- USHORT nPhyPageNums; //Anzahl der Seiten.
+ sal_uInt16 nPhyPageNums; //Anzahl der Seiten.
sal_uInt16 nAccessibleShells; // Number of accessible shells
void ImplCalcBrowseWidth();
@@ -172,9 +172,9 @@ public:
void AllRemoveFtns() ;//swmod 080305
void AllInvalidateSmartTagsOrSpelling(BOOL bSmartTags) const;//swmod 080307
//Virtuelles Device ausgeben (z.B. wenn Animationen ins Spiel kommen)
- static BOOL FlushVout();
+ static sal_Bool FlushVout();
//Clipping sparen, wenn im Vout eh genau das Cliprechteck ausgegeben wird
- static BOOL HasSameRect( const SwRect& rRect );
+ static sal_Bool HasSameRect( const SwRect& rRect );
SwRootFrm( SwFrmFmt*, ViewShell* );
~SwRootFrm();
@@ -188,7 +188,7 @@ public:
//Der ChangeLinkd der CrsrShell (UI-Benachrichtigung) wird im EndAllAction
//automatisch gecallt.
void StartAllAction();
- void EndAllAction( BOOL bVirDev = FALSE );
+ void EndAllAction( sal_Bool bVirDev = sal_False );
// fuer bestimmte UNO-Aktionen (Tabellencursor) ist es notwendig, dass alle Actions
// kurzfristig zurueckgesetzt werden. Dazu muss sich jede ViewShell ihren alten Action-zaehler
@@ -200,13 +200,13 @@ public:
SdrPage* GetDrawPage() { return pDrawPage; }
void SetDrawPage( SdrPage* pNew ){ pDrawPage = pNew; }
- virtual BOOL GetCrsrOfst( SwPosition *, Point&,
+ virtual sal_Bool GetCrsrOfst( SwPosition *, Point&,
SwCrsrMoveState* = 0 ) const;
virtual void Paint( SwRect const&,
SwPrintData const*const pPrintData = NULL ) const;
- virtual SwTwips ShrinkFrm( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE );
- virtual SwTwips GrowFrm ( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE );
+ 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 );
#ifdef DBG_UTIL
virtual void Cut();
virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 );
@@ -214,28 +214,28 @@ public:
virtual bool FillSelection( SwSelectionList& rList, const SwRect& rRect ) const;
- Point GetNextPrevCntntPos( const Point &rPoint, BOOL bNext ) const;
+ Point GetNextPrevCntntPos( const Point &rPoint, sal_Bool bNext ) const;
virtual Size ChgSize( const Size& aNewSize );
- void SetIdleFlags() { bIdleFormat = TRUE; }
- BOOL IsIdleFormat() const { return bIdleFormat; }
- void ResetIdleFormat() { bIdleFormat = FALSE; }
+ void SetIdleFlags() { bIdleFormat = sal_True; }
+ sal_Bool IsIdleFormat() const { return bIdleFormat; }
+ void ResetIdleFormat() { bIdleFormat = sal_False; }
bool IsNeedGrammarCheck() const { return mbNeedGrammarCheck; }
void SetNeedGrammarCheck( bool bVal ) { mbNeedGrammarCheck = bVal; }
//Sorgt dafuer, dass alle gewuenschten Seitengebunden Flys eine Seite finden
- void SetAssertFlyPages() { bAssertFlyPages = TRUE; }
+ void SetAssertFlyPages() { bAssertFlyPages = sal_True; }
void AssertFlyPages();
- BOOL IsAssertFlyPages() { return bAssertFlyPages; }
+ sal_Bool IsAssertFlyPages() { return bAssertFlyPages; }
//Stellt sicher, dass ab der uebergebenen Seite auf allen Seiten die
//Seitengebundenen Rahmen auf der richtigen Seite (Seitennummer) stehen.
void AssertPageFlys( SwPageFrm * );
//Saemtlichen Inhalt invalidieren, Size oder PrtArea
- void InvalidateAllCntnt( BYTE nInvalidate = INV_SIZE );
+ void InvalidateAllCntnt( sal_uInt8 nInvalidate = INV_SIZE );
/** method to invalidate/re-calculate the position of all floating
screen objects (Writer fly frames and drawing objects), which are
@@ -248,21 +248,21 @@ public:
void InvalidateAllObjPos();
//Ueberfluessige Seiten entfernen.
- void SetSuperfluous() { bCheckSuperfluous = TRUE; }
- BOOL IsSuperfluous() const { return bCheckSuperfluous; }
+ void SetSuperfluous() { bCheckSuperfluous = sal_True; }
+ sal_Bool IsSuperfluous() const { return bCheckSuperfluous; }
void RemoveSuperfluous();
//abfragen/setzen der aktuellen Seite und der Gesamtzahl der Seiten.
//Es wird soweit wie notwendig Formatiert.
- USHORT GetCurrPage( const SwPaM* ) const;
- USHORT SetCurrPage( SwCursor*, USHORT nPageNum );
- Point GetPagePos( USHORT nPageNum ) const;
- USHORT GetPageNum() const { return nPhyPageNums; }
+ sal_uInt16 GetCurrPage( const SwPaM* ) const;
+ sal_uInt16 SetCurrPage( SwCursor*, sal_uInt16 nPageNum );
+ Point GetPagePos( sal_uInt16 nPageNum ) const;
+ sal_uInt16 GetPageNum() const { return nPhyPageNums; }
void DecrPhyPageNums() { --nPhyPageNums; }
void IncrPhyPageNums() { ++nPhyPageNums; }
- BOOL IsVirtPageNum() const { return bIsVirtPageNum; }
- inline void SetVirtPageNum( const BOOL bOf ) const;
- BOOL IsDummyPage( USHORT nPageNum ) const;
+ sal_Bool IsVirtPageNum() const { return bIsVirtPageNum; }
+ inline void SetVirtPageNum( const sal_Bool bOf ) const;
+ sal_Bool IsDummyPage( sal_uInt16 nPageNum ) const;
// Point rPt: The point that should be used to find the page
// Size pSize: If given, we return the (first) page that overlaps with the
@@ -272,16 +272,16 @@ public:
const SwPageFrm* GetPageAtPos( const Point& rPt, const Size* pSize = 0, bool bExtend = false ) const;
//Der Crsr moechte die zu selektierenden Bereiche wissen.
- void CalcFrmRects( SwShellCrsr&, BOOL bIsTblSel );
+ void CalcFrmRects( SwShellCrsr&, sal_Bool bIsTblSel );
// Calculates the cells included from the current selection
// false: There was no result because of an invalid layout
// true: Everything worked fine.
bool MakeTblCrsrs( SwTableCursor& );
- void DisallowTurbo() const { ((SwRootFrm*)this)->bTurboAllowed = FALSE; }
- void ResetTurboFlag() const { ((SwRootFrm*)this)->bTurboAllowed = TRUE; }
- BOOL IsTurboAllowed() const { return bTurboAllowed; }
+ void DisallowTurbo() const { ((SwRootFrm*)this)->bTurboAllowed = sal_False; }
+ void ResetTurboFlag() const { ((SwRootFrm*)this)->bTurboAllowed = sal_True; }
+ sal_Bool IsTurboAllowed() const { return bTurboAllowed; }
void SetTurbo( const SwCntntFrm *pCntnt ) { pTurbo = pCntnt; }
void ResetTurbo() { pTurbo = 0; }
const SwCntntFrm *GetTurbo() { return pTurbo; }
@@ -290,27 +290,27 @@ public:
void UpdateFtnNums(); //nur bei Seitenweiser Nummerierung!
//Alle Fussnoten (nicht etwa die Referenzen) entfernen.
- void RemoveFtns( SwPageFrm *pPage = 0, BOOL bPageOnly = FALSE,
- BOOL bEndNotes = FALSE );
- void CheckFtnPageDescs( BOOL bEndNote );
+ void RemoveFtns( SwPageFrm *pPage = 0, sal_Bool bPageOnly = sal_False,
+ sal_Bool bEndNotes = sal_False );
+ void CheckFtnPageDescs( sal_Bool bEndNote );
const SwPageFrm *GetLastPage() const { return pLastPage; }
SwPageFrm *GetLastPage() { return pLastPage; }
- static BOOL IsInPaint() { return bInPaint; }
+ static sal_Bool IsInPaint() { return bInPaint; }
- static void SetNoVirDev( const BOOL bNew ) { bNoVirDev = bNew; }
+ static void SetNoVirDev( const sal_Bool bNew ) { bNoVirDev = bNew; }
inline long GetBrowseWidth() const;
- void SetBrowseWidth( long n ) { bBrowseWidthValid = TRUE; nBrowseWidth = n;}
+ void SetBrowseWidth( long n ) { bBrowseWidthValid = sal_True; nBrowseWidth = n;}
inline void InvalidateBrowseWidth();
#ifdef LONG_TABLE_HACK
void HackPrepareLongTblPaint( int nMode );
#endif
- BOOL IsNewLayout() const { return bIsNewLayout; }
- void ResetNewLayout() { bIsNewLayout = FALSE;}
+ sal_Bool IsNewLayout() const { return bIsNewLayout; }
+ void ResetNewLayout() { bIsNewLayout = sal_False;}
// Hier werden leere SwSectionFrms zur Zerstoerung angemeldet
// und spaeter zerstoert oder wieder abgemeldet
@@ -319,12 +319,12 @@ public:
void RemoveFromList( SwSectionFrm* pSct ) { if( pDestroy ) _RemoveFromList( pSct ); }
#ifdef DBG_UTIL
// Wird zur Zeit nur fuer ASSERTs benutzt:
- BOOL IsInDelList( SwSectionFrm* pSct ) const; // Ist der SectionFrm in der Liste enthalten?
+ sal_Bool IsInDelList( SwSectionFrm* pSct ) const; // Ist der SectionFrm in der Liste enthalten?
#endif
- void SetCallbackActionEnabled( BOOL b ) { bCallbackActionEnabled = b; }
- BOOL IsCallbackActionEnabled() const { return bCallbackActionEnabled; }
+ void SetCallbackActionEnabled( sal_Bool b ) { bCallbackActionEnabled = b; }
+ sal_Bool IsCallbackActionEnabled() const { return bCallbackActionEnabled; }
sal_Bool IsAnyShellAccessible() const { return nAccessibleShells > 0; }
void AddAccessibleShell() { ++nAccessibleShells; }
@@ -367,7 +367,7 @@ inline void SwRootFrm::InvalidateBrowseWidth()
ImplInvalidateBrowseWidth();
}
-inline void SwRootFrm::SetVirtPageNum( const BOOL bOf) const
+inline void SwRootFrm::SetVirtPageNum( const sal_Bool bOf) const
{
((SwRootFrm*)this)->bIsVirtPageNum = bOf;
}
diff --git a/sw/source/core/inc/rowfrm.hxx b/sw/source/core/inc/rowfrm.hxx
index 4a8d3607d54b..e66b521d80ba 100644
--- a/sw/source/core/inc/rowfrm.hxx
+++ b/sw/source/core/inc/rowfrm.hxx
@@ -38,15 +38,15 @@ class SwRowFrm: public SwLayoutFrm
{
virtual void Format( const SwBorderAttrs *pAttrs = 0 );
//Aendern nur die Framesize, nicht die PrtArea-SSize
- virtual SwTwips ShrinkFrm( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE );
- virtual SwTwips GrowFrm ( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE );
+ 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 );
const SwTableLine *pTabLine;
SwRowFrm* pFollowRow;
// --> collapsing borders FME 2005-05-27 #i29550#
- USHORT mnTopMarginForLowers;
- USHORT mnBottomMarginForLowers;
- USHORT mnBottomLineSize;
+ sal_uInt16 mnTopMarginForLowers;
+ sal_uInt16 mnBottomMarginForLowers;
+ sal_uInt16 mnBottomLineSize;
// <-- collapsing
bool bIsFollowFlowRow;
bool bIsRepeatedHeadline;
@@ -72,7 +72,7 @@ public:
//Passt die Zellen auf die aktuelle Hoehe an, invalidiert die Zellen
//wenn die Direction nicht der Hoehe entspricht.
- void AdjustCells( const SwTwips nHeight, const BOOL bHeight );
+ void AdjustCells( const SwTwips nHeight, const sal_Bool bHeight );
//
//
@@ -80,12 +80,12 @@ public:
void SetFollowRow( SwRowFrm* pNew ) { pFollowRow = pNew; }
// --> collapsing borders FME 2005-05-27 #i29550#
- USHORT GetTopMarginForLowers() const { return mnTopMarginForLowers; }
- void SetTopMarginForLowers( USHORT nNew ) { mnTopMarginForLowers = nNew; }
- USHORT GetBottomMarginForLowers() const { return mnBottomMarginForLowers; }
- void SetBottomMarginForLowers( USHORT nNew ) { mnBottomMarginForLowers = nNew; }
- USHORT GetBottomLineSize() const { return mnBottomLineSize; }
- void SetBottomLineSize( USHORT nNew ) { mnBottomLineSize = nNew; }
+ sal_uInt16 GetTopMarginForLowers() const { return mnTopMarginForLowers; }
+ void SetTopMarginForLowers( sal_uInt16 nNew ) { mnTopMarginForLowers = nNew; }
+ sal_uInt16 GetBottomMarginForLowers() const { return mnBottomMarginForLowers; }
+ void SetBottomMarginForLowers( sal_uInt16 nNew ) { mnBottomMarginForLowers = nNew; }
+ sal_uInt16 GetBottomLineSize() const { return mnBottomLineSize; }
+ void SetBottomLineSize( sal_uInt16 nNew ) { mnBottomLineSize = nNew; }
// <-- collapsing
bool IsRepeatedHeadline() const { return bIsRepeatedHeadline; }
diff --git a/sw/source/core/inc/scriptinfo.hxx b/sw/source/core/inc/scriptinfo.hxx
index a470571f845f..60c6877d4fb3 100644
--- a/sw/source/core/inc/scriptinfo.hxx
+++ b/sw/source/core/inc/scriptinfo.hxx
@@ -65,20 +65,20 @@ class SwScanner
xub_StrLen nBegin;
xub_StrLen nLen;
LanguageType aCurrLang;
- USHORT nWordType;
- BOOL bClip;
+ sal_uInt16 nWordType;
+ sal_Bool bClip;
public:
SwScanner( const SwTxtNode& rNd, const String& rTxt, const LanguageType* pLang,
const ModelToViewHelper::ConversionMap* pConvMap,
- USHORT nWordType,
- xub_StrLen nStart, xub_StrLen nEnde, BOOL bClip = FALSE );
+ sal_uInt16 nWordType,
+ xub_StrLen nStart, xub_StrLen nEnde, sal_Bool bClip = sal_False );
// This next word function tries to find the language for the next word
// It should currently _not_ be used for spell checking, and works only for
// ! bReverse
- BOOL NextWord();
+ sal_Bool NextWord();
const XubString& GetWord() const { return aWord; }
@@ -111,7 +111,7 @@ private:
SvXub_StrLens aHiddenChg;
SvBytes aCompType;
xub_StrLen nInvalidityPos;
- BYTE nDefaultDir;
+ sal_uInt8 nDefaultDir;
void UpdateBidiInfo( const String& rTxt );
@@ -136,16 +136,16 @@ public:
inline xub_StrLen GetInvalidity() const { return nInvalidityPos; };
// get default direction for paragraph
- inline BYTE GetDefaultDir() const { return nDefaultDir; };
+ inline sal_uInt8 GetDefaultDir() const { return nDefaultDir; };
// array operations, nCnt refers to array position
inline size_t CountScriptChg() const;
inline xub_StrLen GetScriptChg( const size_t nCnt ) const;
- inline BYTE GetScriptType( const USHORT nCnt ) const;
+ inline sal_uInt8 GetScriptType( const sal_uInt16 nCnt ) const;
inline size_t CountDirChg() const;
inline xub_StrLen GetDirChg( const size_t nCnt ) const;
- inline BYTE GetDirType( const size_t nCnt ) const;
+ inline sal_uInt8 GetDirType( const size_t nCnt ) const;
inline size_t CountKashida() const;
inline xub_StrLen GetKashida( const size_t nCnt ) const;
@@ -153,7 +153,7 @@ public:
inline size_t CountCompChg() const;
inline xub_StrLen GetCompStart( const size_t nCnt ) const;
inline xub_StrLen GetCompLen( const size_t nCnt ) const;
- inline BYTE GetCompType( const size_t nCnt ) const;
+ inline sal_uInt8 GetCompType( const size_t nCnt ) const;
inline size_t CountHiddenChg() const;
inline xub_StrLen GetHiddenChg( const size_t nCnt ) const;
@@ -162,18 +162,18 @@ public:
// "high" level operations, nPos refers to string position
xub_StrLen NextScriptChg( const xub_StrLen nPos ) const;
- BYTE ScriptType( const xub_StrLen nPos ) const;
+ sal_uInt8 ScriptType( const xub_StrLen nPos ) const;
// Returns the position of the next direction level change.
// If bLevel is set, the position of the next level which is smaller
// than the level at position nPos is returned. This is required to
// obtain the end of a SwBidiPortion
xub_StrLen NextDirChg( const xub_StrLen nPos,
- const BYTE* pLevel = 0 ) const;
- BYTE DirType( const xub_StrLen nPos ) const;
+ const sal_uInt8* pLevel = 0 ) const;
+ sal_uInt8 DirType( const xub_StrLen nPos ) const;
#if OSL_DEBUG_LEVEL > 1
- BYTE CompType( const xub_StrLen nPos ) const;
+ sal_uInt8 CompType( const xub_StrLen nPos ) const;
#endif
//
@@ -226,7 +226,7 @@ public:
@param bDel
If set, the hidden ranges will be deleted from the text node.
*/
- static USHORT MaskHiddenRanges( const SwTxtNode& rNode, XubString& rText,
+ static sal_uInt16 MaskHiddenRanges( const SwTxtNode& rNode, XubString& rText,
const xub_StrLen nStt, const xub_StrLen nEnd,
const xub_Unicode cChar );
@@ -245,11 +245,11 @@ public:
// examines the range [ nStart, nStart + nEnd ] if there are kanas
// returns start index of kana entry in array, otherwise USHRT_MAX
- USHORT HasKana( xub_StrLen nStart, const xub_StrLen nEnd ) const;
+ sal_uInt16 HasKana( xub_StrLen nStart, const xub_StrLen nEnd ) const;
// modifies the kerning array according to a given compress value
long Compress( sal_Int32* pKernArray, xub_StrLen nIdx, xub_StrLen nLen,
- const USHORT nCompress, const USHORT nFontHeight,
+ const sal_uInt16 nCompress, const sal_uInt16 nFontHeight,
Point* pPoint = NULL ) const;
/** Performes a kashida justification on the kerning array
@@ -268,7 +268,7 @@ public:
The value which has to be added to a kashida opportunity.
@return The number of kashida opportunities in the given range
*/
- USHORT KashidaJustify( sal_Int32* pKernArray, sal_Int32* pScrArray,
+ sal_uInt16 KashidaJustify( sal_Int32* pKernArray, sal_Int32* pScrArray,
xub_StrLen nStt, xub_StrLen nLen,
long nSpaceAdd = 0) const;
@@ -293,7 +293,7 @@ public:
pKashidaPositions: buffer to reveive the char indices of the
kashida opportunties relative to the paragraph
*/
- USHORT GetKashidaPositions ( xub_StrLen nStt, xub_StrLen nLen,
+ sal_uInt16 GetKashidaPositions ( xub_StrLen nStt, xub_StrLen nLen,
xub_StrLen* pKashidaPosition );
@@ -340,7 +340,7 @@ public:
The value which has to be added to the cells.
@return The number of extra spaces in the given range
*/
- static USHORT ThaiJustify( const XubString& rTxt, sal_Int32* pKernArray,
+ static sal_uInt16 ThaiJustify( const XubString& rTxt, sal_Int32* pKernArray,
sal_Int32* pScrArray, xub_StrLen nIdx,
xub_StrLen nLen, xub_StrLen nNumberOfBlanks = 0,
long nSpaceAdd = 0 );
@@ -348,7 +348,7 @@ public:
static SwScriptInfo* GetScriptInfo( const SwTxtNode& rNode,
sal_Bool bAllowInvalid = sal_False );
- static BYTE WhichFont( xub_StrLen nIdx, const String* pTxt, const SwScriptInfo* pSI );
+ static sal_uInt8 WhichFont( xub_StrLen nIdx, const String* pTxt, const SwScriptInfo* pSI );
};
inline void SwScriptInfo::SetInvalidity( const xub_StrLen nPos )
@@ -362,7 +362,7 @@ inline xub_StrLen SwScriptInfo::GetScriptChg( const size_t nCnt ) const
ASSERT( nCnt < aScriptChg.size(),"No ScriptChange today!");
return aScriptChg[ nCnt ];
}
-inline BYTE SwScriptInfo::GetScriptType( const xub_StrLen nCnt ) const
+inline sal_uInt8 SwScriptInfo::GetScriptType( const xub_StrLen nCnt ) const
{
ASSERT( nCnt < aScriptType.size(),"No ScriptType today!");
return aScriptType[ nCnt ];
@@ -374,7 +374,7 @@ inline xub_StrLen SwScriptInfo::GetDirChg( const size_t nCnt ) const
ASSERT( nCnt < aDirChg.size(),"No DirChange today!");
return aDirChg[ nCnt ];
}
-inline BYTE SwScriptInfo::GetDirType( const size_t nCnt ) const
+inline sal_uInt8 SwScriptInfo::GetDirType( const size_t nCnt ) const
{
ASSERT( nCnt < aDirType.size(),"No DirType today!");
return aDirType[ nCnt ];
@@ -399,7 +399,7 @@ inline xub_StrLen SwScriptInfo::GetCompLen( const size_t nCnt ) const
return aCompLen[ nCnt ];
}
-inline BYTE SwScriptInfo::GetCompType( const size_t nCnt ) const
+inline sal_uInt8 SwScriptInfo::GetCompType( const size_t nCnt ) const
{
ASSERT( nCnt < aCompType.size(),"No CompressionType today!");
return aCompType[ nCnt ];
diff --git a/sw/source/core/inc/sectfrm.hxx b/sw/source/core/inc/sectfrm.hxx
index b4ecb4a9f733..d7c5b7cccb66 100644
--- a/sw/source/core/inc/sectfrm.hxx
+++ b/sw/source/core/inc/sectfrm.hxx
@@ -45,30 +45,39 @@ class SwSectionFrm: public SwLayoutFrm, public SwFlowFrm
{
SwSection* pSection;
+<<<<<<< local
void _UpdateAttr( const SfxPoolItem*, const SfxPoolItem*, BYTE &,
+=======
+ void _UpdateAttr( SfxPoolItem*, SfxPoolItem*, sal_uInt8 &,
+>>>>>>> other
SwAttrSetChg *pa = 0, SwAttrSetChg *pb = 0 );
- void _Cut( BOOL bRemove );
+ void _Cut( sal_Bool bRemove );
// Is there a FtnContainer?
// An empty sectionfrm without FtnCont is superfluous
- BOOL IsSuperfluous() const { return !ContainsAny() && !ContainsFtnCont(); }
+ sal_Bool IsSuperfluous() const { return !ContainsAny() && !ContainsFtnCont(); }
void CalcFtnAtEndFlag();
void CalcEndAtEndFlag();
const SwSectionFmt* _GetEndSectFmt() const;
- BOOL IsEndnoteAtMyEnd() const;
+ sal_Bool IsEndnoteAtMyEnd() const;
protected:
virtual void MakeAll();
- virtual BOOL ShouldBwdMoved( SwLayoutFrm *pNewUpper, BOOL bHead, BOOL &rReformat );
+ 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:
+<<<<<<< local
SwSectionFrm( SwSection &, SwFrm* ); //Inhalt wird nicht erzeugt!
SwSectionFrm( SwSectionFrm &, BOOL bMaster );//_Nur_ zum Erzeugen von Master/Follows
+=======
+ SwSectionFrm( SwSection & ); //Inhalt wird nicht erzeugt!
+ SwSectionFrm( SwSectionFrm &, sal_Bool bMaster );//_Nur_ zum Erzeugen von Master/Follows
+>>>>>>> other
~SwSectionFrm();
void Init();
- virtual void CheckDirection( BOOL bVert );
+ virtual void CheckDirection( sal_Bool bVert );
virtual void Cut();
virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 );
@@ -77,53 +86,53 @@ public:
inline SwSectionFrm *GetFollow();
SwSectionFrm* FindMaster() const;
- SwCntntFrm *FindLastCntnt( BYTE nMode = 0 );
- inline const SwCntntFrm *FindLastCntnt( BYTE nMode = 0 ) const;
+ SwCntntFrm *FindLastCntnt( sal_uInt8 nMode = 0 );
+ inline const SwCntntFrm *FindLastCntnt( sal_uInt8 nMode = 0 ) const;
inline SwSection* GetSection() { return pSection; }
inline const SwSection* GetSection() const { return pSection; }
- inline void ColLock() { bColLocked = TRUE; }
- inline void ColUnlock() { bColLocked = FALSE; }
+ inline void ColLock() { bColLocked = sal_True; }
+ inline void ColUnlock() { bColLocked = sal_False; }
void CalcFtnCntnt();
void SimpleFormat();
- BOOL IsDescendantFrom( const SwSectionFmt* pSect ) const;
- BOOL HasToBreak( const SwFrm* pFrm ) const;
+ sal_Bool IsDescendantFrom( const SwSectionFmt* pSect ) const;
+ sal_Bool HasToBreak( const SwFrm* pFrm ) const;
void MergeNext( SwSectionFrm* pNxt );
//Zerlegt den pFrm umgebenden SectionFrm in zwei Teile,
//pFrm an den Anfang des 2. Teils
- BOOL SplitSect( SwFrm* pFrm, BOOL bApres );
- void DelEmpty( BOOL bRemove ); // wie Cut(), Follow-Verkettung wird aber mitgepflegt
- BOOL IsToIgnore() const // Keine Groesse, kein Inhalt, muss ignoriert werden
+ sal_Bool SplitSect( SwFrm* pFrm, sal_Bool bApres );
+ void DelEmpty( sal_Bool bRemove ); // wie Cut(), Follow-Verkettung wird aber mitgepflegt
+ sal_Bool IsToIgnore() const // Keine Groesse, kein Inhalt, muss ignoriert werden
{ return !Frm().Height() && !ContainsCntnt(); }
SwFtnContFrm* ContainsFtnCont( const SwFtnContFrm* pCont = NULL ) const;
- BOOL Growable() const;
- SwTwips _Shrink( SwTwips, BOOL bTst );
- SwTwips _Grow ( SwTwips, BOOL bTst );
+ sal_Bool Growable() const;
+ SwTwips _Shrink( SwTwips, sal_Bool bTst );
+ SwTwips _Grow ( SwTwips, sal_Bool bTst );
// A sectionfrm has to maximize, if he has a follow or a ftncontainer at
// the end of the page. A superfluous follow will be ignored,
// if bCheckFollow is set.
- BOOL ToMaximize( BOOL bCheckFollow ) const;
- inline BOOL _ToMaximize() const
- { if( !pSection ) return FALSE; return ToMaximize( FALSE ); }
- BOOL MoveAllowed( const SwFrm* ) const;
- BOOL CalcMinDiff( SwTwips& rMinDiff ) const;
- // Uebergibt man kein bOverSize bzw. FALSE, so ist der Returnwert
+ sal_Bool ToMaximize( sal_Bool bCheckFollow ) const;
+ inline sal_Bool _ToMaximize() const
+ { if( !pSection ) return sal_False; return ToMaximize( sal_False ); }
+ sal_Bool MoveAllowed( const SwFrm* ) const;
+ sal_Bool CalcMinDiff( SwTwips& rMinDiff ) const;
+ // Uebergibt man kein bOverSize bzw. sal_False, so ist der Returnwert
// >0 fuer Undersized-Frames, ==0 sonst.
- // Uebergibt man TRUE, so kann es auch einen negativen Returnwert geben,
+ // Uebergibt man sal_True, so kann es auch einen negativen Returnwert geben,
// wenn der SectionFrm nicht vollstaendig ausgefuellt ist, was z.B. bei
// SectionFrm mit Follow meist vorkommt. Benoetigt wird dies im
// FormatWidthCols, um "Luft" aus den Spalten zu lassen.
- long Undersize( BOOL bOverSize = FALSE );
+ long Undersize( sal_Bool bOverSize = sal_False );
// Groesse an die Umgebung anpassen
- void _CheckClipping( BOOL bGrow, BOOL bMaximize );
+ void _CheckClipping( sal_Bool bGrow, sal_Bool bMaximize );
void InvalidateFtnPos();
void CollectEndnotes( SwLayouter* pLayouter );
const SwSectionFmt* GetEndSectFmt() const
{ if( IsEndnAtEnd() ) return _GetEndSectFmt(); return NULL; }
- static void MoveCntntAndDelete( SwSectionFrm* pDel, BOOL bSave );
+ static void MoveCntntAndDelete( SwSectionFrm* pDel, sal_Bool bSave );
bool IsBalancedSection() const;
@@ -141,7 +150,7 @@ inline SwSectionFrm *SwSectionFrm::GetFollow()
{
return (SwSectionFrm*)SwFlowFrm::GetFollow();
}
-inline const SwCntntFrm *SwSectionFrm::FindLastCntnt( BYTE nMode ) const
+inline const SwCntntFrm *SwSectionFrm::FindLastCntnt( sal_uInt8 nMode ) const
{
return ((SwSectionFrm*)this)->FindLastCntnt( nMode );
}
diff --git a/sw/source/core/inc/swblocks.hxx b/sw/source/core/inc/swblocks.hxx
index 300929642f7a..c5d2b9240b22 100644
--- a/sw/source/core/inc/swblocks.hxx
+++ b/sw/source/core/inc/swblocks.hxx
@@ -46,15 +46,15 @@ class SwBlockName
{
friend class SwImpBlocks;
friend class Sw2TextBlocks;
- USHORT nHashS, nHashL; // Hash-Codes zum Checken
+ sal_uInt16 nHashS, nHashL; // Hash-Codes zum Checken
long nPos; // Dateiposition (SW2-Format)
public:
String aShort; // Short name
String aLong; // Long name
String aPackageName; // Package name
- BOOL bIsOnlyTxtFlagInit : 1; // ist das Flag gueltig?
- BOOL bIsOnlyTxt : 1; // unformatted text
- BOOL bInPutMuchBlocks : 1; // put serveral block entries
+ sal_Bool bIsOnlyTxtFlagInit : 1; // ist das Flag gueltig?
+ sal_Bool bIsOnlyTxt : 1; // unformatted text
+ sal_Bool bInPutMuchBlocks : 1; // put serveral block entries
SwBlockName( const String& rShort, const String& rLong, long n );
SwBlockName( const String& rShort, const String& rLong, const String& rPackageName );
@@ -80,12 +80,12 @@ protected:
Date aDateModified; // fuers abgleichen bei den Aktionen
Time aTimeModified;
SwDoc* pDoc; // Austauschdokument
- USHORT nCur; // aktueller Index
- BOOL bReadOnly : 1;
- BOOL bInPutMuchBlocks : 1; // put serveral block entries
- BOOL bInfoChanged : 1; // any Info of TextBlock is changed
+ sal_uInt16 nCur; // aktueller Index
+ sal_Bool bReadOnly : 1;
+ sal_Bool bInPutMuchBlocks : 1; // put serveral block entries
+ sal_Bool bInfoChanged : 1; // any Info of TextBlock is changed
- SwImpBlocks( const String&, BOOL = FALSE );
+ SwImpBlocks( const String&, sal_Bool = sal_False );
virtual ~SwImpBlocks();
static short GetFileType( const String& );
@@ -98,63 +98,63 @@ protected:
virtual void ClearDoc(); // Doc-Inhalt loeschen
SwPaM* MakePaM(); // PaM ueber Doc aufspannen
- virtual void AddName( const String&, const String&, BOOL bOnlyTxt = FALSE );
- BOOL IsFileChanged() const;
+ virtual void AddName( const String&, const String&, sal_Bool bOnlyTxt = sal_False );
+ sal_Bool IsFileChanged() const;
void Touch();
public:
- static USHORT Hash( const String& ); // Hashcode fuer Blocknamen
- USHORT GetCount() const; // Anzahl Textbausteine ermitteln
- USHORT GetIndex( const String& ) const; // Index fuer Kurznamen ermitteln
- USHORT GetLongIndex( const String& ) const; //Index fuer Langnamen ermitteln
- const String& GetShortName( USHORT ) const; // Kurzname fuer Index zurueck
- const String& GetLongName( USHORT ) const; // Langname fuer Index zurueck
- const String& GetPackageName( USHORT ) const; // Langname fuer Index zurueck
+ static sal_uInt16 Hash( const String& ); // Hashcode fuer Blocknamen
+ sal_uInt16 GetCount() const; // Anzahl Textbausteine ermitteln
+ sal_uInt16 GetIndex( const String& ) const; // Index fuer Kurznamen ermitteln
+ sal_uInt16 GetLongIndex( const String& ) const; //Index fuer Langnamen ermitteln
+ const String& GetShortName( sal_uInt16 ) const; // Kurzname fuer Index zurueck
+ const String& GetLongName( sal_uInt16 ) const; // Langname fuer Index zurueck
+ const String& GetPackageName( sal_uInt16 ) const; // Langname fuer Index zurueck
const String& GetFileName() const {return aFile;} // phys. Dateinamen liefern
void SetName( const String& rName ) // logic name
- { aName = rName; bInfoChanged = TRUE; }
+ { aName = rName; bInfoChanged = sal_True; }
const String & GetName( void )
{ return aName; }
const String& GetBaseURL() const { return sBaseURL;}
void SetBaseURL( const String& rURL ) { sBaseURL = rURL; }
- virtual ULONG Delete( USHORT ) = 0;
- virtual ULONG Rename( USHORT, const String&, const String& ) = 0;
- virtual ULONG CopyBlock( SwImpBlocks& rImp, String& rShort, const String& rLong) = 0;
- virtual ULONG GetDoc( USHORT ) = 0;
- virtual ULONG GetDocForConversion( USHORT );
- virtual ULONG BeginPutDoc( const String&, const String& ) = 0;
- virtual ULONG PutDoc() = 0;
- virtual ULONG GetText( USHORT, String& ) = 0;
- virtual ULONG PutText( const String&, const String&, const String& ) = 0;
- virtual ULONG MakeBlockList() = 0;
-
- virtual ULONG OpenFile( BOOL bReadOnly = TRUE ) = 0;
+ virtual sal_uLong Delete( sal_uInt16 ) = 0;
+ virtual sal_uLong Rename( sal_uInt16, const String&, const String& ) = 0;
+ virtual sal_uLong CopyBlock( SwImpBlocks& rImp, String& rShort, const String& rLong) = 0;
+ virtual sal_uLong GetDoc( sal_uInt16 ) = 0;
+ virtual sal_uLong GetDocForConversion( sal_uInt16 );
+ virtual sal_uLong BeginPutDoc( const String&, const String& ) = 0;
+ virtual sal_uLong PutDoc() = 0;
+ virtual sal_uLong GetText( sal_uInt16, String& ) = 0;
+ virtual sal_uLong PutText( const String&, const String&, const String& ) = 0;
+ virtual sal_uLong MakeBlockList() = 0;
+
+ virtual sal_uLong OpenFile( sal_Bool bReadOnly = sal_True ) = 0;
virtual void CloseFile() = 0;
- virtual BOOL IsOnlyTextBlock( const String& rShort ) const;
+ virtual sal_Bool IsOnlyTextBlock( const String& rShort ) const;
- virtual ULONG GetMacroTable( USHORT nIdx, SvxMacroTableDtor& rMacroTbl,
+ virtual sal_uLong GetMacroTable( sal_uInt16 nIdx, SvxMacroTableDtor& rMacroTbl,
sal_Bool bFileAlreadyOpen = sal_False );
- virtual ULONG SetMacroTable( USHORT nIdx,
+ virtual sal_uLong SetMacroTable( sal_uInt16 nIdx,
const SvxMacroTableDtor& rMacroTbl,
sal_Bool bFileAlreadyOpen = sal_False );
- virtual BOOL PutMuchEntries( BOOL bOn );
+ virtual sal_Bool PutMuchEntries( sal_Bool bOn );
};
/*
class Sw3Persist : public SvPersist
{
virtual void FillClass( SvGlobalName * pClassName,
- ULONG * pClipFormat,
+ sal_uLong * pClipFormat,
String * pAppName,
String * pLongUserName,
String * pUserName,
sal_Int32 nFileFormat=SOFFICE_FILEFORMAT_CURRENT ) const;
- virtual BOOL Save();
- virtual BOOL SaveCompleted( SvStorage * );
+ virtual sal_Bool Save();
+ virtual sal_Bool SaveCompleted( SvStorage * );
public:
Sw3Persist();
};
@@ -171,25 +171,25 @@ class Sw2TextBlocks : public SwImpBlocks
long nDocSize; // Laenge des Doc-Records
long nStart; // Beginn des CONTENTS-Records
long nSize; // Laenge des CONTENTS-Records
- USHORT nNamedFmts; // benannte Formate
- USHORT nColls; // Text-Collections
- USHORT nBlks; // Anzahl Elemente im CONTENTS-Record
+ sal_uInt16 nNamedFmts; // benannte Formate
+ sal_uInt16 nColls; // Text-Collections
+ sal_uInt16 nBlks; // Anzahl Elemente im CONTENTS-Record
public:
Sw2TextBlocks( const String& );
virtual ~Sw2TextBlocks();
- virtual ULONG Delete( USHORT );
- virtual ULONG Rename( USHORT, const String&, const String& );
- virtual ULONG CopyBlock( SwImpBlocks& rImp, String& rShort, const String& rLong);
- virtual ULONG GetDoc( USHORT );
- virtual ULONG BeginPutDoc( const String&, const String& );
- virtual ULONG PutDoc();
- virtual ULONG GetText( USHORT, String& );
- virtual ULONG PutText( const String&, const String&, const String& );
- virtual ULONG MakeBlockList();
+ virtual sal_uLong Delete( sal_uInt16 );
+ virtual sal_uLong Rename( sal_uInt16, const String&, const String& );
+ virtual sal_uLong CopyBlock( SwImpBlocks& rImp, String& rShort, const String& rLong);
+ virtual sal_uLong GetDoc( sal_uInt16 );
+ virtual sal_uLong BeginPutDoc( const String&, const String& );
+ virtual sal_uLong PutDoc();
+ virtual sal_uLong GetText( sal_uInt16, String& );
+ virtual sal_uLong PutText( const String&, const String&, const String& );
+ virtual sal_uLong MakeBlockList();
virtual short GetFileType( ) const;
- ULONG LoadDoc();
+ sal_uLong LoadDoc();
- virtual ULONG OpenFile( BOOL bReadOnly = TRUE );
+ virtual sal_uLong OpenFile( sal_Bool bReadOnly = sal_True );
virtual void CloseFile();
void StatLineStartPercent(); // zum Anzeigen des Prozessbars
@@ -202,37 +202,37 @@ class Sw3TextBlocks : public SwImpBlocks
{
Sw3Io* pIo3;
Sw3IoImp* pImp;
- BOOL bAutocorrBlock;
+ sal_Bool bAutocorrBlock;
public:
Sw3TextBlocks( const String& );
Sw3TextBlocks( SvStorage& );
virtual ~Sw3TextBlocks();
- virtual ULONG Delete( USHORT );
- virtual ULONG Rename( USHORT, const String&, const String& );
- virtual ULONG CopyBlock( SwImpBlocks& rImp, String& rShort, const String& rLong);
- virtual ULONG GetDoc( USHORT );
- virtual ULONG GetDocForConversion( USHORT );
- virtual ULONG BeginPutDoc( const String&, const String& );
- virtual ULONG PutDoc();
+ virtual sal_uLong Delete( sal_uInt16 );
+ virtual sal_uLong Rename( sal_uInt16, const String&, const String& );
+ virtual sal_uLong CopyBlock( SwImpBlocks& rImp, String& rShort, const String& rLong);
+ virtual sal_uLong GetDoc( sal_uInt16 );
+ virtual sal_uLong GetDocForConversion( sal_uInt16 );
+ virtual sal_uLong BeginPutDoc( const String&, const String& );
+ virtual sal_uLong PutDoc();
virtual void SetDoc( SwDoc * pNewDoc);
- virtual ULONG GetText( USHORT, String& );
- virtual ULONG PutText( const String&, const String&, const String& );
- virtual ULONG MakeBlockList();
+ virtual sal_uLong GetText( sal_uInt16, String& );
+ virtual sal_uLong PutText( const String&, const String&, const String& );
+ virtual sal_uLong MakeBlockList();
virtual short GetFileType( ) const;
- virtual ULONG OpenFile( BOOL bReadOnly = TRUE );
+ virtual sal_uLong OpenFile( sal_Bool bReadOnly = sal_True );
virtual void CloseFile();
// Methoden fuer die neue Autokorrektur
- ULONG GetText( const String& rShort, String& );
+ sal_uLong GetText( const String& rShort, String& );
SwDoc* GetDoc() const { return pDoc; }
- virtual BOOL IsOnlyTextBlock( const String& rShort ) const;
+ virtual sal_Bool IsOnlyTextBlock( const String& rShort ) const;
- virtual ULONG GetMacroTable( USHORT, SvxMacroTableDtor& rMacroTbl,
+ virtual sal_uLong GetMacroTable( sal_uInt16, SvxMacroTableDtor& rMacroTbl,
sal_Bool bFileAlreadyOpen = sal_False );
- virtual ULONG SetMacroTable( USHORT nIdx,
+ virtual sal_uLong SetMacroTable( sal_uInt16 nIdx,
const SvxMacroTableDtor& rMacroTbl,
sal_Bool bFileAlreadyOpen = sal_False );
diff --git a/sw/source/core/inc/swcache.hxx b/sw/source/core/inc/swcache.hxx
index 90803b515080..b23ccb0f834a 100644
--- a/sw/source/core/inc/swcache.hxx
+++ b/sw/source/core/inc/swcache.hxx
@@ -83,10 +83,10 @@ class SwCache : public SwCacheObjArr
SwCacheObj *pFirst; //der virtuelle erste.
SwCacheObj *pLast;
- const USHORT nMax; //Mehr sollen nicht aufgenommen werden,
+ const sal_uInt16 nMax; //Mehr sollen nicht aufgenommen werden,
//der Cache kann aber dynamisch um jeweils
//nMax vergroessert werden.
- USHORT nCurMax; //Mehr werden nicht aufgenommen.
+ sal_uInt16 nCurMax; //Mehr werden nicht aufgenommen.
void DeleteObj( SwCacheObj *pObj );
@@ -112,34 +112,34 @@ class SwCache : public SwCacheObjArr
public:
- //nur BYTE hineinstecken!!!
+ //nur sal_uInt8 hineinstecken!!!
#ifdef DBG_UTIL
- SwCache( const USHORT nInitSize, const USHORT nGrowSize,
+ SwCache( const sal_uInt16 nInitSize, const sal_uInt16 nGrowSize,
const ByteString &rNm );
~SwCache();
#else
- SwCache( const USHORT nInitSize, const USHORT nGrowSize );
+ SwCache( const sal_uInt16 nInitSize, const sal_uInt16 nGrowSize );
#endif
- void Flush( const BYTE nPercent = 100 );
+ void Flush( const sal_uInt8 nPercent = 100 );
- //bToTop == FALSE -> Keine LRU-Umsortierung!
- SwCacheObj *Get( const void *pOwner, const BOOL bToTop = TRUE );
- SwCacheObj *Get( const void *pOwner, const USHORT nIndex,
- const BOOL bToTop = TRUE );
+ //bToTop == sal_False -> Keine LRU-Umsortierung!
+ SwCacheObj *Get( const void *pOwner, const sal_Bool bToTop = sal_True );
+ SwCacheObj *Get( const void *pOwner, const sal_uInt16 nIndex,
+ const sal_Bool bToTop = sal_True );
void ToTop( SwCacheObj *pObj );
- BOOL Insert( SwCacheObj *pNew );
+ sal_Bool Insert( SwCacheObj *pNew );
void Delete( const void *pOwner );
-// void Delete( const void *pOwner, const USHORT nIndex );
+// void Delete( const void *pOwner, const sal_uInt16 nIndex );
- void SetLRUOfst( const USHORT nOfst ); //nOfst sagt wieviele unangetastet
+ void SetLRUOfst( const sal_uInt16 nOfst ); //nOfst sagt wieviele unangetastet
//bleiben sollen.
void ResetLRUOfst() { pFirst = pRealFirst; }
- inline void IncreaseMax( const USHORT nAdd );
- inline void DecreaseMax( const USHORT nSub );
- USHORT GetCurMax() const { return nCurMax; }
+ inline void IncreaseMax( const sal_uInt16 nAdd );
+ inline void DecreaseMax( const sal_uInt16 nSub );
+ sal_uInt16 GetCurMax() const { return nCurMax; }
inline SwCacheObj *First() { return pRealFirst; }
inline SwCacheObj *Last() { return pLast; }
inline SwCacheObj *Next( SwCacheObj *pCacheObj);
@@ -150,7 +150,7 @@ class SwSaveSetLRUOfst
{
SwCache &rCache;
public:
- SwSaveSetLRUOfst( SwCache &rC, const USHORT nOfst )
+ SwSaveSetLRUOfst( SwCache &rC, const sal_uInt16 nOfst )
: rCache( rC ) { rCache.SetLRUOfst( nOfst ); }
~SwSaveSetLRUOfst() { rCache.ResetLRUOfst(); }
@@ -166,16 +166,16 @@ class SwCacheObj
SwCacheObj *pNext; //Fuer die LRU-Verkettung.
SwCacheObj *pPrev;
- USHORT nCachePos; //Position im Cache-Array.
+ sal_uInt16 nCachePos; //Position im Cache-Array.
- BYTE nLock;
+ sal_uInt8 nLock;
inline SwCacheObj *GetNext() { return pNext; }
inline SwCacheObj *GetPrev() { return pPrev; }
inline void SetNext( SwCacheObj *pNew ) { pNext = pNew; }
inline void SetPrev( SwCacheObj *pNew ) { pPrev = pNew; }
- inline void SetCachePos( const USHORT nNew ) { nCachePos = nNew; }
+ inline void SetCachePos( const sal_uInt16 nNew ) { nCachePos = nNew; }
protected:
const void *pOwner;
@@ -187,12 +187,12 @@ public:
virtual ~SwCacheObj();
inline const void *GetOwner() const { return pOwner; }
- inline BOOL IsOwner( const void *pNew ) const;
+ inline sal_Bool IsOwner( const void *pNew ) const;
- inline USHORT GetCachePos() const { return nCachePos; }
+ inline sal_uInt16 GetCachePos() const { return nCachePos; }
inline void Invalidate() { pOwner = 0; }
- inline BOOL IsLocked() const { return 0 != nLock; }
+ inline sal_Bool IsLocked() const { return 0 != nLock; }
#ifndef DBG_UTIL
inline void Lock() { ++nLock; }
@@ -230,36 +230,36 @@ protected:
inline SwCacheObj *Get();
- inline SwCacheAccess( SwCache &rCache, const void *pOwner, BOOL bSeek = TRUE );
- inline SwCacheAccess( SwCache &rCache, const void *pOwner, const USHORT nIndex );
+ inline SwCacheAccess( SwCache &rCache, const void *pOwner, sal_Bool bSeek = sal_True );
+ inline SwCacheAccess( SwCache &rCache, const void *pOwner, const sal_uInt16 nIndex );
public:
virtual ~SwCacheAccess();
- virtual BOOL IsAvailable() const;
+ virtual sal_Bool IsAvailable() const;
//Abkuerzung fuer diejenigen, die wissen, das die Ableitung das IsAvailable
//nicht ueberladen haben.
- BOOL IsAvail() const { return pObj != 0; }
+ sal_Bool IsAvail() const { return pObj != 0; }
};
-inline void SwCache::IncreaseMax( const USHORT nAdd )
+inline void SwCache::IncreaseMax( const sal_uInt16 nAdd )
{
- nCurMax = nCurMax + sal::static_int_cast< USHORT >(nAdd);
+ nCurMax = nCurMax + sal::static_int_cast< sal_uInt16 >(nAdd);
#ifdef DBG_UTIL
++nIncreaseMax;
#endif
}
-inline void SwCache::DecreaseMax( const USHORT nSub )
+inline void SwCache::DecreaseMax( const sal_uInt16 nSub )
{
if ( nCurMax > nSub )
- nCurMax = nCurMax - sal::static_int_cast< USHORT >(nSub);
+ nCurMax = nCurMax - sal::static_int_cast< sal_uInt16 >(nSub);
#ifdef DBG_UTIL
++nDecreaseMax;
#endif
}
-inline BOOL SwCacheObj::IsOwner( const void *pNew ) const
+inline sal_Bool SwCacheObj::IsOwner( const void *pNew ) const
{
return pOwner && pOwner == pNew;
}
@@ -272,7 +272,7 @@ inline SwCacheObj *SwCache::Next( SwCacheObj *pCacheObj)
return NULL;
}
-inline SwCacheAccess::SwCacheAccess( SwCache &rC, const void *pOwn, BOOL bSeek ) :
+inline SwCacheAccess::SwCacheAccess( SwCache &rC, const void *pOwn, sal_Bool bSeek ) :
rCache( rC ),
pObj( 0 ),
pOwner( pOwn )
@@ -282,7 +282,7 @@ inline SwCacheAccess::SwCacheAccess( SwCache &rC, const void *pOwn, BOOL bSeek )
}
inline SwCacheAccess::SwCacheAccess( SwCache &rC, const void *pOwn,
- const USHORT nIndex ) :
+ const sal_uInt16 nIndex ) :
rCache( rC ),
pObj( 0 ),
pOwner( pOwn )
diff --git a/sw/source/core/inc/swfont.hxx b/sw/source/core/inc/swfont.hxx
index 201c64149e05..631abab76b38 100644
--- a/sw/source/core/inc/swfont.hxx
+++ b/sw/source/core/inc/swfont.hxx
@@ -55,33 +55,33 @@ class SwSubFont : public SvxFont
friend class SwFont;
const void *pMagic; // "MagicNumber" innerhalb des Fontcaches
Size aSize; // Fremde kriegen nur diese Size zu sehen
- USHORT nFntIndex; // Index im Fontcache
- USHORT nOrgHeight; // Hoehe inkl. Escapement/Proportion
- USHORT nOrgAscent; // Ascent inkl. Escapement/Proportion
- USHORT nPropWidth; // proportional width
+ sal_uInt16 nFntIndex; // Index im Fontcache
+ sal_uInt16 nOrgHeight; // Hoehe inkl. Escapement/Proportion
+ sal_uInt16 nOrgAscent; // Ascent inkl. Escapement/Proportion
+ sal_uInt16 nPropWidth; // proportional width
inline SwSubFont() : aSize(0,0)
{ pMagic = NULL; nFntIndex = nOrgHeight = nOrgAscent = 0; nPropWidth =100; }
- USHORT CalcEscAscent( const USHORT nOldAscent ) const;
- USHORT CalcEscHeight( const USHORT nOldHeight,
- const USHORT nOldAscent ) const;
+ sal_uInt16 CalcEscAscent( const sal_uInt16 nOldAscent ) const;
+ sal_uInt16 CalcEscHeight( const sal_uInt16 nOldHeight,
+ const sal_uInt16 nOldAscent ) const;
void CalcEsc( SwDrawTextInfo& rInf, Point& rPos );
inline void CopyMagic( const SwSubFont& rFnt )
{ pMagic = rFnt.pMagic; nFntIndex = rFnt.nFntIndex; }
- BOOL operator==( const SwFont &rFnt ) const;
+ sal_Bool operator==( const SwFont &rFnt ) const;
SwSubFont& operator=( const SwSubFont &rFont );
short _CheckKerning( );
- BOOL ChgFnt( ViewShell *pSh, OutputDevice& rOut );
- BOOL IsSymbol( ViewShell *pSh );
- USHORT GetAscent( ViewShell *pSh, const OutputDevice& rOut );
- USHORT GetHeight( ViewShell *pSh, const OutputDevice& rOut );
+ sal_Bool ChgFnt( ViewShell *pSh, OutputDevice& rOut );
+ sal_Bool IsSymbol( ViewShell *pSh );
+ sal_uInt16 GetAscent( ViewShell *pSh, const OutputDevice& rOut );
+ sal_uInt16 GetHeight( ViewShell *pSh, const OutputDevice& rOut );
Size _GetTxtSize( SwDrawTextInfo& rInf );
Size GetCapitalSize( SwDrawTextInfo& rInf );
- void _DrawText( SwDrawTextInfo &rInf, const BOOL bGrey );
+ void _DrawText( SwDrawTextInfo &rInf, const sal_Bool bGrey );
void DrawCapital( SwDrawTextInfo &rInf );
void DrawStretchCapital( SwDrawTextInfo &rInf );
void DoOnCapitals( SwDoCapitals &rDo );
@@ -98,17 +98,17 @@ class SwSubFont : public SvxFont
inline void SetOverline( const FontUnderline eOverline );
inline void SetStrikeout( const FontStrikeout eStrikeout );
inline void SetItalic( const FontItalic eItalic );
- inline void SetOutline( const BOOL bOutline );
- inline void SetVertical( const USHORT nDir, const BOOL bVertFormat );
- inline void SetShadow( const BOOL bShadow );
- inline void SetAutoKern( const BYTE nAutoKern );
- inline void SetWordLineMode( const BOOL bWordLineMode );
+ inline void SetOutline( const sal_Bool bOutline );
+ inline void SetVertical( const sal_uInt16 nDir, const sal_Bool bVertFormat );
+ inline void SetShadow( const sal_Bool bShadow );
+ inline void SetAutoKern( const sal_uInt8 nAutoKern );
+ inline void SetWordLineMode( const sal_Bool bWordLineMode );
inline void SetEmphasisMark( const FontEmphasisMark eValue );
inline void SetRelief( const FontRelief eNew );
// Methoden fuer die Hoch-/Tiefstellung
inline void SetEscapement( const short nNewEsc );
- inline void SetProportion( const BYTE nNewPropr );
+ inline void SetProportion( const sal_uInt8 nNewPropr );
inline void SetFamily( const FontFamily eFamily );
inline void SetName( const XubString& rName );
@@ -118,10 +118,10 @@ class SwSubFont : public SvxFont
inline void SetLanguage( LanguageType eNewLang );
inline short CheckKerning()
{ return GetFixKerning() >= 0 ? GetFixKerning() : _CheckKerning( ); }
- inline void SetPropWidth( const USHORT nNew )
+ inline void SetPropWidth( const sal_uInt16 nNew )
{ pMagic = 0; nPropWidth = nNew; }
public:
- USHORT GetPropWidth() const { return nPropWidth; }
+ sal_uInt16 GetPropWidth() const { return nPropWidth; }
};
#define SW_LATIN 0
@@ -136,23 +136,23 @@ class SwFont
Color* pBackColor; // background color (i.e. at character styles)
Color aUnderColor; // color of the underlining
Color aOverColor; // color of the overlining
- BYTE nToxCnt; // Zaehlt die Schachtelungstiefe der Tox
- BYTE nRefCnt; // Zaehlt die Schachtelungstiefe der Refs
- BYTE m_nMetaCount; // count META/METAFIELD
- BYTE nActual; // actual font (Latin, CJK or CTL)
+ sal_uInt8 nToxCnt; // Zaehlt die Schachtelungstiefe der Tox
+ sal_uInt8 nRefCnt; // Zaehlt die Schachtelungstiefe der Refs
+ sal_uInt8 m_nMetaCount; // count META/METAFIELD
+ sal_uInt8 nActual; // actual font (Latin, CJK or CTL)
// Schalter fuer die Font-Extensions
- BOOL bNoHyph :1; // SwTxtNoHyphenHere: keine Trennstelle
- BOOL bBlink :1; // blinkender Font
- BOOL bPaintBlank :1; // Blanks nicht mit DrawRect
- BOOL bFntChg :1;
- BOOL bOrgChg :1; // nOrgHeight/Ascent sind invalid
- BOOL bURL :1;
- BOOL bPaintWrong :1; // Flag fuer Rechtschreibfehler
- BOOL bGreyWave :1; // Fuers extended TextInput: Graue Wellenlinie
- BOOL bNoColReplace :1; // Replacement without colormanipulation
-
- BOOL operator==( const SwFont &rFnt ) const;
+ sal_Bool bNoHyph :1; // SwTxtNoHyphenHere: keine Trennstelle
+ sal_Bool bBlink :1; // blinkender Font
+ sal_Bool bPaintBlank :1; // Blanks nicht mit DrawRect
+ sal_Bool bFntChg :1;
+ sal_Bool bOrgChg :1; // nOrgHeight/Ascent sind invalid
+ sal_Bool bURL :1;
+ sal_Bool bPaintWrong :1; // Flag fuer Rechtschreibfehler
+ sal_Bool bGreyWave :1; // Fuers extended TextInput: Graue Wellenlinie
+ sal_Bool bNoColReplace :1; // Replacement without colormanipulation
+
+ sal_Bool operator==( const SwFont &rFnt ) const;
protected:
inline SwFont() { pBackColor = NULL; nActual = SW_LATIN; }
@@ -168,35 +168,35 @@ public:
SwFont& operator=( const SwFont &rFont );
- inline BYTE GetActual() const { return nActual; }
- inline void SetActual( BYTE nNew );
+ inline sal_uInt8 GetActual() const { return nActual; }
+ inline void SetActual( sal_uInt8 nNew );
inline const SvxFont& GetActualFont() const { return aSub[nActual]; }
// holt sich eine MagicNumber ueber SwFntAccess
- void GoMagic( ViewShell *pSh, BYTE nWhich );
+ void GoMagic( ViewShell *pSh, sal_uInt8 nWhich );
// set background color
void SetBackColor( Color* pNewColor );
inline const Color* GetBackColor() const{ return pBackColor; }
- inline void ChkMagic( ViewShell *pSh, BYTE nWhich )
+ inline void ChkMagic( ViewShell *pSh, sal_uInt8 nWhich )
{ if( !aSub[ nWhich ].pMagic ) GoMagic( pSh, nWhich ); }
// uebernimmt die MagicNumber eines (hoffentlich ident.) Kollegen
- inline void CopyMagic( const SwFont* pFnt, BYTE nWhich )
+ inline void CopyMagic( const SwFont* pFnt, sal_uInt8 nWhich )
{ aSub[nWhich].CopyMagic( pFnt->aSub[nWhich] ); }
- inline void GetMagic( const void* &rMagic, USHORT &rIdx, BYTE nWhich )
+ inline void GetMagic( const void* &rMagic, sal_uInt16 &rIdx, sal_uInt8 nWhich )
{ rMagic = aSub[nWhich].pMagic; rIdx = aSub[nWhich].nFntIndex; }
- inline void SetMagic( const void* pNew, const USHORT nIdx, BYTE nWhich )
+ inline void SetMagic( const void* pNew, const sal_uInt16 nIdx, sal_uInt8 nWhich )
{ aSub[nWhich].pMagic = pNew; aSub[nWhich].nFntIndex = nIdx; }
- inline BOOL DifferentMagic( const SwFont* pFnt, BYTE nWhich )
+ inline sal_Bool DifferentMagic( const SwFont* pFnt, sal_uInt8 nWhich )
{ return aSub[nWhich].pMagic != pFnt->aSub[nWhich].pMagic ||
!aSub[nWhich].pMagic || !pFnt->aSub[nWhich].pMagic; }
- inline const Size &GetSize( BYTE nWhich ) const
+ inline const Size &GetSize( sal_uInt8 nWhich ) const
{ return aSub[nWhich].aSize; }
- inline BOOL IsFntChg() const { return bFntChg; }
- inline void SetFntChg( const BOOL bNew ) { bFntChg = bNew; }
+ inline sal_Bool IsFntChg() const { return bFntChg; }
+ inline void SetFntChg( const sal_Bool bNew ) { bFntChg = bNew; }
- // die gekapselten SV-Font-Methoden (setzen bFntChg auf TRUE)
+ // die gekapselten SV-Font-Methoden (setzen bFntChg auf sal_True)
inline void SetColor( const Color& rColor );
inline void SetFillColor( const Color& rColor );
inline void SetAlign( const FontAlign eAlign );
@@ -205,67 +205,67 @@ public:
inline void SetOverline( const FontUnderline eOverline );
inline void SetOverColor( const Color &rColor ) { aOverColor = rColor; }
inline void SetStrikeout( const FontStrikeout eStrikeout );
- inline void SetOutline( const BOOL bOutline );
- void SetVertical( USHORT nDir, const BOOL nVertLayout = FALSE );
- inline void SetShadow( const BOOL bShadow );
- inline void SetAutoKern( BYTE nAutoKern );
- inline void SetTransparent( const BOOL bTrans );
- inline void SetWordLineMode( const BOOL bWordLineMode );
+ inline void SetOutline( const sal_Bool bOutline );
+ void SetVertical( sal_uInt16 nDir, const sal_Bool nVertLayout = sal_False );
+ inline void SetShadow( const sal_Bool bShadow );
+ inline void SetAutoKern( sal_uInt8 nAutoKern );
+ inline void SetTransparent( const sal_Bool bTrans );
+ inline void SetWordLineMode( const sal_Bool bWordLineMode );
inline void SetFixKerning( const short nNewKern );
inline void SetCaseMap( const SvxCaseMap eNew );
inline void SetEmphasisMark( const FontEmphasisMark eValue );
// Methoden fuer die Hoch-/Tiefstellung
inline void SetEscapement( const short nNewEsc );
- inline void SetProportion( const BYTE nNewPropr );
-
- inline void SetPropWidth( const USHORT nNew );
-
- inline void SetFamily( const FontFamily eFamily, const BYTE nWhich );
- inline void SetName( const XubString& rName, const BYTE nWhich );
- inline void SetStyleName( const XubString& rStyleName, const BYTE nWhich );
- inline void SetSize( const Size& rSize, const BYTE nWhich );
- inline void SetWeight( const FontWeight eWeight, const BYTE nWhich );
- inline void SetItalic( const FontItalic eItalic, const BYTE nWhich );
- inline void SetLanguage( LanguageType eNewLang, const BYTE nWhich );
- inline void SetCharSet( const CharSet eCharSet, const BYTE nWhich );
- inline void SetPitch( const FontPitch ePitch, const BYTE nWhich );
+ inline void SetProportion( const sal_uInt8 nNewPropr );
+
+ inline void SetPropWidth( const sal_uInt16 nNew );
+
+ inline void SetFamily( const FontFamily eFamily, const sal_uInt8 nWhich );
+ inline void SetName( const XubString& rName, const sal_uInt8 nWhich );
+ inline void SetStyleName( const XubString& rStyleName, const sal_uInt8 nWhich );
+ inline void SetSize( const Size& rSize, const sal_uInt8 nWhich );
+ inline void SetWeight( const FontWeight eWeight, const sal_uInt8 nWhich );
+ inline void SetItalic( const FontItalic eItalic, const sal_uInt8 nWhich );
+ inline void SetLanguage( LanguageType eNewLang, const sal_uInt8 nWhich );
+ inline void SetCharSet( const CharSet eCharSet, const sal_uInt8 nWhich );
+ inline void SetPitch( const FontPitch ePitch, const sal_uInt8 nWhich );
inline void SetRelief( const FontRelief eNew );
// Get/Set-Methoden fuer die aktuelle Einstellung
- inline void SetNoHyph( const BOOL bNew );
- inline BOOL IsNoHyph() const { return bNoHyph; }
- inline void SetBlink( const BOOL bBlink );
- inline BOOL IsBlink() const { return bBlink; }
- inline BYTE &GetTox() { return nToxCnt; }
- inline BYTE GetTox() const { return nToxCnt; }
- inline BOOL IsTox() const { return ( 0 != nToxCnt ); }
- inline BYTE &GetRef() { return nRefCnt; }
- inline BYTE GetRef() const { return nRefCnt; }
- inline BOOL IsRef() const { return ( 0 != nRefCnt ); }
- inline BYTE &GetMeta() { return m_nMetaCount; }
- inline BYTE GetMeta() const { return m_nMetaCount; }
+ inline void SetNoHyph( const sal_Bool bNew );
+ inline sal_Bool IsNoHyph() const { return bNoHyph; }
+ inline void SetBlink( const sal_Bool bBlink );
+ inline sal_Bool IsBlink() const { return bBlink; }
+ inline sal_uInt8 &GetTox() { return nToxCnt; }
+ inline sal_uInt8 GetTox() const { return nToxCnt; }
+ inline sal_Bool IsTox() const { return ( 0 != nToxCnt ); }
+ inline sal_uInt8 &GetRef() { return nRefCnt; }
+ inline sal_uInt8 GetRef() const { return nRefCnt; }
+ inline sal_Bool IsRef() const { return ( 0 != nRefCnt ); }
+ inline sal_uInt8 &GetMeta() { return m_nMetaCount; }
+ inline sal_uInt8 GetMeta() const { return m_nMetaCount; }
inline bool IsMeta() const { return (0 != m_nMetaCount); }
- inline void SetURL( const BOOL bURL );
- inline BOOL IsURL() const { return bURL; }
- inline void SetGreyWave( const BOOL bNew );
- inline BOOL IsGreyWave() const { return bGreyWave; }
- inline void SetNoCol( const BOOL bNew );
- inline BOOL IsNoCol() const { return bNoColReplace; }
-
- inline void SetPaintBlank( const BOOL bNew );
- inline BOOL IsPaintBlank() const { return bPaintBlank; }
- inline void SetPaintWrong( const BOOL bNew );
- inline BOOL IsPaintWrong() const { return bPaintWrong; }
+ inline void SetURL( const sal_Bool bURL );
+ inline sal_Bool IsURL() const { return bURL; }
+ inline void SetGreyWave( const sal_Bool bNew );
+ inline sal_Bool IsGreyWave() const { return bGreyWave; }
+ inline void SetNoCol( const sal_Bool bNew );
+ inline sal_Bool IsNoCol() const { return bNoColReplace; }
+
+ inline void SetPaintBlank( const sal_Bool bNew );
+ inline sal_Bool IsPaintBlank() const { return bPaintBlank; }
+ inline void SetPaintWrong( const sal_Bool bNew );
+ inline sal_Bool IsPaintWrong() const { return bPaintWrong; }
// Setzen der Basisklasse Font fuer SwTxtCharFmt
void SetDiffFnt( const SfxItemSet* pSet,
const IDocumentSettingAccess* pIDocumentSettingAccess );
- inline const SvxFont &GetFnt( const BYTE nWhich ) const
+ inline const SvxFont &GetFnt( const sal_uInt8 nWhich ) const
{ return aSub[nWhich]; };
- BOOL IsSymbol( ViewShell *pSh )
+ sal_Bool IsSymbol( ViewShell *pSh )
{ return aSub[nActual].IsSymbol( pSh ); }
FontUnderline GetUnderline() const { return aSub[nActual].GetUnderline(); }
const Color& GetUnderColor() const { return aUnderColor; }
@@ -274,13 +274,13 @@ public:
short GetFixKerning() const { return aSub[nActual].GetFixKerning(); }
FontStrikeout GetStrikeout() const { return aSub[nActual].GetStrikeout(); }
const Color& GetColor() const { return aSub[nActual].GetColor(); }
- BOOL IsShadow() const { return aSub[nActual].IsShadow(); }
- BOOL IsWordLineMode() const { return aSub[nActual].IsWordLineMode(); }
- BOOL IsOutline() const { return aSub[nActual].IsOutline(); }
- BOOL IsKerning() const { return aSub[nActual].IsKerning(); }
+ sal_Bool IsShadow() const { return aSub[nActual].IsShadow(); }
+ sal_Bool IsWordLineMode() const { return aSub[nActual].IsWordLineMode(); }
+ sal_Bool IsOutline() const { return aSub[nActual].IsOutline(); }
+ sal_Bool IsKerning() const { return aSub[nActual].IsKerning(); }
short GetEscapement() const { return aSub[nActual].GetEscapement(); }
SvxCaseMap GetCaseMap() const { return aSub[nActual].GetCaseMap(); }
- BYTE GetPropr() const { return aSub[nActual].GetPropr(); }
+ sal_uInt8 GetPropr() const { return aSub[nActual].GetPropr(); }
FontItalic GetItalic() const { return aSub[nActual].GetItalic(); }
LanguageType GetLanguage() const { return aSub[nActual].GetLanguage(); }
FontAlign GetAlign() const { return aSub[nActual].GetAlign(); }
@@ -293,28 +293,28 @@ public:
FontWeight GetWeight() const { return aSub[nActual].GetWeight(); }
FontEmphasisMark GetEmphasisMark() const
{ return aSub[nActual].GetEmphasisMark(); }
- USHORT GetPropWidth() const { return aSub[nActual].GetPropWidth(); }
- USHORT GetOrientation( const BOOL nVertLayout = FALSE ) const;
+ sal_uInt16 GetPropWidth() const { return aSub[nActual].GetPropWidth(); }
+ sal_uInt16 GetOrientation( const sal_Bool nVertLayout = sal_False ) const;
- inline const XubString& GetName( const BYTE nWhich ) const
+ inline const XubString& GetName( const sal_uInt8 nWhich ) const
{ return aSub[nWhich].GetName(); }
- inline LanguageType GetLanguage( const BYTE nWhich ) const
+ inline LanguageType GetLanguage( const sal_uInt8 nWhich ) const
{ return aSub[nWhich].GetLanguage(); }
- inline const XubString& GetStyleName( const BYTE nWhich ) const
+ inline const XubString& GetStyleName( const sal_uInt8 nWhich ) const
{ return aSub[nWhich].GetStyleName(); }
- inline FontFamily GetFamily( const BYTE nWhich ) const
+ inline FontFamily GetFamily( const sal_uInt8 nWhich ) const
{ return aSub[nWhich].GetFamily(); }
- inline FontItalic GetItalic( const BYTE nWhich ) const
+ inline FontItalic GetItalic( const sal_uInt8 nWhich ) const
{ return aSub[nWhich].GetItalic(); }
- inline FontPitch GetPitch( const BYTE nWhich ) const
+ inline FontPitch GetPitch( const sal_uInt8 nWhich ) const
{ return aSub[nWhich].GetPitch(); }
- inline rtl_TextEncoding GetCharSet( const BYTE nWhich ) const
+ inline rtl_TextEncoding GetCharSet( const sal_uInt8 nWhich ) const
{ return aSub[nWhich].GetCharSet(); }
- inline long GetHeight( const BYTE nWhich ) const
+ inline long GetHeight( const sal_uInt8 nWhich ) const
{ return aSub[nWhich].GetSize().Height(); }
- inline FontWeight GetWeight( const BYTE nWhich ) const
+ inline FontWeight GetWeight( const sal_uInt8 nWhich ) const
{ return aSub[nWhich].GetWeight(); }
- inline FontEmphasisMark GetEmphasisMark( const BYTE nWhich ) const
+ inline FontEmphasisMark GetEmphasisMark( const sal_uInt8 nWhich ) const
{ return aSub[nWhich].GetEmphasisMark(); }
// Macht den logischen Font im OutputDevice wirksam.
@@ -357,18 +357,18 @@ public:
inline short CheckKerning()
{ return aSub[nActual].CheckKerning(); }
- inline USHORT GetAscent( ViewShell *pSh, const OutputDevice& rOut )
+ inline sal_uInt16 GetAscent( ViewShell *pSh, const OutputDevice& rOut )
{ return aSub[nActual].GetAscent( pSh, rOut ); }
- inline USHORT GetHeight( ViewShell *pSh, const OutputDevice& rOut )
+ inline sal_uInt16 GetHeight( ViewShell *pSh, const OutputDevice& rOut )
{ return aSub[nActual].GetHeight( pSh, rOut ); }
inline void Invalidate()
- { bFntChg = bOrgChg = TRUE; }
+ { bFntChg = bOrgChg = sal_True; }
};
inline void SwFont::SetColor( const Color& rColor )
{
- bFntChg = TRUE;
+ bFntChg = sal_True;
aSub[0].SetColor( rColor );
aSub[1].SetColor( rColor );
aSub[2].SetColor( rColor );
@@ -391,7 +391,7 @@ inline void SwSubFont::SetFillColor( const Color& rColor )
inline void SwFont::SetFillColor( const Color& rColor )
{
- bFntChg = TRUE;
+ bFntChg = sal_True;
aSub[0].SetFillColor( rColor );
aSub[1].SetFillColor( rColor );
aSub[2].SetFillColor( rColor );
@@ -404,9 +404,9 @@ inline void SwSubFont::SetFamily( const FontFamily eFamily )
Font::SetFamily( eFamily );
}
-inline void SwFont::SetFamily( const FontFamily eFamily, const BYTE nWhich )
+inline void SwFont::SetFamily( const FontFamily eFamily, const sal_uInt8 nWhich )
{
- bFntChg = TRUE;
+ bFntChg = sal_True;
aSub[nWhich].SetFamily( eFamily );
}
@@ -417,9 +417,9 @@ inline void SwSubFont::SetName( const XubString& rName )
Font::SetName( rName );
}
-inline void SwFont::SetName( const XubString& rName, const BYTE nWhich )
+inline void SwFont::SetName( const XubString& rName, const sal_uInt8 nWhich )
{
- bFntChg = TRUE;
+ bFntChg = sal_True;
aSub[nWhich].SetName( rName );
}
@@ -430,9 +430,9 @@ inline void SwSubFont::SetStyleName( const XubString& rStyleName )
Font::SetStyleName( rStyleName );
}
-inline void SwFont::SetStyleName( const XubString& rStyle, const BYTE nWhich )
+inline void SwFont::SetStyleName( const XubString& rStyle, const sal_uInt8 nWhich )
{
- bFntChg = TRUE;
+ bFntChg = sal_True;
aSub[nWhich].SetStyleName( rStyle );
}
@@ -443,9 +443,9 @@ inline void SwSubFont::SetCharSet( const CharSet eCharSet )
Font::SetCharSet( eCharSet );
}
-inline void SwFont::SetCharSet( const CharSet eCharSet, const BYTE nWhich )
+inline void SwFont::SetCharSet( const CharSet eCharSet, const sal_uInt8 nWhich )
{
- bFntChg = TRUE;
+ bFntChg = sal_True;
aSub[nWhich].SetCharSet( eCharSet );
}
@@ -457,9 +457,9 @@ inline void SwSubFont::SetPitch( const FontPitch ePitch )
}
// gekapselte SV-Font-Methode
-inline void SwFont::SetPitch( const FontPitch ePitch, const BYTE nWhich )
+inline void SwFont::SetPitch( const FontPitch ePitch, const sal_uInt8 nWhich )
{
- bFntChg = TRUE;
+ bFntChg = sal_True;
aSub[nWhich].SetPitch( ePitch );
}
@@ -472,7 +472,7 @@ inline void SwSubFont::SetAlign( const FontAlign eAlign )
inline void SwFont::SetAlign( const FontAlign eAlign )
{
- bFntChg = TRUE;
+ bFntChg = sal_True;
aSub[0].SetAlign( eAlign );
aSub[1].SetAlign( eAlign );
aSub[2].SetAlign( eAlign );
@@ -485,9 +485,9 @@ inline void SwSubFont::SetWeight( const FontWeight eWeight )
Font::SetWeight( eWeight );
}
-inline void SwFont::SetWeight( const FontWeight eWeight, const BYTE nWhich )
+inline void SwFont::SetWeight( const FontWeight eWeight, const sal_uInt8 nWhich )
{
- bFntChg = TRUE;
+ bFntChg = sal_True;
aSub[nWhich].SetWeight( eWeight );
}
@@ -500,7 +500,7 @@ inline void SwSubFont::SetUnderline( const FontUnderline eUnderline )
inline void SwFont::SetUnderline( const FontUnderline eUnderline )
{
- bFntChg = TRUE;
+ bFntChg = sal_True;
aSub[0].SetUnderline( eUnderline );
aSub[1].SetUnderline( eUnderline );
aSub[2].SetUnderline( eUnderline );
@@ -515,7 +515,7 @@ inline void SwSubFont::SetOverline( const FontUnderline eOverline )
inline void SwFont::SetOverline( const FontUnderline eOverline )
{
- bFntChg = TRUE;
+ bFntChg = sal_True;
aSub[0].SetOverline( eOverline );
aSub[1].SetOverline( eOverline );
aSub[2].SetOverline( eOverline );
@@ -530,7 +530,7 @@ inline void SwSubFont::SetStrikeout( const FontStrikeout eStrikeout )
inline void SwFont::SetStrikeout( const FontStrikeout eStrikeout )
{
- bFntChg = TRUE;
+ bFntChg = sal_True;
aSub[0].SetStrikeout( eStrikeout );
aSub[1].SetStrikeout( eStrikeout );
aSub[2].SetStrikeout( eStrikeout );
@@ -543,52 +543,52 @@ inline void SwSubFont::SetItalic( const FontItalic eItalic )
Font::SetItalic( eItalic );
}
-inline void SwFont::SetItalic( const FontItalic eItalic, const BYTE nWhich )
+inline void SwFont::SetItalic( const FontItalic eItalic, const sal_uInt8 nWhich )
{
- bFntChg = TRUE;
+ bFntChg = sal_True;
aSub[nWhich].SetItalic( eItalic );
}
// gekapselte SV-Font-Methode
-inline void SwSubFont::SetOutline( const BOOL bOutline )
+inline void SwSubFont::SetOutline( const sal_Bool bOutline )
{
pMagic = 0;
Font::SetOutline( bOutline );
}
-inline void SwFont::SetOutline( const BOOL bOutline )
+inline void SwFont::SetOutline( const sal_Bool bOutline )
{
- bFntChg = TRUE;
+ bFntChg = sal_True;
aSub[0].SetOutline( bOutline );
aSub[1].SetOutline( bOutline );
aSub[2].SetOutline( bOutline );
}
// gekapselte SV-Font-Methode
-inline void SwSubFont::SetShadow( const BOOL bShadow )
+inline void SwSubFont::SetShadow( const sal_Bool bShadow )
{
pMagic = 0;
Font::SetShadow( bShadow );
}
-inline void SwFont::SetShadow( const BOOL bShadow )
+inline void SwFont::SetShadow( const sal_Bool bShadow )
{
- bFntChg = TRUE;
+ bFntChg = sal_True;
aSub[0].SetShadow( bShadow );
aSub[1].SetShadow( bShadow );
aSub[2].SetShadow( bShadow );
}
// gekapselte SV-Font-Methode
-inline void SwSubFont::SetAutoKern( const BYTE nAutoKern )
+inline void SwSubFont::SetAutoKern( const sal_uInt8 nAutoKern )
{
pMagic = 0;
Font::SetKerning( nAutoKern );
}
-inline void SwFont::SetAutoKern( BYTE nAutoKern )
+inline void SwFont::SetAutoKern( sal_uInt8 nAutoKern )
{
- bFntChg = TRUE;
+ bFntChg = sal_True;
aSub[1].SetAutoKern( nAutoKern );
if( nAutoKern )
nAutoKern = KERNING_FONTSPECIFIC;
@@ -596,7 +596,7 @@ inline void SwFont::SetAutoKern( BYTE nAutoKern )
aSub[2].SetAutoKern( nAutoKern );
}
-inline void SwFont::SetTransparent( const BOOL bTrans )
+inline void SwFont::SetTransparent( const sal_Bool bTrans )
{
aSub[0].SetTransparent( bTrans );
aSub[1].SetTransparent( bTrans );
@@ -618,15 +618,15 @@ inline void SwFont::SetCaseMap( const SvxCaseMap eNew )
}
// gekapselte SV-Font-Methode
-inline void SwSubFont::SetWordLineMode( const BOOL bWordLineMode )
+inline void SwSubFont::SetWordLineMode( const sal_Bool bWordLineMode )
{
pMagic = 0;
Font::SetWordLineMode( bWordLineMode );
}
-inline void SwFont::SetWordLineMode( const BOOL bWordLineMode )
+inline void SwFont::SetWordLineMode( const sal_Bool bWordLineMode )
{
- bFntChg = TRUE;
+ bFntChg = sal_True;
aSub[0].SetWordLineMode( bWordLineMode );
aSub[1].SetWordLineMode( bWordLineMode );
aSub[2].SetWordLineMode( bWordLineMode );
@@ -640,17 +640,17 @@ inline void SwSubFont::SetEmphasisMark( const FontEmphasisMark eValue )
inline void SwFont::SetEmphasisMark( const FontEmphasisMark eValue )
{
- bFntChg = TRUE;
+ bFntChg = sal_True;
aSub[0].SetEmphasisMark( eValue );
aSub[1].SetEmphasisMark( eValue );
aSub[2].SetEmphasisMark( eValue );
}
-inline void SwFont::SetPropWidth( const USHORT nNew )
+inline void SwFont::SetPropWidth( const sal_uInt16 nNew )
{
if( nNew != aSub[0].GetPropWidth() )
{
- bFntChg = TRUE;
+ bFntChg = sal_True;
aSub[0].SetPropWidth( nNew );
aSub[1].SetPropWidth( nNew );
aSub[2].SetPropWidth( nNew );
@@ -668,7 +668,7 @@ inline void SwFont::SetRelief( const FontRelief eNew )
{
if( eNew != aSub[0].GetRelief() )
{
- bFntChg = TRUE;
+ bFntChg = sal_True;
aSub[0].SetRelief( eNew );
aSub[1].SetRelief( eNew );
aSub[2].SetRelief( eNew );
@@ -690,27 +690,27 @@ inline void SwSubFont::SetSize( const Size& rSize )
pMagic = 0;
}
-inline void SwFont::SetSize( const Size& rSize, const BYTE nWhich )
+inline void SwFont::SetSize( const Size& rSize, const sal_uInt8 nWhich )
{
if( aSub[nWhich].aSize != rSize )
{
aSub[nWhich].SetSize( rSize );
- bFntChg = TRUE;
- bOrgChg = TRUE;
+ bFntChg = sal_True;
+ bOrgChg = sal_True;
}
}
-inline void SwFont::SetActual( BYTE nNew )
+inline void SwFont::SetActual( sal_uInt8 nNew )
{
if ( nActual != nNew )
{
- bFntChg = TRUE;
- bOrgChg = TRUE;
+ bFntChg = sal_True;
+ bOrgChg = sal_True;
nActual = nNew;
}
}
-inline void SwSubFont::SetProportion( const BYTE nNewPropr )
+inline void SwSubFont::SetProportion( const sal_uInt8 nNewPropr )
{
pMagic = 0;
Font::SetSize( Size( (long) aSize.Width() * nNewPropr / 100L,
@@ -718,12 +718,12 @@ inline void SwSubFont::SetProportion( const BYTE nNewPropr )
SvxFont::SetPropr( nNewPropr );
}
-inline void SwFont::SetProportion( const BYTE nNewPropr )
+inline void SwFont::SetProportion( const sal_uInt8 nNewPropr )
{
if( nNewPropr != aSub[0].GetPropr() )
{
- bFntChg = TRUE;
- bOrgChg = TRUE;
+ bFntChg = sal_True;
+ bOrgChg = sal_True;
aSub[0].SetProportion( nNewPropr );
aSub[1].SetProportion( nNewPropr );
@@ -743,8 +743,8 @@ inline void SwFont::SetEscapement( const short nNewEsc )
{
// these have to be set, otherwise nOrgHeight and nOrgAscent will not
// be calculated
- bFntChg = TRUE;
- bOrgChg = TRUE;
+ bFntChg = sal_True;
+ bOrgChg = sal_True;
aSub[0].SetEscapement( nNewEsc );
aSub[1].SetEscapement( nNewEsc );
@@ -759,7 +759,7 @@ inline void SwSubFont::SetLanguage( LanguageType eNewLang )
SvxFont::SetLanguage( eNewLang );
}
-inline void SwFont::SetLanguage( const LanguageType eNewLang, const BYTE nWhich )
+inline void SwFont::SetLanguage( const LanguageType eNewLang, const sal_uInt8 nWhich )
{
aSub[nWhich].SetLanguage( eNewLang );
if( SW_CJK == nWhich )
@@ -770,42 +770,42 @@ inline void SwFont::SetLanguage( const LanguageType eNewLang, const BYTE nWhich
}
}
-inline void SwFont::SetPaintBlank( const BOOL bNew )
+inline void SwFont::SetPaintBlank( const sal_Bool bNew )
{
bPaintBlank = bNew;
}
-inline void SwFont::SetPaintWrong( const BOOL bNew )
+inline void SwFont::SetPaintWrong( const sal_Bool bNew )
{
bPaintWrong = bNew;
}
-inline void SwFont::SetNoHyph( const BOOL bNew )
+inline void SwFont::SetNoHyph( const sal_Bool bNew )
{
bNoHyph = bNew;
}
-inline void SwFont::SetBlink( const BOOL bNew )
+inline void SwFont::SetBlink( const sal_Bool bNew )
{
bBlink = bNew;
}
-inline void SwFont::SetURL( const BOOL bNew )
+inline void SwFont::SetURL( const sal_Bool bNew )
{
bURL = bNew;
}
-inline void SwFont::SetGreyWave( const BOOL bNew )
+inline void SwFont::SetGreyWave( const sal_Bool bNew )
{
bGreyWave = bNew;
}
-inline void SwFont::SetNoCol( const BOOL bNew )
+inline void SwFont::SetNoCol( const sal_Bool bNew )
{
bNoColReplace = bNew;
}
-inline void SwSubFont::SetVertical( const USHORT nDir, const BOOL bVertFormat )
+inline void SwSubFont::SetVertical( const sal_uInt16 nDir, const sal_Bool bVertFormat )
{
pMagic = 0;
Font::SetVertical( bVertFormat );
@@ -852,12 +852,12 @@ public:
class SvStatistics
{
public:
- USHORT nGetTextSize;
- USHORT nDrawText;
- USHORT nGetStretchTextSize;
- USHORT nDrawStretchText;
- USHORT nChangeFont;
- USHORT nGetFontMetric;
+ sal_uInt16 nGetTextSize;
+ sal_uInt16 nDrawText;
+ sal_uInt16 nGetStretchTextSize;
+ sal_uInt16 nDrawStretchText;
+ sal_uInt16 nChangeFont;
+ sal_uInt16 nGetFontMetric;
inline void Reset()
{
@@ -868,7 +868,7 @@ public:
inline SvStatistics() { Reset(); }
inline void PrintOn( SvStream &rOS ) const; //$ ostream
- inline BOOL IsEmpty() const
+ inline sal_Bool IsEmpty() const
{
return !( nGetTextSize || nDrawText ||
nDrawStretchText || nChangeFont || nGetFontMetric );
diff --git a/sw/source/core/inc/tabfrm.hxx b/sw/source/core/inc/tabfrm.hxx
index 9b32ddfbe9ee..4b839e9da0fe 100644
--- a/sw/source/core/inc/tabfrm.hxx
+++ b/sw/source/core/inc/tabfrm.hxx
@@ -43,45 +43,45 @@ class SwTabFrm: public SwLayoutFrm, public SwFlowFrm
//Fuert Spezialbehandlung fuer _Get[Next|Prev]Leaf() durch.
using SwFrm::GetLeaf;
- SwLayoutFrm *GetLeaf( MakePageType eMakePage, BOOL bFwd );
+ SwLayoutFrm *GetLeaf( MakePageType eMakePage, sal_Bool bFwd );
SwTable* pTable;
- BOOL bComplete :1; //Eintrage als Repaint ohne das CompletePaint
+ sal_Bool bComplete :1; //Eintrage als Repaint ohne das CompletePaint
//der Basisklasse gesetzt werden muss. Damit
//sollen unertraegliche Tabellen-Repaints
//vermieden werden.
- BOOL bCalcLowers :1; //Im MakeAll auf jedenfall auch fuer Stabilitaet
+ sal_Bool bCalcLowers :1; //Im MakeAll auf jedenfall auch fuer Stabilitaet
//des Inhaltes sorgen.
- BOOL bLowersFormatted :1;//Kommunikation zwischen MakeAll und Layact
- BOOL bLockBackMove :1; //BackMove-Test hat der Master erledigt.
- BOOL bResizeHTMLTable :1; //Resize des HTMLTableLayout rufen im MakeAll
+ sal_Bool bLowersFormatted :1;//Kommunikation zwischen MakeAll und Layact
+ sal_Bool bLockBackMove :1; //BackMove-Test hat der Master erledigt.
+ sal_Bool bResizeHTMLTable :1; //Resize des HTMLTableLayout rufen im MakeAll
//Zur Optimierung, damit dies nicht im
//CntntFrm::Grow gerufen werden muss, denn dann
//wird es ggf. fuer jede Zelle gerufen #47483#
- BOOL bONECalcLowers :1; //Primaer fuer die StarONE-SS. Beim MakeAll werden
+ sal_Bool bONECalcLowers :1; //Primaer fuer die StarONE-SS. Beim MakeAll werden
//die Cntnts auf jedenfall per Calc() formatiert.
//es finden keine zusaetzlichen Invalidierungen
//statt und dieser Weg kann auch kaum garantien
//geben.
- BOOL bHasFollowFlowLine :1; // Means that the first line in the follow
+ sal_Bool bHasFollowFlowLine :1; // Means that the first line in the follow
// is indented to contain content from a broken
// cell
- BOOL bIsRebuildLastLine :1; // Means that currently the last line of the
+ sal_Bool bIsRebuildLastLine :1; // Means that currently the last line of the
// TabFrame is rebuilded. In this case we
// do not want any notification to the master
// table
- BOOL bRestrictTableGrowth :1; // Usually, the table may grow infinite,
+ sal_Bool bRestrictTableGrowth :1; // Usually, the table may grow infinite,
// because the table can be split in
// SwTabFrm::MakeAll. In MakeAll, this
// flag is set to indicate that the table
// may only grow inside its upper. This
// is necessary, in order to let the text
// flow into the FollowFlowLine
- BOOL bRemoveFollowFlowLinePending :1;
+ sal_Bool bRemoveFollowFlowLinePending :1;
// --> OD 2004-10-04 #i26945#
- BOOL bConsiderObjsForMinCellHeight :1; // Usually, the floating screen objects
+ sal_Bool bConsiderObjsForMinCellHeight :1; // Usually, the floating screen objects
// are considered on the calculation
// for the minimal cell height.
// For splitting table rows algorithm
@@ -91,10 +91,10 @@ class SwTabFrm: public SwLayoutFrm, public SwFlowFrm
// last table row.
// <--
// --> OD 2004-10-15 #i26945#
- BOOL bObjsDoesFit :1; // For splitting table rows algorithm, this boolean
+ sal_Bool bObjsDoesFit :1; // For splitting table rows algorithm, this boolean
// indicates, if the floating screen objects fits
// <--
- BOOL bDummy4 :1;
+ sal_Bool bDummy4 :1;
//Split() spaltet den Frm an der angegebenen Stelle, es wird ein
//Follow erzeugt und aufgebaut und direkt hinter this gepastet.
@@ -102,17 +102,25 @@ class SwTabFrm: public SwLayoutFrm, public SwFlowFrm
bool Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowKeep );
bool Join();
+<<<<<<< local
void _UpdateAttr( const SfxPoolItem*, const SfxPoolItem*, BYTE &,
+=======
+ void _UpdateAttr( SfxPoolItem*, SfxPoolItem*, sal_uInt8 &,
+>>>>>>> other
SwAttrSetChg *pa = 0, SwAttrSetChg *pb = 0 );
- virtual BOOL ShouldBwdMoved( SwLayoutFrm *pNewUpper, BOOL bHead, BOOL &rReformat );
+ virtual sal_Bool ShouldBwdMoved( SwLayoutFrm *pNewUpper, sal_Bool bHead, sal_Bool &rReformat );
protected:
virtual void MakeAll();
virtual void Format( const SwBorderAttrs *pAttrs = 0 );
//Aendert nur die Framesize, nicht die PrtArea-SSize
+<<<<<<< local
virtual SwTwips GrowFrm ( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE );
virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
+=======
+ virtual SwTwips GrowFrm ( SwTwips, sal_Bool bTst = sal_False, sal_Bool bInfo = sal_False );
+>>>>>>> other
public:
SwTabFrm( SwTable &, SwFrm* ); //Immer nach dem erzeugen _und_ pasten das
//Regist Flys rufen!
@@ -128,10 +136,15 @@ public:
inline SwTabFrm *GetFollow();
SwTabFrm* FindMaster( bool bFirstMaster = false ) const;
+<<<<<<< local
virtual BOOL GetInfo( SfxPoolItem &rHnt ) const;
+=======
+ virtual void Modify( SfxPoolItem*, SfxPoolItem* );
+ virtual sal_Bool GetInfo( SfxPoolItem &rHnt ) const;
+>>>>>>> other
virtual void Paint( SwRect const&,
SwPrintData const*const pPrintData = NULL ) const;
- virtual void CheckDirection( BOOL bVert );
+ virtual void CheckDirection( sal_Bool bVert );
virtual void Cut();
virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 );
@@ -145,48 +158,48 @@ public:
const SwTable *GetTable() const { return pTable; }
SwTable *GetTable() { return pTable; }
- BOOL IsComplete() { return bComplete; }
- void SetComplete() { bComplete = TRUE; }
- void ResetComplete() { bComplete = FALSE; }
+ sal_Bool IsComplete() { return bComplete; }
+ void SetComplete() { bComplete = sal_True; }
+ void ResetComplete() { bComplete = sal_False; }
- BOOL IsLowersFormatted() const { return bLowersFormatted; }
- void SetLowersFormatted( BOOL b ) { bLowersFormatted = b; }
+ sal_Bool IsLowersFormatted() const { return bLowersFormatted; }
+ void SetLowersFormatted( sal_Bool b ) { bLowersFormatted = b; }
- void SetCalcLowers() { bCalcLowers = TRUE; } //Sparsam einsetzen!
- void SetResizeHTMLTable() { bResizeHTMLTable = TRUE; } //dito
- void SetONECalcLowers() { bONECalcLowers = TRUE; }
+ void SetCalcLowers() { bCalcLowers = sal_True; } //Sparsam einsetzen!
+ void SetResizeHTMLTable() { bResizeHTMLTable = sal_True; } //dito
+ void SetONECalcLowers() { bONECalcLowers = sal_True; }
//
// Start: New stuff for breaking table rows
//
- BOOL HasFollowFlowLine() const { return bHasFollowFlowLine; }
- void SetFollowFlowLine( BOOL bNew ) { bHasFollowFlowLine = bNew; }
+ sal_Bool HasFollowFlowLine() const { return bHasFollowFlowLine; }
+ void SetFollowFlowLine( sal_Bool bNew ) { bHasFollowFlowLine = bNew; }
- BOOL IsRebuildLastLine() const { return bIsRebuildLastLine; }
- void SetRebuildLastLine( BOOL bNew ) { bIsRebuildLastLine = bNew; }
+ sal_Bool IsRebuildLastLine() const { return bIsRebuildLastLine; }
+ void SetRebuildLastLine( sal_Bool bNew ) { bIsRebuildLastLine = bNew; }
- BOOL IsRestrictTableGrowth() const { return bRestrictTableGrowth; }
- void SetRestrictTableGrowth( BOOL bNew ) { bRestrictTableGrowth = bNew; }
+ sal_Bool IsRestrictTableGrowth() const { return bRestrictTableGrowth; }
+ void SetRestrictTableGrowth( sal_Bool bNew ) { bRestrictTableGrowth = bNew; }
- BOOL IsRemoveFollowFlowLinePending() const { return bRemoveFollowFlowLinePending; }
- void SetRemoveFollowFlowLinePending( BOOL bNew ) { bRemoveFollowFlowLinePending = bNew; }
+ sal_Bool IsRemoveFollowFlowLinePending() const { return bRemoveFollowFlowLinePending; }
+ void SetRemoveFollowFlowLinePending( sal_Bool bNew ) { bRemoveFollowFlowLinePending = bNew; }
// --> OD 2004-10-04 #i26945#
- BOOL IsConsiderObjsForMinCellHeight() const
+ sal_Bool IsConsiderObjsForMinCellHeight() const
{
return bConsiderObjsForMinCellHeight;
}
- void SetConsiderObjsForMinCellHeight( BOOL _bNewConsiderObjsForMinCellHeight )
+ void SetConsiderObjsForMinCellHeight( sal_Bool _bNewConsiderObjsForMinCellHeight )
{
bConsiderObjsForMinCellHeight = _bNewConsiderObjsForMinCellHeight;
}
// <--
// --> OD 2004-10-04 #i26945#
- BOOL DoesObjsFit() const
+ sal_Bool DoesObjsFit() const
{
return bObjsDoesFit;
}
- void SetDoesObjsFit( BOOL _bNewObjsDoesFit )
+ void SetDoesObjsFit( sal_Bool _bNewObjsDoesFit )
{
bObjsDoesFit = _bNewObjsDoesFit;
}
@@ -197,7 +210,7 @@ public:
// End: New stuff for breaking table rows
//
- BOOL CalcFlyOffsets( SwTwips& rUpper, long& rLeftOffset,
+ sal_Bool CalcFlyOffsets( SwTwips& rUpper, long& rLeftOffset,
long& rRightOffset ) const;
SwTwips CalcHeightOfFirstContentLine() const;
@@ -211,7 +224,7 @@ public:
bool IsCollapsingBorders() const;
// used for collapsing border lines:
- USHORT GetBottomLineSize() const;
+ sal_uInt16 GetBottomLineSize() const;
// <-- collapsing
DECL_FIXEDMEMPOOL_NEWDEL(SwTabFrm)
diff --git a/sw/source/core/inc/tblrwcl.hxx b/sw/source/core/inc/tblrwcl.hxx
index 6100ee41a422..866e82274de9 100644
--- a/sw/source/core/inc/tblrwcl.hxx
+++ b/sw/source/core/inc/tblrwcl.hxx
@@ -50,20 +50,20 @@ class SwShareBoxFmts;
class SwFmtFrmSize;
// Funktions Deklarationen:
-BOOL lcl_CopyRow( const _FndLine*& rpFndLine, void* pPara );
-BOOL lcl_CopyCol( const _FndBox*& rpFndBox, void* pPara );
+sal_Bool lcl_CopyRow( const _FndLine*& rpFndLine, void* pPara );
+sal_Bool lcl_CopyCol( const _FndBox*& rpFndBox, void* pPara );
-BOOL lcl_MergeGCBox( const SwTableBox*& rpBox, void* pPara );
-BOOL lcl_MergeGCLine( const SwTableLine*& rpLine, void* pPara );
+sal_Bool lcl_MergeGCBox( const SwTableBox*& rpBox, void* pPara );
+sal_Bool lcl_MergeGCLine( const SwTableLine*& rpLine, void* pPara );
-BOOL lcl_Merge_MoveBox( const _FndBox*& rpFndBox, void* pPara );
-BOOL lcl_Merge_MoveLine( const _FndLine*& rpFndLine, void* pPara );
+sal_Bool lcl_Merge_MoveBox( const _FndBox*& rpFndBox, void* pPara );
+sal_Bool lcl_Merge_MoveLine( const _FndLine*& rpFndLine, void* pPara );
-BOOL lcl_CopyBoxToDoc( const _FndBox*& rpFndBox, void* pPara );
-BOOL lcl_CopyLineToDoc( const _FndLine*& rpFndLn, void* pPara );
+sal_Bool lcl_CopyBoxToDoc( const _FndBox*& rpFndBox, void* pPara );
+sal_Bool lcl_CopyLineToDoc( const _FndLine*& rpFndLn, void* pPara );
-BOOL lcl_BoxSetHeadCondColl( const SwTableBox*& rpBox, void* pPara );
-BOOL lcl_LineSetHeadCondColl( const SwTableLine*& rpLine, void* pPara );
+sal_Bool lcl_BoxSetHeadCondColl( const SwTableBox*& rpBox, void* pPara );
+sal_Bool lcl_LineSetHeadCondColl( const SwTableLine*& rpLine, void* pPara );
#ifdef DBG_UTIL
@@ -72,10 +72,10 @@ void _CheckBoxWidth( const SwTableLine& rLine, SwTwips nSize );
void _InsTblBox( SwDoc* pDoc, SwTableNode* pTblNd,
SwTableLine* pLine, SwTableBoxFmt* pBoxFrmFmt,
- SwTableBox* pBox, USHORT nInsPos, USHORT nCnt = 1 );
+ SwTableBox* pBox, sal_uInt16 nInsPos, sal_uInt16 nCnt = 1 );
SW_DLLPUBLIC void _DeleteBox( SwTable& rTbl, SwTableBox* pBox, SwUndo* pUndo = 0,
- BOOL bCalcNewSize = TRUE, const BOOL bCorrBorder = TRUE,
+ sal_Bool bCalcNewSize = sal_True, const sal_Bool bCorrBorder = sal_True,
SwShareBoxFmts* pShareFmts = 0 );
// Klasse fuers SplitTable
@@ -88,15 +88,15 @@ class SwCollectTblLineBoxes
SvUShorts aPosArr;
SwSelBoxes_SAR aBoxes;
SwHistory* pHst;
- USHORT nMode, nWidth;
- BOOL bGetFromTop : 1;
- BOOL bGetValues : 1;
+ sal_uInt16 nMode, nWidth;
+ sal_Bool bGetFromTop : 1;
+ sal_Bool bGetValues : 1;
public:
- SwCollectTblLineBoxes( BOOL bTop, USHORT nMd = 0, SwHistory* pHist=0 )
+ SwCollectTblLineBoxes( sal_Bool bTop, sal_uInt16 nMd = 0, SwHistory* pHist=0 )
: aPosArr( 16, 16 ), aBoxes( 16, 16 ),
pHst( pHist ), nMode( nMd ), nWidth( 0 ),
- bGetFromTop( bTop ), bGetValues( TRUE )
+ bGetFromTop( bTop ), bGetValues( sal_True )
{}
@@ -104,8 +104,8 @@ public:
const SwTableBox* GetBoxOfPos( const SwTableBox& rBox );
void AddToUndoHistory( const SwCntntNode& rNd );
- USHORT Count() const { return aBoxes.Count(); }
- const SwTableBox& GetBox( USHORT nPos, USHORT* pWidth = 0 ) const
+ sal_uInt16 Count() const { return aBoxes.Count(); }
+ const SwTableBox& GetBox( sal_uInt16 nPos, sal_uInt16* pWidth = 0 ) const
{
// hier wird die EndPos der Spalte benoetigt!
if( pWidth )
@@ -114,68 +114,68 @@ public:
return *aBoxes[ nPos ];
}
- BOOL IsGetFromTop() const { return bGetFromTop; }
- BOOL IsGetValues() const { return bGetValues; }
+ sal_Bool IsGetFromTop() const { return bGetFromTop; }
+ sal_Bool IsGetValues() const { return bGetValues; }
- USHORT GetMode() const { return nMode; }
- void SetValues( BOOL bFlag ) { bGetValues = FALSE; nWidth = 0;
+ sal_uInt16 GetMode() const { return nMode; }
+ void SetValues( sal_Bool bFlag ) { bGetValues = sal_False; nWidth = 0;
bGetFromTop = bFlag; }
- BOOL Resize( USHORT nOffset, USHORT nWidth );
+ sal_Bool Resize( sal_uInt16 nOffset, sal_uInt16 nWidth );
};
-BOOL lcl_Box_CollectBox( const SwTableBox*& rpBox, void* pPara );
-BOOL lcl_Line_CollectBox( const SwTableLine*& rpLine, void* pPara );
+sal_Bool lcl_Box_CollectBox( const SwTableBox*& rpBox, void* pPara );
+sal_Bool lcl_Line_CollectBox( const SwTableLine*& rpLine, void* pPara );
-BOOL lcl_BoxSetSplitBoxFmts( const SwTableBox*& rpBox, void* pPara );
+sal_Bool lcl_BoxSetSplitBoxFmts( const SwTableBox*& rpBox, void* pPara );
// This structure is needed by Undo to restore row span attributes
// when a table has been splitted into two tables
struct SwSaveRowSpan
{
- USHORT mnSplitLine; // the line number where the table has been splitted
+ sal_uInt16 mnSplitLine; // the line number where the table has been splitted
std::vector< long > mnRowSpans; // the row span attributes in this line
- SwSaveRowSpan( SwTableBoxes& rBoxes, USHORT nSplitLn );
+ SwSaveRowSpan( SwTableBoxes& rBoxes, sal_uInt16 nSplitLn );
};
struct _SwGCLineBorder
{
const SwTableLines* pLines;
SwShareBoxFmts* pShareFmts;
- USHORT nLinePos;
+ sal_uInt16 nLinePos;
_SwGCLineBorder( const SwTable& rTable )
: pLines( &rTable.GetTabLines() ), pShareFmts(0), nLinePos( 0 ) {}
_SwGCLineBorder( const SwTableBox& rBox )
: pLines( &rBox.GetTabLines() ), pShareFmts(0), nLinePos( 0 ) {}
- BOOL IsLastLine() const { return nLinePos + 1 >= pLines->Count(); }
+ sal_Bool IsLastLine() const { return nLinePos + 1 >= pLines->Count(); }
};
class _SwGCBorder_BoxBrd
{
const SvxBorderLine* pBrdLn;
- BOOL bAnyBorderFnd;
+ sal_Bool bAnyBorderFnd;
public:
- _SwGCBorder_BoxBrd() : pBrdLn( 0 ), bAnyBorderFnd( FALSE ) {}
+ _SwGCBorder_BoxBrd() : pBrdLn( 0 ), bAnyBorderFnd( sal_False ) {}
void SetBorder( const SvxBorderLine& rBorderLine )
- { pBrdLn = &rBorderLine; bAnyBorderFnd = FALSE; }
+ { pBrdLn = &rBorderLine; bAnyBorderFnd = sal_False; }
// checke, ob die linke Border dieselbe wie die gesetzte ist
- // returnt FALSE falls gar keine Border gesetzt ist
- BOOL CheckLeftBorderOfFormat( const SwFrmFmt& rFmt );
+ // returnt sal_False falls gar keine Border gesetzt ist
+ sal_Bool CheckLeftBorderOfFormat( const SwFrmFmt& rFmt );
- BOOL IsAnyBorderFound() const { return bAnyBorderFnd; }
+ sal_Bool IsAnyBorderFound() const { return bAnyBorderFnd; }
};
-BOOL lcl_GC_Line_Border( const SwTableLine*& , void* pPara );
-BOOL lcl_GC_Box_Border( const SwTableBox*& , void* pPara );
+sal_Bool lcl_GC_Line_Border( const SwTableLine*& , void* pPara );
+sal_Bool lcl_GC_Box_Border( const SwTableBox*& , void* pPara );
-BOOL lcl_GCBorder_ChkBoxBrd_L( const SwTableLine*& , void* pPara );
-BOOL lcl_GCBorder_ChkBoxBrd_B( const SwTableBox*& , void* pPara );
+sal_Bool lcl_GCBorder_ChkBoxBrd_L( const SwTableLine*& , void* pPara );
+sal_Bool lcl_GCBorder_ChkBoxBrd_B( const SwTableBox*& , void* pPara );
-BOOL lcl_GCBorder_GetLastBox_L( const SwTableLine*& , void* pPara );
-BOOL lcl_GCBorder_GetLastBox_B( const SwTableBox*& , void* pPara );
+sal_Bool lcl_GCBorder_GetLastBox_L( const SwTableLine*& , void* pPara );
+sal_Bool lcl_GCBorder_GetLastBox_B( const SwTableBox*& , void* pPara );
class SwShareBoxFmt
@@ -193,8 +193,8 @@ public:
SwFrmFmt* GetFormat( long nWidth ) const;
SwFrmFmt* GetFormat( const SfxPoolItem& rItem ) const;
void AddFormat( const SwFrmFmt& rFmt );
- // returnt TRUE, wenn geloescht werden kann
- BOOL RemoveFormat( const SwFrmFmt& rFmt );
+ // returnt sal_True, wenn geloescht werden kann
+ sal_Bool RemoveFormat( const SwFrmFmt& rFmt );
};
@@ -203,7 +203,7 @@ SV_DECL_PTRARR_DEL( _SwShareBoxFmts, SwShareBoxFmt*, 8, 8 )
class SwShareBoxFmts
{
_SwShareBoxFmts aShareArr;
- BOOL Seek_Entry( const SwFrmFmt& rFmt, USHORT* pPos ) const;
+ sal_Bool Seek_Entry( const SwFrmFmt& rFmt, sal_uInt16* pPos ) const;
void ChangeFrmFmt( SwTableBox* pBox, SwTableLine* pLn, SwFrmFmt& rFmt );
diff --git a/sw/source/core/inc/toxhlp.hxx b/sw/source/core/inc/toxhlp.hxx
index 16dd42596995..01188e1d8c7e 100644
--- a/sw/source/core/inc/toxhlp.hxx
+++ b/sw/source/core/inc/toxhlp.hxx
@@ -59,7 +59,7 @@ public:
String GetIndexKey( const String& rTxt, const String& rTxtReading,
const STAR_NMSPC::lang::Locale& rLocale ) const;
- String GetFollowingText( BOOL bMorePages ) const;
+ String GetFollowingText( sal_Bool bMorePages ) const;
STAR_NMSPC::uno::Sequence< ::rtl::OUString >
GetAlgorithmList( const STAR_NMSPC::lang::Locale& rLcl ) const;
diff --git a/sw/source/core/inc/txmsrt.hxx b/sw/source/core/inc/txmsrt.hxx
index e82f5dc71253..4d5e41fe8b71 100644
--- a/sw/source/core/inc/txmsrt.hxx
+++ b/sw/source/core/inc/txmsrt.hxx
@@ -55,10 +55,10 @@ struct SwTOXSource
{
const SwCntntNode* pNd;
xub_StrLen nPos;
- BOOL bMainEntry;
+ sal_Bool bMainEntry;
- SwTOXSource() : pNd(0), nPos(0), bMainEntry(FALSE) {}
- SwTOXSource( const SwCntntNode* pNode, xub_StrLen n, BOOL bMain )
+ SwTOXSource() : pNd(0), nPos(0), bMainEntry(sal_False) {}
+ SwTOXSource( const SwCntntNode* pNode, xub_StrLen n, sal_Bool bMain )
: pNd(pNode), nPos(n), bMainEntry(bMain)
{}
};
@@ -71,12 +71,12 @@ class SwTOXInternational
CharClass* pCharClass;
LanguageType eLang;
String sSortAlgorithm;
- USHORT nOptions;
+ sal_uInt16 nOptions;
void Init();
public:
- SwTOXInternational( LanguageType nLang, USHORT nOptions,
+ SwTOXInternational( LanguageType nLang, sal_uInt16 nOptions,
const String& rSortAlgorithm );
SwTOXInternational( const SwTOXInternational& );
~SwTOXInternational();
@@ -86,7 +86,7 @@ public:
const String& rTxt2, const String& rTxtReading2,
const ::com::sun::star::lang::Locale& rLocale2 ) const;
- inline BOOL IsEqual( const String& rTxt1, const String& rTxtReading1,
+ inline sal_Bool IsEqual( const String& rTxt1, const String& rTxtReading1,
const ::com::sun::star::lang::Locale& rLocale1,
const String& rTxt2, const String& rTxtReading2,
const ::com::sun::star::lang::Locale& rLocale2 ) const
@@ -95,7 +95,7 @@ public:
rTxt2, rTxtReading2, rLocale2 );
}
- inline BOOL IsLess( const String& rTxt1, const String& rTxtReading1,
+ inline sal_Bool IsLess( const String& rTxt1, const String& rTxtReading1,
const ::com::sun::star::lang::Locale& rLocale1,
const String& rTxt2, const String& rTxtReading2,
const ::com::sun::star::lang::Locale& rLocale2 ) const
@@ -107,10 +107,10 @@ public:
String GetIndexKey( const String& rTxt, const String& rTxtReading,
const ::com::sun::star::lang::Locale& rLcl ) const;
- String GetFollowingText( BOOL bMorePages ) const;
+ String GetFollowingText( sal_Bool bMorePages ) const;
String ToUpper( const String& rStr, xub_StrLen nPos ) const;
- inline BOOL IsNumeric( const String& rStr ) const;
+ inline sal_Bool IsNumeric( const String& rStr ) const;
};
/*--------------------------------------------------------------------
@@ -124,10 +124,10 @@ struct SwTOXSortTabBase
const SwTxtNode* pTOXNd;
const SwTxtTOXMark* pTxtMark;
const SwTOXInternational* pTOXIntl;
- ULONG nPos;
+ sal_uLong nPos;
xub_StrLen nCntPos;
- USHORT nType;
- static USHORT nOpt;
+ sal_uInt16 nType;
+ static sal_uInt16 nOpt;
SwTOXSortTabBase( TOXSortType nType,
const SwCntntNode* pTOXSrc,
@@ -136,13 +136,13 @@ struct SwTOXSortTabBase
const ::com::sun::star::lang::Locale* pLocale = NULL );
virtual ~SwTOXSortTabBase() {}
- USHORT GetType() const { return nType; }
- USHORT GetOptions() const { return nOpt; }
+ sal_uInt16 GetType() const { return nType; }
+ sal_uInt16 GetOptions() const { return nOpt; }
- virtual void FillText( SwTxtNode& rNd, const SwIndex& rInsPos, USHORT nAuthField = 0) const;
- virtual USHORT GetLevel() const = 0;
- virtual BOOL operator==( const SwTOXSortTabBase& );
- virtual BOOL operator<( const SwTOXSortTabBase& );
+ virtual void FillText( SwTxtNode& rNd, const SwIndex& rInsPos, sal_uInt16 nAuthField = 0) const;
+ virtual sal_uInt16 GetLevel() const = 0;
+ virtual sal_Bool operator==( const SwTOXSortTabBase& );
+ virtual sal_Bool operator<( const SwTOXSortTabBase& );
virtual String GetURL() const;
@@ -150,7 +150,7 @@ struct SwTOXSortTabBase
inline const ::com::sun::star::lang::Locale& GetLocale() const;
private:
- BOOL bValidTxt;
+ sal_Bool bValidTxt;
String sSortTxt;
String sSortTxtReading;
@@ -164,7 +164,7 @@ inline void SwTOXSortTabBase::GetTxt( String& rSortTxt,
{
SwTOXSortTabBase* pThis = (SwTOXSortTabBase*)this;
pThis->GetText_Impl( pThis->sSortTxt, pThis->sSortTxtReading );
- pThis->bValidTxt = TRUE;
+ pThis->bValidTxt = sal_True;
}
rSortTxt = sSortTxt;
@@ -182,40 +182,40 @@ inline const ::com::sun::star::lang::Locale& SwTOXSortTabBase::GetLocale() const
struct SwTOXIndex : public SwTOXSortTabBase
{
- SwTOXIndex( const SwTxtNode&, const SwTxtTOXMark*, USHORT nOptions, BYTE nKeyLevel,
+ SwTOXIndex( const SwTxtNode&, const SwTxtTOXMark*, sal_uInt16 nOptions, sal_uInt8 nKeyLevel,
const SwTOXInternational& rIntl,
const ::com::sun::star::lang::Locale& rLocale );
virtual ~SwTOXIndex() {}
- virtual void FillText( SwTxtNode& rNd, const SwIndex& rInsPos, USHORT nAuthField = 0 ) const;
- virtual USHORT GetLevel() const;
- virtual BOOL operator==( const SwTOXSortTabBase& );
- virtual BOOL operator<( const SwTOXSortTabBase& );
+ virtual void FillText( SwTxtNode& rNd, const SwIndex& rInsPos, sal_uInt16 nAuthField = 0 ) const;
+ virtual sal_uInt16 GetLevel() const;
+ virtual sal_Bool operator==( const SwTOXSortTabBase& );
+ virtual sal_Bool operator<( const SwTOXSortTabBase& );
private:
virtual void GetText_Impl( String&, String& ) const;
- BYTE nKeyLevel;
+ sal_uInt8 nKeyLevel;
};
struct SwTOXCustom : public SwTOXSortTabBase
{
- SwTOXCustom( const String& rKey, const String& rReading, USHORT nLevel,
+ SwTOXCustom( const String& rKey, const String& rReading, sal_uInt16 nLevel,
const SwTOXInternational& rIntl,
const ::com::sun::star::lang::Locale& rLocale );
virtual ~SwTOXCustom() {}
- virtual USHORT GetLevel() const;
- virtual BOOL operator==( const SwTOXSortTabBase& );
- virtual BOOL operator<( const SwTOXSortTabBase& );
+ virtual sal_uInt16 GetLevel() const;
+ virtual sal_Bool operator==( const SwTOXSortTabBase& );
+ virtual sal_Bool operator<( const SwTOXSortTabBase& );
private:
virtual void GetText_Impl( String&, String& ) const;
String aKey;
String sReading;
- USHORT nLev;
+ sal_uInt16 nLev;
};
/*--------------------------------------------------------------------
@@ -228,8 +228,8 @@ struct SwTOXContent : public SwTOXSortTabBase
const SwTOXInternational& rIntl );
virtual ~SwTOXContent() {}
- virtual void FillText( SwTxtNode& rNd, const SwIndex& rInsPos, USHORT nAuthField = 0 ) const;
- virtual USHORT GetLevel() const;
+ virtual void FillText( SwTxtNode& rNd, const SwIndex& rInsPos, sal_uInt16 nAuthField = 0 ) const;
+ virtual sal_uInt16 GetLevel() const;
private:
virtual void GetText_Impl( String&, String& ) const;
@@ -237,21 +237,21 @@ private:
struct SwTOXPara : public SwTOXSortTabBase
{
- SwTOXPara( const SwCntntNode&, SwTOXElement, USHORT nLevel = FORM_ALPHA_DELIMITTER );
+ SwTOXPara( const SwCntntNode&, SwTOXElement, sal_uInt16 nLevel = FORM_ALPHA_DELIMITTER );
virtual ~SwTOXPara() {}
void SetStartIndex( xub_StrLen nSet) { nStartIndex = nSet;}
void SetEndIndex( xub_StrLen nSet ) { nEndIndex = nSet;}
- virtual void FillText( SwTxtNode& rNd, const SwIndex& rInsPos, USHORT nAuthField = 0 ) const;
- virtual USHORT GetLevel() const;
+ virtual void FillText( SwTxtNode& rNd, const SwIndex& rInsPos, sal_uInt16 nAuthField = 0 ) const;
+ virtual sal_uInt16 GetLevel() const;
virtual String GetURL() const;
private:
virtual void GetText_Impl( String&, String& ) const;
SwTOXElement eType;
- USHORT m_nLevel;
+ sal_uInt16 m_nLevel;
xub_StrLen nStartIndex;
xub_StrLen nEndIndex;
};
@@ -261,22 +261,22 @@ struct SwTOXTable : public SwTOXSortTabBase
SwTOXTable( const SwCntntNode& rNd );
virtual ~SwTOXTable() {}
- void SetLevel(USHORT nSet){nLevel = nSet;}
+ void SetLevel(sal_uInt16 nSet){nLevel = nSet;}
- virtual USHORT GetLevel() const;
+ virtual sal_uInt16 GetLevel() const;
virtual String GetURL() const;
private:
virtual void GetText_Impl( String&, String& ) const;
- USHORT nLevel;
+ sal_uInt16 nLevel;
};
struct SwTOXAuthority : public SwTOXSortTabBase
{
private:
SwFmtFld& m_rField;
- virtual void FillText( SwTxtNode& rNd, const SwIndex& rInsPos, USHORT nAuthField = 0 ) const;
+ virtual void FillText( SwTxtNode& rNd, const SwIndex& rInsPos, sal_uInt16 nAuthField = 0 ) const;
virtual void GetText_Impl( String&, String& ) const;
public:
@@ -285,9 +285,9 @@ public:
SwFmtFld& GetFldFmt() {return m_rField;}
- virtual BOOL operator==( const SwTOXSortTabBase& );
- virtual BOOL operator<( const SwTOXSortTabBase& );
- virtual USHORT GetLevel() const;
+ virtual sal_Bool operator==( const SwTOXSortTabBase& );
+ virtual sal_Bool operator<( const SwTOXSortTabBase& );
+ virtual sal_uInt16 GetLevel() const;
};
diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx
index 1dbda6d0614f..b5418f8d415d 100644
--- a/sw/source/core/inc/txtfrm.hxx
+++ b/sw/source/core/inc/txtfrm.hxx
@@ -66,14 +66,14 @@ class SwTxtFrm: public SwCntntFrm
friend class SwTestFormat;
friend class WidowsAndOrphans;
friend class SwTxtFrmLocker; // duerfen Lock()/Unlock()
- friend sal_Bool lcl_ChangeOffset( SwTxtFrm* pFrm, USHORT nNew );
+ friend sal_Bool lcl_ChangeOffset( SwTxtFrm* pFrm, sal_uInt16 nNew );
static SwCache *pTxtCache; //Pointer auf den Line-Cache
static long nMinPrtLine; //Diese Linie darf beim Drucken nicht
//unterschritten werden, Hack fuer Tabellenzellen ueber mehrere Seiten
- ULONG nAllLines :24;//Anzahl der Zeilen fuer das Paint (inkl. nThisLines)
- ULONG nThisLines :8; //Anzahl der Zeilen dieses Frames
+ sal_uLong nAllLines :24;//Anzahl der Zeilen fuer das Paint (inkl. nThisLines)
+ sal_uLong nThisLines :8; //Anzahl der Zeilen dieses Frames
// The x position for flys anchored at this paragraph.
// These values are calculated in SwTxtFrm::CalcBaseOfstForFly()
@@ -95,7 +95,7 @@ class SwTxtFrm: public SwCntntFrm
xub_StrLen nOfst; //nOfst gibt den Offset im Cntnt (Anzahl Zeichen) an.
- USHORT nCacheIdx; //Index in den Cache, USHRT_MAX wenn definitiv
+ sal_uInt16 nCacheIdx; //Index in den Cache, USHRT_MAX wenn definitiv
//kein passendes Objekt im Cache steht.
//Teilt den Master ab und erzeugt einen Follow oder passt die
@@ -116,7 +116,7 @@ class SwTxtFrm: public SwCntntFrm
// wertet in Format() die Preps aus.
sal_Bool CalcPreps();
- void PrepWidows( const USHORT nNeed, sal_Bool bNotify = sal_True );
+ void PrepWidows( const sal_uInt16 nNeed, sal_Bool bNotify = sal_True );
void _InvalidateRange( const SwCharRange &, const long = 0);
inline void InvalidateRange( const SwCharRange &, const long = 0);
@@ -238,11 +238,11 @@ public:
void Init();
// Wird von FormatSpelling( ) gerufen
- SwRect _AutoSpell( const SwCntntNode*, const SwViewOption&, USHORT );
+ SwRect _AutoSpell( const SwCntntNode*, const SwViewOption&, sal_uInt16 );
// is called from the FormatSpelling( ) method
- SwRect SmartTagScan( SwCntntNode* , USHORT );
+ SwRect SmartTagScan( SwCntntNode* , sal_uInt16 );
// Wird vom CollectAutoCmplWords gerufen
- void CollectAutoCmplWrds( SwCntntNode* , USHORT );
+ void CollectAutoCmplWrds( SwCntntNode* , sal_uInt16 );
// Returns the screen position of rPos. The values are relative to the upper
// left position of the page frame.
@@ -315,16 +315,16 @@ public:
// Prepares the cursor position for a visual cursor move (BiDi).
// The behaviour is different for insert and overwrite cursors
- void PrepareVisualMove( xub_StrLen& nPos, BYTE& nCrsrLevel,
+ void PrepareVisualMove( xub_StrLen& nPos, sal_uInt8& nCrsrLevel,
sal_Bool& bRight, sal_Bool bInsertCrsr );
// Methoden zur Verwaltung von FolgeFrames
SwCntntFrm *SplitFrm( const xub_StrLen nTxtPos );
SwCntntFrm *JoinFrm();
- inline USHORT GetOfst() const { return nOfst; }
- void _SetOfst( const USHORT nNewOfst );
- inline void SetOfst ( const USHORT nNewOfst );
- inline void ManipOfst ( const USHORT nNewOfst ){ nOfst = nNewOfst; }
+ inline sal_uInt16 GetOfst() const { return nOfst; }
+ void _SetOfst( const sal_uInt16 nNewOfst );
+ inline void SetOfst ( const sal_uInt16 nNewOfst );
+ inline void ManipOfst ( const sal_uInt16 nNewOfst ){ nOfst = nNewOfst; }
SwTxtFrm *GetFrmAtPos ( const SwPosition &rPos);
inline const SwTxtFrm *GetFrmAtPos ( const SwPosition &rPos) const;
// OD 07.10.2003 #110978# - return <reference> instead of <pointer>
@@ -445,10 +445,10 @@ public:
inline SwTwips GetRightMargin() const;
virtual void Format( const SwBorderAttrs *pAttrs = 0 );
- virtual void CheckDirection( BOOL bVert );
+ virtual void CheckDirection( sal_Bool bVert );
// Liefert die Summe der Zeilenhoehen in pLine zurueck.
- USHORT GetParHeight() const;
+ sal_uInt16 GetParHeight() const;
// Liefert die Resthoehe zurueck
inline SwTwips GetRstHeight() const;
@@ -485,8 +485,8 @@ public:
static long GetMinPrtLine() { return nMinPrtLine; }
static void SetMinPrtLine( long nNew ) { nMinPrtLine = nNew; }
- inline USHORT GetCacheIdx() const { return nCacheIdx; }
- inline void SetCacheIdx( const USHORT nNew ) { nCacheIdx = nNew; }
+ inline sal_uInt16 GetCacheIdx() const { return nCacheIdx; }
+ inline void SetCacheIdx( const sal_uInt16 nNew ) { nCacheIdx = nNew; }
//Entfert die Line-Informationen aus dem Cache.
void ClearPara();
@@ -524,23 +524,23 @@ public:
long GetLineSpace( const bool _bNoPropLineSpacing = false ) const;
// liefert die erste Zeilenhoehe zurueck
- USHORT FirstLineHeight() const;
+ sal_uInt16 FirstLineHeight() const;
// Haengt FlyInCntFrm um, wenn nEnd > Index >= nStart ist.
- void MoveFlyInCnt( SwTxtFrm *pNew, USHORT nStart, USHORT nEnd );
+ void MoveFlyInCnt( SwTxtFrm *pNew, sal_uInt16 nStart, sal_uInt16 nEnd );
// Berechnet die Position von FlyInCntFrms
- USHORT CalcFlyPos( SwFrmFmt* pSearch );
+ sal_uInt16 CalcFlyPos( SwFrmFmt* pSearch );
// Ermittelt die Startposition und Schrittweite des Registers
- sal_Bool FillRegister( SwTwips& rRegStart, USHORT& rRegDiff );
+ sal_Bool FillRegister( SwTwips& rRegStart, sal_uInt16& rRegDiff );
- USHORT GetLineCount( USHORT nPos ); //Ermittelt die Zeilenanzahl
+ sal_uInt16 GetLineCount( sal_uInt16 nPos ); //Ermittelt die Zeilenanzahl
//Fuer die Anzeige der Zeilennummern.
- ULONG GetAllLines() const { return nAllLines; }
- ULONG GetThisLines() const { return nThisLines;}
+ sal_uLong GetAllLines() const { return nAllLines; }
+ sal_uLong GetThisLines() const { return nThisLines;}
void RecalcAllLines();
// Stoppt Animationen innerhalb von Numerierungen
diff --git a/sw/source/core/inc/txttypes.hxx b/sw/source/core/inc/txttypes.hxx
index 559ed95a69d4..f9026574245e 100644
--- a/sw/source/core/inc/txttypes.hxx
+++ b/sw/source/core/inc/txttypes.hxx
@@ -31,10 +31,10 @@
// Ueberpruefte USHORTs, z.B. Indizes auf Arrays oder garantiert kleine
// Integerwerte, auch von aussen vorgegebene
-#define MSHORT USHORT
+#define MSHORT sal_uInt16
#define MSHRT_MAX USHRT_MAX
// Koordinaten: Breite, Hoehe und Offsets in X-/Y-Richtung sowie Ascent etc.
-#define KSHORT USHORT
+#define KSHORT sal_uInt16
#define KSHRT_MAX USHRT_MAX
// Portiontypen
diff --git a/sw/source/core/inc/undoflystrattr.hxx b/sw/source/core/inc/undoflystrattr.hxx
index 329502ea1d1c..5115f1a37c07 100644
--- a/sw/source/core/inc/undoflystrattr.hxx
+++ b/sw/source/core/inc/undoflystrattr.hxx
@@ -24,8 +24,8 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef _UNDO_FLY_STR_ATTR_HXX
-#define _UNDO_FLY_STR_ATTR_HXX
+#ifndef SW_UNDO_FLY_STR_ATTR_HXX
+#define SW_UNDO_FLY_STR_ATTR_HXX
#include <undobj.hxx>
#include <swundo.hxx>
@@ -42,9 +42,8 @@ class SwUndoFlyStrAttr : public SwUndo
const String& sNewStr );
virtual ~SwUndoFlyStrAttr();
- virtual void Undo( SwUndoIter & rIt );
- virtual void Redo( SwUndoIter & rIt );
- virtual void Repeat( SwUndoIter & rIt );
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
virtual SwRewriter GetRewriter() const;
@@ -54,4 +53,4 @@ class SwUndoFlyStrAttr : public SwUndo
const String msNewStr;
};
-#endif // _UNDO_FLY_STR_ATTR_HXX
+#endif // SW_UNDO_FLY_STR_ATTR_HXX
diff --git a/sw/source/core/inc/unometa.hxx b/sw/source/core/inc/unometa.hxx
index 1f5c74612a81..52ac418b3861 100755
--- a/sw/source/core/inc/unometa.hxx
+++ b/sw/source/core/inc/unometa.hxx
@@ -84,7 +84,7 @@ protected:
virtual void SAL_CALL AttachImpl(
const ::com::sun::star::uno::Reference<
::com::sun::star::text::XTextRange > & xTextRange,
- const USHORT nWhich)
+ const sal_uInt16 nWhich)
throw (::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::uno::RuntimeException);
diff --git a/sw/source/core/inc/viewimp.hxx b/sw/source/core/inc/viewimp.hxx
index 6d48f11812c1..3959a815eaa2 100644
--- a/sw/source/core/inc/viewimp.hxx
+++ b/sw/source/core/inc/viewimp.hxx
@@ -90,17 +90,17 @@ class SwViewImp
mutable const SdrObject * pSdrObjCached;
mutable String sSdrObjCachedComment;
- BOOL bFirstPageInvalid :1; //Pointer auf erste Seite ungueltig?
+ sal_Bool bFirstPageInvalid :1; //Pointer auf erste Seite ungueltig?
- //BOOL bResetXorVisibility:1; //StartAction/EndAction
+ //sal_Bool bResetXorVisibility:1; //StartAction/EndAction
//HMHBOOL bShowHdlPaint :1; //LockPaint/UnlockPaint
- BOOL bResetHdlHiddenPaint:1;// -- "" --
+ sal_Bool bResetHdlHiddenPaint:1;// -- "" --
- BOOL bSmoothUpdate :1; //Meber fuer SmoothScroll
- BOOL bStopSmooth :1;
- BOOL bStopPrt :1; // Stop Printing
+ sal_Bool bSmoothUpdate :1; //Meber fuer SmoothScroll
+ sal_Bool bStopSmooth :1;
+ sal_Bool bStopPrt :1; // Stop Printing
- USHORT nRestoreActions ; //Die Anzahl der zu restaurierenden Actions (UNO)
+ sal_uInt16 nRestoreActions ; //Die Anzahl der zu restaurierenden Actions (UNO)
SwRect aSmoothRect;
// OD 12.12.2002 #103492#
@@ -116,16 +116,16 @@ class SwViewImp
/**
Returns if printer shall be stopped.
- @retval TRUE The printer shall be stopped.
- @retval FALSE else
+ @retval sal_True The printer shall be stopped.
+ @retval sal_False else
*/
- BOOL IsStopPrt() { return bStopPrt; }
+ sal_Bool IsStopPrt() { return bStopPrt; }
/**
Resets signal for stopping printing.
*/
- void ResetStopPrt() { bStopPrt = FALSE; }
+ void ResetStopPrt() { bStopPrt = sal_False; }
void SetFirstVisPage(); //Neue Ermittlung der ersten sichtbaren Seite
@@ -192,14 +192,14 @@ public:
//Verwaltung zur ersten sichtbaren Seite
inline const SwPageFrm *GetFirstVisPage() const;
inline SwPageFrm *GetFirstVisPage();
- void SetFirstVisPageInvalid() { bFirstPageInvalid = TRUE; }
+ void SetFirstVisPageInvalid() { bFirstPageInvalid = sal_True; }
- BOOL AddPaintRect( const SwRect &rRect );
+ sal_Bool AddPaintRect( const SwRect &rRect );
SwRegionRects *GetRegion() { return pRegion; }
void DelRegion();
// neues Interface fuer StarView Drawing
- inline BOOL HasDrawView() const { return 0 != pDrawView; }
+ inline sal_Bool HasDrawView() const { return 0 != pDrawView; }
SwDrawView* GetDrawView() { return pDrawView; }
const SwDrawView* GetDrawView() const { return pDrawView; }
SdrPageView*GetPageView() { return pSdrPageView; }
@@ -227,12 +227,12 @@ public:
//DECL_LINK( PaintDispatcher, SdrPaintProcRec * );
// Interface Drawing
- BOOL IsDragPossible( const Point &rPoint );
+ sal_Bool IsDragPossible( const Point &rPoint );
void NotifySizeChg( const Size &rNewSz );
//SS Fuer die Lay- bzw. IdleAction und verwandtes
- BOOL IsAction() const { return pLayAct != 0; }
- BOOL IsIdleAction() const { return pIdleAct != 0; }
+ sal_Bool IsAction() const { return pLayAct != 0; }
+ sal_Bool IsIdleAction() const { return pIdleAct != 0; }
SwLayAction &GetLayAction() { return *pLayAct; }
const SwLayAction &GetLayAction() const { return *pLayAct; }
SwLayIdle &GetIdleAction() { return *pIdleAct;}
@@ -241,13 +241,13 @@ public:
//Wenn eine Aktion laueft wird diese gebeten zu pruefen ob es
//an der zeit ist den WaitCrsr einzuschalten.
void CheckWaitCrsr();
- BOOL IsCalcLayoutProgress() const; //Fragt die LayAction wenn vorhanden.
- //TRUE wenn eine LayAction laeuft, dort wird dann auch das Flag fuer
+ sal_Bool IsCalcLayoutProgress() const; //Fragt die LayAction wenn vorhanden.
+ //sal_True wenn eine LayAction laeuft, dort wird dann auch das Flag fuer
//ExpressionFields gesetzt.
- BOOL IsUpdateExpFlds();
+ sal_Bool IsUpdateExpFlds();
- void SetRestoreActions(USHORT nSet){nRestoreActions = nSet;}
- USHORT GetRestoreActions() const{return nRestoreActions;}
+ void SetRestoreActions(sal_uInt16 nSet){nRestoreActions = nSet;}
+ sal_uInt16 GetRestoreActions() const{return nRestoreActions;}
// OD 12.12.2002 #103492#
void InitPagePreviewLayout();
diff --git a/sw/source/core/inc/wrong.hxx b/sw/source/core/inc/wrong.hxx
index 2f8c8047c96e..7067d63a7adf 100644
--- a/sw/source/core/inc/wrong.hxx
+++ b/sw/source/core/inc/wrong.hxx
@@ -79,8 +79,8 @@ class SwWrongList
{ if( rPos >= nStart ) rPos += nStart - nEnd; }
void _Invalidate( xub_StrLen nBegin, xub_StrLen nEnd );
- void Insert(USHORT nWhere, std::vector<SwWrongArea>::iterator startPos, std::vector<SwWrongArea>::iterator endPos);
- void Remove( USHORT nIdx, USHORT nLen );
+ void Insert(sal_uInt16 nWhere, std::vector<SwWrongArea>::iterator startPos, std::vector<SwWrongArea>::iterator endPos);
+ void Remove( sal_uInt16 nIdx, sal_uInt16 nLen );
// forbidden and not implemented
SwWrongList& operator= (const SwWrongList &);
@@ -96,15 +96,15 @@ public:
inline WrongListType GetWrongListType() const { return meType; }
inline xub_StrLen GetBeginInv() const { return nBeginInvalid; }
inline xub_StrLen GetEndInv() const { return nEndInvalid; }
- inline BOOL InsideInvalid( xub_StrLen nChk ) const
+ inline sal_Bool InsideInvalid( xub_StrLen nChk ) const
{ return nChk >= nBeginInvalid && nChk <= nEndInvalid; }
void SetInvalid( xub_StrLen nBegin, xub_StrLen nEnd );
inline void Validate(){ nBeginInvalid = STRING_LEN; }
void Invalidate( xub_StrLen nBegin, xub_StrLen nEnd );
- BOOL InvalidateWrong();
- BOOL Fresh( xub_StrLen &rStart, xub_StrLen &rEnd, xub_StrLen nPos,
- xub_StrLen nLen, USHORT nIndex, xub_StrLen nCursorPos );
- USHORT GetWrongPos( xub_StrLen nValue ) const;
+ sal_Bool InvalidateWrong();
+ sal_Bool Fresh( xub_StrLen &rStart, xub_StrLen &rEnd, xub_StrLen nPos,
+ xub_StrLen nLen, sal_uInt16 nIndex, xub_StrLen nCursorPos );
+ sal_uInt16 GetWrongPos( xub_StrLen nValue ) const;
sal_Bool Check( xub_StrLen &rChk, xub_StrLen &rLn ) const;
sal_Bool InWrongWord( xub_StrLen &rChk, xub_StrLen &rLn ) const;
@@ -120,21 +120,21 @@ public:
// the other wrong list has to be inserted.
void JoinList( SwWrongList* pNext, xub_StrLen nInsertPos );
- inline xub_StrLen Len( USHORT nIdx ) const
+ inline xub_StrLen Len( sal_uInt16 nIdx ) const
{
return nIdx < maList.size() ? maList[nIdx].mnLen : 0;
}
- inline xub_StrLen Pos( USHORT nIdx ) const
+ inline xub_StrLen Pos( sal_uInt16 nIdx ) const
{
return nIdx < maList.size() ? maList[nIdx].mnPos : 0;
}
- inline USHORT Count() const { return (USHORT)maList.size(); }
+ inline sal_uInt16 Count() const { return (sal_uInt16)maList.size(); }
inline void Insert( const rtl::OUString& rType,
com::sun::star::uno::Reference< com::sun::star::container::XStringKeyMap > xPropertyBag,
- xub_StrLen nNewPos, xub_StrLen nNewLen, USHORT nWhere )
+ xub_StrLen nNewPos, xub_StrLen nNewLen, sal_uInt16 nWhere )
{
std::vector<SwWrongArea>::iterator i = maList.begin();
if ( nWhere >= maList.size() )
@@ -148,14 +148,14 @@ public:
com::sun::star::uno::Reference< com::sun::star::container::XStringKeyMap > xPropertyBag,
xub_StrLen nNewPos, xub_StrLen nNewLen );
- inline SwWrongList* SubList( USHORT nIdx ) const
+ inline SwWrongList* SubList( sal_uInt16 nIdx ) const
{
return nIdx < maList.size() ? maList[nIdx].mpSubList : 0;
}
- void InsertSubList( xub_StrLen nNewPos, xub_StrLen nNewLen, USHORT nWhere, SwWrongList* pSubList );
+ void InsertSubList( xub_StrLen nNewPos, xub_StrLen nNewLen, sal_uInt16 nWhere, SwWrongList* pSubList );
- inline const SwWrongArea* GetElement( USHORT nIdx ) const
+ inline const SwWrongArea* GetElement( sal_uInt16 nIdx ) const
{
return nIdx < maList.size() ? &maList[nIdx] : 0;
}
diff --git a/sw/source/core/layout/anchoreddrawobject.cxx b/sw/source/core/layout/anchoreddrawobject.cxx
index 5c6ee5f03623..301c4a8372ec 100644
--- a/sw/source/core/layout/anchoreddrawobject.cxx
+++ b/sw/source/core/layout/anchoreddrawobject.cxx
@@ -878,7 +878,7 @@ void SwAnchoredDrawObject::NotifyBackground( SwPageFrm* _pPageFrm,
const SwRect& _rRect,
PrepareHint _eHint )
{
- ::Notify_Background( GetDrawObj(), _pPageFrm, _rRect, _eHint, TRUE );
+ ::Notify_Background( GetDrawObj(), _pPageFrm, _rRect, _eHint, sal_True );
}
/** method to assure that anchored object is registered at the correct
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index ac9467ab66c2..d95185064f6b 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -78,6 +78,7 @@
#include <tgrditem.hxx>
#include <hfspacingitem.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <pagefrm.hxx>
#include <rootfrm.hxx>
#include <cntfrm.hxx>
@@ -211,7 +212,7 @@ void DelHFFormat( SwClient *pToRemove, SwFrmFmt *pFmt )
// <--
//Wenn in einem der Nodes noch ein Crsr angemeldet ist, muss das
//ParkCrsr einer (beliebigen) Shell gerufen werden.
- pNode = pDoc->GetNodes()[ aIdx ];
+ pNode = & aIdx.GetNode();
sal_uInt32 nEnd = pNode->EndOfSectionIndex();
while ( aIdx < nEnd )
{
@@ -226,21 +227,17 @@ void DelHFFormat( SwClient *pToRemove, SwFrmFmt *pFmt )
}
}
aIdx++;
- pNode = pDoc->GetNodes()[ aIdx ];
+ pNode = & aIdx.GetNode();
}
}
rCnt.SetNewCntntIdx( (const SwNodeIndex*)0 );
// beim Loeschen von Header/Footer-Formaten IMMER das Undo
// abschalten! (Bug 31069)
- sal_Bool bDoesUndo = pDoc->DoesUndo();
- pDoc->DoUndo( sal_False );
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
ASSERT( pNode, "Ein grosses Problem." );
pDoc->DeleteSection( pNode );
-
- if( bDoesUndo )
- pDoc->DoUndo( sal_True );
}
delete pFmt;
}
@@ -287,7 +284,7 @@ SfxPoolItem* SwFmtFrmSize::Clone( SfxItemPool* ) const
/* -----------------24.04.98 11:36-------------------
*
* --------------------------------------------------*/
-BOOL SwFmtFrmSize::QueryValue( uno::Any& rVal, BYTE nMemberId ) const
+sal_Bool SwFmtFrmSize::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{
// hier wird immer konvertiert!
nMemberId &= ~CONVERT_TWIPS;
@@ -309,13 +306,13 @@ BOOL SwFmtFrmSize::QueryValue( uno::Any& rVal, BYTE nMemberId ) const
break;
case MID_FRMSIZE_IS_SYNC_HEIGHT_TO_WIDTH:
{
- BOOL bTmp = 0xFF == GetHeightPercent();
+ sal_Bool bTmp = 0xFF == GetHeightPercent();
rVal.setValue(&bTmp, ::getBooleanCppuType());
}
break;
case MID_FRMSIZE_IS_SYNC_WIDTH_TO_HEIGHT:
{
- BOOL bTmp = 0xFF == GetWidthPercent();
+ sal_Bool bTmp = 0xFF == GetWidthPercent();
rVal.setValue(&bTmp, ::getBooleanCppuType());
}
break;
@@ -334,7 +331,7 @@ BOOL SwFmtFrmSize::QueryValue( uno::Any& rVal, BYTE nMemberId ) const
break;
case MID_FRMSIZE_IS_AUTO_HEIGHT:
{
- BOOL bTmp = ATT_FIX_SIZE != GetHeightSizeType();
+ sal_Bool bTmp = ATT_FIX_SIZE != GetHeightSizeType();
rVal.setValue(&bTmp, ::getBooleanCppuType());
}
break;
@@ -348,7 +345,7 @@ BOOL SwFmtFrmSize::QueryValue( uno::Any& rVal, BYTE nMemberId ) const
/* -----------------24.04.98 11:36-------------------
*
* --------------------------------------------------*/
-BOOL SwFmtFrmSize::PutValue( const uno::Any& rVal, BYTE nMemberId )
+sal_Bool SwFmtFrmSize::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
sal_Bool bConvert = 0 != (nMemberId&CONVERT_TWIPS);
nMemberId &= ~CONVERT_TWIPS;
@@ -380,7 +377,7 @@ BOOL SwFmtFrmSize::PutValue( const uno::Any& rVal, BYTE nMemberId )
sal_Int16 nSet = 0;
rVal >>= nSet;
if(nSet >= 0 && nSet <= 0xfe)
- SetHeightPercent((BYTE)nSet);
+ SetHeightPercent((sal_uInt8)nSet);
else
bRet = sal_False;
}
@@ -390,7 +387,7 @@ BOOL SwFmtFrmSize::PutValue( const uno::Any& rVal, BYTE nMemberId )
sal_Int16 nSet = 0;
rVal >>= nSet;
if(nSet >= 0 && nSet <= 0xfe)
- SetWidthPercent((BYTE)nSet);
+ SetWidthPercent((sal_uInt8)nSet);
else
bRet = sal_False;
}
@@ -740,7 +737,7 @@ void SwFmtPageDesc::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
}
}
-BOOL SwFmtPageDesc::QueryValue( uno::Any& rVal, BYTE nMemberId ) const
+sal_Bool SwFmtPageDesc::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{
// hier wird immer konvertiert!
nMemberId &= ~CONVERT_TWIPS;
@@ -771,7 +768,7 @@ BOOL SwFmtPageDesc::QueryValue( uno::Any& rVal, BYTE nMemberId ) const
return bRet;
}
-BOOL SwFmtPageDesc::PutValue( const uno::Any& rVal, BYTE nMemberId )
+sal_Bool SwFmtPageDesc::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
// hier wird immer konvertiert!
nMemberId &= ~CONVERT_TWIPS;
@@ -1046,7 +1043,7 @@ void SwFmtCol::Calc( sal_uInt16 nGutterWidth, sal_uInt16 nAct )
}
}
-BOOL SwFmtCol::QueryValue( uno::Any& rVal, BYTE nMemberId ) const
+sal_Bool SwFmtCol::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{
// hier wird immer konvertiert!
nMemberId &= ~CONVERT_TWIPS;
@@ -1062,7 +1059,7 @@ BOOL SwFmtCol::QueryValue( uno::Any& rVal, BYTE nMemberId ) const
return sal_True;
}
-BOOL SwFmtCol::PutValue( const uno::Any& rVal, BYTE nMemberId )
+sal_Bool SwFmtCol::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
// hier wird immer konvertiert!
nMemberId &= ~CONVERT_TWIPS;
@@ -1090,10 +1087,10 @@ BOOL SwFmtCol::PutValue( const uno::Any& rVal, BYTE nMemberId )
for(sal_uInt16 i = 0; i < nCount; i++)
{
SwColumn* pCol = new SwColumn;
- pCol->SetWishWidth( static_cast<USHORT>(pArray[i].Width) );
- nWidthSum = static_cast<USHORT>(nWidthSum + pArray[i].Width);
- pCol->SetLeft ( static_cast<USHORT>(MM100_TO_TWIP(pArray[i].LeftMargin)) );
- pCol->SetRight( static_cast<USHORT>(MM100_TO_TWIP(pArray[i].RightMargin)) );
+ pCol->SetWishWidth( static_cast<sal_uInt16>(pArray[i].Width) );
+ nWidthSum = static_cast<sal_uInt16>(nWidthSum + pArray[i].Width);
+ pCol->SetLeft ( static_cast<sal_uInt16>(MM100_TO_TWIP(pArray[i].LeftMargin)) );
+ pCol->SetRight( static_cast<sal_uInt16>(MM100_TO_TWIP(pArray[i].RightMargin)) );
aColumns.Insert(pCol, i);
}
bRet = sal_True;
@@ -1167,7 +1164,7 @@ sal_uInt16 SwFmtSurround::GetValueCount() const
}
-BOOL SwFmtSurround::QueryValue( uno::Any& rVal, BYTE nMemberId ) const
+sal_Bool SwFmtSurround::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{
// hier wird immer konvertiert!
nMemberId &= ~CONVERT_TWIPS;
@@ -1179,19 +1176,19 @@ BOOL SwFmtSurround::QueryValue( uno::Any& rVal, BYTE nMemberId ) const
break;
case MID_SURROUND_ANCHORONLY:
{
- BOOL bTmp = IsAnchorOnly();
+ sal_Bool bTmp = IsAnchorOnly();
rVal.setValue(&bTmp, ::getBooleanCppuType());
}
break;
case MID_SURROUND_CONTOUR:
{
- BOOL bTmp = IsContour();
+ sal_Bool bTmp = IsContour();
rVal.setValue(&bTmp, ::getBooleanCppuType());
}
break;
case MID_SURROUND_CONTOUROUTSIDE:
{
- BOOL bTmp = IsOutside();
+ sal_Bool bTmp = IsOutside();
rVal.setValue(&bTmp, ::getBooleanCppuType());
}
break;
@@ -1202,7 +1199,7 @@ BOOL SwFmtSurround::QueryValue( uno::Any& rVal, BYTE nMemberId ) const
return bRet;
}
-BOOL SwFmtSurround::PutValue( const uno::Any& rVal, BYTE nMemberId )
+sal_Bool SwFmtSurround::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
// hier wird immer konvertiert!
nMemberId &= ~CONVERT_TWIPS;
@@ -1213,7 +1210,7 @@ BOOL SwFmtSurround::PutValue( const uno::Any& rVal, BYTE nMemberId )
{
sal_Int32 eVal = SWUnoHelper::GetEnumAsInt32( rVal );
if( eVal >= 0 && eVal < (sal_Int16)SURROUND_END )
- SetValue( static_cast<USHORT>(eVal) );
+ SetValue( static_cast<sal_uInt16>(eVal) );
else {
//exception
;
@@ -1261,7 +1258,7 @@ SfxPoolItem* SwFmtVertOrient::Clone( SfxItemPool* ) const
return new SwFmtVertOrient( nYPos, eOrient, eRelation );
}
-BOOL SwFmtVertOrient::QueryValue( uno::Any& rVal, BYTE nMemberId ) const
+sal_Bool SwFmtVertOrient::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{
// hier wird immer konvertiert!
nMemberId &= ~CONVERT_TWIPS;
@@ -1300,7 +1297,7 @@ BOOL SwFmtVertOrient::QueryValue( uno::Any& rVal, BYTE nMemberId ) const
return bRet;
}
-BOOL SwFmtVertOrient::PutValue( const uno::Any& rVal, BYTE nMemberId )
+sal_Bool SwFmtVertOrient::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
sal_Bool bConvert = 0 != (nMemberId&CONVERT_TWIPS);
nMemberId &= ~CONVERT_TWIPS;
@@ -1375,7 +1372,7 @@ SfxPoolItem* SwFmtHoriOrient::Clone( SfxItemPool* ) const
return new SwFmtHoriOrient( nXPos, eOrient, eRelation, bPosToggle );
}
-BOOL SwFmtHoriOrient::QueryValue( uno::Any& rVal, BYTE nMemberId ) const
+sal_Bool SwFmtHoriOrient::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{
// hier wird immer konvertiert!
nMemberId &= ~CONVERT_TWIPS;
@@ -1411,7 +1408,7 @@ BOOL SwFmtHoriOrient::QueryValue( uno::Any& rVal, BYTE nMemberId ) const
break;
case MID_HORIORIENT_PAGETOGGLE:
{
- BOOL bTmp = IsPosToggle();
+ sal_Bool bTmp = IsPosToggle();
rVal.setValue(&bTmp, ::getBooleanCppuType());
}
break;
@@ -1422,7 +1419,7 @@ BOOL SwFmtHoriOrient::QueryValue( uno::Any& rVal, BYTE nMemberId ) const
return bRet;
}
-BOOL SwFmtHoriOrient::PutValue( const uno::Any& rVal, BYTE nMemberId )
+sal_Bool SwFmtHoriOrient::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
sal_Bool bConvert = 0 != (nMemberId&CONVERT_TWIPS);
nMemberId &= ~CONVERT_TWIPS;
@@ -1560,7 +1557,7 @@ sal_uInt32 SwFmtAnchor::GetOrder() const
/*-----------------16.02.98 15:21-------------------
--------------------------------------------------*/
-BOOL SwFmtAnchor::QueryValue( uno::Any& rVal, BYTE nMemberId ) const
+sal_Bool SwFmtAnchor::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{
// hier wird immer konvertiert!
nMemberId &= ~CONVERT_TWIPS;
@@ -1614,7 +1611,7 @@ BOOL SwFmtAnchor::QueryValue( uno::Any& rVal, BYTE nMemberId ) const
return bRet;
}
-BOOL SwFmtAnchor::PutValue( const uno::Any& rVal, BYTE nMemberId )
+sal_Bool SwFmtAnchor::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
// hier wird immer konvertiert!
nMemberId &= ~CONVERT_TWIPS;
@@ -1747,7 +1744,7 @@ void SwFmtURL::SetMap( const ImageMap *pM )
}
extern const SvEventDescription* lcl_GetSupportedMacroItems();
-BOOL SwFmtURL::QueryValue( uno::Any& rVal, BYTE nMemberId ) const
+sal_Bool SwFmtURL::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{
// hier wird immer konvertiert!
nMemberId &= ~CONVERT_TWIPS;
@@ -1787,7 +1784,7 @@ BOOL SwFmtURL::QueryValue( uno::Any& rVal, BYTE nMemberId ) const
break;
case MID_URL_SERVERMAP:
{
- BOOL bTmp = IsServerMap();
+ sal_Bool bTmp = IsServerMap();
rVal.setValue(&bTmp, ::getBooleanCppuType());
}
break;
@@ -1798,7 +1795,7 @@ BOOL SwFmtURL::QueryValue( uno::Any& rVal, BYTE nMemberId ) const
return bRet;
}
-BOOL SwFmtURL::PutValue( const uno::Any& rVal, BYTE nMemberId )
+sal_Bool SwFmtURL::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
// hier wird immer konvertiert!
nMemberId &= ~CONVERT_TWIPS;
@@ -1838,7 +1835,7 @@ BOOL SwFmtURL::PutValue( const uno::Any& rVal, BYTE nMemberId )
bRet = SvUnoImageMap_fillImageMap( xCont, *pMap );
}
else
- bRet = FALSE;
+ bRet = sal_False;
}
break;
case MID_URL_SERVERMAP:
@@ -1909,7 +1906,7 @@ int SwFmtFtnEndAtTxtEnd::operator==( const SfxPoolItem& rItem ) const
sSuffix == rAttr.sSuffix;
}
-BOOL SwFmtFtnEndAtTxtEnd::QueryValue( uno::Any& rVal, BYTE nMemberId ) const
+sal_Bool SwFmtFtnEndAtTxtEnd::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{
nMemberId &= ~CONVERT_TWIPS;
switch(nMemberId)
@@ -1936,14 +1933,14 @@ BOOL SwFmtFtnEndAtTxtEnd::QueryValue( uno::Any& rVal, BYTE nMemberId ) const
case MID_NUM_TYPE : rVal <<= aFmt.GetNumberingType(); break;
case MID_PREFIX : rVal <<= OUString(sPrefix); break;
case MID_SUFFIX : rVal <<= OUString(sSuffix); break;
- default: return FALSE;
+ default: return sal_False;
}
- return TRUE;
+ return sal_True;
}
-BOOL SwFmtFtnEndAtTxtEnd::PutValue( const uno::Any& rVal, BYTE nMemberId )
+sal_Bool SwFmtFtnEndAtTxtEnd::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
nMemberId &= ~CONVERT_TWIPS;
switch(nMemberId)
{
@@ -1972,7 +1969,7 @@ BOOL SwFmtFtnEndAtTxtEnd::PutValue( const uno::Any& rVal, BYTE nMemberId )
if(nVal >= 0)
nOffset = nVal;
else
- bRet = FALSE;
+ bRet = sal_False;
}
break;
case MID_OWN_NUM :
@@ -1994,7 +1991,7 @@ BOOL SwFmtFtnEndAtTxtEnd::PutValue( const uno::Any& rVal, BYTE nMemberId )
SVX_NUM_CHARS_LOWER_LETTER_N == nVal ))
aFmt.SetNumberingType(nVal);
else
- bRet = FALSE;
+ bRet = sal_False;
}
break;
case MID_PREFIX :
@@ -2009,7 +2006,7 @@ BOOL SwFmtFtnEndAtTxtEnd::PutValue( const uno::Any& rVal, BYTE nMemberId )
sSuffix = sVal;
}
break;
- default: bRet = FALSE;
+ default: bRet = sal_False;
}
return bRet;
}
@@ -2075,7 +2072,7 @@ void SwFmtChain::SetNext( SwFlyFrmFmt *pFmt )
((SwModify*)aNext.GetRegisteredIn())->Remove( &aNext );
}
-BOOL SwFmtChain::QueryValue( uno::Any& rVal, BYTE nMemberId ) const
+sal_Bool SwFmtChain::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{
// hier wird immer konvertiert!
nMemberId &= ~CONVERT_TWIPS;
@@ -2128,7 +2125,7 @@ SfxPoolItem* SwFmtLineNumber::Clone( SfxItemPool* ) const
return new SwFmtLineNumber( *this );
}
-BOOL SwFmtLineNumber::QueryValue( uno::Any& rVal, BYTE nMemberId ) const
+sal_Bool SwFmtLineNumber::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{
// hier wird immer konvertiert!
nMemberId &= ~CONVERT_TWIPS;
@@ -2137,7 +2134,7 @@ BOOL SwFmtLineNumber::QueryValue( uno::Any& rVal, BYTE nMemberId ) const
{
case MID_LINENUMBER_COUNT:
{
- BOOL bTmp = IsCount();
+ sal_Bool bTmp = IsCount();
rVal.setValue(&bTmp, ::getBooleanCppuType());
}
break;
@@ -2151,7 +2148,7 @@ BOOL SwFmtLineNumber::QueryValue( uno::Any& rVal, BYTE nMemberId ) const
return bRet;
}
-BOOL SwFmtLineNumber::PutValue( const uno::Any& rVal, BYTE nMemberId )
+sal_Bool SwFmtLineNumber::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
// hier wird immer konvertiert!
nMemberId &= ~CONVERT_TWIPS;
@@ -2231,9 +2228,9 @@ SwTextGridItem& SwTextGridItem::operator=( const SwTextGridItem& rCpy )
return *this;
}
-BOOL SwTextGridItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const
+sal_Bool SwTextGridItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
switch( nMemberId & ~CONVERT_TWIPS )
{
@@ -2281,7 +2278,7 @@ BOOL SwTextGridItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const
break;
default:
DBG_ERROR("unknown SwTextGrid value");
- bRet = FALSE;
+ bRet = sal_False;
break;
}
break;
@@ -2296,16 +2293,16 @@ BOOL SwTextGridItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const
break;
default:
DBG_ERROR("Unknown SwTextGridItem member");
- bRet = FALSE;
+ bRet = sal_False;
break;
}
return bRet;
}
-BOOL SwTextGridItem::PutValue( const uno::Any& rVal, BYTE nMemberId )
+sal_Bool SwTextGridItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
switch( nMemberId & ~CONVERT_TWIPS )
{
case MID_GRID_COLOR:
@@ -2323,7 +2320,7 @@ BOOL SwTextGridItem::PutValue( const uno::Any& rVal, BYTE nMemberId )
if( bRet && (nTmp >= 0) )
SetLines( (sal_uInt16)nTmp );
else
- bRet = FALSE;
+ bRet = sal_False;
}
break;
case MID_GRID_RUBY_BELOW:
@@ -2346,13 +2343,13 @@ BOOL SwTextGridItem::PutValue( const uno::Any& rVal, BYTE nMemberId )
nTmp = MM100_TO_TWIP( nTmp );
if( bRet && (nTmp >= 0) && ( nTmp <= USHRT_MAX) )
if( (nMemberId & ~CONVERT_TWIPS) == MID_GRID_BASEHEIGHT )
- SetBaseHeight( (USHORT)nTmp );
+ SetBaseHeight( (sal_uInt16)nTmp );
else if( (nMemberId & ~CONVERT_TWIPS) == MID_GRID_BASEWIDTH )
- SetBaseWidth( (USHORT)nTmp );
+ SetBaseWidth( (sal_uInt16)nTmp );
else
- SetRubyHeight( (USHORT)nTmp );
+ SetRubyHeight( (sal_uInt16)nTmp );
else
- bRet = FALSE;
+ bRet = sal_False;
}
break;
case MID_GRID_TYPE:
@@ -2373,7 +2370,7 @@ BOOL SwTextGridItem::PutValue( const uno::Any& rVal, BYTE nMemberId )
SetGridType( GRID_LINES_CHARS );
break;
default:
- bRet = FALSE;
+ bRet = sal_False;
break;
}
}
@@ -2390,13 +2387,13 @@ BOOL SwTextGridItem::PutValue( const uno::Any& rVal, BYTE nMemberId )
}
default:
DBG_ERROR("Unknown SwTextGridItem member");
- bRet = FALSE;
+ bRet = sal_False;
}
return bRet;
}
-void SwTextGridItem::SwitchPaperMode(BOOL bNew)
+void SwTextGridItem::SwitchPaperMode(sal_Bool bNew)
{
if( bNew == bSquaredMode )
{
@@ -2838,7 +2835,7 @@ void SwFlyFrmFmt::MakeFrms()
SwIterator<SwFrm,SwModify> aIter( *pModify );
for( SwFrm *pFrm = aIter.First(); pFrm; pFrm = aIter.Next() )
{
- BOOL bAdd = !pFrm->IsCntntFrm() ||
+ sal_Bool bAdd = !pFrm->IsCntntFrm() ||
!((SwCntntFrm*)pFrm)->IsFollow();
if ( FLY_AT_FLY == aAnchorAttr.GetAnchorId() && !pFrm->IsFlyFrm() )
diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx
index dc4395c1ab60..90eb1f9ddff2 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -79,7 +79,7 @@
|*************************************************************************/
-BOOL SwCntntFrm::ShouldBwdMoved( SwLayoutFrm *pNewUpper, BOOL, BOOL & )
+sal_Bool SwCntntFrm::ShouldBwdMoved( SwLayoutFrm *pNewUpper, sal_Bool, sal_Bool & )
{
if ( (SwFlowFrm::IsMoveBwdJump() || !IsPrevObjMove()))
{
@@ -104,12 +104,12 @@ BOOL SwCntntFrm::ShouldBwdMoved( SwLayoutFrm *pNewUpper, BOOL, BOOL & )
//von Leerseiten), so muss in jedemfall gemoved werden - sonst wuerde,
//falls der Frm nicht in das Blatt passt, nicht mehr auf die
//dazwischenliegenden Blaetter geachtet werden.
- BYTE nMoveAnyway = 0;
+ sal_uInt8 nMoveAnyway = 0;
SwPageFrm * const pNewPage = pNewUpper->FindPageFrm();
SwPageFrm *pOldPage = FindPageFrm();
if ( SwFlowFrm::IsMoveBwdJump() )
- return TRUE;
+ return sal_True;
if( IsInFtn() && IsInSct() )
{
@@ -122,7 +122,7 @@ BOOL SwCntntFrm::ShouldBwdMoved( SwLayoutFrm *pNewUpper, BOOL, BOOL & )
pSect = pSect->GetUpper()->FindSctFrm();
ASSERT( pSect, "Escaping footnote" );
if( pSect != pMySect )
- return FALSE;
+ return sal_False;
}
}
SWRECTFN( this )
@@ -188,7 +188,7 @@ BOOL SwCntntFrm::ShouldBwdMoved( SwLayoutFrm *pNewUpper, BOOL, BOOL & )
( pNewUpper->IsColBodyFrm() &&
!pNewUpper->GetUpper()->GetPrev() &&
!pNewUpper->GetUpper()->GetNext() ) ) ) )
- nSpace += pNewUpper->Grow( LONG_MAX, TRUE );
+ nSpace += pNewUpper->Grow( LONG_MAX, sal_True );
if ( nMoveAnyway < 3 )
{
@@ -205,7 +205,7 @@ BOOL SwCntntFrm::ShouldBwdMoved( SwLayoutFrm *pNewUpper, BOOL, BOOL & )
// dabei ist sogar die Breite egal, da ein TestFormat in der neuen Umgebung
// vorgenommen wird.
// --> OD 2007-11-26 #b6614158#
- const BYTE nBwdMoveNecessaryResult =
+ const sal_uInt8 nBwdMoveNecessaryResult =
BwdMoveNecessary( pNewPage, aRect);
const bool bObjsInNewUpper( nBwdMoveNecessaryResult == 2 ||
nBwdMoveNecessaryResult == 3 );
@@ -221,21 +221,21 @@ BOOL SwCntntFrm::ShouldBwdMoved( SwLayoutFrm *pNewUpper, BOOL, BOOL & )
!(pNewUpper->Prt().*fnRectX->fnGetWidth)() &&
( pNewUpper->GetUpper()->GetPrev() ||
pNewUpper->GetUpper()->GetNext() ) )
- return TRUE;
+ return sal_True;
else
- return FALSE; // Kein Platz, dann ist es sinnlos, zurueckzufliessen
+ return sal_False; // Kein Platz, dann ist es sinnlos, zurueckzufliessen
}
else
{
// OD 2004-05-26 #i25904# - check for space left in new upper
if ( nSpace )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
}
}
- return FALSE;
+ return sal_False;
}
//------------------------------------------------------------------------
@@ -295,10 +295,10 @@ void SwFrm::PrepareMake()
if ( !GetUpper() )
return;
- const BOOL bCnt = IsCntntFrm();
- const BOOL bTab = IsTabFrm();
- BOOL bNoSect = IsInSct();
- BOOL bOldTabLock = FALSE, bFoll = FALSE;
+ const sal_Bool bCnt = IsCntntFrm();
+ const sal_Bool bTab = IsTabFrm();
+ sal_Bool bNoSect = IsInSct();
+ sal_Bool bOldTabLock = sal_False, bFoll = sal_False;
SwFlowFrm* pThis = bCnt ? (SwCntntFrm*)this : NULL;
if ( bTab )
@@ -312,9 +312,9 @@ void SwFrm::PrepareMake()
{
pThis = (SwSectionFrm*)this;
bFoll = pThis->IsFollow();
- bNoSect = FALSE;
+ bNoSect = sal_False;
}
- else if ( bCnt && TRUE == (bFoll = pThis->IsFollow()) &&
+ else if ( bCnt && sal_True == (bFoll = pThis->IsFollow()) &&
GetPrev() )
{
//Wenn der Master gereade ein CalcFollow ruft braucht die Kette
@@ -427,11 +427,11 @@ void SwFrm::PrepareCrsr()
if ( !GetUpper() )
return;
- const BOOL bCnt = IsCntntFrm();
- const BOOL bTab = IsTabFrm();
- BOOL bNoSect = IsInSct();
+ const sal_Bool bCnt = IsCntntFrm();
+ const sal_Bool bTab = IsTabFrm();
+ sal_Bool bNoSect = IsInSct();
- BOOL bOldTabLock = FALSE, bFoll;
+ sal_Bool bOldTabLock = sal_False, bFoll;
SwFlowFrm* pThis = bCnt ? (SwCntntFrm*)this : NULL;
if ( bTab )
@@ -443,7 +443,7 @@ void SwFrm::PrepareCrsr()
else if( IsSctFrm() )
{
pThis = (SwSectionFrm*)this;
- bNoSect = FALSE;
+ bNoSect = sal_False;
}
bFoll = pThis && pThis->IsFollow();
@@ -505,7 +505,7 @@ void SwFrm::PrepareCrsr()
// Hier wird GetPrev() zurueckgegeben, allerdings werden
// dabei leere SectionFrms ueberlesen
-SwFrm* lcl_Prev( SwFrm* pFrm, BOOL bSectPrv = TRUE )
+SwFrm* lcl_Prev( SwFrm* pFrm, sal_Bool bSectPrv = sal_True )
{
SwFrm* pRet = pFrm->GetPrev();
if( !pRet && pFrm->GetUpper() && pFrm->GetUpper()->IsSctFrm() &&
@@ -531,8 +531,8 @@ void SwFrm::MakePos()
{
if ( !bValidPos )
{
- bValidPos = TRUE;
- BOOL bUseUpper = FALSE;
+ bValidPos = sal_True;
+ sal_Bool bUseUpper = sal_False;
SwFrm* pPrv = lcl_Prev( this );
if ( pPrv &&
( !pPrv->IsCntntFrm() ||
@@ -549,19 +549,19 @@ void SwFrm::MakePos()
}
else if ( pPrv->Frm().Top() == 0 )
{
- bUseUpper = TRUE;
+ bUseUpper = sal_True;
}
}
- pPrv = lcl_Prev( this, FALSE );
- USHORT nMyType = GetType();
+ pPrv = lcl_Prev( this, sal_False );
+ sal_uInt16 nMyType = GetType();
SWRECTFN( ( IsCellFrm() && GetUpper() ? GetUpper() : this ) )
if ( !bUseUpper && pPrv )
{
aFrm.Pos( pPrv->Frm().Pos() );
if( FRM_NEIGHBOUR & nMyType )
{
- BOOL bR2L = IsRightToLeft();
+ sal_Bool bR2L = IsRightToLeft();
if( bR2L )
(aFrm.*fnRect->fnSetPosX)( (aFrm.*fnRect->fnGetLeft)() -
(aFrm.*fnRect->fnGetWidth)() );
@@ -605,13 +605,13 @@ void SwFrm::MakePos()
GetUpper()->Calc();
}
// <--
- pPrv = lcl_Prev( this, FALSE );
+ pPrv = lcl_Prev( this, sal_False );
if ( !bUseUpper && pPrv )
{
aFrm.Pos( pPrv->Frm().Pos() );
if( FRM_NEIGHBOUR & nMyType )
{
- BOOL bR2L = IsRightToLeft();
+ sal_Bool bR2L = IsRightToLeft();
if( bR2L )
(aFrm.*fnRect->fnSetPosX)( (aFrm.*fnRect->fnGetLeft)() -
(aFrm.*fnRect->fnGetWidth)() );
@@ -654,7 +654,7 @@ void SwFrm::MakePos()
aFrm.Pos().X() = aFrm.Pos().Y() = 0;
if( IsBodyFrm() && bVert && !bReverse && GetUpper() )
aFrm.Pos().X() += GetUpper()->Prt().Width() - aFrm.Width();
- bValidPos = TRUE;
+ bValidPos = sal_True;
}
}
@@ -672,7 +672,7 @@ void lcl_CheckObjects( SwSortedObjs* pSortedObjs, SwFrm* pFrm, long& rBot )
//Und dann kann es natuerlich noch Absatzgebundene
//Rahmen geben, die unterhalb ihres Absatzes stehen.
long nMax = 0;
- for ( USHORT i = 0; i < pSortedObjs->Count(); ++i )
+ for ( sal_uInt16 i = 0; i < pSortedObjs->Count(); ++i )
{
// --> OD 2004-07-01 #i28701# - consider changed type of <SwSortedObjs>
// entries.
@@ -713,7 +713,7 @@ void SwPageFrm::MakeAll()
if ( !bValidPos )
{
// PAGES01
- bValidPos = TRUE; // positioning of the pages is taken care of by the root frame
+ bValidPos = sal_True; // positioning of the pages is taken care of by the root frame
}
if ( !bValidSize || !bValidPrtArea )
@@ -723,7 +723,7 @@ void SwPageFrm::MakeAll()
Frm().Width( 0 ); Prt().Width( 0 );
Frm().Height( 0 ); Prt().Height( 0 );
Prt().Left( 0 ); Prt().Top( 0 );
- bValidSize = bValidPrtArea = TRUE;
+ bValidSize = bValidPrtArea = sal_True;
}
else
{
@@ -830,7 +830,7 @@ void SwPageFrm::MakeAll()
Prt().Width( Frm().Width() - ( Prt().Left()
+ pAttrs->CalcRightLine() + aBorder.Width() ) );
Prt().Height( Frm().Height() - (nTop + nBottom) );
- bValidSize = bValidPrtArea = TRUE;
+ bValidSize = bValidPrtArea = sal_True;
}
else
{ //FixSize einstellen, bei Seiten nicht vom Upper sondern vom
@@ -873,7 +873,7 @@ void SwLayoutFrm::MakeAll()
//uebernimmt im DTor die Benachrichtigung
const SwLayNotify aNotify( this );
- BOOL bVert = IsVertical();
+ sal_Bool bVert = IsVertical();
SwRectFn fnRect = ( IsNeighbourFrm() == bVert )? fnRectHori : fnRectVert;
SwBorderAttrAccess *pAccess = 0;
@@ -890,7 +890,7 @@ void SwLayoutFrm::MakeAll()
if ( IsLeaveUpperAllowed() )
{
if ( !bValidSize )
- bValidPrtArea = FALSE;
+ bValidPrtArea = sal_False;
}
else
{
@@ -898,7 +898,7 @@ void SwLayoutFrm::MakeAll()
{
//FixSize einstellen, die VarSize wird von Format() nach
//Berechnung der PrtArea eingestellt.
- bValidPrtArea = FALSE;
+ bValidPrtArea = sal_False;
SwTwips nPrtWidth = (GetUpper()->Prt().*fnRect->fnGetWidth)();
if( bVert && ( IsBodyFrm() || IsFtnContFrm() ) )
@@ -927,7 +927,7 @@ void SwLayoutFrm::MakeAll()
// Don't leave your upper
const SwTwips nDeadLine = (GetUpper()->*fnRect->fnGetPrtBottom)();
if( (Frm().*fnRect->fnOverStep)( nDeadLine ) )
- bValidSize = FALSE;
+ bValidSize = sal_False;
}
}
}
@@ -954,16 +954,16 @@ void SwLayoutFrm::MakeAll()
|*
|*************************************************************************/
-BOOL SwCntntFrm::MakePrtArea( const SwBorderAttrs &rAttrs )
+sal_Bool SwCntntFrm::MakePrtArea( const SwBorderAttrs &rAttrs )
{
- BOOL bSizeChgd = FALSE;
+ sal_Bool bSizeChgd = sal_False;
if ( !bValidPrtArea )
{
- bValidPrtArea = TRUE;
+ bValidPrtArea = sal_True;
SWRECTFN( this )
- const BOOL bTxtFrm = IsTxtFrm();
+ const sal_Bool bTxtFrm = IsTxtFrm();
SwTwips nUpper = 0;
if ( bTxtFrm && ((SwTxtFrm*)this)->IsHiddenNow() )
{
@@ -998,13 +998,13 @@ BOOL SwCntntFrm::MakePrtArea( const SwBorderAttrs &rAttrs )
//geben kann (RootFrm::ImplCalcBrowseWidth())
long nMinWidth = 0;
- for (USHORT i = 0; GetDrawObjs() && i < GetDrawObjs()->Count();++i)
+ for (sal_uInt16 i = 0; GetDrawObjs() && i < GetDrawObjs()->Count();++i)
{
// --> OD 2004-07-01 #i28701# - consider changed type of
// <SwSortedObjs> entries
SwAnchoredObject* pObj = (*GetDrawObjs())[i];
const SwFrmFmt& rFmt = pObj->GetFrmFmt();
- const BOOL bFly = pObj->ISA(SwFlyFrm);
+ const sal_Bool bFly = pObj->ISA(SwFlyFrm);
if ((bFly && (WEIT_WECH == pObj->GetObjRect().Width()))
|| rFmt.GetFrmSize().GetWidthPercent())
{
@@ -1081,7 +1081,7 @@ BOOL SwCntntFrm::MakePrtArea( const SwBorderAttrs &rAttrs )
GrowFrm( nUpper );
else
ShrinkFrm( -nUpper );
- bSizeChgd = TRUE;
+ bSizeChgd = sal_True;
}
}
return bSizeChgd;
@@ -1105,8 +1105,8 @@ inline void ValidateSz( SwFrm *pFrm )
{
if ( pFrm )
{
- pFrm->bValidSize = TRUE;
- pFrm->bValidPrtArea = TRUE;
+ pFrm->bValidSize = sal_True;
+ pFrm->bValidPrtArea = sal_True;
}
}
@@ -1127,7 +1127,7 @@ void SwCntntFrm::MakeAll()
if ( ((SwTxtFrm*)this)->IsLocked() )
{
- ASSERT( FALSE, "Format fuer gelockten TxtFrm." );
+ ASSERT( sal_False, "Format fuer gelockten TxtFrm." );
return;
}
@@ -1156,31 +1156,31 @@ void SwCntntFrm::MakeAll()
//uebernimmt im DTor die Benachrichtigung
SwCntntNotify *pNotify = new SwCntntNotify( this );
- BOOL bMakePage = TRUE; //solange TRUE kann eine neue Seite
+ sal_Bool bMakePage = sal_True; //solange sal_True kann eine neue Seite
//angelegt werden (genau einmal)
- BOOL bMovedBwd = FALSE; //Wird TRUE wenn der Frame zurueckfliesst
- BOOL bMovedFwd = FALSE; //solange FALSE kann der Frm zurueck-
+ sal_Bool bMovedBwd = sal_False; //Wird sal_True wenn der Frame zurueckfliesst
+ sal_Bool bMovedFwd = sal_False; //solange sal_False kann der Frm zurueck-
//fliessen (solange, bis er einmal
//vorwaerts ge'moved wurde).
- BOOL bFormatted = FALSE; //Fuer die Witwen und Waisen Regelung
+ sal_Bool bFormatted = sal_False; //Fuer die Witwen und Waisen Regelung
//wird der letzte CntntFrm einer Kette
//u.U. zum Formatieren angeregt, dies
//braucht nur einmal zu passieren.
//Immer wenn der Frm gemoved wird muss
//das Flag zurueckgesetzt werden.
- BOOL bMustFit = FALSE; //Wenn einmal die Notbremse gezogen wurde,
+ sal_Bool bMustFit = sal_False; //Wenn einmal die Notbremse gezogen wurde,
//werden keine anderen Prepares mehr
//abgesetzt.
- BOOL bFitPromise = FALSE; //Wenn ein Absatz nicht passte, mit WouldFit
+ sal_Bool bFitPromise = sal_False; //Wenn ein Absatz nicht passte, mit WouldFit
//aber verspricht, dass er sich passend
//einstellt wird dieses Flag gesetzt.
//Wenn er dann sein Versprechen nicht haelt,
//kann kontrolliert verfahren werden.
- BOOL bMoveable;
- const BOOL bFly = IsInFly();
- const BOOL bTab = IsInTab();
- const BOOL bFtn = IsInFtn();
- const BOOL bSct = IsInSct();
+ sal_Bool bMoveable;
+ const sal_Bool bFly = IsInFly();
+ const sal_Bool bTab = IsInTab();
+ const sal_Bool bFtn = IsInFtn();
+ const sal_Bool bSct = IsInSct();
Point aOldFrmPos; //Damit bei Turnarounds jew. mit der
Point aOldPrtPos; //letzten Pos verglichen und geprueft
//werden kann, ob ein Prepare sinnvoll ist.
@@ -1194,7 +1194,7 @@ void SwCntntFrm::MakeAll()
pNotify->SetBordersJoinedWithPrev();
}
- const BOOL bKeep = IsKeep( rAttrs.GetAttrSet() );
+ const sal_Bool bKeep = IsKeep( rAttrs.GetAttrSet() );
SwSaveFtnHeight *pSaveFtn = 0;
if ( bFtn )
@@ -1239,8 +1239,8 @@ void SwCntntFrm::MakeAll()
GetUpper()->GetUpper()->IsCellFrm() ) ) &&
IsMoveable() )
{
- bMovedFwd = TRUE;
- MoveFwd( bMakePage, FALSE );
+ bMovedFwd = sal_True;
+ MoveFwd( bMakePage, sal_False );
}
// <--
}
@@ -1250,7 +1250,7 @@ void SwCntntFrm::MakeAll()
//gleich verschoben werden.
if ( lcl_Prev( this ) && ((SwTxtFrm*)this)->IsFollow() && IsMoveable() )
{
- bMovedFwd = TRUE;
+ bMovedFwd = sal_True;
// OD 2004-03-02 #106629# - If follow frame is in table, it's master
// will be the last in the current table cell. Thus, invalidate the
// printing area of the master,
@@ -1258,7 +1258,7 @@ void SwCntntFrm::MakeAll()
{
lcl_Prev( this )->InvalidatePrt();
}
- MoveFwd( bMakePage, FALSE );
+ MoveFwd( bMakePage, sal_False );
}
// OD 08.11.2002 #104840# - check footnote content for forward move.
@@ -1277,8 +1277,8 @@ void SwCntntFrm::MakeAll()
pFtnBossOfFtn != pFtnBossOfRef &&
pFtnBossOfFtn->IsBefore( pFtnBossOfRef ) )
{
- bMovedFwd = TRUE;
- MoveFwd( bMakePage, FALSE );
+ bMovedFwd = sal_True;
+ MoveFwd( bMakePage, sal_False );
}
}
}
@@ -1291,13 +1291,13 @@ void SwCntntFrm::MakeAll()
SwRect aOldFrm_StopFormat( Frm() );
SwRect aOldPrt_StopFormat( Prt() );
// <--
- if ( TRUE == (bMoveable = IsMoveable()) )
+ if ( sal_True == (bMoveable = IsMoveable()) )
{
SwFrm *pPre = GetIndPrev();
if ( CheckMoveFwd( bMakePage, bKeep, bMovedBwd ) )
{
SWREFRESHFN( this )
- bMovedFwd = TRUE;
+ bMovedFwd = sal_True;
if ( bMovedBwd )
{
//Beim zurueckfliessen wurde der Upper angeregt sich
@@ -1327,7 +1327,7 @@ void SwCntntFrm::MakeAll()
// - current frame width is 0.
// - current printing area width is 0.
// - frame width is adjusted to a value greater than 0.
- // - printing area flag is TRUE.
+ // - printing area flag is sal_True.
// Thus, it's assured that the printing area is adjusted, if the
// frame area width changes its width from 0 to something greater
// than 0.
@@ -1339,7 +1339,7 @@ void SwCntntFrm::MakeAll()
(Frm().*fnRect->fnGetWidth)() == 0 &&
(Prt().*fnRect->fnGetWidth)() == 0 )
{
- bValidPrtArea = FALSE;
+ bValidPrtArea = sal_False;
}
(Frm().*fnRect->fnSetWidth)( nNewFrmWidth );
@@ -1375,7 +1375,7 @@ void SwCntntFrm::MakeAll()
if ( !bNoPrepAdjustFrm )
{
Prepare( PREP_ADJUST_FRM );
- bValidSize = FALSE;
+ bValidSize = sal_False;
}
// <--
}
@@ -1389,32 +1389,32 @@ void SwCntntFrm::MakeAll()
//- Er muss mit der Unterkante der PrtArea des Upper ueberlappen.
if ( !bMustFit )
{
- BOOL bWidow = TRUE;
+ sal_Bool bWidow = sal_True;
const SwTwips nDeadLine = (GetUpper()->*fnRect->fnGetPrtBottom)();
if ( bMoveable && !bFormatted && ( GetFollow() ||
( (Frm().*fnRect->fnOverStep)( nDeadLine ) ) ) )
{
- Prepare( PREP_WIDOWS_ORPHANS, 0, FALSE );
- bValidSize = bWidow = FALSE;
+ Prepare( PREP_WIDOWS_ORPHANS, 0, sal_False );
+ bValidSize = bWidow = sal_False;
}
if( (Frm().*fnRect->fnGetPos)() != aOldFrmPos ||
(Prt().*fnRect->fnGetPos)() != aOldPrtPos )
{
// In diesem Prepare erfolgt ggf. ein _InvalidateSize().
- // bValidSize wird FALSE und das Format() wird gerufen.
- Prepare( PREP_POS_CHGD, (const void*)&bFormatted, FALSE );
+ // bValidSize wird sal_False und das Format() wird gerufen.
+ Prepare( PREP_POS_CHGD, (const void*)&bFormatted, sal_False );
if ( bWidow && GetFollow() )
- { Prepare( PREP_WIDOWS_ORPHANS, 0, FALSE );
- bValidSize = FALSE;
+ { Prepare( PREP_WIDOWS_ORPHANS, 0, sal_False );
+ bValidSize = sal_False;
}
}
}
if ( !bValidSize )
{
- bValidSize = bFormatted = TRUE;
+ bValidSize = bFormatted = sal_True;
++nFormatCount;
if( nFormatCount > STOP_FLY_FORMAT )
- SetFlyLock( TRUE );
+ SetFlyLock( sal_True );
// --> OD 2006-09-25 #b6448963# - loop prevention
// No format any longer, if <cnStopFormat> consequetive formats
// without change occur.
@@ -1443,10 +1443,10 @@ void SwCntntFrm::MakeAll()
)
{
SwFrm* pOldUpper = GetUpper();
- MoveFwd( TRUE, FALSE );
+ MoveFwd( sal_True, sal_False );
if ( GetUpper() != pOldUpper )
{
- bMovedFwd = TRUE;
+ bMovedFwd = sal_True;
SWREFRESHFN( this )
continue;
}
@@ -1456,7 +1456,7 @@ void SwCntntFrm::MakeAll()
//ich zurueckfliessen kann (wenn ich mich ueberhaupt bewegen soll).
//Damit es keine Oszillation gibt, darf ich nicht gerade vorwaerts
//geflossen sein.
- BOOL bDummy;
+ sal_Bool bDummy;
if ( !lcl_Prev( this ) &&
!bMovedFwd &&
( bMoveable || ( bFly && !bTab ) ) &&
@@ -1464,13 +1464,13 @@ void SwCntntFrm::MakeAll()
&& MoveBwd( bDummy ) )
{
SWREFRESHFN( this )
- bMovedBwd = TRUE;
- bFormatted = FALSE;
+ bMovedBwd = sal_True;
+ bFormatted = sal_False;
if ( bKeep && bMoveable )
{
- if( CheckMoveFwd( bMakePage, FALSE, bMovedBwd ) )
+ if( CheckMoveFwd( bMakePage, sal_False, bMovedBwd ) )
{
- bMovedFwd = TRUE;
+ bMovedFwd = sal_True;
bMoveable = IsMoveable();
SWREFRESHFN( this )
}
@@ -1478,7 +1478,7 @@ void SwCntntFrm::MakeAll()
MakePos();
if( aOldPos != (Frm().*fnRect->fnGetPos)() )
{
- Prepare( PREP_POS_CHGD, (const void*)&bFormatted, FALSE );
+ Prepare( PREP_POS_CHGD, (const void*)&bFormatted, sal_False );
if ( !bValidSize )
{
(Frm().*fnRect->fnSetWidth)( (GetUpper()->
@@ -1488,11 +1488,11 @@ void SwCntntFrm::MakeAll()
const long nOldW = (Prt().*fnRect->fnGetWidth)();
MakePrtArea( rAttrs );
if( nOldW != (Prt().*fnRect->fnGetWidth)() )
- Prepare( PREP_FIXSIZE_CHG, 0, FALSE );
+ Prepare( PREP_FIXSIZE_CHG, 0, sal_False );
}
if( GetFollow() )
- Prepare( PREP_WIDOWS_ORPHANS, 0, FALSE );
- bValidSize = bFormatted = TRUE;
+ Prepare( PREP_WIDOWS_ORPHANS, 0, sal_False );
+ bValidSize = bFormatted = sal_True;
Format();
}
}
@@ -1520,10 +1520,10 @@ void SwCntntFrm::MakeAll()
{
SwSectionFrm* pNxtSct = pNxt->FindSctFrm();
if( pNxtSct && pSct->IsAnFollow( pNxtSct ) )
- bValidPos = FALSE;
+ bValidPos = sal_False;
}
else
- bValidPos = FALSE;
+ bValidPos = sal_False;
}
}
}
@@ -1545,7 +1545,7 @@ void SwCntntFrm::MakeAll()
!GetDrawObjs() )
// <--
{
- bValidPos = FALSE;
+ bValidPos = sal_False;
MakePos();
aOldFrmPos = (Frm().*fnRect->fnGetPos)();
aOldPrtPos = (Prt().*fnRect->fnGetPos)();
@@ -1600,8 +1600,8 @@ void SwCntntFrm::MakeAll()
}
if ( pNxt )
{
- const BOOL bMoveFwdInvalid = 0 != GetIndNext();
- const BOOL bNxtNew =
+ const sal_Bool bMoveFwdInvalid = 0 != GetIndNext();
+ const sal_Bool bNxtNew =
( 0 == (pNxt->Prt().*fnRect->fnGetHeight)() ) &&
(!pNxt->IsTxtFrm() ||!((SwTxtFrm*)pNxt)->IsHiddenNow());
@@ -1613,7 +1613,7 @@ void SwCntntFrm::MakeAll()
{
if( bMovedFwd )
pNotify->SetInvaKeep();
- bMovedFwd = FALSE;
+ bMovedFwd = sal_False;
}
}
}
@@ -1649,8 +1649,8 @@ void SwCntntFrm::MakeAll()
//Wenn ich nicht passe und nicht Spaltbar (WouldFit()) bin, so schicke
//ich meinem TxtFrmanteil die Nachricht, dass eben falls moeglich
//trotz des Attributes 'nicht aufspalten' aufgespalten werden muss.
- BOOL bMoveOrFit = FALSE;
- BOOL bDontMoveMe = !GetIndPrev();
+ sal_Bool bMoveOrFit = sal_False;
+ sal_Bool bDontMoveMe = !GetIndPrev();
if( bDontMoveMe && IsInSct() )
{
SwFtnBossFrm* pBoss = FindFtnBossFrm();
@@ -1659,10 +1659,10 @@ void SwCntntFrm::MakeAll()
}
// Finally, we are able to split table rows. Therefore, bDontMoveMe
- // can be set to FALSE:
+ // can be set to sal_False:
if( bDontMoveMe && IsInTab() &&
0 != const_cast<SwCntntFrm*>(this)->GetNextCellLeaf( MAKEPAGE_NONE ) )
- bDontMoveMe = FALSE;
+ bDontMoveMe = sal_False;
if ( bDontMoveMe && (Frm().*fnRect->fnGetHeight)() >
(GetUpper()->Prt().*fnRect->fnGetHeight)() )
@@ -1671,12 +1671,12 @@ void SwCntntFrm::MakeAll()
{
SwTwips nTmp = (GetUpper()->Prt().*fnRect->fnGetHeight)() -
(Prt().*fnRect->fnGetTop)();
- BOOL bSplit = !IsFwdMoveAllowed();
+ sal_Bool bSplit = !IsFwdMoveAllowed();
if ( nTmp > 0 && WouldFit( nTmp, bSplit, sal_False ) )
{
- Prepare( PREP_WIDOWS_ORPHANS, 0, FALSE );
- bValidSize = FALSE;
- bFitPromise = TRUE;
+ Prepare( PREP_WIDOWS_ORPHANS, 0, sal_False );
+ bValidSize = sal_False;
+ bFitPromise = sal_True;
continue;
}
/* -----------------19.02.99 12:58-------------------
@@ -1692,12 +1692,12 @@ void SwCntntFrm::MakeAll()
else if ( !bFtn && bMoveable &&
( !bFly || !FindFlyFrm()->IsColLocked() ) &&
( !bSct || !FindSctFrm()->IsColLocked() ) )
- bMoveOrFit = TRUE;
+ bMoveOrFit = sal_True;
}
#ifdef DBG_UTIL
else
{
- ASSERT( FALSE, "+TxtFrm hat WouldFit-Versprechen nicht eingehalten." );
+ ASSERT( sal_False, "+TxtFrm hat WouldFit-Versprechen nicht eingehalten." );
}
#endif
}
@@ -1716,13 +1716,13 @@ void SwCntntFrm::MakeAll()
pOldUp->GetUpper()->GetUpper()->IsSctFrm() &&
( pPre || pOldUp->GetUpper()->GetPrev() ) &&
((SwSectionFrm*)pOldUp->GetUpper()->GetUpper())->MoveAllowed(this) )
- bMovedFwd = FALSE;
+ bMovedFwd = sal_False;
const sal_Bool bCheckForGrownBody = pOldUp->IsBodyFrm();
const long nOldBodyHeight = (pOldUp->Frm().*fnRect->fnGetHeight)();
- if ( !bMovedFwd && !MoveFwd( bMakePage, FALSE ) )
- bMakePage = FALSE;
+ if ( !bMovedFwd && !MoveFwd( bMakePage, sal_False ) )
+ bMakePage = sal_False;
SWREFRESHFN( this )
// If MoveFwd moves the paragraph to the next page, a following
@@ -1733,19 +1733,19 @@ void SwCntntFrm::MakeAll()
// Therefore we only check for growing body frames.
if ( bCheckForGrownBody && ! bMovedBwd && pOldUp != GetUpper() &&
(pOldUp->Frm().*fnRect->fnGetHeight)() > nOldBodyHeight )
- bMovedFwd = FALSE;
+ bMovedFwd = sal_False;
else
- bMovedFwd = TRUE;
+ bMovedFwd = sal_True;
- bFormatted = FALSE;
+ bFormatted = sal_False;
if ( bMoveOrFit && GetUpper() == pOldUp )
{
// FME 2007-08-30 #i81146# new loop control
if ( nConsequetiveFormatsWithoutChange <= cnStopFormat )
{
- Prepare( PREP_MUST_FIT, 0, FALSE );
- bValidSize = FALSE;
- bMustFit = TRUE;
+ Prepare( PREP_MUST_FIT, 0, sal_False );
+ bValidSize = sal_False;
+ bMustFit = sal_True;
continue;
}
@@ -1794,7 +1794,7 @@ void SwCntntFrm::MakeAll()
pNotify->SetInvalidatePrevPrtArea();
}
delete pNotify;
- SetFlyLock( FALSE );
+ SetFlyLock( sal_False );
}
/*************************************************************************
@@ -1815,10 +1815,10 @@ void MakeNxt( SwFrm *pFrm, SwFrm *pNxt )
//Der erste Versuch, der Abbruch mit pFrm = 0 wenn !Valid,
//fuehrt leider zu dem Problem, dass das Keep dann u.U. nicht mehr
//korrekt beachtet wird (27417)
- const BOOL bOldPos = pFrm->GetValidPosFlag();
- const BOOL bOldSz = pFrm->GetValidSizeFlag();
- const BOOL bOldPrt = pFrm->GetValidPrtAreaFlag();
- pFrm->bValidPos = pFrm->bValidPrtArea = pFrm->bValidSize = TRUE;
+ const sal_Bool bOldPos = pFrm->GetValidPosFlag();
+ const sal_Bool bOldSz = pFrm->GetValidSizeFlag();
+ const sal_Bool bOldPrt = pFrm->GetValidPrtAreaFlag();
+ pFrm->bValidPos = pFrm->bValidPrtArea = pFrm->bValidSize = sal_True;
//fix(29272): Nicht MakeAll rufen, dort wird evtl. pFrm wieder invalidert
//und kommt rekursiv wieder herein.
@@ -1860,7 +1860,7 @@ void MakeNxt( SwFrm *pFrm, SwFrm *pNxt )
// Diese Routine ueberprueft, ob zwischen dem FtnBoss von pFrm und dem
// von pNxt keine anderen FtnBosse liegen
-BOOL lcl_IsNextFtnBoss( const SwFrm *pFrm, const SwFrm* pNxt )
+sal_Bool lcl_IsNextFtnBoss( const SwFrm *pFrm, const SwFrm* pNxt )
{
ASSERT( pFrm && pNxt, "lcl_IsNextFtnBoss: No Frames?" );
pFrm = pFrm->FindFtnBossFrm();
@@ -1876,9 +1876,9 @@ BOOL lcl_IsNextFtnBoss( const SwFrm *pFrm, const SwFrm* pNxt )
}
// --> OD 2007-11-26 #b6614158#
-BOOL SwCntntFrm::_WouldFit( SwTwips nSpace,
+sal_Bool SwCntntFrm::_WouldFit( SwTwips nSpace,
SwLayoutFrm *pNewUpper,
- BOOL bTstMove,
+ sal_Bool bTstMove,
const bool bObjsInNewUpper )
// <--
{
@@ -1890,12 +1890,12 @@ BOOL SwCntntFrm::_WouldFit( SwTwips nSpace,
if ( IsInFtn() )
{
if( !lcl_IsNextFtnBoss( pNewUpper, this ) )
- return TRUE;
+ return sal_True;
pFtnFrm = FindFtnFrm();
}
- BOOL bRet;
- BOOL bSplit = !pNewUpper->Lower();
+ sal_Bool bRet;
+ sal_Bool bSplit = !pNewUpper->Lower();
SwCntntFrm *pFrm = this;
const SwFrm *pTmpPrev = pNewUpper->Lower();
if( pTmpPrev && pTmpPrev->IsFtnFrm() )
@@ -1907,7 +1907,7 @@ BOOL SwCntntFrm::_WouldFit( SwTwips nSpace,
// --> FME 2005-03-31 #b6236853# #i46181#
SwTwips nSecondCheck = 0;
SwTwips nOldSpace = nSpace;
- BOOL bOldSplit = bSplit;
+ sal_Bool bOldSplit = bSplit;
// <--
if ( bTstMove || IsInFly() || ( IsInSct() &&
@@ -1940,7 +1940,7 @@ BOOL SwCntntFrm::_WouldFit( SwTwips nSpace,
)
)
{
- bTstMove = TRUE;
+ bTstMove = sal_True;
bRet = ((SwTxtFrm*)pFrm)->TestFormat( pTmpPrev, nSpace, bSplit );
}
else
@@ -2008,7 +2008,7 @@ BOOL SwCntntFrm::_WouldFit( SwTwips nSpace,
if ( nSpace < 0 )
{
- bRet = FALSE;
+ bRet = sal_False;
// --> FME 2005-03-31 #b6236853# #i46181#
if ( nSecondCheck > 0 )
@@ -2025,8 +2025,8 @@ BOOL SwCntntFrm::_WouldFit( SwTwips nSpace,
const bool bSecondRet = nOldSpace >= 0 && pFrm->WouldFit( nOldSpace, bOldSplit, sal_False );
if ( bSecondRet && bOldSplit && nOldSpace >= 0 )
{
- bRet = TRUE;
- bSplit = TRUE;
+ bRet = sal_True;
+ bSplit = sal_True;
}
}
// <--
@@ -2040,7 +2040,7 @@ BOOL SwCntntFrm::_WouldFit( SwTwips nSpace,
nSpace -= rAttrs.GetULSpace().GetLower();
if ( nSpace < 0 )
{
- bRet = FALSE;
+ bRet = sal_False;
}
}
@@ -2054,11 +2054,11 @@ BOOL SwCntntFrm::_WouldFit( SwTwips nSpace,
}
// OD 11.04.2003 #108824# - If last follow frame of <this> text
// frame isn't valid, a formatting of the next content frame
- // doesn't makes sense. Thus, return TRUE.
+ // doesn't makes sense. Thus, return sal_True.
if ( IsAnFollow( pFrm ) && !pFrm->IsValid() )
{
ASSERT( false, "Only a warning for task 108824:/n<SwCntntFrm::_WouldFit(..) - follow not valid!" );
- return TRUE;
+ return sal_True;
}
}
SwFrm *pNxt;
@@ -2073,7 +2073,7 @@ BOOL SwCntntFrm::_WouldFit( SwTwips nSpace,
if ( bTstMove &&
( pNxt->GetDrawObjs() || bObjsInNewUpper ) )
{
- return TRUE;
+ return sal_True;
}
// <--
diff --git a/sw/source/core/layout/colfrm.cxx b/sw/source/core/layout/colfrm.cxx
index 5382ef4c9f61..0e2aaa1c0081 100644
--- a/sw/source/core/layout/colfrm.cxx
+++ b/sw/source/core/layout/colfrm.cxx
@@ -48,7 +48,7 @@
#include "switerator.hxx"
// ftnfrm.cxx:
-void lcl_RemoveFtns( SwFtnBossFrm* pBoss, BOOL bPageOnly, BOOL bEndNotes );
+void lcl_RemoveFtns( SwFtnBossFrm* pBoss, sal_Bool bPageOnly, sal_Bool bEndNotes );
/*************************************************************************
@@ -90,20 +90,20 @@ SwColumnFrm::~SwColumnFrm()
|*
|*************************************************************************/
-void MA_FASTCALL lcl_RemoveColumns( SwLayoutFrm *pCont, USHORT nCnt )
+void MA_FASTCALL lcl_RemoveColumns( SwLayoutFrm *pCont, sal_uInt16 nCnt )
{
ASSERT( pCont && pCont->Lower() && pCont->Lower()->IsColumnFrm(),
"Keine Spalten zu entfernen." );
SwColumnFrm *pColumn = (SwColumnFrm*)pCont->Lower();
- ::lcl_RemoveFtns( pColumn, TRUE, TRUE );
+ ::lcl_RemoveFtns( pColumn, sal_True, sal_True );
while ( pColumn->GetNext() )
{
ASSERT( pColumn->GetNext()->IsColumnFrm(),
"Nachbar von ColFrm kein ColFrm." );
pColumn = (SwColumnFrm*)pColumn->GetNext();
}
- for ( USHORT i = 0; i < nCnt; ++i )
+ for ( sal_uInt16 i = 0; i < nCnt; ++i )
{
SwColumnFrm *pTmp = (SwColumnFrm*)pColumn->GetPrev();
pColumn->Cut();
@@ -112,7 +112,7 @@ void MA_FASTCALL lcl_RemoveColumns( SwLayoutFrm *pCont, USHORT nCnt )
}
}
-SwLayoutFrm * MA_FASTCALL lcl_FindColumns( SwLayoutFrm *pLay, USHORT nCount )
+SwLayoutFrm * MA_FASTCALL lcl_FindColumns( SwLayoutFrm *pLay, sal_uInt16 nCount )
{
SwFrm *pCol = pLay->Lower();
if ( pLay->IsPageFrm() )
@@ -121,7 +121,7 @@ SwLayoutFrm * MA_FASTCALL lcl_FindColumns( SwLayoutFrm *pLay, USHORT nCount )
if ( pCol && pCol->IsColumnFrm() )
{
SwFrm *pTmp = pCol;
- USHORT i;
+ sal_uInt16 i;
for ( i = 0; pTmp; pTmp = pTmp->GetNext(), ++i )
/* do nothing */;
return i == nCount ? (SwLayoutFrm*)pCol : 0;
@@ -130,10 +130,10 @@ SwLayoutFrm * MA_FASTCALL lcl_FindColumns( SwLayoutFrm *pLay, USHORT nCount )
}
-static BOOL lcl_AddColumns( SwLayoutFrm *pCont, USHORT nCount )
+static sal_Bool lcl_AddColumns( SwLayoutFrm *pCont, sal_uInt16 nCount )
{
SwDoc *pDoc = pCont->GetFmt()->GetDoc();
- const BOOL bMod = pDoc->IsModified();
+ const sal_Bool bMod = pDoc->IsModified();
//Format sollen soweit moeglich geshared werden. Wenn es also schon einen
//Nachbarn mit den selben Spalteneinstellungen gibt, so koennen die
@@ -147,7 +147,7 @@ static BOOL lcl_AddColumns( SwLayoutFrm *pCont, USHORT nCount )
SwIterator<SwLayoutFrm,SwFmt> aIter( *pAttrOwner->GetFmt() );
SwLayoutFrm *pNeighbour = aIter.First();
- USHORT nAdd = 0;
+ sal_uInt16 nAdd = 0;
SwFrm *pCol = pCont->Lower();
if ( pCol && pCol->IsColumnFrm() )
for ( nAdd = 1; pCol; pCol = pCol->GetNext(), ++nAdd )
@@ -161,19 +161,19 @@ static BOOL lcl_AddColumns( SwLayoutFrm *pCont, USHORT nCount )
pNeighbour = aIter.Next();
}
- BOOL bRet;
+ sal_Bool bRet;
SwTwips nMax = pCont->IsPageBodyFrm() ?
pCont->FindPageFrm()->GetMaxFtnHeight() : LONG_MAX;
if ( pNeighbourCol )
{
- bRet = FALSE;
+ bRet = sal_False;
SwFrm *pTmp = pCont->Lower();
while ( pTmp )
{
pTmp = pTmp->GetNext();
pNeighbourCol = (SwLayoutFrm*)pNeighbourCol->GetNext();
}
- for ( USHORT i = 0; i < nCount; ++i )
+ for ( sal_uInt16 i = 0; i < nCount; ++i )
{
SwColumnFrm *pTmpCol = new SwColumnFrm( pNeighbourCol->GetFmt(), pCont );
pTmpCol->SetMaxFtnHeight( nMax );
@@ -183,8 +183,8 @@ static BOOL lcl_AddColumns( SwLayoutFrm *pCont, USHORT nCount )
}
else
{
- bRet = TRUE;
- for ( USHORT i = 0; i < nCount; ++i )
+ bRet = sal_True;
+ for ( sal_uInt16 i = 0; i < nCount; ++i )
{
SwFrmFmt *pFmt = pDoc->MakeFrmFmt( aEmptyStr, pDoc->GetDfltFrmFmt());
SwColumnFrm *pTmp = new SwColumnFrm( pFmt, pCont );
@@ -207,7 +207,7 @@ static BOOL lcl_AddColumns( SwLayoutFrm *pCont, USHORT nCount )
* --------------------------------------------------*/
void SwLayoutFrm::ChgColumns( const SwFmtCol &rOld, const SwFmtCol &rNew,
- const BOOL bChgFtn )
+ const sal_Bool bChgFtn )
{
if ( rOld.GetNumCols() <= 1 && rNew.GetNumCols() <= 1 && !bChgFtn )
return;
@@ -220,7 +220,7 @@ void SwLayoutFrm::ChgColumns( const SwFmtCol &rOld, const SwFmtCol &rNew,
}
// <--
- USHORT nNewNum, nOldNum = 1;
+ sal_uInt16 nNewNum, nOldNum = 1;
if( Lower() && Lower()->IsColumnFrm() )
{
SwFrm* pCol = Lower();
@@ -230,14 +230,14 @@ void SwLayoutFrm::ChgColumns( const SwFmtCol &rOld, const SwFmtCol &rNew,
nNewNum = rNew.GetNumCols();
if( !nNewNum )
++nNewNum;
- BOOL bAtEnd;
+ sal_Bool bAtEnd;
if( IsSctFrm() )
bAtEnd = ((SwSectionFrm*)this)->IsAnyNoteAtEnd();
else
- bAtEnd = FALSE;
+ bAtEnd = sal_False;
//Einstellung der Spaltenbreiten ist nur bei neuen Formaten notwendig.
- BOOL bAdjustAttributes = nOldNum != rOld.GetNumCols();
+ sal_Bool bAdjustAttributes = nOldNum != rOld.GetNumCols();
//Wenn die Spaltenanzahl unterschiedlich ist, wird der Inhalt
//gesichert und restored.
@@ -249,7 +249,11 @@ void SwLayoutFrm::ChgColumns( const SwFmtCol &rOld, const SwFmtCol &rNew,
// SaveCntnt wuerde auch den Inhalt der Fussnotencontainer aufsaugen
// und im normalen Textfluss unterbringen.
if( IsPageBodyFrm() )
+<<<<<<< local
pDoc->GetCurrentLayout()->RemoveFtns( (SwPageFrm*)GetUpper(), TRUE, FALSE ); //swmod 080218
+=======
+ pDoc->GetRootFrm()->RemoveFtns( (SwPageFrm*)GetUpper(), sal_True, sal_False );
+>>>>>>> other
pSave = ::SaveCntnt( this );
//Wenn Spalten existieren, jetzt aber eine Spaltenanzahl von
@@ -277,11 +281,11 @@ void SwLayoutFrm::ChgColumns( const SwFmtCol &rOld, const SwFmtCol &rNew,
if ( nOldNum > nNewNum )
{
::lcl_RemoveColumns( this, nOldNum - nNewNum );
- bAdjustAttributes = TRUE;
+ bAdjustAttributes = sal_True;
}
else if( nOldNum < nNewNum )
{
- USHORT nAdd = nNewNum - nOldNum;
+ sal_uInt16 nAdd = nNewNum - nOldNum;
bAdjustAttributes = lcl_AddColumns( this, nAdd );
}
}
@@ -291,14 +295,14 @@ void SwLayoutFrm::ChgColumns( const SwFmtCol &rOld, const SwFmtCol &rNew,
if ( rOld.GetLineWidth() != rNew.GetLineWidth() ||
rOld.GetWishWidth() != rNew.GetWishWidth() ||
rOld.IsOrtho() != rNew.IsOrtho() )
- bAdjustAttributes = TRUE;
+ bAdjustAttributes = sal_True;
else
{
- USHORT nCount = Min( rNew.GetColumns().Count(), rOld.GetColumns().Count() );
- for ( USHORT i = 0; i < nCount; ++i )
+ sal_uInt16 nCount = Min( rNew.GetColumns().Count(), rOld.GetColumns().Count() );
+ for ( sal_uInt16 i = 0; i < nCount; ++i )
if ( !(*rOld.GetColumns()[i] == *rNew.GetColumns()[i]) )
{
- bAdjustAttributes = TRUE;
+ bAdjustAttributes = sal_True;
break;
}
}
@@ -328,7 +332,7 @@ void SwLayoutFrm::ChgColumns( const SwFmtCol &rOld, const SwFmtCol &rNew,
|*
|*************************************************************************/
-void SwLayoutFrm::AdjustColumns( const SwFmtCol *pAttr, BOOL bAdjustAttributes )
+void SwLayoutFrm::AdjustColumns( const SwFmtCol *pAttr, sal_Bool bAdjustAttributes )
{
if( !Lower()->GetNext() )
{
@@ -336,7 +340,7 @@ void SwLayoutFrm::AdjustColumns( const SwFmtCol *pAttr, BOOL bAdjustAttributes )
return;
}
- const BOOL bVert = IsVertical();
+ const sal_Bool bVert = IsVertical();
SwRectFn fnRect = bVert ? fnRectVert : fnRectHori;
//Ist ein Pointer da, oder sollen wir die Attribute einstellen,
@@ -361,26 +365,26 @@ void SwLayoutFrm::AdjustColumns( const SwFmtCol *pAttr, BOOL bAdjustAttributes )
//Die Breiten werden mitgezaehlt, damit wir dem letzten den Rest geben
//koennen.
SwTwips nAvail = (Prt().*fnRect->fnGetWidth)();
- const BOOL bLine = pAttr->GetLineAdj() != COLADJ_NONE;
- const USHORT nMin = bLine ? USHORT( 20 + ( pAttr->GetLineWidth() / 2) ) : 0;
+ const sal_Bool bLine = pAttr->GetLineAdj() != COLADJ_NONE;
+ const sal_uInt16 nMin = bLine ? sal_uInt16( 20 + ( pAttr->GetLineWidth() / 2) ) : 0;
- const BOOL bR2L = IsRightToLeft();
+ const sal_Bool bR2L = IsRightToLeft();
SwFrm *pCol = bR2L ? GetLastLower() : Lower();
// --> FME 2004-07-16 #i27399#
// bOrtho means we have to adjust the column frames manually. Otherwise
// we may use the values returned by CalcColWidth:
- const BOOL bOrtho = pAttr->IsOrtho() && pAttr->GetNumCols() > 0;
+ const sal_Bool bOrtho = pAttr->IsOrtho() && pAttr->GetNumCols() > 0;
long nGutter = 0;
// <--
- for ( USHORT i = 0; i < pAttr->GetNumCols(); ++i )
+ for ( sal_uInt16 i = 0; i < pAttr->GetNumCols(); ++i )
{
if( !bOrtho )
{
const SwTwips nWidth = i == (pAttr->GetNumCols() - 1) ?
nAvail :
- pAttr->CalcColWidth( i, USHORT( (Prt().*fnRect->fnGetWidth)() ) );
+ pAttr->CalcColWidth( i, sal_uInt16( (Prt().*fnRect->fnGetWidth)() ) );
const Size aColSz = bVert ?
Size( Prt().Width(), nWidth ) :
@@ -408,8 +412,8 @@ void SwLayoutFrm::AdjustColumns( const SwFmtCol *pAttr, BOOL bAdjustAttributes )
//Beruecksichtigung finden. Ueberall wo zwei Spalten aufeinanderstossen
//wird jeweils rechts bzw. links ein Sicherheitsabstand von 20 plus
//der halben Penbreite einkalkuliert.
- const USHORT nLeft = pC->GetLeft();
- const USHORT nRight = pC->GetRight();
+ const sal_uInt16 nLeft = pC->GetLeft();
+ const sal_uInt16 nRight = pC->GetRight();
aLR.SetLeft ( nLeft );
aLR.SetRight( nRight );
@@ -451,7 +455,7 @@ void SwLayoutFrm::AdjustColumns( const SwFmtCol *pAttr, BOOL bAdjustAttributes )
{
long nInnerWidth = ( nAvail - nGutter ) / pAttr->GetNumCols();
pCol = Lower();
- for( USHORT i = 0; i < pAttr->GetNumCols(); pCol = pCol->GetNext(), ++i )
+ for( sal_uInt16 i = 0; i < pAttr->GetNumCols(); pCol = pCol->GetNext(), ++i )
{
SwTwips nWidth;
if ( i == pAttr->GetNumCols() - 1 )
diff --git a/sw/source/core/layout/dbg_lay.cxx b/sw/source/core/layout/dbg_lay.cxx
index 901050414774..82bce24fc8ee 100644
--- a/sw/source/core/layout/dbg_lay.cxx
+++ b/sw/source/core/layout/dbg_lay.cxx
@@ -133,13 +133,13 @@
// OD 2004-05-24 #i28701#
#include <sortedobjs.hxx>
-ULONG SwProtocol::nRecord = 0;
+sal_uLong SwProtocol::nRecord = 0;
SwImplProtocol* SwProtocol::pImpl = NULL;
-ULONG lcl_GetFrameId( const SwFrm* pFrm )
+sal_uLong lcl_GetFrameId( const SwFrm* pFrm )
{
#ifdef DBG_UTIL
- static BOOL bFrameId = FALSE;
+ static sal_Bool bFrameId = sal_False;
if( bFrameId )
return pFrm->GetFrmId();
#endif
@@ -154,28 +154,28 @@ class SwImplProtocol
SvUShortsSort *pFrmIds; // welche FrmIds sollen aufgezeichnet werden ( NULL == alle )
SvLongs *pVar; // Variables
ByteString aLayer; // Einrueckung der Ausgabe (" " pro Start/End)
- USHORT nTypes; // welche Typen sollen aufgezeichnet werden
- USHORT nLineCount; // Ausgegebene Zeilen
- USHORT nMaxLines; // Maximal auszugebende Zeilen
- BYTE nInitFile; // Bereich (FrmId,FrmType,Record) beim Einlesen der INI-Datei
- BYTE nTestMode; // Special fuer Testformatierung, es wird ggf. nur
+ sal_uInt16 nTypes; // welche Typen sollen aufgezeichnet werden
+ sal_uInt16 nLineCount; // Ausgegebene Zeilen
+ sal_uInt16 nMaxLines; // Maximal auszugebende Zeilen
+ sal_uInt8 nInitFile; // Bereich (FrmId,FrmType,Record) beim Einlesen der INI-Datei
+ sal_uInt8 nTestMode; // Special fuer Testformatierung, es wird ggf. nur
// innerhalb einer Testformatierung aufgezeichnet.
- void _Record( const SwFrm* pFrm, ULONG nFunction, ULONG nAct, void* pParam );
- BOOL NewStream();
+ void _Record( const SwFrm* pFrm, sal_uLong nFunction, sal_uLong nAct, void* pParam );
+ sal_Bool NewStream();
void CheckLine( ByteString& rLine );
- void SectFunc( ByteString &rOut, const SwFrm* pFrm, ULONG nAct, void* pParam );
+ void SectFunc( ByteString &rOut, const SwFrm* pFrm, sal_uLong nAct, void* pParam );
public:
SwImplProtocol();
~SwImplProtocol();
// Aufzeichnen
- void Record( const SwFrm* pFrm, ULONG nFunction, ULONG nAct, void* pParam )
+ void Record( const SwFrm* pFrm, sal_uLong nFunction, sal_uLong nAct, void* pParam )
{ if( pStream ) _Record( pFrm, nFunction, nAct, pParam ); }
- BOOL InsertFrm( USHORT nFrmId ); // FrmId aufnehmen zum Aufzeichnen
- BOOL DeleteFrm( USHORT nFrmId ); // FrmId entfernen, diesen nicht mehr Aufzeichnen
+ sal_Bool InsertFrm( sal_uInt16 nFrmId ); // FrmId aufnehmen zum Aufzeichnen
+ sal_Bool DeleteFrm( sal_uInt16 nFrmId ); // FrmId entfernen, diesen nicht mehr Aufzeichnen
void FileInit(); // Auslesen der INI-Datei
void ChkStream() { if( !pStream ) NewStream(); }
- void SnapShot( const SwFrm* pFrm, ULONG nFlags );
- void GetVar( const USHORT nNo, long& rVar )
+ void SnapShot( const SwFrm* pFrm, sal_uLong nFlags );
+ void GetVar( const sal_uInt16 nNo, long& rVar )
{ if( pVar && nNo < pVar->Count() ) rVar = (*pVar)[ nNo ]; }
};
@@ -198,10 +198,10 @@ class SwImplEnterLeave
{
protected:
const SwFrm* pFrm; // Der Frame,
- ULONG nFunction, nAction; // die Funktion, ggf. die Aktion
+ sal_uLong nFunction, nAction; // die Funktion, ggf. die Aktion
void* pParam; // und weitere Parameter
public:
- SwImplEnterLeave( const SwFrm* pF, ULONG nFunct, ULONG nAct, void* pPar )
+ SwImplEnterLeave( const SwFrm* pF, sal_uLong nFunct, sal_uLong nAct, void* pPar )
: pFrm( pF ), nFunction( nFunct ), nAction( nAct ), pParam( pPar ) {}
virtual void Enter(); // Ausgabe beim Eintritt
virtual void Leave(); // Ausgabe beim Verlassen
@@ -211,16 +211,16 @@ class SwSizeEnterLeave : public SwImplEnterLeave
{
long nFrmHeight;
public:
- SwSizeEnterLeave( const SwFrm* pF, ULONG nFunct, ULONG nAct, void* pPar )
+ SwSizeEnterLeave( const SwFrm* pF, sal_uLong nFunct, sal_uLong nAct, void* pPar )
: SwImplEnterLeave( pF, nFunct, nAct, pPar ), nFrmHeight( pF->Frm().Height() ) {}
virtual void Leave(); // Ausgabe der Groessenaenderung
};
class SwUpperEnterLeave : public SwImplEnterLeave
{
- USHORT nFrmId;
+ sal_uInt16 nFrmId;
public:
- SwUpperEnterLeave( const SwFrm* pF, ULONG nFunct, ULONG nAct, void* pPar )
+ SwUpperEnterLeave( const SwFrm* pF, sal_uLong nFunct, sal_uLong nAct, void* pPar )
: SwImplEnterLeave( pF, nFunct, nAct, pPar ), nFrmId( 0 ) {}
virtual void Enter(); // Ausgabe
virtual void Leave(); // Ausgabe der FrmId des Uppers
@@ -230,17 +230,17 @@ class SwFrmChangesLeave : public SwImplEnterLeave
{
SwRect aFrm;
public:
- SwFrmChangesLeave( const SwFrm* pF, ULONG nFunct, ULONG nAct, void* pPar )
+ SwFrmChangesLeave( const SwFrm* pF, sal_uLong nFunct, sal_uLong nAct, void* pPar )
: SwImplEnterLeave( pF, nFunct, nAct, pPar ), aFrm( pF->Frm() ) {}
virtual void Enter(); // keine Ausgabe
virtual void Leave(); // Ausgabe bei Aenderung der Frm-Area
};
-void SwProtocol::Record( const SwFrm* pFrm, ULONG nFunction, ULONG nAct, void* pParam )
+void SwProtocol::Record( const SwFrm* pFrm, sal_uLong nFunction, sal_uLong nAct, void* pParam )
{
if( Start() )
{ // Hier landen wir, wenn im Debugger SwProtocol::nRecord mit PROT_INIT(0x1) oderiert wurde
- BOOL bFinit = FALSE; // Dies bietet im Debugger die Moeglichkeit,
+ sal_Bool bFinit = sal_False; // Dies bietet im Debugger die Moeglichkeit,
if( bFinit ) // die Aufzeichnung dieser Action zu beenden
{
nRecord &= ~nFunction; // Diese Funktion nicht mehr aufzeichnen
@@ -289,13 +289,13 @@ void SwProtocol::Stop()
// Creates a more or less detailed snapshot of the layout structur
-void SwProtocol::SnapShot( const SwFrm* pFrm, ULONG nFlags )
+void SwProtocol::SnapShot( const SwFrm* pFrm, sal_uLong nFlags )
{
if( pImpl )
pImpl->SnapShot( pFrm, nFlags );
}
-void SwProtocol::GetVar( const USHORT nNo, long& rVar )
+void SwProtocol::GetVar( const sal_uInt16 nNo, long& rVar )
{
if( pImpl )
pImpl->GetVar( nNo, rVar );
@@ -308,7 +308,7 @@ SwImplProtocol::SwImplProtocol()
NewStream();
}
-BOOL SwImplProtocol::NewStream()
+sal_Bool SwImplProtocol::NewStream()
{
XubString aName( "dbg_lay.out", RTL_TEXTENCODING_MS_1252 );
nLineCount = 0;
@@ -382,26 +382,26 @@ void SwImplProtocol::CheckLine( ByteString& rLine )
nInitFile = 0; // Nanu: Unbekannter Bereich?
rLine.Erase( 0, aTmp.Len() + 1 );
}
- USHORT nToks = rLine.GetTokenCount( ' ' ); // Blanks (oder Tabs) sind die Trenner
- for( USHORT i=0; i < nToks; ++i )
+ sal_uInt16 nToks = rLine.GetTokenCount( ' ' ); // Blanks (oder Tabs) sind die Trenner
+ for( sal_uInt16 i=0; i < nToks; ++i )
{
ByteString aTok = rLine.GetToken( i, ' ' );
- BOOL bNo = FALSE;
+ sal_Bool bNo = sal_False;
if( '!' == aTok.GetChar(0) )
{
- bNo = TRUE; // Diese(n) Funktion/Typ entfernen
+ bNo = sal_True; // Diese(n) Funktion/Typ entfernen
aTok.Erase( 0, 1 );
}
if( aTok.Len() )
{
- ULONG nVal;
+ sal_uLong nVal;
sscanf( aTok.GetBuffer(), "%li", &nVal );
switch ( nInitFile )
{
- case 1: InsertFrm( USHORT( nVal ) ); // FrmId aufnehmen
+ case 1: InsertFrm( sal_uInt16( nVal ) ); // FrmId aufnehmen
break;
case 2: {
- USHORT nNew = (USHORT)nVal;
+ sal_uInt16 nNew = (sal_uInt16)nVal;
if( bNo )
nTypes &= ~nNew; // Typ entfernen
else
@@ -409,7 +409,7 @@ void SwImplProtocol::CheckLine( ByteString& rLine )
}
break;
case 3: {
- ULONG nOld = SwProtocol::Record();
+ sal_uLong nOld = SwProtocol::Record();
if( bNo )
nOld &= ~nVal; // Funktion entfernen
else
@@ -418,14 +418,14 @@ void SwImplProtocol::CheckLine( ByteString& rLine )
}
break;
case 4: {
- BYTE nNew = (BYTE)nVal;
+ sal_uInt8 nNew = (sal_uInt8)nVal;
if( bNo )
nTestMode &= ~nNew; // TestMode zuruecksetzen
else
nTestMode |= nNew; // TestMode setzen
}
break;
- case 5: nMaxLines = (USHORT)nVal;
+ case 5: nMaxLines = (sal_uInt16)nVal;
break;
case 6: pVar->Insert( (long)nVal, pVar->Count() );
break;
@@ -471,7 +471,7 @@ void SwImplProtocol::FileInit()
* lcl_Start sorgt fuer Einrueckung um zwei Blanks bei ACT_START
* und nimmt diese bei ACT_END wieder zurueck.
* --------------------------------------------------*/
-void lcl_Start( ByteString& rOut, ByteString& rLay, ULONG nAction )
+void lcl_Start( ByteString& rOut, ByteString& rLay, sal_uLong nAction )
{
if( nAction == ACT_START )
{
@@ -560,12 +560,12 @@ void lcl_FrameType( ByteString& rOut, const SwFrm* pFrm )
* ob die FrmId und der FrameType zu den aufzuzeichnenden gehoeren.
* --------------------------------------------------*/
-void SwImplProtocol::_Record( const SwFrm* pFrm, ULONG nFunction, ULONG nAct, void* pParam )
+void SwImplProtocol::_Record( const SwFrm* pFrm, sal_uLong nFunction, sal_uLong nAct, void* pParam )
{
- USHORT nSpecial = 0;
+ sal_uInt16 nSpecial = 0;
if( nSpecial ) // Debugger-Manipulationsmoeglichkeit
{
- USHORT nId = USHORT(lcl_GetFrameId( pFrm ));
+ sal_uInt16 nId = sal_uInt16(lcl_GetFrameId( pFrm ));
switch ( nSpecial )
{
case 1: InsertFrm( nId ); break;
@@ -578,7 +578,7 @@ void SwImplProtocol::_Record( const SwFrm* pFrm, ULONG nFunction, ULONG nAct, vo
if( !pStream && !NewStream() )
return; // Immer noch kein Stream
- if( pFrmIds && !pFrmIds->Seek_Entry( USHORT(lcl_GetFrameId( pFrm )) ) )
+ if( pFrmIds && !pFrmIds->Seek_Entry( sal_uInt16(lcl_GetFrameId( pFrm )) ) )
return; // gehoert nicht zu den gewuenschten FrmIds
if( !(pFrm->GetType() & nTypes) )
@@ -586,7 +586,7 @@ void SwImplProtocol::_Record( const SwFrm* pFrm, ULONG nFunction, ULONG nAct, vo
if( 1 == nTestMode && nFunction != PROT_TESTFORMAT )
return; // Wir sollen nur innerhalb einer Testformatierung aufzeichnen
- BOOL bTmp = FALSE;
+ sal_Bool bTmp = sal_False;
ByteString aOut = aLayer;
aOut += ByteString::CreateFromInt64( lcl_GetFrameId( pFrm ) );
aOut += ' ';
@@ -600,13 +600,13 @@ void SwImplProtocol::_Record( const SwFrm* pFrm, ULONG nFunction, ULONG nAct, vo
if( nAct == ACT_START )
lcl_Flags( aOut, pFrm );
break;
- case PROT_MOVE_FWD: bTmp = TRUE; // NoBreak
+ case PROT_MOVE_FWD: bTmp = sal_True; // NoBreak
case PROT_MOVE_BWD: aOut += ( nFunction == bTmp ) ? "Fwd" : "Bwd";
lcl_Start( aOut, aLayer, nAct );
if( pParam )
{
aOut += ' ';
- aOut += ByteString::CreateFromInt32( *((USHORT*)pParam) );
+ aOut += ByteString::CreateFromInt32( *((sal_uInt16*)pParam) );
}
break;
case PROT_GROW_TST: if( ACT_START != nAct )
@@ -618,7 +618,7 @@ void SwImplProtocol::_Record( const SwFrm* pFrm, ULONG nFunction, ULONG nAct, vo
aOut += "TestShrink";
break;
case PROT_ADJUSTN :
- case PROT_SHRINK: bTmp = TRUE; // NoBreak
+ case PROT_SHRINK: bTmp = sal_True; // NoBreak
case PROT_GROW: aOut += !bTmp ? "Grow" :
( nFunction == PROT_SHRINK ? "Shrink" : "AdjustNgbhd" );
lcl_Start( aOut, aLayer, nAct );
@@ -651,7 +651,7 @@ void SwImplProtocol::_Record( const SwFrm* pFrm, ULONG nFunction, ULONG nAct, vo
break;
case PROT_SECTION: SectFunc( aOut, pFrm, nAct, pParam );
break;
- case PROT_CUT: bTmp = TRUE; // NoBreak
+ case PROT_CUT: bTmp = sal_True; // NoBreak
case PROT_PASTE: aOut += bTmp ? "Cut from " : "Paste to ";
aOut += ByteString::CreateFromInt64( lcl_GetFrameId( (SwFrm*)pParam ) );
break;
@@ -707,20 +707,20 @@ void SwImplProtocol::_Record( const SwFrm* pFrm, ULONG nFunction, ULONG nAct, vo
* hier werden die Ausgaben rund um SectionFrms abgehandelt.
* --------------------------------------------------*/
-void SwImplProtocol::SectFunc( ByteString &rOut, const SwFrm* , ULONG nAct, void* pParam )
+void SwImplProtocol::SectFunc( ByteString &rOut, const SwFrm* , sal_uLong nAct, void* pParam )
{
- BOOL bTmp = FALSE;
+ sal_Bool bTmp = sal_False;
switch( nAct )
{
case ACT_MERGE: rOut += "Merge Section ";
rOut += ByteString::CreateFromInt64( lcl_GetFrameId( (SwFrm*)pParam ) );
break;
- case ACT_CREATE_MASTER: bTmp = TRUE; // NoBreak
+ case ACT_CREATE_MASTER: bTmp = sal_True; // NoBreak
case ACT_CREATE_FOLLOW: rOut += "Create Section ";
rOut += bTmp ? "Master to " : "Follow from ";
rOut += ByteString::CreateFromInt64( lcl_GetFrameId( (SwFrm*)pParam ) );
break;
- case ACT_DEL_MASTER: bTmp = TRUE; // NoBreak
+ case ACT_DEL_MASTER: bTmp = sal_True; // NoBreak
case ACT_DEL_FOLLOW: rOut += "Delete Section ";
rOut += bTmp ? "Master to " : "Follow from ";
rOut += ByteString::CreateFromInt64( lcl_GetFrameId( (SwFrm*)pParam ) );
@@ -734,34 +734,34 @@ void SwImplProtocol::SectFunc( ByteString &rOut, const SwFrm* , ULONG nAct, void
* pFrmIds angelegt wird, werden nur noch die enthaltenen FrmIds aufgezeichnet.
* --------------------------------------------------*/
-BOOL SwImplProtocol::InsertFrm( USHORT nId )
+sal_Bool SwImplProtocol::InsertFrm( sal_uInt16 nId )
{
if( !pFrmIds )
pFrmIds = new SvUShortsSort(5,5);
if( pFrmIds->Seek_Entry( nId ) )
- return FALSE;
+ return sal_False;
pFrmIds->Insert( nId );
- return TRUE;
+ return sal_True;
}
/* -----------------11.01.99 11:52-------------------
* SwImplProtocol::DeleteFrm(..) entfernt eine FrmId aus dem pFrmIds-Array,
* so dass diese Frame nicht mehr aufgezeichnet wird.
* --------------------------------------------------*/
-BOOL SwImplProtocol::DeleteFrm( USHORT nId )
+sal_Bool SwImplProtocol::DeleteFrm( sal_uInt16 nId )
{
- USHORT nPos;
+ sal_uInt16 nPos;
if( !pFrmIds || !pFrmIds->Seek_Entry( nId, &nPos ) )
- return FALSE;
+ return sal_False;
pFrmIds->Remove( nPos );
- return TRUE;
+ return sal_True;
}
/*-----------------20.9.2001 10:29------------------
* SwProtocol::SnapShot(..)
* creates a snapshot of the given frame and its content.
* --------------------------------------------------*/
-void SwImplProtocol::SnapShot( const SwFrm* pFrm, ULONG nFlags )
+void SwImplProtocol::SnapShot( const SwFrm* pFrm, sal_uLong nFlags )
{
while( pFrm )
{
@@ -770,7 +770,7 @@ void SwImplProtocol::SnapShot( const SwFrm* pFrm, ULONG nFlags )
{
aLayer += "[ ";
const SwSortedObjs &rObjs = *pFrm->GetDrawObjs();
- for ( USHORT i = 0; i < rObjs.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i )
{
SwAnchoredObject* pObj = rObjs[i];
if ( pObj->ISA(SwFlyFrm) )
@@ -797,7 +797,7 @@ void SwImplProtocol::SnapShot( const SwFrm* pFrm, ULONG nFlags )
* Die Aufgabe ist es abhaengig von der Funktion das richtige SwImplEnterLeave-Objekt
* zu erzeugen, alles weitere geschieht dann in dessen Ctor/Dtor.
* --------------------------------------------------*/
-void SwEnterLeave::Ctor( const SwFrm* pFrm, ULONG nFunc, ULONG nAct, void* pPar )
+void SwEnterLeave::Ctor( const SwFrm* pFrm, sal_uLong nFunc, sal_uLong nAct, void* pPar )
{
switch( nFunc )
{
@@ -845,13 +845,13 @@ void SwSizeEnterLeave::Leave()
void SwUpperEnterLeave::Enter()
{
- nFrmId = pFrm->GetUpper() ? USHORT(lcl_GetFrameId( pFrm->GetUpper() )) : 0;
+ nFrmId = pFrm->GetUpper() ? sal_uInt16(lcl_GetFrameId( pFrm->GetUpper() )) : 0;
SwProtocol::Record( pFrm, nFunction, ACT_START, &nFrmId );
}
void SwUpperEnterLeave::Leave()
{
- nFrmId = pFrm->GetUpper() ? USHORT(lcl_GetFrameId( pFrm->GetUpper() )) : 0;
+ nFrmId = pFrm->GetUpper() ? sal_uInt16(lcl_GetFrameId( pFrm->GetUpper() )) : 0;
SwProtocol::Record( pFrm, nFunction, ACT_END, &nFrmId );
}
diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx
index 52ca109c4e91..0af84edd0691 100644
--- a/sw/source/core/layout/findfrm.cxx
+++ b/sw/source/core/layout/findfrm.cxx
@@ -238,19 +238,19 @@ SwFrm* SwFrm::GetLower()
|* Letzte Aenderung MA 18. Mar. 93
|*
|*************************************************************************/
-BOOL SwLayoutFrm::IsAnLower( const SwFrm *pAssumed ) const
+sal_Bool SwLayoutFrm::IsAnLower( const SwFrm *pAssumed ) const
{
const SwFrm *pUp = pAssumed;
while ( pUp )
{
if ( pUp == this )
- return TRUE;
+ return sal_True;
if ( pUp->IsFlyFrm() )
pUp = ((SwFlyFrm*)pUp)->GetAnchorFrm();
else
pUp = pUp->GetUpper();
}
- return FALSE;
+ return sal_False;
}
/** method to check relative position of layout frame to
@@ -422,10 +422,10 @@ const SwCntntFrm* SwCntntFrm::ImplGetNextCntntFrm( bool bFwd ) const
const SwFrm *pFrm = this;
// #100926#
SwCntntFrm *pCntntFrm = 0;
- BOOL bGoingUp = FALSE;
+ sal_Bool bGoingUp = sal_False;
do {
const SwFrm *p = 0;
- BOOL bGoingFwdOrBwd = FALSE, bGoingDown = FALSE;
+ sal_Bool bGoingFwdOrBwd = sal_False, bGoingDown = sal_False;
bGoingDown = ( !bGoingUp && ( 0 != ( p = lcl_GetLower( pFrm, true ) ) ) );
if ( !bGoingDown )
@@ -489,7 +489,7 @@ SwPageFrm* SwFrm::FindPageFrm()
return (SwPageFrm*)pRet;
}
-SwFtnBossFrm* SwFrm::FindFtnBossFrm( BOOL bFootnotes )
+SwFtnBossFrm* SwFrm::FindFtnBossFrm( sal_Bool bFootnotes )
{
SwFrm *pRet = this;
// Innerhalb einer Tabelle gibt es keine Fussnotenbosse, auch spaltige
@@ -517,7 +517,7 @@ SwFtnBossFrm* SwFrm::FindFtnBossFrm( BOOL bFootnotes )
SwSectionFrm* pSct = pRet->FindSctFrm();
ASSERT( pSct, "FindFtnBossFrm: Single column outside section?" );
if( !pSct->IsFtnAtEnd() )
- return pSct->FindFtnBossFrm( TRUE );
+ return pSct->FindFtnBossFrm( sal_True );
}
return (SwFtnBossFrm*)pRet;
}
@@ -628,7 +628,7 @@ const SwPageFrm* SwRootFrm::GetPageAtPos( const Point& rPt, const Size* pSize, b
}
ASSERT( GetPageNum() <= maPageRects.size(), "number of pages differes from page rect array size" )
- USHORT nPageIdx = 0;
+ sal_uInt16 nPageIdx = 0;
while ( pPage && !pRet )
{
@@ -690,12 +690,12 @@ const SwAttrSet* SwFrm::GetAttrSet() const
SwFrm* lcl_NextFrm( SwFrm* pFrm )
{
SwFrm *pRet = 0;
- BOOL bGoingUp = FALSE;
+ sal_Bool bGoingUp = sal_False;
do {
SwFrm *p = 0;
- BOOL bGoingFwd = FALSE;
- BOOL bGoingDown = (!bGoingUp && ( 0 != (p = pFrm->IsLayoutFrm() ? ((SwLayoutFrm*)pFrm)->Lower() : 0)));
+ sal_Bool bGoingFwd = sal_False;
+ sal_Bool bGoingDown = (!bGoingUp && ( 0 != (p = pFrm->IsLayoutFrm() ? ((SwLayoutFrm*)pFrm)->Lower() : 0)));
if( !bGoingDown )
{
@@ -718,7 +718,7 @@ SwFrm* lcl_NextFrm( SwFrm* pFrm )
SwFrm *SwFrm::_FindNext()
{
- BOOL bIgnoreTab = FALSE;
+ sal_Bool bIgnoreTab = sal_False;
SwFrm *pThis = this;
if ( IsTabFrm() )
@@ -732,7 +732,7 @@ SwFrm *SwFrm::_FindNext()
pThis = ((SwTabFrm*)this)->FindLastCntnt();
if ( !pThis )
pThis = this;
- bIgnoreTab = TRUE;
+ bIgnoreTab = sal_True;
}
else if ( IsSctFrm() )
{
@@ -761,7 +761,7 @@ SwFrm *SwFrm::_FindNext()
return NULL;
SwFrm* pRet = NULL;
- const BOOL bFtn = pThis->IsInFtn();
+ const sal_Bool bFtn = pThis->IsInFtn();
if ( !bIgnoreTab && pThis->IsInTab() )
{
SwLayoutFrm *pUp = pThis->GetUpper();
@@ -782,7 +782,7 @@ SwFrm *SwFrm::_FindNext()
}
else
{
- const BOOL bBody = pThis->IsInDocBody();
+ const sal_Bool bBody = pThis->IsInDocBody();
SwFrm *pNxtCnt = lcl_NextFrm( pThis );
if ( pNxtCnt )
{
@@ -881,8 +881,8 @@ SwCntntFrm *SwFrm::_FindNextCnt( const bool _bInSameFtn )
if ( pThis->IsCntntFrm() )
{
- const BOOL bBody = pThis->IsInDocBody();
- const BOOL bFtn = pThis->IsInFtn();
+ const sal_Bool bBody = pThis->IsInDocBody();
+ const sal_Bool bFtn = pThis->IsInFtn();
SwCntntFrm *pNxtCnt = ((SwCntntFrm*)pThis)->GetNextCntntFrm();
if ( pNxtCnt )
{
@@ -1106,7 +1106,7 @@ SwCntntFrm* SwFrm::_FindPrevCnt( const bool _bInSameFtn )
SwFrm *SwFrm::_FindPrev()
{
- BOOL bIgnoreTab = FALSE;
+ sal_Bool bIgnoreTab = sal_False;
SwFrm *pThis = this;
if ( IsTabFrm() )
@@ -1118,7 +1118,7 @@ SwFrm *SwFrm::_FindPrev()
return ((SwTabFrm*)this)->FindMaster();
else
pThis = ((SwTabFrm*)this)->ContainsCntnt();
- bIgnoreTab = TRUE;
+ bIgnoreTab = sal_True;
}
if ( pThis && pThis->IsCntntFrm() )
@@ -1138,8 +1138,8 @@ SwFrm *SwFrm::_FindPrev()
else
{
SwFrm* pRet;
- const BOOL bBody = pThis->IsInDocBody();
- const BOOL bFtn = bBody ? FALSE : pThis->IsInFtn();
+ const sal_Bool bBody = pThis->IsInDocBody();
+ const sal_Bool bFtn = bBody ? sal_False : pThis->IsInFtn();
if ( bBody || bFtn )
{
while ( pPrvCnt )
@@ -1181,7 +1181,7 @@ SwFrm *SwFrm::_FindPrev()
return 0;
}
-void SwFrm::ImplInvalidateNextPos( BOOL bNoFtn )
+void SwFrm::ImplInvalidateNextPos( sal_Bool bNoFtn )
{
SwFrm *pFrm;
if ( 0 != (pFrm = _FindNext()) )
@@ -1279,25 +1279,25 @@ void SwFrm::InvalidateNextPrtArea()
/*************************************************************************
|*
|* lcl_IsInColSect()
-|* liefert nur TRUE, wenn der Frame _direkt_ in einem spaltigen Bereich steht,
+|* liefert nur sal_True, wenn der Frame _direkt_ in einem spaltigen Bereich steht,
|* nicht etwa, wenn er in einer Tabelle steht, die in einem spaltigen Bereich ist.
|*
|*************************************************************************/
-BOOL lcl_IsInColSct( const SwFrm *pUp )
+sal_Bool lcl_IsInColSct( const SwFrm *pUp )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
while( pUp )
{
if( pUp->IsColumnFrm() )
- bRet = TRUE;
+ bRet = sal_True;
else if( pUp->IsSctFrm() )
return bRet;
else if( pUp->IsTabFrm() )
- return FALSE;
+ return sal_False;
pUp = pUp->GetUpper();
}
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -1311,7 +1311,7 @@ BOOL lcl_IsInColSct( const SwFrm *pUp )
/** determine, if frame is moveable in given environment
OD 08.08.2003 #110978#
- method replaced 'old' method <BOOL IsMoveable() const>.
+ method replaced 'old' method <sal_Bool IsMoveable() const>.
Determines, if frame is moveable in given environment. if no environment
is given (parameter _pLayoutFrm == 0L), the movability in the actual
environment (<this->GetUpper()) is checked.
@@ -1394,26 +1394,26 @@ void SwFrm::SetInfFlags()
if ( !IsFlyFrm() && !GetUpper() ) //noch nicht gepastet, keine Informationen
return; //lieferbar
- bInfInvalid = bInfBody = bInfTab = bInfFly = bInfFtn = bInfSct = FALSE;
+ bInfInvalid = bInfBody = bInfTab = bInfFly = bInfFtn = bInfSct = sal_False;
SwFrm *pFrm = this;
if( IsFtnContFrm() )
- bInfFtn = TRUE;
+ bInfFtn = sal_True;
do
{ // bInfBody wird nur am Seitenbody, nicht im ColumnBody gesetzt
if ( pFrm->IsBodyFrm() && !bInfFtn && pFrm->GetUpper()
&& pFrm->GetUpper()->IsPageFrm() )
- bInfBody = TRUE;
+ bInfBody = sal_True;
else if ( pFrm->IsTabFrm() || pFrm->IsCellFrm() )
{
- bInfTab = TRUE;
+ bInfTab = sal_True;
}
else if ( pFrm->IsFlyFrm() )
- bInfFly = TRUE;
+ bInfFly = sal_True;
else if ( pFrm->IsSctFrm() )
- bInfSct = TRUE;
+ bInfSct = sal_True;
else if ( pFrm->IsFtnFrm() )
- bInfFtn = TRUE;
+ bInfFtn = sal_True;
pFrm = pFrm->GetUpper();
@@ -1421,13 +1421,13 @@ void SwFrm::SetInfFlags()
}
/*-----------------22.8.2001 14:30------------------
- * SwFrm::SetDirFlags( BOOL )
+ * SwFrm::SetDirFlags( sal_Bool )
* actualizes the vertical or the righttoleft-flags.
* If the property is derived, it's from the upper or (for fly frames) from
* the anchor. Otherwise we've to call a virtual method to check the property.
* --------------------------------------------------*/
-void SwFrm::SetDirFlags( BOOL bVert )
+void SwFrm::SetDirFlags( sal_Bool bVert )
{
if( bVert )
{
@@ -1445,7 +1445,7 @@ void SwFrm::SetDirFlags( BOOL bVert )
bVertical = pAsk->IsVertical() ? 1 : 0;
bReverse = pAsk->IsReverse() ? 1 : 0;
if ( !pAsk->bInvalidVert )
- bInvalidVert = FALSE;
+ bInvalidVert = sal_False;
}
}
else
@@ -1453,7 +1453,7 @@ void SwFrm::SetDirFlags( BOOL bVert )
}
else
{
- BOOL bInv = 0;
+ sal_Bool bInv = 0;
if( !bDerivedR2L ) // CheckDirection is able to set bDerivedR2L!
CheckDirection( bVert );
if( bDerivedR2L )
@@ -1648,7 +1648,7 @@ const SwCellFrm& SwCellFrm::FindStartEndOfRowSpanCell( bool bStart, bool bCurren
{
const SwTable* pTable = pTableFrm->GetTable();
- USHORT nMax = USHRT_MAX;
+ sal_uInt16 nMax = USHRT_MAX;
if ( bCurrentTableOnly )
{
const SwFrm* pCurrentRow = GetUpper();
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx
index 724eeb2a5b92..65e0bd6734a8 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -68,7 +68,7 @@
#include <fmtfollowtextflow.hxx>
#include <switerator.hxx>
-BOOL SwFlowFrm::bMoveBwdJump = FALSE;
+sal_Bool SwFlowFrm::bMoveBwdJump = sal_False;
/*************************************************************************
@@ -86,14 +86,14 @@ SwFlowFrm::SwFlowFrm( SwFrm &rFrm ) :
pFollow( 0 )
{
bLockJoin = bIsFollow = bCntntLock = bOwnFtnNum =
- bFtnLock = bFlyLock = FALSE;
+ bFtnLock = bFlyLock = sal_False;
}
/*************************************************************************
|*
|* SwFlowFrm::IsFollowLocked()
-|* return TRUE if any follow has the JoinLocked flag
+|* return sal_True if any follow has the JoinLocked flag
|*
|*************************************************************************/
@@ -119,24 +119,24 @@ sal_Bool SwFlowFrm::HasLockedFollow() const
|*************************************************************************/
-BOOL SwFlowFrm::IsKeepFwdMoveAllowed()
+sal_Bool SwFlowFrm::IsKeepFwdMoveAllowed()
{
//Wenn der Vorgaenger das KeepAttribut traegt und auch dessen
//Vorgaenger usw. bis zum ersten der Kette und fuer diesen das
- //IsFwdMoveAllowed ein FALSE liefert, so ist das Moven eben nicht erlaubt.
+ //IsFwdMoveAllowed ein sal_False liefert, so ist das Moven eben nicht erlaubt.
SwFrm *pFrm = &rThis;
if ( !pFrm->IsInFtn() )
do
{ if ( pFrm->GetAttrSet()->GetKeep().GetValue() )
pFrm = pFrm->GetIndPrev();
else
- return TRUE;
+ return sal_True;
} while ( pFrm );
//Siehe IsFwdMoveAllowed()
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if ( pFrm && pFrm->GetIndPrev() )
- bRet = TRUE;
+ bRet = sal_True;
return bRet;
}
@@ -165,8 +165,8 @@ void SwFlowFrm::CheckKeep()
return;
}
SwFrm* pTmp;
- BOOL bKeep;
- while ( TRUE == (bKeep = pPre->GetAttrSet()->GetKeep().GetValue()) &&
+ sal_Bool bKeep;
+ while ( sal_True == (bKeep = pPre->GetAttrSet()->GetKeep().GetValue()) &&
0 != ( pTmp = pPre->GetIndPrev() ) )
{
if( pTmp->IsSctFrm() )
@@ -192,7 +192,7 @@ void SwFlowFrm::CheckKeep()
|*
|*************************************************************************/
-BOOL SwFlowFrm::IsKeep( const SwAttrSet& rAttrs, bool bCheckIfLastRowShouldKeep ) const
+sal_Bool SwFlowFrm::IsKeep( const SwAttrSet& rAttrs, bool bCheckIfLastRowShouldKeep ) const
{
// 1. The keep attribute is ignored inside footnotes
// 2. For compatibility reasons, the keep attribute is
@@ -200,7 +200,7 @@ BOOL SwFlowFrm::IsKeep( const SwAttrSet& rAttrs, bool bCheckIfLastRowShouldKeep
// 3. If bBreakCheck is set to true, this function only checks
// if there are any break after attributes set at rAttrs
// or break before attributes set for the next content (or next table)
- BOOL bKeep = bCheckIfLastRowShouldKeep ||
+ sal_Bool bKeep = bCheckIfLastRowShouldKeep ||
( !rThis.IsInFtn() &&
( !rThis.IsInTab() || rThis.IsTabFrm() ) &&
rAttrs.GetKeep().GetValue() );
@@ -218,7 +218,7 @@ BOOL SwFlowFrm::IsKeep( const SwAttrSet& rAttrs, bool bCheckIfLastRowShouldKeep
case SVX_BREAK_PAGE_AFTER:
case SVX_BREAK_PAGE_BOTH:
{
- bKeep = FALSE;
+ bKeep = sal_False;
}
default: break;
}
@@ -245,7 +245,7 @@ BOOL SwFlowFrm::IsKeep( const SwAttrSet& rAttrs, bool bCheckIfLastRowShouldKeep
pNextSection = pNextSectionFrm->GetSection();
if ( pThisSection != pNextSection )
- bKeep = FALSE;
+ bKeep = sal_False;
}
// <--
@@ -266,14 +266,14 @@ BOOL SwFlowFrm::IsKeep( const SwAttrSet& rAttrs, bool bCheckIfLastRowShouldKeep
ASSERT( pSet, "No AttrSet to check keep attribute" )
if ( pSet->GetPageDesc().GetPageDesc() )
- bKeep = FALSE;
+ bKeep = sal_False;
else switch ( pSet->GetBreak().GetBreak() )
{
case SVX_BREAK_COLUMN_BEFORE:
case SVX_BREAK_COLUMN_BOTH:
case SVX_BREAK_PAGE_BEFORE:
case SVX_BREAK_PAGE_BOTH:
- bKeep = FALSE;
+ bKeep = sal_False;
default: break;
}
}
@@ -293,7 +293,7 @@ BOOL SwFlowFrm::IsKeep( const SwAttrSet& rAttrs, bool bCheckIfLastRowShouldKeep
|*************************************************************************/
-BYTE SwFlowFrm::BwdMoveNecessary( const SwPageFrm *pPage, const SwRect &rRect )
+sal_uInt8 SwFlowFrm::BwdMoveNecessary( const SwPageFrm *pPage, const SwRect &rRect )
{
// Der return-Wert entscheidet mit,
// ob auf Zurueckgeflossen werden muss, (3)
@@ -313,7 +313,7 @@ BYTE SwFlowFrm::BwdMoveNecessary( const SwPageFrm *pPage, const SwRect &rRect )
//#32639# Wenn das Objekt bei mir verankert ist kann ich es
//vernachlaessigen, weil es hoechstwahrscheinlich (!?) mitfliesst,
//eine TestFormatierung ist dann allerdings nicht erlaubt!
- BYTE nRet = 0;
+ sal_uInt8 nRet = 0;
SwFlowFrm *pTmp = this;
do
{ // Wenn an uns oder einem Follow Objekte haengen, so
@@ -328,8 +328,8 @@ BYTE SwFlowFrm::BwdMoveNecessary( const SwPageFrm *pPage, const SwRect &rRect )
{
// --> OD 2004-07-01 #i28701# - new type <SwSortedObjs>
const SwSortedObjs &rObjs = *pPage->GetSortedObjs();
- ULONG nIndex = ULONG_MAX;
- for ( USHORT i = 0; nRet < 3 && i < rObjs.Count(); ++i )
+ sal_uLong nIndex = ULONG_MAX;
+ for ( sal_uInt16 i = 0; nRet < 3 && i < rObjs.Count(); ++i )
{
// --> OD 2004-07-01 #i28701# - consider changed type of
// <SwSortedObjs> entries.
@@ -363,7 +363,7 @@ BYTE SwFlowFrm::BwdMoveNecessary( const SwPageFrm *pPage, const SwRect &rRect )
if ( rFmt.GetAnchor().GetAnchorId() == FLY_AT_PARA )
{
// Den Index des anderen erhalten wir immer ueber das Ankerattr.
- ULONG nTmpIndex = rFmt.GetAnchor().GetCntntAnchor()->nNode.GetIndex();
+ sal_uLong nTmpIndex = rFmt.GetAnchor().GetCntntAnchor()->nNode.GetIndex();
// Jetzt wird noch ueberprueft, ob der aktuelle Absatz vor dem
// Anker des verdraengenden Objekts im Text steht, dann wird
// nicht ausgewichen.
@@ -453,7 +453,7 @@ SwLayoutFrm *SwFlowFrm::CutTree( SwFrm *pStart )
}
else
{
- BOOL bUnlock = !((SwFtnFrm*)pLay)->IsBackMoveLocked();
+ sal_Bool bUnlock = !((SwFtnFrm*)pLay)->IsBackMoveLocked();
((SwFtnFrm*)pLay)->LockBackMove();
pLay->InvalidateSize();
pLay->Calc();
@@ -480,11 +480,11 @@ SwLayoutFrm *SwFlowFrm::CutTree( SwFrm *pStart )
-BOOL SwFlowFrm::PasteTree( SwFrm *pStart, SwLayoutFrm *pParent, SwFrm *pSibling,
+sal_Bool SwFlowFrm::PasteTree( SwFrm *pStart, SwLayoutFrm *pParent, SwFrm *pSibling,
SwFrm *pOldParent )
{
- //returnt TRUE wenn in der Kette ein LayoutFrm steht.
- BOOL bRet = FALSE;
+ //returnt sal_True wenn in der Kette ein LayoutFrm steht.
+ sal_Bool bRet = sal_False;
//Die mit pStart beginnende Kette wird vor den Sibling unter den Parent
//gehaengt. Fuer geeignete Invalidierung wird ebenfalls gesorgt.
@@ -557,7 +557,7 @@ BOOL SwFlowFrm::PasteTree( SwFrm *pStart, SwLayoutFrm *pParent, SwFrm *pSibling,
((SwTxtFrm*)pFloat)->Init(); //Ich bin sein Freund.
}
else
- bRet = TRUE;
+ bRet = sal_True;
nGrowVal += (pFloat->Frm().*fnRect->fnGetHeight)();
if ( pFloat->GetNext() )
@@ -603,7 +603,7 @@ void SwFlowFrm::MoveSubTree( SwLayoutFrm* pParent, SwFrm* pSibling )
//Sparsamer benachrichtigen wenn eine Action laeuft.
ViewShell *pSh = rThis.getRootFrm()->GetCurrShell();
const SwViewImp *pImp = pSh ? pSh->Imp() : 0;
- const BOOL bComplete = pImp && pImp->IsAction() && pImp->GetLayAction().IsComplete();
+ const sal_Bool bComplete = pImp && pImp->IsAction() && pImp->GetLayAction().IsComplete();
if ( !bComplete )
{
@@ -629,7 +629,7 @@ void SwFlowFrm::MoveSubTree( SwLayoutFrm* pParent, SwFrm* pSibling )
SwPageFrm *pOldPage = rThis.FindPageFrm();
SwLayoutFrm *pOldParent = CutTree( &rThis );
- const BOOL bInvaLay = PasteTree( &rThis, pParent, pSibling, pOldParent );
+ const sal_Bool bInvaLay = PasteTree( &rThis, pParent, pSibling, pOldParent );
// Wenn durch das Cut&Paste ein leerer SectionFrm entstanden ist, sollte
// dieser automatisch verschwinden.
@@ -642,7 +642,7 @@ void SwFlowFrm::MoveSubTree( SwLayoutFrm* pParent, SwFrm* pSibling )
!pSct->ContainsAny( true ) ) )
// <--
{
- pSct->DelEmpty( FALSE );
+ pSct->DelEmpty( sal_False );
}
// In einem spaltigen Bereich rufen wir lieber kein Calc "von unten"
@@ -652,11 +652,11 @@ void SwFlowFrm::MoveSubTree( SwLayoutFrm* pParent, SwFrm* pSibling )
else if( rThis.GetUpper()->IsSctFrm() )
{
SwSectionFrm* pTmpSct = (SwSectionFrm*)rThis.GetUpper();
- BOOL bOld = pTmpSct->IsCntntLocked();
- pTmpSct->SetCntntLock( TRUE );
+ sal_Bool bOld = pTmpSct->IsCntntLocked();
+ pTmpSct->SetCntntLock( sal_True );
pTmpSct->Calc();
if( !bOld )
- pTmpSct->SetCntntLock( FALSE );
+ pTmpSct->SetCntntLock( sal_False );
}
SwPageFrm *pPage = rThis.FindPageFrm();
@@ -689,15 +689,15 @@ void SwFlowFrm::MoveSubTree( SwLayoutFrm* pParent, SwFrm* pSibling )
|*************************************************************************/
-BOOL SwFlowFrm::IsAnFollow( const SwFlowFrm *pAssumed ) const
+sal_Bool SwFlowFrm::IsAnFollow( const SwFlowFrm *pAssumed ) const
{
const SwFlowFrm *pFoll = this;
do
{ if ( pAssumed == pFoll )
- return TRUE;
+ return sal_True;
pFoll = pFoll->GetFollow();
} while ( pFoll );
- return FALSE;
+ return sal_False;
}
@@ -726,7 +726,7 @@ SwTxtFrm* SwCntntFrm::FindMaster() const
pCnt = pCnt->GetPrevCntntFrm();
}
- ASSERT( FALSE, "Follow ist lost in Space." );
+ ASSERT( sal_False, "Follow ist lost in Space." );
return 0;
}
@@ -743,7 +743,7 @@ SwSectionFrm* SwSectionFrm::FindMaster() const
pSect = aIter.Next();
}
- ASSERT( FALSE, "Follow ist lost in Space." );
+ ASSERT( sal_False, "Follow ist lost in Space." );
return 0;
}
@@ -782,7 +782,7 @@ SwTabFrm* SwTabFrm::FindMaster( bool bFirstMaster ) const
pTab = aIter.Next();
}
- ASSERT( FALSE, "Follow ist lost in Space." );
+ ASSERT( sal_False, "Follow ist lost in Space." );
return 0;
}
@@ -800,7 +800,7 @@ SwTabFrm* SwTabFrm::FindMaster( bool bFirstMaster ) const
|*************************************************************************/
-const SwLayoutFrm *SwFrm::GetLeaf( MakePageType eMakePage, BOOL bFwd,
+const SwLayoutFrm *SwFrm::GetLeaf( MakePageType eMakePage, sal_Bool bFwd,
const SwFrm *pAnch ) const
{
//Ohne Fluss kein genuss...
@@ -808,7 +808,7 @@ const SwLayoutFrm *SwFrm::GetLeaf( MakePageType eMakePage, BOOL bFwd,
return 0;
const SwFrm *pLeaf = this;
- BOOL bFound = FALSE;
+ sal_Bool bFound = sal_False;
do
{ pLeaf = ((SwFrm*)pLeaf)->GetLeaf( eMakePage, bFwd );
@@ -819,7 +819,7 @@ const SwLayoutFrm *SwFrm::GetLeaf( MakePageType eMakePage, BOOL bFwd,
if ( pAnch->IsInDocBody() == pLeaf->IsInDocBody() &&
pAnch->IsInFtn() == pLeaf->IsInFtn() )
{
- bFound = TRUE;
+ bFound = sal_True;
}
}
} while ( !bFound && pLeaf );
@@ -839,7 +839,7 @@ const SwLayoutFrm *SwFrm::GetLeaf( MakePageType eMakePage, BOOL bFwd,
|*************************************************************************/
-SwLayoutFrm *SwFrm::GetLeaf( MakePageType eMakePage, BOOL bFwd )
+SwLayoutFrm *SwFrm::GetLeaf( MakePageType eMakePage, sal_Bool bFwd )
{
if ( IsInFtn() )
return bFwd ? GetNextFtnLeaf( eMakePage ) : GetPrevFtnLeaf( eMakePage );
@@ -883,7 +883,7 @@ SwLayoutFrm *SwFrm::GetLeaf( MakePageType eMakePage, BOOL bFwd )
-BOOL SwFrm::WrongPageDesc( SwPageFrm* pNew )
+sal_Bool SwFrm::WrongPageDesc( SwPageFrm* pNew )
{
//Jetzt wirds leider etwas kompliziert:
//Ich bringe ich evtl. selbst
@@ -913,7 +913,7 @@ BOOL SwFrm::WrongPageDesc( SwPageFrm* pNew )
//Mein Pagedesc zaehlt nicht, wenn ich ein Follow bin!
SwPageDesc *pDesc = 0;
- USHORT nTmp = 0;
+ sal_uInt16 nTmp = 0;
SwFlowFrm *pFlow = SwFlowFrm::CastFlowFrm( this );
if ( !pFlow || !pFlow->IsFollow() )
{
@@ -932,7 +932,7 @@ BOOL SwFrm::WrongPageDesc( SwPageFrm* pNew )
//Bringt der Cntnt einen Pagedesc mit oder muss zaehlt die
//virtuelle Seitennummer des neuen Layoutleafs?
// Bei Follows zaehlt der PageDesc nicht
- const BOOL bOdd = nTmp ? ( nTmp % 2 ? TRUE : FALSE )
+ const sal_Bool bOdd = nTmp ? ( nTmp % 2 ? sal_True : sal_False )
: pNew->OnRightPage();
if ( !pDesc )
pDesc = pNew->FindPageDesc();
@@ -968,7 +968,7 @@ SwLayoutFrm *SwFrm::GetNextLeaf( MakePageType eMakePage )
ASSERT( !IsInFtn(), "GetNextLeaf(), don't call me for Ftn." );
ASSERT( !IsInSct(), "GetNextLeaf(), don't call me for Sections." );
- const BOOL bBody = IsInDocBody(); //Wenn ich aus dem DocBody komme
+ const sal_Bool bBody = IsInDocBody(); //Wenn ich aus dem DocBody komme
//Will ich auch im Body landen.
// Bei Flys macht es keinen Sinn, Seiten einzufuegen, wir wollen lediglich
@@ -992,9 +992,9 @@ SwLayoutFrm *SwFrm::GetNextLeaf( MakePageType eMakePage )
SwLayoutFrm *pOldLayLeaf = 0; //Damit bei neu erzeugten Seiten
//nicht wieder vom Anfang gesucht
//wird.
- BOOL bNewPg = FALSE; //nur einmal eine neue Seite einfuegen.
+ sal_Bool bNewPg = sal_False; //nur einmal eine neue Seite einfuegen.
- while ( TRUE )
+ while ( sal_True )
{
if ( pLayLeaf )
{
@@ -1045,7 +1045,7 @@ SwLayoutFrm *SwFrm::GetNextLeaf( MakePageType eMakePage )
SwFtnFrm *pFtn = (SwFtnFrm*)pCont->Lower();
if( pFtn && pFtn->GetRef() )
{
- const USHORT nRefNum = pNew->GetPhyPageNum();
+ const sal_uInt16 nRefNum = pNew->GetPhyPageNum();
if( pFtn->GetRef()->GetPhyPageNum() < nRefNum )
break;
}
@@ -1054,7 +1054,7 @@ SwLayoutFrm *SwFrm::GetNextLeaf( MakePageType eMakePage )
//muss eine neue eingefuegt werden.
if ( eMakePage == MAKEPAGE_INSERT )
{
- bNewPg = TRUE;
+ bNewPg = sal_True;
SwPageFrm *pPg = pOldLayLeaf ?
pOldLayLeaf->FindPageFrm() : 0;
@@ -1065,7 +1065,7 @@ SwLayoutFrm *SwFrm::GetNextLeaf( MakePageType eMakePage )
if ( !pPg || pPg == pNew )
pPg = FindPageFrm();
- InsertPage( pPg, FALSE );
+ InsertPage( pPg, sal_False );
pLayLeaf = GetNextLayoutLeaf();
pOldLayLeaf = 0;
continue;
@@ -1084,7 +1084,7 @@ SwLayoutFrm *SwFrm::GetNextLeaf( MakePageType eMakePage )
{
InsertPage(
pOldLayLeaf ? pOldLayLeaf->FindPageFrm() : FindPageFrm(),
- FALSE );
+ sal_False );
//und nochmal das ganze
pLayLeaf = pOldLayLeaf ? pOldLayLeaf : GetNextLayoutLeaf();
@@ -1112,9 +1112,9 @@ SwLayoutFrm *SwFrm::GetPrevLeaf( MakePageType )
{
ASSERT( !IsInFtn(), "GetPrevLeaf(), don't call me for Ftn." );
- const BOOL bBody = IsInDocBody(); //Wenn ich aus dem DocBody komme
+ const sal_Bool bBody = IsInDocBody(); //Wenn ich aus dem DocBody komme
//will ich auch im Body landen.
- const BOOL bFly = IsInFly();
+ const sal_Bool bFly = IsInFly();
SwLayoutFrm *pLayLeaf = GetPrevLayoutLeaf();
SwLayoutFrm *pPrevLeaf = 0;
@@ -1131,7 +1131,7 @@ SwLayoutFrm *SwFrm::GetPrevLeaf( MakePageType )
pPrevLeaf = pLayLeaf;
pLayLeaf = pLayLeaf->GetPrevLayoutLeaf();
if ( pLayLeaf )
- SwFlowFrm::SetMoveBwdJump( TRUE );
+ SwFlowFrm::SetMoveBwdJump( sal_True );
}
else if ( bFly )
break; //Cntnts in Flys sollte jedes Layout-Blatt recht sein.
@@ -1151,15 +1151,20 @@ SwLayoutFrm *SwFrm::GetPrevLeaf( MakePageType )
|*************************************************************************/
-BOOL SwFlowFrm::IsPrevObjMove() const
+sal_Bool SwFlowFrm::IsPrevObjMove() const
{
- //TRUE der FlowFrm soll auf einen Rahmen des Vorgaengers Ruecksicht nehmen
+ //sal_True der FlowFrm soll auf einen Rahmen des Vorgaengers Ruecksicht nehmen
// und fuer diesen ggf. Umbrechen.
//!!!!!!!!!!!Hack!!!!!!!!!!!
+<<<<<<< local
const ViewShell *pSh = rThis.getRootFrm()->GetCurrShell();
if( pSh && pSh->GetViewOptions()->getBrowseMode() )
return FALSE;
+=======
+ if ( rThis.GetUpper()->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ return sal_False;
+>>>>>>> other
SwFrm *pPre = rThis.FindPrev();
@@ -1167,7 +1172,7 @@ BOOL SwFlowFrm::IsPrevObjMove() const
{
ASSERT( SwFlowFrm::CastFlowFrm( pPre ), "new flowfrm?" );
if( SwFlowFrm::CastFlowFrm( pPre )->IsAnFollow( this ) )
- return FALSE;
+ return sal_False;
SwLayoutFrm* pPreUp = pPre->GetUpper();
// Wenn der Upper ein SectionFrm oder die Spalte eines SectionFrms ist,
// duerfen wir aus diesem durchaus heraushaengen,
@@ -1183,7 +1188,7 @@ BOOL SwFlowFrm::IsPrevObjMove() const
// --> OD 2004-10-15 #i26945# - re-factoring:
// use <GetVertPosOrientFrm()> to determine, if object has followed the
// text flow to the next layout frame
- for ( USHORT i = 0; i < pPre->GetDrawObjs()->Count(); ++i )
+ for ( sal_uInt16 i = 0; i < pPre->GetDrawObjs()->Count(); ++i )
{
// --> OD 2004-07-01 #i28701# - consider changed type of
// <SwSortedObjs> entries.
@@ -1201,23 +1206,23 @@ BOOL SwFlowFrm::IsPrevObjMove() const
pPreUp != pVertPosOrientFrm &&
!pPreUp->IsAnLower( pVertPosOrientFrm ) )
{
- return TRUE;
+ return sal_True;
}
}
}
// <--
}
- return FALSE;
+ return sal_False;
}
/*************************************************************************
|*
-|* BOOL SwFlowFrm::IsPageBreak()
+|* sal_Bool SwFlowFrm::IsPageBreak()
|*
|* Beschreibung Wenn vor dem Frm ein harter Seitenumbruch steht UND
-|* es einen Vorgaenger auf der gleichen Seite gibt, wird TRUE
-|* zurueckgeliefert (es muss ein PageBreak erzeugt werden) FALSE sonst.
-|* Wenn in bAct TRUE uebergeben wird, gibt die Funktion dann TRUE
+|* es einen Vorgaenger auf der gleichen Seite gibt, wird sal_True
+|* zurueckgeliefert (es muss ein PageBreak erzeugt werden) sal_False sonst.
+|* Wenn in bAct sal_True uebergeben wird, gibt die Funktion dann sal_True
|* zurueck, wenn ein PageBreak besteht.
|* Fuer Follows wird der harte Seitenumbruch natuerlich nicht
|* ausgewertet.
@@ -1234,7 +1239,7 @@ BOOL SwFlowFrm::IsPrevObjMove() const
|*************************************************************************/
-BOOL SwFlowFrm::IsPageBreak( BOOL bAct ) const
+sal_Bool SwFlowFrm::IsPageBreak( sal_Bool bAct ) const
{
if ( !IsFollow() && rThis.IsInDocBody() &&
( !rThis.IsInTab() || ( rThis.IsTabFrm() && !rThis.GetUpper()->IsInTab() ) ) ) // i66968
@@ -1255,37 +1260,37 @@ BOOL SwFlowFrm::IsPageBreak( BOOL bAct ) const
ASSERT( pPrev->IsInDocBody(), "IsPageBreak: Not in DocBody?" );
if ( bAct )
{ if ( rThis.FindPageFrm() == pPrev->FindPageFrm() )
- return FALSE;
+ return sal_False;
}
else
{ if ( rThis.FindPageFrm() != pPrev->FindPageFrm() )
- return FALSE;
+ return sal_False;
}
const SvxBreak eBreak = pSet->GetBreak().GetBreak();
if ( eBreak == SVX_BREAK_PAGE_BEFORE || eBreak == SVX_BREAK_PAGE_BOTH )
- return TRUE;
+ return sal_True;
else
{
const SvxBreak &ePrB = pPrev->GetAttrSet()->GetBreak().GetBreak();
if ( ePrB == SVX_BREAK_PAGE_AFTER ||
ePrB == SVX_BREAK_PAGE_BOTH ||
pSet->GetPageDesc().GetPageDesc() )
- return TRUE;
+ return sal_True;
}
}
}
- return FALSE;
+ return sal_False;
}
/*************************************************************************
|*
-|* BOOL SwFlowFrm::IsColBreak()
+|* sal_Bool SwFlowFrm::IsColBreak()
|*
|* Beschreibung Wenn vor dem Frm ein harter Spaltenumbruch steht UND
-|* es einen Vorgaenger in der gleichen Spalte gibt, wird TRUE
-|* zurueckgeliefert (es muss ein PageBreak erzeugt werden) FALSE sonst.
-|* Wenn in bAct TRUE uebergeben wird, gibt die Funktion dann TRUE
+|* es einen Vorgaenger in der gleichen Spalte gibt, wird sal_True
+|* zurueckgeliefert (es muss ein PageBreak erzeugt werden) sal_False sonst.
+|* Wenn in bAct sal_True uebergeben wird, gibt die Funktion dann sal_True
|* zurueck, wenn ein ColBreak besteht.
|* Fuer Follows wird der harte Spaltenumbruch natuerlich nicht
|* ausgewertet.
@@ -1299,7 +1304,7 @@ BOOL SwFlowFrm::IsPageBreak( BOOL bAct ) const
|*
|*************************************************************************/
-BOOL SwFlowFrm::IsColBreak( BOOL bAct ) const
+sal_Bool SwFlowFrm::IsColBreak( sal_Bool bAct ) const
{
if ( !IsFollow() && (rThis.IsMoveable() || bAct) )
{
@@ -1316,31 +1321,31 @@ BOOL SwFlowFrm::IsColBreak( BOOL bAct ) const
{
if ( bAct )
{ if ( pCol == pPrev->FindColFrm() )
- return FALSE;
+ return sal_False;
}
else
{ if ( pCol != pPrev->FindColFrm() )
- return FALSE;
+ return sal_False;
}
const SvxBreak eBreak = rThis.GetAttrSet()->GetBreak().GetBreak();
if ( eBreak == SVX_BREAK_COLUMN_BEFORE ||
eBreak == SVX_BREAK_COLUMN_BOTH )
- return TRUE;
+ return sal_True;
else
{
const SvxBreak &ePrB = pPrev->GetAttrSet()->GetBreak().GetBreak();
if ( ePrB == SVX_BREAK_COLUMN_AFTER ||
ePrB == SVX_BREAK_COLUMN_BOTH )
- return TRUE;
+ return sal_True;
}
}
}
}
- return FALSE;
+ return sal_False;
}
-BOOL SwFlowFrm::HasParaSpaceAtPages( BOOL bSct ) const
+sal_Bool SwFlowFrm::HasParaSpaceAtPages( sal_Bool bSct ) const
{
if( rThis.IsInSct() )
{
@@ -1350,26 +1355,26 @@ BOOL SwFlowFrm::HasParaSpaceAtPages( BOOL bSct ) const
if( pTmp->IsCellFrm() || pTmp->IsFlyFrm() ||
pTmp->IsFooterFrm() || pTmp->IsHeaderFrm() ||
( pTmp->IsFtnFrm() && !((SwFtnFrm*)pTmp)->GetMaster() ) )
- return TRUE;
+ return sal_True;
if( pTmp->IsPageFrm() )
- return ( pTmp->GetPrev() && !IsPageBreak(TRUE) ) ? FALSE : TRUE;
+ return ( pTmp->GetPrev() && !IsPageBreak(sal_True) ) ? sal_False : sal_True;
if( pTmp->IsColumnFrm() && pTmp->GetPrev() )
- return IsColBreak( TRUE );
+ return IsColBreak( sal_True );
if( pTmp->IsSctFrm() && ( !bSct || pTmp->GetPrev() ) )
- return FALSE;
+ return sal_False;
pTmp = pTmp->GetUpper();
}
- ASSERT( FALSE, "HasParaSpaceAtPages: Where's my page?" );
- return FALSE;
+ ASSERT( sal_False, "HasParaSpaceAtPages: Where's my page?" );
+ return sal_False;
}
if( !rThis.IsInDocBody() || ( rThis.IsInTab() && !rThis.IsTabFrm()) ||
- IsPageBreak( TRUE ) || ( rThis.FindColFrm() && IsColBreak( TRUE ) ) )
- return TRUE;
+ IsPageBreak( sal_True ) || ( rThis.FindColFrm() && IsColBreak( sal_True ) ) )
+ return sal_True;
const SwFrm* pTmp = rThis.FindColFrm();
if( pTmp )
{
if( pTmp->GetPrev() )
- return FALSE;
+ return sal_False;
}
else
pTmp = &rThis;
@@ -1829,7 +1834,7 @@ SwTwips SwFlowFrm::CalcAddLowerSpaceAsLastInTableCell(
/*************************************************************************
|*
-|* BOOL SwFlowFrm::CheckMoveFwd()
+|* sal_Bool SwFlowFrm::CheckMoveFwd()
|*
|* Beschreibung Moved den Frm vorwaerts wenn es durch die aktuellen
|* Bedingungen und Attribute notwendig erscheint.
@@ -1839,7 +1844,7 @@ SwTwips SwFlowFrm::CalcAddLowerSpaceAsLastInTableCell(
|*************************************************************************/
-BOOL SwFlowFrm::CheckMoveFwd( BOOL &rbMakePage, BOOL bKeep, BOOL )
+sal_Bool SwFlowFrm::CheckMoveFwd( sal_Bool &rbMakePage, sal_Bool bKeep, sal_Bool )
{
const SwFrm* pNxt = rThis.GetIndNext();
@@ -1862,61 +1867,61 @@ BOOL SwFlowFrm::CheckMoveFwd( BOOL &rbMakePage, BOOL bKeep, BOOL )
}
if( pNxt && pNxt->GetValidPosFlag() )
{
- BOOL bMove = FALSE;
+ sal_Bool bMove = sal_False;
const SwSectionFrm *pSct = rThis.FindSctFrm();
if( pSct && !pSct->GetValidSizeFlag() )
{
const SwSectionFrm* pNxtSct = pNxt->FindSctFrm();
if( pNxtSct && pSct->IsAnFollow( pNxtSct ) )
- bMove = TRUE;
+ bMove = sal_True;
}
else
- bMove = TRUE;
+ bMove = sal_True;
if( bMove )
{
//Keep together with the following frame
- MoveFwd( rbMakePage, FALSE );
- return TRUE;
+ MoveFwd( rbMakePage, sal_False );
+ return sal_True;
}
}
}
- BOOL bMovedFwd = FALSE;
+ sal_Bool bMovedFwd = sal_False;
if ( rThis.GetIndPrev() )
{
if ( IsPrevObjMove() ) //Auf Objekte des Prev Ruecksicht nehmen?
{
- bMovedFwd = TRUE;
- if ( !MoveFwd( rbMakePage, FALSE ) )
- rbMakePage = FALSE;
+ bMovedFwd = sal_True;
+ if ( !MoveFwd( rbMakePage, sal_False ) )
+ rbMakePage = sal_False;
}
else
{
- if ( IsPageBreak( FALSE ) )
+ if ( IsPageBreak( sal_False ) )
{
- while ( MoveFwd( rbMakePage, TRUE ) )
+ while ( MoveFwd( rbMakePage, sal_True ) )
/* do nothing */;
- rbMakePage = FALSE;
- bMovedFwd = TRUE;
+ rbMakePage = sal_False;
+ bMovedFwd = sal_True;
}
- else if ( IsColBreak ( FALSE ) )
+ else if ( IsColBreak ( sal_False ) )
{
const SwPageFrm *pPage = rThis.FindPageFrm();
SwFrm *pCol = rThis.FindColFrm();
do
- { MoveFwd( rbMakePage, FALSE );
+ { MoveFwd( rbMakePage, sal_False );
SwFrm *pTmp = rThis.FindColFrm();
if( pTmp != pCol )
{
- bMovedFwd = TRUE;
+ bMovedFwd = sal_True;
pCol = pTmp;
}
else
break;
- } while ( IsColBreak( FALSE ) );
+ } while ( IsColBreak( sal_False ) );
if ( pPage != rThis.FindPageFrm() )
- rbMakePage = FALSE;
+ rbMakePage = sal_False;
}
}
}
@@ -1925,7 +1930,7 @@ BOOL SwFlowFrm::CheckMoveFwd( BOOL &rbMakePage, BOOL bKeep, BOOL )
/*************************************************************************
|*
-|* BOOL SwFlowFrm::MoveFwd()
+|* sal_Bool SwFlowFrm::MoveFwd()
|*
|* Beschreibung Returnwert sagt, ob der Frm die Seite gewechselt hat.
|* Ersterstellung MA 05. Dec. 96
@@ -1934,7 +1939,7 @@ BOOL SwFlowFrm::CheckMoveFwd( BOOL &rbMakePage, BOOL bKeep, BOOL )
|*************************************************************************/
-BOOL SwFlowFrm::MoveFwd( BOOL bMakePage, BOOL bPageBreak, BOOL bMoveAlways )
+sal_Bool SwFlowFrm::MoveFwd( sal_Bool bMakePage, sal_Bool bPageBreak, sal_Bool bMoveAlways )
{
//!!!!MoveFtnCntFwd muss ggf. mitgepflegt werden.
SwFtnBossFrm *pOldBoss = rThis.FindFtnBossFrm();
@@ -1943,7 +1948,7 @@ BOOL SwFlowFrm::MoveFwd( BOOL bMakePage, BOOL bPageBreak, BOOL bMoveAlways )
if( !IsFwdMoveAllowed() && !bMoveAlways )
{
- BOOL bNoFwd = TRUE;
+ sal_Bool bNoFwd = sal_True;
if( rThis.IsInSct() )
{
SwFtnBossFrm* pBoss = rThis.FindFtnBossFrm();
@@ -1963,7 +1968,7 @@ BOOL SwFlowFrm::MoveFwd( BOOL bMakePage, BOOL bPageBreak, BOOL bMoveAlways )
// Have a look at our main competitor: We don't move inside row span cells:
( !rThis.GetUpper()->IsCellFrm() || !rThis.GetUpper()->IsLeaveUpperAllowed() ) )*/
{
- bNoFwd = FALSE;
+ bNoFwd = sal_False;
}
if( bNoFwd )
@@ -1971,17 +1976,17 @@ BOOL SwFlowFrm::MoveFwd( BOOL bMakePage, BOOL bPageBreak, BOOL bMoveAlways )
//Fuer PageBreak ist das Moven erlaubt, wenn der Frm nicht
//bereits der erste der Seite ist.
if ( !bPageBreak )
- return FALSE;
+ return sal_False;
const SwFrm *pCol = rThis.FindColFrm();
if ( !pCol || !pCol->GetPrev() )
- return FALSE;
+ return sal_False;
}
}
- BOOL bSamePage = TRUE;
+ sal_Bool bSamePage = sal_True;
SwLayoutFrm *pNewUpper =
- rThis.GetLeaf( bMakePage ? MAKEPAGE_INSERT : MAKEPAGE_NONE, TRUE );
+ rThis.GetLeaf( bMakePage ? MAKEPAGE_INSERT : MAKEPAGE_NONE, sal_True );
if ( pNewUpper )
{
@@ -1993,7 +1998,7 @@ BOOL SwFlowFrm::MoveFwd( BOOL bMakePage, BOOL bPageBreak, BOOL bMoveAlways )
// Wenn unser NewUpper in einem SectionFrm liegt, muessen wir
// verhindern, dass sich dieser im Calc selbst zerstoert
SwSectionFrm* pSect = pNewUpper->FindSctFrm();
- BOOL bUnlock = FALSE;
+ sal_Bool bUnlock = sal_False;
if( pSect )
{
// Wenn wir nur innerhalb unseres SectionFrms die Spalte wechseln,
@@ -2013,13 +2018,13 @@ BOOL SwFlowFrm::MoveFwd( BOOL bMakePage, BOOL bPageBreak, BOOL bMoveAlways )
pNewUpper->Calc();
SwFtnBossFrm *pNewBoss = pNewUpper->FindFtnBossFrm();
- BOOL bBossChg = pNewBoss != pOldBoss;
- pNewBoss = pNewBoss->FindFtnBossFrm( TRUE );
- pOldBoss = pOldBoss->FindFtnBossFrm( TRUE );
+ sal_Bool bBossChg = pNewBoss != pOldBoss;
+ pNewBoss = pNewBoss->FindFtnBossFrm( sal_True );
+ pOldBoss = pOldBoss->FindFtnBossFrm( sal_True );
SwPageFrm* pNewPage = pOldPage;
// First, we move the footnotes.
- BOOL bFtnMoved = FALSE;
+ sal_Bool bFtnMoved = sal_False;
// --> FME 2004-07-15 #i26831#
// If pSect has just been created, the printing area of pSect has
@@ -2049,7 +2054,7 @@ BOOL SwFlowFrm::MoveFwd( BOOL bMakePage, BOOL bPageBreak, BOOL bMoveAlways )
(SwLayoutFrm*)((SwTxtFrm*)pStart)->FindBodyFrm() : 0 ) : 0;
if( pBody )
bFtnMoved = pBody->MoveLowerFtns( pStart, pOldBoss, pNewBoss,
- FALSE);
+ sal_False);
}
// Bei SectionFrms ist es moeglich, dass wir selbst durch pNewUpper->Calc()
// bewegt wurden, z. B. in den pNewUpper.
@@ -2097,7 +2102,7 @@ BOOL SwFlowFrm::MoveFwd( BOOL bMakePage, BOOL bPageBreak, BOOL bMoveAlways )
if( bBossChg )
{
- rThis.Prepare( PREP_BOSS_CHGD, 0, FALSE );
+ rThis.Prepare( PREP_BOSS_CHGD, 0, sal_False );
if( !bSamePage )
{
ViewShell *pSh = rThis.getRootFrm()->GetCurrShell();
@@ -2122,7 +2127,7 @@ BOOL SwFlowFrm::MoveFwd( BOOL bMakePage, BOOL bPageBreak, BOOL bMoveAlways )
( rThis.GetAttrSet()->GetPageDesc().GetPageDesc() ||
pOldPage->GetPageDesc()->GetFollow() != pNewPage->GetPageDesc() ) )
{
- SwFrm::CheckPageDescs( pNewPage, FALSE );
+ SwFrm::CheckPageDescs( pNewPage, sal_False );
}
// <--
}
@@ -2133,7 +2138,7 @@ BOOL SwFlowFrm::MoveFwd( BOOL bMakePage, BOOL bPageBreak, BOOL bMoveAlways )
/*************************************************************************
|*
-|* BOOL SwFlowFrm::MoveBwd()
+|* sal_Bool SwFlowFrm::MoveBwd()
|*
|* Beschreibung Returnwert sagt, ob der Frm die Seite wechseln soll.
|* Sollte von abgeleiteten Klassen gerufen werden.
@@ -2143,13 +2148,13 @@ BOOL SwFlowFrm::MoveFwd( BOOL bMakePage, BOOL bPageBreak, BOOL bMoveAlways )
|*
|*************************************************************************/
-BOOL SwFlowFrm::MoveBwd( BOOL &rbReformat )
+sal_Bool SwFlowFrm::MoveBwd( sal_Bool &rbReformat )
{
- SwFlowFrm::SetMoveBwdJump( FALSE );
+ SwFlowFrm::SetMoveBwdJump( sal_False );
SwFtnFrm* pFtn = rThis.FindFtnFrm();
if ( pFtn && pFtn->IsBackMoveLocked() )
- return FALSE;
+ return sal_False;
// --> OD 2004-11-29 #115759# - text frames, which are directly inside
// tables aren't allowed to move backward.
@@ -2160,7 +2165,7 @@ BOOL SwFlowFrm::MoveBwd( BOOL &rbReformat )
{
if ( pUpperFrm->IsTabFrm() )
{
- return FALSE;
+ return sal_False;
}
else if ( pUpperFrm->IsColumnFrm() && pUpperFrm->IsInSct() )
{
@@ -2174,7 +2179,7 @@ BOOL SwFlowFrm::MoveBwd( BOOL &rbReformat )
SwFtnBossFrm * pOldBoss = rThis.FindFtnBossFrm();
SwPageFrm * const pOldPage = pOldBoss->FindPageFrm();
SwLayoutFrm *pNewUpper = 0;
- BOOL bCheckPageDescs = FALSE;
+ sal_Bool bCheckPageDescs = sal_False;
bool bCheckPageDescOfNextPage = false;
if ( pFtn )
@@ -2200,16 +2205,16 @@ BOOL SwFlowFrm::MoveBwd( BOOL &rbReformat )
ASSERT( pRef, "MoveBwd: Endnote for an empty section?" );
if( !bEndnote )
- pOldBoss = pOldBoss->FindFtnBossFrm( TRUE );
+ pOldBoss = pOldBoss->FindFtnBossFrm( sal_True );
SwFtnBossFrm *pRefBoss = pRef->FindFtnBossFrm( !bEndnote );
if ( pOldBoss != pRefBoss &&
// OD 08.11.2002 #104840# - use <SwLayoutFrm::IsBefore(..)>
( !bEndnote ||
pRefBoss->IsBefore( pOldBoss ) )
)
- pNewUpper = rThis.GetLeaf( MAKEPAGE_FTN, FALSE );
+ pNewUpper = rThis.GetLeaf( MAKEPAGE_FTN, sal_False );
}
- else if ( IsPageBreak( TRUE ) ) //PageBreak zu beachten?
+ else if ( IsPageBreak( sal_True ) ) //PageBreak zu beachten?
{
//Wenn auf der vorhergehenden Seite kein Frm im Body steht,
//so ist das Zurueckfliessen trotz Pagebreak sinnvoll
@@ -2231,7 +2236,7 @@ BOOL SwFlowFrm::MoveBwd( BOOL &rbReformat )
nDiff -= 1;
if ( nDiff > 1 )
{
- pNewUpper = rThis.GetLeaf( MAKEPAGE_NONE, FALSE );
+ pNewUpper = rThis.GetLeaf( MAKEPAGE_NONE, sal_False );
// --> OD 2006-05-08 #i53139#
// Now <pNewUpper> is a previous layout frame, which contains
// content. But the new upper layout frame has to be the next one.
@@ -2256,7 +2261,7 @@ BOOL SwFlowFrm::MoveBwd( BOOL &rbReformat )
// returns new upper on page 2.
if ( pNewUpper->Lower() )
{
- SwLayoutFrm* pNewNextUpper = pNewUpper->GetLeaf( MAKEPAGE_NONE, TRUE );
+ SwLayoutFrm* pNewNextUpper = pNewUpper->GetLeaf( MAKEPAGE_NONE, sal_True );
if ( pNewNextUpper &&
pNewNextUpper != rThis.GetUpper() &&
pNewNextUpper->GetType() == pNewUpper->GetType() &&
@@ -2272,19 +2277,19 @@ BOOL SwFlowFrm::MoveBwd( BOOL &rbReformat )
}
// <--
- bCheckPageDescs = TRUE;
+ bCheckPageDescs = sal_True;
}
}
}
}
- else if ( IsColBreak( TRUE ) )
+ else if ( IsColBreak( sal_True ) )
{
//Wenn in der vorhergehenden Spalte kein CntntFrm steht, so ist
//das Zurueckfliessen trotz ColumnBreak sinnvoll
//(sonst: leere Spalte).
if( rThis.IsInSct() )
{
- pNewUpper = rThis.GetLeaf( MAKEPAGE_NONE, FALSE );
+ pNewUpper = rThis.GetLeaf( MAKEPAGE_NONE, sal_False );
if( pNewUpper && !SwFlowFrm::IsMoveBwdJump() &&
( pNewUpper->ContainsCntnt() ||
( ( !pNewUpper->IsColBodyFrm() ||
@@ -2309,7 +2314,7 @@ BOOL SwFlowFrm::MoveBwd( BOOL &rbReformat )
// --> OD 2006-07-05 #136538# - another correction of fix for i53139
// Beside type check, check also, if proposed new next upper
// frame is inside the same frame types.
- SwLayoutFrm* pNewNextUpper = pNewUpper->GetLeaf( MAKEPAGE_NOSECTION, TRUE );
+ SwLayoutFrm* pNewNextUpper = pNewUpper->GetLeaf( MAKEPAGE_NOSECTION, sal_True );
if ( pNewNextUpper &&
pNewNextUpper->GetType() == pNewUpper->GetType() &&
pNewNextUpper->IsInDocBody() == pNewUpper->IsInDocBody() &&
@@ -2326,16 +2331,16 @@ BOOL SwFlowFrm::MoveBwd( BOOL &rbReformat )
else
{
const SwFrm *pCol = rThis.FindColFrm();
- BOOL bGoOn = TRUE;
- BOOL bJump = FALSE;
+ sal_Bool bGoOn = sal_True;
+ sal_Bool bJump = sal_False;
do
{
if ( pCol->GetPrev() )
pCol = pCol->GetPrev();
else
{
- bGoOn = FALSE;
- pCol = rThis.GetLeaf( MAKEPAGE_NONE, FALSE );
+ bGoOn = sal_False;
+ pCol = rThis.GetLeaf( MAKEPAGE_NONE, sal_False );
}
if ( pCol )
{
@@ -2345,7 +2350,7 @@ BOOL SwFlowFrm::MoveBwd( BOOL &rbReformat )
(SwLayoutFrm*)pCol;
if ( pColBody->ContainsCntnt() )
{
- bGoOn = FALSE; // Hier gibt's Inhalt, wir akzeptieren diese
+ bGoOn = sal_False; // Hier gibt's Inhalt, wir akzeptieren diese
// nur, wenn GetLeaf() das MoveBwdJump-Flag gesetzt hat.
if( SwFlowFrm::IsMoveBwdJump() )
{
@@ -2364,7 +2369,7 @@ BOOL SwFlowFrm::MoveBwd( BOOL &rbReformat )
// --> OD 2006-11-02 #i71065#
// Check that the proposed new next upper layout
// frame isn't the current one.
- SwLayoutFrm* pNewNextUpper = pNewUpper->GetLeaf( MAKEPAGE_NONE, TRUE );
+ SwLayoutFrm* pNewNextUpper = pNewUpper->GetLeaf( MAKEPAGE_NONE, sal_True );
if ( pNewNextUpper &&
pNewNextUpper != rThis.GetUpper() &&
pNewNextUpper->GetType() == pNewUpper->GetType() &&
@@ -2382,18 +2387,18 @@ BOOL SwFlowFrm::MoveBwd( BOOL &rbReformat )
else
{
if( pNewUpper ) // Wir hatten schon eine leere Spalte, haben
- bJump = TRUE; // also eine uebersprungen
+ bJump = sal_True; // also eine uebersprungen
pNewUpper = pColBody; // Diese leere Spalte kommt in Frage,
// trotzdem weitersuchen
}
}
} while( bGoOn );
if( bJump )
- SwFlowFrm::SetMoveBwdJump( TRUE );
+ SwFlowFrm::SetMoveBwdJump( sal_True );
}
}
else //Keine Breaks also kann ich zurueckfliessen
- pNewUpper = rThis.GetLeaf( MAKEPAGE_NONE, FALSE );
+ pNewUpper = rThis.GetLeaf( MAKEPAGE_NONE, sal_False );
// --> OD 2004-06-23 #i27801# - no move backward of 'master' text frame,
// if - due to its object positioning - it isn't allowed to be on the new page frame
@@ -2472,7 +2477,7 @@ BOOL SwFlowFrm::MoveBwd( BOOL &rbReformat )
SwFrm *pFrm = pNewUpper->Lower();
while ( pFrm->GetNext() )
pFrm = pFrm->GetNext();
- pNewUpper = pFrm->GetLeaf( MAKEPAGE_INSERT, TRUE );
+ pNewUpper = pFrm->GetLeaf( MAKEPAGE_INSERT, sal_True );
if( pNewUpper == rThis.GetUpper() ) //Landen wir wieder an der gleichen Stelle?
pNewUpper = NULL; //dann eruebrigt sich das Moven
}
@@ -2481,7 +2486,7 @@ BOOL SwFlowFrm::MoveBwd( BOOL &rbReformat )
}
// <--
}
- if ( pNewUpper && !ShouldBwdMoved( pNewUpper, TRUE, rbReformat ) )
+ if ( pNewUpper && !ShouldBwdMoved( pNewUpper, sal_True, rbReformat ) )
{
if( !pNewUpper->Lower() )
{
@@ -2499,9 +2504,9 @@ BOOL SwFlowFrm::MoveBwd( BOOL &rbReformat )
!pSectFrm->ContainsCntnt() && !pSectFrm->ContainsAny( true ) )
// <--
{
- pSectFrm->DelEmpty( TRUE );
+ pSectFrm->DelEmpty( sal_True );
delete pSectFrm;
- rThis.bValidPos = TRUE;
+ rThis.bValidPos = sal_True;
}
}
}
@@ -2556,7 +2561,7 @@ BOOL SwFlowFrm::MoveBwd( BOOL &rbReformat )
( !rThis.IsSctFrm() && rThis.IsInSct() )
? MAKEPAGE_NOSECTION
: MAKEPAGE_NONE,
- TRUE );
+ sal_True );
// --> OD 2007-01-10 #i73194# - make code robust
ASSERT( pNextNewUpper, "<SwFlowFrm::MoveBwd(..)> - missing next new upper" );
if ( pNextNewUpper &&
@@ -2614,7 +2619,7 @@ BOOL SwFlowFrm::MoveBwd( BOOL &rbReformat )
pNewUpper = (SwSectionFrm*)pTmp;
else
{
- pSct = new SwSectionFrm( *pSct, TRUE );
+ pSct = new SwSectionFrm( *pSct, sal_True );
pSct->Paste( pNewUpper );
pSct->Init();
pNewUpper = pSct;
@@ -2622,8 +2627,8 @@ BOOL SwFlowFrm::MoveBwd( BOOL &rbReformat )
}
}
}
- BOOL bUnlock = FALSE;
- BOOL bFollow = FALSE;
+ sal_Bool bUnlock = sal_False;
+ sal_Bool bFollow = sal_False;
//Section locken, sonst kann sie bei Fluss des einzigen Cntnt etwa
//von zweiter in die erste Spalte zerstoert werden.
SwSectionFrm* pSect = pNewUpper->FindSctFrm();
@@ -2662,8 +2667,13 @@ BOOL SwFlowFrm::MoveBwd( BOOL &rbReformat )
SwPageFrm *pNewPage = rThis.FindPageFrm();
if( pNewPage != pOldPage )
{
+<<<<<<< local
rThis.Prepare( PREP_BOSS_CHGD, (const void*)pOldPage, FALSE );
ViewShell *pSh = rThis.getRootFrm()->GetCurrShell();
+=======
+ rThis.Prepare( PREP_BOSS_CHGD, (const void*)pOldPage, sal_False );
+ ViewShell *pSh = rThis.GetShell();
+>>>>>>> other
if ( pSh && !pSh->Imp()->IsUpdateExpFlds() )
pSh->GetDoc()->SetNewFldLst(true); //Wird von CalcLayout() hinterher eledigt!
@@ -2680,12 +2690,12 @@ BOOL SwFlowFrm::MoveBwd( BOOL &rbReformat )
SwPageFrm* pStartPage = bCheckPageDescOfNextPage ?
pNewPage :
(SwPageFrm*)pNewPage->GetNext();
- SwFrm::CheckPageDescs( pStartPage, FALSE);
+ SwFrm::CheckPageDescs( pStartPage, sal_False);
}
else if ( rThis.GetAttrSet()->GetPageDesc().GetPageDesc() )
{
//Erste Seite wird etwa durch Ausblenden eines Bereiches leer
- SwFrm::CheckPageDescs( (SwPageFrm*)pNewPage, FALSE);
+ SwFrm::CheckPageDescs( (SwPageFrm*)pNewPage, sal_False);
}
}
}
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index b026bcca27a6..fe79266ac084 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -113,30 +113,30 @@ SwFlyFrm::SwFlyFrm( SwFlyFrmFmt *pFmt, SwFrm* pSib, SwFrm *pAnch ) :
// aRelPos(),
pPrevLink( 0 ),
pNextLink( 0 ),
- bInCnt( FALSE ),
- bAtCnt( FALSE ),
- bLayout( FALSE ),
- bAutoPosition( FALSE ),
- bNoShrink( FALSE ),
- bLockDeleteContent( FALSE )
+ bInCnt( sal_False ),
+ bAtCnt( sal_False ),
+ bLayout( sal_False ),
+ bAutoPosition( sal_False ),
+ bNoShrink( sal_False ),
+ bLockDeleteContent( sal_False )
{
nType = FRMC_FLY;
- bInvalid = bNotifyBack = TRUE;
+ bInvalid = bNotifyBack = sal_True;
bLocked = bMinHeight =
- bHeightClipped = bWidthClipped = bFormatHeightOnly = FALSE;
+ bHeightClipped = bWidthClipped = bFormatHeightOnly = sal_False;
//Grosseneinstellung, Fixe groesse ist immer die Breite
const SwFmtFrmSize &rFrmSize = pFmt->GetFrmSize();
- BOOL bVert = FALSE;
- UINT16 nDir =
+ sal_Bool bVert = sal_False;
+ sal_uInt16 nDir =
((SvxFrameDirectionItem&)pFmt->GetFmtAttr( RES_FRAMEDIR )).GetValue();
if( FRMDIR_ENVIRONMENT == nDir )
{
bDerivedVert = 1;
bDerivedR2L = 1;
if( pAnch && pAnch->IsVertical() )
- bVert = TRUE;
+ bVert = sal_True;
}
else
{
@@ -166,16 +166,16 @@ SwFlyFrm::SwFlyFrm( SwFlyFrmFmt *pFmt, SwFrm* pSib, SwFrm *pAnch ) :
//Hoehe Fix oder Variabel oder was?
if ( rFrmSize.GetHeightSizeType() == ATT_MIN_SIZE )
- bMinHeight = TRUE;
+ bMinHeight = sal_True;
else if ( rFrmSize.GetHeightSizeType() == ATT_FIX_SIZE )
- bFixSize = TRUE;
+ bFixSize = sal_True;
// OD 2004-02-12 #110582#-2 - insert columns, if necessary
InsertColumns();
//Erst das Init, dann den Inhalt, denn zum Inhalt koennen widerum
//Objekte/Rahmen gehoeren die dann angemeldet werden.
- InitDrawObj( FALSE );
+ InitDrawObj( sal_False );
// OD 2004-01-19 #110582#
Chain( pAnch );
@@ -227,7 +227,7 @@ void SwFlyFrm::InsertCnt()
{
const SwFmtCntnt& rCntnt = GetFmt()->GetCntnt();
ASSERT( rCntnt.GetCntntIdx(), ":-( no content prepared." );
- ULONG nIndex = rCntnt.GetCntntIdx()->GetIndex();
+ sal_uLong nIndex = rCntnt.GetCntntIdx()->GetIndex();
// Lower() bedeutet SwColumnFrm, eingefuegt werden muss der Inhalt dann in den (Column)BodyFrm
::_InsertCnt( Lower() ? (SwLayoutFrm*)((SwLayoutFrm*)Lower())->Lower() : (SwLayoutFrm*)this,
GetFmt()->GetDoc(), nIndex );
@@ -235,8 +235,8 @@ void SwFlyFrm::InsertCnt()
//NoTxt haben immer eine FixHeight.
if ( Lower() && Lower()->IsNoTxtFrm() )
{
- bFixSize = TRUE;
- bMinHeight = FALSE;
+ bFixSize = sal_True;
+ bMinHeight = sal_False;
}
}
}
@@ -378,6 +378,7 @@ void SwFlyFrm::DeleteCnt()
|* Letzte Aenderung MA 30. Nov. 95
|*
|*************************************************************************/
+<<<<<<< local
sal_uInt32 SwFlyFrm::_GetOrdNumForNewRef( const SwFlyDrawContact* pContact )
{
@@ -446,6 +447,9 @@ SwVirtFlyDrawObj* SwFlyFrm::CreateNewRef( SwFlyDrawContact *pContact )
void SwFlyFrm::InitDrawObj( BOOL bNotify )
+=======
+void SwFlyFrm::InitDrawObj( sal_Bool bNotify )
+>>>>>>> other
{
//ContactObject aus dem Format suchen. Wenn bereits eines existiert, so
//braucht nur eine neue Ref erzeugt werden, anderfalls ist es jetzt an
@@ -629,7 +633,7 @@ void SwFlyFrm::UnchainFrames( SwFlyFrm *pMaster, SwFlyFrm *pFollow )
//Der Follow muss mit seinem eigenen Inhalt versorgt werden.
const SwFmtCntnt &rCntnt = pFollow->GetFmt()->GetCntnt();
ASSERT( rCntnt.GetCntntIdx(), ":-( Kein Inhalt vorbereitet." );
- ULONG nIndex = rCntnt.GetCntntIdx()->GetIndex();
+ sal_uLong nIndex = rCntnt.GetCntntIdx()->GetIndex();
// Lower() bedeutet SwColumnFrm, dieser beinhaltet wieder einen SwBodyFrm
::_InsertCnt( pFollow->Lower() ? (SwLayoutFrm*)((SwLayoutFrm*)pFollow->Lower())->Lower()
: (SwLayoutFrm*)pFollow,
@@ -733,23 +737,23 @@ SwFrm *SwFlyFrm::FindLastLower()
|*
|*************************************************************************/
-BOOL SwFlyFrm::FrmSizeChg( const SwFmtFrmSize &rFrmSize )
+sal_Bool SwFlyFrm::FrmSizeChg( const SwFmtFrmSize &rFrmSize )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
SwTwips nDiffHeight = Frm().Height();
if ( rFrmSize.GetHeightSizeType() == ATT_VAR_SIZE )
- bFixSize = bMinHeight = FALSE;
+ bFixSize = bMinHeight = sal_False;
else
{
if ( rFrmSize.GetHeightSizeType() == ATT_FIX_SIZE )
{
- bFixSize = TRUE;
- bMinHeight = FALSE;
+ bFixSize = sal_True;
+ bMinHeight = sal_False;
}
else if ( rFrmSize.GetHeightSizeType() == ATT_MIN_SIZE )
{
- bFixSize = FALSE;
- bMinHeight = TRUE;
+ bFixSize = sal_False;
+ bMinHeight = sal_True;
}
nDiffHeight -= rFrmSize.GetHeight();
}
@@ -772,13 +776,13 @@ BOOL SwFlyFrm::FrmSizeChg( const SwFmtFrmSize &rFrmSize )
aPrt.Width ( aPrt.Width() - nDiffWidth );
ChgLowersProp( aOldSz );
::Notify( this, FindPageFrm(), aOld );
- bValidPos = FALSE;
- bRet = TRUE;
+ bValidPos = sal_False;
+ bRet = sal_True;
}
else if ( Lower()->IsNoTxtFrm() )
{
- bFixSize = TRUE;
- bMinHeight = FALSE;
+ bFixSize = sal_True;
+ bMinHeight = sal_False;
}
}
return bRet;
@@ -795,7 +799,7 @@ BOOL SwFlyFrm::FrmSizeChg( const SwFmtFrmSize &rFrmSize )
void SwFlyFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
{
- BYTE nInvFlags = 0;
+ sal_uInt8 nInvFlags = 0;
if( pNew && RES_ATTRSET_CHG == pNew->Which() )
{
@@ -803,7 +807,7 @@ void SwFlyFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
SfxItemIter aOIter( *((SwAttrSetChg*)pOld)->GetChgSet() );
SwAttrSetChg aOldSet( *(SwAttrSetChg*)pOld );
SwAttrSetChg aNewSet( *(SwAttrSetChg*)pNew );
- while( TRUE )
+ while( sal_True )
{
_UpdateAttr( (SfxPoolItem*)aOIter.GetCurItem(),
(SfxPoolItem*)aNIter.GetCurItem(), nInvFlags,
@@ -861,13 +865,24 @@ void SwFlyFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
// <--
}
+<<<<<<< local
void SwFlyFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
BYTE &rInvFlags,
+=======
+void SwFlyFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew,
+ sal_uInt8 &rInvFlags,
+>>>>>>> other
SwAttrSetChg *pOldSet, SwAttrSetChg *pNewSet )
{
+<<<<<<< local
BOOL bClear = TRUE;
const USHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
ViewShell *pSh = getRootFrm()->GetCurrShell();
+=======
+ sal_Bool bClear = sal_True;
+ const sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
+ ViewShell *pSh = GetShell();
+>>>>>>> other
switch( nWhich )
{
case RES_VERT_ORIENT:
@@ -965,7 +980,7 @@ void SwFlyFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
SwFmtCol aCol;
if ( Lower() && Lower()->IsColumnFrm() )
{
- USHORT nCol = 0;
+ sal_uInt16 nCol = 0;
SwFrm *pTmp = Lower();
do
{ ++nCol;
@@ -1002,7 +1017,7 @@ void SwFlyFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
if ( pSh )
pSh->InvalidateWindows( Frm() );
const IDocumentDrawModelAccess* pIDDMA = GetFmt()->getIDocumentDrawModelAccess();
- const BYTE nId = GetFmt()->GetOpaque().GetValue() ?
+ const sal_uInt8 nId = GetFmt()->GetOpaque().GetValue() ?
pIDDMA->GetHeavenId() :
pIDDMA->GetHellId();
GetVirtDrawObj()->SetLayer( nId );
@@ -1062,8 +1077,8 @@ void SwFlyFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
break;
case RES_FRAMEDIR :
- SetDerivedVert( FALSE );
- SetDerivedR2L( FALSE );
+ SetDerivedVert( sal_False );
+ SetDerivedR2L( sal_False );
CheckDirChange();
break;
@@ -1073,7 +1088,7 @@ void SwFlyFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
pSh->InvalidateWindows( Frm() );
const IDocumentDrawModelAccess* pIDDMA = GetFmt()->getIDocumentDrawModelAccess();
- const BYTE nId = ((SvxOpaqueItem*)pNew)->GetValue() ?
+ const sal_uInt8 nId = ((SvxOpaqueItem*)pNew)->GetValue() ?
pIDDMA->GetHeavenId() :
pIDDMA->GetHellId();
GetVirtDrawObj()->SetLayer( nId );
@@ -1155,7 +1170,7 @@ void SwFlyFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
}
default:
- bClear = FALSE;
+ bClear = sal_False;
}
if ( bClear )
{
@@ -1182,11 +1197,11 @@ void SwFlyFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
*************************************************************************/
// erfrage vom Modify Informationen
-BOOL SwFlyFrm::GetInfo( SfxPoolItem & rInfo ) const
+sal_Bool SwFlyFrm::GetInfo( SfxPoolItem & rInfo ) const
{
if( RES_AUTOFMT_DOCNODE == rInfo.Which() )
- return FALSE; // es gibt einen FlyFrm also wird er benutzt
- return TRUE; // weiter suchen
+ return sal_False; // es gibt einen FlyFrm also wird er benutzt
+ return sal_True; // weiter suchen
}
/*************************************************************************
@@ -1201,7 +1216,7 @@ BOOL SwFlyFrm::GetInfo( SfxPoolItem & rInfo ) const
void SwFlyFrm::_Invalidate( SwPageFrm *pPage )
{
InvalidatePage( pPage );
- bNotifyBack = bInvalid = TRUE;
+ bNotifyBack = bInvalid = sal_True;
SwFlyFrm *pFrm;
if ( GetAnchorFrm() && 0 != (pFrm = AnchorFrm()->FindFlyFrm()) )
@@ -1315,13 +1330,13 @@ void SwFlyFrm::ChgRelPos( const Point &rNewPos )
{
aHori.SetHoriOrient( text::HoriOrientation::NONE );
aHori.SetRelationOrient( text::RelOrientation::PAGE_FRAME );
- aHori.SetPosToggle( FALSE );
+ aHori.SetPosToggle( sal_False );
}
else if ( eAnchorType == FLY_AT_FLY )
{
aHori.SetHoriOrient( text::HoriOrientation::NONE );
aHori.SetRelationOrient( text::RelOrientation::FRAME );
- aHori.SetPosToggle( FALSE );
+ aHori.SetPosToggle( sal_False );
}
// <--
else if ( IsFlyAtCntFrm() || text::HoriOrientation::NONE != aHori.GetHoriOrient() )
@@ -1346,7 +1361,7 @@ void SwFlyFrm::ChgRelPos( const Point &rNewPos )
}
else
aHori.SetRelationOrient( text::RelOrientation::FRAME );
- aHori.SetPosToggle( FALSE );
+ aHori.SetPosToggle( sal_False );
}
aHori.SetPos( nTmpX );
aSet.Put( aHori );
@@ -1385,9 +1400,9 @@ void SwFlyFrm::Format( const SwBorderAttrs *pAttrs )
//Breite der Spalten pruefen und ggf. einstellen.
if ( Lower() && Lower()->IsColumnFrm() )
- AdjustColumns( 0, FALSE );
+ AdjustColumns( 0, sal_False );
- bValidSize = TRUE;
+ bValidSize = sal_True;
const SwTwips nUL = pAttrs->CalcTopLine() + pAttrs->CalcBottomLine();
const SwTwips nLR = pAttrs->CalcLeftLine() + pAttrs->CalcRightLine();
@@ -1442,7 +1457,7 @@ void SwFlyFrm::Format( const SwBorderAttrs *pAttrs )
SwTwips nTop = (Frm().*fnRect->fnGetTop)();
SwTwips nBorder = (Frm().*fnRect->fnGetHeight)() -
(Prt().*fnRect->fnGetHeight)();
- for ( USHORT i = 0; i < nCnt; ++i )
+ for ( sal_uInt16 i = 0; i < nCnt; ++i )
{
SwAnchoredObject* pAnchoredObj = (*GetDrawObjs())[i];
if ( pAnchoredObj->ISA(SwFlyFrm) )
@@ -1483,11 +1498,11 @@ void SwFlyFrm::Format( const SwBorderAttrs *pAttrs )
InvalidateObjRectWithSpaces();
}
// <--
- bValidSize = TRUE;
+ bValidSize = sal_True;
}
else
{
- bValidSize = TRUE; //Fixe Frms formatieren sich nicht.
+ bValidSize = sal_True; //Fixe Frms formatieren sich nicht.
//Flys stellen ihre Groesse anhand des Attr ein.
SwTwips nNewSize = bVert ? aRelSize.Width() : aRelSize.Height();
nNewSize -= nUL;
@@ -1550,19 +1565,19 @@ void SwFlyFrm::Format( const SwBorderAttrs *pAttrs )
// problems in method <SwCntntFrm::_WouldFit(..)>,
// which assumes that the follows are formatted.
// Thus, <bNoCalcFollow> no longer used by <FormatWidthCols(..)>.
-//void CalcCntnt( SwLayoutFrm *pLay, BOOL bNoColl )
+//void CalcCntnt( SwLayoutFrm *pLay, sal_Bool bNoColl )
void CalcCntnt( SwLayoutFrm *pLay,
bool bNoColl,
bool bNoCalcFollow )
{
SwSectionFrm* pSect;
- BOOL bCollect = FALSE;
+ sal_Bool bCollect = sal_False;
if( pLay->IsSctFrm() )
{
pSect = (SwSectionFrm*)pLay;
if( pSect->IsEndnAtEnd() && !bNoColl )
{
- bCollect = TRUE;
+ bCollect = sal_True;
SwLayouter::CollectEndnotes( pLay->GetFmt()->GetDoc(), pSect );
}
pSect->CalcFtnCntnt();
@@ -1583,8 +1598,8 @@ void CalcCntnt( SwLayoutFrm *pLay,
if( bCollect )
pLay->GetFmt()->GetDoc()->GetLayouter()->
InsertEndnotes( pSect );
- BOOL bLock = pSect->IsFtnLock();
- pSect->SetFtnLock( TRUE );
+ sal_Bool bLock = pSect->IsFtnLock();
+ pSect->SetFtnLock( sal_True );
pSect->CalcFtnCntnt();
pSect->CalcFtnCntnt();
pSect->SetFtnLock( bLock );
@@ -1605,8 +1620,8 @@ void CalcCntnt( SwLayoutFrm *pLay,
SwAnchoredObject* pAgainObj2 = 0;
// FME 2007-08-30 #i81146# new loop control
- USHORT nLoopControlRuns = 0;
- const USHORT nLoopControlMax = 20;
+ sal_uInt16 nLoopControlRuns = 0;
+ const sal_uInt16 nLoopControlMax = 20;
const SwFrm* pLoopControlCond = 0;
SwFrm* pLast;
@@ -1623,14 +1638,14 @@ void CalcCntnt( SwLayoutFrm *pLay,
if ( pFrm->IsTabFrm() )
{
- ((SwTabFrm*)pFrm)->bCalcLowers = TRUE;
+ ((SwTabFrm*)pFrm)->bCalcLowers = sal_True;
// OD 26.08.2003 #i18103# - lock move backward of follow table,
// if no section content is formatted or follow table belongs
// to the section, which content is formatted.
if ( ((SwTabFrm*)pFrm)->IsFollow() &&
( !pSect || pSect == pFrm->FindSctFrm() ) )
{
- ((SwTabFrm*)pFrm)->bLockBackMove = TRUE;
+ ((SwTabFrm*)pFrm)->bLockBackMove = sal_True;
}
}
@@ -1675,7 +1690,7 @@ void CalcCntnt( SwLayoutFrm *pLay,
bool bAgain = false;
SwPageFrm* pPageFrm = pFrm->FindPageFrm();
sal_uInt32 nCnt = pFrm->GetDrawObjs()->Count();
- for ( USHORT i = 0; i < nCnt; ++i )
+ for ( sal_uInt16 i = 0; i < nCnt; ++i )
{
// --> OD 2004-07-01 #i28701#
SwAnchoredObject* pAnchoredObj = (*pFrm->GetDrawObjs())[i];
@@ -1805,7 +1820,7 @@ void CalcCntnt( SwLayoutFrm *pLay,
if ( pFrm->IsTabFrm() )
{
if ( ((SwTabFrm*)pFrm)->IsFollow() )
- ((SwTabFrm*)pFrm)->bLockBackMove = FALSE;
+ ((SwTabFrm*)pFrm)->bLockBackMove = sal_False;
}
pFrm = bPrevInvalid ? pTmpPrev : pFrm->FindNext();
@@ -1856,14 +1871,14 @@ void CalcCntnt( SwLayoutFrm *pLay,
if( bCollect )
{
pFrm = pLay->ContainsAny();
- bCollect = FALSE;
+ bCollect = sal_False;
if( pFrm )
continue;
}
}
break;
}
- while( TRUE );
+ while( sal_True );
}
/*************************************************************************
@@ -1880,7 +1895,7 @@ void SwFlyFrm::MakeObjPos()
{
if ( !bValidPos )
{
- bValidPos = TRUE;
+ bValidPos = sal_True;
// OD 29.10.2003 #113049# - use new class to position object
GetAnchorFrm()->Calc();
@@ -1915,7 +1930,7 @@ void SwFlyFrm::MakePrtArea( const SwBorderAttrs &rAttrs )
if ( !bValidPrtArea )
{
- bValidPrtArea = TRUE;
+ bValidPrtArea = sal_True;
// OD 31.07.2003 #110978# - consider vertical layout
SWRECTFN( this )
@@ -1935,7 +1950,7 @@ void SwFlyFrm::MakePrtArea( const SwBorderAttrs &rAttrs )
|*
|*************************************************************************/
-SwTwips SwFlyFrm::_Grow( SwTwips nDist, BOOL bTst )
+SwTwips SwFlyFrm::_Grow( SwTwips nDist, sal_Bool bTst )
{
SWRECTFN( this )
if ( Lower() && !IsColLocked() && !HasFixSize() )
@@ -1964,7 +1979,7 @@ SwTwips SwFlyFrm::_Grow( SwTwips nDist, BOOL bTst )
{
const SwRect aOld( GetObjRectWithSpaces() );
_InvalidateSize();
- const BOOL bOldLock = bLocked;
+ const sal_Bool bOldLock = bLocked;
Unlock();
if ( IsFlyFreeFrm() )
{
@@ -1974,16 +1989,16 @@ SwTwips SwFlyFrm::_Grow( SwTwips nDist, BOOL bTst )
// Writer fly frames - inner Writer fly frames format its
// anchor, which grows/shrinks the outer Writer fly frame.
// Note: position will be invalidated below.
- bValidPos = TRUE;
+ bValidPos = sal_True;
// --> OD 2005-10-10 #i55416#
// Suppress format of width for autowidth frame, because the
// format of the width would call <SwTxtFrm::CalcFitToContent()>
// for the lower frame, which initiated this grow.
- const BOOL bOldFormatHeightOnly = bFormatHeightOnly;
+ const sal_Bool bOldFormatHeightOnly = bFormatHeightOnly;
const SwFmtFrmSize& rFrmSz = GetFmt()->GetFrmSize();
if ( rFrmSz.GetWidthSizeType() != ATT_FIX_SIZE )
{
- bFormatHeightOnly = TRUE;
+ bFormatHeightOnly = sal_True;
}
// <--
static_cast<SwFlyFreeFrm*>(this)->SetNoMoveOnCheckClip( true );
@@ -2013,7 +2028,7 @@ SwTwips SwFlyFrm::_Grow( SwTwips nDist, BOOL bTst )
return 0L;
}
-SwTwips SwFlyFrm::_Shrink( SwTwips nDist, BOOL bTst )
+SwTwips SwFlyFrm::_Shrink( SwTwips nDist, sal_Bool bTst )
{
if( Lower() && !IsColLocked() && !HasFixSize() && !IsNoShrink() )
{
@@ -2063,7 +2078,7 @@ SwTwips SwFlyFrm::_Shrink( SwTwips nDist, BOOL bTst )
{
const SwRect aOld( GetObjRectWithSpaces() );
_InvalidateSize();
- const BOOL bOldLocked = bLocked;
+ const sal_Bool bOldLocked = bLocked;
Unlock();
if ( IsFlyFreeFrm() )
{
@@ -2073,16 +2088,16 @@ SwTwips SwFlyFrm::_Shrink( SwTwips nDist, BOOL bTst )
// Writer fly frames - inner Writer fly frames format its
// anchor, which grows/shrinks the outer Writer fly frame.
// Note: position will be invalidated below.
- bValidPos = TRUE;
+ bValidPos = sal_True;
// --> OD 2005-10-10 #i55416#
// Suppress format of width for autowidth frame, because the
// format of the width would call <SwTxtFrm::CalcFitToContent()>
// for the lower frame, which initiated this shrink.
- const BOOL bOldFormatHeightOnly = bFormatHeightOnly;
+ const sal_Bool bOldFormatHeightOnly = bFormatHeightOnly;
const SwFmtFrmSize& rFrmSz = GetFmt()->GetFrmSize();
if ( rFrmSz.GetWidthSizeType() != ATT_FIX_SIZE )
{
- bFormatHeightOnly = TRUE;
+ bFormatHeightOnly = sal_True;
}
// <--
static_cast<SwFlyFreeFrm*>(this)->SetNoMoveOnCheckClip( true );
@@ -2139,7 +2154,7 @@ Size SwFlyFrm::ChgSize( const Size& aNewSize )
static_cast<SwNoTxtFrm*>(Lower())->GetNode()->GetOLENode() )
{
SwRect aClipRect;
- ::CalcClipRect( GetVirtDrawObj(), aClipRect, FALSE );
+ ::CalcClipRect( GetVirtDrawObj(), aClipRect, sal_False );
if ( aAdjustedNewSize.Width() > aClipRect.Width() )
{
aAdjustedNewSize.setWidth( aClipRect.Width() );
@@ -2179,19 +2194,19 @@ Size SwFlyFrm::ChgSize( const Size& aNewSize )
|*
|*************************************************************************/
-BOOL SwFlyFrm::IsLowerOf( const SwLayoutFrm* pUpperFrm ) const
+sal_Bool SwFlyFrm::IsLowerOf( const SwLayoutFrm* pUpperFrm ) const
{
ASSERT( GetAnchorFrm(), "8-( Fly is lost in Space." );
const SwFrm* pFrm = GetAnchorFrm();
do
{
if ( pFrm == pUpperFrm )
- return TRUE;
+ return sal_True;
pFrm = pFrm->IsFlyFrm()
? ((const SwFlyFrm*)pFrm)->GetAnchorFrm()
: pFrm->GetUpper();
} while ( pFrm );
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -2242,7 +2257,7 @@ void SwFrm::AppendFly( SwFlyFrm *pNew )
SwPageFrm *pTmp = pRoot->GetLastPage();
if ( pTmp->GetPhyPageNum() > 30 )
{
- for ( USHORT i = 0; i < 10; ++i )
+ for ( sal_uInt16 i = 0; i < 10; ++i )
{
pTmp = (SwPageFrm*)pTmp->GetPrev();
if( pTmp->GetPhyPageNum() <= pPage->GetPhyPageNum() )
@@ -2742,10 +2757,10 @@ SwTwips SwFlyFrm::CalcAutoWidth() const
|*************************************************************************/
/// OD 16.04.2003 #i13147# - If called for paint and the <SwNoTxtFrm> contains
/// a graphic, load of intrinsic graphic has to be avoided.
-BOOL SwFlyFrm::GetContour( PolyPolygon& rContour,
+sal_Bool SwFlyFrm::GetContour( PolyPolygon& rContour,
const sal_Bool _bForPaint ) const
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( GetFmt()->GetSurround().IsContour() && Lower() &&
Lower()->IsNoTxtFrm() )
{
@@ -2771,7 +2786,7 @@ BOOL SwFlyFrm::GetContour( PolyPolygon& rContour,
if( !pNd->HasContour() )
{
// OD 16.04.2003 #i13147# - no <CreateContour> for a graphic
- // during paint. Thus, return (value of <bRet> should be <FALSE>).
+ // during paint. Thus, return (value of <bRet> should be <sal_False>).
if ( pGrfNd && _bForPaint )
{
ASSERT( false, "SwFlyFrm::GetContour() - No Contour found at <SwNoTxtNode> during paint." );
@@ -2785,7 +2800,7 @@ BOOL SwFlyFrm::GetContour( PolyPolygon& rContour,
SwRect aClip;
SwRect aOrig;
Lower()->Calc();
- ((SwNoTxtFrm*)Lower())->GetGrfArea( aClip, &aOrig, FALSE );
+ ((SwNoTxtFrm*)Lower())->GetGrfArea( aClip, &aOrig, sal_False );
// OD 16.04.2003 #i13147# - copy method code <SvxContourDlg::ScaleContour(..)>
// in order to avoid that graphic has to be loaded for contour scale.
//SvxContourDlg::ScaleContour( rContour, aGrf, MAP_TWIP, aOrig.SSize() );
@@ -2798,7 +2813,7 @@ BOOL SwFlyFrm::GetContour( PolyPolygon& rContour,
double fScaleY;
Size aOrgSize;
Point aNewPoint;
- BOOL bPixelMap = aGrfMap.GetMapUnit() == MAP_PIXEL;
+ sal_Bool bPixelMap = aGrfMap.GetMapUnit() == MAP_PIXEL;
if ( bPixelMap )
aOrgSize = pOutDev->PixelToLogic( aGrfSize, aDispMap );
@@ -2810,11 +2825,11 @@ BOOL SwFlyFrm::GetContour( PolyPolygon& rContour,
fScaleX = (double) aOrig.Width() / aOrgSize.Width();
fScaleY = (double) aOrig.Height() / aOrgSize.Height();
- for ( USHORT j = 0, nPolyCount = rContour.Count(); j < nPolyCount; j++ )
+ for ( sal_uInt16 j = 0, nPolyCount = rContour.Count(); j < nPolyCount; j++ )
{
Polygon& rPoly = rContour[ j ];
- for ( USHORT i = 0, nCount = rPoly.GetSize(); i < nCount; i++ )
+ for ( sal_uInt16 i = 0, nCount = rPoly.GetSize(); i < nCount; i++ )
{
if ( bPixelMap )
aNewPoint = pOutDev->PixelToLogic( rPoly[ i ], aDispMap );
@@ -2838,7 +2853,7 @@ BOOL SwFlyFrm::GetContour( PolyPolygon& rContour,
aClip.Height( 1 );
rContour.Clip( aClip.SVRect() );
rContour.Optimize(POLY_OPTIMIZE_CLOSE);
- bRet = TRUE;
+ bRet = sal_True;
}
}
return bRet;
diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx
index 4a7b816acd73..e6f73c81c381 100644
--- a/sw/source/core/layout/flycnt.cxx
+++ b/sw/source/core/layout/flycnt.cxx
@@ -27,12 +27,14 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
#include <tools/bigint.hxx>
#include "pagefrm.hxx"
#include "cntfrm.hxx"
#include "flyfrm.hxx"
#include "txtfrm.hxx"
-#include "doc.hxx"
+#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include "viewsh.hxx"
#include "viewimp.hxx"
#include "pam.hxx"
@@ -85,7 +87,7 @@ using namespace ::com::sun::star;
SwFlyAtCntFrm::SwFlyAtCntFrm( SwFlyFrmFmt *pFmt, SwFrm* pSib, SwFrm *pAnch ) :
SwFlyFreeFrm( pFmt, pSib, pAnch )
{
- bAtCnt = TRUE;
+ bAtCnt = sal_True;
bAutoPosition = (FLY_AT_CHAR == pFmt->GetAnchor().GetAnchorId());
}
@@ -103,11 +105,11 @@ TYPEINIT1(SwFlyAtCntFrm,SwFlyFreeFrm);
void SwFlyAtCntFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
{
- USHORT nWhich = pNew ? pNew->Which() : 0;
+ sal_uInt16 nWhich = pNew ? pNew->Which() : 0;
const SwFmtAnchor *pAnch = 0;
if( RES_ATTRSET_CHG == nWhich && SFX_ITEM_SET ==
- ((SwAttrSetChg*)pNew)->GetChgSet()->GetItemState( RES_ANCHOR, FALSE,
+ ((SwAttrSetChg*)pNew)->GetChgSet()->GetItemState( RES_ANCHOR, sal_False,
(const SfxPoolItem**)&pAnch ))
; // Beim GetItemState wird der AnkerPointer gesetzt !
@@ -131,7 +133,7 @@ void SwFlyAtCntFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
SwCntntFrm *pCntnt = (SwCntntFrm*)GetAnchorFrm();
AnchorFrm()->RemoveFly( this );
- const BOOL bBodyFtn = (pCntnt->IsInDocBody() || pCntnt->IsInFtn());
+ const sal_Bool bBodyFtn = (pCntnt->IsInDocBody() || pCntnt->IsInFtn());
//Den neuen Anker anhand des NodeIdx suchen, am alten und
//neuen NodeIdx kann auch erkannt werden, in welche Richtung
@@ -193,7 +195,11 @@ void SwFlyAtCntFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
if ( !pCntnt )
{
SwCntntNode *pNode = aNewIdx.GetNode().GetCntntNode();
+<<<<<<< local
pCntnt = pNode->getLayoutFrm( getRootFrm(), &pOldAnchor->Frm().Pos(), 0, FALSE );
+=======
+ pCntnt = pNode->GetFrm( &pOldAnchor->Frm().Pos(), 0, sal_False );
+>>>>>>> other
ASSERT( pCntnt, "Neuen Anker nicht gefunden" );
}
//Flys haengen niemals an einem Follow sondern immer am
@@ -268,7 +274,7 @@ public:
SwOszControl( const SwFlyFrm *pFrm );
~SwOszControl();
bool ChkOsz();
- static BOOL IsInProgress( const SwFlyFrm *pFly );
+ static sal_Bool IsInProgress( const SwFlyFrm *pFly );
};
const SwFlyFrm *SwOszControl::pStk1 = 0;
const SwFlyFrm *SwOszControl::pStk2 = 0;
@@ -317,19 +323,19 @@ SwOszControl::~SwOszControl()
// <--
}
-BOOL SwOszControl::IsInProgress( const SwFlyFrm *pFly )
+sal_Bool SwOszControl::IsInProgress( const SwFlyFrm *pFly )
{
if ( SwOszControl::pStk1 && !pFly->IsLowerOf( SwOszControl::pStk1 ) )
- return TRUE;
+ return sal_True;
if ( SwOszControl::pStk2 && !pFly->IsLowerOf( SwOszControl::pStk2 ) )
- return TRUE;
+ return sal_True;
if ( SwOszControl::pStk3 && !pFly->IsLowerOf( SwOszControl::pStk3 ) )
- return TRUE;
+ return sal_True;
if ( SwOszControl::pStk4 && !pFly->IsLowerOf( SwOszControl::pStk4 ) )
- return TRUE;
+ return sal_True;
if ( SwOszControl::pStk5 && !pFly->IsLowerOf( SwOszControl::pStk5 ) )
- return TRUE;
- return FALSE;
+ return sal_True;
+ return sal_False;
}
bool SwOszControl::ChkOsz()
@@ -386,7 +392,7 @@ void SwFlyAtCntFrm::MakeAll()
// --> OD 2004-06-30 #i28701# - use new method <GetPageFrm()>
if( GetPageFrm() )
{
- bSetCompletePaintOnInvalidate = TRUE;
+ bSetCompletePaintOnInvalidate = sal_True;
{
SwFlyFrmFmt *pFmt = (SwFlyFrmFmt*)GetFmt();
const SwFmtFrmSize &rFrmSz = GetFmt()->GetFrmSize();
@@ -420,7 +426,7 @@ void SwFlyAtCntFrm::MakeAll()
if( pFooter && !pFooter->IsFooterFrm() )
pFooter = NULL;
bool bOsz = false;
- BOOL bExtra = Lower() && Lower()->IsColumnFrm();
+ sal_Bool bExtra = Lower() && Lower()->IsColumnFrm();
// --> OD 2004-08-25 #i3317# - boolean, to apply temporarly the
// 'straightforward positioning process' for the frame due to its
// overlapping with a previous column.
@@ -547,7 +553,7 @@ void SwFlyAtCntFrm::MakeAll()
// Spalten hinterlaesst, so drehen wir lieber hier eine weitere
// Runde und formatieren unseren Inhalt via FormatWidthCols nochmal.
_InvalidateSize();
- bExtra = FALSE; // Sicherhaltshalber gibt es nur eine Ehrenrunde.
+ bExtra = sal_False; // Sicherhaltshalber gibt es nur eine Ehrenrunde.
}
} while ( !IsValid() && !bOsz &&
// --> OD 2004-08-25 #i3317#
@@ -594,7 +600,7 @@ void SwFlyAtCntFrm::MakeAll()
// <--
}
// <--
- bSetCompletePaintOnInvalidate = FALSE;
+ bSetCompletePaintOnInvalidate = sal_False;
}
}
}
@@ -631,10 +637,10 @@ public:
SwDistance() { nMain = nSub = 0; }
SwDistance& operator=( const SwDistance &rTwo )
{ nMain = rTwo.nMain; nSub = rTwo.nSub; return *this; }
- BOOL operator<( const SwDistance& rTwo )
+ sal_Bool operator<( const SwDistance& rTwo )
{ return nMain < rTwo.nMain || ( nMain == rTwo.nMain && nSub &&
rTwo.nSub && nSub < rTwo.nSub ); }
- BOOL operator<=( const SwDistance& rTwo )
+ sal_Bool operator<=( const SwDistance& rTwo )
{ return nMain < rTwo.nMain || ( nMain == rTwo.nMain && ( !nSub ||
!rTwo.nSub || nSub <= rTwo.nSub ) ); }
};
@@ -690,7 +696,7 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet,
{
// OD 26.09.2003 - <rPt> point is left of environment of given content frame
// OD: seems not to be correct for vertical layout!?
- const SwFrm *pLay = pUp->GetLeaf( MAKEPAGE_NONE, FALSE, pCnt );
+ const SwFrm *pLay = pUp->GetLeaf( MAKEPAGE_NONE, sal_False, pCnt );
if( !pLay ||
(bVert && (pLay->Frm().Top() + pLay->Prt().Bottom()) <rPt.Y())||
(!bVert && (pLay->Frm().Left() + pLay->Prt().Right())<rPt.X()) )
@@ -716,10 +722,10 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet,
// <--
const SwFrm *pPre = pCnt;
- const SwFrm *pLay = pUp->GetLeaf( MAKEPAGE_NONE, TRUE, pCnt );
+ const SwFrm *pLay = pUp->GetLeaf( MAKEPAGE_NONE, sal_True, pCnt );
SwTwips nFrmTop = 0;
SwTwips nPrtHeight = 0;
- BOOL bSct = FALSE;
+ sal_Bool bSct = sal_False;
const SwSectionFrm *pSect = pUp->FindSctFrm();
if( pSect )
{
@@ -728,7 +734,7 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet,
}
if( pSect && !pSect->IsAnLower( pLay ) )
{
- bSct = FALSE;
+ bSct = sal_False;
const SwSectionFrm* pNxtSect = pLay ? pLay->FindSctFrm() : 0;
if( pSect->IsAnFollow( pNxtSect ) )
{
@@ -800,13 +806,13 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet,
else
rRet.nMain += nPrtHeight;
pPre = pLay;
- pLay = pLay->GetLeaf( MAKEPAGE_NONE, TRUE, pCnt );
+ pLay = pLay->GetLeaf( MAKEPAGE_NONE, sal_True, pCnt );
if( pSect && !pSect->IsAnLower( pLay ) )
{ // If we're leaving a SwSectionFrm, the next Leaf-Frm
// is the part of the upper below the SectionFrm.
const SwSectionFrm* pNxtSect = pLay ?
pLay->FindSctFrm() : NULL;
- bSct = FALSE;
+ bSct = sal_False;
if( pSect->IsAnFollow( pNxtSect ) )
{
pSect = pNxtSect;
@@ -883,9 +889,9 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet,
return 0;
}
-ULONG MA_FASTCALL lcl_FindCntDiff( const Point &rPt, const SwLayoutFrm *pLay,
+sal_uLong MA_FASTCALL lcl_FindCntDiff( const Point &rPt, const SwLayoutFrm *pLay,
const SwCntntFrm *& rpCnt,
- const BOOL bBody, const BOOL bFtn )
+ const sal_Bool bBody, const sal_Bool bFtn )
{
//Sucht unterhalb von pLay den dichtesten Cnt zum Point. Der Bezugspunkt
//der Cntnts ist immer die linke obere Ecke.
@@ -896,8 +902,8 @@ ULONG MA_FASTCALL lcl_FindCntDiff( const Point &rPt, const SwLayoutFrm *pLay,
#endif
rpCnt = 0;
- ULONG nDistance = ULONG_MAX;
- ULONG nNearest = ULONG_MAX;
+ sal_uLong nDistance = ULONG_MAX;
+ sal_uLong nNearest = ULONG_MAX;
const SwCntntFrm *pCnt = pLay->ContainsCntnt();
while ( pCnt && (bBody != pCnt->IsInDocBody() || bFtn != pCnt->IsInFtn()))
@@ -919,7 +925,7 @@ ULONG MA_FASTCALL lcl_FindCntDiff( const Point &rPt, const SwLayoutFrm *pLay,
Min( pCnt->Frm().Top(), rPt.Y() );
BigInt dX1( dX ), dY1( dY );
dX1 *= dX1; dY1 *= dY1;
- const ULONG nDiff = ::SqRt( dX1 + dY1 );
+ const sal_uLong nDiff = ::SqRt( dX1 + dY1 );
if ( pCnt->Frm().Top() <= rPt.Y() )
{
if ( nDiff < nDistance )
@@ -948,7 +954,7 @@ ULONG MA_FASTCALL lcl_FindCntDiff( const Point &rPt, const SwLayoutFrm *pLay,
}
const SwCntntFrm * MA_FASTCALL lcl_FindCnt( const Point &rPt, const SwCntntFrm *pCnt,
- const BOOL bBody, const BOOL bFtn )
+ const sal_Bool bBody, const sal_Bool bFtn )
{
//Sucht ausgehen von pCnt denjenigen CntntFrm, dessen linke obere
//Ecke am dichtesten am Point liegt.
@@ -962,7 +968,7 @@ const SwCntntFrm * MA_FASTCALL lcl_FindCnt( const Point &rPt, const SwCntntFrm *
//des Point sitzt.
const SwCntntFrm *pRet, *pNew;
const SwLayoutFrm *pLay = pCnt->FindPageFrm();
- ULONG nDist;
+ sal_uLong nDist;
nDist = ::lcl_FindCntDiff( rPt, pLay, pNew, bBody, bFtn );
if ( pNew )
@@ -972,16 +978,16 @@ const SwCntntFrm * MA_FASTCALL lcl_FindCnt( const Point &rPt, const SwCntntFrm *
nDist = ULONG_MAX;
}
const SwCntntFrm *pNearest = pRet;
- ULONG nNearest = nDist;
+ sal_uLong nNearest = nDist;
if ( pLay )
{
const SwLayoutFrm *pPge = pLay;
- ULONG nOldNew = ULONG_MAX;
- for ( USHORT i = 0; pPge->GetPrev() && (i < 3); ++i )
+ sal_uLong nOldNew = ULONG_MAX;
+ for ( sal_uInt16 i = 0; pPge->GetPrev() && (i < 3); ++i )
{
pPge = (SwLayoutFrm*)pPge->GetPrev();
- const ULONG nNew = ::lcl_FindCntDiff( rPt, pPge, pNew, bBody, bFtn );
+ const sal_uLong nNew = ::lcl_FindCntDiff( rPt, pPge, pNew, bBody, bFtn );
if ( nNew < nDist )
{
if ( pNew->Frm().Top() <= rPt.Y() )
@@ -1003,10 +1009,10 @@ const SwCntntFrm * MA_FASTCALL lcl_FindCnt( const Point &rPt, const SwCntntFrm *
}
pPge = pLay;
nOldNew = ULONG_MAX;
- for ( USHORT j = 0; pPge->GetNext() && (j < 3); ++j )
+ for ( sal_uInt16 j = 0; pPge->GetNext() && (j < 3); ++j )
{
pPge = (SwLayoutFrm*)pPge->GetNext();
- const ULONG nNew = ::lcl_FindCntDiff( rPt, pPge, pNew, bBody, bFtn );
+ const sal_uLong nNew = ::lcl_FindCntDiff( rPt, pPge, pNew, bBody, bFtn );
if ( nNew < nDist )
{
if ( pNew->Frm().Top() <= rPt.Y() )
@@ -1048,7 +1054,7 @@ void lcl_PointToPrt( Point &rPoint, const SwFrm *pFrm )
}
const SwCntntFrm *FindAnchor( const SwFrm *pOldAnch, const Point &rNew,
- const BOOL bBodyOnly )
+ const sal_Bool bBodyOnly )
{
//Zu der angegebenen DokumentPosition wird der dichteste Cnt im
//Textfluss gesucht. AusgangsFrm ist der uebergebene Anker.
@@ -1066,14 +1072,14 @@ const SwCntntFrm *FindAnchor( const SwFrm *pOldAnch, const Point &rNew,
SwRect aTmpRect( aTmp, Size(0,0) );
pTmpLay = (SwLayoutFrm*)::FindPage( aTmpRect, pTmpLay->Lower() );
}
- pCnt = pTmpLay->GetCntntPos( aTmp, FALSE, bBodyOnly );
+ pCnt = pTmpLay->GetCntntPos( aTmp, sal_False, bBodyOnly );
}
//Beim Suchen darauf achten, dass die Bereiche sinnvoll erhalten
//bleiben. D.h. in diesem Fall nicht in Header/Footer hinein und
//nicht aus Header/Footer hinaus.
- const BOOL bBody = pCnt->IsInDocBody() || bBodyOnly;
- const BOOL bFtn = !bBodyOnly && pCnt->IsInFtn();
+ const sal_Bool bBody = pCnt->IsInDocBody() || bBodyOnly;
+ const sal_Bool bFtn = !bBodyOnly && pCnt->IsInFtn();
Point aNew( rNew );
if ( bBody )
@@ -1095,7 +1101,7 @@ const SwCntntFrm *FindAnchor( const SwFrm *pOldAnch, const Point &rNew,
//So gibt es kein Problem mit Spalten.
Point aTmp( aNew );
const SwCntntFrm *pTmp = pCnt->FindPageFrm()->
- GetCntntPos( aTmp, FALSE, TRUE, FALSE );
+ GetCntntPos( aTmp, sal_False, sal_True, sal_False );
if ( pTmp && pTmp->Frm().IsInside( aNew ) )
return pTmp;
}
@@ -1109,7 +1115,7 @@ const SwCntntFrm *FindAnchor( const SwFrm *pOldAnch, const Point &rNew,
SwDistance nUp, nUpLst;
::lcl_CalcDownDist( nUp, aNew, pUpFrm );
SwDistance nDown = nUp;
- BOOL bNegAllowed = TRUE;//Einmal aus dem negativen Bereich heraus lassen.
+ sal_Bool bNegAllowed = sal_True;//Einmal aus dem negativen Bereich heraus lassen.
do
{
pUpLst = pUpFrm; nUpLst = nUp;
@@ -1137,7 +1143,7 @@ const SwCntntFrm *FindAnchor( const SwFrm *pOldAnch, const Point &rNew,
nUp.nMain = LONG_MAX;
if ( nUp.nMain >= 0 && LONG_MAX != nUp.nMain )
{
- bNegAllowed = FALSE;
+ bNegAllowed = sal_False;
if ( nUpLst.nMain < 0 ) //nicht den falschen erwischen, wenn der Wert
//gerade von negativ auf positiv gekippt ist.
{ pUpLst = pUpFrm;
@@ -1335,7 +1341,7 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
SwFlyFrmFmt *pFmt = (SwFlyFrmFmt*)GetFmt();
const SwFmtSurround& rSurround = pFmt->GetSurround();
- const BOOL bWrapThrough =
+ const sal_Bool bWrapThrough =
rSurround.GetSurround() == SURROUND_THROUGHT;
SwTwips nBaseOfstForFly = 0;
const SwFrm* pTmpFrm = pFrm ? pFrm : pCnt;
@@ -1369,7 +1375,7 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
nX = rNew.X() - pFrm->Frm().Left() - nBaseOfstForFly;
}
}
- GetFmt()->GetDoc()->StartUndo( UNDO_START, NULL );
+ GetFmt()->GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
if( pCnt != GetAnchorFrm() || ( IsAutoPos() && pCnt->IsTxtFrm() &&
GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::HTML_MODE)) )
@@ -1420,11 +1426,11 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
const Point aRelPos = bVert ? Point( -nY, nX ) : Point( nX, nY );
ChgRelPos( aRelPos );
- GetFmt()->GetDoc()->EndUndo( UNDO_END, NULL );
+ GetFmt()->GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
if ( pOldPage != FindPageFrm() )
::Notify_Background( GetVirtDrawObj(), pOldPage, aOld, PREP_FLY_LEAVE,
- FALSE );
+ sal_False );
}
// OD 2004-08-12 #i32795# - Note: method no longer used in <flyincnt.cxx>
@@ -1437,9 +1443,9 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
// if( pFlow && pFlow->IsAnyJoinLocked() )
// return;
-// USHORT nCnt = 0;
+// sal_uInt16 nCnt = 0;
-// BOOL bContinue = FALSE;
+// sal_Bool bContinue = sal_False;
// do
// {
// if ( ++nCnt == 10 )
@@ -1448,7 +1454,7 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
// break;
// }
-// const BOOL bSetComplete = !pFrm->IsValid();
+// const sal_Bool bSetComplete = !pFrm->IsValid();
// const SwRect aOldFrm( pFrm->Frm() );
// const SwRect aOldPrt( pFrm->Prt() );
@@ -1479,7 +1485,7 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
// (((SwFlyFrm*)pUp)->IsFlyAtCntFrm() &&
// SwOszControl::IsInProgress( (const SwFlyFrm*)pUp )) )
// {
-// bContinue = FALSE;
+// bContinue = sal_False;
// }
// }
// } while ( bContinue );
@@ -1521,7 +1527,7 @@ void SwFlyAtCntFrm::MakeObjPos()
}
// OD 2004-03-24 #i26791# - validate position flag here.
- bValidPos = TRUE;
+ bValidPos = sal_True;
// --> OD 2004-10-22 #i35911# - no calculation of new position, if
// anchored object is marked that it clears its environment and its
diff --git a/sw/source/core/layout/flyincnt.cxx b/sw/source/core/layout/flyincnt.cxx
index 8a1f49844e52..f0b3a5995a5c 100644
--- a/sw/source/core/layout/flyincnt.cxx
+++ b/sw/source/core/layout/flyincnt.cxx
@@ -55,7 +55,7 @@ void DeepCalc( const SwFrm *pFrm );
SwFlyInCntFrm::SwFlyInCntFrm( SwFlyFrmFmt *pFmt, SwFrm* pSib, SwFrm *pAnch ) :
SwFlyFrm( pFmt, pSib, pAnch )
{
- bInCnt = bInvalidLayout = bInvalidCntnt = TRUE;
+ bInCnt = bInvalidLayout = bInvalidCntnt = sal_True;
SwTwips nRel = pFmt->GetVertOrient().GetPos();
// OD 2004-05-27 #i26791# - member <aRelPos> moved to <SwAnchoredObject>
Point aRelPos;
@@ -108,8 +108,8 @@ void SwFlyInCntFrm::SetRefPoint( const Point& rPoint,
if( pNotify )
{
InvalidatePage();
- bValidPos = FALSE;
- bInvalid = TRUE;
+ bValidPos = sal_False;
+ bInvalid = sal_True;
Calc();
delete pNotify;
}
@@ -125,14 +125,14 @@ void SwFlyInCntFrm::SetRefPoint( const Point& rPoint,
|*************************************************************************/
void SwFlyInCntFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
{
- BOOL bCallPrepare = FALSE;
- USHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
+ sal_Bool bCallPrepare = sal_False;
+ sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
if( RES_ATTRSET_CHG == nWhich )
{
if( SFX_ITEM_SET == ((SwAttrSetChg*)pNew)->GetChgSet()->
- GetItemState( RES_SURROUND, FALSE ) ||
+ GetItemState( RES_SURROUND, sal_False ) ||
SFX_ITEM_SET == ((SwAttrSetChg*)pNew)->GetChgSet()->
- GetItemState( RES_FRMMACRO, FALSE ) )
+ GetItemState( RES_FRMMACRO, sal_False ) )
{
SwAttrSetChg aOld( *(SwAttrSetChg*)pOld );
SwAttrSetChg aNew( *(SwAttrSetChg*)pNew );
@@ -144,19 +144,19 @@ void SwFlyInCntFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
if( aNew.Count() )
{
SwFlyFrm::Modify( &aOld, &aNew );
- bCallPrepare = TRUE;
+ bCallPrepare = sal_True;
}
}
else if( ((SwAttrSetChg*)pNew)->GetChgSet()->Count())
{
SwFlyFrm::Modify( pOld, pNew );
- bCallPrepare = TRUE;
+ bCallPrepare = sal_True;
}
}
else if( nWhich != RES_SURROUND && RES_FRMMACRO != nWhich )
{
SwFlyFrm::Modify( pOld, pNew );
- bCallPrepare = TRUE;
+ bCallPrepare = sal_True;
}
if ( bCallPrepare && GetAnchorFrm() )
@@ -202,7 +202,7 @@ void SwFlyInCntFrm::MakeObjPos()
{
if ( !bValidPos )
{
- bValidPos = TRUE;
+ bValidPos = sal_True;
SwFlyFrmFmt *pFmt = (SwFlyFrmFmt*)GetFmt();
const SwFmtVertOrient &rVert = pFmt->GetVertOrient();
//Und ggf. noch die aktuellen Werte im Format updaten, dabei darf
@@ -305,14 +305,14 @@ void SwFlyInCntFrm::MakeAll()
const SwBorderAttrs &rAttrs = *aAccess.Get();
if ( IsClipped() )
- bValidSize = bHeightClipped = bWidthClipped = FALSE;
+ bValidSize = bHeightClipped = bWidthClipped = sal_False;
while ( !bValidPos || !bValidSize || !bValidPrtArea )
{
//Nur einstellen wenn das Flag gesetzt ist!!
if ( !bValidSize )
{
- bValidPrtArea = FALSE;
+ bValidPrtArea = sal_False;
/*
// This is also done in the Format function, so I think
// this code is not necessary anymore:
@@ -350,8 +350,8 @@ void SwFlyInCntFrm::MakeAll()
Frm().Width() > pFrm->Prt().Width() )
{
Frm().Width( pFrm->Prt().Width() );
- bValidPrtArea = FALSE;
- bWidthClipped = TRUE;
+ bValidPrtArea = sal_False;
+ bWidthClipped = sal_True;
}
}
// <--
diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx
index 813688e27eb6..38f91d0e509f 100644
--- a/sw/source/core/layout/flylay.cxx
+++ b/sw/source/core/layout/flylay.cxx
@@ -134,7 +134,7 @@ TYPEINIT1(SwFlyFreeFrm,SwFlyFrm);
void SwFlyFreeFrm::NotifyBackground( SwPageFrm *pPageFrm,
const SwRect& rRect, PrepareHint eHint )
{
- ::Notify_Background( GetVirtDrawObj(), pPageFrm, rRect, eHint, TRUE );
+ ::Notify_Background( GetVirtDrawObj(), pPageFrm, rRect, eHint, sal_True );
}
/*************************************************************************
@@ -174,7 +174,7 @@ void SwFlyFreeFrm::MakeAll()
if ( IsClipped() )
{
- bValidSize = bHeightClipped = bWidthClipped = FALSE;
+ bValidSize = bHeightClipped = bWidthClipped = sal_False;
// --> OD 2004-11-03 #114798# - no invalidation of position,
// if anchored object is anchored inside a Writer fly frame,
// its position is already locked, and it follows the text flow.
@@ -186,14 +186,14 @@ void SwFlyFreeFrm::MakeAll()
GetFrmFmt().GetFollowTextFlow().GetValue() ) )
// <--
{
- bValidPos = FALSE;
+ bValidPos = sal_False;
}
// <--
}
// FME 2007-08-30 #i81146# new loop control
- USHORT nLoopControlRuns = 0;
- const USHORT nLoopControlMax = 10;
+ sal_uInt16 nLoopControlRuns = 0;
+ const sal_uInt16 nLoopControlMax = 10;
while ( !bValidPos || !bValidSize || !bValidPrtArea || bFormatHeightOnly )
{
@@ -208,7 +208,7 @@ void SwFlyFreeFrm::MakeAll()
//Nur einstellen wenn das Flag gesetzt ist!!
if ( !bValidSize )
{
- bValidPrtArea = FALSE;
+ bValidPrtArea = sal_False;
/*
// This is also done in the Format function, so I think
// this code is not necessary anymore:
@@ -221,7 +221,7 @@ void SwFlyFreeFrm::MakeAll()
if( nDiff )
{
(aFrm.*fnRect->fnAddRight)( nDiff );
- bValidPos = FALSE;
+ bValidPos = sal_False;
}
*/
}
@@ -231,9 +231,9 @@ void SwFlyFreeFrm::MakeAll()
if ( !bValidSize || bFormatHeightOnly )
{
- bValidSize = FALSE;
+ bValidSize = sal_False;
Format( &rAttrs );
- bFormatHeightOnly = FALSE;
+ bFormatHeightOnly = sal_False;
}
if ( !bValidPos )
@@ -242,7 +242,7 @@ void SwFlyFreeFrm::MakeAll()
// OD 2004-03-23 #i26791# - use new method <MakeObjPos()>
// --> OD 2004-11-15 #i34753# - no positioning, if requested.
if ( IsNoMakePos() )
- bValidPos = TRUE;
+ bValidPos = sal_True;
else
// OD 2004-03-23 #i26791# - use new method <MakeObjPos()>
MakeObjPos();
@@ -251,10 +251,10 @@ void SwFlyFreeFrm::MakeAll()
{
if( !bValidPos && GetAnchorFrm()->IsInSct() &&
!GetAnchorFrm()->FindSctFrm()->IsValid() )
- bValidPos = TRUE;
+ bValidPos = sal_True;
}
else
- bValidSize = FALSE;
+ bValidSize = sal_False;
}
}
@@ -341,8 +341,8 @@ void SwFlyFreeFrm::CheckClip( const SwFmtFrmSize &rSz )
const SwVirtFlyDrawObj *pObj = GetVirtDrawObj();
SwRect aClip, aTmpStretch;
- ::CalcClipRect( pObj, aClip, TRUE );
- ::CalcClipRect( pObj, aTmpStretch, FALSE );
+ ::CalcClipRect( pObj, aClip, sal_True );
+ ::CalcClipRect( pObj, aTmpStretch, sal_False );
aClip._Intersection( aTmpStretch );
const long nBot = Frm().Top() + Frm().Height();
@@ -350,11 +350,11 @@ void SwFlyFreeFrm::CheckClip( const SwFmtFrmSize &rSz )
const long nClipBot = aClip.Top() + aClip.Height();
const long nClipRig = aClip.Left() + aClip.Width();
- const BOOL bBot = nBot > nClipBot;
- const BOOL bRig = nRig > nClipRig;
+ const sal_Bool bBot = nBot > nClipBot;
+ const sal_Bool bRig = nRig > nClipRig;
if ( bBot || bRig )
{
- BOOL bAgain = FALSE;
+ sal_Bool bAgain = sal_False;
// --> OD 2004-11-12 #i37068# - no move, if it's requested
if ( bBot && !IsNoMoveOnCheckClip() &&
!GetDrawObjs() && !GetAnchorFrm()->IsInTab() )
@@ -370,8 +370,8 @@ void SwFlyFreeFrm::CheckClip( const SwFmtFrmSize &rSz )
const long nOld = Frm().Top();
Frm().Pos().Y() = Max( aClip.Top(), nClipBot - Frm().Height() );
if ( Frm().Top() != nOld )
- bAgain = TRUE;
- bHeightClipped = TRUE;
+ bAgain = sal_True;
+ bHeightClipped = sal_True;
}
}
if ( bRig )
@@ -386,12 +386,12 @@ void SwFlyFreeFrm::CheckClip( const SwFmtFrmSize &rSz )
if( rH.GetHoriOrient() == text::HoriOrientation::LEFT )
Frm().Pos().X() = nOld;
else
- bAgain = TRUE;
+ bAgain = sal_True;
}
- bWidthClipped = TRUE;
+ bWidthClipped = sal_True;
}
if ( bAgain )
- bValidSize = FALSE;
+ bValidSize = sal_False;
else
{
//Wenn wir hier ankommen ragt der Frm in unerlaubte Bereiche
@@ -412,7 +412,7 @@ void SwFlyFreeFrm::CheckClip( const SwFmtFrmSize &rSz )
nDiff -= aFrmRect.Top(); //nDiff ist die verfuegbare Strecke.
nDiff = aFrmRect.Height() - nDiff;
aFrmRect.Height( aFrmRect.Height() - nDiff );
- bHeightClipped = TRUE;
+ bHeightClipped = sal_True;
}
if ( bRig )
{
@@ -420,7 +420,7 @@ void SwFlyFreeFrm::CheckClip( const SwFmtFrmSize &rSz )
nDiff -= aFrmRect.Left();//nDiff ist die verfuegbare Strecke.
nDiff = aFrmRect.Width() - nDiff;
aFrmRect.Width( aFrmRect.Width() - nDiff );
- bWidthClipped = TRUE;
+ bWidthClipped = sal_True;
}
// OD 06.08.2003 #i17297#, #111066#, #111070# - no proportional
@@ -454,14 +454,14 @@ void SwFlyFreeFrm::CheckClip( const SwFmtFrmSize &rSz )
{
aFrmRect.Height( aFrmRect.Width() * aOldSize.Height() /
aOldSize.Width() );
- bHeightClipped = TRUE;
+ bHeightClipped = sal_True;
}
//Hoehe angepasst? - Breite dann proportional verkleinern
else if( aFrmRect.Height() != aOldSize.Height() )
{
aFrmRect.Width( aFrmRect.Height() * aOldSize.Width() /
aOldSize.Height() );
- bWidthClipped = TRUE;
+ bWidthClipped = sal_True;
}
// OD 07.08.2003 #i17297#, #111066#, #111070# - reactivate change
@@ -510,7 +510,7 @@ void SwFlyFreeFrm::CheckClip( const SwFmtFrmSize &rSz )
::CalcCntnt( this );
ColUnlock();
if ( !bValidSize && !bWidthClipped )
- bFormatHeightOnly = bValidSize = TRUE;
+ bFormatHeightOnly = bValidSize = sal_True;
}
else
{
@@ -551,7 +551,7 @@ bool SwFlyFreeFrm::IsFormatPossible() const
SwFlyLayFrm::SwFlyLayFrm( SwFlyFrmFmt *pFmt, SwFrm* pSib, SwFrm *pAnch ) :
SwFlyFreeFrm( pFmt, pSib, pAnch )
{
- bLayout = TRUE;
+ bLayout = sal_True;
}
// --> OD 2004-06-29 #i28701#
@@ -568,11 +568,11 @@ TYPEINIT1(SwFlyLayFrm,SwFlyFreeFrm);
void SwFlyLayFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
{
- USHORT nWhich = pNew ? pNew->Which() : 0;
+ sal_uInt16 nWhich = pNew ? pNew->Which() : 0;
SwFmtAnchor *pAnch = 0;
if( RES_ATTRSET_CHG == nWhich && SFX_ITEM_SET ==
- ((SwAttrSetChg*)pNew)->GetChgSet()->GetItemState( RES_ANCHOR, FALSE,
+ ((SwAttrSetChg*)pNew)->GetChgSet()->GetItemState( RES_ANCHOR, sal_False,
(const SfxPoolItem**)&pAnch ))
; // Beim GetItemState wird der AnkerPointer gesetzt !
@@ -599,10 +599,15 @@ void SwFlyLayFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
if ( FLY_AT_PAGE == pAnch->GetAnchorId() )
{
+<<<<<<< local
USHORT nPgNum = pAnch->GetPageNum();
SwRootFrm *pRoot = getRootFrm();
+=======
+ sal_uInt16 nPgNum = pAnch->GetPageNum();
+ SwRootFrm *pRoot = FindRootFrm();
+>>>>>>> other
SwPageFrm *pTmpPage = (SwPageFrm*)pRoot->Lower();
- for ( USHORT i = 1; (i <= nPgNum) && pTmpPage; ++i,
+ for ( sal_uInt16 i = 1; (i <= nPgNum) && pTmpPage; ++i,
pTmpPage = (SwPageFrm*)pTmpPage->GetNext() )
{
if ( i == nPgNum )
@@ -622,7 +627,11 @@ void SwFlyLayFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
{
SwNodeIndex aIdx( pAnch->GetCntntAnchor()->nNode );
SwCntntFrm *pCntnt = GetFmt()->GetDoc()->GetNodes().GoNext( &aIdx )->
+<<<<<<< local
GetCntntNode()->getLayoutFrm( getRootFrm(), 0, 0, FALSE );
+=======
+ GetCntntNode()->GetFrm( 0, 0, sal_False );
+>>>>>>> other
if( pCntnt )
{
SwFlyFrm *pTmp = pCntnt->FindFlyFrm();
@@ -673,7 +682,7 @@ void SwPageFrm::AppendFlyToPage( SwFlyFrm *pNew )
const SwFlyFrm* pFly = pNew->GetAnchorFrm()->FindFlyFrm();
if ( pFly && pObj->GetOrdNum() < pFly->GetVirtDrawObj()->GetOrdNum() )
{
- UINT32 nNewNum = pFly->GetVirtDrawObj()->GetOrdNumDirect();
+ sal_uInt32 nNewNum = pFly->GetVirtDrawObj()->GetOrdNumDirect();
if ( pObj->GetPage() )
pObj->GetPage()->SetObjectOrdNum( pObj->GetOrdNumDirect(), nNewNum);
else
@@ -725,7 +734,7 @@ void SwPageFrm::AppendFlyToPage( SwFlyFrm *pNew )
if ( pNew->GetDrawObjs() )
{
SwSortedObjs &rObjs = *pNew->GetDrawObjs();
- for ( USHORT i = 0; i < rObjs.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i )
{
SwAnchoredObject* pTmpObj = rObjs[i];
if ( pTmpObj->ISA(SwFlyFrm) )
@@ -764,8 +773,13 @@ void SwPageFrm::AppendFlyToPage( SwFlyFrm *pNew )
void SwPageFrm::RemoveFlyFromPage( SwFlyFrm *pToRemove )
{
+<<<<<<< local
const UINT32 nOrdNum = pToRemove->GetVirtDrawObj()->GetOrdNum();
getRootFrm()->GetDrawPage()->RemoveObject( nOrdNum );
+=======
+ const sal_uInt32 nOrdNum = pToRemove->GetVirtDrawObj()->GetOrdNum();
+ FindRootFrm()->GetDrawPage()->RemoveObject( nOrdNum );
+>>>>>>> other
pToRemove->GetVirtDrawObj()->ReferencedObj().SetOrdNum( nOrdNum );
if ( GetUpper() )
@@ -944,7 +958,7 @@ void SwPageFrm::AppendDrawObjToPage( SwAnchoredObject& _rNewObj )
if ( pFlyFrm &&
_rNewObj.GetDrawObj()->GetOrdNum() < pFlyFrm->GetVirtDrawObj()->GetOrdNum() )
{
- UINT32 nNewNum = pFlyFrm->GetVirtDrawObj()->GetOrdNumDirect();
+ sal_uInt32 nNewNum = pFlyFrm->GetVirtDrawObj()->GetOrdNumDirect();
if ( _rNewObj.GetDrawObj()->GetPage() )
_rNewObj.DrawObj()->GetPage()->SetObjectOrdNum(
_rNewObj.GetDrawObj()->GetOrdNumDirect(), nNewNum);
@@ -1063,9 +1077,9 @@ void SwPageFrm::PlaceFly( SwFlyFrm* pFly, SwFlyFrmFmt* pFmt )
// --> OD 2004-07-06 #i28701# - if document compatibility option 'Consider
// wrapping style influence on object positioning' is ON, the clip area
// corresponds to the one as the object doesn't follows the text flow.
-BOOL CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, BOOL bMove )
+sal_Bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, sal_Bool bMove )
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
if ( pSdrObj->ISA(SwVirtFlyDrawObj) )
{
const SwFlyFrm* pFly = ((const SwVirtFlyDrawObj*)pSdrObj)->GetFlyFrm();
@@ -1189,7 +1203,7 @@ BOOL CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, BOOL bMove )
SWRECTFN( pClip )
const SwLayoutFrm *pUp = pClip->GetUpper();
const SwFrm *pCell = pUp->IsCellFrm() ? pUp : 0;
- USHORT nType = bMove ? FRM_ROOT | FRM_FLY | FRM_HEADER |
+ sal_uInt16 nType = bMove ? FRM_ROOT | FRM_FLY | FRM_HEADER |
FRM_FOOTER | FRM_FTN
: FRM_BODY | FRM_FLY | FRM_HEADER |
FRM_FOOTER | FRM_CELL| FRM_FTN;
@@ -1384,7 +1398,7 @@ BOOL CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, BOOL bMove )
}
else
{
- bRet = FALSE;
+ bRet = sal_False;
}
}
}
diff --git a/sw/source/core/layout/flypos.cxx b/sw/source/core/layout/flypos.cxx
index f6dedb46a66f..655b5c4cba12 100644
--- a/sw/source/core/layout/flypos.cxx
+++ b/sw/source/core/layout/flypos.cxx
@@ -44,10 +44,10 @@
SV_IMPL_OP_PTRARR_SORT( SwPosFlyFrms, SwPosFlyFrmPtr )
SwPosFlyFrm::SwPosFlyFrm( const SwNodeIndex& rIdx, const SwFrmFmt* pFmt,
- USHORT nArrPos )
+ sal_uInt16 nArrPos )
: pFrmFmt( pFmt ), pNdIdx( (SwNodeIndex*) &rIdx )
{
- BOOL bFnd = FALSE;
+ sal_Bool bFnd = sal_False;
const SwFmtAnchor& rAnchor = pFmt->GetAnchor();
if (FLY_AT_PAGE == rAnchor.GetAnchorId())
{
@@ -58,21 +58,33 @@ SwPosFlyFrm::SwPosFlyFrm( const SwNodeIndex& rIdx, const SwFrmFmt* pFmt,
if( RES_FLYFRMFMT == pFmt->Which() )
{
// Schauen, ob es ein SdrObject dafuer gibt
+<<<<<<< local
SwFlyFrm* pFly = SwIterator<SwFlyFrm,SwFmt>::FirstElement(*pFmt);
if( pFly )
{
nOrdNum = pFly->GetVirtDrawObj()->GetOrdNum();
bFnd = TRUE;
+=======
+ if( aIter.First( TYPE( SwFlyFrm) ) )
+ nOrdNum = ((SwFlyFrm*)aIter())->GetVirtDrawObj()->GetOrdNum(),
+ bFnd = sal_True;
+>>>>>>> other
}
}
else if( RES_DRAWFRMFMT == pFmt->Which() )
{
// Schauen, ob es ein SdrObject dafuer gibt
+<<<<<<< local
SwDrawContact* pContact = SwIterator<SwDrawContact,SwFmt>::FirstElement(*pFmt);
if( pContact )
{
nOrdNum = pContact->GetMaster()->GetOrdNum();
bFnd = TRUE;
+=======
+ if( aIter.First( TYPE(SwDrawContact) ) )
+ nOrdNum = ((SwDrawContact*)aIter())->GetMaster()->GetOrdNum(),
+ bFnd = sal_True;
+>>>>>>> other
}
}
}
@@ -93,12 +105,12 @@ SwPosFlyFrm::~SwPosFlyFrm()
}
}
-BOOL SwPosFlyFrm::operator==( const SwPosFlyFrm& )
+sal_Bool SwPosFlyFrm::operator==( const SwPosFlyFrm& )
{
- return FALSE; // FlyFrames koennen auf der gleichen Position stehen
+ return sal_False; // FlyFrames koennen auf der gleichen Position stehen
}
-BOOL SwPosFlyFrm::operator<( const SwPosFlyFrm& rPosFly )
+sal_Bool SwPosFlyFrm::operator<( const SwPosFlyFrm& rPosFly )
{
if( pNdIdx->GetIndex() == rPosFly.pNdIdx->GetIndex() )
{
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index 666fa713a537..cf3847aa613c 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -86,17 +86,17 @@
#include <switerator.hxx>
// ftnfrm.cxx:
-void lcl_RemoveFtns( SwFtnBossFrm* pBoss, BOOL bPageOnly, BOOL bEndNotes );
+void lcl_RemoveFtns( SwFtnBossFrm* pBoss, sal_Bool bPageOnly, sal_Bool bEndNotes );
using namespace ::com::sun::star;
-BOOL bObjsDirect = TRUE;
-BOOL bDontCreateObjects = FALSE;
-BOOL bSetCompletePaintOnInvalidate = FALSE;
+sal_Bool bObjsDirect = sal_True;
+sal_Bool bDontCreateObjects = sal_False;
+sal_Bool bSetCompletePaintOnInvalidate = sal_False;
-BYTE StackHack::nCnt = 0;
-BOOL StackHack::bLocked = FALSE;
+sal_uInt8 StackHack::nCnt = 0;
+sal_Bool StackHack::bLocked = sal_False;
@@ -106,7 +106,7 @@ SwFrmNotify::SwFrmNotify( SwFrm *pF ) :
pFrm( pF ),
aFrm( pF->Frm() ),
aPrt( pF->Prt() ),
- bInvaKeep( FALSE ),
+ bInvaKeep( sal_False ),
bValidSize( pF->GetValidSizeFlag() ),
mbFrmDeleted( false ) // #i49383#
{
@@ -122,8 +122,8 @@ SwFrmNotify::SwFrmNotify( SwFrm *pF ) :
}
bHadFollow = pF->IsCntntFrm() ?
- (((SwCntntFrm*)pF)->GetFollow() ? TRUE : FALSE) :
- FALSE;
+ (((SwCntntFrm*)pF)->GetFollow() ? sal_True : sal_False) :
+ sal_False;
}
/*************************************************************************/
@@ -137,12 +137,12 @@ SwFrmNotify::~SwFrmNotify()
}
SWRECTFN( pFrm )
- const BOOL bAbsP = POS_DIFF( aFrm, pFrm->Frm() );
- const BOOL bChgWidth =
+ const sal_Bool bAbsP = POS_DIFF( aFrm, pFrm->Frm() );
+ const sal_Bool bChgWidth =
(aFrm.*fnRect->fnGetWidth)() != (pFrm->Frm().*fnRect->fnGetWidth)();
- const BOOL bChgHeight =
+ const sal_Bool bChgHeight =
(aFrm.*fnRect->fnGetHeight)()!=(pFrm->Frm().*fnRect->fnGetHeight)();
- const BOOL bChgFlyBasePos = pFrm->IsTxtFrm() &&
+ const sal_Bool bChgFlyBasePos = pFrm->IsTxtFrm() &&
( ( mnFlyAnchorOfst != ((SwTxtFrm*)pFrm)->GetBaseOfstForFly( sal_True ) ) ||
( mnFlyAnchorOfstNoWrap != ((SwTxtFrm*)pFrm)->GetBaseOfstForFly( sal_False ) ) );
@@ -224,9 +224,9 @@ SwFrmNotify::~SwFrmNotify()
}
//Fuer Hintergrundgrafiken muss bei Groessenaenderungen ein Repaint her.
- const BOOL bPrtWidth =
+ const sal_Bool bPrtWidth =
(aPrt.*fnRect->fnGetWidth)() != (pFrm->Prt().*fnRect->fnGetWidth)();
- const BOOL bPrtHeight =
+ const sal_Bool bPrtHeight =
(aPrt.*fnRect->fnGetHeight)()!=(pFrm->Prt().*fnRect->fnGetHeight)();
if ( bPrtWidth || bPrtHeight )
{
@@ -245,7 +245,7 @@ SwFrmNotify::~SwFrmNotify()
}
}
- const BOOL bPrtP = POS_DIFF( aPrt, pFrm->Prt() );
+ const sal_Bool bPrtP = POS_DIFF( aPrt, pFrm->Prt() );
if ( bAbsP || bPrtP || bChgWidth || bChgHeight ||
bPrtWidth || bPrtHeight || bChgFlyBasePos )
{
@@ -436,7 +436,7 @@ SwFrmNotify::~SwFrmNotify()
SwLayNotify::SwLayNotify( SwLayoutFrm *pLayFrm ) :
SwFrmNotify( pLayFrm ),
- bLowersComplete( FALSE )
+ bLowersComplete( sal_False )
{
}
@@ -482,22 +482,22 @@ SwLayNotify::~SwLayNotify()
SwLayoutFrm *pLay = GetLay();
SWRECTFN( pLay )
- BOOL bNotify = FALSE;
+ sal_Bool bNotify = sal_False;
if ( pLay->Prt().SSize() != aPrt.SSize() )
{
if ( !IsLowersComplete() )
{
- BOOL bInvaPercent;
+ sal_Bool bInvaPercent;
if ( pLay->IsRowFrm() )
{
- bInvaPercent = TRUE;
+ bInvaPercent = sal_True;
long nNew = (pLay->Prt().*fnRect->fnGetHeight)();
if( nNew != (aPrt.*fnRect->fnGetHeight)() )
- ((SwRowFrm*)pLay)->AdjustCells( nNew, TRUE);
+ ((SwRowFrm*)pLay)->AdjustCells( nNew, sal_True);
if( (pLay->Prt().*fnRect->fnGetWidth)()
!= (aPrt.*fnRect->fnGetWidth)() )
- ((SwRowFrm*)pLay)->AdjustCells( 0, FALSE );
+ ((SwRowFrm*)pLay)->AdjustCells( 0, sal_False );
}
else
{
@@ -507,7 +507,7 @@ SwLayNotify::~SwLayNotify()
//3. Wenn der Fly eine feste Hoehe hat und die Spalten in der
// Hoehe danebenliegen.
//4. niemals bei SectionFrms.
- BOOL bLow;
+ sal_Bool bLow;
if( pLay->IsFlyFrm() )
{
if ( pLay->Lower() )
@@ -517,7 +517,7 @@ SwLayNotify::~SwLayNotify()
!= (pLay->Prt().*fnRect->fnGetHeight)();
}
else
- bLow = FALSE;
+ bLow = sal_False;
}
else if( pLay->IsSctFrm() )
{
@@ -529,12 +529,12 @@ SwLayNotify::~SwLayNotify()
bLow = pLay->Prt().Width() != aPrt.Width();
}
else
- bLow = FALSE;
+ bLow = sal_False;
}
else if( pLay->IsFooterFrm() && !pLay->HasFixSize() )
bLow = pLay->Prt().Width() != aPrt.Width();
else
- bLow = TRUE;
+ bLow = sal_True;
bInvaPercent = bLow;
if ( bLow )
{
@@ -560,7 +560,7 @@ SwLayNotify::~SwLayNotify()
}
}
}
- bNotify = TRUE;
+ bNotify = sal_True;
//TEUER!! aber wie macht man es geschickter?
if( bInvaPercent )
pLay->InvaPercentLowers( pLay->Prt().Height() - aPrt.Height() );
@@ -580,9 +580,9 @@ SwLayNotify::~SwLayNotify()
}
}
//Lower benachrichtigen wenn sich die Position veraendert hat.
- const BOOL bPrtPos = POS_DIFF( aPrt, pLay->Prt() );
- const BOOL bPos = bPrtPos || POS_DIFF( aFrm, pLay->Frm() );
- const BOOL bSize = pLay->Frm().SSize() != aFrm.SSize();
+ const sal_Bool bPrtPos = POS_DIFF( aPrt, pLay->Prt() );
+ const sal_Bool bPos = bPrtPos || POS_DIFF( aFrm, pLay->Frm() );
+ const sal_Bool bSize = pLay->Frm().SSize() != aFrm.SSize();
if ( bPos && pLay->Lower() && !IsLowersComplete() )
pLay->Lower()->InvalidatePos();
@@ -875,7 +875,7 @@ SwCntntNotify::~SwCntntNotify()
}
}
- BOOL bFirst = (aFrm.*fnRect->fnGetWidth)() == 0;
+ sal_Bool bFirst = (aFrm.*fnRect->fnGetWidth)() == 0;
if ( pCnt->IsNoTxtFrm() )
{
@@ -922,7 +922,7 @@ SwCntntNotify::~SwCntntNotify()
if ( pFESh && pNd->IsOLESizeInvalid() )
{
- pNd->SetOLESizeInvalid( FALSE );
+ pNd->SetOLESizeInvalid( sal_False );
//TODO/LATER: needs OnDocumentPrinterChanged
//xObj->OnDocumentPrinterChanged( pNd->GetDoc()->getPrinter( false ) );
pFESh->CalcAndSetScale( xObj );//Client erzeugen lassen.
@@ -959,7 +959,7 @@ SwCntntNotify::~SwCntntNotify()
SwNodeIndex *pIdx = 0;
SwSpzFrmFmts *pTbl = pDoc->GetSpzFrmFmts();
- for ( USHORT i = 0; i < pTbl->Count(); ++i )
+ for ( sal_uInt16 i = 0; i < pTbl->Count(); ++i )
{
if ( !pPage )
pPage = pCnt->FindPageFrm();
@@ -972,7 +972,7 @@ SwCntntNotify::~SwCntntNotify()
continue; //#60878# nicht etwa zeichengebundene.
}
- BOOL bCheckPos = FALSE;
+ sal_Bool bCheckPos = sal_False;
if ( rAnch.GetCntntAnchor() )
{
if ( !pIdx )
@@ -981,7 +981,7 @@ SwCntntNotify::~SwCntntNotify()
}
if ( rAnch.GetCntntAnchor()->nNode == *pIdx )
{
- bCheckPos = TRUE;
+ bCheckPos = sal_True;
if (FLY_AT_PAGE == rAnch.GetAnchorId())
{
ASSERT( false, "<SwCntntNotify::~SwCntntNotify()> - to page anchored object with content position. Please inform OD." );
@@ -1044,10 +1044,10 @@ SwCntntNotify::~SwCntntNotify()
/*************************************************************************/
-void AppendObjs( const SwSpzFrmFmts *pTbl, ULONG nIndex,
+void AppendObjs( const SwSpzFrmFmts *pTbl, sal_uLong nIndex,
SwFrm *pFrm, SwPageFrm *pPage )
{
- for ( USHORT i = 0; i < pTbl->Count(); ++i )
+ for ( sal_uInt16 i = 0; i < pTbl->Count(); ++i )
{
SwFrmFmt *pFmt = (SwFrmFmt*)(*pTbl)[i];
const SwFmtAnchor &rAnch = pFmt->GetAnchor();
@@ -1122,7 +1122,11 @@ void AppendObjs( const SwSpzFrmFmts *pTbl, ULONG nIndex,
}
}
+<<<<<<< local
bool lcl_ObjConnected( SwFrmFmt *pFmt, const SwFrm* pSib )
+=======
+sal_Bool MA_FASTCALL lcl_ObjConnected( SwFrmFmt *pFmt )
+>>>>>>> other
{
SwIterator<SwFlyFrm,SwFmt> aIter( *pFmt );
if ( RES_FLYFRMFMT == pFmt->Which() )
@@ -1141,7 +1145,11 @@ bool lcl_ObjConnected( SwFrmFmt *pFmt, const SwFrm* pSib )
if ( pContact )
return pContact->GetAnchorFrm() != 0;
}
+<<<<<<< local
return false;
+=======
+ return sal_False;
+>>>>>>> other
}
/** helper method to determine, if a <SwFrmFmt>, which has an object connected,
@@ -1176,24 +1184,28 @@ void AppendAllObjs( const SwSpzFrmFmts *pTbl, const SwFrm* pSib )
SwSpzFrmFmts aCpy( 255, 255 );
aCpy.Insert( pTbl, 0 );
- USHORT nOldCnt = USHRT_MAX;
+ sal_uInt16 nOldCnt = USHRT_MAX;
while ( aCpy.Count() && aCpy.Count() != nOldCnt )
{
nOldCnt = aCpy.Count();
for ( int i = 0; i < int(aCpy.Count()); ++i )
{
- SwFrmFmt *pFmt = (SwFrmFmt*)aCpy[ USHORT(i) ];
+ SwFrmFmt *pFmt = (SwFrmFmt*)aCpy[ sal_uInt16(i) ];
const SwFmtAnchor &rAnch = pFmt->GetAnchor();
- BOOL bRemove = FALSE;
+ sal_Bool bRemove = sal_False;
if ((rAnch.GetAnchorId() == FLY_AT_PAGE) ||
(rAnch.GetAnchorId() == FLY_AS_CHAR))
{
//Seitengebunde sind bereits verankert, zeichengebundene
//will ich hier nicht.
- bRemove = TRUE;
+ bRemove = sal_True;
}
+<<<<<<< local
else if ( FALSE == (bRemove = ::lcl_ObjConnected( pFmt, pSib )) ||
+=======
+ else if ( sal_False == (bRemove = ::lcl_ObjConnected( pFmt )) ||
+>>>>>>> other
::lcl_InHeaderOrFooter( *pFmt ) )
{
// OD 23.06.2003 #108784# - correction: for objects in header
@@ -1207,7 +1219,7 @@ void AppendAllObjs( const SwSpzFrmFmts *pTbl, const SwFrm* pSib )
}
if ( bRemove )
{
- aCpy.Remove( USHORT(i) );
+ aCpy.Remove( sal_uInt16(i) );
--i;
}
}
@@ -1235,16 +1247,27 @@ void lcl_SetPos( SwFrm& _rNewFrm,
}
void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc,
- ULONG nIndex, BOOL bPages, ULONG nEndIndex,
+ sal_uLong nIndex, sal_Bool bPages, sal_uLong nEndIndex,
SwFrm *pPrv )
{
pDoc->BlockIdling();
+<<<<<<< local
SwRootFrm* pLayout = pLay->getRootFrm();
const BOOL bOldCallbackActionEnabled = pLayout ? pLayout->IsCallbackActionEnabled() : FALSE;
if( bOldCallbackActionEnabled )
pLayout->SetCallbackActionEnabled( FALSE );
-
+=======
+ SwRootFrm* pLayout = pDoc->GetRootFrm();
+ const sal_Bool bOldCallbackActionEnabled = pLayout ? pLayout->IsCallbackActionEnabled() : sal_False;
+ if(pLayout)
+ pLayout->SetCallbackActionEnabled( sal_False );
+>>>>>>> other
+
+<<<<<<< local
//Bei der Erzeugung des Layouts wird bPages mit TRUE uebergeben. Dann
+=======
+ //Bei der Erzeugung des Layouts wird bPages mit sal_True uebergeben. Dann
+>>>>>>> other
//werden schon mal alle x Absaetze neue Seiten angelegt. Bei umbruechen
//und/oder Pagedescriptorwechseln werden gleich die entsprechenden Seiten
//angelegt.
@@ -1258,17 +1281,17 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc,
//Wenn in der DocStatistik eine brauchebare Seitenzahl angegeben ist
//(wird beim Schreiben gepflegt), so wird von dieser Seitenanzahl
//ausgegengen.
- const BOOL bStartPercent = bPages && !nEndIndex;
+ const sal_Bool bStartPercent = bPages && !nEndIndex;
SwPageFrm *pPage = pLay->FindPageFrm();
const SwSpzFrmFmts *pTbl = pDoc->GetSpzFrmFmts();
SwFrm *pFrm = 0;
- BOOL bBreakAfter = FALSE;
+ sal_Bool bBreakAfter = sal_False;
SwActualSection *pActualSection = 0;
SwLayHelper *pPageMaker;
- //Wenn das Layout erzeugt wird (bPages == TRUE) steuern wir den Progress
+ //Wenn das Layout erzeugt wird (bPages == sal_True) steuern wir den Progress
//an. Flys und DrawObjekte werden dann nicht gleich verbunden, dies
//passiert erst am Ende der Funktion.
if ( bPages )
@@ -1279,9 +1302,9 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc,
pActualSection, bBreakAfter, nIndex, 0 == nEndIndex );
if( bStartPercent )
{
- const ULONG nPageCount = pPageMaker->CalcPageCount();
+ const sal_uLong nPageCount = pPageMaker->CalcPageCount();
if( nPageCount )
- bObjsDirect = FALSE;
+ bObjsDirect = sal_False;
}
}
else
@@ -1315,7 +1338,7 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc,
//the SwActualSection class has a member, which points to an upper(section).
//When the "inner" section finishs, the upper will used instead.
- while( TRUE )
+ while( sal_True )
{
SwNode *pNd = pDoc->GetNodes()[nIndex];
if ( pNd->IsCntntNode() )
@@ -1454,7 +1477,7 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc,
if( pPrv->IsSctFrm() )
pPrv = ((SwSectionFrm*)pPrv)->ContainsCntnt();
if( pPrv && pPrv->IsTxtFrm() )
- ((SwTxtFrm*)pPrv)->Prepare( PREP_QUOVADIS, 0, FALSE );
+ ((SwTxtFrm*)pPrv)->Prepare( PREP_QUOVADIS, 0, sal_False );
}
}
// --> OD 2005-12-01 #i27138#
@@ -1558,7 +1581,7 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc,
if( ! pOuterSectionFrm->IsColLocked() &&
! pOuterSectionFrm->ContainsCntnt() )
{
- pOuterSectionFrm->DelEmpty( TRUE );
+ pOuterSectionFrm->DelEmpty( sal_True );
delete pOuterSectionFrm;
}
pActualSection->SetSectionFrm( (SwSectionFrm*)pFrm );
@@ -1613,8 +1636,13 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc,
if ( bPages ) //Jetzt noch die Flys verbinden lassen.
{
if ( !bDontCreateObjects )
+<<<<<<< local
AppendAllObjs( pTbl, pLayout );
bObjsDirect = TRUE;
+=======
+ AppendAllObjs( pTbl );
+ bObjsDirect = sal_True;
+>>>>>>> other
}
if( pPageMaker )
@@ -1641,29 +1669,29 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc,
void MakeFrms( SwDoc *pDoc, const SwNodeIndex &rSttIdx,
const SwNodeIndex &rEndIdx )
{
- bObjsDirect = FALSE;
+ bObjsDirect = sal_False;
SwNodeIndex aTmp( rSttIdx );
- ULONG nEndIdx = rEndIdx.GetIndex();
+ sal_uLong nEndIdx = rEndIdx.GetIndex();
SwNode* pNd = pDoc->GetNodes().FindPrvNxtFrmNode( aTmp,
pDoc->GetNodes()[ nEndIdx-1 ]);
if ( pNd )
{
- BOOL bApres = aTmp < rSttIdx;
+ sal_Bool bApres = aTmp < rSttIdx;
SwNode2Layout aNode2Layout( *pNd, rSttIdx.GetIndex() );
SwFrm* pFrm;
while( 0 != (pFrm = aNode2Layout.NextFrm()) )
{
SwLayoutFrm *pUpper = pFrm->GetUpper();
SwFtnFrm* pFtnFrm = pUpper->FindFtnFrm();
- BOOL bOldLock, bOldFtn;
+ sal_Bool bOldLock, bOldFtn;
if( pFtnFrm )
{
bOldFtn = pFtnFrm->IsColLocked();
pFtnFrm->ColLock();
}
else
- bOldFtn = TRUE;
+ bOldFtn = sal_True;
SwSectionFrm* pSct = pUpper->FindSctFrm();
// Es sind innerhalb von Fussnoten nur die Bereiche interessant,
// die in den Fussnoten liegen, nicht etwa die (spaltigen) Bereiche,
@@ -1677,14 +1705,14 @@ void MakeFrms( SwDoc *pDoc, const SwNodeIndex &rSttIdx,
pSct->ColLock();
}
else
- bOldLock = TRUE;
+ bOldLock = sal_True;
// Wenn pFrm sich nicht bewegen kann, koennen wir auch niemanden
// auf die naechste Seite schieben. Innerhalb eines Rahmens auch
// nicht ( in der 1. Spalte eines Rahmens waere pFrm Moveable()! )
// Auch in spaltigen Bereichen in Tabellen waere pFrm Moveable.
- BOOL bMoveNext = nEndIdx - rSttIdx.GetIndex() > 120;
- BOOL bAllowMove = !pFrm->IsInFly() && pFrm->IsMoveable() &&
+ sal_Bool bMoveNext = nEndIdx - rSttIdx.GetIndex() > 120;
+ sal_Bool bAllowMove = !pFrm->IsInFly() && pFrm->IsMoveable() &&
(!pFrm->IsInTab() || pFrm->IsTabFrm() );
if ( bMoveNext && bAllowMove )
{
@@ -1773,12 +1801,12 @@ void MakeFrms( SwDoc *pDoc, const SwNodeIndex &rSttIdx,
if( pTmp )
{
SwFrm* pOldUp = pTmp->GetFrm()->GetUpper();
- // MoveFwd==TRUE bedeutet, dass wir auf der gleichen
+ // MoveFwd==sal_True bedeutet, dass wir auf der gleichen
// Seite geblieben sind, wir wollen aber die Seite wechseln,
// sofern dies moeglich ist
- BOOL bTmpOldLock = pTmp->IsJoinLocked();
+ sal_Bool bTmpOldLock = pTmp->IsJoinLocked();
pTmp->LockJoin();
- while( pTmp->MoveFwd( TRUE, FALSE, TRUE ) )
+ while( pTmp->MoveFwd( sal_True, sal_False, sal_True ) )
{
if( pOldUp == pTmp->GetFrm()->GetUpper() )
break;
@@ -1792,7 +1820,7 @@ void MakeFrms( SwDoc *pDoc, const SwNodeIndex &rSttIdx,
}
else
{
- BOOL bSplit;
+ sal_Bool bSplit;
SwFrm* pPrv = bApres ? pFrm : pFrm->GetPrev();
// Wenn in einen SectionFrm ein anderer eingefuegt wird,
// muss dieser aufgebrochen werden
@@ -1807,8 +1835,8 @@ void MakeFrms( SwDoc *pDoc, const SwNodeIndex &rSttIdx,
}
}
else
- bSplit = FALSE;
- ::_InsertCnt( pUpper, pDoc, rSttIdx.GetIndex(), FALSE,
+ bSplit = sal_False;
+ ::_InsertCnt( pUpper, pDoc, rSttIdx.GetIndex(), sal_False,
nEndIdx, pPrv );
// OD 23.06.2003 #108784# - correction: append objects doesn't
// depend on value of <bAllowMove>
@@ -1831,7 +1859,7 @@ void MakeFrms( SwDoc *pDoc, const SwNodeIndex &rSttIdx,
}
SwPageFrm *pPage = pUpper->FindPageFrm();
- SwFrm::CheckPageDescs( pPage, FALSE );
+ SwFrm::CheckPageDescs( pPage, sal_False );
if( !bOldFtn )
pFtnFrm->ColUnlock();
if( !bOldLock )
@@ -1842,15 +1870,20 @@ void MakeFrms( SwDoc *pDoc, const SwNodeIndex &rSttIdx,
// und damit ruhig zerstoert werden.
if( !pSct->ContainsCntnt() )
{
+<<<<<<< local
pSct->DelEmpty( TRUE );
pUpper->getRootFrm()->RemoveFromList( pSct );
+=======
+ pSct->DelEmpty( sal_True );
+ pDoc->GetRootFrm()->RemoveFromList( pSct );
+>>>>>>> other
delete pSct;
}
}
}
}
- bObjsDirect = TRUE;
+ bObjsDirect = sal_True;
}
@@ -1882,20 +1915,20 @@ SwBorderAttrs::SwBorderAttrs( const SwModify *pMod, const SwFrm *pConstructor )
//Muessen alle einmal berechnet werden:
bTopLine = bBottomLine = bLeftLine = bRightLine =
- bTop = bBottom = bLine = TRUE;
+ bTop = bBottom = bLine = sal_True;
- bCacheGetLine = bCachedGetTopLine = bCachedGetBottomLine = FALSE;
+ bCacheGetLine = bCachedGetTopLine = bCachedGetBottomLine = sal_False;
// OD 21.05.2003 #108789# - init cache status for values <bJoinedWithPrev>
// and <bJoinedWithNext>, which aren't initialized by default.
- bCachedJoinedWithPrev = FALSE;
- bCachedJoinedWithNext = FALSE;
+ bCachedJoinedWithPrev = sal_False;
+ bCachedJoinedWithNext = sal_False;
bBorderDist = 0 != (pConstructor->GetType() & (FRM_CELL));
}
SwBorderAttrs::~SwBorderAttrs()
{
- ((SwModify*)pOwner)->SetInCache( FALSE );
+ ((SwModify*)pOwner)->SetInCache( sal_False );
}
/*************************************************************************
@@ -1913,13 +1946,13 @@ SwBorderAttrs::~SwBorderAttrs()
void SwBorderAttrs::_CalcTop()
{
nTop = CalcTopLine() + rUL.GetUpper();
- bTop = FALSE;
+ bTop = sal_False;
}
void SwBorderAttrs::_CalcBottom()
{
nBottom = CalcBottomLine() + rUL.GetLower();
- bBottom = FALSE;
+ bBottom = sal_False;
}
long SwBorderAttrs::CalcRight( const SwFrm* pCaller ) const
@@ -1997,7 +2030,7 @@ void SwBorderAttrs::_CalcTopLine()
? rBox.GetDistance (BOX_LINE_TOP)
: rBox.CalcLineSpace(BOX_LINE_TOP);
nTopLine = nTopLine + rShadow.CalcShadowSpace(SHADOW_TOP);
- bTopLine = FALSE;
+ bTopLine = sal_False;
}
void SwBorderAttrs::_CalcBottomLine()
@@ -2006,7 +2039,7 @@ void SwBorderAttrs::_CalcBottomLine()
? rBox.GetDistance (BOX_LINE_BOTTOM)
: rBox.CalcLineSpace(BOX_LINE_BOTTOM);
nBottomLine = nBottomLine + rShadow.CalcShadowSpace(SHADOW_BOTTOM);
- bBottomLine = FALSE;
+ bBottomLine = sal_False;
}
void SwBorderAttrs::_CalcLeftLine()
@@ -2015,7 +2048,7 @@ void SwBorderAttrs::_CalcLeftLine()
? rBox.GetDistance (BOX_LINE_LEFT)
: rBox.CalcLineSpace(BOX_LINE_LEFT);
nLeftLine = nLeftLine + rShadow.CalcShadowSpace(SHADOW_LEFT);
- bLeftLine = FALSE;
+ bLeftLine = sal_False;
}
void SwBorderAttrs::_CalcRightLine()
@@ -2024,7 +2057,7 @@ void SwBorderAttrs::_CalcRightLine()
? rBox.GetDistance (BOX_LINE_RIGHT)
: rBox.CalcLineSpace(BOX_LINE_RIGHT);
nRightLine = nRightLine + rShadow.CalcShadowSpace(SHADOW_RIGHT);
- bRightLine = FALSE;
+ bRightLine = sal_False;
}
/*************************************************************************/
@@ -2033,7 +2066,7 @@ void SwBorderAttrs::_IsLine()
{
bIsLine = rBox.GetTop() || rBox.GetBottom() ||
rBox.GetLeft()|| rBox.GetRight();
- bLine = FALSE;
+ bLine = sal_False;
}
/*************************************************************************
@@ -2064,7 +2097,7 @@ inline int CmpLines( const SvxBorderLine *pL1, const SvxBorderLine *pL2 )
// OD 21.05.2003 #108789# - compare <CalcRight()> and <rCmpAttrs.CalcRight()>
// instead of only the right LR-spacing, because R2L-layout has to be
// considered.
-BOOL SwBorderAttrs::CmpLeftRight( const SwBorderAttrs &rCmpAttrs,
+sal_Bool SwBorderAttrs::CmpLeftRight( const SwBorderAttrs &rCmpAttrs,
const SwFrm *pCaller,
const SwFrm *pCmp ) const
{
@@ -2075,10 +2108,10 @@ BOOL SwBorderAttrs::CmpLeftRight( const SwBorderAttrs &rCmpAttrs,
CalcRight( pCaller ) == rCmpAttrs.CalcRight( pCmp ) );
}
-BOOL SwBorderAttrs::_JoinWithCmp( const SwFrm& _rCallerFrm,
+sal_Bool SwBorderAttrs::_JoinWithCmp( const SwFrm& _rCallerFrm,
const SwFrm& _rCmpFrm ) const
{
- BOOL bReturnVal = FALSE;
+ sal_Bool bReturnVal = sal_False;
SwBorderAttrAccess aCmpAccess( SwFrm::GetCache(), &_rCmpFrm );
const SwBorderAttrs &rCmpAttrs = *aCmpAccess.Get();
@@ -2088,7 +2121,7 @@ BOOL SwBorderAttrs::_JoinWithCmp( const SwFrm& _rCallerFrm,
CmpLeftRight( rCmpAttrs, &_rCallerFrm, &_rCmpFrm )
)
{
- bReturnVal = TRUE;
+ bReturnVal = sal_True;
}
return bReturnVal;
@@ -2101,7 +2134,7 @@ void SwBorderAttrs::_CalcJoinedWithPrev( const SwFrm& _rFrm,
const SwFrm* _pPrevFrm )
{
// set default
- bJoinedWithPrev = FALSE;
+ bJoinedWithPrev = sal_False;
if ( _rFrm.IsTxtFrm() )
{
@@ -2135,7 +2168,7 @@ void SwBorderAttrs::_CalcJoinedWithPrev( const SwFrm& _rFrm,
void SwBorderAttrs::_CalcJoinedWithNext( const SwFrm& _rFrm )
{
// set default
- bJoinedWithNext = FALSE;
+ bJoinedWithNext = sal_False;
if ( _rFrm.IsTxtFrm() )
{
@@ -2163,7 +2196,7 @@ void SwBorderAttrs::_CalcJoinedWithNext( const SwFrm& _rFrm )
// OD 21.05.2003 #108789# - accessor for cached values <bJoinedWithPrev>
// OD 2004-02-26 #i25029# - add 2nd parameter <_pPrevFrm>, which is passed to
// method <_CalcJoindWithPrev(..)>.
-BOOL SwBorderAttrs::JoinedWithPrev( const SwFrm& _rFrm,
+sal_Bool SwBorderAttrs::JoinedWithPrev( const SwFrm& _rFrm,
const SwFrm* _pPrevFrm ) const
{
if ( !bCachedJoinedWithPrev || _pPrevFrm )
@@ -2175,7 +2208,7 @@ BOOL SwBorderAttrs::JoinedWithPrev( const SwFrm& _rFrm,
return bJoinedWithPrev;
}
-BOOL SwBorderAttrs::JoinedWithNext( const SwFrm& _rFrm ) const
+sal_Bool SwBorderAttrs::JoinedWithNext( const SwFrm& _rFrm ) const
{
if ( !bCachedJoinedWithNext )
{
@@ -2190,7 +2223,7 @@ BOOL SwBorderAttrs::JoinedWithNext( const SwFrm& _rFrm ) const
void SwBorderAttrs::_GetTopLine( const SwFrm& _rFrm,
const SwFrm* _pPrevFrm )
{
- USHORT nRet = CalcTopLine();
+ sal_uInt16 nRet = CalcTopLine();
// OD 21.05.2003 #108789# - use new method <JoinWithPrev()>
// OD 2004-02-26 #i25029# - add 2nd parameter
@@ -2206,7 +2239,7 @@ void SwBorderAttrs::_GetTopLine( const SwFrm& _rFrm,
void SwBorderAttrs::_GetBottomLine( const SwFrm& _rFrm )
{
- USHORT nRet = CalcBottomLine();
+ sal_uInt16 nRet = CalcBottomLine();
// OD 21.05.2003 #108789# - use new method <JoinWithPrev()>
if ( JoinedWithNext( _rFrm ) )
@@ -2225,7 +2258,7 @@ SwBorderAttrAccess::SwBorderAttrAccess( SwCache &rCach, const SwFrm *pFrm ) :
SwCacheAccess( rCach, (pFrm->IsCntntFrm() ?
(void*)((SwCntntFrm*)pFrm)->GetNode() :
(void*)((SwLayoutFrm*)pFrm)->GetFmt()),
- (BOOL)(pFrm->IsCntntFrm() ?
+ (sal_Bool)(pFrm->IsCntntFrm() ?
((SwModify*)((SwCntntFrm*)pFrm)->GetNode())->IsInCache() :
((SwModify*)((SwLayoutFrm*)pFrm)->GetFmt())->IsInCache()) ),
pConstructor( pFrm )
@@ -2236,7 +2269,7 @@ SwBorderAttrAccess::SwBorderAttrAccess( SwCache &rCach, const SwFrm *pFrm ) :
SwCacheObj *SwBorderAttrAccess::NewObj()
{
- ((SwModify*)pOwner)->SetInCache( TRUE );
+ ((SwModify*)pOwner)->SetInCache( sal_True );
return new SwBorderAttrs( (SwModify*)pOwner, pConstructor );
}
@@ -2247,7 +2280,7 @@ SwBorderAttrs *SwBorderAttrAccess::Get()
/*************************************************************************/
-SwOrderIter::SwOrderIter( const SwPageFrm *pPg, BOOL bFlys ) :
+SwOrderIter::SwOrderIter( const SwPageFrm *pPg, sal_Bool bFlys ) :
pPage( pPg ),
pCurrent( 0 ),
bFlysOnly( bFlys )
@@ -2261,17 +2294,17 @@ const SdrObject *SwOrderIter::Top()
pCurrent = 0;
if ( pPage->GetSortedObjs() )
{
- UINT32 nTopOrd = 0;
+ sal_uInt32 nTopOrd = 0;
const SwSortedObjs *pObjs = pPage->GetSortedObjs();
if ( pObjs->Count() )
{
(*pObjs)[0]->GetDrawObj()->GetOrdNum(); //Aktualisieren erzwingen!
- for ( USHORT i = 0; i < pObjs->Count(); ++i )
+ for ( sal_uInt16 i = 0; i < pObjs->Count(); ++i )
{
const SdrObject* pObj = (*pObjs)[i]->GetDrawObj();
if ( bFlysOnly && !pObj->ISA(SwVirtFlyDrawObj) )
continue;
- UINT32 nTmp = pObj->GetOrdNumDirect();
+ sal_uInt32 nTmp = pObj->GetOrdNumDirect();
if ( nTmp >= nTopOrd )
{
nTopOrd = nTmp;
@@ -2290,17 +2323,17 @@ const SdrObject *SwOrderIter::Bottom()
pCurrent = 0;
if ( pPage->GetSortedObjs() )
{
- UINT32 nBotOrd = USHRT_MAX;
+ sal_uInt32 nBotOrd = USHRT_MAX;
const SwSortedObjs *pObjs = pPage->GetSortedObjs();
if ( pObjs->Count() )
{
(*pObjs)[0]->GetDrawObj()->GetOrdNum(); //Aktualisieren erzwingen!
- for ( USHORT i = 0; i < pObjs->Count(); ++i )
+ for ( sal_uInt16 i = 0; i < pObjs->Count(); ++i )
{
const SdrObject* pObj = (*pObjs)[i]->GetDrawObj();
if ( bFlysOnly && !pObj->ISA(SwVirtFlyDrawObj) )
continue;
- UINT32 nTmp = pObj->GetOrdNumDirect();
+ sal_uInt32 nTmp = pObj->GetOrdNumDirect();
if ( nTmp < nBotOrd )
{
nBotOrd = nTmp;
@@ -2316,21 +2349,21 @@ const SdrObject *SwOrderIter::Bottom()
const SdrObject *SwOrderIter::Next()
{
- const UINT32 nCurOrd = pCurrent ? pCurrent->GetOrdNumDirect() : 0;
+ const sal_uInt32 nCurOrd = pCurrent ? pCurrent->GetOrdNumDirect() : 0;
pCurrent = 0;
if ( pPage->GetSortedObjs() )
{
- UINT32 nOrd = USHRT_MAX;
+ sal_uInt32 nOrd = USHRT_MAX;
const SwSortedObjs *pObjs = pPage->GetSortedObjs();
if ( pObjs->Count() )
{
(*pObjs)[0]->GetDrawObj()->GetOrdNum(); //Aktualisieren erzwingen!
- for ( USHORT i = 0; i < pObjs->Count(); ++i )
+ for ( sal_uInt16 i = 0; i < pObjs->Count(); ++i )
{
const SdrObject* pObj = (*pObjs)[i]->GetDrawObj();
if ( bFlysOnly && !pObj->ISA(SwVirtFlyDrawObj) )
continue;
- UINT32 nTmp = pObj->GetOrdNumDirect();
+ sal_uInt32 nTmp = pObj->GetOrdNumDirect();
if ( nTmp > nCurOrd && nTmp < nOrd )
{
nOrd = nTmp;
@@ -2346,21 +2379,21 @@ const SdrObject *SwOrderIter::Next()
const SdrObject *SwOrderIter::Prev()
{
- const UINT32 nCurOrd = pCurrent ? pCurrent->GetOrdNumDirect() : 0;
+ const sal_uInt32 nCurOrd = pCurrent ? pCurrent->GetOrdNumDirect() : 0;
pCurrent = 0;
if ( pPage->GetSortedObjs() )
{
- UINT32 nOrd = 0;
+ sal_uInt32 nOrd = 0;
const SwSortedObjs *pObjs = pPage->GetSortedObjs();
if ( pObjs->Count() )
{
(*pObjs)[0]->GetDrawObj()->GetOrdNum(); //Aktualisieren erzwingen!
- for ( USHORT i = 0; i < pObjs->Count(); ++i )
+ for ( sal_uInt16 i = 0; i < pObjs->Count(); ++i )
{
const SdrObject* pObj = (*pObjs)[i]->GetDrawObj();
if ( bFlysOnly && !pObj->ISA(SwVirtFlyDrawObj) )
continue;
- UINT32 nTmp = pObj->GetOrdNumDirect();
+ sal_uInt32 nTmp = pObj->GetOrdNumDirect();
if ( nTmp < nCurOrd && nTmp >= nOrd )
{
nOrd = nTmp;
@@ -2393,7 +2426,7 @@ void MA_FASTCALL lcl_RemoveObjsFromPage( SwFrm* _pFrm )
{
ASSERT( _pFrm->GetDrawObjs(), "Keine DrawObjs fuer lcl_RemoveFlysFromPage." );
SwSortedObjs &rObjs = *_pFrm->GetDrawObjs();
- for ( USHORT i = 0; i < rObjs.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i )
{
SwAnchoredObject* pObj = rObjs[i];
// --> OD 2004-11-29 #115759# - reset member, at which the anchored
@@ -2447,7 +2480,7 @@ void MA_FASTCALL lcl_RemoveObjsFromPage( SwFrm* _pFrm )
SwFrm *SaveCntnt( SwLayoutFrm *pLay, SwFrm *pStart )
{
if( pLay->IsSctFrm() && pLay->Lower() && pLay->Lower()->IsColumnFrm() )
- lcl_RemoveFtns( (SwColumnFrm*)pLay->Lower(), TRUE, TRUE );
+ lcl_RemoveFtns( (SwColumnFrm*)pLay->Lower(), sal_True, sal_True );
SwFrm *pSav;
if ( 0 == (pSav = pLay->ContainsAny()) )
@@ -2482,7 +2515,7 @@ SwFrm *SaveCntnt( SwLayoutFrm *pLay, SwFrm *pStart )
SwFrm *pFloat = pSav;
if( !pStart )
pStart = pSav;
- BOOL bGo = pStart == pSav;
+ sal_Bool bGo = pStart == pSav;
do
{
if( bGo )
@@ -2521,7 +2554,7 @@ SwFrm *SaveCntnt( SwLayoutFrm *pLay, SwFrm *pStart )
pFloat = pFloat->GetNext();
if( !bGo && pFloat == pStart )
{
- bGo = TRUE;
+ bGo = sal_True;
pFloat->pPrev->pNext = NULL;
pFloat->pPrev = NULL;
}
@@ -2561,7 +2594,7 @@ void MA_FASTCALL lcl_AddObjsToPage( SwFrm* _pFrm, SwPageFrm* _pPage )
{
ASSERT( _pFrm->GetDrawObjs(), "Keine DrawObjs fuer lcl_AddFlysToPage." );
SwSortedObjs &rObjs = *_pFrm->GetDrawObjs();
- for ( USHORT i = 0; i < rObjs.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i )
{
SwAnchoredObject* pObj = rObjs[i];
@@ -2710,7 +2743,7 @@ void RestoreCntnt( SwFrm *pSav, SwLayoutFrm *pParent, SwFrm *pSibling, bool bGro
|*
|*************************************************************************/
-ULONG MA_FASTCALL SqRt( BigInt nX )
+sal_uLong MA_FASTCALL SqRt( BigInt nX )
{
BigInt nErg = 1;
@@ -2723,13 +2756,13 @@ ULONG MA_FASTCALL SqRt( BigInt nX )
nOldErg = nErg;
}
}
- return nErg >= BigInt(SAL_MAX_UINT32) ? ULONG_MAX : (ULONG)nErg;
+ return nErg >= BigInt(SAL_MAX_UINT32) ? ULONG_MAX : (sal_uLong)nErg;
}
/*************************************************************************/
SwPageFrm * MA_FASTCALL InsertNewPage( SwPageDesc &rDesc, SwFrm *pUpper,
- BOOL bOdd, BOOL bInsertEmpty, BOOL bFtn,
+ sal_Bool bOdd, sal_Bool bInsertEmpty, sal_Bool bFtn,
SwFrm *pSibling )
{
SwPageFrm *pRet;
@@ -2771,7 +2804,7 @@ SwPageFrm * MA_FASTCALL InsertNewPage( SwPageDesc &rDesc, SwFrm *pUpper,
void MA_FASTCALL lcl_Regist( SwPageFrm *pPage, const SwFrm *pAnch )
{
SwSortedObjs *pObjs = (SwSortedObjs*)pAnch->GetDrawObjs();
- for ( USHORT i = 0; i < pObjs->Count(); ++i )
+ for ( sal_uInt16 i = 0; i < pObjs->Count(); ++i )
{
SwAnchoredObject* pObj = (*pObjs)[i];
if ( pObj->ISA(SwFlyFrm) )
@@ -2962,7 +2995,7 @@ void MA_FASTCALL lcl_NotifyCntnt( const SdrObject *pThis, SwCntntFrm *pCnt,
if ( pCnt->GetDrawObjs() )
{
const SwSortedObjs &rObjs = *pCnt->GetDrawObjs();
- for ( USHORT i = 0; i < rObjs.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i )
{
SwAnchoredObject* pObj = rObjs[i];
if ( pObj->ISA(SwFlyFrm) )
@@ -2987,7 +3020,7 @@ void Notify_Background( const SdrObject* pObj,
SwPageFrm* pPage,
const SwRect& rRect,
const PrepareHint eHint,
- const BOOL bInva )
+ const sal_Bool bInva )
{
//Wenn der Frm gerade erstmalig sinnvoll positioniert wurde, braucht der
@@ -3092,7 +3125,7 @@ void Notify_Background( const SdrObject* pObj,
{
pObj->GetOrdNum();
const SwSortedObjs &rObjs = *pPage->GetSortedObjs();
- for ( USHORT i = 0; i < rObjs.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i )
{
SwAnchoredObject* pAnchoredObj = rObjs[i];
if ( pAnchoredObj->ISA(SwFlyFrm) )
@@ -3201,7 +3234,7 @@ const SwFrm* GetVirtualUpper( const SwFrm* pFrm, const Point& rPos )
/*************************************************************************/
-BOOL Is_Lower_Of( const SwFrm *pCurrFrm, const SdrObject* pObj )
+sal_Bool Is_Lower_Of( const SwFrm *pCurrFrm, const SdrObject* pObj )
{
Point aPos;
const SwFrm* pFrm;
@@ -3220,7 +3253,7 @@ BOOL Is_Lower_Of( const SwFrm *pCurrFrm, const SdrObject* pObj )
pFrm = GetVirtualUpper( pFrm, aPos );
do
{ if ( pFrm == pCurrFrm )
- return TRUE;
+ return sal_True;
if( pFrm->IsFlyFrm() )
{
aPos = pFrm->Frm().Pos();
@@ -3229,14 +3262,14 @@ BOOL Is_Lower_Of( const SwFrm *pCurrFrm, const SdrObject* pObj )
else
pFrm = pFrm->GetUpper();
} while ( pFrm );
- return FALSE;
+ return sal_False;
}
-const SwFrm *FindKontext( const SwFrm *pFrm, USHORT nAdditionalKontextTyp )
+const SwFrm *FindKontext( const SwFrm *pFrm, sal_uInt16 nAdditionalKontextTyp )
{
//Liefert die Umgebung des Frm in die kein Fly aus einer anderen
//Umgebung hineinragen kann.
- const USHORT nTyp = FRM_ROOT | FRM_HEADER | FRM_FOOTER | FRM_FTNCONT |
+ const sal_uInt16 nTyp = FRM_ROOT | FRM_HEADER | FRM_FOOTER | FRM_FTNCONT |
FRM_FTN | FRM_FLY |
FRM_TAB | FRM_ROW | FRM_CELL |
nAdditionalKontextTyp;
@@ -3248,20 +3281,20 @@ const SwFrm *FindKontext( const SwFrm *pFrm, USHORT nAdditionalKontextTyp )
return pFrm;
}
-BOOL IsFrmInSameKontext( const SwFrm *pInnerFrm, const SwFrm *pFrm )
+sal_Bool IsFrmInSameKontext( const SwFrm *pInnerFrm, const SwFrm *pFrm )
{
const SwFrm *pKontext = FindKontext( pInnerFrm, 0 );
- const USHORT nTyp = FRM_ROOT | FRM_HEADER | FRM_FOOTER | FRM_FTNCONT |
+ const sal_uInt16 nTyp = FRM_ROOT | FRM_HEADER | FRM_FOOTER | FRM_FTNCONT |
FRM_FTN | FRM_FLY |
FRM_TAB | FRM_ROW | FRM_CELL;
do
{ if ( pFrm->GetType() & nTyp )
{
if( pFrm == pKontext )
- return TRUE;
+ return sal_True;
if( pFrm->IsCellFrm() )
- return FALSE;
+ return sal_False;
}
if( pFrm->IsFlyFrm() )
{
@@ -3272,7 +3305,7 @@ BOOL IsFrmInSameKontext( const SwFrm *pInnerFrm, const SwFrm *pFrm )
pFrm = pFrm->GetUpper();
} while( pFrm );
- return FALSE;
+ return sal_False;
}
@@ -3347,6 +3380,7 @@ const SwFrm* MA_FASTCALL FindPage( const SwRect &rRect, const SwFrm *pPage )
return pPage;
}
+<<<<<<< local
#include <svl/smplhint.hxx>
class SwFrmHolder : private SfxListener
@@ -3388,6 +3422,10 @@ void SwFrmHolder::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
SwFrm* GetFrmOfModify( const SwRootFrm* pLayout, SwModify const& rMod, USHORT const nFrmType,
const Point* pPoint, const SwPosition *pPos, const BOOL bCalcFrm )
+=======
+SwFrm* GetFrmOfModify( SwModify const& rMod, sal_uInt16 const nFrmType,
+ const Point* pPoint, const SwPosition *pPos, const sal_Bool bCalcFrm )
+>>>>>>> other
{
SwFrm *pMinFrm = 0, *pTmpFrm;
SwFrmHolder aHolder;
@@ -3486,7 +3524,7 @@ SwFrm* GetFrmOfModify( const SwRootFrm* pLayout, SwModify const& rMod, USHORT co
return pMinFrm;
}
-BOOL IsExtraData( const SwDoc *pDoc )
+sal_Bool IsExtraData( const SwDoc *pDoc )
{
const SwLineNumberInfo &rInf = pDoc->GetLineNumberInfo();
return rInf.IsPaintLineNumbers() ||
diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx
index 4ae9c67bacde..68ac053fa793 100644
--- a/sw/source/core/layout/ftnfrm.cxx
+++ b/sw/source/core/layout/ftnfrm.cxx
@@ -63,14 +63,14 @@
#define ENDNOTE 0x80000000
-ULONG MA_FASTCALL lcl_FindFtnPos( const SwDoc *pDoc, const SwTxtFtn *pAttr )
+sal_uLong MA_FASTCALL lcl_FindFtnPos( const SwDoc *pDoc, const SwTxtFtn *pAttr )
{
const SwFtnIdxs &rFtnIdxs = pDoc->GetFtnIdxs();
#ifdef MA_DEBUG
//Wenn das Array nicht stimmt haben wir ein Problem, denn viele
//Ftn-Functions bauen auf dem Array auf.
- for ( USHORT k = 0; k+1 < rFtnIdxs.Count(); ++k )
+ for ( sal_uInt16 k = 0; k+1 < rFtnIdxs.Count(); ++k )
{
SwIndex aIdx1(&pDoc->GetNodes());
SwIndex aIdx2(&pDoc->GetNodes());
@@ -90,19 +90,19 @@ ULONG MA_FASTCALL lcl_FindFtnPos( const SwDoc *pDoc, const SwTxtFtn *pAttr )
}
#endif
- USHORT nRet;
+ sal_uInt16 nRet;
SwTxtFtnPtr pBla = (SwTxtFtn*)pAttr;
if ( rFtnIdxs.Seek_Entry( pBla, &nRet ) )
{
if( pAttr->GetFtn().IsEndNote() )
- return ULONG(nRet) + ENDNOTE;
+ return sal_uLong(nRet) + ENDNOTE;
return nRet;
}
ASSERT( !pDoc, "FtnPos not found." );
return 0;
}
-BOOL SwFtnFrm::operator<( const SwTxtFtn* pTxtFtn ) const
+sal_Bool SwFtnFrm::operator<( const SwTxtFtn* pTxtFtn ) const
{
const SwDoc* pDoc = GetFmt()->GetDoc();
ASSERT( pDoc, "SwFtnFrm: Missing doc!" );
@@ -112,22 +112,22 @@ BOOL SwFtnFrm::operator<( const SwTxtFtn* pTxtFtn ) const
/*************************************************************************
|*
-|* BOOL lcl_NextFtnBoss( SwFtnBossFrm* pBoss, SwPageFrm* pPage)
+|* sal_Bool lcl_NextFtnBoss( SwFtnBossFrm* pBoss, SwPageFrm* pPage)
|* setzt pBoss auf den naechsten SwFtnBossFrm, das kann entweder eine Spalte
|* oder eine Seite (ohne Spalten) sein. Wenn die Seite dabei gewechselt wird
-|* enthaelt pPage die neue Seite und die Funktion liefert TRUE.
+|* enthaelt pPage die neue Seite und die Funktion liefert sal_True.
|*
|*************************************************************************/
-BOOL lcl_NextFtnBoss( SwFtnBossFrm* &rpBoss, SwPageFrm* &rpPage,
- BOOL bDontLeave )
+sal_Bool lcl_NextFtnBoss( SwFtnBossFrm* &rpBoss, SwPageFrm* &rpPage,
+ sal_Bool bDontLeave )
{
if( rpBoss->IsColumnFrm() )
{
if( rpBoss->GetNext() )
{
rpBoss = (SwFtnBossFrm*)rpBoss->GetNext(); //naechste Spalte
- return FALSE;
+ return sal_False;
}
if( rpBoss->IsInSct() )
{
@@ -145,7 +145,7 @@ BOOL lcl_NextFtnBoss( SwFtnBossFrm* &rpBoss, SwPageFrm* &rpPage,
{
rpPage = NULL;
rpBoss = NULL;
- return FALSE;
+ return sal_False;
}
}
}
@@ -157,20 +157,20 @@ BOOL lcl_NextFtnBoss( SwFtnBossFrm* &rpBoss, SwPageFrm* &rpPage,
if( pBody && pBody->Lower() && pBody->Lower()->IsColumnFrm() )
rpBoss = (SwFtnBossFrm*)pBody->Lower(); // erste Spalte
}
- return TRUE;
+ return sal_True;
}
/*************************************************************************
|*
-|* USHORT lcl_ColumnNum( SwFrm* pBoss )
+|* sal_uInt16 lcl_ColumnNum( SwFrm* pBoss )
|* liefert die Spaltennummer, wenn pBoss eine Spalte ist,
|* sonst eine Null (bei Seiten).
|*
|*************************************************************************/
-USHORT lcl_ColumnNum( const SwFrm* pBoss )
+sal_uInt16 lcl_ColumnNum( const SwFrm* pBoss )
{
- USHORT nRet = 0;
+ sal_uInt16 nRet = 0;
if( !pBoss->IsColumnFrm() )
return 0;
const SwFrm* pCol;
@@ -260,16 +260,17 @@ void SwFtnContFrm::Format( const SwBorderAttrs * )
SWRECTFN( this )
if ( !bValidPrtArea )
{
- bValidPrtArea = TRUE;
+ bValidPrtArea = sal_True;
(Prt().*fnRect->fnSetTop)( nBorder );
(Prt().*fnRect->fnSetWidth)( (Frm().*fnRect->fnGetWidth)() );
(Prt().*fnRect->fnSetHeight)((Frm().*fnRect->fnGetHeight)() - nBorder );
if( (Prt().*fnRect->fnGetHeight)() < 0 && !pPage->IsFtnPage() )
- bValidSize = FALSE;
+ bValidSize = sal_False;
}
if ( !bValidSize )
{
+<<<<<<< local
bool bGrow = pPage->IsFtnPage();
if( bGrow )
{
@@ -279,6 +280,10 @@ void SwFtnContFrm::Format( const SwBorderAttrs * )
}
if( bGrow )
Grow( LONG_MAX, FALSE );
+=======
+ if ( pPage->IsFtnPage() && !GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ Grow( LONG_MAX, sal_False );
+>>>>>>> other
else
{
//Die Groesse in der VarSize wird durch den Inhalt plus den
@@ -327,7 +332,7 @@ void SwFtnContFrm::Format( const SwBorderAttrs * )
}
}
}
- bValidSize = TRUE;
+ bValidSize = sal_True;
}
}
/*************************************************************************
@@ -336,7 +341,7 @@ void SwFtnContFrm::Format( const SwBorderAttrs * )
|*
|*************************************************************************/
-SwTwips SwFtnContFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL )
+SwTwips SwFtnContFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool )
{
//Keine Pruefung ob FixSize oder nicht, die FtnContainer sind immer bis
//zur Maximalhoehe variabel.
@@ -364,7 +369,7 @@ SwTwips SwFtnContFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL )
// In a section, which has to maximize, a footnotecontainer is allowed
// to grow, when the section can't grow anymore.
if( !bTst && !pSect->IsColLocked() &&
- pSect->ToMaximize( FALSE ) && pSect->Growable() )
+ pSect->ToMaximize( sal_False ) && pSect->Growable() )
{
pSect->InvalidateSize();
return 0;
@@ -420,7 +425,7 @@ SwTwips SwFtnContFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL )
nReal = 0;
if ( nGrow > 0 )
{
- BYTE nAdjust = pBoss->NeighbourhoodAdjustment( this );
+ sal_uInt8 nAdjust = pBoss->NeighbourhoodAdjustment( this );
if( NA_ONLY_ADJUST == nAdjust )
nReal = AdjustNeighbourhood( nGrow, bTst );
else
@@ -472,7 +477,7 @@ SwTwips SwFtnContFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL )
}
-SwTwips SwFtnContFrm::ShrinkFrm( SwTwips nDiff, BOOL bTst, BOOL bInfo )
+SwTwips SwFtnContFrm::ShrinkFrm( SwTwips nDiff, sal_Bool bTst, sal_Bool bInfo )
{
SwPageFrm *pPage = FindPageFrm();
bool bShrink = false;
@@ -516,7 +521,7 @@ SwFtnFrm::SwFtnFrm( SwFrmFmt *pFmt, SwFrm* pSib, SwCntntFrm *pCnt, SwTxtFtn *pAt
pMaster( 0 ),
pRef( pCnt ),
pAttr( pAt ),
- bBackMoveLocked( FALSE ),
+ bBackMoveLocked( sal_False ),
// --> OD 2005-08-11 #i49383#
mbUnlockPosOfLowerObjs( true )
// <--
@@ -557,10 +562,10 @@ void SwFtnFrm::InvalidateNxtFtnCnts( SwPageFrm *pPage )
#ifdef DBG_UTIL
-SwTwips SwFtnFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
+SwTwips SwFtnFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
{
#if OSL_DEBUG_LEVEL > 1
- static USHORT nNum = USHRT_MAX;
+ static sal_uInt16 nNum = USHRT_MAX;
SwTxtFtn* pTxtFtn = GetAttr();
if ( pTxtFtn->GetFtn().GetNumber() == nNum )
{
@@ -573,10 +578,10 @@ SwTwips SwFtnFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
}
-SwTwips SwFtnFrm::ShrinkFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
+SwTwips SwFtnFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
{
#if OSL_DEBUG_LEVEL > 1
- static USHORT nNum = USHRT_MAX;
+ static sal_uInt16 nNum = USHRT_MAX;
if( nNum != USHRT_MAX )
{
SwTxtFtn* pTxtFtn = GetAttr();
@@ -637,7 +642,7 @@ void SwFtnFrm::Cut()
delete pUp;
// Wenn der letzte Fussnotencontainer aus einem spaltigen Bereich verschwindet,
// so kann dieser, falls er keinen Follow besitzt, zusammenschrumpfen.
- if( pSect && !pSect->ToMaximize( FALSE ) && !pSect->IsColLocked() )
+ if( pSect && !pSect->ToMaximize( sal_False ) && !pSect->IsColLocked() )
pSect->_InvalidateSize();
}
else
@@ -721,7 +726,13 @@ void SwFtnFrm::Paste( SwFrm* pParent, SwFrm* pSibling )
|*
|* Beschreibung Liefert das naechste LayoutBlatt in den das
|* Frame gemoved werden kann.
+<<<<<<< local
|* Neue Seiten werden nur dann erzeugt, wenn der Parameter TRUE ist.
+=======
+|* Neue Seiten werden nur dann erzeugt, wenn der Parameter sal_True ist.
+|* Ersterstellung MA 16. Nov. 92
+|* Letzte Aenderung AMA 09. Nov. 98
+>>>>>>> other
|*
|*************************************************************************/
@@ -847,13 +858,13 @@ SwLayoutFrm *SwFrm::GetPrevFtnLeaf( MakePageType eMakeFtn )
pTmpRef = pFtn->GetRef();
SwFtnBossFrm* pStop = pTmpRef->FindFtnBossFrm( !bEndn );
- const USHORT nNum = pStop->GetPhyPageNum();
+ const sal_uInt16 nNum = pStop->GetPhyPageNum();
//Wenn die Fussnoten am Dokumentende angezeigt werden, so verlassen wir
//die Entsprechenden Seiten nicht.
//Selbiges gilt analog fuer die Endnotenseiten.
- const BOOL bEndNote = pOldPage->IsEndNotePage();
- const BOOL bFtnEndDoc = pOldPage->IsFtnPage();
+ const sal_Bool bEndNote = pOldPage->IsEndNotePage();
+ const sal_Bool bFtnEndDoc = pOldPage->IsFtnPage();
SwFtnBossFrm* pNxtBoss = pOldBoss;
SwSectionFrm *pSect = pNxtBoss->GetUpper()->IsSctFrm() ?
(SwSectionFrm*)pNxtBoss->GetUpper() : 0;
@@ -922,22 +933,22 @@ SwLayoutFrm *SwFrm::GetPrevFtnLeaf( MakePageType eMakeFtn )
if ( pRet )
{
const SwFtnBossFrm* pNewBoss = pRet->FindFtnBossFrm();
- BOOL bJump = FALSE;
+ sal_Bool bJump = sal_False;
if( pOldBoss->IsColumnFrm() && pOldBoss->GetPrev() ) // es gibt eine vorherige Spalte
bJump = pOldBoss->GetPrev() != (SwFrm*)pNewBoss; // sind wir darin gelandet?
else if( pNewBoss->IsColumnFrm() && pNewBoss->GetNext() )
- bJump = TRUE; // es gibt hinter dem neuen Boss noch eine Spalte, die aber nicht
+ bJump = sal_True; // es gibt hinter dem neuen Boss noch eine Spalte, die aber nicht
// der alte Boss sein kann, das haben wir ja bereits geprueft.
else // hier landen wir nur, wenn neuer und alter Boss entweder Seiten oder letzte (neu)
{ // bzw. erste (alt) Spalten einer Seite sind. In diesem Fall muss noch geprueft
// werden, ob Seiten ueberspringen wurden.
- USHORT nDiff = pOldPage->GetPhyPageNum() - pRet->FindPageFrm()->GetPhyPageNum();
+ sal_uInt16 nDiff = pOldPage->GetPhyPageNum() - pRet->FindPageFrm()->GetPhyPageNum();
if ( nDiff > 2 ||
(nDiff > 1 && !((SwPageFrm*)pOldPage->GetPrev())->IsEmptyPage()) )
- bJump = TRUE;
+ bJump = sal_True;
}
if( bJump )
- SwFlowFrm::SetMoveBwdJump( TRUE );
+ SwFlowFrm::SetMoveBwdJump( sal_True );
}
return pRet;
}
@@ -949,10 +960,10 @@ SwLayoutFrm *SwFrm::GetPrevFtnLeaf( MakePageType eMakeFtn )
|*************************************************************************/
-BOOL SwFrm::IsFtnAllowed() const
+sal_Bool SwFrm::IsFtnAllowed() const
{
if ( !IsInDocBody() )
- return FALSE;
+ return sal_False;
if ( IsInTab() )
{
@@ -961,7 +972,7 @@ BOOL SwFrm::IsFtnAllowed() const
if ( pTab->IsFollow() )
return !pTab->IsInHeadline( *this );
}
- return TRUE;
+ return sal_True;
}
/*************************************************************************
@@ -992,7 +1003,7 @@ void SwRootFrm::UpdateFtnNums()
|*
|*************************************************************************/
-void lcl_RemoveFtns( SwFtnBossFrm* pBoss, BOOL bPageOnly, BOOL bEndNotes )
+void lcl_RemoveFtns( SwFtnBossFrm* pBoss, sal_Bool bPageOnly, sal_Bool bEndNotes )
{
do
{
@@ -1046,7 +1057,7 @@ void lcl_RemoveFtns( SwFtnBossFrm* pBoss, BOOL bPageOnly, BOOL bEndNotes )
} while( pBoss );
}
-void SwRootFrm::RemoveFtns( SwPageFrm *pPage, BOOL bPageOnly, BOOL bEndNotes )
+void SwRootFrm::RemoveFtns( SwPageFrm *pPage, sal_Bool bPageOnly, sal_Bool bEndNotes )
{
if ( !pPage )
pPage = (SwPageFrm*)Lower();
@@ -1085,7 +1096,7 @@ void SwRootFrm::RemoveFtns( SwPageFrm *pPage, BOOL bPageOnly, BOOL bEndNotes )
|*
|*************************************************************************/
-void SwRootFrm::CheckFtnPageDescs( BOOL bEndNote )
+void SwRootFrm::CheckFtnPageDescs( sal_Bool bEndNote )
{
SwPageFrm *pPage = (SwPageFrm*)Lower();
while ( pPage && !pPage->IsFtnPage() )
@@ -1093,7 +1104,7 @@ void SwRootFrm::CheckFtnPageDescs( BOOL bEndNote )
while ( pPage && pPage->IsEndNotePage() != bEndNote )
pPage = (SwPageFrm*)pPage->GetNext();
if ( pPage )
- SwFrm::CheckPageDescs( pPage, FALSE );
+ SwFrm::CheckPageDescs( pPage, sal_False );
}
@@ -1158,7 +1169,7 @@ SwFtnContFrm *SwFtnBossFrm::FindFtnCont()
|*
|*************************************************************************/
-SwFtnContFrm *SwFtnBossFrm::FindNearestFtnCont( BOOL bDontLeave )
+SwFtnContFrm *SwFtnBossFrm::FindNearestFtnCont( sal_Bool bDontLeave )
{
SwFtnContFrm *pCont = 0;
if ( GetFmt()->GetDoc()->GetFtnIdxs().Count() )
@@ -1168,10 +1179,10 @@ SwFtnContFrm *SwFtnBossFrm::FindNearestFtnCont( BOOL bDontLeave )
{
SwPageFrm *pPage = FindPageFrm();
SwFtnBossFrm* pBoss = this;
- BOOL bEndNote = pPage->IsEndNotePage();
+ sal_Bool bEndNote = pPage->IsEndNotePage();
do
{
- BOOL bChgPage = lcl_NextFtnBoss( pBoss, pPage, bDontLeave );
+ sal_Bool bChgPage = lcl_NextFtnBoss( pBoss, pPage, bDontLeave );
// Haben wir noch einen Boss gefunden? Bei einem Seitenwechsel muss
// zudem noch das EndNotenFlag uebereinstimmen
if( pBoss && ( !bChgPage || pPage->IsEndNotePage() == bEndNote ) )
@@ -1203,9 +1214,9 @@ SwFtnFrm *SwFtnBossFrm::FindFirstFtn()
//von der aktuellen Spalte (bzw. einspaltigen Seite) referenziert wird.
SwFtnFrm *pRet = (SwFtnFrm*)pCont->Lower();
- const USHORT nRefNum = FindPageFrm()->GetPhyPageNum();
- const USHORT nRefCol = lcl_ColumnNum( this );
- USHORT nPgNum, nColNum; //Seitennummer, Spaltennummer
+ const sal_uInt16 nRefNum = FindPageFrm()->GetPhyPageNum();
+ const sal_uInt16 nRefCol = lcl_ColumnNum( this );
+ sal_uInt16 nPgNum, nColNum; //Seitennummer, Spaltennummer
SwFtnBossFrm* pBoss;
SwPageFrm* pPage;
if( pRet )
@@ -1213,7 +1224,7 @@ SwFtnFrm *SwFtnBossFrm::FindFirstFtn()
pBoss = pRet->GetRef()->FindFtnBossFrm();
ASSERT( pBoss, "FindFirstFtn: No boss found" );
if( !pBoss )
- return FALSE; // ?There must be a bug, but no GPF
+ return sal_False; // ?There must be a bug, but no GPF
pPage = pBoss->FindPageFrm();
nPgNum = pPage->GetPhyPageNum();
if ( nPgNum == nRefNum )
@@ -1242,7 +1253,7 @@ SwFtnFrm *SwFtnBossFrm::FindFirstFtn()
{
pBoss = pRet->FindFtnBossFrm();
pPage = pBoss->FindPageFrm();
- lcl_NextFtnBoss( pBoss, pPage, FALSE ); // naechster FtnBoss
+ lcl_NextFtnBoss( pBoss, pPage, sal_False ); // naechster FtnBoss
pCont = pBoss ? pBoss->FindNearestFtnCont() : 0;
if ( pCont )
pNxt = (SwFtnFrm*)pCont->Lower();
@@ -1284,8 +1295,8 @@ const SwFtnFrm *SwFtnBossFrm::FindFirstFtn( SwCntntFrm *pCnt ) const
const SwFtnFrm *pRet = ((SwFtnBossFrm*)this)->FindFirstFtn();
if ( pRet )
{
- const USHORT nColNum = lcl_ColumnNum( this ); //Spaltennummer
- const USHORT nPageNum = GetPhyPageNum();
+ const sal_uInt16 nColNum = lcl_ColumnNum( this ); //Spaltennummer
+ const sal_uInt16 nPageNum = GetPhyPageNum();
while ( pRet && (pRet->GetRef() != pCnt) )
{
while ( pRet->GetFollow() )
@@ -1296,7 +1307,7 @@ const SwFtnFrm *SwFtnBossFrm::FindFirstFtn( SwCntntFrm *pCnt ) const
else
{ SwFtnBossFrm *pBoss = (SwFtnBossFrm*)pRet->FindFtnBossFrm();
SwPageFrm *pPage = pBoss->FindPageFrm();
- lcl_NextFtnBoss( pBoss, pPage, FALSE ); // naechster FtnBoss
+ lcl_NextFtnBoss( pBoss, pPage, sal_False ); // naechster FtnBoss
SwFtnContFrm *pCont = pBoss ? pBoss->FindNearestFtnCont() : 0;
pRet = pCont ? (SwFtnFrm*)pCont->Lower() : 0;
}
@@ -1329,10 +1340,17 @@ void SwFtnBossFrm::ResetFtn( const SwFtnFrm *pCheck )
SwCntntNode *pNd = aIdx.GetNode().GetCntntNode();
if ( !pNd )
pNd = pCheck->GetFmt()->GetDoc()->
+<<<<<<< local
GetNodes().GoNextSection( &aIdx, TRUE, FALSE );
SwIterator<SwFrm,SwCntntNode> aIter( *pNd );
SwFrm* pFrm = aIter.First();
while( pFrm )
+=======
+ GetNodes().GoNextSection( &aIdx, sal_True, sal_False );
+ SwClientIter aIter( *pNd );
+ SwClient* pLast = aIter.GoStart();
+ while( pLast )
+>>>>>>> other
{
if( pFrm->getRootFrm() == pCheck->getRootFrm() )
{
@@ -1369,7 +1387,7 @@ void SwFtnBossFrm::ResetFtn( const SwFtnFrm *pCheck )
void SwFtnBossFrm::InsertFtn( SwFtnFrm* pNew )
{
#if (OSL_DEBUG_LEVEL > 1) && defined(DBG_UTIL)
- static USHORT nStop = 0;
+ static sal_uInt16 nStop = 0;
if ( nStop == pNew->GetFrmId() )
{
int bla = 5;
@@ -1387,7 +1405,7 @@ void SwFtnBossFrm::InsertFtn( SwFtnFrm* pNew )
ResetFtn( pNew );
SwFtnFrm *pSibling = FindFirstFtn();
- BOOL bDontLeave = FALSE;
+ sal_Bool bDontLeave = sal_False;
// Ok, a sibling has been found, but is the sibling in an acceptable
// environment?
@@ -1434,10 +1452,10 @@ void SwFtnBossFrm::InsertFtn( SwFtnFrm* pNew )
//Damit die Position herausgefunden werden kann.
SwDoc *pDoc = GetFmt()->GetDoc();
- const ULONG nStPos = ::lcl_FindFtnPos( pDoc, pNew->GetAttr() );
+ const sal_uLong nStPos = ::lcl_FindFtnPos( pDoc, pNew->GetAttr() );
- ULONG nCmpPos = 0;
- ULONG nLastPos = 0;
+ sal_uLong nCmpPos = 0;
+ sal_uLong nLastPos = 0;
SwFtnContFrm *pParent = 0;
if( pSibling )
{
@@ -1508,8 +1526,8 @@ void SwFtnBossFrm::InsertFtn( SwFtnFrm* pNew )
{
pNxtB = pSibling->FindFtnBossFrm();
SwPageFrm *pSibPage = pNxtB->FindPageFrm();
- BOOL bEndNote = pSibPage->IsEndNotePage();
- BOOL bChgPage = lcl_NextFtnBoss( pNxtB, pSibPage, bDontLeave );
+ sal_Bool bEndNote = pSibPage->IsEndNotePage();
+ sal_Bool bChgPage = lcl_NextFtnBoss( pNxtB, pSibPage, bDontLeave );
// Bei Seitenwechsel muss das EndNoteFlag ueberprueft werden.
SwFtnContFrm *pCont = pNxtB && ( !bChgPage ||
pSibPage->IsEndNotePage() == bEndNote )
@@ -1553,9 +1571,9 @@ void SwFtnBossFrm::InsertFtn( SwFtnFrm* pNew )
//dann der Vorgaenger.
SwFtnBossFrm* pBoss = pNew->GetRef()->FindFtnBossFrm(
!pNew->GetAttr()->GetFtn().IsEndNote() );
- USHORT nRefNum = pBoss->GetPhyPageNum(); // Die Seiten- und
- USHORT nRefCol = lcl_ColumnNum( pBoss ); // Spaltennummer der neuen Fussnote
- BOOL bEnd = FALSE;
+ sal_uInt16 nRefNum = pBoss->GetPhyPageNum(); // Die Seiten- und
+ sal_uInt16 nRefCol = lcl_ColumnNum( pBoss ); // Spaltennummer der neuen Fussnote
+ sal_Bool bEnd = sal_False;
SwFtnFrm *pLastSib = 0;
while ( pSibling && !bEnd && (nCmpPos <= nStPos) )
{
@@ -1570,20 +1588,20 @@ void SwFtnBossFrm::InsertFtn( SwFtnFrm* pNew )
{
pBoss = pSibling->GetRef()->FindFtnBossFrm( !pSibling->
GetAttr()->GetFtn().IsEndNote() );
- USHORT nTmpRef;
+ sal_uInt16 nTmpRef;
if( nStPos >= ENDNOTE ||
(nTmpRef = pBoss->GetPhyPageNum()) < nRefNum ||
( nTmpRef == nRefNum && lcl_ColumnNum( pBoss ) <= nRefCol ))
pSibling = pFoll;
else
- bEnd = TRUE;
+ bEnd = sal_True;
}
else
{
SwFtnBossFrm* pNxtB = pSibling->FindFtnBossFrm();
SwPageFrm *pSibPage = pNxtB->FindPageFrm();
- BOOL bEndNote = pSibPage->IsEndNotePage();
- BOOL bChgPage = lcl_NextFtnBoss( pNxtB, pSibPage, bDontLeave );
+ sal_Bool bEndNote = pSibPage->IsEndNotePage();
+ sal_Bool bChgPage = lcl_NextFtnBoss( pNxtB, pSibPage, bDontLeave );
// Bei Seitenwechsel muss das EndNoteFlag ueberprueft werden.
SwFtnContFrm *pCont = pNxtB && ( !bChgPage ||
pSibPage->IsEndNotePage() == bEndNote )
@@ -1591,7 +1609,7 @@ void SwFtnBossFrm::InsertFtn( SwFtnFrm* pNew )
if ( pCont )
pSibling = (SwFtnFrm*)pCont->Lower();
else
- bEnd = TRUE;
+ bEnd = sal_True;
}
if ( !bEnd && pSibling )
nCmpPos = ::lcl_FindFtnPos( pDoc, pSibling->GetAttr() );
@@ -1600,7 +1618,7 @@ void SwFtnBossFrm::InsertFtn( SwFtnFrm* pNew )
if ( (nLastPos < nCmpPos) && (nCmpPos > nStPos) )
{
pSibling = pLastSib;
- bEnd = TRUE;
+ bEnd = sal_True;
}
}
}
@@ -1621,7 +1639,7 @@ void SwFtnBossFrm::InsertFtn( SwFtnFrm* pNew )
{
if( ENDNOTE > nCmpPos || nStPos >= ENDNOTE )
{
- ASSERT( FALSE, "InsertFtn: Master expected II" );
+ ASSERT( sal_False, "InsertFtn: Master expected II" );
do
pSibling = pSibling->GetMaster();
while ( pSibling->GetMaster() );
@@ -1656,11 +1674,11 @@ void SwFtnBossFrm::AppendFtn( SwCntntFrm *pRef, SwTxtFtn *pAttr )
SwFtnBossFrm *pBoss = this;
SwPageFrm *pPage = FindPageFrm();
SwPageFrm *pMyPage = pPage;
- BOOL bChgPage = FALSE;
- BOOL bEnd = FALSE;
+ sal_Bool bChgPage = sal_False;
+ sal_Bool bEnd = sal_False;
if ( pAttr->GetFtn().IsEndNote() )
{
- bEnd = TRUE;
+ bEnd = sal_True;
if( GetUpper()->IsSctFrm() &&
((SwSectionFrm*)GetUpper())->IsEndnAtEnd() )
{
@@ -1677,15 +1695,15 @@ void SwFtnBossFrm::AppendFtn( SwCntntFrm *pRef, SwTxtFtn *pAttr )
while ( pPage->GetNext() && !pPage->IsEndNotePage() )
{
pPage = (SwPageFrm*)pPage->GetNext();
- bChgPage = TRUE;
+ bChgPage = sal_True;
}
if ( !pPage->IsEndNotePage() )
{
SwPageDesc *pDesc = pDoc->GetEndNoteInfo().GetPageDesc( *pDoc );
pPage = ::InsertNewPage( *pDesc, pPage->GetUpper(),
- !pPage->OnRightPage(), FALSE, TRUE, 0 );
- pPage->SetEndNotePage( TRUE );
- bChgPage = TRUE;
+ !pPage->OnRightPage(), sal_False, sal_True, 0 );
+ pPage->SetEndNotePage( sal_True );
+ bChgPage = sal_True;
}
else
{
@@ -1693,7 +1711,7 @@ void SwFtnBossFrm::AppendFtn( SwCntntFrm *pRef, SwTxtFtn *pAttr )
//suchen. Damit stellen wir sicher das wir auch bei hunderten
//Fussnoten noch in endlicher Zeit fertig werden.
SwPageFrm *pNxt = (SwPageFrm*)pPage->GetNext();
- const ULONG nStPos = ::lcl_FindFtnPos( pDoc, pAttr );
+ const sal_uLong nStPos = ::lcl_FindFtnPos( pDoc, pAttr );
while ( pNxt && pNxt->IsEndNotePage() )
{
SwFtnContFrm *pCont = pNxt->FindFtnCont();
@@ -1720,15 +1738,15 @@ void SwFtnBossFrm::AppendFtn( SwCntntFrm *pRef, SwTxtFtn *pAttr )
!((SwPageFrm*)pPage->GetNext())->IsEndNotePage() )
{
pPage = (SwPageFrm*)pPage->GetNext();
- bChgPage = TRUE;
+ bChgPage = sal_True;
}
if ( !pPage->IsFtnPage() )
{
SwPageDesc *pDesc = pDoc->GetFtnInfo().GetPageDesc( *pDoc );
pPage = ::InsertNewPage( *pDesc, pPage->GetUpper(),
- !pPage->OnRightPage(), FALSE, TRUE, pPage->GetNext() );
- bChgPage = TRUE;
+ !pPage->OnRightPage(), sal_False, sal_True, pPage->GetNext() );
+ bChgPage = sal_True;
}
else
{
@@ -1736,7 +1754,7 @@ void SwFtnBossFrm::AppendFtn( SwCntntFrm *pRef, SwTxtFtn *pAttr )
//suchen. Damit stellen wir sicher das wir auch bei hunderten
//Fussnoten noch in endlicher Zeit fertig werden.
SwPageFrm *pNxt = (SwPageFrm*)pPage->GetNext();
- const ULONG nStPos = ::lcl_FindFtnPos( pDoc, pAttr );
+ const sal_uLong nStPos = ::lcl_FindFtnPos( pDoc, pAttr );
while ( pNxt && pNxt->IsFtnPage() && !pNxt->IsEndNotePage() )
{
SwFtnContFrm *pCont = pNxt->FindFtnCont();
@@ -1881,7 +1899,7 @@ SwFtnFrm *SwFtnBossFrm::FindFtn( const SwCntntFrm *pRef, const SwTxtFtn *pAttr )
SwCntntNode *pNd = aIdx.GetNode().GetCntntNode();
if ( !pNd )
pNd = pRef->GetAttrSet()->GetDoc()->
- GetNodes().GoNextSection( &aIdx, TRUE, FALSE );
+ GetNodes().GoNextSection( &aIdx, sal_True, sal_False );
if ( !pNd )
return 0;
SwIterator<SwFrm,SwCntntNode> aIter( *pNd );
@@ -1920,7 +1938,7 @@ SwFtnFrm *SwFtnBossFrm::FindFtn( const SwCntntFrm *pRef, const SwTxtFtn *pAttr )
void SwFtnBossFrm::RemoveFtn( const SwCntntFrm *pRef, const SwTxtFtn *pAttr,
- BOOL bPrep )
+ sal_Bool bPrep )
{
SwFtnFrm *pFtn = FindFtn( pRef, pAttr );
if( pFtn )
@@ -2075,7 +2093,7 @@ void SwFtnBossFrm::_CollectFtns( const SwCntntFrm* _pRef,
while ( _pFtn->GetMaster() )
_pFtn = _pFtn->GetMaster();
- BOOL bFound = FALSE;
+ sal_Bool bFound = sal_False;
while ( _pFtn )
{
@@ -2092,7 +2110,7 @@ void SwFtnBossFrm::_CollectFtns( const SwCntntFrm* _pRef,
SwPageFrm* pPage = pBoss->FindPageFrm();
do
{
- lcl_NextFtnBoss( pBoss, pPage, FALSE );
+ lcl_NextFtnBoss( pBoss, pPage, sal_False );
if( pBoss )
{
SwLayoutFrm* pCont = pBoss->FindFtnCont();
@@ -2117,7 +2135,7 @@ void SwFtnBossFrm::_CollectFtns( const SwCntntFrm* _pRef,
}
if ( pNxtFtn == _pFtn )
{
- ASSERT( FALSE, "_CollectFtn: Devil's circle" );
+ ASSERT( sal_False, "_CollectFtn: Devil's circle" );
pNxtFtn = 0;
}
@@ -2168,7 +2186,7 @@ void SwFtnBossFrm::_CollectFtns( const SwCntntFrm* _pRef,
}
_pFtn->Cut();
FtnInArr( _rFtnArr, _pFtn );
- bFound = TRUE;
+ bFound = sal_True;
}
else
{
@@ -2192,27 +2210,27 @@ void SwFtnBossFrm::_CollectFtns( const SwCntntFrm* _pRef,
|*************************************************************************/
-void SwFtnBossFrm::_MoveFtns( SvPtrarr &rFtnArr, BOOL bCalc )
+void SwFtnBossFrm::_MoveFtns( SvPtrarr &rFtnArr, sal_Bool bCalc )
{
//Alle Fussnoten die von pRef referenziert werden muessen von der
//aktuellen Position, die sich durch die alte Spalte/Seite ergab, auf eine
//neue Position, bestimmt durch die neue Spalte/Seite, gemoved werden.
- const USHORT nMyNum = FindPageFrm()->GetPhyPageNum();
- const USHORT nMyCol = lcl_ColumnNum( this );
+ const sal_uInt16 nMyNum = FindPageFrm()->GetPhyPageNum();
+ const sal_uInt16 nMyCol = lcl_ColumnNum( this );
SWRECTFN( this )
// --> OD 2004-06-11 #i21478# - keep last inserted footnote in order to
// format the content of the following one.
SwFtnFrm* pLastInsertedFtn = 0L;
- for ( USHORT i = 0; i < rFtnArr.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rFtnArr.Count(); ++i )
{
SwFtnFrm *pFtn = (SwFtnFrm*)rFtnArr[i];
- SwFtnBossFrm* pRefBoss = pFtn->GetRef()->FindFtnBossFrm( TRUE );
+ SwFtnBossFrm* pRefBoss = pFtn->GetRef()->FindFtnBossFrm( sal_True );
if( pRefBoss != this )
{
- const USHORT nRefNum = pRefBoss->FindPageFrm()->GetPhyPageNum();
- const USHORT nRefCol = lcl_ColumnNum( this );
+ const sal_uInt16 nRefNum = pRefBoss->FindPageFrm()->GetPhyPageNum();
+ const sal_uInt16 nRefCol = lcl_ColumnNum( this );
if( nRefNum < nMyNum || ( nRefNum == nMyNum && nRefCol <= nMyCol ) )
pRefBoss = this;
}
@@ -2253,7 +2271,7 @@ void SwFtnBossFrm::_MoveFtns( SvPtrarr &rFtnArr, BOOL bCalc )
{
SwTxtFtn *pAttr = pFtn->GetAttr();
pCnt = pFtn->ContainsAny();
- BOOL bUnlock = !pFtn->IsBackMoveLocked();
+ sal_Bool bUnlock = !pFtn->IsBackMoveLocked();
pFtn->LockBackMove();
// --> OD 2005-05-18 #i49383# - disable unlock of position of
@@ -2347,7 +2365,7 @@ void SwFtnBossFrm::_MoveFtns( SvPtrarr &rFtnArr, BOOL bCalc )
SwTxtFtn* pAttr = pNextFtn->GetAttr();
SwFrm* pCnt = pNextFtn->ContainsAny();
- BOOL bUnlock = !pNextFtn->IsBackMoveLocked();
+ sal_Bool bUnlock = !pNextFtn->IsBackMoveLocked();
pNextFtn->LockBackMove();
// --> OD 2005-05-18 #i49383# - disable unlock of position of
// lower objects during format of footnote content.
@@ -2415,14 +2433,14 @@ void SwFtnBossFrm::MoveFtns( const SwCntntFrm *pSrc, SwCntntFrm *pDest,
|| pAttr->GetFtn().IsEndNote() )
return;
- ASSERT( this == pSrc->FindFtnBossFrm( TRUE ),
+ ASSERT( this == pSrc->FindFtnBossFrm( sal_True ),
"SwPageFrm::MoveFtns: source frame isn't on that FtnBoss" );
SwFtnFrm *pFtn = FindFirstFtn();
if( pFtn )
{
ChangeFtnRef( pSrc, pAttr, pDest );
- SwFtnBossFrm *pDestBoss = pDest->FindFtnBossFrm( TRUE );
+ SwFtnBossFrm *pDestBoss = pDest->FindFtnBossFrm( sal_True );
ASSERT( pDestBoss, "+SwPageFrm::MoveFtns: no destination boss" );
if( pDestBoss ) // robust
{
@@ -2430,7 +2448,7 @@ void SwFtnBossFrm::MoveFtns( const SwCntntFrm *pSrc, SwCntntFrm *pDest,
pDestBoss->_CollectFtns( pDest, pFtn, aFtnArr );
if ( aFtnArr.Count() )
{
- pDestBoss->_MoveFtns( aFtnArr, TRUE );
+ pDestBoss->_MoveFtns( aFtnArr, sal_True );
SwPageFrm* pSrcPage = FindPageFrm();
SwPageFrm* pDestPage = pDestBoss->FindPageFrm();
// Nur beim Seitenwechsel FtnNum Updaten
@@ -2452,7 +2470,7 @@ void SwFtnBossFrm::MoveFtns( const SwCntntFrm *pSrc, SwCntntFrm *pDest,
|*************************************************************************/
-void SwFtnBossFrm::RearrangeFtns( const SwTwips nDeadLine, const BOOL bLock,
+void SwFtnBossFrm::RearrangeFtns( const SwTwips nDeadLine, const sal_Bool bLock,
const SwTxtFtn *pAttr )
{
//Alle Fussnoten der Spalte/Seite dergestalt anformatieren,
@@ -2466,7 +2484,7 @@ void SwFtnBossFrm::RearrangeFtns( const SwTwips nDeadLine, const BOOL bLock,
SwFrm* pCntnt = pFirst->ContainsAny();
if( pCntnt )
{
- BOOL bUnlock = !pFirst->IsBackMoveLocked();
+ sal_Bool bUnlock = !pFirst->IsBackMoveLocked();
pFirst->LockBackMove();
pFirst->Calc();
pCntnt->Calc();
@@ -2483,12 +2501,12 @@ void SwFtnBossFrm::RearrangeFtns( const SwTwips nDeadLine, const BOOL bLock,
pFtn = FindFirstFtn();
}
SwDoc *pDoc = GetFmt()->GetDoc();
- const ULONG nFtnPos = pAttr ? ::lcl_FindFtnPos( pDoc, pAttr ) : 0;
+ const sal_uLong nFtnPos = pAttr ? ::lcl_FindFtnPos( pDoc, pAttr ) : 0;
SwFrm *pCnt = pFtn ? pFtn->ContainsAny() : 0;
if ( pCnt )
{
- BOOL bMore = TRUE;
- BOOL bStart = pAttr == 0; // wenn kein Attribut uebergeben wird, alle bearbeiten
+ sal_Bool bMore = sal_True;
+ sal_Bool bStart = pAttr == 0; // wenn kein Attribut uebergeben wird, alle bearbeiten
// --> OD 2005-05-18 #i49383# - disable unlock of position of
// lower objects during format of footnote and footnote content.
SwFtnFrm* pLastFtnFrm( 0L );
@@ -2563,7 +2581,7 @@ void SwFtnBossFrm::RearrangeFtns( const SwTwips nDeadLine, const BOOL bLock,
}
if ( bLock )
{
- BOOL bUnlock = !pFtnFrm->IsBackMoveLocked();
+ sal_Bool bUnlock = !pFtnFrm->IsBackMoveLocked();
pFtnFrm->LockBackMove();
pFtnFrm->Calc();
pCnt->Calc();
@@ -2638,10 +2656,10 @@ void SwFtnBossFrm::RearrangeFtns( const SwTwips nDeadLine, const BOOL bLock,
SwFtnFrm* pFtnFrm = pCnt->FindFtnFrm();
if( pFtnFrm->GetRef()->FindFtnBossFrm(
pFtnFrm->GetAttr()->GetFtn().IsEndNote() ) != this )
- bMore = FALSE;
+ bMore = sal_False;
}
else
- bMore = FALSE;
+ bMore = sal_False;
}
if( pDel )
{
@@ -2655,7 +2673,7 @@ void SwFtnBossFrm::RearrangeFtns( const SwTwips nDeadLine, const BOOL bLock,
if ( pAttr &&
(::lcl_FindFtnPos( pDoc,
pCnt->FindFtnFrm()->GetAttr()) > nFtnPos ) )
- bMore = FALSE;
+ bMore = sal_False;
}
} while ( bMore );
// --> OD 2005-05-18 #i49383#
@@ -2703,13 +2721,13 @@ void SwPageFrm::UpdateFtnNum()
return;
SwCntntFrm* pCntnt = pBody->ContainsCntnt();
- USHORT nNum = 0;
+ sal_uInt16 nNum = 0;
while( pCntnt && pCntnt->FindPageFrm() == this )
{
if( ((SwTxtFrm*)pCntnt)->HasFtn() )
{
- SwFtnBossFrm* pBoss = pCntnt->FindFtnBossFrm( TRUE );
+ SwFtnBossFrm* pBoss = pCntnt->FindFtnBossFrm( sal_True );
if( pBoss->GetUpper()->IsSctFrm() &&
((SwSectionFrm*)pBoss->GetUpper())->IsOwnFtnNum() )
pCntnt = ((SwSectionFrm*)pBoss->GetUpper())->FindLastCntnt();
@@ -2728,10 +2746,10 @@ void SwPageFrm::UpdateFtnNum()
pFtn = (SwFtnFrm*)pFtn->GetNext();
else
{
- SwFtnBossFrm* pTmpBoss = pFtn->FindFtnBossFrm( TRUE );
+ SwFtnBossFrm* pTmpBoss = pFtn->FindFtnBossFrm( sal_True );
SwPageFrm* pPage = pTmpBoss->FindPageFrm();
pFtn = NULL;
- lcl_NextFtnBoss( pTmpBoss, pPage, FALSE );
+ lcl_NextFtnBoss( pTmpBoss, pPage, sal_False );
if( pTmpBoss )
{
SwFtnContFrm *pCont = pTmpBoss->FindNearestFtnCont();
@@ -2770,11 +2788,16 @@ void SwFtnBossFrm::SetFtnDeadLine( const SwTwips nDeadLine )
else
nMaxFtnHeight = -(pBody->Frm().*fnRect->fnBottomDist)( nDeadLine );
+<<<<<<< local
const ViewShell *pSh = getRootFrm() ? getRootFrm()->GetCurrShell() : 0;
if( pSh && pSh->GetViewOptions()->getBrowseMode() )
nMaxFtnHeight += pBody->Grow( LONG_MAX, TRUE );
+=======
+ if ( GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ nMaxFtnHeight += pBody->Grow( LONG_MAX, sal_True );
+>>>>>>> other
if ( IsInSct() )
- nMaxFtnHeight += FindSctFrm()->Grow( LONG_MAX, TRUE );
+ nMaxFtnHeight += FindSctFrm()->Grow( LONG_MAX, sal_True );
if ( nMaxFtnHeight < 0 )
nMaxFtnHeight = 0;
@@ -2873,9 +2896,9 @@ SwTwips SwFtnBossFrm::GetVarSpace() const
|*
|*************************************************************************/
-BYTE SwFtnBossFrm::_NeighbourhoodAdjustment( const SwFrm* ) const
+sal_uInt8 SwFtnBossFrm::_NeighbourhoodAdjustment( const SwFrm* ) const
{
- BYTE nRet = NA_ONLY_ADJUST;
+ sal_uInt8 nRet = NA_ONLY_ADJUST;
if( GetUpper() && !GetUpper()->IsPageBodyFrm() )
{
// Spaltige Rahmen erfordern Grow/Shrink
@@ -2928,22 +2951,22 @@ void SwPageFrm::SetColMaxFtnHeight()
|*************************************************************************/
-BOOL SwLayoutFrm::MoveLowerFtns( SwCntntFrm *pStart, SwFtnBossFrm *pOldBoss,
- SwFtnBossFrm *pNewBoss, const BOOL bFtnNums )
+sal_Bool SwLayoutFrm::MoveLowerFtns( SwCntntFrm *pStart, SwFtnBossFrm *pOldBoss,
+ SwFtnBossFrm *pNewBoss, const sal_Bool bFtnNums )
{
SwDoc *pDoc = GetFmt()->GetDoc();
if ( !pDoc->GetFtnIdxs().Count() )
- return FALSE;
+ return sal_False;
if( pDoc->GetFtnInfo().ePos == FTNPOS_CHAPTER &&
( !IsInSct() || !FindSctFrm()->IsFtnAtEnd() ) )
- return TRUE;
+ return sal_True;
if ( !pNewBoss )
- pNewBoss = FindFtnBossFrm( TRUE );
+ pNewBoss = FindFtnBossFrm( sal_True );
if ( pNewBoss == pOldBoss )
- return FALSE;
+ return sal_False;
- BOOL bMoved = FALSE;
+ sal_Bool bMoved = sal_False;
if( !pStart )
pStart = ContainsCntnt();
@@ -2972,8 +2995,8 @@ BOOL SwLayoutFrm::MoveLowerFtns( SwCntntFrm *pStart, SwFtnBossFrm *pOldBoss,
!= ( pNewChief = pNewBoss->FindSctFrm() ) )
{
pFtnArr = new SvPtrarr( 5, 5 );
- pOldChief = pOldBoss->FindFtnBossFrm( TRUE );
- pNewChief = pNewBoss->FindFtnBossFrm( TRUE );
+ pOldChief = pOldBoss->FindFtnBossFrm( sal_True );
+ pNewChief = pNewBoss->FindFtnBossFrm( sal_True );
while( pOldChief->IsAnLower( pStart ) )
{
if ( ((SwTxtFrm*)pStart)->HasFtn() )
@@ -2993,13 +3016,13 @@ BOOL SwLayoutFrm::MoveLowerFtns( SwCntntFrm *pStart, SwFtnBossFrm *pOldBoss,
if ( aFtnArr.Count() || pFtnArr )
{
if( aFtnArr.Count() )
- pNewBoss->_MoveFtns( aFtnArr, TRUE );
+ pNewBoss->_MoveFtns( aFtnArr, sal_True );
if( pFtnArr )
{
- ((SwFtnBossFrm*)pNewChief)->_MoveFtns( *pFtnArr, TRUE );
+ ((SwFtnBossFrm*)pNewChief)->_MoveFtns( *pFtnArr, sal_True );
delete pFtnArr;
}
- bMoved = TRUE;
+ bMoved = sal_True;
// Nur bei einem Seitenwechsel muss die FtnNum neu berechnet werden
if ( bFtnNums )
@@ -3023,7 +3046,7 @@ BOOL SwLayoutFrm::MoveLowerFtns( SwCntntFrm *pStart, SwFtnBossFrm *pOldBoss,
|*************************************************************************/
-BOOL SwCntntFrm::MoveFtnCntFwd( BOOL bMakePage, SwFtnBossFrm *pOldBoss )
+sal_Bool SwCntntFrm::MoveFtnCntFwd( sal_Bool bMakePage, SwFtnBossFrm *pOldBoss )
{
ASSERT( IsInFtn(), "Keine Ftn." );
SwLayoutFrm *pFtn = FindFtnFrm();
@@ -3036,7 +3059,7 @@ BOOL SwCntntFrm::MoveFtnCntFwd( BOOL bMakePage, SwFtnBossFrm *pOldBoss )
{
SwLayoutFrm* pBody = pOldBoss->FindBodyCont();
if( !pBody || !pBody->Lower() )
- return TRUE;
+ return sal_True;
}
//fix(9538): Wenn die Ftn noch Nachbarn hinter sich hat, so muessen
@@ -3053,21 +3076,21 @@ BOOL SwCntntFrm::MoveFtnCntFwd( BOOL bMakePage, SwFtnBossFrm *pOldBoss )
{ pLst = pNxt;
SwCntntFrm *pCnt = pNxt->ContainsCntnt();
if( pCnt )
- pCnt->MoveFtnCntFwd( TRUE, pOldBoss );
+ pCnt->MoveFtnCntFwd( sal_True, pOldBoss );
pNxt = (SwLayoutFrm*)pFtn->GetNext();
}
}
- BOOL bSamePage = TRUE;
+ sal_Bool bSamePage = sal_True;
SwLayoutFrm *pNewUpper =
- GetLeaf( bMakePage ? MAKEPAGE_INSERT : MAKEPAGE_NONE, TRUE );
+ GetLeaf( bMakePage ? MAKEPAGE_INSERT : MAKEPAGE_NONE, sal_True );
if ( pNewUpper )
{
- BOOL bSameBoss = TRUE;
+ sal_Bool bSameBoss = sal_True;
SwFtnBossFrm * const pNewBoss = pNewUpper->FindFtnBossFrm();
//Wechseln wir die Spalte/Seite?
- if ( FALSE == ( bSameBoss = pNewBoss == pOldBoss ) )
+ if ( sal_False == ( bSameBoss = pNewBoss == pOldBoss ) )
{
bSamePage = pOldBoss->FindPageFrm() == pNewBoss->FindPageFrm(); // Seitenwechsel?
pNewUpper->Calc();
@@ -3120,7 +3143,7 @@ BOOL SwCntntFrm::MoveFtnCntFwd( BOOL bMakePage, SwFtnBossFrm *pOldBoss )
pNewUp = (SwSectionFrm*)pTmpFtn->Lower();
else
{
- pNewUp = new SwSectionFrm( *pSect, FALSE );
+ pNewUp = new SwSectionFrm( *pSect, sal_False );
pNewUp->InsertBefore( pTmpFtn, pTmpFtn->Lower() );
static_cast<SwSectionFrm*>(pNewUp)->Init();
pNewUp->Frm().Pos() = pTmpFtn->Frm().Pos();
@@ -3221,7 +3244,11 @@ SwCntntFrm* SwFtnFrm::GetRefFromAttr()
ASSERT( pAttr, "invalid Attribute" );
SwTxtNode& rTNd = (SwTxtNode&)pAttr->GetTxtNode();
SwPosition aPos( rTNd, SwIndex( &rTNd, *pAttr->GetStart() ));
+<<<<<<< local
SwCntntFrm* pCFrm = rTNd.getLayoutFrm( getRootFrm(), 0, &aPos, FALSE );
+=======
+ SwCntntFrm* pCFrm = rTNd.GetFrm( 0, &aPos, sal_False );
+>>>>>>> other
return pCFrm;
}
diff --git a/sw/source/core/layout/hffrm.cxx b/sw/source/core/layout/hffrm.cxx
index 88659af6f74c..3b52ea360ead 100644
--- a/sw/source/core/layout/hffrm.cxx
+++ b/sw/source/core/layout/hffrm.cxx
@@ -52,7 +52,7 @@
#include <objectformatter.hxx>
// <--
-extern BOOL bObjsDirect; //frmtool.cxx
+extern sal_Bool bObjsDirect; //frmtool.cxx
static SwTwips lcl_GetFrmMinHeight(const SwLayoutFrm & rFrm)
{
@@ -80,7 +80,7 @@ static SwTwips lcl_CalcContentHeight(SwLayoutFrm & frm)
SwFrm* pFrm = frm.Lower();
SwTwips nRemaining = 0;
- USHORT nNum = 0;
+ sal_uInt16 nNum = 0;
pFrm = frm.Lower();
while ( pFrm )
{
@@ -119,20 +119,25 @@ static void lcl_LayoutFrmEnsureMinHeight(SwLayoutFrm & rFrm,
}
}
+<<<<<<< local
SwHeadFootFrm::SwHeadFootFrm( SwFrmFmt * pFmt, SwFrm* pSib, USHORT nTypeIn)
: SwLayoutFrm( pFmt, pSib )
+=======
+SwHeadFootFrm::SwHeadFootFrm( SwFrmFmt * pFmt, sal_uInt16 nTypeIn)
+ : SwLayoutFrm(pFmt)
+>>>>>>> other
{
nType = nTypeIn;
- SetDerivedVert( FALSE );
+ SetDerivedVert( sal_False );
const SwFmtCntnt &rCnt = pFmt->GetCntnt();
ASSERT( rCnt.GetCntntIdx(), "Kein Inhalt fuer Header." );
//Fuer Header Footer die Objekte gleich erzeugen lassen.
- BOOL bOld = bObjsDirect;
- bObjsDirect = TRUE;
- ULONG nIndex = rCnt.GetCntntIdx()->GetIndex();
+ sal_Bool bOld = bObjsDirect;
+ bObjsDirect = sal_True;
+ sal_uLong nIndex = rCnt.GetCntntIdx()->GetIndex();
::_InsertCnt( this, pFmt->GetDoc(), ++nIndex );
bObjsDirect = bOld;
}
@@ -234,7 +239,7 @@ void SwHeadFootFrm::FormatPrt(SwTwips & nUL, const SwBorderAttrs * pAttrs)
}
- bValidPrtArea = TRUE;
+ bValidPrtArea = sal_True;
}
void SwHeadFootFrm::FormatSize(SwTwips nUL, const SwBorderAttrs * pAttrs)
@@ -243,7 +248,7 @@ void SwHeadFootFrm::FormatSize(SwTwips nUL, const SwBorderAttrs * pAttrs)
{
if( !IsColLocked() )
{
- bValidSize = bValidPrtArea = TRUE;
+ bValidSize = bValidPrtArea = sal_True;
const SwTwips nBorder = nUL;
SwTwips nMinHeight = lcl_GetFrmMinHeight(*this);
@@ -399,11 +404,11 @@ void SwHeadFootFrm::FormatSize(SwTwips nUL, const SwBorderAttrs * pAttrs)
Prt().SSize().Height() = Frm().Height() - nBorder;
}
}
- bValidSize = bValidPrtArea = TRUE;
+ bValidSize = bValidPrtArea = sal_True;
} while( nRemaining<=nMaxHeight && nOldHeight!=Prt().Height() );
ColUnlock();
}
- bValidSize = bValidPrtArea = TRUE;
+ bValidSize = bValidPrtArea = sal_True;
}
else //if ( GetType() & 0x0018 )
{
@@ -411,7 +416,7 @@ void SwHeadFootFrm::FormatSize(SwTwips nUL, const SwBorderAttrs * pAttrs)
{
if ( Frm().Height() != pAttrs->GetSize().Height() )
ChgSize( Size( Frm().Width(), pAttrs->GetSize().Height()));
- bValidSize = TRUE;
+ bValidSize = sal_True;
MakePos();
} while ( !bValidSize );
}
@@ -442,7 +447,7 @@ void SwHeadFootFrm::Format(const SwBorderAttrs * pAttrs)
}
}
-SwTwips SwHeadFootFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
+SwTwips SwHeadFootFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
{
SwTwips nResult;
@@ -544,7 +549,7 @@ SwTwips SwHeadFootFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
return nResult;
}
-SwTwips SwHeadFootFrm::ShrinkFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
+SwTwips SwHeadFootFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
{
SwTwips nResult;
@@ -660,15 +665,15 @@ SwTwips SwHeadFootFrm::ShrinkFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
return nResult;
}
-BOOL SwHeadFootFrm::GetEatSpacing() const
+sal_Bool SwHeadFootFrm::GetEatSpacing() const
{
const SwFrmFmt * pFmt = GetFmt();
ASSERT(pFmt, "SwHeadFootFrm: no format?");
if (pFmt->GetHeaderAndFooterEatSpacing().GetValue())
- return TRUE;
+ return sal_True;
- return FALSE;
+ return sal_False;
}
@@ -712,8 +717,12 @@ void SwPageFrm::PrepareHeader()
const SwFmtHeader &rH = ((SwFrmFmt*)GetRegisteredIn())->GetHeader();
+<<<<<<< local
const ViewShell *pSh = getRootFrm()->GetCurrShell();
const BOOL bOn = !(pSh && pSh->GetViewOptions()->getBrowseMode());
+=======
+ const sal_Bool bOn = !((SwFrmFmt*)pRegisteredIn)->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
+>>>>>>> other
if ( bOn && rH.IsActive() )
{ //Header einsetzen, vorher entfernen falls vorhanden.
@@ -763,8 +772,12 @@ void SwPageFrm::PrepareFooter()
while ( pLay->GetNext() )
pLay = (SwLayoutFrm*)pLay->GetNext();
+<<<<<<< local
const ViewShell *pSh = getRootFrm()->GetCurrShell();
const BOOL bOn = !(pSh && pSh->GetViewOptions()->getBrowseMode());
+=======
+ const sal_Bool bOn = !((SwFrmFmt*)pRegisteredIn)->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
+>>>>>>> other
if ( bOn && rF.IsActive() )
{ //Footer einsetzen, vorher entfernen falls vorhanden.
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 2d6924a82b1d..c5606aa40878 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -160,7 +160,7 @@ static void BreakPoint()
} \
}
-inline ULONG Ticks()
+inline sal_uLong Ticks()
{
return 1000 * clock() / CLOCKS_PER_SEC;
}
@@ -171,7 +171,7 @@ void SwLayAction::CheckWaitCrsr()
if ( !IsWait() && IsWaitAllowed() && IsPaint() &&
((Ticks() - GetStartTicks()) >= CLOCKS_PER_SEC/2) )
{
- pWait = new SwWait( *pRoot->GetFmt()->GetDoc()->GetDocShell(), TRUE );
+ pWait = new SwWait( *pRoot->GetFmt()->GetDoc()->GetDocShell(), sal_True );
}
}
@@ -198,7 +198,7 @@ inline void SwLayAction::CheckIdleEnd()
|* Letzte Aenderung MA 06. Aug. 95
|*
|*************************************************************************/
-void SwLayAction::SetStatBar( BOOL bNew )
+void SwLayAction::SetStatBar( sal_Bool bNew )
{
if ( bNew )
{
@@ -221,13 +221,13 @@ void SwLayAction::SetStatBar( BOOL bNew )
|* Letzte Aenderung MA 10. Sep. 96
|*
|*************************************************************************/
-BOOL SwLayAction::PaintWithoutFlys( const SwRect &rRect, const SwCntntFrm *pCnt,
+sal_Bool SwLayAction::PaintWithoutFlys( const SwRect &rRect, const SwCntntFrm *pCnt,
const SwPageFrm *pPage )
{
SwRegionRects aTmp( rRect );
const SwSortedObjs &rObjs = *pPage->GetSortedObjs();
const SwFlyFrm *pSelfFly = pCnt->FindFlyFrm();
- USHORT i;
+ sal_uInt16 i;
for ( i = 0; i < rObjs.Count() && aTmp.Count(); ++i )
{
@@ -264,7 +264,7 @@ BOOL SwLayAction::PaintWithoutFlys( const SwRect &rRect, const SwCntntFrm *pCnt,
}
else
{
- const BOOL bLowerOfSelf = pFly->IsLowerOf( pSelfFly );
+ const sal_Bool bLowerOfSelf = pFly->IsLowerOf( pSelfFly );
if ( !bLowerOfSelf && !pFly->GetFmt()->GetOpaque().GetValue() )
//Aus anderem Layer interessieren uns nur nicht transparente
//oder innenliegende
@@ -297,14 +297,14 @@ BOOL SwLayAction::PaintWithoutFlys( const SwRect &rRect, const SwCntntFrm *pCnt,
aTmp -= pFly->Frm();
}
- BOOL bRetPaint = FALSE;
+ sal_Bool bRetPaint = sal_False;
const SwRect *pData = aTmp.GetData();
for ( i = 0; i < aTmp.Count(); ++pData, ++i )
bRetPaint |= pImp->GetShell()->AddPaintRect( *pData );
return bRetPaint;
}
-inline BOOL SwLayAction::_PaintCntnt( const SwCntntFrm *pCntnt,
+inline sal_Bool SwLayAction::_PaintCntnt( const SwCntntFrm *pCntnt,
const SwPageFrm *pPage,
const SwRect &rRect )
{
@@ -315,7 +315,7 @@ inline BOOL SwLayAction::_PaintCntnt( const SwCntntFrm *pCntnt,
else
return pImp->GetShell()->AddPaintRect( rRect );
}
- return FALSE;
+ return sal_False;
}
void SwLayAction::PaintCntnt( const SwCntntFrm *pCnt,
@@ -341,7 +341,7 @@ void SwLayAction::PaintCntnt( const SwCntntFrm *pCnt,
if( bHeightDiff )
{
// OD 05.11.2002 #94454# - consider whole potential paint area.
- //SwRect aDrawRect( pCnt->UnionFrm( TRUE ) );
+ //SwRect aDrawRect( pCnt->UnionFrm( sal_True ) );
SwRect aDrawRect( pCnt->PaintArea() );
if( nOldHeight > nNewHeight )
nOldBottom = (pCnt->*fnRect->fnGetPrtBottom)();
@@ -390,9 +390,9 @@ SwLayAction::SwLayAction( SwRootFrm *pRt, SwViewImp *pI ) :
nCheckPageNum( USHRT_MAX )
{
bPaintExtraData = ::IsExtraData( pImp->GetShell()->GetDoc() );
- bPaint = bComplete = bWaitAllowed = bCheckPages = TRUE;
+ bPaint = bComplete = bWaitAllowed = bCheckPages = sal_True;
bInput = bAgain = bNextCycle = bCalcLayout = bIdle = bReschedule =
- bUpdateExpFlds = bBrowseActionStop = bActionInProgress = FALSE;
+ bUpdateExpFlds = bBrowseActionStop = bActionInProgress = sal_False;
// OD 14.04.2003 #106346# - init new flag <mbFormatCntntOnInterrupt>.
mbFormatCntntOnInterrupt = sal_False;
@@ -419,9 +419,9 @@ void SwLayAction::Reset()
nStartTicks = Ticks();
nInputType = 0;
nEndPage = nPreInvaPage = nCheckPageNum = USHRT_MAX;
- bPaint = bComplete = bWaitAllowed = bCheckPages = TRUE;
+ bPaint = bComplete = bWaitAllowed = bCheckPages = sal_True;
bInput = bAgain = bNextCycle = bCalcLayout = bIdle = bReschedule =
- bUpdateExpFlds = bBrowseActionStop = FALSE;
+ bUpdateExpFlds = bBrowseActionStop = sal_False;
}
/*************************************************************************
@@ -433,13 +433,18 @@ void SwLayAction::Reset()
|*
|*************************************************************************/
-BOOL SwLayAction::RemoveEmptyBrowserPages()
+sal_Bool SwLayAction::RemoveEmptyBrowserPages()
{
//Beim umschalten vom normalen in den Browsermodus bleiben u.U. einige
//unangenehm lange stehen. Diese beseiten wir mal schnell.
+<<<<<<< local
BOOL bRet = FALSE;
const ViewShell *pSh = pRoot->GetCurrShell();
if( pSh && pSh->GetViewOptions()->getBrowseMode() )
+=======
+ sal_Bool bRet = sal_False;
+ if ( pRoot->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+>>>>>>> other
{
SwPageFrm *pPage = (SwPageFrm*)pRoot->Lower();
do
@@ -449,7 +454,7 @@ BOOL SwLayAction::RemoveEmptyBrowserPages()
pPage = (SwPageFrm*)pPage->GetNext();
else
{
- bRet = TRUE;
+ bRet = sal_True;
SwPageFrm *pDel = pPage;
pPage = (SwPageFrm*)pPage->GetNext();
pDel->Cut();
@@ -471,14 +476,14 @@ BOOL SwLayAction::RemoveEmptyBrowserPages()
|*************************************************************************/
void SwLayAction::Action()
{
- bActionInProgress = TRUE;
+ bActionInProgress = sal_True;
//TurboMode? Disqualifiziert fuer Idle-Format.
if ( IsPaint() && !IsIdle() && TurboAction() )
{
delete pWait, pWait = 0;
pRoot->ResetTurboFlag();
- bActionInProgress = FALSE;
+ bActionInProgress = sal_False;
pRoot->DeleteEmptySct();
return;
}
@@ -492,13 +497,13 @@ void SwLayAction::Action()
pRoot->DisallowTurbo();
if ( IsCalcLayout() )
- SetCheckPages( FALSE );
+ SetCheckPages( sal_False );
InternalAction();
bAgain |= RemoveEmptyBrowserPages();
while ( IsAgain() )
{
- bAgain = bNextCycle = FALSE;
+ bAgain = bNextCycle = sal_False;
InternalAction();
bAgain |= RemoveEmptyBrowserPages();
}
@@ -510,20 +515,20 @@ void SwLayAction::Action()
pRoot->ResetTurboFlag();
pRoot->ResetTurbo();
- SetCheckPages( TRUE );
+ SetCheckPages( sal_True );
- bActionInProgress = FALSE;
+ bActionInProgress = sal_False;
}
SwPageFrm* SwLayAction::CheckFirstVisPage( SwPageFrm *pPage )
{
SwCntntFrm *pCnt = pPage->FindFirstBodyCntnt();
SwCntntFrm *pChk = pCnt;
- BOOL bPageChgd = FALSE;
+ sal_Bool bPageChgd = sal_False;
while ( pCnt && pCnt->IsFollow() )
pCnt = static_cast<SwCntntFrm*>(pCnt)->FindMaster();
if ( pCnt && pChk != pCnt )
- { bPageChgd = TRUE;
+ { bPageChgd = sal_True;
pPage = pCnt->FindPageFrm();
}
@@ -610,14 +615,14 @@ void SwLayAction::InternalAction()
//Cntnt's
if ( !IsComplete() )
pPage = CheckFirstVisPage( pPage );
- USHORT nFirstPageNum = pPage->GetPhyPageNum();
+ sal_uInt16 nFirstPageNum = pPage->GetPhyPageNum();
while ( pPage && !pPage->IsInvalid() && !pPage->IsInvalidFly() )
pPage = (SwPageFrm*)pPage->GetNext();
IDocumentLayoutAccess *pLayoutAccess = pRoot->GetFmt()->getIDocumentLayoutAccess();
- BOOL bNoLoop = pPage ? SwLayouter::StartLoopControl( pRoot->GetFmt()->GetDoc(), pPage ) : FALSE;
- USHORT nPercentPageNum = 0;
+ sal_Bool bNoLoop = pPage ? SwLayouter::StartLoopControl( pRoot->GetFmt()->GetDoc(), pPage ) : sal_False;
+ sal_uInt16 nPercentPageNum = 0;
while ( (pPage && !IsInterrupt()) || nCheckPageNum != USHRT_MAX )
{
if ( !pPage && nCheckPageNum != USHRT_MAX &&
@@ -635,9 +640,9 @@ void SwLayAction::InternalAction()
}
SwPageFrm *pTmp = pPage->GetPrev() ?
(SwPageFrm*)pPage->GetPrev() : pPage;
- SetCheckPages( TRUE );
+ SetCheckPages( sal_True );
SwFrm::CheckPageDescs( pPage );
- SetCheckPages( FALSE );
+ SetCheckPages( sal_False );
nCheckPageNum = USHRT_MAX;
pPage = pTmp;
continue;
@@ -661,7 +666,7 @@ void SwLayAction::InternalAction()
pRoot->AssertFlyPages();
if ( pRoot->IsSuperfluous() )
{
- BOOL bOld = IsAgain();
+ sal_Bool bOld = IsAgain();
pRoot->RemoveSuperfluous();
bAgain = bOld;
}
@@ -712,8 +717,8 @@ void SwLayAction::InternalAction()
XCHECKPAGE;
// FME 2007-08-30 #i81146# new loop control
- USHORT nLoopControlRuns_1 = 0;
- const USHORT nLoopControlMax = 20;
+ sal_uInt16 nLoopControlRuns_1 = 0;
+ const sal_uInt16 nLoopControlMax = 20;
while ( !IsNextCycle() && pPage->IsInvalidLayout() )
{
@@ -751,7 +756,7 @@ void SwLayAction::InternalAction()
pPage->InvalidateFlyCntnt();
// <--
if ( IsBrowseActionStop() )
- bInput = TRUE;
+ bInput = sal_True;
}
}
if( bNoLoop )
@@ -772,7 +777,7 @@ void SwLayAction::InternalAction()
}
if ( !IsInterrupt() )
{
- SetNextCycle( FALSE );
+ SetNextCycle( sal_False );
if ( nPreInvaPage != USHRT_MAX )
{
@@ -820,7 +825,7 @@ void SwLayAction::InternalAction()
pRoot->AssertFlyPages();
if ( pRoot->IsSuperfluous() )
{
- BOOL bOld = IsAgain();
+ sal_Bool bOld = IsAgain();
pRoot->RemoveSuperfluous();
bAgain = bOld;
}
@@ -880,8 +885,8 @@ void SwLayAction::InternalAction()
XCHECKPAGE;
// FME 2007-08-30 #i81146# new loop control
- USHORT nLoopControlRuns_2 = 0;
- const USHORT nLoopControlMax = 20;
+ sal_uInt16 nLoopControlRuns_2 = 0;
+ const sal_uInt16 nLoopControlMax = 20;
// OD 14.04.2003 #106346# - special case: interrupt content formatting
// --> OD 2004-07-08 #i28701# - conditions, introduced by #106346#,
@@ -907,7 +912,7 @@ void SwLayAction::InternalAction()
// <--
// FME 2007-08-30 #i81146# new loop control
- USHORT nLoopControlRuns_3 = 0;
+ sal_uInt16 nLoopControlRuns_3 = 0;
while ( pPg->IsInvalidLayout() )
{
@@ -983,13 +988,13 @@ void SwLayAction::InternalAction()
|* Letzte Aenderung MA 15. Aug. 93
|*
|*************************************************************************/
-BOOL SwLayAction::_TurboAction( const SwCntntFrm *pCnt )
+sal_Bool SwLayAction::_TurboAction( const SwCntntFrm *pCnt )
{
const SwPageFrm *pPage = 0;
if ( !pCnt->IsValid() || pCnt->IsCompletePaint() || pCnt->IsRetouche() )
{
- const SwRect aOldRect( pCnt->UnionFrm( TRUE ) );
+ const SwRect aOldRect( pCnt->UnionFrm( sal_True ) );
const long nOldBottom = pCnt->Frm().Top() + pCnt->Prt().Bottom();
pCnt->Calc();
if ( pCnt->Frm().Bottom() < aOldRect.Bottom() )
@@ -1000,7 +1005,7 @@ BOOL SwLayAction::_TurboAction( const SwCntntFrm *pCnt )
if ( !pCnt->GetValidLineNumFlag() && pCnt->IsTxtFrm() )
{
- const ULONG nAllLines = ((SwTxtFrm*)pCnt)->GetAllLines();
+ const sal_uLong nAllLines = ((SwTxtFrm*)pCnt)->GetAllLines();
((SwTxtFrm*)pCnt)->RecalcAllLines();
if ( nAllLines != ((SwTxtFrm*)pCnt)->GetAllLines() )
{
@@ -1018,11 +1023,11 @@ BOOL SwLayAction::_TurboAction( const SwCntntFrm *pCnt )
if ( pNxt )
pNxt->InvalidatePage();
}
- return FALSE;
+ return sal_False;
}
if ( pPage->IsInvalidLayout() || (IS_FLYS && IS_INVAFLY) )
- return FALSE;
+ return sal_False;
}
if ( !pPage )
pPage = pCnt->FindPageFrm();
@@ -1032,29 +1037,29 @@ BOOL SwLayAction::_TurboAction( const SwCntntFrm *pCnt )
!SwObjectFormatter::FormatObjsAtFrm( *(const_cast<SwCntntFrm*>(pCnt)),
*pPage, this ) )
{
- return FALSE;
+ return sal_False;
}
if ( pPage->IsInvalidCntnt() )
- return FALSE;
- return TRUE;
+ return sal_False;
+ return sal_True;
}
-BOOL SwLayAction::TurboAction()
+sal_Bool SwLayAction::TurboAction()
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
if ( pRoot->GetTurbo() )
{
if ( !_TurboAction( pRoot->GetTurbo() ) )
{
CheckIdleEnd();
- bRet = FALSE;
+ bRet = sal_False;
}
pRoot->ResetTurbo();
}
else
- bRet = FALSE;
+ bRet = sal_False;
return bRet;
}
/*************************************************************************
@@ -1124,7 +1129,7 @@ static const SwFrm *lcl_FindFirstInvaCntnt( const SwLayoutFrm *pLay, long nBotto
if ( pCnt->GetDrawObjs() )
{
const SwSortedObjs &rObjs = *pCnt->GetDrawObjs();
- for ( USHORT i = 0; i < rObjs.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i )
{
const SwAnchoredObject* pObj = rObjs[i];
if ( pObj->ISA(SwFlyFrm) )
@@ -1160,7 +1165,7 @@ static const SwAnchoredObject* lcl_FindFirstInvaObj( const SwPageFrm* _pPage,
{
ASSERT( _pPage->GetSortedObjs(), "FindFirstInvaObj, no Objs" )
- for ( USHORT i = 0; i < _pPage->GetSortedObjs()->Count(); ++i )
+ for ( sal_uInt16 i = 0; i < _pPage->GetSortedObjs()->Count(); ++i )
{
const SwAnchoredObject* pObj = (*_pPage->GetSortedObjs())[i];
if ( pObj->ISA(SwFlyFrm) )
@@ -1189,11 +1194,16 @@ static const SwAnchoredObject* lcl_FindFirstInvaObj( const SwPageFrm* _pPage,
}
// <--
-BOOL SwLayAction::IsShortCut( SwPageFrm *&prPage )
+sal_Bool SwLayAction::IsShortCut( SwPageFrm *&prPage )
{
+<<<<<<< local
BOOL bRet = FALSE;
const ViewShell *pSh = pRoot->GetCurrShell();
const BOOL bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode();
+=======
+ sal_Bool bRet = sal_False;
+ const sal_Bool bBrowse = pRoot->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
+>>>>>>> other
//Wenn die Seite nicht Gueltig ist wird sie schnell formatiert, sonst
//gibts nix als Aerger.
@@ -1204,7 +1214,7 @@ BOOL SwLayAction::IsShortCut( SwPageFrm *&prPage )
/// OD 15.10.2002 #103517# - format complete page
/// Thus, loop on all lowers of the page <prPage>, instead of only
/// format its first lower.
- /// NOTE: In online layout (bBrowse == TRUE) a page can contain
+ /// NOTE: In online layout (bBrowse == sal_True) a page can contain
/// a header frame and/or a footer frame beside the body frame.
prPage->Calc();
SwFrm* pPageLowerFrm = prPage->Lower();
@@ -1217,7 +1227,7 @@ BOOL SwLayAction::IsShortCut( SwPageFrm *&prPage )
else
FormatLayout( prPage );
if ( IsAgain() )
- return FALSE;
+ return sal_False;
}
@@ -1225,7 +1235,7 @@ BOOL SwLayAction::IsShortCut( SwPageFrm *&prPage )
if ( (prPage->Frm().Top() >= rVis.Bottom()) ||
(prPage->Frm().Left()>= rVis.Right()) )
{
- bRet = TRUE;
+ bRet = sal_True;
//Jetzt wird es ein bischen unangenehm: Der erste CntntFrm dieser Seite
//im Bodytext muss Formatiert werden, wenn er dabei die Seite
@@ -1258,7 +1268,7 @@ BOOL SwLayAction::IsShortCut( SwPageFrm *&prPage )
}
if ( pCntnt )
{
- BOOL bTstCnt = TRUE;
+ sal_Bool bTstCnt = sal_True;
if ( bBrowse )
{
//Der Cnt davor schon nicht mehr sichtbar?
@@ -1272,7 +1282,7 @@ BOOL SwLayAction::IsShortCut( SwPageFrm *&prPage )
(pLst->Frm().Top() >= rVis.Bottom() ||
pLst->Frm().Left()>= rVis.Right()) )
{
- bTstCnt = FALSE;
+ bTstCnt = sal_False;
}
}
@@ -1291,7 +1301,7 @@ BOOL SwLayAction::IsShortCut( SwPageFrm *&prPage )
pSct->Calc();
pSct->SetCompletePaint();
if ( IsAgain() )
- return FALSE;
+ return sal_False;
// --> OD 2004-06-04 #i27756#
bPageChg = pCntnt->FindPageFrm() != p2ndPage &&
prPage->GetPrev();
@@ -1303,7 +1313,7 @@ BOOL SwLayAction::IsShortCut( SwPageFrm *&prPage )
pCntnt->Calc();
pCntnt->SetCompletePaint();
if ( IsAgain() )
- return FALSE;
+ return sal_False;
// --> OD 2004-06-04 #i27756#
bPageChg = pCntnt->FindPageFrm() != p2ndPage &&
prPage->GetPrev();
@@ -1317,7 +1327,7 @@ BOOL SwLayAction::IsShortCut( SwPageFrm *&prPage )
pTab->Calc();
pTab->SetCompletePaint();
if ( IsAgain() )
- return FALSE;
+ return sal_False;
// --> OD 2004-06-04 #i27756#
bPageChg = pCntnt->FindPageFrm() != p2ndPage &&
prPage->GetPrev();
@@ -1332,7 +1342,7 @@ BOOL SwLayAction::IsShortCut( SwPageFrm *&prPage )
pSct->Calc();
pSct->SetCompletePaint();
if ( IsAgain() )
- return FALSE;
+ return sal_False;
// --> OD 2004-06-04 #i27756#
bPageChg = pCntnt->FindPageFrm() != p2ndPage &&
prPage->GetPrev();
@@ -1342,7 +1352,7 @@ BOOL SwLayAction::IsShortCut( SwPageFrm *&prPage )
// --> OD 2004-06-04 #i27756#
if ( bPageChg )
{
- bRet = FALSE;
+ bRet = sal_False;
const SwPageFrm* pTmp = pCntnt->FindPageFrm();
if ( pTmp->GetPhyPageNum() < prPage->GetPhyPageNum() &&
pTmp->IsInvalid() )
@@ -1369,7 +1379,7 @@ BOOL SwLayAction::IsShortCut( SwPageFrm *&prPage )
SwAnchoredObject* pObj = (*pObjs)[i];
if ( pObj->GetAnchorFrmContainingAnchPos() == pCntnt )
{
- bRet = FALSE;
+ bRet = sal_False;
break;
}
}
@@ -1389,22 +1399,22 @@ BOOL SwLayAction::IsShortCut( SwPageFrm *&prPage )
0 != (pObj = lcl_FindFirstInvaObj( prPage, nBottom )) &&
pObj->GetObjRect().Top() <= nBottom )
{
- return FALSE;
+ return sal_False;
}
const SwFrm* pFrm( 0L );
if ( prPage->IsInvalidLayout() &&
0 != (pFrm = lcl_FindFirstInvaLay( prPage, nBottom )) &&
pFrm->Frm().Top() <= nBottom )
{
- return FALSE;
+ return sal_False;
}
if ( (prPage->IsInvalidCntnt() || prPage->IsInvalidFlyInCnt()) &&
0 != (pFrm = lcl_FindFirstInvaCntnt( prPage, nBottom, 0 )) &&
pFrm->Frm().Top() <= nBottom )
{
- return FALSE;
+ return sal_False;
}
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
}
@@ -1418,14 +1428,14 @@ BOOL SwLayAction::IsShortCut( SwPageFrm *&prPage )
|*
|*************************************************************************/
// OD 15.11.2002 #105155# - introduce support for vertical layout
-BOOL SwLayAction::FormatLayout( SwLayoutFrm *pLay, BOOL bAddRect )
+sal_Bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, sal_Bool bAddRect )
{
ASSERT( !IsAgain(), "Ungueltige Seite beachten." );
if ( IsAgain() )
- return FALSE;
+ return sal_False;
- BOOL bChanged = FALSE;
- BOOL bAlreadyPainted = FALSE;
+ sal_Bool bChanged = sal_False;
+ sal_Bool bAlreadyPainted = sal_False;
// OD 11.11.2002 #104414# - remember frame at complete paint
SwRect aFrmAtCompletePaint;
@@ -1437,18 +1447,25 @@ BOOL SwLayAction::FormatLayout( SwLayoutFrm *pLay, BOOL bAddRect )
SwRect aOldRect( pLay->Frm() );
pLay->Calc();
if ( aOldRect != pLay->Frm() )
- bChanged = TRUE;
+ bChanged = sal_True;
- BOOL bNoPaint = FALSE;
+ sal_Bool bNoPaint = sal_False;
if ( pLay->IsPageBodyFrm() &&
pLay->Frm().Pos() == aOldRect.Pos() &&
pLay->Lower() )
{
const ViewShell *pSh = pLay->getRootFrm()->GetCurrShell();
//Einschraenkungen wegen Kopf-/Fusszeilen
+<<<<<<< local
if( pSh && pSh->GetViewOptions()->getBrowseMode() &&
!( pLay->IsCompletePaint() && pLay->FindPageFrm()->FindFtnCont() ) )
bNoPaint = TRUE;
+=======
+ if ( !( pLay->IsCompletePaint() &&
+ pLay->FindPageFrm()->FindFtnCont() ) )
+ {
+ bNoPaint = sal_True;
+>>>>>>> other
}
if ( !bNoPaint && IsPaint() && bAddRect && (pLay->IsCompletePaint() || bChanged) )
@@ -1503,11 +1520,11 @@ BOOL SwLayAction::FormatLayout( SwLayoutFrm *pLay, BOOL bAddRect )
if ( pLay->IsCompletePaint() )
{
pImp->GetShell()->AddPaintRect( aPaint );
- bAddRect = FALSE;
+ bAddRect = sal_False;
}
else
{
- USHORT i;
+ sal_uInt16 i;
SwRegionRects aRegion( aOldRect );
aRegion -= aPaint;
@@ -1525,7 +1542,7 @@ BOOL SwLayAction::FormatLayout( SwLayoutFrm *pLay, BOOL bAddRect )
else
{
pImp->GetShell()->AddPaintRect( aPaint );
- bAlreadyPainted = TRUE;
+ bAlreadyPainted = sal_True;
// OD 11.11.2002 #104414# - remember frame at complete paint
aFrmAtCompletePaint = pLay->Frm();
}
@@ -1588,12 +1605,12 @@ BOOL SwLayAction::FormatLayout( SwLayoutFrm *pLay, BOOL bAddRect )
}
if( bAlreadyPainted )
- bAddRect = FALSE;
+ bAddRect = sal_False;
CheckWaitCrsr();
if ( IsAgain() )
- return FALSE;
+ return sal_False;
//Jetzt noch diejenigen Lowers versorgen die LayoutFrm's sind
@@ -1601,7 +1618,7 @@ BOOL SwLayAction::FormatLayout( SwLayoutFrm *pLay, BOOL bAddRect )
return bChanged;
SwFrm *pLow = pLay->Lower();
- BOOL bTabChanged = FALSE;
+ sal_Bool bTabChanged = sal_False;
while ( pLow && pLow->GetUpper() == pLay )
{
if ( pLow->IsLayoutFrm() )
@@ -1618,7 +1635,7 @@ BOOL SwLayAction::FormatLayout( SwLayoutFrm *pLay, BOOL bAddRect )
pLow->OptCalc();
if ( IsAgain() )
- return FALSE;
+ return sal_False;
pLow = pLow->GetNext();
}
// OD 11.11.2002 #104414# - add complete frame area as paint area, if frame
@@ -1634,14 +1651,14 @@ BOOL SwLayAction::FormatLayout( SwLayoutFrm *pLay, BOOL bAddRect )
return bChanged || bTabChanged;
}
-BOOL SwLayAction::FormatLayoutFly( SwFlyFrm* pFly )
+sal_Bool SwLayAction::FormatLayoutFly( SwFlyFrm* pFly )
{
ASSERT( !IsAgain(), "Ungueltige Seite beachten." );
if ( IsAgain() )
- return FALSE;
+ return sal_False;
- BOOL bChanged = false;
- BOOL bAddRect = true;
+ sal_Bool bChanged = false;
+ sal_Bool bAddRect = true;
if ( !pFly->IsValid() || pFly->IsCompletePaint() || pFly->IsInvalid() )
{
@@ -1663,10 +1680,10 @@ BOOL SwLayAction::FormatLayoutFly( SwFlyFrm* pFly )
}
if ( IsAgain() )
- return FALSE;
+ return sal_False;
//Jetzt noch diejenigen Lowers versorgen die LayoutFrm's sind
- BOOL bTabChanged = false;
+ sal_Bool bTabChanged = false;
SwFrm *pLow = pFly->Lower();
while ( pLow )
{
@@ -1684,17 +1701,17 @@ BOOL SwLayAction::FormatLayoutFly( SwFlyFrm* pFly )
// OD 31.10.2002 #104100#
// Implement vertical layout support
-BOOL SwLayAction::FormatLayoutTab( SwTabFrm *pTab, BOOL bAddRect )
+sal_Bool SwLayAction::FormatLayoutTab( SwTabFrm *pTab, sal_Bool bAddRect )
{
ASSERT( !IsAgain(), "8-) Ungueltige Seite beachten." );
if ( IsAgain() || !pTab->Lower() )
- return FALSE;
+ return sal_False;
IDocumentTimerAccess *pTimerAccess = pRoot->GetFmt()->getIDocumentTimerAccess();
pTimerAccess->BlockIdling();
- BOOL bChanged = FALSE;
- BOOL bPainted = FALSE;
+ sal_Bool bChanged = sal_False;
+ sal_Bool bPainted = sal_False;
const SwPageFrm *pOldPage = pTab->FindPageFrm();
@@ -1711,11 +1728,11 @@ BOOL SwLayAction::FormatLayoutTab( SwTabFrm *pTab, BOOL bAddRect )
}
const SwRect aOldRect( pTab->Frm() );
- pTab->SetLowersFormatted( FALSE );
+ pTab->SetLowersFormatted( sal_False );
pTab->Calc();
if ( aOldRect != pTab->Frm() )
{
- bChanged = TRUE;
+ bChanged = sal_True;
}
const SwRect aPaintFrm = pTab->PaintArea();
@@ -1766,8 +1783,8 @@ BOOL SwLayAction::FormatLayoutTab( SwTabFrm *pTab, BOOL bAddRect )
else if ( pTab->IsCompletePaint() )
{
pImp->GetShell()->AddPaintRect( aPaintFrm );
- bAddRect = FALSE;
- bPainted = TRUE;
+ bAddRect = sal_False;
+ bPainted = sal_True;
}
if ( pTab->IsRetouche() && !pTab->GetNext() )
@@ -1780,7 +1797,7 @@ BOOL SwLayAction::FormatLayoutTab( SwTabFrm *pTab, BOOL bAddRect )
}
}
else
- bAddRect = FALSE;
+ bAddRect = sal_False;
if ( pTab->IsCompletePaint() && !pOptTab )
pOptTab = pTab;
@@ -1805,16 +1822,16 @@ BOOL SwLayAction::FormatLayoutTab( SwTabFrm *pTab, BOOL bAddRect )
//Heftige Abkuerzung!
if ( pTab->IsLowersFormatted() &&
(bPainted || !pImp->GetShell()->VisArea().IsOver( pTab->Frm())) )
- return FALSE;
+ return sal_False;
//Jetzt noch die Lowers versorgen
if ( IsAgain() )
- return FALSE;
+ return sal_False;
// OD 20.10.2003 #112464# - for savety reasons:
// check page number before formatting lowers.
if ( pOldPage->GetPhyPageNum() > (pTab->FindPageFrm()->GetPhyPageNum() + 1) )
- SetNextCycle( TRUE );
+ SetNextCycle( sal_True );
// OD 20.10.2003 #112464# - format lowers, only if table frame is valid
if ( pTab->IsValid() )
@@ -1824,7 +1841,7 @@ BOOL SwLayAction::FormatLayoutTab( SwTabFrm *pTab, BOOL bAddRect )
{
bChanged |= FormatLayout( (SwLayoutFrm*)pLow, bAddRect );
if ( IsAgain() )
- return FALSE;
+ return sal_False;
pLow = (SwLayoutFrm*)pLow->GetNext();
}
}
@@ -1840,29 +1857,33 @@ BOOL SwLayAction::FormatLayoutTab( SwTabFrm *pTab, BOOL bAddRect )
|* Letzte Aenderung MA 16. Nov. 95
|*
|*************************************************************************/
-BOOL SwLayAction::FormatCntnt( const SwPageFrm *pPage )
+sal_Bool SwLayAction::FormatCntnt( const SwPageFrm *pPage )
{
const SwCntntFrm *pCntnt = pPage->ContainsCntnt();
+<<<<<<< local
const ViewShell *pSh = pRoot->GetCurrShell();
const BOOL bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode();
+=======
+ const sal_Bool bBrowse = pRoot->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
+>>>>>>> other
while ( pCntnt && pPage->IsAnLower( pCntnt ) )
{
//Wenn der Cntnt sich eh nicht veraendert koennen wir ein paar
//Abkuerzungen nutzen.
- const BOOL bFull = !pCntnt->IsValid() || pCntnt->IsCompletePaint() ||
+ const sal_Bool bFull = !pCntnt->IsValid() || pCntnt->IsCompletePaint() ||
pCntnt->IsRetouche() || pCntnt->GetDrawObjs();
if ( bFull )
{
//Damit wir nacher nicht suchen muessen.
- const BOOL bNxtCnt = IsCalcLayout() && !pCntnt->GetFollow();
+ const sal_Bool bNxtCnt = IsCalcLayout() && !pCntnt->GetFollow();
const SwCntntFrm *pCntntNext = bNxtCnt ? pCntnt->GetNextCntntFrm() : 0;
const SwCntntFrm *pCntntPrev = pCntnt->GetPrev() ? pCntnt->GetPrevCntntFrm() : 0;
const SwLayoutFrm*pOldUpper = pCntnt->GetUpper();
const SwTabFrm *pTab = pCntnt->FindTabFrm();
- const BOOL bInValid = !pCntnt->IsValid() || pCntnt->IsCompletePaint();
- const BOOL bOldPaint = IsPaint();
+ const sal_Bool bInValid = !pCntnt->IsValid() || pCntnt->IsCompletePaint();
+ const sal_Bool bOldPaint = IsPaint();
bPaint = bOldPaint && !(pTab && pTab == pOptTab);
_FormatCntnt( pCntnt, pPage );
// --> OD 2004-11-05 #i26945# - reset <bPaint> before format objects
@@ -1882,12 +1903,12 @@ BOOL SwLayAction::FormatCntnt( const SwPageFrm *pPage )
*(pCntnt->FindPageFrm()), this ) )
// <--
{
- return FALSE;
+ return sal_False;
}
if ( !pCntnt->GetValidLineNumFlag() && pCntnt->IsTxtFrm() )
{
- const ULONG nAllLines = ((SwTxtFrm*)pCntnt)->GetAllLines();
+ const sal_uLong nAllLines = ((SwTxtFrm*)pCntnt)->GetAllLines();
((SwTxtFrm*)pCntnt)->RecalcAllLines();
if ( IsPaintExtraData() && IsPaint() &&
nAllLines != ((SwTxtFrm*)pCntnt)->GetAllLines() )
@@ -1895,7 +1916,7 @@ BOOL SwLayAction::FormatCntnt( const SwPageFrm *pPage )
}
if ( IsAgain() )
- return FALSE;
+ return sal_False;
//Wenn Layout oder Flys wieder Invalid sind breche ich die Verarbeitung
//vorlaeufig ab - allerdings nicht fuer die BrowseView, denn dort wird
@@ -1911,11 +1932,11 @@ BOOL SwLayAction::FormatCntnt( const SwPageFrm *pPage )
// OD 07.05.2003 #109435# - consider interrupt formatting
( IS_FLYS && IS_INVAFLY && !mbFormatCntntOnInterrupt )
)
- return FALSE;
+ return sal_False;
}
if ( pOldUpper != pCntnt->GetUpper() )
{
- const USHORT nCurNum = pCntnt->FindPageFrm()->GetPhyPageNum();
+ const sal_uInt16 nCurNum = pCntnt->FindPageFrm()->GetPhyPageNum();
if ( nCurNum < pPage->GetPhyPageNum() )
nPreInvaPage = nCurNum;
@@ -1923,11 +1944,11 @@ BOOL SwLayAction::FormatCntnt( const SwPageFrm *pPage )
//fangen wir nocheinmal von vorn an damit wir nichts auslassen.
if ( !IsCalcLayout() && pPage->GetPhyPageNum() > nCurNum+1 )
{
- SetNextCycle( TRUE );
+ SetNextCycle( sal_True );
// OD 07.05.2003 #109435# - consider interrupt formatting
if ( !mbFormatCntntOnInterrupt )
{
- return FALSE;
+ return sal_False;
}
}
}
@@ -1936,7 +1957,7 @@ BOOL SwLayAction::FormatCntnt( const SwPageFrm *pPage )
//So werden einerseits Vorgaenger erwischt, die jetzt f?r Retouche
//verantwortlich sind, andererseits werden die Fusszeilen
//auch angefasst.
- BOOL bSetCntnt = TRUE;
+ sal_Bool bSetCntnt = sal_True;
if ( pCntntPrev )
{
if ( !pCntntPrev->IsValid() && pPage->IsAnLower( pCntntPrev ) )
@@ -1945,7 +1966,7 @@ BOOL SwLayAction::FormatCntnt( const SwPageFrm *pPage )
pPage->GetPhyPageNum() < pCntnt->FindPageFrm()->GetPhyPageNum() )
{
pCntnt = pCntntPrev;
- bSetCntnt = FALSE;
+ bSetCntnt = sal_False;
}
}
if ( bSetCntnt )
@@ -1962,11 +1983,11 @@ BOOL SwLayAction::FormatCntnt( const SwPageFrm *pPage )
!lcl_FindFirstInvaObj( pPage, nBottom )) &&
(!pPage->IsInvalidLayout() ||
!lcl_FindFirstInvaLay( pPage, nBottom )))
- SetBrowseActionStop( TRUE );
+ SetBrowseActionStop( sal_True );
// OD 14.04.2003 #106346# - consider interrupt formatting.
if ( !mbFormatCntntOnInterrupt )
{
- return FALSE;
+ return sal_False;
}
}
}
@@ -1979,7 +2000,7 @@ BOOL SwLayAction::FormatCntnt( const SwPageFrm *pPage )
{
if ( !pCntnt->GetValidLineNumFlag() && pCntnt->IsTxtFrm() )
{
- const ULONG nAllLines = ((SwTxtFrm*)pCntnt)->GetAllLines();
+ const sal_uLong nAllLines = ((SwTxtFrm*)pCntnt)->GetAllLines();
((SwTxtFrm*)pCntnt)->RecalcAllLines();
if ( IsPaintExtraData() && IsPaint() &&
nAllLines != ((SwTxtFrm*)pCntnt)->GetAllLines() )
@@ -1995,7 +2016,7 @@ BOOL SwLayAction::FormatCntnt( const SwPageFrm *pPage )
CheckIdleEnd();
// OD 14.04.2003 #106346# - consider interrupt formatting.
if ( IsInterrupt() && !mbFormatCntntOnInterrupt )
- return FALSE;
+ return sal_False;
}
if ( bBrowse && !IsIdle() && !IsCalcLayout() && !IsComplete() &&
pCntnt->Frm().Top() > pImp->GetShell()->VisArea().Bottom())
@@ -2009,11 +2030,11 @@ BOOL SwLayAction::FormatCntnt( const SwPageFrm *pPage )
!lcl_FindFirstInvaObj( pPage, nBottom )) &&
(!pPage->IsInvalidLayout() ||
!lcl_FindFirstInvaLay( pPage, nBottom )))
- SetBrowseActionStop( TRUE );
+ SetBrowseActionStop( sal_True );
// OD 14.04.2003 #106346# - consider interrupt formatting.
if ( !mbFormatCntntOnInterrupt )
{
- return FALSE;
+ return sal_False;
}
}
}
@@ -2028,8 +2049,8 @@ BOOL SwLayAction::FormatCntnt( const SwPageFrm *pPage )
|*
|* SwLayAction::_FormatCntnt()
|*
-|* Beschreibung Returnt TRUE wenn der Absatz verarbeitet wurde,
-|* FALSE wenn es nichts zu verarbeiten gab.
+|* Beschreibung Returnt sal_True wenn der Absatz verarbeitet wurde,
+|* sal_False wenn es nichts zu verarbeiten gab.
|* Ersterstellung MA 07. Dec. 92
|* Letzte Aenderung MA 11. Mar. 98
|*
@@ -2038,7 +2059,7 @@ void SwLayAction::_FormatCntnt( const SwCntntFrm *pCntnt,
const SwPageFrm *pPage )
{
//wird sind hier evtl. nur angekommen, weil der Cntnt DrawObjekte haelt.
- const BOOL bDrawObjsOnly = pCntnt->IsValid() && !pCntnt->IsCompletePaint() &&
+ const sal_Bool bDrawObjsOnly = pCntnt->IsValid() && !pCntnt->IsCompletePaint() &&
!pCntnt->IsRetouche();
SWRECTFN( pCntnt )
if ( !bDrawObjsOnly && IsPaint() )
@@ -2069,13 +2090,13 @@ void SwLayAction::_FormatCntnt( const SwCntntFrm *pCntnt,
|* SwLayAction::_FormatFlyCntnt()
|*
|* Beschreibung:
-|* - Returnt TRUE wenn alle Cntnts des Flys vollstaendig verarbeitet
-|* wurden. FALSE wenn vorzeitig unterbrochen wurde.
+|* - Returnt sal_True wenn alle Cntnts des Flys vollstaendig verarbeitet
+|* wurden. sal_False wenn vorzeitig unterbrochen wurde.
|* Ersterstellung MA 02. Dec. 92
|* Letzte Aenderung MA 24. Jun. 96
|*
|*************************************************************************/
-BOOL SwLayAction::_FormatFlyCntnt( const SwFlyFrm *pFly )
+sal_Bool SwLayAction::_FormatFlyCntnt( const SwFlyFrm *pFly )
{
const SwCntntFrm *pCntnt = pFly->ContainsCntnt();
@@ -2102,7 +2123,7 @@ BOOL SwLayAction::_FormatFlyCntnt( const SwFlyFrm *pFly )
if ( !pCntnt->GetValidLineNumFlag() && pCntnt->IsTxtFrm() )
{
- const ULONG nAllLines = ((SwTxtFrm*)pCntnt)->GetAllLines();
+ const sal_uLong nAllLines = ((SwTxtFrm*)pCntnt)->GetAllLines();
((SwTxtFrm*)pCntnt)->RecalcAllLines();
if ( IsPaintExtraData() && IsPaint() &&
nAllLines != ((SwTxtFrm*)pCntnt)->GetAllLines() )
@@ -2110,7 +2131,7 @@ BOOL SwLayAction::_FormatFlyCntnt( const SwFlyFrm *pFly )
}
if ( IsAgain() )
- return FALSE;
+ return sal_False;
//wenn eine Eingabe anliegt breche ich die Verarbeitung ab.
if ( !pFly->IsFlyInCntFrm() )
@@ -2118,7 +2139,7 @@ BOOL SwLayAction::_FormatFlyCntnt( const SwFlyFrm *pFly )
CheckIdleEnd();
// OD 14.04.2003 #106346# - consider interrupt formatting.
if ( IsInterrupt() && !mbFormatCntntOnInterrupt )
- return FALSE;
+ return sal_False;
}
pCntnt = pCntnt->GetNextCntntFrm();
}
@@ -2127,9 +2148,9 @@ BOOL SwLayAction::_FormatFlyCntnt( const SwFlyFrm *pFly )
return !(IsInterrupt() && !mbFormatCntntOnInterrupt);
}
-BOOL SwLayAction::IsStopPrt() const
+sal_Bool SwLayAction::IsStopPrt() const
{
- BOOL bResult = FALSE;
+ sal_Bool bResult = sal_False;
if (pImp != NULL && pProgress != NULL)
bResult = pImp->IsStopPrt();
@@ -2145,12 +2166,12 @@ BOOL SwLayAction::IsStopPrt() const
|* Letzte Aenderung AMA 01. Feb. 96
|*
|*************************************************************************/
-BOOL SwLayIdle::_DoIdleJob( const SwCntntFrm *pCnt, IdleJobType eJob )
+sal_Bool SwLayIdle::_DoIdleJob( const SwCntntFrm *pCnt, IdleJobType eJob )
{
ASSERT( pCnt->IsTxtFrm(), "NoTxt neighbour of Txt" );
// robust against misuse by e.g. #i52542#
if( !pCnt->IsTxtFrm() )
- return FALSE;
+ return sal_False;
const SwTxtNode* pTxtNode = pCnt->GetNode()->GetTxtNode();
@@ -2191,17 +2212,17 @@ BOOL SwLayIdle::_DoIdleJob( const SwCntntFrm *pCnt, IdleJobType eJob )
SwRect aRepaint( ((SwTxtFrm*)pCnt)->_AutoSpell( pCntntNode, *pSh->GetViewOptions(), nTxtPos ) );
bPageValid = bPageValid && !pTxtNode->IsWrongDirty();
if( !bPageValid )
- bAllValid = FALSE;
+ bAllValid = sal_False;
if ( aRepaint.HasArea() )
pImp->GetShell()->InvalidateWindows( aRepaint );
if ( Application::AnyInput( INPUT_MOUSEANDKEYBOARD|INPUT_OTHER|INPUT_PAINT ) )
- return TRUE;
+ return sal_True;
break;
}
case AUTOCOMPLETE_WORDS :
((SwTxtFrm*)pCnt)->CollectAutoCmplWrds( pCntntNode, nTxtPos );
if ( Application::AnyInput( INPUT_ANY ) )
- return TRUE;
+ return sal_True;
break;
case WORD_COUNT :
{
@@ -2209,7 +2230,7 @@ BOOL SwLayIdle::_DoIdleJob( const SwCntntFrm *pCnt, IdleJobType eJob )
SwDocStat aStat;
pTxtNode->CountWords( aStat, 0, nEnd );
if ( Application::AnyInput( INPUT_ANY ) )
- return TRUE;
+ return sal_True;
break;
}
case SMART_TAGS : // SMARTTAGS
@@ -2217,11 +2238,11 @@ BOOL SwLayIdle::_DoIdleJob( const SwCntntFrm *pCnt, IdleJobType eJob )
const SwRect aRepaint( ((SwTxtFrm*)pCnt)->SmartTagScan( pCntntNode, nTxtPos ) );
bPageValid = bPageValid && !pTxtNode->IsSmartTagDirty();
if( !bPageValid )
- bAllValid = FALSE;
+ bAllValid = sal_False;
if ( aRepaint.HasArea() )
pImp->GetShell()->InvalidateWindows( aRepaint );
if ( Application::AnyInput( INPUT_MOUSEANDKEYBOARD|INPUT_OTHER|INPUT_PAINT ) )
- return TRUE;
+ return sal_True;
break;
}
}
@@ -2231,7 +2252,7 @@ BOOL SwLayIdle::_DoIdleJob( const SwCntntFrm *pCnt, IdleJobType eJob )
if ( pCnt->GetDrawObjs() )
{
const SwSortedObjs &rObjs = *pCnt->GetDrawObjs();
- for ( USHORT i = 0; i < rObjs.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i )
{
SwAnchoredObject* pObj = rObjs[i];
if ( pObj->ISA(SwFlyFrm) )
@@ -2245,7 +2266,7 @@ BOOL SwLayIdle::_DoIdleJob( const SwCntntFrm *pCnt, IdleJobType eJob )
if ( pC->IsTxtFrm() )
{
if ( _DoIdleJob( pC, eJob ) )
- return TRUE;
+ return sal_True;
}
pC = pC->GetNextCntntFrm();
}
@@ -2253,10 +2274,10 @@ BOOL SwLayIdle::_DoIdleJob( const SwCntntFrm *pCnt, IdleJobType eJob )
}
}
}
- return FALSE;
+ return sal_False;
}
-BOOL SwLayIdle::DoIdleJob( IdleJobType eJob, BOOL bVisAreaOnly )
+sal_Bool SwLayIdle::DoIdleJob( IdleJobType eJob, sal_Bool bVisAreaOnly )
{
//Spellchecken aller Inhalte der Seiten. Entweder nur der sichtbaren
//Seiten oder eben aller.
@@ -2268,22 +2289,22 @@ BOOL SwLayIdle::DoIdleJob( IdleJobType eJob, BOOL bVisAreaOnly )
{
case ONLINE_SPELLING :
if( !pViewOptions->IsOnlineSpell() )
- return FALSE;
+ return sal_False;
break;
case AUTOCOMPLETE_WORDS :
if( !pViewOptions->IsAutoCompleteWords() ||
pDoc->GetAutoCompleteWords().IsLockWordLstLocked())
- return FALSE;
+ return sal_False;
break;
case WORD_COUNT :
if ( !pViewShell->getIDocumentStatistics()->GetDocStat().bModified )
- return FALSE;
+ return sal_False;
break;
case SMART_TAGS :
if ( pDoc->GetDocShell()->IsHelpDocument() ||
pDoc->isXForms() ||
!SwSmartTagMgr::Get().IsSmartTagsEnabled() )
- return FALSE;
+ return sal_False;
break;
default: ASSERT( false, "Unknown idle job type" )
}
@@ -2299,17 +2320,17 @@ BOOL SwLayIdle::DoIdleJob( IdleJobType eJob, BOOL bVisAreaOnly )
while ( pPage )
{
- bPageValid = TRUE;
+ bPageValid = sal_True;
const SwCntntFrm *pCnt = pPage->ContainsCntnt();
while( pCnt && pPage->IsAnLower( pCnt ) )
{
if ( _DoIdleJob( pCnt, eJob ) )
- return TRUE;
+ return sal_True;
pCnt = pCnt->GetNextCntntFrm();
}
if ( pPage->GetSortedObjs() )
{
- for ( USHORT i = 0; pPage->GetSortedObjs() &&
+ for ( sal_uInt16 i = 0; pPage->GetSortedObjs() &&
i < pPage->GetSortedObjs()->Count(); ++i )
{
const SwAnchoredObject* pObj = (*pPage->GetSortedObjs())[i];
@@ -2322,7 +2343,7 @@ BOOL SwLayIdle::DoIdleJob( IdleJobType eJob, BOOL bVisAreaOnly )
if ( pC->IsTxtFrm() )
{
if ( _DoIdleJob( pC, eJob ) )
- return TRUE;
+ return sal_True;
}
pC = pC->GetNextCntntFrm();
}
@@ -2346,7 +2367,7 @@ BOOL SwLayIdle::DoIdleJob( IdleJobType eJob, BOOL bVisAreaOnly )
!pPage->Frm().IsOver( pImp->GetShell()->VisArea()))
break;
}
- return FALSE;
+ return sal_False;
}
@@ -2365,7 +2386,7 @@ void SwLayIdle::ShowIdle( ColorData eColorData )
{
if ( !bIndicator )
{
- bIndicator = TRUE;
+ bIndicator = sal_True;
Window *pWin = pImp->GetShell()->GetWin();
if ( pWin )
{
@@ -2401,7 +2422,7 @@ SwLayIdle::SwLayIdle( SwRootFrm *pRt, SwViewImp *pI ) :
pImp( pI )
#ifdef DBG_UTIL
#if OSL_DEBUG_LEVEL > 1
- , bIndicator( FALSE )
+ , bIndicator( sal_False )
#endif
#endif
{
@@ -2409,13 +2430,13 @@ SwLayIdle::SwLayIdle( SwRootFrm *pRt, SwViewImp *pI ) :
SHOW_IDLE( COL_LIGHTRED );
- pImp->GetShell()->EnableSmooth( FALSE );
+ pImp->GetShell()->EnableSmooth( sal_False );
//Zuerst den Sichtbaren Bereich Spellchecken, nur wenn dort nichts
//zu tun war wird das IdleFormat angestossen.
- if ( !DoIdleJob( SMART_TAGS, TRUE ) &&
- !DoIdleJob( ONLINE_SPELLING, TRUE ) &&
- !DoIdleJob( AUTOCOMPLETE_WORDS, TRUE ) ) // SMARTTAGS
+ if ( !DoIdleJob( SMART_TAGS, sal_True ) &&
+ !DoIdleJob( ONLINE_SPELLING, sal_True ) &&
+ !DoIdleJob( AUTOCOMPLETE_WORDS, sal_True ) ) // SMARTTAGS
{
//Formatieren und ggf. Repaint-Rechtecke an der ViewShell vormerken.
//Dabei muessen kuenstliche Actions laufen, damit es z.B. bei
@@ -2426,11 +2447,11 @@ SwLayIdle::SwLayIdle( SwRootFrm *pRt, SwViewImp *pI ) :
ViewShell *pSh = pImp->GetShell();
do
{ ++pSh->nStartAction;
- BOOL bVis = FALSE;
+ sal_Bool bVis = sal_False;
if ( pSh->ISA(SwCrsrShell) )
{
#ifdef SW_CRSR_TIMER
- ((SwCrsrShell*)pSh)->ChgCrsrTimerFlag( FALSE );
+ ((SwCrsrShell*)pSh)->ChgCrsrTimerFlag( sal_False );
#endif
bVis = ((SwCrsrShell*)pSh)->GetCharRect().IsOver(pSh->VisArea());
}
@@ -2440,20 +2461,20 @@ SwLayIdle::SwLayIdle( SwRootFrm *pRt, SwViewImp *pI ) :
SwLayAction aAction( pRoot, pImp );
aAction.SetInputType( INPUT_ANY );
- aAction.SetIdle( TRUE );
- aAction.SetWaitAllowed( FALSE );
+ aAction.SetIdle( sal_True );
+ aAction.SetWaitAllowed( sal_False );
aAction.Action();
//Weitere Start-/EndActions nur auf wenn irgendwo Paints aufgelaufen
//sind oder wenn sich die Sichtbarkeit des CharRects veraendert hat.
- BOOL bActions = FALSE;
- USHORT nBoolIdx = 0;
+ sal_Bool bActions = sal_False;
+ sal_uInt16 nBoolIdx = 0;
do
{
--pSh->nStartAction;
if ( pSh->Imp()->GetRegion() )
- bActions = TRUE;
+ bActions = sal_True;
else
{
SwRect aTmp( pSh->VisArea() );
@@ -2485,7 +2506,7 @@ SwLayIdle::SwLayIdle( SwRootFrm *pRt, SwViewImp *pI ) :
nBoolIdx = 0;
do
{
- BOOL bCrsrShell = pSh->IsA( TYPE(SwCrsrShell) );
+ sal_Bool bCrsrShell = pSh->IsA( TYPE(SwCrsrShell) );
if ( bCrsrShell )
((SwCrsrShell*)pSh)->SttCrsrMove();
@@ -2497,20 +2518,20 @@ SwLayIdle::SwLayIdle( SwRootFrm *pRt, SwViewImp *pI ) :
//deren Loesung unverhaeltnissmaessig aufwendig waere.
//fix(18176):
SwViewImp *pViewImp = pSh->Imp();
- BOOL bUnlock = FALSE;
+ sal_Bool bUnlock = sal_False;
if ( pViewImp->GetRegion() )
{
pViewImp->DelRegion();
//Fuer Repaint mit virtuellem Device sorgen.
pSh->LockPaint();
- bUnlock = TRUE;
+ bUnlock = sal_True;
}
if ( bCrsrShell )
//Wenn der Crsr sichbar war wieder sichbar machen, sonst
- //EndCrsrMove mit TRUE fuer IdleEnd.
- ((SwCrsrShell*)pSh)->EndCrsrMove( TRUE^aBools[nBoolIdx] );
+ //EndCrsrMove mit sal_True fuer IdleEnd.
+ ((SwCrsrShell*)pSh)->EndCrsrMove( sal_True^aBools[nBoolIdx] );
// else
// pSh->EndAction();
if( bUnlock )
@@ -2523,11 +2544,11 @@ SwLayIdle::SwLayIdle( SwRootFrm *pRt, SwViewImp *pI ) :
// paint the selection! -> Set the focus flag at
// CrsrShell and it dont paint the selection.
((SwCrsrShell*)pSh)->ShLooseFcs();
- pSh->UnlockPaint( TRUE );
- ((SwCrsrShell*)pSh)->ShGetFcs( FALSE );
+ pSh->UnlockPaint( sal_True );
+ ((SwCrsrShell*)pSh)->ShGetFcs( sal_False );
}
else
- pSh->UnlockPaint( TRUE );
+ pSh->UnlockPaint( sal_True );
}
pSh = (ViewShell*)pSh->GetNext();
@@ -2538,20 +2559,20 @@ SwLayIdle::SwLayIdle( SwRootFrm *pRt, SwViewImp *pI ) :
if ( !aAction.IsInterrupt() )
{
- if ( !DoIdleJob( WORD_COUNT, FALSE ) )
- if ( !DoIdleJob( SMART_TAGS, FALSE ) )
- if ( !DoIdleJob( ONLINE_SPELLING, FALSE ) )
- DoIdleJob( AUTOCOMPLETE_WORDS, FALSE ); // SMARTTAGS
+ if ( !DoIdleJob( WORD_COUNT, sal_False ) )
+ if ( !DoIdleJob( SMART_TAGS, sal_False ) )
+ if ( !DoIdleJob( ONLINE_SPELLING, sal_False ) )
+ DoIdleJob( AUTOCOMPLETE_WORDS, sal_False ); // SMARTTAGS
}
bool bInValid = false;
const SwViewOption& rVOpt = *pImp->GetShell()->GetViewOptions();
const ViewShell* pViewShell = pImp->GetShell();
// See conditions in DoIdleJob()
- const BOOL bSpell = rVOpt.IsOnlineSpell();
- const BOOL bACmplWrd = rVOpt.IsAutoCompleteWords();
- const BOOL bWordCount = pViewShell->getIDocumentStatistics()->GetDocStat().bModified;
- const BOOL bSmartTags = !pViewShell->GetDoc()->GetDocShell()->IsHelpDocument() &&
+ const sal_Bool bSpell = rVOpt.IsOnlineSpell();
+ const sal_Bool bACmplWrd = rVOpt.IsAutoCompleteWords();
+ const sal_Bool bWordCount = pViewShell->getIDocumentStatistics()->GetDocStat().bModified;
+ const sal_Bool bSmartTags = !pViewShell->GetDoc()->GetDocShell()->IsHelpDocument() &&
!pViewShell->GetDoc()->isXForms() &&
SwSmartTagMgr::Get().IsSmartTagsEnabled(); // SMARTTAGS
@@ -2578,7 +2599,7 @@ SwLayIdle::SwLayIdle( SwRootFrm *pRt, SwViewImp *pI ) :
}
}
- pImp->GetShell()->EnableSmooth( TRUE );
+ pImp->GetShell()->EnableSmooth( sal_True );
if( pImp->IsAccessible() )
pImp->FireAccessibleEvents();
diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx
index db24e0b9199c..dbc59bc25fa5 100644
--- a/sw/source/core/layout/laycache.cxx
+++ b/sw/source/core/layout/laycache.cxx
@@ -100,18 +100,18 @@ void SwLayoutCache::Read( SvStream &rStream )
//-----------------------------------------------------------------------------
-void SwLayCacheImpl::Insert( USHORT nType, ULONG nIndex, xub_StrLen nOffset )
+void SwLayCacheImpl::Insert( sal_uInt16 nType, sal_uLong nIndex, xub_StrLen nOffset )
{
aType.Insert( nType, aType.Count() );
SvULongs::Insert( nIndex, SvULongs::Count() );
aOffset.push_back( nOffset );
}
-BOOL SwLayCacheImpl::Read( SvStream& rStream )
+sal_Bool SwLayCacheImpl::Read( SvStream& rStream )
{
- SwLayCacheIoImpl aIo( rStream, FALSE );
+ SwLayCacheIoImpl aIo( rStream, sal_False );
if( aIo.GetMajorVersion() > SW_LAYCACHE_IO_VERSION_MAJOR )
- return FALSE;
+ return sal_False;
// Due to an evil bug in the layout cache (#102759#), we cannot trust the
// sizes of fly frames which have been written using the "old" layout cache.
@@ -119,8 +119,8 @@ BOOL SwLayCacheImpl::Read( SvStream& rStream )
// height of fly frames
bUseFlyCache = aIo.GetMinorVersion() >= 1;
- BYTE cFlags;
- UINT32 nIndex, nOffset;
+ sal_uInt8 cFlags;
+ sal_uInt32 nIndex, nOffset;
aIo.OpenRec( SW_LAYCACHE_IO_REC_PAGES );
aIo.OpenFlagRec();
@@ -156,7 +156,7 @@ BOOL SwLayCacheImpl::Read( SvStream& rStream )
aIo.OpenFlagRec();
aIo.CloseFlagRec();
long nX, nY, nW, nH;
- USHORT nPgNum;
+ sal_uInt16 nPgNum;
aIo.GetStream() >> nPgNum >> nIndex
>> nX >> nY >> nW >> nH;
SwFlyCache* pFly = new SwFlyCache( nPgNum, nIndex, nX, nY, nW, nH );
@@ -190,10 +190,10 @@ void SwLayoutCache::Write( SvStream &rStream, const SwDoc& rDoc )
{
if( rDoc.GetCurrentLayout() ) // the layout itself .. //swmod 080218
{
- SwLayCacheIoImpl aIo( rStream, TRUE );
+ SwLayCacheIoImpl aIo( rStream, sal_True );
// We want to save the relative index, so we need the index
// of the first content
- ULONG nStartOfContent = rDoc.GetNodes().GetEndOfContent().
+ sal_uLong nStartOfContent = rDoc.GetNodes().GetEndOfContent().
StartOfSectionNode()->GetIndex();
// The first page..
SwPageFrm* pPage = (SwPageFrm*)rDoc.GetCurrentLayout()->Lower(); //swmod 080218
@@ -216,12 +216,12 @@ void SwLayoutCache::Write( SvStream &rStream, const SwDoc& rDoc )
{
if( pTmp->IsTxtFrm() )
{
- ULONG nNdIdx = ((SwTxtFrm*)pTmp)->GetNode()->GetIndex();
+ sal_uLong nNdIdx = ((SwTxtFrm*)pTmp)->GetNode()->GetIndex();
if( nNdIdx > nStartOfContent )
{
/* Open Paragraph Record */
aIo.OpenRec( SW_LAYCACHE_IO_REC_PARA );
- BOOL bFollow = ((SwTxtFrm*)pTmp)->IsFollow();
+ sal_Bool bFollow = ((SwTxtFrm*)pTmp)->IsFollow();
aIo.OpenFlagRec( bFollow ? 0x01 : 0x00,
bFollow ? 8 : 4 );
nNdIdx -= nStartOfContent;
@@ -236,7 +236,7 @@ void SwLayoutCache::Write( SvStream &rStream, const SwDoc& rDoc )
else if( pTmp->IsTabFrm() )
{
SwTabFrm* pTab = (SwTabFrm*)pTmp;
- ULONG nOfst = STRING_LEN;
+ sal_uLong nOfst = STRING_LEN;
if( pTab->IsFollow() )
{
// If the table is a follow, we have to look for the
@@ -258,7 +258,7 @@ void SwLayoutCache::Write( SvStream &rStream, const SwDoc& rDoc )
}
do
{
- ULONG nNdIdx =
+ sal_uLong nNdIdx =
pTab->GetTable()->GetTableNode()->GetIndex();
if( nNdIdx > nStartOfContent )
{
@@ -308,7 +308,7 @@ void SwLayoutCache::Write( SvStream &rStream, const SwDoc& rDoc )
if( pPage->GetSortedObjs() )
{
SwSortedObjs &rObjs = *pPage->GetSortedObjs();
- for ( USHORT i = 0; i < rObjs.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i )
{
SwAnchoredObject* pAnchoredObj = rObjs[i];
if ( pAnchoredObj->ISA(SwFlyFrm) )
@@ -322,7 +322,7 @@ void SwLayoutCache::Write( SvStream &rStream, const SwDoc& rDoc )
if( pC )
{
sal_uInt32 nOrdNum = pAnchoredObj->GetDrawObj()->GetOrdNum();
- USHORT nPageNum = pPage->GetPhyPageNum();
+ sal_uInt16 nPageNum = pPage->GetPhyPageNum();
/* Open Fly Record */
aIo.OpenRec( SW_LAYCACHE_IO_REC_FLY );
aIo.OpenFlagRec( 0, 0 );
@@ -355,8 +355,8 @@ sal_Bool SwLayoutCache::CompareLayout( const SwDoc& rDoc ) const
sal_Bool bRet = sal_True;
if( pRootFrm )
{
- USHORT nIndex = 0;
- ULONG nStartOfContent = rDoc.GetNodes().GetEndOfContent().
+ sal_uInt16 nIndex = 0;
+ sal_uLong nStartOfContent = rDoc.GetNodes().GetEndOfContent().
StartOfSectionNode()->GetIndex();
SwPageFrm* pPage = (SwPageFrm*)pRootFrm->Lower();
if( pPage )
@@ -377,10 +377,10 @@ sal_Bool SwLayoutCache::CompareLayout( const SwDoc& rDoc ) const
{
if( pTmp->IsTxtFrm() )
{
- ULONG nNdIdx = ((SwTxtFrm*)pTmp)->GetNode()->GetIndex();
+ sal_uLong nNdIdx = ((SwTxtFrm*)pTmp)->GetNode()->GetIndex();
if( nNdIdx > nStartOfContent )
{
- BOOL bFollow = ((SwTxtFrm*)pTmp)->IsFollow();
+ sal_Bool bFollow = ((SwTxtFrm*)pTmp)->IsFollow();
nNdIdx -= nStartOfContent;
if( pImpl->GetBreakIndex( nIndex ) != nNdIdx ||
SW_LAYCACHE_IO_REC_PARA !=
@@ -397,7 +397,7 @@ sal_Bool SwLayoutCache::CompareLayout( const SwDoc& rDoc ) const
else if( pTmp->IsTabFrm() )
{
SwTabFrm* pTab = (SwTabFrm*)pTmp;
- ULONG nOfst = STRING_LEN;
+ sal_uLong nOfst = STRING_LEN;
if( pTab->IsFollow() )
{
nOfst = 0;
@@ -416,7 +416,7 @@ sal_Bool SwLayoutCache::CompareLayout( const SwDoc& rDoc ) const
}
do
{
- ULONG nNdIdx =
+ sal_uLong nNdIdx =
pTab->GetTable()->GetTableNode()->GetIndex();
if( nNdIdx > nStartOfContent )
{
@@ -496,8 +496,7 @@ SwActualSection::SwActualSection( SwActualSection *pUp,
if ( !pSectNode )
{
const SwNodeIndex *pIndex = pSect->GetFmt()->GetCntnt().GetCntntIdx();
- pSectNode = pSect->GetFmt()->GetDoc()->GetNodes()[*pIndex]->
- FindSectionNode();
+ pSectNode = pIndex->GetNode().FindSectionNode();
}
}
@@ -511,8 +510,8 @@ SwActualSection::SwActualSection( SwActualSection *pUp,
* --------------------------------------------------*/
SwLayHelper::SwLayHelper( SwDoc *pD, SwFrm* &rpF, SwFrm* &rpP, SwPageFrm* &rpPg,
- SwLayoutFrm* &rpL, SwActualSection* &rpA, BOOL &rB,
- ULONG nNodeIndex, BOOL bCache )
+ SwLayoutFrm* &rpL, SwActualSection* &rpA, sal_Bool &rB,
+ sal_uLong nNodeIndex, sal_Bool bCache )
: rpFrm( rpF ), rpPrv( rpP ), rpPage( rpPg ), rpLay( rpL ),
rpActualSection( rpA ), rbBreakAfter(rB), pDoc(pD), nMaxParaPerPage( 25 ),
nParagraphCnt( bCache ? 0 : USHRT_MAX ), bFirst( bCache )
@@ -556,9 +555,9 @@ SwLayHelper::~SwLayHelper()
* otherwise it estimates the page count.
* --------------------------------------------------*/
-ULONG SwLayHelper::CalcPageCount()
+sal_uLong SwLayHelper::CalcPageCount()
{
- ULONG nPgCount;
+ sal_uLong nPgCount;
SwLayCacheImpl *pCache = pDoc->GetLayoutCache() ?
pDoc->GetLayoutCache()->LockImpl() : NULL;
if( pCache )
@@ -571,11 +570,11 @@ ULONG SwLayHelper::CalcPageCount()
nPgCount = pDoc->GetDocStat().nPage;
if ( nPgCount <= 10 ) // no page insertion for less than 10 pages
nPgCount = 0;
- ULONG nNdCount = pDoc->GetDocStat().nPara;
+ sal_uLong nNdCount = pDoc->GetDocStat().nPara;
if ( nNdCount <= 1 )
{
//Estimates the number of paragraphs.
- ULONG nTmp = pDoc->GetNodes().GetEndOfContent().GetIndex() -
+ sal_uLong nTmp = pDoc->GetNodes().GetEndOfContent().GetIndex() -
pDoc->GetNodes().GetEndOfExtras().GetIndex();
//Tables have a little overhead..
nTmp -= pDoc->GetTblFrmFmts()->Count() * 25;
@@ -591,12 +590,12 @@ ULONG SwLayHelper::CalcPageCount()
nMaxParaPerPage = nNdCount / nPgCount;
else
{
- nMaxParaPerPage = Max( ULONG(20),
- ULONG(20 + nNdCount / 1000 * 3) );
+ nMaxParaPerPage = Max( sal_uLong(20),
+ sal_uLong(20 + nNdCount / 1000 * 3) );
#ifdef PM2
- const ULONG nMax = 49;
+ const sal_uLong nMax = 49;
#else
- const ULONG nMax = 53;
+ const sal_uLong nMax = 53;
#endif
nMaxParaPerPage = Min( nMaxParaPerPage, nMax );
nPgCount = nNdCount / nMaxParaPerPage;
@@ -615,7 +614,7 @@ ULONG SwLayHelper::CalcPageCount()
/*-----------------23.5.2001 16:44------------------
* SwLayHelper::CheckInsertPage()
- * inserts a page and return TRUE, if
+ * inserts a page and return sal_True, if
* - the break after flag is set
* - the actual content wants a break before
* - the maximum count of paragraph/rows is reached
@@ -624,9 +623,9 @@ ULONG SwLayHelper::CalcPageCount()
* wants a break after.
* --------------------------------------------------*/
-BOOL SwLayHelper::CheckInsertPage()
+sal_Bool SwLayHelper::CheckInsertPage()
{
- BOOL bEnd = 0 == rpPage->GetNext();
+ sal_Bool bEnd = 0 == rpPage->GetNext();
const SwAttrSet* pAttr = rpFrm->GetAttrSet();
const SvxFmtBreakItem& rBrk = pAttr->GetBreak();
const SwFmtPageDesc& rDesc = pAttr->GetPageDesc();
@@ -638,7 +637,7 @@ BOOL SwLayHelper::CheckInsertPage()
rDesc.GetPageDesc();
// <--
- BOOL bBrk = nParagraphCnt > nMaxParaPerPage || rbBreakAfter;
+ sal_Bool bBrk = nParagraphCnt > nMaxParaPerPage || rbBreakAfter;
rbBreakAfter = rBrk.GetBreak() == SVX_BREAK_PAGE_AFTER ||
rBrk.GetBreak() == SVX_BREAK_PAGE_BOTH;
if ( !bBrk )
@@ -647,23 +646,23 @@ BOOL SwLayHelper::CheckInsertPage()
if ( bBrk || pDesc )
{
- USHORT nPgNum = 0;
+ sal_uInt16 nPgNum = 0;
if ( !pDesc )
pDesc = rpPage->GetPageDesc()->GetFollow();
else
{
if ( 0 != (nPgNum = rDesc.GetNumOffset()) )
- ((SwRootFrm*)rpPage->GetUpper())->SetVirtPageNum(TRUE);
+ ((SwRootFrm*)rpPage->GetUpper())->SetVirtPageNum(sal_True);
}
- BOOL bNextPageOdd = !rpPage->OnRightPage();
- BOOL bInsertEmpty = FALSE;
+ sal_Bool bNextPageOdd = !rpPage->OnRightPage();
+ sal_Bool bInsertEmpty = sal_False;
if( nPgNum && bNextPageOdd != ( ( nPgNum % 2 ) != 0 ) )
{
bNextPageOdd = !bNextPageOdd;
- bInsertEmpty = TRUE;
+ bInsertEmpty = sal_True;
}
::InsertNewPage( (SwPageDesc&)*pDesc, rpPage->GetUpper(),
- bNextPageOdd, bInsertEmpty, FALSE, rpPage->GetNext() );
+ bNextPageOdd, bInsertEmpty, sal_False, rpPage->GetNext() );
if ( bEnd )
{
ASSERT( rpPage->GetNext(), "Keine neue Seite?" );
@@ -684,9 +683,9 @@ BOOL SwLayHelper::CheckInsertPage()
rpLay = rpPage->FindBodyCont();
while( rpLay->Lower() )
rpLay = (SwLayoutFrm*)rpLay->Lower();
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// --> OD 2006-03-22 #b6375613#
@@ -695,7 +694,7 @@ bool lcl_HasTextFrmAnchoredObjs( SwTxtFrm* p_pTxtFrm )
bool bHasTextFrmAnchoredObjs( false );
const SwSpzFrmFmts* pSpzFrmFmts = p_pTxtFrm->GetTxtNode()->GetDoc()->GetSpzFrmFmts();
- for ( USHORT i = 0; i < pSpzFrmFmts->Count(); ++i )
+ for ( sal_uInt16 i = 0; i < pSpzFrmFmts->Count(); ++i )
{
SwFrmFmt *pFmt = (SwFrmFmt*)(*pSpzFrmFmts)[i];
const SwFmtAnchor &rAnch = pFmt->GetAnchor();
@@ -763,13 +762,13 @@ void lcl_ApplyWorkaroundForB6375613( SwFrm* p_pFirstFrmOnNewPage )
* one page, in this case the needed count of pages will inserted.
* --------------------------------------------------*/
-BOOL SwLayHelper::CheckInsert( ULONG nNodeIndex )
+sal_Bool SwLayHelper::CheckInsert( sal_uLong nNodeIndex )
{
- BOOL bRet = FALSE;
- BOOL bLongTab = FALSE;
- ULONG nMaxRowPerPage( 0 );
+ sal_Bool bRet = sal_False;
+ sal_Bool bLongTab = sal_False;
+ sal_uLong nMaxRowPerPage( 0 );
nNodeIndex -= nStartOfContent;
- USHORT nRows( 0 );
+ sal_uInt16 nRows( 0 );
if( rpFrm->IsTabFrm() )
{
//Inside a table counts every row as a paragraph
@@ -798,15 +797,15 @@ BOOL SwLayHelper::CheckInsert( ULONG nNodeIndex )
if( pTmp->GetNext() )
pTmp = pTmp->GetNext();
pTmp = ((SwRowFrm*)pTmp)->Lower();
- USHORT nCnt = 0;
+ sal_uInt16 nCnt = 0;
do
{
++nCnt;
pTmp = pTmp->GetNext();
} while( pTmp );
- nMaxRowPerPage = Max( ULONG(2), nMaxParaPerPage / nCnt );
+ nMaxRowPerPage = Max( sal_uLong(2), nMaxParaPerPage / nCnt );
}
- bLongTab = TRUE;
+ bLongTab = sal_True;
}
}
else
@@ -816,9 +815,9 @@ BOOL SwLayHelper::CheckInsert( ULONG nNodeIndex )
( pImpl->GetBreakOfst( nIndex ) < STRING_LEN ||
( ++nIndex < pImpl->Count() &&
pImpl->GetBreakIndex( nIndex ) == nNodeIndex ) ) )
- bFirst = FALSE;
+ bFirst = sal_False;
#if OSL_DEBUG_LEVEL > 1
- ULONG nBreakIndex = ( pImpl && nIndex < pImpl->Count() ) ?
+ sal_uLong nBreakIndex = ( pImpl && nIndex < pImpl->Count() ) ?
pImpl->GetBreakIndex(nIndex) : 0xffff;
(void)nBreakIndex;
#endif
@@ -827,18 +826,18 @@ BOOL SwLayHelper::CheckInsert( ULONG nNodeIndex )
( rpFrm->IsTabFrm() && bLongTab )
)
{
- ULONG nRowCount = 0;
+ sal_uLong nRowCount = 0;
do
{
if( pImpl || bLongTab )
{
#if OSL_DEBUG_LEVEL > 1
- ULONG nBrkIndex = ( pImpl && nIndex < pImpl->Count() ) ?
+ sal_uLong nBrkIndex = ( pImpl && nIndex < pImpl->Count() ) ?
pImpl->GetBreakIndex(nIndex) : 0xffff;
(void)nBrkIndex;
#endif
xub_StrLen nOfst = STRING_LEN;
- USHORT nType = SW_LAYCACHE_IO_REC_PAGES;
+ sal_uInt16 nType = SW_LAYCACHE_IO_REC_PAGES;
if( bLongTab )
{
rbBreakAfter = sal_True;
@@ -861,7 +860,7 @@ BOOL SwLayHelper::CheckInsert( ULONG nNodeIndex )
if( nOfst < STRING_LEN )
{
sal_Bool bSplit = sal_False;
- USHORT nRepeat( 0 );
+ sal_uInt16 nRepeat( 0 );
if( !bLongTab && rpFrm->IsTxtFrm() &&
SW_LAYCACHE_IO_REC_PARA == nType &&
nOfst<((SwTxtFrm*)rpFrm)->GetTxtNode()->GetTxt().Len() )
@@ -892,10 +891,10 @@ BOOL SwLayHelper::CheckInsert( ULONG nNodeIndex )
SwFrm *pPrv;
if( nRepeat > 0 )
{
- bDontCreateObjects = TRUE; //frmtool
+ bDontCreateObjects = sal_True; //frmtool
// Insert new headlines:
- USHORT nRowIdx = 0;
+ sal_uInt16 nRowIdx = 0;
SwRowFrm* pHeadline = 0;
while( nRowIdx < nRepeat )
{
@@ -909,7 +908,7 @@ BOOL SwLayHelper::CheckInsert( ULONG nNodeIndex )
++nRowIdx;
}
- bDontCreateObjects = FALSE;
+ bDontCreateObjects = sal_False;
pPrv = pHeadline;
nRows = nRows + nRepeat;
}
@@ -957,7 +956,7 @@ BOOL SwLayHelper::CheckInsert( ULONG nNodeIndex )
if( rpPrv && rpPrv->IsTxtFrm() && !rpPrv->GetValidSizeFlag() )
rpPrv->Frm().Height( rpPrv->GetUpper()->Prt().Height() );
- bRet = TRUE;
+ bRet = sal_True;
rpPrv = 0;
nParagraphCnt = 0;
@@ -975,7 +974,7 @@ BOOL SwLayHelper::CheckInsert( ULONG nNodeIndex )
else
{
pSct = new SwSectionFrm(
- *rpActualSection->GetSectionFrm(), FALSE );
+ *rpActualSection->GetSectionFrm(), sal_False );
rpActualSection->GetSectionFrm()->SimpleFormat();
bInit = true;
}
@@ -994,7 +993,7 @@ BOOL SwLayHelper::CheckInsert( ULONG nNodeIndex )
} while( bLongTab || ( pImpl && nIndex < pImpl->Count() &&
(*pImpl)[ nIndex ] == nNodeIndex ) );
}
- bFirst = FALSE;
+ bFirst = sal_False;
return bRet;
}
@@ -1025,12 +1024,12 @@ void SwLayHelper::_CheckFlyCache( SwPageFrm* pPage )
{
if( !pImpl || !pPage )
return;
- USHORT nFlyCount = pImpl->GetFlyCount();
+ sal_uInt16 nFlyCount = pImpl->GetFlyCount();
// Any text frames at the page, fly cache avaiable?
if( pPage->GetSortedObjs() && nFlyIdx < nFlyCount )
{
SwSortedObjs &rObjs = *pPage->GetSortedObjs();
- USHORT nPgNum = pPage->GetPhyPageNum();
+ sal_uInt16 nPgNum = pPage->GetPhyPageNum();
/*
@@ -1043,7 +1042,7 @@ void SwLayHelper::_CheckFlyCache( SwPageFrm* pPage )
// be used to identify the objects.
//
- for ( USHORT i = 0; i < rObjs.Count(); ++i ) // check objects
+ for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i ) // check objects
{
SdrObject *pO = rObjs[i];
if ( pO->ISA(SwVirtFlyDrawObj) ) // a text frame?
@@ -1055,7 +1054,7 @@ void SwLayHelper::_CheckFlyCache( SwPageFrm* pPage )
const SwContact *pC = (SwContact*)GetUserCall(pO);
if( pC )
{
- ULONG nOrdNum = pO->GetOrdNum(); // the Id
+ sal_uLong nOrdNum = pO->GetOrdNum(); // the Id
SwFlyCache* pFlyC;
while( nFlyIdx < nFlyCount && ( pFlyC = pImpl->
GetFlyCache(nFlyIdx) )->nPageNum < nPgNum)
@@ -1063,7 +1062,7 @@ void SwLayHelper::_CheckFlyCache( SwPageFrm* pPage )
if( nFlyIdx < nFlyCount &&
pFlyC->nPageNum == nPgNum )
{
- USHORT nIdx = nFlyIdx;
+ sal_uInt16 nIdx = nFlyIdx;
while( nIdx < nFlyCount && ( pFlyC = pImpl->
GetFlyCache( nIdx ) )->nPageNum == nPgNum &&
pFlyC->nOrdNum != nOrdNum )
@@ -1097,7 +1096,7 @@ void SwLayHelper::_CheckFlyCache( SwPageFrm* pPage )
// sort cached objects on this page by ordnum
std::set< const SwFlyCache*, FlyCacheCompare > aFlyCacheSet;
- USHORT nIdx = nFlyIdx;
+ sal_uInt16 nIdx = nFlyIdx;
while( nIdx < nFlyCount && ( pFlyC = pImpl->
GetFlyCache( nIdx ) )->nPageNum == nPgNum )
@@ -1108,7 +1107,7 @@ void SwLayHelper::_CheckFlyCache( SwPageFrm* pPage )
// sort objects on this page by ordnum
std::set< const SdrObject*, SdrObjectCompare > aFlySet;
- for ( USHORT i = 0; i < rObjs.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i )
{
SwAnchoredObject* pAnchoredObj = rObjs[i];
if ( pAnchoredObj->ISA(SwFlyFrm) ) // a text frame?
@@ -1168,21 +1167,21 @@ void SwLayHelper::_CheckFlyCache( SwPageFrm* pPage )
* the rpPage parameter to the right page, if possible.
* --------------------------------------------------*/
-BOOL SwLayHelper::CheckPageFlyCache( SwPageFrm* &rpPage, SwFlyFrm* pFly )
+sal_Bool SwLayHelper::CheckPageFlyCache( SwPageFrm* &rpPage, SwFlyFrm* pFly )
{
if( !pFly->GetAnchorFrm() || !pFly->GetVirtDrawObj() ||
pFly->GetAnchorFrm()->FindFooterOrHeader() )
- return FALSE;
- BOOL bRet = FALSE;
+ return sal_False;
+ sal_Bool bRet = sal_False;
SwDoc* pDoc = rpPage->GetFmt()->GetDoc();
SwLayCacheImpl *pCache = pDoc->GetLayoutCache() ?
pDoc->GetLayoutCache()->LockImpl() : NULL;
if( pCache )
{
- USHORT nPgNum = rpPage->GetPhyPageNum();
- USHORT nIdx = 0;
- USHORT nCnt = pCache->GetFlyCount();
- ULONG nOrdNum = pFly->GetVirtDrawObj()->GetOrdNum();
+ sal_uInt16 nPgNum = rpPage->GetPhyPageNum();
+ sal_uInt16 nIdx = 0;
+ sal_uInt16 nCnt = pCache->GetFlyCount();
+ sal_uLong nOrdNum = pFly->GetVirtDrawObj()->GetOrdNum();
SwFlyCache* pFlyC = 0;
// skip fly frames from pages before the current page
@@ -1217,7 +1216,7 @@ BOOL SwLayHelper::CheckPageFlyCache( SwPageFrm* &rpPage, SwFlyFrm* pFly )
pFly->Frm().Width( pFlyC->Width() );
pFly->Frm().Height( pFlyC->Height() );
}
- bRet = TRUE;
+ bRet = sal_True;
}
}
pDoc->GetLayoutCache()->UnlockImpl();
@@ -1227,12 +1226,12 @@ BOOL SwLayHelper::CheckPageFlyCache( SwPageFrm* &rpPage, SwFlyFrm* pFly )
// -----------------------------------------------------------------------------
-SwLayCacheIoImpl::SwLayCacheIoImpl( SvStream& rStrm, BOOL bWrtMd ) :
+SwLayCacheIoImpl::SwLayCacheIoImpl( SvStream& rStrm, sal_Bool bWrtMd ) :
pStream( &rStrm ),
nMajorVersion(SW_LAYCACHE_IO_VERSION_MAJOR),
nMinorVersion(SW_LAYCACHE_IO_VERSION_MINOR),
bWriteMode( bWrtMd ),
- bError( FALSE )
+ bError( sal_False )
{
if( bWriteMode )
*pStream << nMajorVersion
@@ -1243,23 +1242,23 @@ SwLayCacheIoImpl::SwLayCacheIoImpl( SvStream& rStrm, BOOL bWrtMd ) :
>> nMinorVersion;
}
-BOOL SwLayCacheIoImpl::OpenRec( BYTE cType )
+sal_Bool SwLayCacheIoImpl::OpenRec( sal_uInt8 cType )
{
- BOOL bRes = TRUE;
+ sal_Bool bRes = sal_True;
size_t nLvl = aRecTypes.size();
ASSERT( nLvl == aRecSizes.Count(), "OpenRec: Level" );
- UINT32 nPos = pStream->Tell();
+ sal_uInt32 nPos = pStream->Tell();
if( bWriteMode )
{
aRecTypes.push_back( cType );
aRecSizes.Insert( nPos, nLvl );
- *pStream << (UINT32) 0;
+ *pStream << (sal_uInt32) 0;
}
else
{
- UINT32 nVal;
+ sal_uInt32 nVal;
*pStream >> nVal;
- BYTE cRecTyp = (BYTE)nVal;
+ sal_uInt8 cRecTyp = (sal_uInt8)nVal;
aRecTypes.push_back( cRecTyp );
sal_uInt32 nSize = nVal >> 8;
aRecSizes.Insert( nPos + nSize, nLvl );
@@ -1272,7 +1271,7 @@ BOOL SwLayCacheIoImpl::OpenRec( BYTE cType )
aRecTypes.back() = 0;
aRecSizes[nLvl] = pStream->Tell();
bRes = sal_False;
- bError = TRUE;
+ bError = sal_True;
}
}
return bRes;
@@ -1280,39 +1279,39 @@ BOOL SwLayCacheIoImpl::OpenRec( BYTE cType )
// Close record
-BOOL SwLayCacheIoImpl::CloseRec( BYTE )
+sal_Bool SwLayCacheIoImpl::CloseRec( sal_uInt8 )
{
- BOOL bRes = TRUE;
+ sal_Bool bRes = sal_True;
size_t nLvl = aRecTypes.size();
ASSERT( nLvl == aRecSizes.Count(), "CloseRec: wrong Level" );
ASSERT( nLvl, "CloseRec: no levels" );
if( nLvl )
{
nLvl--;
- UINT32 nPos = pStream->Tell();
+ sal_uInt32 nPos = pStream->Tell();
if( bWriteMode )
{
- UINT32 nBgn = aRecSizes[nLvl];
+ sal_uInt32 nBgn = aRecSizes[nLvl];
pStream->Seek( nBgn );
- UINT32 nSize = nPos - nBgn;
- UINT32 nVal = ( nSize << 8 ) | aRecTypes.back();
+ sal_uInt32 nSize = nPos - nBgn;
+ sal_uInt32 nVal = ( nSize << 8 ) | aRecTypes.back();
*pStream << nVal;
pStream->Seek( nPos );
if( pStream->GetError() != SVSTREAM_OK )
- bRes = FALSE;
+ bRes = sal_False;
}
else
{
- UINT32 n = aRecSizes[nLvl];
+ sal_uInt32 n = aRecSizes[nLvl];
ASSERT( n >= nPos, "CloseRec: to much data read" );
if( n != nPos )
{
pStream->Seek( n );
if( n < nPos )
- bRes = FALSE;
+ bRes = sal_False;
}
if( pStream->GetErrorCode() != SVSTREAM_OK )
- bRes = FALSE;
+ bRes = sal_False;
}
aRecTypes.pop_back();
@@ -1320,19 +1319,19 @@ BOOL SwLayCacheIoImpl::CloseRec( BYTE )
}
if( !bRes )
- bError = TRUE;
+ bError = sal_True;
return bRes;
}
-UINT32 SwLayCacheIoImpl::BytesLeft()
+sal_uInt32 SwLayCacheIoImpl::BytesLeft()
{
- UINT16 nLvl = aRecSizes.Count();
- UINT32 n = 0;
+ sal_uInt16 nLvl = aRecSizes.Count();
+ sal_uInt32 n = 0;
if( !bError && nLvl )
{
- UINT32 nEndPos = aRecSizes[ nLvl-1 ];
- UINT32 nPos = pStream->Tell();
+ sal_uInt32 nEndPos = aRecSizes[ nLvl-1 ];
+ sal_uInt32 nPos = pStream->Tell();
if( nEndPos > nPos )
n = nEndPos - nPos;
}
@@ -1340,18 +1339,18 @@ UINT32 SwLayCacheIoImpl::BytesLeft()
return n;
}
-BYTE SwLayCacheIoImpl::Peek()
+sal_uInt8 SwLayCacheIoImpl::Peek()
{
- BYTE c = 0;
+ sal_uInt8 c = 0;
if( !bError )
{
- UINT32 nPos = pStream->Tell();
+ sal_uInt32 nPos = pStream->Tell();
*pStream >> c;
pStream->Seek( nPos );
if( pStream->GetErrorCode() != SVSTREAM_OK )
{
c = 0;
- bError = TRUE;
+ bError = sal_True;
}
}
return c;
@@ -1359,27 +1358,27 @@ BYTE SwLayCacheIoImpl::Peek()
void SwLayCacheIoImpl::SkipRec()
{
- BYTE c = Peek();
+ sal_uInt8 c = Peek();
OpenRec( c );
pStream->Seek( aRecSizes[aRecSizes.Count()-1] );
CloseRec( c );
}
-BYTE SwLayCacheIoImpl::OpenFlagRec()
+sal_uInt8 SwLayCacheIoImpl::OpenFlagRec()
{
ASSERT( !bWriteMode, "OpenFlagRec illegal in write mode" );
- BYTE cFlags;
+ sal_uInt8 cFlags;
*pStream >> cFlags;
nFlagRecEnd = pStream->Tell() + ( cFlags & 0x0F );
return (cFlags >> 4);
}
-void SwLayCacheIoImpl::OpenFlagRec( BYTE nFlags, BYTE nLen )
+void SwLayCacheIoImpl::OpenFlagRec( sal_uInt8 nFlags, sal_uInt8 nLen )
{
ASSERT( bWriteMode, "OpenFlagRec illegal in read mode" );
ASSERT( (nFlags & 0xF0) == 0, "illegal flags set" );
ASSERT( nLen < 16, "wrong flag record length" );
- BYTE cFlags = (nFlags << 4) + nLen;
+ sal_uInt8 cFlags = (nFlags << 4) + nLen;
*pStream << cFlags;
nFlagRecEnd = pStream->Tell() + nLen;
}
diff --git a/sw/source/core/layout/layhelp.hxx b/sw/source/core/layout/layhelp.hxx
index 8eb958f5bfae..48aeefa68e1f 100644
--- a/sw/source/core/layout/layhelp.hxx
+++ b/sw/source/core/layout/layhelp.hxx
@@ -68,18 +68,18 @@ class SwLayCacheImpl : public SvULongs
SvUShorts aType;
SwPageFlyCache aFlyCache;
sal_Bool bUseFlyCache;
- void Insert( USHORT nType, ULONG nIndex, xub_StrLen nOffset );
+ void Insert( sal_uInt16 nType, sal_uLong nIndex, xub_StrLen nOffset );
public:
SwLayCacheImpl() : SvULongs( 20, 10 ), aType( 20, 10 ) {}
- BOOL Read( SvStream& rStream );
+ sal_Bool Read( SvStream& rStream );
- ULONG GetBreakIndex( USHORT nIdx ) const { return GetObject( nIdx ); }
+ sal_uLong GetBreakIndex( sal_uInt16 nIdx ) const { return GetObject( nIdx ); }
xub_StrLen GetBreakOfst( size_t nIdx ) const { return aOffset[ nIdx ]; }
- USHORT GetBreakType( USHORT nIdx ) const { return aType[ nIdx ]; }
+ sal_uInt16 GetBreakType( sal_uInt16 nIdx ) const { return aType[ nIdx ]; }
- USHORT GetFlyCount() const { return aFlyCache.Count(); }
- SwFlyCache *GetFlyCache( USHORT nIdx ) const { return aFlyCache[ nIdx ]; }
+ sal_uInt16 GetFlyCount() const { return aFlyCache.Count(); }
+ SwFlyCache *GetFlyCache( sal_uInt16 nIdx ) const { return aFlyCache[ nIdx ]; }
sal_Bool IsUseFlyCache() const { return bUseFlyCache; }
};
@@ -119,26 +119,26 @@ class SwLayHelper
SwPageFrm* &rpPage;
SwLayoutFrm* &rpLay;
SwActualSection* &rpActualSection;
- BOOL &rbBreakAfter;
+ sal_Bool &rbBreakAfter;
SwDoc* pDoc;
SwLayCacheImpl* pImpl;
- ULONG nMaxParaPerPage;
- ULONG nParagraphCnt;
- ULONG nStartOfContent;
- USHORT nIndex; // the index in the page break array
- USHORT nFlyIdx; // the index in the fly cache array
- BOOL bFirst : 1;
+ sal_uLong nMaxParaPerPage;
+ sal_uLong nParagraphCnt;
+ sal_uLong nStartOfContent;
+ sal_uInt16 nIndex; // the index in the page break array
+ sal_uInt16 nFlyIdx; // the index in the fly cache array
+ sal_Bool bFirst : 1;
void _CheckFlyCache( SwPageFrm* pPage );
public:
SwLayHelper( SwDoc *pD, SwFrm* &rpF, SwFrm* &rpP, SwPageFrm* &rpPg,
- SwLayoutFrm* &rpL, SwActualSection* &rpA, BOOL &rBrk,
- ULONG nNodeIndex, BOOL bCache );
+ SwLayoutFrm* &rpL, SwActualSection* &rpA, sal_Bool &rBrk,
+ sal_uLong nNodeIndex, sal_Bool bCache );
~SwLayHelper();
- ULONG CalcPageCount();
- BOOL CheckInsert( ULONG nNodeIndex );
+ sal_uLong CalcPageCount();
+ sal_Bool CheckInsert( sal_uLong nNodeIndex );
- BOOL BreakPage( xub_StrLen& rOffs, ULONG nNodeIndex );
- BOOL CheckInsertPage();
+ sal_Bool BreakPage( xub_StrLen& rOffs, sal_uLong nNodeIndex );
+ sal_Bool CheckInsertPage();
// Look for fresh text frames at this (new) page and set them to the right
// position, if they are in the fly cache.
@@ -147,7 +147,7 @@ public:
// Look for this text frame and set it to the right position,
// if it's in the fly cache.
- static BOOL CheckPageFlyCache( SwPageFrm* &rpPage, SwFlyFrm* pFly );
+ static sal_Bool CheckPageFlyCache( SwPageFrm* &rpPage, SwFlyFrm* pFly );
};
/*************************************************************************
@@ -171,33 +171,33 @@ class SwLayCacheIoImpl
SvStream *pStream;
- ULONG nFlagRecEnd;
+ sal_uLong nFlagRecEnd;
- USHORT nMajorVersion;
- USHORT nMinorVersion;
+ sal_uInt16 nMajorVersion;
+ sal_uInt16 nMinorVersion;
- BOOL bWriteMode : 1;
- BOOL bError : 1;
+ sal_Bool bWriteMode : 1;
+ sal_Bool bError : 1;
public:
- SwLayCacheIoImpl( SvStream& rStrm, BOOL bWrtMd );
+ SwLayCacheIoImpl( SvStream& rStrm, sal_Bool bWrtMd );
// Get input or output stream
SvStream& GetStream() const { return *pStream; }
// Open a record of type "nType"
- BOOL OpenRec( BYTE nType );
+ sal_Bool OpenRec( sal_uInt8 nType );
// Close a record of type "nType". This skips any unread data that
// remains in the record.
- BOOL CloseRec( BYTE nType );
+ sal_Bool CloseRec( sal_uInt8 nType );
// Return the number of bytes contained in the current record that
// haven't been read by now.
- UINT32 BytesLeft();
+ sal_uInt32 BytesLeft();
// Return the current record's type
- BYTE Peek();
+ sal_uInt8 Peek();
// Skip the current record
void SkipRec();
@@ -205,27 +205,27 @@ public:
// Open a flag record for reading. The uppermost four bits are flags,
// while the lowermost are the flag record's size. Flag records cannot
// be nested.
- BYTE OpenFlagRec();
+ sal_uInt8 OpenFlagRec();
// Open flag record for writing;
- void OpenFlagRec( BYTE nFlags, BYTE nLen );
+ void OpenFlagRec( sal_uInt8 nFlags, sal_uInt8 nLen );
// Close a flag record. Any bytes left are skipped.
void CloseFlagRec();
- BOOL HasError() const { return bError; }
+ sal_Bool HasError() const { return bError; }
- USHORT GetMajorVersion() const { return nMajorVersion; }
- USHORT GetMinorVersion() const { return nMinorVersion; }
+ sal_uInt16 GetMajorVersion() const { return nMajorVersion; }
+ sal_uInt16 GetMinorVersion() const { return nMinorVersion; }
};
// Stored information about text frames:
class SwFlyCache : public SwRect // position and size
{
public:
- ULONG nOrdNum; // Id to recognize text frames
- USHORT nPageNum; // page number
- SwFlyCache( USHORT nP, ULONG nO, long nXL, long nYL, long nWL, long nHL ) :
+ sal_uLong nOrdNum; // Id to recognize text frames
+ sal_uInt16 nPageNum; // page number
+ SwFlyCache( sal_uInt16 nP, sal_uLong nO, long nXL, long nYL, long nWL, long nHL ) :
SwRect( nXL, nYL, nWL, nHL ), nOrdNum( nO ), nPageNum( nP ){}
};
diff --git a/sw/source/core/layout/layouter.cxx b/sw/source/core/layout/layouter.cxx
index 036e14db3f71..17d0dd4356bc 100644
--- a/sw/source/core/layout/layouter.cxx
+++ b/sw/source/core/layout/layouter.cxx
@@ -50,10 +50,10 @@
class SwLooping
{
- USHORT nMinPage;
- USHORT nMaxPage;
- USHORT nCount;
- USHORT mnLoopControlStage;
+ sal_uInt16 nMinPage;
+ sal_uInt16 nMaxPage;
+ sal_uInt16 nCount;
+ sal_uInt16 mnLoopControlStage;
public:
SwLooping( SwPageFrm* pPage );
void Control( SwPageFrm* pPage );
@@ -74,7 +74,7 @@ public:
void CollectEndnote( SwFtnFrm* pFtn );
const SwSectionFrm* GetSect() { return pSect; }
void InsertEndnotes();
- BOOL HasEndnotes() const { return pEndArr && pEndArr->Count(); }
+ sal_Bool HasEndnotes() const { return pEndArr && pEndArr->Count(); }
};
void SwEndnoter::CollectEndnotes( SwSectionFrm* pSct )
@@ -122,7 +122,7 @@ void SwEndnoter::CollectEndnote( SwFtnFrm* pFtn )
}
else if( pEndArr )
{
- for ( USHORT i = 0; i < pEndArr->Count(); ++i )
+ for ( sal_uInt16 i = 0; i < pEndArr->Count(); ++i )
{
SwFtnFrm *pEndFtn = (SwFtnFrm*)((*pEndArr)[i]);
if( pEndFtn->GetAttr() == pFtn->GetAttr() )
@@ -179,7 +179,7 @@ void SwLooping::Control( SwPageFrm* pPage )
{
if( !pPage )
return;
- USHORT nNew = pPage->GetPhyPageNum();
+ sal_uInt16 nNew = pPage->GetPhyPageNum();
if( nNew > nMaxPage )
nMaxPage = nNew;
if( nNew < nMinPage )
@@ -200,7 +200,7 @@ void SwLooping::Control( SwPageFrm* pPage )
{
#ifdef DBG_UTIL
#if OSL_DEBUG_LEVEL > 1
- static BOOL bNoLouie = FALSE;
+ static sal_Bool bNoLouie = sal_False;
if( bNoLouie )
return;
#endif
@@ -266,7 +266,7 @@ void SwLayouter::_CollectEndnotes( SwSectionFrm* pSect )
pEndnoter->CollectEndnotes( pSect );
}
-BOOL SwLayouter::HasEndnotes() const
+sal_Bool SwLayouter::HasEndnotes() const
{
return pEndnoter->HasEndnotes();
}
@@ -283,7 +283,7 @@ void SwLayouter::InsertEndnotes( SwSectionFrm* pSect )
pEndnoter->InsertEndnotes();
}
-void SwLayouter::LoopControl( SwPageFrm* pPage, BYTE )
+void SwLayouter::LoopControl( SwPageFrm* pPage, sal_uInt8 )
{
ASSERT( pLooping, "Looping: Lost control" );
pLooping->Control( pPage );
@@ -300,12 +300,12 @@ void SwLayouter::LoopingLouieLight( const SwDoc& rDoc, const SwTxtFrm& rFrm )
}
}
-BOOL SwLayouter::StartLooping( SwPageFrm* pPage )
+sal_Bool SwLayouter::StartLooping( SwPageFrm* pPage )
{
if( pLooping )
- return FALSE;
+ return sal_False;
pLooping = new SwLooping( pPage );
- return TRUE;
+ return sal_True;
}
void SwLayouter::EndLoopControl()
@@ -322,10 +322,10 @@ void SwLayouter::CollectEndnotes( SwDoc* pDoc, SwSectionFrm* pSect )
pDoc->GetLayouter()->_CollectEndnotes( pSect );
}
-BOOL SwLayouter::Collecting( SwDoc* pDoc, SwSectionFrm* pSect, SwFtnFrm* pFtn )
+sal_Bool SwLayouter::Collecting( SwDoc* pDoc, SwSectionFrm* pSect, SwFtnFrm* pFtn )
{
if( !pDoc->GetLayouter() )
- return FALSE;
+ return sal_False;
SwLayouter *pLayouter = pDoc->GetLayouter();
if( pLayouter->pEndnoter && pLayouter->pEndnoter->GetSect() && pSect &&
( pLayouter->pEndnoter->GetSect()->IsAnFollow( pSect ) ||
@@ -333,12 +333,12 @@ BOOL SwLayouter::Collecting( SwDoc* pDoc, SwSectionFrm* pSect, SwFtnFrm* pFtn )
{
if( pFtn )
pLayouter->CollectEndnote( pFtn );
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
-BOOL SwLayouter::StartLoopControl( SwDoc* pDoc, SwPageFrm *pPage )
+sal_Bool SwLayouter::StartLoopControl( SwDoc* pDoc, SwPageFrm *pPage )
{
ASSERT( pDoc, "No doc, no fun" );
if( !pDoc->GetLayouter() )
diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx
index 1daf7f8554f8..45d524b5a822 100644
--- a/sw/source/core/layout/newfrm.cxx
+++ b/sw/source/core/layout/newfrm.cxx
@@ -57,8 +57,8 @@
#include <viewopt.hxx>
SwLayVout *SwRootFrm::pVout = 0;
-BOOL SwRootFrm::bInPaint = FALSE;
-BOOL SwRootFrm::bNoVirDev = FALSE;
+sal_Bool SwRootFrm::bInPaint = sal_False;
+sal_Bool SwRootFrm::bNoVirDev = sal_False;
SwCache *SwFrm::pCache = 0;
@@ -321,7 +321,7 @@ void _FrmFinit()
{
#ifdef DBG_UTIL
// im Chache duerfen nur noch 0-Pointer stehen
- for( USHORT n = SwFrm::GetCachePtr()->Count(); n; )
+ for( sal_uInt16 n = SwFrm::GetCachePtr()->Count(); n; )
if( (*SwFrm::GetCachePtr())[ --n ] )
{
SwCacheObj* pObj = (*SwFrm::GetCachePtr())[ n ];
@@ -394,7 +394,7 @@ void SwRootFrm::DeRegisterShell( ViewShell *pSh )
pWaitingCurrShell = 0;
//Referenzen entfernen.
- for ( USHORT i = 0; i < pCurrShells->Count(); ++i )
+ for ( sal_uInt16 i = 0; i < pCurrShells->Count(); ++i )
{
CurrShell *pC = (*pCurrShells)[i];
if (pC->pPrev == pSh)
@@ -444,9 +444,14 @@ SwRootFrm::SwRootFrm( SwFrmFmt *pFmt, ViewShell * pSh ) :
nAccessibleShells( 0 )
{
nType = FRMC_ROOT;
+<<<<<<< local
bIdleFormat = bTurboAllowed = bAssertFlyPages = bIsNewLayout = TRUE;
bCheckSuperfluous = bBrowseWidthValid = FALSE;
setRootFrm( this );
+=======
+ bIdleFormat = bTurboAllowed = bAssertFlyPages = bIsNewLayout = sal_True;
+ bCheckSuperfluous = bBrowseWidthValid = sal_False;
+>>>>>>> other
InitCurrShells( this );
@@ -455,8 +460,13 @@ SwRootFrm::SwRootFrm( SwFrmFmt *pFmt, ViewShell * pSh ) :
IDocumentFieldsAccess *pFieldsAccess = pFmt->getIDocumentFieldsAccess();
const IDocumentSettingAccess *pSettingAccess = pFmt->getIDocumentSettingAccess();
pTimerAccess->StopIdling();
+<<<<<<< local
pLayoutAccess->SetCurrentViewShell( this->GetCurrShell() ); //Fuer das Erzeugen der Flys durch MakeFrms() //swmod 071108//swmod 071225
bCallbackActionEnabled = FALSE; //vor Verlassen auf TRUE setzen!
+=======
+ pLayoutAccess->SetRootFrm( this ); //Fuer das Erzeugen der Flys durch MakeFrms()
+ bCallbackActionEnabled = sal_False; //vor Verlassen auf sal_True setzen!
+>>>>>>> other
SdrModel *pMd = pFmt->getIDocumentDrawModelAccess()->GetDrawModel();
if ( pMd )
@@ -476,7 +486,7 @@ SwRootFrm::SwRootFrm( SwFrmFmt *pFmt, ViewShell * pSh ) :
SwDoc* pDoc = pFmt->GetDoc();
SwNodeIndex aIndex( *pDoc->GetNodes().GetEndOfContent().StartOfSectionNode() );
- SwCntntNode *pNode = pDoc->GetNodes().GoNextSection( &aIndex, TRUE, FALSE );
+ SwCntntNode *pNode = pDoc->GetNodes().GoNextSection( &aIndex, sal_True, sal_False );
// --> FME 2005-05-25 #123067# pNode = 0 can really happen:
SwTableNode *pTblNd= pNode ? pNode->FindTableNode() : 0;
// <--
@@ -484,7 +494,7 @@ SwRootFrm::SwRootFrm( SwFrmFmt *pFmt, ViewShell * pSh ) :
//PageDesc besorgen (entweder vom FrmFmt des ersten Node oder den
//initialen.)
SwPageDesc *pDesc = 0;
- USHORT nPgNum = 1;
+ sal_uInt16 nPgNum = 1;
if ( pTblNd )
{
@@ -501,14 +511,14 @@ SwRootFrm::SwRootFrm( SwFrmFmt *pFmt, ViewShell * pSh ) :
bIsVirtPageNum = 0 != ( nPgNum = rDesc.GetNumOffset() );
}
else
- bIsVirtPageNum = FALSE;
+ bIsVirtPageNum = sal_False;
if ( !pDesc )
pDesc = (SwPageDesc*)
&const_cast<const SwDoc *>(pDoc)->GetPageDesc( 0 );
- const BOOL bOdd = !nPgNum || 0 != ( nPgNum % 2 );
+ const sal_Bool bOdd = !nPgNum || 0 != ( nPgNum % 2 );
//Eine Seite erzeugen und in das Layout stellen
- SwPageFrm *pPage = ::InsertNewPage( *pDesc, this, bOdd, FALSE, FALSE, 0 );
+ SwPageFrm *pPage = ::InsertNewPage( *pDesc, this, bOdd, sal_False, sal_False, 0 );
//Erstes Blatt im Bodytext-Bereich suchen.
SwLayoutFrm *pLay = pPage->FindBodyCont();
@@ -516,7 +526,7 @@ SwRootFrm::SwRootFrm( SwFrmFmt *pFmt, ViewShell * pSh ) :
pLay = (SwLayoutFrm*)pLay->Lower();
SwNodeIndex aTmp( *pDoc->GetNodes().GetEndOfContent().StartOfSectionNode(), 1 );
- ::_InsertCnt( pLay, pDoc, aTmp.GetIndex(), TRUE );
+ ::_InsertCnt( pLay, pDoc, aTmp.GetIndex(), sal_True );
//Noch nicht ersetzte Master aus der Liste entfernen.
RemoveMasterObjs( pDrawPage );
if( pSettingAccess->get(IDocumentSettingAccess::GLOBAL_DOCUMENT) )
@@ -531,7 +541,7 @@ SwRootFrm::SwRootFrm( SwFrmFmt *pFmt, ViewShell * pSh ) :
// <---
pTimerAccess->StartIdling();
- bCallbackActionEnabled = TRUE;
+ bCallbackActionEnabled = sal_True;
ViewShell *pViewSh = GetCurrShell();
if (pViewSh)
@@ -551,7 +561,7 @@ SwRootFrm::SwRootFrm( SwFrmFmt *pFmt, ViewShell * pSh ) :
SwRootFrm::~SwRootFrm()
{
- bTurboAllowed = FALSE;
+ bTurboAllowed = sal_False;
pTurbo = 0;
if(pBlink)
pBlink->FrmDelete( this );
@@ -560,7 +570,7 @@ SwRootFrm::~SwRootFrm()
pDestroy = 0;
//Referenzen entfernen.
- for ( USHORT i = 0; i < pCurrShells->Count(); ++i )
+ for ( sal_uInt16 i = 0; i < pCurrShells->Count(); ++i )
(*pCurrShells)[i]->pRoot = 0;
delete pCurrShells;
@@ -581,7 +591,7 @@ SwRootFrm::~SwRootFrm()
void SwRootFrm::RemoveMasterObjs( SdrPage *pPg )
{
//Alle Masterobjekte aus der Page entfernen. Nicht loeschen!!
- for( ULONG i = pPg ? pPg->GetObjCount() : 0; i; )
+ for( sal_uLong i = pPg ? pPg->GetObjCount() : 0; i; )
{
SdrObject* pObj = pPg->GetObj( --i );
if( pObj->ISA(SwFlyDrawObj ) )
diff --git a/sw/source/core/layout/objectformatter.cxx b/sw/source/core/layout/objectformatter.cxx
index a8b7503c6042..36b3c186d68a 100644
--- a/sw/source/core/layout/objectformatter.cxx
+++ b/sw/source/core/layout/objectformatter.cxx
@@ -357,8 +357,8 @@ void SwObjectFormatter::_FormatObj( SwAnchoredObject& _rAnchoredObj )
// <--
// FME 2007-08-30 #i81146# new loop control
- USHORT nLoopControlRuns = 0;
- const USHORT nLoopControlMax = 15;
+ sal_uInt16 nLoopControlRuns = 0;
+ const sal_uInt16 nLoopControlMax = 15;
do {
if ( mpLayAction )
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index d1aeafd66091..9d4ecc991a7f 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -136,13 +136,13 @@ void SwBodyFrm::Format( const SwBorderAttrs * )
Frm().Width( nWidth );
}
- BOOL bNoGrid = TRUE;
+ sal_Bool bNoGrid = sal_True;
if( GetUpper()->IsPageFrm() && ((SwPageFrm*)GetUpper())->HasGrid() )
{
GETGRID( ((SwPageFrm*)GetUpper()) )
if( pGrid )
{
- bNoGrid = FALSE;
+ bNoGrid = sal_False;
long nSum = pGrid->GetBaseHeight() + pGrid->GetRubyHeight();
SWRECTFN( this )
long nSize = (Frm().*fnRect->fnGetWidth)();
@@ -185,7 +185,7 @@ void SwBodyFrm::Format( const SwBorderAttrs * )
Prt().Height( Frm().Height() );
Prt().Width( Frm().Width() );
}
- bValidSize = bValidPrtArea = TRUE;
+ bValidSize = bValidPrtArea = sal_True;
}
/*************************************************************************
@@ -204,22 +204,22 @@ SwPageFrm::SwPageFrm( SwFrmFmt *pFmt, SwFrm* pSib, SwPageDesc *pPgDsc ) :
// OD 2004-05-17 #i28701#
mbLayoutInProgress( false )
{
- SetDerivedVert( FALSE );
- SetDerivedR2L( FALSE );
+ SetDerivedVert( sal_False );
+ SetDerivedR2L( sal_False );
if( pDesc )
{
- bHasGrid = TRUE;
+ bHasGrid = sal_True;
GETGRID( this )
if( !pGrid )
- bHasGrid = FALSE;
+ bHasGrid = sal_False;
}
else
- bHasGrid = FALSE;
+ bHasGrid = sal_False;
SetMaxFtnHeight( pPgDsc->GetFtnInfo().GetHeight() ?
pPgDsc->GetFtnInfo().GetHeight() : LONG_MAX ),
nType = FRMC_PAGE;
- bInvalidLayout = bInvalidCntnt = bInvalidSpelling = bInvalidSmartTags = bInvalidAutoCmplWrds = bInvalidWordCount = TRUE;
- bInvalidFlyLayout = bInvalidFlyCntnt = bInvalidFlyInCnt = bFtnPage = bEndNotePage = FALSE;
+ bInvalidLayout = bInvalidCntnt = bInvalidSpelling = bInvalidSmartTags = bInvalidAutoCmplWrds = bInvalidWordCount = sal_True;
+ bInvalidFlyLayout = bInvalidFlyCntnt = bInvalidFlyInCnt = bFtnPage = bEndNotePage = sal_False;
ViewShell *pSh = getRootFrm()->GetCurrShell();
const bool bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode();
@@ -237,9 +237,9 @@ SwPageFrm::SwPageFrm( SwFrmFmt *pFmt, SwFrm* pSib, SwPageDesc *pPgDsc ) :
//Body-Bereich erzeugen und einsetzen, aber nur wenn ich nicht gerade
//eine Leerseite bin.
SwDoc *pDoc = pFmt->GetDoc();
- if ( FALSE == (bEmptyPage = pFmt == pDoc->GetEmptyPageFmt()) )
+ if ( sal_False == (bEmptyPage = pFmt == pDoc->GetEmptyPageFmt()) )
{
- bEmptyPage = FALSE;
+ bEmptyPage = sal_False;
Calc(); //Damit die PrtArea stimmt.
SwBodyFrm *pBodyFrm = new SwBodyFrm( pDoc->GetDfltFrmFmt(), this );
pBodyFrm->ChgSize( Prt().SSize() );
@@ -276,7 +276,7 @@ SwPageFrm::~SwPageFrm()
//Objekte koennen (warum auch immer) auch an Seiten verankert sein,
//die vor Ihren Ankern stehen. Dann wuerde auf bereits freigegebenen
//Speicher zugegriffen.
- for ( USHORT i = 0; i < pSortedObjs->Count(); ++i )
+ for ( sal_uInt16 i = 0; i < pSortedObjs->Count(); ++i )
{
SwAnchoredObject* pAnchoredObj = (*pSortedObjs)[i];
pAnchoredObj->SetPageFrm( 0L );
@@ -310,10 +310,10 @@ SwPageFrm::~SwPageFrm()
}
-void SwPageFrm::CheckGrid( BOOL bInvalidate )
+void SwPageFrm::CheckGrid( sal_Bool bInvalidate )
{
- BOOL bOld = bHasGrid;
- bHasGrid = TRUE;
+ sal_Bool bOld = bHasGrid;
+ bHasGrid = sal_True;
GETGRID( this )
bHasGrid = 0 != pGrid;
if( bInvalidate || bOld != bHasGrid )
@@ -334,9 +334,9 @@ void SwPageFrm::CheckGrid( BOOL bInvalidate )
}
-void SwPageFrm::CheckDirection( BOOL bVert )
+void SwPageFrm::CheckDirection( sal_Bool bVert )
{
- UINT16 nDir =
+ sal_uInt16 nDir =
((SvxFrameDirectionItem&)GetFmt()->GetFmtAttr( RES_FRAMEDIR )).GetValue();
if( bVert )
{
@@ -394,7 +394,7 @@ void MA_FASTCALL lcl_MakeObjs( const SwSpzFrmFmts &rTbl, SwPageFrm *pPage )
//Die Formate stehen in der SpzTbl (vom Dokument).
//Flys werden angelegt, DrawObjekte werden bei der Seite angemeldet.
- for ( USHORT i = 0; i < rTbl.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rTbl.Count(); ++i )
{
SdrObject *pSdrObj;
SwFrmFmt *pFmt = rTbl[i];
@@ -414,11 +414,11 @@ void MA_FASTCALL lcl_MakeObjs( const SwSpzFrmFmts &rTbl, SwPageFrm *pPage )
}
//Wird ein Rahmen oder ein SdrObject beschrieben?
- BOOL bSdrObj = RES_DRAWFRMFMT == pFmt->Which();
+ sal_Bool bSdrObj = RES_DRAWFRMFMT == pFmt->Which();
pSdrObj = 0;
if ( bSdrObj && 0 == (pSdrObj = pFmt->FindSdrObject()) )
{
- ASSERT( FALSE, "DrawObject not found." );
+ ASSERT( sal_False, "DrawObject not found." );
pFmt->GetDoc()->DelFrmFmt( pFmt );
--i;
continue;
@@ -471,7 +471,7 @@ void MA_FASTCALL lcl_MakeObjs( const SwSpzFrmFmts &rTbl, SwPageFrm *pPage )
}
}
-void SwPageFrm::PreparePage( BOOL bFtn )
+void SwPageFrm::PreparePage( sal_Bool bFtn )
{
SetFtnPage( bFtn );
@@ -533,7 +533,7 @@ void SwPageFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
ViewShell *pSh = getRootFrm()->GetCurrShell();
if ( pSh )
pSh->SetFirstVisPageInvalid();
- BYTE nInvFlags = 0;
+ sal_uInt8 nInvFlags = 0;
if( pNew && RES_ATTRSET_CHG == pNew->Which() )
{
@@ -541,7 +541,7 @@ void SwPageFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
SfxItemIter aOIter( *((SwAttrSetChg*)pOld)->GetChgSet() );
SwAttrSetChg aOldSet( *(SwAttrSetChg*)pOld );
SwAttrSetChg aNewSet( *(SwAttrSetChg*)pNew );
- while( TRUE )
+ while( sal_True )
{
_UpdateAttr( (SfxPoolItem*)aOIter.GetCurItem(),
(SfxPoolItem*)aNIter.GetCurItem(), nInvFlags,
@@ -575,12 +575,17 @@ void SwPageFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
}
}
+<<<<<<< local
void SwPageFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
BYTE &rInvFlags,
+=======
+void SwPageFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew,
+ sal_uInt8 &rInvFlags,
+>>>>>>> other
SwAttrSetChg *pOldSet, SwAttrSetChg *pNewSet )
{
- BOOL bClear = TRUE;
- const USHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
+ sal_Bool bClear = sal_True;
+ const sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
switch( nWhich )
{
case RES_FMT_CHG:
@@ -623,7 +628,7 @@ void SwPageFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
ViewShell *pSh = getRootFrm()->GetCurrShell();
if( pSh && pSh->GetViewOptions()->getBrowseMode() )
{
- bValidSize = FALSE;
+ bValidSize = sal_False;
// OD 28.10.2002 #97265# - Don't call <SwPageFrm::MakeAll()>
// Calculation of the page is not necessary, because its size is
// is invalidated here and further invalidation is done in the
@@ -692,14 +697,14 @@ void SwPageFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
SetMaxFtnHeight( LONG_MAX );
SetColMaxFtnHeight();
//Hier wird die Seite ggf. zerstoert!
- ((SwRootFrm*)GetUpper())->RemoveFtns( 0, FALSE, TRUE );
+ ((SwRootFrm*)GetUpper())->RemoveFtns( 0, sal_False, sal_True );
break;
case RES_FRAMEDIR :
CheckDirChange();
break;
default:
- bClear = FALSE;
+ bClear = sal_False;
}
if ( bClear )
{
@@ -725,14 +730,14 @@ void SwPageFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
|*
*************************************************************************/
// erfrage vom Modify Informationen
-BOOL SwPageFrm::GetInfo( SfxPoolItem & rInfo ) const
+sal_Bool SwPageFrm::GetInfo( SfxPoolItem & rInfo ) const
{
if( RES_AUTOFMT_DOCNODE == rInfo.Which() )
{
// es gibt einen PageFrm also wird er benutzt
- return FALSE;
+ return sal_False;
}
- return TRUE; // weiter suchen
+ return sal_True; // weiter suchen
}
/*************************************************************************
@@ -841,8 +846,8 @@ SwPageDesc *SwPageFrm::FindPageDesc()
//Wenn der RootFrm seine Groesse aendert muss benachrichtigt werden.
void AdjustSizeChgNotify( SwRootFrm *pRoot )
{
- const BOOL bOld = pRoot->IsSuperfluous();
- pRoot->bCheckSuperfluous = FALSE;
+ const sal_Bool bOld = pRoot->IsSuperfluous();
+ pRoot->bCheckSuperfluous = sal_False;
ViewShell *pSh = pRoot->GetCurrShell();
if ( pSh )
{
@@ -889,7 +894,7 @@ void SwPageFrm::Cut()
if ( GetSortedObjs() )
{
for ( int i = 0; GetSortedObjs() &&
- (USHORT)i < GetSortedObjs()->Count(); ++i )
+ (sal_uInt16)i < GetSortedObjs()->Count(); ++i )
{
// --> OD 2004-06-29 #i28701#
SwAnchoredObject* pAnchoredObj = (*GetSortedObjs())[i];
@@ -1004,7 +1009,7 @@ void lcl_PrepFlyInCntRegister( SwCntntFrm *pFrm )
pFrm->Prepare( PREP_REGISTER );
if( pFrm->GetDrawObjs() )
{
- for( USHORT i = 0; i < pFrm->GetDrawObjs()->Count(); ++i )
+ for( sal_uInt16 i = 0; i < pFrm->GetDrawObjs()->Count(); ++i )
{
// --> OD 2004-06-29 #i28701#
SwAnchoredObject* pAnchoredObj = (*pFrm->GetDrawObjs())[i];
@@ -1035,7 +1040,7 @@ void SwPageFrm::PrepareRegisterChg()
}
if( GetSortedObjs() )
{
- for( USHORT i = 0; i < GetSortedObjs()->Count(); ++i )
+ for( sal_uInt16 i = 0; i < GetSortedObjs()->Count(); ++i )
{
// --> OD 2004-06-29 #i28701#
SwAnchoredObject* pAnchoredObj = (*GetSortedObjs())[i];
@@ -1066,7 +1071,7 @@ void SwPageFrm::PrepareRegisterChg()
|* Letzte Aenderung MA 18. Apr. 96
|*
|*************************************************************************/
-void SwFrm::CheckPageDescs( SwPageFrm *pStart, BOOL bNotifyFields )
+void SwFrm::CheckPageDescs( SwPageFrm *pStart, sal_Bool bNotifyFields )
{
ASSERT( pStart, "Keine Startpage." );
@@ -1085,7 +1090,7 @@ void SwFrm::CheckPageDescs( SwPageFrm *pStart, BOOL bNotifyFields )
SwRootFrm *pRoot = (SwRootFrm*)pStart->GetUpper();
SwDoc* pDoc = pStart->GetFmt()->GetDoc();
- const BOOL bFtns = 0 != pDoc->GetFtnIdxs().Count();
+ const sal_Bool bFtns = 0 != pDoc->GetFtnIdxs().Count();
SwPageFrm *pPage = pStart;
if( pPage->GetPrev() && ((SwPageFrm*)pPage->GetPrev())->IsEmptyPage() )
@@ -1094,9 +1099,9 @@ void SwFrm::CheckPageDescs( SwPageFrm *pStart, BOOL bNotifyFields )
{
//gewuenschten PageDesc und FrmFmt festellen.
SwPageDesc *pDesc = pPage->FindPageDesc();
- BOOL bCheckEmpty = pPage->IsEmptyPage();
- BOOL bActOdd = pPage->OnRightPage();
- BOOL bOdd = pPage->WannaRightPage();
+ sal_Bool bCheckEmpty = pPage->IsEmptyPage();
+ sal_Bool bActOdd = pPage->OnRightPage();
+ sal_Bool bOdd = pPage->WannaRightPage();
SwFrmFmt *pFmtWish = bOdd ? pDesc->GetRightFmt()
: pDesc->GetLeftFmt();
@@ -1163,7 +1168,7 @@ void SwFrm::CheckPageDescs( SwPageFrm *pStart, BOOL bNotifyFields )
pDesc = ((SwPageFrm*)pPage->GetPrev())->GetPageDesc();
SwPageFrm *pTmp = new SwPageFrm( pDoc->GetEmptyPageFmt(),pRoot,pDesc);
pTmp->Paste( pRoot, pPage );
- pTmp->PreparePage( FALSE );
+ pTmp->PreparePage( sal_False );
pPage = pTmp;
}
else if ( pPage->GetPageDesc() != pDesc ) //4.
@@ -1198,7 +1203,7 @@ void SwFrm::CheckPageDescs( SwPageFrm *pStart, BOOL bNotifyFields )
#ifdef DBG_UTIL
else
{
- ASSERT( FALSE, "CheckPageDescs, missing solution" );
+ ASSERT( sal_False, "CheckPageDescs, missing solution" );
}
#endif
}
@@ -1243,7 +1248,7 @@ void SwFrm::CheckPageDescs( SwPageFrm *pStart, BOOL bNotifyFields )
//1. Keine zwei EmptyPages hintereinander.
//2. Alle PageDescs richtig?
- BOOL bEmpty = FALSE;
+ sal_Bool bEmpty = sal_False;
SwPageFrm *pPg = pStart;
while ( pPg )
{
@@ -1251,13 +1256,13 @@ void SwFrm::CheckPageDescs( SwPageFrm *pStart, BOOL bNotifyFields )
{
if ( bEmpty )
{
- ASSERT( FALSE, "Doppelte Leerseiten." );
+ ASSERT( sal_False, "Doppelte Leerseiten." );
break; //Einmal reicht.
}
- bEmpty = TRUE;
+ bEmpty = sal_True;
}
else
- bEmpty = FALSE;
+ bEmpty = sal_False;
//MA 21. Jun. 95: Kann zu testzwecken 'rein, ist aber bei zyklen durchaus
//moeglich: Ein paar Seiten, auf der ersten 'erste Seite' anwenden,
@@ -1280,7 +1285,7 @@ void SwFrm::CheckPageDescs( SwPageFrm *pStart, BOOL bNotifyFields )
|* Letzte Aenderung MA 27. Jul. 93
|*
|*************************************************************************/
-SwPageFrm *SwFrm::InsertPage( SwPageFrm *pPrevPage, BOOL bFtn )
+SwPageFrm *SwFrm::InsertPage( SwPageFrm *pPrevPage, sal_Bool bFtn )
{
SwRootFrm *pRoot = (SwRootFrm*)pPrevPage->GetUpper();
SwPageFrm *pSibling = (SwPageFrm*)pRoot->GetLower();
@@ -1288,8 +1293,8 @@ SwPageFrm *SwFrm::InsertPage( SwPageFrm *pPrevPage, BOOL bFtn )
pSibling = (SwPageFrm*)pPrevPage->GetNext();
//Rechte (ungerade) oder linke (gerade) Seite einfuegen?
- BOOL bNextOdd = !pPrevPage->OnRightPage();
- BOOL bWishedOdd = bNextOdd;
+ sal_Bool bNextOdd = !pPrevPage->OnRightPage();
+ sal_Bool bWishedOdd = bNextOdd;
//Welcher PageDesc gilt?
//Bei CntntFrm der aus dem Format wenn einer angegeben ist,
@@ -1300,9 +1305,9 @@ SwPageFrm *SwFrm::InsertPage( SwPageFrm *pPrevPage, BOOL bFtn )
pDesc = rDesc.GetPageDesc();
if ( rDesc.GetNumOffset() )
{
- bWishedOdd = rDesc.GetNumOffset() % 2 ? TRUE : FALSE;
+ bWishedOdd = rDesc.GetNumOffset() % 2 ? sal_True : sal_False;
//Die Gelegenheit nutzen wir um das Flag an der Root zu pflegen.
- pRoot->SetVirtPageNum( TRUE );
+ pRoot->SetVirtPageNum( sal_True );
}
}
if ( !pDesc )
@@ -1314,7 +1319,7 @@ SwPageFrm *SwFrm::InsertPage( SwPageFrm *pPrevPage, BOOL bFtn )
SwDoc *pDoc = pPrevPage->GetFmt()->GetDoc();
SwFrmFmt *pFmt;
- BOOL bCheckPages = FALSE;
+ sal_Bool bCheckPages = sal_False;
//Wenn ich kein FrmFmt fuer die Seite gefunden habe, muss ich eben eine
//Leerseite einfuegen.
if( bWishedOdd != bNextOdd )
@@ -1331,12 +1336,12 @@ SwPageFrm *SwFrm::InsertPage( SwPageFrm *pPrevPage, BOOL bFtn )
SwPageFrm *pDel = pSibling;
pSibling = (SwPageFrm*)pSibling->GetNext();
if ( pDoc->GetFtnIdxs().Count() )
- pRoot->RemoveFtns( pDel, TRUE );
+ pRoot->RemoveFtns( pDel, sal_True );
pDel->Cut();
delete pDel;
}
else
- bCheckPages = TRUE;
+ bCheckPages = sal_True;
}
pFmt = bWishedOdd ? pDesc->GetRightFmt() : pDesc->GetLeftFmt();
ASSERT( pFmt, "Descriptor without format." );
@@ -1351,23 +1356,28 @@ SwPageFrm *SwFrm::InsertPage( SwPageFrm *pPrevPage, BOOL bFtn )
SwPageFrm *pDel = pSibling;
pSibling = (SwPageFrm*)pSibling->GetNext();
if ( pDoc->GetFtnIdxs().Count() )
- pRoot->RemoveFtns( pDel, TRUE );
+ pRoot->RemoveFtns( pDel, sal_True );
pDel->Cut();
delete pDel;
}
else
- bCheckPages = TRUE;
+ bCheckPages = sal_True;
if ( pSibling )
{
if ( bCheckPages )
{
+<<<<<<< local
CheckPageDescs( pSibling, FALSE );
ViewShell *pSh = getRootFrm()->GetCurrShell();
+=======
+ CheckPageDescs( pSibling, sal_False );
+ ViewShell *pSh = GetShell();
+>>>>>>> other
SwViewImp *pImp = pSh ? pSh->Imp() : 0;
if ( pImp && pImp->IsAction() && !pImp->GetLayAction().IsCheckPages() )
{
- const USHORT nNum = pImp->GetLayAction().GetCheckPageNum();
+ const sal_uInt16 nNum = pImp->GetLayAction().GetCheckPageNum();
if ( nNum == pPrevPage->GetPhyPageNum() + 1 )
pImp->GetLayAction().SetCheckPageNumDirect(
pSibling->GetPhyPageNum() );
@@ -1417,7 +1427,7 @@ sw::sidebarwindows::SidebarPosition SwPageFrm::SidebarPosition() const
|*
|*************************************************************************/
-SwTwips SwRootFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL )
+SwTwips SwRootFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool )
{
if ( !bTst )
Frm().SSize().Height() += nDist;
@@ -1431,7 +1441,7 @@ SwTwips SwRootFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL )
|* Letzte Aenderung MA 05. May. 94
|*
|*************************************************************************/
-SwTwips SwRootFrm::ShrinkFrm( SwTwips nDist, BOOL bTst, BOOL )
+SwTwips SwRootFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool )
{
ASSERT( nDist >= 0, "nDist < 0." );
ASSERT( nDist <= Frm().Height(), "nDist > als aktuelle Groesse." );
@@ -1464,7 +1474,7 @@ void SwRootFrm::RemoveSuperfluous()
{
if ( !IsSuperfluous() )
return;
- bCheckSuperfluous = FALSE;
+ bCheckSuperfluous = sal_False;
SwPageFrm *pPage = GetLastPage();
long nDocPos = LONG_MAX;
@@ -1483,7 +1493,7 @@ void SwRootFrm::RemoveSuperfluous()
// header/footer are supported now.
bool bOnlySuperfluosObjs = true;
SwSortedObjs &rObjs = *pPage->GetSortedObjs();
- for ( USHORT i = 0; bOnlySuperfluosObjs && i < rObjs.Count(); ++i )
+ for ( sal_uInt16 i = 0; bOnlySuperfluosObjs && i < rObjs.Count(); ++i )
{
// --> OD 2004-06-29 #i28701#
SwAnchoredObject* pAnchoredObj = rObjs[i];
@@ -1533,7 +1543,7 @@ void SwRootFrm::RemoveSuperfluous()
SwPageFrm *pEmpty = pPage;
pPage = (SwPageFrm*)pPage->GetPrev();
if ( GetFmt()->GetDoc()->GetFtnIdxs().Count() )
- RemoveFtns( pEmpty, TRUE );
+ RemoveFtns( pEmpty, sal_True );
pEmpty->Cut();
delete pEmpty;
nDocPos = pPage ? pPage->Frm().Top() : 0;
@@ -1565,14 +1575,14 @@ void SwRootFrm::AssertFlyPages()
{
if ( !IsAssertFlyPages() )
return;
- bAssertFlyPages = FALSE;
+ bAssertFlyPages = sal_False;
SwDoc *pDoc = GetFmt()->GetDoc();
const SwSpzFrmFmts *pTbl = pDoc->GetSpzFrmFmts();
//Auf welche Seite will der 'letzte' Fly?
- USHORT nMaxPg = 0;
- USHORT i;
+ sal_uInt16 nMaxPg = 0;
+ sal_uInt16 i;
for ( i = 0; i < pTbl->Count(); ++i )
{
@@ -1592,7 +1602,7 @@ void SwRootFrm::AssertFlyPages()
{
//Die Seiten werden ausgehend von der letzten Seite konsequent
//nach den Regeln der PageDescs weitergefuehrt.
- BOOL bOdd = pPage->GetPhyPageNum() % 2 ? TRUE : FALSE;
+ sal_Bool bOdd = pPage->GetPhyPageNum() % 2 ? sal_True : sal_False;
SwPageDesc *pDesc = pPage->GetPageDesc();
SwFrm *pSibling = pPage->GetNext();
for ( i = pPage->GetPhyPageNum(); i < nMaxPg; ++i )
@@ -1603,16 +1613,16 @@ void SwRootFrm::AssertFlyPages()
//der naechsten Seite aufgenommen!
pPage = new SwPageFrm( pDoc->GetEmptyPageFmt(), this, pDesc );
pPage->Paste( this, pSibling );
- pPage->PreparePage( FALSE );
- bOdd = bOdd ? FALSE : TRUE;
+ pPage->PreparePage( sal_False );
+ bOdd = bOdd ? sal_False : sal_True;
++i;
}
pPage = new
SwPageFrm( (bOdd ? pDesc->GetRightFmt() :
pDesc->GetLeftFmt()), this, pDesc );
pPage->Paste( this, pSibling );
- pPage->PreparePage( FALSE );
- bOdd = bOdd ? FALSE : TRUE;
+ pPage->PreparePage( sal_False );
+ bOdd = bOdd ? sal_False : sal_True;
pDesc = pDesc->GetFollow();
}
//Jetzt koennen die Endnotenseiten natuerlich wieder krumm sein;
@@ -1629,7 +1639,7 @@ void SwRootFrm::AssertFlyPages()
bOdd = pPage->OnRightPage();
if ( pPage->GetFmt() !=
(bOdd ? pTmpDesc->GetRightFmt() : pTmpDesc->GetLeftFmt()) )
- RemoveFtns( pPage, FALSE, TRUE );
+ RemoveFtns( pPage, sal_False, sal_True );
}
}
}
@@ -1655,13 +1665,13 @@ void SwRootFrm::AssertPageFlys( SwPageFrm *pPage )
{
pPage->GetSortedObjs();
for ( int i = 0;
- pPage->GetSortedObjs() && USHORT(i) < pPage->GetSortedObjs()->Count();
+ pPage->GetSortedObjs() && sal_uInt16(i) < pPage->GetSortedObjs()->Count();
++i)
{
// --> OD 2004-06-29 #i28701#
SwFrmFmt& rFmt = (*pPage->GetSortedObjs())[i]->GetFrmFmt();
const SwFmtAnchor &rAnch = rFmt.GetAnchor();
- const USHORT nPg = rAnch.GetPageNum();
+ const sal_uInt16 nPg = rAnch.GetPageNum();
if ((rAnch.GetAnchorId() == FLY_AT_PAGE) &&
nPg != pPage->GetPhyPageNum() )
{
@@ -1703,7 +1713,7 @@ Size SwRootFrm::ChgSize( const Size& aNewSize )
{
Frm().SSize() = aNewSize;
_InvalidatePrt();
- bFixSize = FALSE;
+ bFixSize = sal_False;
return Frm().SSize();
}
@@ -1718,17 +1728,17 @@ Size SwRootFrm::ChgSize( const Size& aNewSize )
void SwRootFrm::MakeAll()
{
if ( !bValidPos )
- { bValidPos = TRUE;
+ { bValidPos = sal_True;
aFrm.Pos().X() = aFrm.Pos().Y() = DOCUMENTBORDER;
}
if ( !bValidPrtArea )
- { bValidPrtArea = TRUE;
+ { bValidPrtArea = sal_True;
aPrt.Pos().X() = aPrt.Pos().Y() = 0;
aPrt.SSize( aFrm.SSize() );
}
if ( !bValidSize )
//SSize wird von den Seiten (Cut/Paste) eingestellt.
- bValidSize = TRUE;
+ bValidSize = sal_True;
}
/*************************************************************************
@@ -1741,7 +1751,7 @@ void SwRootFrm::MakeAll()
|*************************************************************************/
void SwRootFrm::ImplInvalidateBrowseWidth()
{
- bBrowseWidthValid = FALSE;
+ bBrowseWidthValid = sal_False;
SwFrm *pPg = Lower();
while ( pPg )
{
@@ -1777,8 +1787,13 @@ void SwRootFrm::ImplCalcBrowseWidth()
if ( !pFrm )
return;
+<<<<<<< local
bBrowseWidthValid = TRUE;
ViewShell *pSh = getRootFrm()->GetCurrShell();
+=======
+ bBrowseWidthValid = sal_True;
+ ViewShell *pSh = GetShell();
+>>>>>>> other
nBrowseWidth = pSh
? MINLAY + 2 * pSh->GetOut()->
PixelToLogic( pSh->GetBrowseBorder() ).Width()
@@ -1823,12 +1838,12 @@ void SwRootFrm::ImplCalcBrowseWidth()
}
else if ( pFrm->GetDrawObjs() )
{
- for ( USHORT i = 0; i < pFrm->GetDrawObjs()->Count(); ++i )
+ for ( sal_uInt16 i = 0; i < pFrm->GetDrawObjs()->Count(); ++i )
{
// --> OD 2004-06-29 #i28701#
SwAnchoredObject* pAnchoredObj = (*pFrm->GetDrawObjs())[i];
const SwFrmFmt& rFmt = pAnchoredObj->GetFrmFmt();
- const BOOL bFly = pAnchoredObj->ISA(SwFlyFrm);
+ const sal_Bool bFly = pAnchoredObj->ISA(SwFlyFrm);
if ((bFly && (WEIT_WECH == pAnchoredObj->GetObjRect().Width()))
|| rFmt.GetFrmSize().GetWidthPercent())
{
@@ -1908,13 +1923,13 @@ void SwRootFrm::StartAllAction()
} while ( pSh != GetCurrShell() );
}
-void SwRootFrm::EndAllAction( BOOL bVirDev )
+void SwRootFrm::EndAllAction( sal_Bool bVirDev )
{
ViewShell *pSh = GetCurrShell();
if ( pSh )
do
{
- const BOOL bOldEndActionByVirDev = pSh->IsEndActionByVirDev();
+ const sal_Bool bOldEndActionByVirDev = pSh->IsEndActionByVirDev();
pSh->SetEndActionByVirDev( bVirDev );
if ( pSh->ISA( SwCrsrShell ) )
{
@@ -1943,9 +1958,9 @@ void SwRootFrm::UnoRemoveAllActions()
if ( !pSh->IsInEndAction() )
{
DBG_ASSERT(!pSh->GetRestoreActions(), "Restore action count is already set!");
- BOOL bCrsr = pSh->ISA( SwCrsrShell );
- BOOL bFE = pSh->ISA( SwFEShell );
- USHORT nRestore = 0;
+ sal_Bool bCrsr = pSh->ISA( SwCrsrShell );
+ sal_Bool bFE = pSh->ISA( SwFEShell );
+ sal_uInt16 nRestore = 0;
while( pSh->ActionCount() )
{
if( bCrsr )
@@ -1962,7 +1977,7 @@ void SwRootFrm::UnoRemoveAllActions()
pSh->SetRestoreActions(nRestore);
}
// <--
- pSh->LockView(TRUE);
+ pSh->LockView(sal_True);
pSh = (ViewShell*)pSh->GetNext();
} while ( pSh != GetCurrShell() );
@@ -1974,7 +1989,7 @@ void SwRootFrm::UnoRestoreAllActions()
if ( pSh )
do
{
- USHORT nActions = pSh->GetRestoreActions();
+ sal_uInt16 nActions = pSh->GetRestoreActions();
while( nActions-- )
{
if ( pSh->ISA( SwCrsrShell ) )
@@ -1983,7 +1998,7 @@ void SwRootFrm::UnoRestoreAllActions()
pSh->StartAction();
}
pSh->SetRestoreActions(0);
- pSh->LockView(FALSE);
+ pSh->LockView(sal_False);
pSh = (ViewShell*)pSh->GetNext();
} while ( pSh != GetCurrShell() );
@@ -2002,7 +2017,7 @@ void lcl_MoveAllLowerObjs( SwFrm* pFrm, const Point& rOffset )
else
pSortedObj = pFrm->GetDrawObjs();
- for ( USHORT i = 0; pSortedObj && i < pSortedObj->Count(); ++i)
+ for ( sal_uInt16 i = 0; pSortedObj && i < pSortedObj->Count(); ++i)
{
SwAnchoredObject* pAnchoredObj = (*pSortedObj)[i];
@@ -2131,7 +2146,7 @@ void SwRootFrm::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* pVi
{
ASSERT( pViewOpt, "CheckViewLayout required ViewOptions" )
- const USHORT nColumns = pViewOpt->GetViewLayoutColumns();
+ const sal_uInt16 nColumns = pViewOpt->GetViewLayoutColumns();
const bool bBookMode = pViewOpt->IsViewLayoutBookMode();
if ( nColumns == mnColumns && bBookMode == mbBookMode && pVisArea->Width() == mnViewWidth && !mbSidebarChanged )
@@ -2151,8 +2166,8 @@ void SwRootFrm::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* pVi
Calc();
- const BOOL bOldCallbackActionEnabled = IsCallbackActionEnabled();
- SetCallbackActionEnabled( FALSE );
+ const sal_Bool bOldCallbackActionEnabled = IsCallbackActionEnabled();
+ SetCallbackActionEnabled( sal_False );
maPageRects.clear();
@@ -2178,7 +2193,7 @@ void SwRootFrm::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* pVi
SwTwips nMinPageLeft = TWIPS_MAX;
SwTwips nMaxPageRight = 0;
SwPageFrm* pStartOfRow = pPageFrm;
- USHORT nNumberOfPagesInRow = mbBookMode ? 1 : 0; // in book view, start with right page
+ sal_uInt16 nNumberOfPagesInRow = mbBookMode ? 1 : 0; // in book view, start with right page
bool bFirstRow = true;
bool bPageChanged = false;
@@ -2257,8 +2272,8 @@ void SwRootFrm::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* pVi
pLastPageInCurrentRow = static_cast<const SwPageFrm*>(pLastPageInCurrentRow->GetPrev());
// check how many times the last page would still fit into the remaining space:
- USHORT nNumberOfVirtualPages = 0;
- const USHORT nMaxNumberOfVirtualPages = mnColumns > 0 ? mnColumns - nNumberOfPagesInRow : USHRT_MAX;
+ sal_uInt16 nNumberOfVirtualPages = 0;
+ const sal_uInt16 nMaxNumberOfVirtualPages = mnColumns > 0 ? mnColumns - nNumberOfPagesInRow : USHRT_MAX;
SwTwips nRemain = nWidthRemain;
SwTwips nVirtualPagesWidth = 0;
SwTwips nLastPageWidth = pLastPageInCurrentRow->Frm().Width() + nSidebarWidth;
@@ -2457,7 +2472,7 @@ bool SwRootFrm::IsLeftToRightViewLayout() const
// <--
}
-/*const SwRect SwRootFrm::GetExtendedPageArea( USHORT nPageNumber ) const
+/*const SwRect SwRootFrm::GetExtendedPageArea( sal_uInt16 nPageNumber ) const
{
SwRect aRet;
ASSERT( nPageNumber < maPageRects.size(), "No extended page area available" )
diff --git a/sw/source/core/layout/pagedesc.cxx b/sw/source/core/layout/pagedesc.cxx
index 87f9259b8292..01b238178cf4 100644
--- a/sw/source/core/layout/pagedesc.cxx
+++ b/sw/source/core/layout/pagedesc.cxx
@@ -73,7 +73,7 @@ SwPageDesc::SwPageDesc( const String& rName, SwFrmFmt *pFmt, SwDoc *pDc ) :
nRegHeight( 0 ),
nRegAscent( 0 ),
eUse( (UseOnPage)(nsUseOnPage::PD_ALL | nsUseOnPage::PD_HEADERSHARE | nsUseOnPage::PD_FOOTERSHARE) ),
- bLandscape( FALSE ),
+ bLandscape( sal_False ),
aFtnInfo()
{
}
@@ -175,16 +175,16 @@ void SwPageDesc::ResetAllAttr( sal_Bool bLeft )
// erfrage vom Modify Informationen
-BOOL SwPageDesc::GetInfo( SfxPoolItem & rInfo ) const
+sal_Bool SwPageDesc::GetInfo( SfxPoolItem & rInfo ) const
{
// if( RES_AUTOFMT_DOCNODE == rInfo.Which() )
// {
// dann weiter zum Format
if( !aMaster.GetInfo( rInfo ) )
- return FALSE; // gefunden
+ return sal_False; // gefunden
return aLeft.GetInfo( rInfo );
// }
-// return TRUE; // weiter suchen
+// return sal_True; // weiter suchen
}
/*************************************************************************
@@ -289,8 +289,13 @@ void SwPageDesc::RegisterChange()
void SwPageDesc::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
{
+<<<<<<< local
const USHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
NotifyClients( pOld, pNew );
+=======
+ const sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
+ SwModify::Modify( pOld, pNew );
+>>>>>>> other
if ( (RES_ATTRSET_CHG == nWhich) || (RES_FMT_CHG == nWhich)
|| isCHRATR(nWhich) || (RES_PARATR_LINESPACING == nWhich) )
@@ -302,7 +307,7 @@ void SwPageDesc::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
static const SwFrm* lcl_GetFrmOfNode( const SwNode& rNd )
{
SwModify* pMod;
- USHORT nFrmType = FRM_CNTNT;
+ sal_uInt16 nFrmType = FRM_CNTNT;
if( rNd.IsCntntNode() )
{
@@ -317,7 +322,11 @@ static const SwFrm* lcl_GetFrmOfNode( const SwNode& rNd )
pMod = 0;
Point aNullPt;
+<<<<<<< local
return pMod ? ::GetFrmOfModify( 0, *pMod, nFrmType, &aNullPt, 0, FALSE )
+=======
+ return pMod ? ::GetFrmOfModify( *pMod, nFrmType, &aNullPt, 0, sal_False )
+>>>>>>> other
: 0;
}
@@ -331,7 +340,7 @@ const SwPageDesc* SwPageDesc::GetPageDescOfNode(const SwNode& rNd)
}
const SwFrmFmt* SwPageDesc::GetPageFmtOfNode( const SwNode& rNd,
- BOOL bCheckForThisPgDc ) const
+ sal_Bool bCheckForThisPgDc ) const
{
// welches PageDescFormat ist fuer diesen Node gueltig?
const SwFrmFmt* pRet;
@@ -355,9 +364,9 @@ const SwFrmFmt* SwPageDesc::GetPageFmtOfNode( const SwNode& rNd,
return pRet;
}
-BOOL SwPageDesc::IsFollowNextPageOfNode( const SwNode& rNd ) const
+sal_Bool SwPageDesc::IsFollowNextPageOfNode( const SwNode& rNd ) const
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( GetFollow() && this != GetFollow() )
{
const SwFrm* pChkFrm = lcl_GetFrmOfNode( rNd );
@@ -366,7 +375,7 @@ BOOL SwPageDesc::IsFollowNextPageOfNode( const SwNode& rNd ) const
( !pChkFrm->GetNext() || GetFollow() ==
((SwPageFrm*)pChkFrm->GetNext())->GetPageDesc() ))
// die Seite gefunden, auf die der Follow verweist
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
}
@@ -442,7 +451,7 @@ SwPageFtnInfo &SwPageFtnInfo::operator=( const SwPageFtnInfo& rCpy )
-BOOL SwPageFtnInfo::operator==( const SwPageFtnInfo& rCmp ) const
+sal_Bool SwPageFtnInfo::operator==( const SwPageFtnInfo& rCmp ) const
{
return ( nMaxHeight == rCmp.GetHeight() &&
nLineWidth == rCmp.nLineWidth &&
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index f43cb2e0d45a..35207452f7c5 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -138,43 +138,43 @@ class SwLineRect : public SwRect
{
const Color *pColor;
const SwTabFrm *pTab;
- BYTE nSubColor; //Hilfslinien einfaerben
- BOOL bPainted; //schon gepaintet?
- BYTE nLock; //Um die Linien zum Hell-Layer abzugrenzen.
+ sal_uInt8 nSubColor; //Hilfslinien einfaerben
+ sal_Bool bPainted; //schon gepaintet?
+ sal_uInt8 nLock; //Um die Linien zum Hell-Layer abzugrenzen.
public:
SwLineRect( const SwRect &rRect, const Color *pCol,
- const SwTabFrm *pT , const BYTE nSCol );
+ const SwTabFrm *pT , const sal_uInt8 nSCol );
const Color *GetColor() const { return pColor;}
const SwTabFrm *GetTab() const { return pTab; }
- void SetPainted() { bPainted = TRUE; }
- void Lock( BOOL bLock ) { if ( bLock )
+ void SetPainted() { bPainted = sal_True; }
+ void Lock( sal_Bool bLock ) { if ( bLock )
++nLock;
else if ( nLock )
--nLock;
}
- BOOL IsPainted() const { return bPainted; }
- BOOL IsLocked() const { return nLock != 0; }
- BYTE GetSubColor() const { return nSubColor;}
+ sal_Bool IsPainted() const { return bPainted; }
+ sal_Bool IsLocked() const { return nLock != 0; }
+ sal_uInt8 GetSubColor() const { return nSubColor;}
- BOOL MakeUnion( const SwRect &rRect );
+ sal_Bool MakeUnion( const SwRect &rRect );
};
SV_DECL_VARARR( SwLRects, SwLineRect, 100, 100 )
class SwLineRects : public SwLRects
{
- USHORT nLastCount; //unuetze Durchlaeufe im PaintLines verhindern.
+ sal_uInt16 nLastCount; //unuetze Durchlaeufe im PaintLines verhindern.
public:
SwLineRects() : nLastCount( 0 ) {}
void AddLineRect( const SwRect& rRect, const Color *pColor,
- const SwTabFrm *pTab, const BYTE nSCol );
+ const SwTabFrm *pTab, const sal_uInt8 nSCol );
void ConnectEdges( OutputDevice *pOut );
void PaintLines ( OutputDevice *pOut );
- void LockLines( BOOL bLock );
+ void LockLines( sal_Bool bLock );
/// OD 13.08.2002 - correct type of function
- USHORT Free() const { return nFree; }
+ sal_uInt16 Free() const { return nFree; }
};
class SwSubsRects : public SwLineRects
@@ -183,7 +183,7 @@ class SwSubsRects : public SwLineRects
public:
void PaintSubsidiary( OutputDevice *pOut, const SwLineRects *pRects );
- inline void Ins( const SwRect &rRect, const BYTE nSCol );
+ inline void Ins( const SwRect &rRect, const sal_uInt8 nSCol );
};
//----------------- End Klassen Umrandungen ----------------------
@@ -192,11 +192,11 @@ static ViewShell *pGlobalShell = 0;
//Wenn durchsichtige FlyInCnts im PaintBackground gepainted werden so soll der
//Hintergrund nicht mehr retouchiert werden.
-//static BOOL bLockFlyBackground = FALSE;
+//static sal_Bool bLockFlyBackground = sal_False;
//Wenn vom Fly ein Metafile abgezogen wird, so soll nur der FlyInhalt und vor
//nur hintergrund vom FlyInhalt gepaintet werden.
-static BOOL bFlyMetafile = FALSE;
+static sal_Bool bFlyMetafile = sal_False;
static OutputDevice *pFlyMetafileOut = 0;
//Die Retouche fuer Durchsichtige Flys wird vom Hintergrund der Flys
@@ -223,7 +223,7 @@ static double aEdgeScale = 0.5;
//In pSubsLines werden Hilfslinien gesammelt und zusammengefasst. Diese
//werden vor der Ausgabe mit pLines abgeglichen, so dass moeglichst keine
//Umrandungen von den Hilfslinen verdeckt werden.
-//bTablines ist waerend des Paints einer Tabelle TRUE.
+//bTablines ist waerend des Paints einer Tabelle sal_True.
static SwLineRects *pLines = 0;
static SwSubsRects *pSubsLines = 0;
// OD 18.11.2002 #99672# - global variable for sub-lines of body, header, footer,
@@ -235,7 +235,7 @@ static SfxProgress *pProgress = 0;
static SwFlyFrm *pFlyOnlyDraw = 0;
//Damit die Flys auch fuer den Hack richtig gepaintet werden koennen.
-static BOOL bTableHack = FALSE;
+static sal_Bool bTableHack = sal_False;
//Um das teure Ermitteln der RetoucheColor zu optimieren
Color aGlobalRetoucheColor;
@@ -300,7 +300,7 @@ void SwCalcPixStatics( OutputDevice *pOut )
//Zum Sichern der statics, damit das Paint (quasi) reentrant wird.
class SwSavePaintStatics
{
- BOOL bSFlyMetafile,
+ sal_Bool bSFlyMetafile,
bSPageOnly;
ViewShell *pSGlobalShell;
OutputDevice *pSFlyMetafileOut;
@@ -350,7 +350,7 @@ SwSavePaintStatics::SwSavePaintStatics() :
aSScaleX ( aScaleX ),
aSScaleY ( aScaleY )
{
- bFlyMetafile = FALSE;
+ bFlyMetafile = sal_False;
pFlyMetafileOut = 0;
pRetoucheFly = 0;
pRetoucheFly2 = 0;
@@ -399,17 +399,17 @@ SV_IMPL_VARARR( SwLRects, SwLineRect );
SwLineRect::SwLineRect( const SwRect &rRect, const Color *pCol,
- const SwTabFrm *pT, const BYTE nSCol ) :
+ const SwTabFrm *pT, const sal_uInt8 nSCol ) :
SwRect( rRect ),
pColor( pCol ),
pTab( pT ),
nSubColor( nSCol ),
- bPainted( FALSE ),
+ bPainted( sal_False ),
nLock( 0 )
{
}
-BOOL SwLineRect::MakeUnion( const SwRect &rRect )
+sal_Bool SwLineRect::MakeUnion( const SwRect &rRect )
{
//Es wurde bereits ausserhalb geprueft, ob die Rechtecke die gleiche
//Ausrichtung (horizontal bzw. vertikal), Farbe usw. besitzen.
@@ -424,7 +424,7 @@ BOOL SwLineRect::MakeUnion( const SwRect &rRect )
{
Bottom( Max( Bottom(), rRect.Bottom() ) );
Top ( Min( Top(), rRect.Top() ) );
- return TRUE;
+ return sal_True;
}
}
}
@@ -439,19 +439,19 @@ BOOL SwLineRect::MakeUnion( const SwRect &rRect )
{
Right( Max( Right(), rRect.Right() ) );
Left ( Min( Left(), rRect.Left() ) );
- return TRUE;
+ return sal_True;
}
}
}
- return FALSE;
+ return sal_False;
}
void SwLineRects::AddLineRect( const SwRect &rRect, const Color *pCol,
- const SwTabFrm *pTab, const BYTE nSCol )
+ const SwTabFrm *pTab, const sal_uInt8 nSCol )
{
//Rueckwaerts durch, weil Linien die zusammengefasst werden koennen i.d.R.
//im gleichen Kontext gepaintet werden.
- for ( USHORT i = Count(); i ; )
+ for ( sal_uInt16 i = Count(); i ; )
{
SwLineRect &rLRect = operator[](--i);
//Pruefen von Ausrichtung, Farbe, Tabelle.
@@ -483,13 +483,13 @@ void SwLineRects::ConnectEdges( OutputDevice *pOut )
for ( int i = 0; i < (int)Count(); ++i )
{
- SwLineRect &rL1 = operator[](USHORT(i));
+ SwLineRect &rL1 = operator[](sal_uInt16(i));
if ( !rL1.GetTab() || rL1.IsPainted() || rL1.IsLocked() )
continue;
aCheck.Remove( 0, aCheck.Count() );
- const BOOL bVert = rL1.Height() > rL1.Width();
+ const sal_Bool bVert = rL1.Height() > rL1.Width();
long nL1a, nL1b, nL1c, nL1d;
if ( bVert )
@@ -504,7 +504,7 @@ void SwLineRects::ConnectEdges( OutputDevice *pOut )
}
//Alle moeglicherweise mit i1 zu verbindenden Linien einsammeln.
- for ( USHORT i2 = 0; i2 < Count(); ++i2 )
+ for ( sal_uInt16 i2 = 0; i2 < Count(); ++i2 )
{
SwLineRect &rL2 = operator[](i2);
if ( rL2.GetTab() != rL1.GetTab() ||
@@ -537,14 +537,14 @@ void SwLineRects::ConnectEdges( OutputDevice *pOut )
if ( aCheck.Count() < 2 )
continue;
- BOOL bRemove = FALSE;
+ sal_Bool bRemove = sal_False;
//Fuer jede Linie jede alle folgenden checken.
- for ( USHORT k = 0; !bRemove && k < aCheck.Count(); ++k )
+ for ( sal_uInt16 k = 0; !bRemove && k < aCheck.Count(); ++k )
{
SwLineRect &rR1 = (SwLineRect&)*(SwLineRect*)aCheck[k];
- for ( USHORT k2 = k+1; !bRemove && k2 < aCheck.Count(); ++k2 )
+ for ( sal_uInt16 k2 = k+1; !bRemove && k2 < aCheck.Count(); ++k2 )
{
SwLineRect &rR2 = (SwLineRect&)*(SwLineRect*)aCheck[k2];
if ( bVert )
@@ -571,7 +571,7 @@ void SwLineRects::ConnectEdges( OutputDevice *pOut )
aIns.Bottom( pLA->Bottom() );
if ( !rL1.IsInside( aIns ) )
continue;
- const USHORT nTmpFree = Free();
+ const sal_uInt16 nTmpFree = Free();
Insert( SwLineRect( aIns, rL1.GetColor(),
rL1.GetTab(), SUBCOL_TAB ), Count() );
if ( !nTmpFree )
@@ -585,7 +585,7 @@ void SwLineRects::ConnectEdges( OutputDevice *pOut )
if ( rL1.Bottom() > pLB->Bottom() )
rL1.Top( pLB->Top() ); //i1 nach oben verlaengern
else
- bRemove = TRUE; //abbrechen, i1 entfernen
+ bRemove = sal_True; //abbrechen, i1 entfernen
}
}
else
@@ -612,7 +612,7 @@ void SwLineRects::ConnectEdges( OutputDevice *pOut )
aIns.Right( pLA->Right() );
if ( !rL1.IsInside( aIns ) )
continue;
- const USHORT nTmpFree = Free();
+ const sal_uInt16 nTmpFree = Free();
Insert( SwLineRect( aIns, rL1.GetColor(),
rL1.GetTab(), SUBCOL_TAB ), Count() );
if ( !nTmpFree )
@@ -625,20 +625,20 @@ void SwLineRects::ConnectEdges( OutputDevice *pOut )
if ( rL1.Right() > pLB->Right() )
rL1.Left( pLB->Left() );
else
- bRemove = TRUE;
+ bRemove = sal_True;
}
}
}
}
if ( bRemove )
{
- Remove( static_cast<USHORT>(i), 1 );
+ Remove( static_cast<sal_uInt16>(i), 1 );
--i; //keinen auslassen!
}
}
}
-inline void SwSubsRects::Ins( const SwRect &rRect, const BYTE nSCol )
+inline void SwSubsRects::Ins( const SwRect &rRect, const sal_uInt8 nSCol )
{
//Linien die kuerzer als die breiteste Linienbreite sind werden
//nicht aufgenommen.
@@ -650,7 +650,7 @@ void SwSubsRects::RemoveSuperfluousSubsidiaryLines( const SwLineRects &rRects )
{
//Alle Hilfslinien, die sich mit irgendwelchen Umrandungen decken werden
//entfernt bzw. zerstueckelt..
- for ( USHORT i = 0; i < Count(); ++i )
+ for ( sal_uInt16 i = 0; i < Count(); ++i )
{
// OD 18.11.2002 #99672# - get a copy instead of a reference, because
// an <insert> may destroy the object due to a necessary array resize.
@@ -674,7 +674,7 @@ void SwSubsRects::RemoveSuperfluousSubsidiaryLines( const SwLineRects &rRects )
aSubsRect.Top ( aSubsRect.Top() - (nPixelSzH+nHalfPixelSzH) );
aSubsRect.Bottom( aSubsRect.Bottom() + (nPixelSzH+nHalfPixelSzH) );
}
- for ( USHORT k = 0; k < rRects.Count(); ++k )
+ for ( sal_uInt16 k = 0; k < rRects.Count(); ++k )
{
SwLineRect &rLine = rRects[k];
@@ -746,9 +746,9 @@ void SwSubsRects::RemoveSuperfluousSubsidiaryLines( const SwLineRects &rRects )
}
}
-void SwLineRects::LockLines( BOOL bLock )
+void SwLineRects::LockLines( sal_Bool bLock )
{
- for ( USHORT i = 0; i < Count(); ++i )
+ for ( sal_uInt16 i = 0; i < Count(); ++i )
operator[](i).Lock( bLock );
}
@@ -769,9 +769,9 @@ void SwLineRects::PaintLines( OutputDevice *pOut )
ConnectEdges( pOut );
const Color *pLast = 0;
- BOOL bPaint2nd = FALSE;
- USHORT nMinCount = Count();
- USHORT i;
+ sal_Bool bPaint2nd = sal_False;
+ sal_uInt16 nMinCount = Count();
+ sal_uInt16 i;
for ( i = 0; i < Count(); ++i )
{
@@ -787,7 +787,7 @@ void SwLineRects::PaintLines( OutputDevice *pOut )
}
//Jetzt malen oder erst in der zweiten Runde?
- BOOL bPaint = TRUE;
+ sal_Bool bPaint = sal_True;
if ( rLRect.GetTab() )
{
if ( rLRect.Height() > rLRect.Width() )
@@ -799,7 +799,7 @@ void SwLineRects::PaintLines( OutputDevice *pOut )
nTRight = rLRect.GetTab()->Frm().Left() + rLRect.GetTab()->Prt().Right();
if ( (nTLeft >= nLLeft && nTLeft <= nLRight) ||
(nTRight>= nLLeft && nTRight<= nLRight) )
- bPaint = FALSE;
+ bPaint = sal_False;
}
else
{ //Waagerechte Kante, ueberlappt sie mit der Tabellenkante?
@@ -809,7 +809,7 @@ void SwLineRects::PaintLines( OutputDevice *pOut )
nTBottom = rLRect.GetTab()->Frm().Top() + rLRect.GetTab()->Prt().Bottom();
if ( (nTTop >= nLTop && nTTop <= nLBottom) ||
(nTBottom >= nLTop && nTBottom <= nLBottom) )
- bPaint = FALSE;
+ bPaint = sal_False;
}
}
if ( bPaint )
@@ -818,7 +818,7 @@ void SwLineRects::PaintLines( OutputDevice *pOut )
{
pLast = rLRect.GetColor();
- ULONG nOldDrawMode = pOut->GetDrawMode();
+ sal_uLong nOldDrawMode = pOut->GetDrawMode();
if( pGlobalShell->GetWin() &&
Application::GetSettings().GetStyleSettings().GetHighContrastMode() )
pOut->SetDrawMode( 0 );
@@ -831,7 +831,7 @@ void SwLineRects::PaintLines( OutputDevice *pOut )
rLRect.SetPainted();
}
else
- bPaint2nd = TRUE;
+ bPaint2nd = sal_True;
}
if ( bPaint2nd )
for ( i = 0; i < Count(); ++i )
@@ -850,7 +850,7 @@ void SwLineRects::PaintLines( OutputDevice *pOut )
{
pLast = rLRect.GetColor();
- ULONG nOldDrawMode = pOut->GetDrawMode();
+ sal_uLong nOldDrawMode = pOut->GetDrawMode();
if( pGlobalShell->GetWin() &&
Application::GetSettings().GetStyleSettings().GetHighContrastMode() )
{
@@ -879,12 +879,12 @@ void SwSubsRects::PaintSubsidiary( OutputDevice *pOut,
// <--
//Alle Hilfslinien, die sich fast decken entfernen (Tabellen)
- for ( USHORT i = 0; i < Count(); ++i )
+ for ( sal_uInt16 i = 0; i < Count(); ++i )
{
SwLineRect &rLi = operator[](i);
const bool bVerticalSubs = rLi.Height() > rLi.Width();
- for ( USHORT k = i+1; k < Count(); ++k )
+ for ( sal_uInt16 k = i+1; k < Count(); ++k )
{
SwLineRect &rLk = operator[](k);
if ( rLi.SSize() == rLk.SSize() )
@@ -936,14 +936,14 @@ void SwSubsRects::PaintSubsidiary( OutputDevice *pOut,
// mode in order to get fill color set at output device.
// Recover draw mode after draw of lines.
// Necessary for the subsidiary lines painted by the fly frames.
- ULONG nOldDrawMode = pOut->GetDrawMode();
+ sal_uLong nOldDrawMode = pOut->GetDrawMode();
if( pGlobalShell->GetWin() &&
Application::GetSettings().GetStyleSettings().GetHighContrastMode() )
{
pOut->SetDrawMode( 0 );
}
- for ( USHORT i = 0; i < Count(); ++i )
+ for ( sal_uInt16 i = 0; i < Count(); ++i )
{
SwLineRect &rLRect = operator[](i);
// OD 19.12.2002 #106318# - add condition <!rLRect.IsLocked()>
@@ -1180,7 +1180,7 @@ long MA_FASTCALL lcl_MinWidthDist( const long nDist )
//Ermittelt PrtArea plus Umrandung plus Schatten.
void MA_FASTCALL lcl_CalcBorderRect( SwRect &rRect, const SwFrm *pFrm,
const SwBorderAttrs &rAttrs,
- const BOOL bShadow )
+ const sal_Bool bShadow )
{
// OD 23.01.2003 #106386# - special handling for cell frames.
// The printing area of a cell frame is completely enclosed in the frame area
@@ -1206,7 +1206,7 @@ void MA_FASTCALL lcl_CalcBorderRect( SwRect &rRect, const SwFrm *pFrm,
{
SwRectFn fnRect = pFrm->IsVertical() ? fnRectVert : fnRectHori;
const SvxBoxItem &rBox = rAttrs.GetBox();
- const BOOL bTop = 0 != (pFrm->*fnRect->fnGetTopMargin)();
+ const sal_Bool bTop = 0 != (pFrm->*fnRect->fnGetTopMargin)();
if ( bTop )
{
SwTwips nDiff = rBox.GetTop() ?
@@ -1219,7 +1219,7 @@ void MA_FASTCALL lcl_CalcBorderRect( SwRect &rRect, const SwFrm *pFrm,
(rRect.*fnRect->fnSubTop)( nDiff );
}
- const BOOL bBottom = 0 != (pFrm->*fnRect->fnGetBottomMargin)();
+ const sal_Bool bBottom = 0 != (pFrm->*fnRect->fnGetBottomMargin)();
if ( bBottom )
{
SwTwips nDiff = 0;
@@ -1303,7 +1303,7 @@ void MA_FASTCALL lcl_SubtractFlys( const SwFrm *pFrm, const SwPageFrm *pPage,
if ( !pRetoucheFly )
pRetoucheFly = pRetoucheFly2;
- for ( USHORT j = 0; (j < rObjs.Count()) && rRegion.Count(); ++j )
+ for ( sal_uInt16 j = 0; (j < rObjs.Count()) && rRegion.Count(); ++j )
{
const SwAnchoredObject* pAnchoredObj = rObjs[j];
const SdrObject* pSdrObj = pAnchoredObj->GetDrawObj();
@@ -1325,8 +1325,8 @@ void MA_FASTCALL lcl_SubtractFlys( const SwFrm *pFrm, const SwPageFrm *pPage,
pGlobalShell->IsPreView()))
continue;
- const BOOL bLowerOfSelf = pSelfFly && pFly->IsLowerOf( pSelfFly ) ?
- TRUE : FALSE;
+ const sal_Bool bLowerOfSelf = pSelfFly && pFly->IsLowerOf( pSelfFly ) ?
+ sal_True : sal_False;
//Bei zeichengebundenem Fly nur diejenigen betrachten, in denen er
//nicht selbst verankert ist.
@@ -1351,7 +1351,7 @@ void MA_FASTCALL lcl_SubtractFlys( const SwFrm *pFrm, const SwPageFrm *pPage,
}
#endif
- BOOL bStopOnHell = TRUE;
+ sal_Bool bStopOnHell = sal_True;
if ( pSelfFly )
{
const SdrObject *pTmp = pSelfFly->GetVirtDrawObj();
@@ -1367,7 +1367,7 @@ void MA_FASTCALL lcl_SubtractFlys( const SwFrm *pFrm, const SwPageFrm *pPage,
//Aus anderem Layer interessieren uns nur nicht transparente
//oder innenliegende
continue;
- bStopOnHell = FALSE;
+ bStopOnHell = sal_False;
}
}
if ( pRetoucheFly )
@@ -1385,14 +1385,14 @@ void MA_FASTCALL lcl_SubtractFlys( const SwFrm *pFrm, const SwPageFrm *pPage,
//Aus anderem Layer interessieren uns nur nicht transparente
//oder innenliegende
continue;
- bStopOnHell = FALSE;
+ bStopOnHell = sal_False;
}
}
//Wenn der Inhalt des Fly Transparent ist, wird er nicht abgezogen, es sei denn
//er steht im Hell-Layer (#31941#)
const IDocumentDrawModelAccess* pIDDMA = pFly->GetFmt()->getIDocumentDrawModelAccess();
- BOOL bHell = pSdrObj->GetLayer() == pIDDMA->GetHellId();
+ sal_Bool bHell = pSdrObj->GetLayer() == pIDDMA->GetHellId();
if ( (bStopOnHell && bHell) ||
/// OD 05.08.2002 - change internal order of condition
/// first check "!bHell", then "..->Lower()" and "..->IsNoTxtFrm()"
@@ -1430,7 +1430,7 @@ void MA_FASTCALL lcl_SubtractFlys( const SwFrm *pFrm, const SwPageFrm *pPage,
SwRect aRect;
SwBorderAttrAccess aAccess( SwFrm::GetCache(), (SwFrm*)pFly );
const SwBorderAttrs &rAttrs = *aAccess.Get();
- ::lcl_CalcBorderRect( aRect, pFly, rAttrs, TRUE );
+ ::lcl_CalcBorderRect( aRect, pFly, rAttrs, sal_True );
rRegion -= aRect;
continue;
}
@@ -1451,7 +1451,7 @@ void MA_FASTCALL lcl_SubtractFlys( const SwFrm *pFrm, const SwPageFrm *pPage,
SwRect aRect;
SwBorderAttrAccess aAccess( SwFrm::GetCache(), (SwFrm*)pFly );
const SwBorderAttrs &rAttrs = *aAccess.Get();
- ::lcl_CalcBorderRect( aRect, pFly, rAttrs, TRUE );
+ ::lcl_CalcBorderRect( aRect, pFly, rAttrs, sal_True );
rRegion -= aRect;
}
else
@@ -1466,7 +1466,7 @@ void MA_FASTCALL lcl_SubtractFlys( const SwFrm *pFrm, const SwPageFrm *pPage,
}
// --> OD 2008-05-16 #i84659# - no longer needed
-//inline BOOL IsShortCut( const SwRect &rRect, const SwRect &rFrmRect )
+//inline sal_Bool IsShortCut( const SwRect &rRect, const SwRect &rFrmRect )
//{
// //Wenn der Frm vollstaendig rechts neben bzw. unter dem
// //Rect sitzt ist's genug mit Painten.
@@ -1589,7 +1589,7 @@ inline void lcl_DrawGraphicBackgrd( const SvxBrushItem& _rBackgrdBrush,
/// OD 25.09.2002 #99739# - pixel-align coordinations for drawing graphic.
/// OD 17.10.2002 #103876# - outsource code for drawing background of the graphic
/// with a background color in method <lcl_DrawGraphicBackgrd>
-/// Also, change type of <bGrfNum> and <bClip> from <BOOL> to <bool>.
+/// Also, change type of <bGrfNum> and <bClip> from <sal_Bool> to <bool>.
void lcl_DrawGraphic( const SvxBrushItem& rBrush, OutputDevice *pOut,
ViewShell &rSh, const SwRect &rGrf, const SwRect &rOut,
bool bClip, bool bGrfNum,
@@ -1603,7 +1603,7 @@ void lcl_DrawGraphic( const SvxBrushItem& rBrush, OutputDevice *pOut,
SwRect aAlignedGrfRect = rGrf;
::SwAlignRect( aAlignedGrfRect, &rSh );
- /// OD 17.10.2002 #103876# - change type from <BOOL> to <bool>.
+ /// OD 17.10.2002 #103876# - change type from <sal_Bool> to <bool>.
const bool bNotInside = bClip && !rOut.IsInside( aAlignedGrfRect );
if ( bNotInside )
{
@@ -1632,13 +1632,13 @@ void MA_FASTCALL DrawGraphic( const SvxBrushItem *pBrush,
OutputDevice *pOutDev,
const SwRect &rOrg,
const SwRect &rOut,
- const BYTE nGrfNum,
+ const sal_uInt8 nGrfNum,
const sal_Bool bConsiderBackgroundTransparency )
/// OD 05.08.2002 #99657# - add 6th parameter to indicate that method should
/// consider background transparency, saved in the color of the brush item
{
ViewShell &rSh = *pGlobalShell;
- /// OD 17.10.2002 #103876# - change type from <BOOL> to <bool>
+ /// OD 17.10.2002 #103876# - change type from <sal_Bool> to <bool>
bool bReplaceGrfNum = GRFNUM_REPLACE == nGrfNum;
bool bGrfNum = GRFNUM_NO != nGrfNum;
Size aGrfSize;
@@ -1675,8 +1675,8 @@ void MA_FASTCALL DrawGraphic( const SvxBrushItem *pBrush,
SwRect aGrf;
aGrf.SSize( aGrfSize );
- BOOL bDraw = TRUE;
- BOOL bRetouche = TRUE;
+ sal_Bool bDraw = sal_True;
+ sal_Bool bRetouche = sal_True;
switch ( ePos )
{
case GPOS_LT:
@@ -1795,12 +1795,12 @@ void MA_FASTCALL DrawGraphic( const SvxBrushItem *pBrush,
pOutDev->Pop();
// set <bDraw> and <bRetouche> to false, indicating that background
// graphic and background are already drawn.
- bDraw = bRetouche = FALSE;
+ bDraw = bRetouche = sal_False;
}
break;
case GPOS_NONE:
- bDraw = FALSE;
+ bDraw = sal_False;
break;
default: ASSERT( !pOutDev, "new Graphic position?" );
@@ -1871,7 +1871,7 @@ void MA_FASTCALL DrawGraphic( const SvxBrushItem *pBrush,
// --> OD 2008-06-02 #i75614#
// reset draw mode in high contrast mode in order to get fill color set
- const ULONG nOldDrawMode = pOutDev->GetDrawMode();
+ const sal_uLong nOldDrawMode = pOutDev->GetDrawMode();
if ( pGlobalShell->GetWin() &&
Application::GetSettings().GetStyleSettings().GetHighContrastMode() )
{
@@ -1942,7 +1942,7 @@ void MA_FASTCALL DrawGraphic( const SvxBrushItem *pBrush,
else
bGrfBackgrdAlreadyDrawn = true;
/// loop rectangles of background region, which has to be drawn
- for( USHORT i = 0; i < aRegion.Count(); ++i )
+ for( sal_uInt16 i = 0; i < aRegion.Count(); ++i )
{
pOutDev->DrawRect( aRegion[i].SVRect() );
}
@@ -2232,7 +2232,7 @@ void SwTabFrmPainter::PaintLines( OutputDevice& rDev, const SwRect& rRect ) cons
// high contrast mode:
// overrides the color of non-subsidiary lines.
const Color* pHCColor = 0;
- ULONG nOldDrawMode = rDev.GetDrawMode();
+ sal_uLong nOldDrawMode = rDev.GetDrawMode();
if( pGlobalShell->GetWin() &&
Application::GetSettings().GetStyleSettings().GetHighContrastMode() )
{
@@ -2719,7 +2719,7 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const
PROTOCOL( this, PROT_FILE_INIT, 0, 0)
- BOOL bResetRootPaint = FALSE;
+ sal_Bool bResetRootPaint = sal_False;
ViewShell *pSh = pCurrShell;
if ( pSh->GetWin() )
@@ -2735,7 +2735,7 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const
}
}
else
- SwRootFrm::bInPaint = bResetRootPaint = TRUE;
+ SwRootFrm::bInPaint = bResetRootPaint = sal_True;
SwSavePaintStatics *pStatics = 0;
if ( pGlobalShell )
@@ -2776,9 +2776,9 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const
{
((SwRootFrm*)this)->ResetTurbo();
SwLayAction aAction( (SwRootFrm*)this, pSh->Imp() );
- aAction.SetPaint( FALSE );
- aAction.SetComplete( FALSE );
- aAction.SetReschedule( pProgress ? TRUE : FALSE );
+ aAction.SetPaint( sal_False );
+ aAction.SetComplete( sal_False );
+ aAction.SetReschedule( pProgress ? sal_True : sal_False );
aAction.Action();
((SwRootFrm*)this)->ResetTurboFlag();
if ( !pSh->ActionPend() )
@@ -2788,7 +2788,7 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const
SwRect aRect( rRect );
aRect.Intersection( pSh->VisArea() );
- const BOOL bExtraData = ::IsExtraData( GetFmt()->GetDoc() );
+ const sal_Bool bExtraData = ::IsExtraData( GetFmt()->GetDoc() );
pLines = new SwLineRects; //Sammler fuer Umrandungen.
@@ -2797,7 +2797,7 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const
// of the document. Dangerous! We better set this flag to
// avoid the reformat.
const sal_Bool bOldAction = IsCallbackActionEnabled();
- ((SwRootFrm*)this)->SetCallbackActionEnabled( FALSE );
+ ((SwRootFrm*)this)->SetCallbackActionEnabled( sal_False );
const SwPageFrm *pPage = pSh->Imp()->GetFirstVisPage();
@@ -2904,18 +2904,18 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const
/// calls, paint <hell> or <heaven>
const Color aPageBackgrdColor = pPage->GetDrawBackgrdColor();
- pPage->PaintBaBo( aPaintRect, pPage, TRUE );
+ pPage->PaintBaBo( aPaintRect, pPage, sal_True );
if ( pSh->Imp()->HasDrawView() )
{
- pLines->LockLines( TRUE );
+ pLines->LockLines( sal_True );
// OD 29.08.2002 #102450# - add 3rd parameter
// OD 09.12.2002 #103045# - add 4th parameter for horizontal text direction.
const IDocumentDrawModelAccess* pIDDMA = pSh->getIDocumentDrawModelAccess();
pSh->Imp()->PaintLayer( pIDDMA->GetHellId(), pPrintData, aPaintRect,
&aPageBackgrdColor, (pPage->IsRightToLeft() ? true : false) );
pLines->PaintLines( pSh->GetOut() );
- pLines->LockLines( FALSE );
+ pLines->LockLines( sal_False );
}
if( pSh->GetWin() )
@@ -3056,7 +3056,7 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const
#endif
if ( bResetRootPaint )
- SwRootFrm::bInPaint = FALSE;
+ SwRootFrm::bInPaint = sal_False;
if ( pStatics )
delete pStatics;
else
@@ -3086,17 +3086,27 @@ void SwRootFrm::HackPrepareLongTblPaint( int nMode )
case HACK_TABLEMODE_INIT : ASSERT( !pLines, "HackPrepare: already prepared" );
pLines = new SwLineRects;
ASSERT( !pGlobalShell, "old GlobalShell lost" );
+<<<<<<< local
pGlobalShell = GetCurrShell();
bTableHack = TRUE;
+=======
+ pGlobalShell = GetShell();
+ bTableHack = sal_True;
+>>>>>>> other
break;
- case HACK_TABLEMODE_LOCKLINES : pLines->LockLines( TRUE ); break;
+ case HACK_TABLEMODE_LOCKLINES : pLines->LockLines( sal_True ); break;
case HACK_TABLEMODE_PAINTLINES : pLines->PaintLines( GetShell()->GetOut() );
break;
+<<<<<<< local
case HACK_TABLEMODE_UNLOCKLINES: pLines->LockLines( FALSE ); break;
case HACK_TABLEMODE_EXIT : pLines->PaintLines( GetCurrShell()->GetOut() );
+=======
+ case HACK_TABLEMODE_UNLOCKLINES: pLines->LockLines( sal_False ); break;
+ case HACK_TABLEMODE_EXIT : pLines->PaintLines( GetShell()->GetOut() );
+>>>>>>> other
DELETEZ( pLines );
pGlobalShell = 0;
- bTableHack = FALSE;
+ bTableHack = sal_False;
break;
}
}
@@ -3130,14 +3140,14 @@ class SwShortCut
long nLimit;
public:
SwShortCut( const SwFrm& rFrm, const SwRect& rRect );
- BOOL Stop( const SwRect& rRect ) const
+ sal_Bool Stop( const SwRect& rRect ) const
{ return (rRect.*fnCheck)( nLimit ) > 0; }
};
SwShortCut::SwShortCut( const SwFrm& rFrm, const SwRect& rRect )
{
- BOOL bVert = rFrm.IsVertical();
- BOOL bR2L = rFrm.IsRightToLeft();
+ sal_Bool bVert = rFrm.IsVertical();
+ sal_Bool bR2L = rFrm.IsRightToLeft();
if( rFrm.IsNeighbourFrm() && bVert == bR2L )
{
if( bVert )
@@ -3177,8 +3187,8 @@ void SwLayoutFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
return;
SwShortCut aShortCut( *pFrm, rRect );
- BOOL bCnt;
- if ( TRUE == (bCnt = pFrm->IsCntntFrm()) )
+ sal_Bool bCnt;
+ if ( sal_True == (bCnt = pFrm->IsCntntFrm()) )
pFrm->Calc();
if ( pFrm->IsFtnContFrm() )
@@ -3188,7 +3198,7 @@ void SwLayoutFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
}
const SwPageFrm *pPage = 0;
- const BOOL bWin = pGlobalShell->GetWin() ? TRUE : FALSE;
+ const sal_Bool bWin = pGlobalShell->GetWin() ? sal_True : sal_False;
while ( IsAnLower( pFrm ) )
{
@@ -3241,7 +3251,7 @@ void SwLayoutFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
{
pGlobalShell->InvalidateWindows( aPaintRect );
pFrm = pFrm->GetNext();
- if ( pFrm && (TRUE == (bCnt = pFrm->IsCntntFrm())) )
+ if ( pFrm && (sal_True == (bCnt = pFrm->IsCntntFrm())) )
pFrm->Calc();
continue;
}
@@ -3272,7 +3282,7 @@ void SwLayoutFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
::lcl_EmergencyFormatFtnCont( (SwFtnContFrm*)pFrm->GetNext() );
pFrm = pFrm->GetNext();
- if ( pFrm && (TRUE == (bCnt = pFrm->IsCntntFrm())) )
+ if ( pFrm && (sal_True == (bCnt = pFrm->IsCntntFrm())) )
pFrm->Calc();
}
}
@@ -3357,15 +3367,15 @@ sal_Bool SwFlyFrm::IsShadowTransparent() const
|*
|*************************************************************************/
-BOOL SwFlyFrm::IsPaint( SdrObject *pObj, const ViewShell *pSh )
+sal_Bool SwFlyFrm::IsPaint( SdrObject *pObj, const ViewShell *pSh )
{
SdrObjUserCall *pUserCall;
if ( 0 == ( pUserCall = GetUserCall(pObj) ) )
- return TRUE;
+ return sal_True;
//Attributabhaengig nicht fuer Drucker oder PreView painten
- BOOL bPaint = pFlyOnlyDraw ||
+ sal_Bool bPaint = pFlyOnlyDraw ||
((SwContact*)pUserCall)->GetFmt()->GetPrint().GetValue();
if ( !bPaint )
bPaint = pSh->GetWin() && !pSh->IsPreView();
@@ -3378,7 +3388,7 @@ BOOL SwFlyFrm::IsPaint( SdrObject *pObj, const ViewShell *pSh )
{
SwFlyFrm *pFly = ((SwVirtFlyDrawObj*)pObj)->GetFlyFrm();
if ( pFlyOnlyDraw && pFlyOnlyDraw == pFly )
- return TRUE;
+ return sal_True;
//Die Anzeige eines Zwischenstadiums vermeiden, Flys die nicht mit
//der Seite auf der sie verankert sind ueberlappen werden auch
@@ -3440,10 +3450,10 @@ BOOL SwFlyFrm::IsPaint( SdrObject *pObj, const ViewShell *pSh )
bPaint = SwFlyFrm::IsPaint( pAnch->FindFlyFrm()->GetVirtDrawObj(),
pSh );
else if ( pFlyOnlyDraw )
- bPaint = FALSE;
+ bPaint = sal_False;
}
else
- bPaint = FALSE;
+ bPaint = sal_False;
}
return bPaint;
}
@@ -3475,7 +3485,7 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
//wegen der Ueberlappung von Rahmen und Zeichenobjekten muessen die
//Flys ihre Umrandung (und die der Innenliegenden) direkt ausgeben.
//z.B. #33066#
- pLines->LockLines(TRUE);
+ pLines->LockLines(sal_True);
SwRect aRect( rRect );
aRect._Intersection( Frm() );
@@ -3556,7 +3566,7 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
const SwBorderAttrs &rAttrs = *aAccess.Get();
SwRect aPaintRect( aRect );
aPaintRect._Intersection( pParentFlyFrm->Frm() );
- pParentFlyFrm->PaintBackground( aPaintRect, pPage, rAttrs, FALSE, FALSE );
+ pParentFlyFrm->PaintBackground( aPaintRect, pPage, rAttrs, sal_False, sal_False );
pRetoucheFly2 = pOldRet;
}
@@ -3614,13 +3624,13 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
{
pOut->SetClipRegion( aPoly );
}
- for ( USHORT i = 0; i < aRegion.Count(); ++i )
- PaintBackground( aRegion[i], pPage, rAttrs, FALSE, TRUE );
+ for ( sal_uInt16 i = 0; i < aRegion.Count(); ++i )
+ PaintBackground( aRegion[i], pPage, rAttrs, sal_False, sal_True );
pOut->Pop();
}
else
- for ( USHORT i = 0; i < aRegion.Count(); ++i )
- PaintBackground( aRegion[i], pPage, rAttrs, FALSE, TRUE );
+ for ( sal_uInt16 i = 0; i < aRegion.Count(); ++i )
+ PaintBackground( aRegion[i], pPage, rAttrs, sal_False, sal_True );
}
pOut->Pop();
@@ -3637,7 +3647,7 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
if ( pSubsLines )
{
// Lock already existing subsidiary lines
- pSubsLines->LockLines( TRUE );
+ pSubsLines->LockLines( sal_True );
bSubsLineRectsCreated = false;
}
else
@@ -3651,7 +3661,7 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
if ( pSpecSubsLines )
{
// Lock already existing special subsidiary lines
- pSpecSubsLines->LockLines( TRUE );
+ pSpecSubsLines->LockLines( sal_True );
bSpecSubsLineRectsCreated = false;
}
else
@@ -3667,14 +3677,14 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
pSubsLines->PaintSubsidiary( pOut, pLines );
if ( !bSubsLineRectsCreated )
// unlock subsidiary lines
- pSubsLines->LockLines( FALSE );
+ pSubsLines->LockLines( sal_False );
else
// delete created subsidiary lines container
DELETEZ( pSubsLines );
if ( !bSpecSubsLineRectsCreated )
// unlock special subsidiary lines
- pSpecSubsLines->LockLines( FALSE );
+ pSpecSubsLines->LockLines( sal_False );
else
{
// delete created special subsidiary lines container
@@ -3689,7 +3699,7 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
// OD 19.12.2002 #106318# - first paint lines added by fly frame paint
// and then unlock other lines.
pLines->PaintLines( pOut );
- pLines->LockLines( FALSE );
+ pLines->LockLines( sal_False );
pOut->Pop();
@@ -3719,7 +3729,7 @@ void SwTabFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
if ( rAttrs.GetShadow().GetLocation() != SVX_SHADOW_NONE )
{
SwRect aRect;
- ::lcl_CalcBorderRect( aRect, this, rAttrs, TRUE );
+ ::lcl_CalcBorderRect( aRect, this, rAttrs, sal_True );
PaintShadow( rRect, aRect, rAttrs );
}
@@ -3769,9 +3779,9 @@ void SwFrm::PaintShadow( const SwRect& rRect, SwRect& rOutRect,
SwRects aRegion( 2, 2 );
SwRect aOut( rOutRect );
- const BOOL bCnt = IsCntntFrm();
- const BOOL bTop = !bCnt || rAttrs.GetTopLine ( *(this) ) ? TRUE : FALSE;
- const BOOL bBottom = !bCnt || rAttrs.GetBottomLine( *(this) ) ? TRUE : FALSE;
+ const sal_Bool bCnt = IsCntntFrm();
+ const sal_Bool bTop = !bCnt || rAttrs.GetTopLine ( *(this) ) ? sal_True : sal_False;
+ const sal_Bool bBottom = !bCnt || rAttrs.GetBottomLine( *(this) ) ? sal_True : sal_False;
SvxShadowLocation eLoc = rShadow.GetLocation();
@@ -3919,7 +3929,7 @@ void SwFrm::PaintShadow( const SwRect& rRect, SwRect& rOutRect,
OutputDevice *pOut = pGlobalShell->GetOut();
- ULONG nOldDrawMode = pOut->GetDrawMode();
+ sal_uLong nOldDrawMode = pOut->GetDrawMode();
Color aShadowColor( rShadow.GetColor() );
if( aRegion.Count() && pGlobalShell->GetWin() &&
Application::GetSettings().GetStyleSettings().GetHighContrastMode() )
@@ -3937,7 +3947,7 @@ void SwFrm::PaintShadow( const SwRect& rRect, SwRect& rOutRect,
pOut->SetDrawMode( nOldDrawMode );
- for ( USHORT i = 0; i < aRegion.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < aRegion.Count(); ++i )
{
SwRect &rOut = aRegion[i];
aOut = rOut;
@@ -3979,7 +3989,7 @@ void SwFrm::PaintBorderLine( const SwRect& rRect,
aOut._Intersection( rRect );
const SwTabFrm *pTab = IsCellFrm() ? FindTabFrm() : 0;
- BYTE nSubCol = ( IsCellFrm() || IsRowFrm() ) ? SUBCOL_TAB :
+ sal_uInt8 nSubCol = ( IsCellFrm() || IsRowFrm() ) ? SUBCOL_TAB :
( IsInSct() ? SUBCOL_SECT :
( IsInFly() ? SUBCOL_FLY : SUBCOL_PAGE ) );
if( pColor && pGlobalShell->GetWin() &&
@@ -3992,7 +4002,7 @@ void SwFrm::PaintBorderLine( const SwRect& rRect,
{
SwRegionRects aRegion( aOut, 4, 1 );
::lcl_SubtractFlys( this, pPage, aOut, aRegion );
- for ( USHORT i = 0; i < aRegion.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < aRegion.Count(); ++i )
pLines->AddLineRect( aRegion[i], pColor, pTab, nSubCol );
}
else
@@ -4022,7 +4032,7 @@ void MA_FASTCALL lcl_SubTopBottom( SwRect& _iorRect,
const SwRectFn& _rRectFn,
const sal_Bool _bPrtOutputDev )
{
- const BOOL bCnt = _rFrm.IsCntntFrm();
+ const sal_Bool bCnt = _rFrm.IsCntntFrm();
if ( _rBox.GetTop() && _rBox.GetTop()->GetInWidth() &&
( !bCnt || _rAttrs.GetTopLine( _rFrm ) )
)
@@ -4186,7 +4196,7 @@ void lcl_PaintLeftRightLine( const sal_Bool _bLeft,
(aRect.*_rRectFn->fnGetWidth)() );
}
- const BOOL bCnt = _rFrm.IsCntntFrm();
+ const sal_Bool bCnt = _rFrm.IsCntntFrm();
if ( bCnt )
{
@@ -4719,8 +4729,8 @@ void SwFrm::PaintBorder( const SwRect& rRect, const SwPageFrm *pPage,
if ( !pPage )
pPage = FindPageFrm();
- ::lcl_CalcBorderRect( aRect, this, rAttrs, TRUE );
- rAttrs.SetGetCacheLine( TRUE );
+ ::lcl_CalcBorderRect( aRect, this, rAttrs, sal_True );
+ rAttrs.SetGetCacheLine( sal_True );
if ( bShadow )
PaintShadow( rRect, aRect, rAttrs );
// OD 27.09.2002 #103636# - suspend drawing of border
@@ -4780,7 +4790,7 @@ void SwFrm::PaintBorder( const SwRect& rRect, const SwPageFrm *pPage,
}
}
}
- rAttrs.SetGetCacheLine( FALSE );
+ rAttrs.SetGetCacheLine( sal_False );
}
}
/*************************************************************************
@@ -4933,8 +4943,8 @@ void SwPageFrm::PaintGrid( OutputDevice* pOut, SwRect &rRect ) const
aInter.Intersection( rRect );
if( aInter.HasArea() )
{
- BOOL bGrid = pGrid->GetRubyTextBelow();
- BOOL bCell = GRID_LINES_CHARS == pGrid->GetGridType();
+ sal_Bool bGrid = pGrid->GetRubyTextBelow();
+ sal_Bool bCell = GRID_LINES_CHARS == pGrid->GetGridType();
long nGrid = pGrid->GetBaseHeight();
const SwDoc* pDoc = GetFmt()->GetDoc();
long nGridWidth = GETGRIDWIDTH(pGrid,pDoc); //for textgrid refactor
@@ -4956,9 +4966,9 @@ void SwPageFrm::PaintGrid( OutputDevice* pOut, SwRect &rRect ) const
if( nX < aInter.Top() )
nX += nGrid;
SwTwips nGridBottom = aGrid.Top() + aGrid.Height();
- BOOL bLeft = aGrid.Top() >= aInter.Top();
- BOOL bRight = nGridBottom <= nBottom;
- BOOL bBorder = bLeft || bRight;
+ sal_Bool bLeft = aGrid.Top() >= aInter.Top();
+ sal_Bool bRight = nGridBottom <= nBottom;
+ sal_Bool bBorder = bLeft || bRight;
while( nY > nRight )
{
aTmp.Pos().X() = nY;
@@ -5087,9 +5097,9 @@ void SwPageFrm::PaintGrid( OutputDevice* pOut, SwRect &rRect ) const
if( nX < aInter.Left() )
nX += nGridWidth;
SwTwips nGridRight = aGrid.Left() + aGrid.Width();
- BOOL bLeft = aGrid.Left() >= aInter.Left();
- BOOL bRight = nGridRight <= nRight;
- BOOL bBorder = bLeft || bRight;
+ sal_Bool bLeft = aGrid.Left() >= aInter.Left();
+ sal_Bool bRight = nGridRight <= nRight;
+ sal_Bool bBorder = bLeft || bRight;
while( nY < aInter.Top() )
{
aTmp.Pos().Y() = nY;
@@ -5248,7 +5258,7 @@ void SwPageFrm::PaintMarginArea( const SwRect& _rOutputRect,
OutputDevice *pOut = _pViewShell->GetOut();
if ( pOut->GetFillColor() != aGlobalRetoucheColor )
pOut->SetFillColor( aGlobalRetoucheColor );
- for ( USHORT i = 0; i < aPgRegion.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < aPgRegion.Count(); ++i )
{
if ( 1 < aPgRegion.Count() )
{
@@ -5409,7 +5419,7 @@ const sal_Int8 SwPageFrm::mnShadowPxWidth = 2;
//mod #i6193# paint sidebar for notes
//IMPORTANT: if you change the rects here, also change SwPostItMgr::ScrollbarHit
-/*static*/void SwPageFrm::PaintNotesSidebar(const SwRect& _rPageRect, ViewShell* _pViewShell, USHORT nPageNum, bool bRight)
+/*static*/void SwPageFrm::PaintNotesSidebar(const SwRect& _rPageRect, ViewShell* _pViewShell, sal_uInt16 nPageNum, bool bRight)
{
//TOOD: cut out scrollbar area and arrows out of sidepane rect, otherwise it could flicker when pressing arrow buttons
if (!_pViewShell )
@@ -5586,7 +5596,7 @@ const sal_Int8 SwPageFrm::mnShadowPxWidth = 2;
|*************************************************************************/
void SwFrm::PaintBaBo( const SwRect& rRect, const SwPageFrm *pPage,
- const BOOL bLowerBorder ) const
+ const sal_Bool bLowerBorder ) const
{
if ( !pPage )
pPage = FindPageFrm();
@@ -5623,7 +5633,7 @@ void SwFrm::PaintBaBo( const SwRect& rRect, const SwPageFrm *pPage,
// paint background
{
- PaintBackground( rRect, pPage, rAttrs, FALSE, bLowerBorder );
+ PaintBackground( rRect, pPage, rAttrs, sal_False, bLowerBorder );
}
pOut->Pop();
@@ -5642,8 +5652,8 @@ void SwFrm::PaintBaBo( const SwRect& rRect, const SwPageFrm *pPage,
/// calling <PaintBaBo> at the page or at the fly frame its anchored
void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
const SwBorderAttrs & rAttrs,
- const BOOL bLowerMode,
- const BOOL bLowerBorder ) const
+ const sal_Bool bLowerMode,
+ const sal_Bool bLowerBorder ) const
{
// OD 20.01.2003 #i1837# - no paint of table background, if corresponding
// option is *not* set.
@@ -5669,10 +5679,10 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
SvxBrushItem* pTmpBackBrush = 0;
const Color* pCol;
SwRect aOrigBackRect;
- const BOOL bPageFrm = IsPageFrm();
- BOOL bLowMode = TRUE;
+ const sal_Bool bPageFrm = IsPageFrm();
+ sal_Bool bLowMode = sal_True;
- BOOL bBack = GetBackgroundBrush( pItem, pCol, aOrigBackRect, bLowerMode );
+ sal_Bool bBack = GetBackgroundBrush( pItem, pCol, aOrigBackRect, bLowerMode );
//- Ausgabe wenn ein eigener Hintergrund mitgebracht wird.
bool bNoFlyBackground = !bFlyMetafile && !bBack && IsFlyFrm();
if ( bNoFlyBackground )
@@ -5686,7 +5696,7 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
}
// If still no background found for the fly frame, initialize the
// background brush <pItem> with global retouche color and set <bBack>
- // to TRUE, that fly frame will paint its background using this color.
+ // to sal_True, that fly frame will paint its background using this color.
if ( !bBack )
{
// OD 10.01.2003 #i6467# - on print output, pdf output and
@@ -5712,13 +5722,17 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
SwRect aPaintRect( Frm() );
if( IsTxtFrm() || IsSctFrm() )
- aPaintRect = UnionFrm( TRUE );
+ aPaintRect = UnionFrm( sal_True );
if ( aPaintRect.IsOver( rRect ) )
{
if ( bBack || bPageFrm || !bLowerMode )
{
+<<<<<<< local
const BOOL bBrowse = pSh->GetViewOptions()->getBrowseMode();
+=======
+ const sal_Bool bBrowse = pSh->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
+>>>>>>> other
SwRect aRect;
if ( (bPageFrm && bBrowse) ||
@@ -5729,7 +5743,7 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
}
else
{
- ::lcl_CalcBorderRect( aRect, this, rAttrs, FALSE );
+ ::lcl_CalcBorderRect( aRect, this, rAttrs, sal_False );
if ( (IsTxtFrm() || IsTabFrm()) && GetPrev() )
{
if ( GetPrev()->GetAttrSet()->GetBackground() ==
@@ -5761,7 +5775,7 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
/// --> Status Quo: background transparency have to be
/// considered for fly frames
const sal_Bool bConsiderBackgroundTransparency = IsFlyFrm();
- for ( USHORT i = 0; i < aRegion.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < aRegion.Count(); ++i )
{
if ( 1 < aRegion.Count() )
{
@@ -5782,7 +5796,7 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
}
}
else
- bLowMode = bLowerMode ? TRUE : FALSE;
+ bLowMode = bLowerMode ? sal_True : sal_False;
}
/// OD 05.09.2002 #102912#
@@ -5845,13 +5859,13 @@ void SwPageFrm::RefreshSubsidiary( const SwRect &rRect ) const
{
//Beim Paint ueber die Root wird das Array von dort gesteuert.
//Anderfalls kuemmern wir uns selbst darum.
- BOOL bDelSubs = FALSE;
+ sal_Bool bDelSubs = sal_False;
if ( !pSubsLines )
{
pSubsLines = new SwSubsRects;
// OD 20.12.2002 #106318# - create container for special subsidiary lines
pSpecSubsLines = new SwSubsRects;
- bDelSubs = TRUE;
+ bDelSubs = sal_True;
}
RefreshLaySubsidiary( this, aRect );
@@ -5881,19 +5895,19 @@ void SwPageFrm::RefreshSubsidiary( const SwRect &rRect ) const
void SwLayoutFrm::RefreshLaySubsidiary( const SwPageFrm *pPage,
const SwRect &rRect ) const
{
- const BOOL bNoLowerColumn = !Lower() || !Lower()->IsColumnFrm();
- const BOOL bSubsOpt = IS_SUBS;
- const BOOL bSubsTable = ((GetType() & (FRM_ROW | FRM_CELL)) && IS_SUBS_TABLE);
- const BOOL bSubsOther = (GetType() & (FRM_HEADER | FRM_FOOTER | FRM_FTN )) && bSubsOpt;
- const BOOL bSubsSect = IsSctFrm() &&
+ const sal_Bool bNoLowerColumn = !Lower() || !Lower()->IsColumnFrm();
+ const sal_Bool bSubsOpt = IS_SUBS;
+ const sal_Bool bSubsTable = ((GetType() & (FRM_ROW | FRM_CELL)) && IS_SUBS_TABLE);
+ const sal_Bool bSubsOther = (GetType() & (FRM_HEADER | FRM_FOOTER | FRM_FTN )) && bSubsOpt;
+ const sal_Bool bSubsSect = IsSctFrm() &&
bNoLowerColumn &&
IS_SUBS_SECTION;
- const BOOL bSubsFly = IS_SUBS_FLYS &&
+ const sal_Bool bSubsFly = IS_SUBS_FLYS &&
(GetType() & FRM_FLY) &&
bNoLowerColumn &&
(!Lower() || !Lower()->IsNoTxtFrm() ||
!((SwNoTxtFrm*)Lower())->HasAnimation());
- BOOL bSubsBody = FALSE;
+ sal_Bool bSubsBody = sal_False;
if ( GetType() & FRM_BODY )
{
if ( IsPageBodyFrm() )
@@ -5972,7 +5986,7 @@ void MA_FASTCALL lcl_RefreshLine( const SwLayoutFrm *pLay,
const SwPageFrm *pPage,
const Point &rP1,
const Point &rP2,
- const BYTE nSubColor,
+ const sal_uInt8 nSubColor,
SwLineRects* _pSubsLines )
{
//In welche Richtung gehts? Kann nur Horizontal oder Vertikal sein.
@@ -6134,20 +6148,20 @@ void SwLayoutFrm::PaintSubsidiaryLines( const SwPageFrm *pPage,
const Point aRB( nRight, nBottom );
const Point aLB( aOut.Left(), nBottom );
- BYTE nSubColor = ( bCell || IsRowFrm() ) ? SUBCOL_TAB :
+ sal_uInt8 nSubColor = ( bCell || IsRowFrm() ) ? SUBCOL_TAB :
( IsInSct() ? SUBCOL_SECT :
( IsInFly() ? SUBCOL_FLY : SUBCOL_PAGE ) );
// OD 05.11.2002 #102406# - body frames are responsible for page/column breaks.
- BOOL bBreak = FALSE;
+ sal_Bool bBreak = sal_False;
if ( IsBodyFrm() )
{
const SwCntntFrm *pCnt = ContainsCntnt();
if ( pCnt )
{
// OD 05.11.2002 #102406# - adjust setting of <bBreak>.
- bBreak = pCnt->IsPageBreak( TRUE ) ||
- ( IsColBodyFrm() && pCnt->IsColBreak( TRUE ) );
+ bBreak = pCnt->IsPageBreak( sal_True ) ||
+ ( IsColBodyFrm() && pCnt->IsColBreak( sal_True ) );
}
}
@@ -6241,7 +6255,7 @@ void SwLayoutFrm::PaintSubsidiaryLines( const SwPageFrm *pPage,
void SwPageFrm::RefreshExtraData( const SwRect &rRect ) const
{
const SwLineNumberInfo &rInfo = GetFmt()->GetDoc()->GetLineNumberInfo();
- BOOL bLineInFly = (rInfo.IsPaintLineNumbers() && rInfo.IsCountInFlys())
+ sal_Bool bLineInFly = (rInfo.IsPaintLineNumbers() && rInfo.IsCountInFlys())
|| (sal_Int16)SW_MOD()->GetRedlineMarkPos() != text::HoriOrientation::NONE;
SwRect aRect( rRect );
@@ -6251,7 +6265,7 @@ void SwPageFrm::RefreshExtraData( const SwRect &rRect ) const
SwLayoutFrm::RefreshExtraData( aRect );
if ( bLineInFly && GetSortedObjs() )
- for ( USHORT i = 0; i < GetSortedObjs()->Count(); ++i )
+ for ( sal_uInt16 i = 0; i < GetSortedObjs()->Count(); ++i )
{
const SwAnchoredObject* pAnchoredObj = (*GetSortedObjs())[i];
if ( pAnchoredObj->ISA(SwFlyFrm) )
@@ -6269,7 +6283,7 @@ void SwLayoutFrm::RefreshExtraData( const SwRect &rRect ) const
{
const SwLineNumberInfo &rInfo = GetFmt()->GetDoc()->GetLineNumberInfo();
- BOOL bLineInBody = rInfo.IsPaintLineNumbers(),
+ sal_Bool bLineInBody = rInfo.IsPaintLineNumbers(),
bLineInFly = bLineInBody && rInfo.IsCountInFlys(),
bRedLine = (sal_Int16)SW_MOD()->GetRedlineMarkPos()!=text::HoriOrientation::NONE;
@@ -6345,7 +6359,7 @@ const Font& SwPageFrm::GetEmptyPageFont()
pEmptyPgFont->SetName( String::CreateFromAscii(
RTL_CONSTASCII_STRINGPARAM( "Helvetica" )) );
pEmptyPgFont->SetFamily( FAMILY_SWISS );
- pEmptyPgFont->SetTransparent( TRUE );
+ pEmptyPgFont->SetTransparent( sal_True );
pEmptyPgFont->SetColor( COL_GRAY );
}
@@ -6389,11 +6403,11 @@ void SwFrm::Retouche( const SwPageFrm * pPage, const SwRect &rRect ) const
SwTaggedPDFHelper aTaggedPDFHelper( 0, 0, 0, *pSh->GetOut() );
// <--
- for ( USHORT i = 0; i < aRegion.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < aRegion.Count(); ++i )
{
SwRect &rRetouche = aRegion[i];
- GetUpper()->PaintBaBo( rRetouche, pPage, TRUE );
+ GetUpper()->PaintBaBo( rRetouche, pPage, sal_True );
//Hoelle und Himmel muessen auch refreshed werden.
//Um Rekursionen zu vermeiden muss mein Retouche Flag zuerst
@@ -6447,7 +6461,7 @@ void SwFrm::Retouche( const SwPageFrm * pPage, const SwRect &rRect ) const
Beschreibung Liefert die Backgroundbrush fuer den Bereich des
des Frm. Die Brush wird entweder von ihm selbst oder von einem
Upper vorgegeben, die erste Brush wird benutzt.
- Ist fuer keinen Frm eine Brush angegeben, so wird FALSE zurueck-
+ Ist fuer keinen Frm eine Brush angegeben, so wird sal_False zurueck-
geliefert.
Ersterstellung MA 23. Dec. 92
Letzte Aenderung MA 04. Feb. 97
@@ -6474,10 +6488,10 @@ void SwFrm::Retouche( const SwPageFrm * pPage, const SwRect &rRect ) const
@return true, if a background brush for the frame is found
*/
-BOOL SwFrm::GetBackgroundBrush( const SvxBrushItem* & rpBrush,
+sal_Bool SwFrm::GetBackgroundBrush( const SvxBrushItem* & rpBrush,
const Color*& rpCol,
SwRect &rOrigRect,
- BOOL bLowerMode ) const
+ sal_Bool bLowerMode ) const
{
const SwFrm *pFrm = this;
ViewShell *pSh = getRootFrm()->GetCurrShell();
@@ -6486,7 +6500,7 @@ BOOL SwFrm::GetBackgroundBrush( const SvxBrushItem* & rpBrush,
rpCol = NULL;
do
{ if ( pFrm->IsPageFrm() && !pOpt->IsPageBack() )
- return FALSE;
+ return sal_False;
const SvxBrushItem &rBack = pFrm->GetAttrSet()->GetBackground();
if( pFrm->IsSctFrm() )
@@ -6544,7 +6558,7 @@ BOOL SwFrm::GetBackgroundBrush( const SvxBrushItem* & rpBrush,
{
SwBorderAttrAccess aAccess( SwFrm::GetCache(), pFrm );
const SwBorderAttrs &rAttrs = *aAccess.Get();
- ::lcl_CalcBorderRect( rOrigRect, pFrm, rAttrs, FALSE );
+ ::lcl_CalcBorderRect( rOrigRect, pFrm, rAttrs, sal_False );
}
else
{
@@ -6552,12 +6566,12 @@ BOOL SwFrm::GetBackgroundBrush( const SvxBrushItem* & rpBrush,
rOrigRect += pFrm->Frm().Pos();
}
}
- return TRUE;
+ return sal_True;
}
if ( bLowerMode )
/// Do not try to get background brush from parent (anchor/upper)
- return FALSE;
+ return sal_False;
/// get parent frame - anchor or upper - for next loop
if ( pFrm->IsFlyFrm() )
@@ -6569,7 +6583,7 @@ BOOL SwFrm::GetBackgroundBrush( const SvxBrushItem* & rpBrush,
} while ( pFrm );
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -6582,7 +6596,7 @@ BOOL SwFrm::GetBackgroundBrush( const SvxBrushItem* & rpBrush,
|*************************************************************************/
void SetOutDevAndWin( ViewShell *pSh, OutputDevice *pO,
- Window *pW, USHORT nZoom )
+ Window *pW, sal_uInt16 nZoom )
{
pSh->pOut = pO;
pSh->pWin = pW;
@@ -6606,8 +6620,8 @@ Graphic SwFlyFrmFmt::MakeGraphic( ImageMap* pMap )
ViewShell *pOldGlobal = pGlobalShell;
pGlobalShell = pSh;
- BOOL bNoteURL = pMap &&
- SFX_ITEM_SET != GetAttrSet().GetItemState( RES_URL, TRUE );
+ sal_Bool bNoteURL = pMap &&
+ SFX_ITEM_SET != GetAttrSet().GetItemState( RES_URL, sal_True );
if( bNoteURL )
{
ASSERT( !pNoteURL, "MakeGraphic: pNoteURL already used? " );
@@ -6617,7 +6631,7 @@ Graphic SwFlyFrmFmt::MakeGraphic( ImageMap* pMap )
OutputDevice *pOld = pSh->GetOut();
VirtualDevice aDev( *pOld );
- aDev.EnableOutput( FALSE );
+ aDev.EnableOutput( sal_False );
GDIMetaFile aMet;
MapMode aMap( pOld->GetMapMode().GetMapUnit() );
@@ -6646,9 +6660,9 @@ Graphic SwFlyFrmFmt::MakeGraphic( ImageMap* pMap )
pSh->DLPrePaint2(aRepaintRegion);
Window *pWin = pSh->GetWin();
- USHORT nZoom = pSh->GetViewOptions()->GetZoom();
+ sal_uInt16 nZoom = pSh->GetViewOptions()->GetZoom();
::SetOutDevAndWin( pSh, &aDev, 0, 100 );
- bFlyMetafile = TRUE;
+ bFlyMetafile = sal_True;
pFlyMetafileOut = pWin;
SwViewImp *pImp = pSh->Imp();
@@ -6678,7 +6692,7 @@ Graphic SwFlyFrmFmt::MakeGraphic( ImageMap* pMap )
pFlyOnlyDraw = 0;
pFlyMetafileOut = 0;
- bFlyMetafile = FALSE;
+ bFlyMetafile = sal_False;
::SetOutDevAndWin( pSh, pOld, pWin, nZoom );
// #i92711# end Pre/PostPaint encapsulation when pOut is back and content is painted
diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx
index d5ccc299be9f..c8a19fd5694b 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -86,14 +86,19 @@ SwSectionFrm::SwSectionFrm( SwSection &rSect, SwFrm* pSib ) :
CalcEndAtEndFlag();
}
+<<<<<<< local
SwSectionFrm::SwSectionFrm( SwSectionFrm &rSect, BOOL bMaster ) :
SwLayoutFrm( rSect.GetFmt(), rSect.getRootFrm() ),
+=======
+SwSectionFrm::SwSectionFrm( SwSectionFrm &rSect, sal_Bool bMaster ) :
+ SwLayoutFrm( rSect.GetFmt() ),
+>>>>>>> other
SwFlowFrm( (SwFrm&)*this ),
pSection( rSect.GetSection() )
{
bFtnAtEnd = rSect.IsFtnAtEnd();
bEndnAtEnd = rSect.IsEndnAtEnd();
- bLockJoin = FALSE;
+ bLockJoin = sal_False;
nType = FRMC_SECTION;
PROTOCOL( this, PROT_SECTION, bMaster ? ACT_CREATE_MASTER : ACT_CREATE_FOLLOW, &rSect )
@@ -104,15 +109,15 @@ SwSectionFrm::SwSectionFrm( SwSectionFrm &rSect, BOOL bMaster ) :
{
SwSectionFrm* pMaster = rSect.FindMaster();
pMaster->SetFollow( this );
- bIsFollow = TRUE;
+ bIsFollow = sal_True;
}
else
- rSect.bIsFollow = TRUE;
+ rSect.bIsFollow = sal_True;
SetFollow( &rSect );
}
else
{
- bIsFollow = TRUE;
+ bIsFollow = sal_True;
SetFollow( rSect.GetFollow() );
rSect.SetFollow( this );
if( !GetFollow() )
@@ -173,7 +178,7 @@ SwSectionFrm::~SwSectionFrm()
else if( HasFollow() )
{
PROTOCOL( this, PROT_SECTION, ACT_DEL_MASTER, GetFollow() )
- GetFollow()->bIsFollow = FALSE;
+ GetFollow()->bIsFollow = sal_False;
}
}
}
@@ -187,7 +192,7 @@ SwSectionFrm::~SwSectionFrm()
|* Letzte Aenderung AMA 17. Dec. 97
|*
|*************************************************************************/
-void SwSectionFrm::DelEmpty( BOOL bRemove )
+void SwSectionFrm::DelEmpty( sal_Bool bRemove )
{
if( IsColLocked() )
{
@@ -224,10 +229,10 @@ void SwSectionFrm::DelEmpty( BOOL bRemove )
// freigeben, deshalb wird die Size des Masters invalidiert.
if( !GetFollow() && !pMaster->IsColLocked() )
pMaster->InvalidateSize();
- bIsFollow = FALSE;
+ bIsFollow = sal_False;
}
else if( HasFollow() )
- GetFollow()->bIsFollow = FALSE;
+ GetFollow()->bIsFollow = sal_False;
pFollow = NULL;
if( pUp )
{
@@ -257,10 +262,10 @@ void SwSectionFrm::DelEmpty( BOOL bRemove )
|*************************************************************************/
void SwSectionFrm::Cut()
{
- _Cut( TRUE );
+ _Cut( sal_True );
}
-void SwSectionFrm::_Cut( BOOL bRemove )
+void SwSectionFrm::_Cut( sal_Bool bRemove )
{
ASSERT( GetUpper(), "Cut ohne Upper()." );
@@ -409,10 +414,10 @@ void SwSectionFrm::Paste( SwFrm* pParent, SwFrm* pSibling )
InsertGroupBefore( pParent, pSibling, pSect );
pSect->Init();
- (pSect->*fnRect->fnMakePos)( pSect->GetUpper(), pSect->GetPrev(), TRUE);
+ (pSect->*fnRect->fnMakePos)( pSect->GetUpper(), pSect->GetPrev(), sal_True);
if( !((SwLayoutFrm*)pParent)->Lower() )
{
- SwSectionFrm::MoveCntntAndDelete( (SwSectionFrm*)pParent, FALSE );
+ SwSectionFrm::MoveCntntAndDelete( (SwSectionFrm*)pParent, sal_False );
pParent = this;
}
}
@@ -461,24 +466,24 @@ void SwSectionFrm::Paste( SwFrm* pParent, SwFrm* pSibling )
|*
|*************************************************************************/
-BOOL SwSectionFrm::HasToBreak( const SwFrm* pFrm ) const
+sal_Bool SwSectionFrm::HasToBreak( const SwFrm* pFrm ) const
{
if( !pFrm->IsSctFrm() )
- return FALSE;
+ return sal_False;
SwSectionFmt *pTmp = (SwSectionFmt*)GetFmt();
// if( !pTmp->GetSect().GetValue() )
-// return FALSE;
+// return sal_False;
const SwFrmFmt *pOtherFmt = ((SwSectionFrm*)pFrm)->GetFmt();
do
{
pTmp = pTmp->GetParent();
if( !pTmp )
- return FALSE;
+ return sal_False;
if( pTmp == pOtherFmt )
- return TRUE;
- } while( TRUE ); // ( pTmp->GetSect().GetValue() );
+ return sal_True;
+ } while( sal_True ); // ( pTmp->GetSect().GetValue() );
}
/*************************************************************************
@@ -523,7 +528,7 @@ void SwSectionFrm::MergeNext( SwSectionFrm* pNxt )
}
SetFollow( pNxt->GetFollow() );
pNxt->SetFollow( NULL );
- pNxt->bIsFollow = FALSE;
+ pNxt->bIsFollow = sal_False;
pNxt->Cut();
delete pNxt;
InvalidateSize();
@@ -545,15 +550,15 @@ void SwSectionFrm::MergeNext( SwSectionFrm* pNxt )
|*
|*************************************************************************/
-BOOL SwSectionFrm::SplitSect( SwFrm* pFrm, BOOL bApres )
+sal_Bool SwSectionFrm::SplitSect( SwFrm* pFrm, sal_Bool bApres )
{
ASSERT( pFrm, "SplitSect: Why?" );
SwFrm* pOther = bApres ? pFrm->FindNext() : pFrm->FindPrev();
if( !pOther )
- return FALSE;
+ return sal_False;
SwSectionFrm* pSect = pOther->FindSctFrm();
if( pSect != this )
- return FALSE;
+ return sal_False;
// Den Inhalt zur Seite stellen
SwFrm* pSav = ::SaveCntnt( this, bApres ? pOther : pFrm );
ASSERT( pSav, "SplitSect: What's on?" );
@@ -563,7 +568,7 @@ BOOL SwSectionFrm::SplitSect( SwFrm* pFrm, BOOL bApres )
pNew->InsertBehind( pSect->GetUpper(), pSect );
pNew->Init();
SWRECTFN( this )
- (pNew->*fnRect->fnMakePos)( NULL, pSect, TRUE );
+ (pNew->*fnRect->fnMakePos)( NULL, pSect, sal_True );
// OD 25.03.2003 #108339# - restore content:
// determine layout frame for restoring content after the initialization
// of the section frame. In the section initialization the columns are
@@ -581,9 +586,9 @@ BOOL SwSectionFrm::SplitSect( SwFrm* pFrm, BOOL bApres )
pNew->SetFollow( GetFollow() );
SetFollow( NULL );
}
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -603,7 +608,7 @@ BOOL SwSectionFrm::SplitSect( SwFrm* pFrm, BOOL bApres )
// Wenn ein mehrspaltiger Bereich aufgehoben wird, muessen die ContentFrms
// invalidiert werden
-void lcl_InvalidateInfFlags( SwFrm* pFrm, BOOL bInva )
+void lcl_InvalidateInfFlags( SwFrm* pFrm, sal_Bool bInva )
{
while ( pFrm )
{
@@ -615,7 +620,7 @@ void lcl_InvalidateInfFlags( SwFrm* pFrm, BOOL bInva )
pFrm->_InvalidatePrt();
}
if( pFrm->IsLayoutFrm() )
- lcl_InvalidateInfFlags( ((SwLayoutFrm*)pFrm)->GetLower(), FALSE );
+ lcl_InvalidateInfFlags( ((SwLayoutFrm*)pFrm)->GetLower(), sal_False );
pFrm = pFrm->GetNext();
}
}
@@ -640,10 +645,10 @@ SwCntntFrm* lcl_GetNextCntntFrm( const SwLayoutFrm* pLay, bool bFwd )
// #100926#
const SwFrm* pFrm = pLay;
SwCntntFrm *pCntntFrm = 0;
- BOOL bGoingUp = TRUE;
+ sal_Bool bGoingUp = sal_True;
do {
const SwFrm *p = 0;
- BOOL bGoingFwdOrBwd = FALSE, bGoingDown = FALSE;
+ sal_Bool bGoingFwdOrBwd = sal_False, bGoingDown = sal_False;
bGoingDown = !bGoingUp && ( 0 != ( p = pFrm->IsLayoutFrm() ? ((SwLayoutFrm*)pFrm)->Lower() : 0 ) );
if ( !bGoingDown )
@@ -675,9 +680,9 @@ SwCntntFrm* lcl_GetNextCntntFrm( const SwLayoutFrm* pLay, bool bFwd )
? pLayFrm->GetNextLayoutLeaf() \
: pLayFrm )
-void SwSectionFrm::MoveCntntAndDelete( SwSectionFrm* pDel, BOOL bSave )
+void SwSectionFrm::MoveCntntAndDelete( SwSectionFrm* pDel, sal_Bool bSave )
{
- BOOL bSize = pDel->Lower() && pDel->Lower()->IsColumnFrm();
+ sal_Bool bSize = pDel->Lower() && pDel->Lower()->IsColumnFrm();
SwFrm* pPrv = pDel->GetPrev();
SwLayoutFrm* pUp = pDel->GetUpper();
// OD 27.03.2003 #i12711# - initialize local pointer variables.
@@ -714,13 +719,13 @@ void SwSectionFrm::MoveCntntAndDelete( SwSectionFrm* pDel, BOOL bSave )
// Jetzt wird der Inhalt beseite gestellt und der Frame zerstoert
SwFrm *pSave = bSave ? ::SaveCntnt( pDel ) : NULL;
- BOOL bOldFtn = TRUE;
+ sal_Bool bOldFtn = sal_True;
if( pSave && pUp->IsFtnFrm() )
{
bOldFtn = ((SwFtnFrm*)pUp)->IsColLocked();
((SwFtnFrm*)pUp)->ColLock();
}
- pDel->DelEmpty( TRUE );
+ pDel->DelEmpty( sal_True );
delete pDel;
if( pParent )
{ // Hier wird die geeignete Einfuegeposition gesucht
@@ -757,7 +762,7 @@ void SwSectionFrm::MoveCntntAndDelete( SwSectionFrm* pDel, BOOL bSave )
pPrvSct->InsertBehind( pUp, pPrv );
pPrvSct->Init();
SWRECTFN( pUp )
- (pPrvSct->*fnRect->fnMakePos)( pUp, pPrv, TRUE );
+ (pPrvSct->*fnRect->fnMakePos)( pUp, pPrv, sal_True );
pUp = FIRSTLEAF( pPrvSct );
pPrv = NULL;
}
@@ -793,10 +798,10 @@ void SwSectionFrm::MakeAll()
if( GetUpper() )
{
SWRECTFN( GetUpper() )
- (this->*fnRect->fnMakePos)( GetUpper(), GetPrev(), FALSE );
+ (this->*fnRect->fnMakePos)( GetUpper(), GetPrev(), sal_False );
}
}
- bValidSize = bValidPos = bValidPrtArea = TRUE;
+ bValidSize = bValidPos = bValidPrtArea = sal_True;
return;
}
LockJoin(); //Ich lass mich nicht unterwegs vernichten.
@@ -826,8 +831,8 @@ void SwSectionFrm::MakeAll()
// Ein Bereich mit Follow nimmt allen Platz bis zur Unterkante des Uppers
// in Anspruch. Bewegt er sich, so kann seine Groesse zu- oder abnehmen...
- if( !bValidPos && ToMaximize( FALSE ) )
- bValidSize = FALSE;
+ if( !bValidPos && ToMaximize( sal_False ) )
+ bValidSize = sal_False;
#if OSL_DEBUG_LEVEL > 1
const SwFmtCol &rCol = GetFmt()->GetCol();
@@ -836,13 +841,13 @@ void SwSectionFrm::MakeAll()
SwLayoutFrm::MakeAll();
UnlockJoin();
if( pSection && IsSuperfluous() )
- DelEmpty( FALSE );
+ DelEmpty( sal_False );
}
-BOOL SwSectionFrm::ShouldBwdMoved( SwLayoutFrm *, BOOL , BOOL & )
+sal_Bool SwSectionFrm::ShouldBwdMoved( SwLayoutFrm *, sal_Bool , sal_Bool & )
{
- ASSERT( FALSE, "Hups, wo ist meine Tarnkappe?" );
- return FALSE;
+ ASSERT( sal_False, "Hups, wo ist meine Tarnkappe?" );
+ return sal_False;
}
const SwSectionFmt* SwSectionFrm::_GetEndSectFmt() const
@@ -859,7 +864,7 @@ const SwSectionFmt* SwSectionFrm::_GetEndSectFmt() const
}
void lcl_FindCntntFrm( SwCntntFrm* &rpCntntFrm, SwFtnFrm* &rpFtnFrm,
- SwFrm* pFrm, BOOL &rbChkFtn )
+ SwFrm* pFrm, sal_Bool &rbChkFtn )
{
if( pFrm )
{
@@ -888,7 +893,7 @@ void lcl_FindCntntFrm( SwCntntFrm* &rpCntntFrm, SwFtnFrm* &rpFtnFrm,
}
}
-SwCntntFrm *SwSectionFrm::FindLastCntnt( BYTE nMode )
+SwCntntFrm *SwSectionFrm::FindLastCntnt( sal_uInt8 nMode )
{
SwCntntFrm *pRet = NULL;
SwFtnFrm *pFtnFrm = NULL;
@@ -909,9 +914,9 @@ SwCntntFrm *SwSectionFrm::FindLastCntnt( BYTE nMode )
pSect = (SwSectionFrm*)pTmp;
else
break;
- } while( TRUE );
+ } while( sal_True );
}
- BOOL bFtnFound = nMode == FINDMODE_ENDNOTE;
+ sal_Bool bFtnFound = nMode == FINDMODE_ENDNOTE;
do
{
lcl_FindCntntFrm( pRet, pFtnFrm, pSect->Lower(), bFtnFound );
@@ -925,16 +930,16 @@ SwCntntFrm *SwSectionFrm::FindLastCntnt( BYTE nMode )
return pRet;
}
-BOOL SwSectionFrm::CalcMinDiff( SwTwips& rMinDiff ) const
+sal_Bool SwSectionFrm::CalcMinDiff( SwTwips& rMinDiff ) const
{
- if( ToMaximize( TRUE ) )
+ if( ToMaximize( sal_True ) )
{
SWRECTFN( this )
rMinDiff = (GetUpper()->*fnRect->fnGetPrtBottom)();
rMinDiff = (Frm().*fnRect->fnBottomDist)( rMinDiff );
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -951,7 +956,7 @@ BOOL SwSectionFrm::CalcMinDiff( SwTwips& rMinDiff ) const
*
*************************************************************************/
-SwFtnFrm* lcl_FindEndnote( SwSectionFrm* &rpSect, BOOL &rbEmpty,
+SwFtnFrm* lcl_FindEndnote( SwSectionFrm* &rpSect, sal_Bool &rbEmpty,
SwLayouter *pLayouter )
{
// if rEmpty is set, the rpSect is already searched
@@ -993,16 +998,16 @@ SwFtnFrm* lcl_FindEndnote( SwSectionFrm* &rpSect, BOOL &rbEmpty,
}
rpSect = pSect;
pSect = pLayouter ? pSect->GetFollow() : NULL;
- rbEmpty = TRUE;
+ rbEmpty = sal_True;
}
return NULL;
}
-void lcl_ColumnRefresh( SwSectionFrm* pSect, BOOL bFollow )
+void lcl_ColumnRefresh( SwSectionFrm* pSect, sal_Bool bFollow )
{
while( pSect )
{
- BOOL bOldLock = pSect->IsColLocked();
+ sal_Bool bOldLock = pSect->IsColLocked();
pSect->ColLock();
if( pSect->Lower() && pSect->Lower()->IsColumnFrm() )
{
@@ -1033,19 +1038,19 @@ void SwSectionFrm::CollectEndnotes( SwLayouter* pLayouter )
SwSectionFrm* pSect = this;
SwFtnFrm* pFtn;
- BOOL bEmpty = FALSE;
+ sal_Bool bEmpty = sal_False;
// pSect is the last sectionfrm without endnotes or the this-pointer
// the first sectionfrm with endnotes may be destroyed, when the endnotes
// is cutted
while( 0 != (pFtn = lcl_FindEndnote( pSect, bEmpty, pLayouter )) )
pLayouter->CollectEndnote( pFtn );
if( pLayouter->HasEndnotes() )
- lcl_ColumnRefresh( this, TRUE );
+ lcl_ColumnRefresh( this, sal_True );
}
/*************************************************************************
|*
-|* SwSectionFrm::_CheckClipping( BOOL bGrow, BOOL bMaximize )
+|* SwSectionFrm::_CheckClipping( sal_Bool bGrow, sal_Bool bMaximize )
|*
|* Beschreibung: Passt die Groesse an die Umgebung an.
|* Wer einen Follow oder Fussnoten besitzt, soll bis zur Unterkante
@@ -1058,7 +1063,7 @@ void SwSectionFrm::CollectEndnotes( SwLayouter* pLayouter )
/// OD 18.09.2002 #100522#
/// perform calculation of content, only if height has changed.
-void SwSectionFrm::_CheckClipping( BOOL bGrow, BOOL bMaximize )
+void SwSectionFrm::_CheckClipping( sal_Bool bGrow, sal_Bool bMaximize )
{
SWRECTFN( this )
long nDiff;
@@ -1089,7 +1094,7 @@ void SwSectionFrm::_CheckClipping( BOOL bGrow, BOOL bMaximize )
if( !bCalc && !bGrow && IsAnyNoteAtEnd() && !IsInFtn() )
{
SwSectionFrm *pSect = this;
- BOOL bEmpty = FALSE;
+ sal_Bool bEmpty = sal_False;
SwLayoutFrm* pFtn = IsEndnAtEnd() ?
lcl_FindEndnote( pSect, bEmpty, NULL ) : NULL;
if( pFtn )
@@ -1137,7 +1142,7 @@ void SwSectionFrm::_CheckClipping( BOOL bGrow, BOOL bMaximize )
{
if( Lower()->IsColumnFrm() )
{
- lcl_ColumnRefresh( this, FALSE );
+ lcl_ColumnRefresh( this, sal_False );
::CalcCntnt( this );
}
else
@@ -1163,8 +1168,8 @@ void SwSectionFrm::SimpleFormat()
// assure notifications on position changes.
const SwLayNotify aNotify( this );
// <--
- (this->*fnRect->fnMakePos)( GetUpper(), GetPrev(), FALSE );
- bValidPos = TRUE;
+ (this->*fnRect->fnMakePos)( GetUpper(), GetPrev(), sal_False );
+ bValidPos = sal_True;
}
SwTwips nDeadLine = (GetUpper()->*fnRect->fnGetPrtBottom)();
// OD 22.10.2002 #97265# - call always method <lcl_ColumnRefresh(..)>, in
@@ -1178,7 +1183,7 @@ void SwSectionFrm::SimpleFormat()
nTop = nHeight;
(this->*fnRect->fnSetYMargins)( nTop, 0 );
}
- lcl_ColumnRefresh( this, FALSE );
+ lcl_ColumnRefresh( this, sal_False );
UnlockJoin();
}
@@ -1334,15 +1339,21 @@ void SwSectionFrm::Format( const SwBorderAttrs *pAttr )
{
if( !pSection ) // Durch DelEmpty
{
+<<<<<<< local
ASSERT( getRootFrm()->IsInDelList( this ), "SectionFrm without Section" );
bValidSize = bValidPos = bValidPrtArea = TRUE;
+=======
+ ASSERT( GetFmt()->GetDoc()->GetRootFrm()->IsInDelList( this ),
+ "SectionFrm without Section" );
+ bValidSize = bValidPos = bValidPrtArea = sal_True;
+>>>>>>> other
return;
}
SWRECTFN( this )
if ( !bValidPrtArea )
{
PROTOCOL( this, PROT_PRTAREA, 0, 0 )
- bValidPrtArea = TRUE;
+ bValidPrtArea = sal_True;
SwTwips nUpper = CalcUpperSpace();
// #109700# LRSpace for sections
@@ -1351,7 +1362,7 @@ void SwSectionFrm::Format( const SwBorderAttrs *pAttr )
if( nUpper != (this->*fnRect->fnGetTopMargin)() )
{
- bValidSize = FALSE;
+ bValidSize = sal_False;
SwFrm* pOwn = ContainsAny();
if( pOwn )
pOwn->_InvalidatePos();
@@ -1363,16 +1374,16 @@ void SwSectionFrm::Format( const SwBorderAttrs *pAttr )
{
PROTOCOL_ENTER( this, PROT_SIZE, 0, 0 )
const long nOldHeight = (Frm().*fnRect->fnGetHeight)();
- BOOL bOldLock = IsColLocked();
+ sal_Bool bOldLock = IsColLocked();
ColLock();
- bValidSize = TRUE;
+ bValidSize = sal_True;
//die Groesse wird nur dann vom Inhalt bestimmt, wenn der SectFrm
//keinen Follow hat. Anderfalls fuellt er immer den Upper bis
//zur Unterkante aus. Fuer den Textfluss ist nicht er, sondern sein
//Inhalt selbst verantwortlich.
- BOOL bMaximize = ToMaximize( FALSE );
+ sal_Bool bMaximize = ToMaximize( sal_False );
// OD 2004-05-17 #i28701# - If the wrapping style has to be considered
// on object positioning, an extra formatting has to be performed
@@ -1395,7 +1406,7 @@ void SwSectionFrm::Format( const SwBorderAttrs *pAttr )
// which still have a width of 0.
const sal_Bool bHasColumns = Lower() && Lower()->IsColumnFrm();
if ( bHasColumns && Lower()->GetNext() )
- AdjustColumns( 0, FALSE );
+ AdjustColumns( 0, sal_False );
if( GetUpper() )
{
@@ -1410,10 +1421,16 @@ 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(..)>.
+<<<<<<< local
const ViewShell *pSh = getRootFrm()->GetCurrShell();
_CheckClipping( pSh && pSh->GetViewOptions()->getBrowseMode(), bMaximize );
bMaximize = ToMaximize( FALSE );
bValidSize = TRUE;
+=======
+ _CheckClipping( GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE), bMaximize );
+ bMaximize = ToMaximize( sal_False );
+ bValidSize = sal_True;
+>>>>>>> other
}
//Breite der Spalten pruefen und ggf. einstellen.
@@ -1442,11 +1459,11 @@ void SwSectionFrm::Format( const SwBorderAttrs *pAttr )
// <--
{
SwFrm* pOld = GetFollow();
- GetFollow()->DelEmpty( FALSE );
+ GetFollow()->DelEmpty( sal_False );
if( pOld == GetFollow() )
break;
}
- bMaximize = ToMaximize( FALSE );
+ bMaximize = ToMaximize( sal_False );
nRemaining += (pFrm->Frm().*fnRect->fnGetHeight)();
}
else
@@ -1480,7 +1497,7 @@ void SwSectionFrm::Format( const SwBorderAttrs *pAttr )
long nTmpDiff = (*fnRect->fnYDiff)( nBottom, nDeadLine );
if( nTmpDiff > 0 )
{
- nTmpDiff = GetUpper()->Grow( nTmpDiff, TRUE );
+ nTmpDiff = GetUpper()->Grow( nTmpDiff, sal_True );
nDeadLine = (*fnRect->fnYInc)( nDeadLine, nTmpDiff );
nTmpDiff = (*fnRect->fnYDiff)( nBottom, nDeadLine );
if( nTmpDiff > 0 )
@@ -1514,13 +1531,13 @@ void SwSectionFrm::Format( const SwBorderAttrs *pAttr )
pFrm = ((SwLayoutFrm*)pFrm)->Lower();
CalcFtnCntnt();
}
- BOOL bUnderSz = FALSE;
+ sal_Bool bUnderSz = sal_False;
while( pFrm )
{
if( pFrm->IsTxtFrm() && ((SwTxtFrm*)pFrm)->IsUndersized() )
{
pFrm->Prepare( PREP_ADJUST_FRM );
- bUnderSz = TRUE;
+ bUnderSz = sal_True;
}
pFrm = pFrm->GetNext();
}
@@ -1533,7 +1550,7 @@ void SwSectionFrm::Format( const SwBorderAttrs *pAttr )
//Unterkante des Uppers nicht ueberschreiten. Fuer Sections mit
//Follows die Unterkante auch nicht unterschreiten.
if ( GetUpper() )
- _CheckClipping( TRUE, bMaximize );
+ _CheckClipping( sal_True, bMaximize );
if( !bOldLock )
ColUnlock();
long nDiff = nOldHeight - (Frm().*fnRect->fnGetHeight)();
@@ -1545,7 +1562,7 @@ void SwSectionFrm::Format( const SwBorderAttrs *pAttr )
GetUpper()->Shrink( nDiff );
}
if( IsUndersized() )
- bValidPrtArea = TRUE;
+ bValidPrtArea = sal_True;
}
}
@@ -1555,7 +1572,7 @@ void SwSectionFrm::Format( const SwBorderAttrs *pAttr )
|*
|* Beschreibung Liefert das naechste Layoutblatt in das der Frame
|* gemoved werden kann.
-|* Neue Seiten werden nur dann erzeugt, wenn der Parameter TRUE ist.
+|* Neue Seiten werden nur dann erzeugt, wenn der Parameter sal_True ist.
|* Ersterstellung AMA 07. Jan. 98
|* Letzte Aenderung AMA 07. Jan. 98
|*
@@ -1584,7 +1601,7 @@ SwLayoutFrm *SwFrm::GetNextSctLeaf( MakePageType eMakePage )
//GetLeaf gerufen wird.
// SwSectionFrm *pSect = GetUpper()->FindSctFrm();
SwSectionFrm *pSect = FindSctFrm();
- BOOL bWrongPage = FALSE;
+ sal_Bool bWrongPage = sal_False;
ASSERT( pSect, "GetNextSctLeaf: Missing SectionFrm" );
// Hier eine Abkuerzung fuer Bereiche mit Follows,
@@ -1597,7 +1614,7 @@ SwLayoutFrm *SwFrm::GetNextSctLeaf( MakePageType eMakePage )
{
SwPageFrm *pPg = pSect->GetFollow()->FindPageFrm();
if( WrongPageDesc( pPg ) )
- bWrongPage = TRUE;
+ bWrongPage = sal_True;
else
return FIRSTLEAF( pSect->GetFollow() );
}
@@ -1625,7 +1642,7 @@ SwLayoutFrm *SwFrm::GetNextSctLeaf( MakePageType eMakePage )
SwPageFrm* pNxtPg = pUp->IsPageFrm() ?
(SwPageFrm*)pUp : pUp->FindPageFrm();
if( WrongPageDesc( pNxtPg ) )
- bWrongPage = TRUE;
+ bWrongPage = sal_True;
else
return FIRSTLEAF( pSect->GetFollow() );
}
@@ -1634,8 +1651,8 @@ SwLayoutFrm *SwFrm::GetNextSctLeaf( MakePageType eMakePage )
}
// Immer im gleichen Bereich landen: Body wieder in Body etc.
- const BOOL bBody = IsInDocBody();
- const BOOL bFtnPage = FindPageFrm()->IsFtnPage();
+ const sal_Bool bBody = IsInDocBody();
+ const sal_Bool bFtnPage = FindPageFrm()->IsFtnPage();
SwLayoutFrm *pLayLeaf;
// Eine Abkuerzung fuer TabFrms, damit nicht alle Zellen abgehuehnert werden
@@ -1660,7 +1677,7 @@ SwLayoutFrm *SwFrm::GetNextSctLeaf( MakePageType eMakePage )
//nicht wieder vom Anfang gesucht
//wird.
- while( TRUE )
+ while( sal_True )
{
if( pLayLeaf )
{
@@ -1691,7 +1708,7 @@ SwLayoutFrm *SwFrm::GetNextSctLeaf( MakePageType eMakePage )
if( bWrongPage )
break; // there's a column between me and my right page
pLayLeaf = 0;
- bWrongPage = TRUE;
+ bWrongPage = sal_True;
pOldLayLeaf = 0;
continue;
}
@@ -1703,7 +1720,7 @@ SwLayoutFrm *SwFrm::GetNextSctLeaf( MakePageType eMakePage )
( eMakePage == MAKEPAGE_APPEND || eMakePage == MAKEPAGE_INSERT ) )
{
InsertPage(pOldLayLeaf ? pOldLayLeaf->FindPageFrm() : FindPageFrm(),
- FALSE );
+ sal_False );
//und nochmal das ganze
pLayLeaf = pOldLayLeaf ? pOldLayLeaf : GetNextLayoutLeaf();
continue;
@@ -1729,11 +1746,11 @@ SwLayoutFrm *SwFrm::GetNextSctLeaf( MakePageType eMakePage )
return pLayLeaf;
else
{
- pNew = new SwSectionFrm( *pSect, FALSE );
+ pNew = new SwSectionFrm( *pSect, sal_False );
pNew->InsertBefore( pLayLeaf, pLayLeaf->Lower() );
pNew->Init();
SWRECTFN( pNew )
- (pNew->*fnRect->fnMakePos)( pLayLeaf, NULL, TRUE );
+ (pNew->*fnRect->fnMakePos)( pLayLeaf, NULL, sal_True );
// Wenn unser Bereichsframe einen Nachfolger hat, so muss dieser
// umgehaengt werden hinter den neuen Follow der Bereichsframes.
@@ -1767,13 +1784,13 @@ SwLayoutFrm *SwFrm::GetNextSctLeaf( MakePageType eMakePage )
}
if( pNxtCntnt )
{
- SwFtnBossFrm* pOldBoss = pSect->FindFtnBossFrm( TRUE );
- if( pOldBoss == pNxtCntnt->FindFtnBossFrm( TRUE ) )
+ SwFtnBossFrm* pOldBoss = pSect->FindFtnBossFrm( sal_True );
+ if( pOldBoss == pNxtCntnt->FindFtnBossFrm( sal_True ) )
{
SwSaveFtnHeight aHeight( pOldBoss,
pOldBoss->Frm().Top() + pOldBoss->Frm().Height() );
pSect->GetUpper()->MoveLowerFtns( pNxtCntnt, pOldBoss,
- pLayLeaf->FindFtnBossFrm( TRUE ), FALSE );
+ pLayLeaf->FindFtnBossFrm( sal_True ), sal_False );
}
}
((SwFlowFrm*)pNxt)->MoveSubTree( pLayLeaf, pNew->GetNext() );
@@ -1811,7 +1828,7 @@ SwLayoutFrm *SwFrm::GetPrevSctLeaf( MakePageType )
pCol = GetUpper()->GetUpper();
else
pCol = NULL;
- BOOL bJump = FALSE;
+ sal_Bool bJump = sal_False;
if( pCol )
{
if( pCol->GetPrev() )
@@ -1823,10 +1840,10 @@ SwLayoutFrm *SwFrm::GetPrevSctLeaf( MakePageType )
if( ((SwLayoutFrm*)pCol->Lower())->Lower() )
{
if( bJump ) // Haben wir eine leere Spalte uebersprungen?
- SwFlowFrm::SetMoveBwdJump( TRUE );
+ SwFlowFrm::SetMoveBwdJump( sal_True );
return (SwLayoutFrm*)pCol->Lower(); // Der Spaltenbody
}
- bJump = TRUE;
+ bJump = sal_True;
} while( pCol->GetPrev() );
// Hier landen wir, wenn alle Spalten leer sind,
@@ -1838,7 +1855,7 @@ SwLayoutFrm *SwFrm::GetPrevSctLeaf( MakePageType )
}
if( bJump ) // Haben wir eine leere Spalte uebersprungen?
- SwFlowFrm::SetMoveBwdJump( TRUE );
+ SwFlowFrm::SetMoveBwdJump( sal_True );
// Innerhalb von Bereichen in Tabellen oder Bereichen in Kopf/Fusszeilen kann
// nur ein Spaltenwechsel erfolgen, eine der oberen Abkuerzungen haette
@@ -1877,8 +1894,8 @@ SwLayoutFrm *SwFrm::GetPrevSctLeaf( MakePageType )
}
}
- const BOOL bBody = IsInDocBody();
- const BOOL bFly = IsInFly();
+ const sal_Bool bBody = IsInDocBody();
+ const sal_Bool bFly = IsInFly();
SwLayoutFrm *pLayLeaf = GetPrevLayoutLeaf();
SwLayoutFrm *pPrevLeaf = 0;
@@ -1916,7 +1933,7 @@ SwLayoutFrm *SwFrm::GetPrevSctLeaf( MakePageType )
pPrevLeaf = pLayLeaf;
pLayLeaf = pLayLeaf->GetPrevLayoutLeaf();
if ( pLayLeaf )
- SwFlowFrm::SetMoveBwdJump( TRUE );
+ SwFlowFrm::SetMoveBwdJump( sal_True );
}
else if ( bFly )
break; //Cntnts in Flys sollte jedes Layout-Blatt recht sein. Warum?
@@ -1949,11 +1966,11 @@ SwLayoutFrm *SwFrm::GetPrevSctLeaf( MakePageType )
}
if( !pNew )
{
- pNew = new SwSectionFrm( *pSect, TRUE );
+ pNew = new SwSectionFrm( *pSect, sal_True );
pNew->InsertBefore( pLayLeaf, NULL );
pNew->Init();
SWRECTFN( pNew )
- (pNew->*fnRect->fnMakePos)( pLayLeaf, pNew->GetPrev(), TRUE );
+ (pNew->*fnRect->fnMakePos)( pLayLeaf, pNew->GetPrev(), sal_True );
pLayLeaf = FIRSTLEAF( pNew );
if( !pNew->Lower() ) // einspaltige Bereiche formatieren
@@ -1982,7 +1999,7 @@ SwLayoutFrm *SwFrm::GetPrevSctLeaf( MakePageType )
if( pLayLeaf != pTmpLay )
{
pLayLeaf = pTmpLay;
- SwFlowFrm::SetMoveBwdJump( TRUE );
+ SwFlowFrm::SetMoveBwdJump( sal_True );
}
}
}
@@ -2010,14 +2027,14 @@ SwTwips lcl_DeadLine( const SwFrm* pFrm )
// SwSectionFrm::Growable(..) prueft, ob der SectionFrm noch wachsen kann,
// ggf. muss die Umgebung gefragt werden
-BOOL SwSectionFrm::Growable() const
+sal_Bool SwSectionFrm::Growable() const
{
SWRECTFN( this )
if( (*fnRect->fnYDiff)( lcl_DeadLine( this ),
(Frm().*fnRect->fnGetBottom)() ) > 0 )
- return TRUE;
+ return sal_True;
- return ( GetUpper() && ((SwFrm*)GetUpper())->Grow( LONG_MAX, TRUE ) );
+ return ( GetUpper() && ((SwFrm*)GetUpper())->Grow( LONG_MAX, sal_True ) );
}
/*************************************************************************
@@ -2029,7 +2046,7 @@ BOOL SwSectionFrm::Growable() const
|*
|*************************************************************************/
-SwTwips SwSectionFrm::_Grow( SwTwips nDist, BOOL bTst )
+SwTwips SwSectionFrm::_Grow( SwTwips nDist, sal_Bool bTst )
{
if ( !IsColLocked() && !HasFixSize() )
{
@@ -2041,7 +2058,7 @@ SwTwips SwSectionFrm::_Grow( SwTwips nDist, BOOL bTst )
if ( nDist <= 0L )
return 0L;
- BOOL bInCalcCntnt = GetUpper() && IsInFly() && FindFlyFrm()->IsLocked();
+ sal_Bool bInCalcCntnt = GetUpper() && IsInFly() && FindFlyFrm()->IsLocked();
// OD 2004-03-15 #116561# - allow grow in online layout
BOOL bGrow = !Lower() || !Lower()->IsColumnFrm() || !Lower()->GetNext() ||
GetSection()->GetFmt()->GetBalancedColumns().GetValue();
@@ -2063,7 +2080,7 @@ SwTwips SwSectionFrm::_Grow( SwTwips nDist, BOOL bTst )
}
SwTwips nSpace = nGrow;
if( !bInCalcCntnt && nGrow < nDist && GetUpper() )
- nGrow += GetUpper()->Grow( LONG_MAX, TRUE );
+ nGrow += GetUpper()->Grow( LONG_MAX, sal_True );
if( nGrow > nDist )
nGrow = nDist;
@@ -2083,7 +2100,7 @@ SwTwips SwSectionFrm::_Grow( SwTwips nDist, BOOL bTst )
if( bInCalcCntnt )
_InvalidateSize();
else if( nSpace < nGrow && nDist != nSpace + GetUpper()->
- Grow( nGrow - nSpace, FALSE ) )
+ Grow( nGrow - nSpace, sal_False ) )
InvalidateSize();
else
{
@@ -2148,11 +2165,11 @@ SwTwips SwSectionFrm::_Grow( SwTwips nDist, BOOL bTst )
return 0L;
}
-SwTwips SwSectionFrm::_Shrink( SwTwips nDist, BOOL bTst )
+SwTwips SwSectionFrm::_Shrink( SwTwips nDist, sal_Bool bTst )
{
if ( Lower() && !IsColLocked() && !HasFixSize() )
{
- if( ToMaximize( FALSE ) )
+ if( ToMaximize( sal_False ) )
{
if( !bTst )
InvalidateSize();
@@ -2252,12 +2269,12 @@ SwTwips SwSectionFrm::_Shrink( SwTwips nDist, BOOL bTst )
|*
|*************************************************************************/
-BOOL SwSectionFrm::MoveAllowed( const SwFrm* pFrm) const
+sal_Bool SwSectionFrm::MoveAllowed( const SwFrm* pFrm) const
{
// Gibt es einen Follow oder ist der Frame nicht in der letzten Spalte?
if( HasFollow() || ( pFrm->GetUpper()->IsColBodyFrm() &&
pFrm->GetUpper()->GetUpper()->GetNext() ) )
- return TRUE;
+ return sal_True;
if( pFrm->IsInFtn() )
{
if( IsInFtn() )
@@ -2265,11 +2282,11 @@ BOOL SwSectionFrm::MoveAllowed( const SwFrm* pFrm) const
if( GetUpper()->IsInSct() )
{
if( Growable() )
- return FALSE;
+ return sal_False;
return GetUpper()->FindSctFrm()->MoveAllowed( this );
}
else
- return TRUE;
+ return sal_True;
}
// The content of footnote inside a columned sectionfrm is moveable
// except in the last column
@@ -2279,30 +2296,30 @@ BOOL SwSectionFrm::MoveAllowed( const SwFrm* pFrm) const
// The first paragraph in the first footnote in the first column
// in the sectionfrm at the top of the page is not moveable,
// if the columnbody is empty.
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pLay->GetIndPrev() || pFrm->GetIndPrev() ||
pFrm->FindFtnFrm()->GetPrev() )
- bRet = TRUE;
+ bRet = sal_True;
else
{
SwLayoutFrm* pBody = ((SwColumnFrm*)pLay)->FindBodyCont();
if( pBody && pBody->Lower() )
- bRet = TRUE;
+ bRet = sal_True;
}
if( bRet && ( IsFtnAtEnd() || !Growable() ) )
- return TRUE;
+ return sal_True;
}
}
// Oder kann der Bereich noch wachsen?
if( !IsColLocked() && Growable() )
- return FALSE;
+ return sal_False;
// Jetzt muss untersucht werden, ob es ein Layoutblatt gibt, in dem
// ein Bereichsfollow erzeugt werden kann.
if( IsInTab() || ( !IsInDocBody() && FindFooterOrHeader() ) )
- return FALSE; // In Tabellen/Kopf/Fusszeilen geht es nicht
+ return sal_False; // In Tabellen/Kopf/Fusszeilen geht es nicht
if( IsInFly() ) // Bei spaltigen oder verketteten Rahmen
return 0 != ((SwFrm*)GetUpper())->GetNextLeaf( MAKEPAGE_NONE );
- return TRUE;
+ return sal_True;
}
/** Called for a frame inside a section with no direct previous frame (or only
@@ -2376,25 +2393,25 @@ SwFrm* SwFrm::_GetIndNext()
return NULL;
}
-BOOL SwSectionFrm::IsDescendantFrom( const SwSectionFmt* pFmt ) const
+sal_Bool SwSectionFrm::IsDescendantFrom( const SwSectionFmt* pFmt ) const
{
if( !pSection || !pFmt )
- return FALSE;
+ return sal_False;
const SwSectionFmt *pMyFmt = pSection->GetFmt();
while( pFmt != pMyFmt )
{
if( pMyFmt->GetRegisteredIn()->ISA( SwSectionFmt ) )
pMyFmt = (SwSectionFmt*)pMyFmt->GetRegisteredIn();
else
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
void SwSectionFrm::CalcFtnAtEndFlag()
{
SwSectionFmt *pFmt = GetSection()->GetFmt();
- USHORT nVal = pFmt->GetFtnAtTxtEnd( FALSE ).GetValue();
+ sal_uInt16 nVal = pFmt->GetFtnAtTxtEnd( sal_False ).GetValue();
bFtnAtEnd = FTNEND_ATPGORDOCEND != nVal;
bOwnFtnNum = FTNEND_ATTXTEND_OWNNUMSEQ == nVal ||
FTNEND_ATTXTEND_OWNNUMANDFMT == nVal;
@@ -2404,32 +2421,32 @@ void SwSectionFrm::CalcFtnAtEndFlag()
pFmt = (SwSectionFmt*)pFmt->GetRegisteredIn();
else
break;
- nVal = pFmt->GetFtnAtTxtEnd( FALSE ).GetValue();
+ nVal = pFmt->GetFtnAtTxtEnd( sal_False ).GetValue();
if( FTNEND_ATPGORDOCEND != nVal )
{
- bFtnAtEnd = TRUE;
+ bFtnAtEnd = sal_True;
bOwnFtnNum = bOwnFtnNum ||FTNEND_ATTXTEND_OWNNUMSEQ == nVal ||
FTNEND_ATTXTEND_OWNNUMANDFMT == nVal;
}
}
}
-BOOL SwSectionFrm::IsEndnoteAtMyEnd() const
+sal_Bool SwSectionFrm::IsEndnoteAtMyEnd() const
{
- return pSection->GetFmt()->GetEndAtTxtEnd( FALSE ).IsAtEnd();
+ return pSection->GetFmt()->GetEndAtTxtEnd( sal_False ).IsAtEnd();
}
void SwSectionFrm::CalcEndAtEndFlag()
{
SwSectionFmt *pFmt = GetSection()->GetFmt();
- bEndnAtEnd = pFmt->GetEndAtTxtEnd( FALSE ).IsAtEnd();
+ bEndnAtEnd = pFmt->GetEndAtTxtEnd( sal_False ).IsAtEnd();
while( !bEndnAtEnd )
{
if( pFmt->GetRegisteredIn()->ISA( SwSectionFmt ) )
pFmt = (SwSectionFmt*)pFmt->GetRegisteredIn();
else
break;
- bEndnAtEnd = pFmt->GetEndAtTxtEnd( FALSE ).IsAtEnd();
+ bEndnAtEnd = pFmt->GetEndAtTxtEnd( sal_False ).IsAtEnd();
}
}
@@ -2444,7 +2461,7 @@ void SwSectionFrm::CalcEndAtEndFlag()
void SwSectionFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
{
- BYTE nInvFlags = 0;
+ sal_uInt8 nInvFlags = 0;
if( pNew && RES_ATTRSET_CHG == pNew->Which() )
{
@@ -2452,7 +2469,7 @@ void SwSectionFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
SfxItemIter aOIter( *((SwAttrSetChg*)pOld)->GetChgSet() );
SwAttrSetChg aOldSet( *(SwAttrSetChg*)pOld );
SwAttrSetChg aNewSet( *(SwAttrSetChg*)pNew );
- while( TRUE )
+ while( sal_True )
{
_UpdateAttr( (SfxPoolItem*)aOIter.GetCurItem(),
(SfxPoolItem*)aNIter.GetCurItem(), nInvFlags,
@@ -2477,6 +2494,7 @@ void SwSectionFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
}
}
+<<<<<<< local
void SwSectionFrm::SwClientNotify( const SwModify& rMod, const SfxHint& rHint )
{
const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
@@ -2488,10 +2506,14 @@ void SwSectionFrm::SwClientNotify( const SwModify& rMod, const SfxHint& rHint )
void SwSectionFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
BYTE &rInvFlags,
+=======
+void SwSectionFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew,
+ sal_uInt8 &rInvFlags,
+>>>>>>> other
SwAttrSetChg *pOldSet, SwAttrSetChg *pNewSet )
{
- BOOL bClear = TRUE;
- const USHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
+ sal_Bool bClear = sal_True;
+ const sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
switch( nWhich )
{ // Mehrspaltigkeit in Fussnoten unterdruecken...
case RES_FMT_CHG:
@@ -2506,7 +2528,7 @@ void SwSectionFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew
SwFmtCol aCol;
if ( Lower() && Lower()->IsColumnFrm() )
{
- USHORT nCol = 0;
+ sal_uInt16 nCol = 0;
SwFrm *pTmp = Lower();
do
{ ++nCol;
@@ -2514,9 +2536,9 @@ void SwSectionFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew
} while ( pTmp );
aCol.Init( nCol, 0, 1000 );
}
- BOOL bChgFtn = IsFtnAtEnd();
- BOOL bChgEndn = IsEndnAtEnd();
- BOOL bChgMyEndn = IsEndnoteAtMyEnd();
+ sal_Bool bChgFtn = IsFtnAtEnd();
+ sal_Bool bChgEndn = IsEndnAtEnd();
+ sal_Bool bChgMyEndn = IsEndnoteAtMyEnd();
CalcFtnAtEndFlag();
CalcEndAtEndFlag();
bChgFtn = ( bChgFtn != IsFtnAtEnd() ) ||
@@ -2526,7 +2548,7 @@ void SwSectionFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew
rInvFlags |= 0x10;
}
rInvFlags |= 0x01;
- bClear = FALSE;
+ bClear = sal_False;
}
break;
@@ -2541,12 +2563,12 @@ void SwSectionFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew
case RES_FTN_AT_TXTEND:
if( !IsInFtn() )
{
- BOOL bOld = IsFtnAtEnd();
+ sal_Bool bOld = IsFtnAtEnd();
CalcFtnAtEndFlag();
if( bOld != IsFtnAtEnd() )
{
const SwFmtCol& rNewCol = GetFmt()->GetCol();
- ChgColumns( rNewCol, rNewCol, TRUE );
+ ChgColumns( rNewCol, rNewCol, sal_True );
rInvFlags |= 0x01;
}
}
@@ -2555,13 +2577,13 @@ void SwSectionFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew
case RES_END_AT_TXTEND:
if( !IsInFtn() )
{
- BOOL bOld = IsEndnAtEnd();
- BOOL bMyOld = IsEndnoteAtMyEnd();
+ sal_Bool bOld = IsEndnAtEnd();
+ sal_Bool bMyOld = IsEndnoteAtMyEnd();
CalcEndAtEndFlag();
if( bOld != IsEndnAtEnd() || bMyOld != IsEndnoteAtMyEnd())
{
const SwFmtCol& rNewCol = GetFmt()->GetCol();
- ChgColumns( rNewCol, rNewCol, TRUE );
+ ChgColumns( rNewCol, rNewCol, sal_True );
rInvFlags |= 0x01;
}
}
@@ -2584,7 +2606,7 @@ void SwSectionFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew
break;
default:
- bClear = FALSE;
+ bClear = sal_False;
}
if ( bClear )
{
@@ -2605,28 +2627,28 @@ void SwSectionFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew
* page causes a maximal Size of the sectionframe.
* --------------------------------------------------*/
-BOOL SwSectionFrm::ToMaximize( BOOL bCheckFollow ) const
+sal_Bool SwSectionFrm::ToMaximize( sal_Bool bCheckFollow ) const
{
if( HasFollow() )
{
if( !bCheckFollow ) // Don't check superfluous follows
- return TRUE;
+ return sal_True;
const SwSectionFrm* pFoll = GetFollow();
while( pFoll && pFoll->IsSuperfluous() )
pFoll = pFoll->GetFollow();
if( pFoll )
- return TRUE;
+ return sal_True;
}
if( IsFtnAtEnd() )
- return FALSE;
+ return sal_False;
const SwFtnContFrm* pCont = ContainsFtnCont();
if( !IsEndnAtEnd() )
return 0 != pCont;
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
while( pCont && !bRet )
{
if( pCont->FindFootNote() )
- bRet = TRUE;
+ bRet = sal_True;
else
pCont = ContainsFtnCont( pCont );
}
@@ -2634,7 +2656,7 @@ BOOL SwSectionFrm::ToMaximize( BOOL bCheckFollow ) const
}
/*-----------------09.06.99 15:07-------------------
- * BOOL SwSectionFrm::ContainsFtnCont()
+ * sal_Bool SwSectionFrm::ContainsFtnCont()
* checks every Column for FtnContFrms.
* --------------------------------------------------*/
@@ -2684,13 +2706,13 @@ void SwSectionFrm::InvalidateFtnPos()
* Das Undersized-Flag wird ggf. korrigiert.
* --------------------------------------------------*/
-long SwSectionFrm::Undersize( BOOL bOverSize )
+long SwSectionFrm::Undersize( sal_Bool bOverSize )
{
- bUndersized = FALSE;
+ bUndersized = sal_False;
SWRECTFN( this )
long nRet = InnerHeight() - (Prt().*fnRect->fnGetHeight)();
if( nRet > 0 )
- bUndersized = TRUE;
+ bUndersized = sal_True;
else if( !bOverSize )
nRet = 0;
return nRet;
@@ -2749,7 +2771,7 @@ void SwRootFrm::InsertEmptySct( SwSectionFrm* pDel )
{
if( !pDestroy )
pDestroy = new SwDestroyList;
- USHORT nPos;
+ sal_uInt16 nPos;
if( !pDestroy->Seek_Entry( pDel, &nPos ) )
pDestroy->Insert( pDel );
}
@@ -2760,7 +2782,7 @@ void SwRootFrm::_DeleteEmptySct()
while( pDestroy->Count() )
{
SwSectionFrm* pSect = (*pDestroy)[0];
- pDestroy->Remove( USHORT(0) );
+ pDestroy->Remove( sal_uInt16(0) );
ASSERT( !pSect->IsColLocked() && !pSect->IsJoinLocked(),
"DeleteEmptySct: Locked SectionFrm" );
if( !pSect->Frm().HasArea() && !pSect->ContainsCntnt() )
@@ -2789,16 +2811,16 @@ void SwRootFrm::_DeleteEmptySct()
void SwRootFrm::_RemoveFromList( SwSectionFrm* pSct )
{
ASSERT( pDestroy, "Where's my list?" );
- USHORT nPos;
+ sal_uInt16 nPos;
if( pDestroy->Seek_Entry( pSct, &nPos ) )
pDestroy->Remove( nPos );
}
#ifdef DBG_UTIL
-BOOL SwRootFrm::IsInDelList( SwSectionFrm* pSct ) const
+sal_Bool SwRootFrm::IsInDelList( SwSectionFrm* pSct ) const
{
- USHORT nPos;
+ sal_uInt16 nPos;
return ( pDestroy && pDestroy->Seek_Entry( pSct, &nPos ) );
}
diff --git a/sw/source/core/layout/softpagebreak.cxx b/sw/source/core/layout/softpagebreak.cxx
index fe981d2e3b0a..5289fb860b56 100644
--- a/sw/source/core/layout/softpagebreak.cxx
+++ b/sw/source/core/layout/softpagebreak.cxx
@@ -99,7 +99,7 @@ void SwTxtNode::fillSoftPageBreakList( SwSoftPageBreakList& rBreak ) const
}
}
else // No soft page break if there's a "hard" page break attribute
- if( pFirst2 == pFrm && !pFrm->IsPageBreak( TRUE ) )
+ if( pFirst2 == pFrm && !pFrm->IsPageBreak( sal_True ) )
rBreak.insert( pFrm->GetOfst() );
}
}
@@ -124,7 +124,7 @@ bool SwTableLine::hasSoftPageBreak() const
// master table frames with "hard" page break attribute
if( pTab->GetIndPrev() || pTab->FindFooterOrHeader()
|| pTab->IsInFly() || pTab->GetUpper()->IsInTab() ||
- ( !pTab->IsFollow() && pTab->IsPageBreak( TRUE ) ) )
+ ( !pTab->IsFollow() && pTab->IsPageBreak( sal_True ) ) )
return false;
const SwPageFrm* pPage = pTab->FindPageFrm();
// No soft page break at the first page of the document
diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx
index 883fa0e6983a..f015e84fbdc5 100644
--- a/sw/source/core/layout/ssfrm.cxx
+++ b/sw/source/core/layout/ssfrm.cxx
@@ -75,55 +75,55 @@ long SwFrm::GetPrtRight() const
long SwFrm::GetPrtTop() const
{ return Frm().Top() + Prt().Top(); }
-BOOL SwFrm::SetMinLeft( long nDeadline )
+sal_Bool SwFrm::SetMinLeft( long nDeadline )
{
SwTwips nDiff = nDeadline - Frm().Left();
if( nDiff > 0 )
{
Frm().Left( nDeadline );
Prt().Width( Prt().Width() - nDiff );
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
-BOOL SwFrm::SetMaxBottom( long nDeadline )
+sal_Bool SwFrm::SetMaxBottom( long nDeadline )
{
SwTwips nDiff = Frm().Top() + Frm().Height() - nDeadline;
if( nDiff > 0 )
{
Frm().Height( Frm().Height() - nDiff );
Prt().Height( Prt().Height() - nDiff );
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
-BOOL SwFrm::SetMinTop( long nDeadline )
+sal_Bool SwFrm::SetMinTop( long nDeadline )
{
SwTwips nDiff = nDeadline - Frm().Top();
if( nDiff > 0 )
{
Frm().Top( nDeadline );
Prt().Height( Prt().Height() - nDiff );
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
-BOOL SwFrm::SetMaxRight( long nDeadline )
+sal_Bool SwFrm::SetMaxRight( long nDeadline )
{
SwTwips nDiff = Frm().Left() + Frm().Width() - nDeadline;
if( nDiff > 0 )
{
Frm().Width( Frm().Width() - nDiff );
Prt().Width( Prt().Width() - nDiff );
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
-void SwFrm::MakeBelowPos( const SwFrm* pUp, const SwFrm* pPrv, BOOL bNotify )
+void SwFrm::MakeBelowPos( const SwFrm* pUp, const SwFrm* pPrv, sal_Bool bNotify )
{
if( pPrv )
{
@@ -139,7 +139,7 @@ void SwFrm::MakeBelowPos( const SwFrm* pUp, const SwFrm* pPrv, BOOL bNotify )
aFrm.Pos().Y() += 1;
}
-void SwFrm::MakeUpperPos( const SwFrm* pUp, const SwFrm* pPrv, BOOL bNotify )
+void SwFrm::MakeUpperPos( const SwFrm* pUp, const SwFrm* pPrv, sal_Bool bNotify )
{
if( pPrv )
{
@@ -156,7 +156,7 @@ void SwFrm::MakeUpperPos( const SwFrm* pUp, const SwFrm* pPrv, BOOL bNotify )
aFrm.Pos().Y() -= 1;
}
-void SwFrm::MakeLeftPos( const SwFrm* pUp, const SwFrm* pPrv, BOOL bNotify )
+void SwFrm::MakeLeftPos( const SwFrm* pUp, const SwFrm* pPrv, sal_Bool bNotify )
{
if( pPrv )
{
@@ -173,7 +173,7 @@ void SwFrm::MakeLeftPos( const SwFrm* pUp, const SwFrm* pPrv, BOOL bNotify )
aFrm.Pos().X() -= 1;
}
-void SwFrm::MakeRightPos( const SwFrm* pUp, const SwFrm* pPrv, BOOL bNotify )
+void SwFrm::MakeRightPos( const SwFrm* pUp, const SwFrm* pPrv, sal_Bool bNotify )
{
if( pPrv )
{
@@ -213,7 +213,7 @@ void SwFrm::SetRightLeftMargins( long nRight, long nLeft)
Prt().Width( Frm().Width() - nLeft - nRight );
}
-const USHORT nMinVertCellHeight = 1135;
+const sal_uInt16 nMinVertCellHeight = 1135;
/*-----------------------------------
* SwFrm::CheckDirChange(..)
@@ -223,12 +223,12 @@ const USHORT nMinVertCellHeight = 1135;
void SwFrm::CheckDirChange()
{
- BOOL bOldVert = GetVerticalFlag();
- BOOL bOldRev = IsReverse();
- BOOL bOldR2L = GetRightToLeftFlag();
- SetInvalidVert( TRUE );
- SetInvalidR2L( TRUE );
- BOOL bChg = bOldR2L != IsRightToLeft();
+ sal_Bool bOldVert = GetVerticalFlag();
+ sal_Bool bOldRev = IsReverse();
+ sal_Bool bOldR2L = GetRightToLeftFlag();
+ SetInvalidVert( sal_True );
+ SetInvalidR2L( sal_True );
+ sal_Bool bChg = bOldR2L != IsRightToLeft();
if( ( IsVertical() != bOldVert ) || bChg || IsReverse() != bOldRev )
{
InvalidateAll();
@@ -279,7 +279,7 @@ void SwFrm::CheckDirChange()
pFrm = pFrm->GetNext();
}
if( pCol )
- pBody->AdjustColumns( pCol, TRUE );
+ pBody->AdjustColumns( pCol, sal_True );
}
else if( IsTxtFrm() )
((SwTxtFrm*)this)->Prepare( PREP_CLEAR );
@@ -469,8 +469,8 @@ SwCntntFrm::~SwCntntFrm()
{
SwTxtNode *pTxtNd = ((SwTxtFrm*)this)->GetTxtNode();
const SwFtnIdxs &rFtnIdxs = pCNd->GetDoc()->GetFtnIdxs();
- USHORT nPos;
- ULONG nIndex = pCNd->GetIndex();
+ sal_uInt16 nPos;
+ sal_uLong nIndex = pCNd->GetIndex();
rFtnIdxs.SeekEntry( *pTxtNd, &nPos );
SwTxtFtn* pTxtFtn;
if( nPos < rFtnIdxs.Count() )
@@ -658,13 +658,13 @@ const SwRect SwFrm::PaintArea() const
// NEW TABLES
// Cell frames may not leave their upper:
SwRect aRect = IsRowFrm() ? GetUpper()->Frm() : Frm();
- const BOOL bVert = IsVertical();
+ const sal_Bool bVert = IsVertical();
SwRectFn fnRect = bVert ? fnRectVert : fnRectHori;
long nRight = (aRect.*fnRect->fnGetRight)();
long nLeft = (aRect.*fnRect->fnGetLeft)();
const SwFrm* pTmp = this;
- BOOL bLeft = TRUE;
- BOOL bRight = TRUE;
+ sal_Bool bLeft = sal_True;
+ sal_Bool bRight = sal_True;
long nRowSpan = 0;
while( pTmp )
{
@@ -694,25 +694,25 @@ const SwRect SwFrm::PaintArea() const
nRight = nTmpRight;
if( pTmp->IsPageFrm() || pTmp->IsFlyFrm() || pTmp->IsRootFrm() )
break;
- bLeft = FALSE;
- bRight = FALSE;
+ bLeft = sal_False;
+ bRight = sal_False;
}
else if( pTmp->IsColumnFrm() ) // nobody enters neightbour columns
{
- BOOL bR2L = pTmp->IsRightToLeft();
+ sal_Bool bR2L = pTmp->IsRightToLeft();
// the first column has _no_ influence to the left range
if( bR2L ? pTmp->GetNext() : pTmp->GetPrev() )
{
if( bLeft || nLeft < nTmpLeft )
nLeft = nTmpLeft;
- bLeft = FALSE;
+ bLeft = sal_False;
}
// the last column has _no_ influence to the right range
if( bR2L ? pTmp->GetPrev() : pTmp->GetNext() )
{
if( bRight || nTmpRight < nRight )
nRight = nTmpRight;
- bRight = FALSE;
+ bRight = sal_False;
}
}
else if( bVert && pTmp->IsBodyFrm() )
@@ -726,14 +726,14 @@ const SwRect SwFrm::PaintArea() const
if( pTmp->GetPrev() && ( bLeft || nLeft < nTmpLeft ) )
{
nLeft = nTmpLeft;
- bLeft = FALSE;
+ bLeft = sal_False;
}
if( pTmp->GetNext() &&
( pTmp->GetNext()->IsFooterFrm() || pTmp->GetNext()->GetNext() )
&& ( bRight || nTmpRight < nRight ) )
{
nRight = nTmpRight;
- bRight = FALSE;
+ bRight = sal_False;
}
}
pTmp = pTmp->GetUpper();
@@ -752,9 +752,9 @@ const SwRect SwFrm::PaintArea() const
|*
|*************************************************************************/
-const SwRect SwFrm::UnionFrm( BOOL bBorder ) const
+const SwRect SwFrm::UnionFrm( sal_Bool bBorder ) const
{
- BOOL bVert = IsVertical();
+ sal_Bool bVert = IsVertical();
SwRectFn fnRect = bVert ? fnRectVert : fnRectHori;
long nLeft = (Frm().*fnRect->fnGetLeft)();
long nWidth = (Frm().*fnRect->fnGetWidth)();
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 1297b12c0fd2..7ce2a0330308 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -75,7 +75,7 @@
#include <layouter.hxx>
#include <switerator.hxx>
-extern void AppendObjs( const SwSpzFrmFmts *pTbl, ULONG nIndex,
+extern void AppendObjs( const SwSpzFrmFmts *pTbl, sal_uLong nIndex,
SwFrm *pFrm, SwPageFrm *pPage );
using namespace ::com::sun::star;
@@ -96,18 +96,18 @@ SwTabFrm::SwTabFrm( SwTable &rTab, SwFrm* pSib ):
{
bComplete = bCalcLowers = bONECalcLowers = bLowersFormatted = bLockBackMove =
bResizeHTMLTable = bHasFollowFlowLine = bIsRebuildLastLine =
- bRestrictTableGrowth = bRemoveFollowFlowLinePending = FALSE;
+ bRestrictTableGrowth = bRemoveFollowFlowLinePending = sal_False;
// --> OD 2004-10-04 #i26945#
- bConsiderObjsForMinCellHeight = TRUE;
- bObjsDoesFit = TRUE;
+ bConsiderObjsForMinCellHeight = sal_True;
+ bObjsDoesFit = sal_True;
// <--
- bFixSize = FALSE; //Nicht nochmal auf die Importfilter hereinfallen.
+ bFixSize = sal_False; //Nicht nochmal auf die Importfilter hereinfallen.
nType = FRMC_TAB;
//Gleich die Zeilen erzeugen und einfuegen.
const SwTableLines &rLines = rTab.GetTabLines();
SwFrm *pTmpPrev = 0;
- for ( USHORT i = 0; i < rLines.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rLines.Count(); ++i )
{
SwRowFrm *pNew = new SwRowFrm( *rLines[i], this );
if( pNew->Lower() )
@@ -126,15 +126,15 @@ SwTabFrm::SwTabFrm( SwTabFrm &rTab ) :
SwFlowFrm( (SwFrm&)*this ),
pTable( rTab.GetTable() )
{
- bIsFollow = TRUE;
+ bIsFollow = sal_True;
bLockJoin = bComplete = bONECalcLowers = bCalcLowers = bLowersFormatted = bLockBackMove =
bResizeHTMLTable = bHasFollowFlowLine = bIsRebuildLastLine =
- bRestrictTableGrowth = bRemoveFollowFlowLinePending = FALSE;
+ bRestrictTableGrowth = bRemoveFollowFlowLinePending = sal_False;
// --> OD 2004-10-04 #i26945#
- bConsiderObjsForMinCellHeight = TRUE;
- bObjsDoesFit = TRUE;
+ bConsiderObjsForMinCellHeight = sal_True;
+ bObjsDoesFit = sal_True;
// <--
- bFixSize = FALSE; //Nicht nochmal auf die Importfilter hereinfallen.
+ bFixSize = sal_False; //Nicht nochmal auf die Importfilter hereinfallen.
nType = FRMC_TAB;
SetFollow( rTab.GetFollow() );
@@ -212,10 +212,10 @@ void SwTabFrm::RegistFlys()
|*************************************************************************/
void MA_FASTCALL SwInvalidateAll( SwFrm *pFrm, long nBottom );
void MA_FASTCALL lcl_RecalcRow( SwRowFrm& rRow, long nBottom );
-BOOL lcl_ArrangeLowers( SwLayoutFrm *pLay, long lYStart, BOOL bInva );
+sal_Bool lcl_ArrangeLowers( SwLayoutFrm *pLay, long lYStart, sal_Bool bInva );
// --> OD 2004-10-15 #i26945# - add parameter <_bOnlyRowsAndCells> to control
// that only row and cell frames are formatted.
-BOOL MA_FASTCALL lcl_InnerCalcLayout( SwFrm *pFrm,
+sal_Bool MA_FASTCALL lcl_InnerCalcLayout( SwFrm *pFrm,
long nBottom,
bool _bOnlyRowsAndCells = false );
// <--
@@ -224,7 +224,7 @@ BOOL MA_FASTCALL lcl_InnerCalcLayout( SwFrm *pFrm,
// control, if floating screen objects have to be considered for the minimal
// cell height.
SwTwips MA_FASTCALL lcl_CalcMinRowHeight( const SwRowFrm *pRow,
- const BOOL _bConsiderObjs );
+ const sal_Bool _bConsiderObjs );
// <--
SwTwips lcl_CalcTopAndBottomMargin( const SwLayoutFrm&, const SwBorderAttrs& );
@@ -265,8 +265,13 @@ SwRowFrm* lcl_InsertNewFollowFlowLine( SwTabFrm& rTab, const SwFrm& rTmpRow, boo
ASSERT( rTmpRow.IsRowFrm(), "No row frame to copy for FollowFlowLine" )
const SwRowFrm& rRow = (SwRowFrm&)rTmpRow;
+<<<<<<< local
rTab.SetFollowFlowLine( TRUE );
SwRowFrm *pFollowFlowLine = new SwRowFrm(*rRow.GetTabLine(), &rTab, false );
+=======
+ rTab.SetFollowFlowLine( sal_True );
+ SwRowFrm *pFollowFlowLine = new SwRowFrm(*rRow.GetTabLine(), false );
+>>>>>>> other
pFollowFlowLine->SetRowSpanLine( bRowSpanLine );
SwFrm* pFirstRow = rTab.GetFollow()->GetFirstNonHeadlineRow();
pFollowFlowLine->InsertBefore( rTab.GetFollow(), pFirstRow );
@@ -303,7 +308,7 @@ void lcl_InvalidateLowerObjs( SwLayoutFrm& _rLayoutFrm,
}
if ( pLowerFrm->GetDrawObjs() )
{
- for ( USHORT i = 0; i < pLowerFrm->GetDrawObjs()->Count(); ++i )
+ for ( sal_uInt16 i = 0; i < pLowerFrm->GetDrawObjs()->Count(); ++i )
{
SwAnchoredObject* pAnchoredObj = (*pLowerFrm->GetDrawObjs())[i];
@@ -496,9 +501,9 @@ void lcl_MoveFootnotes( SwTabFrm& rSource, SwTabFrm& rDest, SwLayoutFrm& rRowFrm
{
if ( 0 != rSource.GetFmt()->GetDoc()->GetFtnIdxs().Count() )
{
- SwFtnBossFrm* pOldBoss = rSource.FindFtnBossFrm( TRUE );
- SwFtnBossFrm* pNewBoss = rDest.FindFtnBossFrm( TRUE );
- rRowFrm.MoveLowerFtns( 0, pOldBoss, pNewBoss, TRUE );
+ SwFtnBossFrm* pOldBoss = rSource.FindFtnBossFrm( sal_True );
+ SwFtnBossFrm* pNewBoss = rDest.FindFtnBossFrm( sal_True );
+ rRowFrm.MoveLowerFtns( 0, pOldBoss, pNewBoss, sal_True );
}
}
@@ -682,9 +687,9 @@ bool lcl_RecalcSplitLine( SwRowFrm& rLastLine, SwRowFrm& rFollowLine,
//
// Here the recalculation process starts:
//
- rTab.SetRebuildLastLine( TRUE );
+ rTab.SetRebuildLastLine( sal_True );
// --> OD 2004-10-15 #i26945#
- rTab.SetDoesObjsFit( TRUE );
+ rTab.SetDoesObjsFit( sal_True );
// <--
SWRECTFN( rTab.GetUpper() )
@@ -697,9 +702,9 @@ bool lcl_RecalcSplitLine( SwRowFrm& rLastLine, SwRowFrm& rFollowLine,
//
// --> OD 2004-10-04 #i26945# - Do *not* consider floating screen objects
// for the minimal cell height.
- rTab.SetConsiderObjsForMinCellHeight( FALSE );
+ rTab.SetConsiderObjsForMinCellHeight( sal_False );
::lcl_ShrinkCellsAndAllContent( rLastLine );
- rTab.SetConsiderObjsForMinCellHeight( TRUE );
+ rTab.SetConsiderObjsForMinCellHeight( sal_True );
// <--
//
@@ -855,9 +860,9 @@ bool lcl_RecalcSplitLine( SwRowFrm& rLastLine, SwRowFrm& rFollowLine,
::SwInvalidateAll( &rLastLine, LONG_MAX );
}
- rTab.SetRebuildLastLine( FALSE );
+ rTab.SetRebuildLastLine( sal_False );
// --> OD 2004-10-15 #i26945#
- rTab.SetDoesObjsFit( TRUE );
+ rTab.SetDoesObjsFit( sal_True );
// <--
return bRet;
@@ -942,7 +947,7 @@ bool SwTabFrm::RemoveFollowFlowLine()
// We have to reset the flag here, because lcl_MoveRowContent
// calls a GrowFrm(), which has a different bahavior if
// this flag is set.
- SetFollowFlowLine( FALSE );
+ SetFollowFlowLine( sal_False );
// --> FME 2007-07-19 #140081# Make code robust.
if ( !pFollowFlowLine || !pLastLine )
@@ -1065,8 +1070,8 @@ bool SwTabFrm::Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowKee
if( !pRow )
return bRet;
- const USHORT nRepeat = GetTable()->GetRowsToRepeat();
- USHORT nRowCount = 0; // pRow currently points to the first row
+ const sal_uInt16 nRepeat = GetTable()->GetRowsToRepeat();
+ sal_uInt16 nRowCount = 0; // pRow currently points to the first row
SwTwips nRemainingSpaceForLastRow =
(*fnRect->fnYDiff)( nCutPos, (Frm().*fnRect->fnGetTop)() );
@@ -1237,16 +1242,16 @@ bool SwTabFrm::Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowKee
//
// Build follow table if not already done:
//
- BOOL bNewFollow;
+ sal_Bool bNewFollow;
SwTabFrm *pFoll;
if ( GetFollow() )
{
pFoll = GetFollow();
- bNewFollow = FALSE;
+ bNewFollow = sal_False;
}
else
{
- bNewFollow = TRUE;
+ bNewFollow = sal_True;
pFoll = new SwTabFrm( *this );
//
@@ -1267,18 +1272,18 @@ bool SwTabFrm::Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowKee
for ( nRowCount = 0; nRowCount < nRepeat; ++nRowCount )
{
// Insert new headlines:
- bDontCreateObjects = TRUE; //frmtool
+ bDontCreateObjects = sal_True; //frmtool
SwRowFrm* pHeadline = new SwRowFrm(
*GetTable()->GetTabLines()[ nRowCount ], this );
pHeadline->SetRepeatedHeadline( true );
- bDontCreateObjects = FALSE;
+ bDontCreateObjects = sal_False;
pHeadline->InsertBefore( pFoll, 0 );
SwPageFrm *pPage = pHeadline->FindPageFrm();
const SwSpzFrmFmts *pTbl = GetFmt()->GetDoc()->GetSpzFrmFmts();
if( pTbl->Count() )
{
- ULONG nIndex;
+ sal_uLong nIndex;
SwCntntFrm* pFrm = pHeadline->ContainsCntnt();
while( pFrm )
{
@@ -1450,7 +1455,7 @@ bool SwTabFrm::Join()
void MA_FASTCALL SwInvalidatePositions( SwFrm *pFrm, long nBottom )
{
// LONG_MAX == nBottom means we have to calculate all
- BOOL bAll = LONG_MAX == nBottom;
+ sal_Bool bAll = LONG_MAX == nBottom;
SWRECTFN( pFrm )
do
{ pFrm->_InvalidatePos();
@@ -1476,7 +1481,7 @@ void MA_FASTCALL SwInvalidatePositions( SwFrm *pFrm, long nBottom )
void MA_FASTCALL SwInvalidateAll( SwFrm *pFrm, long nBottom )
{
// LONG_MAX == nBottom means we have to calculate all
- BOOL bAll = LONG_MAX == nBottom;
+ sal_Bool bAll = LONG_MAX == nBottom;
SWRECTFN( pFrm )
do
{
@@ -1537,17 +1542,17 @@ bool SwCntntFrm::CalcLowers( SwLayoutFrm* pLay, const SwLayoutFrm* pDontLeave,
long nBottom, bool bSkipRowSpanCells )
{
if ( !pLay )
- return TRUE;
+ return sal_True;
// LONG_MAX == nBottom means we have to calculate all
bool bAll = LONG_MAX == nBottom;
- bool bRet = FALSE;
+ bool bRet = sal_False;
SwCntntFrm *pCnt = pLay->ContainsCntnt();
SWRECTFN( pLay )
// FME 2007-08-30 #i81146# new loop control
- USHORT nLoopControlRuns = 0;
- const USHORT nLoopControlMax = 10;
+ sal_uInt16 nLoopControlRuns = 0;
+ const sal_uInt16 nLoopControlMax = 10;
const SwModify* pLoopControlCond = 0;
while ( pCnt && pDontLeave->IsAnLower( pCnt ) )
@@ -1627,13 +1632,13 @@ bool SwCntntFrm::CalcLowers( SwLayoutFrm* pLay, const SwLayoutFrm* pDontLeave,
// --> OD 2004-10-15 #i26945# - add parameter <_bOnlyRowsAndCells> to control
// that only row and cell frames are formatted.
-BOOL MA_FASTCALL lcl_InnerCalcLayout( SwFrm *pFrm,
+sal_Bool MA_FASTCALL lcl_InnerCalcLayout( SwFrm *pFrm,
long nBottom,
bool _bOnlyRowsAndCells )
{
// LONG_MAX == nBottom means we have to calculate all
- BOOL bAll = LONG_MAX == nBottom;
- BOOL bRet = FALSE;
+ sal_Bool bAll = LONG_MAX == nBottom;
+ sal_Bool bRet = sal_False;
const SwFrm* pOldUp = pFrm->GetUpper();
SWRECTFN( pFrm )
do
@@ -1685,16 +1690,16 @@ void MA_FASTCALL lcl_RecalcRow( SwRowFrm& rRow, long nBottom )
// <--
// FME 2007-08-30 #i81146# new loop control
- USHORT nLoopControlRuns_1 = 0;
- USHORT nLoopControlStage_1 = 0;
- const USHORT nLoopControlMax = 10;
+ sal_uInt16 nLoopControlRuns_1 = 0;
+ sal_uInt16 nLoopControlStage_1 = 0;
+ const sal_uInt16 nLoopControlMax = 10;
bool bCheck = true;
do
{
// FME 2007-08-30 #i81146# new loop control
- USHORT nLoopControlRuns_2 = 0;
- USHORT nLoopControlStage_2 = 0;
+ sal_uInt16 nLoopControlRuns_2 = 0;
+ sal_uInt16 nLoopControlStage_2 = 0;
while( lcl_InnerCalcLayout( &rRow, nBottom ) )
{
@@ -1781,7 +1786,7 @@ void MA_FASTCALL lcl_RecalcTable( SwTabFrm& rTab,
if ( !pFirstRow )
{
pFirstRow = (SwLayoutFrm*)rTab.Lower();
- rNotify.SetLowersComplete( TRUE );
+ rNotify.SetLowersComplete( sal_True );
}
::SwInvalidatePositions( pFirstRow, LONG_MAX );
lcl_RecalcRow( static_cast<SwRowFrm&>(*pFirstRow), LONG_MAX );
@@ -1899,7 +1904,7 @@ void SwTabFrm::MakeAll()
SwLayNotify aNotify( this ); //uebernimmt im DTor die Benachrichtigung
// If pos is invalid, we have to call a SetInvaKeep at aNotify.
// Otherwise the keep atribute would not work in front of a table.
- const BOOL bOldValidPos = GetValidPosFlag();
+ const sal_Bool bOldValidPos = GetValidPosFlag();
//Wenn mein direkter Nachbar gleichzeitig mein Follow ist
//verleibe ich mir das Teil ein.
@@ -1923,29 +1928,29 @@ void SwTabFrm::MakeAll()
{
if ( RemoveFollowFlowLine() )
Join();
- SetRemoveFollowFlowLinePending( FALSE );
+ SetRemoveFollowFlowLinePending( sal_False );
}
if ( bResizeHTMLTable ) //Optimiertes Zusammenspiel mit Grow/Shrink des Inhaltes
{
- bResizeHTMLTable = FALSE;
+ bResizeHTMLTable = sal_False;
SwHTMLTableLayout *pLayout = GetTable()->GetHTMLTableLayout();
if ( pLayout )
bCalcLowers = pLayout->Resize(
- pLayout->GetBrowseWidthByTabFrm( *this ), FALSE );
+ pLayout->GetBrowseWidthByTabFrm( *this ), sal_False );
}
- BOOL bMakePage = TRUE; //solange TRUE kann eine neue Seite
+ sal_Bool bMakePage = sal_True; //solange sal_True kann eine neue Seite
//angelegt werden (genau einmal)
- BOOL bMovedBwd = FALSE; //Wird TRUE wenn der Frame zurueckfliesst
- BOOL bMovedFwd = FALSE; //solange FALSE kann der Frm zurueck-
+ sal_Bool bMovedBwd = sal_False; //Wird sal_True wenn der Frame zurueckfliesst
+ sal_Bool bMovedFwd = sal_False; //solange sal_False kann der Frm zurueck-
//fliessen (solange, bis er einmal
//vorwaerts ge'moved wurde).
- BOOL bSplit = FALSE; //Wird TRUE wenn der Frm gesplittet wurde.
- const BOOL bFtnsInDoc = 0 != GetFmt()->GetDoc()->GetFtnIdxs().Count();
- BOOL bMoveable;
- const BOOL bFly = IsInFly();
+ sal_Bool bSplit = sal_False; //Wird sal_True wenn der Frm gesplittet wurde.
+ const sal_Bool bFtnsInDoc = 0 != GetFmt()->GetDoc()->GetFtnIdxs().Count();
+ sal_Bool bMoveable;
+ const sal_Bool bFly = IsInFly();
SwBorderAttrAccess *pAccess= new SwBorderAttrAccess( SwFrm::GetCache(), this );
const SwBorderAttrs *pAttrs = pAccess->Get();
@@ -1959,7 +1964,7 @@ void SwTabFrm::MakeAll()
( !GetFmt()->GetLayoutSplit().GetValue() || bKeep );
// The number of repeated headlines
- const USHORT nRepeat = GetTable()->GetRowsToRepeat();
+ const sal_uInt16 nRepeat = GetTable()->GetRowsToRepeat();
// This flag indicates that we are allowed to try to split the
// table rows.
@@ -2019,9 +2024,9 @@ void SwTabFrm::MakeAll()
SwFrm *pPre = GetPrev();
if ( pPre && pPre->IsTabFrm() && ((SwTabFrm*)pPre)->GetFollow() == this)
{
- if ( !MoveFwd( bMakePage, FALSE ) )
- bMakePage = FALSE;
- bMovedFwd = TRUE;
+ if ( !MoveFwd( bMakePage, sal_False ) )
+ bMakePage = sal_False;
+ bMovedFwd = sal_True;
}
}
@@ -2029,15 +2034,15 @@ void SwTabFrm::MakeAll()
SWRECTFN( this )
while ( !bValidPos || !bValidSize || !bValidPrtArea )
{
- if ( TRUE == (bMoveable = IsMoveable()) )
+ if ( sal_True == (bMoveable = IsMoveable()) )
if ( CheckMoveFwd( bMakePage, bKeep && KEEPTAB, bMovedBwd ) )
{
- bMovedFwd = TRUE;
- bCalcLowers = TRUE;
+ bMovedFwd = sal_True;
+ bCalcLowers = sal_True;
// --> OD 2009-08-12 #i99267#
// reset <bSplit> after forward move to assure that follows
// can be joined, if further space is available.
- bSplit = FALSE;
+ bSplit = sal_False;
// <--
}
@@ -2053,19 +2058,19 @@ void SwTabFrm::MakeAll()
{
delete pAccess;
bCalcLowers |= pLayout->Resize(
- pLayout->GetBrowseWidthByTabFrm( *this ), FALSE );
+ pLayout->GetBrowseWidthByTabFrm( *this ), sal_False );
pAccess = new SwBorderAttrAccess( SwFrm::GetCache(), this );
pAttrs = pAccess->Get();
}
- bValidPrtArea = FALSE;
- aNotify.SetLowersComplete( FALSE );
+ bValidPrtArea = sal_False;
+ aNotify.SetLowersComplete( sal_False );
}
SwFrm *pPre;
if ( bKeep || (0 != (pPre = FindPrev()) &&
pPre->GetAttrSet()->GetKeep().GetValue()) )
{
- bCalcLowers = TRUE;
+ bCalcLowers = sal_True;
}
}
@@ -2094,13 +2099,13 @@ void SwTabFrm::MakeAll()
{
delete pAccess;
bCalcLowers |= pLayout->Resize(
- pLayout->GetBrowseWidthByTabFrm( *this ), FALSE );
-// GetFmt()->GetDoc()->GetDocShell()->IsReadOnly() ? FALSE : TRUE );
+ pLayout->GetBrowseWidthByTabFrm( *this ), sal_False );
+// GetFmt()->GetDoc()->GetDocShell()->IsReadOnly() ? sal_False : sal_True );
pAccess= new SwBorderAttrAccess( SwFrm::GetCache(), this );
pAttrs = pAccess->Get();
}
if ( aOldPrtPos != (Prt().*fnRect->fnGetPos)() )
- aNotify.SetLowersComplete( FALSE );
+ aNotify.SetLowersComplete( sal_False );
}
//Wenn ich der erste einer Kette bin koennte ich mal sehen ob
@@ -2119,20 +2124,20 @@ void SwTabFrm::MakeAll()
if( pFrm && n1StLineHeight >(pFrm->Frm().*fnRect->fnGetHeight )() )
{
SwTabFrm *pMaster = (SwTabFrm*)FindMaster();
- BOOL bDummy;
- if ( ShouldBwdMoved( pMaster->GetUpper(), FALSE, bDummy ) )
+ sal_Bool bDummy;
+ if ( ShouldBwdMoved( pMaster->GetUpper(), sal_False, bDummy ) )
pMaster->InvalidatePos();
}
}
- SwFtnBossFrm *pOldBoss = bFtnsInDoc ? FindFtnBossFrm( TRUE ) : 0;
- BOOL bReformat;
+ SwFtnBossFrm *pOldBoss = bFtnsInDoc ? FindFtnBossFrm( sal_True ) : 0;
+ sal_Bool bReformat;
if ( MoveBwd( bReformat ) )
{
SWREFRESHFN( this )
- bMovedBwd = TRUE;
- aNotify.SetLowersComplete( FALSE );
+ bMovedBwd = sal_True;
+ aNotify.SetLowersComplete( sal_False );
if ( bFtnsInDoc )
- MoveLowerFtns( 0, pOldBoss, 0, TRUE );
+ MoveLowerFtns( 0, pOldBoss, 0, sal_True );
if ( bReformat || bKeep )
{
long nOldTop = (Frm().*fnRect->fnGetTop)();
@@ -2146,18 +2151,18 @@ void SwTabFrm::MakeAll()
delete pAccess;
bCalcLowers |= pHTMLLayout->Resize(
pHTMLLayout->GetBrowseWidthByTabFrm( *this ),
- FALSE );
+ sal_False );
pAccess= new SwBorderAttrAccess(
SwFrm::GetCache(), this );
pAttrs = pAccess->Get();
}
- bValidPrtArea = FALSE;
+ bValidPrtArea = sal_False;
Format( pAttrs );
}
lcl_RecalcTable( *this, 0, aNotify );
- bLowersFormatted = TRUE;
+ bLowersFormatted = sal_True;
if ( bKeep && KEEPTAB )
{
// --> OD 2005-09-28 #b6329202#
@@ -2174,11 +2179,11 @@ void SwTabFrm::MakeAll()
// {
// pNxt->Calc();
// if ( !GetNext() )
-// bValidPos = FALSE;
+// bValidPos = sal_False;
// }
if ( 0 != lcl_FormatNextCntntForKeep( this ) && !GetNext() )
{
- bValidPos = FALSE;
+ bValidPos = sal_False;
}
// <--
}
@@ -2226,13 +2231,13 @@ void SwTabFrm::MakeAll()
// at least one further row of an existing follow.
if ( !bSplit && GetFollow() )
{
- BOOL bDummy;
- if ( GetFollow()->ShouldBwdMoved( GetUpper(), FALSE, bDummy ) )
+ sal_Bool bDummy;
+ if ( GetFollow()->ShouldBwdMoved( GetUpper(), sal_False, bDummy ) )
{
SwFrm *pTmp = GetUpper();
SwTwips nDeadLine = (pTmp->*fnRect->fnGetPrtBottom)();
if ( bBrowseMode )
- nDeadLine += pTmp->Grow( LONG_MAX, TRUE );
+ nDeadLine += pTmp->Grow( LONG_MAX, sal_True );
if( (Frm().*fnRect->fnBottomDist)( nDeadLine ) > 0 )
{
//
@@ -2246,9 +2251,9 @@ void SwTabFrm::MakeAll()
if ( pLastLine )
{
::SwInvalidateAll( pLastLine, LONG_MAX );
- SetRebuildLastLine( TRUE );
+ SetRebuildLastLine( sal_True );
lcl_RecalcRow( static_cast<SwRowFrm&>(*pLastLine), LONG_MAX );
- SetRebuildLastLine( FALSE );
+ SetRebuildLastLine( sal_False );
}
SwFrm* pRow = GetFollow()->GetFirstNonHeadlineRow();
@@ -2279,11 +2284,11 @@ void SwTabFrm::MakeAll()
while ( pRowToMove && nRowsToMove-- > 0 )
{
- const BOOL bMoveFtns = bFtnsInDoc && !GetFollow()->IsJoinLocked();
+ const sal_Bool bMoveFtns = bFtnsInDoc && !GetFollow()->IsJoinLocked();
SwFtnBossFrm *pOldBoss = 0;
if ( bMoveFtns )
- pOldBoss = pRowToMove->FindFtnBossFrm( TRUE );
+ pOldBoss = pRowToMove->FindFtnBossFrm( sal_True );
SwFrm* pNextRow = pRowToMove->GetNext();
@@ -2299,7 +2304,7 @@ void SwTabFrm::MakeAll()
//Die Fussnoten verschieben!
if ( bMoveFtns )
if ( ((SwLayoutFrm*)pRowToMove)->MoveLowerFtns(
- 0, pOldBoss, FindFtnBossFrm( TRUE ), TRUE ) )
+ 0, pOldBoss, FindFtnBossFrm( sal_True ), sal_True ) )
GetUpper()->Calc();
pRowToMove = pNextRow;
@@ -2357,7 +2362,7 @@ void SwTabFrm::MakeAll()
// In this case we do a magic trick:
if ( !bKeep && !GetNext() && pTmpNxt && pTmpNxt->IsValid() )
{
- bValidPos = FALSE;
+ bValidPos = sal_False;
bLastRowHasToMoveToFollow = true;
}
}
@@ -2368,13 +2373,13 @@ void SwTabFrm::MakeAll()
if ( bCalcLowers )
{
lcl_RecalcTable( *this, 0, aNotify );
- bLowersFormatted = TRUE;
- bCalcLowers = FALSE;
+ bLowersFormatted = sal_True;
+ bCalcLowers = sal_False;
}
else if ( bONECalcLowers )
{
lcl_RecalcRow( static_cast<SwRowFrm&>(*Lower()), LONG_MAX );
- bONECalcLowers = FALSE;
+ bONECalcLowers = sal_False;
}
}
continue;
@@ -2392,13 +2397,13 @@ void SwTabFrm::MakeAll()
if ( bCalcLowers && IsValid() )
{
lcl_RecalcTable( *this, 0, aNotify );
- bLowersFormatted = TRUE;
- bCalcLowers = FALSE;
+ bLowersFormatted = sal_True;
+ bCalcLowers = sal_False;
}
else if ( bONECalcLowers )
{
lcl_RecalcRow( static_cast<SwRowFrm&>(*Lower()), LONG_MAX );
- bONECalcLowers = FALSE;
+ bONECalcLowers = sal_False;
}
// It does not make sense to cut off the last line if we are
@@ -2411,8 +2416,8 @@ void SwTabFrm::MakeAll()
if ( bCalcLowers && IsValid() )
{
lcl_RecalcTable( *this, 0, aNotify );
- bLowersFormatted = TRUE;
- bCalcLowers = FALSE;
+ bLowersFormatted = sal_True;
+ bCalcLowers = sal_False;
if( !IsValid() )
continue;
}
@@ -2451,11 +2456,11 @@ void SwTabFrm::MakeAll()
SwTwips nDeadLine = (GetUpper()->*fnRect->fnGetPrtBottom)();
if( IsInSct() || GetUpper()->IsInTab() ) // TABLE IN TABLE)
nDeadLine = (*fnRect->fnYInc)( nDeadLine,
- GetUpper()->Grow( LONG_MAX, TRUE ) );
+ GetUpper()->Grow( LONG_MAX, sal_True ) );
::lcl_RecalcRow( static_cast<SwRowFrm&>(*Lower()), nDeadLine );
- bLowersFormatted = TRUE;
- aNotify.SetLowersComplete( TRUE );
+ bLowersFormatted = sal_True;
+ aNotify.SetLowersComplete( sal_True );
// One more check if its really necessary to split the table.
// 1. The table either has to exceed the deadline or
@@ -2482,7 +2487,7 @@ void SwTabFrm::MakeAll()
}
// <--
- USHORT nMinNumOfLines = nRepeat;
+ sal_uInt16 nMinNumOfLines = nRepeat;
if ( bTableRowKeep )
{
@@ -2512,8 +2517,8 @@ void SwTabFrm::MakeAll()
// if we do not have an (in)direkt Prev, we split anyway.
if( (*fnRect->fnYDiff)(nDeadLine, nBreakLine) >=0 || !pIndPrev )
{
- aNotify.SetLowersComplete( FALSE );
- bSplit = TRUE;
+ aNotify.SetLowersComplete( sal_False );
+ bSplit = sal_True;
//
// An existing follow flow line has to be removed.
@@ -2549,7 +2554,7 @@ void SwTabFrm::MakeAll()
if ( bSplitError && bTryToSplit ) // no restart if we did not try to split: i72847, i79426
{
lcl_RecalcRow( static_cast<SwRowFrm&>(*Lower()), LONG_MAX );
- bValidPos = FALSE;
+ bValidPos = sal_False;
bTryToSplit = false;
continue;
}
@@ -2574,7 +2579,7 @@ void SwTabFrm::MakeAll()
// <--
SWRECTFNX( GetFollow() )
- static BYTE nStack = 0;
+ static sal_uInt8 nStack = 0;
if ( !StackHack::IsLocked() && nStack < 4 )
{
++nStack;
@@ -2586,7 +2591,7 @@ void SwTabFrm::MakeAll()
pAccess= new SwBorderAttrAccess( SwFrm::GetCache(), this );
pAttrs = pAccess->Get();
- ((SwTabFrm*)GetFollow())->SetLowersFormatted(FALSE);
+ ((SwTabFrm*)GetFollow())->SetLowersFormatted(sal_False);
// --> OD 2005-03-30 #i43913# - lock follow table
// to avoid its formatting during the format of
// its content.
@@ -2630,7 +2635,7 @@ void SwTabFrm::MakeAll()
--nStack;
}
else if ( GetFollow() == GetNext() )
- ((SwTabFrm*)GetFollow())->MoveFwd( TRUE, FALSE );
+ ((SwTabFrm*)GetFollow())->MoveFwd( sal_True, sal_False );
}
continue;
}
@@ -2644,15 +2649,15 @@ void SwTabFrm::MakeAll()
GetUpper()->GetUpper()->GetUpper()->IsSctFrm() &&
( GetUpper()->GetUpper()->GetPrev() || GetIndPrev() ) &&
((SwSectionFrm*)GetUpper()->GetUpper()->GetUpper())->MoveAllowed(this) )
- bMovedFwd = FALSE;
+ bMovedFwd = sal_False;
// --> FME 2004-06-09 #i29771# Reset bTryToSplit flag on change of upper
const SwFrm* pOldUpper = GetUpper();
// <--
//Mal sehen ob ich irgenwo Platz finde...
- if ( !bMovedFwd && !MoveFwd( bMakePage, FALSE ) )
- bMakePage = FALSE;
+ if ( !bMovedFwd && !MoveFwd( bMakePage, sal_False ) )
+ bMakePage = sal_False;
// --> FME 2004-06-09 #i29771# Reset bSplitError flag on change of upper
if ( GetUpper() != pOldUpper )
@@ -2663,8 +2668,8 @@ void SwTabFrm::MakeAll()
// <--
SWREFRESHFN( this )
- bMovedFwd = bCalcLowers = TRUE;
- aNotify.SetLowersComplete( FALSE );
+ bMovedFwd = bCalcLowers = sal_True;
+ aNotify.SetLowersComplete( sal_False );
if ( IsFollow() )
{ //Um Oszillationen zu vermeiden sollte kein ungueltiger Master
//zurueckbleiben.
@@ -2672,7 +2677,7 @@ void SwTabFrm::MakeAll()
if ( pTab->GetUpper() )
pTab->GetUpper()->Calc();
pTab->Calc();
- pTab->SetLowersFormatted( FALSE );
+ pTab->SetLowersFormatted( sal_False );
}
//Wenn mein direkter Nachbar jetzt gleichzeitig mein Follow ist
@@ -2701,8 +2706,8 @@ void SwTabFrm::MakeAll()
if ( nDistToUpperPrtBottom >= 0 || bTryToSplit )
{
lcl_RecalcTable( *this, 0, aNotify );
- bLowersFormatted = TRUE;
- bCalcLowers = FALSE;
+ bLowersFormatted = sal_True;
+ bCalcLowers = sal_False;
}
#if OSL_DEBUG_LEVEL > 1
else
@@ -2724,7 +2729,7 @@ void SwTabFrm::MakeAll()
pPre->InvalidatePos();
}
- bCalcLowers = bONECalcLowers = FALSE;
+ bCalcLowers = bONECalcLowers = sal_False;
delete pAccess;
UnlockJoin();
if ( bMovedFwd || bMovedBwd || !bOldValidPos )
@@ -2741,11 +2746,11 @@ void SwTabFrm::MakeAll()
|* Letzte Aenderung
|*
|*************************************************************************/
-BOOL SwTabFrm::CalcFlyOffsets( SwTwips& rUpper,
+sal_Bool SwTabFrm::CalcFlyOffsets( SwTwips& rUpper,
long& rLeftOffset,
long& rRightOffset ) const
{
- BOOL bInvalidatePrtArea = FALSE;
+ sal_Bool bInvalidatePrtArea = sal_False;
const SwPageFrm *pPage = FindPageFrm();
const SwFlyFrm* pMyFly = FindFlyFrm();
@@ -2767,7 +2772,7 @@ BOOL SwTabFrm::CalcFlyOffsets( SwTwips& rUpper,
long nYDiff = (*fnRect->fnYDiff)( (Prt().*fnRect->fnGetTop)(), rUpper );
if( nYDiff > 0 )
(aRect.*fnRect->fnAddBottom)( -nYDiff );
- for ( USHORT i = 0; i < pPage->GetSortedObjs()->Count(); ++i )
+ for ( sal_uInt16 i = 0; i < pPage->GetSortedObjs()->Count(); ++i )
{
SwAnchoredObject* pAnchoredObj = (*pPage->GetSortedObjs())[i];
if ( pAnchoredObj->ISA(SwFlyFrm) )
@@ -2860,7 +2865,7 @@ BOOL SwTabFrm::CalcFlyOffsets( SwTwips& rUpper,
long nBottom = (aFlyRect.*fnRect->fnGetBottom)();
if( (*fnRect->fnYDiff)( nPrtPos, nBottom ) < 0 )
nPrtPos = nBottom;
- bInvalidatePrtArea = TRUE;
+ bInvalidatePrtArea = sal_True;
}
if ( (SURROUND_RIGHT == rSur.GetSurround() ||
SURROUND_PARALLEL == rSur.GetSurround())&&
@@ -2870,7 +2875,7 @@ BOOL SwTabFrm::CalcFlyOffsets( SwTwips& rUpper,
(aFlyRect.*fnRect->fnGetRight)(),
(pFly->GetAnchorFrm()->Frm().*fnRect->fnGetLeft)() );
rLeftOffset = Max( rLeftOffset, nWidth );
- bInvalidatePrtArea = TRUE;
+ bInvalidatePrtArea = sal_True;
}
if ( (SURROUND_LEFT == rSur.GetSurround() ||
SURROUND_PARALLEL == rSur.GetSurround())&&
@@ -2880,7 +2885,7 @@ BOOL SwTabFrm::CalcFlyOffsets( SwTwips& rUpper,
(pFly->GetAnchorFrm()->Frm().*fnRect->fnGetRight)(),
(aFlyRect.*fnRect->fnGetLeft)() );
rRightOffset = Max( rRightOffset, nWidth );
- bInvalidatePrtArea = TRUE;
+ bInvalidatePrtArea = sal_True;
}
}
}
@@ -2928,7 +2933,7 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs )
long nTmpRight = -1000000,
nLeftOffset = 0;
if( CalcFlyOffsets( nUpper, nLeftOffset, nTmpRight ) )
- bValidPrtArea = FALSE;
+ bValidPrtArea = sal_False;
long nRightOffset = Max( 0L, nTmpRight );
SwTwips nLower = pAttrs->CalcBottomLine();
@@ -2938,7 +2943,7 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs )
// <-- collapsing
if ( !bValidPrtArea )
- { bValidPrtArea = TRUE;
+ { bValidPrtArea = sal_True;
//Die Breite der PrtArea wird vom FrmFmt vorgegeben, die Raender
//sind entsprechend einzustellen.
@@ -2960,9 +2965,9 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs )
//bezieht sie sich in der BrowseView auf die Bildschirmbreite.
const SwFmtFrmSize &rSz = GetFmt()->GetFrmSize();
// OD 14.03.2003 #i9040# - adjust variable name.
- const SwTwips nWishedTableWidth = CalcRel( rSz, TRUE );
+ const SwTwips nWishedTableWidth = CalcRel( rSz, sal_True );
- BOOL bCheckBrowseWidth = FALSE;
+ sal_Bool bCheckBrowseWidth = sal_False;
// OD 14.03.2003 #i9040# - insert new variables for left/right spacing.
SwTwips nLeftSpacing = 0;
@@ -3051,7 +3056,7 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs )
//Nur die fuer die Umrandung benoetigten Freiraeume
//werden beruecksichtigt.
//Die Attributwerte von LRSpace werden bewusst missachtet!
- bCheckBrowseWidth = TRUE;
+ bCheckBrowseWidth = sal_True;
nLeftSpacing = nLeftLine + nLeftOffset;
nRightSpacing = nRightLine + nRightOffset;
break;
@@ -3088,7 +3093,7 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs )
{
//Linker Rand und die Breite zaehlen (Word-Spezialitaet)
// OD 10.03.2003 #i9040# - no width alignment in online mode.
- //bCheckBrowseWidth = TRUE;
+ //bCheckBrowseWidth = sal_True;
nLeftSpacing = pAttrs->CalcLeft( this );
if( nLeftOffset )
{
@@ -3108,7 +3113,7 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs )
}
break;
default:
- ASSERT( FALSE, "Ungueltige orientation fuer Table." );
+ ASSERT( sal_False, "Ungueltige orientation fuer Table." );
}
// --> OD 2004-07-15 #i26250# - extend bottom printing area, if table
@@ -3141,12 +3146,12 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs )
}
if ( nOldHeight != (Prt().*fnRect->fnGetHeight)() )
- bValidSize = FALSE;
+ bValidSize = sal_False;
}
if ( !bValidSize )
{
- bValidSize = TRUE;
+ bValidSize = sal_True;
//Die Groesse wird durch den Inhalt plus den Raendern bestimmt.
SwTwips nRemaining = 0, nDiff;
@@ -3174,7 +3179,7 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs )
|* Letzte Aenderung MA 23. Sep. 96
|*
|*************************************************************************/
-SwTwips SwTabFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
+SwTwips SwTabFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
{
SWRECTFN( this )
SwTwips nHeight =(Frm().*fnRect->fnGetHeight)();
@@ -3263,8 +3268,8 @@ SwTwips SwTabFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
|*************************************************************************/
void SwTabFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
{
- BYTE nInvFlags = 0;
- BOOL bAttrSetChg = pNew && RES_ATTRSET_CHG == pNew->Which();
+ sal_uInt8 nInvFlags = 0;
+ sal_Bool bAttrSetChg = pNew && RES_ATTRSET_CHG == pNew->Which();
if( bAttrSetChg )
{
@@ -3272,7 +3277,7 @@ void SwTabFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
SfxItemIter aOIter( *((SwAttrSetChg*)pOld)->GetChgSet() );
SwAttrSetChg aOldSet( *(SwAttrSetChg*)pOld );
SwAttrSetChg aNewSet( *(SwAttrSetChg*)pNew );
- while( TRUE )
+ while( sal_True )
{
_UpdateAttr( (SfxPoolItem*)aOIter.GetCurItem(),
(SfxPoolItem*)aNIter.GetCurItem(), nInvFlags,
@@ -3326,12 +3331,17 @@ void SwTabFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
}
}
+<<<<<<< local
void SwTabFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
BYTE &rInvFlags,
+=======
+void SwTabFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew,
+ sal_uInt8 &rInvFlags,
+>>>>>>> other
SwAttrSetChg *pOldSet, SwAttrSetChg *pNewSet )
{
- BOOL bClear = TRUE;
- const USHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
+ sal_Bool bClear = sal_True;
+ const sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
switch( nWhich )
{
case RES_TBLHEADLINECHG:
@@ -3346,13 +3356,18 @@ void SwTabFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
}
// insert new headlines
- const USHORT nNewRepeat = GetTable()->GetRowsToRepeat();
- for ( USHORT nIdx = 0; nIdx < nNewRepeat; ++nIdx )
+ const sal_uInt16 nNewRepeat = GetTable()->GetRowsToRepeat();
+ for ( sal_uInt16 nIdx = 0; nIdx < nNewRepeat; ++nIdx )
{
+<<<<<<< local
bDontCreateObjects = TRUE; //frmtool
SwRowFrm* pHeadline = new SwRowFrm( *GetTable()->GetTabLines()[ nIdx ], this );
+=======
+ bDontCreateObjects = sal_True; //frmtool
+ SwRowFrm* pHeadline = new SwRowFrm( *GetTable()->GetTabLines()[ nIdx ] );
+>>>>>>> other
pHeadline->SetRepeatedHeadline( true );
- bDontCreateObjects = FALSE;
+ bDontCreateObjects = sal_False;
pHeadline->Paste( this, pLowerRow );
}
}
@@ -3372,7 +3387,7 @@ void SwTabFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
if ( !GetPrev() )
CheckPageDescs( pPage );
if ( pPage && GetFmt()->GetPageDesc().GetNumOffset() )
- ((SwRootFrm*)pPage->GetUpper())->SetVirtPageNum( TRUE );
+ ((SwRootFrm*)pPage->GetUpper())->SetVirtPageNum( sal_True );
SwDocPosUpdate aMsgHnt( pPage->Frm().Top() );
GetFmt()->GetDoc()->UpdatePageFlds( &aMsgHnt );
}
@@ -3399,7 +3414,7 @@ void SwTabFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
/* kein Break hier */
default:
- bClear = FALSE;
+ bClear = sal_False;
}
if ( bClear )
{
@@ -3423,7 +3438,7 @@ void SwTabFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
|* Letzte Aenderung MA 26. Jun. 98
|*
|*************************************************************************/
-BOOL SwTabFrm::GetInfo( SfxPoolItem &rHnt ) const
+sal_Bool SwTabFrm::GetInfo( SfxPoolItem &rHnt ) const
{
if ( RES_VIRTPAGENUM_INFO == rHnt.Which() && IsInDocBody() && !IsFollow() )
{
@@ -3436,7 +3451,7 @@ BOOL SwTabFrm::GetInfo( SfxPoolItem &rHnt ) const
//Das sollte er sein (kann allenfalls temporaer anders sein,
// sollte uns das beunruhigen?)
rInfo.SetInfo( pPage, this );
- return FALSE;
+ return sal_False;
}
if ( pPage->GetPhyPageNum() < rInfo.GetOrigPage()->GetPhyPageNum() &&
(!rInfo.GetPage() || pPage->GetPhyPageNum() > rInfo.GetPage()->GetPhyPageNum()))
@@ -3446,7 +3461,7 @@ BOOL SwTabFrm::GetInfo( SfxPoolItem &rHnt ) const
}
}
}
- return TRUE;
+ return sal_True;
}
/*************************************************************************
@@ -3535,7 +3550,7 @@ SwCntntFrm *SwTabFrm::FindLastCntnt()
|* Letzte Aenderung MA 25. Apr. 95
|*
|*************************************************************************/
-SwLayoutFrm *SwTabFrm::GetLeaf( MakePageType eMakePage, BOOL bFwd )
+SwLayoutFrm *SwTabFrm::GetLeaf( MakePageType eMakePage, sal_Bool bFwd )
{
SwLayoutFrm *pRet;
if ( bFwd )
@@ -3560,9 +3575,9 @@ SwLayoutFrm *SwTabFrm::GetLeaf( MakePageType eMakePage, BOOL bFwd )
|* Letzte Aenderung MA 04. Mar. 97
|*
|*************************************************************************/
-BOOL SwTabFrm::ShouldBwdMoved( SwLayoutFrm *pNewUpper, BOOL, BOOL &rReformat )
+sal_Bool SwTabFrm::ShouldBwdMoved( SwLayoutFrm *pNewUpper, sal_Bool, sal_Bool &rReformat )
{
- rReformat = FALSE;
+ rReformat = sal_False;
if ( (SwFlowFrm::IsMoveBwdJump() || !IsPrevObjMove()) )
{
//Das zurueckfliessen von Frm's ist leider etwas Zeitintensiv.
@@ -3584,7 +3599,7 @@ BOOL SwTabFrm::ShouldBwdMoved( SwLayoutFrm *pNewUpper, BOOL, BOOL &rReformat )
SwPageFrm *pOldPage = FindPageFrm(),
*pNewPage = pNewUpper->FindPageFrm();
- BOOL bMoveAnyway = FALSE;
+ sal_Bool bMoveAnyway = sal_False;
SwTwips nSpace = 0;
SWRECTFN( this )
@@ -3596,7 +3611,7 @@ BOOL SwTabFrm::ShouldBwdMoved( SwLayoutFrm *pNewUpper, BOOL, BOOL &rReformat )
long nNewWidth = (pNewUpper->Prt().*fnRectX->fnGetWidth)();
if( Abs( nNewWidth - nOldWidth ) < 2 )
{
- if( FALSE ==
+ if( sal_False ==
( bMoveAnyway = BwdMoveNecessary( pOldPage, Frm() ) > 1 ) )
{
SwRect aRect( pNewUpper->Prt() );
@@ -3622,19 +3637,24 @@ BOOL SwTabFrm::ShouldBwdMoved( SwLayoutFrm *pNewUpper, BOOL, BOOL &rReformat )
nSpace = nTmpSpace;
// <--
+<<<<<<< local
const ViewShell *pSh = getRootFrm()->GetCurrShell();
if( pSh && pSh->GetViewOptions()->getBrowseMode() )
nSpace += pNewUpper->Grow( LONG_MAX, TRUE );
+=======
+ if ( GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ nSpace += pNewUpper->Grow( LONG_MAX, sal_True );
+>>>>>>> other
}
}
else if( !bLockBackMove )
- bMoveAnyway = TRUE;
+ bMoveAnyway = sal_True;
}
else if( !bLockBackMove )
- bMoveAnyway = TRUE;
+ bMoveAnyway = sal_True;
if ( bMoveAnyway )
- return rReformat = TRUE;
+ return rReformat = sal_True;
else if ( !bLockBackMove && nSpace > 0 )
{
// --> OD 2004-10-05 #i26945# - check, if follow flow line
@@ -3646,7 +3666,7 @@ BOOL SwTabFrm::ShouldBwdMoved( SwLayoutFrm *pNewUpper, BOOL, BOOL &rReformat )
*(pFirstRow->GetFmt()->GetDoc()),
*(pFirstRow) ) )
{
- return FALSE;
+ return sal_False;
}
// <--
SwTwips nTmpHeight = CalcHeightOfFirstContentLine();
@@ -3660,7 +3680,7 @@ BOOL SwTabFrm::ShouldBwdMoved( SwLayoutFrm *pNewUpper, BOOL, BOOL &rReformat )
// <--
}
}
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -3742,7 +3762,7 @@ void SwTabFrm::Cut()
{
if ( pUp->GetUpper() )
{
- pSct->DelEmpty( FALSE );
+ pSct->DelEmpty( sal_False );
pSct->_InvalidateSize();
}
}
@@ -3824,7 +3844,7 @@ void SwTabFrm::Paste( SwFrm* pParent, SwFrm* pSibling )
(!pDesc && pPage->GetPageDesc() !=
&(const_cast<const SwDoc *>(GetFmt()->GetDoc())
->GetPageDesc(0))) )
- CheckPageDescs( pPage, TRUE );
+ CheckPageDescs( pPage, sal_True );
}
}
}
@@ -3837,7 +3857,7 @@ void SwTabFrm::Paste( SwFrm* pParent, SwFrm* pSibling )
|* Last Change AMA 01/10/02
|*
|*************************************************************************/
-void SwTabFrm::Prepare( const PrepareHint eHint, const void *, BOOL )
+void SwTabFrm::Prepare( const PrepareHint eHint, const void *, sal_Bool )
{
if( PREP_BOSS_CHGD == eHint )
CheckDirChange();
@@ -3871,7 +3891,7 @@ SwRowFrm::SwRowFrm( const SwTableLine &rLine, SwFrm* pSib, bool bInsertContent )
//Gleich die Boxen erzeugen und einfuegen.
const SwTableBoxes &rBoxes = rLine.GetTabBoxes();
SwFrm *pTmpPrev = 0;
- for ( USHORT i = 0; i < rBoxes.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rBoxes.Count(); ++i )
{
SwCellFrm *pNew = new SwCellFrm( *rBoxes[i], this, bInsertContent );
pNew->InsertBehind( this, pTmpPrev );
@@ -3913,15 +3933,15 @@ void SwRowFrm::RegistFlys( SwPageFrm *pPage )
|*************************************************************************/
void SwRowFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
{
- BOOL bAttrSetChg = pNew && RES_ATTRSET_CHG == pNew->Which();
+ sal_Bool bAttrSetChg = pNew && RES_ATTRSET_CHG == pNew->Which();
const SfxPoolItem *pItem = 0;
if( bAttrSetChg )
{
const SwAttrSet* pChgSet = ((SwAttrSetChg*)pNew)->GetChgSet();
- pChgSet->GetItemState( RES_FRM_SIZE, FALSE, &pItem);
+ pChgSet->GetItemState( RES_FRM_SIZE, sal_False, &pItem);
if ( !pItem )
- pChgSet->GetItemState( RES_ROW_SPLIT, FALSE, &pItem);
+ pChgSet->GetItemState( RES_ROW_SPLIT, sal_False, &pItem);
}
else if ( RES_FRM_SIZE == pNew->Which() || RES_ROW_SPLIT == pNew->Which() )
pItem = pNew;
@@ -3961,7 +3981,7 @@ void SwRowFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
void SwRowFrm::MakeAll()
{
if ( !GetNext() )
- bValidSize = FALSE;
+ bValidSize = sal_False;
SwLayoutFrm::MakeAll();
}
@@ -4011,7 +4031,7 @@ long MA_FASTCALL CalcHeightWidthFlys( const SwFrm *pFrm )
if ( pObjs )
// <--
{
- for ( USHORT i = 0; i < pObjs->Count(); ++i )
+ for ( sal_uInt16 i = 0; i < pObjs->Count(); ++i )
{
const SwAnchoredObject* pAnchoredObj = (*pObjs)[i];
// --> OD 2004-10-08 #i26945# - if <pTmp> is follow, the
@@ -4114,7 +4134,7 @@ SwTwips lcl_CalcTopAndBottomMargin( const SwLayoutFrm& rCell, const SwBorderAttr
// control, if floating screen objects have to be considered for the minimal
// cell height.
SwTwips MA_FASTCALL lcl_CalcMinCellHeight( const SwLayoutFrm *_pCell,
- const BOOL _bConsiderObjs,
+ const sal_Bool _bConsiderObjs,
const SwBorderAttrs *pAttrs = 0 )
{
SWRECTFN( _pCell )
@@ -4173,7 +4193,7 @@ SwTwips MA_FASTCALL lcl_CalcMinCellHeight( const SwLayoutFrm *_pCell,
// --> OD 2004-10-04 #i26945# - add parameter <_bConsiderObjs> in order to control,
// if floating screen objects have to be considered for the minimal cell height
SwTwips MA_FASTCALL lcl_CalcMinRowHeight( const SwRowFrm* _pRow,
- const BOOL _bConsiderObjs )
+ const sal_Bool _bConsiderObjs )
{
SWRECTFN( _pRow )
@@ -4230,13 +4250,13 @@ SwTwips MA_FASTCALL lcl_CalcMinRowHeight( const SwRowFrm* _pRow,
// --> collapsing borders FME 2005-05-27 #i29550#
// Calculate the maximum of (TopLineSize + TopLineDist) over all lowers:
-USHORT lcl_GetTopSpace( const SwRowFrm& rRow )
+sal_uInt16 lcl_GetTopSpace( const SwRowFrm& rRow )
{
- USHORT nTopSpace = 0;
+ sal_uInt16 nTopSpace = 0;
for ( SwCellFrm* pCurrLower = (SwCellFrm*)rRow.Lower(); pCurrLower;
pCurrLower = (SwCellFrm*)pCurrLower->GetNext() )
{
- USHORT nTmpTopSpace = 0;
+ sal_uInt16 nTmpTopSpace = 0;
if ( pCurrLower->Lower() && pCurrLower->Lower()->IsRowFrm() )
nTmpTopSpace = lcl_GetTopSpace( *(SwRowFrm*)pCurrLower->Lower() );
else
@@ -4251,13 +4271,13 @@ USHORT lcl_GetTopSpace( const SwRowFrm& rRow )
}
// Calculate the maximum of TopLineDist over all lowers:
-USHORT lcl_GetTopLineDist( const SwRowFrm& rRow )
+sal_uInt16 lcl_GetTopLineDist( const SwRowFrm& rRow )
{
- USHORT nTopLineDist = 0;
+ sal_uInt16 nTopLineDist = 0;
for ( SwCellFrm* pCurrLower = (SwCellFrm*)rRow.Lower(); pCurrLower;
pCurrLower = (SwCellFrm*)pCurrLower->GetNext() )
{
- USHORT nTmpTopLineDist = 0;
+ sal_uInt16 nTmpTopLineDist = 0;
if ( pCurrLower->Lower() && pCurrLower->Lower()->IsRowFrm() )
nTmpTopLineDist = lcl_GetTopLineDist( *(SwRowFrm*)pCurrLower->Lower() );
else
@@ -4272,13 +4292,13 @@ USHORT lcl_GetTopLineDist( const SwRowFrm& rRow )
}
// Calculate the maximum of BottomLineSize over all lowers:
-USHORT lcl_GetBottomLineSize( const SwRowFrm& rRow )
+sal_uInt16 lcl_GetBottomLineSize( const SwRowFrm& rRow )
{
- USHORT nBottomLineSize = 0;
+ sal_uInt16 nBottomLineSize = 0;
for ( SwCellFrm* pCurrLower = (SwCellFrm*)rRow.Lower(); pCurrLower;
pCurrLower = (SwCellFrm*)pCurrLower->GetNext() )
{
- USHORT nTmpBottomLineSize = 0;
+ sal_uInt16 nTmpBottomLineSize = 0;
if ( pCurrLower->Lower() && pCurrLower->Lower()->IsRowFrm() )
{
const SwFrm* pRow = pCurrLower->GetLastLower();
@@ -4297,13 +4317,13 @@ USHORT lcl_GetBottomLineSize( const SwRowFrm& rRow )
}
// Calculate the maximum of BottomLineDist over all lowers:
-USHORT lcl_GetBottomLineDist( const SwRowFrm& rRow )
+sal_uInt16 lcl_GetBottomLineDist( const SwRowFrm& rRow )
{
- USHORT nBottomLineDist = 0;
+ sal_uInt16 nBottomLineDist = 0;
for ( SwCellFrm* pCurrLower = (SwCellFrm*)rRow.Lower(); pCurrLower;
pCurrLower = (SwCellFrm*)pCurrLower->GetNext() )
{
- USHORT nTmpBottomLineDist = 0;
+ sal_uInt16 nTmpBottomLineDist = 0;
if ( pCurrLower->Lower() && pCurrLower->Lower()->IsRowFrm() )
{
const SwFrm* pRow = pCurrLower->GetLastLower();
@@ -4327,13 +4347,13 @@ void SwRowFrm::Format( const SwBorderAttrs *pAttrs )
SWRECTFN( this )
ASSERT( pAttrs, "SwRowFrm::Format ohne Attrs." );
- const BOOL bFix = bFixSize;
+ const sal_Bool bFix = bFixSize;
if ( !bValidPrtArea )
{
//RowFrms haben keine Umrandung usw. also entspricht die PrtArea immer
//dem Frm.
- bValidPrtArea = TRUE;
+ bValidPrtArea = sal_True;
aPrt.Left( 0 );
aPrt.Top( 0 );
aPrt.Width ( aFrm.Width() );
@@ -4344,10 +4364,10 @@ void SwRowFrm::Format( const SwBorderAttrs *pAttrs )
SwTabFrm* pTabFrm = FindTabFrm();
if ( pTabFrm->IsCollapsingBorders() )
{
- const USHORT nTopSpace = lcl_GetTopSpace( *this );
- const USHORT nTopLineDist = lcl_GetTopLineDist( *this );
- const USHORT nBottomLineSize = lcl_GetBottomLineSize( *this );
- const USHORT nBottomLineDist = lcl_GetBottomLineDist( *this );
+ const sal_uInt16 nTopSpace = lcl_GetTopSpace( *this );
+ const sal_uInt16 nTopLineDist = lcl_GetTopLineDist( *this );
+ const sal_uInt16 nBottomLineSize = lcl_GetBottomLineSize( *this );
+ const sal_uInt16 nBottomLineDist = lcl_GetBottomLineDist( *this );
const SwRowFrm* pPreviousRow = 0;
@@ -4364,7 +4384,7 @@ void SwRowFrm::Format( const SwBorderAttrs *pAttrs )
while ( pTmpRow && !pPrevTabLine )
{
- USHORT nIdx = 0;
+ sal_uInt16 nIdx = 0;
const SwTableLines& rLines = pTmpRow->GetTabLine()->GetUpper() ?
pTmpRow->GetTabLine()->GetUpper()->GetTabLines() :
pTable->GetTabLines();
@@ -4408,10 +4428,10 @@ void SwRowFrm::Format( const SwBorderAttrs *pAttrs )
}
// <--
- USHORT nTopPrtMargin = nTopSpace;
+ sal_uInt16 nTopPrtMargin = nTopSpace;
if ( pPreviousRow )
{
- const USHORT nTmpPrtMargin = pPreviousRow->GetBottomLineSize() + nTopLineDist;
+ const sal_uInt16 nTmpPrtMargin = pPreviousRow->GetBottomLineSize() + nTopLineDist;
if ( nTmpPrtMargin > nTopPrtMargin )
nTopPrtMargin = nTmpPrtMargin;
}
@@ -4445,7 +4465,7 @@ void SwRowFrm::Format( const SwBorderAttrs *pAttrs )
while ( !bValidSize )
{
- bValidSize = TRUE;
+ bValidSize = sal_True;
#ifdef DBG_UTIL
if ( HasFixSize() )
@@ -4463,9 +4483,9 @@ void SwRowFrm::Format( const SwBorderAttrs *pAttrs )
// <--
if ( nDiff )
{
- bFixSize = FALSE;
+ bFixSize = sal_False;
if ( nDiff > 0 )
- Shrink( nDiff, FALSE, TRUE );
+ Shrink( nDiff, sal_False, sal_True );
else if ( nDiff < 0 )
Grow( -nDiff );
bFixSize = bFix;
@@ -4484,10 +4504,10 @@ void SwRowFrm::Format( const SwBorderAttrs *pAttrs )
} while ( pSibling );
if ( nDiff > 0 )
{
- bFixSize = FALSE;
+ bFixSize = sal_False;
Grow( nDiff );
bFixSize = bFix;
- bValidSize = TRUE;
+ bValidSize = sal_True;
}
}
}
@@ -4500,7 +4520,7 @@ void SwRowFrm::Format( const SwBorderAttrs *pAttrs )
|* Letzte Aenderung MA 16. Dec. 96
|*
|*************************************************************************/
-void SwRowFrm::AdjustCells( const SwTwips nHeight, const BOOL bHeight )
+void SwRowFrm::AdjustCells( const SwTwips nHeight, const sal_Bool bHeight )
{
SwFrm *pFrm = Lower();
if ( bHeight )
@@ -4648,7 +4668,7 @@ void SwRowFrm::Cut()
|*************************************************************************/
-SwTwips SwRowFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
+SwTwips SwRowFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
{
SwTwips nReal = 0;
@@ -4685,7 +4705,7 @@ SwTwips SwRowFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
}
if ( bRestrictTableGrowth )
- pTab->SetRestrictTableGrowth( TRUE );
+ pTab->SetRestrictTableGrowth( sal_True );
else
{
// Ok, this looks like a hack, indeed, it is a hack.
@@ -4694,19 +4714,19 @@ SwTwips SwRowFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
// be allowed to grow. In fact, setting bRestrictTableGrowth
// to 'false' does not work, because the surrounding RowFrm
// would set this to 'true'.
- pTab->SetFollowFlowLine( FALSE );
+ pTab->SetFollowFlowLine( sal_False );
}
nReal += SwLayoutFrm::GrowFrm( nDist, bTst, bInfo);
- pTab->SetRestrictTableGrowth( FALSE );
+ pTab->SetRestrictTableGrowth( sal_False );
pTab->SetFollowFlowLine( bHasFollowFlowLine );
//Hoehe der Zellen auf den neuesten Stand bringen.
if ( !bTst )
{
SWRECTFNX( this )
- AdjustCells( (Prt().*fnRectX->fnGetHeight)() + nReal, TRUE );
+ AdjustCells( (Prt().*fnRectX->fnGetHeight)() + nReal, sal_True );
if ( nReal )
SetCompletePaint();
}
@@ -4722,18 +4742,18 @@ SwTwips SwRowFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
|* Letzte Aenderung MA 20. Jun. 96
|*
|*************************************************************************/
-SwTwips SwRowFrm::ShrinkFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
+SwTwips SwRowFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
{
SWRECTFN( this )
if( HasFixSize() )
{
- AdjustCells( (Prt().*fnRect->fnGetHeight)(), TRUE );
+ AdjustCells( (Prt().*fnRect->fnGetHeight)(), sal_True );
return 0L;
}
- //bInfo wird ggf. vom SwRowFrm::Format auf TRUE gesetzt, hier muss dann
+ //bInfo wird ggf. vom SwRowFrm::Format auf sal_True gesetzt, hier muss dann
//entsprechend reagiert werden
- const BOOL bShrinkAnyway = bInfo;
+ const sal_Bool bShrinkAnyway = bInfo;
//Nur soweit Shrinken, wie es der Inhalt der groessten Zelle zulaesst.
SwTwips nRealDist = nDist;
@@ -4808,7 +4828,7 @@ SwTwips SwRowFrm::ShrinkFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
pMasterTab->InvalidatePos();
}
}
- AdjustCells( (Prt().*fnRect->fnGetHeight)() - nReal, TRUE );
+ AdjustCells( (Prt().*fnRect->fnGetHeight)() - nReal, sal_True );
}
return nReal;
}
@@ -4879,14 +4899,14 @@ SwCellFrm::SwCellFrm( const SwTableBox &rBox, SwFrm* pSib, bool bInsertContent )
//angelegt.
if ( rBox.GetSttIdx() )
{
- ULONG nIndex = rBox.GetSttIdx();
+ sal_uLong nIndex = rBox.GetSttIdx();
::_InsertCnt( this, rBox.GetFrmFmt()->GetDoc(), ++nIndex );
}
else
{
const SwTableLines &rLines = rBox.GetTabLines();
SwFrm *pTmpPrev = 0;
- for ( USHORT i = 0; i < rLines.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rLines.Count(); ++i )
{
SwRowFrm *pNew = new SwRowFrm( *rLines[i], this, bInsertContent );
pNew->InsertBehind( this, pTmpPrev );
@@ -4923,9 +4943,9 @@ SwCellFrm::~SwCellFrm()
|* Letzte Aenderung MA 29. Jan. 98
|*
|*************************************************************************/
-BOOL lcl_ArrangeLowers( SwLayoutFrm *pLay, long lYStart, BOOL bInva )
+sal_Bool lcl_ArrangeLowers( SwLayoutFrm *pLay, long lYStart, sal_Bool bInva )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
SwFrm *pFrm = pLay->Lower();
SWRECTFN( pLay )
while ( pFrm )
@@ -4933,7 +4953,7 @@ BOOL lcl_ArrangeLowers( SwLayoutFrm *pLay, long lYStart, BOOL bInva )
long nFrmTop = (pFrm->Frm().*fnRect->fnGetTop)();
if( nFrmTop != lYStart )
{
- bRet = TRUE;
+ bRet = sal_True;
const long lDiff = (*fnRect->fnYDiff)( lYStart, nFrmTop );
const long lDiffX = lYStart - nFrmTop;
(pFrm->Frm().*fnRect->fnSubTop)( -lDiff );
@@ -4949,7 +4969,7 @@ BOOL lcl_ArrangeLowers( SwLayoutFrm *pLay, long lYStart, BOOL bInva )
+ lDiffX, bInva );
if ( pFrm->GetDrawObjs() )
{
- for ( USHORT i = 0; i < pFrm->GetDrawObjs()->Count(); ++i )
+ for ( sal_uInt16 i = 0; i < pFrm->GetDrawObjs()->Count(); ++i )
{
SwAnchoredObject* pAnchoredObj = (*pFrm->GetDrawObjs())[i];
// --> OD 2004-10-08 #i26945# - check, if anchored object
@@ -5164,7 +5184,7 @@ void SwCellFrm::Format( const SwBorderAttrs *pAttrs )
if ( !bValidPrtArea )
{
- bValidPrtArea = TRUE;
+ bValidPrtArea = sal_True;
//Position einstellen.
if ( Lower() )
@@ -5199,7 +5219,7 @@ void SwCellFrm::Format( const SwBorderAttrs *pAttrs )
// <--
if ( !bValidSize )
{
- bValidSize = TRUE;
+ bValidSize = sal_True;
//Die VarSize der CellFrms ist immer die Breite.
//Tatsaechlich ist die Breite jedoch nicht Variabel, sie wird durch das
@@ -5233,7 +5253,7 @@ void SwCellFrm::Format( const SwBorderAttrs *pAttrs )
const SwTableBox* pTmpBox = 0;
SwTwips nSumWidth = 0;
- USHORT i = 0;
+ sal_uInt16 i = 0;
do
{
pTmpBox = rBoxes[ i++ ];
@@ -5297,7 +5317,7 @@ void SwCellFrm::Format( const SwBorderAttrs *pAttrs )
//Wieder validieren wenn kein Wachstum stattgefunden hat.
//Invalidiert wird durch AdjustCells von der Row.
if ( !Grow( nDiffHeight ) )
- bValidSize = bValidPrtArea = TRUE;
+ bValidSize = bValidPrtArea = sal_True;
}
else
{
@@ -5305,7 +5325,7 @@ void SwCellFrm::Format( const SwBorderAttrs *pAttrs )
//geshrinkt wurde; das kann abgelehnt werden, weil alle
//nebeneinanderliegenden Zellen gleichgross sein muessen.
if ( !Shrink( -nDiffHeight ) )
- bValidSize = bValidPrtArea = TRUE;
+ bValidSize = bValidPrtArea = sal_True;
}
}
}
@@ -5332,7 +5352,7 @@ void SwCellFrm::Format( const SwBorderAttrs *pAttrs )
ASSERT( !this, "VAlign an Zelle ohne Inhalt" );
return;
}
- BOOL bVertDir = TRUE;
+ sal_Bool bVertDir = sal_True;
// --> OD 2005-03-30 #i43913# - no vertical alignment, if wrapping
// style influence is considered on object positioning and
// an object is anchored inside the cell.
@@ -5342,7 +5362,7 @@ void SwCellFrm::Format( const SwBorderAttrs *pAttrs )
if ( pPg->GetSortedObjs() )
{
SwRect aRect( Prt() ); aRect += Frm().Pos();
- for ( USHORT i = 0; i < pPg->GetSortedObjs()->Count(); ++i )
+ for ( sal_uInt16 i = 0; i < pPg->GetSortedObjs()->Count(); ++i )
{
const SwAnchoredObject* pAnchoredObj = (*pPg->GetSortedObjs())[i];
SwRect aTmp( pAnchoredObj->GetObjRect() );
@@ -5375,7 +5395,7 @@ void SwCellFrm::Format( const SwBorderAttrs *pAttrs )
!rAnchoredObjFrmFmt.GetFollowTextFlow().GetValue() )
// <--
{
- bVertDir = FALSE;
+ bVertDir = sal_False;
break;
}
}
@@ -5413,7 +5433,7 @@ void SwCellFrm::Format( const SwBorderAttrs *pAttrs )
if ( Lower()->IsCntntFrm() )
{
const long lYStart = (this->*fnRect->fnGetPrtTop)();
- lcl_ArrangeLowers( this, lYStart, TRUE );
+ lcl_ArrangeLowers( this, lYStart, sal_True );
}
}
}
@@ -5429,24 +5449,24 @@ void SwCellFrm::Format( const SwBorderAttrs *pAttrs )
void SwCellFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
{
- BOOL bAttrSetChg = pNew && RES_ATTRSET_CHG == pNew->Which();
+ sal_Bool bAttrSetChg = pNew && RES_ATTRSET_CHG == pNew->Which();
const SfxPoolItem *pItem = 0;
if( bAttrSetChg )
- ((SwAttrSetChg*)pNew)->GetChgSet()->GetItemState( RES_VERT_ORIENT, FALSE, &pItem);
+ ((SwAttrSetChg*)pNew)->GetChgSet()->GetItemState( RES_VERT_ORIENT, sal_False, &pItem);
else if ( RES_VERT_ORIENT == pNew->Which() )
pItem = pNew;
if ( pItem )
{
- BOOL bInva = TRUE;
+ sal_Bool bInva = sal_True;
if ( text::VertOrientation::NONE == ((SwFmtVertOrient*)pItem)->GetVertOrient() &&
// OD 04.11.2003 #112910#
Lower() && Lower()->IsCntntFrm() )
{
SWRECTFN( this )
const long lYStart = (this->*fnRect->fnGetPrtTop)();
- bInva = lcl_ArrangeLowers( this, lYStart, FALSE );
+ bInva = lcl_ArrangeLowers( this, lYStart, sal_False );
}
if ( bInva )
{
@@ -5456,7 +5476,7 @@ void SwCellFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
}
if ( ( bAttrSetChg &&
- SFX_ITEM_SET == ((SwAttrSetChg*)pNew)->GetChgSet()->GetItemState( RES_PROTECT, FALSE ) ) ||
+ SFX_ITEM_SET == ((SwAttrSetChg*)pNew)->GetChgSet()->GetItemState( RES_PROTECT, sal_False ) ) ||
RES_PROTECT == pNew->Which() )
{
ViewShell *pSh = getRootFrm()->GetCurrShell();
@@ -5465,15 +5485,15 @@ void SwCellFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
}
if ( bAttrSetChg &&
- SFX_ITEM_SET == ((SwAttrSetChg*)pNew)->GetChgSet()->GetItemState( RES_FRAMEDIR, FALSE, &pItem ) )
+ SFX_ITEM_SET == ((SwAttrSetChg*)pNew)->GetChgSet()->GetItemState( RES_FRAMEDIR, sal_False, &pItem ) )
{
- SetDerivedVert( FALSE );
+ SetDerivedVert( sal_False );
CheckDirChange();
}
// --> collapsing borders FME 2005-05-27 #i29550#
if ( bAttrSetChg &&
- SFX_ITEM_SET == ((SwAttrSetChg*)pNew)->GetChgSet()->GetItemState( RES_BOX, FALSE, &pItem ) )
+ SFX_ITEM_SET == ((SwAttrSetChg*)pNew)->GetChgSet()->GetItemState( RES_BOX, sal_False, &pItem ) )
{
SwFrm* pTmpUpper = GetUpper();
while ( pTmpUpper->GetUpper() && !pTmpUpper->GetUpper()->IsTabFrm() )
@@ -5574,7 +5594,7 @@ SwRowFrm* SwTabFrm::GetFirstNonHeadlineRow() const
}
else
{
- USHORT nRepeat = GetTable()->GetRowsToRepeat();
+ sal_uInt16 nRepeat = GetTable()->GetRowsToRepeat();
while ( pRet && nRepeat > 0 )
{
pRet = (SwRowFrm*)pRet->GetNext();
@@ -5591,7 +5611,7 @@ SwRowFrm* SwTabFrm::GetFirstNonHeadlineRow() const
*/
bool SwTable::IsHeadline( const SwTableLine& rLine ) const
{
- for ( USHORT i = 0; i < GetRowsToRepeat(); ++i )
+ for ( sal_uInt16 i = 0; i < GetRowsToRepeat(); ++i )
if ( GetTabLines()[ i ] == &rLine )
return true;
@@ -5605,7 +5625,7 @@ bool SwTabFrm::IsLayoutSplitAllowed() const
// --> collapsing borders FME 2005-05-27 #i29550#
-USHORT SwTabFrm::GetBottomLineSize() const
+sal_uInt16 SwTabFrm::GetBottomLineSize() const
{
ASSERT( IsCollapsingBorders(),
"BottomLineSize only required for collapsing borders" )
@@ -5803,7 +5823,7 @@ SwTwips SwTabFrm::CalcHeightOfFirstContentLine() const
pFirstRow = static_cast<SwRowFrm*>(pFirstRow->GetNext());
// Calculate the height of the headlines:
- const USHORT nRepeat = GetTable()->GetRowsToRepeat();
+ const sal_uInt16 nRepeat = GetTable()->GetRowsToRepeat();
SwTwips nRepeatHeight = nRepeat ? lcl_GetHeightOfRows( GetLower(), nRepeat ) : 0;
// Calculate the height of the keeping lines
@@ -5811,7 +5831,7 @@ SwTwips SwTabFrm::CalcHeightOfFirstContentLine() const
SwTwips nKeepHeight = nRepeatHeight;
if ( GetFmt()->GetDoc()->get(IDocumentSettingAccess::TABLE_ROW_KEEP) )
{
- USHORT nKeepRows = nRepeat;
+ sal_uInt16 nKeepRows = nRepeat;
// Check how many rows want to keep together
while ( pFirstRow && pFirstRow->ShouldRowKeepWithNext() )
@@ -5860,7 +5880,7 @@ SwTwips SwTabFrm::CalcHeightOfFirstContentLine() const
{
if ( 1 == pLower2->GetTabBox()->getRowSpan() )
{
- const SwTwips nCellHeight = lcl_CalcMinCellHeight( pLower2, TRUE );
+ const SwTwips nCellHeight = lcl_CalcMinCellHeight( pLower2, sal_True );
nMaxHeight = Max( nCellHeight, nMaxHeight );
}
pLower2 = static_cast<const SwCellFrm*>(pLower2->GetNext());
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index f6301ab79e68..9a2b8acc4d96 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -77,14 +77,14 @@ public:
//public:
// SwCrsrOszControl() : pStk1( 0 ), pStk2( 0 ) {}; // ; <- ????
- BOOL ChkOsz( const SwFlyFrm *pFly )
+ sal_Bool ChkOsz( const SwFlyFrm *pFly )
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
if ( pFly != pStk1 && pFly != pStk2 )
{
pStk1 = pStk2;
pStk2 = pFly;
- bRet = FALSE;
+ bRet = sal_False;
}
return bRet;
}
@@ -112,10 +112,10 @@ static SwCrsrOszControl aOszCtrl = { 0, 0, 0 };
|* Letzte Aenderung MA 23. May. 95
|*
|*************************************************************************/
-BOOL SwLayoutFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
+sal_Bool SwLayoutFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
SwCrsrMoveState* pCMS ) const
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
const SwFrm *pFrm = Lower();
while ( !bRet && pFrm )
{
@@ -130,11 +130,11 @@ BOOL SwLayoutFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
if ( aPaintRect.IsInside( rPoint ) &&
( bCntntCheck || pFrm->GetCrsrOfst( pPos, rPoint, pCMS ) ) )
- bRet = TRUE;
+ bRet = sal_True;
else
pFrm = pFrm->GetNext();
if ( pCMS && pCMS->bStop )
- return FALSE;
+ return sal_False;
}
return bRet;
}
@@ -150,10 +150,10 @@ BOOL SwLayoutFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
|*
|*************************************************************************/
-BOOL SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
+sal_Bool SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
SwCrsrMoveState* pCMS ) const
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
Point aPoint( rPoint );
// check, if we have to adjust the point
@@ -178,16 +178,16 @@ BOOL SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
static_cast<const SwVirtFlyDrawObj*>(aIter());
const SwFlyFrm* pFly = pObj ? pObj->GetFlyFrm() : 0;
if ( pFly &&
- ( ( pCMS ? pCMS->bSetInReadOnly : FALSE ) ||
+ ( ( pCMS ? pCMS->bSetInReadOnly : sal_False ) ||
!pFly->IsProtected() ) &&
pFly->GetCrsrOfst( pPos, aPoint, pCMS ) )
{
- bRet = TRUE;
+ bRet = sal_True;
break;
}
if ( pCMS && pCMS->bStop )
- return FALSE;
+ return sal_False;
aIter.Prev();
}
}
@@ -198,17 +198,17 @@ BOOL SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
//wir den StartPoint und fangen nochmal eine Seite vor der
//aktuellen an. Mit Flys ist es dann allerdings vorbei.
if ( SwLayoutFrm::GetCrsrOfst( pPos, aPoint, pCMS ) )
- bRet = TRUE;
+ bRet = sal_True;
else
{
if ( pCMS && (pCMS->bStop || pCMS->bExactOnly) )
{
- ((SwCrsrMoveState*)pCMS)->bStop = TRUE;
- return FALSE;
+ ((SwCrsrMoveState*)pCMS)->bStop = sal_True;
+ return sal_False;
}
- const SwCntntFrm *pCnt = GetCntntPos( aPoint, FALSE, FALSE, FALSE, pCMS, FALSE );
+ const SwCntntFrm *pCnt = GetCntntPos( aPoint, sal_False, sal_False, sal_False, pCMS, sal_False );
if ( pCMS && pCMS->bStop )
- return FALSE;
+ return sal_False;
ASSERT( pCnt, "Crsr is gone to a Black hole" );
if( pCMS && pCMS->pFill && pCnt->IsTxtFrm() )
@@ -221,7 +221,7 @@ BOOL SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
// Set point to pCnt, delete mark
// this may happen, if pCnt is hidden
*pPos = SwPosition( *pCnt->GetNode(), SwIndex( (SwTxtNode*)pCnt->GetNode(), 0 ) );
- bRet = TRUE;
+ bRet = sal_True;
}
}
}
@@ -256,7 +256,7 @@ bool SwPageFrm::FillSelection( SwSelectionList& rList, const SwRect& rRect ) con
if( GetSortedObjs() )
{
const SwSortedObjs &rObjs = *GetSortedObjs();
- for ( USHORT i = 0; i < rObjs.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i )
{
const SwAnchoredObject* pAnchoredObj = rObjs[i];
if( !pAnchoredObj->ISA(SwFlyFrm) )
@@ -294,19 +294,19 @@ bool SwRootFrm::FillSelection( SwSelectionList& aSelList, const SwRect& rRect) c
|*
|* Beschreibung: Reicht Primaer den Aufruf an die erste Seite weiter.
|* Wenn der 'reingereichte Point veraendert wird,
-|* so wird FALSE zurueckgegeben.
+|* so wird sal_False zurueckgegeben.
|* Ersterstellung MA 01. Jun. 92
|* Letzte Aenderung MA 30. Nov. 94
|*
|*************************************************************************/
-BOOL SwRootFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
+sal_Bool SwRootFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
SwCrsrMoveState* pCMS ) const
{
sal_Bool bOldAction = IsCallbackActionEnabled();
- ((SwRootFrm*)this)->SetCallbackActionEnabled( FALSE );
+ ((SwRootFrm*)this)->SetCallbackActionEnabled( sal_False );
ASSERT( (Lower() && Lower()->IsPageFrm()), "Keinen PageFrm gefunden." );
if( pCMS && pCMS->pFill )
- ((SwCrsrMoveState*)pCMS)->bFillRet = FALSE;
+ ((SwCrsrMoveState*)pCMS)->bFillRet = sal_False;
Point aOldPoint = rPoint;
// PAGES01
@@ -335,7 +335,7 @@ BOOL SwRootFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
if( pCMS )
{
if( pCMS->bStop )
- return FALSE;
+ return sal_False;
if( pCMS->pFill )
return pCMS->bFillRet;
}
@@ -354,24 +354,24 @@ BOOL SwRootFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
|* Letzte Aenderung MA 23. May. 95
|*
|*************************************************************************/
-BOOL SwCellFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
+sal_Bool SwCellFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
SwCrsrMoveState* pCMS ) const
{
// cell frame does not necessarily have a lower (split table cell)
if ( !Lower() )
- return FALSE;
+ return sal_False;
- if ( !(pCMS?pCMS->bSetInReadOnly:FALSE) &&
+ if ( !(pCMS?pCMS->bSetInReadOnly:sal_False) &&
GetFmt()->GetProtect().IsCntntProtected() )
- return FALSE;
+ return sal_False;
if ( pCMS && pCMS->eState == MV_TBLSEL )
{
const SwTabFrm *pTab = FindTabFrm();
if ( pTab->IsFollow() && pTab->IsInHeadline( *this ) )
{
- ((SwCrsrMoveState*)pCMS)->bStop = TRUE;
- return FALSE;
+ ((SwCrsrMoveState*)pCMS)->bStop = sal_True;
+ return sal_False;
}
}
@@ -382,7 +382,7 @@ BOOL SwCellFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
else
{
Calc();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
const SwFrm *pFrm = Lower();
while ( pFrm && !bRet )
@@ -392,14 +392,14 @@ BOOL SwCellFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
{
bRet = pFrm->GetCrsrOfst( pPos, rPoint, pCMS );
if ( pCMS && pCMS->bStop )
- return FALSE;
+ return sal_False;
}
pFrm = pFrm->GetNext();
}
if ( !bRet )
{
Point *pPoint = pCMS && pCMS->pFill ? new Point( rPoint ) : NULL;
- const SwCntntFrm *pCnt = GetCntntPos( rPoint, TRUE );
+ const SwCntntFrm *pCnt = GetCntntPos( rPoint, sal_True );
if( pPoint && pCnt->IsTxtFrm() )
{
pCnt->GetCrsrOfst( pPos, *pPoint, pCMS );
@@ -409,11 +409,11 @@ BOOL SwCellFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
pCnt->GetCrsrOfst( pPos, rPoint, pCMS );
delete pPoint;
}
- return TRUE;
+ return sal_True;
}
}
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -434,7 +434,7 @@ BOOL SwCellFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
//GetCrsrOfst entscheidet sich bei einer Rekursion fuer denjenigen der
//am weitesten oben liegt.
-BOOL SwFlyFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
+sal_Bool SwFlyFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
SwCrsrMoveState* pCMS ) const
{
aOszCtrl.Entry( this );
@@ -445,14 +445,14 @@ BOOL SwFlyFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
//innerhalb des aktuellen befindet, so wird fuer diesen das
//GetCrsrOfst gerufen.
Calc();
- BOOL bInside = Frm().IsInside( rPoint ) && Lower(),
- bRet = FALSE;
+ sal_Bool bInside = Frm().IsInside( rPoint ) && Lower(),
+ bRet = sal_False;
//Wenn der Frm eine Grafik enthaelt, aber nur Text gewuenscht ist, so
//nimmt er den Crsr grundsaetzlich nicht an.
if ( bInside && pCMS && pCMS->eState == MV_SETONLYTEXT &&
(!Lower() || Lower()->IsNoTxtFrm()) )
- bInside = FALSE;
+ bInside = sal_False;
const SwPageFrm *pPage = FindPageFrm();
if ( bInside && pPage && pPage->GetSortedObjs() )
@@ -467,10 +467,10 @@ BOOL SwFlyFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
Frm().IsInside( pFly->Frm() ) )
{
if ( aOszCtrl.ChkOsz( pFly ) ||
- TRUE == (bRet = pFly->GetCrsrOfst( pPos, rPoint, pCMS )))
+ sal_True == (bRet = pFly->GetCrsrOfst( pPos, rPoint, pCMS )))
break;
if ( pCMS && pCMS->bStop )
- return FALSE;
+ return sal_False;
}
aIter.Next();
}
@@ -486,7 +486,7 @@ BOOL SwFlyFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
{
bRet = pFrm->GetCrsrOfst( pPos, rPoint, pCMS );
if ( pCMS && pCMS->bStop )
- return FALSE;
+ return sal_False;
}
pFrm = pFrm->GetNext();
}
@@ -494,9 +494,9 @@ BOOL SwFlyFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
{
Point *pPoint = pCMS && pCMS->pFill ? new Point( rPoint ) : NULL;
const SwCntntFrm *pCnt = GetCntntPos(
- rPoint, TRUE, FALSE, FALSE, pCMS );
+ rPoint, sal_True, sal_False, sal_False, pCMS );
if ( pCMS && pCMS->bStop )
- return FALSE;
+ return sal_False;
if( pPoint && pCnt->IsTxtFrm() )
{
pCnt->GetCrsrOfst( pPos, *pPoint, pCMS );
@@ -505,7 +505,7 @@ BOOL SwFlyFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
else
pCnt->GetCrsrOfst( pPos, rPoint, pCMS );
delete pPoint;
- bRet = TRUE;
+ bRet = sal_True;
}
}
aOszCtrl.Exit( this );
@@ -519,22 +519,22 @@ BOOL SwFlyFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
|* Letzte Aenderung MA 06. Sep. 93
|*
|*************************************************************************/
-BOOL SwCntntFrm::LeftMargin(SwPaM *pPam) const
+sal_Bool SwCntntFrm::LeftMargin(SwPaM *pPam) const
{
if( pPam->GetNode() != (SwCntntNode*)GetNode() )
- return FALSE;
+ return sal_False;
((SwCntntNode*)GetNode())->
MakeStartIndex((SwIndex *) &pPam->GetPoint()->nContent);
- return TRUE;
+ return sal_True;
}
-BOOL SwCntntFrm::RightMargin(SwPaM *pPam, BOOL) const
+sal_Bool SwCntntFrm::RightMargin(SwPaM *pPam, sal_Bool) const
{
if( pPam->GetNode() != (SwCntntNode*)GetNode() )
- return FALSE;
+ return sal_False;
((SwCntntNode*)GetNode())->
MakeEndIndex((SwIndex *) &pPam->GetPoint()->nContent);
- return TRUE;
+ return sal_True;
}
const SwCntntFrm *lcl_GetNxtCnt( const SwCntntFrm* pCnt )
@@ -550,7 +550,7 @@ const SwCntntFrm *lcl_GetPrvCnt( const SwCntntFrm* pCnt )
typedef const SwCntntFrm *(*GetNxtPrvCnt)( const SwCntntFrm* );
//Frame in wiederholter Headline?
-BOOL lcl_IsInRepeatedHeadline( const SwFrm *pFrm,
+sal_Bool lcl_IsInRepeatedHeadline( const SwFrm *pFrm,
const SwTabFrm** ppTFrm = 0 )
{
const SwTabFrm *pTab = pFrm->FindTabFrm();
@@ -566,13 +566,13 @@ BOOL lcl_IsInRepeatedHeadline( const SwFrm *pFrm,
// FME: Skip follow flow cells
const SwCntntFrm * MA_FASTCALL lcl_MissProtectedFrames( const SwCntntFrm *pCnt,
GetNxtPrvCnt fnNxtPrv,
- BOOL bMissHeadline,
- BOOL bInReadOnly,
- BOOL bMissFollowFlowLine )
+ sal_Bool bMissHeadline,
+ sal_Bool bInReadOnly,
+ sal_Bool bMissFollowFlowLine )
{
if ( pCnt && pCnt->IsInTab() )
{
- BOOL bProtect = TRUE;
+ sal_Bool bProtect = sal_True;
while ( pCnt && bProtect )
{
const SwLayoutFrm *pCell = pCnt->GetUpper();
@@ -583,7 +583,7 @@ const SwCntntFrm * MA_FASTCALL lcl_MissProtectedFrames( const SwCntntFrm *pCnt,
( !bMissHeadline || !lcl_IsInRepeatedHeadline( pCell ) ) &&
( !bMissFollowFlowLine || !pCell->IsInFollowFlowRow() ) &&
!pCell->IsCoveredCell() ) )
- bProtect = FALSE;
+ bProtect = sal_False;
else
pCnt = (*fnNxtPrv)( pCnt );
}
@@ -595,8 +595,8 @@ const SwCntntFrm * MA_FASTCALL lcl_MissProtectedFrames( const SwCntntFrm *pCnt,
return pCnt;
}
-BOOL MA_FASTCALL lcl_UpDown( SwPaM *pPam, const SwCntntFrm *pStart,
- GetNxtPrvCnt fnNxtPrv, BOOL bInReadOnly )
+sal_Bool MA_FASTCALL lcl_UpDown( SwPaM *pPam, const SwCntntFrm *pStart,
+ GetNxtPrvCnt fnNxtPrv, sal_Bool bInReadOnly )
{
ASSERT( pPam->GetNode() == (SwCntntNode*)pStart->GetNode(),
"lcl_UpDown arbeitet nicht fuer andere." );
@@ -606,10 +606,10 @@ BOOL MA_FASTCALL lcl_UpDown( SwPaM *pPam, const SwCntntFrm *pStart,
//Wenn gerade eine Tabellenselection laeuft muss ein bischen getricktst
//werden: Beim hochlaufen an den Anfang der Zelle gehen, beim runterlaufen
//an das Ende der Zelle gehen.
- BOOL bTblSel = false;
+ sal_Bool bTblSel = false;
if ( pStart->IsInTab() &&
- pPam->GetNode( TRUE )->StartOfSectionNode() !=
- pPam->GetNode( FALSE )->StartOfSectionNode() )
+ pPam->GetNode( sal_True )->StartOfSectionNode() !=
+ pPam->GetNode( sal_False )->StartOfSectionNode() )
{
bTblSel = true;
const SwLayoutFrm *pCell = pStart->GetUpper();
@@ -642,13 +642,13 @@ BOOL MA_FASTCALL lcl_UpDown( SwPaM *pPam, const SwCntntFrm *pStart,
}
pCnt = (*fnNxtPrv)( pCnt ? pCnt : pStart );
- pCnt = ::lcl_MissProtectedFrames( pCnt, fnNxtPrv, TRUE, bInReadOnly, bTblSel );
+ pCnt = ::lcl_MissProtectedFrames( pCnt, fnNxtPrv, sal_True, bInReadOnly, bTblSel );
const SwTabFrm *pStTab = pStart->FindTabFrm();
const SwTabFrm *pTable = 0;
- const BOOL bTab = pStTab || (pCnt && pCnt->IsInTab()) ? TRUE : FALSE;
- BOOL bEnd = bTab ? FALSE : TRUE;
+ const sal_Bool bTab = pStTab || (pCnt && pCnt->IsInTab()) ? sal_True : sal_False;
+ sal_Bool bEnd = bTab ? sal_False : sal_True;
const SwFrm* pVertRefFrm = pStart;
if ( bTblSel && pStTab )
@@ -723,7 +723,7 @@ BOOL MA_FASTCALL lcl_UpDown( SwPaM *pPam, const SwCntntFrm *pStart,
(pCnt->IsTxtFrm() && ((SwTxtFrm*)pCnt)->IsHiddenNow())))
{
pCnt = (*fnNxtPrv)( pCnt );
- pCnt = ::lcl_MissProtectedFrames( pCnt, fnNxtPrv, TRUE, bInReadOnly, bTblSel );
+ pCnt = ::lcl_MissProtectedFrames( pCnt, fnNxtPrv, sal_True, bInReadOnly, bTblSel );
}
}
@@ -735,7 +735,7 @@ BOOL MA_FASTCALL lcl_UpDown( SwPaM *pPam, const SwCntntFrm *pStart,
(pCnt->IsTxtFrm() && ((SwTxtFrm*)pCnt)->IsHiddenNow())))
{
pCnt = (*fnNxtPrv)( pCnt );
- pCnt = ::lcl_MissProtectedFrames( pCnt, fnNxtPrv, TRUE, bInReadOnly, bTblSel );
+ pCnt = ::lcl_MissProtectedFrames( pCnt, fnNxtPrv, sal_True, bInReadOnly, bTblSel );
}
}
@@ -746,7 +746,7 @@ BOOL MA_FASTCALL lcl_UpDown( SwPaM *pPam, const SwCntntFrm *pStart,
if ( pCnt && pCnt->IsTxtFrm() && ((SwTxtFrm*)pCnt)->IsHiddenNow() )
{
pCnt = (*fnNxtPrv)( pCnt );
- pCnt = ::lcl_MissProtectedFrames( pCnt, fnNxtPrv, TRUE, bInReadOnly, bTblSel );
+ pCnt = ::lcl_MissProtectedFrames( pCnt, fnNxtPrv, sal_True, bInReadOnly, bTblSel );
}
}
@@ -757,11 +757,11 @@ BOOL MA_FASTCALL lcl_UpDown( SwPaM *pPam, const SwCntntFrm *pStart,
const SwFrm *pUp = pStart->GetUpper(); //Head/Foot
while ( pUp && pUp->GetUpper() && !(pUp->GetType() & 0x0018 ) )
pUp = pUp->GetUpper();
- BOOL bSame = FALSE;
+ sal_Bool bSame = sal_False;
const SwFrm *pCntUp = pCnt->GetUpper();
while ( pCntUp && !bSame )
{ if ( pUp == pCntUp )
- bSame = TRUE;
+ bSame = sal_True;
else
pCntUp = pCntUp->GetUpper();
}
@@ -770,18 +770,18 @@ BOOL MA_FASTCALL lcl_UpDown( SwPaM *pPam, const SwCntntFrm *pStart,
else if ( pCnt && pCnt->IsTxtFrm() && ((SwTxtFrm*)pCnt)->IsHiddenNow() ) // i73332
{
pCnt = (*fnNxtPrv)( pCnt );
- pCnt = ::lcl_MissProtectedFrames( pCnt, fnNxtPrv, TRUE, bInReadOnly, bTblSel );
+ pCnt = ::lcl_MissProtectedFrames( pCnt, fnNxtPrv, sal_True, bInReadOnly, bTblSel );
}
}
if ( bTab )
{
if ( !pCnt )
- bEnd = TRUE;
+ bEnd = sal_True;
else
{ const SwTabFrm *pTab = pCnt->FindTabFrm();
if( !pTab )
- bEnd = TRUE;
+ bEnd = sal_True;
else
{
if ( pTab != pTable )
@@ -828,7 +828,7 @@ BOOL MA_FASTCALL lcl_UpDown( SwPaM *pPam, const SwCntntFrm *pStart,
if ( pCell && pCell->Frm().IsInside( aInsideCell ) )
{
- bEnd = TRUE;
+ bEnd = sal_True;
//Jetzt noch schnell den richtigen Cntnt in der Zelle
//greifen.
if ( !pCnt->Frm().IsInside( aInsideCnt ) )
@@ -840,13 +840,13 @@ BOOL MA_FASTCALL lcl_UpDown( SwPaM *pPam, const SwCntntFrm *pStart,
}
}
else if ( pCnt->Frm().IsInside( aInsideCnt ) )
- bEnd = TRUE;
+ bEnd = sal_True;
}
}
if ( !bEnd )
{
pCnt = (*fnNxtPrv)( pCnt );
- pCnt = ::lcl_MissProtectedFrames( pCnt, fnNxtPrv, TRUE, bInReadOnly, bTblSel );
+ pCnt = ::lcl_MissProtectedFrames( pCnt, fnNxtPrv, sal_True, bInReadOnly, bTblSel );
}
}
@@ -861,17 +861,17 @@ BOOL MA_FASTCALL lcl_UpDown( SwPaM *pPam, const SwCntntFrm *pStart,
pCNd->MakeEndIndex( (SwIndex*)&pPam->GetPoint()->nContent );
else
pCNd->MakeStartIndex( (SwIndex*)&pPam->GetPoint()->nContent );
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
-BOOL SwCntntFrm::UnitUp( SwPaM* pPam, const SwTwips, BOOL bInReadOnly ) const
+sal_Bool SwCntntFrm::UnitUp( SwPaM* pPam, const SwTwips, sal_Bool bInReadOnly ) const
{
return ::lcl_UpDown( pPam, this, lcl_GetPrvCnt, bInReadOnly );
}
-BOOL SwCntntFrm::UnitDown( SwPaM* pPam, const SwTwips, BOOL bInReadOnly ) const
+sal_Bool SwCntntFrm::UnitDown( SwPaM* pPam, const SwTwips, sal_Bool bInReadOnly ) const
{
return ::lcl_UpDown( pPam, this, lcl_GetNxtCnt, bInReadOnly );
}
@@ -889,13 +889,18 @@ BOOL SwCntntFrm::UnitDown( SwPaM* pPam, const SwTwips, BOOL bInReadOnly ) const
|* Letzte Aenderung MA 09. Oct. 97
|*
|*************************************************************************/
-USHORT SwRootFrm::GetCurrPage( const SwPaM *pActualCrsr ) const
+sal_uInt16 SwRootFrm::GetCurrPage( const SwPaM *pActualCrsr ) const
{
ASSERT( pActualCrsr, "Welche Seite soll's denn sein?" );
+<<<<<<< local
const SwFrm *pActFrm = GetFmt()->GetDoc()->GetNodes()[pActualCrsr->GetPoint()->nNode]->
GetCntntNode()->getLayoutFrm( this, 0,
+=======
+ SwFrm const*const pActFrm = pActualCrsr->GetPoint()->nNode.GetNode().
+ GetCntntNode()->GetFrm( 0,
+>>>>>>> other
pActualCrsr->GetPoint(),
- FALSE );
+ sal_False );
return pActFrm->FindPageFrm()->GetPhyPageNum();
}
@@ -913,12 +918,12 @@ USHORT SwRootFrm::GetCurrPage( const SwPaM *pActualCrsr ) const
|* Letzte Aenderung MA 09. Oct. 97
|*
|*************************************************************************/
-USHORT SwRootFrm::SetCurrPage( SwCursor* pToSet, USHORT nPageNum )
+sal_uInt16 SwRootFrm::SetCurrPage( SwCursor* pToSet, sal_uInt16 nPageNum )
{
ASSERT( Lower() && Lower()->IsPageFrm(), "Keine Seite vorhanden." );
SwPageFrm *pPage = (SwPageFrm*)Lower();
- BOOL bEnd =FALSE;
+ sal_Bool bEnd =sal_False;
while ( !bEnd && pPage->GetPhyPageNum() != nPageNum )
{ if ( pPage->GetNext() )
pPage = (SwPageFrm*)pPage->GetNext();
@@ -937,7 +942,7 @@ USHORT SwRootFrm::SetCurrPage( SwCursor* pToSet, USHORT nPageNum )
if ( pPage->GetNext() )
pPage = (SwPageFrm*)pPage->GetNext();
else
- bEnd = TRUE;
+ bEnd = sal_True;
}
}
//pPage zeigt jetzt auf die 'gewuenschte' Seite. Jetzt muss noch der
@@ -1036,18 +1041,18 @@ SwWhichPage fnPageNext = GetNextFrm;
//den Parameter fnPosPage) in der
//aktuellen/vorhergehenden/folgenden Seite (gesteuert durch den
//Parameter fnWhichPage).
-BOOL GetFrmInPage( const SwCntntFrm *pCnt, SwWhichPage fnWhichPage,
+sal_Bool GetFrmInPage( const SwCntntFrm *pCnt, SwWhichPage fnWhichPage,
SwPosPage fnPosPage, SwPaM *pPam )
{
//Erstmal die gewuenschte Seite besorgen, anfangs die aktuelle, dann
//die die per fnWichPage gewuenscht wurde
const SwLayoutFrm *pLayoutFrm = pCnt->FindPageFrm();
if ( !pLayoutFrm || (0 == (pLayoutFrm = (*fnWhichPage)(pLayoutFrm))) )
- return FALSE;
+ return sal_False;
//Jetzt den gewuenschen CntntFrm unterhalb der Seite
if( 0 == (pCnt = (*fnPosPage)(pLayoutFrm)) )
- return FALSE;
+ return sal_False;
else
{
// repeated headlines in tables
@@ -1067,7 +1072,7 @@ BOOL GetFrmInPage( const SwCntntFrm *pCnt, SwWhichPage fnWhichPage,
// of the next row
pCnt = pRow->ContainsCntnt();
if ( ! pCnt )
- return FALSE;
+ return sal_False;
}
}
}
@@ -1082,7 +1087,7 @@ BOOL GetFrmInPage( const SwCntntFrm *pCnt, SwWhichPage fnWhichPage,
nIdx = pCnt->GetFollow() ?
((SwTxtFrm*)pCnt)->GetFollow()->GetOfst()-1 : pCNd->Len();
pPam->GetPoint()->nContent.Assign( pCNd, nIdx );
- return TRUE;
+ return sal_True;
}
}
@@ -1101,7 +1106,7 @@ BOOL GetFrmInPage( const SwCntntFrm *pCnt, SwWhichPage fnWhichPage,
|* Letzte Aenderung MA 09. Jan. 97
|*
|*************************************************************************/
-ULONG CalcDiff( const Point &rPt1, const Point &rPt2 )
+sal_uLong CalcDiff( const Point &rPt1, const Point &rPt2 )
{
//Jetzt die Entfernung zwischen den beiden Punkten berechnen.
//'Delta' X^2 + 'Delta'Y^2 = 'Entfernung'^2
@@ -1140,11 +1145,11 @@ const SwLayoutFrm* lcl_Inside( const SwCntntFrm *pCnt, Point& rPt )
}
const SwCntntFrm *SwLayoutFrm::GetCntntPos( Point& rPoint,
- const BOOL bDontLeave,
- const BOOL bBodyOnly,
- const BOOL bCalc,
+ const sal_Bool bDontLeave,
+ const sal_Bool bBodyOnly,
+ const sal_Bool bCalc,
const SwCrsrMoveState *pCMS,
- const BOOL bDefaultExpand ) const
+ const sal_Bool bDefaultExpand ) const
{
//Ersten CntntFrm ermitteln.
const SwLayoutFrm *pStart = (!bDontLeave && bDefaultExpand && GetPrev()) ?
@@ -1160,11 +1165,11 @@ const SwCntntFrm *SwLayoutFrm::GetCntntPos( Point& rPoint,
const SwCntntFrm *pActual= pCntnt;
const SwLayoutFrm *pInside = NULL;
- USHORT nMaxPage = GetPhyPageNum() + (bDefaultExpand ? 1 : 0);
+ sal_uInt16 nMaxPage = GetPhyPageNum() + (bDefaultExpand ? 1 : 0);
Point aPoint = rPoint;
- ULONG nDistance = ULONG_MAX;
+ sal_uLong nDistance = ULONG_MAX;
- while ( TRUE ) //Sicherheitsschleifchen, damit immer einer gefunden wird.
+ while ( sal_True ) //Sicherheitsschleifchen, damit immer einer gefunden wird.
{
while ( pCntnt &&
((!bDontLeave || IsAnLower( pCntnt )) &&
@@ -1176,8 +1181,8 @@ const SwCntntFrm *SwLayoutFrm::GetCntntPos( Point& rPoint,
//Wenn der Cntnt in einem geschuetzen Bereich (Zelle, Ftn, Section)
//liegt, wird der nachste Cntnt der nicht geschuetzt ist gesucht.
const SwCntntFrm *pComp = pCntnt;
- pCntnt = ::lcl_MissProtectedFrames( pCntnt, lcl_GetNxtCnt, FALSE,
- pCMS ? pCMS->bSetInReadOnly : FALSE, FALSE );
+ pCntnt = ::lcl_MissProtectedFrames( pCntnt, lcl_GetNxtCnt, sal_False,
+ pCMS ? pCMS->bSetInReadOnly : sal_False, sal_False );
if ( pComp != pCntnt )
continue;
@@ -1215,13 +1220,13 @@ const SwCntntFrm *SwLayoutFrm::GetCntntPos( Point& rPoint,
if( !pInside || ( pInside->IsAnLower( pCntnt ) &&
( !pCntnt->IsInFtn() || pInside->IsFtnContFrm() ) ) )
{
- const ULONG nDiff = ::CalcDiff( aCntntPoint, rPoint );
- BOOL bBetter = nDiff < nDistance; // Dichter dran
+ const sal_uLong nDiff = ::CalcDiff( aCntntPoint, rPoint );
+ sal_Bool bBetter = nDiff < nDistance; // Dichter dran
if( !pInside )
{
pInside = lcl_Inside( pCntnt, rPoint );
if( pInside ) // Im "richtigen" Seitenteil
- bBetter = TRUE;
+ bBetter = sal_True;
}
if( bBetter )
{
@@ -1296,7 +1301,7 @@ const SwCntntFrm *SwLayoutFrm::GetCntntPos( Point& rPoint,
const SwTabFrm *pTab = pActual->FindTabFrm();
if ( pTab->IsFollow() && pTab->IsInHeadline( *pActual ) )
{
- ((SwCrsrMoveState*)pCMS)->bStop = TRUE;
+ ((SwCrsrMoveState*)pCMS)->bStop = sal_True;
return 0;
}
}
@@ -1374,7 +1379,7 @@ void SwPageFrm::GetCntntPosition( const Point &rPt, SwPosition &rPos ) const
const SwCntntFrm *pAct = pCntnt;
Point aAct = rPt;
- ULONG nDist = ULONG_MAX;
+ sal_uLong nDist = ULONG_MAX;
while ( pCntnt )
{
@@ -1401,7 +1406,7 @@ void SwPageFrm::GetCntntPosition( const Point &rPt, SwPosition &rPos ) const
else if ( aCntFrm.Right() < rPt.X() )
aPoint.X() = aCntFrm.Right();
- const ULONG nDiff = ::CalcDiff( aPoint, rPt );
+ const sal_uLong nDiff = ::CalcDiff( aPoint, rPt );
if ( nDiff < nDist )
{
aAct = aPoint;
@@ -1460,14 +1465,14 @@ class DisableCallbackAction
{
private:
SwRootFrm& mrRootFrm;
- BOOL mbOldCallbackActionState;
+ sal_Bool mbOldCallbackActionState;
public:
DisableCallbackAction( const SwRootFrm& _rRootFrm ) :
mrRootFrm( const_cast<SwRootFrm&>(_rRootFrm) ),
mbOldCallbackActionState( _rRootFrm.IsCallbackActionEnabled() )
{
- mrRootFrm.SetCallbackActionEnabled( FALSE );
+ mrRootFrm.SetCallbackActionEnabled( sal_False );
}
~DisableCallbackAction()
@@ -1479,7 +1484,7 @@ class DisableCallbackAction
//!!!!! Es wird nur der vertikal naechstliegende gesucht.
//JP 11.10.2001: only in tables we try to find the right column - Bug 72294
-Point SwRootFrm::GetNextPrevCntntPos( const Point& rPoint, BOOL bNext ) const
+Point SwRootFrm::GetNextPrevCntntPos( const Point& rPoint, sal_Bool bNext ) const
{
// --> OD 2005-05-25 #123110# - disable creation of an action by a callback
// event during processing of this method. Needed because formatting is
@@ -1567,7 +1572,7 @@ Point SwRootFrm::GetNextPrevCntntPos( const Point& rPoint, BOOL bNext ) const
|*
|* Beschreibung: Liefert die absolute Dokumentpositon der gewuenschten
|* Seite.
-|* Formatiert wird nur soweit notwendig und nur dann wenn bFormat=TRUE
+|* Formatiert wird nur soweit notwendig und nur dann wenn bFormat=sal_True
|* Liefert Null, wenn die Operation nicht moeglich ist.
|* Die Pos ist die der letzten Seite, wenn die Seitenzahl zu gross
|* gewaehlt wurde.
@@ -1575,12 +1580,12 @@ Point SwRootFrm::GetNextPrevCntntPos( const Point& rPoint, BOOL bNext ) const
|* Letzte Aenderung MA 09. Oct. 97
|*
|*************************************************************************/
-Point SwRootFrm::GetPagePos( USHORT nPageNum ) const
+Point SwRootFrm::GetPagePos( sal_uInt16 nPageNum ) const
{
ASSERT( Lower() && Lower()->IsPageFrm(), "Keine Seite vorhanden." );
const SwPageFrm *pPage = (const SwPageFrm*)Lower();
- while ( TRUE )
+ while ( sal_True )
{
if ( pPage->GetPhyPageNum() >= nPageNum || !pPage->GetNext() )
break;
@@ -1615,20 +1620,20 @@ SwPageFrm* SwRootFrm::GetPageByPageNum( sal_uInt16 _nPageNum ) const
/*************************************************************************
|*
-|* SwRootFrm::IsDummyPage(USHORT)
+|* SwRootFrm::IsDummyPage(sal_uInt16)
|*
-|* Description: Returns TRUE, when the given physical pagenumber does't exist
+|* Description: Returns sal_True, when the given physical pagenumber does't exist
|* or this page is an empty page.
|*************************************************************************/
-BOOL SwRootFrm::IsDummyPage( USHORT nPageNum ) const
+sal_Bool SwRootFrm::IsDummyPage( sal_uInt16 nPageNum ) const
{
if( !Lower() || !nPageNum || nPageNum > GetPageNum() )
- return TRUE;
+ return sal_True;
const SwPageFrm *pPage = (const SwPageFrm*)Lower();
while( pPage && nPageNum < pPage->GetPhyPageNum() )
pPage = (const SwPageFrm*)pPage->GetNext();
- return pPage ? pPage->IsEmptyPage() : TRUE;
+ return pPage ? pPage->IsEmptyPage() : sal_True;
}
@@ -1644,7 +1649,7 @@ BOOL SwRootFrm::IsDummyPage( USHORT nPageNum ) const
|* Letzte Aenderung MA 06. Nov. 97
|*
|*************************************************************************/
-BOOL SwFrm::IsProtected() const
+sal_Bool SwFrm::IsProtected() const
{
if (this->IsCntntFrm() && ((SwCntntFrm*)this)->GetNode())
{
@@ -1652,7 +1657,7 @@ BOOL SwFrm::IsProtected() const
bool isFormProtected=pDoc->get(IDocumentSettingAccess::PROTECT_FORM );
if (isFormProtected)
{
- return FALSE; // TODO a hack for now, well deal with it laster, I we return true here we have a "double" locking
+ return sal_False; // TODO a hack for now, well deal with it laster, I we return true here we have a "double" locking
}
}
//Der Frm kann in Rahmen, Zellen oder Bereichen geschuetzt sein.
@@ -1664,16 +1669,16 @@ BOOL SwFrm::IsProtected() const
{
if ( ((SwCntntFrm*)pFrm)->GetNode() &&
((SwCntntFrm*)pFrm)->GetNode()->IsInProtectSect() )
- return TRUE;
+ return sal_True;
}
else
{
if ( ((SwLayoutFrm*)pFrm)->GetFmt() &&
((SwLayoutFrm*)pFrm)->GetFmt()->
GetProtect().IsCntntProtected() )
- return TRUE;
+ return sal_True;
if ( pFrm->IsCoveredCell() )
- return TRUE;
+ return sal_True;
}
if ( pFrm->IsFlyFrm() )
{
@@ -1686,7 +1691,7 @@ BOOL SwFrm::IsProtected() const
{ pMaster = pMaster->GetPrevLink();
} while ( pMaster->GetPrevLink() );
if ( pMaster->IsProtected() )
- return TRUE;
+ return sal_True;
}
pFrm = ((SwFlyFrm*)pFrm)->GetAnchorFrm();
}
@@ -1697,7 +1702,7 @@ BOOL SwFrm::IsProtected() const
} while ( pFrm );
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -1709,7 +1714,7 @@ BOOL SwFrm::IsProtected() const
|* Letzte Aenderung MA 30. Nov. 94
|*
|*************************************************************************/
-USHORT SwFrm::GetPhyPageNum() const
+sal_uInt16 SwFrm::GetPhyPageNum() const
{
const SwPageFrm *pPage = FindPageFrm();
return pPage ? pPage->GetPhyPageNum() : 0;
@@ -1729,15 +1734,15 @@ USHORT SwFrm::GetPhyPageNum() const
* but a previous empty page don't count.
* --------------------------------------------------*/
-BOOL SwFrm::WannaRightPage() const
+sal_Bool SwFrm::WannaRightPage() const
{
const SwPageFrm *pPage = FindPageFrm();
if ( !pPage || !pPage->GetUpper() )
- return TRUE;
+ return sal_True;
const SwFrm *pFlow = pPage->FindFirstBodyCntnt();
SwPageDesc *pDesc = 0;
- USHORT nPgNum = 0;
+ sal_uInt16 nPgNum = 0;
if ( pFlow )
{
if ( pFlow->IsInTab() )
@@ -1764,9 +1769,9 @@ BOOL SwFrm::WannaRightPage() const
}
}
ASSERT( pDesc, "No pagedescriptor" );
- BOOL bOdd;
+ sal_Bool bOdd;
if( nPgNum )
- bOdd = nPgNum % 2 ? TRUE : FALSE;
+ bOdd = nPgNum % 2 ? sal_True : sal_False;
else
{
bOdd = pPage->OnRightPage();
@@ -1776,9 +1781,9 @@ BOOL SwFrm::WannaRightPage() const
if( !pPage->IsEmptyPage() )
{
if( !pDesc->GetRightFmt() )
- bOdd = FALSE;
+ bOdd = sal_False;
else if( !pDesc->GetLeftFmt() )
- bOdd = TRUE;
+ bOdd = sal_True;
}
return bOdd;
}
@@ -1792,13 +1797,13 @@ BOOL SwFrm::WannaRightPage() const
|* Letzte Aenderung MA 30. Nov. 94
|*
|*************************************************************************/
-USHORT SwFrm::GetVirtPageNum() const
+sal_uInt16 SwFrm::GetVirtPageNum() const
{
const SwPageFrm *pPage = FindPageFrm();
if ( !pPage || !pPage->GetUpper() )
return 0;
- USHORT nPhyPage = pPage->GetPhyPageNum();
+ sal_uInt16 nPhyPage = pPage->GetPhyPageNum();
if ( !((SwRootFrm*)pPage->GetUpper())->IsVirtPageNum() )
return nPhyPage;
@@ -1854,7 +1859,7 @@ USHORT SwFrm::GetVirtPageNum() const
bool SwRootFrm::MakeTblCrsrs( SwTableCursor& rTblCrsr )
{
//Union-Rects und Tabellen (Follows) der Selektion besorgen.
- ASSERT( rTblCrsr.GetCntntNode() && rTblCrsr.GetCntntNode( FALSE ),
+ ASSERT( rTblCrsr.GetCntntNode() && rTblCrsr.GetCntntNode( sal_False ),
"Tabselection nicht auf Cnt." );
bool bRet = false;
@@ -1876,10 +1881,15 @@ bool SwRootFrm::MakeTblCrsrs( SwTableCursor& rTblCrsr )
// --> FME 2008-01-14 #151012# Made code robust here:
const SwCntntNode* pTmpStartNode = rTblCrsr.GetCntntNode();
- const SwCntntNode* pTmpEndNode = rTblCrsr.GetCntntNode(FALSE);
+ const SwCntntNode* pTmpEndNode = rTblCrsr.GetCntntNode(sal_False);
+<<<<<<< local
const SwFrm* pTmpStartFrm = pTmpStartNode ? pTmpStartNode->getLayoutFrm( this, &aPtPt, 0, FALSE ) : 0;
const SwFrm* pTmpEndFrm = pTmpEndNode ? pTmpEndNode->getLayoutFrm( this, &aMkPt, 0, FALSE ) : 0;
+=======
+ const SwFrm* pTmpStartFrm = pTmpStartNode ? pTmpStartNode->GetFrm( &aPtPt, 0, sal_False ) : 0;
+ const SwFrm* pTmpEndFrm = pTmpEndNode ? pTmpEndNode->GetFrm( &aMkPt, 0, sal_False ) : 0;
+>>>>>>> other
const SwLayoutFrm* pStart = pTmpStartFrm ? pTmpStartFrm->GetUpper() : 0;
const SwLayoutFrm* pEnd = pTmpEndFrm ? pTmpEndFrm->GetUpper() : 0;
@@ -1897,9 +1907,9 @@ bool SwRootFrm::MakeTblCrsrs( SwTableCursor& rTblCrsr )
SwSelBoxes aNew;
- const BOOL bReadOnlyAvailable = rTblCrsr.IsReadOnlyAvailable();
+ const sal_Bool bReadOnlyAvailable = rTblCrsr.IsReadOnlyAvailable();
- for ( USHORT i = 0; i < aUnions.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < aUnions.Count(); ++i )
{
SwSelUnion *pUnion = aUnions[i];
const SwTabFrm *pTable = pUnion->GetTable();
@@ -2009,9 +2019,8 @@ inline void Sub( SwRegionRects& rRegion, const SwRect& rRect )
rRegion -= rRect;
}
-void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, BOOL bIsTblMode )
+void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, sal_Bool bIsTblMode )
{
- const SwNodes &rNds = GetFmt()->GetDoc()->GetNodes();
SwPosition *pStartPos = rCrsr.Start(),
*pEndPos = rCrsr.GetPoint() == pStartPos ?
rCrsr.GetMark() : rCrsr.GetPoint();
@@ -2047,11 +2056,21 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, BOOL bIsTblMode )
//Erstmal die CntntFrms zum Start und End besorgen, die brauch ich auf
//jedenfall.
+<<<<<<< local
const SwCntntFrm *pStartFrm = rNds[ pStartPos->nNode ]->
GetCntntNode()->getLayoutFrm( this, &rCrsr.GetSttPos(), pStartPos );
+=======
+ SwCntntFrm const* pStartFrm = pStartPos->nNode.GetNode().
+ GetCntntNode()->GetFrm( &rCrsr.GetSttPos(), pStartPos );
+>>>>>>> other
+<<<<<<< local
const SwCntntFrm *pEndFrm = rNds[ pEndPos->nNode ]->
GetCntntNode()->getLayoutFrm( this, &rCrsr.GetEndPos(), pEndPos );
+=======
+ SwCntntFrm const* pEndFrm = pEndPos->nNode.GetNode().
+ GetCntntNode()->GetFrm( &rCrsr.GetEndPos(), pEndPos );
+>>>>>>> other
ASSERT( (pStartFrm && pEndFrm), "Keine CntntFrms gefunden." );
@@ -2084,7 +2103,7 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, BOOL bIsTblMode )
// nicht erlaubt ist Header/Footer/TableHeadline ueber 2 Seiten
do { // middle check loop
const SwLayoutFrm* pSttLFrm = pStartFrm->GetUpper();
- const USHORT cHdFtTblHd = FRM_HEADER | FRM_FOOTER | FRM_TAB;
+ const sal_uInt16 cHdFtTblHd = FRM_HEADER | FRM_FOOTER | FRM_TAB;
while( pSttLFrm &&
! (cHdFtTblHd & pSttLFrm->GetType() ))
pSttLFrm = pSttLFrm->GetUpper();
@@ -2136,7 +2155,7 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, BOOL bIsTblMode )
}
break;
}
- } while( FALSE );
+ } while( sal_False );
SwCrsrMoveState aTmpState( MV_NONE );
aTmpState.b2Lines = sal_True;
@@ -2160,8 +2179,8 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, BOOL bIsTblMode )
if( pStartFrm != pEndFrm )
aEndFrm.Intersection( pEndFrm->PaintArea() );
SWRECTFN( pStartFrm )
- const BOOL bR2L = pStartFrm->IsRightToLeft();
- const BOOL bEndR2L = pEndFrm->IsRightToLeft();
+ const sal_Bool bR2L = pStartFrm->IsRightToLeft();
+ const sal_Bool bEndR2L = pEndFrm->IsRightToLeft();
// If there's no doubleline portion involved or start and end are both
// in the same doubleline portion, all works fine, but otherwise
@@ -2505,7 +2524,7 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, BOOL bIsTblMode )
}
//Now the frames between, if there are any
- BOOL bBody = pStartFrm->IsInDocBody();
+ sal_Bool bBody = pStartFrm->IsInDocBody();
const SwTableBox* pCellBox = pStartFrm->GetUpper()->IsCellFrm() ?
((SwCellFrm*)pStartFrm->GetUpper())->GetTabBox() : 0;
const SwCntntFrm *pCntnt = pStartFrm->GetNextCntntFrm();
@@ -2582,7 +2601,7 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, BOOL bIsTblMode )
Sub( aRegion, aSubRect );
}
-// aRegion.Compress( FALSE );
+// aRegion.Compress( sal_False );
aRegion.Invert();
delete pSt2Pos;
delete pEnd2Pos;
@@ -2601,7 +2620,7 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, BOOL bIsTblMode )
if ( pPage->GetSortedObjs() )
{
const SwSortedObjs &rObjs = *pPage->GetSortedObjs();
- for ( USHORT i = 0; i < rObjs.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i )
{
SwAnchoredObject* pAnchoredObj = rObjs[i];
if ( !pAnchoredObj->ISA(SwFlyFrm) )
@@ -2616,16 +2635,16 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, BOOL bIsTblMode )
if ( aSortObjs.Contains( *pAnchoredObj ) )
continue;
- BOOL bSub = TRUE;
- const UINT32 nPos = pObj->GetOrdNum();
- for ( USHORT k = 0; bSub && k < aSortObjs.Count(); ++k )
+ sal_Bool bSub = sal_True;
+ const sal_uInt32 nPos = pObj->GetOrdNum();
+ for ( sal_uInt16 k = 0; bSub && k < aSortObjs.Count(); ++k )
{
ASSERT( aSortObjs[k]->ISA(SwFlyFrm),
"<SwRootFrm::CalcFrmRects(..)> - object in <aSortObjs> of unexcepted type" );
const SwFlyFrm* pTmp = static_cast<SwFlyFrm*>(aSortObjs[k]);
do
{ if ( nPos < pTmp->GetVirtDrawObj()->GetOrdNumDirect() )
- bSub = FALSE;
+ bSub = sal_False;
else
pTmp = pTmp->GetAnchorFrm()->FindFlyFrm();
} while ( bSub && pTmp );
diff --git a/sw/source/core/layout/unusedf.cxx b/sw/source/core/layout/unusedf.cxx
index 4b9a9417480a..1f6bd97479bd 100644
--- a/sw/source/core/layout/unusedf.cxx
+++ b/sw/source/core/layout/unusedf.cxx
@@ -36,18 +36,18 @@
void SwFrm::Format( const SwBorderAttrs * )
{
- ASSERT( FALSE, "Format() der Basisklasse gerufen." );
+ ASSERT( sal_False, "Format() der Basisklasse gerufen." );
}
void SwFrm::Paint(SwRect const&, SwPrintData const*const) const
{
- ASSERT( FALSE, "Paint() der Basisklasse gerufen." );
+ ASSERT( sal_False, "Paint() der Basisklasse gerufen." );
}
sal_Bool SwCntntFrm::WouldFit( SwTwips &, sal_Bool&, sal_Bool )
{
- ASSERT( FALSE, "WouldFit des CntntFrm gerufen." );
- return FALSE;
+ ASSERT( sal_False, "WouldFit des CntntFrm gerufen." );
+ return sal_False;
}
bool SwFrm::FillSelection( SwSelectionList& , const SwRect& ) const
@@ -56,36 +56,36 @@ bool SwFrm::FillSelection( SwSelectionList& , const SwRect& ) const
return false;
}
-BOOL SwFrm::GetCrsrOfst( SwPosition *, Point&, SwCrsrMoveState* ) const
+sal_Bool SwFrm::GetCrsrOfst( SwPosition *, Point&, SwCrsrMoveState* ) const
{
- ASSERT( FALSE, "GetCrsrOfst der Basisklasse, hi!" );
- return FALSE;
+ ASSERT( sal_False, "GetCrsrOfst der Basisklasse, hi!" );
+ return sal_False;
}
#ifdef DBG_UTIL
void SwRootFrm::Cut()
{
- ASSERT( FALSE, "Cut() des RootFrm gerufen." );
+ ASSERT( sal_False, "Cut() des RootFrm gerufen." );
}
void SwRootFrm::Paste( SwFrm *, SwFrm * )
{
- ASSERT( FALSE, "Paste() des RootFrm gerufen." );
+ ASSERT( sal_False, "Paste() des RootFrm gerufen." );
}
void SwFlyFrm::Paste( SwFrm *, SwFrm * )
{
- ASSERT( FALSE, "Paste() des FlyFrm gerufen." );
+ ASSERT( sal_False, "Paste() des FlyFrm gerufen." );
}
#endif
-BOOL SwFrm::GetCharRect( SwRect&, const SwPosition&,
+sal_Bool SwFrm::GetCharRect( SwRect&, const SwPosition&,
SwCrsrMoveState* ) const
{
- ASSERT( FALSE, "GetCharRect() der Basis gerufen." );
- return FALSE;
+ ASSERT( sal_False, "GetCharRect() der Basis gerufen." );
+ return sal_False;
}
diff --git a/sw/source/core/layout/virtoutp.cxx b/sw/source/core/layout/virtoutp.cxx
index 1c8338c73a85..f1d909fd2f83 100644
--- a/sw/source/core/layout/virtoutp.cxx
+++ b/sw/source/core/layout/virtoutp.cxx
@@ -74,21 +74,21 @@ inline DbgRect::DbgRect( OutputDevice *pOutDev, const Rectangle &rRect,
* dieser wird in _FrmInit angelegt und in _FrmFinit zerstoert.
* */
-BOOL SwRootFrm::FlushVout()
+sal_Bool SwRootFrm::FlushVout()
{
if( SwRootFrm::pVout->IsFlushable() )
{
SwRootFrm::pVout->_Flush();
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
-BOOL SwRootFrm::HasSameRect( const SwRect& rRect )
+sal_Bool SwRootFrm::HasSameRect( const SwRect& rRect )
{
if( SwRootFrm::pVout->IsFlushable() )
return ( rRect == SwRootFrm::pVout->GetOrgRect() );
- return FALSE;
+ return sal_False;
}
/** method to set mapping/pixel offset for virtual output device
@@ -138,14 +138,14 @@ void SetMappingForVirtDev( const Point& _rNewOrigin,
*************************************************************************/
// rSize muss in Pixel-Koordinaten vorliegen!
-BOOL SwLayVout::DoesFit( const Size &rNew )
+sal_Bool SwLayVout::DoesFit( const Size &rNew )
{
if( rNew.Height() > VIRTUALHEIGHT )
- return FALSE;
+ return sal_False;
if( rNew.Width() <= 0 || rNew.Height() <= 0 )
- return FALSE;
+ return sal_False;
if( rNew.Width() <= aSize.Width() )
- return TRUE;
+ return sal_True;
if( !pVirDev )
{
pVirDev = new VirtualDevice();
@@ -165,10 +165,10 @@ BOOL SwLayVout::DoesFit( const Size &rNew )
delete pVirDev;
pVirDev = NULL;
aSize.Width() = 0;
- return FALSE;
+ return sal_False;
}
}
- return TRUE;
+ return sal_True;
}
/*************************************************************************
@@ -179,7 +179,7 @@ BOOL SwLayVout::DoesFit( const Size &rNew )
/// output is used.
/// <aRect> contains the rectangle that represents the area the virtual
/// output device is used for and that is flushed at the end.
-void SwLayVout::Enter( ViewShell *pShell, SwRect &rRect, BOOL bOn )
+void SwLayVout::Enter( ViewShell *pShell, SwRect &rRect, sal_Bool bOn )
{
Flush();
diff --git a/sw/source/core/layout/virtoutp.hxx b/sw/source/core/layout/virtoutp.hxx
index 8183b3edbe26..deb2b20538a1 100644
--- a/sw/source/core/layout/virtoutp.hxx
+++ b/sw/source/core/layout/virtoutp.hxx
@@ -49,22 +49,22 @@ private:
SwRect aRect;
SwRect aOrgRect;
Size aSize;
- USHORT nCount;
+ sal_uInt16 nCount;
- BOOL DoesFit( const Size &rOut );
+ sal_Bool DoesFit( const Size &rOut );
public:
SwLayVout() : pSh(0), pOut(0), pVirDev(0), aSize(0, VIRTUALHEIGHT), nCount(0) {}
~SwLayVout() { delete pVirDev; }
/// OD 27.09.2002 #103636# - change 2nd parameter <rRect> - no longer <const>
- void Enter( ViewShell *pShell, SwRect &rRect, BOOL bOn );
+ void Enter( ViewShell *pShell, SwRect &rRect, sal_Bool bOn );
void Leave() { --nCount; Flush(); }
void SetOrgRect( SwRect &rRect ) { aOrgRect = rRect; }
const SwRect& GetOrgRect() const { return aOrgRect; }
- BOOL IsFlushable() { return 0 != pOut; }
+ sal_Bool IsFlushable() { return 0 != pOut; }
void _Flush();
void Flush() { if( pOut ) _Flush(); }
};
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index 939f95f4d2df..50e9c4332932 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -100,11 +100,11 @@ SwFrm::SwFrm( SwModify *pMod, SwFrm* pSib ) :
pNext( 0 ),
pPrev( 0 ),
pDrawObjs( 0 )
- , bInfBody( FALSE )
- , bInfTab ( FALSE )
- , bInfFly ( FALSE )
- , bInfFtn ( FALSE )
- , bInfSct ( FALSE )
+ , bInfBody( sal_False )
+ , bInfTab ( sal_False )
+ , bInfFly ( sal_False )
+ , bInfFtn ( sal_False )
+ , bInfSct ( sal_False )
{
#ifdef DBG_UTIL
bFlag01 = bFlag02 = bFlag03 = bFlag04 = bFlag05 = 0;
@@ -114,8 +114,8 @@ SwFrm::SwFrm( SwModify *pMod, SwFrm* pSib ) :
bInvalidR2L = bInvalidVert = 1;
bDerivedR2L = bDerivedVert = bRightToLeft = bVertical = bReverse = 0;
bValidPos = bValidPrtArea = bValidSize = bValidLineNum = bRetouche =
- bFixSize = bColLocked = FALSE;
- bCompletePaint = bInfInvalid = TRUE;
+ bFixSize = bColLocked = sal_False;
+ bCompletePaint = bInfInvalid = sal_True;
}
bool SwFrm::KnowsFormat( const SwFmt& rFmt ) const
@@ -128,7 +128,12 @@ void SwFrm::RegisterToFormat( SwFmt& rFmt )
rFmt.Add( this );
}
+<<<<<<< local
void SwFrm::CheckDir( UINT16 nDir, BOOL bVert, BOOL bOnlyBiDi, BOOL bBrowse )
+=======
+
+void SwFrm::CheckDir( sal_uInt16 nDir, sal_Bool bVert, sal_Bool bOnlyBiDi, sal_Bool bBrowse )
+>>>>>>> other
{
if( FRMDIR_ENVIRONMENT == nDir || ( bVert && bOnlyBiDi ) )
{
@@ -156,7 +161,7 @@ void SwFrm::CheckDir( UINT16 nDir, BOOL bVert, BOOL bOnlyBiDi, BOOL bBrowse )
}
}
-void SwFrm::CheckDirection( BOOL bVert )
+void SwFrm::CheckDirection( sal_Bool bVert )
{
if( bVert )
{
@@ -173,7 +178,7 @@ void SwFrm::CheckDirection( BOOL bVert )
}
}
-void SwSectionFrm::CheckDirection( BOOL bVert )
+void SwSectionFrm::CheckDirection( sal_Bool bVert )
{
const SwFrmFmt* pFmt = GetFmt();
if( pFmt )
@@ -187,7 +192,7 @@ void SwSectionFrm::CheckDirection( BOOL bVert )
SwFrm::CheckDirection( bVert );
}
-void SwFlyFrm::CheckDirection( BOOL bVert )
+void SwFlyFrm::CheckDirection( sal_Bool bVert )
{
const SwFrmFmt* pFmt = GetFmt();
if( pFmt )
@@ -201,7 +206,7 @@ void SwFlyFrm::CheckDirection( BOOL bVert )
SwFrm::CheckDirection( bVert );
}
-void SwTabFrm::CheckDirection( BOOL bVert )
+void SwTabFrm::CheckDirection( sal_Bool bVert )
{
const SwFrmFmt* pFmt = GetFmt();
if( pFmt )
@@ -215,7 +220,7 @@ void SwTabFrm::CheckDirection( BOOL bVert )
SwFrm::CheckDirection( bVert );
}
-void SwCellFrm::CheckDirection( BOOL bVert )
+void SwCellFrm::CheckDirection( sal_Bool bVert )
{
const SwFrmFmt* pFmt = GetFmt();
const SfxPoolItem* pItem;
@@ -223,7 +228,7 @@ void SwCellFrm::CheckDirection( BOOL bVert )
// using it. Otherwise the dynamic pool default is used, which may be set
// to LTR in case of OOo 1.0 documents.
// <--
- if( pFmt && SFX_ITEM_SET == pFmt->GetItemState( RES_FRAMEDIR, TRUE, &pItem ) )
+ if( pFmt && SFX_ITEM_SET == pFmt->GetItemState( RES_FRAMEDIR, sal_True, &pItem ) )
{
const SvxFrameDirectionItem* pFrmDirItem = static_cast<const SvxFrameDirectionItem*>(pItem);
const ViewShell *pSh = getRootFrm()->GetCurrShell();
@@ -234,7 +239,7 @@ void SwCellFrm::CheckDirection( BOOL bVert )
SwFrm::CheckDirection( bVert );
}
-void SwTxtFrm::CheckDirection( BOOL bVert )
+void SwTxtFrm::CheckDirection( sal_Bool bVert )
{
const ViewShell *pSh = getRootFrm()->GetCurrShell();
const BOOL bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode();
@@ -245,13 +250,13 @@ void SwTxtFrm::CheckDirection( BOOL bVert )
/*************************************************************************/
void SwFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
{
- BYTE nInvFlags = 0;
+ sal_uInt8 nInvFlags = 0;
if( pNew && RES_ATTRSET_CHG == pNew->Which() )
{
SfxItemIter aNIter( *((SwAttrSetChg*)pNew)->GetChgSet() );
SfxItemIter aOIter( *((SwAttrSetChg*)pOld)->GetChgSet() );
- while( TRUE )
+ while( sal_True )
{
_UpdateAttrFrm( (SfxPoolItem*)aOIter.GetCurItem(),
(SfxPoolItem*)aNIter.GetCurItem(), nInvFlags );
@@ -292,10 +297,15 @@ void SwFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
}
}
+<<<<<<< local
void SwFrm::_UpdateAttrFrm( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
BYTE &rInvFlags )
+=======
+void SwFrm::_UpdateAttrFrm( SfxPoolItem *pOld, SfxPoolItem *pNew,
+ sal_uInt8 &rInvFlags )
+>>>>>>> other
{
- USHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
+ sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
switch( nWhich )
{
case RES_BOX:
@@ -332,19 +342,19 @@ void SwFrm::_UpdateAttrFrm( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
{
if ( IsRowFrm() )
{
- BOOL bInFollowFlowRow = 0 != IsInFollowFlowRow();
+ sal_Bool bInFollowFlowRow = 0 != IsInFollowFlowRow();
if ( bInFollowFlowRow || 0 != IsInSplitTableRow() )
{
SwTabFrm* pTab = FindTabFrm();
if ( bInFollowFlowRow )
pTab = pTab->FindMaster();
- pTab->SetRemoveFollowFlowLinePending( TRUE );
+ pTab->SetRemoveFollowFlowLinePending( sal_True );
}
}
break;
}
case RES_COL:
- ASSERT( FALSE, "Spalten fuer neuen FrmTyp?" );
+ ASSERT( sal_False, "Spalten fuer neuen FrmTyp?" );
break;
default:
@@ -359,7 +369,7 @@ void SwFrm::_UpdateAttrFrm( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
|* Letzte Aenderung MA 26. Jun. 96
|*
|*************************************************************************/
-void SwFrm::Prepare( const PrepareHint, const void *, BOOL )
+void SwFrm::Prepare( const PrepareHint, const void *, sal_Bool )
{
/* Do nothing */
}
@@ -479,7 +489,7 @@ void SwFrm::InvalidatePage( const SwPageFrm *pPage ) const
{
const SwTxtNode *pTxtNode = pTxtFrm->GetTxtNode();
if (pTxtNode && pTxtNode->IsGrammarCheckDirty())
- pRoot->SetNeedGrammarCheck( TRUE );
+ pRoot->SetNeedGrammarCheck( sal_True );
}
}
}
@@ -494,7 +504,7 @@ void SwFrm::InvalidatePage( const SwPageFrm *pPage ) const
|*************************************************************************/
Size SwFrm::ChgSize( const Size& aNewSize )
{
- bFixSize = TRUE;
+ bFixSize = sal_True;
const Size aOldSize( Frm().SSize() );
if ( aNewSize == aOldSize )
return aOldSize;
@@ -834,7 +844,7 @@ void SwCntntFrm::Paste( SwFrm* pParent, SwFrm* pSibling)
if( pNxt->IsSctFrm() )
pNxt = ((SwSectionFrm*)pNxt)->ContainsCntnt();
if( pNxt && pNxt->IsTxtFrm() && pNxt->IsInFtn() )
- pNxt->Prepare( PREP_FTN, 0, FALSE );
+ pNxt->Prepare( PREP_FTN, 0, sal_False );
}
if ( Frm().Height() )
@@ -872,7 +882,7 @@ void SwCntntFrm::Paste( SwFrm* pParent, SwFrm* pSibling)
if( pFrm && pFrm->IsSctFrm() )
pFrm = ((SwSectionFrm*)pFrm)->ContainsAny();
if( pFrm )
- pFrm->Prepare( PREP_QUOVADIS, 0, FALSE );
+ pFrm->Prepare( PREP_QUOVADIS, 0, sal_False );
if( !GetNext() )
{
pFrm = FindFtnFrm()->GetNext();
@@ -922,7 +932,7 @@ void SwCntntFrm::Cut()
{
pFrm->_InvalidatePrt();
if( IsInFtn() )
- pFrm->Prepare( PREP_QUOVADIS, 0, FALSE );
+ pFrm->Prepare( PREP_QUOVADIS, 0, sal_False );
}
// --> OD 2004-07-15 #i26250# - invalidate printing area of previous
// table frame.
@@ -966,7 +976,7 @@ void SwCntntFrm::Cut()
}
}
if( pFrm && IsInFtn() )
- pFrm->Prepare( PREP_ERGOSUM, 0, FALSE );
+ pFrm->Prepare( PREP_ERGOSUM, 0, sal_False );
if( IsInSct() && !GetPrev() )
{
SwSectionFrm* pSct = FindSctFrm();
@@ -1016,7 +1026,7 @@ void SwCntntFrm::Cut()
if ( pMasterTab )
{
pMasterTab->_InvalidatePos();
- pMasterTab->SetRemoveFollowFlowLinePending( TRUE );
+ pMasterTab->SetRemoveFollowFlowLinePending( sal_True );
}
}
// <--
@@ -1068,7 +1078,7 @@ void SwCntntFrm::Cut()
( pUp->IsFtnFrm() && pUp->IsColLocked() ) )
// <--
{
- pSct->DelEmpty( FALSE );
+ pSct->DelEmpty( sal_False );
// Wenn ein gelockter Bereich nicht geloescht werden darf,
// so ist zumindest seine Groesse durch das Entfernen seines
// letzten Contents ungueltig geworden.
@@ -1076,7 +1086,7 @@ void SwCntntFrm::Cut()
}
else
{
- pSct->DelEmpty( TRUE );
+ pSct->DelEmpty( sal_True );
delete pSct;
}
}
@@ -1162,7 +1172,7 @@ void SwLayoutFrm::Paste( SwFrm* pParent, SwFrm* pSibling)
if( pFrm->IsSctFrm() )
pFrm = ((SwSectionFrm*)pFrm)->ContainsAny();
if( pFrm )
- pFrm->Prepare( PREP_ERGOSUM, 0, FALSE );
+ pFrm->Prepare( PREP_ERGOSUM, 0, sal_False );
}
}
if ( IsInFtn() && 0 != ( pFrm = GetIndPrev() ) )
@@ -1170,7 +1180,7 @@ void SwLayoutFrm::Paste( SwFrm* pParent, SwFrm* pSibling)
if( pFrm->IsSctFrm() )
pFrm = ((SwSectionFrm*)pFrm)->ContainsAny();
if( pFrm )
- pFrm->Prepare( PREP_QUOVADIS, 0, FALSE );
+ pFrm->Prepare( PREP_QUOVADIS, 0, sal_False );
}
}
@@ -1178,7 +1188,7 @@ void SwLayoutFrm::Paste( SwFrm* pParent, SwFrm* pSibling)
{
// AdjustNeighbourhood wird jetzt auch in Spalten aufgerufen,
// die sich nicht in Rahmen befinden
- BYTE nAdjust = GetUpper()->IsFtnBossFrm() ?
+ sal_uInt8 nAdjust = GetUpper()->IsFtnBossFrm() ?
((SwFtnBossFrm*)GetUpper())->NeighbourhoodAdjustment( this )
: NA_GROW_SHRINK;
SwTwips nGrow = (Frm().*fnRect->fnGetHeight)();
@@ -1226,7 +1236,7 @@ void SwLayoutFrm::Cut()
{
if( pUp->IsFtnBossFrm() )
{
- BYTE nAdjust= ((SwFtnBossFrm*)pUp)->NeighbourhoodAdjustment( this );
+ sal_uInt8 nAdjust= ((SwFtnBossFrm*)pUp)->NeighbourhoodAdjustment( this );
if( NA_ONLY_ADJUST == nAdjust )
AdjustNeighbourhood( -nShrink );
else
@@ -1270,7 +1280,7 @@ void SwLayoutFrm::Cut()
|* Letzte Aenderung MA 05. May. 94
|*
|*************************************************************************/
-SwTwips SwFrm::Grow( SwTwips nDist, BOOL bTst, BOOL bInfo )
+SwTwips SwFrm::Grow( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
{
ASSERT( nDist >= 0, "Negatives Wachstum?" );
@@ -1322,7 +1332,7 @@ SwTwips SwFrm::Grow( SwTwips nDist, BOOL bTst, BOOL bInfo )
|* Letzte Aenderung MA 05. May. 94
|*
|*************************************************************************/
-SwTwips SwFrm::Shrink( SwTwips nDist, BOOL bTst, BOOL bInfo )
+SwTwips SwFrm::Shrink( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
{
ASSERT( nDist >= 0, "Negative Verkleinerung?" );
@@ -1393,15 +1403,19 @@ SwTwips SwFrm::Shrink( SwTwips nDist, BOOL bTst, BOOL bInfo )
|* Letzte Aenderung AMA 02. Nov. 98
|*
|*************************************************************************/
-SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, BOOL bTst )
+SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, sal_Bool bTst )
{
PROTOCOL_ENTER( this, PROT_ADJUSTN, 0, &nDiff );
if ( !nDiff || !GetUpper()->IsFtnBossFrm() ) // nur innerhalb von Seiten/Spalten
return 0L;
+<<<<<<< local
const ViewShell *pSh = getRootFrm()->GetCurrShell();
const BOOL bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode();
+=======
+ sal_Bool bBrowse = GetUpper()->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
+>>>>>>> other
//Der (Page)Body veraendert sich nur im BrowseMode, aber nicht wenn er
//Spalten enthaelt.
@@ -1522,7 +1536,7 @@ SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, BOOL bTst )
//Anpassung von Frm und Prt sorgen wird.
const long nOldFrmHeight = Frm().Height();
const long nOldPrtHeight = Prt().Height();
- const BOOL bOldComplete = IsCompletePaint();
+ const sal_Bool bOldComplete = IsCompletePaint();
if ( IsBodyFrm() )
Prt().SSize().Height() = nOldFrmHeight;
@@ -1564,13 +1578,13 @@ SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, BOOL bTst )
SwFtnContFrm* pCont = (SwFtnContFrm*)GetNext();
SwTwips nMinH = 0;
SwFtnFrm* pFtn = (SwFtnFrm*)pCont->Lower();
- BOOL bFtn = FALSE;
+ sal_Bool bFtn = sal_False;
while( pFtn )
{
if( !pFtn->GetAttr()->GetFtn().IsEndNote() )
{
nMinH += (pFtn->Frm().*fnRect->fnGetHeight)();
- bFtn = TRUE;
+ bFtn = sal_True;
}
pFtn = (SwFtnFrm*)pFtn->GetNext();
}
@@ -1592,7 +1606,7 @@ SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, BOOL bTst )
}
else
{
- const BOOL bFtnPage = pBoss->IsPageFrm() && ((SwPageFrm*)pBoss)->IsFtnPage();
+ const sal_Bool bFtnPage = pBoss->IsPageFrm() && ((SwPageFrm*)pBoss)->IsFtnPage();
if ( bFtnPage && !IsFtnContFrm() )
pFrm = (SwFrm*)pBoss->FindFtnCont();
if ( !pFrm )
@@ -1660,7 +1674,7 @@ SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, BOOL bTst )
{
const SwSortedObjs &rObjs = *pBoss->GetDrawObjs();
ASSERT( pBoss->IsPageFrm(), "Header/Footer out of page?" );
- for ( USHORT i = 0; i < rObjs.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i )
{
SwAnchoredObject* pAnchoredObj = rObjs[i];
if ( pAnchoredObj->ISA(SwFlyFrm) )
@@ -1726,7 +1740,7 @@ void SwFrm::ImplInvalidateSize()
{
if ( _InvalidationAllowed( INVALID_SIZE ) )
{
- bValidSize = FALSE;
+ bValidSize = sal_False;
if ( IsFlyFrm() )
((SwFlyFrm*)this)->_Invalidate();
else
@@ -1741,7 +1755,7 @@ void SwFrm::ImplInvalidatePrt()
{
if ( _InvalidationAllowed( INVALID_PRTAREA ) )
{
- bValidPrtArea = FALSE;
+ bValidPrtArea = sal_False;
if ( IsFlyFrm() )
((SwFlyFrm*)this)->_Invalidate();
else
@@ -1756,7 +1770,7 @@ void SwFrm::ImplInvalidatePos()
{
if ( _InvalidationAllowed( INVALID_POS ) )
{
- bValidPos = FALSE;
+ bValidPos = sal_False;
if ( IsFlyFrm() )
{
((SwFlyFrm*)this)->_Invalidate();
@@ -1775,7 +1789,7 @@ void SwFrm::ImplInvalidateLineNum()
{
if ( _InvalidationAllowed( INVALID_LINENUM ) )
{
- bValidLineNum = FALSE;
+ bValidLineNum = sal_False;
ASSERT( IsTxtFrm(), "line numbers are implemented for text only" );
InvalidatePage();
@@ -1798,7 +1812,7 @@ void SwFrm::ReinitializeFrmSizeAttrFlags()
if ( ATT_VAR_SIZE == rFmtSize.GetHeightSizeType() ||
ATT_MIN_SIZE == rFmtSize.GetHeightSizeType())
{
- bFixSize = FALSE;
+ bFixSize = sal_False;
if ( GetType() & (FRM_HEADER | FRM_FOOTER | FRM_ROW) )
{
SwFrm *pFrm = ((SwLayoutFrm*)this)->Lower();
@@ -1837,7 +1851,7 @@ void SwFrm::ReinitializeFrmSizeAttrFlags()
*
* FME 2007-08-30 #i81146# new loop control
|*************************************************************************/
-void SwFrm::ValidateThisAndAllLowers( const USHORT nStage )
+void SwFrm::ValidateThisAndAllLowers( const sal_uInt16 nStage )
{
// Stage 0: Only validate frames. Do not process any objects.
// Stage 1: Only validate fly frames and all of their contents.
@@ -1848,9 +1862,9 @@ void SwFrm::ValidateThisAndAllLowers( const USHORT nStage )
if ( !bOnlyObject || ISA(SwFlyFrm) )
{
- bValidSize = TRUE;
- bValidPrtArea = TRUE;
- bValidPos = TRUE;
+ bValidSize = sal_True;
+ bValidPrtArea = sal_True;
+ bValidPos = sal_True;
}
if ( bIncludeObjects )
@@ -1889,7 +1903,7 @@ void SwFrm::ValidateThisAndAllLowers( const USHORT nStage )
|* Letzte Aenderung MA 25. Mar. 99
|*
|*************************************************************************/
-SwTwips SwCntntFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
+SwTwips SwCntntFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
{
SWRECTFN( this )
@@ -1898,9 +1912,14 @@ SwTwips SwCntntFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
nDist > (LONG_MAX - nFrmHeight ) )
nDist = LONG_MAX - nFrmHeight;
+<<<<<<< local
const ViewShell *pSh = getRootFrm()->GetCurrShell();
const BOOL bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode();
const USHORT nTmpType = bBrowse ? 0x2084: 0x2004; //Row+Cell, Browse mit Body
+=======
+ const sal_Bool bBrowse = GetUpper()->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
+ const sal_uInt16 nTmpType = bBrowse ? 0x2084: 0x2004; //Row+Cell, Browse mit Body
+>>>>>>> other
if( !(GetUpper()->GetType() & nTmpType) && GetUpper()->HasFixSize() )
{
if ( !bTst )
@@ -2002,7 +2021,7 @@ SwTwips SwCntntFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
|* Letzte Aenderung MA 05. May. 94
|*
|*************************************************************************/
-SwTwips SwCntntFrm::ShrinkFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
+SwTwips SwCntntFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
{
SWRECTFN( this )
ASSERT( nDist >= 0, "nDist < 0" );
@@ -2072,7 +2091,7 @@ SwTwips SwCntntFrm::ShrinkFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
const SwSortedObjs* pSorted = pPage ? pPage->GetSortedObjs() : 0;
if( pSorted )
{
- for ( USHORT i = 0; i < pSorted->Count(); ++i )
+ for ( sal_uInt16 i = 0; i < pSorted->Count(); ++i )
{
const SwAnchoredObject* pAnchoredObj = (*pSorted)[i];
const SwRect aBound( pAnchoredObj->GetObjRectWithSpaces() );
@@ -2127,7 +2146,7 @@ SwTwips SwCntntFrm::ShrinkFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
|*************************************************************************/
void SwCntntFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
{
- BYTE nInvFlags = 0;
+ sal_uInt8 nInvFlags = 0;
if( pNew && RES_ATTRSET_CHG == pNew->Which() )
{
@@ -2135,7 +2154,7 @@ void SwCntntFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
SfxItemIter aOIter( *((SwAttrSetChg*)pOld)->GetChgSet() );
SwAttrSetChg aOldSet( *(SwAttrSetChg*)pOld );
SwAttrSetChg aNewSet( *(SwAttrSetChg*)pNew );
- while( TRUE )
+ while( sal_True )
{
_UpdateAttr( (SfxPoolItem*)aOIter.GetCurItem(),
(SfxPoolItem*)aNIter.GetCurItem(), nInvFlags,
@@ -2198,12 +2217,17 @@ void SwCntntFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
}
}
+<<<<<<< local
void SwCntntFrm::_UpdateAttr( const SfxPoolItem* pOld, const SfxPoolItem* pNew,
BYTE &rInvFlags,
+=======
+void SwCntntFrm::_UpdateAttr( SfxPoolItem* pOld, SfxPoolItem* pNew,
+ sal_uInt8 &rInvFlags,
+>>>>>>> other
SwAttrSetChg *pOldSet, SwAttrSetChg *pNewSet )
{
- BOOL bClear = TRUE;
- USHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
+ sal_Bool bClear = sal_True;
+ sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
switch ( nWhich )
{
case RES_FMT_CHG:
@@ -2218,7 +2242,7 @@ void SwCntntFrm::_UpdateAttr( const SfxPoolItem* pOld, const SfxPoolItem* pNew,
if ( !GetPrev() )
CheckPageDescs( pPage );
if ( pPage && GetAttrSet()->GetPageDesc().GetNumOffset() )
- ((SwRootFrm*)pPage->GetUpper())->SetVirtPageNum( TRUE );
+ ((SwRootFrm*)pPage->GetUpper())->SetVirtPageNum( sal_True );
SwDocPosUpdate aMsgHnt( pPage->Frm().Top() );
pPage->GetFmt()->GetDoc()->UpdatePageFlds( &aMsgHnt );
}
@@ -2333,7 +2357,7 @@ void SwCntntFrm::_UpdateAttr( const SfxPoolItem* pOld, const SfxPoolItem* pNew,
/* no break here */
default:
- bClear = FALSE;
+ bClear = sal_False;
}
if ( bClear )
{
@@ -2363,7 +2387,7 @@ SwLayoutFrm::SwLayoutFrm( SwFrmFmt* pFmt, SwFrm* pSib ):
{
const SwFmtFrmSize &rFmtSize = pFmt->GetFrmSize();
if ( rFmtSize.GetHeightSizeType() == ATT_FIX_SIZE )
- bFixSize = TRUE;
+ bFixSize = sal_True;
}
// --> OD 2004-06-29 #i28701#
@@ -2419,11 +2443,16 @@ SwTwips SwLayoutFrm::InnerHeight() const
|* Letzte Aenderung MA 23. Sep. 96
|*
|*************************************************************************/
-SwTwips SwLayoutFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
+SwTwips SwLayoutFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
{
+<<<<<<< local
const ViewShell *pSh = getRootFrm()->GetCurrShell();
const BOOL bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode();
const USHORT nTmpType = bBrowse ? 0x2084: 0x2004; //Row+Cell, Browse mit Body
+=======
+ const sal_Bool bBrowse = GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
+ const sal_uInt16 nTmpType = bBrowse ? 0x2084: 0x2004; //Row+Cell, Browse mit Body
+>>>>>>> other
if( !(GetType() & nTmpType) && HasFixSize() )
return 0;
@@ -2450,7 +2479,7 @@ SwTwips SwLayoutFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
SwRect aOldFrm( Frm() );
sal_Bool bMoveAccFrm = sal_False;
- BOOL bChgPos = IsVertical() && !IsReverse();
+ sal_Bool bChgPos = IsVertical() && !IsReverse();
if ( !bTst )
{
(Frm().*fnRect->fnSetHeight)( nFrmHeight + nDist );
@@ -2464,7 +2493,7 @@ SwTwips SwLayoutFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
{
if ( GetUpper() )
{ // AdjustNeighbourhood jetzt auch in Spalten (aber nicht in Rahmen)
- BYTE nAdjust = GetUpper()->IsFtnBossFrm() ?
+ sal_uInt8 nAdjust = GetUpper()->IsFtnBossFrm() ?
((SwFtnBossFrm*)GetUpper())->NeighbourhoodAdjustment( this )
: NA_GROW_SHRINK;
if( NA_ONLY_ADJUST == nAdjust )
@@ -2586,11 +2615,16 @@ SwTwips SwLayoutFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
|* Letzte Aenderung MA 25. Mar. 99
|*
|*************************************************************************/
-SwTwips SwLayoutFrm::ShrinkFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
+SwTwips SwLayoutFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
{
+<<<<<<< local
const ViewShell *pSh = getRootFrm()->GetCurrShell();
const BOOL bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode();
const USHORT nTmpType = bBrowse ? 0x2084: 0x2004; //Row+Cell, Browse mit Body
+=======
+ const sal_Bool bBrowse = GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
+ const sal_uInt16 nTmpType = bBrowse ? 0x2084: 0x2004; //Row+Cell, Browse mit Body
+>>>>>>> other
if( !(GetType() & nTmpType) && HasFixSize() )
return 0;
@@ -2601,7 +2635,7 @@ SwTwips SwLayoutFrm::ShrinkFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
nDist = nFrmHeight;
SwTwips nMin = 0;
- BOOL bChgPos = IsVertical() && !IsReverse();
+ sal_Bool bChgPos = IsVertical() && !IsReverse();
if ( Lower() )
{
if( !Lower()->IsNeighbourFrm() )
@@ -2632,7 +2666,7 @@ SwTwips SwLayoutFrm::ShrinkFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
bMoveAccFrm = sal_True;
}
- BYTE nAdjust = GetUpper() && GetUpper()->IsFtnBossFrm() ?
+ sal_uInt8 nAdjust = GetUpper() && GetUpper()->IsFtnBossFrm() ?
((SwFtnBossFrm*)GetUpper())->NeighbourhoodAdjustment( this )
: NA_GROW_SHRINK;
@@ -2741,7 +2775,7 @@ SwTwips SwLayoutFrm::ShrinkFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
{ // Wenn wir sowieso schon in einer anderen Spalte/Seite sitzen
// als der Frame mit der Referenz, dann brauchen wir nicht
// auch noch seinen Master zu invalidieren.
- SwFrm *pTmp = pCnt->FindFtnBossFrm(TRUE) == FindFtnBossFrm(TRUE)
+ SwFrm *pTmp = pCnt->FindFtnBossFrm(sal_True) == FindFtnBossFrm(sal_True)
? pCnt->FindMaster()->GetFrm() : pCnt;
pTmp->Prepare( PREP_ADJUST_FRM );
pTmp->InvalidateSize();
@@ -2809,7 +2843,7 @@ void SwLayoutFrm::ChgLowersProp( const Size& rOldSize )
pLowerFrm = pLowerFrm->GetNext();
else
break;
- } while( TRUE );
+ } while( sal_True );
// If found last lower is a section frame containing no section
// (section frame isn't valid and will be deleted in the future),
// travel backwards.
@@ -2822,7 +2856,7 @@ void SwLayoutFrm::ChgLowersProp( const Size& rOldSize )
// contains invalid section frames.
if( pLowerFrm->IsSctFrm() )
pLowerFrm = ((SwSectionFrm*)pLowerFrm)->GetSection() &&
- !((SwSectionFrm*)pLowerFrm)->ToMaximize( FALSE ) ?
+ !((SwSectionFrm*)pLowerFrm)->ToMaximize( sal_False ) ?
((SwSectionFrm*)pLowerFrm)->FindLastCntnt() : NULL;
// continue with found last lower, probably the last content of a section
@@ -2853,7 +2887,7 @@ void SwLayoutFrm::ChgLowersProp( const Size& rOldSize )
pLowerFrm->InvalidatePage( pPage );
if( !pLowerFrm->IsFlowFrm() ||
!SwFlowFrm::CastFlowFrm( pLowerFrm )->HasFollow() )
- pLowerFrm->InvalidateNextPos( TRUE );
+ pLowerFrm->InvalidateNextPos( sal_True );
if ( pLowerFrm->IsTxtFrm() )
((SwCntntFrm*)pLowerFrm)->Prepare( PREP_ADJUST_FRM );
}
@@ -2934,7 +2968,7 @@ void SwLayoutFrm::ChgLowersProp( const Size& rOldSize )
// In vertical layout these are neighbour frames (cell and column frames),
// header frames and footer frames.
// In horizontal layout these are all frames, which aren't neighbour frames.
- const USHORT nFixWidth = bVert ? (FRM_NEIGHBOUR | FRM_HEADFOOT)
+ const sal_uInt16 nFixWidth = bVert ? (FRM_NEIGHBOUR | FRM_HEADFOOT)
: ~FRM_NEIGHBOUR;
// Declare const unsigned short <nFixHeight> and init it this frame types
@@ -2942,7 +2976,7 @@ void SwLayoutFrm::ChgLowersProp( const Size& rOldSize )
// In vertical layout these are all frames, which aren't neighbour frames,
// header frames, footer frames, body frames or foot note container frames.
// In horizontal layout these are neighbour frames.
- const USHORT nFixHeight= bVert ? ~(FRM_NEIGHBOUR | FRM_HEADFOOT | FRM_BODYFTNC)
+ const sal_uInt16 nFixHeight= bVert ? ~(FRM_NEIGHBOUR | FRM_HEADFOOT | FRM_BODYFTNC)
: FRM_NEIGHBOUR;
// Travel through all lowers using <GetNext()>
@@ -2960,7 +2994,7 @@ void SwLayoutFrm::ChgLowersProp( const Size& rOldSize )
{
// If lower isn't a table, row, cell or section frame, adjust its
// frame size.
- const USHORT nLowerType = pLowerFrm->GetType();
+ const sal_uInt16 nLowerType = pLowerFrm->GetType();
if ( !(nLowerType & (FRM_TAB|FRM_ROW|FRM_CELL|FRM_SECTION)) )
{
if ( bWidthChgd )
@@ -3175,16 +3209,16 @@ void SwLayoutFrm::Format( const SwBorderAttrs *pAttrs )
if ( bValidPrtArea && bValidSize )
return;
- const USHORT nLeft = (USHORT)pAttrs->CalcLeft( this );
- const USHORT nUpper = pAttrs->CalcTop();
+ const sal_uInt16 nLeft = (sal_uInt16)pAttrs->CalcLeft( this );
+ const sal_uInt16 nUpper = pAttrs->CalcTop();
- const USHORT nRight = (USHORT)((SwBorderAttrs*)pAttrs)->CalcRight( this );
- const USHORT nLower = pAttrs->CalcBottom();
- BOOL bVert = IsVertical() && !IsPageFrm();
+ 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;
if ( !bValidPrtArea )
{
- bValidPrtArea = TRUE;
+ bValidPrtArea = sal_True;
(this->*fnRect->fnSetXMargins)( nLeft, nRight );
(this->*fnRect->fnSetYMargins)( nUpper, nLower );
}
@@ -3197,7 +3231,7 @@ void SwLayoutFrm::Format( const SwBorderAttrs *pAttrs )
const SwFmtFrmSize &rSz = GetFmt()->GetFrmSize();
SwTwips nMinHeight = rSz.GetHeightSizeType() == ATT_MIN_SIZE ? rSz.GetHeight() : 0;
do
- { bValidSize = TRUE;
+ { bValidSize = sal_True;
//Die Groesse in der VarSize wird durch den Inhalt plus den
//Raendern bestimmt.
@@ -3234,7 +3268,7 @@ void SwLayoutFrm::Format( const SwBorderAttrs *pAttrs )
if( (this->*fnRect->fnSetLimit)( nLimit ) &&
nOldLeft == (Frm().*fnRect->fnGetLeft)() &&
nOldTop == (Frm().*fnRect->fnGetTop)() )
- bValidSize = bValidPrtArea = TRUE;
+ bValidSize = bValidPrtArea = sal_True;
}
} while ( !bValidSize );
}
@@ -3243,12 +3277,12 @@ void SwLayoutFrm::Format( const SwBorderAttrs *pAttrs )
do
{ if ( Frm().Height() != pAttrs->GetSize().Height() )
ChgSize( Size( Frm().Width(), pAttrs->GetSize().Height()));
- bValidSize = TRUE;
+ bValidSize = sal_True;
MakePos();
} while ( !bValidSize );
}
else
- bValidSize = TRUE;
+ bValidSize = sal_True;
}
}
@@ -3263,7 +3297,7 @@ void SwLayoutFrm::Format( const SwBorderAttrs *pAttrs )
static void InvaPercentFlys( SwFrm *pFrm, SwTwips nDiff )
{
ASSERT( pFrm->GetDrawObjs(), "Can't find any Objects" );
- for ( USHORT i = 0; i < pFrm->GetDrawObjs()->Count(); ++i )
+ for ( sal_uInt16 i = 0; i < pFrm->GetDrawObjs()->Count(); ++i )
{
SwAnchoredObject* pAnchoredObj = (*pFrm->GetDrawObjs())[i];
if ( pAnchoredObj->ISA(SwFlyFrm) )
@@ -3272,7 +3306,7 @@ static void InvaPercentFlys( SwFrm *pFrm, SwTwips nDiff )
const SwFmtFrmSize &rSz = pFly->GetFmt()->GetFrmSize();
if ( rSz.GetWidthPercent() || rSz.GetHeightPercent() )
{
- BOOL bNotify = TRUE;
+ sal_Bool bNotify = sal_True;
// If we've a fly with more than 90% relative height...
if( rSz.GetHeightPercent() > 90 && pFly->GetAnchorFrm() &&
rSz.GetHeightPercent() != 0xFF && nDiff )
@@ -3287,7 +3321,7 @@ static void InvaPercentFlys( SwFrm *pFrm, SwTwips nDiff )
( nDiff + pRel->Prt().Height() )*9 &&
pFly->GetFmt()->GetSurround().GetSurround() !=
SURROUND_THROUGHT )
- bNotify = FALSE;
+ bNotify = sal_False;
}
if( bNotify )
pFly->InvalidateSize();
@@ -3333,7 +3367,7 @@ void SwLayoutFrm::InvaPercentLowers( SwTwips nDiff )
|* Letzte Aenderung MA 10. Oct. 96
|*
|*************************************************************************/
-long SwLayoutFrm::CalcRel( const SwFmtFrmSize &rSz, BOOL ) const
+long SwLayoutFrm::CalcRel( const SwFmtFrmSize &rSz, sal_Bool ) const
{
long nRet = rSz.GetWidth(),
nPercent = rSz.GetWidthPercent();
@@ -3391,7 +3425,7 @@ long MA_FASTCALL lcl_CalcMinColDiff( SwLayoutFrm *pLayFrm )
return nDiff ? nDiff : nFirstDiff ? nFirstDiff : 240;
}
-BOOL lcl_IsFlyHeightClipped( SwLayoutFrm *pLay )
+sal_Bool lcl_IsFlyHeightClipped( SwLayoutFrm *pLay )
{
SwFrm *pFrm = pLay->ContainsCntnt();
while ( pFrm )
@@ -3402,7 +3436,7 @@ BOOL lcl_IsFlyHeightClipped( SwLayoutFrm *pLay )
if ( pFrm->GetDrawObjs() )
{
sal_uInt32 nCnt = pFrm->GetDrawObjs()->Count();
- for ( USHORT i = 0; i < nCnt; ++i )
+ for ( sal_uInt16 i = 0; i < nCnt; ++i )
{
SwAnchoredObject* pAnchoredObj = (*pFrm->GetDrawObjs())[i];
if ( pAnchoredObj->ISA(SwFlyFrm) )
@@ -3410,13 +3444,13 @@ BOOL lcl_IsFlyHeightClipped( SwLayoutFrm *pLay )
SwFlyFrm* pFly = static_cast<SwFlyFrm*>(pAnchoredObj);
if ( pFly->IsHeightClipped() &&
( !pFly->IsFlyFreeFrm() || pFly->GetPageFrm() ) )
- return TRUE;
+ return sal_True;
}
}
}
pFrm = pFrm->FindNextCnt();
}
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -3441,13 +3475,23 @@ void SwLayoutFrm::FormatWidthCols( const SwBorderAttrs &rAttrs,
//3. Weiter mit 1. bis zur Stabilitaet.
const SwFmtCol &rCol = rAttrs.GetAttrSet().GetCol();
+<<<<<<< local
const USHORT nNumCols = rCol.GetNumCols();
+=======
+ const sal_uInt16 nNumCols = rCol.GetNumCols();
+>>>>>>> other
+<<<<<<< local
BOOL bEnd = FALSE;
BOOL bBackLock = FALSE;
ViewShell *pSh = getRootFrm()->GetCurrShell();
SwViewImp *pImp = pSh ? pSh->Imp() : 0;
+=======
+ sal_Bool bEnd = sal_False;
+ sal_Bool bBackLock = sal_False;
+ SwViewImp *pImp = GetShell() ? GetShell()->Imp() : 0;
+>>>>>>> other
{
// Zugrunde liegender Algorithmus
// Es wird versucht, eine optimale Hoehe fuer die Spalten zu finden.
@@ -3480,14 +3524,14 @@ void SwLayoutFrm::FormatWidthCols( const SwBorderAttrs &rAttrs,
long nMinimum = nMinHeight;
long nMaximum;
- BOOL bNoBalance = FALSE;
+ sal_Bool bNoBalance = sal_False;
SWRECTFN( this )
if( IsSctFrm() )
{
nMaximum = (Frm().*fnRect->fnGetHeight)() - nBorder +
(Frm().*fnRect->fnBottomDist)(
(GetUpper()->*fnRect->fnGetPrtBottom)() );
- nMaximum += GetUpper()->Grow( LONG_MAX, TRUE );
+ nMaximum += GetUpper()->Grow( LONG_MAX, sal_True );
if( nMaximum < nMinimum )
{
if( nMaximum < 0 )
@@ -3522,8 +3566,8 @@ void SwLayoutFrm::FormatWidthCols( const SwBorderAttrs &rAttrs,
SwFrm* pFtnAny = pFtnCont->ContainsAny();
if( pFtnAny && pFtnAny->IsValid() )
{
- bBackLock = TRUE;
- ((SwSectionFrm*)this)->SetFtnLock( TRUE );
+ bBackLock = sal_True;
+ ((SwSectionFrm*)this)->SetFtnLock( sal_True );
}
}
}
@@ -3555,7 +3599,7 @@ void SwLayoutFrm::FormatWidthCols( const SwBorderAttrs &rAttrs,
if ( pImp )
pImp->CheckWaitCrsr();
- bValidSize = TRUE;
+ bValidSize = sal_True;
//Erstmal die Spalten formatieren, das entlastet den
//Stack ein wenig.
//Bei der Gelegenheit stellen wir auch gleich mal die
@@ -3568,7 +3612,7 @@ void SwLayoutFrm::FormatWidthCols( const SwBorderAttrs &rAttrs,
AdjustColumns( &rCol, sal_False );
// <--
- for ( USHORT i = 0; i < nNumCols; ++i )
+ for ( sal_uInt16 i = 0; i < nNumCols; ++i )
{
pCol->Calc();
// ColumnFrms besitzen jetzt einen BodyFrm, der auch kalkuliert werden will
@@ -3583,7 +3627,7 @@ void SwLayoutFrm::FormatWidthCols( const SwBorderAttrs &rAttrs,
pCol = (SwLayoutFrm*)Lower();
ASSERT( pCol && pCol->GetNext(), ":-( Spalten auf Urlaub?");
// bMinDiff wird gesetzt, wenn es keine leere Spalte gibt
- BOOL bMinDiff = TRUE;
+ sal_Bool bMinDiff = sal_True;
// OD 28.03.2003 #108446# - check for all column content and all columns
while ( bMinDiff && pCol )
{
@@ -3597,7 +3641,7 @@ void SwLayoutFrm::FormatWidthCols( const SwBorderAttrs &rAttrs,
SwTwips nMaxFree = 0;
SwTwips nAllFree = LONG_MAX;
// bFoundLower wird gesetzt, wenn es mind. eine nichtleere Spalte gibt
- BOOL bFoundLower = FALSE;
+ sal_Bool bFoundLower = sal_False;
while( pCol )
{
SwLayoutFrm* pLay = (SwLayoutFrm*)pCol->Lower();
@@ -3605,7 +3649,7 @@ void SwLayoutFrm::FormatWidthCols( const SwBorderAttrs &rAttrs,
(pLay->Prt().*fnRect->fnGetHeight)();
if( pLay->Lower() )
{
- bFoundLower = TRUE;
+ bFoundLower = sal_True;
nInnerHeight += pLay->InnerHeight();
}
else if( nInnerHeight < 0 )
@@ -3613,7 +3657,7 @@ void SwLayoutFrm::FormatWidthCols( const SwBorderAttrs &rAttrs,
if( pLay->GetNext() )
{
- bFoundLower = TRUE;
+ bFoundLower = sal_True;
pLay = (SwLayoutFrm*)pLay->GetNext();
ASSERT( pLay->IsFtnContFrm(),"FtnContainer exspected" );
nInnerHeight += pLay->InnerHeight();
@@ -3774,10 +3818,10 @@ void SwLayoutFrm::FormatWidthCols( const SwBorderAttrs &rAttrs,
}
}
else
- bEnd = TRUE;
+ bEnd = sal_True;
}
else
- bEnd = TRUE;
+ bEnd = sal_True;
} while ( !bEnd || !bValidSize );
}
@@ -3786,10 +3830,10 @@ void SwLayoutFrm::FormatWidthCols( const SwBorderAttrs &rAttrs,
::CalcCntnt( this, true );
if( IsSctFrm() )
{
- // OD 14.03.2003 #i11760# - adjust 2nd parameter - TRUE --> true
+ // OD 14.03.2003 #i11760# - adjust 2nd parameter - sal_True --> true
::CalcCntnt( this, true );
if( bBackLock )
- ((SwSectionFrm*)this)->SetFtnLock( FALSE );
+ ((SwSectionFrm*)this)->SetFtnLock( sal_False );
}
}
@@ -3803,7 +3847,7 @@ void SwLayoutFrm::FormatWidthCols( const SwBorderAttrs &rAttrs,
|*
|*************************************************************************/
-SwCntntFrm* lcl_InvalidateSection( SwFrm *pCnt, BYTE nInv )
+SwCntntFrm* lcl_InvalidateSection( SwFrm *pCnt, sal_uInt8 nInv )
{
SwSectionFrm* pSect = pCnt->FindSctFrm();
// Wenn unser CntntFrm in einer Tabelle oder Fussnote steht, sind nur
@@ -3826,7 +3870,7 @@ SwCntntFrm* lcl_InvalidateSection( SwFrm *pCnt, BYTE nInv )
return pRet;
}
-SwCntntFrm* lcl_InvalidateTable( SwTabFrm *pTable, BYTE nInv )
+SwCntntFrm* lcl_InvalidateTable( SwTabFrm *pTable, sal_uInt8 nInv )
{
if( ( nInv & INV_SECTION ) && pTable->IsInSct() )
lcl_InvalidateSection( pTable, nInv );
@@ -3839,9 +3883,9 @@ SwCntntFrm* lcl_InvalidateTable( SwTabFrm *pTable, BYTE nInv )
return pTable->FindLastCntnt();
}
-void lcl_InvalidateAllCntnt( SwCntntFrm *pCnt, BYTE nInv );
+void lcl_InvalidateAllCntnt( SwCntntFrm *pCnt, sal_uInt8 nInv );
-void lcl_InvalidateCntnt( SwCntntFrm *pCnt, BYTE nInv )
+void lcl_InvalidateCntnt( SwCntntFrm *pCnt, sal_uInt8 nInv )
{
SwCntntFrm *pLastTabCnt = NULL;
SwCntntFrm *pLastSctCnt = NULL;
@@ -3892,7 +3936,7 @@ void lcl_InvalidateCntnt( SwCntntFrm *pCnt, BYTE nInv )
}
if( nInv & INV_SIZE )
- pCnt->Prepare( PREP_CLEAR, 0, FALSE );
+ pCnt->Prepare( PREP_CLEAR, 0, sal_False );
if( nInv & INV_POS )
pCnt->_InvalidatePos();
if( nInv & INV_PRTAREA )
@@ -3905,10 +3949,10 @@ void lcl_InvalidateCntnt( SwCntntFrm *pCnt, BYTE nInv )
}
}
-void lcl_InvalidateAllCntnt( SwCntntFrm *pCnt, BYTE nInv )
+void lcl_InvalidateAllCntnt( SwCntntFrm *pCnt, sal_uInt8 nInv )
{
SwSortedObjs &rObjs = *pCnt->GetDrawObjs();
- for ( USHORT i = 0; i < rObjs.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i )
{
SwAnchoredObject* pAnchoredObj = rObjs[i];
if ( pAnchoredObj->ISA(SwFlyFrm) )
@@ -3924,7 +3968,7 @@ void lcl_InvalidateAllCntnt( SwCntntFrm *pCnt, BYTE nInv )
}
}
-void SwRootFrm::InvalidateAllCntnt( BYTE nInv )
+void SwRootFrm::InvalidateAllCntnt( sal_uInt8 nInv )
{
// Erst werden alle Seitengebundenen FlyFrms abgearbeitet.
SwPageFrm *pPage = (SwPageFrm*)Lower();
@@ -3940,7 +3984,7 @@ void SwRootFrm::InvalidateAllCntnt( BYTE nInv )
if ( pPage->GetSortedObjs() )
{
const SwSortedObjs &rObjs = *pPage->GetSortedObjs();
- for ( USHORT i = 0; i < rObjs.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i )
{
SwAnchoredObject* pAnchoredObj = rObjs[i];
if ( pAnchoredObj->ISA(SwFlyFrm) )
diff --git a/sw/source/core/objectpositioning/anchoredobjectposition.cxx b/sw/source/core/objectpositioning/anchoredobjectposition.cxx
index 71b8f1b38e18..cf3017426f31 100644
--- a/sw/source/core/objectpositioning/anchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/anchoredobjectposition.cxx
@@ -953,11 +953,11 @@ SwTwips SwAnchoredObjectPosition::_AdjustHoriRelPosForDrawAside(
}
SwRect aTmpObjRect( aTmpPos, aObjBoundRect.SSize() );
- const UINT32 nObjOrdNum = GetObject().GetOrdNum();
+ const sal_uInt32 nObjOrdNum = GetObject().GetOrdNum();
const SwPageFrm* pObjPage = rFlyAtCntFrm.FindPageFrm();
const SwFrm* pObjContext = ::FindKontext( &rAnchorTxtFrm, FRM_COLUMN );
- ULONG nObjIndex = rAnchorTxtFrm.GetTxtNode()->GetIndex();
- SwOrderIter aIter( pObjPage, TRUE );
+ sal_uLong nObjIndex = rAnchorTxtFrm.GetTxtNode()->GetIndex();
+ SwOrderIter aIter( pObjPage, sal_True );
const SwFlyFrm* pFly = ((SwVirtFlyDrawObj*)aIter.Bottom())->GetFlyFrm();
while ( pFly && nObjOrdNum > pFly->GetVirtDrawObj()->GetOrdNumDirect() )
{
@@ -1053,7 +1053,7 @@ SwTwips SwAnchoredObjectPosition::_AdjustHoriRelPosForDrawAside(
bool SwAnchoredObjectPosition::_DrawAsideFly( const SwFlyFrm* _pFly,
const SwRect& _rObjRect,
const SwFrm* _pObjContext,
- const ULONG _nObjIndex,
+ const sal_uLong _nObjIndex,
const bool _bEvenPage,
const sal_Int16 _eHoriOrient,
const sal_Int16 _eRelOrient
@@ -1068,7 +1068,7 @@ bool SwAnchoredObjectPosition::_DrawAsideFly( const SwFlyFrm* _pFly,
(_rObjRect.*fnRect->fnBottomDist)( (_pFly->Frm().*fnRect->fnGetTop)() ) < 0 &&
::FindKontext( _pFly->GetAnchorFrm(), FRM_COLUMN ) == _pObjContext )
{
- ULONG nOtherIndex =
+ sal_uLong nOtherIndex =
static_cast<const SwTxtFrm*>(_pFly->GetAnchorFrm())->GetTxtNode()->GetIndex();
if( _nObjIndex >= nOtherIndex )
{
@@ -1111,11 +1111,11 @@ bool SwAnchoredObjectPosition::_Minor( sal_Int16 _eRelOrient1,
// draw aside order for left horizontal position
//! one array entry for each value in text::RelOrientation
- static USHORT __READONLY_DATA aLeft[ 10 ] =
+ static sal_uInt16 __READONLY_DATA aLeft[ 10 ] =
{ 5, 6, 0, 1, 8, 4, 7, 2, 3, 9 };
// draw aside order for right horizontal position
//! one array entry for each value in text::RelOrientation
- static USHORT __READONLY_DATA aRight[ 10 ] =
+ static sal_uInt16 __READONLY_DATA aRight[ 10 ] =
{ 5, 6, 0, 8, 1, 7, 4, 2, 3, 9 };
// decide depending on given order, which frame has to draw aside another frame
diff --git a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
index 1e07d9bdf13a..82fd8ebcab04 100644
--- a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
@@ -122,13 +122,13 @@ bool lcl_DoesVertPosFits( const SwTwips _nRelPosY,
{
SwSectionFrm* pSctFrm =
const_cast<SwSectionFrm*>(_pUpperOfOrientFrm->FindSctFrm());
- bVertPosFits = pSctFrm->GetUpper()->Grow( _nRelPosY - _nAvail, TRUE ) > 0;
+ bVertPosFits = pSctFrm->GetUpper()->Grow( _nRelPosY - _nAvail, sal_True ) > 0;
// Note: do not provide a layout frame for a grow.
}
else
{
bVertPosFits = const_cast<SwLayoutFrm*>(_pUpperOfOrientFrm)->
- Grow( _nRelPosY - _nAvail, TRUE ) > 0;
+ Grow( _nRelPosY - _nAvail, sal_True ) > 0;
if ( bVertPosFits )
_orpLayoutFrmToGrow = const_cast<SwLayoutFrm*>(_pUpperOfOrientFrm);
}
@@ -138,7 +138,7 @@ bool lcl_DoesVertPosFits( const SwTwips _nRelPosY,
// --> OD 2005-06-08 #i45085# - check, if upper frame would grow the
// excepted amount of twips.
const SwTwips nTwipsGrown = const_cast<SwLayoutFrm*>(_pUpperOfOrientFrm)->
- Grow( _nRelPosY - _nAvail, TRUE ) > 0;
+ Grow( _nRelPosY - _nAvail, sal_True ) > 0;
bVertPosFits = ( nTwipsGrown == ( _nRelPosY - _nAvail ) );
// <--
if ( bVertPosFits )
@@ -674,7 +674,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
eMakePage = MAKEPAGE_NOSECTION;
const SwLayoutFrm* pTmp =
- pUpperOfOrientFrm->GetLeaf( eMakePage, TRUE, &rAnchorTxtFrm );
+ pUpperOfOrientFrm->GetLeaf( eMakePage, sal_True, &rAnchorTxtFrm );
if ( pTmp &&
( !bInSct ||
pUpperOfOrientFrm->FindSctFrm()->IsAnFollow( pTmp->FindSctFrm() ) ) )
@@ -823,7 +823,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
!pOrientFrm->GetIndPrev() )
{
const_cast<SwTabFrm*>(pOrientFrm->FindTabFrm())
- ->SetDoesObjsFit( FALSE );
+ ->SetDoesObjsFit( sal_False );
}
else
{
@@ -860,7 +860,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
pOrientFrm == &rAnchorTxtFrm && !pOrientFrm->GetIndPrev() )
{
const_cast<SwTabFrm*>(pOrientFrm->FindTabFrm())
- ->SetDoesObjsFit( FALSE );
+ ->SetDoesObjsFit( sal_False );
}
}
}
@@ -898,7 +898,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
( bInSct
? MAKEPAGE_NOSECTION
: ( bInFtn ? MAKEPAGE_NONE : MAKEPAGE_APPEND ) ),
- TRUE, &rAnchorTxtFrm );
+ sal_True, &rAnchorTxtFrm );
// OD 06.10.2003 #110978# - correction:
// If anchor is in footnote and proposed next layout environment
// isn't a footnote frame, object can't follow the text flow
diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx
index 8c1488cdbf9c..60f9453b25ca 100644
--- a/sw/source/core/ole/ndole.cxx
+++ b/sw/source/core/ole/ndole.cxx
@@ -91,7 +91,7 @@ public:
virtual void Commit();
void Load();
- void SetInUnload( BOOL bFlag ) { bInUnload = bFlag; }
+ void SetInUnload( sal_Bool bFlag ) { bInUnload = bFlag; }
using SvPtrarr::Count;
void InsertObj( SwOLEObj& rObj );
@@ -99,7 +99,7 @@ public:
void RemovePtr( SwOLEObj* pObj )
{
- USHORT nPos = SvPtrarr::GetPos( pObj );
+ sal_uInt16 nPos = SvPtrarr::GetPos( pObj );
if( USHRT_MAX != nPos )
SvPtrarr::Remove( nPos );
}
@@ -187,7 +187,7 @@ SwEmbedObjectLink::SwEmbedObjectLink(SwOLENode* pNode):
::sfx2::SvBaseLink( ::sfx2::LINKUPDATE_ONCALL, SOT_FORMATSTR_ID_SVXB ),
pOleNode(pNode)
{
- SetSynchron( FALSE );
+ SetSynchron( sal_False );
}
// -----------------------------------------------------------------------------
@@ -252,7 +252,7 @@ SwOLENode::SwOLENode( const SwNodeIndex &rWhere,
SwNoTxtNode( rWhere, ND_OLENODE, pGrfColl, pAutoAttr ),
aOLEObj( xObj ),
pGraphic(0),
- bOLESizeInvalid( FALSE ),
+ bOLESizeInvalid( sal_False ),
mpObjectLink( NULL )
{
aOLEObj.SetNode( this );
@@ -266,7 +266,7 @@ SwOLENode::SwOLENode( const SwNodeIndex &rWhere,
SwNoTxtNode( rWhere, ND_OLENODE, pGrfColl, pAutoAttr ),
aOLEObj( rString, nAspect ),
pGraphic(0),
- bOLESizeInvalid( FALSE ),
+ bOLESizeInvalid( sal_False ),
mpObjectLink( NULL )
{
aOLEObj.SetNode( this );
@@ -293,13 +293,13 @@ Graphic* SwOLENode::GetHCGraphic()
SwCntntNode *SwOLENode::SplitCntntNode( const SwPosition & )
{
// OLE-Objecte vervielfaeltigen ??
- ASSERT( FALSE, "OleNode: can't split." );
+ ASSERT( sal_False, "OleNode: can't split." );
return this;
}
// Laden eines in den Undo-Bereich verschobenen OLE-Objekts
-BOOL SwOLENode::RestorePersistentData()
+sal_Bool SwOLENode::RestorePersistentData()
{
DBG_ASSERT( aOLEObj.GetOleRef().is(), "No object to restore!" );
if ( aOLEObj.xOLERef.is() )
@@ -335,11 +335,11 @@ BOOL SwOLENode::RestorePersistentData()
}
}
- return TRUE;
+ return sal_True;
}
// OLE object is transported into UNDO area
-BOOL SwOLENode::SavePersistentData()
+sal_Bool SwOLENode::SavePersistentData()
{
if( aOLEObj.xOLERef.is() )
{
@@ -379,7 +379,7 @@ BOOL SwOLENode::SavePersistentData()
DisconnectFileLink_Impl();
- return TRUE;
+ return sal_True;
}
@@ -437,16 +437,14 @@ Size SwOLENode::GetTwipSize() const
SwCntntNode* SwOLENode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const
{
// Falls bereits eine SvPersist-Instanz existiert, nehmen wir diese
- SfxObjectShell* p = pDoc->GetPersist();
- if( !p )
+ SfxObjectShell* pPersistShell = pDoc->GetPersist();
+ if( !pPersistShell )
{
- // TODO/LATER: reicht hier nicht ein EmbeddedObjectContainer? Was passiert mit
- // diesem Dokument?
- ASSERT( pDoc->GetRefForDocShell(),
- "wo ist die Ref-Klasse fuer die DocShell?")
- p = new SwDocShell( pDoc, SFX_CREATE_MODE_INTERNAL );
- *pDoc->GetRefForDocShell() = p;
- p->DoInitNew( NULL );
+ // TODO/LATER: is EmbeddedObjectContainer not enough?
+ // the created document will be closed by pDoc ( should use SfxObjectShellLock )
+ pPersistShell = new SwDocShell( pDoc, SFX_CREATE_MODE_INTERNAL );
+ pDoc->SetTmpDocShell( pPersistShell );
+ pPersistShell->DoInitNew( NULL );
}
// Wir hauen das Ding auf SvPersist-Ebene rein
@@ -454,7 +452,7 @@ SwCntntNode* SwOLENode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const
::rtl::OUString aNewName/*( Sw3Io::UniqueName( p->GetStorage(), "Obj" ) )*/;
SfxObjectShell* pSrc = GetDoc()->GetPersist();
- p->GetEmbeddedObjectContainer().CopyAndGetEmbeddedObject(
+ pPersistShell->GetEmbeddedObjectContainer().CopyAndGetEmbeddedObject(
pSrc->GetEmbeddedObjectContainer(),
pSrc->GetEmbeddedObjectContainer().GetEmbeddedObject( aOLEObj.aName ),
aNewName );
@@ -469,32 +467,32 @@ SwCntntNode* SwOLENode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const
pOLENd->SetContour( HasContour(), HasAutomaticContour() );
pOLENd->SetAspect( GetAspect() ); // the replacement image must be already copied
- pOLENd->SetOLESizeInvalid( TRUE );
+ pOLENd->SetOLESizeInvalid( sal_True );
pDoc->SetOLEPrtNotifyPending();
return pOLENd;
}
-BOOL SwOLENode::IsInGlobalDocSection() const
+sal_Bool SwOLENode::IsInGlobalDocSection() const
{
// suche den "Body Anchor"
- ULONG nEndExtraIdx = GetNodes().GetEndOfExtras().GetIndex();
+ sal_uLong nEndExtraIdx = GetNodes().GetEndOfExtras().GetIndex();
const SwNode* pAnchorNd = this;
do {
SwFrmFmt* pFlyFmt = pAnchorNd->GetFlyFmt();
if( !pFlyFmt )
- return FALSE;
+ return sal_False;
const SwFmtAnchor& rAnchor = pFlyFmt->GetAnchor();
if( !rAnchor.GetCntntAnchor() )
- return FALSE;
+ return sal_False;
pAnchorNd = &rAnchor.GetCntntAnchor()->nNode.GetNode();
} while( pAnchorNd->GetIndex() < nEndExtraIdx );
const SwSectionNode* pSectNd = pAnchorNd->FindSectionNode();
if( !pSectNd )
- return FALSE;
+ return sal_False;
while( pSectNd )
{
@@ -509,9 +507,9 @@ BOOL SwOLENode::IsInGlobalDocSection() const
pSectNd->GetIndex() > nEndExtraIdx;
}
-BOOL SwOLENode::IsOLEObjectDeleted() const
+sal_Bool SwOLENode::IsOLEObjectDeleted() const
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( aOLEObj.xOLERef.is() )
{
SfxObjectShell* p = GetDoc()->GetPersist();
@@ -662,7 +660,7 @@ SwOLEObj::SwOLEObj( const svt::EmbeddedObjectRef& xObj ) :
pListener( 0 ),
xOLERef( xObj )
{
- xOLERef.Lock( TRUE );
+ xOLERef.Lock( sal_True );
if ( xObj.is() )
{
pListener = new SwOLEListener_Impl( this );
@@ -677,7 +675,7 @@ SwOLEObj::SwOLEObj( const String &rString, sal_Int64 nAspect ) :
pListener( 0 ),
aName( rString )
{
- xOLERef.Lock( TRUE );
+ xOLERef.Lock( sal_True );
xOLERef.SetViewAspect( nAspect );
}
@@ -717,7 +715,7 @@ SwOLEObj::~SwOLEObj()
// unlock object so that object can be closed in RemoveEmbeddedObject
// successful closing of the object will automatically clear the reference then
- xOLERef.Lock(FALSE);
+ xOLERef.Lock(sal_False);
// Always remove object from conteiner it is connected to
try
@@ -776,7 +774,7 @@ void SwOLEObj::SetNode( SwOLENode* pNode )
}
}
-BOOL SwOLEObj::IsOleRef() const
+sal_Bool SwOLEObj::IsOleRef() const
{
return xOLERef.is();
}
@@ -839,9 +837,9 @@ svt::EmbeddedObjectRef& SwOLEObj::GetObject()
return xOLERef;
}
-BOOL SwOLEObj::UnloadObject()
+sal_Bool SwOLEObj::UnloadObject()
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
//Nicht notwendig im Doc DTor (MM)
//ASSERT( pOLERef && pOLERef->Is() && 1 < (*pOLERef)->GetRefCount(),
// "Falscher RefCount fuers Unload" );
@@ -854,14 +852,14 @@ BOOL SwOLEObj::UnloadObject()
return bRet;
}
-BOOL SwOLEObj::UnloadObject( uno::Reference< embed::XEmbeddedObject > xObj, const SwDoc* pDoc, sal_Int64 nAspect )
+sal_Bool SwOLEObj::UnloadObject( uno::Reference< embed::XEmbeddedObject > xObj, const SwDoc* pDoc, sal_Int64 nAspect )
{
if ( !pDoc )
- return FALSE;
+ return sal_False;
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
sal_Int32 nState = xObj.is() ? xObj->getCurrentState() : embed::EmbedStates::LOADED;
- BOOL bIsActive = ( nState != embed::EmbedStates::LOADED && nState != embed::EmbedStates::RUNNING );
+ sal_Bool bIsActive = ( nState != embed::EmbedStates::LOADED && nState != embed::EmbedStates::RUNNING );
sal_Int64 nMiscStatus = xObj->getStatus( nAspect );
if( nState != embed::EmbedStates::LOADED && !pDoc->IsInDtor() && !bIsActive &&
@@ -891,11 +889,11 @@ BOOL SwOLEObj::UnloadObject( uno::Reference< embed::XEmbeddedObject > xObj, cons
}
catch ( uno::Exception& )
{
- bRet = FALSE;
+ bRet = sal_False;
}
}
else
- bRet = FALSE;
+ bRet = sal_False;
}
}
@@ -965,8 +963,8 @@ void SwOLELRUCache::Load()
if( nVal < nLRU_InitSize )
{
// size of cache has been changed
- USHORT nCount = SvPtrarr::Count();
- USHORT nPos = nCount;
+ sal_uInt16 nCount = SvPtrarr::Count();
+ sal_uInt16 nPos = nCount;
// try to remove the last entries until new maximum size is reached
while( nCount > nVal )
@@ -980,14 +978,14 @@ void SwOLELRUCache::Load()
}
}
- nLRU_InitSize = (USHORT)nVal;
+ nLRU_InitSize = (sal_uInt16)nVal;
}
}
void SwOLELRUCache::InsertObj( SwOLEObj& rObj )
{
SwOLEObj* pObj = &rObj;
- USHORT nPos = SvPtrarr::GetPos( pObj );
+ sal_uInt16 nPos = SvPtrarr::GetPos( pObj );
if( nPos )
{
// object is currently not the first in cache
@@ -997,7 +995,7 @@ void SwOLELRUCache::InsertObj( SwOLEObj& rObj )
SvPtrarr::Insert( pObj, 0 );
// try to remove objects if necessary (of course not the freshly inserted one at nPos=0)
- USHORT nCount = SvPtrarr::Count();
+ sal_uInt16 nCount = SvPtrarr::Count();
nPos = nCount-1;
while( nPos && nCount > nLRU_InitSize )
{
@@ -1010,7 +1008,7 @@ void SwOLELRUCache::InsertObj( SwOLEObj& rObj )
void SwOLELRUCache::RemoveObj( SwOLEObj& rObj )
{
- USHORT nPos = SvPtrarr::GetPos( &rObj );
+ sal_uInt16 nPos = SvPtrarr::GetPos( &rObj );
if ( nPos != 0xFFFF )
SvPtrarr::Remove( nPos );
if( !Count() )
diff --git a/sw/source/core/para/paratr.cxx b/sw/source/core/para/paratr.cxx
index a67cca8c1796..94322f2b05ea 100644
--- a/sw/source/core/para/paratr.cxx
+++ b/sw/source/core/para/paratr.cxx
@@ -192,7 +192,7 @@ sal_Bool SwFmtDrop::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
sal_Int8 nTemp = 0;
rVal >>= nTemp;
if(nTemp >=1 && nTemp < 0x7f)
- nLines = (BYTE)nTemp;
+ nLines = (sal_uInt8)nTemp;
}
break;
case MID_DROPCAP_COUNT :
@@ -200,7 +200,7 @@ sal_Bool SwFmtDrop::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
sal_Int16 nTemp = 0;
rVal >>= nTemp;
if(nTemp >=1 && nTemp < 0x7f)
- nChars = (BYTE)nTemp;
+ nChars = (sal_uInt8)nTemp;
}
break;
case MID_DROPCAP_DISTANCE :
@@ -260,21 +260,21 @@ int SwNumRuleItem::operator==( const SfxPoolItem& rAttr ) const
/* -----------------------------27.06.00 11:05--------------------------------
---------------------------------------------------------------------------*/
-BOOL SwNumRuleItem::QueryValue( uno::Any& rVal, BYTE ) const
+sal_Bool SwNumRuleItem::QueryValue( uno::Any& rVal, sal_uInt8 ) const
{
rtl::OUString sRet = SwStyleNameMapper::GetProgName(GetValue(), nsSwGetPoolIdFromName::GET_POOLID_NUMRULE );
rVal <<= sRet;
- return TRUE;
+ return sal_True;
}
/* -----------------------------27.06.00 11:05--------------------------------
---------------------------------------------------------------------------*/
-BOOL SwNumRuleItem::PutValue( const uno::Any& rVal, BYTE )
+sal_Bool SwNumRuleItem::PutValue( const uno::Any& rVal, sal_uInt8 )
{
rtl::OUString uName;
rVal >>= uName;
SetValue(SwStyleNameMapper::GetUIName(uName, nsSwGetPoolIdFromName::GET_POOLID_NUMRULE));
- return TRUE;
+ return sal_True;
}
/* -----------------19.05.2003 10:44-----------------
diff --git a/sw/source/core/sw3io/sw3convert.cxx b/sw/source/core/sw3io/sw3convert.cxx
index 3d3b9e552a5e..af9350427b51 100644
--- a/sw/source/core/sw3io/sw3convert.cxx
+++ b/sw/source/core/sw3io/sw3convert.cxx
@@ -94,7 +94,7 @@ using namespace nsSwDocInfoSubType;
struct OldFormats
{
NfIndexTableOffset eFormatIdx;
- USHORT nOldFormat;
+ sal_uInt16 nOldFormat;
};
static OldFormats aOldDateFmt40[] =
@@ -213,9 +213,9 @@ static OldFormats aOldGetSetExpFmt30[] =
{ NF_NUMERIC_START, 0 } // Tabellenende
};
-SW_DLLPUBLIC void sw3io_ConvertFromOldField( SwDoc& rDoc, USHORT& rWhich,
- USHORT& rSubType, ULONG &rFmt,
- USHORT nVersion )
+SW_DLLPUBLIC void sw3io_ConvertFromOldField( SwDoc& rDoc, sal_uInt16& rWhich,
+ sal_uInt16& rSubType, sal_uLong &rFmt,
+ sal_uInt16 nVersion )
{
const OldFormats *pOldFmt = 0L;
@@ -278,10 +278,10 @@ SW_DLLPUBLIC void sw3io_ConvertFromOldField( SwDoc& rDoc, USHORT& rWhich,
// uns voruebergehend mal im Subtyp, sofern es
// ueberhaupt als entsprechendes Format in Frage kommt.
if( RES_SETEXPFLD==rWhich &&
- /*rFmt >= (USHORT)SVX_NUM_CHARS_UPPER_LETTER && always true*/
- rFmt <= (USHORT)SVX_NUM_BITMAP )
+ /*rFmt >= (sal_uInt16)SVX_NUM_CHARS_UPPER_LETTER && always true*/
+ rFmt <= (sal_uInt16)SVX_NUM_BITMAP )
{
- rSubType = (USHORT)rFmt;
+ rSubType = (sal_uInt16)rFmt;
}
pOldFmt = nVersion<SWG_INETBROWSER ? aOldGetSetExpFmt30
: aOldGetSetExpFmt40;
@@ -306,7 +306,7 @@ SW_DLLPUBLIC void sw3io_ConvertFromOldField( SwDoc& rDoc, USHORT& rWhich,
if( pOldFmt )
{
SvNumberFormatter *pFormatter = rDoc.GetNumberFormatter();
- USHORT i = 0;
+ sal_uInt16 i = 0;
while( pOldFmt[i].eFormatIdx != NF_NUMERIC_START ||
pOldFmt[i].nOldFormat)
@@ -320,11 +320,11 @@ SW_DLLPUBLIC void sw3io_ConvertFromOldField( SwDoc& rDoc, USHORT& rWhich,
}
}
}
-SW_DLLPUBLIC void sw3io_ConvertToOldField( const SwField* pFld, USHORT& rWhich,
- ULONG& rFmt, ULONG nFFVersion )
+SW_DLLPUBLIC void sw3io_ConvertToOldField( const SwField* pFld, sal_uInt16& rWhich,
+ sal_uLong& rFmt, sal_uLong nFFVersion )
{
const OldFormats *pOldFmt = 0L;
- ULONG nOldFmt = rFmt;
+ sal_uLong nOldFmt = rFmt;
switch( rWhich )
{
@@ -343,7 +343,7 @@ SW_DLLPUBLIC void sw3io_ConvertToOldField( const SwField* pFld, USHORT& rWhich,
case RES_DATETIMEFLD:
if( SOFFICE_FILEFORMAT_40 >= nFFVersion )
{
- USHORT nSubType = ((SwDateTimeField*) pFld)->GetSubType();
+ sal_uInt16 nSubType = ((SwDateTimeField*) pFld)->GetSubType();
switch( nSubType )
{
case DATEFLD: rWhich = RES_DATEFLD; break;
@@ -372,7 +372,7 @@ SW_DLLPUBLIC void sw3io_ConvertToOldField( const SwField* pFld, USHORT& rWhich,
case RES_USERFLD:
if( SOFFICE_FILEFORMAT_40 >= nFFVersion )
{
- USHORT nSubType = pFld->GetSubType();
+ sal_uInt16 nSubType = pFld->GetSubType();
if (nSubType & nsSwExtendedSubType::SUB_INVISIBLE)
rFmt = VVF_INVISIBLE;
@@ -408,7 +408,7 @@ SW_DLLPUBLIC void sw3io_ConvertToOldField( const SwField* pFld, USHORT& rWhich,
if( pOldFmt && nOldFmt )
{
- USHORT i = 0;
+ sal_uInt16 i = 0;
SvNumberFormatter *pFormatter = ((SwValueField*)pFld)->GetDoc()->GetNumberFormatter();
const SvNumberformat* pEntry = pFormatter->GetEntry( nOldFmt );
@@ -418,7 +418,7 @@ SW_DLLPUBLIC void sw3io_ConvertToOldField( const SwField* pFld, USHORT& rWhich,
while( pOldFmt[i].eFormatIdx != NF_NUMERIC_START ||
pOldFmt[i].nOldFormat )
{
- ULONG nKey = pFormatter->GetFormatIndex(
+ sal_uLong nKey = pFormatter->GetFormatIndex(
pOldFmt[i].eFormatIdx, pEntry->GetLanguage() );
if( nOldFmt == nKey )
diff --git a/sw/source/core/sw3io/swacorr.cxx b/sw/source/core/sw3io/swacorr.cxx
index be0fdf0ac441..6c9a4c52a111 100644
--- a/sw/source/core/sw3io/swacorr.cxx
+++ b/sw/source/core/sw3io/swacorr.cxx
@@ -52,9 +52,9 @@ TYPEINIT1( SwAutoCorrect, SvxAutoCorrect );
// koennen aus der Wortliste herausgeholt werden!)
// rShort ist der Stream-Name - gecryptet!
-BOOL SwAutoCorrect::GetLongText( const uno::Reference < embed::XStorage >& rStg, const String& rFileName, const String& rShort, String& rLong )
+sal_Bool SwAutoCorrect::GetLongText( const uno::Reference < embed::XStorage >& rStg, const String& rFileName, const String& rShort, String& rLong )
{
- ULONG nRet = 0;
+ sal_uLong nRet = 0;
if (rStg.is())
{
// mba: relative URLs don't make sense here
@@ -69,14 +69,14 @@ BOOL SwAutoCorrect::GetLongText( const uno::Reference < embed::XStorage >& rStg,
// - Text mit Attributierung (kann nur der SWG - SWG-Format!)
// rShort ist der Stream-Name - gecryptet!
-BOOL SwAutoCorrect::PutText( const uno::Reference < embed::XStorage >& rStg, const String& rFileName, const String& rShort,
+sal_Bool SwAutoCorrect::PutText( const uno::Reference < embed::XStorage >& rStg, const String& rFileName, const String& rShort,
SfxObjectShell& rObjSh, String& rLong )
{
if( !rObjSh.IsA( TYPE(SwDocShell) ) )
- return FALSE;
+ return sal_False;
SwDocShell& rDShell = (SwDocShell&)rObjSh;
- ULONG nRet = 0;
+ sal_uLong nRet = 0;
// mba: relative URLs don't make sense here
SwXMLTextBlocks aBlk( rStg, rFileName );
@@ -87,7 +87,7 @@ BOOL SwAutoCorrect::PutText( const uno::Reference < embed::XStorage >& rStg, co
{
((SwEditShell*)rDShell.GetWrtShell())->_CopySelToDoc( pDoc );
nRet = aBlk.PutDoc();
- aBlk.AddName ( rShort, rShort, FALSE );
+ aBlk.AddName ( rShort, rShort, sal_False );
if( !IsError( nRet ) )
nRet = aBlk.GetText( rShort, rLong );
}
diff --git a/sw/source/core/swg/SwXMLBlockListContext.cxx b/sw/source/core/swg/SwXMLBlockListContext.cxx
index 1fb2659c9a2d..b8c5fb58aefc 100644
--- a/sw/source/core/swg/SwXMLBlockListContext.cxx
+++ b/sw/source/core/swg/SwXMLBlockListContext.cxx
@@ -96,7 +96,7 @@ SwXMLBlockContext::SwXMLBlockContext(
{
static const CharClass & rCC = GetAppCharClass();
String aShort, aLong, aPackageName;
- BOOL bTextOnly = FALSE;
+ sal_Bool bTextOnly = sal_False;
sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
for (sal_Int16 i=0; i < nAttrCount; i++)
@@ -122,7 +122,7 @@ SwXMLBlockContext::SwXMLBlockContext(
else if ( IsXMLToken ( aLocalName, XML_UNFORMATTED_TEXT ) )
{
if ( IsXMLToken ( rAttrValue, XML_TRUE ) )
- bTextOnly = TRUE;
+ bTextOnly = sal_True;
}
}
}
diff --git a/sw/source/core/swg/SwXMLTextBlocks.cxx b/sw/source/core/swg/SwXMLTextBlocks.cxx
index 358b00e12ca1..a0728661ad60 100644
--- a/sw/source/core/swg/SwXMLTextBlocks.cxx
+++ b/sw/source/core/swg/SwXMLTextBlocks.cxx
@@ -28,7 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/embed/XTransactedObject.hpp>
#include <tools/urlobj.hxx>
@@ -39,9 +38,8 @@
#include <comphelper/storagehelper.hxx>
#include <doc.hxx>
-#ifndef _DOCSH_HXX
+#include <IDocumentUndoRedo.hxx>
#include <docsh.hxx>
-#endif
#include <pam.hxx>
#include <swblocks.hxx>
#include <ndtxt.hxx>
@@ -72,16 +70,16 @@ void SwXMLTextBlocks::ResetBlockMode ( )
}
SwXMLTextBlocks::SwXMLTextBlocks( const String& rFile )
-: SwImpBlocks( rFile ), bAutocorrBlock( FALSE ), nFlags ( 0 )
+: SwImpBlocks( rFile ), bAutocorrBlock( sal_False ), nFlags ( 0 )
{
SwDocShell* pDocSh = new SwDocShell ( SFX_CREATE_MODE_INTERNAL );
if( !pDocSh->DoInitNew( 0 ) )
return;
- bReadOnly = TRUE;
+ bReadOnly = sal_True;
pDoc = pDocSh->GetDoc();
xDocShellRef = pDocSh;
pDoc->SetOle2Link( Link() );
- pDoc->DoUndo( FALSE ); // always FALSE
+ pDoc->GetIDocumentUndoRedo().DoUndo(false);
pDoc->acquire();
uno::Reference< embed::XStorage > refStg;
if( !aDateModified.GetDate() || !aTimeModified.GetTime() )
@@ -89,7 +87,7 @@ SwXMLTextBlocks::SwXMLTextBlocks( const String& rFile )
try
{
refStg = comphelper::OStorageHelper::GetStorageFromURL( rFile, embed::ElementModes::READWRITE );
- bReadOnly = FALSE;
+ bReadOnly = sal_False;
}
catch( const uno::Exception& )
{
@@ -109,27 +107,27 @@ SwXMLTextBlocks::SwXMLTextBlocks( const String& rFile )
InitBlockMode ( refStg );
ReadInfo();
ResetBlockMode ();
- bInfoChanged = FALSE;
+ bInfoChanged = sal_False;
}
SwXMLTextBlocks::SwXMLTextBlocks( const uno::Reference < embed::XStorage >& rStg, const String& rName )
: SwImpBlocks( rName )
-, bAutocorrBlock( TRUE )
+, bAutocorrBlock( sal_True )
, nFlags ( 0 )
{
SwDocShell* pDocSh = new SwDocShell ( SFX_CREATE_MODE_INTERNAL );
if( !pDocSh->DoInitNew( 0 ) )
return;
- bReadOnly = FALSE;
+ bReadOnly = sal_False;
pDoc = pDocSh->GetDoc();
xDocShellRef = pDocSh;
pDoc->SetOle2Link( Link() );
- pDoc->DoUndo( FALSE );
+ pDoc->GetIDocumentUndoRedo().DoUndo(false);
pDoc->acquire();
InitBlockMode ( rStg );
ReadInfo();
- bInfoChanged = FALSE;
+ bInfoChanged = sal_False;
}
SwXMLTextBlocks::~SwXMLTextBlocks()
@@ -153,35 +151,35 @@ void SwXMLTextBlocks::ClearDoc()
pDoc->ClearDoc();
pDocShell->ClearEmbeddedObjects();
}
-void SwXMLTextBlocks::AddName( const String& rShort, const String& rLong, BOOL bOnlyTxt )
+void SwXMLTextBlocks::AddName( const String& rShort, const String& rLong, sal_Bool bOnlyTxt )
{
- USHORT nIdx = GetIndex( rShort );
+ sal_uInt16 nIdx = GetIndex( rShort );
SwBlockName* pNew = NULL;
- if( nIdx != (USHORT) -1 )
+ if( nIdx != (sal_uInt16) -1 )
aNames.DeleteAndDestroy( nIdx );
GeneratePackageName( rShort, aPackageName );
pNew = new SwBlockName( rShort, rLong, aPackageName );
- pNew->bIsOnlyTxtFlagInit = TRUE;
+ pNew->bIsOnlyTxtFlagInit = sal_True;
pNew->bIsOnlyTxt = bOnlyTxt;
aNames.C40_PTR_INSERT( SwBlockName, pNew );
- bInfoChanged = TRUE;
+ bInfoChanged = sal_True;
}
void SwXMLTextBlocks::AddName( const String& rShort, const String& rLong,
- const String& rPackageName, BOOL bOnlyTxt )
+ const String& rPackageName, sal_Bool bOnlyTxt )
{
- USHORT nIdx = GetIndex( rShort );
- if( nIdx != (USHORT) -1 )
+ sal_uInt16 nIdx = GetIndex( rShort );
+ if( nIdx != (sal_uInt16) -1 )
aNames.DeleteAndDestroy( nIdx );
SwBlockName* pNew = new SwBlockName( rShort, rLong, rPackageName );
- pNew->bIsOnlyTxtFlagInit = TRUE;
+ pNew->bIsOnlyTxtFlagInit = sal_True;
pNew->bIsOnlyTxt = bOnlyTxt;
aNames.C40_PTR_INSERT( SwBlockName, pNew );
- bInfoChanged = TRUE;
+ bInfoChanged = sal_True;
}
-ULONG SwXMLTextBlocks::Delete( USHORT n )
+sal_uLong SwXMLTextBlocks::Delete( sal_uInt16 n )
{
String aPckName (aNames[ n ]->aPackageName);
uno::Reference < container::XNameAccess > xAccess( xBlkRoot, uno::UNO_QUERY );
@@ -204,7 +202,7 @@ ULONG SwXMLTextBlocks::Delete( USHORT n )
return 0;
}
-ULONG SwXMLTextBlocks::Rename( USHORT nIdx, const String& rNewShort, const String& )
+sal_uLong SwXMLTextBlocks::Rename( sal_uInt16 nIdx, const String& rNewShort, const String& )
{
DBG_ASSERT( xBlkRoot.is(), "No storage set" );
if(!xBlkRoot.is())
@@ -245,17 +243,17 @@ ULONG SwXMLTextBlocks::Rename( USHORT nIdx, const String& rNewShort, const Strin
return 0;
}
-ULONG SwXMLTextBlocks::CopyBlock( SwImpBlocks& rDestImp, String& rShort,
+sal_uLong SwXMLTextBlocks::CopyBlock( SwImpBlocks& rDestImp, String& rShort,
const String& rLong)
{
- ULONG nError = 0;
- OpenFile(TRUE);
- rDestImp.OpenFile(FALSE);
+ sal_uLong nError = 0;
+ OpenFile(sal_True);
+ rDestImp.OpenFile(sal_False);
String aGroup( rShort );
- BOOL bTextOnly = IsOnlyTextBlock ( rShort ) ;//pImp->pBlkRoot->IsStream( aGroup );
- USHORT nIndex = GetIndex ( rShort );
+ sal_Bool bTextOnly = IsOnlyTextBlock ( rShort ) ;//pImp->pBlkRoot->IsStream( aGroup );
+ sal_uInt16 nIndex = GetIndex ( rShort );
String sDestShortName( GetPackageName (nIndex) );
- USHORT nIdx = 0;
+ sal_uInt16 nIdx = 0;
DBG_ASSERT( xBlkRoot.is(), "No storage set" );
if(!xBlkRoot.is())
@@ -319,7 +317,7 @@ ULONG SwXMLTextBlocks::CopyBlock( SwImpBlocks& rDestImp, String& rShort,
}
-ULONG SwXMLTextBlocks::StartPutBlock( const String& rShort, const String& rPackageName )
+sal_uLong SwXMLTextBlocks::StartPutBlock( const String& rShort, const String& rPackageName )
{
DBG_ASSERT( xBlkRoot.is(), "No storage set" );
if(!xBlkRoot.is())
@@ -346,20 +344,20 @@ ULONG SwXMLTextBlocks::StartPutBlock( const String& rShort, const String& rPacka
}
return 0;
}
-ULONG SwXMLTextBlocks::BeginPutDoc( const String& rShort, const String& rLong )
+sal_uLong SwXMLTextBlocks::BeginPutDoc( const String& rShort, const String& rLong )
{
// In der Basisklasse ablegen!
aShort = rShort;
aLong = rLong;
GeneratePackageName( rShort, aPackageName );
- SetIsTextOnly( rShort, FALSE);
+ SetIsTextOnly( rShort, sal_False);
return StartPutBlock (rShort, aPackageName);
}
-ULONG SwXMLTextBlocks::PutBlock( SwPaM& , const String& )
+sal_uLong SwXMLTextBlocks::PutBlock( SwPaM& , const String& )
{
- ULONG nRes = 0;
- USHORT nCommitFlags = nFlags & (SWXML_CONVBLOCK|SWXML_NOROOTCOMMIT);
+ sal_uLong nRes = 0;
+ sal_uInt16 nCommitFlags = nFlags & (SWXML_CONVBLOCK|SWXML_NOROOTCOMMIT);
nFlags |= nCommitFlags;
@@ -433,7 +431,7 @@ ULONG SwXMLTextBlocks::PutBlock( SwPaM& , const String& )
//TODO/LATER: error handling
/*
- ULONG nErr = xBlkRoot->GetError();
+ sal_uLong nErr = xBlkRoot->GetError();
if( nErr == SVSTREAM_DISK_FULL )
nRes = ERR_W4W_WRITE_FULL;
else if( nErr != SVSTREAM_OK )
@@ -443,34 +441,34 @@ ULONG SwXMLTextBlocks::PutBlock( SwPaM& , const String& )
return 0;
}
-ULONG SwXMLTextBlocks::PutDoc()
+sal_uLong SwXMLTextBlocks::PutDoc()
{
SwPaM* pPaM = MakePaM();
- ULONG nErr = PutBlock(*pPaM, aLong);
+ sal_uLong nErr = PutBlock(*pPaM, aLong);
delete pPaM;
return nErr;
}
-ULONG SwXMLTextBlocks::GetText( USHORT nIdx, String& rText )
+sal_uLong SwXMLTextBlocks::GetText( sal_uInt16 nIdx, String& rText )
{
return GetBlockText( aNames[ nIdx ]->aShort, rText );
}
-ULONG SwXMLTextBlocks::GetText( const String& rShort, String& rText )
+sal_uLong SwXMLTextBlocks::GetText( const String& rShort, String& rText )
{
return GetBlockText( rShort, rText );
}
-ULONG SwXMLTextBlocks::MakeBlockList()
+sal_uLong SwXMLTextBlocks::MakeBlockList()
{
WriteInfo();
return 0;
}
-BOOL SwXMLTextBlocks::PutMuchEntries( BOOL bOn )
+sal_Bool SwXMLTextBlocks::PutMuchEntries( sal_Bool bOn )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( bOn )
{
if( bInPutMuchBlocks )
@@ -479,11 +477,11 @@ BOOL SwXMLTextBlocks::PutMuchEntries( BOOL bOn )
}
else if( !IsFileChanged() )
{
- bRet = 0 == OpenFile( FALSE );
+ bRet = 0 == OpenFile( sal_False );
if( bRet )
{
nFlags |= SWXML_NOROOTCOMMIT;
- bInPutMuchBlocks = TRUE;
+ bInPutMuchBlocks = sal_True;
}
}
}
@@ -500,8 +498,8 @@ BOOL SwXMLTextBlocks::PutMuchEntries( BOOL bOn )
MakeBlockList();
CloseFile();
Touch();
- bInPutMuchBlocks = FALSE;
- bRet = TRUE;
+ bInPutMuchBlocks = sal_False;
+ bRet = sal_True;
}
catch (uno::Exception&)
{
@@ -511,11 +509,11 @@ BOOL SwXMLTextBlocks::PutMuchEntries( BOOL bOn )
return bRet;
}
-ULONG SwXMLTextBlocks::OpenFile( BOOL bRdOnly )
+sal_uLong SwXMLTextBlocks::OpenFile( sal_Bool bRdOnly )
{
if( bAutocorrBlock )
return 0;
- ULONG nRet = 0;
+ sal_uLong nRet = 0;
try
{
uno::Reference < embed::XStorage > refStg = comphelper::OStorageHelper::GetStorageFromURL( aFile,
@@ -541,34 +539,34 @@ void SwXMLTextBlocks::CloseFile()
}
}
-void SwXMLTextBlocks::SetIsTextOnly( const String& rShort, BOOL bNewValue )
+void SwXMLTextBlocks::SetIsTextOnly( const String& rShort, sal_Bool bNewValue )
{
- USHORT nIdx = GetIndex ( rShort );
- if (nIdx != (USHORT) -1 && nIdx != USHRT_MAX)
+ sal_uInt16 nIdx = GetIndex ( rShort );
+ if (nIdx != (sal_uInt16) -1 && nIdx != USHRT_MAX)
aNames[nIdx]->bIsOnlyTxt = bNewValue;
}
-void SwXMLTextBlocks::SetIsTextOnly( USHORT nIdx, BOOL bNewValue )
+void SwXMLTextBlocks::SetIsTextOnly( sal_uInt16 nIdx, sal_Bool bNewValue )
{
aNames[nIdx]->bIsOnlyTxt = bNewValue;
}
-BOOL SwXMLTextBlocks::IsOnlyTextBlock( const String& rShort ) const
+sal_Bool SwXMLTextBlocks::IsOnlyTextBlock( const String& rShort ) const
{
- USHORT nIdx = GetIndex ( rShort );
- BOOL bRet = FALSE;
- if (nIdx != (USHORT) -1 && nIdx != USHRT_MAX)
+ sal_uInt16 nIdx = GetIndex ( rShort );
+ sal_Bool bRet = sal_False;
+ if (nIdx != (sal_uInt16) -1 && nIdx != USHRT_MAX)
{
bRet = aNames[nIdx]->bIsOnlyTxt;
}
return bRet;
}
-BOOL SwXMLTextBlocks::IsOnlyTextBlock( USHORT nIdx ) const
+sal_Bool SwXMLTextBlocks::IsOnlyTextBlock( sal_uInt16 nIdx ) const
{
return aNames[nIdx]->bIsOnlyTxt;
}
-BOOL SwXMLTextBlocks::IsFileUCBStorage( const String & rFileName)
+sal_Bool SwXMLTextBlocks::IsFileUCBStorage( const String & rFileName)
{
String aName( rFileName );
INetURLObject aObj( aName );
@@ -581,7 +579,7 @@ BOOL SwXMLTextBlocks::IsFileUCBStorage( const String & rFileName)
}
SvStream * pStm = ::utl::UcbStreamHelper::CreateStream( aName, STREAM_STD_READ );
- BOOL bRet = UCBStorage::IsStorageFile( pStm );
+ sal_Bool bRet = UCBStorage::IsStorageFile( pStm );
delete pStm;
return bRet;
}
@@ -607,14 +605,14 @@ void SwXMLTextBlocks::GeneratePackageName ( const String& rShort, String& rPacka
}
}
-ULONG SwXMLTextBlocks::PutText( const String& rShort, const String& rName,
+sal_uLong SwXMLTextBlocks::PutText( const String& rShort, const String& rName,
const String& rText )
{
- ULONG nRes = 0;
+ sal_uLong nRes = 0;
aShort = rShort;
aLong = rName;
aCur = rText;
- SetIsTextOnly( aShort, TRUE );
+ SetIsTextOnly( aShort, sal_True );
GeneratePackageName( rShort, aPackageName );
ClearDoc();
nRes = PutBlockText( rShort, rName, rText, aPackageName );
diff --git a/sw/source/core/swg/SwXMLTextBlocks1.cxx b/sw/source/core/swg/SwXMLTextBlocks1.cxx
index f46a0b642db8..0aab2addfd7d 100644
--- a/sw/source/core/swg/SwXMLTextBlocks1.cxx
+++ b/sw/source/core/swg/SwXMLTextBlocks1.cxx
@@ -65,7 +65,7 @@ using ::xmloff::token::XML_BLOCK_LIST;
using ::xmloff::token::XML_UNFORMATTED_TEXT;
using ::xmloff::token::GetXMLToken;
-ULONG SwXMLTextBlocks::GetDoc( USHORT nIdx )
+sal_uLong SwXMLTextBlocks::GetDoc( sal_uInt16 nIdx )
{
String aFolderName ( GetPackageName ( nIdx ) );
@@ -159,7 +159,7 @@ ULONG SwXMLTextBlocks::GetDoc( USHORT nIdx )
// re throw ?
}
- bInfoChanged = FALSE;
+ bInfoChanged = sal_False;
MakeBlockText(aCur);
}
catch( uno::Exception& )
@@ -180,7 +180,7 @@ const struct SvEventDescription aAutotextEvents[] =
{ 0, NULL }
};
-ULONG SwXMLTextBlocks::GetMacroTable( USHORT nIdx,
+sal_uLong SwXMLTextBlocks::GetMacroTable( sal_uInt16 nIdx,
SvxMacroTableDtor& rMacroTbl,
sal_Bool bFileAlreadyOpen )
{
@@ -190,13 +190,13 @@ ULONG SwXMLTextBlocks::GetMacroTable( USHORT nIdx,
aLong = aNames[ nIdx ]->aLong;
aPackageName = aNames[ nIdx ]->aPackageName;
- ULONG nRet = 0;
+ sal_uLong nRet = 0;
// open stream in proper sub-storage
if( !bFileAlreadyOpen )
{
CloseFile();
- nRet = OpenFile ( TRUE );
+ nRet = OpenFile ( sal_True );
}
if ( 0 == nRet )
{
@@ -315,9 +315,9 @@ ULONG SwXMLTextBlocks::GetMacroTable( USHORT nIdx,
}
-ULONG SwXMLTextBlocks::GetBlockText( const String& rShort, String& rText )
+sal_uLong SwXMLTextBlocks::GetBlockText( const String& rShort, String& rText )
{
- ULONG n = 0;
+ sal_uLong n = 0;
sal_Bool bTextOnly = sal_True;
String aFolderName;
GeneratePackageName ( rShort, aFolderName );
@@ -394,7 +394,7 @@ ULONG SwXMLTextBlocks::GetBlockText( const String& rShort, String& rText )
return n;
}
-ULONG SwXMLTextBlocks::PutBlockText( const String& rShort, const String& ,
+sal_uLong SwXMLTextBlocks::PutBlockText( const String& rShort, const String& ,
const String& rText, const String& rPackageName )
{
GetIndex ( rShort );
@@ -420,7 +420,7 @@ ULONG SwXMLTextBlocks::PutBlockText( const String& rShort, const String& ,
uno::Reference < XInterface > xWriter (xServiceFactory->createInstance(
OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Writer"))));
DBG_ASSERT(xWriter.is(),"com.sun.star.xml.sax.Writer service missing");
- ULONG nRes = 0;
+ sal_uLong nRes = 0;
try
{
@@ -467,8 +467,8 @@ ULONG SwXMLTextBlocks::PutBlockText( const String& rShort, const String& ,
//TODO/LATER: error handling
/*
- ULONG nErr = xBlkRoot->GetError();
- ULONG nRes = 0;
+ sal_uLong nErr = xBlkRoot->GetError();
+ sal_uLong nRes = 0;
if( nErr == SVSTREAM_DISK_FULL )
nRes = ERR_W4W_WRITE_FULL;
else if( nErr != SVSTREAM_OK )
@@ -547,7 +547,7 @@ void SwXMLTextBlocks::ReadInfo( void )
}
void SwXMLTextBlocks::WriteInfo( void )
{
- if ( xBlkRoot.is() || 0 == OpenFile ( FALSE ) )
+ if ( xBlkRoot.is() || 0 == OpenFile ( sal_False ) )
{
uno::Reference< lang::XMultiServiceFactory > xServiceFactory =
comphelper::getProcessServiceFactory();
@@ -602,13 +602,13 @@ void SwXMLTextBlocks::WriteInfo( void )
{
}
- bInfoChanged = FALSE;
+ bInfoChanged = sal_False;
return;
}
}
-ULONG SwXMLTextBlocks::SetMacroTable(
- USHORT nIdx,
+sal_uLong SwXMLTextBlocks::SetMacroTable(
+ sal_uInt16 nIdx,
const SvxMacroTableDtor& rMacroTbl,
sal_Bool bFileAlreadyOpen )
{
@@ -618,7 +618,7 @@ ULONG SwXMLTextBlocks::SetMacroTable(
aPackageName = aNames[ nIdx ]->aPackageName;
// start XML autotext event export
- ULONG nRes = 0;
+ sal_uLong nRes = 0;
uno::Reference< lang::XMultiServiceFactory > xServiceFactory =
comphelper::getProcessServiceFactory();
@@ -638,7 +638,7 @@ ULONG SwXMLTextBlocks::SetMacroTable(
if( !bFileAlreadyOpen )
{
CloseFile(); // close (it may be open in read-only-mode)
- nRes = OpenFile ( FALSE );
+ nRes = OpenFile ( sal_False );
}
if ( 0 == nRes )
diff --git a/sw/source/core/swg/swblocks.cxx b/sw/source/core/swg/swblocks.cxx
index 4329e7345384..3c0409b764cc 100644
--- a/sw/source/core/swg/swblocks.cxx
+++ b/sw/source/core/swg/swblocks.cxx
@@ -63,9 +63,9 @@ SV_IMPL_OP_PTRARR_SORT( SwBlockNames, SwBlockName* );
// Hash-Code errechnen (muss nicht eindeutig sein)
-USHORT SwImpBlocks::Hash( const String& r )
+sal_uInt16 SwImpBlocks::Hash( const String& r )
{
- USHORT n = 0;
+ sal_uInt16 n = 0;
xub_StrLen nLen = r.Len();
if( nLen > 8 )
nLen = 8;
@@ -78,14 +78,14 @@ USHORT SwImpBlocks::Hash( const String& r )
SwBlockName::SwBlockName( const String& rShort, const String& rLong, long n )
: nPos( n ), aShort( rShort ), aLong( rLong ), aPackageName (rShort),
- bIsOnlyTxtFlagInit( FALSE ), bIsOnlyTxt( FALSE )
+ bIsOnlyTxtFlagInit( sal_False ), bIsOnlyTxt( sal_False )
{
nHashS = SwImpBlocks::Hash( rShort );
nHashL = SwImpBlocks::Hash( rLong );
}
SwBlockName::SwBlockName( const String& rShort, const String& rLong, const String& rPackageName)
: nPos( 0 ), aShort( rShort ), aLong( rLong ), aPackageName (rPackageName),
- bIsOnlyTxtFlagInit( FALSE ), bIsOnlyTxt( FALSE )
+ bIsOnlyTxtFlagInit( sal_False ), bIsOnlyTxt( sal_False )
{
nHashS = SwImpBlocks::Hash( rShort );
nHashL = SwImpBlocks::Hash( rLong );
@@ -107,9 +107,9 @@ short SwImpBlocks::GetFileType( const String& rFile )
}
-SwImpBlocks::SwImpBlocks( const String& rFile, BOOL )
- : aFile( rFile ), pDoc( 0 ), nCur( (USHORT)-1 ),
- bReadOnly( TRUE ), bInPutMuchBlocks( FALSE )
+SwImpBlocks::SwImpBlocks( const String& rFile, sal_Bool )
+ : aFile( rFile ), pDoc( 0 ), nCur( (sal_uInt16)-1 ),
+ bReadOnly( sal_True ), bInPutMuchBlocks( sal_False )
{
FStatHelper::GetModifiedDateTimeOfFile( rFile,
&aDateModified, &aTimeModified );
@@ -130,7 +130,7 @@ void SwImpBlocks::ClearDoc()
pDoc->ClearDoc();
}
-ULONG SwImpBlocks::GetDocForConversion( USHORT n )
+sal_uLong SwImpBlocks::GetDocForConversion( sal_uInt16 n )
{
return GetDoc( n );
}
@@ -147,42 +147,42 @@ SwPaM* SwImpBlocks::MakePaM()
}
-USHORT SwImpBlocks::GetCount() const
+sal_uInt16 SwImpBlocks::GetCount() const
{
return aNames.Count();
}
// Case Insensitive
-USHORT SwImpBlocks::GetIndex( const String& rShort ) const
+sal_uInt16 SwImpBlocks::GetIndex( const String& rShort ) const
{
String s( GetAppCharClass().upper( rShort ) );
- USHORT nHash = Hash( s );
- for( USHORT i = 0; i < aNames.Count(); i++ )
+ sal_uInt16 nHash = Hash( s );
+ for( sal_uInt16 i = 0; i < aNames.Count(); i++ )
{
SwBlockName* pName = aNames[ i ];
if( pName->nHashS == nHash
&& pName->aShort == s )
return i;
}
- return (USHORT) -1;
+ return (sal_uInt16) -1;
}
-USHORT SwImpBlocks::GetLongIndex( const String& rLong ) const
+sal_uInt16 SwImpBlocks::GetLongIndex( const String& rLong ) const
{
- USHORT nHash = Hash( rLong );
- for( USHORT i = 0; i < aNames.Count(); i++ )
+ sal_uInt16 nHash = Hash( rLong );
+ for( sal_uInt16 i = 0; i < aNames.Count(); i++ )
{
SwBlockName* pName = aNames[ i ];
if( pName->nHashL == nHash
&& pName->aLong == rLong )
return i;
}
- return (USHORT) -1;
+ return (sal_uInt16) -1;
}
-const String& SwImpBlocks::GetShortName( USHORT n ) const
+const String& SwImpBlocks::GetShortName( sal_uInt16 n ) const
{
if( n < aNames.Count() )
return aNames[ n ]->aShort;
@@ -190,14 +190,14 @@ const String& SwImpBlocks::GetShortName( USHORT n ) const
}
-const String& SwImpBlocks::GetLongName( USHORT n ) const
+const String& SwImpBlocks::GetLongName( sal_uInt16 n ) const
{
if( n < aNames.Count() )
return aNames[ n ]->aLong;
return aEmptyStr;
}
-const String& SwImpBlocks::GetPackageName( USHORT n ) const
+const String& SwImpBlocks::GetPackageName( sal_uInt16 n ) const
{
if( n < aNames.Count() )
return aNames[ n ]->aPackageName;
@@ -205,20 +205,20 @@ const String& SwImpBlocks::GetPackageName( USHORT n ) const
}
void SwImpBlocks::AddName( const String& rShort, const String& rLong,
- BOOL bOnlyTxt )
+ sal_Bool bOnlyTxt )
{
- USHORT nIdx = GetIndex( rShort );
- if( nIdx != (USHORT) -1 )
+ sal_uInt16 nIdx = GetIndex( rShort );
+ if( nIdx != (sal_uInt16) -1 )
aNames.DeleteAndDestroy( nIdx );
SwBlockName* pNew = new SwBlockName( rShort, rLong, 0L );
- pNew->bIsOnlyTxtFlagInit = TRUE;
+ pNew->bIsOnlyTxtFlagInit = sal_True;
pNew->bIsOnlyTxt = bOnlyTxt;
aNames.C40_PTR_INSERT( SwBlockName, pNew );
}
-BOOL SwImpBlocks::IsFileChanged() const
+sal_Bool SwImpBlocks::IsFileChanged() const
{
Date aTempDateModified( aDateModified );
Time aTempTimeModified( aTimeModified );
@@ -235,25 +235,25 @@ void SwImpBlocks::Touch()
&aDateModified, &aTimeModified );
}
-BOOL SwImpBlocks::IsOnlyTextBlock( const String& ) const
+sal_Bool SwImpBlocks::IsOnlyTextBlock( const String& ) const
{
- return FALSE;
+ return sal_False;
}
-ULONG SwImpBlocks::GetMacroTable( USHORT, SvxMacroTableDtor&, sal_Bool )
+sal_uLong SwImpBlocks::GetMacroTable( sal_uInt16, SvxMacroTableDtor&, sal_Bool )
{
return 0;
}
-ULONG SwImpBlocks::SetMacroTable( USHORT ,
+sal_uLong SwImpBlocks::SetMacroTable( sal_uInt16 ,
const SvxMacroTableDtor& , sal_Bool )
{
return 0;
}
-BOOL SwImpBlocks::PutMuchEntries( BOOL )
+sal_Bool SwImpBlocks::PutMuchEntries( sal_Bool )
{
- return FALSE;
+ return sal_False;
}
////////////////////////////////////////////////////////////////////////////
@@ -293,20 +293,20 @@ void SwTextBlocks::SetName( const String& r )
}
-BOOL SwTextBlocks::IsOld() const
+sal_Bool SwTextBlocks::IsOld() const
{
if (pImp)
{
short nType = pImp->GetFileType();
if (SWBLK_SW3 == nType || SWBLK_SW2 == nType )
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
/*
-ULONG SwTextBlocks::ConvertToNew()
+sal_uLong SwTextBlocks::ConvertToNew()
{
// Wir nehmen die aktuelle Datei, benennen diese in .BAK um
// und kreieren den neuen Storage
@@ -318,7 +318,7 @@ ULONG SwTextBlocks::ConvertToNew()
Sw3TextBlocks *pThree = NULL;
SwImpBlocks *pOld = NULL;
- pImp->nCur = (USHORT) -1;
+ pImp->nCur = (sal_uInt16) -1;
String aName( pImp->aFile );
delete pImp; pImp = NULL;
// Jetzt wird umbenannt
@@ -329,7 +329,7 @@ ULONG SwTextBlocks::ConvertToNew()
String aOld( aOldFull.GetMainURL( INetURLObject::NO_DECODE ) );
String aNew( aNewFull.GetMainURL( INetURLObject::NO_DECODE ) );
- BOOL bError = !SWUnoHelper::UCB_CopyFile( aNew, aOld, TRUE );
+ sal_Bool bError = !SWUnoHelper::UCB_CopyFile( aNew, aOld, sal_True );
if( bError )
{
if (nType == SWBLK_SW2)
@@ -360,23 +360,23 @@ ULONG SwTextBlocks::ConvertToNew()
}
else
{
- nErr = pThree->OpenFile ( TRUE );
+ nErr = pThree->OpenFile ( sal_True );
// Within this call, Sw3IoImp::SetDoc calls RemoveLink
// on the old document, and deletes it if the
// ref count is now zero
pThree->SetDoc ( pNew->pDoc );
pOld->pDoc->AddLink();
}
- if( !nErr && 0 == ( nErr = pNew->OpenFile( FALSE )) )
+ if( !nErr && 0 == ( nErr = pNew->OpenFile( sal_False )) )
{
- nErr = pNew->SetConvertMode( TRUE );
+ nErr = pNew->SetConvertMode( sal_True );
// jetzt werden die Bausteine einfach umkopiert!
if( !nErr )
{
if (SWBLK_SW2 == nType)
pTwo->StatLineStartPercent();
- USHORT nCount = pOld->GetCount();
- for( USHORT i = 0; i < nCount; i++ )
+ sal_uInt16 nCount = pOld->GetCount();
+ for( sal_uInt16 i = 0; i < nCount; i++ )
{
pNew->ClearDoc();
String aShort( pOld->GetShortName( i ) );
@@ -418,7 +418,7 @@ ULONG SwTextBlocks::ConvertToNew()
::EndProgress( pOld->pDoc->GetDocShell() );
}
if( !nErr )
- nErr = pNew->SetConvertMode( FALSE );
+ nErr = pNew->SetConvertMode( sal_False );
}
if ( SWBLK_SW3 == nType )
{
@@ -441,7 +441,7 @@ ULONG SwTextBlocks::ConvertToNew()
{
delete pOld; delete pNew;
SWUnoHelper::UCB_DeleteFile( aNew );
- SWUnoHelper::UCB_CopyFile( aOld, aNew, TRUE );
+ SWUnoHelper::UCB_CopyFile( aOld, aNew, sal_True );
if ( SWBLK_SW2 == nType )
pImp = new Sw2TextBlocks( aOld );
else
@@ -455,25 +455,25 @@ ULONG SwTextBlocks::ConvertToNew()
} */
-USHORT SwTextBlocks::GetCount() const
+sal_uInt16 SwTextBlocks::GetCount() const
{
return pImp ? pImp->GetCount() : 0;
}
-USHORT SwTextBlocks::GetIndex( const String& r ) const
+sal_uInt16 SwTextBlocks::GetIndex( const String& r ) const
{
- return pImp ? pImp->GetIndex( r ) : (USHORT) -1;
+ return pImp ? pImp->GetIndex( r ) : (sal_uInt16) -1;
}
-USHORT SwTextBlocks::GetLongIndex( const String& r ) const
+sal_uInt16 SwTextBlocks::GetLongIndex( const String& r ) const
{
- return pImp ? (USHORT)(pImp->GetLongIndex( r )) : (USHORT) -1;
+ return pImp ? (sal_uInt16)(pImp->GetLongIndex( r )) : (sal_uInt16) -1;
}
-const String& SwTextBlocks::GetShortName( USHORT n ) const
+const String& SwTextBlocks::GetShortName( sal_uInt16 n ) const
{
if( pImp )
return pImp->GetShortName( n );
@@ -481,7 +481,7 @@ const String& SwTextBlocks::GetShortName( USHORT n ) const
}
-const String& SwTextBlocks::GetLongName( USHORT n ) const
+const String& SwTextBlocks::GetLongName( sal_uInt16 n ) const
{
if( pImp )
return pImp->GetLongName( n );
@@ -489,34 +489,34 @@ const String& SwTextBlocks::GetLongName( USHORT n ) const
}
-BOOL SwTextBlocks::Delete( USHORT n )
+sal_Bool SwTextBlocks::Delete( sal_uInt16 n )
{
if( pImp && !pImp->bInPutMuchBlocks )
{
if( pImp->IsFileChanged() )
nErr = ERR_TXTBLOCK_NEWFILE_ERROR;
- else if( 0 == (nErr = pImp->OpenFile( FALSE ) ))
+ else if( 0 == (nErr = pImp->OpenFile( sal_False ) ))
{
nErr = pImp->Delete( n );
if( !nErr )
pImp->aNames.DeleteAndDestroy( n );
if( n == pImp->nCur )
- pImp->nCur = (USHORT) -1;
+ pImp->nCur = (sal_uInt16) -1;
if( !nErr )
nErr = pImp->MakeBlockList();
}
pImp->CloseFile();
pImp->Touch();
- return BOOL( nErr == 0 );
+ return sal_Bool( nErr == 0 );
}
- return FALSE;
+ return sal_False;
}
-USHORT SwTextBlocks::Rename( USHORT n, const String* s, const String* l )
+sal_uInt16 SwTextBlocks::Rename( sal_uInt16 n, const String* s, const String* l )
{
- USHORT nIdx = (USHORT)-1;
+ sal_uInt16 nIdx = (sal_uInt16)-1;
if( pImp && !pImp->bInPutMuchBlocks )
{
pImp->nCur = nIdx;
@@ -528,19 +528,19 @@ USHORT SwTextBlocks::Rename( USHORT n, const String* s, const String* l )
if( !aNew.Len() )
{
ASSERT( !this, "Kein Kurzname in Rename angegeben" );
- nErr = ERR_SWG_INTERNAL_ERROR; return (USHORT) -1;
+ nErr = ERR_SWG_INTERNAL_ERROR; return (sal_uInt16) -1;
}
if( pImp->IsFileChanged() )
nErr = ERR_TXTBLOCK_NEWFILE_ERROR;
- else if( 0 == ( nErr = pImp->OpenFile( FALSE )))
+ else if( 0 == ( nErr = pImp->OpenFile( sal_False )))
{
// Vorher den neuen Eintrag in die Liste setzen!
GetAppCharClass().toUpper( aNew );
nErr = pImp->Rename( n, aNew, aLong );
if( !nErr )
{
- BOOL bOnlyTxt = pImp->aNames[ n ]->bIsOnlyTxt;
+ sal_Bool bOnlyTxt = pImp->aNames[ n ]->bIsOnlyTxt;
pImp->aNames.DeleteAndDestroy( n );
pImp->AddName( aNew, aLong, bOnlyTxt );
nErr = pImp->MakeBlockList();
@@ -554,15 +554,15 @@ USHORT SwTextBlocks::Rename( USHORT n, const String* s, const String* l )
return nIdx;
}
-ULONG SwTextBlocks::CopyBlock( SwTextBlocks& rSource, String& rSrcShort,
+sal_uLong SwTextBlocks::CopyBlock( SwTextBlocks& rSource, String& rSrcShort,
const String& rLong )
{
- BOOL bIsOld = FALSE;
+ sal_Bool bIsOld = sal_False;
if (rSource.pImp)
{
short nType = rSource.pImp->GetFileType();
if (SWBLK_SW2 == nType || SWBLK_SW3 == nType )
- bIsOld = TRUE;
+ bIsOld = sal_True;
}
if( bIsOld ) //rSource.IsOld() )
nErr = ERR_SWG_OLD_GLOSSARY;
@@ -573,29 +573,29 @@ ULONG SwTextBlocks::CopyBlock( SwTextBlocks& rSource, String& rSrcShort,
return nErr;
}
-BOOL SwTextBlocks::BeginGetDoc( USHORT n )
+sal_Bool SwTextBlocks::BeginGetDoc( sal_uInt16 n )
{
if( pImp && !pImp->bInPutMuchBlocks )
{
// diese Optimierierung darf es nicht mehr geben. OLE-Objecte muessen auf
// ihre SubStorages zugreifem koennen!
// if( n == pImp->nCur )
-// return TRUE;
+// return sal_True;
if( pImp->IsFileChanged() )
nErr = ERR_TXTBLOCK_NEWFILE_ERROR;
- else if( 0 == ( nErr = pImp->OpenFile( TRUE )))
+ else if( 0 == ( nErr = pImp->OpenFile( sal_True )))
{
pImp->ClearDoc();
nErr = pImp->GetDoc( n );
if( nErr )
- pImp->nCur = (USHORT)-1;
+ pImp->nCur = (sal_uInt16)-1;
else
pImp->nCur = n;
}
- return BOOL( nErr == 0 );
+ return sal_Bool( nErr == 0 );
}
- return FALSE;
+ return sal_False;
}
@@ -606,17 +606,17 @@ void SwTextBlocks::EndGetDoc()
}
-BOOL SwTextBlocks::BeginPutDoc( const String& s, const String& l )
+sal_Bool SwTextBlocks::BeginPutDoc( const String& s, const String& l )
{
if( pImp )
{
- BOOL bOk = pImp->bInPutMuchBlocks;
+ sal_Bool bOk = pImp->bInPutMuchBlocks;
if( !bOk )
{
if( pImp->IsFileChanged() )
nErr = ERR_TXTBLOCK_NEWFILE_ERROR;
else
- nErr = pImp->OpenFile( FALSE );
+ nErr = pImp->OpenFile( sal_False );
bOk = 0 == nErr;
}
if( bOk )
@@ -632,16 +632,16 @@ BOOL SwTextBlocks::BeginPutDoc( const String& s, const String& l )
}
-USHORT SwTextBlocks::PutDoc()
+sal_uInt16 SwTextBlocks::PutDoc()
{
- USHORT nIdx = (USHORT)-1;
+ sal_uInt16 nIdx = (sal_uInt16)-1;
if( pImp )
{
nErr = pImp->PutDoc();
if( !nErr )
{
pImp->nCur = GetIndex( pImp->aShort );
- if( pImp->nCur != (USHORT) -1 )
+ if( pImp->nCur != (sal_uInt16) -1 )
pImp->aNames[ pImp->nCur ]->aLong = pImp->aLong;
else
{
@@ -661,19 +661,19 @@ USHORT SwTextBlocks::PutDoc()
return nIdx;
}
-USHORT SwTextBlocks::PutText( const String& rShort, const String& rName,
+sal_uInt16 SwTextBlocks::PutText( const String& rShort, const String& rName,
const String& rTxt )
{
- USHORT nIdx = (USHORT) -1;
+ sal_uInt16 nIdx = (sal_uInt16) -1;
if( pImp )
{
- BOOL bOk = pImp->bInPutMuchBlocks;
+ sal_Bool bOk = pImp->bInPutMuchBlocks;
if( !bOk )
{
if( pImp->IsFileChanged() )
nErr = ERR_TXTBLOCK_NEWFILE_ERROR;
else
- nErr = pImp->OpenFile( FALSE );
+ nErr = pImp->OpenFile( sal_False );
bOk = 0 == nErr;
}
if( bOk )
@@ -681,15 +681,15 @@ USHORT SwTextBlocks::PutText( const String& rShort, const String& rName,
String aNew( rShort );
GetAppCharClass().toUpper( aNew );
nErr = pImp->PutText( aNew, rName, rTxt );
- pImp->nCur = (USHORT) -1;
+ pImp->nCur = (sal_uInt16) -1;
if( !nErr )
{
nIdx = GetIndex( pImp->aShort );
- if( nIdx != (USHORT) -1 )
+ if( nIdx != (sal_uInt16) -1 )
pImp->aNames[ nIdx ]->aLong = rName;
else
{
- pImp->AddName( pImp->aShort, rName, TRUE );
+ pImp->AddName( pImp->aShort, rName, sal_True );
nIdx = pImp->GetIndex( pImp->aShort );
}
if( !pImp->bInPutMuchBlocks )
@@ -718,7 +718,7 @@ void SwTextBlocks::ClearDoc()
{
if( pImp )
pImp->ClearDoc();
- pImp->nCur = (USHORT) -1;
+ pImp->nCur = (sal_uInt16) -1;
}
@@ -728,22 +728,22 @@ const String& SwTextBlocks::GetFileName() const
}
-BOOL SwTextBlocks::IsReadOnly() const
+sal_Bool SwTextBlocks::IsReadOnly() const
{
return pImp->bReadOnly;
}
-BOOL SwTextBlocks::IsOnlyTextBlock( USHORT nIdx ) const
+sal_Bool SwTextBlocks::IsOnlyTextBlock( sal_uInt16 nIdx ) const
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pImp && !pImp->bInPutMuchBlocks )
{
SwBlockName* pBlkNm = pImp->aNames[ nIdx ];
if( !pBlkNm->bIsOnlyTxtFlagInit &&
- !pImp->IsFileChanged() && !pImp->OpenFile( TRUE ) )
+ !pImp->IsFileChanged() && !pImp->OpenFile( sal_True ) )
{
pBlkNm->bIsOnlyTxt = pImp->IsOnlyTextBlock( pBlkNm->aShort );
- pBlkNm->bIsOnlyTxtFlagInit = TRUE;
+ pBlkNm->bIsOnlyTxtFlagInit = sal_True;
pImp->CloseFile();
}
bRet = pBlkNm->bIsOnlyTxt;
@@ -751,9 +751,9 @@ BOOL SwTextBlocks::IsOnlyTextBlock( USHORT nIdx ) const
return bRet;
}
-BOOL SwTextBlocks::IsOnlyTextBlock( const String& rShort ) const
+sal_Bool SwTextBlocks::IsOnlyTextBlock( const String& rShort ) const
{
- USHORT nIdx = pImp->GetIndex( rShort );
+ sal_uInt16 nIdx = pImp->GetIndex( rShort );
if( USHRT_MAX != nIdx )
{
if( pImp->aNames[ nIdx ]->bIsOnlyTxtFlagInit )
@@ -762,38 +762,38 @@ BOOL SwTextBlocks::IsOnlyTextBlock( const String& rShort ) const
}
ASSERT( !this, "ungueltiger Name" );
- return FALSE;
+ return sal_False;
}
-BOOL SwTextBlocks::GetMacroTable( USHORT nIdx, SvxMacroTableDtor& rMacroTbl )
+sal_Bool SwTextBlocks::GetMacroTable( sal_uInt16 nIdx, SvxMacroTableDtor& rMacroTbl )
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
if ( pImp && !pImp->bInPutMuchBlocks )
bRet = ( 0 == pImp->GetMacroTable( nIdx, rMacroTbl ) );
return bRet;
}
-BOOL SwTextBlocks::SetMacroTable( USHORT nIdx,
+sal_Bool SwTextBlocks::SetMacroTable( sal_uInt16 nIdx,
const SvxMacroTableDtor& rMacroTbl )
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
if ( pImp && !pImp->bInPutMuchBlocks )
bRet = ( 0 == pImp->SetMacroTable( nIdx, rMacroTbl ) );
return bRet;
}
-BOOL SwTextBlocks::StartPutMuchBlockEntries()
+sal_Bool SwTextBlocks::StartPutMuchBlockEntries()
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( !IsOld() && pImp )
- bRet = pImp->PutMuchEntries( TRUE );
+ bRet = pImp->PutMuchEntries( sal_True );
return bRet;
}
void SwTextBlocks::EndPutMuchBlockEntries()
{
if( pImp )
- pImp->PutMuchEntries( FALSE );
+ pImp->PutMuchEntries( sal_False );
}
/*-- 20.09.2004 10:25:33---------------------------------------------------
diff --git a/sw/source/core/table/swnewtable.cxx b/sw/source/core/table/swnewtable.cxx
index 7c3bc0d44f28..e351aede87d4 100644
--- a/sw/source/core/table/swnewtable.cxx
+++ b/sw/source/core/table/swnewtable.cxx
@@ -32,13 +32,14 @@
#include <tblsel.hxx>
#include <tblrwcl.hxx>
#include <node.hxx>
-#include <undobj.hxx>
+#include <UndoTable.hxx>
#include <pam.hxx>
#include <frmfmt.hxx>
#include <frmatr.hxx>
#include <cellfrm.hxx>
#include <fmtfsize.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <vector>
#include <set>
#include <list>
@@ -92,18 +93,18 @@ the boxes to remove
@param pUndo
the undo object to notify, maybe empty
-@return TRUE for compatibility reasons with OldMerge(..)
+@return sal_True for compatibility reasons with OldMerge(..)
*/
-BOOL SwTable::NewMerge( SwDoc* pDoc, const SwSelBoxes& rBoxes,
+sal_Bool SwTable::NewMerge( SwDoc* pDoc, const SwSelBoxes& rBoxes,
const SwSelBoxes& rMerged, SwTableBox*, SwUndoTblMerge* pUndo )
{
if( pUndo )
pUndo->SetSelBoxes( rBoxes );
- DeleteSel( pDoc, rBoxes, &rMerged, 0, TRUE, TRUE );
+ DeleteSel( pDoc, rBoxes, &rMerged, 0, sal_True, sal_True );
CHECK_TABLE( *this )
- return TRUE;
+ return sal_True;
}
/** lcl_CheckMinMax helps evaluating (horizontal) min/max of boxes
@@ -129,7 +130,7 @@ if bSet is true, rMin and rMax will be set to the left and right border of the b
*/
-void lcl_CheckMinMax( long& rMin, long& rMax, const SwTableLine& rLine, USHORT nCheck, bool bSet )
+void lcl_CheckMinMax( long& rMin, long& rMax, const SwTableLine& rLine, sal_uInt16 nCheck, bool bSet )
{
++nCheck;
if( rLine.GetTabBoxes().Count() < nCheck )
@@ -140,7 +141,7 @@ void lcl_CheckMinMax( long& rMin, long& rMax, const SwTableLine& rLine, USHORT n
long nNew = 0; // will be the right border of the current box
long nWidth = 0; // the width of the current box
- for( USHORT nCurrBox = 0; nCurrBox < nCheck; ++nCurrBox )
+ for( sal_uInt16 nCurrBox = 0; nCurrBox < nCheck; ++nCurrBox )
{
SwTableBox* pBox = rLine.GetTabBoxes()[nCurrBox];
ASSERT( pBox, "Missing table box" );
@@ -173,8 +174,8 @@ long lcl_Box2LeftBorder( const SwTableBox& rBox )
return 0;
long nLeft = 0;
const SwTableLine &rLine = *rBox.GetUpper();
- USHORT nCount = rLine.GetTabBoxes().Count();
- for( USHORT nCurrBox = 0; nCurrBox < nCount; ++nCurrBox )
+ sal_uInt16 nCount = rLine.GetTabBoxes().Count();
+ for( sal_uInt16 nCurrBox = 0; nCurrBox < nCount; ++nCurrBox )
{
SwTableBox* pBox = rLine.GetTabBoxes()[nCurrBox];
ASSERT( pBox, "Missing table box" );
@@ -207,8 +208,8 @@ SwTableBox* lcl_LeftBorder2Box( long nLeft, const SwTableLine* pLine )
if( !pLine )
return 0;
long nCurrLeft = 0;
- USHORT nCount = pLine->GetTabBoxes().Count();
- for( USHORT nCurrBox = 0; nCurrBox < nCount; ++nCurrBox )
+ sal_uInt16 nCount = pLine->GetTabBoxes().Count();
+ for( sal_uInt16 nCurrBox = 0; nCurrBox < nCount; ++nCurrBox )
{
SwTableBox* pBox = pLine->GetTabBoxes()[nCurrBox];
ASSERT( pBox, "Missing table box" );
@@ -253,7 +254,7 @@ false is also needed for deleted rows
*/
void lcl_ChangeRowSpan( const SwTable& rTable, const long nDiff,
- USHORT nRowIdx, const bool bSingle )
+ sal_uInt16 nRowIdx, const bool bSingle )
{
if( !nDiff || nRowIdx >= rTable.GetTabLines().Count() )
return;
@@ -271,8 +272,8 @@ void lcl_ChangeRowSpan( const SwTable& rTable, const long nDiff,
bGoOn = false; // will be set to true if we found a non-master cell
// which has to be manipulated => we have to chekc the previous row, too.
const SwTableLine* pLine = rTable.GetTabLines()[ nRowIdx ];
- USHORT nBoxCount = pLine->GetTabBoxes().Count();
- for( USHORT nCurrBox = 0; nCurrBox < nBoxCount; ++nCurrBox )
+ sal_uInt16 nBoxCount = pLine->GetTabBoxes().Count();
+ for( sal_uInt16 nCurrBox = 0; nCurrBox < nBoxCount; ++nCurrBox )
{
long nRowSpan = pLine->GetTabBoxes()[nCurrBox]->getRowSpan();
long nAbsSpan = nRowSpan > 0 ? nRowSpan : -nRowSpan;
@@ -334,16 +335,16 @@ SwBoxSelection* SwTable::CollectBoxSelection( const SwPaM& rPam ) const
if( !pStartNd || !pEndNd || pStartNd == pEndNd )
return 0;
- USHORT nLines = aLines.Count();
- USHORT nTop = 0, nBottom = 0;
+ sal_uInt16 nLines = aLines.Count();
+ sal_uInt16 nTop = 0, nBottom = 0;
long nMin = 0, nMax = 0;
int nFound = 0;
- for( USHORT nRow = 0; nFound < 2 && nRow < nLines; ++nRow )
+ for( sal_uInt16 nRow = 0; nFound < 2 && nRow < nLines; ++nRow )
{
SwTableLine* pLine = aLines[nRow];
ASSERT( pLine, "Missing table line" );
- USHORT nCols = pLine->GetTabBoxes().Count();
- for( USHORT nCol = 0; nCol < nCols; ++nCol )
+ sal_uInt16 nCols = pLine->GetTabBoxes().Count();
+ for( sal_uInt16 nCol = 0; nCol < nCols; ++nCol )
{
SwTableBox* pBox = pLine->GetTabBoxes()[nCol];
ASSERT( pBox, "Missing table box" );
@@ -373,12 +374,12 @@ SwBoxSelection* SwTable::CollectBoxSelection( const SwPaM& rPam ) const
SwBoxSelection* pRet = new SwBoxSelection();
std::list< std::pair< SwTableBox*, long > > aNewWidthList;
- USHORT nCheckBottom = nBottom;
+ sal_uInt16 nCheckBottom = nBottom;
long nLeftSpan = 0;
long nRightSpan = 0;
long nLeftSpanCnt = 0;
long nRightSpanCnt = 0;
- for( USHORT nRow = nTop; nRow <= nBottom && bOkay; ++nRow )
+ for( sal_uInt16 nRow = nTop; nRow <= nBottom && bOkay; ++nRow )
{
SwTableLine* pLine = aLines[nRow];
ASSERT( pLine, "Missing table line" );
@@ -386,8 +387,8 @@ SwBoxSelection* SwTable::CollectBoxSelection( const SwPaM& rPam ) const
long nLeft = 0;
long nRight = 0;
long nRowSpan = 1;
- USHORT nCount = pLine->GetTabBoxes().Count();
- for( USHORT nCurrBox = 0; nCurrBox < nCount; ++nCurrBox )
+ sal_uInt16 nCount = pLine->GetTabBoxes().Count();
+ for( sal_uInt16 nCurrBox = 0; nCurrBox < nCount; ++nCurrBox )
{
SwTableBox* pBox = pLine->GetTabBoxes()[nCurrBox];
ASSERT( pBox, "Missing table box" );
@@ -449,9 +450,9 @@ SwBoxSelection* SwTable::CollectBoxSelection( const SwPaM& rPam ) const
break;
}
if( nRowSpan > 1 && nRow + nRowSpan - 1 > nBottom )
- nBottom = nRow + (USHORT)nRowSpan - 1;
+ nBottom = nRow + (sal_uInt16)nRowSpan - 1;
if( nRowSpan < -1 && nRow - nRowSpan - 1 > nBottom )
- nBottom = (USHORT)(nRow - nRowSpan - 1);
+ nBottom = (sal_uInt16)(nRow - nRowSpan - 1);
if( nRightSpanCnt && nRight == nMax )
bOkay = false;
}
@@ -486,9 +487,9 @@ SwBoxSelection* SwTable::CollectBoxSelection( const SwPaM& rPam ) const
{
long nTmpSpan = pInnerBox->getRowSpan();
if( nTmpSpan > 1 )
- nBottom += (USHORT)nTmpSpan - 1;
+ nBottom += (sal_uInt16)nTmpSpan - 1;
else if( nTmpSpan < -1 )
- nBottom = (USHORT)( nBottom - nTmpSpan - 1 );
+ nBottom = (sal_uInt16)( nBottom - nTmpSpan - 1 );
}
SwTableBox* pOuterBox = pLeftBox;
do
@@ -498,7 +499,7 @@ SwBoxSelection* SwTable::CollectBoxSelection( const SwPaM& rPam ) const
long nOutSpan = pOuterBox->getRowSpan();
if( nOutSpan != 1 )
{
- USHORT nCheck = nRow;
+ sal_uInt16 nCheck = nRow;
if( nOutSpan < 0 )
{
const SwTableBox& rBox =
@@ -536,7 +537,7 @@ SwBoxSelection* SwTable::CollectBoxSelection( const SwPaM& rPam ) const
nRightSpanCnt = nOutSpan;
}
}
- nCheck += (USHORT)nOutSpan - 1;
+ nCheck += (sal_uInt16)nOutSpan - 1;
if( nCheck > nCheckBottom )
nCheckBottom = nCheck;
}
@@ -609,19 +610,19 @@ void lcl_InvalidateCellFrm( const SwTableBox& rBox )
when a selection of cells is given and returns the average cell widths
*/
-long lcl_InsertPosition( SwTable &rTable, std::vector<USHORT>& rInsPos,
- const SwSelBoxes& rBoxes, BOOL bBehind )
+long lcl_InsertPosition( SwTable &rTable, std::vector<sal_uInt16>& rInsPos,
+ const SwSelBoxes& rBoxes, sal_Bool bBehind )
{
sal_Int32 nAddWidth = 0;
long nCount = 0;
- for( USHORT j = 0; j < rBoxes.Count(); ++j )
+ for( sal_uInt16 j = 0; j < rBoxes.Count(); ++j )
{
SwTableBox *pBox = rBoxes[j];
SwTableLine* pLine = pBox->GetUpper();
long nWidth = rBoxes[j]->GetFrmFmt()->GetFrmSize().GetWidth();
nAddWidth += nWidth;
- USHORT nCurrBox = pLine->GetTabBoxes().C40_GETPOS(SwTableBox, pBox );
- USHORT nCurrLine = rTable.GetTabLines().C40_GETPOS(SwTableLine, pLine );
+ sal_uInt16 nCurrBox = pLine->GetTabBoxes().C40_GETPOS(SwTableBox, pBox );
+ sal_uInt16 nCurrLine = rTable.GetTabLines().C40_GETPOS(SwTableLine, pLine );
ASSERT( nCurrLine != USHRT_MAX, "Time to say Good-Bye.." );
if( rInsPos[ nCurrLine ] == USHRT_MAX )
{
@@ -655,18 +656,18 @@ insertion behind (true) or before (false) the selected boxes
*/
-BOOL SwTable::NewInsertCol( SwDoc* pDoc, const SwSelBoxes& rBoxes,
- USHORT nCnt, BOOL bBehind )
+sal_Bool SwTable::NewInsertCol( SwDoc* pDoc, const SwSelBoxes& rBoxes,
+ sal_uInt16 nCnt, sal_Bool bBehind )
{
if( !aLines.Count() || !nCnt )
- return FALSE;
+ return sal_False;
CHECK_TABLE( *this )
long nNewBoxWidth = 0;
- std::vector< USHORT > aInsPos( aLines.Count(), USHRT_MAX );
+ std::vector< sal_uInt16 > aInsPos( aLines.Count(), USHRT_MAX );
{ // Calculation of the insert positions and the width of the new boxes
sal_uInt64 nTableWidth = 0;
- for( USHORT i = 0; i < aLines[0]->GetTabBoxes().Count(); ++i )
+ for( sal_uInt16 i = 0; i < aLines[0]->GetTabBoxes().Count(); ++i )
nTableWidth += aLines[0]->GetTabBoxes()[i]->GetFrmFmt()->GetFrmSize().GetWidth();
// Fill the vector of insert positions and the (average) width to insert
@@ -681,12 +682,12 @@ BOOL SwTable::NewInsertCol( SwDoc* pDoc, const SwSelBoxes& rBoxes,
nAddWidth *= nCnt; // we have to insert nCnt boxes per line
sal_uInt64 nResultingWidth = nAddWidth + nTableWidth;
if( !nResultingWidth )
- return FALSE;
+ return sal_False;
nAddWidth = (nAddWidth * nTableWidth) / nResultingWidth;
nNewBoxWidth = long( nAddWidth / nCnt ); // Rounding
nAddWidth = nNewBoxWidth * nCnt; // Rounding
if( !nAddWidth || nAddWidth >= nTableWidth )
- return FALSE;
+ return sal_False;
AdjustWidths( static_cast< long >(nTableWidth), static_cast< long >(nTableWidth - nAddWidth) );
}
@@ -697,13 +698,13 @@ BOOL SwTable::NewInsertCol( SwDoc* pDoc, const SwSelBoxes& rBoxes,
SwTableNode* pTblNd = GetTableNode();
std::vector<SwTableBoxFmt*> aInsFormat( nCnt, 0 );
- USHORT nLastLine = USHRT_MAX;
+ sal_uInt16 nLastLine = USHRT_MAX;
long nLastRowSpan = 1;
- for( USHORT i = 0; i < aLines.Count(); ++i )
+ for( sal_uInt16 i = 0; i < aLines.Count(); ++i )
{
SwTableLine* pLine = aLines[ i ];
- USHORT nInsPos = aInsPos[i];
+ sal_uInt16 nInsPos = aInsPos[i];
ASSERT( nInsPos != USHRT_MAX, "Didn't found insert position" );
SwTableBox* pBox = pLine->GetTabBoxes()[ nInsPos ];
if( bBehind )
@@ -720,10 +721,10 @@ BOOL SwTable::NewInsertCol( SwDoc* pDoc, const SwSelBoxes& rBoxes,
while( nLastLine < i )
{
SwTableLine* pTmpLine = aLines[ nLastLine ];
- USHORT nTmpPos = aInsPos[nLastLine];
+ sal_uInt16 nTmpPos = aInsPos[nLastLine];
if( bBehind )
++nTmpPos;
- for( USHORT j = 0; j < nCnt; ++j )
+ for( sal_uInt16 j = 0; j < nCnt; ++j )
pTmpLine->GetTabBoxes()[nTmpPos+j]->setRowSpan( nDiff );
if( nDiff > 0 )
nDiff = -nDiff;
@@ -748,7 +749,7 @@ BOOL SwTable::NewInsertCol( SwDoc* pDoc, const SwSelBoxes& rBoxes,
pNoRightBorder = new SvxBoxItem( aSelBoxItem );
pNoRightBorder->SetLine( 0, BOX_LINE_RIGHT );
}
- for( USHORT j = 0; j < nCnt; ++j )
+ for( sal_uInt16 j = 0; j < nCnt; ++j )
{
SwTableBox *pCurrBox = pLine->GetTabBoxes()[nInsPos+j];
if( bNewSpan )
@@ -779,14 +780,14 @@ BOOL SwTable::NewInsertCol( SwDoc* pDoc, const SwSelBoxes& rBoxes,
{
const SwTableBoxes &rTabBoxes = aLines[0]->GetTabBoxes();
long nNewWidth = 0;
- for( USHORT i = 0; i < rTabBoxes.Count(); ++i )
+ for( sal_uInt16 i = 0; i < rTabBoxes.Count(); ++i )
nNewWidth += rTabBoxes[i]->GetFrmFmt()->GetFrmSize().GetWidth();
ASSERT( nNewWidth > 0, "Very small" );
}
#endif
CHECK_TABLE( *this )
- return TRUE;
+ return sal_True;
}
/** SwTable::PrepareMerge(..) some preparation for the coming Merge(..)
@@ -846,7 +847,7 @@ bool SwTable::PrepareMerge( const SwPaM& rPam, SwSelBoxes& rBoxes,
SwPosition aInsPos( *pMergeBox->GetSttNd()->EndOfSectionNode() );
SwPaM aChkPam( aInsPos );
// The number of lines in the selection rectangle: nLineCount
- const USHORT nLineCount = USHORT(pSel->aBoxes.size());
+ const sal_uInt16 nLineCount = sal_uInt16(pSel->aBoxes.size());
// BTW: nLineCount is the rowspan of the new master cell
long nRowSpan = nLineCount;
// We will need the first and last line of the selection
@@ -854,13 +855,13 @@ bool SwTable::PrepareMerge( const SwPaM& rPam, SwSelBoxes& rBoxes,
SwTableLine* pFirstLn = 0;
SwTableLine* pLastLn = 0;
// Iteration over the lines of the selection...
- for( USHORT nCurrLine = 0; nCurrLine < nLineCount; ++nCurrLine )
+ for( sal_uInt16 nCurrLine = 0; nCurrLine < nLineCount; ++nCurrLine )
{
// The selected boxes in the current line
const SwSelBoxes* pBoxes = pSel->aBoxes[ nCurrLine ];
- USHORT nColCount = pBoxes->Count();
+ sal_uInt16 nColCount = pBoxes->Count();
// Iteration over the selected cell in the current row
- for( USHORT nCurrCol = 0; nCurrCol < nColCount; ++nCurrCol )
+ for( sal_uInt16 nCurrCol = 0; nCurrCol < nColCount; ++nCurrCol )
{
SwTableBox* pBox = (*pBoxes)[nCurrCol];
rMerged.Insert( pBox );
@@ -893,14 +894,19 @@ bool SwTable::PrepareMerge( const SwPaM& rPam, SwSelBoxes& rBoxes,
SwPaM aPam( aInsPos );
aPam.GetPoint()->nNode.Assign( *pBox->GetSttNd()->EndOfSectionNode(), -1 );
SwCntntNode* pCNd = aPam.GetCntntNode();
- USHORT nL = pCNd ? pCNd->Len() : 0;
+ sal_uInt16 nL = pCNd ? pCNd->Len() : 0;
aPam.GetPoint()->nContent.Assign( pCNd, nL );
SwNodeIndex aSttNdIdx( *pBox->GetSttNd(), 1 );
+ bool const bUndo = pDoc->GetIDocumentUndoRedo().DoesUndo();
if( pUndo )
- pDoc->DoUndo( FALSE );
+ {
+ pDoc->GetIDocumentUndoRedo().DoUndo(false);
+ }
pDoc->AppendTxtNode( *aPam.GetPoint() );
if( pUndo )
- pDoc->DoUndo( TRUE );
+ {
+ pDoc->GetIDocumentUndoRedo().DoUndo(bUndo);
+ }
SwNodeRange aRg( aSttNdIdx, aPam.GetPoint()->nNode );
if( pUndo )
pUndo->MoveBoxCntnt( pDoc, aRg, rInsPosNd );
@@ -928,11 +934,11 @@ bool SwTable::PrepareMerge( const SwPaM& rPam, SwSelBoxes& rBoxes,
// pNewFmt will be set to the new master box and the overlapped cells
SwFrmFmt* pNewFmt = pMergeBox->ClaimFrmFmt();
pNewFmt->SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE, pSel->mnMergeWidth, 0 ) );
- for( USHORT nCurrLine = 0; nCurrLine < nLineCount; ++nCurrLine )
+ for( sal_uInt16 nCurrLine = 0; nCurrLine < nLineCount; ++nCurrLine )
{
const SwSelBoxes* pBoxes = pSel->aBoxes[ nCurrLine ];
- USHORT nColCount = pBoxes->Count();
- for( USHORT nCurrCol = 0; nCurrCol < nColCount; ++nCurrCol )
+ sal_uInt16 nColCount = pBoxes->Count();
+ for( sal_uInt16 nCurrCol = 0; nCurrCol < nColCount; ++nCurrCol )
{
SwTableBox* pBox = (*pBoxes)[nCurrCol];
if( nCurrCol )
@@ -978,15 +984,15 @@ void SwTable::_FindSuperfluousRows( SwSelBoxes& rBoxes,
pFirstLn = rBoxes[0]->GetUpper();
pLastLn = rBoxes[ rBoxes.Count() - 1 ]->GetUpper();
}
- USHORT nFirstLn = GetTabLines().C40_GETPOS(SwTableLine, pFirstLn );
- USHORT nLastLn = GetTabLines().C40_GETPOS(SwTableLine, pLastLn );
- for( USHORT nRow = nFirstLn; nRow <= nLastLn; ++nRow )
+ sal_uInt16 nFirstLn = GetTabLines().C40_GETPOS(SwTableLine, pFirstLn );
+ sal_uInt16 nLastLn = GetTabLines().C40_GETPOS(SwTableLine, pLastLn );
+ for( sal_uInt16 nRow = nFirstLn; nRow <= nLastLn; ++nRow )
{
SwTableLine* pLine = aLines[nRow];
ASSERT( pLine, "Missing table line" );
- USHORT nCols = pLine->GetTabBoxes().Count();
+ sal_uInt16 nCols = pLine->GetTabBoxes().Count();
bool bSuperfl = true;
- for( USHORT nCol = 0; nCol < nCols; ++nCol )
+ for( sal_uInt16 nCol = 0; nCol < nCols; ++nCol )
{
SwTableBox *pBox = pLine->GetTabBoxes()[nCol];
if( pBox->getRowSpan() > 0 &&
@@ -998,7 +1004,7 @@ void SwTable::_FindSuperfluousRows( SwSelBoxes& rBoxes,
}
if( bSuperfl )
{
- for( USHORT nCol = 0; nCol < nCols; ++nCol )
+ for( sal_uInt16 nCol = 0; nCol < nCols; ++nCol )
{
SwTableBox* pBox = pLine->GetTabBoxes()[nCol];
rBoxes.Insert( pBox );
@@ -1011,7 +1017,7 @@ void SwTable::_FindSuperfluousRows( SwSelBoxes& rBoxes,
overlaps the given cell, it maybe the cell itself.
*/
-SwTableBox& SwTableBox::FindStartOfRowSpan( const SwTable& rTable, USHORT nMaxStep )
+SwTableBox& SwTableBox::FindStartOfRowSpan( const SwTable& rTable, sal_uInt16 nMaxStep )
{
if( getRowSpan() > 0 || !nMaxStep )
return *this;
@@ -1019,7 +1025,7 @@ SwTableBox& SwTableBox::FindStartOfRowSpan( const SwTable& rTable, USHORT nMaxSt
long nLeftBorder = lcl_Box2LeftBorder( *this );
SwTableBox* pBox = this;
const SwTableLine* pMyUpper = GetUpper();
- USHORT nLine = rTable.GetTabLines().C40_GETPOS(SwTableLine, pMyUpper );
+ sal_uInt16 nLine = rTable.GetTabLines().C40_GETPOS(SwTableLine, pMyUpper );
if( nLine && nLine < rTable.GetTabLines().Count() )
{
SwTableBox* pNext;
@@ -1038,7 +1044,7 @@ SwTableBox& SwTableBox::FindStartOfRowSpan( const SwTable& rTable, USHORT nMaxSt
any. Otherwise the cell itself will returned.
*/
-SwTableBox& SwTableBox::FindEndOfRowSpan( const SwTable& rTable, USHORT nMaxStep )
+SwTableBox& SwTableBox::FindEndOfRowSpan( const SwTable& rTable, sal_uInt16 nMaxStep )
{
long nAbsSpan = getRowSpan();
if( nAbsSpan < 0 )
@@ -1047,9 +1053,9 @@ SwTableBox& SwTableBox::FindEndOfRowSpan( const SwTable& rTable, USHORT nMaxStep
return *this;
if( nMaxStep > --nAbsSpan )
- nMaxStep = (USHORT)nAbsSpan;
+ nMaxStep = (sal_uInt16)nAbsSpan;
const SwTableLine* pMyUpper = GetUpper();
- USHORT nLine = rTable.GetTabLines().C40_GETPOS(SwTableLine, pMyUpper );
+ sal_uInt16 nLine = rTable.GetTabLines().C40_GETPOS(SwTableLine, pMyUpper );
nMaxStep = nLine + nMaxStep;
if( nMaxStep >= rTable.GetTabLines().Count() )
nMaxStep = rTable.GetTabLines().Count() - 1;
@@ -1073,9 +1079,9 @@ void lcl_getAllMergedBoxes( const SwTable& rTable, SwSelBoxes& rBoxes, SwTableBo
if( pBox->getRowSpan() == 1 )
return;
const SwTableLine* pMyUpper = pBox->GetUpper();
- USHORT nLine = rTable.GetTabLines().C40_GETPOS(SwTableLine, pMyUpper );
+ sal_uInt16 nLine = rTable.GetTabLines().C40_GETPOS(SwTableLine, pMyUpper );
long nLeftBorder = lcl_Box2LeftBorder( *pBox );
- USHORT nCount = rTable.GetTabLines().Count();
+ sal_uInt16 nCount = rTable.GetTabLines().Count();
while( ++nLine < nCount && pBox && pBox->getRowSpan() != -1 )
{
pBox = lcl_LeftBorder2Box( nLeftBorder, rTable.GetTabLines()[nLine] );
@@ -1088,22 +1094,22 @@ void lcl_getAllMergedBoxes( const SwTable& rTable, SwSelBoxes& rBoxes, SwTableBo
and its overlapped cells to split them into several pieces.
*/
-void lcl_UnMerge( const SwTable& rTable, SwTableBox& rBox, USHORT nCnt,
- BOOL bSameHeight )
+void lcl_UnMerge( const SwTable& rTable, SwTableBox& rBox, sal_uInt16 nCnt,
+ sal_Bool bSameHeight )
{
SwSelBoxes aBoxes;
lcl_getAllMergedBoxes( rTable, aBoxes, rBox );
- USHORT nCount = aBoxes.Count();
+ sal_uInt16 nCount = aBoxes.Count();
if( nCount < 2 )
return;
if( nCnt > nCount )
nCnt = nCount;
- USHORT *pSplitIdx = new USHORT[ nCnt ];
+ sal_uInt16 *pSplitIdx = new sal_uInt16[ nCnt ];
if( bSameHeight )
{
SwTwips *pHeights = new SwTwips[ nCount ];
SwTwips nHeight = 0;
- for( USHORT i = 0; i < nCount; ++i )
+ for( sal_uInt16 i = 0; i < nCount; ++i )
{
SwTableLine* pLine = aBoxes[ i ]->GetUpper();
SwFrmFmt *pRowFmt = pLine->GetFrmFmt();
@@ -1111,8 +1117,8 @@ void lcl_UnMerge( const SwTable& rTable, SwTableBox& rBox, USHORT nCnt,
nHeight += pHeights[ i ];
}
SwTwips nSumH = 0;
- USHORT nIdx = 0;
- for( USHORT i = 1; i <= nCnt; ++i )
+ sal_uInt16 nIdx = 0;
+ for( sal_uInt16 i = 1; i <= nCnt; ++i )
{
SwTwips nSplit = ( i * nHeight ) / nCnt;
while( nSumH < nSplit && nIdx < nCount )
@@ -1124,12 +1130,12 @@ void lcl_UnMerge( const SwTable& rTable, SwTableBox& rBox, USHORT nCnt,
else
{
for( long i = 1; i <= nCnt; ++i )
- pSplitIdx[ i - 1 ] = (USHORT)( ( i * nCount ) / nCnt );
+ pSplitIdx[ i - 1 ] = (sal_uInt16)( ( i * nCount ) / nCnt );
}
- USHORT nIdx = 0;
+ sal_uInt16 nIdx = 0;
for( long i = 0; i < nCnt; ++i )
{
- USHORT nNextIdx = pSplitIdx[ i ];
+ sal_uInt16 nNextIdx = pSplitIdx[ i ];
aBoxes[ nIdx ]->setRowSpan( nNextIdx - nIdx );
lcl_InvalidateCellFrm( *aBoxes[ nIdx ] );
while( ++nIdx < nNextIdx )
@@ -1143,8 +1149,8 @@ void lcl_UnMerge( const SwTable& rTable, SwTableBox& rBox, USHORT nCnt,
void lcl_FillSelBoxes( SwSelBoxes &rBoxes, SwTableLine &rLine )
{
- USHORT nBoxCount = rLine.GetTabBoxes().Count();
- USHORT nCurrBox;
+ sal_uInt16 nBoxCount = rLine.GetTabBoxes().Count();
+ sal_uInt16 nCurrBox;
for( nCurrBox = 0; nCurrBox < nBoxCount; ++nCurrBox )
rBoxes.Insert( rLine.GetTabBoxes()[nCurrBox] );
}
@@ -1153,7 +1159,7 @@ void lcl_FillSelBoxes( SwSelBoxes &rBoxes, SwTableLine &rLine )
overlapped cells only. This is a preparation for an upcoming split.
*/
-void SwTable::InsertSpannedRow( SwDoc* pDoc, USHORT nRowIdx, USHORT nCnt )
+void SwTable::InsertSpannedRow( SwDoc* pDoc, sal_uInt16 nRowIdx, sal_uInt16 nCnt )
{
CHECK_TABLE( *this )
ASSERT( nCnt && nRowIdx < GetTabLines().Count(), "Wrong call of InsertSpannedRow" );
@@ -1170,12 +1176,12 @@ void SwTable::InsertSpannedRow( SwDoc* pDoc, USHORT nRowIdx, USHORT nCnt )
aFSz.SetHeight( nNewHeight );
pFrmFmt->SetFmtAttr( aFSz );
}
- _InsertRow( pDoc, aBoxes, nCnt, TRUE );
- USHORT nBoxCount = rLine.GetTabBoxes().Count();
- for( USHORT n = 0; n < nCnt; ++n )
+ _InsertRow( pDoc, aBoxes, nCnt, sal_True );
+ sal_uInt16 nBoxCount = rLine.GetTabBoxes().Count();
+ for( sal_uInt16 n = 0; n < nCnt; ++n )
{
SwTableLine *pNewLine = GetTabLines()[ nRowIdx + nCnt - n ];
- for( USHORT nCurrBox = 0; nCurrBox < nBoxCount; ++nCurrBox )
+ for( sal_uInt16 nCurrBox = 0; nCurrBox < nBoxCount; ++nCurrBox )
{
long nRowSpan = rLine.GetTabBoxes()[nCurrBox]->getRowSpan();
if( nRowSpan > 0 )
@@ -1187,7 +1193,7 @@ void SwTable::InsertSpannedRow( SwDoc* pDoc, USHORT nRowIdx, USHORT nCnt )
CHECK_TABLE( *this )
}
-typedef std::pair< USHORT, USHORT > SwLineOffset;
+typedef std::pair< sal_uInt16, sal_uInt16 > SwLineOffset;
typedef std::list< SwLineOffset > SwLineOffsetArray;
/******************************************************************************
@@ -1204,24 +1210,24 @@ Output
******************************************************************************/
void lcl_SophisticatedFillLineIndices( SwLineOffsetArray &rArr,
- const SwTable& rTable, const SwSelBoxes& rBoxes, USHORT nCnt )
+ const SwTable& rTable, const SwSelBoxes& rBoxes, sal_uInt16 nCnt )
{
std::list< SwLineOffset > aBoxes;
SwLineOffset aLnOfs( USHRT_MAX, USHRT_MAX );
- for( USHORT i = 0; i < rBoxes.Count(); ++i )
+ for( sal_uInt16 i = 0; i < rBoxes.Count(); ++i )
{ // Collect all end line indices and the row spans
const SwTableBox &rBox = rBoxes[ i ]->FindStartOfRowSpan( rTable );
ASSERT( rBox.getRowSpan() > 0, "Didn't I say 'StartOfRowSpan' ??" )
if( nCnt > rBox.getRowSpan() )
{
const SwTableLine *pLine = rBox.GetUpper();
- const USHORT nEnd = USHORT( rBox.getRowSpan() +
+ const sal_uInt16 nEnd = sal_uInt16( rBox.getRowSpan() +
rTable.GetTabLines().C40_GETPOS( SwTableLine, pLine ) );
// The next if statement is a small optimization
if( aLnOfs.first != nEnd || aLnOfs.second != rBox.getRowSpan() )
{
aLnOfs.first = nEnd; // ok, this is the line behind the box
- aLnOfs.second = USHORT( rBox.getRowSpan() ); // the row span
+ aLnOfs.second = sal_uInt16( rBox.getRowSpan() ); // the row span
aBoxes.insert( aBoxes.end(), aLnOfs );
}
}
@@ -1229,7 +1235,7 @@ void lcl_SophisticatedFillLineIndices( SwLineOffsetArray &rArr,
// As I said, I noted the line index _behind_ the last line of the boxes
// in the resulting array the index has to be _on_ the line
// nSum is to evaluate the wished value
- USHORT nSum = 1;
+ sal_uInt16 nSum = 1;
while( aBoxes.size() )
{
// I. step:
@@ -1298,22 +1304,22 @@ typedef std::set< SwTwips > SwSplitLines;
to be splitted to fulfill the requested "split same height"
*/
-USHORT lcl_CalculateSplitLineHeights( SwSplitLines &rCurr, SwSplitLines &rNew,
- const SwTable& rTable, const SwSelBoxes& rBoxes, USHORT nCnt )
+sal_uInt16 lcl_CalculateSplitLineHeights( SwSplitLines &rCurr, SwSplitLines &rNew,
+ const SwTable& rTable, const SwSelBoxes& rBoxes, sal_uInt16 nCnt )
{
if( nCnt < 2 )
return 0;
std::list< SwLineOffset > aBoxes;
SwLineOffset aLnOfs( USHRT_MAX, USHRT_MAX );
- USHORT nFirst = USHRT_MAX; // becomes the index of the first line
- USHORT nLast = 0; // becomes the index of the last line of the splitting
- for( USHORT i = 0; i < rBoxes.Count(); ++i )
+ sal_uInt16 nFirst = USHRT_MAX; // becomes the index of the first line
+ sal_uInt16 nLast = 0; // becomes the index of the last line of the splitting
+ for( sal_uInt16 i = 0; i < rBoxes.Count(); ++i )
{ // Collect all pairs (start+end) of line indices to split
const SwTableBox &rBox = rBoxes[ i ]->FindStartOfRowSpan( rTable );
ASSERT( rBox.getRowSpan() > 0, "Didn't I say 'StartOfRowSpan' ??" )
const SwTableLine *pLine = rBox.GetUpper();
- const USHORT nStart = rTable.GetTabLines().C40_GETPOS( SwTableLine, pLine );
- const USHORT nEnd = USHORT( rBox.getRowSpan() + nStart - 1 );
+ const sal_uInt16 nStart = rTable.GetTabLines().C40_GETPOS( SwTableLine, pLine );
+ const sal_uInt16 nEnd = sal_uInt16( rBox.getRowSpan() + nStart - 1 );
// The next if statement is a small optimization
if( aLnOfs.first != nStart || aLnOfs.second != nEnd )
{
@@ -1331,7 +1337,7 @@ USHORT lcl_CalculateSplitLineHeights( SwSplitLines &rCurr, SwSplitLines &rNew,
return 0;
SwTwips nHeight = 0;
SwTwips* pLines = new SwTwips[ nLast + 1 - nFirst ];
- for( USHORT i = nFirst; i <= nLast; ++i )
+ for( sal_uInt16 i = nFirst; i <= nLast; ++i )
{
bool bLayoutAvailable = false;
nHeight += rTable.GetTabLines()[ i ]->GetTableLineHeight( bLayoutAvailable );
@@ -1344,7 +1350,7 @@ USHORT lcl_CalculateSplitLineHeights( SwSplitLines &rCurr, SwSplitLines &rNew,
SwTwips nBase = pSplit->first <= nFirst ? 0 :
pLines[ pSplit->first - nFirst - 1 ];
SwTwips nDiff = pLines[ pSplit->second - nFirst ] - nBase;
- for( USHORT i = 1; i < nCnt; ++i )
+ for( sal_uInt16 i = 1; i < nCnt; ++i )
{
SwTwips nSplit = nBase + ( i * nDiff ) / nCnt;
rNew.insert( nSplit );
@@ -1359,16 +1365,16 @@ USHORT lcl_CalculateSplitLineHeights( SwSplitLines &rCurr, SwSplitLines &rNew,
the box selection.
*/
-USHORT lcl_LineIndex( const SwTable& rTable, const SwSelBoxes& rBoxes,
+sal_uInt16 lcl_LineIndex( const SwTable& rTable, const SwSelBoxes& rBoxes,
bool bBehind )
{
- USHORT nDirect = USHRT_MAX;
- USHORT nSpan = USHRT_MAX;
- for( USHORT i = 0; i < rBoxes.Count(); ++i )
+ sal_uInt16 nDirect = USHRT_MAX;
+ sal_uInt16 nSpan = USHRT_MAX;
+ for( sal_uInt16 i = 0; i < rBoxes.Count(); ++i )
{
SwTableBox *pBox = rBoxes[i];
const SwTableLine* pLine = rBoxes[i]->GetUpper();
- USHORT nPos = rTable.GetTabLines().C40_GETPOS( SwTableLine, pLine );
+ sal_uInt16 nPos = rTable.GetTabLines().C40_GETPOS( SwTableLine, pLine );
if( USHRT_MAX != nPos )
{
if( bBehind )
@@ -1380,7 +1386,7 @@ USHORT lcl_LineIndex( const SwTable& rTable, const SwSelBoxes& rBoxes,
nSpan = 0;
else if( nSpan )
{
- USHORT nEndOfRowSpan = (USHORT)(nPos + nRowSpan - 1);
+ sal_uInt16 nEndOfRowSpan = (sal_uInt16)(nPos + nRowSpan - 1);
if( nEndOfRowSpan > nSpan || nSpan == USHRT_MAX )
nSpan = nEndOfRowSpan;
}
@@ -1397,8 +1403,8 @@ USHORT lcl_LineIndex( const SwTable& rTable, const SwSelBoxes& rBoxes,
/** SwTable::NewSplitRow(..) splits all selected boxes horizontally.
*/
-BOOL SwTable::NewSplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, USHORT nCnt,
- BOOL bSameHeight )
+sal_Bool SwTable::NewSplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nCnt,
+ sal_Bool bSameHeight )
{
CHECK_TABLE( *this )
++nCnt;
@@ -1409,7 +1415,7 @@ BOOL SwTable::NewSplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, USHORT nCnt,
{
SwSplitLines aRowLines;
SwSplitLines aSplitLines;
- USHORT nFirst = lcl_CalculateSplitLineHeights( aRowLines, aSplitLines,
+ sal_uInt16 nFirst = lcl_CalculateSplitLineHeights( aRowLines, aSplitLines,
*this, rBoxes, nCnt );
aFndBox.DelFrms( *this );
SwTwips nLast = 0;
@@ -1446,7 +1452,7 @@ BOOL SwTable::NewSplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, USHORT nCnt,
else
{
aFndBox.DelFrms( *this );
- bSameHeight = FALSE;
+ bSameHeight = sal_False;
}
if( !bSameHeight )
{
@@ -1460,15 +1466,15 @@ BOOL SwTable::NewSplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, USHORT nCnt,
}
}
- std::set< USHORT> aIndices;
- for( USHORT i = 0; i < rBoxes.Count(); ++i )
+ std::set< sal_uInt16> aIndices;
+ for( sal_uInt16 i = 0; i < rBoxes.Count(); ++i )
{
ASSERT( rBoxes[i]->getRowSpan() != 1, "Forgot to split?" )
if( rBoxes[i]->getRowSpan() > 1 )
aIndices.insert( i );
}
- std::set< USHORT >::iterator pCurrBox = aIndices.begin();
+ std::set< sal_uInt16 >::iterator pCurrBox = aIndices.begin();
while( pCurrBox != aIndices.end() )
lcl_UnMerge( *this, *rBoxes[*pCurrBox++], nCnt, bSameHeight );
@@ -1476,21 +1482,21 @@ BOOL SwTable::NewSplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, USHORT nCnt,
//Layout updaten
aFndBox.MakeFrms( *this );
- return TRUE;
+ return sal_True;
}
/** SwTable::InsertRow(..) inserts one or more rows before or behind the selected
boxes.
*/
-BOOL SwTable::InsertRow( SwDoc* pDoc, const SwSelBoxes& rBoxes,
- USHORT nCnt, BOOL bBehind )
+sal_Bool SwTable::InsertRow( SwDoc* pDoc, const SwSelBoxes& rBoxes,
+ sal_uInt16 nCnt, sal_Bool bBehind )
{
bool bRet = false;
if( IsNewModel() )
{
CHECK_TABLE( *this )
- USHORT nRowIdx = lcl_LineIndex( *this, rBoxes, bBehind );
+ sal_uInt16 nRowIdx = lcl_LineIndex( *this, rBoxes, bBehind );
if( nRowIdx < USHRT_MAX )
{
_FndBox aFndBox( 0, 0 );
@@ -1503,12 +1509,12 @@ BOOL SwTable::InsertRow( SwDoc* pDoc, const SwSelBoxes& rBoxes,
SwSelBoxes aLineBoxes;
lcl_FillSelBoxes( aLineBoxes, *pLine );
_InsertRow( pDoc, aLineBoxes, nCnt, bBehind );
- USHORT nBoxCount = pLine->GetTabBoxes().Count();
- USHORT nOfs = bBehind ? 0 : 1;
- for( USHORT n = 0; n < nCnt; ++n )
+ sal_uInt16 nBoxCount = pLine->GetTabBoxes().Count();
+ sal_uInt16 nOfs = bBehind ? 0 : 1;
+ for( sal_uInt16 n = 0; n < nCnt; ++n )
{
SwTableLine *pNewLine = GetTabLines()[ nRowIdx+nCnt-n-nOfs];
- for( USHORT nCurrBox = 0; nCurrBox < nBoxCount; ++nCurrBox )
+ for( sal_uInt16 nCurrBox = 0; nCurrBox < nBoxCount; ++nCurrBox )
{
long nRowSpan = pLine->GetTabBoxes()[nCurrBox]->getRowSpan();
if( bBehind )
@@ -1551,7 +1557,7 @@ void SwTable::PrepareDelBoxes( const SwSelBoxes& rBoxes )
{
if( IsNewModel() )
{
- for( USHORT i = 0; i < rBoxes.Count(); ++i )
+ for( sal_uInt16 i = 0; i < rBoxes.Count(); ++i )
{
SwTableBox* pBox = rBoxes[i];
long nRowSpan = pBox->getRowSpan();
@@ -1559,7 +1565,7 @@ void SwTable::PrepareDelBoxes( const SwSelBoxes& rBoxes )
{
long nLeft = lcl_Box2LeftBorder( *pBox );
SwTableLine *pLine = pBox->GetUpper();
- USHORT nLinePos = GetTabLines().C40_GETPOS(SwTableLine, pLine);
+ sal_uInt16 nLinePos = GetTabLines().C40_GETPOS(SwTableLine, pLine);
ASSERT( nLinePos < USHRT_MAX, "Box/table mismatch" )
if( nRowSpan > 1 )
{
@@ -1611,8 +1617,8 @@ void lcl_SearchSelBox( const SwTable &rTable, SwSelBoxes& rBoxes, long nMin, lon
long nLeft = 0;
long nRight = 0;
long nMid = ( nMax + nMin )/ 2;
- USHORT nCount = rLine.GetTabBoxes().Count();
- for( USHORT nCurrBox = 0; nCurrBox < nCount; ++nCurrBox )
+ sal_uInt16 nCount = rLine.GetTabBoxes().Count();
+ for( sal_uInt16 nCurrBox = 0; nCurrBox < nCount; ++nCurrBox )
{
SwTableBox* pBox = rLine.GetTabBoxes()[nCurrBox];
ASSERT( pBox, "Missing table box" );
@@ -1632,7 +1638,7 @@ void lcl_SearchSelBox( const SwTable &rTable, SwSelBoxes& rBoxes, long nMin, lon
( !bChkProtected ||
!pBox->GetFrmFmt()->GetProtect().IsCntntProtected() ) )
{
- USHORT nOldCnt = rBoxes.Count();
+ sal_uInt16 nOldCnt = rBoxes.Count();
rBoxes.Insert( pBox );
if( bColumn && nRowSpan != 1 && nOldCnt < rBoxes.Count() )
{
@@ -1675,13 +1681,13 @@ void SwTable::CreateSelection( const SwNode* pStartNd, const SwNode* pEndNd,
if( rBoxes.Count() )
{
// aKeepBoxes.Insert( &rBoxes );
- rBoxes.Remove( USHORT(0), rBoxes.Count() );
+ rBoxes.Remove( sal_uInt16(0), rBoxes.Count() );
}
// Looking for start and end of the selection given by SwNode-pointer
- USHORT nLines = aLines.Count();
+ sal_uInt16 nLines = aLines.Count();
// nTop becomes the line number of the upper box
// nBottom becomes the line number of the lower box
- USHORT nTop = 0, nBottom = 0;
+ sal_uInt16 nTop = 0, nBottom = 0;
// nUpperMin becomes the left border value of the upper box
// nUpperMax becomes the right border of the upper box
// nLowerMin and nLowerMax the borders of the lower box
@@ -1690,12 +1696,12 @@ void SwTable::CreateSelection( const SwNode* pStartNd, const SwNode* pEndNd,
// nFound will incremented if a box is found
// 0 => no box found; 1 => the upper box has been found; 2 => both found
int nFound = 0;
- for( USHORT nRow = 0; nFound < 2 && nRow < nLines; ++nRow )
+ for( sal_uInt16 nRow = 0; nFound < 2 && nRow < nLines; ++nRow )
{
SwTableLine* pLine = aLines[nRow];
ASSERT( pLine, "Missing table line" );
- USHORT nCols = pLine->GetTabBoxes().Count();
- for( USHORT nCol = 0; nCol < nCols; ++nCol )
+ sal_uInt16 nCols = pLine->GetTabBoxes().Count();
+ for( sal_uInt16 nCol = 0; nCol < nCols; ++nCol )
{
SwTableBox* pBox = pLine->GetTabBoxes()[nCol];
ASSERT( pBox, "Missing table box" );
@@ -1735,12 +1741,12 @@ void SwTable::CreateSelection( const SwNode* pStartNd, const SwNode* pEndNd,
// Selection of a row is quiet easy:
// every (unprotected) box between start and end line
// with a positive row span will be collected
- for( USHORT nRow = nTop; nRow <= nBottom; ++nRow )
+ for( sal_uInt16 nRow = nTop; nRow <= nBottom; ++nRow )
{
SwTableLine* pLine = aLines[nRow];
ASSERT( pLine, "Missing table line" );
- USHORT nCount = pLine->GetTabBoxes().Count();
- for( USHORT nCurrBox = 0; nCurrBox < nCount; ++nCurrBox )
+ sal_uInt16 nCount = pLine->GetTabBoxes().Count();
+ for( sal_uInt16 nCurrBox = 0; nCurrBox < nCount; ++nCurrBox )
{
SwTableBox* pBox = pLine->GetTabBoxes()[nCurrBox];
ASSERT( pBox, "Missing table box" );
@@ -1779,7 +1785,7 @@ void SwTable::CreateSelection( const SwNode* pStartNd, const SwNode* pEndNd,
const bool bColumn = eSearch == SEARCH_COL;
if( bColumn )
{
- for( USHORT i = 0; i < nTop; ++i )
+ for( sal_uInt16 i = 0; i < nTop; ++i )
lcl_SearchSelBox( *this, rBoxes, nUpperMin, nUpperMax,
*aLines[i], bChkProtected, bColumn );
}
@@ -1787,7 +1793,7 @@ void SwTable::CreateSelection( const SwNode* pStartNd, const SwNode* pEndNd,
{
long nMin = nUpperMin < nLowerMin ? nUpperMin : nLowerMin;
long nMax = nUpperMax < nLowerMax ? nLowerMax : nUpperMax;
- for( USHORT i = nTop; i <= nBottom; ++i )
+ for( sal_uInt16 i = nTop; i <= nBottom; ++i )
lcl_SearchSelBox( *this, rBoxes, nMin, nMax, *aLines[i],
bChkProtected, bColumn );
}
@@ -1795,7 +1801,7 @@ void SwTable::CreateSelection( const SwNode* pStartNd, const SwNode* pEndNd,
{
long nInnerMin = nUpperMin < nLowerMin ? nLowerMin : nUpperMin;
long nInnerMax = nUpperMax < nLowerMax ? nUpperMax : nLowerMax;
- for( USHORT i = nTop + 1; i < nBottom; ++i )
+ for( sal_uInt16 i = nTop + 1; i < nBottom; ++i )
lcl_SearchSelBox( *this, rBoxes, nInnerMin, nInnerMax, *aLines[i],
bChkProtected, bColumn );
}
@@ -1812,10 +1818,10 @@ void SwTable::CreateSelection( const SwNode* pStartNd, const SwNode* pEndNd,
long nMin = nUpperMin < nLowerMin ? nUpperMin : nLowerMin;
long nMax = nUpperMax < nLowerMax ? nLowerMax : nUpperMax;
SwSelBoxes aCandidates;
- for( USHORT i = nTop; i <= nBottom; ++i )
+ for( sal_uInt16 i = nTop; i <= nBottom; ++i )
lcl_SearchSelBox( *this, aCandidates, nMin, nMax, *aLines[i],
bChkProtected, bColumn );
- USHORT nOld = 0, nNew = 0;
+ sal_uInt16 nOld = 0, nNew = 0;
while ( nOld < aKeepBoxes.Count() && nNew < aCandidates.Count() )
{
const SwTableBox* pPOld = *( aKeepBoxes.GetData() + nOld );
@@ -1834,7 +1840,7 @@ void SwTable::CreateSelection( const SwNode* pStartNd, const SwNode* pEndNd,
} */
if( bColumn )
{
- for( USHORT i = nBottom + 1; i < nLines; ++i )
+ for( sal_uInt16 i = nBottom + 1; i < nLines; ++i )
lcl_SearchSelBox( *this, rBoxes, nLowerMin, nLowerMax, *aLines[i],
bChkProtected, true );
}
@@ -1852,15 +1858,15 @@ void SwTable::ExpandColumnSelection( SwSelBoxes& rBoxes, long &rMin, long &rMax
if( !aLines.Count() || !rBoxes.Count() )
return;
- USHORT nLineCnt = aLines.Count();
- USHORT nBoxCnt = rBoxes.Count();
- USHORT nBox = 0;
- for( USHORT nRow = 0; nRow < nLineCnt && nBox < nBoxCnt; ++nRow )
+ sal_uInt16 nLineCnt = aLines.Count();
+ sal_uInt16 nBoxCnt = rBoxes.Count();
+ sal_uInt16 nBox = 0;
+ for( sal_uInt16 nRow = 0; nRow < nLineCnt && nBox < nBoxCnt; ++nRow )
{
SwTableLine* pLine = aLines[nRow];
ASSERT( pLine, "Missing table line" );
- USHORT nCols = pLine->GetTabBoxes().Count();
- for( USHORT nCol = 0; nCol < nCols; ++nCol )
+ sal_uInt16 nCols = pLine->GetTabBoxes().Count();
+ for( sal_uInt16 nCol = 0; nCol < nCols; ++nCol )
{
SwTableBox* pBox = pLine->GetTabBoxes()[nCol];
ASSERT( pBox, "Missing table box" );
@@ -1873,13 +1879,13 @@ void SwTable::ExpandColumnSelection( SwSelBoxes& rBoxes, long &rMin, long &rMax
}
}
nBox = 0;
- for( USHORT nRow = 0; nRow < nLineCnt; ++nRow )
+ for( sal_uInt16 nRow = 0; nRow < nLineCnt; ++nRow )
{
SwTableLine* pLine = aLines[nRow];
- USHORT nCols = pLine->GetTabBoxes().Count();
+ sal_uInt16 nCols = pLine->GetTabBoxes().Count();
long nLeft = 0;
long nRight = 0;
- for( USHORT nCurrBox = 0; nCurrBox < nCols; ++nCurrBox )
+ for( sal_uInt16 nCurrBox = 0; nCurrBox < nCols; ++nCurrBox )
{
nLeft = nRight;
SwTableBox* pBox = pLine->GetTabBoxes()[nCurrBox];
@@ -1902,14 +1908,14 @@ void SwTable::PrepareDeleteCol( long nMin, long nMax )
const SwTwips nTabSize = GetFrmFmt()->GetFrmSize().GetWidth();
if( nTabSize == nMax )
nMid = nMax;
- USHORT nLineCnt = aLines.Count();
- for( USHORT nRow = 0; nRow < nLineCnt; ++nRow )
+ sal_uInt16 nLineCnt = aLines.Count();
+ for( sal_uInt16 nRow = 0; nRow < nLineCnt; ++nRow )
{
SwTableLine* pLine = aLines[nRow];
- USHORT nCols = pLine->GetTabBoxes().Count();
+ sal_uInt16 nCols = pLine->GetTabBoxes().Count();
long nLeft = 0;
long nRight = 0;
- for( USHORT nCurrBox = 0; nCurrBox < nCols; ++nCurrBox )
+ for( sal_uInt16 nCurrBox = 0; nCurrBox < nCols; ++nCurrBox )
{
nLeft = nRight;
SwTableBox* pBox = pLine->GetTabBoxes()[nCurrBox];
@@ -1947,7 +1953,7 @@ void SwTable::PrepareDeleteCol( long nMin, long nMax )
void SwTable::ExpandSelection( SwSelBoxes& rBoxes ) const
{
- for( USHORT i = 0; i < rBoxes.Count(); ++i )
+ for( sal_uInt16 i = 0; i < rBoxes.Count(); ++i )
{
SwTableBox *pBox = rBoxes[i];
long nRowSpan = pBox->getRowSpan();
@@ -1967,7 +1973,7 @@ void SwTable::ExpandSelection( SwSelBoxes& rBoxes ) const
void SwTable::CheckRowSpan( SwTableLinePtr &rpLine, bool bUp ) const
{
ASSERT( IsNewModel(), "Don't call me for old tables" );
- USHORT nLineIdx = GetTabLines().C40_GETPOS( SwTableLine, rpLine );
+ sal_uInt16 nLineIdx = GetTabLines().C40_GETPOS( SwTableLine, rpLine );
ASSERT( nLineIdx < GetTabLines().Count(), "Start line out of range" );
bool bChange = true;
if( bUp )
@@ -1976,8 +1982,8 @@ void SwTable::CheckRowSpan( SwTableLinePtr &rpLine, bool bUp ) const
{
bChange = false;
rpLine = GetTabLines()[ nLineIdx ];
- USHORT nCols = rpLine->GetTabBoxes().Count();
- for( USHORT nCol = 0; !bChange && nCol < nCols; ++nCol )
+ sal_uInt16 nCols = rpLine->GetTabBoxes().Count();
+ for( sal_uInt16 nCol = 0; !bChange && nCol < nCols; ++nCol )
{
SwTableBox* pBox = rpLine->GetTabBoxes()[nCol];
if( pBox->getRowSpan() > 1 || pBox->getRowSpan() < -1 )
@@ -1997,13 +2003,13 @@ void SwTable::CheckRowSpan( SwTableLinePtr &rpLine, bool bUp ) const
}
else
{
- USHORT nMaxLine = GetTabLines().Count();
+ sal_uInt16 nMaxLine = GetTabLines().Count();
while( bChange )
{
bChange = false;
rpLine = GetTabLines()[ nLineIdx ];
- USHORT nCols = rpLine->GetTabBoxes().Count();
- for( USHORT nCol = 0; !bChange && nCol < nCols; ++nCol )
+ sal_uInt16 nCols = rpLine->GetTabBoxes().Count();
+ for( sal_uInt16 nCol = 0; !bChange && nCol < nCols; ++nCol )
{
SwTableBox* pBox = rpLine->GetTabBoxes()[nCol];
if( pBox->getRowSpan() < 0 )
@@ -2026,14 +2032,14 @@ void SwTable::CheckRowSpan( SwTableLinePtr &rpLine, bool bUp ) const
// In a top line no negative row span is allowed, so these have to be corrected.
// If there has been at least one correction, all values are stored
// and can be used by undo of table split
-SwSaveRowSpan::SwSaveRowSpan( SwTableBoxes& rBoxes, USHORT nSplitLn )
+SwSaveRowSpan::SwSaveRowSpan( SwTableBoxes& rBoxes, sal_uInt16 nSplitLn )
: mnSplitLine( nSplitLn )
{
bool bDontSave = true; // nothing changed, nothing to save
- USHORT nColCount = rBoxes.Count();
+ sal_uInt16 nColCount = rBoxes.Count();
ASSERT( nColCount, "Empty Table Line" )
mnRowSpans.resize( nColCount );
- for( USHORT nCurrCol = 0; nCurrCol < nColCount; ++nCurrCol )
+ for( sal_uInt16 nCurrCol = 0; nCurrCol < nColCount; ++nCurrCol )
{
SwTableBox* pBox = rBoxes[nCurrCol];
ASSERT( pBox, "Missing Table Box" );
@@ -2056,17 +2062,17 @@ void SwTable::RestoreRowSpan( const SwSaveRowSpan& rSave )
{
if( !IsNewModel() ) // for new model only
return;
- USHORT nLineCount = GetTabLines().Count();
+ sal_uInt16 nLineCount = GetTabLines().Count();
ASSERT( rSave.mnSplitLine < nLineCount, "Restore behind last line?" )
if( rSave.mnSplitLine < nLineCount )
{
SwTableLine* pLine = GetTabLines()[rSave.mnSplitLine];
- USHORT nColCount = pLine->GetTabBoxes().Count();
+ sal_uInt16 nColCount = pLine->GetTabBoxes().Count();
ASSERT( nColCount, "Empty Table Line" )
ASSERT( nColCount == rSave.mnRowSpans.size(), "Wrong row span store" )
if( nColCount == rSave.mnRowSpans.size() )
{
- for( USHORT nCurrCol = 0; nCurrCol < nColCount; ++nCurrCol )
+ for( sal_uInt16 nCurrCol = 0; nCurrCol < nColCount; ++nCurrCol )
{
SwTableBox* pBox = pLine->GetTabBoxes()[nCurrCol];
ASSERT( pBox, "Missing Table Box" );
@@ -2077,7 +2083,7 @@ void SwTable::RestoreRowSpan( const SwSaveRowSpan& rSave )
ASSERT( rSave.mnRowSpans[ nCurrCol ] < 0, "Pardon me?!" )
pBox->setRowSpan( -nRowSp );
- USHORT nLine = rSave.mnSplitLine;
+ sal_uInt16 nLine = rSave.mnSplitLine;
if( nLine )
{
long nLeftBorder = lcl_Box2LeftBorder( *pBox );
@@ -2106,7 +2112,7 @@ void SwTable::RestoreRowSpan( const SwSaveRowSpan& rSave )
}
}
-SwSaveRowSpan* SwTable::CleanUpTopRowSpan( USHORT nSplitLine )
+SwSaveRowSpan* SwTable::CleanUpTopRowSpan( sal_uInt16 nSplitLine )
{
SwSaveRowSpan* pRet = 0;
if( !IsNewModel() )
@@ -2120,15 +2126,15 @@ SwSaveRowSpan* SwTable::CleanUpTopRowSpan( USHORT nSplitLine )
return pRet;
}
-void SwTable::CleanUpBottomRowSpan( USHORT nDelLines )
+void SwTable::CleanUpBottomRowSpan( sal_uInt16 nDelLines )
{
if( !IsNewModel() )
return;
- USHORT nLastLine = GetTabLines().Count()-1;
+ sal_uInt16 nLastLine = GetTabLines().Count()-1;
SwTableLine* pLine = GetTabLines()[nLastLine];
- USHORT nColCount = pLine->GetTabBoxes().Count();
+ sal_uInt16 nColCount = pLine->GetTabBoxes().Count();
ASSERT( nColCount, "Empty Table Line" )
- for( USHORT nCurrCol = 0; nCurrCol < nColCount; ++nCurrCol )
+ for( sal_uInt16 nCurrCol = 0; nCurrCol < nColCount; ++nCurrCol )
{
SwTableBox* pBox = pLine->GetTabBoxes()[nCurrCol];
ASSERT( pBox, "Missing Table Box" );
@@ -2156,19 +2162,19 @@ void SwTable::CheckConsistency() const
{
if( !IsNewModel() )
return;
- USHORT nLineCount = GetTabLines().Count();
+ sal_uInt16 nLineCount = GetTabLines().Count();
const SwTwips nTabSize = GetFrmFmt()->GetFrmSize().GetWidth();
SwTwips nLineWidth = 0;
std::list< RowSpanCheck > aRowSpanCells;
std::list< RowSpanCheck >::iterator aIter = aRowSpanCells.end();
- for( USHORT nCurrLine = 0; nCurrLine < nLineCount; ++nCurrLine )
+ for( sal_uInt16 nCurrLine = 0; nCurrLine < nLineCount; ++nCurrLine )
{
SwTwips nWidth = 0;
SwTableLine* pLine = GetTabLines()[nCurrLine];
ASSERT( pLine, "Missing Table Line" )
- USHORT nColCount = pLine->GetTabBoxes().Count();
+ sal_uInt16 nColCount = pLine->GetTabBoxes().Count();
ASSERT( nColCount, "Empty Table Line" )
- for( USHORT nCurrCol = 0; nCurrCol < nColCount; ++nCurrCol )
+ for( sal_uInt16 nCurrCol = 0; nCurrCol < nColCount; ++nCurrCol )
{
SwTableBox* pBox = pLine->GetTabBoxes()[nCurrCol];
ASSERT( pBox, "Missing Table Box" );
@@ -2235,10 +2241,10 @@ private:
{
const SwTableBox* mpKeyBox;
const SwTableBox* mpCacheBox;
- USHORT mnSteps;
+ sal_uInt16 mnSteps;
bool mbStart;
- SwFindRowSpanCacheObj( const SwTableBox& rKeyBox, const SwTableBox& rCacheBox, USHORT nSteps, bool bStart ) :
+ SwFindRowSpanCacheObj( const SwTableBox& rKeyBox, const SwTableBox& rCacheBox, sal_uInt16 nSteps, bool bStart ) :
mpKeyBox( &rKeyBox ), mpCacheBox( &rCacheBox ), mnSteps( nSteps ), mbStart( bStart ) {}
};
@@ -2250,8 +2256,8 @@ private:
public:
static SwFindRowSpanCache& getSwFindRowSpanCache();
- const SwTableBox* FindCachedStartEndOfRowSpan( const SwTableBox& rKeyBox, USHORT nSteps, bool bStart );
- void SetCachedStartEndOfRowSpan( const SwTableBox& rKeyBox, const SwTableBox& rCacheBox, USHORT nSteps, bool bStart );
+ const SwTableBox* FindCachedStartEndOfRowSpan( const SwTableBox& rKeyBox, sal_uInt16 nSteps, bool bStart );
+ void SetCachedStartEndOfRowSpan( const SwTableBox& rKeyBox, const SwTableBox& rCacheBox, sal_uInt16 nSteps, bool bStart );
void SetUseCache( bool bNew );
};
@@ -2272,7 +2278,7 @@ void SwFindRowSpanCache::SetUseCache( bool bNew )
}
const SwTableBox* SwFindRowSpanCache::FindCachedStartEndOfRowSpan( const SwTableBox& rKeyBox,
- USHORT nSteps,
+ sal_uInt16 nSteps,
bool bStart )
{
static nCallCount = 0;
@@ -2303,7 +2309,7 @@ const int FindBoxCacheSize = 2;
void SwFindRowSpanCache::SetCachedStartEndOfRowSpan( const SwTableBox& rKeyBox,
const SwTableBox& rCacheBox,
- USHORT nSteps,
+ sal_uInt16 nSteps,
bool bStart )
{
if ( !mbUseCache ) return;
diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index 3f59266b65e5..74197aee67df 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -96,7 +96,7 @@ SV_IMPL_REF( SwServerObject )
#define COLFUZZY 20
void ChgTextToNum( SwTableBox& rBox, const String& rTxt, const Color* pCol,
- BOOL bChgAlign,ULONG nNdPos );
+ sal_Bool bChgAlign,sal_uLong nNdPos );
//----------------------------------
class SwTableBox_Impl
@@ -213,7 +213,7 @@ String& lcl_DelTabsAtSttEnd( String& rTxt )
void _InsTblBox( SwDoc* pDoc, SwTableNode* pTblNd,
SwTableLine* pLine, SwTableBoxFmt* pBoxFrmFmt,
SwTableBox* pBox,
- USHORT nInsPos, USHORT nCnt )
+ sal_uInt16 nInsPos, sal_uInt16 nCnt )
{
ASSERT( pBox->GetSttNd(), "Box ohne Start-Node" );
SwNodeIndex aIdx( *pBox->GetSttNd(), +1 );
@@ -250,7 +250,7 @@ void _InsTblBox( SwDoc* pDoc, SwTableNode* pTblNd,
if( nRowSpan != 1 )
{
SwTableBoxes& rTblBoxes = pLine->GetTabBoxes();
- for( USHORT i = 0; i < nCnt; ++i )
+ for( sal_uInt16 i = 0; i < nCnt; ++i )
{
pBox = rTblBoxes[ i + nInsPos ];
pBox->setRowSpan( nRowSpan );
@@ -269,8 +269,8 @@ SwTable::SwTable( SwTableFmt* pFmt )
pTableNode( 0 ),
nGrfsThatResize( 0 ),
nRowsToRepeat( 1 ),
- bModifyLocked( FALSE ),
- bNewModel( TRUE )
+ bModifyLocked( sal_False ),
+ bNewModel( sal_True )
{
// default Wert aus den Optionen setzen
eTblChgMode = (TblChgMode)GetTblChgDefaultMode();
@@ -283,14 +283,14 @@ SwTable::SwTable( const SwTable& rTable )
eTblChgMode( rTable.eTblChgMode ),
nGrfsThatResize( 0 ),
nRowsToRepeat( rTable.GetRowsToRepeat() ),
- bModifyLocked( FALSE ),
+ bModifyLocked( sal_False ),
bNewModel( rTable.bNewModel )
{
}
void DelBoxNode( SwTableSortBoxes& rSortCntBoxes )
{
- for( USHORT n = 0; n < rSortCntBoxes.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rSortCntBoxes.Count(); ++n )
rSortCntBoxes[ n ]->pSttNd = 0;
}
@@ -319,7 +319,7 @@ SwTable::~SwTable()
//JP: reicht leider nicht, es muessen die Pointer auf den StartNode
// der Section geloescht werden
DelBoxNode( aSortCntBoxes );
- aSortCntBoxes.Remove( (USHORT)0, aSortCntBoxes.Count() );
+ aSortCntBoxes.Remove( (sal_uInt16)0, aSortCntBoxes.Count() );
delete pHTMLLayout;
}
@@ -330,7 +330,7 @@ SwTable::~SwTable()
|*************************************************************************/
inline void FmtInArr( SvPtrarr& rFmtArr, SwFmt* pBoxFmt )
{
- BOOL bRet = USHRT_MAX != rFmtArr.GetPos( (VoidPtr)pBoxFmt );
+ sal_Bool bRet = USHRT_MAX != rFmtArr.GetPos( (VoidPtr)pBoxFmt );
if( !bRet )
rFmtArr.Insert( (VoidPtr)pBoxFmt, rFmtArr.Count() );
}
@@ -341,11 +341,11 @@ void lcl_ModifyBoxes( SwTableBoxes &rBoxes, const long nOld,
void lcl_ModifyLines( SwTableLines &rLines, const long nOld,
const long nNew, SvPtrarr& rFmtArr, const bool bCheckSum )
{
- for ( USHORT i = 0; i < rLines.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rLines.Count(); ++i )
::lcl_ModifyBoxes( rLines[i]->GetTabBoxes(), nOld, nNew, rFmtArr );
if( bCheckSum )
{
- for( USHORT i = 0; i < rFmtArr.Count(); ++i )
+ for( sal_uInt16 i = 0; i < rFmtArr.Count(); ++i )
{
SwFmt* pFmt = (SwFmt*)rFmtArr[i];
sal_uInt64 nBox = pFmt->GetFrmSize().GetWidth();
@@ -364,7 +364,7 @@ void lcl_ModifyBoxes( SwTableBoxes &rBoxes, const long nOld,
{
sal_uInt64 nSum = 0; // To avoid rounding errors we summarize all box widths
sal_uInt64 nOriginalSum = 0; // Sum of original widths
- for ( USHORT i = 0; i < rBoxes.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rBoxes.Count(); ++i )
{
SwTableBox &rBox = *rBoxes[i];
if ( rBox.GetTabLines().Count() )
@@ -406,13 +406,13 @@ void lcl_ModifyBoxes( SwTableBoxes &rBoxes, const long nOld,
void SwTable::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
{
// fange SSize Aenderungen ab, um die Lines/Boxen anzupassen
- USHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0 ;
+ sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0 ;
const SwFmtFrmSize* pNewSize = 0, *pOldSize = 0;
if( RES_ATTRSET_CHG == nWhich )
{
if( SFX_ITEM_SET == ((SwAttrSetChg*)pNew)->GetChgSet()->GetItemState(
- RES_FRM_SIZE, FALSE, (const SfxPoolItem**)&pNewSize ))
+ RES_FRM_SIZE, sal_False, (const SfxPoolItem**)&pNewSize ))
pOldSize = &((SwAttrSetChg*)pOld)->GetChgSet()->GetFrmSize();
}
else if( RES_FRM_SIZE == nWhich )
@@ -437,7 +437,7 @@ void SwTable::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
void SwTable::AdjustWidths( const long nOld, const long nNew )
{
- SvPtrarr aFmtArr( (BYTE)aLines[0]->GetTabBoxes().Count(), 1 );
+ SvPtrarr aFmtArr( (sal_uInt8)aLines[0]->GetTabBoxes().Count(), 1 );
::lcl_ModifyLines( aLines, nOld, nNew, aFmtArr, true );
}
@@ -446,20 +446,20 @@ void SwTable::AdjustWidths( const long nOld, const long nNew )
|* SwTable::GetTabCols()
|*
|*************************************************************************/
-void lcl_RefreshHidden( SwTabCols &rToFill, USHORT nPos )
+void lcl_RefreshHidden( SwTabCols &rToFill, sal_uInt16 nPos )
{
- for ( USHORT i = 0; i < rToFill.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rToFill.Count(); ++i )
{
if ( Abs((long)(nPos - rToFill[i])) <= COLFUZZY )
{
- rToFill.SetHidden( i, FALSE );
+ rToFill.SetHidden( i, sal_False );
break;
}
}
}
void lcl_SortedTabColInsert( SwTabCols &rToFill, const SwTableBox *pBox,
- const SwFrmFmt *pTabFmt, const BOOL bHidden,
+ const SwFrmFmt *pTabFmt, const sal_Bool bHidden,
const FASTBOOL bRefreshHidden )
{
const long nWish = pTabFmt->GetFrmSize().GetWidth();
@@ -467,32 +467,32 @@ void lcl_SortedTabColInsert( SwTabCols &rToFill, const SwTableBox *pBox,
//Der Wert fuer die linke Kante der Box errechnet sich aus den
//Breiten der vorhergehenden Boxen.
- USHORT nPos = 0;
- USHORT nSum = 0;
- USHORT nLeftMin = 0;
- USHORT nRightMax = 0;
+ sal_uInt16 nPos = 0;
+ sal_uInt16 nSum = 0;
+ sal_uInt16 nLeftMin = 0;
+ sal_uInt16 nRightMax = 0;
const SwTableBox *pCur = pBox;
const SwTableLine *pLine = pBox->GetUpper();
while ( pLine )
{ const SwTableBoxes &rBoxes = pLine->GetTabBoxes();
- for ( USHORT i = 0; i < rBoxes.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rBoxes.Count(); ++i )
{
SwTwips nWidth = rBoxes[i]->GetFrmFmt()->GetFrmSize().GetWidth();
- nSum = (USHORT)(nSum + nWidth);
+ nSum = (sal_uInt16)(nSum + nWidth);
sal_uInt64 nTmp = nSum;
nTmp *= nAct;
nTmp /= nWish;
if (rBoxes[i] != pCur)
{
if ( pLine == pBox->GetUpper() || 0 == nLeftMin )
- nLeftMin = (USHORT)(nTmp - nPos);
- nPos = (USHORT)nTmp;
+ nLeftMin = (sal_uInt16)(nTmp - nPos);
+ nPos = (sal_uInt16)nTmp;
}
else
{
- nSum = (USHORT)(nSum - nWidth);
+ nSum = (sal_uInt16)(nSum - nWidth);
if ( 0 == nRightMax )
- nRightMax = (USHORT)(nTmp - nPos);
+ nRightMax = (sal_uInt16)(nTmp - nPos);
break;
}
}
@@ -500,18 +500,18 @@ void lcl_SortedTabColInsert( SwTabCols &rToFill, const SwTableBox *pBox,
pLine = pCur ? pCur->GetUpper() : 0;
}
- BOOL bInsert = !bRefreshHidden;
- for ( USHORT j = 0; bInsert && (j < rToFill.Count()); ++j )
+ sal_Bool bInsert = !bRefreshHidden;
+ for ( sal_uInt16 j = 0; bInsert && (j < rToFill.Count()); ++j )
{
long nCmp = rToFill[j];
if ( (nPos >= ((nCmp >= COLFUZZY) ? nCmp - COLFUZZY : nCmp)) &&
(nPos <= (nCmp + COLFUZZY)) )
{
- bInsert = FALSE; //Hat ihn schon.
+ bInsert = sal_False; //Hat ihn schon.
}
else if ( nPos < nCmp )
{
- bInsert = FALSE;
+ bInsert = sal_False;
rToFill.Insert( nPos, bHidden, j );
}
}
@@ -529,7 +529,7 @@ void lcl_SortedTabColInsert( SwTabCols &rToFill, const SwTableBox *pBox,
// check if nPos is entry:
bool bFoundPos = false;
bool bFoundMax = false;
- for ( USHORT j = 0; !(bFoundPos && bFoundMax ) && j < rToFill.Count(); ++j )
+ for ( sal_uInt16 j = 0; !(bFoundPos && bFoundMax ) && j < rToFill.Count(); ++j )
{
SwTabColsEntry& rEntry = rToFill.GetEntry( j );
long nCmp = rToFill[j];
@@ -568,26 +568,26 @@ void lcl_ProcessBoxGet( const SwTableBox *pBox, SwTabCols &rToFill,
if ( pBox->GetTabLines().Count() )
{
const SwTableLines &rLines = pBox->GetTabLines();
- for ( USHORT i = 0; i < rLines.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rLines.Count(); ++i )
{ const SwTableBoxes &rBoxes = rLines[i]->GetTabBoxes();
- for ( USHORT j = 0; j < rBoxes.Count(); ++j )
+ for ( sal_uInt16 j = 0; j < rBoxes.Count(); ++j )
::lcl_ProcessBoxGet( rBoxes[j], rToFill, pTabFmt, bRefreshHidden);
}
}
else
- ::lcl_SortedTabColInsert( rToFill, pBox, pTabFmt, FALSE, bRefreshHidden );
+ ::lcl_SortedTabColInsert( rToFill, pBox, pTabFmt, sal_False, bRefreshHidden );
}
void lcl_ProcessLineGet( const SwTableLine *pLine, SwTabCols &rToFill,
const SwFrmFmt *pTabFmt )
{
- for ( USHORT i = 0; i < pLine->GetTabBoxes().Count(); ++i )
+ for ( sal_uInt16 i = 0; i < pLine->GetTabBoxes().Count(); ++i )
{
const SwTableBox *pBox = pLine->GetTabBoxes()[i];
if ( pBox->GetSttNd() )
- ::lcl_SortedTabColInsert( rToFill, pBox, pTabFmt, TRUE, FALSE );
+ ::lcl_SortedTabColInsert( rToFill, pBox, pTabFmt, sal_True, sal_False );
else
- for ( USHORT j = 0; j < pBox->GetTabLines().Count(); ++j )
+ for ( sal_uInt16 j = 0; j < pBox->GetTabLines().Count(); ++j )
::lcl_ProcessLineGet( pBox->GetTabLines()[j], rToFill, pTabFmt );
}
}
@@ -599,14 +599,14 @@ void lcl_ProcessLineGet( const SwTableLine *pLine, SwTabCols &rToFill,
#endif
void SwTable::GetTabCols( SwTabCols &rToFill, const SwTableBox *pStart,
- BOOL bRefreshHidden, BOOL bCurRowOnly ) const
+ sal_Bool bRefreshHidden, sal_Bool bCurRowOnly ) const
{
//MA 30. Nov. 95: Opt: wenn bHidden gesetzt ist, wird nur das Hidden
//Array aktualisiert.
if ( bRefreshHidden )
{
//Korrekturen entfernen
- USHORT i;
+ sal_uInt16 i;
for ( i = 0; i < rToFill.Count(); ++i )
{
SwTabColsEntry& rEntry = rToFill.GetEntry( i );
@@ -617,7 +617,7 @@ void SwTable::GetTabCols( SwTabCols &rToFill, const SwTableBox *pStart,
//Alle sind hidden, dann die sichtbaren eintragen.
for ( i = 0; i < rToFill.Count(); ++i )
- rToFill.SetHidden( i, TRUE );
+ rToFill.SetHidden( i, sal_True );
}
else
{
@@ -647,7 +647,7 @@ void SwTable::GetTabCols( SwTabCols &rToFill, const SwTableBox *pStart,
//1.
const SwTableBoxes &rBoxes = pStart->GetUpper()->GetTabBoxes();
- USHORT i;
+ sal_uInt16 i;
for ( i = 0; i < rBoxes.Count(); ++i )
::lcl_ProcessBoxGet( rBoxes[i], rToFill, pTabFmt, bRefreshHidden );
@@ -657,9 +657,9 @@ void SwTable::GetTabCols( SwTabCols &rToFill, const SwTableBox *pStart,
while ( pLine )
{
const SwTableBoxes &rBoxes2 = pLine->GetTabBoxes();
- for ( USHORT k = 0; k < rBoxes2.Count(); ++k )
+ for ( sal_uInt16 k = 0; k < rBoxes2.Count(); ++k )
::lcl_SortedTabColInsert( rToFill, rBoxes2[k],
- pTabFmt, FALSE, bRefreshHidden );
+ pTabFmt, sal_False, bRefreshHidden );
pLine = pLine->GetUpper() ? pLine->GetUpper()->GetUpper() : 0;
}
@@ -710,9 +710,9 @@ struct Parm
Parm( const SwTabCols &rN, const SwTabCols &rO ) :
rNew( rN ), rOld( rO ), aBoxArr( 10, 1 ) {}
};
-inline BOOL BoxInArr( SvPtrarr& rArr, SwTableBox* pBox )
+inline sal_Bool BoxInArr( SvPtrarr& rArr, SwTableBox* pBox )
{
- BOOL bRet = USHRT_MAX != rArr.GetPos( (VoidPtr)pBox );
+ sal_Bool bRet = USHRT_MAX != rArr.GetPos( (VoidPtr)pBox );
if( !bRet )
rArr.Insert( (VoidPtr)pBox, rArr.Count() );
return bRet;
@@ -724,7 +724,7 @@ void lcl_ProcessLine( SwTableLine *pLine, Parm &rParm )
{
SwTableBoxes &rBoxes = pLine->GetTabBoxes();
for ( int i = rBoxes.Count()-1; i >= 0; --i )
- ::lcl_ProcessBoxSet( rBoxes[ static_cast< USHORT >(i) ], rParm );
+ ::lcl_ProcessBoxSet( rBoxes[ static_cast< sal_uInt16 >(i) ], rParm );
}
void lcl_ProcessBoxSet( SwTableBox *pBox, Parm &rParm )
@@ -732,7 +732,7 @@ void lcl_ProcessBoxSet( SwTableBox *pBox, Parm &rParm )
if ( pBox->GetTabLines().Count() )
{ SwTableLines &rLines = pBox->GetTabLines();
for ( int i = rLines.Count()-1; i >= 0; --i )
- lcl_ProcessLine( rLines[ static_cast< USHORT >(i) ], rParm );
+ lcl_ProcessLine( rLines[ static_cast< sal_uInt16 >(i) ], rParm );
}
else
{
@@ -753,13 +753,13 @@ void lcl_ProcessBoxSet( SwTableBox *pBox, Parm &rParm )
while ( pLine )
{ const SwTableBoxes &rBoxes = pLine->GetTabBoxes();
- for ( USHORT i = 0; (i < rBoxes.Count()) && (rBoxes[i] != pCur); ++i)
+ for ( sal_uInt16 i = 0; (i < rBoxes.Count()) && (rBoxes[i] != pCur); ++i)
{
sal_uInt64 nWidth = rBoxes[i]->GetFrmFmt()->
GetFrmSize().GetWidth();
nWidth *= nOldAct;
nWidth /= rParm.nOldWish;
- nLeft += (USHORT)nWidth;
+ nLeft += (sal_uInt16)nWidth;
}
pCur = pLine->GetUpper();
pLine = pCur ? pCur->GetUpper() : 0;
@@ -773,9 +773,9 @@ void lcl_ProcessBoxSet( SwTableBox *pBox, Parm &rParm )
nWidth *= nOldAct;
nWidth /= rParm.nOldWish;
long nRight = nLeft + (long)nWidth;
- USHORT nLeftPos = USHRT_MAX,
+ sal_uInt16 nLeftPos = USHRT_MAX,
nRightPos = USHRT_MAX;
- for ( USHORT i = 0; i < rParm.rOld.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rParm.rOld.Count(); ++i )
{
if ( nLeft >= (rParm.rOld[i] - COLFUZZY) &&
nLeft <= (rParm.rOld[i] + COLFUZZY) )
@@ -801,8 +801,8 @@ void lcl_ProcessBoxSet( SwTableBox *pBox, Parm &rParm )
nWidth /= rParm.nOldWish;
long nTmp = (long)nWidth;
nTmp += rParm.rOld.GetLeft();
- USHORT nLeftPos = USHRT_MAX;
- for ( USHORT i = 0; i < rParm.rOld.Count() &&
+ sal_uInt16 nLeftPos = USHRT_MAX;
+ for ( sal_uInt16 i = 0; i < rParm.rOld.Count() &&
nLeftPos == USHRT_MAX; ++i )
{
if ( nTmp >= (rParm.rOld[i] - COLFUZZY) &&
@@ -823,7 +823,7 @@ void lcl_ProcessBoxSet( SwTableBox *pBox, Parm &rParm )
if( pBox->getRowSpan() == 1 )
{
SwTableBoxes& rTblBoxes = pBox->GetUpper()->GetTabBoxes();
- USHORT nPos = rTblBoxes.C40_GETPOS( SwTableBox, pBox );
+ sal_uInt16 nPos = rTblBoxes.C40_GETPOS( SwTableBox, pBox );
if( nPos && rTblBoxes[ nPos - 1 ]->getRowSpan() != 1 )
nLeftDiff = 0;
if( nPos + 1 < rTblBoxes.Count() &&
@@ -881,15 +881,15 @@ void lcl_ProcessBoxSet( SwTableBox *pBox, Parm &rParm )
}
void lcl_ProcessBoxPtr( SwTableBox *pBox, SvPtrarr &rBoxArr,
- BOOL bBefore )
+ sal_Bool bBefore )
{
if ( pBox->GetTabLines().Count() )
{
const SwTableLines &rLines = pBox->GetTabLines();
- for ( USHORT i = 0; i < rLines.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rLines.Count(); ++i )
{
const SwTableBoxes &rBoxes = rLines[i]->GetTabBoxes();
- for ( USHORT j = 0; j < rBoxes.Count(); ++j )
+ for ( sal_uInt16 j = 0; j < rBoxes.Count(); ++j )
::lcl_ProcessBoxPtr( rBoxes[j], rBoxArr, bBefore );
}
}
@@ -903,7 +903,7 @@ void lcl_AdjustBox( SwTableBox *pBox, const long nDiff, Parm &rParm );
void lcl_AdjustLines( SwTableLines &rLines, const long nDiff, Parm &rParm )
{
- for ( USHORT i = 0; i < rLines.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rLines.Count(); ++i )
{
SwTableBox *pBox = rLines[i]->GetTabBoxes()
[rLines[i]->GetTabBoxes().Count()-1];
@@ -926,7 +926,7 @@ void lcl_AdjustBox( SwTableBox *pBox, const long nDiff, Parm &rParm )
}
void SwTable::SetTabCols( const SwTabCols &rNew, const SwTabCols &rOld,
- const SwTableBox *pStart, BOOL bCurRowOnly )
+ const SwTableBox *pStart, sal_Bool bCurRowOnly )
{
CHECK_TABLE( *this )
@@ -967,8 +967,8 @@ void SwTable::SetTabCols( const SwTabCols &rNew, const SwTabCols &rOld,
SwFmtHoriOrient aOri( pFmt->GetHoriOrient() );
if(text::HoriOrientation::NONE != aOri.GetHoriOrient())
{
- const BOOL bLeftDist = rNew.GetLeft() != nShLeft;
- const BOOL bRightDist = rNew.GetRight() + nShRight != rNew.GetRightMax();
+ const sal_Bool bLeftDist = rNew.GetLeft() != nShLeft;
+ const sal_Bool bRightDist = rNew.GetRight() + nShRight != rNew.GetRightMax();
if(!bLeftDist && !bRightDist)
aOri.SetHoriOrient( text::HoriOrientation::FULL );
else if(!bRightDist && rNew.GetLeft() > nShLeft )
@@ -1032,8 +1032,8 @@ void SwTable::SetTabCols( const SwTabCols &rNew, const SwTabCols &rOld,
//entsprechenden Boxen in einem PtrArray vorzumerken.
const SwTableBoxes &rBoxes = pStart->GetUpper()->GetTabBoxes();
- for ( USHORT i = 0; i < rBoxes.Count(); ++i )
- ::lcl_ProcessBoxPtr( rBoxes[i], aParm.aBoxArr, FALSE );
+ for ( sal_uInt16 i = 0; i < rBoxes.Count(); ++i )
+ ::lcl_ProcessBoxPtr( rBoxes[i], aParm.aBoxArr, sal_False );
const SwTableLine *pLine = pStart->GetUpper()->GetUpper() ?
pStart->GetUpper()->GetUpper()->GetUpper() : 0;
@@ -1041,13 +1041,13 @@ void SwTable::SetTabCols( const SwTabCols &rNew, const SwTabCols &rOld,
while ( pLine )
{
const SwTableBoxes &rBoxes2 = pLine->GetTabBoxes();
- BOOL bBefore = TRUE;
- for ( USHORT i = 0; i < rBoxes2.Count(); ++i )
+ sal_Bool bBefore = sal_True;
+ for ( sal_uInt16 i = 0; i < rBoxes2.Count(); ++i )
{
if ( rBoxes2[i] != pExcl )
::lcl_ProcessBoxPtr( rBoxes2[i], aParm.aBoxArr, bBefore );
else
- bBefore = FALSE;
+ bBefore = sal_False;
}
pExcl = pLine->GetUpper();
pLine = pLine->GetUpper() ? pLine->GetUpper()->GetUpper() : 0;
@@ -1057,7 +1057,7 @@ void SwTable::SetTabCols( const SwTabCols &rNew, const SwTabCols &rOld,
//verarbeitet zu werden.
for ( int j = aParm.aBoxArr.Count()-1; j >= 0; --j )
{
- SwTableBox *pBox = (SwTableBox*)aParm.aBoxArr[ static_cast< USHORT >(j)];
+ SwTableBox *pBox = (SwTableBox*)aParm.aBoxArr[ static_cast< sal_uInt16 >(j)];
::lcl_ProcessBoxSet( pBox, aParm );
}
}
@@ -1069,7 +1069,7 @@ void SwTable::SetTabCols( const SwTabCols &rNew, const SwTabCols &rOld,
//gearbeitet werden!
SwTableLines &rLines = GetTabLines();
for ( int i = rLines.Count()-1; i >= 0; --i )
- ::lcl_ProcessLine( rLines[ static_cast< USHORT >(i) ], aParm );
+ ::lcl_ProcessLine( rLines[ static_cast< sal_uInt16 >(i) ], aParm );
}
}
@@ -1079,23 +1079,23 @@ void SwTable::SetTabCols( const SwTabCols &rNew, const SwTabCols &rOld,
extern void _CheckBoxWidth( const SwTableLine&, SwTwips );
// checke doch mal ob die Tabellen korrekte Breiten haben
SwTwips nSize = GetFrmFmt()->GetFrmSize().GetWidth();
- for( USHORT n = 0; n < aLines.Count(); ++n )
+ for( sal_uInt16 n = 0; n < aLines.Count(); ++n )
_CheckBoxWidth( *aLines[ n ], nSize );
}
#endif
}
-typedef std::pair<USHORT, USHORT> ColChange;
+typedef std::pair<sal_uInt16, sal_uInt16> ColChange;
typedef std::list< ColChange > ChangeList;
static void lcl_AdjustWidthsInLine( SwTableLine* pLine, ChangeList& rOldNew,
- Parm& rParm, USHORT nColFuzzy )
+ Parm& rParm, sal_uInt16 nColFuzzy )
{
ChangeList::iterator pCurr = rOldNew.begin();
if( pCurr == rOldNew.end() )
return;
- USHORT nCount = pLine->GetTabBoxes().Count();
- USHORT i = 0;
+ sal_uInt16 nCount = pLine->GetTabBoxes().Count();
+ sal_uInt16 i = 0;
SwTwips nBorder = 0;
SwTwips nRest = 0;
while( i < nCount )
@@ -1138,7 +1138,7 @@ static void lcl_AdjustWidthsInLine( SwTableLine* pLine, ChangeList& rOldNew,
}
}
-static void lcl_CalcNewWidths( std::list<USHORT> &rSpanPos, ChangeList& rChanges,
+static void lcl_CalcNewWidths( std::list<sal_uInt16> &rSpanPos, ChangeList& rChanges,
SwTableLine* pLine, long nWish, long nWidth, bool bTop )
{
if( !rChanges.size() )
@@ -1151,17 +1151,17 @@ static void lcl_CalcNewWidths( std::list<USHORT> &rSpanPos, ChangeList& rChanges
rChanges.clear();
return;
}
- std::list<USHORT> aNewSpanPos;
+ std::list<sal_uInt16> aNewSpanPos;
ChangeList aNewChanges;
ChangeList::iterator pCurr = rChanges.begin();
aNewChanges.push_back( *pCurr ); // Nullposition
- std::list<USHORT>::iterator pSpan = rSpanPos.begin();
- USHORT nCurr = 0;
- USHORT nOrgSum = 0;
+ std::list<sal_uInt16>::iterator pSpan = rSpanPos.begin();
+ sal_uInt16 nCurr = 0;
+ sal_uInt16 nOrgSum = 0;
bool bRowSpan = false;
- USHORT nRowSpanCount = 0;
- USHORT nCount = pLine->GetTabBoxes().Count();
- for( USHORT nCurrBox = 0; nCurrBox < nCount; ++nCurrBox )
+ sal_uInt16 nRowSpanCount = 0;
+ sal_uInt16 nCount = pLine->GetTabBoxes().Count();
+ for( sal_uInt16 nCurrBox = 0; nCurrBox < nCount; ++nCurrBox )
{
SwTableBox* pBox = pLine->GetTabBoxes()[nCurrBox];
SwTwips nCurrWidth = pBox->GetFrmFmt()->GetFrmSize().GetWidth();
@@ -1171,17 +1171,17 @@ static void lcl_CalcNewWidths( std::list<USHORT> &rSpanPos, ChangeList& rChanges
if( bRowSpan || bCurrRowSpan )
aNewSpanPos.push_back( nRowSpanCount );
bRowSpan = bCurrRowSpan;
- nOrgSum = (USHORT)(nOrgSum + nCurrWidth);
+ nOrgSum = (sal_uInt16)(nOrgSum + nCurrWidth);
sal_uInt64 nSum = nOrgSum;
nSum *= nWidth;
nSum /= nWish;
nSum *= nWish;
nSum /= nWidth;
- USHORT nPos = (USHORT)nSum;
+ sal_uInt16 nPos = (sal_uInt16)nSum;
while( pCurr != rChanges.end() && pCurr->first < nPos )
{
#ifdef DBG_UTIL
- USHORT nTemp = pCurr->first;
+ sal_uInt16 nTemp = pCurr->first;
nTemp = pCurr->second;
#endif
++nCurr;
@@ -1230,7 +1230,7 @@ static void lcl_CalcNewWidths( std::list<USHORT> &rSpanPos, ChangeList& rChanges
nTmp *= pLeftMove->second - pLast->second;
nTmp /= pLeftMove->first - pLast->first;
nTmp += pLast->second;
- pCurr->second = (USHORT)nTmp;
+ pCurr->second = (sal_uInt16)nTmp;
}
}
pLast = pCurr;
@@ -1254,7 +1254,7 @@ static void lcl_CalcNewWidths( std::list<USHORT> &rSpanPos, ChangeList& rChanges
nTmp *= pNext->second - pLast->second;
nTmp /= pNext->first - pLast->first;
nTmp += pLast->second;
- pCurr->second = (USHORT)nTmp;
+ pCurr->second = (sal_uInt16)nTmp;
}
++pCurr;
}
@@ -1272,13 +1272,13 @@ static void lcl_CalcNewWidths( std::list<USHORT> &rSpanPos, ChangeList& rChanges
while( pCopy != aNewChanges.end() )
rChanges.push_back( *pCopy++ );
rSpanPos.clear();
- std::list<USHORT>::iterator pSpCopy = aNewSpanPos.begin();
+ std::list<sal_uInt16>::iterator pSpCopy = aNewSpanPos.begin();
while( pSpCopy != aNewSpanPos.end() )
rSpanPos.push_back( *pSpCopy++ );
}
void SwTable::NewSetTabCols( Parm &rParm, const SwTabCols &rNew,
- const SwTabCols &rOld, const SwTableBox *pStart, BOOL bCurRowOnly )
+ const SwTabCols &rOld, const SwTableBox *pStart, sal_Bool bCurRowOnly )
{
#ifdef DBG_UTIL
static int nCallCount = 0;
@@ -1290,7 +1290,7 @@ void SwTable::NewSetTabCols( Parm &rParm, const SwTabCols &rNew,
const long nOldWidth = rParm.rOld.GetRight() - rParm.rOld.GetLeft();
if( nNewWidth < 1 || nOldWidth < 1 )
return;
- for( USHORT i = 0; i <= rOld.Count(); ++i )
+ for( sal_uInt16 i = 0; i <= rOld.Count(); ++i )
{
sal_uInt64 nNewPos;
sal_uInt64 nOldPos;
@@ -1310,7 +1310,7 @@ void SwTable::NewSetTabCols( Parm &rParm, const SwTabCols &rNew,
nOldPos /= nOldWidth;
if( nOldPos != nNewPos && nNewPos > 0 && nOldPos > 0 )
{
- ColChange aChg( (USHORT)nOldPos, (USHORT)nNewPos );
+ ColChange aChg( (sal_uInt16)nOldPos, (sal_uInt16)nNewPos );
aOldNew.push_back( aChg );
}
}
@@ -1322,18 +1322,18 @@ void SwTable::NewSetTabCols( Parm &rParm, const SwTabCols &rNew,
if( bCurRowOnly )
{
const SwTableLine* pCurrLine = pStart->GetUpper();
- USHORT nCurr = rLines.C40_GETPOS( SwTableLine, pCurrLine );
+ sal_uInt16 nCurr = rLines.C40_GETPOS( SwTableLine, pCurrLine );
if( nCurr >= USHRT_MAX )
return;
ColChange aChg( 0, 0 );
aOldNew.push_front( aChg );
- std::list<USHORT> aRowSpanPos;
+ std::list<sal_uInt16> aRowSpanPos;
if( nCurr )
{
ChangeList aCopy;
ChangeList::iterator pCop = aOldNew.begin();
- USHORT nPos = 0;
+ sal_uInt16 nPos = 0;
while( pCop != aOldNew.end() )
{
aCopy.push_back( *pCop );
@@ -1343,7 +1343,7 @@ void SwTable::NewSetTabCols( Parm &rParm, const SwTabCols &rNew,
lcl_CalcNewWidths( aRowSpanPos, aCopy, rLines[nCurr],
rParm.nOldWish, nOldWidth, true );
bool bGoOn = aRowSpanPos.size() > 0;
- USHORT j = nCurr;
+ sal_uInt16 j = nCurr;
while( bGoOn )
{
lcl_CalcNewWidths( aRowSpanPos, aCopy, rLines[--j],
@@ -1357,7 +1357,7 @@ void SwTable::NewSetTabCols( Parm &rParm, const SwTabCols &rNew,
{
ChangeList aCopy;
ChangeList::iterator pCop = aOldNew.begin();
- USHORT nPos = 0;
+ sal_uInt16 nPos = 0;
while( pCop != aOldNew.end() )
{
aCopy.push_back( *pCop );
@@ -1367,7 +1367,7 @@ void SwTable::NewSetTabCols( Parm &rParm, const SwTabCols &rNew,
lcl_CalcNewWidths( aRowSpanPos, aCopy, rLines[nCurr],
rParm.nOldWish, nOldWidth, false );
bool bGoOn = aRowSpanPos.size() > 0;
- USHORT j = nCurr;
+ sal_uInt16 j = nCurr;
while( bGoOn )
{
lcl_CalcNewWidths( aRowSpanPos, aCopy, rLines[++j],
@@ -1378,7 +1378,7 @@ void SwTable::NewSetTabCols( Parm &rParm, const SwTabCols &rNew,
}
::lcl_AdjustWidthsInLine( rLines[nCurr], aOldNew, rParm, 1 );
}
- else for( USHORT i = 0; i < rLines.Count(); ++i )
+ else for( sal_uInt16 i = 0; i < rLines.Count(); ++i )
::lcl_AdjustWidthsInLine( rLines[i], aOldNew, rParm, COLFUZZY );
CHECK_TABLE( *this )
}
@@ -1391,31 +1391,31 @@ void SwTable::NewSetTabCols( Parm &rParm, const SwTabCols &rNew,
|*
|*************************************************************************/
-BOOL IsValidRowName( const String& rStr )
+sal_Bool IsValidRowName( const String& rStr )
{
- BOOL bIsValid = TRUE;
+ sal_Bool bIsValid = sal_True;
xub_StrLen nLen = rStr.Len();
for (xub_StrLen i = 0; i < nLen && bIsValid; ++i)
{
const sal_Unicode cChar = rStr.GetChar(i);
if (cChar < '0' || cChar > '9')
- bIsValid = FALSE;
+ bIsValid = sal_False;
}
return bIsValid;
}
// --> OD 2007-08-03 #i80314#
// add 3rd parameter and its handling
-USHORT SwTable::_GetBoxNum( String& rStr, BOOL bFirstPart,
+sal_uInt16 SwTable::_GetBoxNum( String& rStr, sal_Bool bFirstPart,
const bool bPerformValidCheck )
{
- USHORT nRet = 0;
+ sal_uInt16 nRet = 0;
xub_StrLen nPos = 0;
- if( bFirstPart ) // TRUE == column; FALSE == row
+ if( bFirstPart ) // sal_True == column; sal_False == row
{
// die 1. ist mit Buchstaben addressiert!
sal_Unicode cChar;
- BOOL bFirst = TRUE;
+ sal_Bool bFirst = sal_True;
while( 0 != ( cChar = rStr.GetChar( nPos )) &&
( (cChar >= 'A' && cChar <= 'Z') ||
(cChar >= 'a' && cChar <= 'z') ) )
@@ -1423,7 +1423,7 @@ USHORT SwTable::_GetBoxNum( String& rStr, BOOL bFirstPart,
if( (cChar -= 'A') >= 26 )
cChar -= 'a' - '[';
if( bFirst )
- bFirst = FALSE;
+ bFirst = sal_False;
else
++nRet;
nRet = nRet * 52 + cChar;
@@ -1436,7 +1436,7 @@ USHORT SwTable::_GetBoxNum( String& rStr, BOOL bFirstPart,
nRet = 0;
if ( !bPerformValidCheck || IsValidRowName( rStr ) )
{
- nRet = static_cast<USHORT>(rStr.ToInt32());
+ nRet = static_cast<sal_uInt16>(rStr.ToInt32());
}
rStr.Erase();
}
@@ -1446,7 +1446,7 @@ USHORT SwTable::_GetBoxNum( String& rStr, BOOL bFirstPart,
String aTxt( rStr.Copy( 0, nPos ) );
if ( !bPerformValidCheck || IsValidRowName( aTxt ) )
{
- nRet = static_cast<USHORT>(aTxt.ToInt32());
+ nRet = static_cast<sal_uInt16>(aTxt.ToInt32());
}
rStr.Erase( 0, nPos+1 );
}
@@ -1464,7 +1464,7 @@ const SwTableBox* SwTable::GetTblBox( const String& rName,
const SwTableLines* pLines;
const SwTableBoxes* pBoxes;
- USHORT nLine, nBox;
+ sal_uInt16 nLine, nBox;
String aNm( rName );
while( aNm.Len() )
{
@@ -1479,7 +1479,7 @@ const SwTableBox* SwTable::GetTblBox( const String& rName,
--nBox;
}
- nLine = SwTable::_GetBoxNum( aNm, FALSE, bPerformValidCheck );
+ nLine = SwTable::_GetBoxNum( aNm, sal_False, bPerformValidCheck );
// bestimme die Line
if( !nLine || nLine > pLines->Count() )
@@ -1497,7 +1497,7 @@ const SwTableBox* SwTable::GetTblBox( const String& rName,
// Box ist ??
if( pBox && !pBox->GetSttNd() )
{
- ASSERT( FALSE, "Box ohne Inhalt, suche die naechste !!" );
+ ASSERT( sal_False, "Box ohne Inhalt, suche die naechste !!" );
// "herunterfallen lassen" bis zur ersten Box
while( pBox->GetTabLines().Count() )
pBox = pBox->GetTabLines()[0]->GetTabBoxes()[0];
@@ -1505,7 +1505,7 @@ const SwTableBox* SwTable::GetTblBox( const String& rName,
return pBox;
}
-SwTableBox* SwTable::GetTblBox( ULONG nSttIdx )
+SwTableBox* SwTable::GetTblBox( sal_uLong nSttIdx )
{
//MA: Zur Optimierung nicht immer umstaendlich das ganze SortArray abhuenern.
//OS: #102675# converting text to table tries und certain conditions
@@ -1514,7 +1514,7 @@ SwTableBox* SwTable::GetTblBox( ULONG nSttIdx )
return 0;
SwTableBox* pRet = 0;
SwNodes& rNds = GetFrmFmt()->GetDoc()->GetNodes();
- ULONG nIndex = nSttIdx + 1;
+ sal_uLong nIndex = nSttIdx + 1;
SwCntntNode* pCNd = 0;
SwTableNode* pTblNd = 0;
@@ -1549,22 +1549,22 @@ SwTableBox* SwTable::GetTblBox( ULONG nSttIdx )
//Falls es das Layout noch nicht gibt oder sonstwie etwas schieft geht.
if ( !pRet )
{
- for( USHORT n = aSortCntBoxes.Count(); n; )
+ for( sal_uInt16 n = aSortCntBoxes.Count(); n; )
if( aSortCntBoxes[ --n ]->GetSttIdx() == nSttIdx )
return aSortCntBoxes[ n ];
}
return pRet;
}
-BOOL SwTable::IsTblComplex() const
+sal_Bool SwTable::IsTblComplex() const
{
- // returnt TRUE wenn sich in der Tabelle Verschachtelungen befinden
+ // returnt sal_True wenn sich in der Tabelle Verschachtelungen befinden
// steht eine Box nicht in der obersten Line, da wurde gesplittet/
// gemergt und die Struktur ist komplexer.
- for( USHORT n = 0; n < aSortCntBoxes.Count(); ++n )
+ for( sal_uInt16 n = 0; n < aSortCntBoxes.Count(); ++n )
if( aSortCntBoxes[ n ]->GetUpper()->GetUpper() )
- return TRUE;
- return FALSE;
+ return sal_True;
+ return sal_False;
}
@@ -1574,10 +1574,10 @@ BOOL SwTable::IsTblComplex() const
|* SwTableLine::SwTableLine()
|*
|*************************************************************************/
-SwTableLine::SwTableLine( SwTableLineFmt *pFmt, USHORT nBoxes,
+SwTableLine::SwTableLine( SwTableLineFmt *pFmt, sal_uInt16 nBoxes,
SwTableBox *pUp )
: SwClient( pFmt ),
- aBoxes( (BYTE)nBoxes, 1 ),
+ aBoxes( (sal_uInt8)nBoxes, 1 ),
pUpper( pUp )
{
}
@@ -1661,7 +1661,7 @@ void SwTableLine::ChgFrmFmt( SwTableLineFmt *pNewFmt )
if ( bInFirstNonHeadlineRow || bInFollowFlowRow )
pTab = pTab->FindMaster();
- pTab->SetRemoveFollowFlowLinePending( TRUE );
+ pTab->SetRemoveFollowFlowLinePending( sal_True );
pTab->InvalidatePos();
}
// <--
@@ -1719,9 +1719,9 @@ SwTwips SwTableLine::GetTableLineHeight( bool& bLayoutAvailable ) const
|* SwTableBox::SwTableBox()
|*
|*************************************************************************/
-SwTableBox::SwTableBox( SwTableBoxFmt* pFmt, USHORT nLines, SwTableLine *pUp )
+SwTableBox::SwTableBox( SwTableBoxFmt* pFmt, sal_uInt16 nLines, SwTableLine *pUp )
: SwClient( 0 ),
- aLines( (BYTE)nLines, 1 ),
+ aLines( (sal_uInt8)nLines, 1 ),
pSttNd( 0 ),
pUpper( pUp ),
pImpl( 0 )
@@ -1736,10 +1736,9 @@ SwTableBox::SwTableBox( SwTableBoxFmt* pFmt, const SwNodeIndex &rIdx,
pUpper( pUp ),
pImpl( 0 )
{
- SwDoc* pDoc = pFmt->GetDoc();
CheckBoxFmt( pFmt )->Add( this );
- pSttNd = pDoc->GetNodes()[ rIdx ]->GetStartNode();
+ pSttNd = rIdx.GetNode().GetStartNode();
// an der Table eintragen
const SwTableNode* pTblNd = pSttNd->FindTableNode();
@@ -1796,8 +1795,8 @@ SwTableBoxFmt* SwTableBox::CheckBoxFmt( SwTableBoxFmt* pFmt )
{
// sollte das Format eine Formel oder einen Value tragen, dann muss die
// Box alleine am Format haengen. Ggfs. muss ein neues angelegt werden.
- if( SFX_ITEM_SET == pFmt->GetItemState( RES_BOXATR_VALUE, FALSE ) ||
- SFX_ITEM_SET == pFmt->GetItemState( RES_BOXATR_FORMULA, FALSE ) )
+ if( SFX_ITEM_SET == pFmt->GetItemState( RES_BOXATR_VALUE, sal_False ) ||
+ SFX_ITEM_SET == pFmt->GetItemState( RES_BOXATR_FORMULA, sal_False ) )
{
SwTableBox* pOther = SwIterator<SwTableBox,SwFmt>::FirstElement( *pFmt );
if( pOther )
@@ -1871,7 +1870,7 @@ void SwTableBox::ChgFrmFmt( SwTableBoxFmt* pNewFmt )
pCell->InvalidateSize();
pCell->_InvalidatePrt();
pCell->SetCompletePaint();
- pCell->SetDerivedVert( FALSE );
+ pCell->SetDerivedVert( sal_False );
pCell->CheckDirChange();
// --> FME 2005-04-15 #i47489#
@@ -1903,10 +1902,10 @@ void SwTableBox::ChgFrmFmt( SwTableBoxFmt* pNewFmt )
|* und ergibt sich aus der Position in den Lines/Boxen/Tabelle
|*
|*************************************************************************/
-void lcl_GetTblBoxColStr( USHORT nCol, String& rNm )
+void lcl_GetTblBoxColStr( sal_uInt16 nCol, String& rNm )
{
- const USHORT coDiff = 52; // 'A'-'Z' 'a' - 'z'
- USHORT nCalc;
+ const sal_uInt16 coDiff = 52; // 'A'-'Z' 'a' - 'z'
+ sal_uInt16 nCalc;
do {
nCalc = nCol % coDiff;
@@ -1931,7 +1930,7 @@ String SwTableBox::GetName() const
}
const SwTable& rTbl = pSttNd->FindTableNode()->GetTable();
- USHORT nPos;
+ sal_uInt16 nPos;
String sNm, sTmp;
const SwTableBox* pBox = this;
do {
@@ -1957,10 +1956,10 @@ String SwTableBox::GetName() const
return sNm;
}
-BOOL SwTableBox::IsInHeadline( const SwTable* pTbl ) const
+sal_Bool SwTableBox::IsInHeadline( const SwTable* pTbl ) const
{
if( !GetUpper() ) // sollte nur beim Merge vorkommen.
- return FALSE;
+ return sal_False;
if( !pTbl )
pTbl = &pSttNd->FindTableNode()->GetTable();
@@ -1975,14 +1974,14 @@ BOOL SwTableBox::IsInHeadline( const SwTable* pTbl ) const
#ifdef DBG_UTIL
-ULONG SwTableBox::GetSttIdx() const
+sal_uLong SwTableBox::GetSttIdx() const
{
return pSttNd ? pSttNd->GetIndex() : 0;
}
#endif
// erfrage vom Client Informationen
-BOOL SwTable::GetInfo( SfxPoolItem& rInfo ) const
+sal_Bool SwTable::GetInfo( SfxPoolItem& rInfo ) const
{
switch( rInfo.Which() )
{
@@ -1997,7 +1996,7 @@ BOOL SwTable::GetInfo( SfxPoolItem& rInfo ) const
((SwAutoFmtGetDocNode&)rInfo).pCntntNode =
GetFrmFmt()->GetDoc()->GetNodes().GoNext( &aIdx );
}
- return FALSE;
+ return sal_False;
}
break;
}
@@ -2014,9 +2013,9 @@ BOOL SwTable::GetInfo( SfxPoolItem& rInfo ) const
{
((SwPtrMsgPoolItem&)rInfo).pObject = SwIterator<SwFrm,SwFmt>::FirstElement( *GetFrmFmt() );
}
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
SwTable * SwTable::FindTable( SwFrmFmt const*const pFmt )
@@ -2049,13 +2048,13 @@ void SwTable::SetHTMLTableLayout( SwHTMLTableLayout *p )
}
void ChgTextToNum( SwTableBox& rBox, const String& rTxt, const Color* pCol,
- BOOL bChgAlign )
+ sal_Bool bChgAlign )
{
- ULONG nNdPos = rBox.IsValidNumTxtNd( TRUE );
+ sal_uLong nNdPos = rBox.IsValidNumTxtNd( sal_True );
ChgTextToNum( rBox,rTxt,pCol,bChgAlign,nNdPos);
}
void ChgTextToNum( SwTableBox& rBox, const String& rTxt, const Color* pCol,
- BOOL bChgAlign,ULONG nNdPos )
+ sal_Bool bChgAlign,sal_uLong nNdPos )
{
if( ULONG_MAX != nNdPos )
@@ -2079,7 +2078,7 @@ void ChgTextToNum( SwTableBox& rBox, const String& rTxt, const Color* pCol,
// Farbe umsetzen oder "Benutzer Farbe" sichern
if( !pTNd->GetpSwAttrSet() || SFX_ITEM_SET != pTNd->GetpSwAttrSet()->
- GetItemState( RES_CHRATR_COLOR, FALSE, &pItem ))
+ GetItemState( RES_CHRATR_COLOR, sal_False, &pItem ))
pItem = 0;
const Color* pOldNumFmtColor = rBox.GetSaveNumFmtColor();
@@ -2136,7 +2135,7 @@ void ChgTextToNum( SwTableBox& rBox, const String& rTxt, const Color* pCol,
// zuruecksetzen, damit sie wieder aufgespannt werden
{
SwIndex aResetIdx( aIdx, n );
- pTNd->DontExpandFmt( aResetIdx, FALSE, FALSE );
+ pTNd->DontExpandFmt( aResetIdx, sal_False, sal_False );
}
if( !pDoc->IsIgnoreRedline() && pDoc->GetRedlineTbl().Count() )
@@ -2160,7 +2159,7 @@ void ChgTextToNum( SwTableBox& rBox, const String& rTxt, const Color* pCol,
// vertikale Ausrichtung umsetzen
if( bChgAlign &&
( SFX_ITEM_SET != rBox.GetFrmFmt()->GetItemState(
- RES_VERT_ORIENT, TRUE, &pItem ) ||
+ RES_VERT_ORIENT, sal_True, &pItem ) ||
text::VertOrientation::TOP == ((SwFmtVertOrient*)pItem)->GetVertOrient() ))
{
rBox.GetFrmFmt()->SetFmtAttr( SwFmtVertOrient( 0, text::VertOrientation::BOTTOM ));
@@ -2168,14 +2167,14 @@ void ChgTextToNum( SwTableBox& rBox, const String& rTxt, const Color* pCol,
}
}
-void ChgNumToText( SwTableBox& rBox, ULONG nFmt )
+void ChgNumToText( SwTableBox& rBox, sal_uLong nFmt )
{
- ULONG nNdPos = rBox.IsValidNumTxtNd( FALSE );
+ sal_uLong nNdPos = rBox.IsValidNumTxtNd( sal_False );
if( ULONG_MAX != nNdPos )
{
SwDoc* pDoc = rBox.GetFrmFmt()->GetDoc();
SwTxtNode* pTNd = pDoc->GetNodes()[ nNdPos ]->GetTxtNode();
- BOOL bChgAlign = pDoc->IsInsTblAlignNum();
+ sal_Bool bChgAlign = pDoc->IsInsTblAlignNum();
const SfxPoolItem* pItem;
Color* pCol = 0;
@@ -2190,7 +2189,7 @@ void ChgNumToText( SwTableBox& rBox, ULONG nFmt )
SwIndex aIdx( pTNd, sTxt.Len() );
//JP 06.04.99: Bug 64321 - DontExpand-Flags vorm Austauschen
// zuruecksetzen, damit sie wieder aufgespannt werden
- pTNd->DontExpandFmt( aIdx, FALSE, FALSE );
+ pTNd->DontExpandFmt( aIdx, sal_False, sal_False );
aIdx = 0;
pTNd->EraseText( aIdx, STRING_LEN,
IDocumentContentOperations::INS_EMPTYEXPAND );
@@ -2203,7 +2202,7 @@ void ChgNumToText( SwTableBox& rBox, ULONG nFmt )
// Ausrichtung umsetzen
if( bChgAlign && pAttrSet && SFX_ITEM_SET == pAttrSet->GetItemState(
- RES_PARATR_ADJUST, FALSE, &pItem ) &&
+ RES_PARATR_ADJUST, sal_False, &pItem ) &&
SVX_ADJUST_RIGHT == ((SvxAdjustItem*)pItem)->GetAdjust() )
{
pTNd->SetAttr( SvxAdjustItem( SVX_ADJUST_LEFT, RES_PARATR_ADJUST ) );
@@ -2211,7 +2210,7 @@ void ChgNumToText( SwTableBox& rBox, ULONG nFmt )
// Farbe umsetzen oder "Benutzer Farbe" sichern
if( !pAttrSet || SFX_ITEM_SET != pAttrSet->
- GetItemState( RES_CHRATR_COLOR, FALSE, &pItem ))
+ GetItemState( RES_CHRATR_COLOR, sal_False, &pItem ))
pItem = 0;
const Color* pOldNumFmtColor = rBox.GetSaveNumFmtColor();
@@ -2252,7 +2251,7 @@ void ChgNumToText( SwTableBox& rBox, ULONG nFmt )
// vertikale Ausrichtung umsetzen
if( bChgAlign &&
SFX_ITEM_SET == rBox.GetFrmFmt()->GetItemState(
- RES_VERT_ORIENT, FALSE, &pItem ) &&
+ RES_VERT_ORIENT, sal_False, &pItem ) &&
text::VertOrientation::BOTTOM == ((SwFmtVertOrient*)pItem)->GetVertOrient() )
{
rBox.GetFrmFmt()->SetFmtAttr( SwFmtVertOrient( 0, text::VertOrientation::TOP ));
@@ -2269,7 +2268,7 @@ void SwTableBoxFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
const SwTblBoxFormula *pNewFml = 0;
const SwTblBoxValue *pNewVal = 0;
double aOldValue = 0;
- ULONG nOldFmt = NUMBERFORMAT_TEXT;
+ sal_uLong nOldFmt = NUMBERFORMAT_TEXT;
switch( pNew ? pNew->Which() : 0 )
{
@@ -2277,13 +2276,13 @@ void SwTableBoxFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
const SfxItemSet& rSet = *((SwAttrSetChg*)pNew)->GetChgSet();
if( SFX_ITEM_SET == rSet.GetItemState( RES_BOXATR_FORMAT,
- FALSE, (const SfxPoolItem**)&pNewFmt ) )
+ sal_False, (const SfxPoolItem**)&pNewFmt ) )
nOldFmt = ((SwTblBoxNumFormat&)((SwAttrSetChg*)pOld)->
GetChgSet()->Get( RES_BOXATR_FORMAT )).GetValue();
- rSet.GetItemState( RES_BOXATR_FORMULA, FALSE,
+ rSet.GetItemState( RES_BOXATR_FORMULA, sal_False,
(const SfxPoolItem**)&pNewFml );
if( SFX_ITEM_SET == rSet.GetItemState( RES_BOXATR_VALUE,
- FALSE, (const SfxPoolItem**)&pNewVal ) )
+ sal_False, (const SfxPoolItem**)&pNewVal ) )
aOldValue = ((SwTblBoxValue&)((SwAttrSetChg*)pOld)->
GetChgSet()->Get( RES_BOXATR_VALUE )).GetValue();
}
@@ -2308,9 +2307,9 @@ void SwTableBoxFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
GetDoc()->SetFieldsDirty(true, NULL, 0);
- if( SFX_ITEM_SET == GetItemState( RES_BOXATR_FORMAT, FALSE ) ||
- SFX_ITEM_SET == GetItemState( RES_BOXATR_VALUE, FALSE ) ||
- SFX_ITEM_SET == GetItemState( RES_BOXATR_FORMULA, FALSE ) )
+ if( SFX_ITEM_SET == GetItemState( RES_BOXATR_FORMAT, sal_False ) ||
+ SFX_ITEM_SET == GetItemState( RES_BOXATR_VALUE, sal_False ) ||
+ SFX_ITEM_SET == GetItemState( RES_BOXATR_FORMULA, sal_False ) )
{
// die Box holen
SwIterator<SwTableBox,SwFmt> aIter( *this );
@@ -2319,19 +2318,19 @@ void SwTableBoxFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
ASSERT( !aIter.Next(), "keine Box oder mehrere am Format" );
- ULONG nNewFmt;
+ sal_uLong nNewFmt;
if( pNewFmt )
{
nNewFmt = pNewFmt->GetValue();
// neu Formatieren
// ist es neuer oder wurde der akt. entfernt?
- if( SFX_ITEM_SET != GetItemState( RES_BOXATR_VALUE, FALSE ))
+ if( SFX_ITEM_SET != GetItemState( RES_BOXATR_VALUE, sal_False ))
pNewFmt = 0;
}
else
{
// das akt. Item besorgen
- GetItemState( RES_BOXATR_FORMAT, FALSE,
+ GetItemState( RES_BOXATR_FORMAT, sal_False,
(const SfxPoolItem**)&pNewFmt );
nOldFmt = GetTblBoxNumFmt().GetValue();
nNewFmt = pNewFmt ? pNewFmt->GetValue() : nOldFmt;
@@ -2343,7 +2342,7 @@ void SwTableBoxFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
if( NUMBERFORMAT_TEXT != nNewFmt )
{
if( SFX_ITEM_SET == GetItemState(
- RES_BOXATR_VALUE, FALSE ))
+ RES_BOXATR_VALUE, sal_False ))
nOldFmt = NUMBERFORMAT_TEXT;
else
nNewFmt = NUMBERFORMAT_TEXT;
@@ -2365,26 +2364,26 @@ void SwTableBoxFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
// - vertikale Ausrichtung auf OEBN, wenn UNTEN gesetzt ist
SvNumberFormatter* pNumFmtr = GetDoc()->GetNumberFormatter();
- BOOL bNewIsTxtFmt = pNumFmtr->IsTextFormat( nNewFmt ) ||
+ sal_Bool bNewIsTxtFmt = pNumFmtr->IsTextFormat( nNewFmt ) ||
NUMBERFORMAT_TEXT == nNewFmt;
if( (!bNewIsTxtFmt && nOldFmt != nNewFmt) || pNewFml )
{
- BOOL bChgTxt = TRUE;
+ sal_Bool bChgTxt = sal_True;
double fVal = 0;
if( !pNewVal && SFX_ITEM_SET != GetItemState(
- RES_BOXATR_VALUE, FALSE, (const SfxPoolItem**)&pNewVal ))
+ RES_BOXATR_VALUE, sal_False, (const SfxPoolItem**)&pNewVal ))
{
// es wurde noch nie ein Wert gesetzt, dann versuche
// doch mal den Inhalt auszuwerten
- ULONG nNdPos = pBox->IsValidNumTxtNd( TRUE );
+ sal_uLong nNdPos = pBox->IsValidNumTxtNd( sal_True );
if( ULONG_MAX != nNdPos )
{
sal_uInt32 nTmpFmtIdx = nNewFmt;
String aTxt( GetDoc()->GetNodes()[ nNdPos ]
->GetTxtNode()->GetRedlineTxt());
if( !aTxt.Len() )
- bChgTxt = FALSE;
+ bChgTxt = sal_False;
else
{
//JP 15.09.98: Bug 55741 - Tabs beibehalten
@@ -2392,7 +2391,7 @@ void SwTableBoxFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
// JP 22.04.98: Bug 49659 -
// Sonderbehandlung fuer Prozent
- BOOL bIsNumFmt = FALSE;
+ sal_Bool bIsNumFmt = sal_False;
if( NUMBERFORMAT_PERCENT ==
pNumFmtr->GetType( nNewFmt ))
{
@@ -2466,11 +2465,11 @@ void SwTableBoxFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
SwFrmFmt::Modify( pOld, pNew );
}
-BOOL SwTableBox::HasNumCntnt( double& rNum, sal_uInt32& rFmtIndex,
- BOOL& rIsEmptyTxtNd ) const
+sal_Bool SwTableBox::HasNumCntnt( double& rNum, sal_uInt32& rFmtIndex,
+ sal_Bool& rIsEmptyTxtNd ) const
{
- BOOL bRet = FALSE;
- ULONG nNdPos = IsValidNumTxtNd( TRUE );
+ sal_Bool bRet = sal_False;
+ sal_uLong nNdPos = IsValidNumTxtNd( sal_True );
if( ULONG_MAX != nNdPos )
{
String aTxt( pSttNd->GetNodes()[ nNdPos ]->GetTxtNode()->
@@ -2482,7 +2481,7 @@ BOOL SwTableBox::HasNumCntnt( double& rNum, sal_uInt32& rFmtIndex,
const SfxPoolItem* pItem;
if( SFX_ITEM_SET == GetFrmFmt()->GetItemState( RES_BOXATR_FORMAT,
- FALSE, &pItem ))
+ sal_False, &pItem ))
{
rFmtIndex = ((SwTblBoxNumFormat*)pItem)->GetValue();
// JP 22.04.98: Bug 49659 - Sonderbehandlung fuer Prozent
@@ -2499,31 +2498,49 @@ BOOL SwTableBox::HasNumCntnt( double& rNum, sal_uInt32& rFmtIndex,
rFmtIndex = 0;
bRet = pNumFmtr->IsNumberFormat( aTxt, rFmtIndex, rNum );
+<<<<<<< local
+=======
+
+/*
+// 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;
+ }
+*/
+>>>>>>> other
}
else
- rIsEmptyTxtNd = FALSE;
+ rIsEmptyTxtNd = sal_False;
return bRet;
}
-BOOL SwTableBox::IsNumberChanged() const
+sal_Bool SwTableBox::IsNumberChanged() const
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
- if( SFX_ITEM_SET == GetFrmFmt()->GetItemState( RES_BOXATR_FORMULA, FALSE ))
+ if( SFX_ITEM_SET == GetFrmFmt()->GetItemState( RES_BOXATR_FORMULA, sal_False ))
{
const SwTblBoxNumFormat *pNumFmt;
const SwTblBoxValue *pValue;
- if( SFX_ITEM_SET != GetFrmFmt()->GetItemState( RES_BOXATR_VALUE, FALSE,
+ if( SFX_ITEM_SET != GetFrmFmt()->GetItemState( RES_BOXATR_VALUE, sal_False,
(const SfxPoolItem**)&pValue ))
pValue = 0;
- if( SFX_ITEM_SET != GetFrmFmt()->GetItemState( RES_BOXATR_FORMAT, FALSE,
+ if( SFX_ITEM_SET != GetFrmFmt()->GetItemState( RES_BOXATR_FORMAT, sal_False,
(const SfxPoolItem**)&pNumFmt ))
pNumFmt = 0;
- ULONG nNdPos;
+ sal_uLong nNdPos;
if( pNumFmt && pValue &&
- ULONG_MAX != ( nNdPos = IsValidNumTxtNd( TRUE ) ) )
+ ULONG_MAX != ( nNdPos = IsValidNumTxtNd( sal_True ) ) )
{
String sNewTxt, sOldTxt( pSttNd->GetNodes()[ nNdPos ]->
GetTxtNode()->GetRedlineTxt() );
@@ -2542,14 +2559,14 @@ BOOL SwTableBox::IsNumberChanged() const
return bRet;
}
-ULONG SwTableBox::IsValidNumTxtNd( BOOL bCheckAttr ) const
+sal_uLong SwTableBox::IsValidNumTxtNd( sal_Bool bCheckAttr ) const
{
- ULONG nPos = ULONG_MAX;
+ sal_uLong nPos = ULONG_MAX;
if( pSttNd )
{
SwNodeIndex aIdx( *pSttNd );
- ULONG nIndex = aIdx.GetIndex();
- const ULONG nIndexEnd = pSttNd->GetNodes()[ nIndex ]->EndOfSectionIndex();
+ sal_uLong nIndex = aIdx.GetIndex();
+ const sal_uLong nIndexEnd = pSttNd->GetNodes()[ nIndex ]->EndOfSectionIndex();
const SwTxtNode *pTextNode = 0;
while( ++nIndex < nIndexEnd )
{
@@ -2583,7 +2600,7 @@ ULONG SwTableBox::IsValidNumTxtNd( BOOL bCheckAttr ) const
// Flys/Felder/..
if( pHts )
{
- for( USHORT n = 0; n < pHts->Count(); ++n )
+ for( sal_uInt16 n = 0; n < pHts->Count(); ++n )
{
const SwTxtAttr* pAttr = (*pHts)[ n ];
if( RES_TXTATR_NOEND_BEGIN <= pAttr->Which() ||
@@ -2612,14 +2629,14 @@ ULONG SwTableBox::IsValidNumTxtNd( BOOL bCheckAttr ) const
}
// ist das eine FormelBox oder eine Box mit numerischen Inhalt (AutoSum)
-USHORT SwTableBox::IsFormulaOrValueBox() const
+sal_uInt16 SwTableBox::IsFormulaOrValueBox() const
{
- USHORT nWhich = 0;
+ sal_uInt16 nWhich = 0;
const SwTxtNode* pTNd;
SwFrmFmt* pFmt = GetFrmFmt();
- if( SFX_ITEM_SET == pFmt->GetItemState( RES_BOXATR_FORMULA, FALSE ))
+ if( SFX_ITEM_SET == pFmt->GetItemState( RES_BOXATR_FORMULA, sal_False ))
nWhich = RES_BOXATR_FORMULA;
- else if( SFX_ITEM_SET == pFmt->GetItemState( RES_BOXATR_VALUE, FALSE ) &&
+ else if( SFX_ITEM_SET == pFmt->GetItemState( RES_BOXATR_VALUE, sal_False ) &&
!pFmt->GetDoc()->GetNumberFormatter()->IsTextFormat(
pFmt->GetTblBoxNumFmt().GetValue() ))
nWhich = RES_BOXATR_VALUE;
@@ -2635,15 +2652,15 @@ void SwTableBox::ActualiseValueBox()
{
const SfxPoolItem *pFmtItem, *pValItem;
SwFrmFmt* pFmt = GetFrmFmt();
- if( SFX_ITEM_SET == pFmt->GetItemState( RES_BOXATR_FORMAT, TRUE, &pFmtItem )
- && SFX_ITEM_SET == pFmt->GetItemState( RES_BOXATR_VALUE, TRUE, &pValItem ))
+ if( SFX_ITEM_SET == pFmt->GetItemState( RES_BOXATR_FORMAT, sal_True, &pFmtItem )
+ && SFX_ITEM_SET == pFmt->GetItemState( RES_BOXATR_VALUE, sal_True, &pValItem ))
{
- const ULONG nFmtId = ((SwTblBoxNumFormat*)pFmtItem)->GetValue();
- ULONG nNdPos = ULONG_MAX;
+ const sal_uLong nFmtId = ((SwTblBoxNumFormat*)pFmtItem)->GetValue();
+ sal_uLong nNdPos = ULONG_MAX;
SvNumberFormatter* pNumFmtr = pFmt->GetDoc()->GetNumberFormatter();
if( !pNumFmtr->IsTextFormat( nFmtId ) &&
- ULONG_MAX != (nNdPos = IsValidNumTxtNd( TRUE )) )
+ ULONG_MAX != (nNdPos = IsValidNumTxtNd( sal_True )) )
{
double fVal = ((SwTblBoxValue*)pValItem)->GetValue();
Color* pCol = 0;
@@ -2652,7 +2669,7 @@ void SwTableBox::ActualiseValueBox()
const String& rTxt = pSttNd->GetNodes()[ nNdPos ]->GetTxtNode()->GetTxt();
if( rTxt != sNewTxt )
- ChgTextToNum( *this, sNewTxt, pCol, FALSE ,nNdPos);
+ ChgTextToNum( *this, sNewTxt, pCol, sal_False ,nNdPos);
}
}
}
diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx
index 3ee651997691..13262cf15ae3 100644
--- a/sw/source/core/text/EnhancedPDFExportHelper.cxx
+++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx
@@ -101,7 +101,7 @@ LanguageType SwEnhancedPDFExportHelper::eLanguageDefault = 0;
#ifdef DBG_UTIL
-static std::vector< USHORT > aStructStack;
+static std::vector< sal_uInt16 > aStructStack;
void lcl_DBGCheckStack()
{
@@ -118,8 +118,8 @@ void lcl_DBGCheckStack()
* Formula = 35 Form = 36 Continued frame = 99
*/
- USHORT nElement;
- std::vector< USHORT >::iterator aIter;
+ sal_uInt16 nElement;
+ std::vector< sal_uInt16 >::iterator aIter;
for ( aIter = aStructStack.begin(); aIter != aStructStack.end(); ++aIter )
{
nElement = *aIter;
@@ -435,7 +435,7 @@ void SwTaggedPDFHelper::BeginTag( vcl::PDFWriter::StructElement eType, const Str
++nEndStructureElement;
#ifdef DBG_UTIL
- aStructStack.push_back( static_cast<USHORT>(eType) );
+ aStructStack.push_back( static_cast<sal_uInt16>(eType) );
#endif
// Store the id of the current structure element if
@@ -1016,7 +1016,7 @@ void SwTaggedPDFHelper::BeginBlockStructureElements()
if ( CheckReopenTag() )
return;
- USHORT nPDFType = USHRT_MAX;
+ sal_uInt16 nPDFType = USHRT_MAX;
String aPDFType;
switch ( pFrm->GetType() )
@@ -1114,7 +1114,7 @@ void SwTaggedPDFHelper::BeginBlockStructureElements()
// This is the default. If the paragraph could not be mapped to
// any of the standard pdf tags, we write a user defined tag
// <stylename> with role = P
- nPDFType = static_cast<USHORT>(vcl::PDFWriter::Paragraph);
+ nPDFType = static_cast<sal_uInt16>(vcl::PDFWriter::Paragraph);
aPDFType = sStyleName;
//
@@ -1122,7 +1122,7 @@ void SwTaggedPDFHelper::BeginBlockStructureElements()
//
if ( sStyleName == aQuotations )
{
- nPDFType = static_cast<USHORT>(vcl::PDFWriter::BlockQuote);
+ nPDFType = static_cast<sal_uInt16>(vcl::PDFWriter::BlockQuote);
aPDFType = aBlockQuoteString;
}
@@ -1131,7 +1131,7 @@ void SwTaggedPDFHelper::BeginBlockStructureElements()
//
else if ( sStyleName == aCaption)
{
- nPDFType = static_cast<USHORT>(vcl::PDFWriter::Caption);
+ nPDFType = static_cast<sal_uInt16>(vcl::PDFWriter::Caption);
aPDFType = aCaptionString;
}
@@ -1140,7 +1140,7 @@ void SwTaggedPDFHelper::BeginBlockStructureElements()
//
else if ( sParentStyleName == aCaption)
{
- nPDFType = static_cast<USHORT>(vcl::PDFWriter::Caption);
+ nPDFType = static_cast<sal_uInt16>(vcl::PDFWriter::Caption);
aPDFType = sStyleName.Append(aCaptionString);
}
@@ -1149,7 +1149,7 @@ void SwTaggedPDFHelper::BeginBlockStructureElements()
//
else if ( sStyleName == aHeading )
{
- nPDFType = static_cast<USHORT>(vcl::PDFWriter::Heading);
+ nPDFType = static_cast<sal_uInt16>(vcl::PDFWriter::Heading);
aPDFType = aHString;
}
@@ -1162,7 +1162,7 @@ void SwTaggedPDFHelper::BeginBlockStructureElements()
int nRealLevel = pTxtNd->GetAttrOutlineLevel()-1; //<-end,zhaojianwei
nRealLevel = nRealLevel > 5 ? 5 : nRealLevel;
- nPDFType = static_cast<USHORT>(vcl::PDFWriter::H1 + nRealLevel);
+ nPDFType = static_cast<sal_uInt16>(vcl::PDFWriter::H1 + nRealLevel);
switch(nRealLevel)
{
case 0 :
@@ -1375,7 +1375,7 @@ void SwTaggedPDFHelper::BeginInlineStructureElements()
if ( lcl_IsInNonStructEnv( *pFrm ) )
return;
- USHORT nPDFType = USHRT_MAX;
+ sal_uInt16 nPDFType = USHRT_MAX;
String aPDFType;
switch ( pPor->GetWhichPor() )
@@ -1427,7 +1427,7 @@ void SwTaggedPDFHelper::BeginInlineStructureElements()
else
{
const LanguageType nCurrentLanguage = rInf.GetFont()->GetLanguage();
- const USHORT nFont = rInf.GetFont()->GetActual();
+ const sal_uInt16 nFont = rInf.GetFont()->GetActual();
const LanguageType nDefaultLang = SwEnhancedPDFExportHelper::GetDefaultLanguage();
if ( UNDERLINE_NONE != rInf.GetFont()->GetUnderline() ||
@@ -1529,8 +1529,8 @@ SwEnhancedPDFExportHelper::SwEnhancedPDFExportHelper( SwEditShell& rSh,
aStructStack.clear();
#endif
- const BYTE nScript = (BYTE)GetI18NScriptTypeOfLanguage( (USHORT)GetAppLanguage() );
- USHORT nLangRes = RES_CHRATR_LANGUAGE;
+ const sal_uInt8 nScript = (sal_uInt8)GetI18NScriptTypeOfLanguage( (sal_uInt16)GetAppLanguage() );
+ sal_uInt16 nLangRes = RES_CHRATR_LANGUAGE;
if ( i18n::ScriptType::ASIAN == nScript )
nLangRes = RES_CHRATR_CJK_LANGUAGE;
@@ -1578,8 +1578,8 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
SwDoc* pDoc = mrSh.GetDoc();
mrSh.SwCrsrShell::Push();
mrSh.SwCrsrShell::ClearMark();
- const BOOL bOldLockView = mrSh.IsViewLocked();
- mrSh.LockView( TRUE );
+ const sal_Bool bOldLockView = mrSh.IsViewLocked();
+ mrSh.LockView( sal_True );
if ( !mbEditEngineOnly )
{
@@ -1619,7 +1619,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
SvNumberFormatter* pNumFormatter = pDoc->GetNumberFormatter();
const Date aDateDiff( pField->GetDate() -
*pNumFormatter->GetNullDate() );
- const ULONG nFormat =
+ const sal_uLong nFormat =
pNumFormatter->GetStandardFormat( NUMBERFORMAT_DATE, pField->GetLanguage() );
String sDate;
Color* pColor;
@@ -1714,8 +1714,8 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
// <--
// Create links for all selected rectangles:
- const USHORT nNumOfRects = aTmp.Count();
- for ( USHORT i = 0; i < nNumOfRects; ++i )
+ const sal_uInt16 nNumOfRects = aTmp.Count();
+ for ( sal_uInt16 i = 0; i < nNumOfRects; ++i )
{
// Link Rectangle
const SwRect& rLinkRect( aTmp[ i ] );
@@ -1761,7 +1761,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
const SwFrmFmt* pFrmFmt = (*pTbl)[n];
const SfxPoolItem* pItem;
if ( RES_DRAWFRMFMT != pFrmFmt->Which() &&
- SFX_ITEM_SET == pFrmFmt->GetAttrSet().GetItemState( RES_URL, TRUE, &pItem ) )
+ SFX_ITEM_SET == pFrmFmt->GetAttrSet().GetItemState( RES_URL, sal_True, &pItem ) )
{
String aURL( static_cast<const SwFmtURL*>(pItem)->GetURL() );
const bool bIntern = '#' == aURL.GetChar( 0 );
@@ -1875,8 +1875,8 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
// <--
// Create links for all selected rectangles:
- const USHORT nNumOfRects = aTmp.Count();
- for ( USHORT i = 0; i < nNumOfRects; ++i )
+ const sal_uInt16 nNumOfRects = aTmp.Count();
+ for ( sal_uInt16 i = 0; i < nNumOfRects; ++i )
{
// Link rectangle
const SwRect& rLinkRect( aTmp[ i ] );
@@ -1916,8 +1916,8 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
//
// FOOTNOTES
//
- const USHORT nFtnCount = pDoc->GetFtnIdxs().Count();
- for ( USHORT nIdx = 0; nIdx < nFtnCount; ++nIdx )
+ const sal_uInt16 nFtnCount = pDoc->GetFtnIdxs().Count();
+ for ( sal_uInt16 nIdx = 0; nIdx < nFtnCount; ++nIdx )
{
// Set cursor to text node that contains the footnote:
const SwTxtFtn* pTxtFtn = pDoc->GetFtnIdxs()[ nIdx ];
@@ -2118,7 +2118,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
// Restore view, cursor, and outdev:
mrSh.LockView( bOldLockView );
- mrSh.SwCrsrShell::Pop( FALSE );
+ mrSh.SwCrsrShell::Pop( sal_False );
mrOut.Pop();
}
diff --git a/sw/source/core/text/atrhndl.hxx b/sw/source/core/text/atrhndl.hxx
index 62df7e0499db..f5b8f87fe25c 100644
--- a/sw/source/core/text/atrhndl.hxx
+++ b/sw/source/core/text/atrhndl.hxx
@@ -38,7 +38,7 @@ class SwAttrSet;
class IDocumentSettingAccess;
class ViewShell;
class SfxPoolItem;
-extern const BYTE StackPos[];
+extern const sal_uInt8 StackPos[];
/*************************************************************************
* class SwAttrHandler
@@ -62,8 +62,8 @@ private:
private:
SwTxtAttr* pInitialArray[ INITIAL_NUM_ATTR ];
SwTxtAttr** pArray;
- USHORT nCount; // number of elements on stack
- USHORT nSize; // number of positions in Array
+ sal_uInt16 nCount; // number of elements on stack
+ sal_uInt16 nSize; // number of positions in Array
public:
// Ctor, Dtor
@@ -78,7 +78,7 @@ private:
inline void Push( const SwTxtAttr& rAttr ) { Insert( rAttr, nCount ); };
// insert at specified position, take care for not inserting behind
// the value returned by Count()
- void Insert( const SwTxtAttr& rAttr, const USHORT nPos );
+ void Insert( const SwTxtAttr& rAttr, const sal_uInt16 nPos );
// remove specified attribute
void Remove( const SwTxtAttr& rAttr );
@@ -87,11 +87,11 @@ private:
const SwTxtAttr* Top() const;
// number of elements on stack
- inline USHORT Count() const { return nCount; };
+ inline sal_uInt16 Count() const { return nCount; };
// returns position of rAttr on Stack if found, otherwise USHRT_MAX
// can be used for Remove of an attribute
- USHORT Pos( const SwTxtAttr& rAttr ) const;
+ sal_uInt16 Pos( const SwTxtAttr& rAttr ) const;
};
SwAttrStack aAttrStack[ NUM_ATTRIBUTE_STACKS ]; // stack collection
@@ -114,7 +114,7 @@ private:
sal_Bool Push( const SwTxtAttr& rAttr, const SfxPoolItem& rItem );
// apply top attribute on stack to font
- void ActivateTop( SwFont& rFnt, USHORT nStackPos );
+ void ActivateTop( SwFont& rFnt, sal_uInt16 nStackPos );
public:
// Ctor
@@ -141,21 +141,21 @@ public:
void Pop( const SwTxtAttr& rAttr );
// apply script dependent attributes
-// void ChangeScript( SwFont& rFnt, const BYTE nScr );
+// void ChangeScript( SwFont& rFnt, const sal_uInt8 nScr );
// returns the default value for stack nStack
- inline const SfxPoolItem& GetDefault( const USHORT nAttribID ) const;
+ inline const SfxPoolItem& GetDefault( const sal_uInt16 nAttribID ) const;
// do not call these if you only used the small init function
inline void ResetFont( SwFont& rFnt ) const;
inline const SwFont* GetFont() const;
void GetDefaultAscentAndHeight(ViewShell* pShell,
OutputDevice& rOut,
- USHORT& nAscent,
- USHORT& nHeight) const;
+ sal_uInt16& nAscent,
+ sal_uInt16& nHeight) const;
};
-inline const SfxPoolItem& SwAttrHandler::GetDefault( const USHORT nAttribID ) const
+inline const SfxPoolItem& SwAttrHandler::GetDefault( const sal_uInt16 nAttribID ) const
{
ASSERT( nAttribID < RES_TXTATR_END,
"this attrib does not ex."
diff --git a/sw/source/core/text/atrstck.cxx b/sw/source/core/text/atrstck.cxx
index e4518a26eb0d..63f3c22151b3 100644
--- a/sw/source/core/text/atrstck.cxx
+++ b/sw/source/core/text/atrstck.cxx
@@ -81,8 +81,8 @@
* Also adjust NUM_ATTRIBUTE_STACKS in atrhndl.hxx.
*************************************************************************/
-const BYTE StackPos[ static_cast<USHORT>(RES_TXTATR_WITHEND_END) -
- static_cast<USHORT>(RES_CHRATR_BEGIN) + 1 ] =
+const sal_uInt8 StackPos[ static_cast<sal_uInt16>(RES_TXTATR_WITHEND_END) -
+ static_cast<sal_uInt16>(RES_CHRATR_BEGIN) + 1 ] =
{
0, // // 0
1, // RES_CHRATR_CASEMAP = RES_CHRATR_BEGIN // 1
@@ -173,7 +173,7 @@ const SfxItemSet* GetItemSet( const SfxPoolItem& rAttr )
* extracts pool item of type nWhich from rAttr
*************************************************************************/
-const SfxPoolItem* GetItem( const SwTxtAttr& rAttr, USHORT nWhich )
+const SfxPoolItem* GetItem( const SwTxtAttr& rAttr, sal_uInt16 nWhich )
{
if ( RES_TXTATR_INETFMT == rAttr.Which() ||
RES_TXTATR_CHARFMT == rAttr.Which() ||
@@ -184,7 +184,7 @@ const SfxPoolItem* GetItem( const SwTxtAttr& rAttr, USHORT nWhich )
bool bInParent = RES_TXTATR_AUTOFMT != rAttr.Which();
const SfxPoolItem* pItem;
- BOOL bRet = SFX_ITEM_SET == pSet->GetItemState( nWhich, bInParent, &pItem );
+ sal_Bool bRet = SFX_ITEM_SET == pSet->GetItemState( nWhich, bInParent, &pItem );
return bRet ? pItem : 0;
}
@@ -197,13 +197,13 @@ const SfxPoolItem* GetItem( const SwTxtAttr& rAttr, USHORT nWhich )
* checks if item is included in character/inet/auto style
*************************************************************************/
-BOOL IsItemIncluded( const USHORT nWhich, const SwTxtAttr *pAttr )
+sal_Bool IsItemIncluded( const sal_uInt16 nWhich, const SwTxtAttr *pAttr )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
const SfxItemSet* pItemSet = CharFmt::GetItemSet( pAttr->GetAttr() );
if ( pItemSet )
- bRet = SFX_ITEM_SET == pItemSet->GetItemState( nWhich, TRUE );
+ bRet = SFX_ITEM_SET == pItemSet->GetItemState( nWhich, sal_True );
return bRet;
}
@@ -248,7 +248,7 @@ bool lcl_ChgHyperLinkColor( const SwTxtAttr& rAttr,
rInetAttr.SetVisited( false );
const SwCharFmt* pTmpFmt = ((SwTxtINetFmt&)rAttr).GetCharFmt();
const SfxPoolItem* pItem;
- pTmpFmt->GetItemState( RES_CHRATR_COLOR, TRUE, &pItem );
+ pTmpFmt->GetItemState( RES_CHRATR_COLOR, sal_True, &pItem );
*pColor = ((SvxColorItem*)pItem)->GetValue();
rInetAttr.SetVisited( true );
}
@@ -304,7 +304,7 @@ inline SwAttrHandler::SwAttrStack::SwAttrStack()
* SwAttrHandler::SwAttrStack::Insert()
*************************************************************************/
-void SwAttrHandler::SwAttrStack::Insert( const SwTxtAttr& rAttr, const USHORT nPos )
+void SwAttrHandler::SwAttrStack::Insert( const SwTxtAttr& rAttr, const sal_uInt16 nPos )
{
// do we still have enough space?
if ( nCount >= nSize )
@@ -349,7 +349,7 @@ void SwAttrHandler::SwAttrStack::Insert( const SwTxtAttr& rAttr, const USHORT nP
void SwAttrHandler::SwAttrStack::Remove( const SwTxtAttr& rAttr )
{
- USHORT nPos = Pos( rAttr );
+ sal_uInt16 nPos = Pos( rAttr );
if ( nPos < nCount )
{
memmove( pArray + nPos, pArray + nPos + 1,
@@ -372,13 +372,13 @@ const SwTxtAttr* SwAttrHandler::SwAttrStack::Top() const
* SwAttrHandler::SwAttrStack::Pos()
*************************************************************************/
-USHORT SwAttrHandler::SwAttrStack::Pos( const SwTxtAttr& rAttr ) const
+sal_uInt16 SwAttrHandler::SwAttrStack::Pos( const SwTxtAttr& rAttr ) const
{
if ( ! nCount )
// empty stack
return USHRT_MAX;
- for ( USHORT nIdx = nCount; nIdx > 0; )
+ for ( sal_uInt16 nIdx = nCount; nIdx > 0; )
{
if ( &rAttr == pArray[ --nIdx ] )
return nIdx;
@@ -414,8 +414,8 @@ void SwAttrHandler::Init( const SwAttrSet& rAttrSet,
mpIDocumentSettingAccess = &rIDocumentSettingAcces;
mpShell = pSh;
- for ( USHORT i = RES_CHRATR_BEGIN; i < RES_CHRATR_END; i++ )
- pDefaultArray[ StackPos[ i ] ] = &rAttrSet.Get( i, TRUE );
+ for ( sal_uInt16 i = RES_CHRATR_BEGIN; i < RES_CHRATR_END; i++ )
+ pDefaultArray[ StackPos[ i ] ] = &rAttrSet.Get( i, sal_True );
}
void SwAttrHandler::Init( const SfxPoolItem** pPoolItem, const SwAttrSet* pAS,
@@ -436,9 +436,9 @@ void SwAttrHandler::Init( const SfxPoolItem** pPoolItem, const SwAttrSet* pAS,
if ( pAS && pAS->Count() )
{
SfxItemIter aIter( *pAS );
- USHORT nWhich;
+ sal_uInt16 nWhich;
const SfxPoolItem* pItem = aIter.GetCurItem();
- while( TRUE )
+ while( sal_True )
{
nWhich = pItem->Which();
if (isCHRATR(nWhich))
@@ -462,7 +462,7 @@ void SwAttrHandler::Init( const SfxPoolItem** pPoolItem, const SwAttrSet* pAS,
void SwAttrHandler::Reset( )
{
- for ( USHORT i = 0; i < NUM_ATTRIBUTE_STACKS; i++ )
+ for ( sal_uInt16 i = 0; i < NUM_ATTRIBUTE_STACKS; i++ )
aAttrStack[ i ].Reset();
}
@@ -481,10 +481,10 @@ void SwAttrHandler::PushAndChg( const SwTxtAttr& rAttr, SwFont& rFnt )
const SfxItemSet* pSet = CharFmt::GetItemSet( rAttr.GetAttr() );
if ( !pSet ) return;
- for ( USHORT i = RES_CHRATR_BEGIN; i < RES_CHRATR_END; i++)
+ for ( sal_uInt16 i = RES_CHRATR_BEGIN; i < RES_CHRATR_END; i++)
{
const SfxPoolItem* pItem;
- BOOL bRet = SFX_ITEM_SET == pSet->GetItemState( i, rAttr.Which() != RES_TXTATR_AUTOFMT, &pItem );
+ sal_Bool bRet = SFX_ITEM_SET == pSet->GetItemState( i, rAttr.Which() != RES_TXTATR_AUTOFMT, &pItem );
if ( bRet )
{
@@ -527,7 +527,7 @@ sal_Bool SwAttrHandler::Push( const SwTxtAttr& rAttr, const SfxPoolItem& rItem )
if ( RES_TXTATR_WITHEND_END <= rItem.Which() )
return sal_False;
- USHORT nStack = StackPos[ rItem.Which() ];
+ sal_uInt16 nStack = StackPos[ rItem.Which() ];
// attributes originating from redlining have highest priority
// second priority are hyperlink attributes, which have a color replacement
@@ -540,7 +540,7 @@ sal_Bool SwAttrHandler::Push( const SwTxtAttr& rAttr, const SfxPoolItem& rItem )
return sal_True;
}
- USHORT nPos = aAttrStack[ nStack ].Count();
+ sal_uInt16 nPos = aAttrStack[ nStack ].Count();
ASSERT( nPos, "empty stack?" );
aAttrStack[ nStack ].Insert( rAttr, nPos - 1 );
return sal_False;
@@ -564,14 +564,14 @@ void SwAttrHandler::PopAndChg( const SwTxtAttr& rAttr, SwFont& rFnt )
const SfxItemSet* pSet = CharFmt::GetItemSet( rAttr.GetAttr() );
if ( !pSet ) return;
- for ( USHORT i = RES_CHRATR_BEGIN; i < RES_CHRATR_END; i++)
+ for ( sal_uInt16 i = RES_CHRATR_BEGIN; i < RES_CHRATR_END; i++)
{
const SfxPoolItem* pItem;
- BOOL bRet = SFX_ITEM_SET == pSet->GetItemState( i, RES_TXTATR_AUTOFMT != rAttr.Which(), &pItem );
+ sal_Bool bRet = SFX_ITEM_SET == pSet->GetItemState( i, RES_TXTATR_AUTOFMT != rAttr.Which(), &pItem );
if ( bRet )
{
// we remove rAttr from the appropriate stack
- USHORT nStackPos = StackPos[ i ];
+ sal_uInt16 nStackPos = StackPos[ i ];
aAttrStack[ nStackPos ].Remove( rAttr );
// reset font according to attribute on top of stack
// or default value
@@ -610,12 +610,12 @@ void SwAttrHandler::Pop( const SwTxtAttr& rAttr )
/*************************************************************************
* SwAttrHandler::ActivateTop()
*************************************************************************/
-void SwAttrHandler::ActivateTop( SwFont& rFnt, const USHORT nAttr )
+void SwAttrHandler::ActivateTop( SwFont& rFnt, const sal_uInt16 nAttr )
{
ASSERT( nAttr < RES_TXTATR_WITHEND_END,
"I cannot activate this attribute, nWhich >= RES_TXTATR_WITHEND_END" );
- const USHORT nStackPos = StackPos[ nAttr ];
+ const sal_uInt16 nStackPos = StackPos[ nAttr ];
const SwTxtAttr* pTopAt = aAttrStack[ nStackPos ].Top();
if ( pTopAt )
{
@@ -656,7 +656,7 @@ void SwAttrHandler::ActivateTop( SwFont& rFnt, const USHORT nAttr )
{
// ruby stack has no more attributes
// check, if an rotation attribute has to be applied
- USHORT nTwoLineStack = StackPos[ RES_CHRATR_TWO_LINES ];
+ sal_uInt16 nTwoLineStack = StackPos[ RES_CHRATR_TWO_LINES ];
sal_Bool bTwoLineAct = sal_False;
const SfxPoolItem* pTwoLineItem = 0;
const SwTxtAttr* pTwoLineAttr = aAttrStack[ nTwoLineStack ].Top();
@@ -674,7 +674,7 @@ void SwAttrHandler::ActivateTop( SwFont& rFnt, const USHORT nAttr )
return;
// eventually, an rotate attribute has to be activated
- USHORT nRotateStack = StackPos[ RES_CHRATR_ROTATE ];
+ sal_uInt16 nRotateStack = StackPos[ RES_CHRATR_ROTATE ];
const SfxPoolItem* pRotateItem = 0;
const SwTxtAttr* pRotateAttr = aAttrStack[ nRotateStack ].Top();
@@ -744,7 +744,7 @@ void SwAttrHandler::FontChg(const SfxPoolItem& rItem, SwFont& rFnt, sal_Bool bPu
break;
case RES_CHRATR_UNDERLINE :
{
- const USHORT nStackPos = StackPos[ RES_CHRATR_HIDDEN ];
+ const sal_uInt16 nStackPos = StackPos[ RES_CHRATR_HIDDEN ];
const SwTxtAttr* pTopAt = aAttrStack[ nStackPos ].Top();
const SfxPoolItem* pTmpItem = pTopAt ?
@@ -856,7 +856,7 @@ void SwAttrHandler::FontChg(const SfxPoolItem& rItem, SwFont& rFnt, sal_Bool bPu
if ( bRuby )
break;
- USHORT nTwoLineStack = StackPos[ RES_CHRATR_TWO_LINES ];
+ sal_uInt16 nTwoLineStack = StackPos[ RES_CHRATR_TWO_LINES ];
sal_Bool bTwoLineAct = sal_False;
const SfxPoolItem* pTwoLineItem = 0;
const SwTxtAttr* pTwoLineAttr = aAttrStack[ nTwoLineStack ].Top();
@@ -898,7 +898,7 @@ void SwAttrHandler::FontChg(const SfxPoolItem& rItem, SwFont& rFnt, sal_Bool bPu
if ( bRuby )
break;
- USHORT nRotateStack = StackPos[ RES_CHRATR_ROTATE ];
+ sal_uInt16 nRotateStack = StackPos[ RES_CHRATR_ROTATE ];
const SfxPoolItem* pRotateItem = 0;
const SwTxtAttr* pRotateAttr = aAttrStack[ nRotateStack ].Top();
@@ -942,7 +942,7 @@ void SwAttrHandler::FontChg(const SfxPoolItem& rItem, SwFont& rFnt, sal_Bool bPu
// Takes the default font and calculated the ascent and height
void SwAttrHandler::GetDefaultAscentAndHeight( ViewShell* pShell, OutputDevice& rOut,
- USHORT& nAscent, USHORT& nHeight ) const
+ sal_uInt16& nAscent, sal_uInt16& nHeight ) const
{
ASSERT( pFnt, "No font available for GetDefaultAscentAndHeight" )
diff --git a/sw/source/core/text/blink.cxx b/sw/source/core/text/blink.cxx
index 5430528956eb..aee16acc8dcf 100644
--- a/sw/source/core/text/blink.cxx
+++ b/sw/source/core/text/blink.cxx
@@ -136,7 +136,7 @@ IMPL_LINK( SwBlink, Blinker, Timer *, EMPTYARG )
}
void SwBlink::Insert( const Point& rPoint, const SwLinePortion* pPor,
- const SwTxtFrm *pTxtFrm, USHORT nDir )
+ const SwTxtFrm *pTxtFrm, sal_uInt16 nDir )
{
SwBlinkPortion *pBlinkPor = new SwBlinkPortion( pPor, nDir );
diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx
index c613a9ca1c24..abf8637bb225 100644
--- a/sw/source/core/text/frmcrsr.cxx
+++ b/sw/source/core/text/frmcrsr.cxx
@@ -80,7 +80,7 @@ using namespace ::com::sun::star;
*************************************************************************/
SwTxtFrm *GetAdjFrmAtPos( SwTxtFrm *pFrm, const SwPosition &rPos,
- const sal_Bool bRightMargin, const sal_Bool bNoScroll = TRUE )
+ const sal_Bool bRightMargin, const sal_Bool bNoScroll = sal_True )
{
// 8810: vgl. 1170, RightMargin in der letzten Masterzeile...
const xub_StrLen nOffset = rPos.nContent.GetIndex();
@@ -438,7 +438,7 @@ sal_Bool SwTxtFrm::GetAutoPos( SwRect& rOrig, const SwPosition &rPos ) const
SwTxtSizeInfo aInf( pFrm );
SwTxtCursor aLine( pFrm, &aInf );
SwCrsrMoveState aTmpState( MV_SETONLYTEXT );
- aTmpState.bRealHeight = TRUE;
+ aTmpState.bRealHeight = sal_True;
if( aLine.GetCharRect( &rOrig, nOffset, &aTmpState, nMaxY ) )
{
if( aTmpState.aRealHeight.X() >= 0 )
@@ -886,7 +886,7 @@ sal_Bool SwTxtFrm::_UnitUp( SwPaM *pPam, const SwTwips nOffset,
// siehe Kommentar in SwTxtFrm::GetCrsrOfst()
#ifdef DBG_UTIL
- const ULONG nOldNode = pPam->GetPoint()->nNode.GetIndex();
+ const sal_uLong nOldNode = pPam->GetPoint()->nNode.GetIndex();
#endif
// Der Node soll nicht gewechselt werden
xub_StrLen nTmpOfst = aLine.GetCrsrOfst( pPam->GetPoint(),
@@ -955,7 +955,7 @@ sal_Bool SwTxtFrm::_UnitUp( SwPaM *pPam, const SwTwips nOffset,
// current position
void lcl_VisualMoveRecursion( const SwLineLayout& rCurrLine, xub_StrLen nIdx,
xub_StrLen& nPos, sal_Bool& bRight,
- BYTE& nCrsrLevel, BYTE nDefaultDir )
+ sal_uInt8& nCrsrLevel, sal_uInt8 nDefaultDir )
{
const SwLinePortion* pPor = rCurrLine.GetFirstPortion();
const SwLinePortion* pLast = 0;
@@ -1010,7 +1010,7 @@ void lcl_VisualMoveRecursion( const SwLineLayout& rCurrLine, xub_StrLen nIdx,
const SwLineLayout& rLine = ((SwMultiPortion*)pPor)->GetRoot();
xub_StrLen nTmpPos = nPos - nIdx;
sal_Bool bTmpForward = ! bRight;
- BYTE nTmpCrsrLevel = nCrsrLevel;
+ sal_uInt8 nTmpCrsrLevel = nCrsrLevel;
lcl_VisualMoveRecursion( rLine, 0, nTmpPos, bTmpForward,
nTmpCrsrLevel, nDefaultDir + 1 );
@@ -1069,7 +1069,7 @@ void lcl_VisualMoveRecursion( const SwLineLayout& rCurrLine, xub_StrLen nIdx,
const SwLineLayout& rLine = ((SwMultiPortion*)pPor)->GetRoot();
xub_StrLen nTmpPos = nPos - nIdx;
sal_Bool bTmpForward = ! bRight;
- BYTE nTmpCrsrLevel = nCrsrLevel;
+ sal_uInt8 nTmpCrsrLevel = nCrsrLevel;
lcl_VisualMoveRecursion( rLine, 0, nTmpPos, bTmpForward,
nTmpCrsrLevel, nDefaultDir + 1 );
@@ -1098,7 +1098,7 @@ void lcl_VisualMoveRecursion( const SwLineLayout& rCurrLine, xub_StrLen nIdx,
}
}
-void SwTxtFrm::PrepareVisualMove( xub_StrLen& nPos, BYTE& nCrsrLevel,
+void SwTxtFrm::PrepareVisualMove( xub_StrLen& nPos, sal_uInt8& nCrsrLevel,
sal_Bool& bForward, sal_Bool bInsertCrsr )
{
if( IsEmpty() || IsHiddenNow() )
@@ -1134,7 +1134,7 @@ void SwTxtFrm::PrepareVisualMove( xub_StrLen& nPos, BYTE& nCrsrLevel,
return;
}
- const BYTE nDefaultDir = static_cast<BYTE>(IsRightToLeft() ? UBIDI_RTL : UBIDI_LTR);
+ const sal_uInt8 nDefaultDir = static_cast<sal_uInt8>(IsRightToLeft() ? UBIDI_RTL : UBIDI_LTR);
const sal_Bool bVisualRight = ( nDefaultDir == UBIDI_LTR && bForward ) ||
( nDefaultDir == UBIDI_RTL && ! bForward );
@@ -1253,7 +1253,7 @@ sal_Bool SwTxtFrm::_UnitDown(SwPaM *pPam, const SwTwips nOffset,
aCharBox.SSize().Width() /= 2;
#ifdef DBG_UTIL
// siehe Kommentar in SwTxtFrm::GetCrsrOfst()
- const ULONG nOldNode = pPam->GetPoint()->nNode.GetIndex();
+ const sal_uLong nOldNode = pPam->GetPoint()->nNode.GetIndex();
#endif
if ( pNextLine && ! bFirstOfDouble )
aLine.NextLine();
@@ -1471,7 +1471,7 @@ void SwTxtFrm::FillCrsrPos( SwFillData& rFill ) const
nFirst = 0;
}
else if( nDist < nFirst )
- nFirst = nFirst - (USHORT)nDist;
+ nFirst = nFirst - (sal_uInt16)nDist;
else
nFirst = 0;
nDist = Max( nDist, long( GetLineSpace() ) );
@@ -1481,7 +1481,7 @@ void SwTxtFrm::FillCrsrPos( SwFillData& rFill ) const
if( nDiff > 0 )
{
nDiff /= nDist;
- rFill.Fill().nParaCnt = static_cast<USHORT>(nDiff + 1);
+ rFill.Fill().nParaCnt = static_cast<sal_uInt16>(nDiff + 1);
rFill.nLineWidth = 0;
rFill.bInner = sal_False;
rFill.bEmpty = sal_True;
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index 72effc63ba6a..d99604722604 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -641,7 +641,7 @@ SwCntntFrm *SwTxtFrm::JoinFrm()
{
SwFtnBossFrm *pFtnBoss = 0;
SwFtnBossFrm *pEndBoss = 0;
- for ( USHORT i = 0; i < pHints->Count(); ++i )
+ for ( sal_uInt16 i = 0; i < pHints->Count(); ++i )
{
const SwTxtAttr *pHt = (*pHints)[i];
if( RES_TXTATR_FTN==pHt->Which() && *pHt->GetStart()>=nStart )
@@ -674,7 +674,7 @@ SwCntntFrm *SwTxtFrm::JoinFrm()
#endif
pFoll->MoveFlyInCnt( this, nStart, STRING_LEN );
- pFoll->SetFtn( FALSE );
+ pFoll->SetFtn( sal_False );
// --> 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
@@ -741,7 +741,7 @@ SwCntntFrm *SwTxtFrm::SplitFrm( const xub_StrLen nTxtPos )
{
SwFtnBossFrm *pFtnBoss = 0;
SwFtnBossFrm *pEndBoss = 0;
- for ( USHORT i = 0; i < pHints->Count(); ++i )
+ for ( sal_uInt16 i = 0; i < pHints->Count(); ++i )
{
const SwTxtAttr *pHt = (*pHints)[i];
if( RES_TXTATR_FTN==pHt->Which() && *pHt->GetStart()>=nTxtPos )
@@ -1150,7 +1150,7 @@ void SwTxtFrm::FormatAdjust( SwTxtFormatter &rLine,
// FME 16.07.2003 #i16930# - removed this code because it did not
// work correctly. In SwCntntFrm::MakeAll, the frame did not move to the
// next page, instead the print area was recalculated and
- // Prepare( PREP_POS_CHGD, (const void*)&bFormatted, FALSE ) invalidated
+ // Prepare( PREP_POS_CHGD, (const void*)&bFormatted, sal_False ) invalidated
// the other flags => loop
// OD 04.04.2003 #108446# - handle special case:
diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx
index c6e66dfc810c..c219f69407ff 100644
--- a/sw/source/core/text/frmpaint.cxx
+++ b/sw/source/core/text/frmpaint.cxx
@@ -95,7 +95,7 @@ class SwExtraPainter
const SwLineNumberInfo &rLineInf;
SwTwips nX;
SwTwips nRedX;
- ULONG nLineNr;
+ sal_uLong nLineNr;
MSHORT nDivider;
sal_Bool bGoLeft;
sal_Bool bLineNum;
diff --git a/sw/source/core/text/guess.cxx b/sw/source/core/text/guess.cxx
index 4c9ad8022157..9c341c3838ea 100644
--- a/sw/source/core/text/guess.cxx
+++ b/sw/source/core/text/guess.cxx
@@ -78,13 +78,13 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
ASSERT( nPorHeight, "+SwTxtGuess::Guess: no height" );
- USHORT nMinSize;
- USHORT nMaxSizeDiff;
+ sal_uInt16 nMinSize;
+ sal_uInt16 nMaxSizeDiff;
const SwScriptInfo& rSI =
((SwParaPortion*)rInf.GetParaPortion())->GetScriptInfo();
- USHORT nMaxComp = ( SW_CJK == rInf.GetFont()->GetActual() ) &&
+ sal_uInt16 nMaxComp = ( SW_CJK == rInf.GetFont()->GetActual() ) &&
rSI.CountCompChg() &&
! rInf.IsMulti() &&
! rPor.InFldGrp() &&
@@ -150,7 +150,7 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
// save maximum width for later use
if ( nMaxSizeDiff )
- rInf.SetMaxWidthDiff( (ULONG)&rPor, nMaxSizeDiff );
+ rInf.SetMaxWidthDiff( (sal_uLong)&rPor, nMaxSizeDiff );
return sal_True;
}
@@ -201,7 +201,7 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
// save maximum width for later use
if ( nMaxSizeDiff )
- rInf.SetMaxWidthDiff( (ULONG)&rPor, nMaxSizeDiff );
+ rInf.SetMaxWidthDiff( (sal_uLong)&rPor, nMaxSizeDiff );
return sal_True;
}
@@ -327,7 +327,7 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
// we have to check the script type of the last "real" character
if ( nLangIndex < rInf.GetIdx() )
{
- USHORT nScript = pBreakIt->GetRealScriptOfText( rInf.GetTxt(),
+ sal_uInt16 nScript = pBreakIt->GetRealScriptOfText( rInf.GetTxt(),
nLangIndex );
ASSERT( nScript, "Script is not between 1 and 4" );
@@ -394,10 +394,10 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
// e.g., Schiff-fahrt, referes to the word after hyphenation
const String aHyphenatedWord = xHyphWord->getHyphenatedWord();
// e.g., Schif-fahrt: 5, referes to our string
- const USHORT nHyphenationPos = xHyphWord->getHyphenationPos();
+ const sal_uInt16 nHyphenationPos = xHyphWord->getHyphenationPos();
(void)nHyphenationPos;
// e.g., Schiff-fahrt: 6, referes to the word after hyphenation
- const USHORT nHyphenPos = xHyphWord->getHyphenPos();
+ const sal_uInt16 nHyphenPos = xHyphWord->getHyphenPos();
(void)nHyphenPos;
#endif
@@ -504,7 +504,7 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
// save maximum width for later use
if ( nMaxSizeDiff )
- rInf.SetMaxWidthDiff( (ULONG)&rPor, nMaxSizeDiff );
+ rInf.SetMaxWidthDiff( (sal_uLong)&rPor, nMaxSizeDiff );
nBreakWidth = nItalic + nMinSize;
}
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 15774bc139ea..d8448b9f6305 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -180,7 +180,7 @@ void SwLineInfo::CtorInitLineInfo( const SwAttrSet& rAttrSet,
pRuler->Insert( aListTabStop );
// remove default tab stops, which are before the inserted list tab stop
- for ( USHORT i = 0; i < pRuler->Count(); i++ )
+ for ( sal_uInt16 i = 0; i < pRuler->Count(); i++ )
{
if ( (*pRuler)[i].GetTabPos() < nListTabStopPosition &&
(*pRuler)[i].GetAdjustment() == SVX_TAB_ADJUST_DEFAULT )
@@ -195,7 +195,7 @@ void SwLineInfo::CtorInitLineInfo( const SwAttrSet& rAttrSet,
if ( !rTxtNode.getIDocumentSettingAccess()->get(IDocumentSettingAccess::TABS_RELATIVE_TO_INDENT) )
{
// remove default tab stop at position 0
- for ( USHORT i = 0; i < pRuler->Count(); i++ )
+ for ( sal_uInt16 i = 0; i < pRuler->Count(); i++ )
{
if ( (*pRuler)[i].GetTabPos() == 0 &&
(*pRuler)[i].GetAdjustment() == SVX_TAB_ADJUST_DEFAULT )
@@ -453,7 +453,7 @@ SwPosSize SwTxtSizeInfo::GetTxtSize( OutputDevice* pOutDev,
const XubString& rTxt,
const xub_StrLen nIndex,
const xub_StrLen nLength,
- const USHORT nComp ) const
+ const sal_uInt16 nComp ) const
{
SwDrawTextInfo aDrawInf( pVsh, *pOutDev, pSI, rTxt, nIndex, nLength );
aDrawInf.SetFrm( pFrm );
@@ -475,7 +475,7 @@ SwPosSize SwTxtSizeInfo::GetTxtSize() const
// in some cases, compression is not allowed or surpressed for
// performance reasons
- USHORT nComp =( SW_CJK == GetFont()->GetActual() &&
+ sal_uInt16 nComp =( SW_CJK == GetFont()->GetActual() &&
rSI.CountCompChg() &&
! IsMulti() ) ?
GetKanaComp() :
@@ -494,8 +494,8 @@ SwPosSize SwTxtSizeInfo::GetTxtSize() const
*************************************************************************/
void SwTxtSizeInfo::GetTxtSize( const SwScriptInfo* pSI, const xub_StrLen nIndex,
- const xub_StrLen nLength, const USHORT nComp,
- USHORT& nMinSize, USHORT& nMaxSizeDiff ) const
+ const xub_StrLen nLength, const sal_uInt16 nComp,
+ sal_uInt16& nMinSize, sal_uInt16& nMaxSizeDiff ) const
{
SwDrawTextInfo aDrawInf( pVsh, *pOut, pSI, *pTxt, nIndex, nLength );
aDrawInf.SetFrm( pFrm );
@@ -503,7 +503,7 @@ void SwTxtSizeInfo::GetTxtSize( const SwScriptInfo* pSI, const xub_StrLen nIndex
aDrawInf.SetSnapToGrid( SnapToGrid() );
aDrawInf.SetKanaComp( nComp );
SwPosSize aSize = pFnt->_GetTxtSize( aDrawInf );
- nMaxSizeDiff = (USHORT)aDrawInf.GetKanaDiff();
+ nMaxSizeDiff = (sal_uInt16)aDrawInf.GetKanaDiff();
nMinSize = aSize.Width();
}
@@ -513,7 +513,7 @@ void SwTxtSizeInfo::GetTxtSize( const SwScriptInfo* pSI, const xub_StrLen nIndex
xub_StrLen SwTxtSizeInfo::GetTxtBreak( const long nLineWidth,
const xub_StrLen nMaxLen,
- const USHORT nComp ) const
+ const sal_uInt16 nComp ) const
{
const SwScriptInfo& rScriptInfo =
( (SwParaPortion*)GetParaPortion() )->GetScriptInfo();
@@ -536,7 +536,7 @@ xub_StrLen SwTxtSizeInfo::GetTxtBreak( const long nLineWidth,
xub_StrLen SwTxtSizeInfo::GetTxtBreak( const long nLineWidth,
const xub_StrLen nMaxLen,
- const USHORT nComp,
+ const sal_uInt16 nComp,
xub_StrLen& rExtraCharPos ) const
{
const SwScriptInfo& rScriptInfo =
@@ -624,7 +624,7 @@ sal_Bool lcl_IsDarkBackground( const SwTxtPaintInfo& rInf )
/// OD 21.08.2002 #99657#
/// There is a background color, if there is a background brush and
/// its color is *not* "no fill"/"auto fill".
- if( rInf.GetTxtFrm()->GetBackgroundBrush( pItem, pCol, aOrigBackRect, FALSE ) )
+ if( rInf.GetTxtFrm()->GetBackgroundBrush( pItem, pCol, aOrigBackRect, sal_False ) )
{
if ( !pCol )
pCol = &pItem->GetColor();
@@ -698,7 +698,7 @@ void SwTxtPaintInfo::_DrawText( const XubString &rText, const SwLinePortion &rPo
// in some cases, kana compression is not allowed or surpressed for
// performance reasons
- USHORT nComp = 0;
+ sal_uInt16 nComp = 0;
if ( ! IsMulti() )
nComp = GetKanaComp();
@@ -818,8 +818,8 @@ void SwTxtPaintInfo::CalcRect( const SwLinePortion& rPor,
}
// Adjust x coordinate if we are inside a bidi portion
- const BOOL bFrmDir = GetTxtFrm()->IsRightToLeft();
- BOOL bCounterDir = ( ! bFrmDir && DIR_RIGHT2LEFT == GetDirection() ) ||
+ const sal_Bool bFrmDir = GetTxtFrm()->IsRightToLeft();
+ sal_Bool bCounterDir = ( ! bFrmDir && DIR_RIGHT2LEFT == GetDirection() ) ||
( bFrmDir && DIR_LEFT2RIGHT == GetDirection() );
if ( bCounterDir )
@@ -863,7 +863,7 @@ void SwTxtPaintInfo::CalcRect( const SwLinePortion& rPor,
static void lcl_DrawSpecial( const SwTxtPaintInfo& rInf, const SwLinePortion& rPor,
SwRect& rRect, const Color* pCol, sal_Unicode cChar,
- BYTE nOptions )
+ sal_uInt8 nOptions )
{
sal_Bool bCenter = 0 != ( nOptions & DRAW_SPECIAL_OPTIONS_CENTER );
sal_Bool bRotate = 0 != ( nOptions & DRAW_SPECIAL_OPTIONS_ROTATE );
@@ -904,7 +904,7 @@ static void lcl_DrawSpecial( const SwTxtPaintInfo& rInf, const SwLinePortion& rP
((SwTxtPaintInfo&)rInf).SetFont( pFnt );
// The maximum width depends on the current orientation
- const USHORT nDir = pFnt->GetOrientation( rInf.GetTxtFrm()->IsVertical() );
+ const sal_uInt16 nDir = pFnt->GetOrientation( rInf.GetTxtFrm()->IsVertical() );
SwTwips nMaxWidth = 0;
switch ( nDir )
{
@@ -929,7 +929,7 @@ static void lcl_DrawSpecial( const SwTxtPaintInfo& rInf, const SwLinePortion& rP
const SwTwips nOldWidth = aFontSize.Width();
// new height for font
- const BYTE nAct = pFnt->GetActual();
+ const sal_uInt8 nAct = pFnt->GetActual();
aFontSize.Height() = ( 100 * pFnt->GetSize( nAct ).Height() ) / nFactor;
aFontSize.Width() = ( 100 * pFnt->GetSize( nAct).Width() ) / nFactor;
@@ -970,8 +970,8 @@ static void lcl_DrawSpecial( const SwTxtPaintInfo& rInf, const SwLinePortion& rP
Point aTmpPos( nX, nY );
((SwTxtPaintInfo&)rInf).SetPos( aTmpPos );
- USHORT nOldWidth = rPor.Width();
- ((SwLinePortion&)rPor).Width( (USHORT)aFontSize.Width() );
+ sal_uInt16 nOldWidth = rPor.Width();
+ ((SwLinePortion&)rPor).Width( (sal_uInt16)aFontSize.Width() );
rInf.DrawText( aTmp, rPor );
((SwLinePortion&)rPor).Width( nOldWidth );
((SwTxtPaintInfo&)rInf).SetFont( (SwFont*)pOldFnt );
@@ -1016,7 +1016,7 @@ void SwTxtPaintInfo::DrawTab( const SwLinePortion &rPor ) const
const sal_Unicode cChar = GetTxtFrm()->IsRightToLeft() ?
CHAR_TAB_RTL : CHAR_TAB;
- const BYTE nOptions = DRAW_SPECIAL_OPTIONS_CENTER |
+ const sal_uInt8 nOptions = DRAW_SPECIAL_OPTIONS_CENTER |
DRAW_SPECIAL_OPTIONS_ROTATE;
lcl_DrawSpecial( *this, rPor, aRect, 0, cChar, nOptions );
}
@@ -1040,7 +1040,7 @@ void SwTxtPaintInfo::DrawLineBreak( const SwLinePortion &rPor ) const
{
const sal_Unicode cChar = GetTxtFrm()->IsRightToLeft() ?
CHAR_LINEBREAK_RTL : CHAR_LINEBREAK;
- const BYTE nOptions = 0;
+ const sal_uInt8 nOptions = 0;
lcl_DrawSpecial( *this, rPor, aRect, 0, cChar, nOptions );
}
@@ -1082,7 +1082,7 @@ void SwTxtPaintInfo::DrawRedArrow( const SwLinePortion &rPor ) const
if( aRect.HasArea() )
{
- const BYTE nOptions = 0;
+ const sal_uInt8 nOptions = 0;
lcl_DrawSpecial( *this, rPor, aRect, &aCol, cChar, nOptions );
}
}
@@ -1099,9 +1099,9 @@ void SwTxtPaintInfo::DrawPostIts( const SwLinePortion&, sal_Bool bScript ) const
Size aSize;
Point aTmp;
- const USHORT nPostItsWidth = pOpt->GetPostItsWidth( GetOut() );
- const USHORT nFontHeight = pFnt->GetHeight( pVsh, *GetOut() );
- const USHORT nFontAscent = pFnt->GetAscent( pVsh, *GetOut() );
+ const sal_uInt16 nPostItsWidth = pOpt->GetPostItsWidth( GetOut() );
+ const sal_uInt16 nFontHeight = pFnt->GetHeight( pVsh, *GetOut() );
+ const sal_uInt16 nFontAscent = pFnt->GetAscent( pVsh, *GetOut() );
switch ( pFnt->GetOrientation( GetTxtFrm()->IsVertical() ) )
{
@@ -1339,9 +1339,9 @@ void SwTxtPaintInfo::_NotifyURL( const SwLinePortion &rPor ) const
*************************************************************************/
static void lcl_InitHyphValues( PropertyValues &rVals,
- INT16 nMinLeading, INT16 nMinTrailing )
+ sal_Int16 nMinLeading, sal_Int16 nMinTrailing )
{
- INT32 nLen = rVals.getLength();
+ sal_Int32 nLen = rVals.getLength();
if (0 == nLen) // yet to be initialized?
{
@@ -1396,8 +1396,8 @@ sal_Bool SwTxtFormatInfo::InitHyph( const sal_Bool bAutoHyphen )
nHyphStart = nHyphWrdStart = STRING_LEN;
nHyphWrdLen = 0;
- const INT16 nMinimalLeading = Max(rAttr.GetMinLead(), sal_uInt8(2));
- const INT16 nMinimalTrailing = rAttr.GetMinTrail();
+ const sal_Int16 nMinimalLeading = Max(rAttr.GetMinLead(), sal_uInt8(2));
+ const sal_Int16 nMinimalTrailing = rAttr.GetMinTrail();
lcl_InitHyphValues( aHyphVals, nMinimalLeading, nMinimalTrailing);
}
return bAuto;
@@ -1558,23 +1558,23 @@ SwTxtFormatInfo::SwTxtFormatInfo( const SwTxtFormatInfo& rInf,
nMinLeading = 0;
nMinTrailing = 0;
nMinWordLength = 0;
- bFull = FALSE;
- bFtnDone = TRUE;
- bErgoDone = TRUE;
- bNumDone = TRUE;
- bArrowDone = TRUE;
- bStop = FALSE;
- bNewLine = TRUE;
- bShift = FALSE;
- bUnderFlow = FALSE;
- bInterHyph = FALSE;
- bAutoHyph = FALSE;
- bDropInit = FALSE;
+ bFull = sal_False;
+ bFtnDone = sal_True;
+ bErgoDone = sal_True;
+ bNumDone = sal_True;
+ bArrowDone = sal_True;
+ bStop = sal_False;
+ bNewLine = sal_True;
+ bShift = sal_False;
+ bUnderFlow = sal_False;
+ bInterHyph = sal_False;
+ bAutoHyph = sal_False;
+ bDropInit = sal_False;
bQuick = rInf.bQuick;
- bNoEndHyph = FALSE;
- bNoMidHyph = FALSE;
- bIgnoreFly = FALSE;
- bFakeLineStart = FALSE;
+ bNoEndHyph = sal_False;
+ bNoMidHyph = sal_False;
+ bIgnoreFly = sal_False;
+ bFakeLineStart = sal_False;
cTabDecimal = 0;
cHookChar = 0;
@@ -1718,15 +1718,15 @@ xub_StrLen SwTxtFormatInfo::ScanPortionEnd( const xub_StrLen nStart,
return i;
}
-BOOL SwTxtFormatInfo::LastKernPortion()
+sal_Bool SwTxtFormatInfo::LastKernPortion()
{
if( GetLast() )
{
if( GetLast()->IsKernPortion() )
- return TRUE;
+ return sal_True;
if( GetLast()->Width() || ( GetLast()->GetLen() &&
!GetLast()->IsHolePortion() ) )
- return FALSE;
+ return sal_False;
}
SwLinePortion* pPor = GetRoot();
SwLinePortion *pKern = NULL;
@@ -1741,9 +1741,9 @@ BOOL SwTxtFormatInfo::LastKernPortion()
if( pKern )
{
SetLast( pKern );
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -1782,7 +1782,7 @@ SwTxtSlot::SwTxtSlot( const SwTxtSizeInfo *pNew, const SwLinePortion *pPor,
pOldSmartTagList = static_cast<SwTxtPaintInfo*>(pInf)->GetSmartTags();
if ( pOldSmartTagList )
{
- const USHORT nPos = pOldSmartTagList->GetWrongPos(nIdx);
+ const sal_uInt16 nPos = pOldSmartTagList->GetWrongPos(nIdx);
const xub_StrLen nListPos = pOldSmartTagList->Pos(nPos);
if( nListPos == nIdx )
((SwTxtPaintInfo*)pInf)->SetSmartTags( pOldSmartTagList->SubList( nPos ) );
@@ -1798,7 +1798,7 @@ SwTxtSlot::SwTxtSlot( const SwTxtSizeInfo *pNew, const SwLinePortion *pPor,
pOldGrammarCheckList = static_cast<SwTxtPaintInfo*>(pInf)->GetGrammarCheckList();
if ( pOldGrammarCheckList )
{
- const USHORT nPos = pOldGrammarCheckList->GetWrongPos(nIdx);
+ const sal_uInt16 nPos = pOldGrammarCheckList->GetWrongPos(nIdx);
const xub_StrLen nListPos = pOldGrammarCheckList->Pos(nPos);
if( nListPos == nIdx )
((SwTxtPaintInfo*)pInf)->SetGrammarCheckList( pOldGrammarCheckList->SubList( nPos ) );
@@ -1903,7 +1903,7 @@ SwFontSave::~SwFontSave()
SwDefFontSave::SwDefFontSave( const SwTxtSizeInfo &rInf )
: pFnt( ((SwTxtSizeInfo&)rInf).GetFont() )
{
- const BOOL bTmpAlter = pFnt->GetFixKerning() ||
+ const sal_Bool bTmpAlter = pFnt->GetFixKerning() ||
( RTL_TEXTENCODING_SYMBOL == pFnt->GetCharSet(pFnt->GetActual()) )
;
diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx
index 382c58a6f5c6..065e38a0e563 100644
--- a/sw/source/core/text/inftxt.hxx
+++ b/sw/source/core/text/inftxt.hxx
@@ -98,7 +98,7 @@ class SwLineInfo
SvxTabStopItem* pRuler;
const SvxLineSpacingItem *pSpace;
- USHORT nVertAlign;
+ sal_uInt16 nVertAlign;
KSHORT nDefTabStop;
// --> OD 2008-02-04 #newlistlevelattrs#
bool bListTabStopIncluded;
@@ -125,14 +125,14 @@ public:
{ ( (SwLineInfo*)this )->nDefTabStop = nNew; }
// vertical alignment
- inline USHORT GetVertAlign() const { return nVertAlign; }
+ inline sal_uInt16 GetVertAlign() const { return nVertAlign; }
inline sal_Bool HasSpecialAlign( sal_Bool bVert ) const
{ return bVert ?
( SvxParaVertAlignItem::BASELINE != nVertAlign ) :
( SvxParaVertAlignItem::BASELINE != nVertAlign &&
SvxParaVertAlignItem::AUTOMATIC != nVertAlign ); }
- USHORT NumberOfTabStops() const;
+ sal_uInt16 NumberOfTabStops() const;
// --> OD 2008-02-04 #newlistlevelattrs#
inline bool IsListTabStopIncluded() const
@@ -202,7 +202,7 @@ protected:
const SwViewOption *pOpt;
const XubString *pTxt;
xub_StrLen nIdx, nLen;
- USHORT nKanaIdx;
+ sal_uInt16 nKanaIdx;
sal_Bool bOnWin : 1;
sal_Bool bNotEOL : 1;
sal_Bool bURLNotify : 1;
@@ -302,13 +302,13 @@ public:
//
SwPosSize GetTxtSize( OutputDevice* pOut, const SwScriptInfo* pSI,
const XubString& rTxt, const xub_StrLen nIdx,
- const xub_StrLen nLen, const USHORT nComp ) const;
+ const xub_StrLen nLen, const sal_uInt16 nComp ) const;
SwPosSize GetTxtSize() const;
void GetTxtSize( const SwScriptInfo* pSI, const xub_StrLen nIdx,
- const xub_StrLen nLen, const USHORT nComp,
- USHORT& nMinSize, USHORT& nMaxSizeDiff ) const;
+ const xub_StrLen nLen, const sal_uInt16 nComp,
+ sal_uInt16& nMinSize, sal_uInt16& nMaxSizeDiff ) const;
inline SwPosSize GetTxtSize( const SwScriptInfo* pSI, const xub_StrLen nIdx,
- const xub_StrLen nLen, const USHORT nComp ) const;
+ const xub_StrLen nLen, const sal_uInt16 nComp ) const;
inline SwPosSize GetTxtSize( const XubString &rTxt ) const;
//
@@ -316,10 +316,10 @@ public:
//
xub_StrLen GetTxtBreak( const long nLineWidth,
const xub_StrLen nMaxLen,
- const USHORT nComp ) const;
+ const sal_uInt16 nComp ) const;
xub_StrLen GetTxtBreak( const long nLineWidth,
const xub_StrLen nMaxLen,
- const USHORT nComp,
+ const sal_uInt16 nComp,
xub_StrLen& rExtraCharPos ) const;
inline KSHORT GetAscent() const;
@@ -351,13 +351,13 @@ public:
// space among compressed kanas.
// During formatting, the maximum values of compressable portions are
// stored in aMaxWidth and discarded after a line has been formatted.
- inline void SetMaxWidthDiff( ULONG nKey, USHORT nVal )
+ inline void SetMaxWidthDiff( sal_uLong nKey, sal_uInt16 nVal )
{
aMaxWidth.Insert( nKey, nVal );
};
- inline USHORT GetMaxWidthDiff( ULONG nKey )
+ inline sal_uInt16 GetMaxWidthDiff( sal_uLong nKey )
{
- return (USHORT)aMaxWidth.Get( nKey );
+ return (sal_uInt16)aMaxWidth.Get( nKey );
};
inline void ResetMaxWidthDiff()
{
@@ -377,7 +377,7 @@ public:
inline void IncKanaIdx() { ++nKanaIdx; }
inline void SetKanaComp( SvUShorts *pNew ){ pKanaComp = pNew; }
inline SvUShorts* GetpKanaComp() const { return pKanaComp; }
- inline USHORT GetKanaComp() const
+ inline sal_uInt16 GetKanaComp() const
{ return ( pKanaComp && nKanaIdx < pKanaComp->Count() )
? (*pKanaComp)[nKanaIdx] : 0; }
@@ -542,7 +542,7 @@ class SwTxtFormatInfo : public SwTxtPaintInfo
xub_StrLen nHyphWrdLen; // gefundene Wort-Laenge
xub_StrLen nLineStart; // aktueller Zeilenbeginn im rTxt
xub_StrLen nUnderScorePos; // enlarge repaint if underscore has been found
- // --> FME 2004-11-25 #i34348# Changed type from USHORT to SwTwips
+ // --> FME 2004-11-25 #i34348# Changed type from sal_uInt16 to SwTwips
SwTwips nLeft; // linker Rand
SwTwips nRight; // rechter Rand
SwTwips nFirst; // EZE
@@ -553,9 +553,9 @@ class SwTxtFormatInfo : public SwTxtPaintInfo
KSHORT nLineNettoHeight; // line height without spacing
KSHORT nForcedLeftMargin; // Verschiebung des linken Rands wg. Rahmen
- INT16 nMinLeading; // minimum number of chars before hyphenation point
- INT16 nMinTrailing; // minimum number of chars after hyphenation point
- INT16 nMinWordLength; // minimum length of word to be hyphenated
+ sal_Int16 nMinLeading; // minimum number of chars before hyphenation point
+ sal_Int16 nMinTrailing; // minimum number of chars after hyphenation point
+ sal_Int16 nMinWordLength; // minimum length of word to be hyphenated
sal_Bool bFull : 1; // Zeile ist voll
sal_Bool bFtnDone : 1; // Ftn bereits formatiert
@@ -723,7 +723,7 @@ public:
// ruft HyphenateWord() des Hyphenators
::com::sun::star::uno::Reference<
::com::sun::star::linguistic2::XHyphenatedWord >
- HyphWord( const String &rTxt, const USHORT nMinTrail );
+ HyphWord( const String &rTxt, const sal_uInt16 nMinTrail );
const com::sun::star::beans::PropertyValues &
GetHyphValues() const;
@@ -737,7 +737,7 @@ public:
void Reset( const SwTxtFrm *pFrame); // , const sal_Bool bAll );
// Sets the last SwKernPortion as pLast, if it is followed by empty portions
- BOOL LastKernPortion();
+ sal_Bool LastKernPortion();
// Sucht ab nIdx bis nEnd nach Tabs, TabDec, TXTATR und BRK.
// Return: gefundene Position, setzt ggf. cHookChar
@@ -831,7 +831,7 @@ inline SwPosSize SwTxtSizeInfo::GetTxtSize( const XubString &rTxt ) const
inline SwPosSize SwTxtSizeInfo::GetTxtSize( const SwScriptInfo* pSI,
const xub_StrLen nNewIdx,
const xub_StrLen nNewLen,
- const USHORT nCompress ) const
+ const sal_uInt16 nCompress ) const
{
return GetTxtSize( pOut, pSI, *pTxt, nNewIdx, nNewLen, nCompress );
}
diff --git a/sw/source/core/text/itradj.cxx b/sw/source/core/text/itradj.cxx
index b8e361bcae6c..a262b411a4f9 100644
--- a/sw/source/core/text/itradj.cxx
+++ b/sw/source/core/text/itradj.cxx
@@ -176,7 +176,7 @@ bool lcl_CheckKashidaPositions( SwScriptInfo& rSI, SwTxtSizeInfo& rInf, SwTxtIte
}
else
{
- ULONG nOldLayout = rInf.GetOut()->GetLayoutMode();
+ sal_uLong nOldLayout = rInf.GetOut()->GetLayoutMode();
rInf.GetOut()->SetLayoutMode ( nOldLayout | TEXT_LAYOUT_BIDI_RTL );
nKashidasDropped = rInf.GetOut()->ValidateKashidas ( rInf.GetTxt(), nIdx, nNext - nIdx,
nKashidasInAttr, pKashidaPos + nKashidaIdx,
@@ -429,7 +429,7 @@ SwTwips SwTxtAdjuster::CalcKanaAdj( SwLineLayout* pCurrent )
SvUShorts *pNewKana = new SvUShorts;
pCurrent->SetKanaComp( pNewKana );
- const USHORT nNull = 0;
+ const sal_uInt16 nNull = 0;
MSHORT nKanaIdx = 0;
long nKanaDiffSum = 0;
SwTwips nRepaintOfst = 0;
@@ -448,11 +448,11 @@ SwTwips SwTxtAdjuster::CalcKanaAdj( SwLineLayout* pCurrent )
{
// get maximum portion width from info structure, calculated
// during text formatting
- USHORT nMaxWidthDiff = GetInfo().GetMaxWidthDiff( (ULONG)pPos );
+ sal_uInt16 nMaxWidthDiff = GetInfo().GetMaxWidthDiff( (sal_uLong)pPos );
// check, if information is stored under other key
if ( !nMaxWidthDiff && pPos == pCurrent->GetFirstPortion() )
- nMaxWidthDiff = GetInfo().GetMaxWidthDiff( (ULONG)pCurrent );
+ nMaxWidthDiff = GetInfo().GetMaxWidthDiff( (sal_uLong)pCurrent );
// calculate difference between portion width and max. width
nKanaDiffSum += nMaxWidthDiff;
@@ -467,7 +467,7 @@ SwTwips SwTxtAdjuster::CalcKanaAdj( SwLineLayout* pCurrent )
if ( nKanaIdx == pCurrent->GetKanaComp().Count() )
pCurrent->GetKanaComp().Insert( nNull, nKanaIdx );
- USHORT nRest;
+ sal_uInt16 nRest;
if ( pPos->InTabGrp() )
{
@@ -492,7 +492,7 @@ SwTwips SwTxtAdjuster::CalcKanaAdj( SwLineLayout* pCurrent )
if( nKanaDiffSum )
{
- ULONG nCompress = ( 10000 * nRest ) / nKanaDiffSum;
+ sal_uLong nCompress = ( 10000 * nRest ) / nKanaDiffSum;
if ( nCompress >= 10000 )
// kanas can be expanded to 100%, and there is still
@@ -502,7 +502,7 @@ SwTwips SwTxtAdjuster::CalcKanaAdj( SwLineLayout* pCurrent )
else
nCompress = 10000 - nCompress;
- ( pCurrent->GetKanaComp() )[ nKanaIdx ] = (USHORT)nCompress;
+ ( pCurrent->GetKanaComp() )[ nKanaIdx ] = (sal_uInt16)nCompress;
nKanaDiffSum = 0;
}
@@ -515,7 +515,7 @@ SwTwips SwTxtAdjuster::CalcKanaAdj( SwLineLayout* pCurrent )
// set portion width
nKanaIdx = 0;
- USHORT nCompress = ( pCurrent->GetKanaComp() )[ nKanaIdx ];
+ sal_uInt16 nCompress = ( pCurrent->GetKanaComp() )[ nKanaIdx ];
pPos = pCurrent->GetPortion();
long nDecompress = 0;
nKanaDiffSum = 0;
@@ -524,15 +524,15 @@ SwTwips SwTxtAdjuster::CalcKanaAdj( SwLineLayout* pCurrent )
{
if ( pPos->InTxtGrp() )
{
- const USHORT nMinWidth = pPos->Width();
+ const sal_uInt16 nMinWidth = pPos->Width();
// get maximum portion width from info structure, calculated
// during text formatting
- USHORT nMaxWidthDiff = GetInfo().GetMaxWidthDiff( (ULONG)pPos );
+ sal_uInt16 nMaxWidthDiff = GetInfo().GetMaxWidthDiff( (sal_uLong)pPos );
// check, if information is stored under other key
if ( !nMaxWidthDiff && pPos == pCurrent->GetFirstPortion() )
- nMaxWidthDiff = GetInfo().GetMaxWidthDiff( (ULONG)pCurrent );
+ nMaxWidthDiff = GetInfo().GetMaxWidthDiff( (sal_uLong)pCurrent );
nKanaDiffSum += nMaxWidthDiff;
pPos->Width( nMinWidth +
( ( 10000 - nCompress ) * nMaxWidthDiff ) / 10000 );
@@ -546,7 +546,7 @@ SwTwips SwTxtAdjuster::CalcKanaAdj( SwLineLayout* pCurrent )
nKanaDiffSum /= 10000;
}
- pPos->Width( static_cast<USHORT>(pPos->Width() - nDecompress) );
+ pPos->Width( static_cast<sal_uInt16>(pPos->Width() - nDecompress) );
if ( pPos->InTabGrp() )
// set fix width to width
@@ -573,8 +573,8 @@ SwMarginPortion *SwTxtAdjuster::CalcRightMargin( SwLineLayout *pCurrent,
SwTwips nReal )
{
long nRealWidth;
- const USHORT nRealHeight = GetLineHeight();
- const USHORT nLineHeight = pCurrent->Height();
+ const sal_uInt16 nRealHeight = GetLineHeight();
+ const sal_uInt16 nLineHeight = pCurrent->Height();
KSHORT nPrtWidth = pCurrent->PrtWidth();
SwLinePortion *pLast = pCurrent->FindLastPortion();
diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx
index 71df51432fe9..4e89e2c53ed3 100644
--- a/sw/source/core/text/itratr.cxx
+++ b/sw/source/core/text/itratr.cxx
@@ -333,7 +333,7 @@ xub_StrLen SwAttrIter::GetNextAttr( ) const
if (m_pTxtNode!=NULL) {
//TODO maybe use hints like FieldHints for this instead of looking at the text...
int l=(nNext<m_pTxtNode->Len()?nNext:m_pTxtNode->Len());
- USHORT p=nPos;
+ sal_uInt16 p=nPos;
const sal_Unicode *txt=m_pTxtNode->GetTxt().GetBuffer();
while(p<l && txt[p]!=CH_TXT_ATR_FIELDSTART && txt[p]!=CH_TXT_ATR_FIELDEND && txt[p]!=CH_TXT_ATR_FORMELEMENT) p++;
if ((p<l && p>nPos) || nNext<=p)
@@ -363,14 +363,14 @@ class SwMinMaxArgs
public:
OutputDevice* pOut;
ViewShell* pSh;
- ULONG &rMin;
- ULONG &rMax;
- ULONG &rAbsMin;
+ sal_uLong &rMin;
+ sal_uLong &rMax;
+ sal_uLong &rAbsMin;
long nRowWidth;
long nWordWidth;
long nWordAdd;
xub_StrLen nNoLineBreak;
- SwMinMaxArgs( OutputDevice* pOutI, ViewShell* pShI, ULONG& rMinI, ULONG &rMaxI, ULONG &rAbsI )
+ SwMinMaxArgs( OutputDevice* pOutI, ViewShell* pShI, sal_uLong& rMinI, sal_uLong &rMaxI, sal_uLong &rAbsI )
: pOut( pOutI ), pSh( pShI ), rMin( rMinI ), rMax( rMaxI ), rAbsMin( rAbsI )
{ nRowWidth = nWordWidth = nWordAdd = 0; nNoLineBreak = STRING_LEN; }
void Minimum( long nNew ) { if( (long)rMin < nNew ) rMin = nNew; }
@@ -391,7 +391,7 @@ sal_Bool lcl_MinMaxString( SwMinMaxArgs& rArg, SwFont* pFnt, const XubString &rT
bClear = CH_BLANK == rTxt.GetChar( nStop );
Boundary aBndry( pBreakIt->GetBreakIter()->getWordBoundary( rTxt, nIdx,
pBreakIt->GetLocale( eLang ),
- WordType::DICTIONARY_WORD, TRUE ) );
+ WordType::DICTIONARY_WORD, sal_True ) );
nStop = (xub_StrLen)aBndry.endPos;
if( nIdx <= aBndry.startPos && nIdx && nIdx-1 != rArg.nNoLineBreak )
rArg.NewWord();
@@ -443,13 +443,13 @@ sal_Bool SwTxtNode::IsSymbol( const xub_StrLen nBegin ) const//swmodtest 080307
class SwMinMaxNodeArgs
{
public:
- ULONG nMaxWidth; // Summe aller Rahmenbreite
+ sal_uLong nMaxWidth; // Summe aller Rahmenbreite
long nMinWidth; // Breitester Rahmen
long nLeftRest; // noch nicht von Rahmen ueberdeckter Platz im l. Rand
long nRightRest; // noch nicht von Rahmen ueberdeckter Platz im r. Rand
long nLeftDiff; // Min/Max-Differenz des Rahmens im linken Rand
long nRightDiff; // Min/Max-Differenz des Rahmens im rechten Rand
- ULONG nIndx; // Indexnummer des Nodes
+ sal_uLong nIndx; // Indexnummer des Nodes
void Minimum( long nNew ) { if( nNew > nMinWidth ) nMinWidth = nNew; }
};
@@ -483,7 +483,7 @@ sal_Bool lcl_MinMaxNode( const SwFrmFmtPtr& rpNd, void* pArgs )
// Enthaelt der Rahmen zu Beginn oder am Ende eine Tabelle?
const SwNodes& rNodes = static_cast<SwFrmFmt*>(rpNd)->GetDoc()->GetNodes();
const SwFmtCntnt& rFlyCntnt = ((SwFrmFmt*)rpNd)->GetCntnt();
- ULONG nStt = rFlyCntnt.GetCntntIdx()->GetIndex();
+ sal_uLong nStt = rFlyCntnt.GetCntntIdx()->GetIndex();
SwTableNode* pTblNd = rNodes[nStt+1]->GetTableNode();
if( !pTblNd )
{
@@ -589,8 +589,13 @@ sal_Bool lcl_MinMaxNode( const SwFrmFmtPtr& rpNd, void* pArgs )
// changing this method very likely requires changing of
// "GetScalingOfSelectedText"
+<<<<<<< local
void SwTxtNode::GetMinMaxSize( ULONG nIndex, ULONG& rMin, ULONG &rMax,
ULONG& rAbsMin, OutputDevice* pOut ) const//swmodtest 080307
+=======
+void SwTxtNode::GetMinMaxSize( sal_uLong nIndex, sal_uLong& rMin, sal_uLong &rMax,
+ sal_uLong& rAbsMin, OutputDevice* pOut ) const
+>>>>>>> other
{
ViewShell* pSh = 0;
GetDoc()->GetEditShell( &pSh );
@@ -825,7 +830,7 @@ void SwTxtNode::GetMinMaxSize( ULONG nIndex, ULONG& rMin, ULONG &rMax,
* changing this method very likely requires changing of "GetMinMaxSize"
*************************************************************************/
-USHORT SwTxtNode::GetScalingOfSelectedText( xub_StrLen nStt, xub_StrLen nEnd )
+sal_uInt16 SwTxtNode::GetScalingOfSelectedText( xub_StrLen nStt, xub_StrLen nEnd )
const
{
ViewShell* pSh = NULL;
@@ -893,8 +898,8 @@ USHORT SwTxtNode::GetScalingOfSelectedText( xub_StrLen nStt, xub_StrLen nEnd )
xub_StrLen nIdx = nStt;
- ULONG nWidth = 0;
- ULONG nProWidth = 0;
+ sal_uLong nWidth = 0;
+ sal_uLong nProWidth = 0;
while( nIdx < nEnd )
{
@@ -1018,7 +1023,7 @@ USHORT SwTxtNode::GetScalingOfSelectedText( xub_StrLen nStt, xub_StrLen nEnd )
SwTxtIter aLine( pFrm, &aInf );
aLine.CharToLine( nStt );
pOut->SetMapMode( aOldMap );
- return (USHORT)( nWidth ?
+ return (sal_uInt16)( nWidth ?
( ( 100 * aLine.GetCurr()->Height() ) / nWidth ) : 0 );
}
// no frame or no paragraph, we take the height of the character
@@ -1028,13 +1033,13 @@ USHORT SwTxtNode::GetScalingOfSelectedText( xub_StrLen nStt, xub_StrLen nEnd )
pOut->SetMapMode( aOldMap );
SwDrawTextInfo aDrawInf( pSh, *pOut, 0, GetTxt(), nStt, 1 );
- return (USHORT)
+ return (sal_uInt16)
( nWidth ? ((100 * aIter.GetFnt()->_GetTxtSize( aDrawInf ).Height()) / nWidth ) : 0 );
}
-USHORT SwTxtNode::GetWidthOfLeadingTabs() const
+sal_uInt16 SwTxtNode::GetWidthOfLeadingTabs() const
{
- USHORT nRet = 0;
+ sal_uInt16 nRet = 0;
xub_StrLen nIdx = 0;
sal_Unicode cCh;
@@ -1059,7 +1064,7 @@ USHORT SwTxtNode::GetWidthOfLeadingTabs() const
SWRECTFN( pFrm )
SwRect aRect;
pFrm->GetCharRect( aRect, aPos );
- nRet = (USHORT)
+ nRet = (sal_uInt16)
( pFrm->IsRightToLeft() ?
(pFrm->*fnRect->fnGetPrtRight)() - (aRect.*fnRect->fnGetRight)() :
(aRect.*fnRect->fnGetLeft)() - (pFrm->*fnRect->fnGetPrtLeft)() );
diff --git a/sw/source/core/text/itratr.hxx b/sw/source/core/text/itratr.hxx
index 5a8854c8c075..372c6083b73f 100644
--- a/sw/source/core/text/itratr.hxx
+++ b/sw/source/core/text/itratr.hxx
@@ -67,7 +67,7 @@ private:
MSHORT nChgCnt;
SwRedlineItr *pRedln;
xub_StrLen nStartIndex, nEndIndex, nPos;
- BYTE nPropFont;
+ sal_uInt8 nPropFont;
void SeekFwd( const xub_StrLen nPos );
inline void SetFnt( SwFont* pNew ) { pFnt = pNew; }
const void* aMagicNo[ SW_SCRIPTS ];
@@ -118,8 +118,8 @@ public:
inline SwFont *GetFnt() { return pFnt; }
inline const SwFont *GetFnt() const { return pFnt; }
- inline BYTE GetPropFont() const { return nPropFont; }
- inline void SetPropFont( const BYTE nNew ) { nPropFont = nNew; }
+ inline sal_uInt8 GetPropFont() const { return nPropFont; }
+ inline void SetPropFont( const sal_uInt8 nNew ) { nPropFont = nNew; }
inline SwAttrHandler& GetAttrHandler() { return aAttrHandler; }
diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index 34c0a9843986..67569418f0bb 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -81,9 +81,9 @@ void lcl_GetCharRectInsideField( SwTxtSizeInfo& rInf, SwRect& rOrig,
if ( rPor.InFldGrp() && ((SwFldPortion&)rPor).GetExp().Len() )
{
- const USHORT nCharOfst = rCMS.pSpecialPos->nCharOfst;
- USHORT nFldIdx = 0;
- USHORT nFldLen = 0;
+ const sal_uInt16 nCharOfst = rCMS.pSpecialPos->nCharOfst;
+ sal_uInt16 nFldIdx = 0;
+ sal_uInt16 nFldLen = 0;
const XubString* pString = 0;
const SwLinePortion* pPor = &rPor;
@@ -107,10 +107,10 @@ void lcl_GetCharRectInsideField( SwTxtSizeInfo& rInf, SwRect& rOrig,
rOrig.Pos().X() += pPor->Width();
pPor = pPor->GetPortion();
- } while ( TRUE );
+ } while ( sal_True );
ASSERT( nCharOfst >= nFldIdx, "Request of position inside field failed" )
- USHORT nLen = nCharOfst - nFldIdx + 1;
+ sal_uInt16 nLen = nCharOfst - nFldIdx + 1;
if ( pString )
{
@@ -155,7 +155,7 @@ namespace {
if ( rTxtNode.AreListLevelIndentsApplicable() )
{
const SwNumFmt& rNumFmt =
- rTxtNode.GetNumRule()->Get( static_cast<USHORT>(rTxtNode.GetActualListLevel()) );
+ rTxtNode.GetNumRule()->Get( static_cast<sal_uInt16>(rTxtNode.GetActualListLevel()) );
if ( rNumFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT )
{
bRet = true;
@@ -350,7 +350,7 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf )
nFirst = nRight - 1;
}
const SvxAdjustItem& rAdjust = pFrm->GetTxtNode()->GetSwAttrSet().GetAdjust();
- nAdjust = static_cast<USHORT>(rAdjust.GetAdjust());
+ nAdjust = static_cast<sal_uInt16>(rAdjust.GetAdjust());
// left is left and right is right
if ( pFrm->IsRightToLeft() )
@@ -646,7 +646,7 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
// For common portions (including BidiPortions) we want to add
// the portion width to nX. For MultiPortions, nExtra = 0,
// therefore we go to the 'else' branch and start a recursion.
- const BYTE nExtra = pPor->IsMultiPortion() &&
+ const sal_uInt8 nExtra = pPor->IsMultiPortion() &&
! ((SwMultiPortion*)pPor)->IsBidi() &&
! bWidth ? 0 : 1;
if ( aInf.GetIdx() + pPor->GetLen() < nOfst + nExtra )
@@ -758,7 +758,7 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
// of the multi-portion.
xub_StrLen nOldStart = nStart;
SwTwips nOldY = nY;
- BYTE nOldProp = GetPropFont();
+ sal_uInt8 nOldProp = GetPropFont();
nStart = aInf.GetIdx();
SwLineLayout* pOldCurr = pCurr;
pCurr = &((SwMultiPortion*)pPor)->GetRoot();
@@ -767,14 +767,14 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
GETGRID( GetTxtFrm()->FindPageFrm() )
const sal_Bool bHasGrid = pGrid && GetInfo().SnapToGrid();
- const USHORT nRubyHeight = bHasGrid ?
+ const sal_uInt16 nRubyHeight = bHasGrid ?
pGrid->GetRubyHeight() : 0;
if( nStart + pCurr->GetLen() <= nOfst && GetNext() &&
( ! ((SwMultiPortion*)pPor)->IsRuby() ||
((SwMultiPortion*)pPor)->OnTop() ) )
{
- USHORT nOffset;
+ sal_uInt16 nOffset;
// in grid mode we may only add the height of the
// ruby line if ruby line is on top
if ( bHasGrid &&
@@ -796,8 +796,8 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
// temporarily set the inner line height to the
// outer line height because that value is needed
// for the adjustment inside the recursion
- const USHORT nOldRubyHeight = pCurr->Height();
- const USHORT nOldRubyRealHeight = pCurr->GetRealHeight();
+ const sal_uInt16 nOldRubyHeight = pCurr->Height();
+ const sal_uInt16 nOldRubyRealHeight = pCurr->GetRealHeight();
const sal_Bool bChgHeight =
((SwMultiPortion*)pPor)->IsRuby() && bHasGrid;
@@ -1073,7 +1073,7 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
if( nTmpHeight < pOrig->Height() )
{
nTmpAscent = nPorAscent;
- nTmpHeight = USHORT( pOrig->Height() );
+ nTmpHeight = sal_uInt16( pOrig->Height() );
}
}
if( bWidth && pPor->PrtWidth() && pPor->GetLen() &&
@@ -1133,7 +1133,7 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
// the bidi portion
if ( pLastBidiPor )
{
- const BYTE nPortionLevel = pLastBidiPor->GetLevel();
+ const sal_uInt8 nPortionLevel = pLastBidiPor->GetLevel();
if ( pCMS->nCursorBidiLevel >= nPortionLevel )
{
@@ -1160,7 +1160,7 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
}
else
{
- const BYTE nPortionLevel = ((SwBidiPortion*)pPor)->GetLevel();
+ const sal_uInt8 nPortionLevel = ((SwBidiPortion*)pPor)->GetLevel();
if ( pCMS->nCursorBidiLevel >= nPortionLevel )
{
@@ -1206,7 +1206,7 @@ sal_Bool SwTxtCursor::GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
if ( bSpecialPos )
{
- const BYTE nExtendRange = pCMS->pSpecialPos->nExtendRange;
+ const sal_uInt8 nExtendRange = pCMS->pSpecialPos->nExtendRange;
ASSERT( ! pCMS->pSpecialPos->nLineOfst || SP_EXTEND_RANGE_BEFORE != nExtendRange,
"LineOffset AND Number Portion?" )
@@ -1216,7 +1216,7 @@ sal_Bool SwTxtCursor::GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
++nFindOfst;
// skip lines for fields which cover more than one line
- for ( USHORT i = 0; i < pCMS->pSpecialPos->nLineOfst; i++ )
+ for ( sal_uInt16 i = 0; i < pCMS->pSpecialPos->nLineOfst; i++ )
Next();
}
@@ -1335,7 +1335,7 @@ xub_StrLen SwTxtCursor::GetCrsrOfst( SwPosition *pPos, const Point &rPoint,
if ( pPor->InSpaceGrp() && nSpaceAdd )
{
((SwTxtSizeInfo&)GetInfo()).SetIdx( nCurrStart );
- nWidth = nWidth + USHORT( pPor->CalcSpacing( nSpaceAdd, GetInfo() ) );
+ nWidth = nWidth + sal_uInt16( pPor->CalcSpacing( nSpaceAdd, GetInfo() ) );
}
if( ( pPor->InFixMargGrp() && ! pPor->IsMarginPortion() ) ||
( pPor->IsMultiPortion() && ((SwMultiPortion*)pPor)->HasTabulator() )
@@ -1379,7 +1379,7 @@ xub_StrLen SwTxtCursor::GetCrsrOfst( SwPosition *pPos, const Point &rPoint,
if ( pPor->InSpaceGrp() && nSpaceAdd )
{
((SwTxtSizeInfo&)GetInfo()).SetIdx( nCurrStart );
- nWidth = nWidth + USHORT( pPor->CalcSpacing( nSpaceAdd, GetInfo() ) );
+ nWidth = nWidth + sal_uInt16( pPor->CalcSpacing( nSpaceAdd, GetInfo() ) );
}
if( ( pPor->InFixMargGrp() && ! pPor->IsMarginPortion() ) ||
@@ -1584,7 +1584,7 @@ xub_StrLen SwTxtCursor::GetCrsrOfst( SwPosition *pPos, const Point &rPoint,
SwLayoutModeModifier aLayoutModeModifier( *GetInfo().GetOut() );
if ( ((SwMultiPortion*)pPor)->IsBidi() )
{
- const BYTE nBidiLevel = ((SwBidiPortion*)pPor)->GetLevel();
+ const sal_uInt8 nBidiLevel = ((SwBidiPortion*)pPor)->GetLevel();
aLayoutModeModifier.Modify( nBidiLevel % 2 );
}
@@ -1600,7 +1600,7 @@ xub_StrLen SwTxtCursor::GetCrsrOfst( SwPosition *pPos, const Point &rPoint,
if( ((SwMultiPortion*)pPor)->HasBrackets() )
{
- USHORT nPreWidth = ((SwDoubleLinePortion*)pPor)->PreWidth();
+ sal_uInt16 nPreWidth = ((SwDoubleLinePortion*)pPor)->PreWidth();
if ( nX > nPreWidth )
nX = nX - nPreWidth;
else
@@ -1612,7 +1612,7 @@ xub_StrLen SwTxtCursor::GetCrsrOfst( SwPosition *pPos, const Point &rPoint,
}
if( pPor->InTxtGrp() )
{
- BYTE nOldProp;
+ sal_uInt8 nOldProp;
if( GetPropFont() )
{
((SwFont*)GetFnt())->SetProportion( GetPropFont() );
@@ -1871,7 +1871,7 @@ bool SwTxtFrm::FillSelection( SwSelectionList& rSelList, const SwRect& rRect ) c
if( GetDrawObjs() )
{
const SwSortedObjs &rObjs = *GetDrawObjs();
- for ( USHORT i = 0; i < rObjs.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i )
{
const SwAnchoredObject* pAnchoredObj = rObjs[i];
if( !pAnchoredObj->ISA(SwFlyFrm) )
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index 8ce4f6523ba0..66251e83e618 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -282,7 +282,7 @@ SwLinePortion *SwTxtFormatter::UnderFlow( SwTxtFormatInfo &rInf )
// line width is adjusted, so that pPor does not fit to current
// line anymore
- rInf.Width( (USHORT)(rInf.X() + (pPor->Width() ? pPor->Width() - 1 : 0)) );
+ rInf.Width( (sal_uInt16)(rInf.X() + (pPor->Width() ? pPor->Width() - 1 : 0)) );
rInf.SetLen( pPor->GetLen() );
rInf.SetFull( sal_False );
if( pFly )
@@ -419,7 +419,7 @@ void SwTxtFormatter::BuildPortions( SwTxtFormatInfo &rInf )
GRID_LINES_CHARS == pGrid->GetGridType();
const SwDoc *pDoc = rInf.GetTxtFrm()->GetNode()->GetDoc();
- const USHORT nGridWidth = bHasGrid ?
+ const sal_uInt16 nGridWidth = bHasGrid ?
GETGRIDWIDTH(pGrid,pDoc) : 0; //for textgrid refactor
// used for grid mode only:
@@ -447,9 +447,9 @@ void SwTxtFormatter::BuildPortions( SwTxtFormatInfo &rInf )
rInf.GetLast() && rInf.GetLast()->InTxtGrp() &&
rInf.GetLast()->Width() && !rInf.GetLast()->InNumberGrp() )
{
- BYTE nNxtActual = rInf.GetFont()->GetActual();
- BYTE nLstActual = nNxtActual;
- USHORT nLstHeight = (USHORT)rInf.GetFont()->GetHeight();
+ sal_uInt8 nNxtActual = rInf.GetFont()->GetActual();
+ sal_uInt8 nLstActual = nNxtActual;
+ sal_uInt16 nLstHeight = (sal_uInt16)rInf.GetFont()->GetHeight();
sal_Bool bAllowBefore = sal_False;
sal_Bool bAllowBehind = sal_False;
const CharClass& rCC = GetAppCharClass();
@@ -487,7 +487,7 @@ void SwTxtFormatter::BuildPortions( SwTxtFormatInfo &rInf )
if ( pTmpFnt )
{
nLstActual = pTmpFnt->GetActual();
- nLstHeight = (USHORT)pTmpFnt->GetHeight();
+ nLstHeight = (sal_uInt16)pTmpFnt->GetHeight();
}
}
}
@@ -541,14 +541,14 @@ void SwTxtFormatter::BuildPortions( SwTxtFormatInfo &rInf )
const SwTwips nOfst = nStartX - nGridOrigin;
if ( nOfst )
{
- const ULONG i = ( nOfst > 0 ) ?
+ const sal_uLong i = ( nOfst > 0 ) ?
( ( nOfst - 1 ) / nGridWidth + 1 ) :
0;
const SwTwips nKernWidth = i * nGridWidth - nOfst;
const SwTwips nRestWidth = rInf.Width() - rInf.X();
if ( nKernWidth <= nRestWidth )
- pGridKernPortion->Width( (USHORT)nKernWidth );
+ pGridKernPortion->Width( (sal_uInt16)nKernWidth );
}
if ( pGridKernPortion != pPor )
@@ -631,7 +631,7 @@ void SwTxtFormatter::BuildPortions( SwTxtFormatInfo &rInf )
if( nTmp == pScriptInfo->NextScriptChg( nTmp - 1 ) &&
nTmp != rInf.GetTxt().Len() )
{
- USHORT nDist = (USHORT)(rInf.GetFont()->GetHeight()/5);
+ sal_uInt16 nDist = (sal_uInt16)(rInf.GetFont()->GetHeight()/5);
if( nDist )
{
@@ -657,8 +657,8 @@ void SwTxtFormatter::BuildPortions( SwTxtFormatInfo &rInf )
xub_StrLen nTmp = rInf.GetIdx() + pPor->GetLen();
const SwTwips nRestWidth = rInf.Width() - rInf.X() - pPor->Width();
- const BYTE nCurrScript = pFnt->GetActual(); // pScriptInfo->ScriptType( rInf.GetIdx() );
- const BYTE nNextScript = nTmp >= rInf.GetTxt().Len() ?
+ const sal_uInt8 nCurrScript = pFnt->GetActual(); // pScriptInfo->ScriptType( rInf.GetIdx() );
+ const sal_uInt8 nNextScript = nTmp >= rInf.GetTxt().Len() ?
SW_CJK :
SwScriptInfo::WhichFont( nTmp, 0, pScriptInfo );
@@ -673,20 +673,20 @@ void SwTxtFormatter::BuildPortions( SwTxtFormatInfo &rInf )
// calculate size
SwLinePortion* pTmpPor = pGridKernPortion->GetPortion();
- USHORT nSumWidth = pPor->Width();
+ sal_uInt16 nSumWidth = pPor->Width();
while ( pTmpPor )
{
nSumWidth = nSumWidth + pTmpPor->Width();
pTmpPor = pTmpPor->GetPortion();
}
- const USHORT i = nSumWidth ?
+ const sal_uInt16 i = nSumWidth ?
( nSumWidth - 1 ) / nGridWidth + 1 :
0;
const SwTwips nTmpWidth = i * nGridWidth;
const SwTwips nKernWidth = Min( (SwTwips)(nTmpWidth - nSumWidth),
nRestWidth );
- const USHORT nKernWidth_1 = (USHORT)(nKernWidth / 2);
+ const sal_uInt16 nKernWidth_1 = (sal_uInt16)(nKernWidth / 2);
ASSERT( nKernWidth <= nRestWidth,
"Not enough space left for adjusting non-asian text in grid mode" )
@@ -957,7 +957,7 @@ SwTxtPortion *SwTxtFormatter::NewTxtPortion( SwTxtFormatInfo &rInf )
KSHORT( pPor->GetAscent() ) ) / 8;
if ( !nExpect )
nExpect = 1;
- nExpect = (USHORT)(rInf.GetIdx() + ((rInf.Width() - rInf.X()) / nExpect));
+ nExpect = (sal_uInt16)(rInf.GetIdx() + ((rInf.Width() - rInf.X()) / nExpect));
if( nExpect > rInf.GetIdx() && nNextChg > nExpect )
nNextChg = Min( nExpect, rInf.GetTxt().Len() );
@@ -1350,7 +1350,7 @@ SwLinePortion *SwTxtFormatter::NewPortion( SwTxtFormatInfo &rInf )
POR_TABDECIMAL == pLastTabPortion->GetWhichPor() )
{
ASSERT( rInf.X() >= pLastTabPortion->Fix(), "Decimal tab stop position cannot be calculated" )
- const USHORT nWidthOfPortionsUpToDecimalPosition = (USHORT)(rInf.X() - pLastTabPortion->Fix() );
+ const sal_uInt16 nWidthOfPortionsUpToDecimalPosition = (sal_uInt16)(rInf.X() - pLastTabPortion->Fix() );
static_cast<SwTabDecimalPortion*>(pLastTabPortion)->SetWidthOfPortionsUpToDecimalPosition( nWidthOfPortionsUpToDecimalPosition );
rInf.SetTabDecimal( 0 );
}
@@ -1414,7 +1414,7 @@ SwLinePortion *SwTxtFormatter::NewPortion( SwTxtFormatInfo &rInf )
const SwAttrSet& rSet = pInfo->GetAnchorCharFmt((SwDoc&)*pDoc)->GetAttrSet();
const SfxPoolItem* pItem;
- USHORT nDir = 0;
+ sal_uInt16 nDir = 0;
if( SFX_ITEM_SET == rSet.GetItemState( RES_CHRATR_ROTATE,
sal_True, &pItem ))
nDir = ((SvxCharRotateItem*)pItem)->GetValue();
@@ -1434,7 +1434,7 @@ SwLinePortion *SwTxtFormatter::NewPortion( SwTxtFormatInfo &rInf )
if ( pNumFnt )
{
- USHORT nDir = pNumFnt->GetOrientation( rInf.GetTxtFrm()->IsVertical() );
+ sal_uInt16 nDir = pNumFnt->GetOrientation( rInf.GetTxtFrm()->IsVertical() );
if ( 0 != nDir )
{
delete pPor;
@@ -1524,7 +1524,7 @@ xub_StrLen SwTxtFormatter::FormatLine( const xub_StrLen nStartPos )
pFlyStart = new SvLongs;
SwLinePortion* pPor = pCurr->GetFirstPortion();
long nPOfst = 0;
- USHORT nCnt = 0;
+ sal_uInt16 nCnt = 0;
while ( pPor )
{
@@ -1696,12 +1696,12 @@ void SwTxtFormatter::CalcRealHeight( sal_Bool bNewLine )
GETGRID( pFrm->FindPageFrm() )
if ( pGrid && GetInfo().SnapToGrid() )
{
- const USHORT nGridWidth = pGrid->GetBaseHeight();
- const USHORT nRubyHeight = pGrid->GetRubyHeight();
+ const sal_uInt16 nGridWidth = pGrid->GetBaseHeight();
+ const sal_uInt16 nRubyHeight = pGrid->GetRubyHeight();
const sal_Bool bRubyTop = ! pGrid->GetRubyTextBelow();
nLineHeight = nGridWidth + nRubyHeight;
- USHORT nLineDist = nLineHeight;
+ sal_uInt16 nLineDist = nLineHeight;
while ( pCurr->Height() > nLineHeight )
nLineHeight = nLineHeight + nLineDist;
@@ -1720,13 +1720,13 @@ void SwTxtFormatter::CalcRealHeight( sal_Bool bNewLine )
if ( ! IsParaLine() && pSpace &&
SVX_INTER_LINE_SPACE_PROP == pSpace->GetInterLineSpaceRule() )
{
- ULONG nTmp = pSpace->GetPropLineSpace();
+ sal_uLong nTmp = pSpace->GetPropLineSpace();
if( nTmp < 100 )
nTmp = 100;
nTmp *= nLineHeight;
- nLineHeight = (USHORT)(nTmp / 100);
+ nLineHeight = (sal_uInt16)(nTmp / 100);
}
pCurr->SetRealHeight( nLineHeight );
@@ -1831,7 +1831,7 @@ void SwTxtFormatter::FeedInf( SwTxtFormatInfo &rInf ) const
rInf.SetIdx( nStart );
// Handle overflows:
- // --> FME 2004-11-25 #i34348# Changed type from USHORT to SwTwips
+ // --> FME 2004-11-25 #i34348# Changed type from sal_uInt16 to SwTwips
SwTwips nTmpLeft = Left();
SwTwips nTmpRight = Right();
SwTwips nTmpFirst = FirstLeft();
@@ -2079,9 +2079,9 @@ long SwTxtFormatter::CalcOptRepaint( xub_StrLen nOldLineEnd,
// if anything has changed, we carefully have to adjust the right
// repaint position
long nPOfst = 0;
- USHORT nCnt = 0;
- USHORT nX = 0;
- USHORT nIdx = GetInfo().GetLineStart();
+ sal_uInt16 nCnt = 0;
+ sal_uInt16 nX = 0;
+ sal_uInt16 nIdx = GetInfo().GetLineStart();
SwLinePortion* pPor = pCurr->GetFirstPortion();
while ( pPor )
@@ -2115,7 +2115,7 @@ bool lcl_BuildHiddenPortion( const SwTxtSizeInfo& rInf, xub_StrLen &rPos )
// Only if hidden text should not be shown:
// if ( rInf.GetVsh() && rInf.GetVsh()->GetWin() && rInf.GetOpt().IsShowHiddenChar() )
const bool bShowInDocView = rInf.GetVsh() && rInf.GetVsh()->GetWin() && rInf.GetOpt().IsShowHiddenChar();
- const bool bShowForPrinting = rInf.GetOpt().IsShowHiddenChar( TRUE ) && rInf.GetOpt().IsPrinting();
+ const bool bShowForPrinting = rInf.GetOpt().IsShowHiddenChar( sal_True ) && rInf.GetOpt().IsPrinting();
if (bShowInDocView || bShowForPrinting)
return false;
diff --git a/sw/source/core/text/itrform2.hxx b/sw/source/core/text/itrform2.hxx
index 0e3522883bc1..a082538ed4d3 100644
--- a/sw/source/core/text/itrform2.hxx
+++ b/sw/source/core/text/itrform2.hxx
@@ -57,7 +57,7 @@ class SwTxtFormatter : public SwTxtPainter
sal_Bool bChanges : 1; // Flag, fuer die Berechnung des Repaint-Rechtecks
sal_Bool bTruncLines : 1; // Flag, Repaint-Rechtecks ggf. erweitern
sal_Bool bUnclipped : 1; // Flag, ob Repaint groesser als feste Zeilenhoehe
- USHORT m_nHintEndIndex; // HACK for TryNewNoLengthPortion
+ sal_uInt16 m_nHintEndIndex; // HACK for TryNewNoLengthPortion
SwLinePortion *NewPortion( SwTxtFormatInfo &rInf );
SwTxtPortion *NewTxtPortion( SwTxtFormatInfo &rInf );
SwLinePortion *NewExtraPortion( SwTxtFormatInfo &rInf );
@@ -77,7 +77,7 @@ class SwTxtFormatter : public SwTxtPainter
// Das Herzstueck der Formatierung
void BuildPortions( SwTxtFormatInfo &rInf );
- BOOL BuildMultiPortion( SwTxtFormatInfo &rInf, SwMultiPortion& rMulti );
+ sal_Bool BuildMultiPortion( SwTxtFormatInfo &rInf, SwMultiPortion& rMulti );
// Berechnung des emulierten rechten Rands
void CalcFlyWidth( SwTxtFormatInfo &rInf );
diff --git a/sw/source/core/text/itrpaint.cxx b/sw/source/core/text/itrpaint.cxx
index 50dbe9fdc451..8c9405a9a483 100644
--- a/sw/source/core/text/itrpaint.cxx
+++ b/sw/source/core/text/itrpaint.cxx
@@ -173,8 +173,8 @@ void SwTxtPainter::DrawTextLine( const SwRect &rPaint, SwSaveClip &rClip,
const sal_Bool bUnderSz )
{
#if OSL_DEBUG_LEVEL > 1
-// USHORT nFntHeight = GetInfo().GetFont()->GetHeight( GetInfo().GetVsh(), GetInfo().GetOut() );
-// USHORT nFntAscent = GetInfo().GetFont()->GetAscent( GetInfo().GetVsh(), GetInfo().GetOut() );
+// sal_uInt16 nFntHeight = GetInfo().GetFont()->GetHeight( GetInfo().GetVsh(), GetInfo().GetOut() );
+// sal_uInt16 nFntAscent = GetInfo().GetFont()->GetAscent( GetInfo().GetVsh(), GetInfo().GetOut() );
#endif
// Adjustierung ggf. nachholen
@@ -618,11 +618,11 @@ void SwTxtPainter::CheckSpecialUnderline( const SwLinePortion* pPor,
rScriptInfo );
xub_StrLen nTmpIdx = nIndx;
- ULONG nSumWidth = 0;
- ULONG nSumHeight = 0;
- ULONG nBold = 0;
- USHORT nMaxBaseLineOfst = 0;
- USHORT nNumberOfPortions = 0;
+ sal_uLong nSumWidth = 0;
+ sal_uLong nSumHeight = 0;
+ sal_uLong nBold = 0;
+ sal_uInt16 nMaxBaseLineOfst = 0;
+ sal_uInt16 nNumberOfPortions = 0;
while( nTmpIdx <= nUnderEnd && pPor )
{
@@ -641,13 +641,13 @@ void SwTxtPainter::CheckSpecialUnderline( const SwLinePortion* pPor,
if ( !aIter.GetFnt()->GetEscapement() )
{
nSumWidth += pPor->Width();
- const ULONG nFontHeight = aIter.GetFnt()->GetHeight();
+ const sal_uLong nFontHeight = aIter.GetFnt()->GetHeight();
// If we do not have a common baseline we take the baseline
// and the font of the lowest portion.
if ( nAdjustBaseLine )
{
- USHORT nTmpBaseLineOfst = AdjustBaseLine( *pCurr, pPor );
+ sal_uInt16 nTmpBaseLineOfst = AdjustBaseLine( *pCurr, pPor );
if ( nMaxBaseLineOfst < nTmpBaseLineOfst )
{
nMaxBaseLineOfst = nTmpBaseLineOfst;
@@ -671,14 +671,14 @@ void SwTxtPainter::CheckSpecialUnderline( const SwLinePortion* pPor,
// resulting height
if ( nNumberOfPortions > 1 && nSumWidth )
{
- const ULONG nNewFontHeight = nAdjustBaseLine ?
+ const sal_uLong nNewFontHeight = nAdjustBaseLine ?
nSumHeight :
nSumHeight / nSumWidth;
pUnderlineFnt = new SwFont( *GetInfo().GetFont() );
// font height
- const BYTE nActual = pUnderlineFnt->GetActual();
+ const sal_uInt8 nActual = pUnderlineFnt->GetActual();
pUnderlineFnt->SetSize( Size( pUnderlineFnt->GetSize( nActual ).Width(),
nNewFontHeight ), nActual );
diff --git a/sw/source/core/text/itrtxt.cxx b/sw/source/core/text/itrtxt.cxx
index 9ea46606945a..798faee0d58d 100644
--- a/sw/source/core/text/itrtxt.cxx
+++ b/sw/source/core/text/itrtxt.cxx
@@ -303,9 +303,9 @@ const SwLineLayout *SwTxtCursor::CharCrsrToLine( const xub_StrLen nPosition )
* SwTxtCrsr::AdjustBaseLine()
*************************************************************************/
-USHORT SwTxtCursor::AdjustBaseLine( const SwLineLayout& rLine,
+sal_uInt16 SwTxtCursor::AdjustBaseLine( const SwLineLayout& rLine,
const SwLinePortion* pPor,
- USHORT nPorHeight, USHORT nPorAscent,
+ sal_uInt16 nPorHeight, sal_uInt16 nPorAscent,
const sal_Bool bAutoToCentered ) const
{
if ( pPor )
@@ -314,14 +314,14 @@ USHORT SwTxtCursor::AdjustBaseLine( const SwLineLayout& rLine,
nPorAscent = pPor->GetAscent();
}
- USHORT nOfst = rLine.GetRealHeight() - rLine.Height();
+ sal_uInt16 nOfst = rLine.GetRealHeight() - rLine.Height();
GETGRID( pFrm->FindPageFrm() )
const sal_Bool bHasGrid = pGrid && GetInfo().SnapToGrid();
if ( bHasGrid )
{
- const USHORT nRubyHeight = pGrid->GetRubyHeight();
+ const sal_uInt16 nRubyHeight = pGrid->GetRubyHeight();
const sal_Bool bRubyTop = ! pGrid->GetRubyTextBelow();
if ( GetInfo().IsMulti() )
@@ -341,8 +341,8 @@ USHORT SwTxtCursor::AdjustBaseLine( const SwLineLayout& rLine,
// centered inside the whole line.
//for text refactor
- const USHORT nLineNetto = rLine.Height() - nRubyHeight;
- //const USHORT nLineNetto = ( nPorHeight > nGridWidth ) ?
+ const sal_uInt16 nLineNetto = rLine.Height() - nRubyHeight;
+ //const sal_uInt16 nLineNetto = ( nPorHeight > nGridWidth ) ?
// rLine.Height() - nRubyHeight :
// nGridWidth;
nOfst += ( nLineNetto - nPorHeight ) / 2;
@@ -445,13 +445,13 @@ void SwTxtIter::TruncLines( sal_Bool bNoteFollow )
SwpHints* pTmpHints = GetTxtFrm()->GetTxtNode()->GetpSwpHints();
// examine hints in range nEnd - (nEnd + nRangeChar)
- for( USHORT i = 0; i < pTmpHints->Count(); i++ )
+ for( sal_uInt16 i = 0; i < pTmpHints->Count(); i++ )
{
const SwTxtAttr* pHt = pTmpHints->GetTextHint( i );
if( RES_TXTATR_FLYCNT == pHt->Which() )
{
// check, if hint is in our range
- const USHORT nTmpPos = *pHt->GetStart();
+ const sal_uInt16 nTmpPos = *pHt->GetStart();
if ( nEnd <= nTmpPos && nTmpPos < nRangeEnd )
pFollow->_InvalidateRange(
SwCharRange( nTmpPos, nTmpPos ), 0 );
diff --git a/sw/source/core/text/itrtxt.hxx b/sw/source/core/text/itrtxt.hxx
index 2ea324539f32..aa129aef9888 100644
--- a/sw/source/core/text/itrtxt.hxx
+++ b/sw/source/core/text/itrtxt.hxx
@@ -278,8 +278,8 @@ public:
// calculates baseline for portion rPor
// bAutoToCentered indicates, if AUTOMATIC mode means CENTERED or BASELINE
- USHORT AdjustBaseLine( const SwLineLayout& rLine, const SwLinePortion* pPor,
- USHORT nPorHeight = 0, USHORT nAscent = 0,
+ sal_uInt16 AdjustBaseLine( const SwLineLayout& rLine, const SwLinePortion* pPor,
+ sal_uInt16 nPorHeight = 0, sal_uInt16 nAscent = 0,
const sal_Bool bAutoToCentered = sal_False ) const;
static inline void SetRightMargin( const sal_Bool bNew ){ bRightMargin = bNew; }
diff --git a/sw/source/core/text/pordrop.hxx b/sw/source/core/text/pordrop.hxx
index c4cb9089381c..452a2b394d65 100644
--- a/sw/source/core/text/pordrop.hxx
+++ b/sw/source/core/text/pordrop.hxx
@@ -49,7 +49,7 @@ class SwDropPortionPart
SwDropPortionPart* pFollow;
SwFont* pFnt;
xub_StrLen nLen;
- USHORT nWidth;
+ sal_uInt16 nWidth;
public:
SwDropPortionPart( SwFont& rFont, const xub_StrLen nL )
@@ -60,8 +60,8 @@ public:
inline void SetFollow( SwDropPortionPart* pNew ) { pFollow = pNew; };
inline SwFont& GetFont() const { return *pFnt; }
inline xub_StrLen GetLen() const { return nLen; }
- inline USHORT GetWidth() const { return nWidth; }
- inline void SetWidth( USHORT nNew ) { nWidth = nNew; }
+ inline sal_uInt16 GetWidth() const { return nWidth; }
+ inline void SetWidth( sal_uInt16 nNew ) { nWidth = nNew; }
};
/*************************************************************************
diff --git a/sw/source/core/text/porexp.hxx b/sw/source/core/text/porexp.hxx
index 6cecd542c764..214c9f336eb3 100644
--- a/sw/source/core/text/porexp.hxx
+++ b/sw/source/core/text/porexp.hxx
@@ -58,14 +58,14 @@ public:
class SwBlankPortion : public SwExpandPortion
{
xub_Unicode cChar;
- BOOL bMulti; // For multiportion brackets
+ sal_Bool bMulti; // For multiportion brackets
public:
- inline SwBlankPortion( xub_Unicode cCh, BOOL bMult = sal_False )
+ inline SwBlankPortion( xub_Unicode cCh, sal_Bool bMult = sal_False )
: cChar( cCh ), bMulti( bMult )
{ cChar = cCh; SetLen(1); SetWhichPor( POR_BLANK ); }
- BOOL IsMulti() const { return bMulti; }
- void SetMulti( BOOL bNew ) { bMulti = bNew; }
+ sal_Bool IsMulti() const { return bMulti; }
+ void SetMulti( sal_Bool bNew ) { bMulti = bNew; }
virtual SwLinePortion *Compress();
virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const;
diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx
index 804303cf4050..366ede0c888e 100644
--- a/sw/source/core/text/porfld.cxx
+++ b/sw/source/core/text/porfld.cxx
@@ -212,8 +212,8 @@ void SwFldPortion::CheckScript( const SwTxtSizeInfo &rInf )
String aTxt;
if( GetExpTxt( rInf, aTxt ) && aTxt.Len() && pBreakIt->GetBreakIter().is() )
{
- BYTE nActual = pFnt ? pFnt->GetActual() : rInf.GetFont()->GetActual();
- USHORT nScript;
+ sal_uInt8 nActual = pFnt ? pFnt->GetActual() : rInf.GetFont()->GetActual();
+ sal_uInt16 nScript;
{
nScript = pBreakIt->GetBreakIter()->getScriptType( aTxt, 0 );
xub_StrLen nChg = 0;
@@ -233,7 +233,7 @@ void SwFldPortion::CheckScript( const SwTxtSizeInfo &rInf )
nNextScriptChg = aTxt.Len();
}
- BYTE nTmp;
+ sal_uInt8 nTmp;
switch ( nScript ) {
case i18n::ScriptType::LATIN : nTmp = SW_LATIN; break;
case i18n::ScriptType::ASIAN : nTmp = SW_CJK; break;
@@ -244,8 +244,8 @@ void SwFldPortion::CheckScript( const SwTxtSizeInfo &rInf )
// #i16354# Change script type for RTL text to CTL.
const SwScriptInfo& rSI = rInf.GetParaPortion()->GetScriptInfo();
// --> OD 2009-01-29 #i98418#
-// const BYTE nFldDir = IsNumberPortion() ?
- const BYTE nFldDir = ( IsNumberPortion() || IsFtnNumPortion() ) ?
+// const sal_uInt8 nFldDir = IsNumberPortion() ?
+ const sal_uInt8 nFldDir = ( IsNumberPortion() || IsFtnNumPortion() ) ?
rSI.GetDefaultDir() :
rSI.DirType( IsFollow() ? rInf.GetIdx() - 1 : rInf.GetIdx() );
// <--
@@ -690,8 +690,8 @@ void SwNumberPortion::Paint( const SwTxtPaintInfo &rInf ) const
// calculate the width of the number portion, including follows
const KSHORT nOldWidth = Width();
- USHORT nSumWidth = 0;
- USHORT nOffset = 0;
+ sal_uInt16 nSumWidth = 0;
+ sal_uInt16 nOffset = 0;
const SwLinePortion* pTmp = this;
while ( pTmp && pTmp->InNumberGrp() )
@@ -854,7 +854,7 @@ SwGrfNumPortion::SwGrfNumPortion(
nYPos = 0;
eOrient = text::VertOrientation::TOP;
}
- Width( static_cast<USHORT>(rGrfSize.Width() + 2 * GRFNUM_SECURE) );
+ Width( static_cast<sal_uInt16>(rGrfSize.Width() + 2 * GRFNUM_SECURE) );
nFixWidth = Width();
nGrfHeight = rGrfSize.Height() + 2 * GRFNUM_SECURE;
Height( KSHORT(nGrfHeight) );
@@ -891,7 +891,7 @@ sal_Bool SwGrfNumPortion::Format( SwTxtFormatInfo &rInf )
const sal_Bool bFull = rInf.Width() < rInf.X() + Width();
const sal_Bool bFly = rInf.GetFly() ||
( rInf.GetLast() && rInf.GetLast()->IsFlyPortion() );
- SetAscent( static_cast<USHORT>(GetRelPos() > 0 ? GetRelPos() : 0) );
+ SetAscent( static_cast<sal_uInt16>(GetRelPos() > 0 ? GetRelPos() : 0) );
if( GetAscent() > Height() )
Height( GetAscent() );
@@ -1129,10 +1129,10 @@ SwCombinedPortion::SwCombinedPortion( const XubString &rTxt )
// the arrays of width and position are filled by the format function
if( pBreakIt->GetBreakIter().is() )
{
- BYTE nScr = SW_SCRIPTS;
- for( USHORT i = 0; i < rTxt.Len(); ++i )
+ sal_uInt8 nScr = SW_SCRIPTS;
+ for( sal_uInt16 i = 0; i < rTxt.Len(); ++i )
{
- USHORT nScript = pBreakIt->GetBreakIter()->getScriptType( rTxt, i );
+ sal_uInt16 nScript = pBreakIt->GetBreakIter()->getScriptType( rTxt, i );
switch ( nScript ) {
case i18n::ScriptType::LATIN : nScr = SW_LATIN; break;
case i18n::ScriptType::ASIAN : nScr = SW_CJK; break;
@@ -1143,7 +1143,7 @@ SwCombinedPortion::SwCombinedPortion( const XubString &rTxt )
}
else
{
- for( USHORT i = 0; i < 6; aScrType[i++] = 0 )
+ for( sal_uInt16 i = 0; i < 6; aScrType[i++] = 0 )
; // nothing
}
memset( &aWidth, 0, sizeof(aWidth) );
@@ -1165,19 +1165,19 @@ void SwCombinedPortion::Paint( const SwTxtPaintInfo &rInf ) const
if( rInf.OnWin() && pPortion && !pPortion->Width() )
pPortion->PrePaint( rInf, this );
- USHORT nCount = aExpand.Len();
+ sal_uInt16 nCount = aExpand.Len();
if( !nCount )
return;
ASSERT( nCount < 7, "Too much combined characters" );
// the first character of the second row
- USHORT nTop = ( nCount + 1 ) / 2;
+ sal_uInt16 nTop = ( nCount + 1 ) / 2;
SwFont aTmpFont( *rInf.GetFont() );
aTmpFont.SetProportion( nProportion ); // a smaller font
SwFontSave aFontSave( rInf, &aTmpFont );
- USHORT i = 0;
+ sal_uInt16 i = 0;
Point aOldPos = rInf.GetPos();
Point aOutPos( aOldPos.X(), aOldPos.Y() - nUpPos );// Y of the first row
while( i < nCount )
@@ -1185,7 +1185,7 @@ void SwCombinedPortion::Paint( const SwTxtPaintInfo &rInf ) const
if( i == nTop ) // change the row
aOutPos.Y() = aOldPos.Y() + nLowPos; // Y of the second row
aOutPos.X() = aOldPos.X() + aPos[i]; // X position
- const BYTE nAct = aScrType[i]; // script type
+ const sal_uInt8 nAct = aScrType[i]; // script type
aTmpFont.SetActual( nAct );
// if there're more than 4 characters to display, we choose fonts
// with 2/3 of the original font width.
@@ -1213,7 +1213,7 @@ void SwCombinedPortion::Paint( const SwTxtPaintInfo &rInf ) const
sal_Bool SwCombinedPortion::Format( SwTxtFormatInfo &rInf )
{
- USHORT nCount = aExpand.Len();
+ sal_uInt16 nCount = aExpand.Len();
if( !nCount )
{
Width( 0 );
@@ -1223,7 +1223,7 @@ sal_Bool SwCombinedPortion::Format( SwTxtFormatInfo &rInf )
ASSERT( nCount < 7, "Too much combined characters" );
// If there are leading "weak"-scripttyped characters in this portion,
// they get the actual scripttype.
- USHORT i = 0;
+ sal_uInt16 i = 0;
while( i < nCount && SW_SCRIPTS == aScrType[i] )
aScrType[i++] = rInf.GetFont()->GetActual();
if( nCount > 4 )
@@ -1237,22 +1237,27 @@ sal_Bool SwCombinedPortion::Format( SwTxtFormatInfo &rInf )
{
rInf.GetOut()->SetFont( rInf.GetFont()->GetFnt( aScrType[i] ) );
aWidth[ aScrType[i] ] =
- static_cast<USHORT>(2 * rInf.GetOut()->GetFontMetric().GetSize().Width() / 3);
+ static_cast<sal_uInt16>(2 * rInf.GetOut()->GetFontMetric().GetSize().Width() / 3);
}
++i;
}
}
+<<<<<<< local
USHORT nTop = ( nCount + 1 ) / 2; // the first character of the second line
ViewShell *pSh = rInf.GetTxtFrm()->getRootFrm()->GetCurrShell();
+=======
+ sal_uInt16 nTop = ( nCount + 1 ) / 2; // the first character of the second line
+ ViewShell *pSh = rInf.GetTxtFrm()->GetShell();
+>>>>>>> other
SwFont aTmpFont( *rInf.GetFont() );
SwFontSave aFontSave( rInf, &aTmpFont );
nProportion = 55;
// In nMainAscent/Descent we store the ascent and descent
// of the original surrounding font
- USHORT nMaxDescent, nMaxAscent, nMaxWidth;
- USHORT nMainDescent = rInf.GetFont()->GetHeight( pSh, *rInf.GetOut() );
- const USHORT nMainAscent = rInf.GetFont()->GetAscent( pSh, *rInf.GetOut() );
+ sal_uInt16 nMaxDescent, nMaxAscent, nMaxWidth;
+ sal_uInt16 nMainDescent = rInf.GetFont()->GetHeight( pSh, *rInf.GetOut() );
+ const sal_uInt16 nMainAscent = rInf.GetFont()->GetAscent( pSh, *rInf.GetOut() );
nMainDescent = nMainDescent - nMainAscent;
// we start with a 50% font, but if we notice that the combined portion
// becomes bigger than the surrounding font, we check 45% and maybe 40%.
@@ -1274,7 +1279,7 @@ sal_Bool SwCombinedPortion::Format( SwTxtFormatInfo &rInf )
// local nMaxAscent, nMaxDescent and nMaxWidth variables.
while( i < nCount )
{
- BYTE nScrp = aScrType[i];
+ sal_uInt8 nScrp = aScrType[i];
aTmpFont.SetActual( nScrp );
if( aWidth[ nScrp ] )
{
@@ -1285,8 +1290,8 @@ sal_Bool SwCombinedPortion::Format( SwTxtFormatInfo &rInf )
SwDrawTextInfo aDrawInf( pSh, *rInf.GetOut(), 0, aExpand, i, 1 );
Size aSize = aTmpFont._GetTxtSize( aDrawInf );
- USHORT nAsc = aTmpFont.GetAscent( pSh, *rInf.GetOut() );
- aPos[ i ] = (USHORT)aSize.Width();
+ sal_uInt16 nAsc = aTmpFont.GetAscent( pSh, *rInf.GetOut() );
+ aPos[ i ] = (sal_uInt16)aSize.Width();
if( i == nTop ) // enter the second line
{
nLowPos = nMaxDescent;
@@ -1301,7 +1306,7 @@ sal_Bool SwCombinedPortion::Format( SwTxtFormatInfo &rInf )
if( nAsc > nMaxAscent )
nMaxAscent = nAsc;
if( aSize.Height() - nAsc > nMaxDescent )
- nMaxDescent = static_cast<USHORT>(aSize.Height() - nAsc);
+ nMaxDescent = static_cast<sal_uInt16>(aSize.Height() - nAsc);
}
// for one or two characters we double the width of the portion
if( nCount < 3 )
@@ -1330,8 +1335,8 @@ sal_Bool SwCombinedPortion::Format( SwTxtFormatInfo &rInf )
Height( nMainAscent + nMainDescent );
// We calculate the x positions of the characters in both lines..
- USHORT nTopDiff = 0;
- USHORT nBotDiff = 0;
+ sal_uInt16 nTopDiff = 0;
+ sal_uInt16 nBotDiff = 0;
if( nMaxWidth > Width() )
{
nTopDiff = ( nMaxWidth - Width() ) / 2;
@@ -1360,7 +1365,7 @@ sal_Bool SwCombinedPortion::Format( SwTxtFormatInfo &rInf )
{
if( rInf.GetLineStart() == rInf.GetIdx() && (!rInf.GetLast()->InFldGrp()
|| !((SwFldPortion*)rInf.GetLast())->IsFollow() ) )
- Width( (USHORT)( rInf.Width() - rInf.X() ) );
+ Width( (sal_uInt16)( rInf.Width() - rInf.X() ) );
else
{
Truncate();
diff --git a/sw/source/core/text/porfld.hxx b/sw/source/core/text/porfld.hxx
index ad71ce0c6a47..aa0cb4f1be14 100644
--- a/sw/source/core/text/porfld.hxx
+++ b/sw/source/core/text/porfld.hxx
@@ -249,12 +249,12 @@ public:
class SwCombinedPortion : public SwFldPortion
{
- USHORT aPos[6]; // up to six X positions
- USHORT aWidth[3]; // one width for every scripttype
- BYTE aScrType[6]; // scripttype of every character
- USHORT nUpPos; // the Y position of the upper baseline
- USHORT nLowPos; // the Y position of the lower baseline
- BYTE nProportion; // relative font height
+ sal_uInt16 aPos[6]; // up to six X positions
+ sal_uInt16 aWidth[3]; // one width for every scripttype
+ sal_uInt8 aScrType[6]; // scripttype of every character
+ sal_uInt16 nUpPos; // the Y position of the upper baseline
+ sal_uInt16 nLowPos; // the Y position of the lower baseline
+ sal_uInt8 nProportion; // relative font height
public:
SwCombinedPortion( const XubString &rExpand );
virtual void Paint( const SwTxtPaintInfo &rInf ) const;
diff --git a/sw/source/core/text/porfly.cxx b/sw/source/core/text/porfly.cxx
index cc4f060d5f86..d2792e3bad68 100644
--- a/sw/source/core/text/porfly.cxx
+++ b/sw/source/core/text/porfly.cxx
@@ -76,7 +76,7 @@ sal_Bool SwFlyPortion::Format( SwTxtFormatInfo &rInf )
// Der Glue wird aufgespannt.
rInf.GetLast()->FormatEOL( rInf );
- PrtWidth( static_cast<USHORT>(Fix() - rInf.X() + PrtWidth()) );
+ PrtWidth( static_cast<sal_uInt16>(Fix() - rInf.X() + PrtWidth()) );
if( !Width() )
{
ASSERT( Width(), "+SwFlyPortion::Format: a fly is a fly is a fly" );
@@ -99,7 +99,7 @@ sal_Bool SwFlyPortion::Format( SwTxtFormatInfo &rInf )
SetLen( 1 );
}
- const USHORT nNewWidth = static_cast<USHORT>(rInf.X() + PrtWidth());
+ const sal_uInt16 nNewWidth = static_cast<sal_uInt16>(rInf.X() + PrtWidth());
if( rInf.Width() <= nNewWidth )
{
Truncate();
@@ -129,7 +129,7 @@ sal_Bool SwFlyCntPortion::Format( SwTxtFormatInfo &rInf )
// KerningPortions at beginning of line, e.g., for grid layout
// must be considered.
const SwLinePortion* pLastPor = rInf.GetLast();
- const USHORT nLeft = ( pLastPor &&
+ const sal_uInt16 nLeft = ( pLastPor &&
( pLastPor->IsKernPortion() ||
pLastPor->IsErgoSumPortion() ) ) ?
pLastPor->Width() :
@@ -209,7 +209,7 @@ xub_StrLen SwTxtFrm::CalcFlyPos( SwFrmFmt* pSearch )
if( !pHints )
return STRING_LEN;
SwTxtAttr* pFound = NULL;
- for ( USHORT i = 0; i < pHints->Count(); i++)
+ for ( sal_uInt16 i = 0; i < pHints->Count(); i++)
{
SwTxtAttr *pHt = pHints->GetTextHint( i );
if( RES_TXTATR_FLYCNT == pHt->Which() )
@@ -408,14 +408,14 @@ void SwFlyCntPortion::SetBase( const SwTxtFrm& rFrm, const Point &rBase,
SwTwips nRelPos = aObjPositioning.GetRelPosY();
if ( nRelPos < 0 )
{
- nAscent = static_cast<USHORT>(-nRelPos);
+ nAscent = static_cast<sal_uInt16>(-nRelPos);
if( nAscent > Height() )
Height( nAscent );
}
else
{
nAscent = 0;
- Height( Height() + static_cast<USHORT>(nRelPos) );
+ Height( Height() + static_cast<sal_uInt16>(nRelPos) );
}
}
else
diff --git a/sw/source/core/text/porftn.hxx b/sw/source/core/text/porftn.hxx
index 5590b6f972d3..fef27b065278 100644
--- a/sw/source/core/text/porftn.hxx
+++ b/sw/source/core/text/porftn.hxx
@@ -43,7 +43,7 @@ class SwFtnPortion : public SwFldPortion
KSHORT nOrigHeight;
// --> OD 2009-01-29 #i98418#
bool mbPreferredScriptTypeSet;
- BYTE mnPreferredScriptType;
+ sal_uInt8 mnPreferredScriptType;
// <--
public:
SwFtnPortion( const XubString &rExpand, SwTxtFrm *pFrm, SwTxtFtn *pFtn,
@@ -56,7 +56,7 @@ public:
virtual sal_Bool Format( SwTxtFormatInfo &rInf );
// --> OD 2009-01-29 #i98418#
- void SetPreferredScriptType( BYTE nPreferredScriptType );
+ void SetPreferredScriptType( sal_uInt8 nPreferredScriptType );
// <--
const SwTxtFtn* GetTxtFtn() const { return pFtn; };
diff --git a/sw/source/core/text/porglue.cxx b/sw/source/core/text/porglue.cxx
index 983f5aded904..28207fb8b936 100644
--- a/sw/source/core/text/porglue.cxx
+++ b/sw/source/core/text/porglue.cxx
@@ -215,7 +215,7 @@ SwMarginPortion::SwMarginPortion( const KSHORT nFixedWidth )
void SwMarginPortion::AdjustRight( const SwLineLayout *pCurr )
{
SwGluePortion *pRight = 0;
- BOOL bNoMove = 0 != pCurr->GetpKanaComp();
+ sal_Bool bNoMove = 0 != pCurr->GetpKanaComp();
while( pRight != this )
{
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index ce7a184dd9ff..5ba32f89d0b0 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -641,8 +641,8 @@ void SwLineLayout::CalcLine( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf )
// --> FME 2006-03-01 #i3952#
if ( bHasBlankPortion && bHasOnlyBlankPortions )
{
- USHORT nTmpAscent = GetAscent();
- USHORT nTmpHeight = Height();
+ sal_uInt16 nTmpAscent = GetAscent();
+ sal_uInt16 nTmpHeight = Height();
rLine.GetAttrHandler().GetDefaultAscentAndHeight( rInf.GetVsh(), *rInf.GetOut(), nTmpAscent, nTmpHeight );
SetAscent( nTmpAscent );
Height( nTmpHeight );
@@ -755,10 +755,10 @@ SwScriptInfo::~SwScriptInfo()
* Converts i18n Script Type (LATIN, ASIAN, COMPLEX, WEAK) to
* Sw Script Types (SW_LATIN, SW_CJK, SW_CTL), used to identify the font
*************************************************************************/
-BYTE SwScriptInfo::WhichFont( xub_StrLen nIdx, const String* pTxt, const SwScriptInfo* pSI )
+sal_uInt8 SwScriptInfo::WhichFont( xub_StrLen nIdx, const String* pTxt, const SwScriptInfo* pSI )
{
ASSERT( pTxt || pSI,"How should I determine the script type?" );
- USHORT nScript;
+ sal_uInt16 nScript;
// First we try to use our SwScriptInfo
if ( pSI )
@@ -803,7 +803,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
CalcHiddenRanges( rNode, aHiddenMulti );
aHiddenChg.clear();
- USHORT i = 0;
+ sal_uInt16 i = 0;
for( i = 0; i < aHiddenMulti.GetRangeCount(); ++i )
{
const Range& rRange = aHiddenMulti.GetRange( i );
@@ -824,16 +824,16 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
nInvalidityPos = STRING_LEN;
// this is the default direction
- nDefaultDir = static_cast<BYTE>(bRTL ? UBIDI_RTL : UBIDI_LTR);
+ nDefaultDir = static_cast<sal_uInt8>(bRTL ? UBIDI_RTL : UBIDI_LTR);
// counter for script info arrays
- USHORT nCnt = 0;
+ sal_uInt16 nCnt = 0;
// counter for compression information arrays
- USHORT nCntComp = 0;
+ sal_uInt16 nCntComp = 0;
// counter for kashida array
- USHORT nCntKash = 0;
+ sal_uInt16 nCntKash = 0;
- BYTE nScript = i18n::ScriptType::LATIN;
+ sal_uInt8 nScript = i18n::ScriptType::LATIN;
// compression type
const SwCharCompressType aCompEnum = rNode.getIDocumentSettingAccess()->getCharacterCompressionType();
@@ -904,7 +904,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
// If we are at the start of a group, we do not trust nScript,
// we better get nScript from the breakiterator:
if ( nChg == nGrpStart )
- nScript = (BYTE)pBreakIt->GetBreakIter()->getScriptType( rTxt, nChg );
+ nScript = (sal_uInt8)pBreakIt->GetBreakIter()->getScriptType( rTxt, nChg );
//
// INVALID DATA FROM THE SCRIPT INFO ARRAYS HAS TO BE DELETED:
@@ -916,7 +916,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
aScriptType.erase( aScriptType.begin() + nCnt, aScriptType.begin() + (nCnt + nScriptRemove) );
// get the start of the last compression group
- USHORT nLastCompression = nChg;
+ sal_uInt16 nLastCompression = nChg;
if( nCntComp )
{
--nCntComp;
@@ -935,7 +935,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
aCompType.erase( aCompType.begin() + nCntComp, aCompType.end() );
// get the start of the last kashida group
- USHORT nLastKashida = nChg;
+ sal_uInt16 nLastKashida = nChg;
if( nCntKash && i18n::ScriptType::COMPLEX == nScript )
{
--nCntKash;
@@ -962,7 +962,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
if( nEnd > rTxt.Len() )
nEnd = rTxt.Len();
- nScript = (BYTE)GetI18NScriptTypeOfLanguage( (USHORT)GetAppLanguage() );
+ nScript = (sal_uInt8)GetI18NScriptTypeOfLanguage( (sal_uInt16)GetAppLanguage() );
ASSERT( i18n::ScriptType::LATIN == nScript ||
i18n::ScriptType::ASIAN == nScript ||
@@ -971,9 +971,9 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
nChg = nEnd;
// Get next script type or set to weak in order to exit
- BYTE nNextScript = ( nEnd < rTxt.Len() ) ?
- (BYTE)pBreakIt->GetBreakIter()->getScriptType( rTxt, nEnd ) :
- (BYTE)WEAK;
+ sal_uInt8 nNextScript = ( nEnd < rTxt.Len() ) ?
+ (sal_uInt8)pBreakIt->GetBreakIter()->getScriptType( rTxt, nEnd ) :
+ (sal_uInt8)WEAK;
if ( nScript != nNextScript )
{
@@ -1048,9 +1048,9 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
if ( CHARCOMPRESS_NONE != aCompEnum &&
i18n::ScriptType::ASIAN == nScript )
{
- BYTE ePrevState = NONE;
- BYTE eState;
- USHORT nPrevChg = nLastCompression;
+ sal_uInt8 ePrevState = NONE;
+ sal_uInt8 eState;
+ sal_uInt16 nPrevChg = nLastCompression;
while ( nLastCompression < nChg )
{
@@ -1073,7 +1073,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
eState = SPECIAL_RIGHT;
break;
default:
- eState = static_cast<BYTE>( ( 0x3040 <= cChar && 0x3100 > cChar ) ? KANA : NONE );
+ eState = static_cast<sal_uInt8>( ( 0x3040 <= cChar && 0x3100 > cChar ) ? KANA : NONE );
}
// insert range of compressable characters
@@ -1086,7 +1086,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
ePrevState != KANA )
{
aCompChg.insert( aCompChg.begin() + nCntComp, nPrevChg );
- BYTE nTmpType = ePrevState;
+ sal_uInt8 nTmpType = ePrevState;
aCompType.insert( aCompType.begin() + nCntComp, nTmpType );
aCompLen.insert( aCompLen.begin() + nCntComp, nLastCompression - nPrevChg );
nCntComp++;
@@ -1108,7 +1108,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
ePrevState != KANA )
{
aCompChg.insert( aCompChg.begin() + nCntComp, nPrevChg );
- BYTE nTmpType = ePrevState;
+ sal_uInt8 nTmpType = ePrevState;
aCompType.insert( aCompType.begin() + nCntComp, nTmpType );
aCompLen.insert( aCompLen.begin() + nCntComp, nLastCompression - nPrevChg );
nCntComp++;
@@ -1133,7 +1133,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
xub_Unicode cCh;
xub_Unicode cPrevCh = 0;
- USHORT nPriorityLevel = 7; // 0..6 = level found
+ sal_uInt16 nPriorityLevel = 7; // 0..6 = level found
// 7 not found
xub_StrLen nWordLen = rWord.Len();
@@ -1285,7 +1285,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
}
if ( nChg < rTxt.Len() )
- nScript = (BYTE)pBreakIt->GetBreakIter()->getScriptType( rTxt, nChg );
+ nScript = (sal_uInt8)pBreakIt->GetBreakIter()->getScriptType( rTxt, nChg );
nLastCompression = nChg;
nLastKashida = nChg;
@@ -1332,7 +1332,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
// 2. Text in embedded LTR runs that does not have any strong LTR characters (numbers!)
for ( size_t nDirIdx = 0; nDirIdx < aDirChg.size(); ++nDirIdx )
{
- const BYTE nCurrDirType = GetDirType( nDirIdx );
+ const sal_uInt8 nCurrDirType = GetDirType( nDirIdx );
// nStart ist start of RTL run:
const xub_StrLen nStart = nDirIdx > 0 ? GetDirChg( nDirIdx - 1 ) : 0;
// nEnd is end of RTL run:
@@ -1352,7 +1352,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
++nScriptIdx;
const xub_StrLen nStartPosOfGroup = nScriptIdx ? GetScriptChg( nScriptIdx - 1 ) : 0;
- const BYTE nScriptTypeOfGroup = GetScriptType( nScriptIdx );
+ const sal_uInt8 nScriptTypeOfGroup = GetScriptType( nScriptIdx );
ASSERT( nStartPosOfGroup <= nStart && GetScriptChg( nScriptIdx ) > nStart,
"Script override with CTL font trouble" )
@@ -1379,8 +1379,8 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
aScriptType.insert( aScriptType.begin() + nScriptIdx, i18n::ScriptType::COMPLEX );
#if OSL_DEBUG_LEVEL > 1
- BYTE nScriptType;
- BYTE nLastScriptType = i18n::ScriptType::WEAK;
+ sal_uInt8 nScriptType;
+ sal_uInt8 nLastScriptType = i18n::ScriptType::WEAK;
xub_StrLen nScriptChg;
xub_StrLen nLastScriptChg = 0;
(void) nLastScriptChg;
@@ -1422,11 +1422,11 @@ void SwScriptInfo::UpdateBidiInfo( const String& rTxt )
UBiDiLevel nCurrDir;
// counter for direction information arrays
- for ( USHORT nIdx = 0; nIdx < nCount; ++nIdx )
+ for ( sal_uInt16 nIdx = 0; nIdx < nCount; ++nIdx )
{
ubidi_getLogicalRun( pBidi, nStart, &nEnd, &nCurrDir );
- aDirChg.push_back( (USHORT)nEnd );
- aDirType.push_back( (BYTE)nCurrDir );
+ aDirChg.push_back( (sal_uInt16)nEnd );
+ aDirType.push_back( (sal_uInt8)nCurrDir );
nStart = nEnd;
}
@@ -1447,8 +1447,8 @@ void SwScriptInfo::UpdateBidiInfo( const String& rTxt )
xub_StrLen SwScriptInfo::NextScriptChg( const xub_StrLen nPos ) const
{
- USHORT nEnd = CountScriptChg();
- for( USHORT nX = 0; nX < nEnd; ++nX )
+ sal_uInt16 nEnd = CountScriptChg();
+ for( sal_uInt16 nX = 0; nX < nEnd; ++nX )
{
if( nPos < GetScriptChg( nX ) )
return GetScriptChg( nX );
@@ -1462,25 +1462,25 @@ xub_StrLen SwScriptInfo::NextScriptChg( const xub_StrLen nPos ) const
* returns the script of the character at the input position
*************************************************************************/
-BYTE SwScriptInfo::ScriptType( const xub_StrLen nPos ) const
+sal_uInt8 SwScriptInfo::ScriptType( const xub_StrLen nPos ) const
{
- USHORT nEnd = CountScriptChg();
- for( USHORT nX = 0; nX < nEnd; ++nX )
+ sal_uInt16 nEnd = CountScriptChg();
+ for( sal_uInt16 nX = 0; nX < nEnd; ++nX )
{
if( nPos < GetScriptChg( nX ) )
return GetScriptType( nX );
}
// the default is the application language script
- return (BYTE)GetI18NScriptTypeOfLanguage( (USHORT)GetAppLanguage() );
+ return (sal_uInt8)GetI18NScriptTypeOfLanguage( (sal_uInt16)GetAppLanguage() );
}
xub_StrLen SwScriptInfo::NextDirChg( const xub_StrLen nPos,
- const BYTE* pLevel ) const
+ const sal_uInt8* pLevel ) const
{
- BYTE nCurrDir = pLevel ? *pLevel : 62;
- USHORT nEnd = CountDirChg();
- for( USHORT nX = 0; nX < nEnd; ++nX )
+ sal_uInt8 nCurrDir = pLevel ? *pLevel : 62;
+ sal_uInt16 nEnd = CountDirChg();
+ for( sal_uInt16 nX = 0; nX < nEnd; ++nX )
{
if( nPos < GetDirChg( nX ) &&
( nX + 1 == nEnd || GetDirType( nX + 1 ) <= nCurrDir ) )
@@ -1490,10 +1490,10 @@ xub_StrLen SwScriptInfo::NextDirChg( const xub_StrLen nPos,
return STRING_LEN;
}
-BYTE SwScriptInfo::DirType( const xub_StrLen nPos ) const
+sal_uInt8 SwScriptInfo::DirType( const xub_StrLen nPos ) const
{
- USHORT nEnd = CountDirChg();
- for( USHORT nX = 0; nX < nEnd; ++nX )
+ sal_uInt16 nEnd = CountDirChg();
+ for( sal_uInt16 nX = 0; nX < nEnd; ++nX )
{
if( nPos < GetDirChg( nX ) )
return GetDirType( nX );
@@ -1507,7 +1507,7 @@ BYTE SwScriptInfo::DirType( const xub_StrLen nPos ) const
* Takes a string and replaced the hidden ranges with cChar.
**************************************************************************/
-USHORT SwScriptInfo::MaskHiddenRanges( const SwTxtNode& rNode, XubString& rText,
+sal_uInt16 SwScriptInfo::MaskHiddenRanges( const SwTxtNode& rNode, XubString& rText,
const xub_StrLen nStt, const xub_StrLen nEnd,
const xub_Unicode cChar )
{
@@ -1516,7 +1516,7 @@ USHORT SwScriptInfo::MaskHiddenRanges( const SwTxtNode& rNode, XubString& rText,
PositionList aList;
xub_StrLen nHiddenStart;
xub_StrLen nHiddenEnd;
- USHORT nNumOfHiddenChars = 0;
+ sal_uInt16 nNumOfHiddenChars = 0;
GetBoundsOfHiddenRange( rNode, 0, nHiddenStart, nHiddenEnd, &aList );
PositionList::const_reverse_iterator rFirst( aList.end() );
PositionList::const_reverse_iterator rLast( aList.begin() );
@@ -1621,7 +1621,7 @@ bool SwScriptInfo::GetBoundsOfHiddenRange( const SwTxtNode& rNode, xub_StrLen nP
Range aRange( 0, rNode.GetTxt().Len() ? rNode.GetTxt().Len() - 1 : 0 );
MultiSelection aHiddenMulti( aRange );
SwScriptInfo::CalcHiddenRanges( rNode, aHiddenMulti );
- for( USHORT i = 0; i < aHiddenMulti.GetRangeCount(); ++i )
+ for( sal_uInt16 i = 0; i < aHiddenMulti.GetRangeCount(); ++i )
{
const Range& rRange = aHiddenMulti.GetRange( i );
const xub_StrLen nHiddenStart = (xub_StrLen)rRange.Min();
@@ -1639,7 +1639,7 @@ bool SwScriptInfo::GetBoundsOfHiddenRange( const SwTxtNode& rNode, xub_StrLen nP
if ( pList )
{
- for( USHORT i = 0; i < aHiddenMulti.GetRangeCount(); ++i )
+ for( sal_uInt16 i = 0; i < aHiddenMulti.GetRangeCount(); ++i )
{
const Range& rRange = aHiddenMulti.GetRange( i );
pList->push_back( (xub_StrLen)rRange.Min() );
@@ -1664,8 +1664,8 @@ bool SwScriptInfo::GetBoundsOfHiddenRange( xub_StrLen nPos, xub_StrLen& rnStartP
rnStartPos = STRING_LEN;
rnEndPos = 0;
- USHORT nEnd = CountHiddenChg();
- for( USHORT nX = 0; nX < nEnd; ++nX )
+ sal_uInt16 nEnd = CountHiddenChg();
+ for( sal_uInt16 nX = 0; nX < nEnd; ++nX )
{
const xub_StrLen nHiddenStart = GetHiddenChg( nX++ );
const xub_StrLen nHiddenEnd = GetHiddenChg( nX );
@@ -1682,7 +1682,7 @@ bool SwScriptInfo::GetBoundsOfHiddenRange( xub_StrLen nPos, xub_StrLen& rnStartP
if ( pList )
{
- for( USHORT nX = 0; nX < nEnd; ++nX )
+ for( sal_uInt16 nX = 0; nX < nEnd; ++nX )
{
pList->push_back( GetHiddenChg( nX++ ) );
pList->push_back( GetHiddenChg( nX ) );
@@ -1711,10 +1711,10 @@ bool SwScriptInfo::IsInHiddenRange( const SwTxtNode& rNode, xub_StrLen nPos )
* returns the type of the compressed character
*************************************************************************/
-BYTE SwScriptInfo::CompType( const xub_StrLen nPos ) const
+sal_uInt8 SwScriptInfo::CompType( const xub_StrLen nPos ) const
{
- USHORT nEnd = CountCompChg();
- for( USHORT nX = 0; nX < nEnd; ++nX )
+ sal_uInt16 nEnd = CountCompChg();
+ for( sal_uInt16 nX = 0; nX < nEnd; ++nX )
{
xub_StrLen nChg = GetCompStart( nX );
@@ -1734,12 +1734,12 @@ BYTE SwScriptInfo::CompType( const xub_StrLen nPos ) const
* betwenn nStart and nEnd
*************************************************************************/
-USHORT SwScriptInfo::HasKana( xub_StrLen nStart, const xub_StrLen nLen ) const
+sal_uInt16 SwScriptInfo::HasKana( xub_StrLen nStart, const xub_StrLen nLen ) const
{
- USHORT nCnt = CountCompChg();
+ sal_uInt16 nCnt = CountCompChg();
xub_StrLen nEnd = nStart + nLen;
- for( USHORT nX = 0; nX < nCnt; ++nX )
+ for( sal_uInt16 nX = 0; nX < nCnt; ++nX )
{
xub_StrLen nKanaStart = GetCompStart( nX );
xub_StrLen nKanaEnd = nKanaStart + GetCompLen( nX );
@@ -1759,26 +1759,26 @@ USHORT SwScriptInfo::HasKana( xub_StrLen nStart, const xub_StrLen nLen ) const
*************************************************************************/
long SwScriptInfo::Compress( sal_Int32* pKernArray, xub_StrLen nIdx, xub_StrLen nLen,
- const USHORT nCompress, const USHORT nFontHeight,
+ const sal_uInt16 nCompress, const sal_uInt16 nFontHeight,
Point* pPoint ) const
{
ASSERT( nCompress, "Compression without compression?!" );
ASSERT( nLen, "Compression without text?!" );
- USHORT nCompCount = CountCompChg();
+ sal_uInt16 nCompCount = CountCompChg();
// In asian typography, there are full width and half width characters.
// Full width punctuation characters can be compressed by 50 %
// to determine this, we compare the font width with 75 % of its height
- USHORT nMinWidth = ( 3 * nFontHeight ) / 4;
+ sal_uInt16 nMinWidth = ( 3 * nFontHeight ) / 4;
- USHORT nCompIdx = HasKana( nIdx, nLen );
+ sal_uInt16 nCompIdx = HasKana( nIdx, nLen );
if ( USHRT_MAX == nCompIdx )
return 0;
xub_StrLen nChg = GetCompStart( nCompIdx );
xub_StrLen nCompLen = GetCompLen( nCompIdx );
- USHORT nI = 0;
+ sal_uInt16 nI = 0;
nLen = nLen + nIdx;
if( nChg > nIdx )
@@ -1796,7 +1796,7 @@ long SwScriptInfo::Compress( sal_Int32* pKernArray, xub_StrLen nIdx, xub_StrLen
long nLast = nI ? pKernArray[ nI - 1 ] : 0;
do
{
- USHORT nType = GetCompType( nCompIdx );
+ sal_uInt16 nType = GetCompType( nCompIdx );
#if OSL_DEBUG_LEVEL > 1
ASSERT( nType == CompType( nIdx ), "Gimme the right type!" );
#endif
@@ -1879,7 +1879,7 @@ long SwScriptInfo::Compress( sal_Int32* pKernArray, xub_StrLen nIdx, xub_StrLen
// total number of kashida positions, or the number of kashida positions after some positions
// have been dropped, depending on the state of the aKashidaInvalid array.
-USHORT SwScriptInfo::KashidaJustify( sal_Int32* pKernArray,
+sal_uInt16 SwScriptInfo::KashidaJustify( sal_Int32* pKernArray,
sal_Int32* pScrArray,
xub_StrLen nStt,
xub_StrLen nLen,
@@ -1892,7 +1892,7 @@ USHORT SwScriptInfo::KashidaJustify( sal_Int32* pKernArray,
// evaluate kashida informatin in collected in SwScriptInfo
- USHORT nCntKash = 0;
+ sal_uInt16 nCntKash = 0;
while( nCntKash < CountKashida() )
{
if ( nStt <= GetKashida( nCntKash ) )
@@ -1903,7 +1903,7 @@ USHORT SwScriptInfo::KashidaJustify( sal_Int32* pKernArray,
const xub_StrLen nEnd = nStt + nLen;
- USHORT nCntKashEnd = nCntKash;
+ sal_uInt16 nCntKashEnd = nCntKash;
while ( nCntKashEnd < CountKashida() )
{
if ( nEnd <= GetKashida( nCntKashEnd ) )
@@ -1912,8 +1912,8 @@ USHORT SwScriptInfo::KashidaJustify( sal_Int32* pKernArray,
nCntKashEnd++;
}
- USHORT nActualKashCount = nCntKashEnd - nCntKash;
- for ( USHORT i = nCntKash; i < nCntKashEnd; ++i )
+ sal_uInt16 nActualKashCount = nCntKashEnd - nCntKash;
+ for ( sal_uInt16 i = nCntKash; i < nCntKashEnd; ++i )
{
if ( nActualKashCount && !IsKashidaValid ( i ) )
--nActualKashCount;
@@ -1935,7 +1935,7 @@ USHORT SwScriptInfo::KashidaJustify( sal_Int32* pKernArray,
while ( nIdx < nEnd )
{
- USHORT nArrayPos = nIdx - nStt;
+ sal_uInt16 nArrayPos = nIdx - nStt;
// next kashida position
++nCntKash;
@@ -1946,7 +1946,7 @@ USHORT SwScriptInfo::KashidaJustify( sal_Int32* pKernArray,
if ( nIdx > nEnd )
nIdx = nEnd;
- const USHORT nArrayEnd = nIdx - nStt;
+ const sal_uInt16 nArrayEnd = nIdx - nStt;
while ( nArrayPos < nArrayEnd )
{
@@ -2046,7 +2046,7 @@ void SwScriptInfo::ClearKashidaInvalid ( xub_StrLen nKashPos )
bool SwScriptInfo::MarkOrClearKashidaInvalid ( xub_StrLen nStt, xub_StrLen nLen, bool bMark, xub_StrLen nMarkCount )
{
- USHORT nCntKash = 0;
+ sal_uInt16 nCntKash = 0;
while( nCntKash < CountKashida() )
{
if ( nStt <= GetKashida( nCntKash ) )
@@ -2092,10 +2092,10 @@ void SwScriptInfo::MarkKashidaInvalid ( xub_StrLen nKashPos )
* SwScriptInfo::GetKashidaPositions()
*************************************************************************/
// retrieve the kashida positions in the given text range
-USHORT SwScriptInfo::GetKashidaPositions ( xub_StrLen nStt, xub_StrLen nLen,
+sal_uInt16 SwScriptInfo::GetKashidaPositions ( xub_StrLen nStt, xub_StrLen nLen,
xub_StrLen* pKashidaPosition )
{
- USHORT nCntKash = 0;
+ sal_uInt16 nCntKash = 0;
while( nCntKash < CountKashida() )
{
if ( nStt <= GetKashida( nCntKash ) )
@@ -2106,7 +2106,7 @@ USHORT SwScriptInfo::GetKashidaPositions ( xub_StrLen nStt, xub_StrLen nLen,
const xub_StrLen nEnd = nStt + nLen;
- USHORT nCntKashEnd = nCntKash;
+ sal_uInt16 nCntKashEnd = nCntKash;
while ( nCntKashEnd < CountKashida() )
{
if ( nEnd <= GetKashida( nCntKashEnd ) )
@@ -2167,7 +2167,7 @@ bool SwScriptInfo::MarkKashidasInvalid ( xub_StrLen nCnt, xub_StrLen* pKashidaPo
{
ASSERT( pKashidaPositions && nCnt > 0, "Where are kashidas?" )
- USHORT nCntKash = 0;
+ sal_uInt16 nCntKash = 0;
xub_StrLen nKashidaPosIdx = 0;
while ( nCntKash < CountKashida() && nKashidaPosIdx < nCnt )
@@ -2193,7 +2193,7 @@ bool SwScriptInfo::MarkKashidasInvalid ( xub_StrLen nCnt, xub_StrLen* pKashidaPo
* SwScriptInfo::ThaiJustify()
*************************************************************************/
-USHORT SwScriptInfo::ThaiJustify( const XubString& rTxt, sal_Int32* pKernArray,
+sal_uInt16 SwScriptInfo::ThaiJustify( const XubString& rTxt, sal_Int32* pKernArray,
sal_Int32* pScrArray, xub_StrLen nStt,
xub_StrLen nLen, xub_StrLen nNumberOfBlanks,
long nSpaceAdd )
@@ -2204,9 +2204,9 @@ USHORT SwScriptInfo::ThaiJustify( const XubString& rTxt, sal_Int32* pKernArray,
SPACING_PRECISION_FACTOR;
long nSpaceSum = 0;
- USHORT nCnt = 0;
+ sal_uInt16 nCnt = 0;
- for ( USHORT nI = 0; nI < nLen; ++nI )
+ for ( sal_uInt16 nI = 0; nI < nLen; ++nI )
{
const xub_Unicode cCh = rTxt.GetChar( nStt + nI );
@@ -2333,7 +2333,7 @@ void SwLineLayout::Init( SwLinePortion* pNextPortion )
SwTwips SwLineLayout::_GetHangingMargin() const
{
SwLinePortion* pPor = GetPortion();
- BOOL bFound = sal_False;
+ sal_Bool bFound = sal_False;
SwTwips nDiff = 0;
while( pPor)
{
@@ -2383,7 +2383,7 @@ SwTwips SwTxtFrm::HangingMargin() const
void SwScriptInfo::CalcHiddenRanges( const SwTxtNode& rNode, MultiSelection& rHiddenMulti )
{
const SfxPoolItem* pItem = 0;
- if( SFX_ITEM_SET == rNode.GetSwAttrSet().GetItemState( RES_CHRATR_HIDDEN, TRUE, &pItem ) &&
+ if( SFX_ITEM_SET == rNode.GetSwAttrSet().GetItemState( RES_CHRATR_HIDDEN, sal_True, &pItem ) &&
((SvxCharHiddenItem*)pItem)->GetValue() )
{
rHiddenMulti.SelectAll();
@@ -2418,7 +2418,7 @@ void SwScriptInfo::CalcHiddenRanges( const SwTxtNode& rNode, MultiSelection& rHi
const IDocumentRedlineAccess& rIDRA = *rNode.getIDocumentRedlineAccess();
if ( rHiddenMulti.GetRangeCount() && IDocumentRedlineAccess::IsShowChanges( rIDRA.GetRedlineMode() ) )
{
- USHORT nAct = rIDRA.GetRedlinePos( rNode, USHRT_MAX );
+ sal_uInt16 nAct = rIDRA.GetRedlinePos( rNode, USHRT_MAX );
for ( ; nAct < rIDRA.GetRedlineTbl().Count(); nAct++ )
{
diff --git a/sw/source/core/text/porlay.hxx b/sw/source/core/text/porlay.hxx
index f8a7deb9fe29..9dc56001c125 100644
--- a/sw/source/core/text/porlay.hxx
+++ b/sw/source/core/text/porlay.hxx
@@ -194,15 +194,15 @@ public:
void InitSpaceAdd(); // Creates pLLSpaceAdd if necessary
void CreateSpaceAdd( const long nInit = 0 );
inline void FinishSpaceAdd() { delete pLLSpaceAdd; pLLSpaceAdd = NULL; }
- inline USHORT GetLLSpaceAddCount() const { return sal::static_int_cast< USHORT >(pLLSpaceAdd->size()); }
- inline void SetLLSpaceAdd( long nNew, USHORT nIdx )
+ inline sal_uInt16 GetLLSpaceAddCount() const { return sal::static_int_cast< sal_uInt16 >(pLLSpaceAdd->size()); }
+ inline void SetLLSpaceAdd( long nNew, sal_uInt16 nIdx )
{
if ( nIdx == GetLLSpaceAddCount() )
pLLSpaceAdd->push_back( nNew );
else
(*pLLSpaceAdd)[ nIdx ] = nNew;
}
- inline long GetLLSpaceAdd( USHORT nIdx ) { return (*pLLSpaceAdd)[ nIdx ]; }
+ inline long GetLLSpaceAdd( sal_uInt16 nIdx ) { return (*pLLSpaceAdd)[ nIdx ]; }
inline void RemoveFirstLLSpaceAdd() { pLLSpaceAdd->erase( pLLSpaceAdd->begin() ); }
inline std::vector<long>* GetpLLSpaceAdd() const { return pLLSpaceAdd; }
diff --git a/sw/source/core/text/porlin.cxx b/sw/source/core/text/porlin.cxx
index 862b5ce13024..1de04c82b43c 100644
--- a/sw/source/core/text/porlin.cxx
+++ b/sw/source/core/text/porlin.cxx
@@ -117,18 +117,18 @@ void SwLinePortion::PrePaint( const SwTxtPaintInfo& rInf,
return;
const KSHORT nHalfView = nViewWidth / 2;
- USHORT nLastWidth = pLast->Width();
+ sal_uInt16 nLastWidth = pLast->Width();
if ( pLast->InSpaceGrp() && rInf.GetSpaceAdd() )
- nLastWidth = nLastWidth + (USHORT)pLast->CalcSpacing( rInf.GetSpaceAdd(), rInf );
+ nLastWidth = nLastWidth + (sal_uInt16)pLast->CalcSpacing( rInf.GetSpaceAdd(), rInf );
KSHORT nPos;
SwTxtPaintInfo aInf( rInf );
- const BOOL bBidiPor = ( rInf.GetTxtFrm()->IsRightToLeft() ) !=
+ const sal_Bool bBidiPor = ( rInf.GetTxtFrm()->IsRightToLeft() ) !=
( 0 != ( TEXT_LAYOUT_BIDI_RTL & rInf.GetOut()->GetLayoutMode() ) );
- USHORT nDir = bBidiPor ?
+ sal_uInt16 nDir = bBidiPor ?
1800 :
rInf.GetFont()->GetOrientation( rInf.GetTxtFrm()->IsVertical() );
@@ -332,7 +332,7 @@ sal_Bool SwLinePortion::Format( SwTxtFormatInfo &rInf )
const SwLinePortion *pLast = rInf.GetLast();
Height( pLast->Height() );
SetAscent( pLast->GetAscent() );
- const KSHORT nNewWidth = static_cast<USHORT>(rInf.X() + PrtWidth());
+ const KSHORT nNewWidth = static_cast<sal_uInt16>(rInf.X() + PrtWidth());
// Nur Portions mit echter Breite koennen ein sal_True zurueckliefern
// Notizen beispielsweise setzen niemals bFull==sal_True
if( rInf.Width() <= nNewWidth && PrtWidth() && ! IsKernPortion() )
@@ -361,9 +361,9 @@ void SwLinePortion::FormatEOL( SwTxtFormatInfo & )
void SwLinePortion::Move( SwTxtPaintInfo &rInf )
{
- BOOL bB2T = rInf.GetDirection() == DIR_BOTTOM2TOP;
- const BOOL bFrmDir = rInf.GetTxtFrm()->IsRightToLeft();
- BOOL bCounterDir = ( ! bFrmDir && DIR_RIGHT2LEFT == rInf.GetDirection() ) ||
+ sal_Bool bB2T = rInf.GetDirection() == DIR_BOTTOM2TOP;
+ const sal_Bool bFrmDir = rInf.GetTxtFrm()->IsRightToLeft();
+ sal_Bool bCounterDir = ( ! bFrmDir && DIR_RIGHT2LEFT == rInf.GetDirection() ) ||
( bFrmDir && DIR_LEFT2RIGHT == rInf.GetDirection() );
if ( InSpaceGrp() && rInf.GetSpaceAdd() )
diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx
index 35f45f20d4c7..368f0782b144 100644
--- a/sw/source/core/text/pormulti.cxx
+++ b/sw/source/core/text/pormulti.cxx
@@ -79,7 +79,7 @@ SwMultiPortion::~SwMultiPortion()
void SwMultiPortion::Paint( const SwTxtPaintInfo & ) const
{
- ASSERT( FALSE,
+ ASSERT( sal_False,
"Don't try SwMultiPortion::Paint, try SwTxtPainter::PaintMultiPortion" );
}
@@ -212,7 +212,7 @@ SwRotatedPortion::SwRotatedPortion( const SwMultiCreator& rCreate,
* SwBidiPortion::SwBidiPortion(..)
* --------------------------------------------------*/
-SwBidiPortion::SwBidiPortion( xub_StrLen nEnd, BYTE nLv )
+SwBidiPortion::SwBidiPortion( xub_StrLen nEnd, sal_uInt8 nLv )
: SwMultiPortion( nEnd ), nLevel( nLv )
{
SetBidi();
@@ -329,7 +329,7 @@ SwDoubleLinePortion::SwDoubleLinePortion( const SwMultiCreator& rCreate,
pBracket->cPre = 0;
pBracket->cPost = 0;
}
- BYTE nTmp = SW_SCRIPTS;
+ sal_uInt8 nTmp = SW_SCRIPTS;
if( pBracket->cPre > 255 )
{
String aTxt( pBracket->cPre );
@@ -386,7 +386,7 @@ void SwDoubleLinePortion::PaintBracket( SwTxtPaintInfo &rInf,
aBlank.Height( pBracket->nHeight );
{
SwFont* pTmpFnt = new SwFont( *rInf.GetFont() );
- BYTE nAct = bOpen ? pBracket->nPreScript : pBracket->nPostScript;
+ sal_uInt8 nAct = bOpen ? pBracket->nPreScript : pBracket->nPostScript;
if( SW_SCRIPTS > nAct )
pTmpFnt->SetActual( nAct );
pTmpFnt->SetProportion( 100 );
@@ -433,7 +433,7 @@ void SwDoubleLinePortion::FormatBrackets( SwTxtFormatInfo &rInf, SwTwips& nMaxWi
if( pBracket->cPre )
{
String aStr( pBracket->cPre );
- BYTE nActualScr = pTmpFnt->GetActual();
+ sal_uInt8 nActualScr = pTmpFnt->GetActual();
if( SW_SCRIPTS > pBracket->nPreScript )
pTmpFnt->SetActual( pBracket->nPreScript );
SwFontSave aSave( rInf, pTmpFnt );
@@ -713,11 +713,11 @@ void SwRubyPortion::_Adjust( SwTxtFormatInfo &rInf )
}
KSHORT nLeft = 0; // the space in front of the first letter
KSHORT nRight = 0; // the space at the end of the last letter
- USHORT nSub = 0;
+ sal_uInt16 nSub = 0;
switch ( nAdjustment )
{
- case 1: nRight = static_cast<USHORT>(nLineDiff / 2); // no break
- case 2: nLeft = static_cast<USHORT>(nLineDiff - nRight); break;
+ case 1: nRight = static_cast<sal_uInt16>(nLineDiff / 2); // no break
+ case 2: nLeft = static_cast<sal_uInt16>(nLineDiff - nRight); break;
case 3: nSub = 1; // no break
case 4:
{
@@ -743,8 +743,8 @@ void SwRubyPortion::_Adjust( SwTxtFormatInfo &rInf )
}
if( nLineDiff > 1 )
{
- nRight = static_cast<USHORT>(nLineDiff / 2);
- nLeft = static_cast<USHORT>(nLineDiff - nRight);
+ nRight = static_cast<sal_uInt16>(nLineDiff / 2);
+ nLeft = static_cast<sal_uInt16>(nLineDiff - nRight);
}
break;
}
@@ -824,7 +824,7 @@ void SwRubyPortion::CalcRubyOffset()
* lcl_Has2Lines(..)
* is a little help function for GetMultiCreator(..)
* It extracts the 2-line-format from a 2-line-attribute or a character style.
- * The rValue is set to TRUE, if the 2-line-attribute's value is set and
+ * The rValue is set to sal_True, if the 2-line-attribute's value is set and
* no 2-line-format reference is passed. If there is a 2-line-format reference,
* then the rValue is set only, if the 2-line-attribute's value is set _and_
* the 2-line-formats has the same brackets.
@@ -853,7 +853,7 @@ sal_Bool lcl_Has2Lines( const SwTxtAttr& rAttr, const SvxTwoLinesItem* &rpRef,
* lcl_HasRotation(..)
* is a little help function for GetMultiCreator(..)
* It extracts the charrotation from a charrotate-attribute or a character style.
- * The rValue is set to TRUE, if the charrotate-attribute's value is set and
+ * The rValue is set to sal_True, if the charrotate-attribute's value is set and
* no charrotate-format reference is passed.
* If there is a charrotate-format reference, then the rValue is set only,
* if the charrotate-attribute's value is set _and_ identical
@@ -884,7 +884,7 @@ SwMultiCreator* SwTxtSizeInfo::GetMultiCreator( xub_StrLen &rPos,
SwScriptInfo& rSI = ((SwParaPortion*)GetParaPortion())->GetScriptInfo();
// get the last embedding level
- BYTE nCurrLevel;
+ sal_uInt8 nCurrLevel;
if ( pMulti )
{
ASSERT( pMulti->IsBidi(), "Nested MultiPortion is not BidiPortion" )
@@ -896,7 +896,7 @@ SwMultiCreator* SwTxtSizeInfo::GetMultiCreator( xub_StrLen &rPos,
nCurrLevel = GetTxtFrm()->IsRightToLeft() ? 1 : 0;
// check if there is a field at rPos:
- BYTE nNextLevel = nCurrLevel;
+ sal_uInt8 nNextLevel = nCurrLevel;
sal_Bool bFldBidi = sal_False;
if ( CH_TXTATR_BREAKWORD == GetChar( rPos ) )
@@ -942,7 +942,7 @@ SwMultiCreator* SwTxtSizeInfo::GetMultiCreator( xub_StrLen &rPos,
const SvxCharRotateItem* pRotate = NULL;
const SfxPoolItem* pRotItem;
if( SFX_ITEM_SET == pFrm->GetTxtNode()->GetSwAttrSet().
- GetItemState( RES_CHRATR_ROTATE, TRUE, &pRotItem ) &&
+ GetItemState( RES_CHRATR_ROTATE, sal_True, &pRotItem ) &&
((SvxCharRotateItem*)pRotItem)->GetValue() )
pRotate = (SvxCharRotateItem*)pRotItem;
else
@@ -950,7 +950,7 @@ SwMultiCreator* SwTxtSizeInfo::GetMultiCreator( xub_StrLen &rPos,
const SvxTwoLinesItem* p2Lines = NULL;
const SfxPoolItem* pItem;
if( SFX_ITEM_SET == pFrm->GetTxtNode()->GetSwAttrSet().
- GetItemState( RES_CHRATR_TWO_LINES, TRUE, &pItem ) &&
+ GetItemState( RES_CHRATR_TWO_LINES, sal_True, &pItem ) &&
((SvxTwoLinesItem*)pItem)->GetValue() )
p2Lines = (SvxTwoLinesItem*)pItem;
else
@@ -962,10 +962,10 @@ SwMultiCreator* SwTxtSizeInfo::GetMultiCreator( xub_StrLen &rPos,
const SwTxtAttr *pRuby = NULL;
sal_Bool bTwo = sal_False;
sal_Bool bRot = sal_False;
- USHORT n2Lines = USHRT_MAX;
- USHORT nRotate = USHRT_MAX;
- USHORT nCount = pHints ? pHints->Count() : 0;
- USHORT i;
+ sal_uInt16 n2Lines = USHRT_MAX;
+ sal_uInt16 nRotate = USHRT_MAX;
+ sal_uInt16 nCount = pHints ? pHints->Count() : 0;
+ sal_uInt16 i;
for( i = 0; i < nCount; ++i )
{
const SwTxtAttr *pTmp = (*pHints)[i];
@@ -1065,14 +1065,14 @@ SwMultiCreator* SwTxtSizeInfo::GetMultiCreator( xub_StrLen &rPos,
continue;
if( rPos < *pTmp->GetStart() )
{
- // If bOn is FALSE and the next attribute starts later than rPos
+ // If bOn is sal_False and the next attribute starts later than rPos
// the winner attribute is interrupted at rPos.
// If the start of the next atribute is behind the end of
// the last attribute on the aEnd-stack, this is the endposition
// on the stack is the end of the 2-line portion.
if( !bOn || aEnd.back() < *pTmp->GetStart() )
break;
- // At this moment, bOn is TRUE and the next attribute starts
+ // At this moment, bOn is sal_True and the next attribute starts
// behind rPos, so we could move rPos to the next startpoint
rPos = *pTmp->GetStart();
// We clean up the aEnd-stack, endpositions equal to rPos are
@@ -1083,7 +1083,7 @@ SwMultiCreator* SwTxtSizeInfo::GetMultiCreator( xub_StrLen &rPos,
aEnd.pop_back();
}
// If the endstack is empty, we simulate an attribute with
- // state TRUE and endposition rPos
+ // state sal_True and endposition rPos
if( aEnd.empty() )
{
aEnd.push_front( rPos );
@@ -1366,8 +1366,8 @@ void SwTxtPainter::PaintMultiPortion( const SwRect &rPaint,
{
GETGRID( pFrm->FindPageFrm() )
const sal_Bool bHasGrid = pGrid && GetInfo().SnapToGrid();
- USHORT nGridWidth = 0;
- USHORT nRubyHeight = 0;
+ sal_uInt16 nGridWidth = 0;
+ sal_uInt16 nRubyHeight = 0;
sal_Bool bRubyTop = sal_False;
if ( bHasGrid )
@@ -1380,7 +1380,7 @@ void SwTxtPainter::PaintMultiPortion( const SwRect &rPaint,
// do not allow grid mode for first line in ruby portion
const sal_Bool bRubyInGrid = bHasGrid && rMulti.IsRuby();
- const USHORT nOldHeight = rMulti.Height();
+ const sal_uInt16 nOldHeight = rMulti.Height();
const sal_Bool bOldGridModeAllowed = GetInfo().SnapToGrid();
if ( bRubyInGrid )
@@ -1390,9 +1390,9 @@ void SwTxtPainter::PaintMultiPortion( const SwRect &rPaint,
}
SwLayoutModeModifier aLayoutModeModifier( *GetInfo().GetOut() );
- BYTE nEnvDir = 0;
- BYTE nThisDir = 0;
- BYTE nFrmDir = 0;
+ sal_uInt8 nEnvDir = 0;
+ sal_uInt8 nThisDir = 0;
+ sal_uInt8 nFrmDir = 0;
if ( rMulti.IsBidi() )
{
// these values are needed for the calculation of the x coordinate
@@ -1511,7 +1511,7 @@ void SwTxtPainter::PaintMultiPortion( const SwRect &rPaint,
{
if( rMulti.HasRotation() )
{
- const USHORT nAdjustment = ( pLay->Height() - pPor->Height() ) / 2 +
+ const sal_uInt16 nAdjustment = ( pLay->Height() - pPor->Height() ) / 2 +
pPor->GetAscent();
if( rMulti.IsRevers() )
GetInfo().X( nOfst - nAdjustment );
@@ -1744,7 +1744,7 @@ void lcl_TruncateMultiPortion( SwMultiPortion& rMulti, SwTxtFormatInfo& rInf,
* SwTxtFrm::_Format with multiple BuildPortions
*---------------------------------------------------------------------------*/
-BOOL SwTxtFormatter::BuildMultiPortion( SwTxtFormatInfo &rInf,
+sal_Bool SwTxtFormatter::BuildMultiPortion( SwTxtFormatInfo &rInf,
SwMultiPortion& rMulti )
{
SwTwips nMaxWidth = rInf.Width();
@@ -1868,13 +1868,13 @@ BOOL SwTxtFormatter::BuildMultiPortion( SwTxtFormatInfo &rInf,
SwLinePortion *pNextFirst = NULL;
SwLinePortion *pNextSecond = NULL;
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
GETGRID( pFrm->FindPageFrm() )
const sal_Bool bHasGrid = pGrid && GRID_LINES_CHARS == pGrid->GetGridType();
- USHORT nGridWidth = 0;
- USHORT nRubyHeight = 0;
+ sal_uInt16 nGridWidth = 0;
+ sal_uInt16 nRubyHeight = 0;
sal_Bool bRubyTop = sal_False;
if ( bHasGrid )
@@ -1888,7 +1888,7 @@ BOOL SwTxtFormatter::BuildMultiPortion( SwTxtFormatInfo &rInf,
{
pCurr = &rMulti.GetRoot();
nStart = nStartIdx;
- bRet = FALSE;
+ bRet = sal_False;
FormatReset( aInf );
aInf.X( nTmpX );
aInf.Width( KSHORT(nActWidth) );
@@ -2016,7 +2016,7 @@ BOOL SwTxtFormatter::BuildMultiPortion( SwTxtFormatInfo &rInf,
}
delete pNextFirst;
pNextFirst = NULL;
- } while ( TRUE );
+ } while ( sal_True );
pMulti = pOldMulti;
@@ -2358,7 +2358,7 @@ SwLinePortion* SwTxtFormatter::MakeRestPortion( const SwLineLayout* pLine,
SwTxtCursorSave::SwTxtCursorSave( SwTxtCursor* pTxtCursor,
SwMultiPortion* pMulti,
SwTwips nY,
- USHORT& nX,
+ sal_uInt16& nX,
xub_StrLen nCurrStart,
long nSpaceAdd )
{
@@ -2377,7 +2377,7 @@ SwTxtCursorSave::SwTxtCursorSave( SwTxtCursor* pTxtCursor,
{
bSpaceChg = pMulti->ChgSpaceAdd( pTxtCursor->pCurr, nSpaceAdd );
- USHORT nSpaceCnt;
+ sal_uInt16 nSpaceCnt;
if ( pMulti->IsDouble() )
{
pTxtCursor->SetPropFont( 50 );
@@ -2392,7 +2392,7 @@ SwTxtCursorSave::SwTxtCursorSave( SwTxtCursor* pTxtCursor,
}
if( nSpaceAdd > 0 && !pMulti->HasTabulator() )
- pTxtCursor->pCurr->Width( static_cast<USHORT>(nWidth + nSpaceAdd * nSpaceCnt / SPACING_PRECISION_FACTOR ) );
+ pTxtCursor->pCurr->Width( static_cast<sal_uInt16>(nWidth + nSpaceAdd * nSpaceCnt / SPACING_PRECISION_FACTOR ) );
// For a BidiPortion we have to calculate the offset from the
// end of the portion
diff --git a/sw/source/core/text/pormulti.hxx b/sw/source/core/text/pormulti.hxx
index a1e89f838b54..b292f1163e1d 100644
--- a/sw/source/core/text/pormulti.hxx
+++ b/sw/source/core/text/pormulti.hxx
@@ -56,8 +56,8 @@ struct SwMultiCreator
{
const SwTxtAttr* pAttr;
const SfxPoolItem* pItem;
- BYTE nId;
- BYTE nLevel;
+ sal_uInt8 nId;
+ sal_uInt8 nLevel;
};
/*-----------------25.10.00 16:19-------------------
@@ -74,8 +74,8 @@ struct SwBracket
KSHORT nPostWidth; // Width of the closing bracket
sal_Unicode cPre; // Initial character, e.g. '('
sal_Unicode cPost; // Final character, e.g. ')'
- BYTE nPreScript; // Script of the initial character
- BYTE nPostScript; // Script of the final character
+ sal_uInt8 nPreScript; // Script of the initial character
+ sal_uInt8 nPostScript; // Script of the final character
};
/*-----------------16.10.00 12:45-------------------
@@ -147,7 +147,7 @@ public:
inline sal_Bool HasRotation() const { return 0 != (1 & nDirection); }
inline sal_Bool IsRevers() const { return 0 != (2 & nDirection); }
inline sal_uInt8 GetDirection() const { return nDirection; }
- inline USHORT GetFontRotation() const
+ inline sal_uInt16 GetFontRotation() const
{ return ( HasRotation() ? ( IsRevers() ? 2700 : 900 ) : 0 ); }
// Accessibility: pass information about this portion to the PortionHandler
@@ -194,7 +194,7 @@ public:
class SwRubyPortion : public SwMultiPortion
{
xub_StrLen nRubyOffset;
- USHORT nAdjustment;
+ sal_uInt16 nAdjustment;
void _Adjust( SwTxtFormatInfo &rInf);
public:
SwRubyPortion( const SwRubyPortion& rRuby, xub_StrLen nEnd );
@@ -207,7 +207,7 @@ public:
void CalcRubyOffset();
inline void Adjust( SwTxtFormatInfo &rInf )
{ if(nAdjustment && GetRoot().GetNext()) _Adjust(rInf); }
- inline USHORT GetAdjustment() const { return nAdjustment; }
+ inline sal_uInt16 GetAdjustment() const { return nAdjustment; }
inline xub_StrLen GetRubyOffset() const { return nRubyOffset; }
};
@@ -222,12 +222,12 @@ public:
class SwBidiPortion : public SwMultiPortion
{
- BYTE nLevel;
+ sal_uInt8 nLevel;
public:
- SwBidiPortion( xub_StrLen nEnd, BYTE nLv );
+ SwBidiPortion( xub_StrLen nEnd, sal_uInt8 nLv );
- inline BYTE GetLevel() const { return nLevel; }
+ inline sal_uInt8 GetLevel() const { return nLevel; }
// Get number of blanks for justified alignment
xub_StrLen GetSpaceCnt( const SwTxtSizeInfo &rInf ) const;
// Calculates extra spacing based on number of blanks
@@ -244,11 +244,11 @@ class SwTxtCursorSave
SwLineLayout* pCurr;
SwTwips nWidth;
xub_StrLen nStart;
- BYTE nOldProp;
+ sal_uInt8 nOldProp;
sal_Bool bSpaceChg;
public:
SwTxtCursorSave( SwTxtCursor* pTxtCursor, SwMultiPortion* pMulti,
- SwTwips nY, USHORT& nX, xub_StrLen nCurrStart, long nSpaceAdd );
+ SwTwips nY, sal_uInt16& nX, xub_StrLen nCurrStart, long nSpaceAdd );
~SwTxtCursorSave();
};
diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx
index 2e51fa45411b..b3736dbb3b87 100644
--- a/sw/source/core/text/porrst.cxx
+++ b/sw/source/core/text/porrst.cxx
@@ -212,7 +212,7 @@ SwArrowPortion::SwArrowPortion( const SwLinePortion &rPortion ) :
SwArrowPortion::SwArrowPortion( const SwTxtPaintInfo &rInf )
: bLeft( sal_False )
{
- Height( (USHORT)(rInf.GetTxtFrm()->Prt().Height()) );
+ Height( (sal_uInt16)(rInf.GetTxtFrm()->Prt().Height()) );
aPos.X() = rInf.GetTxtFrm()->Frm().Left() +
rInf.GetTxtFrm()->Prt().Right();
aPos.Y() = rInf.GetTxtFrm()->Frm().Top() +
@@ -522,7 +522,7 @@ void SwControlCharPortion::Paint( const SwTxtPaintInfo &rInf ) const
{
SwFont aTmpFont( *rInf.GetFont() );
aTmpFont.SetEscapement( CHAR_ZWSP == mcChar ? DFLT_ESC_AUTO_SUB : -25 );
- const USHORT nProp = 40;
+ const sal_uInt16 nProp = 40;
aTmpFont.SetProportion( nProp ); // a smaller font
SwFontSave aFontSave( rInf, &aTmpFont );
diff --git a/sw/source/core/text/porrst.hxx b/sw/source/core/text/porrst.hxx
index f94410bb4213..1eaaa442b9b0 100644
--- a/sw/source/core/text/porrst.hxx
+++ b/sw/source/core/text/porrst.hxx
@@ -156,8 +156,8 @@ class SwControlCharPortion : public SwLinePortion
{
private:
- mutable USHORT mnViewWidth; // used to cache a calculated value
- mutable USHORT mnHalfCharWidth; // used to cache a calculated value
+ mutable sal_uInt16 mnViewWidth; // used to cache a calculated value
+ mutable sal_uInt16 mnHalfCharWidth; // used to cache a calculated value
sal_Unicode mcChar;
public:
diff --git a/sw/source/core/text/portab.hxx b/sw/source/core/text/portab.hxx
index a2f10803c894..00b061230a46 100644
--- a/sw/source/core/text/portab.hxx
+++ b/sw/source/core/text/portab.hxx
@@ -107,7 +107,7 @@ class SwTabDecimalPortion : public SwTabPortion
* following the tab stop up to the decimal position. This value is
* evaluated during pLastTab->FormatEOL. FME 2006-01-06 #127428#.
*/
- USHORT mnWidthOfPortionsUpTpDecimalPosition;
+ sal_uInt16 mnWidthOfPortionsUpTpDecimalPosition;
public:
inline SwTabDecimalPortion( const KSHORT nTabPosVal, const xub_Unicode cTab,
@@ -119,11 +119,11 @@ public:
inline xub_Unicode GetTabDecimal() const { return mcTab; }
- inline void SetWidthOfPortionsUpToDecimalPosition( USHORT nNew )
+ inline void SetWidthOfPortionsUpToDecimalPosition( sal_uInt16 nNew )
{
mnWidthOfPortionsUpTpDecimalPosition = nNew;
}
- inline USHORT GetWidthOfPortionsUpToDecimalPosition() const
+ inline sal_uInt16 GetWidthOfPortionsUpToDecimalPosition() const
{
return mnWidthOfPortionsUpTpDecimalPosition;
}
diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx
index a849cbe42f40..f123f6c42c6b 100644
--- a/sw/source/core/text/portxt.cxx
+++ b/sw/source/core/text/portxt.cxx
@@ -68,7 +68,7 @@ using namespace ::com::sun::star::i18n::ScriptType;
* (for justified alignment).
*************************************************************************/
-USHORT lcl_AddSpace( const SwTxtSizeInfo &rInf, const XubString* pStr,
+sal_uInt16 lcl_AddSpace( const SwTxtSizeInfo &rInf, const XubString* pStr,
const SwLinePortion& rPor )
{
xub_StrLen nPos, nEnd;
@@ -88,8 +88,8 @@ USHORT lcl_AddSpace( const SwTxtSizeInfo &rInf, const XubString* pStr,
pSI = &((SwParaPortion*)rInf.GetParaPortion())->GetScriptInfo();
}
- USHORT nCnt = 0;
- BYTE nScript = 0;
+ sal_uInt16 nCnt = 0;
+ sal_uInt8 nScript = 0;
// If portion consists of Asian characters and language is not
// Korean, we add extra space to each character.
@@ -97,7 +97,7 @@ USHORT lcl_AddSpace( const SwTxtSizeInfo &rInf, const XubString* pStr,
if ( pSI )
nScript = pSI->ScriptType( nPos );
else if ( pBreakIt->GetBreakIter().is() )
- nScript = (BYTE)pBreakIt->GetBreakIter()->getScriptType( *pStr, nPos );
+ nScript = (sal_uInt8)pBreakIt->GetBreakIter()->getScriptType( *pStr, nPos );
// Note: rInf.GetIdx() can differ from nPos,
// e.g., when rPor is a field portion. nPos referes to the string passed
@@ -135,7 +135,7 @@ USHORT lcl_AddSpace( const SwTxtSizeInfo &rInf, const XubString* pStr,
{
if ( SwScriptInfo::IsArabicText( *pStr, nPos, nEnd - nPos ) && pSI->CountKashida() )
{
- const USHORT nKashRes = pSI->KashidaJustify( 0, 0, nPos, nEnd - nPos );
+ const sal_uInt16 nKashRes = pSI->KashidaJustify( 0, 0, nPos, nEnd - nPos );
// i60591: need to check result of KashidaJustify
// determine if kashida justification is applicable
if( nKashRes != STRING_LEN )
@@ -192,7 +192,7 @@ USHORT lcl_AddSpace( const SwTxtSizeInfo &rInf, const XubString* pStr,
nPos = rInf.GetIdx() + rPor.GetLen();
if ( nPos < rInf.GetTxt().Len() )
{
- BYTE nNextScript = 0;
+ sal_uInt8 nNextScript = 0;
const SwLinePortion* pPor = rPor.GetPortion();
if ( pPor && pPor->IsKernPortion() )
pPor = pPor->GetPortion();
@@ -210,10 +210,10 @@ USHORT lcl_AddSpace( const SwTxtSizeInfo &rInf, const XubString* pStr,
pPor->GetExpTxt( rInf, aStr );
((SwTxtSizeInfo &)rInf).SetOnWin( bOldOnWin );
- nNextScript = (BYTE)pBreakIt->GetBreakIter()->getScriptType( aStr, 0 );
+ nNextScript = (sal_uInt8)pBreakIt->GetBreakIter()->getScriptType( aStr, 0 );
}
else
- nNextScript = (BYTE)pBreakIt->GetBreakIter()->getScriptType( rInf.GetTxt(), nPos );
+ nNextScript = (sal_uInt8)pBreakIt->GetBreakIter()->getScriptType( rInf.GetTxt(), nPos );
if( ASIAN == nNextScript )
{
@@ -523,7 +523,7 @@ void SwTxtPortion::FormatEOL( SwTxtFormatInfo &rInf )
{
// calculate number of blanks
xub_StrLen nX = rInf.GetIdx() - 1;
- USHORT nHoleLen = 1;
+ sal_uInt16 nHoleLen = 1;
while( nX && nHoleLen < GetLen() && CH_BLANK == rInf.GetChar( --nX ) )
nHoleLen++;
diff --git a/sw/source/core/text/redlnitr.cxx b/sw/source/core/text/redlnitr.cxx
index 71db30b53b60..cf364b5e2e1d 100644
--- a/sw/source/core/text/redlnitr.cxx
+++ b/sw/source/core/text/redlnitr.cxx
@@ -112,13 +112,13 @@ void SwAttrIter::CtorInitAttrIter( SwTxtNode& rTxtNode, SwScriptInfo& rScrInf, S
pFnt->SetActual( SwScriptInfo::WhichFont( 0, 0, pScriptInfo ) );
xub_StrLen nChg = 0;
- USHORT nCnt = 0;
+ sal_uInt16 nCnt = 0;
do
{
nChg = pScriptInfo->GetScriptChg( nCnt );
- USHORT nScript = pScriptInfo->GetScriptType( nCnt++ );
- BYTE nTmp = 4;
+ sal_uInt16 nScript = pScriptInfo->GetScriptType( nCnt++ );
+ sal_uInt8 nTmp = 4;
switch ( nScript ) {
case i18n::ScriptType::ASIAN :
if( !aMagicNo[SW_CJK] ) nTmp = SW_CJK; break;
diff --git a/sw/source/core/text/redlnitr.hxx b/sw/source/core/text/redlnitr.hxx
index 466cd5a9ad02..c288d427e92c 100644
--- a/sw/source/core/text/redlnitr.hxx
+++ b/sw/source/core/text/redlnitr.hxx
@@ -76,7 +76,7 @@ class SwRedlineItr
SwAttrHandler& rAttrHandler;
SfxItemSet *pSet;
SwExtend *pExt;
- ULONG nNdIdx;
+ sal_uLong nNdIdx;
xub_StrLen nFirst;
xub_StrLen nAct;
xub_StrLen nStart;
diff --git a/sw/source/core/text/txtdrop.cxx b/sw/source/core/text/txtdrop.cxx
index 9f759ccaade8..623019163396 100644
--- a/sw/source/core/text/txtdrop.cxx
+++ b/sw/source/core/text/txtdrop.cxx
@@ -62,7 +62,7 @@ using namespace ::com::sun::star;
*************************************************************************/
sal_Bool lcl_IsDropFlyInter( const SwTxtFormatInfo &rInf,
- USHORT nWidth, USHORT nHeight )
+ sal_uInt16 nWidth, sal_uInt16 nHeight )
{
const SwTxtFly *pTxtFly = rInf.GetTxtFly();
if( pTxtFly && pTxtFly->IsOn() )
@@ -167,7 +167,7 @@ MSHORT SwTxtNode::GetDropLen( MSHORT nWishLen ) const
{
// find first word
const SwAttrSet& rAttrSet = GetSwAttrSet();
- const USHORT nTxtScript = pBreakIt->GetRealScriptOfText( GetTxt(), 0 );
+ const sal_uInt16 nTxtScript = pBreakIt->GetRealScriptOfText( GetTxt(), 0 );
LanguageType eLanguage;
@@ -266,7 +266,7 @@ bool SwTxtNode::GetDropSize(int& rFontHeight, int& rDropHeight, int& rDropDescen
if (rFontHeight==0 && rDropHeight==0 && rDropDescent==0)
{
- const USHORT nLines = rDrop.GetLines();
+ const sal_uInt16 nLines = rDrop.GetLines();
const SvxFontHeightItem& rItem = (SvxFontHeightItem&)rSet.Get( RES_CHRATR_FONTSIZE );
rFontHeight = rItem.GetHeight();
@@ -429,7 +429,7 @@ sal_Bool SwDropPortion::FormatTxt( SwTxtFormatInfo &rInf )
SwPosSize SwDropPortion::GetTxtSize( const SwTxtSizeInfo &rInf ) const
{
- USHORT nMyX = 0;
+ sal_uInt16 nMyX = 0;
xub_StrLen nIdx = 0;
const SwDropPortionPart* pCurrPart = GetPart();
@@ -721,7 +721,7 @@ class SwDropCapCache
{
long aMagicNo[ DROP_CACHE_SIZE ];
XubString aTxt[ DROP_CACHE_SIZE ];
- USHORT aFactor[ DROP_CACHE_SIZE ];
+ sal_uInt16 aFactor[ DROP_CACHE_SIZE ];
KSHORT aWishedHeight[ DROP_CACHE_SIZE ];
short aDescent[ DROP_CACHE_SIZE ];
MSHORT nIndex;
@@ -813,7 +813,7 @@ void SwDropCapCache::CalcFontSize( SwDropPortion* pDrop, SwTxtFormatInfo &rInf )
aTxt[ nTmpIdx ] = aStr;
aWishedHeight[ nTmpIdx ] = KSHORT(nWishedHeight);
// save initial scaling factor
- aFactor[ nTmpIdx ] = (USHORT)nFactor;
+ aFactor[ nTmpIdx ] = (sal_uInt16)nFactor;
}
sal_Bool bGrow = ( pDrop->GetLen() != 0 );
@@ -849,11 +849,11 @@ void SwDropCapCache::CalcFontSize( SwDropPortion* pDrop, SwTxtFormatInfo &rInf )
SwFont& rFnt = pCurrPart->GetFont();
// Get height including proportion
- const USHORT nCurrHeight =
- (USHORT)rFnt.GetHeight( rFnt.GetActual() );
+ const sal_uInt16 nCurrHeight =
+ (sal_uInt16)rFnt.GetHeight( rFnt.GetActual() );
// Get without proportion
- const BYTE nOldProp = rFnt.GetPropr();
+ const sal_uInt8 nOldProp = rFnt.GetPropr();
rFnt.SetProportion( 100 );
Size aOldSize = Size( 0, rFnt.GetHeight( rFnt.GetActual() ) );
@@ -946,7 +946,7 @@ void SwDropCapCache::CalcFontSize( SwDropPortion* pDrop, SwTxtFormatInfo &rInf )
else
{
if ( bUseCache )
- aFactor[ nTmpIdx ] = (USHORT)nFactor;
+ aFactor[ nTmpIdx ] = (sal_uInt16)nFactor;
nMin = nFactor;
}
@@ -990,7 +990,7 @@ void SwDropCapCache::CalcFontSize( SwDropPortion* pDrop, SwTxtFormatInfo &rInf )
SwFont& rFnt = pCurrPart->GetFont();
Size aNewSize( 0, ( nFactor * rFnt.GetHeight( rFnt.GetActual() ) ) / 1000 );
- const BYTE nOldProp = rFnt.GetPropr();
+ const sal_uInt8 nOldProp = rFnt.GetPropr();
rFnt.SetProportion( 100 );
rFnt.SetSize( aNewSize, rFnt.GetActual() );
rFnt.SetProportion( nOldProp );
@@ -1007,7 +1007,7 @@ void SwDropCapCache::CalcFontSize( SwDropPortion* pDrop, SwTxtFormatInfo &rInf )
sal_Bool SwDropPortion::Format( SwTxtFormatInfo &rInf )
{
sal_Bool bFull = sal_False;
- Fix( (USHORT)rInf.X() );
+ Fix( (sal_uInt16)rInf.X() );
SwLayoutModeModifier aLayoutModeModifier( *rInf.GetOut() );
aLayoutModeModifier.SetAuto();
@@ -1043,7 +1043,7 @@ sal_Bool SwDropPortion::Format( SwTxtFormatInfo &rInf )
Width();
// set values
- pCurrPart->SetWidth( (USHORT)nTmpWidth );
+ pCurrPart->SetWidth( (sal_uInt16)nTmpWidth );
// Move
rInf.SetIdx( rInf.GetIdx() + pCurrPart->GetLen() );
@@ -1051,7 +1051,7 @@ sal_Bool SwDropPortion::Format( SwTxtFormatInfo &rInf )
pCurrPart = pCurrPart->GetFollow();
}
- Width( (USHORT)(rInf.X() - nOldX) );
+ Width( (sal_uInt16)(rInf.X() - nOldX) );
}
// reset my length
@@ -1089,7 +1089,7 @@ sal_Bool SwDropPortion::Format( SwTxtFormatInfo &rInf )
else
{
const KSHORT nWant = Width() + GetDistance();
- const KSHORT nRest = (USHORT)(rInf.Width() - rInf.X());
+ const KSHORT nRest = (sal_uInt16)(rInf.Width() - rInf.X());
if( ( nWant > nRest ) ||
lcl_IsDropFlyInter( rInf, Width() + GetDistance(), nDropHeight ) )
nDistance = 0;
diff --git a/sw/source/core/text/txtfld.cxx b/sw/source/core/text/txtfld.cxx
index 3146fc4ddab7..e917ca738d9d 100644
--- a/sw/source/core/text/txtfld.cxx
+++ b/sw/source/core/text/txtfld.cxx
@@ -446,7 +446,7 @@ SwNumberPortion *SwTxtFormatter::NewNumberPortion( SwTxtFormatInfo &rInf ) const
// hat ein "gueltige" Nummer ?
if( pTxtNd->IsNumbered() && pTxtNd->IsCountedInList())
{
- const SwNumFmt &rNumFmt = pNumRule->Get( static_cast<USHORT>(pTxtNd->GetActualListLevel()) );
+ const SwNumFmt &rNumFmt = pNumRule->Get( static_cast<sal_uInt16>(pTxtNd->GetActualListLevel()) );
const sal_Bool bLeft = SVX_ADJUST_LEFT == rNumFmt.GetNumAdjust();
const sal_Bool bCenter = SVX_ADJUST_CENTER == rNumFmt.GetNumAdjust();
// --> OD 2008-01-23 #newlistlevelattrs#
@@ -519,7 +519,7 @@ SwNumberPortion *SwTxtFormatter::NewNumberPortion( SwTxtFormatInfo &rInf ) const
if ( pFmtFnt )
{
- const BYTE nAct = pNumFnt->GetActual();
+ const sal_uInt8 nAct = pNumFnt->GetActual();
pNumFnt->SetFamily( pFmtFnt->GetFamily(), nAct );
pNumFnt->SetName( pFmtFnt->GetName(), nAct );
pNumFnt->SetStyleName( pFmtFnt->GetStyleName(), nAct );
diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx
index 8d274c9036fa..a1ccd4b226b2 100644
--- a/sw/source/core/text/txtfly.cxx
+++ b/sw/source/core/text/txtfly.cxx
@@ -547,7 +547,7 @@ void SwTxtFormatter::CalcFlyWidth( SwTxtFormatInfo &rInf )
if( bForced )
{
pCurr->SetForcedLeftMargin( sal_True );
- rInf.ForcedLeftMargin( (USHORT)aInter.Width() );
+ rInf.ForcedLeftMargin( (sal_uInt16)aInter.Width() );
}
if( bFullLine )
@@ -620,7 +620,7 @@ void SwTxtFormatter::CalcFlyWidth( SwTxtFormatInfo &rInf )
(pPageFrm->*fnRect->fnGetPrtLeft)();
const SwDoc *pDoc = rInf.GetTxtFrm()->GetNode()->GetDoc();
- const USHORT nGridWidth = GETGRIDWIDTH( pGrid, pDoc); //for textgrid refactor
+ const sal_uInt16 nGridWidth = GETGRIDWIDTH( pGrid, pDoc); //for textgrid refactor
SwTwips nStartX = GetLeftMargin();
if ( bVert )
@@ -633,11 +633,11 @@ void SwTxtFormatter::CalcFlyWidth( SwTxtFormatInfo &rInf )
const SwTwips nOfst = nStartX - nGridOrigin;
const SwTwips nTmpWidth = rInf.Width() + nOfst;
- const ULONG i = nTmpWidth / nGridWidth + 1;
+ const sal_uLong i = nTmpWidth / nGridWidth + 1;
const long nNewWidth = ( i - 1 ) * nGridWidth - nOfst;
if ( nNewWidth > 0 )
- rInf.Width( (USHORT)nNewWidth );
+ rInf.Width( (sal_uInt16)nNewWidth );
else
rInf.Width( 0 );
}
@@ -688,7 +688,7 @@ SwFlyCntPortion *SwTxtFormatter::NewFlyCntPortion( SwTxtFormatInfo &rInf,
pFly->GetRefPoint().Y() );
if ( bUseFlyAscent )
- nAscent = static_cast<USHORT>( Abs( int( bTxtFrmVertical ?
+ nAscent = static_cast<sal_uInt16>( Abs( int( bTxtFrmVertical ?
pFly->GetRelPos().X() :
pFly->GetRelPos().Y() ) ) );
@@ -952,7 +952,7 @@ sal_Bool SwTxtFly::DrawTextOpaque( SwDrawTextInfo &rInf )
sal_Bool bOpaque = sal_False;
// --> OD 2006-08-15 #i68520#
- const UINT32 nCurrOrd = mpCurrAnchoredObj
+ const sal_uInt32 nCurrOrd = mpCurrAnchoredObj
? mpCurrAnchoredObj->GetDrawObj()->GetOrdNum()
: SAL_MAX_UINT32;
// <--
@@ -1147,8 +1147,8 @@ sal_Bool SwTxtFly::GetTop( const SwAnchoredObject* _pAnchoredObj,
// #102344# Ignore connectors which have one or more connections
if(pNew && pNew->ISA(SdrEdgeObj))
{
- if(((SdrEdgeObj*)pNew)->GetConnectedNode(TRUE)
- || ((SdrEdgeObj*)pNew)->GetConnectedNode(FALSE))
+ if(((SdrEdgeObj*)pNew)->GetConnectedNode(sal_True)
+ || ((SdrEdgeObj*)pNew)->GetConnectedNode(sal_False))
{
return sal_False;
}
@@ -1168,7 +1168,7 @@ sal_Bool SwTxtFly::GetTop( const SwAnchoredObject* _pAnchoredObj,
if ( bInFooterOrHeader )
{
SwFmtVertOrient aVert( rFrmFmt.GetVertOrient() );
- BOOL bVertPrt = aVert.GetRelationOrient() == text::RelOrientation::PRINT_AREA ||
+ sal_Bool bVertPrt = aVert.GetRelationOrient() == text::RelOrientation::PRINT_AREA ||
aVert.GetRelationOrient() == text::RelOrientation::PAGE_PRINT_AREA;
if( bVertPrt )
return sal_False;
@@ -1338,7 +1338,7 @@ sal_Bool SwTxtFly::GetTop( const SwAnchoredObject* _pAnchoredObj,
// Compare indices:
// Den Index des anderen erhalten wir immer ueber das Ankerattr.
- ULONG nTmpIndex = rNewA.GetCntntAnchor()->nNode.GetIndex();
+ sal_uLong nTmpIndex = rNewA.GetCntntAnchor()->nNode.GetIndex();
// Jetzt wird noch ueberprueft, ob der aktuelle Absatz vor dem
// Anker des verdraengenden Objekts im Text steht, dann wird
// nicht ausgewichen.
@@ -1797,7 +1797,7 @@ const SwRect SwContourCache::ContourRect( const SwFmt* pFmt,
pSdrObj[ 0 ] = pObj; // Wg. #37347 darf das Object erst nach dem
// GetContour() eingetragen werden.
pTextRanger[ 0 ] = new TextRanger( aPolyPolygon, pPolyPolygon, 20,
- (USHORT)rLRSpace.GetLeft(), (USHORT)rLRSpace.GetRight(),
+ (sal_uInt16)rLRSpace.GetLeft(), (sal_uInt16)rLRSpace.GetRight(),
pFmt->GetSurround().IsOutside(), sal_False, pFrm->IsVertical() );
pTextRanger[ 0 ]->SetUpper( rULSpace.GetUpper() );
pTextRanger[ 0 ]->SetLower( rULSpace.GetLower() );
@@ -1933,7 +1933,7 @@ void SwContourCache::ShowContour( OutputDevice* pOut, const SdrObject* pObj,
void SwTxtFly::ShowContour( OutputDevice* pOut )
{
MSHORT nFlyCount;
- if( bOn && ( 0 != ( nFlyCount = static_cast<USHORT>(GetAnchoredObjList()->size() ) ) ) )
+ if( bOn && ( 0 != ( nFlyCount = static_cast<sal_uInt16>(GetAnchoredObjList()->size() ) ) ) )
{
Color aRedColor( COL_LIGHTRED );
Color aGreenColor( COL_LIGHTGREEN );
diff --git a/sw/source/core/text/txtfly.hxx b/sw/source/core/text/txtfly.hxx
index 8c128c52c015..6bfb4e9afa0e 100644
--- a/sw/source/core/text/txtfly.hxx
+++ b/sw/source/core/text/txtfly.hxx
@@ -125,7 +125,7 @@ class SwTxtFly
long nMinBottom;
long nNextTop; // Hier wird die Oberkante des "naechsten" Rahmens gespeichert
- ULONG nIndex;
+ sal_uLong nIndex;
sal_Bool bOn : 1;
sal_Bool bLeftSide : 1;
sal_Bool bTopRule: 1;
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index e0f49a61fe3a..dbdf6bad8c9f 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -276,7 +276,7 @@ void SwLayoutModeModifier::Modify( sal_Bool bChgToRTL )
void SwLayoutModeModifier::SetAuto()
{
- const ULONG nNewLayoutMode = nOldLayoutMode & ~TEXT_LAYOUT_BIDI_STRONG;
+ const sal_uLong nNewLayoutMode = nOldLayoutMode & ~TEXT_LAYOUT_BIDI_STRONG;
((OutputDevice&)rOut).SetLayoutMode( nNewLayoutMode );
}
@@ -441,9 +441,9 @@ void SwTxtFrm::HideFootnotes( xub_StrLen nStart, xub_StrLen nEnd )
const SwpHints *pHints = GetTxtNode()->GetpSwpHints();
if( pHints )
{
- const USHORT nSize = pHints->Count();
+ const sal_uInt16 nSize = pHints->Count();
SwPageFrm *pPage = 0;
- for ( USHORT i = 0; i < nSize; ++i )
+ for ( sal_uInt16 i = 0; i < nSize; ++i )
{
const SwTxtAttr *pHt = (*pHints)[i];
if ( pHt->Which() == RES_TXTATR_FTN )
@@ -840,13 +840,13 @@ void lcl_SetWrong( SwTxtFrm& rFrm, xub_StrLen nPos, long nCnt, bool bMove )
if ( !pTxtNode->GetWrong() && !pTxtNode->IsWrongDirty() )
{
pTxtNode->SetWrong( new SwWrongList( WRONGLIST_SPELL ) );
- pTxtNode->GetWrong()->SetInvalid( nPos, nPos + (USHORT)( nCnt > 0 ? nCnt : 1 ) );
+ pTxtNode->GetWrong()->SetInvalid( nPos, nPos + (sal_uInt16)( nCnt > 0 ? nCnt : 1 ) );
}
if ( !pTxtNode->GetSmartTags() && !pTxtNode->IsSmartTagDirty() )
{
// SMARTTAGS
pTxtNode->SetSmartTags( new SwWrongList( WRONGLIST_SMARTTAG ) );
- pTxtNode->GetSmartTags()->SetInvalid( nPos, nPos + (USHORT)( nCnt > 0 ? nCnt : 1 ) );
+ pTxtNode->GetSmartTags()->SetInvalid( nPos, nPos + (sal_uInt16)( nCnt > 0 ? nCnt : 1 ) );
}
pTxtNode->SetWrongDirty( true );
pTxtNode->SetGrammarCheckDirty( true );
@@ -859,7 +859,7 @@ void lcl_SetWrong( SwTxtFrm& rFrm, xub_StrLen nPos, long nCnt, bool bMove )
SwRootFrm *pRootFrm = rFrm.getRootFrm();
if (pRootFrm)
{
- pRootFrm->SetNeedGrammarCheck( TRUE );
+ pRootFrm->SetNeedGrammarCheck( sal_True );
}
SwPageFrm *pPage = rFrm.FindPageFrm();
@@ -1485,7 +1485,7 @@ void SwTxtFrm::Prepare( const PrepareHint ePrep, const void* pVoid,
switch ( ePrep )
{
case PREP_BOSS_CHGD:
- SetInvalidVert( TRUE ); // Test
+ SetInvalidVert( sal_True ); // Test
case PREP_WIDOWS_ORPHANS:
case PREP_WIDOWS:
case PREP_FTN_GONE : return;
@@ -1531,7 +1531,7 @@ void SwTxtFrm::Prepare( const PrepareHint ePrep, const void* pVoid,
if( !HasPara() && PREP_MUST_FIT != ePrep )
{
- SetInvalidVert( TRUE ); // Test
+ SetInvalidVert( sal_True ); // Test
ASSERT( !IsLocked(), "SwTxtFrm::Prepare: three of a perfect pair" );
if ( bNotify )
InvalidateSize();
@@ -1611,9 +1611,9 @@ void SwTxtFrm::Prepare( const PrepareHint ePrep, const void* pVoid,
{
// Test
{
- SetInvalidVert( FALSE );
- BOOL bOld = IsVertical();
- SetInvalidVert( TRUE );
+ SetInvalidVert( sal_False );
+ sal_Bool bOld = IsVertical();
+ SetInvalidVert( sal_True );
if( bOld != IsVertical() )
InvalidateRange( SwCharRange( GetOfst(), STRING_LEN ) );
}
@@ -1638,10 +1638,10 @@ void SwTxtFrm::Prepare( const PrepareHint ePrep, const void* pVoid,
SwpHints *pHints = GetTxtNode()->GetpSwpHints();
if( pHints )
{
- const USHORT nSize = pHints->Count();
+ const sal_uInt16 nSize = pHints->Count();
const xub_StrLen nEnd = GetFollow() ?
GetFollow()->GetOfst() : STRING_LEN;
- for ( USHORT i = 0; i < nSize; ++i )
+ for ( sal_uInt16 i = 0; i < nSize; ++i )
{
const SwTxtAttr *pHt = (*pHints)[i];
const xub_StrLen nStart = *pHt->GetStart();
@@ -2195,7 +2195,7 @@ void SwTxtFrm::CalcAdditionalFirstLineOffset()
pTxtNode->GetNumRule() )
{
const SwNumFmt& rNumFmt =
- pTxtNode->GetNumRule()->Get( static_cast<USHORT>(pTxtNode->GetActualListLevel()) );
+ pTxtNode->GetNumRule()->Get( static_cast<sal_uInt16>(pTxtNode->GetActualListLevel()) );
if ( rNumFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT )
{
// keep current paragraph portion and apply dummy paragraph portion
@@ -2495,7 +2495,7 @@ void SwTxtFrm::ChgThisLines()
{
//not necassary to format here (GerFormatted etc.), because we have to come from there!
- ULONG nNew = 0;
+ sal_uLong nNew = 0;
const SwLineNumberInfo &rInf = GetNode()->getIDocumentLineNumberAccess()->GetLineNumberInfo();
if ( GetTxt().Len() && HasPara() )
{
@@ -2504,7 +2504,7 @@ void SwTxtFrm::ChgThisLines()
if ( rInf.IsCountBlankLines() )
{
aLine.Bottom();
- nNew = (ULONG)aLine.GetLineNr();
+ nNew = (sal_uLong)aLine.GetLineNr();
}
else
{
@@ -2556,9 +2556,9 @@ void SwTxtFrm::RecalcAllLines()
if ( !IsInTab() )
{
- const ULONG nOld = GetAllLines();
+ const sal_uLong nOld = GetAllLines();
const SwFmtLineNumber &rLineNum = pAttrSet->GetLineNumber();
- ULONG nNewNum;
+ sal_uLong nNewNum;
const bool bRestart = GetTxtNode()->getIDocumentLineNumberAccess()->GetLineNumberInfo().IsRestartEachPage();
if ( !IsFollow() && rLineNum.GetStartValue() && rLineNum.IsCount() )
diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx
index 74fa31f9237e..9a1fde88724a 100644
--- a/sw/source/core/text/txtftn.cxx
+++ b/sw/source/core/text/txtftn.cxx
@@ -116,7 +116,7 @@ void SwTxtFrm::CalcFtnFlag( xub_StrLen nStop )//Fuer den Test von SplitFrm
if( !pHints )
return;
- const USHORT nSize = pHints->Count();
+ const sal_uInt16 nSize = pHints->Count();
#ifndef DBG_UTIL
const xub_StrLen nEnd = GetFollow() ? GetFollow()->GetOfst() : STRING_LEN;
@@ -125,7 +125,7 @@ void SwTxtFrm::CalcFtnFlag( xub_StrLen nStop )//Fuer den Test von SplitFrm
: GetFollow() ? GetFollow()->GetOfst() : STRING_LEN;
#endif
- for ( USHORT i = 0; i < nSize; ++i )
+ for ( sal_uInt16 i = 0; i < nSize; ++i )
{
const SwTxtAttr *pHt = (*pHints)[i];
if ( pHt->Which() == RES_TXTATR_FTN )
@@ -226,7 +226,7 @@ SwTwips lcl_GetFtnLower( const SwTxtFrm* pFrm, SwTwips nLower )
ASSERT( pTabFrm && pRow &&
pRow->GetUpper()->IsTabFrm(), "Upper of row should be tab" )
- const BOOL bDontSplit = !pTabFrm->IsFollow() &&
+ const sal_Bool bDontSplit = !pTabFrm->IsFollow() &&
!pTabFrm->IsLayoutSplitAllowed();
SwTwips nMin = 0;
@@ -262,7 +262,7 @@ SwTwips lcl_GetFtnLower( const SwTxtFrm* pFrm, SwTwips nLower )
if ( pStartFrm->GetDrawObjs() )
{
const SwSortedObjs &rObjs = *pStartFrm->GetDrawObjs();
- for ( USHORT i = 0; i < rObjs.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i )
{
SwAnchoredObject* pAnchoredObj = rObjs[i];
SwRect aRect( pAnchoredObj->GetObjRect() );
@@ -450,7 +450,7 @@ void SwTxtFrm::RemoveFtn( const xub_StrLen nStart, const xub_StrLen nLen )
return;
sal_Bool bRollBack = nLen != STRING_LEN;
- USHORT nSize = pHints->Count();
+ sal_uInt16 nSize = pHints->Count();
xub_StrLen nEnd;
SwTxtFrm* pSource;
if( bRollBack )
@@ -474,7 +474,7 @@ void SwTxtFrm::RemoveFtn( const xub_StrLen nStart, const xub_StrLen nLen )
SwFtnBossFrm *pEndBoss = 0;
sal_Bool bFtnEndDoc
= FTNPOS_CHAPTER == GetNode()->GetDoc()->GetFtnInfo().ePos;
- for ( USHORT i = nSize; i; )
+ for ( sal_uInt16 i = nSize; i; )
{
SwTxtAttr *pHt = pHints->GetTextHint(--i);
if ( RES_TXTATR_FTN != pHt->Which() )
@@ -1160,7 +1160,7 @@ xub_StrLen SwTxtFormatter::FormatQuoVadis( const xub_StrLen nOffset )
pQuo->SetAscent( rInf.GetAscent() );
pQuo->Height( rInf.GetTxtHeight() );
pQuo->Format( rInf );
- USHORT nQuoWidth = pQuo->Width();
+ sal_uInt16 nQuoWidth = pQuo->Width();
SwLinePortion* pCurrPor = pQuo;
while ( rInf.GetRest() )
@@ -1239,12 +1239,12 @@ xub_StrLen SwTxtFormatter::FormatQuoVadis( const xub_StrLen nOffset )
if( nDiff < 0 )
{
nLastLeft = pQuo->GetAscent();
- nQuoWidth = (USHORT)(-nDiff + nLastLeft);
+ nQuoWidth = (sal_uInt16)(-nDiff + nLastLeft);
}
else
{
nQuoWidth = 0;
- nLastLeft = USHORT(( pQuo->GetAscent() + nDiff ) / 2);
+ nLastLeft = sal_uInt16(( pQuo->GetAscent() + nDiff ) / 2);
}
break;
}
@@ -1331,7 +1331,7 @@ public:
SwFtnSave( const SwTxtSizeInfo &rInf,
const SwTxtFtn *pTxtFtn,
const bool bApplyGivenScriptType,
- const BYTE nGivenScriptType );
+ const sal_uInt8 nGivenScriptType );
~SwFtnSave();
};
@@ -1342,7 +1342,7 @@ public:
SwFtnSave::SwFtnSave( const SwTxtSizeInfo &rInf,
const SwTxtFtn* pTxtFtn,
const bool bApplyGivenScriptType,
- const BYTE nGivenScriptType )
+ const sal_uInt8 nGivenScriptType )
: pInf( &((SwTxtSizeInfo&)rInf) )
, pFnt( 0 )
, pOld( 0 )
@@ -1500,7 +1500,7 @@ SwPosSize SwFtnPortion::GetTxtSize( const SwTxtSizeInfo &rInfo ) const
}
// --> OD 2009-01-29 #i98418#
-void SwFtnPortion::SetPreferredScriptType( BYTE nPreferredScriptType )
+void SwFtnPortion::SetPreferredScriptType( sal_uInt8 nPreferredScriptType )
{
mbPreferredScriptTypeSet = true;
mnPreferredScriptType = nPreferredScriptType;
@@ -1540,7 +1540,7 @@ sal_Bool SwQuoVadisPortion::Format( SwTxtFormatInfo &rInf )
SetLen( 0 );
if( bFull )
// dritter Versuch, es langt: jetzt wird gestaucht:
- Width( USHORT(rInf.Width() - rInf.X()) );
+ Width( sal_uInt16(rInf.Width() - rInf.X()) );
// 8317: keine mehrzeiligen Felder bei QuoVadis und ErgoSum
if( rInf.GetRest() )
diff --git a/sw/source/core/text/txthyph.cxx b/sw/source/core/text/txthyph.cxx
index 69b4bef4135a..ab1e9e96b3d3 100644
--- a/sw/source/core/text/txthyph.cxx
+++ b/sw/source/core/text/txthyph.cxx
@@ -666,7 +666,7 @@ sal_Bool SwSoftHyphPortion::GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTx
void SwSoftHyphPortion::HandlePortion( SwPortionHandler& rPH ) const
{
const String aString( '-' );
- const USHORT nWhich = ! Width() ?
+ const sal_uInt16 nWhich = ! Width() ?
POR_SOFTHYPH_COMP :
GetWhichPor();
rPH.Special( GetLen(), aString, nWhich );
diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx
index a86589b64851..4a715ba3b27b 100644
--- a/sw/source/core/text/txttab.cxx
+++ b/sw/source/core/text/txttab.cxx
@@ -76,7 +76,7 @@ const SvxTabStop *SwLineInfo::GetTabStop( const SwTwips nSearchPos,
* SwLineInfo::NumberOfTabStops()
*************************************************************************/
-USHORT SwLineInfo::NumberOfTabStops() const
+sal_uInt16 SwLineInfo::NumberOfTabStops() const
{
return pRuler->Count();
}
@@ -377,14 +377,14 @@ sal_Bool SwTabPortion::PreFormat( SwTxtFormatInfo &rInf )
ASSERT( rInf.X() <= GetTabPos(), "SwTabPortion::PreFormat: rush hour" );
// Hier lassen wir uns nieder...
- Fix( static_cast<USHORT>(rInf.X()) );
+ Fix( static_cast<sal_uInt16>(rInf.X()) );
const bool bTabCompat = rInf.GetTxtFrm()->GetTxtNode()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::TAB_COMPAT);
// Die Mindestbreite eines Tabs ist immer mindestens ein Blank
// --> FME 2004-11-25 #i37686# In compatibility mode, the minimum width
// should be 1, even for non-left tab stops.
- USHORT nMinimumTabWidth = 1;
+ sal_uInt16 nMinimumTabWidth = 1;
// <--
if ( !bTabCompat )
{
@@ -414,7 +414,7 @@ sal_Bool SwTabPortion::PreFormat( SwTxtFormatInfo &rInf )
rInf.Width() <= rInf.X() + PrtWidth();
// #95477# Rotated tab stops get the width of one blank
- const USHORT nDir = rInf.GetFont()->GetOrientation( rInf.GetTxtFrm()->IsVertical() );
+ const sal_uInt16 nDir = rInf.GetFont()->GetOrientation( rInf.GetTxtFrm()->IsVertical() );
if( ! bFull && 0 == nDir )
{
@@ -433,7 +433,7 @@ sal_Bool SwTabPortion::PreFormat( SwTxtFormatInfo &rInf )
}
case POR_TABLEFT:
{
- PrtWidth( static_cast<USHORT>(GetTabPos() - rInf.X()) );
+ PrtWidth( static_cast<sal_uInt16>(GetTabPos() - rInf.X()) );
bFull = rInf.Width() <= rInf.X() + PrtWidth();
// In tabulator compatibility mode, we reset the bFull flag
@@ -460,7 +460,7 @@ sal_Bool SwTabPortion::PreFormat( SwTxtFormatInfo &rInf )
!rInf.GetFly() )
// <--
{
- PrtWidth( static_cast<USHORT>(rInf.Width() - rInf.X()) );
+ PrtWidth( static_cast<sal_uInt16>(rInf.Width() - rInf.X()) );
SetFixWidth( PrtWidth() );
}
else
diff --git a/sw/source/core/text/widorp.cxx b/sw/source/core/text/widorp.cxx
index be69b19263e3..d5a45beb41d1 100644
--- a/sw/source/core/text/widorp.cxx
+++ b/sw/source/core/text/widorp.cxx
@@ -486,7 +486,7 @@ sal_Bool WidowsAndOrphans::FindWidows( SwTxtFrm *pFrame, SwTxtMargin &rLine )
// --> FME 2008-09-16 #i91421#
if ( !pMaster->GetIndPrev() )
{
- ULONG nLines = pMaster->GetThisLines();
+ sal_uLong nLines = pMaster->GetThisLines();
if(nLines == 0 && pMaster->HasPara())
{
const SwParaPortion *pMasterPara = pMaster->GetPara();
diff --git a/sw/source/core/text/wrong.cxx b/sw/source/core/text/wrong.cxx
index 6029b6c84aeb..152ed79b0cef 100644
--- a/sw/source/core/text/wrong.cxx
+++ b/sw/source/core/text/wrong.cxx
@@ -470,7 +470,7 @@ void SwWrongList::JoinList( SwWrongList* pNext, xub_StrLen nInsertPos )
}
if( pNext )
{
- USHORT nCnt = Count();
+ sal_uInt16 nCnt = Count();
pNext->Move( 0, nInsertPos );
Insert(nCnt, pNext->maList.begin(), pNext->maList.end());
@@ -498,7 +498,7 @@ void SwWrongList::JoinList( SwWrongList* pNext, xub_StrLen nInsertPos )
}
-void SwWrongList::InsertSubList( xub_StrLen nNewPos, xub_StrLen nNewLen, USHORT nWhere, SwWrongList* pSubList )
+void SwWrongList::InsertSubList( xub_StrLen nNewPos, xub_StrLen nNewLen, sal_uInt16 nWhere, SwWrongList* pSubList )
{
if (pSubList)
{
@@ -514,7 +514,7 @@ void SwWrongList::InsertSubList( xub_StrLen nNewPos, xub_StrLen nNewLen, USHORT
// New functions: Necessary because SwWrongList has been changed to use std::vector
-void SwWrongList::Insert(USHORT nWhere, std::vector<SwWrongArea>::iterator startPos, std::vector<SwWrongArea>::iterator endPos)
+void SwWrongList::Insert(sal_uInt16 nWhere, std::vector<SwWrongArea>::iterator startPos, std::vector<SwWrongArea>::iterator endPos)
{
std::vector<SwWrongArea>::iterator i = maList.begin();
if ( nWhere >= maList.size() )
@@ -532,14 +532,14 @@ void SwWrongList::Insert(USHORT nWhere, std::vector<SwWrongArea>::iterator start
}
}
-void SwWrongList::Remove(USHORT nIdx, USHORT nLen )
+void SwWrongList::Remove(sal_uInt16 nIdx, sal_uInt16 nLen )
{
if ( nIdx >= maList.size() ) return;
std::vector<SwWrongArea>::iterator i1 = maList.begin();
i1 += nIdx;
std::vector<SwWrongArea>::iterator i2 = i1;
- if ( nIdx + nLen >= static_cast<USHORT>(maList.size()) )
+ if ( nIdx + nLen >= static_cast<sal_uInt16>(maList.size()) )
i2 = maList.end(); // robust
else
i2 += nLen;
@@ -565,8 +565,8 @@ void SwWrongList::Remove(USHORT nIdx, USHORT nLen )
}
void SwWrongList::RemoveEntry( xub_StrLen nBegin, xub_StrLen nEnd ) {
- USHORT nDelPos = 0;
- USHORT nDel = 0;
+ sal_uInt16 nDelPos = 0;
+ sal_uInt16 nDel = 0;
std::vector<SwWrongArea>::iterator aIter = maList.begin();
while( aIter != maList.end() && (*aIter).mnPos < nBegin )
{
diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx
index 28a41ea7d364..152432de4d75 100644
--- a/sw/source/core/tox/tox.cxx
+++ b/sw/source/core/tox/tox.cxx
@@ -59,16 +59,16 @@ const sal_Char* SwForm::aFormEntryTxt = "<ET>";
const sal_Char* SwForm::aFormChapterMark= "<C>";
const sal_Char* SwForm::aFormText = "<X>";
const sal_Char* SwForm::aFormAuth = "<A>";
-BYTE SwForm::nFormTabLen = 3;
-BYTE SwForm::nFormEntryLen = 3;
-BYTE SwForm::nFormPageNumsLen = 3;
-BYTE SwForm::nFormLinkSttLen = 4;
-BYTE SwForm::nFormLinkEndLen = 4;
-BYTE SwForm::nFormEntryNumLen = 4;
-BYTE SwForm::nFormEntryTxtLen = 4;
-BYTE SwForm::nFormChapterMarkLen = 3;
-BYTE SwForm::nFormTextLen = 3;
-BYTE SwForm::nFormAuthLen = 5;
+sal_uInt8 SwForm::nFormTabLen = 3;
+sal_uInt8 SwForm::nFormEntryLen = 3;
+sal_uInt8 SwForm::nFormPageNumsLen = 3;
+sal_uInt8 SwForm::nFormLinkSttLen = 4;
+sal_uInt8 SwForm::nFormLinkEndLen = 4;
+sal_uInt8 SwForm::nFormEntryNumLen = 4;
+sal_uInt8 SwForm::nFormEntryTxtLen = 4;
+sal_uInt8 SwForm::nFormChapterMarkLen = 3;
+sal_uInt8 SwForm::nFormTextLen = 3;
+sal_uInt8 SwForm::nFormAuthLen = 5;
SV_IMPL_PTRARR(SwTOXMarks, SwTOXMark*)
@@ -76,11 +76,11 @@ TYPEINIT2( SwTOXMark, SfxPoolItem, SwClient ); // fuers rtti
struct PatternIni
{
- USHORT n1;
- USHORT n2;
- USHORT n3;
- USHORT n4;
- USHORT n5;
+ sal_uInt16 n1;
+ sal_uInt16 n2;
+ sal_uInt16 n3;
+ sal_uInt16 n4;
+ sal_uInt16 n5;
};
const PatternIni aPatternIni[] =
{
@@ -116,12 +116,20 @@ 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}
};
+<<<<<<< local
SwFormTokens lcl_GetAuthPattern(USHORT nTypeId)
+=======
+/* -----------------23.09.99 13:58-------------------
+
+ --------------------------------------------------*/
+// -> #i21237#
+SwFormTokens lcl_GetAuthPattern(sal_uInt16 nTypeId)
+>>>>>>> other
{
SwFormTokens aRet;
PatternIni aIni = aPatternIni[nTypeId];
- USHORT nVals[5];
+ sal_uInt16 nVals[5];
nVals[0] = aIni.n1;
nVals[1] = aIni.n2;
nVals[2] = aIni.n3;
@@ -137,7 +145,7 @@ SwFormTokens lcl_GetAuthPattern(USHORT nTypeId)
SwFormToken aTextToken( TOKEN_TEXT );
aTextToken.sText = String::CreateFromAscii( ", " );
- for(USHORT i = 0; i < 5 ; i++)
+ for(sal_uInt16 i = 0; i < 5 ; i++)
{
if(nVals[i] == USHRT_MAX)
break;
@@ -165,8 +173,8 @@ SwTOXMark::SwTOXMark()
, SwModify( 0 )
,
pTxtAttr( 0 ),
- bAutoGenerated(FALSE),
- bMainEntry(FALSE)
+ bAutoGenerated(sal_False),
+ bMainEntry(sal_False)
{
}
@@ -176,8 +184,8 @@ SwTOXMark::SwTOXMark( const SwTOXType* pTyp )
, SwModify( const_cast<SwTOXType*>(pTyp) )
,
pTxtAttr( 0 ), nLevel( 0 ),
- bAutoGenerated(FALSE),
- bMainEntry(FALSE)
+ bAutoGenerated(sal_False),
+ bMainEntry(sal_False)
{
}
@@ -294,18 +302,18 @@ SwTOXType::SwTOXType(const SwTOXType& rCopy)
SwForm::SwForm( TOXTypes eTyp ) // #i21237#
: eType( eTyp ), nFormMaxLevel( SwForm::GetFormMaxLevel( eTyp )),
// nFirstTabPos( lNumIndent ),
- bCommaSeparated(FALSE)
+ bCommaSeparated(sal_False)
{
//bHasFirstTabPos =
- bGenerateTabPos = FALSE;
- bIsRelTabPos = TRUE;
+ bGenerateTabPos = sal_False;
+ bIsRelTabPos = sal_True;
// Inhaltsverzeichnis hat entsprechend Anzahl Headlines + Ueberschrift
// Benutzer hat 10 Ebenen + Ueberschrift
// Stichwort hat 3 Ebenen + Ueberschrift + Trenner
// indexes of tables, objects illustrations and authorities consist of a heading and one level
- USHORT nPoolId;
+ sal_uInt16 nPoolId;
switch( eType )
{
case TOX_INDEX: nPoolId = STR_POOLCOLL_TOX_IDXH; break;
@@ -347,7 +355,7 @@ SwForm::SwForm( TOXTypes eTyp ) // #i21237#
if(TOX_INDEX == eType)
{
- for( USHORT i = 1; i < 5; ++i )
+ for( sal_uInt16 i = 1; i < 5; ++i )
{
if(1 == i)
{
@@ -366,7 +374,7 @@ SwForm::SwForm( TOXTypes eTyp ) // #i21237#
}
}
else
- for( USHORT i = 1; i < GetFormMax(); ++i, ++nPoolId ) // Nr 0 ist der Titel
+ for( sal_uInt16 i = 1; i < GetFormMax(); ++i, ++nPoolId ) // Nr 0 ist der Titel
{
if(TOX_AUTHORITIES == eType)
SetPattern(i, lcl_GetAuthPattern(i));
@@ -400,7 +408,7 @@ SwForm& SwForm::operator=(const SwForm& rForm)
bGenerateTabPos = rForm.bGenerateTabPos;
bIsRelTabPos = rForm.bIsRelTabPos;
bCommaSeparated = rForm.bCommaSeparated;
- for(USHORT i=0; i < nFormMaxLevel; ++i)
+ for(sal_uInt16 i=0; i < nFormMaxLevel; ++i)
{
aPattern[i] = rForm.aPattern[i];
aTemplate[i] = rForm.aTemplate[i];
@@ -408,9 +416,9 @@ SwForm& SwForm::operator=(const SwForm& rForm)
return *this;
}
-USHORT SwForm::GetFormMaxLevel( TOXTypes eTOXType )
+sal_uInt16 SwForm::GetFormMaxLevel( TOXTypes eTOXType )
{
- USHORT nRet = 0;
+ sal_uInt16 nRet = 0;
switch( eTOXType )
{
case TOX_INDEX: nRet = 5; break;
@@ -431,34 +439,34 @@ bool operator == (const SwFormToken & rToken, FormTokenType eType)
}
//-----------------------------------------------------------------------------
-void SwForm::AdjustTabStops(SwDoc& rDoc, BOOL bInsertNewTapStops) // #i21237#
+void SwForm::AdjustTabStops(SwDoc& rDoc, sal_Bool bInsertNewTapStops) // #i21237#
{
- for(USHORT nLevel = 1; nLevel < GetFormMax(); nLevel++)
+ for(sal_uInt16 nLevel = 1; nLevel < GetFormMax(); nLevel++)
{
const String& sTemplateName = GetTemplate(nLevel);
SwTxtFmtColl* pColl = rDoc.FindTxtFmtCollByName( sTemplateName );
if( !pColl )
{
- USHORT nId = SwStyleNameMapper::GetPoolIdFromUIName
+ sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName
( sTemplateName, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL ); // #i21237#
if( USHRT_MAX != nId )
pColl = rDoc.GetTxtCollFromPool( nId );
}
const SvxTabStopItem* pTabStops = 0;
- USHORT nTabCount = 0;
+ sal_uInt16 nTabCount = 0;
if( pColl &&
- 0 != ( pTabStops = &pColl->GetTabStops(FALSE) ) &&
+ 0 != ( pTabStops = &pColl->GetTabStops(sal_False) ) &&
0 != ( nTabCount = pTabStops->Count() ) )
{
// #i21237#
SwFormTokens aCurrentPattern = GetPattern(nLevel);
SwFormTokens::iterator aIt = aCurrentPattern.begin();
- BOOL bChanged = FALSE;
+ sal_Bool bChanged = sal_False;
- for(USHORT nTab = 0; nTab < nTabCount; ++nTab)
+ for(sal_uInt16 nTab = 0; nTab < nTabCount; ++nTab)
{
const SvxTabStop& rTab = (*pTabStops)[nTab];
@@ -469,9 +477,9 @@ void SwForm::AdjustTabStops(SwDoc& rDoc, BOOL bInsertNewTapStops) // #i21237#
{
if ( SVX_TAB_ADJUST_DEFAULT != rTab.GetAdjustment() )
{
- bChanged = TRUE;
+ bChanged = sal_True;
SwFormToken aToken(TOKEN_TAB_STOP);
- aToken.bWithTab = FALSE;
+ aToken.bWithTab = sal_False;
aToken.nTabStopPosition = rTab.GetTabPos();
aToken.eTabAlign = rTab.GetAdjustment();
aToken.cTabFillChar = rTab.GetFill();
@@ -486,7 +494,7 @@ void SwForm::AdjustTabStops(SwDoc& rDoc, BOOL bInsertNewTapStops) // #i21237#
(TOKEN_TAB_STOP));
if ( aIt != aCurrentPattern.end() )
{
- bChanged = TRUE;
+ bChanged = sal_True;
aIt->nTabStopPosition = rTab.GetTabPos();
aIt->eTabAlign = nTab == nTabCount - 1 &&
SVX_TAB_ADJUST_RIGHT == rTab.GetAdjustment() ?
@@ -512,7 +520,7 @@ void SwForm::AdjustTabStops(SwDoc& rDoc, BOOL bInsertNewTapStops) // #i21237#
SwTOXBase::SwTOXBase(const SwTOXType* pTyp, const SwForm& rForm,
- USHORT nCreaType, const String& rTitle )
+ sal_uInt16 nCreaType, const String& rTitle )
: SwClient((SwModify*)pTyp),
aForm(rForm),
aTitle(rTitle),
@@ -520,10 +528,10 @@ SwTOXBase::SwTOXBase(const SwTOXType* pTyp, const SwForm& rForm,
nCreateType(nCreaType),
nOLEOptions(0),
eCaptionDisplay(CAPTION_COMPLETE),
- bProtected( TRUE ),
- bFromChapter(FALSE),
- bFromObjectNames(FALSE),
- bLevelFromChapter(FALSE)
+ bProtected( sal_True ),
+ bFromChapter(sal_False),
+ bFromObjectNames(sal_False),
+ bLevelFromChapter(sal_False)
{
aData.nOptions = 0;
}
@@ -547,15 +555,15 @@ SwTOXBase& SwTOXBase::CopyTOXBase( SwDoc* pDoc, const SwTOXBase& rSource )
{
// type not in pDoc, so create it now
const SwTOXTypes& rTypes = pDoc->GetTOXTypes();
- BOOL bFound = FALSE;
- for( USHORT n = rTypes.Count(); n; )
+ sal_Bool bFound = sal_False;
+ for( sal_uInt16 n = rTypes.Count(); n; )
{
const SwTOXType* pCmp = rTypes[ --n ];
if( pCmp->GetType() == pType->GetType() &&
pCmp->GetTypeName() == pType->GetTypeName() )
{
pType = (SwTOXType*)pCmp;
- bFound = TRUE;
+ bFound = sal_True;
break;
}
}
@@ -578,7 +586,7 @@ SwTOXBase& SwTOXBase::CopyTOXBase( SwDoc* pDoc, const SwTOXBase& rSource )
eLanguage = rSource.eLanguage;
sSortAlgorithm = rSource.sSortAlgorithm;
- for( USHORT i = 0; i < MAXLEVEL; ++i )
+ for( sal_uInt16 i = 0; i < MAXLEVEL; ++i )
aStyleNames[i] = rSource.aStyleNames[i];
// its the same data type!
@@ -615,7 +623,7 @@ SwTOXBase & SwTOXBase::operator = (const SwTOXBase & rSource)
aName = rSource.aName;
aTitle = rSource.aTitle;
sMainEntryCharStyle = rSource.sMainEntryCharStyle;
- for(USHORT nLevel = 0; nLevel < MAXLEVEL; nLevel++)
+ for(sal_uInt16 nLevel = 0; nLevel < MAXLEVEL; nLevel++)
aStyleNames[nLevel] = rSource.aStyleNames[nLevel];
sSequenceName = rSource.sSequenceName;
eLanguage = rSource.eLanguage;
@@ -667,7 +675,7 @@ String SwFormToken::GetString() const
{
String sRet;
- BOOL bAppend = TRUE;
+ sal_Bool bAppend = sal_True;
switch( eTokenType )
{
case TOKEN_ENTRY_NO:
@@ -746,7 +754,7 @@ String SwFormToken::GetString() const
sRet += TOX_STYLE_DELIMITER;
}
else
- bAppend = FALSE;
+ bAppend = sal_False;
}
else if(TOKEN_ENTRY_NO == eTokenType)
{
@@ -803,16 +811,16 @@ SwFormToken SwFormTokensHelper::BuildToken( const String & sPattern,
eRet.sCharStyleName = sToken.GetToken( 0, ',');
String sTmp( sToken.GetToken( 1, ',' ));
if( sTmp.Len() )
- eRet.nPoolId = static_cast<USHORT>(sTmp.ToInt32());
+ eRet.nPoolId = static_cast<sal_uInt16>(sTmp.ToInt32());
switch( eTokenType )
{
//i53420
case TOKEN_ENTRY_NO:
if( (sTmp = sToken.GetToken( 2, ',' ) ).Len() )
- eRet.nChapterFormat = static_cast<USHORT>(sTmp.ToInt32());
+ eRet.nChapterFormat = static_cast<sal_uInt16>(sTmp.ToInt32());
if( (sTmp = sToken.GetToken( 3, ',' ) ).Len() )
- eRet.nOutlineLevel = static_cast<USHORT>(sTmp.ToInt32()); //the maximum outline level to examine
+ eRet.nOutlineLevel = static_cast<sal_uInt16>(sTmp.ToInt32()); //the maximum outline level to examine
break;
case TOKEN_TEXT:
@@ -847,15 +855,15 @@ SwFormToken SwFormTokensHelper::BuildToken( const String & sPattern,
case TOKEN_CHAPTER_INFO:
if( (sTmp = sToken.GetToken( 2, ',' ) ).Len() )
- eRet.nChapterFormat = static_cast<USHORT>(sTmp.ToInt32()); //SwChapterFormat;
+ eRet.nChapterFormat = static_cast<sal_uInt16>(sTmp.ToInt32()); //SwChapterFormat;
//i53420
if( (sTmp = sToken.GetToken( 3, ',' ) ).Len() )
- eRet.nOutlineLevel = static_cast<USHORT>(sTmp.ToInt32()); //the maximum outline level to examine
+ eRet.nOutlineLevel = static_cast<sal_uInt16>(sTmp.ToInt32()); //the maximum outline level to examine
break;
case TOKEN_AUTHORITY:
- eRet.nAuthorityField = static_cast<USHORT>(sAuthFieldEnum.ToInt32());
+ eRet.nAuthorityField = static_cast<sal_uInt16>(sAuthFieldEnum.ToInt32());
break;
default: break;
}
@@ -866,7 +874,7 @@ String SwFormTokensHelper::SearchNextToken( const String & sPattern,
xub_StrLen nStt ) const
{
//it's not so easy - it doesn't work if the text part contains a '>'
- //USHORT nTokenEnd = sPattern.Search('>');
+ //sal_uInt16 nTokenEnd = sPattern.Search('>');
String aResult;
@@ -901,8 +909,8 @@ FormTokenType SwFormTokensHelper::GetTokenType(const String & sToken,
static struct
{
const sal_Char* pNm;
- USHORT nLen;
- USHORT nOffset;
+ sal_uInt16 nLen;
+ sal_uInt16 nOffset;
FormTokenType eToken;
} __READONLY_DATA aTokenArr[] = {
{ SwForm::aFormTab, SwForm::nFormEntryLen, 1, TOKEN_TAB_STOP },
@@ -939,13 +947,13 @@ FormTokenType SwFormTokensHelper::GetTokenType(const String & sToken,
// <- #i21237#
-void SwForm::SetPattern(USHORT nLevel, const SwFormTokens& rTokens)
+void SwForm::SetPattern(sal_uInt16 nLevel, const SwFormTokens& rTokens)
{
ASSERT(nLevel < GetFormMax(), "Index >= FORM_MAX");
aPattern[nLevel] = rTokens;
}
-void SwForm::SetPattern(USHORT nLevel, const String & rStr)
+void SwForm::SetPattern(sal_uInt16 nLevel, const String & rStr)
{
ASSERT(nLevel < GetFormMax(), "Index >= FORM_MAX");
@@ -953,7 +961,7 @@ void SwForm::SetPattern(USHORT nLevel, const String & rStr)
aPattern[nLevel] = aHelper.GetTokens();
}
-const SwFormTokens& SwForm::GetPattern(USHORT nLevel) const
+const SwFormTokens& SwForm::GetPattern(sal_uInt16 nLevel) const
{
ASSERT(nLevel < GetFormMax(), "Index >= FORM_MAX");
return aPattern[nLevel];
diff --git a/sw/source/core/tox/toxhlp.cxx b/sw/source/core/tox/toxhlp.cxx
index f119bf5a5540..be86709adcd2 100644
--- a/sw/source/core/tox/toxhlp.cxx
+++ b/sw/source/core/tox/toxhlp.cxx
@@ -99,7 +99,7 @@ String IndexEntrySupplierWrapper::GetIndexKey( const String& rTxt,
return sRet;
}
-String IndexEntrySupplierWrapper::GetFollowingText( BOOL bMorePages ) const
+String IndexEntrySupplierWrapper::GetFollowingText( sal_Bool bMorePages ) const
{
String sRet;
try {
diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx
index a5bf52ebc4b0..38b143db6825 100644
--- a/sw/source/core/tox/txmsrt.cxx
+++ b/sw/source/core/tox/txmsrt.cxx
@@ -54,7 +54,7 @@
#include <comcore.hrc>
#include <numrule.hxx>
-extern BOOL IsFrameBehind( const SwTxtNode& rMyNd, xub_StrLen nMySttPos,
+extern sal_Bool IsFrameBehind( const SwTxtNode& rMyNd, xub_StrLen nMySttPos,
const SwTxtNode& rBehindNd, xub_StrLen nSttPos );
using namespace ::com::sun::star;
@@ -64,12 +64,12 @@ using ::rtl::OUString;
Beschreibung: Strings initialisieren
--------------------------------------------------------------------*/
-USHORT SwTOXSortTabBase::nOpt = 0;
+sal_uInt16 SwTOXSortTabBase::nOpt = 0;
SV_IMPL_VARARR( SwTOXSources, SwTOXSource )
-SwTOXInternational::SwTOXInternational( LanguageType nLang, USHORT nOpt,
+SwTOXInternational::SwTOXInternational( LanguageType nLang, sal_uInt16 nOpt,
const String& rSortAlgorithm ) :
eLang( nLang ),
sSortAlgorithm(rSortAlgorithm),
@@ -119,7 +119,7 @@ String SwTOXInternational::ToUpper( const String& rStr, xub_StrLen nPos ) const
{
return pCharClass->toUpper( rStr, nPos, 1 );
}
-inline BOOL SwTOXInternational::IsNumeric( const String& rStr ) const
+inline sal_Bool SwTOXInternational::IsNumeric( const String& rStr ) const
{
return pCharClass->isNumeric( rStr );
}
@@ -139,7 +139,7 @@ String SwTOXInternational::GetIndexKey( const String& rTxt, const String& rTxtRe
return pIndexWrapper->GetIndexKey( rTxt, rTxtReading, rLocale );
}
-String SwTOXInternational::GetFollowingText( BOOL bMorePages ) const
+String SwTOXInternational::GetFollowingText( sal_Bool bMorePages ) const
{
return pIndexWrapper->GetFollowingText( bMorePages );
}
@@ -154,7 +154,7 @@ SwTOXSortTabBase::SwTOXSortTabBase( TOXSortType nTyp, const SwCntntNode* pNd,
const SwTOXInternational* pInter,
const lang::Locale* pLocale )
: pTOXNd( 0 ), pTxtMark( pMark ), pTOXIntl( pInter ),
- nPos( 0 ), nCntPos( 0 ), nType( static_cast<USHORT>(nTyp) ), bValidTxt( FALSE )
+ nPos( 0 ), nCntPos( 0 ), nType( static_cast<sal_uInt16>(nTyp) ), bValidTxt( sal_False )
{
if ( pLocale )
aLocale = *pLocale;
@@ -165,7 +165,7 @@ SwTOXSortTabBase::SwTOXSortTabBase( TOXSortType nTyp, const SwCntntNode* pNd,
if( pTxtMark )
n = *pTxtMark->GetStart();
SwTOXSource aTmp( pNd, n,
- pTxtMark ? pTxtMark->GetTOXMark().IsMainEntry() : FALSE );
+ pTxtMark ? pTxtMark->GetTOXMark().IsMainEntry() : sal_False );
aTOXSources.Insert( aTmp, aTOXSources.Count() );
nPos = pNd->GetIndex();
@@ -181,7 +181,11 @@ SwTOXSortTabBase::SwTOXSortTabBase( TOXSortType nTyp, const SwCntntNode* pNd,
{
// dann die "Anker" (Body) Position holen.
Point aPt;
+<<<<<<< local
const SwCntntFrm* pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), &aPt, 0, FALSE );
+=======
+ const SwCntntFrm* pFrm = pNd->GetFrm( &aPt, 0, sal_False );
+>>>>>>> other
if( pFrm )
{
SwPosition aPos( *pNd );
@@ -211,7 +215,7 @@ String SwTOXSortTabBase::GetURL() const
}
void SwTOXSortTabBase::FillText( SwTxtNode& rNd, const SwIndex& rInsPos,
- USHORT ) const
+ sal_uInt16 ) const
{
String sMyTxt;
String sMyTxtReading;
@@ -221,9 +225,9 @@ void SwTOXSortTabBase::FillText( SwTxtNode& rNd, const SwIndex& rInsPos,
rNd.InsertText( sMyTxt, rInsPos );
}
-BOOL SwTOXSortTabBase::operator==( const SwTOXSortTabBase& rCmp )
+sal_Bool SwTOXSortTabBase::operator==( const SwTOXSortTabBase& rCmp )
{
- BOOL bRet = nPos == rCmp.nPos && nCntPos == rCmp.nCntPos &&
+ sal_Bool bRet = nPos == rCmp.nPos && nCntPos == rCmp.nCntPos &&
(!aTOXSources[0].pNd || !rCmp.aTOXSources[0].pNd ||
aTOXSources[0].pNd == rCmp.aTOXSources[0].pNd );
@@ -255,15 +259,15 @@ BOOL SwTOXSortTabBase::operator==( const SwTOXSortTabBase& rCmp )
return bRet;
}
-BOOL SwTOXSortTabBase::operator<( const SwTOXSortTabBase& rCmp )
+sal_Bool SwTOXSortTabBase::operator<( const SwTOXSortTabBase& rCmp )
{
if( nPos < rCmp.nPos )
- return TRUE;
+ return sal_True;
if( nPos == rCmp.nPos )
{
if( nCntPos < rCmp.nCntPos )
- return TRUE;
+ return sal_True;
if( nCntPos == rCmp.nCntPos )
{
@@ -275,7 +279,7 @@ BOOL SwTOXSortTabBase::operator<( const SwTOXSortTabBase& rCmp )
if( TOX_SORT_CONTENT == nType && pTxtMark && rCmp.pTxtMark )
{
if( *pTxtMark->GetStart() < *rCmp.pTxtMark->GetStart() )
- return TRUE;
+ return sal_True;
if( *pTxtMark->GetStart() == *rCmp.pTxtMark->GetStart() )
{
@@ -297,7 +301,7 @@ BOOL SwTOXSortTabBase::operator<( const SwTOXSortTabBase& rCmp )
sOtherTxt, sOtherTxtReading, rCmp.GetLocale() );
if( pEnd && !pEndCmp )
- return TRUE;
+ return sal_True;
}
}
}
@@ -307,7 +311,7 @@ BOOL SwTOXSortTabBase::operator<( const SwTOXSortTabBase& rCmp )
*(SwTxtNode*)pFirst, nCntPos );
}
}
- return FALSE;
+ return sal_False;
}
/*--------------------------------------------------------------------
@@ -316,8 +320,8 @@ BOOL SwTOXSortTabBase::operator<( const SwTOXSortTabBase& rCmp )
SwTOXIndex::SwTOXIndex( const SwTxtNode& rNd,
- const SwTxtTOXMark* pMark, USHORT nOptions,
- BYTE nKyLevel,
+ const SwTxtTOXMark* pMark, sal_uInt16 nOptions,
+ sal_uInt8 nKyLevel,
const SwTOXInternational& rIntl,
const lang::Locale& rLocale )
: SwTOXSortTabBase( TOX_SORT_INDEX, &rNd, pMark, &rIntl, &rLocale ),
@@ -332,13 +336,13 @@ SwTOXIndex::SwTOXIndex( const SwTxtNode& rNd,
//
-BOOL SwTOXIndex::operator==( const SwTOXSortTabBase& rCmpBase )
+sal_Bool SwTOXIndex::operator==( const SwTOXSortTabBase& rCmpBase )
{
SwTOXIndex& rCmp = (SwTOXIndex&)rCmpBase;
// In Abhaengigkeit von den Optionen Grosskleinschreibung beachten
if(GetLevel() != rCmp.GetLevel() || nKeyLevel != rCmp.nKeyLevel)
- return FALSE;
+ return sal_False;
ASSERT(pTxtMark, "pTxtMark == 0, Kein Stichwort");
@@ -350,7 +354,7 @@ BOOL SwTOXIndex::operator==( const SwTOXSortTabBase& rCmpBase )
String sOtherTxtReading;
rCmp.GetTxt( sOtherTxt, sOtherTxtReading );
- BOOL bRet = pTOXIntl->IsEqual( sMyTxt, sMyTxtReading, GetLocale(),
+ sal_Bool bRet = pTOXIntl->IsEqual( sMyTxt, sMyTxtReading, GetLocale(),
sOtherTxt, sOtherTxtReading, rCmp.GetLocale() );
// Wenn nicht zusammengefasst wird muss die Pos aus gewertet werden
@@ -366,7 +370,7 @@ BOOL SwTOXIndex::operator==( const SwTOXSortTabBase& rCmpBase )
//
-BOOL SwTOXIndex::operator<( const SwTOXSortTabBase& rCmpBase )
+sal_Bool SwTOXIndex::operator<( const SwTOXSortTabBase& rCmpBase )
{
SwTOXIndex& rCmp = (SwTOXIndex&)rCmpBase;
@@ -380,7 +384,7 @@ BOOL SwTOXIndex::operator<( const SwTOXSortTabBase& rCmpBase )
String sOtherTxtReading;
rCmp.GetTxt( sOtherTxt, sOtherTxtReading );
- BOOL bRet = GetLevel() == rCmp.GetLevel() &&
+ sal_Bool bRet = GetLevel() == rCmp.GetLevel() &&
pTOXIntl->IsLess( sMyTxt, sMyTxtReading, GetLocale(),
sOtherTxt, sOtherTxtReading, rCmp.GetLocale() );
@@ -434,7 +438,7 @@ void SwTOXIndex::GetText_Impl( String& rTxt, String& rTxtReading ) const
}
}
-void SwTOXIndex::FillText( SwTxtNode& rNd, const SwIndex& rInsPos, USHORT ) const
+void SwTOXIndex::FillText( SwTxtNode& rNd, const SwIndex& rInsPos, sal_uInt16 ) const
{
const xub_StrLen* pEnd = pTxtMark->GetEnd();
String sTmp;
@@ -459,11 +463,11 @@ void SwTOXIndex::FillText( SwTxtNode& rNd, const SwIndex& rInsPos, USHORT ) cons
-USHORT SwTOXIndex::GetLevel() const
+sal_uInt16 SwTOXIndex::GetLevel() const
{
ASSERT(pTxtMark, "pTxtMark == 0, Kein Stichwort");
- USHORT nForm = FORM_PRIMARY_KEY;
+ sal_uInt16 nForm = FORM_PRIMARY_KEY;
if( 0 == (GetOptions() & nsSwTOIOptions::TOI_KEY_AS_ENTRY)&&
pTxtMark->GetTOXMark().GetPrimaryKey().Len() )
@@ -481,7 +485,7 @@ USHORT SwTOXIndex::GetLevel() const
SwTOXCustom::SwTOXCustom(const String& rStr, const String& rReading,
- USHORT nLevel,
+ sal_uInt16 nLevel,
const SwTOXInternational& rIntl,
const lang::Locale& rLocale )
: SwTOXSortTabBase( TOX_SORT_CUSTOM, 0, 0, &rIntl, &rLocale ),
@@ -490,7 +494,7 @@ SwTOXCustom::SwTOXCustom(const String& rStr, const String& rReading,
}
-BOOL SwTOXCustom::operator==(const SwTOXSortTabBase& rCmpBase)
+sal_Bool SwTOXCustom::operator==(const SwTOXSortTabBase& rCmpBase)
{
String sMyTxt;
String sMyTxtReading;
@@ -506,7 +510,7 @@ BOOL SwTOXCustom::operator==(const SwTOXSortTabBase& rCmpBase)
}
-BOOL SwTOXCustom::operator < (const SwTOXSortTabBase& rCmpBase)
+sal_Bool SwTOXCustom::operator < (const SwTOXSortTabBase& rCmpBase)
{
String sMyTxt;
String sMyTxtReading;
@@ -522,7 +526,7 @@ BOOL SwTOXCustom::operator < (const SwTOXSortTabBase& rCmpBase)
}
-USHORT SwTOXCustom::GetLevel() const
+sal_uInt16 SwTOXCustom::GetLevel() const
{
return nLev;
}
@@ -566,7 +570,7 @@ void SwTOXContent::GetText_Impl( String& rTxt, String& rTxtReading ) const
rTxt = pTxtMark->GetTOXMark().GetAlternativeText();
}
-void SwTOXContent::FillText( SwTxtNode& rNd, const SwIndex& rInsPos, USHORT ) const
+void SwTOXContent::FillText( SwTxtNode& rNd, const SwIndex& rInsPos, sal_uInt16 ) const
{
const xub_StrLen* pEnd = pTxtMark->GetEnd();
if( pEnd && !pTxtMark->GetTOXMark().IsAlternativeText() )
@@ -586,7 +590,7 @@ void SwTOXContent::FillText( SwTxtNode& rNd, const SwIndex& rInsPos, USHORT ) co
//
-USHORT SwTOXContent::GetLevel() const
+sal_uInt16 SwTOXContent::GetLevel() const
{
return pTxtMark->GetTOXMark().GetLevel();
}
@@ -600,7 +604,7 @@ USHORT SwTOXContent::GetLevel() const
// sondern muss die vom "Henkel" sein !!
-SwTOXPara::SwTOXPara( const SwCntntNode& rNd, SwTOXElement eT, USHORT nLevel )
+SwTOXPara::SwTOXPara( const SwCntntNode& rNd, SwTOXElement eT, sal_uInt16 nLevel )
: SwTOXSortTabBase( TOX_SORT_PARA, &rNd, 0, 0 ),
eType( eT ),
m_nLevel(nLevel),
@@ -644,7 +648,7 @@ void SwTOXPara::GetText_Impl( String& rTxt, String& ) const
else
{
ASSERT( !this, "Grafik/Object ohne Namen" )
- USHORT nId = nsSwTOXElement::TOX_OLE == eType
+ sal_uInt16 nId = nsSwTOXElement::TOX_OLE == eType
? STR_OBJECT_DEFNAME
: nsSwTOXElement::TOX_GRAPHIC == eType
? STR_GRAPHIC_DEFNAME
@@ -657,7 +661,7 @@ void SwTOXPara::GetText_Impl( String& rTxt, String& ) const
}
}
-void SwTOXPara::FillText( SwTxtNode& rNd, const SwIndex& rInsPos, USHORT ) const
+void SwTOXPara::FillText( SwTxtNode& rNd, const SwIndex& rInsPos, sal_uInt16 ) const
{
if( nsSwTOXElement::TOX_TEMPLATE == eType || nsSwTOXElement::TOX_SEQUENCE == eType || nsSwTOXElement::TOX_OUTLINELEVEL == eType)
{
@@ -672,7 +676,7 @@ void SwTOXPara::FillText( SwTxtNode& rNd, const SwIndex& rInsPos, USHORT ) const
*/
pSrc->GetExpandTxt( rNd, &rInsPos, nStt,
nEndIndex == STRING_LEN ? STRING_LEN : nEndIndex - nStt,
- FALSE, FALSE, TRUE );
+ sal_False, sal_False, sal_True );
}
else
{
@@ -684,19 +688,19 @@ void SwTOXPara::FillText( SwTxtNode& rNd, const SwIndex& rInsPos, USHORT ) const
}
-USHORT SwTOXPara::GetLevel() const
+sal_uInt16 SwTOXPara::GetLevel() const
{
- USHORT nRet = m_nLevel;
+ sal_uInt16 nRet = m_nLevel;
const SwCntntNode* pNd = aTOXSources[0].pNd;
if( nsSwTOXElement::TOX_OUTLINELEVEL == eType && pNd->GetTxtNode() )
{
- //USHORT nTmp = ((SwTxtNode*)pNd)->GetTxtColl()->GetOutlineLevel();//#outline level,zhaojianwei
+ //sal_uInt16 nTmp = ((SwTxtNode*)pNd)->GetTxtColl()->GetOutlineLevel();//#outline level,zhaojianwei
//if(nTmp < NO_NUMBERING)
// nRet = nTmp + 1;
const int nTmp = ((SwTxtNode*)pNd)->GetAttrOutlineLevel();//#outline level,zhaojianwei????
if(nTmp != 0 )
- nRet = static_cast<USHORT>(nTmp);
+ nRet = static_cast<sal_uInt16>(nTmp);
}
return nRet;
}
@@ -722,7 +726,7 @@ String SwTOXPara::GetURL() const
// if( pRule )
// {
// // dann noch die rel. Nummer davor setzen
-// const USHORT nCurrLevel = static_cast<USHORT>(pTxtNd->GetActualListLevel());
+// const sal_uInt16 nCurrLevel = static_cast<sal_uInt16>(pTxtNd->GetActualListLevel());
// if(nCurrLevel <= MAXLEVEL)
// {
// // --> OD 2005-11-02 #i51089 - TUNING#
@@ -731,7 +735,7 @@ String SwTOXPara::GetURL() const
// SwNumberTree::tNumberVector aNumVector =
// pTxtNd->GetNumberVector();
-// for( USHORT n = 0; n <= nCurrLevel; ++n )
+// for( sal_uInt16 n = 0; n <= nCurrLevel; ++n )
// {
// int nNum = aNumVector[ n ];
// nNum -= ( pRule->Get( n ).GetStart() - 1 );
@@ -813,7 +817,7 @@ void SwTOXTable::GetText_Impl( String& rTxt, String& ) const
}
}
-USHORT SwTOXTable::GetLevel() const
+sal_uInt16 SwTOXTable::GetLevel() const
{
return nLevel;
}
@@ -847,15 +851,15 @@ SwTOXAuthority::SwTOXAuthority( const SwCntntNode& rNd,
nCntPos = *rField.GetTxtFld()->GetStart();
}
-USHORT SwTOXAuthority::GetLevel() const
+sal_uInt16 SwTOXAuthority::GetLevel() const
{
String sText(((SwAuthorityField*)m_rField.GetFld())->
GetFieldText(AUTH_FIELD_AUTHORITY_TYPE));
//#i18655# the level '0' is the heading level therefor the values are incremented here
- USHORT nRet = 1;
+ sal_uInt16 nRet = 1;
if( pTOXIntl->IsNumeric( sText ) )
{
- nRet = (USHORT)sText.ToInt32();
+ nRet = (sal_uInt16)sText.ToInt32();
nRet++;
}
//illegal values are also set to 'ARTICLE' as non-numeric values are
@@ -880,7 +884,7 @@ void SwTOXAuthority::GetText_Impl( String& rTxt, String& ) const
--------------------------------------------------*/
void SwTOXAuthority::FillText( SwTxtNode& rNd,
- const SwIndex& rInsPos, USHORT nAuthField ) const
+ const SwIndex& rInsPos, sal_uInt16 nAuthField ) const
{
SwAuthorityField* pField = (SwAuthorityField*)m_rField.GetFld();
String sText;
@@ -897,7 +901,7 @@ void SwTOXAuthority::FillText( SwTxtNode& rNd,
}
else if(AUTH_FIELD_AUTHORITY_TYPE == nAuthField)
{
- USHORT nLevel = GetLevel();
+ sal_uInt16 nLevel = GetLevel();
if(nLevel)
sText = SwAuthorityFieldType::GetAuthTypeName((ToxAuthorityType) --nLevel);
}
@@ -908,7 +912,7 @@ void SwTOXAuthority::FillText( SwTxtNode& rNd,
/* -----------------14.10.99 09:35-------------------
--------------------------------------------------*/
-BOOL SwTOXAuthority::operator==( const SwTOXSortTabBase& rCmp)
+sal_Bool SwTOXAuthority::operator==( const SwTOXSortTabBase& rCmp)
{
return nType == rCmp.nType &&
((SwAuthorityField*)m_rField.GetFld())->GetHandle() ==
@@ -917,9 +921,9 @@ BOOL SwTOXAuthority::operator==( const SwTOXSortTabBase& rCmp)
/* -----------------21.10.99 09:52-------------------
--------------------------------------------------*/
-BOOL SwTOXAuthority::operator<( const SwTOXSortTabBase& rBase)
+sal_Bool SwTOXAuthority::operator<( const SwTOXSortTabBase& rBase)
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
SwAuthorityField* pField = (SwAuthorityField*)m_rField.GetFld();
SwAuthorityFieldType* pType = (SwAuthorityFieldType*)
pField->GetTyp();
@@ -931,7 +935,7 @@ BOOL SwTOXAuthority::operator<( const SwTOXSortTabBase& rBase)
((SwTOXAuthority&)rBase).m_rField.GetFld();
- for(USHORT i = 0; i < pType->GetSortKeyCount(); i++)
+ for(sal_uInt16 i = 0; i < pType->GetSortKeyCount(); i++)
{
const SwTOXSortKey* pKey = pType->GetSortKey(i);
String sMyTxt = pField->GetFieldText(pKey->eField);
diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx
index 73e9d5bdad92..3b487dde6910 100644
--- a/sw/source/core/txtnode/atrfld.cxx
+++ b/sw/source/core/txtnode/atrfld.cxx
@@ -101,7 +101,7 @@ SwFmtFld::~SwFmtFld()
// bei einige FeldTypen muessen wir den FeldTypen noch loeschen
if( pType && pType->IsLastDepend() )
{
- BOOL bDel = FALSE;
+ sal_Bool bDel = sal_False;
switch( pType->Which() )
{
case RES_USERFLD:
@@ -251,27 +251,27 @@ void SwFmtFld::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
pTxtAttr->Expand();
}
-BOOL SwFmtFld::GetInfo( SfxPoolItem& rInfo ) const
+sal_Bool SwFmtFld::GetInfo( SfxPoolItem& rInfo ) const
{
const SwTxtNode* pTxtNd;
if( RES_AUTOFMT_DOCNODE != rInfo.Which() ||
!pTxtAttr || 0 == ( pTxtNd = pTxtAttr->GetpTxtNode() ) ||
&pTxtNd->GetNodes() != ((SwAutoFmtGetDocNode&)rInfo).pNodes )
- return TRUE;
+ return sal_True;
((SwAutoFmtGetDocNode&)rInfo).pCntntNode = pTxtNd;
- return FALSE;
+ return sal_False;
}
-BOOL SwFmtFld::IsFldInDoc() const
+sal_Bool SwFmtFld::IsFldInDoc() const
{
const SwTxtNode* pTxtNd;
return pTxtAttr && 0 != ( pTxtNd = pTxtAttr->GetpTxtNode() ) &&
pTxtNd->GetNodes().IsDocNodes();
}
-BOOL SwFmtFld::IsProtect() const
+sal_Bool SwFmtFld::IsProtect() const
{
const SwTxtNode* pTxtNd;
return pTxtAttr && 0 != ( pTxtNd = pTxtAttr->GetpTxtNode() ) &&
@@ -328,7 +328,7 @@ void SwTxtFld::Expand() const
if( aNewExpand == m_aExpand )
{
// Bei Seitennummernfeldern
- const USHORT nWhich = pFld->GetTyp()->Which();
+ const sal_uInt16 nWhich = pFld->GetTyp()->Which();
if( RES_CHAPTERFLD != nWhich && RES_PAGENUMBERFLD != nWhich &&
RES_REFPAGEGETFLD != nWhich &&
// --> FME 2005-05-23 #122919# Page count fields to not use aExpand
@@ -368,7 +368,7 @@ void SwTxtFld::CopyFld( SwTxtFld *pDest ) const
IDocumentFieldsAccess* pDestIDFA = pDest->m_pTxtNode->getIDocumentFieldsAccess();
SwFmtFld& rFmtFld = (SwFmtFld&)pDest->GetFld();
- const USHORT nFldWhich = rFmtFld.GetFld()->GetTyp()->Which();
+ const sal_uInt16 nFldWhich = rFmtFld.GetFld()->GetTyp()->Which();
if( pIDFA != pDestIDFA )
{
diff --git a/sw/source/core/txtnode/atrflyin.cxx b/sw/source/core/txtnode/atrflyin.cxx
index f98ca5595bb5..dbcc5d06b8d1 100644
--- a/sw/source/core/txtnode/atrflyin.cxx
+++ b/sw/source/core/txtnode/atrflyin.cxx
@@ -31,6 +31,7 @@
#include "hintids.hxx"
#include "cntfrm.hxx" // _GetFly
#include "doc.hxx"
+#include <IDocumentUndoRedo.hxx>
#include "pam.hxx" // fuer SwTxtFlyCnt
#include "flyfrm.hxx" // fuer SwTxtFlyCnt
#include "ndtxt.hxx" // SwFlyFrmFmt
@@ -114,9 +115,8 @@ void SwTxtFlyCnt::CopyFlyFmt( SwDoc* pDoc )
// In CopyLayoutFmt (siehe doclay.cxx) wird das FlyFrmFmt erzeugt
// und der Inhalt dupliziert.
- // fuers kopieren vom Attribut das Undo immer abschalten
- BOOL bUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ // disable undo while copying attribute
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
SwFmtAnchor aAnchor( pFmt->GetAnchor() );
if ((FLY_AT_PAGE != aAnchor.GetAnchorId()) &&
(pDoc != pFmt->GetDoc())) // different documents?
@@ -143,7 +143,6 @@ void SwTxtFlyCnt::CopyFlyFmt( SwDoc* pDoc )
}
SwFrmFmt* pNew = pDoc->CopyLayoutFmt( *pFmt, aAnchor, false, false );
- pDoc->DoUndo( bUndo );
((SwFmtFlyCnt&)GetFlyCnt()).SetFlyFmt( pNew );
}
@@ -190,16 +189,13 @@ void SwTxtFlyCnt::SetAnchor( const SwTxtNode *pNode )
// stehen wir noch im falschen Dokument ?
if( pDoc != pFmt->GetDoc() )
{
- // fuers kopieren vom Attribut das Undo immer abschalten
- BOOL bUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ // disable undo while copying attribute
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
SwFrmFmt* pNew = pDoc->CopyLayoutFmt( *pFmt, aAnchor, false, false );
- pDoc->DoUndo( bUndo );
- bUndo = pFmt->GetDoc()->DoesUndo();
- pFmt->GetDoc()->DoUndo( FALSE );
+ ::sw::UndoGuard const undoGuardFmt(
+ pFmt->GetDoc()->GetIDocumentUndoRedo());
pFmt->GetDoc()->DelLayoutFmt( pFmt );
- pFmt->GetDoc()->DoUndo( bUndo );
((SwFmtFlyCnt&)GetFlyCnt()).SetFlyFmt( pNew );
}
else if( pNode->GetpSwpHints() &&
diff --git a/sw/source/core/txtnode/atrftn.cxx b/sw/source/core/txtnode/atrftn.cxx
index de7f96217751..ea961555bcf2 100644
--- a/sw/source/core/txtnode/atrftn.cxx
+++ b/sw/source/core/txtnode/atrftn.cxx
@@ -115,14 +115,14 @@ void SwFmtFtn::GetFtnText( XubString& rStr ) const
}
// returnt den anzuzeigenden String der Fuss-/Endnote
-XubString SwFmtFtn::GetViewNumStr( const SwDoc& rDoc, BOOL bInclStrings ) const
+XubString SwFmtFtn::GetViewNumStr( const SwDoc& rDoc, sal_Bool bInclStrings ) const
{
XubString sRet( GetNumStr() );
if( !sRet.Len() )
{
// dann ist die Nummer von Interesse, also ueber die Info diese
// besorgen.
- BOOL bMakeNum = TRUE;
+ sal_Bool bMakeNum = sal_True;
const SwSectionNode* pSectNd = pTxtAttr
? SwUpdFtnEndNtAtEnd::FindSectNdWithEndAttr( *pTxtAttr )
: 0;
@@ -132,12 +132,12 @@ XubString SwFmtFtn::GetViewNumStr( const SwDoc& rDoc, BOOL bInclStrings ) const
const SwFmtFtnEndAtTxtEnd& rFtnEnd = (SwFmtFtnEndAtTxtEnd&)
pSectNd->GetSection().GetFmt()->GetFmtAttr(
IsEndNote() ?
- static_cast<USHORT>(RES_END_AT_TXTEND) :
- static_cast<USHORT>(RES_FTN_AT_TXTEND) );
+ static_cast<sal_uInt16>(RES_END_AT_TXTEND) :
+ static_cast<sal_uInt16>(RES_FTN_AT_TXTEND) );
if( FTNEND_ATTXTEND_OWNNUMANDFMT == rFtnEnd.GetValue() )
{
- bMakeNum = FALSE;
+ bMakeNum = sal_False;
sRet = rFtnEnd.GetSwNumType().GetNumStr( GetNumber() );
if( bInclStrings )
{
@@ -187,7 +187,7 @@ SwTxtFtn::~SwTxtFtn()
-void SwTxtFtn::SetStartNode( const SwNodeIndex *pNewNode, BOOL bDelNode )
+void SwTxtFtn::SetStartNode( const SwNodeIndex *pNewNode, sal_Bool bDelNode )
{
if( pNewNode )
{
@@ -240,7 +240,7 @@ void SwTxtFtn::SetStartNode( const SwNodeIndex *pNewNode, BOOL bDelNode )
DELETEZ( m_pStartNode );
// loesche die Fussnote noch aus dem Array am Dokument
- for( USHORT n = 0; n < pDoc->GetFtnIdxs().Count(); ++n )
+ for( sal_uInt16 n = 0; n < pDoc->GetFtnIdxs().Count(); ++n )
if( this == pDoc->GetFtnIdxs()[n] )
{
pDoc->GetFtnIdxs().Remove( n );
@@ -256,7 +256,7 @@ void SwTxtFtn::SetStartNode( const SwNodeIndex *pNewNode, BOOL bDelNode )
}
-void SwTxtFtn::SetNumber( const USHORT nNewNum, const XubString* pStr )
+void SwTxtFtn::SetNumber( const sal_uInt16 nNewNum, const XubString* pStr )
{
SwFmtFtn& rFtn = (SwFmtFtn&)GetFtn();
if( pStr && pStr->Len() )
@@ -274,8 +274,8 @@ void SwTxtFtn::SetNumber( const USHORT nNewNum, const XubString* pStr )
{
// must iterate over all TxtNodes because of footnotes on other pages
SwNode* pNd;
- ULONG nSttIdx = m_pStartNode->GetIndex() + 1;
- ULONG nEndIdx = m_pStartNode->GetNode().EndOfSectionIndex();
+ sal_uLong nSttIdx = m_pStartNode->GetIndex() + 1;
+ sal_uLong nEndIdx = m_pStartNode->GetNode().EndOfSectionIndex();
for( ; nSttIdx < nEndIdx; ++nSttIdx )
{
// Es koennen ja auch Grafiken in der Fussnote stehen ...
@@ -308,9 +308,9 @@ void SwTxtFtn::CopyFtn(SwTxtFtn & rDest, SwTxtNode & rDestNode) const
// nDestLen contains number of CntntNodes in rDest _before_ copy.
SwNodeIndex aStart( *(rDest.GetStartNode()) );
SwNodeIndex aEnd( *aStart.GetNode().EndOfSectionNode() );
- ULONG nDestLen = aEnd.GetIndex() - aStart.GetIndex() - 1;
+ sal_uLong nDestLen = aEnd.GetIndex() - aStart.GetIndex() - 1;
- m_pTxtNode->GetDoc()->CopyWithFlyInFly( aRg, 0, aEnd, TRUE );
+ m_pTxtNode->GetDoc()->CopyWithFlyInFly( aRg, 0, aEnd, sal_True );
// in case the destination section was not empty, delete the old nodes
// before: Src: SxxxE, Dst: SnE
@@ -337,7 +337,7 @@ void SwTxtFtn::MakeNewTextSection( SwNodes& rNodes )
// Nun verpassen wir dem TxtNode noch die Fussnotenvorlage.
SwTxtFmtColl *pFmtColl;
const SwEndNoteInfo* pInfo;
- USHORT nPoolId;
+ sal_uInt16 nPoolId;
if( GetFtn().IsEndNote() )
{
@@ -366,8 +366,12 @@ void SwTxtFtn::DelFrms( const SwFrm* pSib )
if ( !m_pTxtNode )
return;
+<<<<<<< local
const SwRootFrm* pRoot = pSib ? pSib->getRootFrm() : 0;
BOOL bFrmFnd = FALSE;
+=======
+ sal_Bool bFrmFnd = sal_False;
+>>>>>>> other
{
SwIterator<SwCntntFrm,SwTxtNode> aIter( *m_pTxtNode );
for( SwCntntFrm* pFnd = aIter.First(); pFnd; pFnd = aIter.Next() )
@@ -378,7 +382,7 @@ void SwTxtFtn::DelFrms( const SwFrm* pSib )
if( pPage )
{
pPage->RemoveFtn( pFnd, this );
- bFrmFnd = TRUE;
+ bFrmFnd = sal_True;
}
}
}
@@ -424,7 +428,7 @@ void SwTxtFtn::DelFrms( const SwFrm* pSib )
}
-USHORT SwTxtFtn::SetSeqRefNo()
+sal_uInt16 SwTxtFtn::SetSeqRefNo()
{
if( !m_pTxtNode )
return USHRT_MAX;
@@ -433,9 +437,9 @@ USHORT SwTxtFtn::SetSeqRefNo()
if( pDoc->IsInReading() )
return USHRT_MAX;
- USHORT n, nFtnCnt = pDoc->GetFtnIdxs().Count();
+ sal_uInt16 n, nFtnCnt = pDoc->GetFtnIdxs().Count();
- const BYTE nTmp = 255 < nFtnCnt ? 255 : static_cast<BYTE>(nFtnCnt);
+ const sal_uInt8 nTmp = 255 < nFtnCnt ? 255 : static_cast<sal_uInt8>(nFtnCnt);
SvUShortsSort aArr( nTmp, nTmp );
// dann testmal, ob die Nummer schon vergeben ist oder ob eine neue
@@ -481,9 +485,9 @@ USHORT SwTxtFtn::SetSeqRefNo()
void SwTxtFtn::SetUniqueSeqRefNo( SwDoc& rDoc )
{
- USHORT n, nStt = 0, nFtnCnt = rDoc.GetFtnIdxs().Count();
+ sal_uInt16 n, nStt = 0, nFtnCnt = rDoc.GetFtnIdxs().Count();
- const BYTE nTmp = 255 < nFtnCnt ? 255 : static_cast<BYTE>(nFtnCnt);
+ const sal_uInt8 nTmp = 255 < nFtnCnt ? 255 : static_cast<sal_uInt8>(nFtnCnt);
SvUShortsSort aArr( nTmp, nTmp );
// dann alle Nummern zusammensammeln die schon existieren
diff --git a/sw/source/core/txtnode/atrtox.cxx b/sw/source/core/txtnode/atrtox.cxx
index c02478fe1014..8c64e4b2bd29 100644
--- a/sw/source/core/txtnode/atrtox.cxx
+++ b/sw/source/core/txtnode/atrtox.cxx
@@ -68,13 +68,13 @@ void SwTxtTOXMark::CopyTOXMark( SwDoc* pDoc )
{
SwTOXMark& rTOX = (SwTOXMark&)GetTOXMark();
TOXTypes eType = rTOX.GetTOXType()->GetType();
- USHORT nCount = pDoc->GetTOXTypeCount( eType );
+ sal_uInt16 nCount = pDoc->GetTOXTypeCount( eType );
const SwTOXType* pType = 0;
const XubString& rNm = rTOX.GetTOXType()->GetTypeName();
// kein entsprechender Verzeichnistyp vorhanden -> anlegen
// sonst verwenden
- for(USHORT i=0; i < nCount; ++i)
+ for(sal_uInt16 i=0; i < nCount; ++i)
{
const SwTOXType* pSrcType = pDoc->GetTOXType(eType, i);
if(pSrcType->GetTypeName() == rNm )
diff --git a/sw/source/core/txtnode/fmtatr2.cxx b/sw/source/core/txtnode/fmtatr2.cxx
index 3bc60d5b4628..435b34f3957d 100644
--- a/sw/source/core/txtnode/fmtatr2.cxx
+++ b/sw/source/core/txtnode/fmtatr2.cxx
@@ -123,22 +123,22 @@ void SwFmtCharFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
// weiterleiten an das TextAttribut
-BOOL SwFmtCharFmt::GetInfo( SfxPoolItem& rInfo ) const
+sal_Bool SwFmtCharFmt::GetInfo( SfxPoolItem& rInfo ) const
{
- return pTxtAttr ? pTxtAttr->GetInfo( rInfo ) : FALSE;
+ return pTxtAttr ? pTxtAttr->GetInfo( rInfo ) : sal_False;
}
-BOOL SwFmtCharFmt::QueryValue( uno::Any& rVal, BYTE ) const
+sal_Bool SwFmtCharFmt::QueryValue( uno::Any& rVal, sal_uInt8 ) const
{
String sCharFmtName;
if(GetCharFmt())
SwStyleNameMapper::FillProgName(GetCharFmt()->GetName(), sCharFmtName, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, sal_True );
rVal <<= OUString( sCharFmtName );
- return TRUE;
+ return sal_True;
}
-BOOL SwFmtCharFmt::PutValue( const uno::Any& , BYTE )
+sal_Bool SwFmtCharFmt::PutValue( const uno::Any& , sal_uInt8 )
{
DBG_ERROR("Zeichenvorlage kann mit PutValue nicht gesetzt werden!");
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -150,7 +150,7 @@ BOOL SwFmtCharFmt::PutValue( const uno::Any& , BYTE )
|*
*************************************************************************/
-SwFmtAutoFmt::SwFmtAutoFmt( USHORT nInitWhich )
+SwFmtAutoFmt::SwFmtAutoFmt( sal_uInt16 nInitWhich )
: SfxPoolItem( nInitWhich )
{
}
@@ -175,17 +175,17 @@ SfxPoolItem* SwFmtAutoFmt::Clone( SfxItemPool* ) const
return new SwFmtAutoFmt( *this );
}
-BOOL SwFmtAutoFmt::QueryValue( uno::Any& rVal, BYTE ) const
+sal_Bool SwFmtAutoFmt::QueryValue( uno::Any& rVal, sal_uInt8 ) const
{
String sCharFmtName = StylePool::nameOf( mpHandle );
rVal <<= OUString( sCharFmtName );
- return TRUE;
+ return sal_True;
}
-BOOL SwFmtAutoFmt::PutValue( const uno::Any& , BYTE )
+sal_Bool SwFmtAutoFmt::PutValue( const uno::Any& , sal_uInt8 )
{
//the format is not renameable via API
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -242,7 +242,7 @@ SwFmtINetFmt::~SwFmtINetFmt()
int SwFmtINetFmt::operator==( const SfxPoolItem& rAttr ) const
{
ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
- BOOL bRet = SfxPoolItem::operator==( (SfxPoolItem&) rAttr )
+ sal_Bool bRet = SfxPoolItem::operator==( (SfxPoolItem&) rAttr )
&& aURL == ((SwFmtINetFmt&)rAttr).aURL
&& aName == ((SwFmtINetFmt&)rAttr).aName
&& aTargetFrame == ((SwFmtINetFmt&)rAttr).aTargetFrame
@@ -252,7 +252,7 @@ int SwFmtINetFmt::operator==( const SfxPoolItem& rAttr ) const
&& nVisitedId == ((SwFmtINetFmt&)rAttr).nVisitedId;
if( !bRet )
- return FALSE;
+ return sal_False;
const SvxMacroTableDtor* pOther = ((SwFmtINetFmt&)rAttr).pMacroTbl;
if( !pMacroTbl )
@@ -265,19 +265,19 @@ int SwFmtINetFmt::operator==( const SfxPoolItem& rAttr ) const
// Anzahl unterschiedlich => auf jeden Fall ungleich
if( rOwn.Count() != rOther.Count() )
- return FALSE;
+ return sal_False;
// einzeln vergleichen; wegen Performance ist die Reihenfolge wichtig
- for( USHORT nNo = 0; nNo < rOwn.Count(); ++nNo )
+ for( sal_uInt16 nNo = 0; nNo < rOwn.Count(); ++nNo )
{
const SvxMacro *pOwnMac = rOwn.GetObject(nNo);
const SvxMacro *pOtherMac = rOther.GetObject(nNo);
if ( rOwn.GetKey(pOwnMac) != rOther.GetKey(pOtherMac) ||
pOwnMac->GetLibName() != pOtherMac->GetLibName() ||
pOwnMac->GetMacName() != pOtherMac->GetMacName() )
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
@@ -304,7 +304,7 @@ void SwFmtINetFmt::SetMacroTbl( const SvxMacroTableDtor* pNewTbl )
-void SwFmtINetFmt::SetMacro( USHORT nEvent, const SvxMacro& rMacro )
+void SwFmtINetFmt::SetMacro( sal_uInt16 nEvent, const SvxMacro& rMacro )
{
if( !pMacroTbl )
pMacroTbl = new SvxMacroTableDtor;
@@ -321,7 +321,7 @@ void SwFmtINetFmt::SetMacro( USHORT nEvent, const SvxMacro& rMacro )
-const SvxMacro* SwFmtINetFmt::GetMacro( USHORT nEvent ) const
+const SvxMacro* SwFmtINetFmt::GetMacro( sal_uInt16 nEvent ) const
{
const SvxMacro* pRet = 0;
if( pMacroTbl && pMacroTbl->IsKeyValid( nEvent ) )
@@ -331,9 +331,9 @@ const SvxMacro* SwFmtINetFmt::GetMacro( USHORT nEvent ) const
-BOOL SwFmtINetFmt::QueryValue( uno::Any& rVal, BYTE nMemberId ) const
+sal_Bool SwFmtINetFmt::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
XubString sVal;
nMemberId &= ~CONVERT_TWIPS;
switch(nMemberId)
@@ -379,9 +379,9 @@ BOOL SwFmtINetFmt::QueryValue( uno::Any& rVal, BYTE nMemberId ) const
rVal <<= OUString(sVal);
return bRet;
}
-BOOL SwFmtINetFmt::PutValue( const uno::Any& rVal, BYTE nMemberId )
+sal_Bool SwFmtINetFmt::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
nMemberId &= ~CONVERT_TWIPS;
// all properties except HyperlinkEvents are of type string, hence
@@ -403,14 +403,14 @@ BOOL SwFmtINetFmt::PutValue( const uno::Any& rVal, BYTE nMemberId )
else
{
// wrong type!
- bRet = FALSE;
+ bRet = sal_False;
}
}
else
{
// all string properties:
if(rVal.getValueType() != ::getCppuType((rtl::OUString*)0))
- return FALSE;
+ return sal_False;
XubString sVal = *(rtl::OUString*)rVal.getValue();
switch(nMemberId)
{
@@ -441,7 +441,7 @@ BOOL SwFmtINetFmt::PutValue( const uno::Any& rVal, BYTE nMemberId )
}
break;
default:
- bRet = FALSE;
+ bRet = sal_False;
}
}
return bRet;
@@ -503,10 +503,10 @@ SfxPoolItem* SwFmtRuby::Clone( SfxItemPool* ) const
return new SwFmtRuby( *this );
}
-BOOL SwFmtRuby::QueryValue( uno::Any& rVal,
- BYTE nMemberId ) const
+sal_Bool SwFmtRuby::QueryValue( uno::Any& rVal,
+ sal_uInt8 nMemberId ) const
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
nMemberId &= ~CONVERT_TWIPS;
switch( nMemberId )
{
@@ -526,14 +526,14 @@ BOOL SwFmtRuby::QueryValue( uno::Any& rVal,
}
break;
default:
- bRet = FALSE;
+ bRet = sal_False;
}
return bRet;
}
-BOOL SwFmtRuby::PutValue( const uno::Any& rVal,
- BYTE nMemberId )
+sal_Bool SwFmtRuby::PutValue( const uno::Any& rVal,
+ sal_uInt8 nMemberId )
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
nMemberId &= ~CONVERT_TWIPS;
switch( nMemberId )
{
@@ -573,7 +573,7 @@ BOOL SwFmtRuby::PutValue( const uno::Any& rVal,
}
break;
default:
- bRet = FALSE;
+ bRet = sal_False;
}
return bRet;
}
@@ -583,12 +583,12 @@ BOOL SwFmtRuby::PutValue( const uno::Any& rVal,
class SwFmtMeta
************************************************************************/
-SwFmtMeta * SwFmtMeta::CreatePoolDefault(const USHORT i_nWhich)
+SwFmtMeta * SwFmtMeta::CreatePoolDefault(const sal_uInt16 i_nWhich)
{
return new SwFmtMeta(i_nWhich);
}
-SwFmtMeta::SwFmtMeta(const USHORT i_nWhich)
+SwFmtMeta::SwFmtMeta(const sal_uInt16 i_nWhich)
: SfxPoolItem( i_nWhich )
, m_pMeta()
, m_pTxtAttr( 0 )
@@ -598,7 +598,7 @@ SwFmtMeta::SwFmtMeta(const USHORT i_nWhich)
}
SwFmtMeta::SwFmtMeta( ::boost::shared_ptr< ::sw::Meta > const & i_pMeta,
- const USHORT i_nWhich )
+ const sal_uInt16 i_nWhich )
: SfxPoolItem( i_nWhich )
, m_pMeta( i_pMeta )
, m_pTxtAttr( 0 )
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index fb76c68824da..3bd6f8594c1c 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -80,7 +80,7 @@ SwFntCache *pFntCache = NULL;
// Letzter Font, der durch ChgFntCache eingestellt wurde.
SwFntObj *pLastFont = NULL;
// Die "MagicNumber", die den Fonts zur Identifizierung verpasst wird
-BYTE* pMagicNo = NULL;
+sal_uInt8* pMagicNo = NULL;
Color *pWaveCol = 0;
@@ -88,8 +88,8 @@ long SwFntObj::nPixWidth;
MapMode* SwFntObj::pPixMap = NULL;
OutputDevice* SwFntObj::pPixOut = NULL;
-extern USHORT UnMapDirection( USHORT nDir, const BOOL bVertFormat );
-USHORT GetDefaultFontHeight( SwDrawTextInfo &rInf )
+extern sal_uInt16 UnMapDirection( sal_uInt16 nDir, const sal_Bool bVertFormat );
+sal_uInt16 GetDefaultFontHeight( SwDrawTextInfo &rInf )
{
SwDocShell* pDocShell = rInf.GetShell()->GetDoc()->GetDocShell();
SfxStyleSheetBasePool* pBasePool = pDocShell->GetStyleSheetPool();
@@ -99,7 +99,7 @@ USHORT GetDefaultFontHeight( SwDrawTextInfo &rInf )
SfxStyleSheetBase* pStyle = pBasePool->Find( aString, (SfxStyleFamily)SFX_STYLE_FAMILY_PARA );
SfxItemSet& aTmpSet = pStyle->GetItemSet();
SvxFontHeightItem &aDefaultFontItem = (SvxFontHeightItem&)aTmpSet.Get(RES_CHRATR_CJK_FONTSIZE);
- return (USHORT)aDefaultFontItem.GetHeight();
+ return (sal_uInt16)aDefaultFontItem.GetHeight();
}
@@ -212,15 +212,15 @@ struct CalcLinePosData
SwDrawTextInfo& rInf;
Font& rFont;
xub_StrLen nCnt;
- const BOOL bSwitchH2V;
- const BOOL bSwitchL2R;
+ const sal_Bool bSwitchH2V;
+ const sal_Bool bSwitchL2R;
long nHalfSpace;
sal_Int32* pKernArray;
- const BOOL bBidiPor;
+ const sal_Bool bBidiPor;
CalcLinePosData( SwDrawTextInfo& _rInf, Font& _rFont,
- xub_StrLen _nCnt, const BOOL _bSwitchH2V, const BOOL _bSwitchL2R,
- long _nHalfSpace, sal_Int32* _pKernArray, const BOOL _bBidiPor) :
+ xub_StrLen _nCnt, const sal_Bool _bSwitchH2V, const sal_Bool _bSwitchL2R,
+ long _nHalfSpace, sal_Int32* _pKernArray, const sal_Bool _bBidiPor) :
rInf( _rInf ),
rFont( _rFont ),
nCnt( _nCnt ),
@@ -256,10 +256,10 @@ void lcl_calcLinePos( const CalcLinePosData &rData,
}
// determine start, end and length of wave line
- sal_Int32 nKernStart = nStart ? rData.pKernArray[ USHORT( nStart - 1 ) ] : 0;
- sal_Int32 nKernEnd = rData.pKernArray[ USHORT( nEnd - 1 ) ];
+ sal_Int32 nKernStart = nStart ? rData.pKernArray[ sal_uInt16( nStart - 1 ) ] : 0;
+ sal_Int32 nKernEnd = rData.pKernArray[ sal_uInt16( nEnd - 1 ) ];
- USHORT nDir = rData.bBidiPor ? 1800 :
+ sal_uInt16 nDir = rData.bBidiPor ? 1800 :
UnMapDirection( rData.rFont.GetOrientation(), rData.bSwitchH2V );
switch ( nDir )
@@ -301,7 +301,7 @@ void lcl_calcLinePos( const CalcLinePosData &rData,
/*************************************************************************
*
- * USHORT SwFntObj::GetFontAscent( const OutputDevice& rOut )
+ * sal_uInt16 SwFntObj::GetFontAscent( const OutputDevice& rOut )
*
* Ersterstellung AMA 7. Nov. 94
* Letzte Aenderung AMA 7. Nov. 94
@@ -311,9 +311,9 @@ void lcl_calcLinePos( const CalcLinePosData &rData,
* erzeugt werden.
*************************************************************************/
-USHORT SwFntObj::GetFontAscent( const ViewShell *pSh, const OutputDevice& rOut )
+sal_uInt16 SwFntObj::GetFontAscent( const ViewShell *pSh, const OutputDevice& rOut )
{
- USHORT nRet = 0;
+ sal_uInt16 nRet = 0;
const OutputDevice& rRefDev = pSh ? pSh->GetRefDev() : rOut;
if ( pSh && lcl_IsFontAdjustNecessary( rOut, rRefDev ) )
@@ -330,7 +330,7 @@ USHORT SwFntObj::GetFontAscent( const ViewShell *pSh, const OutputDevice& rOut )
const Font aOldFnt( rRefDev.GetFont() );
((OutputDevice&)rRefDev).SetFont( *pPrtFont );
const FontMetric aOutMet( rRefDev.GetFontMetric() );
- nPrtAscent = (USHORT) aOutMet.GetAscent();
+ nPrtAscent = (sal_uInt16) aOutMet.GetAscent();
( (OutputDevice&)rRefDev).SetFont( aOldFnt );
}
@@ -348,7 +348,7 @@ USHORT SwFntObj::GetFontAscent( const ViewShell *pSh, const OutputDevice& rOut )
/*************************************************************************
*
- * USHORT SwFntObj::GetFontHeight( const OutputDevice* pOut )
+ * sal_uInt16 SwFntObj::GetFontHeight( const OutputDevice* pOut )
*
* Ersterstellung AMA 7. Nov. 94
* Letzte Aenderung AMA 7. Nov. 94
@@ -358,9 +358,9 @@ USHORT SwFntObj::GetFontAscent( const ViewShell *pSh, const OutputDevice& rOut )
* erzeugt werden.
*************************************************************************/
-USHORT SwFntObj::GetFontHeight( const ViewShell* pSh, const OutputDevice& rOut )
+sal_uInt16 SwFntObj::GetFontHeight( const ViewShell* pSh, const OutputDevice& rOut )
{
- USHORT nRet = 0;
+ sal_uInt16 nRet = 0;
const OutputDevice& rRefDev = pSh ? pSh->GetRefDev() : rOut;
if ( pSh && lcl_IsFontAdjustNecessary( rOut, rRefDev ) )
@@ -376,12 +376,12 @@ USHORT SwFntObj::GetFontHeight( const ViewShell* pSh, const OutputDevice& rOut )
CreatePrtFont( rOut );
const Font aOldFnt( rRefDev.GetFont() );
((OutputDevice&)rRefDev).SetFont( *pPrtFont );
- nPrtHeight = static_cast<USHORT>(rRefDev.GetTextHeight());
+ nPrtHeight = static_cast<sal_uInt16>(rRefDev.GetTextHeight());
#if OSL_DEBUG_LEVEL > 1
// Check if vcl did not change the meading of GetTextHeight
const FontMetric aOutMet( rRefDev.GetFontMetric() );
- long nTmpPrtHeight = (USHORT)aOutMet.GetAscent() + aOutMet.GetDescent();
+ long nTmpPrtHeight = (sal_uInt16)aOutMet.GetAscent() + aOutMet.GetDescent();
(void) nTmpPrtHeight;
// #i106098#: do not compare with == here due to rounding error
ASSERT( abs(nTmpPrtHeight - nPrtHeight) < 3,
@@ -398,9 +398,9 @@ USHORT SwFntObj::GetFontHeight( const ViewShell* pSh, const OutputDevice& rOut )
return nRet;
}
-USHORT SwFntObj::GetFontLeading( const ViewShell *pSh, const OutputDevice& rOut )
+sal_uInt16 SwFntObj::GetFontLeading( const ViewShell *pSh, const OutputDevice& rOut )
{
- USHORT nRet = 0;
+ sal_uInt16 nRet = 0;
if ( pSh )
{
@@ -412,7 +412,7 @@ USHORT SwFntObj::GetFontLeading( const ViewShell *pSh, const OutputDevice& rOut
((OutputDevice&)rOut).SetFont( aOldFnt );
bSymbol = RTL_TEXTENCODING_SYMBOL == aMet.GetCharSet();
GuessLeading( *pSh, aMet );
- nExtLeading = static_cast<USHORT>(aMet.GetExtLeading());
+ nExtLeading = static_cast<sal_uInt16>(aMet.GetExtLeading());
}
const IDocumentSettingAccess& rIDSA = *pSh->getIDocumentSettingAccess();
@@ -490,7 +490,7 @@ void SwFntObj::CreateScrFont( const ViewShell& rSh, const OutputDevice& rOut )
GuessLeading( rSh, aMet );
if ( USHRT_MAX == nExtLeading )
- nExtLeading = static_cast<USHORT>(aMet.GetExtLeading());
+ nExtLeading = static_cast<sal_uInt16>(aMet.GetExtLeading());
// reset the original reference device font
pPrt->SetFont( aOldPrtFnt );
@@ -528,9 +528,9 @@ void SwFntObj::CreateScrFont( const ViewShell& rSh, const OutputDevice& rOut )
nZoom = USHRT_MAX - 1;
}
- nScrAscent = (USHORT)pOut->GetFontMetric().GetAscent();
+ nScrAscent = (sal_uInt16)pOut->GetFontMetric().GetAscent();
if ( USHRT_MAX == nScrHeight )
- nScrHeight = (USHORT)pOut->GetTextHeight();
+ nScrHeight = (sal_uInt16)pOut->GetTextHeight();
// reset original output device font
pOut->SetFont( aOldOutFont );
@@ -563,7 +563,7 @@ void SwFntObj::GuessLeading( const ViewShell&
const Font aOldFnt( pWin->GetFont() );
pWin->SetFont( *pPrtFont );
const FontMetric aWinMet( pWin->GetFontMetric() );
- const USHORT nWinHeight = USHORT( aWinMet.GetSize().Height() );
+ const sal_uInt16 nWinHeight = sal_uInt16( aWinMet.GetSize().Height() );
if( pPrtFont->GetName().Search( aWinMet.GetName() ) < USHRT_MAX )
{
// Wenn das Leading auf dem Window auch 0 ist, dann
@@ -577,11 +577,11 @@ void SwFntObj::GuessLeading( const ViewShell&
if( nTmpLeading < 0 )
nGuessedLeading = 0;
else
- nGuessedLeading = USHORT(nTmpLeading);
+ nGuessedLeading = sal_uInt16(nTmpLeading);
}
else
{
- nGuessedLeading = USHORT(nTmpLeading);
+ nGuessedLeading = sal_uInt16(nTmpLeading);
// Manta-Hack #50153#:
// Wer beim Leading luegt, luegt moeglicherweise auch beim
// Ascent/Descent, deshalb wird hier ggf. der Font ein wenig
@@ -592,7 +592,7 @@ void SwFntObj::GuessLeading( const ViewShell&
{
ASSERT( nPrtAscent < USHRT_MAX, "GuessLeading: PrtAscent-Fault" );
if ( nPrtAscent < USHRT_MAX )
- nPrtAscent = nPrtAscent + (USHORT)(( 2 * nDiff ) / 5);
+ nPrtAscent = nPrtAscent + (sal_uInt16)(( 2 * nDiff ) / 5);
}
}
}
@@ -664,7 +664,7 @@ void SwFntObj::SetDevFont( const ViewShell *pSh, OutputDevice& rOut )
*
*************************************************************************/
-BYTE lcl_WhichPunctuation( xub_Unicode cChar )
+sal_uInt8 lcl_WhichPunctuation( xub_Unicode cChar )
{
if ( ( cChar < 0x3001 || cChar > 0x3002 ) &&
( cChar < 0x3008 || cChar > 0x3011 ) &&
@@ -744,7 +744,7 @@ static void lcl_DrawLineForWrongListData(
rInf.GetOut().Push();
const Color aCol( rInf.GetOut().GetLineColor() );
- const BOOL bColSave = aCol != aLineColor;
+ const sal_Bool bColSave = aCol != aLineColor;
if (bColSave)
rInf.GetOut().SetLineColor( aLineColor );
@@ -803,7 +803,7 @@ static void lcl_DrawLineForWrongListData(
else // draw wavy lines for spell or grammar errors
{
// get wavy line type to use
- USHORT nWave =
+ sal_uInt16 nWave =
WRONG_SHOW_MEDIUM < nHght ? WAVE_NORMAL :
( WRONG_SHOW_SMALL < nHght ? WAVE_SMALL : WAVE_FLAT );
@@ -834,10 +834,15 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
OutputDevice* pWin = rInf.GetShell()->GetWin();
// true if pOut is the printer and the printer has been used for formatting
- const BOOL bPrt = OUTDEV_PRINTER == rInf.GetOut().GetOutDevType() &&
+ const sal_Bool bPrt = OUTDEV_PRINTER == rInf.GetOut().GetOutDevType() &&
OUTDEV_PRINTER == rRefDev.GetOutDevType();
+<<<<<<< local
const BOOL bBrowse = ( pWin &&
rInf.GetShell()->GetViewOptions()->getBrowseMode() &&
+=======
+ const sal_Bool bBrowse = ( pWin &&
+ pIDSA->get(IDocumentSettingAccess::BROWSE_MODE) &&
+>>>>>>> other
!rInf.GetShell()->GetViewOptions()->IsPrtFormat() &&
!rInf.GetBullet() &&
( rInf.GetSpace() || !rInf.GetKern() ) &&
@@ -848,10 +853,10 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
// bDirectPrint indicates that we can enter the branch which calls
// the DrawText functions instead of calling the DrawTextArray functions
- const BOOL bDirectPrint = bPrt || bBrowse;
+ const sal_Bool bDirectPrint = bPrt || bBrowse;
// Condition for output font / refdev font adjustment
- const BOOL bUseScrFont =
+ const sal_Bool bUseScrFont =
lcl_IsFontAdjustNecessary( rInf.GetOut(), rRefDev );
Font* pTmpFont = bUseScrFont ? pScrFont : pPrtFont;
@@ -873,7 +878,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
#ifdef DBG_UTIL
- const BOOL bNoAdjust = bPrt ||
+ const sal_Bool bNoAdjust = bPrt ||
( pWin &&
rInf.GetShell()->GetViewOptions()->getBrowseMode() &&
!rInf.GetShell()->GetViewOptions()->IsPrtFormat() );
@@ -947,11 +952,11 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
// wird die graue Wellenlinie des ExtendedAttributSets zunaechst
// in der Fontfarbe erscheinen.
- const BOOL bSwitchH2V = rInf.GetFrm() && rInf.GetFrm()->IsVertical();
- const BOOL bSwitchL2R = rInf.GetFrm() && rInf.GetFrm()->IsRightToLeft() &&
+ const sal_Bool bSwitchH2V = rInf.GetFrm() && rInf.GetFrm()->IsVertical();
+ const sal_Bool bSwitchL2R = rInf.GetFrm() && rInf.GetFrm()->IsRightToLeft() &&
! rInf.IsIgnoreFrmRTL();
- const ULONG nMode = rInf.GetOut().GetLayoutMode();
- const BOOL bBidiPor = ( bSwitchL2R !=
+ const sal_uLong nMode = rInf.GetOut().GetLayoutMode();
+ const sal_Bool bBidiPor = ( bSwitchL2R !=
( 0 != ( TEXT_LAYOUT_BIDI_RTL & nMode ) ) );
// be sure to have the correct layout mode at the printer
@@ -997,9 +1002,9 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
if ( pGrid && GRID_LINES_CHARS == pGrid->GetGridType() && pGrid->IsSnapToChars())
{
//for textgrid refactor
- //const USHORT nGridWidth = pGrid->GetBaseHeight();
+ //const sal_uInt16 nGridWidth = pGrid->GetBaseHeight();
const SwDoc* pDoc = rInf.GetShell()->GetDoc();
- const USHORT nGridWidth = GETGRIDWIDTH(pGrid, pDoc);
+ const sal_uInt16 nGridWidth = GETGRIDWIDTH(pGrid, pDoc);
sal_Int32* pKernArray = new sal_Int32[rInf.GetLen()];
if ( pPrinter )
@@ -1011,7 +1016,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
long nWidthPerChar = pKernArray[ rInf.GetLen() - 1 ] / rInf.GetLen();
- const ULONG i = nWidthPerChar ?
+ const sal_uLong i = nWidthPerChar ?
( nWidthPerChar - 1 ) / nGridWidth + 1:
1;
@@ -1019,13 +1024,13 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
// position of first character, we take the printer position
long nCharWidth = pKernArray[ 0 ];
- ULONG nHalfWidth = nWidthPerChar / 2;
+ sal_uLong nHalfWidth = nWidthPerChar / 2;
long nNextFix;
// punctuation characters are not centered
xub_Unicode cChar = rInf.GetText().GetChar( rInf.GetIdx() );
- BYTE nType = lcl_WhichPunctuation( cChar );
+ sal_uInt8 nType = lcl_WhichPunctuation( cChar );
switch ( nType )
{
case SwScriptInfo::NONE :
@@ -1087,7 +1092,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
if ( pGrid && GRID_LINES_CHARS == pGrid->GetGridType() && !pGrid->IsSnapToChars() )
{
- const USHORT nDefaultFontHeight = GetDefaultFontHeight( rInf );
+ const sal_uInt16 nDefaultFontHeight = GetDefaultFontHeight( rInf );
const SwDoc* pDoc = rInf.GetShell()->GetDoc();
long nGridWidthAdd = GETGRIDWIDTH(pGrid, pDoc);
@@ -1113,14 +1118,14 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
if ( rInf.GetFont() && rInf.GetLen() )
{
const SwScriptInfo* pSI = rInf.GetScriptInfo();
- const BYTE nActual = rInf.GetFont()->GetActual();
+ const sal_uInt8 nActual = rInf.GetFont()->GetActual();
///Kana Compression
if( SW_CJK == nActual && rInf.GetKanaComp() &&
pSI && pSI->CountCompChg() &&
lcl_IsMonoSpaceFont( *(rInf.GetpOut()) ) )
{
pSI->Compress( pKernArray,rInf.GetIdx(), rInf.GetLen(),
- rInf.GetKanaComp(), (USHORT)aFont.GetSize().Height(),&aPos );
+ rInf.GetKanaComp(), (sal_uInt16)aFont.GetSize().Height(),&aPos );
bSpecialJust = sal_True;
}
///Asian Justification
@@ -1130,7 +1135,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
if ( LANGUAGE_KOREAN != aLang && LANGUAGE_KOREAN_JOHAB != aLang)
{
long nSpaceSum = nSpaceAdd;
- for ( USHORT nI = 0; nI < rInf.GetLen(); ++nI )
+ for ( sal_uInt16 nI = 0; nI < rInf.GetLen(); ++nI )
{
pKernArray[ nI ] += nSpaceSum;
nSpaceSum += nSpaceAdd;
@@ -1228,7 +1233,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
if ( bDirectPrint )
{
const Fraction aTmp( 1, 1 );
- BOOL bStretch = rInf.GetWidth() && ( rInf.GetLen() > 1 ) && bPrt
+ sal_Bool bStretch = rInf.GetWidth() && ( rInf.GetLen() > 1 ) && bPrt
&& ( aTmp != rInf.GetOut().GetMapMode().GetScaleX() );
if ( bSwitchL2R )
@@ -1285,7 +1290,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
if ( rInf.GetFont() && rInf.GetLen() )
{
const SwScriptInfo* pSI = rInf.GetScriptInfo();
- const BYTE nActual = rInf.GetFont()->GetActual();
+ const sal_uInt8 nActual = rInf.GetFont()->GetActual();
// Kana Compression
if ( SW_CJK == nActual && rInf.GetKanaComp() &&
@@ -1294,7 +1299,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
{
pSI->Compress( pKernArray, rInf.GetIdx(), rInf.GetLen(),
rInf.GetKanaComp(),
- (USHORT)aFont.GetSize().Height(), &aPos );
+ (sal_uInt16)aFont.GetSize().Height(), &aPos );
bSpecialJust = sal_True;
}
@@ -1306,7 +1311,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
if ( LANGUAGE_KOREAN != aLang && LANGUAGE_KOREAN_JOHAB != aLang )
{
long nSpaceSum = nSpaceAdd;
- for ( USHORT nI = 0; nI < rInf.GetLen(); ++nI )
+ for ( sal_uInt16 nI = 0; nI < rInf.GetLen(); ++nI )
{
pKernArray[ nI ] += nSpaceSum;
nSpaceSum += nSpaceAdd;
@@ -1438,7 +1443,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
pTmpFont->SetColor( aSaveColor );
}
- rInf.GetOut().DrawStretchText( aPos, (USHORT)nTmpWidth,
+ rInf.GetOut().DrawStretchText( aPos, (sal_uInt16)nTmpWidth,
rInf.GetText(), rInf.GetIdx(), rInf.GetLen() );
}
else
@@ -1454,9 +1459,9 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
{
const String* pStr = &rInf.GetText();
String aStr( aEmptyStr );
- BOOL bBullet = rInf.GetBullet();
+ sal_Bool bBullet = rInf.GetBullet();
if( bSymbol )
- bBullet = FALSE;
+ bBullet = sal_False;
sal_Int32 *pKernArray = new sal_Int32[ rInf.GetLen() ];
CreateScrFont( *rInf.GetShell(), rInf.GetOut() );
long nScrPos;
@@ -1481,7 +1486,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
}
else
{
-// BOOL bRestore = FALSE;
+// sal_Bool bRestore = sal_False;
// MapMode aOld( rInf.GetOut().GetMapMode() );
// if( rInf.GetZoom().GetNumerator() &&
// rInf.GetZoom() != aOld.GetScaleX() )
@@ -1490,7 +1495,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
// aNew.SetScaleX( rInf.GetZoom() );
// aNew.SetScaleY( rInf.GetZoom() );
// rInf.GetOut().SetMapMode( aNew );
-// bRestore = TRUE;
+// bRestore = sal_True;
// }
rInf.GetOut().GetTextArray( rInf.GetText(), pKernArray,
rInf.GetIdx(), rInf.GetLen() );
@@ -1506,7 +1511,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
if ( rInf.GetFont() && rInf.GetLen() )
{
- const BYTE nActual = rInf.GetFont()->GetActual();
+ const sal_uInt8 nActual = rInf.GetFont()->GetActual();
const SwScriptInfo* pSI = rInf.GetScriptInfo();
// Kana Compression
@@ -1517,10 +1522,10 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
Point aTmpPos( aPos );
pSI->Compress( pScrArray, rInf.GetIdx(), rInf.GetLen(),
rInf.GetKanaComp(),
- (USHORT)aFont.GetSize().Height(), &aTmpPos );
+ (sal_uInt16)aFont.GetSize().Height(), &aTmpPos );
pSI->Compress( pKernArray, rInf.GetIdx(), rInf.GetLen(),
rInf.GetKanaComp(),
- (USHORT)aFont.GetSize().Height(), &aPos );
+ (sal_uInt16)aFont.GetSize().Height(), &aPos );
}
// Asian Justification
@@ -1531,7 +1536,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
if ( LANGUAGE_KOREAN != aLang && LANGUAGE_KOREAN_JOHAB != aLang )
{
long nSpaceSum = nSpaceAdd;
- for ( USHORT nI = 0; nI < rInf.GetLen(); ++nI )
+ for ( sal_uInt16 nI = 0; nI < rInf.GetLen(); ++nI )
{
pKernArray[ nI ] += nSpaceSum;
pScrArray[ nI ] += nSpaceSum;
@@ -1632,12 +1637,12 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
xub_Unicode nCh;
// Bei Pairkerning waechst der Printereinfluss auf die Positionierung
- USHORT nMul = 3;
+ sal_uInt16 nMul = 3;
if ( pPrtFont->GetKerning() )
nMul = 1;
- const USHORT nDiv = nMul+1;
+ const sal_uInt16 nDiv = nMul+1;
// In nSpaceSum wird der durch Blocksatz auf die Spaces verteilte
// Zwischenraum aufsummiert.
@@ -1732,19 +1737,19 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
if ( rInf.GetOut().GetConnectMetaFile() )
rInf.GetOut().Push();
- USHORT nWave =
+ sal_uInt16 nWave =
WRONG_SHOW_MEDIUM < nHght ? WAVE_NORMAL :
( WRONG_SHOW_SMALL < nHght ? WAVE_SMALL :
WAVE_FLAT );
Color aCol( rInf.GetOut().GetLineColor() );
- BOOL bColSave = aCol != *pWaveCol;
+ sal_Bool bColSave = aCol != *pWaveCol;
if ( bColSave )
rInf.GetOut().SetLineColor( *pWaveCol );
Point aEnd;
- long nKernVal = pKernArray[ USHORT( rInf.GetLen() - 1 ) ];
+ long nKernVal = pKernArray[ sal_uInt16( rInf.GetLen() - 1 ) ];
- USHORT nDir = bBidiPor ?
+ sal_uInt16 nDir = bBidiPor ?
1800 :
UnMapDirection(
GetFont()->GetOrientation(),
@@ -1877,7 +1882,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
/*************************************************************************
*
* Size SwFntObj::GetTextSize( const OutputDevice *pOut, const String &rTxt,
- * const USHORT nIdx, const USHORT nLen, const short nKern = 0 );
+ * const sal_uInt16 nIdx, const sal_uInt16 nLen, const short nKern = 0 );
*
* Ersterstellung AMA 16. Dez. 94
* Letzte Aenderung AMA 16. Dez. 94
@@ -1906,7 +1911,7 @@ Size SwFntObj::GetTextSize( SwDrawTextInfo& rInf )
if ( pGrid && GRID_LINES_CHARS == pGrid->GetGridType() && pGrid->IsSnapToChars() )
{
const SwDoc* pDoc = rInf.GetShell()->GetDoc();
- const USHORT nGridWidth = GETGRIDWIDTH(pGrid, pDoc);
+ const sal_uInt16 nGridWidth = GETGRIDWIDTH(pGrid, pDoc);
OutputDevice* pOutDev;
@@ -1930,7 +1935,7 @@ Size SwFntObj::GetTextSize( SwDrawTextInfo& rInf )
long nWidthPerChar = aTxtSize.Width() / nLn;
- const ULONG i = nWidthPerChar ?
+ const sal_uLong i = nWidthPerChar ?
( nWidthPerChar - 1 ) / nGridWidth + 1:
1;
@@ -1947,7 +1952,7 @@ Size SwFntObj::GetTextSize( SwDrawTextInfo& rInf )
GETGRID( rInf.GetFrm()->FindPageFrm() )
if ( pGrid && GRID_LINES_CHARS == pGrid->GetGridType() && !pGrid->IsSnapToChars() )
{
- const USHORT nDefaultFontHeight = GetDefaultFontHeight( rInf );
+ const sal_uInt16 nDefaultFontHeight = GetDefaultFontHeight( rInf );
const SwDoc* pDoc = rInf.GetShell()->GetDoc();
long nGridWidthAdd = GETGRIDWIDTH(pGrid, pDoc);
@@ -1976,7 +1981,7 @@ Size SwFntObj::GetTextSize( SwDrawTextInfo& rInf )
}
}
- const BOOL bCompress = rInf.GetKanaComp() && nLn &&
+ const sal_Bool bCompress = rInf.GetKanaComp() && nLn &&
rInf.GetFont() &&
SW_CJK == rInf.GetFont()->GetActual() &&
rInf.GetScriptInfo() &&
@@ -2005,7 +2010,7 @@ Size SwFntObj::GetTextSize( SwDrawTextInfo& rInf )
if( bCompress )
rInf.SetKanaDiff( rInf.GetScriptInfo()->Compress( pKernArray,
rInf.GetIdx(), nLn, rInf.GetKanaComp(),
- (USHORT)aFont.GetSize().Height() ) );
+ (sal_uInt16)aFont.GetSize().Height() ) );
else
rInf.SetKanaDiff( 0 );
@@ -2028,10 +2033,10 @@ Size SwFntObj::GetTextSize( SwDrawTextInfo& rInf )
xub_Unicode nCh;
// Bei Pairkerning waechst der Printereinfluss auf die Positionierung
- USHORT nMul = 3;
+ sal_uInt16 nMul = 3;
if ( pPrtFont->GetKerning() )
nMul = 1;
- const USHORT nDiv = nMul+1;
+ const sal_uInt16 nDiv = nMul+1;
for( xub_StrLen i=1; i<nCnt; i++ )
{
nCh = rInf.GetText().GetChar( rInf.GetIdx() + i );
@@ -2069,7 +2074,7 @@ Size SwFntObj::GetTextSize( SwDrawTextInfo& rInf )
rInf.GetIdx(), nLn );
rInf.SetKanaDiff( rInf.GetScriptInfo()->Compress( pKernArray,
rInf.GetIdx(), nLn, rInf.GetKanaComp(),
- (USHORT) aFont.GetSize().Height() ) );
+ (sal_uInt16) aFont.GetSize().Height() ) );
aTxtSize.Width() = pKernArray[ nLn - 1 ];
delete[] pKernArray;
}
@@ -2120,7 +2125,7 @@ xub_StrLen SwFntObj::GetCrsrOfst( SwDrawTextInfo &rInf )
const SwScriptInfo* pSI = rInf.GetScriptInfo();
if ( rInf.GetFont() && rInf.GetLen() )
{
- const BYTE nActual = rInf.GetFont()->GetActual();
+ const sal_uInt8 nActual = rInf.GetFont()->GetActual();
// Kana Compression
if ( SW_CJK == nActual && rInf.GetKanaComp() &&
@@ -2129,7 +2134,7 @@ xub_StrLen SwFntObj::GetCrsrOfst( SwDrawTextInfo &rInf )
{
pSI->Compress( pKernArray, rInf.GetIdx(), rInf.GetLen(),
rInf.GetKanaComp(),
- (USHORT) aFont.GetSize().Height() );
+ (sal_uInt16) aFont.GetSize().Height() );
}
// Asian Justification
@@ -2140,7 +2145,7 @@ xub_StrLen SwFntObj::GetCrsrOfst( SwDrawTextInfo &rInf )
if ( LANGUAGE_KOREAN != aLang && LANGUAGE_KOREAN_JOHAB != aLang )
{
long nSpaceSum = nSpaceAdd;
- for ( USHORT nI = 0; nI < rInf.GetLen(); ++nI )
+ for ( sal_uInt16 nI = 0; nI < rInf.GetLen(); ++nI )
{
pKernArray[ nI ] += nSpaceSum;
nSpaceSum += nSpaceAdd;
@@ -2194,17 +2199,17 @@ xub_StrLen SwFntObj::GetCrsrOfst( SwDrawTextInfo &rInf )
if ( pGrid && GRID_LINES_CHARS == pGrid->GetGridType() && pGrid->IsSnapToChars() )
{
const SwDoc* pDoc = rInf.GetShell()->GetDoc();
- const USHORT nGridWidth = GETGRIDWIDTH(pGrid, pDoc);
+ const sal_uInt16 nGridWidth = GETGRIDWIDTH(pGrid, pDoc);
long nWidthPerChar = pKernArray[ rInf.GetLen() - 1 ] / rInf.GetLen();
- ULONG i = nWidthPerChar ?
+ sal_uLong i = nWidthPerChar ?
( nWidthPerChar - 1 ) / nGridWidth + 1:
1;
nWidthPerChar = i * nGridWidth;
- nCnt = (USHORT)(rInf.GetOfst() / nWidthPerChar);
+ nCnt = (sal_uInt16)(rInf.GetOfst() / nWidthPerChar);
if ( 2 * ( rInf.GetOfst() - nCnt * nWidthPerChar ) > nWidthPerChar )
++nCnt;
@@ -2221,7 +2226,7 @@ xub_StrLen SwFntObj::GetCrsrOfst( SwDrawTextInfo &rInf )
if ( pGrid && GRID_LINES_CHARS == pGrid->GetGridType() && !pGrid->IsSnapToChars() )
{
- const USHORT nDefaultFontHeight = GetDefaultFontHeight( rInf );
+ const sal_uInt16 nDefaultFontHeight = GetDefaultFontHeight( rInf );
const SwDoc* pDoc = rInf.GetShell()->GetDoc();
long nGridWidthAdd = GETGRIDWIDTH(pGrid, pDoc);
@@ -2313,8 +2318,8 @@ xub_StrLen SwFntObj::GetCrsrOfst( SwDrawTextInfo &rInf )
|*************************************************************************/
SwFntAccess::SwFntAccess( const void* &rMagic,
- USHORT &rIndex, const void *pOwn, ViewShell *pSh,
- BOOL bCheck ) :
+ sal_uInt16 &rIndex, const void *pOwn, ViewShell *pSh,
+ sal_Bool bCheck ) :
SwCacheAccess( *pFntCache, rMagic, rIndex ),
pShell( pSh )
{
@@ -2331,12 +2336,12 @@ SwFntAccess::SwFntAccess( const void* &rMagic,
}
else
// Hier ist der Font nicht bekannt, muss also gesucht werden.
- bCheck = FALSE;
+ bCheck = sal_False;
{
OutputDevice* pOut = 0;
- USHORT nZoom = USHRT_MAX;
+ sal_uInt16 nZoom = USHRT_MAX;
// Get the reference device
if ( pSh )
@@ -2432,7 +2437,7 @@ xub_StrLen SwFont::GetTxtBreak( SwDrawTextInfo& rInf, long nTextWidth )
{
ChgFnt( rInf.GetShell(), rInf.GetOut() );
- const BOOL bCompress = rInf.GetKanaComp() && rInf.GetLen() &&
+ const sal_Bool bCompress = rInf.GetKanaComp() && rInf.GetLen() &&
SW_CJK == GetActual() &&
rInf.GetScriptInfo() &&
rInf.GetScriptInfo()->CountCompChg() &&
@@ -2441,10 +2446,10 @@ xub_StrLen SwFont::GetTxtBreak( SwDrawTextInfo& rInf, long nTextWidth )
ASSERT( !bCompress || ( rInf.GetScriptInfo() && rInf.GetScriptInfo()->
CountCompChg()), "Compression without info" );
- USHORT nTxtBreak = 0;
+ sal_uInt16 nTxtBreak = 0;
long nKern = 0;
- USHORT nLn = ( rInf.GetLen() == STRING_LEN ? rInf.GetText().Len()
+ sal_uInt16 nLn = ( rInf.GetLen() == STRING_LEN ? rInf.GetText().Len()
: rInf.GetLen() );
if ( rInf.GetFrm() && nLn && rInf.SnapToGrid() &&
@@ -2454,7 +2459,7 @@ xub_StrLen SwFont::GetTxtBreak( SwDrawTextInfo& rInf, long nTextWidth )
if ( pGrid && GRID_LINES_CHARS == pGrid->GetGridType() && pGrid->IsSnapToChars() )
{
const SwDoc* pDoc = rInf.GetShell()->GetDoc();
- const USHORT nGridWidth = GETGRIDWIDTH(pGrid, pDoc);
+ const sal_uInt16 nGridWidth = GETGRIDWIDTH(pGrid, pDoc);
sal_Int32* pKernArray = new sal_Int32[rInf.GetLen()];
rInf.GetOut().GetTextArray( rInf.GetText(), pKernArray,
@@ -2462,7 +2467,7 @@ xub_StrLen SwFont::GetTxtBreak( SwDrawTextInfo& rInf, long nTextWidth )
long nWidthPerChar = pKernArray[ rInf.GetLen() - 1 ] / rInf.GetLen();
- const ULONG i = nWidthPerChar ?
+ const sal_uLong i = nWidthPerChar ?
( nWidthPerChar - 1 ) / nGridWidth + 1:
1;
@@ -2487,7 +2492,7 @@ xub_StrLen SwFont::GetTxtBreak( SwDrawTextInfo& rInf, long nTextWidth )
GETGRID( rInf.GetFrm()->FindPageFrm() )
if ( pGrid && GRID_LINES_CHARS == pGrid->GetGridType() && !pGrid->IsSnapToChars() )
{
- const USHORT nDefaultFontHeight = GetDefaultFontHeight( rInf );
+ const sal_uInt16 nDefaultFontHeight = GetDefaultFontHeight( rInf );
const SwDoc* pDoc = rInf.GetShell()->GetDoc();
long nGridWidthAdd = GETGRIDWIDTH(pGrid, pDoc);
@@ -2592,7 +2597,7 @@ xub_StrLen SwFont::GetTxtBreak( SwDrawTextInfo& rInf, long nTextWidth )
rInf.GetOut().GetTextArray( rInf.GetText(), pKernArray,
rInf.GetIdx(), nLn );
if( rInf.GetScriptInfo()->Compress( pKernArray, rInf.GetIdx(), nLn,
- rInf.GetKanaComp(), (USHORT)GetHeight( nActual ) ) )
+ rInf.GetKanaComp(), (sal_uInt16)GetHeight( nActual ) ) )
{
long nKernAdd = nKern;
xub_StrLen nTmpBreak = nTxtBreak;
@@ -2659,7 +2664,7 @@ sal_Bool SwDrawTextInfo::ApplyAutoColor( Font* pFont )
/// OD 21.08.2002 #99657#
/// There is a user defined setting for the background, if there
/// is a background brush and its color is *not* "no fill"/"auto fill".
- if( GetFrm()->GetBackgroundBrush( pItem, pCol, aOrigBackRect, FALSE ) )
+ if( GetFrm()->GetBackgroundBrush( pItem, pCol, aOrigBackRect, sal_False ) )
{
if ( !pCol )
{
diff --git a/sw/source/core/txtnode/fntcap.cxx b/sw/source/core/txtnode/fntcap.cxx
index e38b26ecb9f7..69426bcffa34 100644
--- a/sw/source/core/txtnode/fntcap.cxx
+++ b/sw/source/core/txtnode/fntcap.cxx
@@ -180,7 +180,7 @@ Size SwSubFont::GetCapitalSize( SwDrawTextInfo& rInf )
Point aPos;
rInf.SetPos( aPos );
rInf.SetSpace( 0 );
- rInf.SetDrawSpace( FALSE );
+ rInf.SetDrawSpace( sal_False );
SwDoGetCapitalSize aDo( rInf );
DoOnCapitals( aDo );
Size aTxtSize( aDo.GetSize() );
@@ -271,13 +271,13 @@ xub_StrLen SwFont::GetCapitalBreak( ViewShell* pSh, const OutputDevice* pOut,
// Start:
Point aPos( 0, 0 );
SwDrawTextInfo aInfo(pSh, *(OutputDevice*)pOut, pScript, rTxt, nIdx, nLen,
- 0, FALSE);
+ 0, sal_False);
aInfo.SetPos( aPos );
aInfo.SetSpace( 0 );
aInfo.SetWrong( NULL );
aInfo.SetGrammarCheck( NULL );
aInfo.SetSmartTags( NULL ); // SMARTTAGS
- aInfo.SetDrawSpace( FALSE );
+ aInfo.SetDrawSpace( sal_False );
aInfo.SetKern( CheckKerning() );
aInfo.SetKanaComp( pScript ? 0 : 100 );
aInfo.SetFont( this );
@@ -314,14 +314,14 @@ void SwDoDrawCapital::Init( SwFntObj *pUpperFont, SwFntObj *pLowerFont )
void SwDoDrawCapital::Do()
{
SV_STAT( nDrawText );
- USHORT nOrgWidth = rInf.GetWidth();
- rInf.SetWidth( USHORT(rInf.GetSize().Width()) );
+ sal_uInt16 nOrgWidth = rInf.GetWidth();
+ rInf.SetWidth( sal_uInt16(rInf.GetSize().Width()) );
if ( rInf.GetUpper() )
pUpperFnt->DrawText( rInf );
else
{
- BOOL bOldBullet = rInf.GetBullet();
- rInf.SetBullet( FALSE );
+ sal_Bool bOldBullet = rInf.GetBullet();
+ rInf.SetBullet( sal_False );
pLowerFnt->DrawText( rInf );
rInf.SetBullet( bOldBullet );
}
@@ -342,15 +342,15 @@ void SwDoDrawCapital::DrawSpace( Point &rPos )
long nDiff = rInf.GetPos().X() - rPos.X();
Point aPos( rPos );
- const BOOL bSwitchL2R = rInf.GetFrm()->IsRightToLeft() &&
+ const sal_Bool bSwitchL2R = rInf.GetFrm()->IsRightToLeft() &&
! rInf.IsIgnoreFrmRTL();
if ( bSwitchL2R )
rInf.GetFrm()->SwitchLTRtoRTL( aPos );
- const ULONG nMode = rInf.GetpOut()->GetLayoutMode();
- const BOOL bBidiPor = ( bSwitchL2R !=
+ const sal_uLong nMode = rInf.GetpOut()->GetLayoutMode();
+ const sal_Bool bBidiPor = ( bSwitchL2R !=
( 0 != ( TEXT_LAYOUT_BIDI_RTL & nMode ) ) );
if ( bBidiPor )
@@ -393,9 +393,9 @@ protected:
SwFntObj *pUpperFnt;
SwFntObj *pLowerFnt;
xub_StrLen nCrsr;
- USHORT nOfst;
+ sal_uInt16 nOfst;
public:
- SwDoCapitalCrsrOfst( SwDrawTextInfo &rInfo, const USHORT nOfs ) :
+ SwDoCapitalCrsrOfst( SwDrawTextInfo &rInfo, const sal_uInt16 nOfs ) :
SwDoCapitals( rInfo ), nCrsr( 0 ), nOfst( nOfs )
{ }
virtual void Init( SwFntObj *pUpperFont, SwFntObj *pLowerFont );
@@ -417,7 +417,7 @@ void SwDoCapitalCrsrOfst::Do()
{
if ( nOfst > rInf.GetSize().Width() )
{
- nOfst = nOfst - USHORT(rInf.GetSize().Width());
+ nOfst = nOfst - sal_uInt16(rInf.GetSize().Width());
nCrsr = nCrsr + rInf.GetLen();
}
else
@@ -426,7 +426,7 @@ void SwDoCapitalCrsrOfst::Do()
rInf.GetScriptInfo(),
rInf.GetText(),
rInf.GetIdx(),
- rInf.GetLen(), 0, FALSE );
+ rInf.GetLen(), 0, sal_False );
aDrawInf.SetOfst( nOfst );
aDrawInf.SetKern( rInf.GetKern() );
aDrawInf.SetKanaComp( rInf.GetKanaComp() );
@@ -459,7 +459,7 @@ xub_StrLen SwSubFont::GetCapitalCrsrOfst( SwDrawTextInfo& rInf )
SwDoCapitalCrsrOfst aDo( rInf, rInf.GetOfst() );
Point aPos;
rInf.SetPos( aPos );
- rInf.SetDrawSpace( FALSE );
+ rInf.SetDrawSpace( sal_False );
DoOnCapitals( aDo );
rInf.SetKern( nOldKern );
return aDo.GetCrsr();
@@ -472,12 +472,12 @@ xub_StrLen SwSubFont::GetCapitalCrsrOfst( SwDrawTextInfo& rInf )
class SwDoDrawStretchCapital : public SwDoDrawCapital
{
const xub_StrLen nStrLen;
- const USHORT nCapWidth;
- const USHORT nOrgWidth;
+ const sal_uInt16 nCapWidth;
+ const sal_uInt16 nOrgWidth;
public:
virtual void Do();
- SwDoDrawStretchCapital( SwDrawTextInfo &rInfo, const USHORT nCapitalWidth )
+ SwDoDrawStretchCapital( SwDrawTextInfo &rInfo, const sal_uInt16 nCapitalWidth )
: SwDoDrawCapital( rInfo ),
nStrLen( rInfo.GetLen() ),
nCapWidth( nCapitalWidth ),
@@ -492,7 +492,7 @@ public:
void SwDoDrawStretchCapital::Do()
{
SV_STAT( nDrawStretchText );
- USHORT nPartWidth = USHORT(rInf.GetSize().Width());
+ sal_uInt16 nPartWidth = sal_uInt16(rInf.GetSize().Width());
if( rInf.GetLen() )
{
@@ -504,13 +504,13 @@ void SwDoDrawStretchCapital::Do()
nDiff /= (long) nStrLen;
nDiff += nPartWidth;
if( 0 < nDiff )
- nPartWidth = USHORT(nDiff);
+ nPartWidth = sal_uInt16(nDiff);
}
rInf.ApplyAutoColor();
Point aPos( rInf.GetPos() );
- const BOOL bSwitchL2R = rInf.GetFrm()->IsRightToLeft() &&
+ const sal_Bool bSwitchL2R = rInf.GetFrm()->IsRightToLeft() &&
! rInf.IsIgnoreFrmRTL();
if ( bSwitchL2R )
@@ -543,7 +543,7 @@ void SwSubFont::DrawStretchCapital( SwDrawTextInfo &rInf )
rInf.SetLen( rInf.GetText().Len() );
const Point& rOldPos = rInf.GetPos();
- const USHORT nCapWidth = (USHORT)( GetCapitalSize( rInf ).Width() );
+ const sal_uInt16 nCapWidth = (sal_uInt16)( GetCapitalSize( rInf ).Width() );
rInf.SetPos( rOldPos );
rInf.SetDrawSpace( GetUnderline() != UNDERLINE_NONE ||
@@ -569,7 +569,7 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo )
Size aPartSize;
long nKana = 0;
const XubString aTxt( CalcCaseMap( rDo.GetInf().GetText() ) );
- xub_StrLen nMaxPos = Min( USHORT(rDo.GetInf().GetText().Len()
+ xub_StrLen nMaxPos = Min( sal_uInt16(rDo.GetInf().GetText().Len()
- rDo.GetInf().GetIdx()), rDo.GetInf().GetLen() );
rDo.GetInf().SetLen( nMaxPos );
@@ -596,14 +596,14 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo )
SwFntObj *pSpaceFont = NULL;
const void *pMagic2 = NULL;
- USHORT nIndex2 = 0;
+ sal_uInt16 nIndex2 = 0;
SwSubFont aFont( *this );
Point aStartPos( rDo.GetInf().GetPos() );
- const BOOL bTextLines = aFont.GetUnderline() != UNDERLINE_NONE
+ const sal_Bool bTextLines = aFont.GetUnderline() != UNDERLINE_NONE
|| aFont.GetOverline() != UNDERLINE_NONE
|| aFont.GetStrikeout() != STRIKEOUT_NONE;
- const BOOL bWordWise = bTextLines && aFont.IsWordLineMode() &&
+ const sal_Bool bWordWise = bTextLines && aFont.IsWordLineMode() &&
rDo.GetInf().GetDrawSpace();
const long nTmpKern = rDo.GetInf().GetKern();
@@ -611,7 +611,7 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo )
{
if ( bWordWise )
{
- aFont.SetWordLineMode( FALSE );
+ aFont.SetWordLineMode( sal_False );
pSpaceFontAccess = new SwFntAccess( pMagic2, nIndex2, &aFont,
rDo.GetInf().GetShell() );
pSpaceFont = pSpaceFontAccess->Get();
@@ -633,7 +633,7 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo )
pBigFont = pLastFont;
// Hier entsteht der Kleinbuchstabenfont:
- aFont.SetProportion( BYTE( (aFont.GetPropr()*KAPITAELCHENPROP) / 100L) );
+ aFont.SetProportion( sal_uInt8( (aFont.GetPropr()*KAPITAELCHENPROP) / 100L) );
pMagic2 = NULL;
nIndex2 = 0;
SwFntAccess *pSmallFontAccess = new SwFntAccess( pMagic2, nIndex2, &aFont,
@@ -689,7 +689,7 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo )
rDo.GetInf().SetLen( nPos - nOldPos );
}
- rDo.GetInf().SetUpper( FALSE );
+ rDo.GetInf().SetUpper( sal_False );
rDo.GetInf().SetOut( *pOutSize );
aPartSize = pSmallFont->GetTextSize( rDo.GetInf() );
nKana += rDo.GetInf().GetKanaDiff();
@@ -715,7 +715,7 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo )
do
{
- rDo.GetInf().SetUpper( TRUE );
+ rDo.GetInf().SetUpper( sal_True );
pLastFont = pBigFont;
pLastFont->SetDevFont( rDo.GetInf().GetShell(), rDo.GetOut() );
xub_StrLen nTmp;
diff --git a/sw/source/core/txtnode/ndhints.cxx b/sw/source/core/txtnode/ndhints.cxx
index c4c78fd6d59d..70cd84706ca8 100644
--- a/sw/source/core/txtnode/ndhints.cxx
+++ b/sw/source/core/txtnode/ndhints.cxx
@@ -50,7 +50,7 @@ void DumpHints( const SwpHtStart &rHtStart,
#ifdef DBG_UTIL
aDbstream << "DumpHints:" << endl;
(aDbstream << "\tStarts:" ).WriteNumber(rHtStart.Count()) << endl;
- for( USHORT i = 0; i < rHtStart.Count(); ++i )
+ for( sal_uInt16 i = 0; i < rHtStart.Count(); ++i )
{
const SwTxtAttr *pHt = rHtStart[i];
((((aDbstream << '\t').WriteNumber( i )<< " [").WriteNumber( pHt->Which() )
@@ -81,7 +81,7 @@ inline void DumpHints(const SwpHtStart &, const SwpHtEnd &) { }
* inline IsEqual()
*************************************************************************/
-inline BOOL IsEqual( const SwTxtAttr &rHt1, const SwTxtAttr &rHt2 )
+inline sal_Bool IsEqual( const SwTxtAttr &rHt1, const SwTxtAttr &rHt2 )
{
return (long)(&rHt1) == (long)(&rHt2);
}
@@ -97,7 +97,7 @@ inline BOOL IsEqual( const SwTxtAttr &rHt1, const SwTxtAttr &rHt2 )
// Sortierreihenfolge: Start, Ende (umgekehrt!), Which-Wert (umgekehrt!),
// als letztes die Adresse selbst
-static BOOL lcl_IsLessStart( const SwTxtAttr &rHt1, const SwTxtAttr &rHt2 )
+static sal_Bool lcl_IsLessStart( const SwTxtAttr &rHt1, const SwTxtAttr &rHt2 )
{
if ( *rHt1.GetStart() == *rHt2.GetStart() )
{
@@ -105,14 +105,14 @@ static BOOL lcl_IsLessStart( const SwTxtAttr &rHt1, const SwTxtAttr &rHt2 )
const xub_StrLen nHt2 = *rHt2.GetAnyEnd();
if ( nHt1 == nHt2 )
{
- const USHORT nWhich1 = rHt1.Which();
- const USHORT nWhich2 = rHt2.Which();
+ const sal_uInt16 nWhich1 = rHt1.Which();
+ const sal_uInt16 nWhich2 = rHt2.Which();
if ( nWhich1 == nWhich2 )
{
if ( RES_TXTATR_CHARFMT == nWhich1 )
{
- const USHORT nS1 = static_cast<const SwTxtCharFmt&>(rHt1).GetSortNumber();
- const USHORT nS2 = static_cast<const SwTxtCharFmt&>(rHt2).GetSortNumber();
+ const sal_uInt16 nS1 = static_cast<const SwTxtCharFmt&>(rHt1).GetSortNumber();
+ const sal_uInt16 nS2 = static_cast<const SwTxtCharFmt&>(rHt2).GetSortNumber();
ASSERT( nS1 != nS2, "AUTOSTYLES: lcl_IsLessStart trouble" )
if ( nS1 != nS2 ) // robust
return nS1 < nS2;
@@ -133,7 +133,7 @@ static BOOL lcl_IsLessStart( const SwTxtAttr &rHt1, const SwTxtAttr &rHt2 )
*************************************************************************/
// Zuerst nach Ende danach nach Ptr
-static BOOL lcl_IsLessEnd( const SwTxtAttr &rHt1, const SwTxtAttr &rHt2 )
+static sal_Bool lcl_IsLessEnd( const SwTxtAttr &rHt1, const SwTxtAttr &rHt2 )
{
const xub_StrLen nHt1 = *rHt1.GetAnyEnd();
const xub_StrLen nHt2 = *rHt2.GetAnyEnd();
@@ -141,14 +141,14 @@ static BOOL lcl_IsLessEnd( const SwTxtAttr &rHt1, const SwTxtAttr &rHt2 )
{
if ( *rHt1.GetStart() == *rHt2.GetStart() )
{
- const USHORT nWhich1 = rHt1.Which();
- const USHORT nWhich2 = rHt2.Which();
+ const sal_uInt16 nWhich1 = rHt1.Which();
+ const sal_uInt16 nWhich2 = rHt2.Which();
if ( nWhich1 == nWhich2 )
{
if ( RES_TXTATR_CHARFMT == nWhich1 )
{
- const USHORT nS1 = static_cast<const SwTxtCharFmt&>(rHt1).GetSortNumber();
- const USHORT nS2 = static_cast<const SwTxtCharFmt&>(rHt2).GetSortNumber();
+ const sal_uInt16 nS1 = static_cast<const SwTxtCharFmt&>(rHt1).GetSortNumber();
+ const sal_uInt16 nS2 = static_cast<const SwTxtCharFmt&>(rHt2).GetSortNumber();
ASSERT( nS1 != nS2, "AUTOSTYLES: lcl_IsLessEnd trouble" )
if ( nS1 != nS2 ) // robust
return nS1 > nS2;
@@ -169,9 +169,9 @@ static BOOL lcl_IsLessEnd( const SwTxtAttr &rHt1, const SwTxtAttr &rHt2 )
* SwpHtStart::Seek_Entry()
*************************************************************************/
-BOOL SwpHtStart::Seek_Entry( const SwTxtAttr *pElement, USHORT *pPos ) const
+sal_Bool SwpHtStart::Seek_Entry( const SwTxtAttr *pElement, sal_uInt16 *pPos ) const
{
- USHORT nOben = Count(), nMitte, nUnten = 0;
+ sal_uInt16 nOben = Count(), nMitte, nUnten = 0;
if( nOben > 0 )
{
nOben--;
@@ -182,7 +182,7 @@ BOOL SwpHtStart::Seek_Entry( const SwTxtAttr *pElement, USHORT *pPos ) const
if( IsEqual( *pMitte, *pElement ) )
{
*pPos = nMitte;
- return TRUE;
+ return sal_True;
}
else
if( lcl_IsLessStart( *pMitte, *pElement ) )
@@ -191,23 +191,23 @@ BOOL SwpHtStart::Seek_Entry( const SwTxtAttr *pElement, USHORT *pPos ) const
if( nMitte == 0 )
{
*pPos = nUnten;
- return FALSE;
+ return sal_False;
}
else
nOben = nMitte - 1;
}
}
*pPos = nUnten;
- return FALSE;
+ return sal_False;
}
/*************************************************************************
* SwpHtEnd::Seek_Entry()
*************************************************************************/
-BOOL SwpHtEnd::Seek_Entry( const SwTxtAttr *pElement, USHORT *pPos ) const
+sal_Bool SwpHtEnd::Seek_Entry( const SwTxtAttr *pElement, sal_uInt16 *pPos ) const
{
- USHORT nOben = Count(), nMitte, nUnten = 0;
+ sal_uInt16 nOben = Count(), nMitte, nUnten = 0;
if( nOben > 0 )
{
nOben--;
@@ -218,7 +218,7 @@ BOOL SwpHtEnd::Seek_Entry( const SwTxtAttr *pElement, USHORT *pPos ) const
if( IsEqual( *pMitte, *pElement ) )
{
*pPos = nMitte;
- return TRUE;
+ return sal_True;
}
else
if( lcl_IsLessEnd( *pMitte, *pElement ) )
@@ -227,14 +227,14 @@ BOOL SwpHtEnd::Seek_Entry( const SwTxtAttr *pElement, USHORT *pPos ) const
if( nMitte == 0 )
{
*pPos = nUnten;
- return FALSE;
+ return sal_False;
}
else
nOben = nMitte - 1;
}
}
*pPos = nUnten;
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -245,7 +245,7 @@ void SwpHintsArray::Insert( const SwTxtAttr *pHt )
{
Resort();
#ifdef DBG_UTIL
- USHORT nPos;
+ sal_uInt16 nPos;
ASSERT(!m_HintStarts.Seek_Entry( pHt, &nPos ),
"Insert: hint already in HtStart");
ASSERT(!m_HintEnds.Seek_Entry( pHt, &nPos ),
@@ -261,7 +261,7 @@ void SwpHintsArray::Insert( const SwTxtAttr *pHt )
#endif
}
-void SwpHintsArray::DeleteAtPos( const USHORT nPos )
+void SwpHintsArray::DeleteAtPos( const sal_uInt16 nPos )
{
// optimization: nPos is the position in the Starts array
const SwTxtAttr *pHt = m_HintStarts[ nPos ];
@@ -269,7 +269,7 @@ void SwpHintsArray::DeleteAtPos( const USHORT nPos )
Resort();
- USHORT nEndPos;
+ sal_uInt16 nEndPos;
m_HintEnds.Seek_Entry( pHt, &nEndPos );
m_HintEnds.Remove( nEndPos );
#ifdef DBG_UTIL
@@ -306,7 +306,7 @@ bool SwpHintsArray::Check() const
const SwTxtAttr *pLastStart = 0;
const SwTxtAttr *pLastEnd = 0;
- for( USHORT i = 0; i < Count(); ++i )
+ for( sal_uInt16 i = 0; i < Count(); ++i )
{
// --- Start-Kontrolle ---
@@ -358,7 +358,7 @@ bool SwpHintsArray::Check() const
CHECK_ERR( STRING_LEN != nIdx, "HintsCheck: no GetEndOf" );
// 7a) character attributes in array?
- USHORT nWhich = pHt->Which();
+ sal_uInt16 nWhich = pHt->Which();
CHECK_ERR( !isCHRATR(nWhich),
"HintsCheck: Character attribute in start array" );
@@ -390,7 +390,7 @@ bool SwpHintsArray::Check() const
// 9) nesting portion check
if (pHtThis->IsNesting())
{
- for ( USHORT j = 0; j < Count(); ++j )
+ for ( sal_uInt16 j = 0; j < Count(); ++j )
{
SwTxtAttr const * const pOther( m_HintStarts[j] );
if ( pOther->IsNesting() && (i != j) )
@@ -408,7 +408,7 @@ bool SwpHintsArray::Check() const
// 10) dummy char check (unfortunately cannot check SwTxtNode::m_Text)
if (pHtThis->HasDummyChar())
{
- for ( USHORT j = 0; j < i; ++j )
+ for ( sal_uInt16 j = 0; j < i; ++j )
{
SwTxtAttr const * const pOther( m_HintStarts[j] );
if (pOther->HasDummyChar())
@@ -438,7 +438,7 @@ bool SwpHintsArray::Resort()
{
bool bResort = false;
const SwTxtAttr *pLast = 0;
- USHORT i;
+ sal_uInt16 i;
for ( i = 0; i < m_HintStarts.Count(); ++i )
{
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index ff7a6a20b899..3e0ecc88c9ca 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -62,6 +62,7 @@
#include <charfmt.hxx>
#include <ndtxt.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <docary.hxx>
#include <pam.hxx> // fuer SwPosition
#include <fldbas.hxx>
@@ -144,8 +145,8 @@ SwTxtNode *SwNodes::MakeTxtNode( const SwNodeIndex & rWhere,
// 1. den Nachfolger nehmen
// 2. den Vorgaenger
- SwNode *pNd;
- switch( ( pNd = (*this)[aTmp] )->GetNodeType() )
+ SwNode * pNd = & aTmp.GetNode();
+ switch (pNd->GetNodeType())
{
case ND_TABLENODE:
((SwTableNode*)pNd)->MakeFrms( aIdx );
@@ -177,7 +178,7 @@ SwTxtNode *SwNodes::MakeTxtNode( const SwNodeIndex & rWhere,
{
if( pNd->StartOfSectionNode()->GetSectionNode()->GetSection().IsHiddenFlag())
{
- if( !GoPrevSection( &aTmp, TRUE, FALSE ) ||
+ if( !GoPrevSection( &aTmp, sal_True, sal_False ) ||
aTmp.GetNode().FindTableNode() !=
pNode->FindTableNode() )
return pNode; // schade, das wars
@@ -201,7 +202,7 @@ SwTxtNode *SwNodes::MakeTxtNode( const SwNodeIndex & rWhere,
return pNode;
break;
}
- } while( TRUE );
+ } while( sal_True );
}
// --------------------
@@ -264,7 +265,7 @@ SwTxtNode::~SwTxtNode()
SwpHints* pTmpHints = m_pSwpHints;
m_pSwpHints = 0;
- for( USHORT j = pTmpHints->Count(); j; )
+ for( sal_uInt16 j = pTmpHints->Count(); j; )
// erst muss das Attribut aus dem Array entfernt werden,
// denn sonst wuerde es sich selbst loeschen (Felder) !!!!
DestroyAttr( pTmpHints->GetTextHint( --j ) );
@@ -313,7 +314,7 @@ void lcl_ChangeFtnRef( SwTxtNode &rNode )
// of node <rNode> in order to invalidate position of its first content.
// Thus, in its <MakeAll()> it will checked its position relative to its reference.
SwFtnFrm* pFirstFtnOfNode = 0;
- for( USHORT j = pSwpHints->Count(); j; )
+ for( sal_uInt16 j = pSwpHints->Count(); j; )
{
pHt = pSwpHints->GetTextHint(--j);
if (RES_TXTATR_FTN == pHt->Which())
@@ -330,7 +331,7 @@ void lcl_ChangeFtnRef( SwTxtNode &rNode )
SwCntntNode *pNd = aIdx.GetNode().GetCntntNode();
if ( !pNd )
pNd = pFrm->GetAttrSet()->GetDoc()->
- GetNodes().GoNextSection( &aIdx, TRUE, FALSE );
+ GetNodes().GoNextSection( &aIdx, sal_True, sal_False );
if ( !pNd )
continue;
@@ -351,7 +352,7 @@ void lcl_ChangeFtnRef( SwTxtNode &rNode )
{
pFtn->SetRef( pFrm );
pFtn = pFtn->GetFollow();
- ((SwTxtFrm*)pFrm)->SetFtn( TRUE );
+ ((SwTxtFrm*)pFrm)->SetFtn( sal_True );
}
}
#ifdef DBG_UTIL
@@ -383,7 +384,7 @@ SwCntntNode *SwTxtNode::SplitCntntNode( const SwPosition &rPos )
const xub_StrLen nSplitPos = rPos.nContent.GetIndex();
const xub_StrLen nTxtLen = m_Text.Len();
SwTxtNode* const pNode =
- _MakeNewTxtNode( rPos.nNode, FALSE, nSplitPos==nTxtLen );
+ _MakeNewTxtNode( rPos.nNode, sal_False, nSplitPos==nTxtLen );
// the first paragraph gets the XmlId,
// _except_ if it is empty and the second is not empty
@@ -476,7 +477,7 @@ SwCntntNode *SwTxtNode::SplitCntntNode( const SwPosition &rPos )
// Attribute loeschen
if ( HasHints() )
{
- for ( USHORT j = m_pSwpHints->Count(); j; )
+ for ( sal_uInt16 j = m_pSwpHints->Count(); j; )
{
SwTxtAttr* const pHt = m_pSwpHints->GetTextHint( --j );
if ( RES_TXTATR_FLYCNT == pHt ->Which() )
@@ -509,7 +510,7 @@ SwCntntNode *SwTxtNode::SplitCntntNode( const SwPosition &rPos )
if ( IsInCache() )
{
SwFrm::GetCache().Delete( this );
- SetInCache( FALSE );
+ SetInCache( sal_False );
}
UnlockModify(); // Benachrichtigungen wieder freischalten
@@ -565,7 +566,7 @@ SwCntntNode *SwTxtNode::SplitCntntNode( const SwPosition &rPos )
// Attribute loeschen
if ( HasHints() )
{
- for ( USHORT j = m_pSwpHints->Count(); j; )
+ for ( sal_uInt16 j = m_pSwpHints->Count(); j; )
{
SwTxtAttr* const pHt = m_pSwpHints->GetTextHint( --j );
const xub_StrLen* const pEnd = pHt->GetEnd();
@@ -612,7 +613,7 @@ SwCntntNode *SwTxtNode::SplitCntntNode( const SwPosition &rPos )
//muesten. #56977# #55001# #56135#
const SfxPoolItem *pItem;
if( GetDepends() && SFX_ITEM_SET == pNode->GetSwAttrSet().
- GetItemState( RES_PAGEDESC, TRUE, &pItem ) )
+ GetItemState( RES_PAGEDESC, sal_True, &pItem ) )
{
pNode->ModifyNotification( (SfxPoolItem*)pItem, (SfxPoolItem*)pItem );
}
@@ -623,7 +624,7 @@ SwCntntNode *SwTxtNode::SplitCntntNode( const SwPosition &rPos )
void SwTxtNode::MoveTxtAttr_To_AttrSet()
{
ASSERT( m_pSwpHints, "MoveTxtAttr_To_AttrSet without SwpHints?" );
- for ( USHORT i = 0; m_pSwpHints && i < m_pSwpHints->Count(); ++i )
+ for ( sal_uInt16 i = 0; m_pSwpHints && i < m_pSwpHints->Count(); ++i )
{
SwTxtAttr *pHt = m_pSwpHints->GetTextHint(i);
@@ -729,7 +730,7 @@ SwCntntNode *SwTxtNode::JoinNext()
if( pTxtNode->HasAnyIndex() )
{
// alle Crsr/StkCrsr/UnoCrsr aus dem Loeschbereich verschieben
- pDoc->CorrAbs( aIdx, SwPosition( *this ), nOldLen, TRUE );
+ pDoc->CorrAbs( aIdx, SwPosition( *this ), nOldLen, sal_True );
}
rNds.Delete(aIdx);
SetWrong( pList, false );
@@ -738,7 +739,7 @@ SwCntntNode *SwTxtNode::JoinNext()
InvalidateNumRule();
}
else {
- ASSERT( FALSE, "kein TxtNode." );
+ ASSERT( sal_False, "kein TxtNode." );
}
return this;
@@ -824,7 +825,7 @@ SwCntntNode *SwTxtNode::JoinPrev()
if( pTxtNode->HasAnyIndex() )
{
// alle Crsr/StkCrsr/UnoCrsr aus dem Loeschbereich verschieben
- pDoc->CorrAbs( aIdx, SwPosition( *this ), nLen, TRUE );
+ pDoc->CorrAbs( aIdx, SwPosition( *this ), nLen, sal_True );
}
rNds.Delete(aIdx);
SetWrong( pList, false );
@@ -833,7 +834,7 @@ SwCntntNode *SwTxtNode::JoinPrev()
InvalidateNumRule();
}
else {
- ASSERT( FALSE, "kein TxtNode." );
+ ASSERT( sal_False, "kein TxtNode." );
}
return this;
@@ -866,7 +867,7 @@ void SwTxtNode::NewAttrSet( SwAttrPool& rPool )
void SwTxtNode::Update( SwIndex const & rPos, const xub_StrLen nChangeLen,
const bool bNegative, const bool bDelete )
{
- SetAutoCompleteWordDirty( TRUE );
+ SetAutoCompleteWordDirty( sal_True );
::std::auto_ptr<TmpHints> pCollector;
const xub_StrLen nChangePos = rPos.GetIndex();
@@ -876,7 +877,7 @@ void SwTxtNode::Update( SwIndex const & rPos, const xub_StrLen nChangeLen,
if ( bNegative )
{
const xub_StrLen nChangeEnd = nChangePos + nChangeLen;
- for ( USHORT n = 0; n < m_pSwpHints->Count(); ++n )
+ for ( sal_uInt16 n = 0; n < m_pSwpHints->Count(); ++n )
{
SwTxtAttr * const pHint = m_pSwpHints->GetTextHint(n);
xub_StrLen * const pStart = pHint->GetStart();
@@ -915,13 +916,13 @@ void SwTxtNode::Update( SwIndex const & rPos, const xub_StrLen nChangeLen,
{
bool bNoExp = false;
bool bResort = false;
- const USHORT coArrSz = static_cast<USHORT>(RES_TXTATR_WITHEND_END) -
- static_cast<USHORT>(RES_CHRATR_BEGIN);
+ const sal_uInt16 coArrSz = static_cast<sal_uInt16>(RES_TXTATR_WITHEND_END) -
+ static_cast<sal_uInt16>(RES_CHRATR_BEGIN);
- BOOL aDontExp[ coArrSz ];
- memset( &aDontExp, 0, coArrSz * sizeof(BOOL) );
+ sal_Bool aDontExp[ coArrSz ];
+ memset( &aDontExp, 0, coArrSz * sizeof(sal_Bool) );
- for ( USHORT n = 0; n < m_pSwpHints->Count(); ++n )
+ for ( sal_uInt16 n = 0; n < m_pSwpHints->Count(); ++n )
{
SwTxtAttr * const pHint = m_pSwpHints->GetTextHint(n);
xub_StrLen * const pStart = pHint->GetStart();
@@ -942,13 +943,13 @@ void SwTxtNode::Update( SwIndex const & rPos, const xub_StrLen nChangeLen,
}
else // *pEnd == nChangePos
{
- USHORT nWhPos;
- const USHORT nWhich = pHint->Which();
+ sal_uInt16 nWhPos;
+ const sal_uInt16 nWhich = pHint->Which();
ASSERT(!isCHRATR(nWhich), "Update: char attr hint?");
if (isCHRATR(nWhich) || isTXTATR_WITHEND(nWhich))
{
- nWhPos = static_cast<USHORT>(nWhich -
+ nWhPos = static_cast<sal_uInt16>(nWhich -
RES_CHRATR_BEGIN);
}
else
@@ -964,13 +965,13 @@ void SwTxtNode::Update( SwIndex const & rPos, const xub_StrLen nChangeLen,
if ( pHint->IsCharFmtAttr() )
{
bNoExp = true;
- aDontExp[ static_cast<USHORT>(RES_TXTATR_CHARFMT) - static_cast<USHORT>(RES_CHRATR_BEGIN) ]
- = TRUE;
- aDontExp[ static_cast<USHORT>(RES_TXTATR_INETFMT) - static_cast<USHORT>(RES_CHRATR_BEGIN) ]
- = TRUE;
+ aDontExp[ static_cast<sal_uInt16>(RES_TXTATR_CHARFMT) - static_cast<sal_uInt16>(RES_CHRATR_BEGIN) ]
+ = sal_True;
+ aDontExp[ static_cast<sal_uInt16>(RES_TXTATR_INETFMT) - static_cast<sal_uInt16>(RES_CHRATR_BEGIN) ]
+ = sal_True;
}
else
- aDontExp[ nWhPos ] = TRUE;
+ aDontExp[ nWhPos ] = sal_True;
}
else if( bNoExp )
{
@@ -978,8 +979,8 @@ void SwTxtNode::Update( SwIndex const & rPos, const xub_StrLen nChangeLen,
{
pCollector.reset( new TmpHints );
}
- USHORT nCollCnt = pCollector->Count();
- for( USHORT i = 0; i < nCollCnt; ++i )
+ sal_uInt16 nCollCnt = pCollector->Count();
+ for( sal_uInt16 i = 0; i < nCollCnt; ++i )
{
SwTxtAttr *pTmp = (*pCollector)[ i ];
if( nWhich == pTmp->Which() )
@@ -1013,7 +1014,7 @@ void SwTxtNode::Update( SwIndex const & rPos, const xub_StrLen nChangeLen,
if ( !bNegative && !bDelete )
{
const SwRedlineTbl& rTbl = GetDoc()->GetRedlineTbl();
- for ( USHORT i = 0; i < rTbl.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rTbl.Count(); ++i )
{
SwRedline *const pRedl = rTbl[ i ];
if ( pRedl->HasMark() )
@@ -1078,8 +1079,8 @@ void SwTxtNode::Update( SwIndex const & rPos, const xub_StrLen nChangeLen,
if ( pCollector.get() )
{
- const USHORT nCount = pCollector->Count();
- for ( USHORT i = 0; i < nCount; ++i )
+ const sal_uInt16 nCount = pCollector->Count();
+ for ( sal_uInt16 i = 0; i < nCount; ++i )
{
m_pSwpHints->TryInsertHint( (*pCollector)[ i ], *this );
}
@@ -1095,8 +1096,8 @@ void SwTxtNode::_ChgTxtCollUpdateNum( const SwTxtFmtColl *pOldColl,
ASSERT( pDoc, "Kein Doc?" );
// erfrage die OutlineLevel und update gegebenenfalls das Nodes-Array,
// falls sich die Level geaendert haben !
- //const BYTE nOldLevel = pOldColl ? pOldColl->GetOutlineLevel():NO_NUMBERING;//#outline level,removed by zhaojianwei
- //const BYTE nNewLevel = pNewColl ? pNewColl->GetOutlineLevel():NO_NUMBERING;//<-end,zhaojianwei
+ //const sal_uInt8 nOldLevel = pOldColl ? pOldColl->GetOutlineLevel():NO_NUMBERING;//#outline level,removed by zhaojianwei
+ //const sal_uInt8 nNewLevel = pNewColl ? pNewColl->GetOutlineLevel():NO_NUMBERING;//<-end,zhaojianwei
const int nOldLevel = pOldColl && pOldColl->IsAssignedToListLevelOfOutlineStyle() ?
pOldColl->GetAssignedOutlineStyleLevel() : MAXLEVEL;
const int nNewLevel = pNewColl && pNewColl->IsAssignedToListLevelOfOutlineStyle() ?
@@ -1138,8 +1139,8 @@ void SwTxtNode::_ChgTxtCollUpdateNum( const SwTxtFmtColl *pOldColl,
// Wenn man sich genau am Ende einer Text- bzw. INetvorlage befindet,
// bekommt diese das DontExpand-Flag verpasst
-BOOL SwTxtNode::DontExpandFmt( const SwIndex& rIdx, bool bFlag,
- BOOL bFmtToTxtAttributes )
+sal_Bool SwTxtNode::DontExpandFmt( const SwIndex& rIdx, bool bFlag,
+ sal_Bool bFmtToTxtAttributes )
{
const xub_StrLen nIdx = rIdx.GetIndex();
if ( bFmtToTxtAttributes && nIdx == m_Text.Len() )
@@ -1147,11 +1148,11 @@ BOOL SwTxtNode::DontExpandFmt( const SwIndex& rIdx, bool bFlag,
FmtToTxtAttr( this );
}
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if ( HasHints() )
{
- const USHORT nEndCnt = m_pSwpHints->GetEndCount();
- USHORT nPos = nEndCnt;
+ const sal_uInt16 nEndCnt = m_pSwpHints->GetEndCount();
+ sal_uInt16 nPos = nEndCnt;
while( nPos )
{
SwTxtAttr *pTmp = m_pSwpHints->GetEnd( --nPos );
@@ -1163,7 +1164,7 @@ BOOL SwTxtNode::DontExpandFmt( const SwIndex& rIdx, bool bFlag,
else if( bFlag != pTmp->DontExpand() && !pTmp->IsLockExpandFlag()
&& *pEnd > *pTmp->GetStart())
{
- bRet = TRUE;
+ bRet = sal_True;
m_pSwpHints->NoteInHistory( pTmp );
pTmp->SetDontExpand( bFlag );
}
@@ -1195,7 +1196,7 @@ lcl_GetTxtAttrs(
xub_StrLen const nIndex, RES_TXTATR const nWhich,
enum SwTxtNode::GetTxtAttrMode const eMode)
{
- USHORT const nSize = (pSwpHints) ? pSwpHints->Count() : 0;
+ sal_uInt16 const nSize = (pSwpHints) ? pSwpHints->Count() : 0;
xub_StrLen nPreviousIndex(0); // index of last hint with nWhich
bool (*pMatchFunc)(xub_StrLen const, xub_StrLen const, xub_StrLen const)=0;
switch (eMode)
@@ -1206,7 +1207,7 @@ lcl_GetTxtAttrs(
default: OSL_ASSERT(false);
}
- for( USHORT i = 0; i < nSize; ++i )
+ for( sal_uInt16 i = 0; i < nSize; ++i )
{
SwTxtAttr *const pHint = pSwpHints->GetTextHint(i);
xub_StrLen const nHintStart( *(pHint->GetStart()) );
@@ -1286,8 +1287,8 @@ SwCharFmt* lcl_FindCharFmt( const SwCharFmts* pCharFmts, const XubString& rName
if( rName.Len() )
{
SwCharFmt* pFmt;
- USHORT nArrLen = pCharFmts->Count();
- for( USHORT i = 1; i < nArrLen; i++ )
+ sal_uInt16 nArrLen = pCharFmts->Count();
+ for( sal_uInt16 i = 1; i < nArrLen; i++ )
{
pFmt = (*pCharFmts)[ i ];
if( pFmt->GetName().CompareTo( rName ) == COMPARE_EQUAL )
@@ -1297,7 +1298,7 @@ SwCharFmt* lcl_FindCharFmt( const SwCharFmts* pCharFmts, const XubString& rName
return NULL;
}
-void lcl_CopyHint( const USHORT nWhich, const SwTxtAttr * const pHt,
+void lcl_CopyHint( const sal_uInt16 nWhich, const SwTxtAttr * const pHt,
SwTxtAttr *const pNewHt, SwDoc *const pOtherDoc, SwTxtNode *const pDest )
{
ASSERT( nWhich == pHt->Which(), "Falsche Hint-Id" );
@@ -1436,7 +1437,7 @@ void SwTxtNode::CopyAttr( SwTxtNode *pDest, const xub_StrLen nTxtStartIdx,
SwDoc* const pOtherDoc = (pDest->GetDoc() != GetDoc()) ?
pDest->GetDoc() : 0;
- for ( USHORT i = 0; i < m_pSwpHints->Count(); i++ )
+ for ( sal_uInt16 i = 0; i < m_pSwpHints->Count(); i++ )
{
SwTxtAttr *const pHt = m_pSwpHints->GetTextHint(i);
xub_StrLen const nAttrStartIdx = *pHt->GetStart();
@@ -1450,7 +1451,7 @@ void SwTxtNode::CopyAttr( SwTxtNode *pDest, const xub_StrLen nTxtStartIdx,
( *pEndIdx == nTxtStartIdx &&
nAttrStartIdx == nTxtStartIdx ) ) )
{
- USHORT const nWhich = pHt->Which();
+ sal_uInt16 const nWhich = pHt->Which();
if ( RES_TXTATR_REFMARK != nWhich )
{
// attribute in the area => copy
@@ -1600,7 +1601,8 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest,
}
}
- const bool bUndoNodes = !pOtherDoc && GetDoc()->GetUndoNds() == &GetNodes();
+ bool const bUndoNodes = !pOtherDoc
+ && GetDoc()->GetIDocumentUndoRedo().IsUndoNodes(GetNodes());
// Ende erst jetzt holen, weil beim Kopieren in sich selbst der
// Start-Index und alle Attribute vorher aktualisiert werden.
@@ -1610,7 +1612,7 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest,
// 2. Attribute kopieren
// durch das Attribute-Array, bis der Anfang des Geltungsbereiches
// des Attributs hinter dem zu kopierenden Bereich liegt
- const USHORT nSize = m_pSwpHints ? m_pSwpHints->Count() : 0;
+ const sal_uInt16 nSize = m_pSwpHints ? m_pSwpHints->Count() : 0;
// wird in sich selbst kopiert, dann kann beim Einfuegen ein
// Attribut geloescht werden. Darum erst ins Tmp-Array kopieren und
@@ -1620,9 +1622,9 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest,
// Del-Array fuer alle RefMarks ohne Ausdehnung
SwpHts aRefMrkArr;
- USHORT nDeletedDummyChars(0);
+ sal_uInt16 nDeletedDummyChars(0);
//Achtung: kann ungueltig sein!!
- for (USHORT n = 0; ( n < nSize ); ++n)
+ for (sal_uInt16 n = 0; ( n < nSize ); ++n)
{
const xub_StrLen nAttrStartIdx = *(*m_pSwpHints)[n]->GetStart();
if (!( nAttrStartIdx < nEnd))
@@ -1630,7 +1632,7 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest,
SwTxtAttr * const pHt = m_pSwpHints->GetTextHint(n);
const xub_StrLen * const pEndIdx = pHt->GetEnd();
- const USHORT nWhich = pHt->Which();
+ const sal_uInt16 nWhich = pHt->Which();
// JP 26.04.94: REFMARK's werden nie kopiert. Hat das Refmark aber
// keinen Bereich umspannt, so steht im Text ein 255
@@ -1720,14 +1722,14 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest,
// nur falls im Array Attribute stehen (kann nur beim Kopieren
// sich selbst passieren!!)
- for ( USHORT i = 0; i < aArr.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < aArr.Count(); ++i )
{
InsertHint( aArr[ i ], nsSetAttrMode::SETATTR_NOTXTATRCHR );
}
if( pDest->GetpSwpHints() )
{
- for ( USHORT i = 0; i < aRefMrkArr.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < aRefMrkArr.Count(); ++i )
{
SwTxtAttr * const pNewHt = aRefMrkArr[i];
if( pNewHt->GetEnd() )
@@ -1751,7 +1753,7 @@ void SwTxtNode::InsertText( const XubString & rStr, const SwIndex & rIdx,
const IDocumentContentOperations::InsertFlags nMode )
{
ASSERT( rIdx <= m_Text.Len(), "SwTxtNode::InsertText: invalid index." );
- ASSERT( (ULONG)m_Text.Len() + (ULONG)rStr.Len() <= STRING_LEN,
+ ASSERT( (sal_uLong)m_Text.Len() + (sal_uLong)rStr.Len() <= STRING_LEN,
"SwTxtNode::InsertText: node text with insertion > STRING_LEN." );
xub_StrLen aPos = rIdx.GetIndex();
@@ -1761,10 +1763,10 @@ void SwTxtNode::InsertText( const XubString & rStr, const SwIndex & rIdx,
if ( !nLen ) return;
- BOOL bOldExpFlg = IsIgnoreDontExpand();
+ sal_Bool bOldExpFlg = IsIgnoreDontExpand();
if (nMode & IDocumentContentOperations::INS_FORCEHINTEXPAND)
{
- SetIgnoreDontExpand( TRUE );
+ SetIgnoreDontExpand( sal_True );
}
Update( rIdx, nLen ); // text content changed!
@@ -1776,11 +1778,11 @@ void SwTxtNode::InsertText( const XubString & rStr, const SwIndex & rIdx,
// analog zu Insert(char) in txtedt.cxx:
// 1) bei bHintExp leere Hints an rIdx.GetIndex suchen und aufspannen
- // 2) bei bHintExp == FALSE mitgezogene Feldattribute zuruecksetzen
+ // 2) bei bHintExp == sal_False mitgezogene Feldattribute zuruecksetzen
if ( HasHints() )
{
- for ( USHORT i = 0; i < m_pSwpHints->Count() &&
+ for ( sal_uInt16 i = 0; i < m_pSwpHints->Count() &&
rIdx >= *(*m_pSwpHints)[i]->GetStart(); ++i )
{
SwTxtAttr * const pHt = m_pSwpHints->GetTextHint( i );
@@ -1806,7 +1808,7 @@ void SwTxtNode::InsertText( const XubString & rStr, const SwIndex & rIdx,
&& (*pEndIdx == *pHt->GetStart()) )
{
*pHt->GetStart() = *pHt->GetStart() - nLen;
- const USHORT nAktLen = m_pSwpHints->Count();
+ const sal_uInt16 nAktLen = m_pSwpHints->Count();
m_pSwpHints->DeleteAtPos(i);
InsertHint( pHt/* AUTOSTYLES:, nsSetAttrMode::SETATTR_NOHINTADJUST*/ );
if ( nAktLen > m_pSwpHints->Count() && i )
@@ -1924,7 +1926,7 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart,
// 2. Attribute verschieben
// durch das Attribute-Array, bis der Anfang des Geltungsbereiches
// des Attributs hinter dem zu verschiebenden Bereich liegt
- USHORT nAttrCnt = 0;
+ sal_uInt16 nAttrCnt = 0;
while ( m_pSwpHints && nAttrCnt < m_pSwpHints->Count() )
{
SwTxtAttr * const pHt = m_pSwpHints->GetTextHint(nAttrCnt);
@@ -1932,7 +1934,7 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart,
if (!( nAttrStartIdx < nEnd ))
break;
const xub_StrLen * const pEndIdx = pHt->GetEnd();
- const USHORT nWhich = pHt->Which();
+ const sal_uInt16 nWhich = pHt->Which();
SwTxtAttr *pNewHt = 0;
if(nAttrStartIdx < nTxtStartIdx)
@@ -1986,7 +1988,7 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart,
if( bUpdate )
{
// Update aller Indizies
- Update( rDestStart, nLen, FALSE, TRUE );
+ Update( rDestStart, nLen, sal_False, sal_True );
}
#ifdef CUTNOEXPAND
else
@@ -1995,7 +1997,7 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart,
{
// check if there was the end of an attribute at the insertion
// position: if it is not a field, it must be expanded
- for ( USHORT n = 0; n < m_pSwpHints->Count(); n++ )
+ for ( sal_uInt16 n = 0; n < m_pSwpHints->Count(); n++ )
{
SwTxtAttr * const pHt = m_pSwpHints->GetTextHint(n);
const xub_StrLen * const pEndIdx = pHt->GetEnd();
@@ -2008,7 +2010,7 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart,
#endif
CHECK_SWPHINTS(this);
- Update( rStart, nLen, TRUE, TRUE );
+ Update( rStart, nLen, sal_True, sal_True );
CHECK_SWPHINTS(this);
@@ -2022,7 +2024,7 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart,
nDestStart = nDestStart - nLen;
}
- for ( USHORT n = 0; n < aArr.Count(); ++n )
+ for ( sal_uInt16 n = 0; n < aArr.Count(); ++n )
{
SwTxtAttr *const pNewHt = aArr[n];
*pNewHt->GetStart() = nDestStart + *pNewHt->GetStart();
@@ -2045,7 +2047,7 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart,
if( bUpdate )
{
// Update aller Indizies
- pDest->Update( rDestStart, nLen, FALSE, TRUE);
+ pDest->Update( rDestStart, nLen, sal_False, sal_True);
}
#ifdef CUTNOEXPAND
else
@@ -2054,7 +2056,7 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart,
{
// check if there was the end of an attribute at the insertion
// position: if it is not a field, it must be expanded
- for ( USHORT n = 0; n < pDest->m_pSwpHints->Count(); n++ )
+ for ( sal_uInt16 n = 0; n < pDest->m_pSwpHints->Count(); n++ )
{
SwTxtAttr * const pHt = pDest->m_pSwpHints->GetTextHint(n);
const xub_StrLen * const pEndIdx = pHt->GetEnd();
@@ -2070,8 +2072,8 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart,
const xub_StrLen nEnd = rStart.GetIndex() + nLen;
SwDoc* const pOtherDoc = (pDest->GetDoc() != GetDoc())
? pDest->GetDoc() : 0;
- const bool bUndoNodes =
- !pOtherDoc && GetDoc()->GetUndoNds() == &GetNodes();
+ bool const bUndoNodes = !pOtherDoc
+ && GetDoc()->GetIDocumentUndoRedo().IsUndoNodes(GetNodes());
ASSERT(!pOtherDoc,
"mst: entering dead and bitrotted code; fasten your seatbelts!");
@@ -2102,7 +2104,7 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart,
// 2. Attribute verschieben
// durch das Attribute-Array, bis der Anfang des Geltungsbereiches
// des Attributs hinter dem zu verschiebenden Bereich liegt
- USHORT nAttrCnt = 0;
+ sal_uInt16 nAttrCnt = 0;
while ( m_pSwpHints && (nAttrCnt < m_pSwpHints->Count()) )
{
SwTxtAttr * const pHt = m_pSwpHints->GetTextHint(nAttrCnt);
@@ -2110,7 +2112,7 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart,
if (!( nAttrStartIdx < nEnd ))
break;
const xub_StrLen * const pEndIdx = pHt->GetEnd();
- const USHORT nWhich = pHt->Which();
+ const sal_uInt16 nWhich = pHt->Which();
SwTxtAttr *pNewHt = 0;
// if the hint has a dummy character, then it must not be split!
@@ -2209,9 +2211,9 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart,
++nAttrCnt;
}
}
- Update( rStart, nLen, TRUE, TRUE );
+ Update( rStart, nLen, sal_True, sal_True );
- for ( USHORT n = 0; n < aArr.Count(); ++n )
+ for ( sal_uInt16 n = 0; n < aArr.Count(); ++n )
{
SwTxtAttr * const pHt = aArr[ n ];
*pHt->GetStart() = *pHt->GetEnd() = rStart.GetIndex();
@@ -2220,7 +2222,7 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart,
}
else
{
- Update( rStart, nLen, TRUE, TRUE );
+ Update( rStart, nLen, sal_True, sal_True );
}
CHECK_SWPHINTS(this);
@@ -2252,7 +2254,7 @@ void SwTxtNode::EraseText(const SwIndex &rIdx, const xub_StrLen nCount,
* die im Bereich liegen und nicht am Ende des Bereiches liegen
*/
- for ( USHORT i = 0; m_pSwpHints && i < m_pSwpHints->Count(); ++i )
+ for ( sal_uInt16 i = 0; m_pSwpHints && i < m_pSwpHints->Count(); ++i )
{
SwTxtAttr *pHt = m_pSwpHints->GetTextHint(i);
@@ -2265,7 +2267,7 @@ void SwTxtNode::EraseText(const SwIndex &rIdx, const xub_StrLen nCount,
break; // hints are sorted by end, so break here
const xub_StrLen* pHtEndIdx = pHt->GetEnd();
- const USHORT nWhich = pHt->Which();
+ const sal_uInt16 nWhich = pHt->Which();
if( !pHtEndIdx )
{
@@ -2322,7 +2324,7 @@ void SwTxtNode::EraseText(const SwIndex &rIdx, const xub_StrLen nCount,
TryDeleteSwpHints();
- Update( rIdx, nCnt, TRUE );
+ Update( rIdx, nCnt, sal_True );
if( 1 == nCnt )
{
@@ -2361,12 +2363,12 @@ void SwTxtNode::GCAttr()
return;
bool bChanged = false;
- USHORT nMin = m_Text.Len(),
+ sal_uInt16 nMin = m_Text.Len(),
nMax = 0;
- BOOL bAll = nMin != 0; // Bei leeren Absaetzen werden nur die
+ sal_Bool bAll = nMin != 0; // Bei leeren Absaetzen werden nur die
// INet-Formate entfernt.
- for ( USHORT i = 0; m_pSwpHints && i < m_pSwpHints->Count(); ++i )
+ for ( sal_uInt16 i = 0; m_pSwpHints && i < m_pSwpHints->Count(); ++i )
{
SwTxtAttr * const pHt = m_pSwpHints->GetTextHint(i);
@@ -2399,7 +2401,7 @@ void SwTxtNode::GCAttr()
}
// #i23726#
-SwNumRule* SwTxtNode::_GetNumRule(BOOL bInParent) const
+SwNumRule* SwTxtNode::_GetNumRule(sal_Bool bInParent) const
{
SwNumRule* pRet = 0;
@@ -2421,12 +2423,12 @@ SwNumRule* SwTxtNode::_GetNumRule(BOOL bInParent) const
if ( pRet && pRet == GetDoc()->GetOutlineNumRule() &&
( !HasSwAttrSet() ||
SFX_ITEM_SET !=
- GetpSwAttrSet()->GetItemState( RES_PARATR_NUMRULE, FALSE ) ) )
+ GetpSwAttrSet()->GetItemState( RES_PARATR_NUMRULE, sal_False ) ) )
{
SwTxtFmtColl* pColl = GetTxtColl();
if ( pColl )
{
- const SwNumRuleItem& rDirectItem = pColl->GetNumRule( FALSE );
+ const SwNumRuleItem& rDirectItem = pColl->GetNumRule( sal_False );
if ( rDirectItem.GetValue().Len() == 0 )
{
pRet = 0L;
@@ -2453,7 +2455,7 @@ SwNumRule* SwTxtNode::_GetNumRule(BOOL bInParent) const
// if ( HasSwAttrSet() ) // does text node has hard attributes ?
// {
// if ( SFX_ITEM_SET !=
-// GetpSwAttrSet()->GetItemState( RES_PARATR_NUMRULE, FALSE, &pItem ) )
+// GetpSwAttrSet()->GetItemState( RES_PARATR_NUMRULE, sal_False, &pItem ) )
// {
// pItem = 0L;
// }
@@ -2482,7 +2484,7 @@ SwNumRule* SwTxtNode::_GetNumRule(BOOL bInParent) const
// if (pColl)
// {
-// const SwNumRuleItem & rItem = pColl->GetNumRule(TRUE);
+// const SwNumRuleItem & rItem = pColl->GetNumRule(sal_True);
// pRet = const_cast<SwDoc *>(GetDoc())->
// FindNumRulePtrWithPool(rItem.GetValue());
@@ -2494,7 +2496,7 @@ SwNumRule* SwTxtNode::_GetNumRule(BOOL bInParent) const
// // the outline numbering rule.
// if ( pRet && pRet == GetDoc()->GetOutlineNumRule() )
// {
-// const SwNumRuleItem& rDirectItem = pColl->GetNumRule(FALSE);
+// const SwNumRuleItem& rDirectItem = pColl->GetNumRule(sal_False);
// SwNumRule* pNumRuleAtParaStyle = const_cast<SwDoc*>(GetDoc())->
// FindNumRulePtrWithPool(rDirectItem.GetValue());
// if ( !pNumRuleAtParaStyle )
@@ -2515,7 +2517,7 @@ SwNumRule* SwTxtNode::_GetNumRule(BOOL bInParent) const
return pRet;
}
-SwNumRule* SwTxtNode::GetNumRule(BOOL bInParent) const
+SwNumRule* SwTxtNode::GetNumRule(sal_Bool bInParent) const
{
SwNumRule * pRet = _GetNumRule(bInParent);
@@ -2538,9 +2540,9 @@ void SwTxtNode::NumRuleChgd()
if( IsInCache() )
{
SwFrm::GetCache().Delete( this );
- SetInCache( FALSE );
+ SetInCache( sal_False );
}
- SetInSwFntCache( FALSE );
+ SetInSwFntCache( sal_False );
// Sending "noop" modify in order to cause invalidations of registered
// <SwTxtFrm> instances to get the list style change respectively the change
@@ -2553,13 +2555,13 @@ void SwTxtNode::NumRuleChgd()
}
// -> #i27615#
-BOOL SwTxtNode::IsNumbered() const
+sal_Bool SwTxtNode::IsNumbered() const
{
- BOOL bResult = FALSE;
+ sal_Bool bResult = sal_False;
SwNumRule* pRule = GetNum() ? GetNum()->GetNumRule() : 0L;
if ( pRule && IsCountedInList() )
- bResult = TRUE;
+ bResult = sal_True;
return bResult;
}
@@ -2580,8 +2582,8 @@ bool SwTxtNode::HasMarkedLabel() const
// <--
// <- #i27615#
-SwTxtNode* SwTxtNode::_MakeNewTxtNode( const SwNodeIndex& rPos, BOOL bNext,
- BOOL bChgFollow )
+SwTxtNode* SwTxtNode::_MakeNewTxtNode( const SwNodeIndex& rPos, sal_Bool bNext,
+ sal_Bool bChgFollow )
{
/* hartes PageBreak/PageDesc/ColumnBreak aus AUTO-Set ignorieren */
SwAttrSet* pNewAttrSet = 0;
@@ -2597,38 +2599,38 @@ SwTxtNode* SwTxtNode::_MakeNewTxtNode( const SwNodeIndex& rPos, BOOL bNext,
pTmpSet = pNewAttrSet;
// PageBreaks/PageDesc/ColBreak rausschmeissen.
- BOOL bRemoveFromCache = FALSE;
- std::vector<USHORT> aClearWhichIds;
+ sal_Bool bRemoveFromCache = sal_False;
+ std::vector<sal_uInt16> aClearWhichIds;
if ( bNext )
bRemoveFromCache = ( 0 != pNewAttrSet->ClearItem( RES_PAGEDESC ) );
else
aClearWhichIds.push_back( RES_PAGEDESC );
- if( SFX_ITEM_SET == pTmpSet->GetItemState( RES_BREAK, FALSE ) )
+ if( SFX_ITEM_SET == pTmpSet->GetItemState( RES_BREAK, sal_False ) )
{
if ( bNext )
pNewAttrSet->ClearItem( RES_BREAK );
else
aClearWhichIds.push_back( RES_BREAK );
- bRemoveFromCache = TRUE;
+ bRemoveFromCache = sal_True;
}
- if( SFX_ITEM_SET == pTmpSet->GetItemState( RES_KEEP, FALSE ) )
+ if( SFX_ITEM_SET == pTmpSet->GetItemState( RES_KEEP, sal_False ) )
{
if ( bNext )
pNewAttrSet->ClearItem( RES_KEEP );
else
aClearWhichIds.push_back( RES_KEEP );
- bRemoveFromCache = TRUE;
+ bRemoveFromCache = sal_True;
}
- if( SFX_ITEM_SET == pTmpSet->GetItemState( RES_PARATR_SPLIT, FALSE ) )
+ if( SFX_ITEM_SET == pTmpSet->GetItemState( RES_PARATR_SPLIT, sal_False ) )
{
if ( bNext )
pNewAttrSet->ClearItem( RES_PARATR_SPLIT );
else
aClearWhichIds.push_back( RES_PARATR_SPLIT );
- bRemoveFromCache = TRUE;
+ bRemoveFromCache = sal_True;
}
- if(SFX_ITEM_SET == pTmpSet->GetItemState(RES_PARATR_NUMRULE, FALSE))
+ if(SFX_ITEM_SET == pTmpSet->GetItemState(RES_PARATR_NUMRULE, sal_False))
{
SwNumRule * pRule = GetNumRule();
@@ -2645,7 +2647,7 @@ SwTxtNode* SwTxtNode::_MakeNewTxtNode( const SwNodeIndex& rPos, BOOL bNext,
bClearHardSetNumRuleWhenFmtCollChanges = true;
// <--
}
- bRemoveFromCache = TRUE;
+ bRemoveFromCache = sal_True;
}
}
@@ -2655,7 +2657,7 @@ SwTxtNode* SwTxtNode::_MakeNewTxtNode( const SwNodeIndex& rPos, BOOL bNext,
if( !bNext && bRemoveFromCache && IsInCache() )
{
SwFrm::GetCache().Delete( this );
- SetInCache( FALSE );
+ SetInCache( sal_False );
}
}
SwNodes& rNds = GetNodes();
@@ -2697,12 +2699,12 @@ SwTxtNode* SwTxtNode::_MakeNewTxtNode( const SwNodeIndex& rPos, BOOL bNext,
// --> OD 2007-07-10 #i75353#
if ( bClearHardSetNumRuleWhenFmtCollChanges )
{
- std::vector<USHORT> aClearWhichIds;
+ std::vector<sal_uInt16> aClearWhichIds;
aClearWhichIds.push_back( RES_PARATR_NUMRULE );
if ( ClearItemsFromAttrSet( aClearWhichIds ) != 0 && IsInCache() )
{
SwFrm::GetCache().Delete( this );
- SetInCache( FALSE );
+ SetInCache( sal_False );
}
}
// <--
@@ -2717,7 +2719,7 @@ SwCntntNode* SwTxtNode::AppendNode( const SwPosition & rPos )
{
// Position hinter dem eingefuegt wird
SwNodeIndex aIdx( rPos.nNode, 1 );
- SwTxtNode* pNew = _MakeNewTxtNode( aIdx, TRUE );
+ SwTxtNode* pNew = _MakeNewTxtNode( aIdx, sal_True );
// --> OD 2008-05-14 #refactorlists#
// reset list attributes at appended text node
@@ -2752,7 +2754,7 @@ SwTxtAttr * SwTxtNode::GetTxtAttrForCharAt( const xub_StrLen nIndex,
{
if ( HasHints() )
{
- for ( USHORT i = 0; i < m_pSwpHints->Count(); ++i )
+ for ( sal_uInt16 i = 0; i < m_pSwpHints->Count(); ++i )
{
SwTxtAttr * const pHint = m_pSwpHints->GetTextHint(i);
const xub_StrLen nStartPos = *pHint->GetStart();
@@ -2771,14 +2773,14 @@ SwTxtAttr * SwTxtNode::GetTxtAttrForCharAt( const xub_StrLen nIndex,
}
// -> #i29560#
-BOOL SwTxtNode::HasNumber() const
+sal_Bool SwTxtNode::HasNumber() const
{
- BOOL bResult = FALSE;
+ sal_Bool bResult = sal_False;
const SwNumRule* pRule = GetNum() ? GetNum()->GetNumRule() : 0L;
if ( pRule )
{
- SwNumFmt aFmt(pRule->Get( static_cast<USHORT>(GetActualListLevel())));
+ SwNumFmt aFmt(pRule->Get( static_cast<sal_uInt16>(GetActualListLevel())));
// #i40041#
bResult = aFmt.IsEnumeration() &&
@@ -2788,14 +2790,14 @@ BOOL SwTxtNode::HasNumber() const
return bResult;
}
-BOOL SwTxtNode::HasBullet() const
+sal_Bool SwTxtNode::HasBullet() const
{
- BOOL bResult = FALSE;
+ sal_Bool bResult = sal_False;
const SwNumRule* pRule = GetNum() ? GetNum()->GetNumRule() : 0L;
if ( pRule )
{
- SwNumFmt aFmt(pRule->Get( static_cast<USHORT>(GetActualListLevel())));
+ SwNumFmt aFmt(pRule->Get( static_cast<sal_uInt16>(GetActualListLevel())));
bResult = aFmt.IsItemize();
}
@@ -2818,14 +2820,14 @@ XubString SwTxtNode::GetNumString( const bool _bInclPrefixAndSuffixStrings, cons
IsCountedInList() )
{
SvxNumberType const& rNumberType(
- pRule->Get( static_cast<USHORT>(GetActualListLevel()) ) );
+ pRule->Get( static_cast<sal_uInt16>(GetActualListLevel()) ) );
if (rNumberType.IsTxtFmt() ||
// #b6432095#
(style::NumberingType::NUMBER_NONE == rNumberType.GetNumberingType()))
{
return pRule->MakeNumString( GetNum()->GetNumberVector(),
- _bInclPrefixAndSuffixStrings ? TRUE : FALSE,
- FALSE,
+ _bInclPrefixAndSuffixStrings ? sal_True : sal_False,
+ sal_False,
_nRestrictToThisLevel );
}
}
@@ -2833,13 +2835,13 @@ XubString SwTxtNode::GetNumString( const bool _bInclPrefixAndSuffixStrings, cons
return aEmptyStr;
}
-long SwTxtNode::GetLeftMarginWithNum( BOOL bTxtLeft ) const
+long SwTxtNode::GetLeftMarginWithNum( sal_Bool bTxtLeft ) const
{
long nRet = 0;
const SwNumRule* pRule = GetNum() ? GetNum()->GetNumRule() : 0L;
if( pRule )
{
- const SwNumFmt& rFmt = pRule->Get(static_cast<USHORT>(GetActualListLevel()));
+ const SwNumFmt& rFmt = pRule->Get(static_cast<sal_uInt16>(GetActualListLevel()));
// --> OD 2008-01-16 #newlistlevelattrs#
if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
@@ -2878,9 +2880,9 @@ long SwTxtNode::GetLeftMarginWithNum( BOOL bTxtLeft ) const
return nRet;
}
-BOOL SwTxtNode::GetFirstLineOfsWithNum( short& rFLOffset ) const
+sal_Bool SwTxtNode::GetFirstLineOfsWithNum( short& rFLOffset ) const
{
- BOOL bRet( FALSE );
+ sal_Bool bRet( sal_False );
// --> OD 2009-09-08 #i95907#, #b6879723#
rFLOffset = 0;
// <--
@@ -2892,10 +2894,10 @@ BOOL SwTxtNode::GetFirstLineOfsWithNum( short& rFLOffset ) const
if ( IsCountedInList() )
{
// --> OD 2008-01-16 #newlistlevelattrs#
- const SwNumFmt& rFmt = pRule->Get(static_cast<USHORT>(GetActualListLevel()));
+ const SwNumFmt& rFmt = pRule->Get(static_cast<sal_uInt16>(GetActualListLevel()));
if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
- rFLOffset = pRule->Get( static_cast<USHORT>(GetActualListLevel() )).GetFirstLineOffset();
+ rFLOffset = pRule->Get( static_cast<sal_uInt16>(GetActualListLevel() )).GetFirstLineOffset();
if (!getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING))
{
@@ -2907,7 +2909,7 @@ BOOL SwTxtNode::GetFirstLineOfsWithNum( short& rFLOffset ) const
{
if ( AreListLevelIndentsApplicable() )
{
- rFLOffset = static_cast<USHORT>(rFmt.GetFirstLineIndent());
+ rFLOffset = static_cast<sal_uInt16>(rFmt.GetFirstLineIndent());
}
else if (!getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING))
{
@@ -2918,7 +2920,7 @@ BOOL SwTxtNode::GetFirstLineOfsWithNum( short& rFLOffset ) const
// <--
}
- bRet = TRUE;
+ bRet = sal_True;
}
else
{
@@ -2936,7 +2938,7 @@ SwTwips SwTxtNode::GetAdditionalIndentForStartingNewList() const
const SwNumRule* pRule = GetNum() ? GetNum()->GetNumRule() : 0L;
if ( pRule )
{
- const SwNumFmt& rFmt = pRule->Get(static_cast<USHORT>(GetActualListLevel()));
+ const SwNumFmt& rFmt = pRule->Get(static_cast<sal_uInt16>(GetActualListLevel()));
if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
nAdditionalIndent = GetSwAttrSet().GetLRSpace().GetLeft();
@@ -2981,7 +2983,7 @@ void SwTxtNode::ClearLRSpaceItemDueToListLevelIndents( SvxLRSpaceItem& o_rLRSpac
const SwNumRule* pRule = GetNumRule();
if ( pRule && GetActualListLevel() >= 0 )
{
- const SwNumFmt& rFmt = pRule->Get(static_cast<USHORT>(GetActualListLevel()));
+ const SwNumFmt& rFmt = pRule->Get(static_cast<sal_uInt16>(GetActualListLevel()));
if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT )
{
SvxLRSpaceItem aLR( RES_LR_SPACE );
@@ -3001,7 +3003,7 @@ long SwTxtNode::GetLeftMarginForTabCalculation() const
const SwNumRule* pRule = GetNum() ? GetNum()->GetNumRule() : 0;
if( pRule )
{
- const SwNumFmt& rFmt = pRule->Get(static_cast<USHORT>(GetActualListLevel()));
+ const SwNumFmt& rFmt = pRule->Get(static_cast<sal_uInt16>(GetActualListLevel()));
if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT )
{
if ( AreListLevelIndentsApplicable() )
@@ -3021,7 +3023,7 @@ long SwTxtNode::GetLeftMarginForTabCalculation() const
// <--
void SwTxtNode::Replace0xFF( XubString& rTxt, xub_StrLen& rTxtStt,
- xub_StrLen nEndPos, BOOL bExpandFlds ) const
+ xub_StrLen nEndPos, sal_Bool bExpandFlds ) const
{
if( GetpSwpHints() )
{
@@ -3099,7 +3101,7 @@ XubString SwTxtNode::GetExpandTxt( const xub_StrLen nIdx,
{
XubString aTxt( GetTxt().Copy( nIdx, nLen ) );
xub_StrLen nTxtStt = nIdx;
- Replace0xFF( aTxt, nTxtStt, aTxt.Len(), TRUE );
+ Replace0xFF( aTxt, nTxtStt, aTxt.Len(), sal_True );
if( bWithNum )
{
XubString aListLabelStr = GetNumString();
@@ -3130,12 +3132,12 @@ XubString SwTxtNode::GetExpandTxt( const xub_StrLen nIdx,
}
// <--
-BOOL SwTxtNode::GetExpandTxt( SwTxtNode& rDestNd, const SwIndex* pDestIdx,
- xub_StrLen nIdx, xub_StrLen nLen, BOOL bWithNum,
- BOOL bWithFtn, BOOL bReplaceTabsWithSpaces ) const
+sal_Bool SwTxtNode::GetExpandTxt( SwTxtNode& rDestNd, const SwIndex* pDestIdx,
+ xub_StrLen nIdx, xub_StrLen nLen, sal_Bool bWithNum,
+ sal_Bool bWithFtn, sal_Bool bReplaceTabsWithSpaces ) const
{
if( &rDestNd == this )
- return FALSE;
+ return sal_False;
SwIndex aDestIdx( &rDestNd, rDestNd.GetTxt().Len() );
if( pDestIdx )
@@ -3149,7 +3151,7 @@ BOOL SwTxtNode::GetExpandTxt( SwTxtNode& rDestNd, const SwIndex* pDestIdx,
// mask hidden characters
const xub_Unicode cChar = CH_TXTATR_BREAKWORD;
- USHORT nHiddenChrs =
+ sal_uInt16 nHiddenChrs =
SwScriptInfo::MaskHiddenRanges( *this, sTmpText, 0, sTmpText.Len(), cChar );
sTmpText = sTmpText.Copy( nIdx, nLen );
@@ -3160,11 +3162,11 @@ BOOL SwTxtNode::GetExpandTxt( SwTxtNode& rDestNd, const SwIndex* pDestIdx,
if ( HasHints() )
{
xub_StrLen nInsPos = nDestStt - nIdx;
- for ( USHORT i = 0; i < m_pSwpHints->Count(); i++ )
+ for ( sal_uInt16 i = 0; i < m_pSwpHints->Count(); i++ )
{
const SwTxtAttr* pHt = (*m_pSwpHints)[i];
const xub_StrLen nAttrStartIdx = *pHt->GetStart();
- const USHORT nWhich = pHt->Which();
+ const sal_uInt16 nWhich = pHt->Which();
if (nIdx + nLen <= nAttrStartIdx)
break; // ueber das Textende
@@ -3271,7 +3273,7 @@ BOOL SwTxtNode::GetExpandTxt( SwTxtNode& rDestNd, const SwIndex* pDestIdx,
}
}
- return TRUE;
+ return sal_True;
}
const ModelToViewHelper::ConversionMap*
@@ -3284,7 +3286,7 @@ const ModelToViewHelper::ConversionMap*
const SwpHints* pSwpHints2 = GetpSwpHints();
xub_StrLen nPos = 0;
- for ( USHORT i = 0; pSwpHints2 && i < pSwpHints2->Count(); ++i )
+ for ( sal_uInt16 i = 0; pSwpHints2 && i < pSwpHints2->Count(); ++i )
{
const SwTxtAttr* pAttr = (*pSwpHints2)[i];
if ( RES_TXTATR_FIELD == pAttr->Which() )
@@ -3315,15 +3317,15 @@ const ModelToViewHelper::ConversionMap*
}
XubString SwTxtNode::GetRedlineTxt( xub_StrLen nIdx, xub_StrLen nLen,
- BOOL bExpandFlds, BOOL bWithNum ) const
+ sal_Bool bExpandFlds, sal_Bool bWithNum ) const
{
SvUShorts aRedlArr;
const SwDoc* pDoc = GetDoc();
- USHORT nRedlPos = pDoc->GetRedlinePos( *this, nsRedlineType_t::REDLINE_DELETE );
+ sal_uInt16 nRedlPos = pDoc->GetRedlinePos( *this, nsRedlineType_t::REDLINE_DELETE );
if( USHRT_MAX != nRedlPos )
{
// es existiert fuer den Node irgendein Redline-Delete-Object
- const ULONG nNdIdx = GetIndex();
+ const sal_uLong nNdIdx = GetIndex();
for( ; nRedlPos < pDoc->GetRedlineTbl().Count() ; ++nRedlPos )
{
const SwRedline* pTmp = pDoc->GetRedlineTbl()[ nRedlPos ];
@@ -3362,7 +3364,7 @@ XubString SwTxtNode::GetRedlineTxt( xub_StrLen nIdx, xub_StrLen nLen,
XubString aTxt( GetTxt().Copy( nIdx, nLen ) );
xub_StrLen nTxtStt = nIdx, nIdxEnd = nIdx + aTxt.Len();
- for( USHORT n = 0; n < aRedlArr.Count(); n += 2 )
+ for( sal_uInt16 n = 0; n < aRedlArr.Count(); n += 2 )
{
xub_StrLen nStt = aRedlArr[ n ], nEnd = aRedlArr[ n+1 ];
if( ( nIdx <= nStt && nStt <= nIdxEnd ) ||
@@ -3418,8 +3420,8 @@ void SwTxtNode::ReplaceText( const SwIndex& rStart, const xub_StrLen nDelLen,
}
}
- BOOL bOldExpFlg = IsIgnoreDontExpand();
- SetIgnoreDontExpand( TRUE );
+ sal_Bool bOldExpFlg = IsIgnoreDontExpand();
+ SetIgnoreDontExpand( sal_True );
if( nLen && rText.Len() )
{
@@ -3467,7 +3469,7 @@ namespace {
const SfxPoolItem* pOldValue,
const SfxPoolItem* pNewValue )
{
- const USHORT nWhich = pOldValue ? pOldValue->Which() :
+ const sal_uInt16 nWhich = pOldValue ? pOldValue->Which() :
pNewValue ? pNewValue->Which() : 0 ;
bool bNumRuleSet = false;
bool bParagraphStyleChanged = false;
@@ -3517,7 +3519,7 @@ namespace {
// --> OD 2008-12-19 #i70748#
// The former list style set at the paragraph can not be
// retrieved from the change set.
-// if ( dynamic_cast<const SwAttrSetChg*>(pOldValue)->GetChgSet()->GetItemState( RES_PARATR_NUMRULE, FALSE, &pItem ) ==
+// if ( dynamic_cast<const SwAttrSetChg*>(pOldValue)->GetChgSet()->GetItemState( RES_PARATR_NUMRULE, sal_False, &pItem ) ==
// SFX_ITEM_SET )
// {
// sOldNumRule = dynamic_cast<const SwNumRuleItem*>(pItem)->GetValue();
@@ -3529,7 +3531,7 @@ namespace {
sOldNumRule = pFormerNumRuleAtTxtNode->GetName();
}
// <--
- if ( dynamic_cast<const SwAttrSetChg*>(pNewValue)->GetChgSet()->GetItemState( RES_PARATR_NUMRULE, FALSE, &pItem ) ==
+ if ( dynamic_cast<const SwAttrSetChg*>(pNewValue)->GetChgSet()->GetItemState( RES_PARATR_NUMRULE, sal_False, &pItem ) ==
SFX_ITEM_SET )
{
// --> OD 2008-11-19 #i70748#
@@ -3657,7 +3659,7 @@ namespace {
false );
// <--
// --> OD 2008-11-19 #i70748#
- if ( dynamic_cast<const SfxUInt16Item &>(rTxtNode.GetAttr( RES_PARATR_OUTLINELEVEL, FALSE )).GetValue() > 0 )
+ if ( dynamic_cast<const SfxUInt16Item &>(rTxtNode.GetAttr( RES_PARATR_OUTLINELEVEL, sal_False )).GetValue() > 0 )
{
rTxtNode.SetEmptyListStyleDueToSetOutlineLevelAttr();
}
@@ -3823,7 +3825,7 @@ void SwTxtNode::SetAttrOutlineLevel(int nLevel)
if ( 0 <= nLevel && nLevel <= MAXLEVEL )
{
SetAttr( SfxUInt16Item( RES_PARATR_OUTLINELEVEL,
- static_cast<UINT16>(nLevel) ) );
+ static_cast<sal_uInt16>(nLevel) ) );
}
}
//<-end
@@ -3865,7 +3867,7 @@ void SwTxtNode::SetAttrListLevel( int nLevel )
}
SfxInt16Item aNewListLevelItem( RES_PARATR_LIST_LEVEL,
- static_cast<INT16>(nLevel) );
+ static_cast<sal_Int16>(nLevel) );
SetAttr( aNewListLevelItem );
}
// <--
@@ -3873,7 +3875,7 @@ void SwTxtNode::SetAttrListLevel( int nLevel )
bool SwTxtNode::HasAttrListLevel() const
{
return GetpSwAttrSet() &&
- GetpSwAttrSet()->GetItemState( RES_PARATR_LIST_LEVEL, FALSE ) == SFX_ITEM_SET;
+ GetpSwAttrSet()->GetItemState( RES_PARATR_LIST_LEVEL, sal_False ) == SFX_ITEM_SET;
}
// <--
// --> OD 2008-02-27 #refactorlists#
@@ -3907,7 +3909,7 @@ void SwTxtNode::SetListRestart( bool bRestart )
else
{
SfxBoolItem aNewIsRestartItem( RES_PARATR_LIST_ISRESTART,
- TRUE );
+ sal_True );
SetAttr( aNewIsRestartItem );
}
}
@@ -3938,7 +3940,7 @@ bool SwTxtNode::HasVisibleNumberingOrBullet() const
// --> OD 2008-03-19 #i87154#
// Correction of #newlistlevelattrs#:
// The numbering type has to be checked for bullet lists.
- const SwNumFmt& rFmt = pRule->Get( static_cast<USHORT>(GetActualListLevel() ));
+ const SwNumFmt& rFmt = pRule->Get( static_cast<sal_uInt16>(GetActualListLevel() ));
if ( SVX_NUM_NUMBER_NONE != rFmt.GetNumberingType() ||
pRule->MakeNumString( *(GetNum()) ).Len() > 0 )
{
@@ -3967,7 +3969,7 @@ void SwTxtNode::SetAttrListRestartValue( SwNumberTree::tSwNumTreeNumber nNumber
else
{
SfxInt16Item aNewListRestartValueItem( RES_PARATR_LIST_RESTARTVALUE,
- static_cast<INT16>(nNumber) );
+ static_cast<sal_Int16>(nNumber) );
SetAttr( aNewListRestartValueItem );
}
}
@@ -3978,7 +3980,7 @@ void SwTxtNode::SetAttrListRestartValue( SwNumberTree::tSwNumTreeNumber nNumber
bool SwTxtNode::HasAttrListRestartValue() const
{
return GetpSwAttrSet() &&
- GetpSwAttrSet()->GetItemState( RES_PARATR_LIST_RESTARTVALUE, FALSE ) == SFX_ITEM_SET;
+ GetpSwAttrSet()->GetItemState( RES_PARATR_LIST_RESTARTVALUE, sal_False ) == SFX_ITEM_SET;
}
// <--
SwNumberTree::tSwNumTreeNumber SwTxtNode::GetAttrListRestartValue() const
@@ -4007,7 +4009,7 @@ SwNumberTree::tSwNumTreeNumber SwTxtNode::GetActualListStartValue() const
if ( pRule )
{
const SwNumFmt* pFmt =
- pRule->GetNumFmt( static_cast<USHORT>(GetAttrListLevel()) );
+ pRule->GetNumFmt( static_cast<sal_uInt16>(GetAttrListLevel()) );
if ( pFmt )
{
nListRestartValue = pFmt->GetStart();
@@ -4046,7 +4048,7 @@ void SwTxtNode::SetCountedInList( bool bCounted )
}
else
{
- SfxBoolItem aIsCountedInListItem( RES_PARATR_LIST_ISCOUNTED, FALSE );
+ SfxBoolItem aIsCountedInListItem( RES_PARATR_LIST_ISCOUNTED, sal_False );
SetAttr( aIsCountedInListItem );
}
}
@@ -4198,13 +4200,13 @@ bool SwTxtNode::AreListLevelIndentsApplicable() const
bAreListLevelIndentsApplicable = false;
}
else if ( HasSwAttrSet() &&
- GetpSwAttrSet()->GetItemState( RES_LR_SPACE, FALSE ) == SFX_ITEM_SET )
+ GetpSwAttrSet()->GetItemState( RES_LR_SPACE, sal_False ) == SFX_ITEM_SET )
{
// paragraph has hard-set indent attributes
bAreListLevelIndentsApplicable = false;
}
else if ( HasSwAttrSet() &&
- GetpSwAttrSet()->GetItemState( RES_PARATR_NUMRULE, FALSE ) == SFX_ITEM_SET )
+ GetpSwAttrSet()->GetItemState( RES_PARATR_NUMRULE, sal_False ) == SFX_ITEM_SET )
{
// list style is directly applied to paragraph and paragraph has no
// hard-set indent attributes
@@ -4219,14 +4221,14 @@ bool SwTxtNode::AreListLevelIndentsApplicable() const
const SwTxtFmtColl* pColl = GetTxtColl();
while ( pColl )
{
- if ( pColl->GetAttrSet().GetItemState( RES_LR_SPACE, FALSE ) == SFX_ITEM_SET )
+ if ( pColl->GetAttrSet().GetItemState( RES_LR_SPACE, sal_False ) == SFX_ITEM_SET )
{
// indent attributes found in the paragraph style hierarchy.
bAreListLevelIndentsApplicable = false;
break;
}
- if ( pColl->GetAttrSet().GetItemState( RES_PARATR_NUMRULE, FALSE ) == SFX_ITEM_SET )
+ if ( pColl->GetAttrSet().GetItemState( RES_PARATR_NUMRULE, sal_False ) == SFX_ITEM_SET )
{
// paragraph style with the list style found and until now no
// indent attributes are found in the paragraph style hierarchy.
@@ -4262,7 +4264,7 @@ bool SwTxtNode::GetListTabStopPosition( long& nListTabStopPosition ) const
const SwNumRule* pNumRule = GetNum() ? GetNum()->GetNumRule() : 0;
if ( pNumRule && HasVisibleNumberingOrBullet() && GetActualListLevel() >= 0 )
{
- const SwNumFmt& rFmt = pNumRule->Get( static_cast<USHORT>(GetActualListLevel()) );
+ const SwNumFmt& rFmt = pNumRule->Get( static_cast<sal_uInt16>(GetActualListLevel()) );
if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT &&
rFmt.GetLabelFollowedBy() == SvxNumberFormat::LISTTAB )
{
@@ -4305,7 +4307,7 @@ XubString SwTxtNode::GetLabelFollowedBy() const
const SwNumRule* pNumRule = GetNum() ? GetNum()->GetNumRule() : 0;
if ( pNumRule && HasVisibleNumberingOrBullet() && GetActualListLevel() >= 0 )
{
- const SwNumFmt& rFmt = pNumRule->Get( static_cast<USHORT>(GetActualListLevel()) );
+ const SwNumFmt& rFmt = pNumRule->Get( static_cast<sal_uInt16>(GetActualListLevel()) );
if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT )
{
switch ( rFmt.GetLabelFollowedBy() )
@@ -4478,7 +4480,7 @@ namespace {
const SfxBoolItem& aListIsRestartItem =
dynamic_cast<const SfxBoolItem&>(pItem);
if ( aListIsRestartItem.GetValue() !=
- (mrTxtNode.IsListRestart() ? TRUE : FALSE) )
+ (mrTxtNode.IsListRestart() ? sal_True : sal_False) )
{
mbUpdateListRestart = true;
}
@@ -4504,7 +4506,7 @@ namespace {
const SfxBoolItem& aIsCountedInListItem =
dynamic_cast<const SfxBoolItem&>(pItem);
if ( aIsCountedInListItem.GetValue() !=
- (mrTxtNode.IsCountedInList() ? TRUE : FALSE) )
+ (mrTxtNode.IsCountedInList() ? sal_True : sal_False) )
{
mbUpdateListCount = true;
}
@@ -4541,7 +4543,7 @@ namespace {
{
const SfxPoolItem* pItem = 0;
// handle RES_PARATR_NUMRULE
- if ( rItemSet.GetItemState( RES_PARATR_NUMRULE, FALSE, &pItem ) == SFX_ITEM_SET )
+ if ( rItemSet.GetItemState( RES_PARATR_NUMRULE, sal_False, &pItem ) == SFX_ITEM_SET )
{
mrTxtNode.RemoveFromList();
@@ -4557,7 +4559,7 @@ namespace {
}
// handle RES_PARATR_LIST_ID
- if ( rItemSet.GetItemState( RES_PARATR_LIST_ID, FALSE, &pItem ) == SFX_ITEM_SET )
+ if ( rItemSet.GetItemState( RES_PARATR_LIST_ID, sal_False, &pItem ) == SFX_ITEM_SET )
{
const SfxStringItem* pListIdItem =
dynamic_cast<const SfxStringItem*>(pItem);
@@ -4574,7 +4576,7 @@ namespace {
}
// handle RES_PARATR_LIST_LEVEL
- if ( rItemSet.GetItemState( RES_PARATR_LIST_LEVEL, FALSE, &pItem ) == SFX_ITEM_SET )
+ if ( rItemSet.GetItemState( RES_PARATR_LIST_LEVEL, sal_False, &pItem ) == SFX_ITEM_SET )
{
const SfxInt16Item* pListLevelItem =
dynamic_cast<const SfxInt16Item*>(pItem);
@@ -4585,19 +4587,19 @@ namespace {
}
// handle RES_PARATR_LIST_ISRESTART
- if ( rItemSet.GetItemState( RES_PARATR_LIST_ISRESTART, FALSE, &pItem ) == SFX_ITEM_SET )
+ if ( rItemSet.GetItemState( RES_PARATR_LIST_ISRESTART, sal_False, &pItem ) == SFX_ITEM_SET )
{
const SfxBoolItem* pListIsRestartItem =
dynamic_cast<const SfxBoolItem*>(pItem);
if ( pListIsRestartItem->GetValue() !=
- (mrTxtNode.IsListRestart() ? TRUE : FALSE) )
+ (mrTxtNode.IsListRestart() ? sal_True : sal_False) )
{
mbUpdateListRestart = true;
}
}
// handle RES_PARATR_LIST_RESTARTVALUE
- if ( rItemSet.GetItemState( RES_PARATR_LIST_RESTARTVALUE, FALSE, &pItem ) == SFX_ITEM_SET )
+ if ( rItemSet.GetItemState( RES_PARATR_LIST_RESTARTVALUE, sal_False, &pItem ) == SFX_ITEM_SET )
{
const SfxInt16Item* pListRestartValueItem =
dynamic_cast<const SfxInt16Item*>(pItem);
@@ -4609,12 +4611,12 @@ namespace {
}
// handle RES_PARATR_LIST_ISCOUNTED
- if ( rItemSet.GetItemState( RES_PARATR_LIST_ISCOUNTED, FALSE, &pItem ) == SFX_ITEM_SET )
+ if ( rItemSet.GetItemState( RES_PARATR_LIST_ISCOUNTED, sal_False, &pItem ) == SFX_ITEM_SET )
{
const SfxBoolItem* pIsCountedInListItem =
dynamic_cast<const SfxBoolItem*>(pItem);
if ( pIsCountedInListItem->GetValue() !=
- (mrTxtNode.IsCountedInList() ? TRUE : FALSE) )
+ (mrTxtNode.IsCountedInList() ? sal_True : sal_False) )
{
mbUpdateListCount = true;
}
@@ -4622,7 +4624,7 @@ namespace {
// --> OD 2008-11-19 #i70748#
// handle RES_PARATR_OUTLINELEVEL
- if ( rItemSet.GetItemState( RES_PARATR_OUTLINELEVEL, FALSE, &pItem ) == SFX_ITEM_SET )
+ if ( rItemSet.GetItemState( RES_PARATR_OUTLINELEVEL, sal_False, &pItem ) == SFX_ITEM_SET )
{
const SfxUInt16Item* pOutlineLevelItem =
dynamic_cast<const SfxUInt16Item*>(pItem);
@@ -4676,7 +4678,7 @@ namespace {
{
const SfxPoolItem* pItem = 0;
if ( mrTxtNode.GetSwAttrSet().GetItemState( RES_PARATR_NUMRULE,
- TRUE, &pItem )
+ sal_True, &pItem )
!= SFX_ITEM_SET )
{
mrTxtNode.SetEmptyListStyleDueToSetOutlineLevelAttr();
@@ -4688,28 +4690,28 @@ namespace {
// End of class <HandleSetAttrAtTxtNode>
}
-BOOL SwTxtNode::SetAttr( const SfxPoolItem& pItem )
+sal_Bool SwTxtNode::SetAttr( const SfxPoolItem& pItem )
{
const bool bOldIsSetOrResetAttr( mbInSetOrResetAttr );
mbInSetOrResetAttr = true;
HandleSetAttrAtTxtNode aHandleSetAttr( *this, pItem );
- BOOL bRet = SwCntntNode::SetAttr( pItem );
+ sal_Bool bRet = SwCntntNode::SetAttr( pItem );
mbInSetOrResetAttr = bOldIsSetOrResetAttr;
return bRet;
}
-BOOL SwTxtNode::SetAttr( const SfxItemSet& rSet )
+sal_Bool SwTxtNode::SetAttr( const SfxItemSet& rSet )
{
const bool bOldIsSetOrResetAttr( mbInSetOrResetAttr );
mbInSetOrResetAttr = true;
HandleSetAttrAtTxtNode aHandleSetAttr( *this, rSet );
- BOOL bRet = SwCntntNode::SetAttr( rSet );
+ sal_Bool bRet = SwCntntNode::SetAttr( rSet );
mbInSetOrResetAttr = bOldIsSetOrResetAttr;
@@ -4737,8 +4739,8 @@ namespace {
{
public:
HandleResetAttrAtTxtNode( SwTxtNode& rTxtNode,
- const USHORT nWhich1,
- const USHORT nWhich2 );
+ const sal_uInt16 nWhich1,
+ const sal_uInt16 nWhich2 );
HandleResetAttrAtTxtNode( SwTxtNode& rTxtNode,
const SvUShorts& rWhichArr );
HandleResetAttrAtTxtNode( SwTxtNode& rTxtNode );
@@ -4754,8 +4756,8 @@ namespace {
};
HandleResetAttrAtTxtNode::HandleResetAttrAtTxtNode( SwTxtNode& rTxtNode,
- const USHORT nWhich1,
- const USHORT nWhich2 )
+ const sal_uInt16 nWhich1,
+ const sal_uInt16 nWhich2 )
: mrTxtNode( rTxtNode ),
mbListStyleOrIdReset( false ),
mbUpdateListLevel( false ),
@@ -4774,7 +4776,7 @@ namespace {
else if ( nWhich1 <= RES_PARATR_LIST_ID && RES_PARATR_LIST_ID <= nWhich2 )
{
bRemoveFromList = mrTxtNode.GetpSwAttrSet() &&
- mrTxtNode.GetpSwAttrSet()->GetItemState( RES_PARATR_LIST_ID, FALSE ) == SFX_ITEM_SET;
+ mrTxtNode.GetpSwAttrSet()->GetItemState( RES_PARATR_LIST_ID, sal_False ) == SFX_ITEM_SET;
// --> OD 2008-10-20 #i92898#
mbListStyleOrIdReset = true;
// <--
@@ -4819,7 +4821,7 @@ namespace {
else if ( nWhich1 == RES_PARATR_LIST_ID )
{
bRemoveFromList = mrTxtNode.GetpSwAttrSet() &&
- mrTxtNode.GetpSwAttrSet()->GetItemState( RES_PARATR_LIST_ID, FALSE ) == SFX_ITEM_SET;
+ mrTxtNode.GetpSwAttrSet()->GetItemState( RES_PARATR_LIST_ID, sal_False ) == SFX_ITEM_SET;
// --> OD 2008-10-20 #i92898#
mbListStyleOrIdReset = true;
// <--
@@ -4866,8 +4868,8 @@ namespace {
{
bool bRemoveFromList( false );
{
- const USHORT nEnd = rWhichArr.Count();
- for ( USHORT n = 0; n < nEnd; ++n )
+ const sal_uInt16 nEnd = rWhichArr.Count();
+ for ( sal_uInt16 n = 0; n < nEnd; ++n )
{
// RES_PARATR_NUMRULE and RES_PARATR_LIST_ID
if ( rWhichArr[ n ] == RES_PARATR_NUMRULE )
@@ -4880,7 +4882,7 @@ namespace {
{
bRemoveFromList = bRemoveFromList ||
( mrTxtNode.GetpSwAttrSet() &&
- mrTxtNode.GetpSwAttrSet()->GetItemState( RES_PARATR_LIST_ID, FALSE ) == SFX_ITEM_SET );
+ mrTxtNode.GetpSwAttrSet()->GetItemState( RES_PARATR_LIST_ID, sal_False ) == SFX_ITEM_SET );
// --> OD 2008-10-20 #i92898#
mbListStyleOrIdReset = true;
// <--
@@ -4967,7 +4969,7 @@ namespace {
// --> OD 2008-11-19 #i70748#
// --> OD 2010-05-12 #i105562#
else if ( mrTxtNode.GetpSwAttrSet() &&
- dynamic_cast<const SfxUInt16Item &>(mrTxtNode.GetAttr( RES_PARATR_OUTLINELEVEL, FALSE )).GetValue() > 0 )
+ dynamic_cast<const SfxUInt16Item &>(mrTxtNode.GetAttr( RES_PARATR_OUTLINELEVEL, sal_False )).GetValue() > 0 )
{
mrTxtNode.SetEmptyListStyleDueToSetOutlineLevelAttr();
}
@@ -4999,42 +5001,42 @@ namespace {
// End of class <HandleResetAttrAtTxtNode>
}
-BOOL SwTxtNode::ResetAttr( USHORT nWhich1, USHORT nWhich2 )
+sal_Bool SwTxtNode::ResetAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 )
{
const bool bOldIsSetOrResetAttr( mbInSetOrResetAttr );
mbInSetOrResetAttr = true;
HandleResetAttrAtTxtNode aHandleResetAttr( *this, nWhich1, nWhich2 );
- BOOL bRet = SwCntntNode::ResetAttr( nWhich1, nWhich2 );
+ sal_Bool bRet = SwCntntNode::ResetAttr( nWhich1, nWhich2 );
mbInSetOrResetAttr = bOldIsSetOrResetAttr;
return bRet;
}
-BOOL SwTxtNode::ResetAttr( const SvUShorts& rWhichArr )
+sal_Bool SwTxtNode::ResetAttr( const SvUShorts& rWhichArr )
{
const bool bOldIsSetOrResetAttr( mbInSetOrResetAttr );
mbInSetOrResetAttr = true;
HandleResetAttrAtTxtNode aHandleResetAttr( *this, rWhichArr );
- BOOL bRet = SwCntntNode::ResetAttr( rWhichArr );
+ sal_Bool bRet = SwCntntNode::ResetAttr( rWhichArr );
mbInSetOrResetAttr = bOldIsSetOrResetAttr;
return bRet;
}
-USHORT SwTxtNode::ResetAllAttr()
+sal_uInt16 SwTxtNode::ResetAllAttr()
{
const bool bOldIsSetOrResetAttr( mbInSetOrResetAttr );
mbInSetOrResetAttr = true;
HandleResetAttrAtTxtNode aHandleResetAttr( *this );
- USHORT nRet = SwCntntNode::ResetAllAttr();
+ sal_uInt16 nRet = SwCntntNode::ResetAllAttr();
mbInSetOrResetAttr = bOldIsSetOrResetAttr;
@@ -5055,7 +5057,7 @@ bool SwTxtNode::IsInClipboard() const
bool SwTxtNode::IsInUndo() const
{
- return &GetNodes() == GetDoc()->GetUndoNds();
+ return GetDoc()->GetIDocumentUndoRedo().IsUndoNodes(GetNodes());
}
bool SwTxtNode::IsInContent() const
diff --git a/sw/source/core/txtnode/swfntcch.cxx b/sw/source/core/txtnode/swfntcch.cxx
index 202e6d48f763..9c294ac03936 100644
--- a/sw/source/core/txtnode/swfntcch.cxx
+++ b/sw/source/core/txtnode/swfntcch.cxx
@@ -35,7 +35,7 @@
#include "swfont.hxx"
// aus atrstck.cxx
-extern const BYTE StackPos[];
+extern const sal_uInt8 StackPos[];
// globale Variablen, werden in SwFntCch.Hxx bekanntgegeben
// Der FontCache wird in TxtInit.Cxx _TXTINIT erzeugt und in _TXTEXIT geloescht
@@ -56,8 +56,8 @@ SwFontObj::SwFontObj( const void *pOwn, ViewShell *pSh ) :
{
aSwFont.GoMagic( pSh, aSwFont.GetActual() );
const SwAttrSet& rAttrSet = ((SwTxtFmtColl *)pOwn)->GetAttrSet();
- for (USHORT i = RES_CHRATR_BEGIN; i < RES_CHRATR_END; i++)
- pDefaultArray[ StackPos[ i ] ] = &rAttrSet.Get( i, TRUE );
+ for (sal_uInt16 i = RES_CHRATR_BEGIN; i < RES_CHRATR_END; i++)
+ pDefaultArray[ StackPos[ i ] ] = &rAttrSet.Get( i, sal_True );
}
SwFontObj::~SwFontObj()
@@ -87,7 +87,7 @@ SwFontObj *SwFontAccess::Get( )
SwCacheObj *SwFontAccess::NewObj( )
{
- ((SwTxtFmtColl*)pOwner)->SetInSwFntCache( TRUE );
+ ((SwTxtFmtColl*)pOwner)->SetInSwFntCache( sal_True );
return new SwFontObj( pOwner, pShell );
}
diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx
index 02c21242a220..24f5c097f7d4 100644
--- a/sw/source/core/txtnode/swfont.cxx
+++ b/sw/source/core/txtnode/swfont.cxx
@@ -100,12 +100,12 @@ void SwFont::SetBackColor( Color* pNewColor )
{
delete pBackColor;
pBackColor = pNewColor;
- bFntChg = TRUE;
+ bFntChg = sal_True;
aSub[SW_LATIN].pMagic = aSub[SW_CJK].pMagic = aSub[SW_CTL].pMagic = 0;
}
// maps directions for vertical layout
-USHORT MapDirection( USHORT nDir, const BOOL bVertFormat )
+sal_uInt16 MapDirection( sal_uInt16 nDir, const sal_Bool bVertFormat )
{
if ( bVertFormat )
{
@@ -132,7 +132,7 @@ USHORT MapDirection( USHORT nDir, const BOOL bVertFormat )
// maps the absolute direction set at the font to its logical conterpart
// in the rotated environment
-USHORT UnMapDirection( USHORT nDir, const BOOL bVertFormat )
+sal_uInt16 UnMapDirection( sal_uInt16 nDir, const sal_Bool bVertFormat )
{
if ( bVertFormat )
{
@@ -157,19 +157,19 @@ USHORT UnMapDirection( USHORT nDir, const BOOL bVertFormat )
return nDir;
}
-USHORT SwFont::GetOrientation( const BOOL bVertFormat ) const
+sal_uInt16 SwFont::GetOrientation( const sal_Bool bVertFormat ) const
{
return UnMapDirection( aSub[nActual].GetOrientation(), bVertFormat );
}
-void SwFont::SetVertical( USHORT nDir, const BOOL bVertFormat )
+void SwFont::SetVertical( sal_uInt16 nDir, const sal_Bool bVertFormat )
{
// map direction if frame has vertical layout
nDir = MapDirection( nDir, bVertFormat );
if( nDir != aSub[0].GetOrientation() )
{
- bFntChg = TRUE;
+ bFntChg = sal_True;
aSub[0].SetVertical( nDir, bVertFormat );
aSub[1].SetVertical( nDir, bVertFormat || nDir > 1000 );
aSub[2].SetVertical( nDir, bVertFormat );
@@ -205,11 +205,11 @@ void SwFont::SetVertical( USHORT nDir, const BOOL bVertFormat )
*************************************************************************/
/*************************************************************************
- * SwSubFont::CalcEscAscent( const USHORT nOldAscent )
+ * SwSubFont::CalcEscAscent( const sal_uInt16 nOldAscent )
*************************************************************************/
// nEsc ist der Prozentwert
-USHORT SwSubFont::CalcEscAscent( const USHORT nOldAscent ) const
+sal_uInt16 SwSubFont::CalcEscAscent( const sal_uInt16 nOldAscent ) const
{
if( DFLT_ESC_AUTO_SUPER != GetEscapement() &&
DFLT_ESC_AUTO_SUB != GetEscapement() )
@@ -217,7 +217,7 @@ USHORT SwSubFont::CalcEscAscent( const USHORT nOldAscent ) const
const long nAscent = nOldAscent +
( (long) nOrgHeight * GetEscapement() ) / 100L;
if ( nAscent>0 )
- return ( Max( USHORT (nAscent), nOrgAscent ));
+ return ( Max( sal_uInt16 (nAscent), nOrgAscent ));
}
return nOrgAscent;
}
@@ -236,7 +236,7 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet,
{
const SfxPoolItem* pItem;
if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_FONT,
- TRUE, &pItem ))
+ sal_True, &pItem ))
{
const SvxFontItem *pFont = (const SvxFontItem *)pItem;
aSub[SW_LATIN].SetFamily( pFont->GetFamily() );
@@ -246,7 +246,7 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet,
aSub[SW_LATIN].Font::SetCharSet( pFont->GetCharSet() );
}
if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_FONTSIZE,
- TRUE, &pItem ))
+ sal_True, &pItem ))
{
const SvxFontHeightItem *pHeight = (const SvxFontHeightItem *)pItem;
aSub[SW_LATIN].SvxFont::SetPropr( 100 );
@@ -256,17 +256,17 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet,
aSub[SW_LATIN].SetSize( aTmpSize );
}
if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_POSTURE,
- TRUE, &pItem ))
+ sal_True, &pItem ))
aSub[SW_LATIN].Font::SetItalic( ((SvxPostureItem*)pItem)->GetPosture() );
if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_WEIGHT,
- TRUE, &pItem ))
+ sal_True, &pItem ))
aSub[SW_LATIN].Font::SetWeight( ((SvxWeightItem*)pItem)->GetWeight() );
if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_LANGUAGE,
- TRUE, &pItem ))
+ sal_True, &pItem ))
aSub[SW_LATIN].SetLanguage( ((SvxLanguageItem*)pItem)->GetLanguage() );
if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CJK_FONT,
- TRUE, &pItem ))
+ sal_True, &pItem ))
{
const SvxFontItem *pFont = (const SvxFontItem *)pItem;
aSub[SW_CJK].SetFamily( pFont->GetFamily() );
@@ -276,7 +276,7 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet,
aSub[SW_CJK].Font::SetCharSet( pFont->GetCharSet() );
}
if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CJK_FONTSIZE,
- TRUE, &pItem ))
+ sal_True, &pItem ))
{
const SvxFontHeightItem *pHeight = (const SvxFontHeightItem *)pItem;
aSub[SW_CJK].SvxFont::SetPropr( 100 );
@@ -286,13 +286,13 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet,
aSub[SW_CJK].SetSize( aTmpSize );
}
if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CJK_POSTURE,
- TRUE, &pItem ))
+ sal_True, &pItem ))
aSub[SW_CJK].Font::SetItalic( ((SvxPostureItem*)pItem)->GetPosture() );
if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CJK_WEIGHT,
- TRUE, &pItem ))
+ sal_True, &pItem ))
aSub[SW_CJK].Font::SetWeight( ((SvxWeightItem*)pItem)->GetWeight() );
if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CJK_LANGUAGE,
- TRUE, &pItem ))
+ sal_True, &pItem ))
{
LanguageType eNewLang = ((SvxLanguageItem*)pItem)->GetLanguage();
aSub[SW_CJK].SetLanguage( eNewLang );
@@ -302,7 +302,7 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet,
}
if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CTL_FONT,
- TRUE, &pItem ))
+ sal_True, &pItem ))
{
const SvxFontItem *pFont = (const SvxFontItem *)pItem;
aSub[SW_CTL].SetFamily( pFont->GetFamily() );
@@ -312,7 +312,7 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet,
aSub[SW_CTL].Font::SetCharSet( pFont->GetCharSet() );
}
if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CTL_FONTSIZE,
- TRUE, &pItem ))
+ sal_True, &pItem ))
{
const SvxFontHeightItem *pHeight = (const SvxFontHeightItem *)pItem;
aSub[SW_CTL].SvxFont::SetPropr( 100 );
@@ -322,53 +322,53 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet,
aSub[SW_CTL].SetSize( aTmpSize );
}
if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CTL_POSTURE,
- TRUE, &pItem ))
+ sal_True, &pItem ))
aSub[SW_CTL].Font::SetItalic( ((SvxPostureItem*)pItem)->GetPosture() );
if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CTL_WEIGHT,
- TRUE, &pItem ))
+ sal_True, &pItem ))
aSub[SW_CTL].Font::SetWeight( ((SvxWeightItem*)pItem)->GetWeight() );
if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CTL_LANGUAGE,
- TRUE, &pItem ))
+ sal_True, &pItem ))
aSub[SW_CTL].SetLanguage( ((SvxLanguageItem*)pItem)->GetLanguage() );
if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_UNDERLINE,
- TRUE, &pItem ))
+ sal_True, &pItem ))
{
SetUnderline( ((SvxUnderlineItem*)pItem)->GetLineStyle() );
SetUnderColor( ((SvxUnderlineItem*)pItem)->GetColor() );
}
if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_OVERLINE,
- TRUE, &pItem ))
+ sal_True, &pItem ))
{
SetOverline( ((SvxOverlineItem*)pItem)->GetLineStyle() );
SetOverColor( ((SvxOverlineItem*)pItem)->GetColor() );
}
if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CROSSEDOUT,
- TRUE, &pItem ))
+ sal_True, &pItem ))
SetStrikeout( ((SvxCrossedOutItem*)pItem)->GetStrikeout() );
if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_COLOR,
- TRUE, &pItem ))
+ sal_True, &pItem ))
SetColor( ((SvxColorItem*)pItem)->GetValue() );
if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_EMPHASIS_MARK,
- TRUE, &pItem ))
+ sal_True, &pItem ))
SetEmphasisMark( ((SvxEmphasisMarkItem*)pItem)->GetEmphasisMark() );
- SetTransparent( TRUE );
+ SetTransparent( sal_True );
SetAlign( ALIGN_BASELINE );
if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CONTOUR,
- TRUE, &pItem ))
+ sal_True, &pItem ))
SetOutline( ((SvxContourItem*)pItem)->GetValue() );
if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_SHADOWED,
- TRUE, &pItem ))
+ sal_True, &pItem ))
SetShadow( ((SvxShadowedItem*)pItem)->GetValue() );
if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_RELIEF,
- TRUE, &pItem ))
+ sal_True, &pItem ))
SetRelief( (FontRelief)((SvxCharReliefItem*)pItem)->GetValue() );
if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_SHADOWED,
- TRUE, &pItem ))
+ sal_True, &pItem ))
SetPropWidth(((SvxShadowedItem*)pItem)->GetValue() ? 50 : 100 );
if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_AUTOKERN,
- TRUE, &pItem ))
+ sal_True, &pItem ))
{
if( ((SvxAutoKernItem*)pItem)->GetValue() )
{
@@ -381,11 +381,11 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet,
SetAutoKern( 0 );
}
if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_WORDLINEMODE,
- TRUE, &pItem ))
+ sal_True, &pItem ))
SetWordLineMode( ((SvxWordLineModeItem*)pItem)->GetValue() );
if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_ESCAPEMENT,
- TRUE, &pItem ))
+ sal_True, &pItem ))
{
const SvxEscapementItem *pEsc = (const SvxEscapementItem *)pItem;
SetEscapement( pEsc->GetEsc() );
@@ -393,39 +393,39 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet,
SetProportion( pEsc->GetProp() );
}
if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CASEMAP,
- TRUE, &pItem ))
+ sal_True, &pItem ))
SetCaseMap( ((SvxCaseMapItem*)pItem)->GetCaseMap() );
if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_KERNING,
- TRUE, &pItem ))
+ sal_True, &pItem ))
SetFixKerning( ((SvxKerningItem*)pItem)->GetValue() );
if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_NOHYPHEN,
- TRUE, &pItem ))
+ sal_True, &pItem ))
SetNoHyph( ((SvxNoHyphenItem*)pItem)->GetValue() );
if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_BLINK,
- TRUE, &pItem ))
+ sal_True, &pItem ))
SetBlink( ((SvxBlinkItem*)pItem)->GetValue() );
if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_ROTATE,
- TRUE, &pItem ))
+ sal_True, &pItem ))
SetVertical( ((SvxCharRotateItem*)pItem)->GetValue() );
if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_BACKGROUND,
- TRUE, &pItem ))
+ sal_True, &pItem ))
pBackColor = new Color( ((SvxBrushItem*)pItem)->GetColor() );
else
pBackColor = NULL;
const SfxPoolItem* pTwoLinesItem = 0;
if( SFX_ITEM_SET ==
- pAttrSet->GetItemState( RES_CHRATR_TWO_LINES, TRUE, &pTwoLinesItem ))
+ pAttrSet->GetItemState( RES_CHRATR_TWO_LINES, sal_True, &pTwoLinesItem ))
if ( ((SvxTwoLinesItem*)pTwoLinesItem)->GetValue() )
SetVertical( 0 );
}
else
{
Invalidate();
- bNoHyph = FALSE;
- bBlink = FALSE;
+ bNoHyph = sal_False;
+ bBlink = sal_False;
}
- bPaintBlank = FALSE;
- bPaintWrong = FALSE;
+ bPaintBlank = sal_False;
+ bPaintWrong = sal_False;
ASSERT( aSub[SW_LATIN].IsTransparent(), "SwFont: Transparent revolution" );
}
@@ -448,7 +448,7 @@ SwFont::SwFont( const SwFont &rFont )
bFntChg = rFont.bFntChg;
bOrgChg = rFont.bOrgChg;
bPaintBlank = rFont.bPaintBlank;
- bPaintWrong = FALSE;
+ bPaintWrong = sal_False;
bURL = rFont.bURL;
bGreyWave = rFont.bGreyWave;
bNoColReplace = rFont.bNoColReplace;
@@ -463,14 +463,14 @@ SwFont::SwFont( const SwAttrSet* pAttrSet,
nToxCnt = 0;
nRefCnt = 0;
m_nMetaCount = 0;
- bPaintBlank = FALSE;
- bPaintWrong = FALSE;
- bURL = FALSE;
- bGreyWave = FALSE;
- bNoColReplace = FALSE;
+ bPaintBlank = sal_False;
+ bPaintWrong = sal_False;
+ bURL = sal_False;
+ bGreyWave = sal_False;
+ bNoColReplace = sal_False;
bNoHyph = pAttrSet->GetNoHyphenHere().GetValue();
bBlink = pAttrSet->GetBlink().GetValue();
- bOrgChg = TRUE;
+ bOrgChg = sal_True;
{
const SvxFontItem& rFont = pAttrSet->GetFont();
aSub[SW_LATIN].SetFamily( rFont.GetFamily() );
@@ -534,7 +534,7 @@ SwFont::SwFont( const SwAttrSet* pAttrSet,
SetEmphasisMark( pAttrSet->GetEmphasisMark().GetEmphasisMark() );
SetStrikeout( pAttrSet->GetCrossedOut().GetStrikeout() );
SetColor( pAttrSet->GetColor().GetValue() );
- SetTransparent( TRUE );
+ SetTransparent( sal_True );
SetAlign( ALIGN_BASELINE );
SetOutline( pAttrSet->GetContour().GetValue() );
SetShadow( pAttrSet->GetShadowed().GetValue() );
@@ -558,7 +558,7 @@ SwFont::SwFont( const SwAttrSet* pAttrSet,
SetFixKerning( pAttrSet->GetKerning().GetValue() );
const SfxPoolItem* pItem;
if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_BACKGROUND,
- TRUE, &pItem ))
+ sal_True, &pItem ))
pBackColor = new Color( ((SvxBrushItem*)pItem)->GetColor() );
else
pBackColor = NULL;
@@ -597,7 +597,7 @@ SwFont& SwFont::operator=( const SwFont &rFont )
bFntChg = rFont.bFntChg;
bOrgChg = rFont.bOrgChg;
bPaintBlank = rFont.bPaintBlank;
- bPaintWrong = FALSE;
+ bPaintWrong = sal_False;
bURL = rFont.bURL;
bGreyWave = rFont.bGreyWave;
bNoColReplace = rFont.bNoColReplace;
@@ -610,19 +610,19 @@ SwFont& SwFont::operator=( const SwFont &rFont )
* SwFont::GoMagic()
*************************************************************************/
-void SwFont::GoMagic( ViewShell *pSh, BYTE nWhich )
+void SwFont::GoMagic( ViewShell *pSh, sal_uInt8 nWhich )
{
SwFntAccess aFntAccess( aSub[nWhich].pMagic, aSub[nWhich].nFntIndex,
- &aSub[nWhich], pSh, TRUE );
+ &aSub[nWhich], pSh, sal_True );
}
/*************************************************************************
* SwSubFont::IsSymbol()
*************************************************************************/
-BOOL SwSubFont::IsSymbol( ViewShell *pSh )
+sal_Bool SwSubFont::IsSymbol( ViewShell *pSh )
{
- SwFntAccess aFntAccess( pMagic, nFntIndex, this, pSh, FALSE );
+ SwFntAccess aFntAccess( pMagic, nFntIndex, this, pSh, sal_False );
return aFntAccess.Get()->IsSymbol();
}
@@ -630,11 +630,11 @@ BOOL SwSubFont::IsSymbol( ViewShell *pSh )
* SwSubFont::ChgFnt()
*************************************************************************/
-BOOL SwSubFont::ChgFnt( ViewShell *pSh, OutputDevice& rOut )
+sal_Bool SwSubFont::ChgFnt( ViewShell *pSh, OutputDevice& rOut )
{
if ( pLastFont )
pLastFont->Unlock();
- SwFntAccess aFntAccess( pMagic, nFntIndex, this, pSh, TRUE );
+ SwFntAccess aFntAccess( pMagic, nFntIndex, this, pSh, sal_True );
SV_STAT( nChangeFont );
pLastFont = aFntAccess.Get();
@@ -655,7 +655,7 @@ void SwFont::ChgPhysFnt( ViewShell *pSh, OutputDevice& rOut )
{
if( bOrgChg && aSub[nActual].IsEsc() )
{
- const BYTE nOldProp = aSub[nActual].GetPropr();
+ const sal_uInt8 nOldProp = aSub[nActual].GetPropr();
SetProportion( 100 );
ChgFnt( pSh, rOut );
SwFntAccess aFntAccess( aSub[nActual].pMagic, aSub[nActual].nFntIndex,
@@ -663,7 +663,7 @@ void SwFont::ChgPhysFnt( ViewShell *pSh, OutputDevice& rOut )
aSub[nActual].nOrgHeight = aFntAccess.Get()->GetFontHeight( pSh, rOut );
aSub[nActual].nOrgAscent = aFntAccess.Get()->GetFontAscent( pSh, rOut );
SetProportion( nOldProp );
- bOrgChg = FALSE;
+ bOrgChg = sal_False;
}
if( bFntChg )
@@ -685,16 +685,16 @@ void SwFont::ChgPhysFnt( ViewShell *pSh, OutputDevice& rOut )
* T2_height-T2_ascent - (Esc * T1_height)
*************************************************************************/
-USHORT SwSubFont::CalcEscHeight( const USHORT nOldHeight,
- const USHORT nOldAscent ) const
+sal_uInt16 SwSubFont::CalcEscHeight( const sal_uInt16 nOldHeight,
+ const sal_uInt16 nOldAscent ) const
{
if( DFLT_ESC_AUTO_SUPER != GetEscapement() &&
DFLT_ESC_AUTO_SUB != GetEscapement() )
{
long nDescent = nOldHeight - nOldAscent -
( (long) nOrgHeight * GetEscapement() ) / 100L;
- const USHORT nDesc = ( nDescent>0 ) ? Max ( USHORT(nDescent),
- USHORT(nOrgHeight - nOrgAscent) ) : nOrgHeight - nOrgAscent;
+ const sal_uInt16 nDesc = ( nDescent>0 ) ? Max ( sal_uInt16(nDescent),
+ sal_uInt16(nOrgHeight - nOrgAscent) ) : nOrgHeight - nOrgAscent;
return ( nDesc + CalcEscAscent( nOldAscent ) );
}
return nOrgHeight;
@@ -713,9 +713,9 @@ short SwSubFont::_CheckKerning( )
* SwSubFont::GetAscent()
*************************************************************************/
-USHORT SwSubFont::GetAscent( ViewShell *pSh, const OutputDevice& rOut )
+sal_uInt16 SwSubFont::GetAscent( ViewShell *pSh, const OutputDevice& rOut )
{
- USHORT nAscent;
+ sal_uInt16 nAscent;
SwFntAccess aFntAccess( pMagic, nFntIndex, this, pSh );
nAscent = aFntAccess.Get()->GetFontAscent( pSh, rOut );
if( GetEscapement() )
@@ -727,14 +727,14 @@ USHORT SwSubFont::GetAscent( ViewShell *pSh, const OutputDevice& rOut )
* SwSubFont::GetHeight()
*************************************************************************/
-USHORT SwSubFont::GetHeight( ViewShell *pSh, const OutputDevice& rOut )
+sal_uInt16 SwSubFont::GetHeight( ViewShell *pSh, const OutputDevice& rOut )
{
SV_STAT( nGetTextSize );
SwFntAccess aFntAccess( pMagic, nFntIndex, this, pSh );
- const USHORT nHeight = aFntAccess.Get()->GetFontHeight( pSh, rOut );
+ const sal_uInt16 nHeight = aFntAccess.Get()->GetFontHeight( pSh, rOut );
if ( GetEscapement() )
{
- const USHORT nAscent = aFntAccess.Get()->GetFontAscent( pSh, rOut );
+ const sal_uInt16 nAscent = aFntAccess.Get()->GetFontAscent( pSh, rOut );
return CalcEscHeight( nHeight, nAscent ); // + nLeading;
}
return nHeight; // + nLeading;
@@ -807,10 +807,10 @@ Size SwSubFont::_GetTxtSize( SwDrawTextInfo& rInf )
// hochgestellt, muss seine effektive Hoehe melden.
if( GetEscapement() )
{
- const USHORT nAscent = pLastFont->GetFontAscent( rInf.GetShell(),
+ const sal_uInt16 nAscent = pLastFont->GetFontAscent( rInf.GetShell(),
rInf.GetOut() );
aTxtSize.Height() =
- (long)CalcEscHeight( (USHORT)aTxtSize.Height(), nAscent);
+ (long)CalcEscHeight( (sal_uInt16)aTxtSize.Height(), nAscent);
}
}
@@ -846,7 +846,7 @@ Size SwSubFont::_GetTxtSize( SwDrawTextInfo& rInf )
* SwSubFont::_DrawText()
*************************************************************************/
-void SwSubFont::_DrawText( SwDrawTextInfo &rInf, const BOOL bGrey )
+void SwSubFont::_DrawText( SwDrawTextInfo &rInf, const sal_Bool bGrey )
{
rInf.SetGreyWave( bGrey );
xub_StrLen nLn = rInf.GetText().Len();
@@ -958,7 +958,7 @@ static sal_Char __READONLY_DATA sDoubleSpace[] = " ";
nSpace *= rInf.GetSpace() / SPACING_PRECISION_FACTOR;
}
- rInf.SetWidth( USHORT(aFontSize.Width() + nSpace) );
+ rInf.SetWidth( sal_uInt16(aFontSize.Width() + nSpace) );
rInf.SetText( aStr );
rInf.SetIdx( 0 );
rInf.SetLen( 2 );
@@ -1105,7 +1105,7 @@ void SwSubFont::CalcEsc( SwDrawTextInfo& rInf, Point& rPos )
{
long nOfst;
- USHORT nDir = UnMapDirection(
+ sal_uInt16 nDir = UnMapDirection(
GetOrientation(), rInf.GetFrm() && rInf.GetFrm()->IsVertical() );
switch ( GetEscapement() )
@@ -1167,12 +1167,12 @@ void SwSubFont::CalcEsc( SwDrawTextInfo& rInf, Point& rPos )
}
// used during painting of small capitals
-void SwDrawTextInfo::Shift( USHORT nDir )
+void SwDrawTextInfo::Shift( sal_uInt16 nDir )
{
ASSERT( bPos, "DrawTextInfo: Undefined Position" );
ASSERT( bSize, "DrawTextInfo: Undefined Width" );
- const BOOL bBidiPor = ( GetFrm() && GetFrm()->IsRightToLeft() ) !=
+ const sal_Bool bBidiPor = ( GetFrm() && GetFrm()->IsRightToLeft() ) !=
( 0 != ( TEXT_LAYOUT_BIDI_RTL & GetpOut()->GetLayoutMode() ) );
nDir = bBidiPor ?
@@ -1219,7 +1219,7 @@ long AttrSetToLineHeight( const IDocumentSettingAccess& rIDocumentSettingAccess,
const OutputDevice &rOut, sal_Int16 nScript)
{
SwFont aFont(&rSet, &rIDocumentSettingAccess);
- BYTE nActual;
+ sal_uInt8 nActual;
switch (nScript)
{
default:
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index 5acc55a0820d..e1c700165c73 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -65,6 +65,7 @@
#include <fmtmeta.hxx>
#include <breakit.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <errhdl.hxx>
#include <fldbas.hxx>
#include <pam.hxx>
@@ -167,7 +168,7 @@ bool isNestedAny(const xub_StrLen nStart1, const xub_StrLen nEnd1,
}
static
-bool isSelfNestable(const USHORT nWhich)
+bool isSelfNestable(const sal_uInt16 nWhich)
{
if ((RES_TXTATR_INETFMT == nWhich) ||
(RES_TXTATR_CJK_RUBY == nWhich))
@@ -178,7 +179,7 @@ bool isSelfNestable(const USHORT nWhich)
}
static
-bool isSplittable(const USHORT nWhich)
+bool isSplittable(const sal_uInt16 nWhich)
{
if ((RES_TXTATR_INETFMT == nWhich) ||
(RES_TXTATR_CJK_RUBY == nWhich))
@@ -194,7 +195,7 @@ enum Split_t { FAIL, SPLIT_NEW, SPLIT_OTHER };
hint is inserted, and what kind of existing hint overlaps.
*/
static Split_t
-splitPolicy(const USHORT nWhichNew, const USHORT nWhichOther)
+splitPolicy(const sal_uInt16 nWhichNew, const sal_uInt16 nWhichOther)
{
if (!isSplittable(nWhichOther))
{
@@ -362,7 +363,7 @@ bool
SwpHints::TryInsertNesting( SwTxtNode & rNode, SwTxtAttrNesting & rNewHint )
{
// INVARIANT: the nestable hints in the array are properly nested
- const USHORT nNewWhich( rNewHint.Which() );
+ const sal_uInt16 nNewWhich( rNewHint.Which() );
const xub_StrLen nNewStart( *rNewHint.GetStart() );
const xub_StrLen nNewEnd ( *rNewHint.GetEnd() );
//??? const bool bNoLengthAttribute( nNewStart == nNewEnd );
@@ -381,13 +382,13 @@ SwpHints::TryInsertNesting( SwTxtNode & rNode, SwTxtAttrNesting & rNewHint )
SplitNew.push_back(& rNewHint);
// pass 1: split the inserted hint into fragments if necessary
- for ( USHORT i = 0; i < GetEndCount(); ++i )
+ for ( sal_uInt16 i = 0; i < GetEndCount(); ++i )
{
SwTxtAttr * const pOther = GetEnd(i);
if (pOther->IsNesting())
{
- const USHORT nOtherWhich( pOther->Which() );
+ const sal_uInt16 nOtherWhich( pOther->Which() );
const xub_StrLen nOtherStart( *(pOther)->GetStart() );
const xub_StrLen nOtherEnd ( *(pOther)->GetEnd() );
if (isOverlap(nNewStart, nNewEnd, nOtherStart, nOtherEnd ))
@@ -590,7 +591,7 @@ SwpHints::TryInsertNesting( SwTxtNode & rNode, SwTxtAttrNesting & rNewHint )
void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint,
const SetAttrMode nMode )
{
- const USHORT nWhich = rNewHint.Which();
+ const sal_uInt16 nWhich = rNewHint.Which();
const xub_StrLen nThisStart = *rNewHint.GetStart();
const xub_StrLen nThisEnd = *rNewHint.GetEnd();
@@ -609,7 +610,7 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint,
//
if ( !bNoLengthAttribute ) // nothing to do for no length attributes
{
- for ( USHORT i = 0; i < Count(); ++i )
+ for ( sal_uInt16 i = 0; i < Count(); ++i )
{
SwTxtAttr* pOther = GetTextHint(i);
@@ -675,7 +676,7 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint,
if ( !bNoLengthAttribute ) // nothing to do for no length attributes
{
- for ( USHORT i = 0; i < Count(); ++i )
+ for ( sal_uInt16 i = 0; i < Count(); ++i )
{
const SwTxtAttr* pOther = GetTextHint(i);
@@ -708,7 +709,7 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint,
aInsDelHints.clear();
// Get all hints that are in [nPorStart, nPorEnd[:
- for ( USHORT i = 0; i < Count(); ++i )
+ for ( sal_uInt16 i = 0; i < Count(); ++i )
{
SwTxtAttr *pOther = GetTextHint(i);
@@ -734,7 +735,7 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint,
// pNewHint can be inserted after calculating the sort value.
// This should ensure, that pNewHint comes behind the already present
// character style
- USHORT nCharStyleCount = 0;
+ sal_uInt16 nCharStyleCount = 0;
aIter = aInsDelHints.begin();
while ( aIter != aInsDelHints.end() )
{
@@ -775,7 +776,7 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint,
aCharAutoFmtSetRange);
SfxItemIter aItemIter( *pOldStyle );
const SfxPoolItem* pItem = aItemIter.GetCurItem();
- while( TRUE )
+ while( sal_True )
{
if ( !CharFmt::IsItemIncluded( pItem->Which(), &rNewHint ) )
{
@@ -855,7 +856,7 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint,
do
{
const SfxPoolItem* pTmpItem = 0;
- if ( SFX_ITEM_SET == rWholeParaAttrSet.GetItemState( pItem->Which(), FALSE, &pTmpItem ) &&
+ if ( SFX_ITEM_SET == rWholeParaAttrSet.GetItemState( pItem->Which(), sal_False, &pTmpItem ) &&
pTmpItem == pItem )
{
// Do not clear item if the attribute is set in a character format:
@@ -893,14 +894,14 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint,
do
{
const SfxPoolItem* pTmpItem = 0;
- if ( SFX_ITEM_SET == rWholeParaAttrSet.GetItemState( pItem->Which(), FALSE, &pTmpItem ) &&
+ if ( SFX_ITEM_SET == rWholeParaAttrSet.GetItemState( pItem->Which(), sal_False, &pTmpItem ) &&
pTmpItem == pItem )
{
// Do not clear item if the attribute is set in a character format:
if ( !pCurrentCharFmt || 0 == CharFmt::GetItem( *pCurrentCharFmt, pItem->Which() ) )
{
if ( !pNewSet )
- pNewSet = pNewStyle->Clone( TRUE );
+ pNewSet = pNewStyle->Clone( sal_True );
pNewSet->ClearItem( pItem->Which() );
}
}
@@ -1013,7 +1014,7 @@ SwTxtAttr* MakeTxtAttr( SwDoc & rDoc, SfxPoolItem& rAttr,
// different from rDoc's pool, we have to correct this:
const StylePool::SfxItemSet_Pointer_t pAutoStyle = static_cast<const SwFmtAutoFmt&>(rAttr).GetStyleHandle();
::std::auto_ptr<const SfxItemSet> pNewSet(
- pAutoStyle->SfxItemSet::Clone( TRUE, &rDoc.GetAttrPool() ));
+ pAutoStyle->SfxItemSet::Clone( sal_True, &rDoc.GetAttrPool() ));
SwTxtAttr* pNew = MakeTxtAttr( rDoc, *pNewSet, nStt, nEnd );
return pNew;
}
@@ -1104,7 +1105,7 @@ void SwTxtNode::DestroyAttr( SwTxtAttr* pAttr )
{
// einige Sachen muessen vorm Loeschen der "Format-Attribute" erfolgen
SwDoc* pDoc = GetDoc();
- USHORT nDelMsg = 0;
+ sal_uInt16 nDelMsg = 0;
switch( pAttr->Which() )
{
case RES_TXTATR_FLYCNT:
@@ -1152,7 +1153,7 @@ void SwTxtNode::DestroyAttr( SwTxtAttr* pAttr )
case RES_DBNUMSETFLD:
case RES_DBNEXTSETFLD:
if( !pDoc->IsNewFldLst() && GetNodes().IsDocNodes() )
- pDoc->InsDelFldInFldLst( FALSE, *(SwTxtFld*)pAttr );
+ pDoc->InsDelFldInFldLst( sal_False, *(SwTxtFld*)pAttr );
break;
case RES_DDEFLD:
if( GetNodes().IsDocNodes() &&
@@ -1228,7 +1229,7 @@ SwTxtNode::InsertItem( SfxPoolItem& rAttr,
// take ownership of pAttr; if insertion fails, delete pAttr
bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode )
{
- BOOL bHiddenPara = FALSE;
+ sal_Bool bHiddenPara = sal_False;
ASSERT( pAttr && *pAttr->GetStart() <= Len(), "StartIdx out of bounds!" );
ASSERT( !pAttr->GetEnd() || (*pAttr->GetEnd() <= Len()),
@@ -1247,7 +1248,7 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode )
const bool bDummyChar( pAttr->HasDummyChar() );
if (bDummyChar)
{
- USHORT nInsMode = nMode;
+ sal_uInt16 nInsMode = nMode;
switch( pAttr->Which() )
{
case RES_TXTATR_FLYCNT:
@@ -1263,7 +1264,7 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode )
// des Zeichens. Sonst muesste das immer ausserhalb
// erfolgen (Fehleranfaellig !)
const SwFmtAnchor* pAnchor = 0;
- pFmt->GetItemState( RES_ANCHOR, FALSE,
+ pFmt->GetItemState( RES_ANCHOR, sal_False,
(const SfxPoolItem**)&pAnchor );
SwIndex aIdx( this, *pAttr->GetStart() );
@@ -1314,13 +1315,11 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode )
m_Text.Erase( *pAttr->GetStart(), 1 );
// Indizies Updaten
SwIndex aTmpIdx( this, *pAttr->GetStart() );
- Update( aTmpIdx, 1, TRUE );
+ Update( aTmpIdx, 1, sal_True );
}
- // Format loeschen nicht ins Undo aufnehmen!!
- BOOL bUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ // do not record deletion of Format!
+ ::sw::UndoGuard const ug(pDoc->GetIDocumentUndoRedo());
DestroyAttr( pAttr );
- pDoc->DoUndo( bUndo );
return false;
}
}
@@ -1352,14 +1351,14 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode )
m_Text.Erase( *pAttr->GetStart(), 1 );
// Indizies Updaten
SwIndex aTmpIdx( this, *pAttr->GetStart() );
- Update( aTmpIdx, 1, TRUE );
+ Update( aTmpIdx, 1, sal_True );
}
DestroyAttr( pAttr );
return false;
}
// wird eine neue Fussnote eingefuegt ??
- BOOL bNewFtn = 0 == ((SwTxtFtn*)pAttr)->GetStartNode();
+ sal_Bool bNewFtn = 0 == ((SwTxtFtn*)pAttr)->GetStartNode();
if( bNewFtn )
{
((SwTxtFtn*)pAttr)->MakeNewTextSection( GetNodes() );
@@ -1371,9 +1370,9 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode )
else if ( !GetpSwpHints() || !GetpSwpHints()->IsInSplitNode() )
{
// loesche alle Frames der Section, auf die der StartNode zeigt
- ULONG nSttIdx =
+ sal_uLong nSttIdx =
((SwTxtFtn*)pAttr)->GetStartNode()->GetIndex();
- ULONG nEndIdx = rNodes[ nSttIdx++ ]->EndOfSectionIndex();
+ sal_uLong nEndIdx = rNodes[ nSttIdx++ ]->EndOfSectionIndex();
SwCntntNode* pCNd;
for( ; nSttIdx < nEndIdx; ++nSttIdx )
if( 0 != ( pCNd = rNodes[ nSttIdx ]->GetCntntNode() ))
@@ -1396,7 +1395,7 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode )
if( !bNewFtn )
{
// eine alte Ftn wird umgehaengt (z.B. SplitNode)
- for( USHORT n = 0; n < pDoc->GetFtnIdxs().Count(); ++n )
+ for( sal_uInt16 n = 0; n < pDoc->GetFtnIdxs().Count(); ++n )
if( pAttr == pDoc->GetFtnIdxs()[n] )
{
// neuen Index zuweisen, dafuer aus dem SortArray
@@ -1419,7 +1418,7 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode )
if( StartOfSectionIndex() > rNodes.GetEndOfRedlines().GetIndex() )
{
#ifdef DBG_UTIL
- const BOOL bSuccess =
+ const sal_Bool bSuccess =
#endif
pDoc->GetFtnIdxs().Insert( pTxtFtn );
#ifdef DBG_UTIL
@@ -1438,7 +1437,7 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode )
// anwerfen
if( RES_HIDDENPARAFLD ==
pAttr->GetFld().GetFld()->GetTyp()->Which() )
- bHiddenPara = TRUE;
+ bHiddenPara = sal_True;
}
break;
@@ -1528,13 +1527,13 @@ void SwTxtNode::DeleteAttribute( SwTxtAttr * const pAttr )
*************************************************************************/
//FIXME: this does NOT respect SORT NUMBER (for CHARFMT)!
-void SwTxtNode::DeleteAttributes( const USHORT nWhich,
+void SwTxtNode::DeleteAttributes( const sal_uInt16 nWhich,
const xub_StrLen nStart, const xub_StrLen nEnd )
{
if ( !HasHints() )
return;
- for ( USHORT nPos = 0; m_pSwpHints && nPos < m_pSwpHints->Count(); nPos++ )
+ for ( sal_uInt16 nPos = 0; m_pSwpHints && nPos < m_pSwpHints->Count(); nPos++ )
{
SwTxtAttr * const pTxtHt = m_pSwpHints->GetTextHint( nPos );
const xub_StrLen nHintStart = *(pTxtHt->GetStart());
@@ -1554,7 +1553,7 @@ void SwTxtNode::DeleteAttributes( const USHORT nWhich,
// Check if character format contains hidden attribute:
const SwCharFmt* pFmt = pTxtHt->GetCharFmt().GetCharFmt();
const SfxPoolItem* pItem;
- if ( SFX_ITEM_SET == pFmt->GetItemState( RES_CHRATR_HIDDEN, TRUE, &pItem ) )
+ if ( SFX_ITEM_SET == pFmt->GetItemState( RES_CHRATR_HIDDEN, sal_True, &pItem ) )
SetCalcHiddenCharFlags();
}
// --> FME 2007-03-16 #i75430# Recalc hidden flags if necessary
@@ -1611,11 +1610,11 @@ void SwTxtNode::DelSoftHyph( const xub_StrLen nStt, const xub_StrLen nEnd )
// setze diese Attribute am TextNode. Wird der gesamte Bereich umspannt,
// dann setze sie nur im AutoAttrSet (SwCntntNode:: SetAttr)
-BOOL SwTxtNode::SetAttr( const SfxItemSet& rSet, xub_StrLen nStt,
+sal_Bool SwTxtNode::SetAttr( const SfxItemSet& rSet, xub_StrLen nStt,
xub_StrLen nEnd, const SetAttrMode nMode )
{
if( !rSet.Count() )
- return FALSE;
+ return sal_False;
// teil die Sets auf (fuer Selektion in Nodes)
const SfxItemSet* pSet = &rSet;
@@ -1627,14 +1626,14 @@ BOOL SwTxtNode::SetAttr( const SfxItemSet& rSet, xub_StrLen nStt,
{
// sind am Node schon Zeichenvorlagen gesetzt, muss man diese Attribute
// (rSet) immer als TextAttribute setzen, damit sie angezeigt werden.
- int bHasCharFmts = FALSE;
+ int bHasCharFmts = sal_False;
if ( HasHints() )
{
- for ( USHORT n = 0; n < m_pSwpHints->Count(); ++n )
+ for ( sal_uInt16 n = 0; n < m_pSwpHints->Count(); ++n )
{
if ( (*m_pSwpHints)[ n ]->IsCharFmtAttr() )
{
- bHasCharFmts = TRUE;
+ bHasCharFmts = sal_True;
break;
}
}
@@ -1647,18 +1646,18 @@ BOOL SwTxtNode::SetAttr( const SfxItemSet& rSet, xub_StrLen nStt,
// we want to set them at the paragraph:
if( aTxtSet.Count() != rSet.Count() )
{
- BOOL bRet = SetAttr( rSet );
+ sal_Bool bRet = SetAttr( rSet );
if( !aTxtSet.Count() )
return bRet;
}
// check for auto style:
const SfxPoolItem* pItem;
- const bool bAutoStyle = SFX_ITEM_SET == aTxtSet.GetItemState( RES_TXTATR_AUTOFMT, FALSE, &pItem );
+ const bool bAutoStyle = SFX_ITEM_SET == aTxtSet.GetItemState( RES_TXTATR_AUTOFMT, sal_False, &pItem );
if ( bAutoStyle )
{
boost::shared_ptr<SfxItemSet> pAutoStyleSet = static_cast<const SwFmtAutoFmt*>(pItem)->GetStyleHandle();
- BOOL bRet = SetAttr( *pAutoStyleSet );
+ sal_Bool bRet = SetAttr( *pAutoStyleSet );
if( 1 == aTxtSet.Count() )
return bRet;
}
@@ -1672,7 +1671,7 @@ BOOL SwTxtNode::SetAttr( const SfxItemSet& rSet, xub_StrLen nStt,
SfxItemSet aCharSet( *rSet.GetPool(), aCharAutoFmtSetRange );
- USHORT nCount = 0;
+ sal_uInt16 nCount = 0;
SfxItemIter aIter( *pSet );
const SfxPoolItem* pItem = aIter.GetCurItem();
@@ -1680,7 +1679,7 @@ BOOL SwTxtNode::SetAttr( const SfxItemSet& rSet, xub_StrLen nStt,
{
if ( pItem && (reinterpret_cast<SfxPoolItem*>(-1) != pItem))
{
- const USHORT nWhich = pItem->Which();
+ const sal_uInt16 nWhich = pItem->Which();
ASSERT( isCHRATR(nWhich) || isTXTATR(nWhich),
"SwTxtNode::SetAttr(): unknown attribute" );
if ( isCHRATR(nWhich) || isTXTATR(nWhich) )
@@ -1738,7 +1737,7 @@ BOOL SwTxtNode::SetAttr( const SfxItemSet& rSet, xub_StrLen nStt,
TryDeleteSwpHints();
- return nCount ? TRUE : FALSE;
+ return nCount ? sal_True : sal_False;
}
void lcl_MergeAttr( SfxItemSet& rSet, const SfxPoolItem& rAttr )
@@ -1749,12 +1748,12 @@ void lcl_MergeAttr( SfxItemSet& rSet, const SfxPoolItem& rAttr )
if ( !pCFSet )
return;
SfxWhichIter aIter( *pCFSet );
- USHORT nWhich = aIter.FirstWhich();
+ sal_uInt16 nWhich = aIter.FirstWhich();
while( nWhich )
{
if( ( nWhich < RES_CHRATR_END ||
RES_TXTATR_UNKNOWN_CONTAINER == nWhich ) &&
- ( SFX_ITEM_SET == pCFSet->GetItemState( nWhich, TRUE ) ) )
+ ( SFX_ITEM_SET == pCFSet->GetItemState( nWhich, sal_True ) ) )
rSet.Put( pCFSet->Get( nWhich ) );
nWhich = aIter.NextWhich();
}
@@ -1774,12 +1773,12 @@ void lcl_MergeAttr_ExpandChrFmt( SfxItemSet& rSet, const SfxPoolItem& rAttr )
if ( pCFSet )
{
SfxWhichIter aIter( *pCFSet );
- USHORT nWhich = aIter.FirstWhich();
+ sal_uInt16 nWhich = aIter.FirstWhich();
while( nWhich )
{
if( ( nWhich < RES_CHRATR_END ||
( RES_TXTATR_AUTOFMT == rAttr.Which() && RES_TXTATR_UNKNOWN_CONTAINER == nWhich ) ) &&
- ( SFX_ITEM_SET == pCFSet->GetItemState( nWhich, TRUE ) ) )
+ ( SFX_ITEM_SET == pCFSet->GetItemState( nWhich, sal_True ) ) )
rSet.Put( pCFSet->Get( nWhich ) );
nWhich = aIter.NextWhich();
}
@@ -1817,7 +1816,7 @@ void lcl_MergeListLevelIndentAsLRSpaceItem( const SwTxtNode& rTxtNode,
const SwNumRule* pRule = rTxtNode.GetNumRule();
if ( pRule && rTxtNode.GetActualListLevel() >= 0 )
{
- const SwNumFmt& rFmt = pRule->Get(static_cast<USHORT>(rTxtNode.GetActualListLevel()));
+ const SwNumFmt& rFmt = pRule->Get(static_cast<sal_uInt16>(rTxtNode.GetActualListLevel()));
if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT )
{
SvxLRSpaceItem aLR( RES_LR_SPACE );
@@ -1831,8 +1830,8 @@ void lcl_MergeListLevelIndentAsLRSpaceItem( const SwTxtNode& rTxtNode,
// erfrage die Attribute vom TextNode ueber den Bereich
// --> OD 2008-01-16 #newlistlevelattrs#
-BOOL SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd,
- BOOL bOnlyTxtAttr, BOOL bGetFromChrFmt,
+sal_Bool SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd,
+ sal_Bool bOnlyTxtAttr, sal_Bool bGetFromChrFmt,
const bool bMergeIndentValuesOfNumRule ) const
{
if( HasHints() )
@@ -1866,11 +1865,11 @@ BOOL SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd,
// <--
}
- const USHORT nSize = m_pSwpHints->Count();
+ const sal_uInt16 nSize = m_pSwpHints->Count();
if( nStt == nEnd ) // kein Bereich:
{
- for (USHORT n = 0; n < nSize; ++n)
+ for (sal_uInt16 n = 0; n < nSize; ++n)
{
const SwTxtAttr* pHt = (*m_pSwpHints)[n];
const xub_StrLen nAttrStart = *pHt->GetStart();
@@ -1895,10 +1894,10 @@ BOOL SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd,
::std::auto_ptr< std::vector< SwPoolItemEndPair > > pAttrArr;
// <--
- const USHORT coArrSz = static_cast<USHORT>(RES_TXTATR_WITHEND_END) -
- static_cast<USHORT>(RES_CHRATR_BEGIN);
+ const sal_uInt16 coArrSz = static_cast<sal_uInt16>(RES_TXTATR_WITHEND_END) -
+ static_cast<sal_uInt16>(RES_CHRATR_BEGIN);
- for (USHORT n = 0; n < nSize; ++n)
+ for (sal_uInt16 n = 0; n < nSize; ++n)
{
const SwTxtAttr* pHt = (*m_pSwpHints)[n];
const xub_StrLen nAttrStart = *pHt->GetStart();
@@ -1909,7 +1908,7 @@ BOOL SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd,
if ( ! pAttrEnd ) // no attributes without end
continue;
- BOOL bChkInvalid = FALSE;
+ sal_Bool bChkInvalid = sal_False;
if( nAttrStart <= nStt ) // vor oder genau Start
{
if( *pAttrEnd <= nStt ) // liegt davor
@@ -1920,11 +1919,11 @@ BOOL SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd,
else
// else if( pHt->GetAttr() != aFmtSet.Get( pHt->Which() ) )
// uneindeutig
- bChkInvalid = TRUE;
+ bChkInvalid = sal_True;
}
else if( nAttrStart < nEnd // reicht in den Bereich
)// && pHt->GetAttr() != aFmtSet.Get( pHt->Which() ) )
- bChkInvalid = TRUE;
+ bChkInvalid = sal_True;
if( bChkInvalid )
{
@@ -1944,11 +1943,11 @@ BOOL SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd,
else
pItem = &pHt->GetAttr();
- const USHORT nHintEnd = *pAttrEnd;
+ const sal_uInt16 nHintEnd = *pAttrEnd;
while ( pItem )
{
- const USHORT nHintWhich = pItem->Which();
+ const sal_uInt16 nHintWhich = pItem->Which();
ASSERT(!isUNKNOWNATR(nHintWhich),
"SwTxtNode::GetAttr(): unkonwn attribute?");
@@ -2015,13 +2014,13 @@ BOOL SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd,
if ( pAttrArr.get() )
{
- for (USHORT n = 0; n < coArrSz; ++n)
+ for (sal_uInt16 n = 0; n < coArrSz; ++n)
{
const SwPoolItemEndPair& rItemPair = (*pAttrArr)[ n ];
if( (0 != rItemPair.mpItem) && ((SfxPoolItem*)-1 != rItemPair.mpItem) )
{
- const USHORT nWh =
- static_cast<USHORT>(n + RES_CHRATR_BEGIN);
+ const sal_uInt16 nWh =
+ static_cast<sal_uInt16>(n + RES_CHRATR_BEGIN);
if( nEnd <= rItemPair.mnEndPos ) // hinter oder genau Ende
{
@@ -2055,14 +2054,14 @@ BOOL SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd,
// <--
}
- return rSet.Count() ? TRUE : FALSE;
+ return rSet.Count() ? sal_True : sal_False;
}
namespace
{
-typedef std::pair<USHORT, USHORT> AttrSpan_t;
+typedef std::pair<sal_uInt16, sal_uInt16> AttrSpan_t;
typedef std::multimap<AttrSpan_t, const SwTxtAttr*> AttrSpanMap_t;
@@ -2101,7 +2100,7 @@ struct RemovePresentAttrs
const SfxPoolItem* pItem(aIter.GetCurItem());
while (true)
{
- const USHORT nWhich(pItem->Which());
+ const sal_uInt16 nWhich(pItem->Which());
if (CharFmt::IsItemIncluded(nWhich, pAutoStyle))
{
m_rAttrSet.ClearItem(nWhich);
@@ -2127,15 +2126,15 @@ private:
that tries to access the pointer has to check if it's non-null!
*/
void
-lcl_CollectHintSpans(const SwpHints& i_rHints, const USHORT nLength,
+lcl_CollectHintSpans(const SwpHints& i_rHints, const sal_uInt16 nLength,
AttrSpanMap_t& o_rSpanMap)
{
- USHORT nLastEnd(0);
+ sal_uInt16 nLastEnd(0);
- for (USHORT i(0); i != i_rHints.Count(); ++i)
+ for (sal_uInt16 i(0); i != i_rHints.Count(); ++i)
{
const SwTxtAttr* const pHint(i_rHints[i]);
- const USHORT nWhich(pHint->Which());
+ const sal_uInt16 nWhich(pHint->Which());
if (nWhich == RES_TXTATR_CHARFMT || nWhich == RES_TXTATR_AUTOFMT)
{
const AttrSpan_t aSpan(*pHint->GetStart(), *pHint->GetEnd());
@@ -2162,7 +2161,7 @@ lcl_CollectHintSpans(const SwpHints& i_rHints, const USHORT nLength,
void
-lcl_FillWhichIds(const SfxItemSet& i_rAttrSet, std::vector<USHORT>& o_rClearIds)
+lcl_FillWhichIds(const SfxItemSet& i_rAttrSet, std::vector<sal_uInt16>& o_rClearIds)
{
o_rClearIds.reserve(i_rAttrSet.Count());
SfxItemIter aIter(i_rAttrSet);
@@ -2183,7 +2182,7 @@ struct SfxItemSetClearer
{
SfxItemSet & m_rItemSet;
SfxItemSetClearer(SfxItemSet & rItemSet) : m_rItemSet(rItemSet) { }
- void operator()(USHORT const nWhich) { m_rItemSet.ClearItem(nWhich); }
+ void operator()(sal_uInt16 const nWhich) { m_rItemSet.ClearItem(nWhich); }
};
}
@@ -2251,7 +2250,7 @@ SwTxtNode::impl_FmtToTxtAttr(const SfxItemSet& i_rAttrSet)
}
// 3. Clear items from the node
- std::vector<USHORT> aClearedIds;
+ std::vector<sal_uInt16> aClearedIds;
lcl_FillWhichIds(i_rAttrSet, aClearedIds);
ClearItemsFromAttrSet(aClearedIds);
}
@@ -2287,18 +2286,18 @@ void SwTxtNode::FmtToTxtAttr( SwTxtNode* pNd )
pNd->GetOrCreateSwpHints();
- std::vector<USHORT> aProcessedIds;
+ std::vector<sal_uInt16> aProcessedIds;
if( aThisSet.Count() )
{
SfxItemIter aIter( aThisSet );
const SfxPoolItem* pItem = aIter.GetCurItem(), *pNdItem = 0;
SfxItemSet aConvertSet( GetDoc()->GetAttrPool(), aCharFmtSetRange );
- std::vector<USHORT> aClearWhichIds;
+ std::vector<sal_uInt16> aClearWhichIds;
while( true )
{
- if( SFX_ITEM_SET == aNdSet.GetItemState( pItem->Which(), FALSE, &pNdItem ) )
+ if( SFX_ITEM_SET == aNdSet.GetItemState( pItem->Which(), sal_False, &pNdItem ) )
{
if (*pItem == *pNdItem) // 4
{
@@ -2354,9 +2353,9 @@ void SwTxtNode::FmtToTxtAttr( SwTxtNode* pNd )
void SwpHints::CalcFlags()
{
m_bDDEFields = m_bFootnote = false;
- const USHORT nSize = Count();
+ const sal_uInt16 nSize = Count();
const SwTxtAttr* pAttr;
- for( USHORT nPos = 0; nPos < nSize; ++nPos )
+ for( sal_uInt16 nPos = 0; nPos < nSize; ++nPos )
{
switch( ( pAttr = (*this)[ nPos ])->Which() )
{
@@ -2389,13 +2388,13 @@ bool SwpHints::CalcHiddenParaField()
m_bCalcHiddenParaField = false;
bool bOldHasHiddenParaField = m_bHasHiddenParaField;
bool bNewHasHiddenParaField = false;
- const USHORT nSize = Count();
+ const sal_uInt16 nSize = Count();
const SwTxtAttr *pTxtHt;
- for( USHORT nPos = 0; nPos < nSize; ++nPos )
+ for( sal_uInt16 nPos = 0; nPos < nSize; ++nPos )
{
pTxtHt = (*this)[ nPos ];
- const USHORT nWhich = pTxtHt->Which();
+ const sal_uInt16 nWhich = pTxtHt->Which();
if( RES_TXTATR_FIELD == nWhich )
{
@@ -2444,7 +2443,7 @@ bool SwpHints::MergePortions( SwTxtNode& rNode )
typedef std::multimap< int, SwTxtAttr* > PortionMap;
PortionMap aPortionMap;
xub_StrLen nLastPorStart = STRING_LEN;
- USHORT i = 0;
+ sal_uInt16 i = 0;
int nKey = 0;
// get portions by start position:
@@ -2475,8 +2474,8 @@ bool SwpHints::MergePortions( SwTxtNode& rNode )
PortionMap::iterator aIter2 = aRange2.first;
bool bMerge = true;
- const USHORT nAttributesInPor1 = static_cast<USHORT>(std::distance( aRange1.first, aRange1.second ));
- const USHORT nAttributesInPor2 = static_cast<USHORT>(std::distance( aRange2.first, aRange2.second ));
+ const sal_uInt16 nAttributesInPor1 = static_cast<sal_uInt16>(std::distance( aRange1.first, aRange1.second ));
+ const sal_uInt16 nAttributesInPor2 = static_cast<sal_uInt16>(std::distance( aRange2.first, aRange2.second ));
if ( nAttributesInPor1 == nAttributesInPor2 && nAttributesInPor1 != 0 )
{
@@ -2507,7 +2506,7 @@ bool SwpHints::MergePortions( SwTxtNode& rNode )
SwTxtAttr* p2 = (*aIter2).second;
nNewPortionEnd = *p2->GetEnd();
- const USHORT nCountBeforeDelete = Count();
+ const sal_uInt16 nCountBeforeDelete = Count();
Delete( p2 );
// robust: check if deletion actually took place before destroying attribute:
@@ -2548,9 +2547,9 @@ void lcl_CheckSortNumber( const SwpHints& rHints, SwTxtCharFmt& rNewCharFmt )
{
const xub_StrLen nHtStart = *rNewCharFmt.GetStart();
const xub_StrLen nHtEnd = *rNewCharFmt.GetEnd();
- USHORT nSortNumber = 0;
+ sal_uInt16 nSortNumber = 0;
- for ( USHORT i = 0; i < rHints.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rHints.Count(); ++i )
{
const SwTxtAttr* pOtherHt = rHints[i];
@@ -2565,7 +2564,7 @@ void lcl_CheckSortNumber( const SwpHints& rHints, SwTxtCharFmt& rNewCharFmt )
if ( nOtherStart == nHtStart && nOtherEnd == nHtEnd )
{
- const USHORT nOtherSortNum = static_cast<const SwTxtCharFmt*>(pOtherHt)->GetSortNumber();
+ const sal_uInt16 nOtherSortNum = static_cast<const SwTxtCharFmt*>(pOtherHt)->GetSortNumber();
nSortNumber = nOtherSortNum + 1;
}
}
@@ -2602,7 +2601,7 @@ bool SwpHints::TryInsertHint( SwTxtAttr* const pHint, SwTxtNode &rNode,
// Wir koennen also auf die while-Schleife verzichten
xub_StrLen *pHtEnd = pHint->GetEnd();
- USHORT nWhich = pHint->Which();
+ sal_uInt16 nWhich = pHint->Which();
switch( nWhich )
{
@@ -2611,7 +2610,7 @@ bool SwpHints::TryInsertHint( SwTxtAttr* const pHint, SwTxtNode &rNode,
// Check if character format contains hidden attribute:
const SwCharFmt* pFmt = pHint->GetCharFmt().GetCharFmt();
const SfxPoolItem* pItem;
- if ( SFX_ITEM_SET == pFmt->GetItemState( RES_CHRATR_HIDDEN, TRUE, &pItem ) )
+ if ( SFX_ITEM_SET == pFmt->GetItemState( RES_CHRATR_HIDDEN, sal_True, &pItem ) )
rNode.SetCalcHiddenCharFlags();
((SwTxtCharFmt*)pHint)->ChgTxtNode( &rNode );
@@ -2632,7 +2631,7 @@ bool SwpHints::TryInsertHint( SwTxtAttr* const pHint, SwTxtNode &rNode,
break;
case RES_TXTATR_FIELD:
{
- BOOL bDelFirst = 0 != ((SwTxtFld*)pHint)->GetpTxtNode();
+ sal_Bool bDelFirst = 0 != ((SwTxtFld*)pHint)->GetpTxtNode();
((SwTxtFld*)pHint)->ChgTxtNode( &rNode );
SwDoc* pDoc = rNode.GetDoc();
const SwField* pFld = ((SwTxtFld*)pHint)->GetFld().GetFld();
@@ -2651,9 +2650,9 @@ bool SwpHints::TryInsertHint( SwTxtAttr* const pHint, SwTxtNode &rNode,
case RES_DBNEXTSETFLD:
{
if( bDelFirst )
- pDoc->InsDelFldInFldLst( FALSE, *(SwTxtFld*)pHint );
+ pDoc->InsDelFldInFldLst( sal_False, *(SwTxtFld*)pHint );
if( rNode.GetNodes().IsDocNodes() )
- pDoc->InsDelFldInFldLst( TRUE, *(SwTxtFld*)pHint );
+ pDoc->InsDelFldInFldLst( sal_True, *(SwTxtFld*)pHint );
}
break;
case RES_DDEFLD:
@@ -2666,7 +2665,7 @@ bool SwpHints::TryInsertHint( SwTxtAttr* const pHint, SwTxtNode &rNode,
// gehts ins normale Nodes-Array?
if( rNode.GetNodes().IsDocNodes() )
{
- BOOL bInsFldType = FALSE;
+ sal_Bool bInsFldType = sal_False;
switch( pFld->GetTyp()->Which() )
{
case RES_SETEXPFLD:
@@ -2717,7 +2716,7 @@ bool SwpHints::TryInsertHint( SwTxtAttr* const pHint, SwTxtNode &rNode,
// search for a reference with the same name
SwTxtAttr* pTmpHt;
xub_StrLen *pTmpHtEnd, *pTmpHintEnd;
- for( USHORT n = 0, nEnd = Count(); n < nEnd; ++n )
+ for( sal_uInt16 n = 0, nEnd = Count(); n < nEnd; ++n )
{
if (RES_TXTATR_REFMARK == (pTmpHt = GetTextHint(n))->Which() &&
pHint->GetAttr() == pTmpHt->GetAttr() &&
@@ -2727,18 +2726,18 @@ bool SwpHints::TryInsertHint( SwTxtAttr* const pHint, SwTxtNode &rNode,
SwComparePosition eCmp = ::ComparePosition(
*pTmpHt->GetStart(), *pTmpHtEnd,
*pHint->GetStart(), *pTmpHintEnd );
- BOOL bDelOld = TRUE, bChgStart = FALSE, bChgEnd = FALSE;
+ sal_Bool bDelOld = sal_True, bChgStart = sal_False, bChgEnd = sal_False;
switch( eCmp )
{
case POS_BEFORE:
- case POS_BEHIND: bDelOld = FALSE; break;
+ case POS_BEHIND: bDelOld = sal_False; break;
- case POS_OUTSIDE: bChgStart = bChgEnd = TRUE; break;
+ case POS_OUTSIDE: bChgStart = bChgEnd = sal_True; break;
case POS_COLLIDE_END:
- case POS_OVERLAP_BEFORE: bChgStart = TRUE; break;
+ case POS_OVERLAP_BEFORE: bChgStart = sal_True; break;
case POS_COLLIDE_START:
- case POS_OVERLAP_BEHIND: bChgEnd = TRUE; break;
+ case POS_OVERLAP_BEHIND: bChgEnd = sal_True; break;
default: break;
}
@@ -2776,7 +2775,7 @@ bool SwpHints::TryInsertHint( SwTxtAttr* const pHint, SwTxtNode &rNode,
}
if( nsSetAttrMode::SETATTR_DONTEXPAND & nMode )
- pHint->SetDontExpand( TRUE );
+ pHint->SetDontExpand( sal_True );
// SwTxtAttrs ohne Ende werden sonderbehandelt:
// Sie werden natuerlich in das Array insertet, aber sie werden nicht
@@ -2892,7 +2891,7 @@ bool SwpHints::TryInsertHint( SwTxtAttr* const pHint, SwTxtNode &rNode,
* SwpHints::DeleteAtPos()
*************************************************************************/
-void SwpHints::DeleteAtPos( const USHORT nPos )
+void SwpHints::DeleteAtPos( const sal_uInt16 nPos )
{
SwTxtAttr *pHint = GetTextHint(nPos);
// ChainDelete( pHint );
@@ -2930,7 +2929,7 @@ void SwpHints::DeleteAtPos( const USHORT nPos )
void SwpHints::Delete( SwTxtAttr* pTxtHt )
{
// Attr 2.0: SwpHintsArr::Delete( pTxtHt );
- const USHORT nPos = GetStartOf( pTxtHt );
+ const sal_uInt16 nPos = GetStartOf( pTxtHt );
ASSERT( USHRT_MAX != nPos, "Attribut nicht im Attribut-Array!" );
if( USHRT_MAX != nPos )
DeleteAtPos( nPos );
@@ -2940,7 +2939,7 @@ void SwTxtNode::ClearSwpHintsArr( bool bDelFields )
{
if ( HasHints() )
{
- USHORT nPos = 0;
+ sal_uInt16 nPos = 0;
while ( nPos < m_pSwpHints->Count() )
{
SwTxtAttr* pDel = m_pSwpHints->GetTextHint( nPos );
@@ -2971,10 +2970,10 @@ void SwTxtNode::ClearSwpHintsArr( bool bDelFields )
}
}
-USHORT SwTxtNode::GetLang( const xub_StrLen nBegin, const xub_StrLen nLen,
- USHORT nScript ) const
+sal_uInt16 SwTxtNode::GetLang( const xub_StrLen nBegin, const xub_StrLen nLen,
+ sal_uInt16 nScript ) const
{
- USHORT nRet = LANGUAGE_DONTKNOW;
+ sal_uInt16 nRet = LANGUAGE_DONTKNOW;
if ( ! nScript )
{
@@ -2982,13 +2981,13 @@ USHORT SwTxtNode::GetLang( const xub_StrLen nBegin, const xub_StrLen nLen,
}
// --> FME 2008-09-29 #i91465# hennerdrewes: Consider nScript if pSwpHints == 0
- const USHORT nWhichId = GetWhichOfScript( RES_CHRATR_LANGUAGE, nScript );
+ const sal_uInt16 nWhichId = GetWhichOfScript( RES_CHRATR_LANGUAGE, nScript );
// <--
if ( HasHints() )
{
const xub_StrLen nEnd = nBegin + nLen;
- for ( USHORT i = 0, nSize = m_pSwpHints->Count(); i < nSize; ++i )
+ for ( sal_uInt16 i = 0, nSize = m_pSwpHints->Count(); i < nSize; ++i )
{
// ist der Attribut-Anfang schon groesser als der Idx ?
const SwTxtAttr *pHt = m_pSwpHints->operator[](i);
@@ -2996,7 +2995,7 @@ USHORT SwTxtNode::GetLang( const xub_StrLen nBegin, const xub_StrLen nLen,
if( nEnd < nAttrStart )
break;
- const USHORT nWhich = pHt->Which();
+ const sal_uInt16 nWhich = pHt->Which();
if( nWhichId == nWhich ||
( ( pHt->IsCharFmtAttr() || RES_TXTATR_AUTOFMT == nWhich ) && CharFmt::IsItemIncluded( nWhichId, pHt ) ) )
@@ -3013,7 +3012,7 @@ USHORT SwTxtNode::GetLang( const xub_StrLen nBegin, const xub_StrLen nLen,
( nAttrStart == *pEndIdx || !nBegin ))) )
{
const SfxPoolItem* pItem = CharFmt::GetItem( *pHt, nWhichId );
- USHORT nLng = ((SvxLanguageItem*)pItem)->GetLanguage();
+ sal_uInt16 nLng = ((SvxLanguageItem*)pItem)->GetLanguage();
// Umfasst das Attribut den Bereich komplett?
if( nAttrStart <= nBegin && nEnd <= *pEndIdx )
@@ -3028,7 +3027,7 @@ USHORT SwTxtNode::GetLang( const xub_StrLen nBegin, const xub_StrLen nLen,
{
nRet = ((SvxLanguageItem&)GetSwAttrSet().Get( nWhichId )).GetLanguage();
if( LANGUAGE_DONTKNOW == nRet )
- nRet = static_cast<USHORT>(GetAppLanguage());
+ nRet = static_cast<sal_uInt16>(GetAppLanguage());
}
return nRet;
}
@@ -3045,12 +3044,19 @@ sal_Unicode GetCharOfTxtAttr( const SwTxtAttr& rAttr )
case RES_TXTATR_META:
case RES_TXTATR_METAFIELD:
cRet = CH_TXTATR_INWORD;
- break;
+ break;
case RES_TXTATR_FIELD:
case RES_TXTATR_FLYCNT:
+ {
cRet = CH_TXTATR_BREAKWORD;
- break;
+
+ // #i78149: PostIt fields should not break words for spell and grammar checking
+ if (rAttr.Which() == RES_TXTATR_FIELD &&
+ RES_POSTITFLD == rAttr.GetFld().GetFld()->GetTyp()->Which())
+ cRet = CH_TXTATR_INWORD;
+ }
+ break;
default:
ASSERT(false, "GetCharOfTxtAttr: unknown attr");
diff --git a/sw/source/core/txtnode/txatritr.cxx b/sw/source/core/txtnode/txatritr.cxx
index 48ce2462cf2b..7511dee4009a 100644
--- a/sw/source/core/txtnode/txatritr.cxx
+++ b/sw/source/core/txtnode/txatritr.cxx
@@ -107,7 +107,7 @@ sal_Bool SwScriptIterator::Next()
// --------------------------------------------------------------------
-SwTxtAttrIterator::SwTxtAttrIterator( const SwTxtNode& rTNd, USHORT nWhchId,
+SwTxtAttrIterator::SwTxtAttrIterator( const SwTxtNode& rTNd, sal_uInt16 nWhchId,
xub_StrLen nStt,
sal_Bool bUseGetWhichOfScript )
: aSIter( rTNd.GetTxt(), nStt ), rTxtNd( rTNd ),
@@ -127,7 +127,7 @@ sal_Bool SwTxtAttrIterator::Next()
{
do {
const SwTxtAttr* pHt = (SwTxtAttr*)aStack[ 0 ];
- USHORT nEndPos = *pHt->GetEnd();
+ sal_uInt16 nEndPos = *pHt->GetEnd();
if( nChgPos >= nEndPos )
aStack.Remove( 0 );
else
@@ -142,7 +142,7 @@ sal_Bool SwTxtAttrIterator::Next()
if( aStack.Count() )
{
const SwTxtAttr* pHt = (SwTxtAttr*)aStack[ 0 ];
- USHORT nEndPos = *pHt->GetEnd();
+ sal_uInt16 nEndPos = *pHt->GetEnd();
if( nChgPos >= nEndPos )
{
nChgPos = nEndPos;
@@ -171,7 +171,7 @@ sal_Bool SwTxtAttrIterator::Next()
void SwTxtAttrIterator::AddToStack( const SwTxtAttr& rAttr )
{
void* pAdd = (void*)&rAttr;
- USHORT nIns = 0, nEndPos = *rAttr.GetEnd();
+ sal_uInt16 nIns = 0, nEndPos = *rAttr.GetEnd();
for( ; nIns < aStack.Count(); ++nIns )
if( *((SwTxtAttr*)aStack[ nIns ] )->GetEnd() > nEndPos )
break;
@@ -181,7 +181,7 @@ void SwTxtAttrIterator::AddToStack( const SwTxtAttr& rAttr )
void SwTxtAttrIterator::SearchNextChg()
{
- USHORT nWh = 0;
+ sal_uInt16 nWh = 0;
if( nChgPos == aSIter.GetScriptChgPos() )
{
aSIter.Next();
@@ -217,8 +217,8 @@ void SwTxtAttrIterator::SearchNextChg()
for( ; nAttrPos < pHts->Count(); ++nAttrPos )
{
const SwTxtAttr* pHt = (*pHts)[ nAttrPos ];
- const USHORT* pEnd = pHt->GetEnd();
- const USHORT nHtStt = *pHt->GetStart();
+ const sal_uInt16* pEnd = pHt->GetEnd();
+ const sal_uInt16 nHtStt = *pHt->GetStart();
if( nHtStt < nStt && ( !pEnd || *pEnd <= nStt ))
continue;
diff --git a/sw/source/core/txtnode/txtatr2.cxx b/sw/source/core/txtnode/txtatr2.cxx
index d63fe84420b3..698be6cd1443 100644
--- a/sw/source/core/txtnode/txtatr2.cxx
+++ b/sw/source/core/txtnode/txtatr2.cxx
@@ -60,7 +60,7 @@ SwTxtCharFmt::SwTxtCharFmt( SwFmtCharFmt& rAttr,
, m_nSortNumber( 0 )
{
rAttr.pTxtAttr = this;
- SetCharFmtAttr( TRUE );
+ SetCharFmtAttr( sal_True );
}
SwTxtCharFmt::~SwTxtCharFmt( )
@@ -69,7 +69,7 @@ SwTxtCharFmt::~SwTxtCharFmt( )
void SwTxtCharFmt::ModifyNotification( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
- USHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
+ sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
ASSERT( isCHRATR(nWhich) || (RES_OBJECTDYING == nWhich)
|| (RES_ATTRSET_CHG == nWhich) || (RES_FMT_CHG == nWhich),
"SwTxtCharFmt::Modify(): unknown Modify");
@@ -82,16 +82,20 @@ void SwTxtCharFmt::ModifyNotification( const SfxPoolItem* pOld, const SfxPoolIte
}
// erfrage vom Modify Informationen
+<<<<<<< local
bool SwTxtCharFmt::GetInfo( SfxPoolItem& rInfo ) const
+=======
+sal_Bool SwTxtCharFmt::GetInfo( SfxPoolItem& rInfo ) const
+>>>>>>> other
{
if ( RES_AUTOFMT_DOCNODE != rInfo.Which() || !m_pTxtNode ||
&m_pTxtNode->GetNodes() != static_cast<SwAutoFmtGetDocNode&>(rInfo).pNodes )
{
- return TRUE;
+ return sal_True;
}
static_cast<SwAutoFmtGetDocNode&>(rInfo).pCntntNode = m_pTxtNode;
- return FALSE;
+ return sal_False;
}
@@ -149,17 +153,17 @@ SwCharFmt* SwTxtINetFmt::GetCharFmt()
SetVisited( pDoc->IsVisitedURL( rFmt.GetValue() ) );
SetVisitedValid( true );
}
- USHORT nId;
+ sal_uInt16 nId;
const String& rStr = IsVisited() ? rFmt.GetVisitedFmt()
: rFmt.GetINetFmt();
if( rStr.Len() )
nId = IsVisited() ? rFmt.GetVisitedFmtId() : rFmt.GetINetFmtId();
else
- nId = static_cast<USHORT>(IsVisited() ? RES_POOLCHR_INET_VISIT : RES_POOLCHR_INET_NORMAL);
+ nId = static_cast<sal_uInt16>(IsVisited() ? RES_POOLCHR_INET_VISIT : RES_POOLCHR_INET_NORMAL);
// JP 10.02.2000, Bug 72806: dont modify the doc for getting the
// correct charstyle.
- BOOL bResetMod = !pDoc->IsModified();
+ sal_Bool bResetMod = !pDoc->IsModified();
Link aOle2Lnk;
if( bResetMod )
{
@@ -188,7 +192,7 @@ SwCharFmt* SwTxtINetFmt::GetCharFmt()
void SwTxtINetFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
- USHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
+ sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
ASSERT( isCHRATR(nWhich) || (RES_OBJECTDYING == nWhich)
|| (RES_ATTRSET_CHG == nWhich) || (RES_FMT_CHG == nWhich),
"SwTxtINetFmt::Modify(): unknown Modify");
@@ -201,19 +205,19 @@ void SwTxtINetFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
}
// erfrage vom Modify Informationen
-BOOL SwTxtINetFmt::GetInfo( SfxPoolItem& rInfo ) const
+sal_Bool SwTxtINetFmt::GetInfo( SfxPoolItem& rInfo ) const
{
if ( RES_AUTOFMT_DOCNODE != rInfo.Which() || !m_pTxtNode ||
&m_pTxtNode->GetNodes() != static_cast<SwAutoFmtGetDocNode&>(rInfo).pNodes )
{
- return TRUE;
+ return sal_True;
}
static_cast<SwAutoFmtGetDocNode&>(rInfo).pCntntNode = m_pTxtNode;
- return FALSE;
+ return sal_False;
}
-BOOL SwTxtINetFmt::IsProtect( ) const
+sal_Bool SwTxtINetFmt::IsProtect( ) const
{
return m_pTxtNode && m_pTxtNode->IsProtect();
}
@@ -237,7 +241,7 @@ SwTxtRuby::~SwTxtRuby()
void SwTxtRuby::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
{
- USHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
+ sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
ASSERT( isCHRATR(nWhich) || (RES_OBJECTDYING == nWhich)
|| (RES_ATTRSET_CHG == nWhich) || (RES_FMT_CHG == nWhich),
"SwTxtRuby::Modify(): unknown Modify");
@@ -249,16 +253,16 @@ void SwTxtRuby::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
}
}
-BOOL SwTxtRuby::GetInfo( SfxPoolItem& rInfo ) const
+sal_Bool SwTxtRuby::GetInfo( SfxPoolItem& rInfo ) const
{
if( RES_AUTOFMT_DOCNODE != rInfo.Which() || !m_pTxtNode ||
&m_pTxtNode->GetNodes() != static_cast<SwAutoFmtGetDocNode&>(rInfo).pNodes )
{
- return TRUE;
+ return sal_True;
}
static_cast<SwAutoFmtGetDocNode&>(rInfo).pCntntNode = m_pTxtNode;
- return FALSE;
+ return sal_False;
}
SwCharFmt* SwTxtRuby::GetCharFmt()
@@ -270,13 +274,13 @@ SwCharFmt* SwTxtRuby::GetCharFmt()
{
const SwDoc* pDoc = GetTxtNode().GetDoc();
const String& rStr = rFmt.GetCharFmtName();
- USHORT nId = RES_POOLCHR_RUBYTEXT;
+ sal_uInt16 nId = RES_POOLCHR_RUBYTEXT;
if ( rStr.Len() )
nId = rFmt.GetCharFmtId();
// JP 10.02.2000, Bug 72806: dont modify the doc for getting the
// correct charstyle.
- BOOL bResetMod = !pDoc->IsModified();
+ sal_Bool bResetMod = !pDoc->IsModified();
Link aOle2Lnk;
if( bResetMod )
{
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index b37b30461bbc..2f92fbb11938 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -70,7 +70,7 @@
#include <txttypes.hxx>
#include <breakit.hxx>
#include <crstate.hxx>
-#include <undobj.hxx>
+#include <UndoOverwrite.hxx>
#include <txatritr.hxx>
#include <redline.hxx> // SwRedline
#include <docary.hxx> // SwRedlineTbl
@@ -120,14 +120,14 @@ bool lcl_IsSkippableWhiteSpace( xub_Unicode cCh )
* only for deleted redlines
*/
-USHORT lcl_MaskRedlines( const SwTxtNode& rNode, XubString& rText,
+sal_uInt16 lcl_MaskRedlines( const SwTxtNode& rNode, XubString& rText,
const xub_StrLen nStt, const xub_StrLen nEnd,
const xub_Unicode cChar )
{
- USHORT nNumOfMaskedRedlines = 0;
+ sal_uInt16 nNumOfMaskedRedlines = 0;
const SwDoc& rDoc = *rNode.GetDoc();
- USHORT nAct = rDoc.GetRedlinePos( rNode, USHRT_MAX );
+ sal_uInt16 nAct = rDoc.GetRedlinePos( rNode, USHRT_MAX );
for ( ; nAct < rDoc.GetRedlineTbl().Count(); nAct++ )
{
@@ -165,13 +165,13 @@ USHORT lcl_MaskRedlines( const SwTxtNode& rNode, XubString& rText,
* Used for spell checking. Deleted redlines and hidden characters are masked
*/
-USHORT lcl_MaskRedlinesAndHiddenText( const SwTxtNode& rNode, XubString& rText,
+sal_uInt16 lcl_MaskRedlinesAndHiddenText( const SwTxtNode& rNode, XubString& rText,
const xub_StrLen nStt, const xub_StrLen nEnd,
const xub_Unicode cChar = CH_TXTATR_INWORD,
bool bCheckShowHiddenChar = true )
{
- USHORT nRedlinesMasked = 0;
- USHORT nHiddenCharsMasked = 0;
+ sal_uInt16 nRedlinesMasked = 0;
+ sal_uInt16 nHiddenCharsMasked = 0;
const SwDoc& rDoc = *rNode.GetDoc();
const bool bShowChg = 0 != IDocumentRedlineAccess::IsShowChanges( rDoc.GetRedlineMode() );
@@ -267,13 +267,13 @@ static SwRect lcl_CalculateRepaintRect( SwTxtFrm& rTxtFrm, xub_StrLen nChgStart,
delete pSt2Pos;
}
- BOOL bSameFrame = TRUE;
+ sal_Bool bSameFrame = sal_True;
if( rTxtFrm.HasFollow() )
{
if( pEndFrm != pStartFrm )
{
- bSameFrame = FALSE;
+ bSameFrame = sal_False;
SwRect aStFrm( pStartFrm->PaintArea() );
{
SWRECTFN( pStartFrm )
@@ -289,7 +289,7 @@ static SwRect lcl_CalculateRepaintRect( SwTxtFrm& rTxtFrm, xub_StrLen nChgStart,
(aRect.*fnRect->fnSetRight)( (aStFrm.*fnRect->fnGetRight)() );
}
aRect.Union( aTmp );
- while( TRUE )
+ while( sal_True )
{
pStartFrm = pStartFrm->GetFollow();
if( pStartFrm == pEndFrm )
@@ -324,7 +324,7 @@ static SwRect lcl_CalculateRepaintRect( SwTxtFrm& rTxtFrm, xub_StrLen nChgStart,
static bool lcl_HaveCommonAttributes( IStyleAccess& rStyleAccess,
const SfxItemSet* pSet1,
- USHORT nWhichId,
+ sal_uInt16 nWhichId,
const SfxItemSet& rSet2,
boost::shared_ptr<SfxItemSet>& pStyleHandle )
{
@@ -335,9 +335,9 @@ static bool lcl_HaveCommonAttributes( IStyleAccess& rStyleAccess,
if ( !pSet1 )
{
ASSERT( nWhichId, "lcl_HaveCommonAttributes not used correctly" )
- if ( SFX_ITEM_SET == rSet2.GetItemState( nWhichId, FALSE ) )
+ if ( SFX_ITEM_SET == rSet2.GetItemState( nWhichId, sal_False ) )
{
- pNewSet = rSet2.Clone( TRUE );
+ pNewSet = rSet2.Clone( sal_True );
pNewSet->ClearItem( nWhichId );
}
}
@@ -345,12 +345,12 @@ static bool lcl_HaveCommonAttributes( IStyleAccess& rStyleAccess,
{
SfxItemIter aIter( *pSet1 );
const SfxPoolItem* pItem = aIter.GetCurItem();
- while( TRUE )
+ while( sal_True )
{
- if ( SFX_ITEM_SET == rSet2.GetItemState( pItem->Which(), FALSE ) )
+ if ( SFX_ITEM_SET == rSet2.GetItemState( pItem->Which(), sal_False ) )
{
if ( !pNewSet )
- pNewSet = rSet2.Clone( TRUE );
+ pNewSet = rSet2.Clone( sal_True );
pNewSet->ClearItem( pItem->Which() );
}
@@ -372,12 +372,12 @@ static bool lcl_HaveCommonAttributes( IStyleAccess& rStyleAccess,
return bRet;
}
-inline BOOL InRange(xub_StrLen nIdx, xub_StrLen nStart, xub_StrLen nEnd) {
+inline sal_Bool InRange(xub_StrLen nIdx, xub_StrLen nStart, xub_StrLen nEnd) {
return ((nIdx >=nStart) && (nIdx <= nEnd));
}
/*
- * void SwTxtNode::RstAttr(const SwIndex &rIdx, USHORT nLen)
+ * void SwTxtNode::RstAttr(const SwIndex &rIdx, sal_uInt16 nLen)
*
* Deletes all attributes, starting at position rIdx, for length nLen.
*/
@@ -397,26 +397,26 @@ inline BOOL InRange(xub_StrLen nIdx, xub_StrLen nStart, xub_StrLen nEnd) {
* -> nothing to do
*/
-void SwTxtNode::RstAttr(const SwIndex &rIdx, xub_StrLen nLen, USHORT nWhich,
- const SfxItemSet* pSet, BOOL bInclRefToxMark )
+void SwTxtNode::RstAttr(const SwIndex &rIdx, xub_StrLen nLen, sal_uInt16 nWhich,
+ const SfxItemSet* pSet, sal_Bool bInclRefToxMark )
{
// Attribute?
if ( !GetpSwpHints() )
return;
- USHORT i = 0;
+ sal_uInt16 i = 0;
xub_StrLen nStt = rIdx.GetIndex();
xub_StrLen nEnd = nStt + nLen;
xub_StrLen nAttrStart;
SwTxtAttr *pHt;
- BOOL bChanged = FALSE;
+ sal_Bool bChanged = sal_False;
// nMin and nMax initialized to maximum / minimum (inverse)
xub_StrLen nMin = m_Text.Len();
xub_StrLen nMax = nStt;
- const BOOL bNoLen = !nMin;
+ const sal_Bool bNoLen = !nMin;
// We have to remember the "new" attributes, which have
// been introduced by splitting surrounding attributes (case 4).
@@ -445,7 +445,7 @@ void SwTxtNode::RstAttr(const SwIndex &rIdx, xub_StrLen nLen, USHORT nWhich,
// 1. case: We want to reset only the attributes listed in pSet:
if ( pSet )
{
- bSkipAttr = SFX_ITEM_SET != pSet->GetItemState( pHt->Which(), FALSE );
+ bSkipAttr = SFX_ITEM_SET != pSet->GetItemState( pHt->Which(), sal_False );
if ( bSkipAttr && RES_TXTATR_AUTOFMT == pHt->Which() )
{
// if the current attribute is an autostyle, we have to check if the autostyle
@@ -527,7 +527,7 @@ void SwTxtNode::RstAttr(const SwIndex &rIdx, xub_StrLen nLen, USHORT nWhich,
{
m_pSwpHints->NoteInHistory( pHt );
*pHt->GetStart() = nEnd;
- m_pSwpHints->NoteInHistory( pHt, TRUE );
+ m_pSwpHints->NoteInHistory( pHt, sal_True );
if ( pStyleHandle.get() && nAttrStart < nEnd )
{
@@ -536,7 +536,7 @@ void SwTxtNode::RstAttr(const SwIndex &rIdx, xub_StrLen nLen, USHORT nWhich,
InsertHint( pNew, nsSetAttrMode::SETATTR_NOHINTADJUST );
}
- bChanged = TRUE;
+ bChanged = sal_True;
}
}
}
@@ -549,13 +549,13 @@ void SwTxtNode::RstAttr(const SwIndex &rIdx, xub_StrLen nLen, USHORT nWhich,
nMin = nAttrStart;
if ( nMax < *pAttrEnd )
nMax = *pAttrEnd;
- bChanged = TRUE;
+ bChanged = sal_True;
const xub_StrLen nAttrEnd = *pAttrEnd;
m_pSwpHints->NoteInHistory( pHt );
*pAttrEnd = nStt;
- m_pSwpHints->NoteInHistory( pHt, TRUE );
+ m_pSwpHints->NoteInHistory( pHt, sal_True );
if ( pStyleHandle.get() )
{
@@ -571,11 +571,11 @@ void SwTxtNode::RstAttr(const SwIndex &rIdx, xub_StrLen nLen, USHORT nWhich,
nMin = nAttrStart;
if ( nMax < *pAttrEnd )
nMax = *pAttrEnd;
- bChanged = TRUE;
+ bChanged = sal_True;
xub_StrLen nTmpEnd = *pAttrEnd;
m_pSwpHints->NoteInHistory( pHt );
*pAttrEnd = nStt;
- m_pSwpHints->NoteInHistory( pHt, TRUE );
+ m_pSwpHints->NoteInHistory( pHt, sal_True );
if ( pStyleHandle.get() && nStt < nEnd )
{
@@ -650,13 +650,13 @@ XubString SwTxtNode::GetCurWord( xub_StrLen nPos ) const
sal_Int16 nWordType = WordType::DICTIONARY_WORD;
lang::Locale aLocale( pBreakIt->GetLocale( GetLang( nPos ) ) );
#ifdef DEBUG
- BOOL bBegin = rxBreak->isBeginWord( m_Text, nPos, aLocale, nWordType );
- BOOL bEnd = rxBreak->isEndWord ( m_Text, nPos, aLocale, nWordType );
+ sal_Bool bBegin = rxBreak->isBeginWord( m_Text, nPos, aLocale, nWordType );
+ sal_Bool bEnd = rxBreak->isEndWord ( m_Text, nPos, aLocale, nWordType );
(void)bBegin;
(void)bEnd;
#endif
aBndry =
- rxBreak->getWordBoundary( m_Text, nPos, aLocale, nWordType, TRUE );
+ rxBreak->getWordBoundary( m_Text, nPos, aLocale, nWordType, sal_True );
// if no word was found use previous word (if any)
if (aBndry.startPos == aBndry.endPos)
@@ -676,7 +676,7 @@ XubString SwTxtNode::GetCurWord( xub_StrLen nPos ) const
SwScanner::SwScanner( const SwTxtNode& rNd, const String& rTxt, const LanguageType* pLang,
const ModelToViewHelper::ConversionMap* pConvMap,
- USHORT nType, xub_StrLen nStart, xub_StrLen nEnde, BOOL bClp )
+ sal_uInt16 nType, xub_StrLen nStart, xub_StrLen nEnde, sal_Bool bClp )
: rNode( rNd ), rText( rTxt), pLanguage( pLang ), pConversionMap( pConvMap ), nLen( 0 ), nWordType( nType ), bClip( bClp )
{
ASSERT( rText.Len(), "SwScanner: EmptyString" );
@@ -695,7 +695,7 @@ SwScanner::SwScanner( const SwTxtNode& rNd, const String& rTxt, const LanguageTy
}
}
-BOOL SwScanner::NextWord()
+sal_Bool SwScanner::NextWord()
{
nBegin = nBegin + nLen;
Boundary aBound;
@@ -712,7 +712,7 @@ BOOL SwScanner::NextWord()
{
if ( !pLanguage )
{
- const USHORT nNextScriptType = pBreakIt->GetBreakIter()->getScriptType( rText, nBegin );
+ const sal_uInt16 nNextScriptType = pBreakIt->GetBreakIter()->getScriptType( rText, nBegin );
ModelToViewHelper::ModelPosition aModelBeginPos = ModelToViewHelper::ConvertToModelPosition( pConversionMap, nBegin );
const xub_StrLen nBeginModelPos = (xub_StrLen)aModelBeginPos.mnPos;
aCurrLang = rNode.GetLang( nBeginModelPos, 1, nNextScriptType );
@@ -731,15 +731,16 @@ BOOL SwScanner::NextWord()
}
if ( nBegin >= rText.Len() || nBegin >= nEndPos )
- return FALSE;
+ return sal_False;
// get the word boundaries
aBound = pBreakIt->GetBreakIter()->getWordBoundary( rText, nBegin,
pBreakIt->GetLocale( aCurrLang ), nWordType, sal_True );
+ ASSERT( aBound.endPos >= aBound.startPos, "broken aBound result" );
//no word boundaries could be found
if(aBound.endPos == aBound.startPos)
- return FALSE;
+ return sal_False;
//if a word before is found it has to be searched for the next
if(aBound.endPos == nBegin)
@@ -750,46 +751,54 @@ BOOL SwScanner::NextWord()
rCC.setLocale( aOldLocale );
- // we have to differenciate between these cases:
- if ( aBound.startPos <= nBegin )
+ // #i89042, as discussed with HDU: don't evaluate script changes for word count. Use whole word.
+ if ( nWordType == i18n::WordType::WORD_COUNT )
{
- ASSERT( aBound.endPos >= nBegin, "Unexpected aBound result" )
-
- // restrict boundaries to script boundaries and nEndPos
- const USHORT nCurrScript =
- pBreakIt->GetBreakIter()->getScriptType( rText, nBegin );
-
- XubString aTmpWord = rText.Copy( nBegin, static_cast<xub_StrLen>(aBound.endPos - nBegin) );
- const sal_Int32 nScriptEnd = nBegin +
- pBreakIt->GetBreakIter()->endOfScript( aTmpWord, 0, nCurrScript );
- const sal_Int32 nEnd = Min( aBound.endPos, nScriptEnd );
-
- // restrict word start to last script change position
- sal_Int32 nScriptBegin = 0;
- if ( aBound.startPos < nBegin )
- {
- // search from nBegin backwards until the next script change
- aTmpWord = rText.Copy( static_cast<xub_StrLen>(aBound.startPos),
- static_cast<xub_StrLen>(nBegin - aBound.startPos + 1) );
- nScriptBegin = aBound.startPos +
- pBreakIt->GetBreakIter()->beginOfScript( aTmpWord, nBegin - aBound.startPos,
- nCurrScript );
- }
-
- nBegin = (xub_StrLen)Max( aBound.startPos, nScriptBegin );
- nLen = (xub_StrLen)(nEnd - nBegin);
+ nBegin = Max( static_cast< xub_StrLen >(aBound.startPos), nBegin );
+ nLen = 0;
+ if (static_cast< xub_StrLen >(aBound.endPos) > nBegin)
+ nLen = static_cast< xub_StrLen >(aBound.endPos) - nBegin;
}
else
{
- const USHORT nCurrScript =
- pBreakIt->GetBreakIter()->getScriptType( rText, aBound.startPos );
- XubString aTmpWord = rText.Copy( static_cast<xub_StrLen>(aBound.startPos),
- static_cast<xub_StrLen>(aBound.endPos - aBound.startPos) );
- const sal_Int32 nScriptEnd = aBound.startPos +
- pBreakIt->GetBreakIter()->endOfScript( aTmpWord, 0, nCurrScript );
- const sal_Int32 nEnd = Min( aBound.endPos, nScriptEnd );
- nBegin = (xub_StrLen)aBound.startPos;
- nLen = (xub_StrLen)(nEnd - nBegin);
+ // we have to differenciate between these cases:
+ if ( aBound.startPos <= nBegin )
+ {
+ ASSERT( aBound.endPos >= nBegin, "Unexpected aBound result" )
+
+ // restrict boundaries to script boundaries and nEndPos
+ const sal_uInt16 nCurrScript = pBreakIt->GetBreakIter()->getScriptType( rText, nBegin );
+ XubString aTmpWord = rText.Copy( nBegin, static_cast<xub_StrLen>(aBound.endPos - nBegin) );
+ const sal_Int32 nScriptEnd = nBegin +
+ pBreakIt->GetBreakIter()->endOfScript( aTmpWord, 0, nCurrScript );
+ const sal_Int32 nEnd = Min( aBound.endPos, nScriptEnd );
+
+ // restrict word start to last script change position
+ sal_Int32 nScriptBegin = 0;
+ if ( aBound.startPos < nBegin )
+ {
+ // search from nBegin backwards until the next script change
+ aTmpWord = rText.Copy( static_cast<xub_StrLen>(aBound.startPos),
+ static_cast<xub_StrLen>(nBegin - aBound.startPos + 1) );
+ nScriptBegin = aBound.startPos +
+ pBreakIt->GetBreakIter()->beginOfScript( aTmpWord, nBegin - aBound.startPos,
+ nCurrScript );
+ }
+
+ nBegin = (xub_StrLen)Max( aBound.startPos, nScriptBegin );
+ nLen = (xub_StrLen)(nEnd - nBegin);
+ }
+ else
+ {
+ const sal_uInt16 nCurrScript = pBreakIt->GetBreakIter()->getScriptType( rText, aBound.startPos );
+ XubString aTmpWord = rText.Copy( static_cast<xub_StrLen>(aBound.startPos),
+ static_cast<xub_StrLen>(aBound.endPos - aBound.startPos) );
+ const sal_Int32 nScriptEnd = aBound.startPos +
+ pBreakIt->GetBreakIter()->endOfScript( aTmpWord, 0, nCurrScript );
+ const sal_Int32 nEnd = Min( aBound.endPos, nScriptEnd );
+ nBegin = (xub_StrLen)aBound.startPos;
+ nLen = (xub_StrLen)(nEnd - nBegin);
+ }
}
// optionally clip the result of getWordBoundaries:
@@ -802,15 +811,15 @@ BOOL SwScanner::NextWord()
}
if( ! nLen )
- return FALSE;
+ return sal_False;
aWord = rText.Copy( nBegin, nLen );
- return TRUE;
+ return sal_True;
}
-USHORT SwTxtNode::Spell(SwSpellArgs* pArgs)
+sal_uInt16 SwTxtNode::Spell(SwSpellArgs* pArgs)
{
// Die Aehnlichkeiten zu SwTxtFrm::_AutoSpell sind beabsichtigt ...
// ACHTUNG: Ev. Bugs in beiden Routinen fixen!
@@ -939,8 +948,8 @@ USHORT SwTxtNode::Spell(SwSpellArgs* pArgs)
void SwTxtNode::SetLanguageAndFont( const SwPaM &rPaM,
- LanguageType nLang, USHORT nLangWhichId,
- const Font *pFont, USHORT nFontWhichId )
+ LanguageType nLang, sal_uInt16 nLangWhichId,
+ const Font *pFont, sal_uInt16 nFontWhichId )
{
sal_uInt16 aRanges[] = {
nLangWhichId, nLangWhichId,
@@ -974,7 +983,7 @@ void SwTxtNode::SetLanguageAndFont( const SwPaM &rPaM,
}
-USHORT SwTxtNode::Convert( SwConversionArgs &rArgs )
+sal_uInt16 SwTxtNode::Convert( SwConversionArgs &rArgs )
{
// get range of text within node to be converted
// (either all the text or the the text within the selection
@@ -1105,7 +1114,7 @@ SwRect SwTxtFrm::_AutoSpell( const SwCntntNode* pActNode, const SwViewOption& rV
{
SwRect aRect;
#if OSL_DEBUG_LEVEL > 1
- static BOOL bStop = FALSE;
+ static sal_Bool bStop = sal_False;
if ( bStop )
return aRect;
#endif
@@ -1160,7 +1169,7 @@ SwRect SwTxtFrm::_AutoSpell( const SwCntntNode* pActNode, const SwViewOption& rV
Boundary aBound =
pBreakIt->GetBreakIter()->getWordBoundary( pNode->GetTxt(), nBegin,
pBreakIt->GetLocale( eActLang ),
- WordType::DICTIONARY_WORD, TRUE );
+ WordType::DICTIONARY_WORD, sal_True );
nBegin = xub_StrLen(aBound.startPos);
}
@@ -1174,7 +1183,7 @@ SwRect SwTxtFrm::_AutoSpell( const SwCntntNode* pActNode, const SwViewOption& rV
nInsertPos++;
}
- BOOL bFresh = nBegin < nEnd;
+ sal_Bool bFresh = nBegin < nEnd;
if( nBegin < nEnd )
{
@@ -1200,8 +1209,8 @@ SwRect SwTxtFrm::_AutoSpell( const SwCntntNode* pActNode, const SwViewOption& rV
// within the word
LanguageType eActLang = aScanner.GetCurrentLanguage();
- BOOL bSpell = TRUE;
- bSpell = xSpell.is() ? xSpell->hasLanguage( eActLang ) : FALSE;
+ sal_Bool bSpell = sal_True;
+ bSpell = xSpell.is() ? xSpell->hasLanguage( eActLang ) : sal_False;
if( bSpell && rWord.Len() > 0 )
{
// check for: bAlter => xHyphWord.is()
@@ -1320,16 +1329,16 @@ SwRect SwTxtFrm::SmartTagScan( SwCntntNode* /*pActNode*/, xub_StrLen /*nActPos*/
}
}
- const USHORT nNumberOfEntries = pSmartTagList ? pSmartTagList->Count() : 0;
- USHORT nNumberOfRemovedEntries = 0;
- USHORT nNumberOfInsertedEntries = 0;
+ const sal_uInt16 nNumberOfEntries = pSmartTagList ? pSmartTagList->Count() : 0;
+ sal_uInt16 nNumberOfRemovedEntries = 0;
+ sal_uInt16 nNumberOfInsertedEntries = 0;
// clear smart tag list between nBegin and nEnd:
if ( 0 != nNumberOfEntries )
{
xub_StrLen nChgStart = STRING_LEN;
xub_StrLen nChgEnd = 0;
- const USHORT nCurrentIndex = pSmartTagList->GetWrongPos( nBegin );
+ const sal_uInt16 nCurrentIndex = pSmartTagList->GetWrongPos( nBegin );
pSmartTagList->Fresh( nChgStart, nChgEnd, nBegin, nEnd - nBegin, nCurrentIndex, STRING_LEN );
nNumberOfRemovedEntries = nNumberOfEntries - pSmartTagList->Count();
}
@@ -1370,7 +1379,7 @@ SwRect SwTxtFrm::SmartTagScan( SwCntntNode* /*pActNode*/, xub_StrLen /*nActPos*/
pSmartTagList = pNode->GetSmartTags();
- const USHORT nNumberOfEntriesAfterRecognize = pSmartTagList ? pSmartTagList->Count() : 0;
+ const sal_uInt16 nNumberOfEntriesAfterRecognize = pSmartTagList ? pSmartTagList->Count() : 0;
nNumberOfInsertedEntries = nNumberOfEntriesAfterRecognize - ( nNumberOfEntries - nNumberOfRemovedEntries );
}
@@ -1389,7 +1398,7 @@ SwRect SwTxtFrm::SmartTagScan( SwCntntNode* /*pActNode*/, xub_StrLen /*nActPos*/
// Calculate repaint area:
//
#if OSL_DEBUG_LEVEL > 1
- const USHORT nNumberOfEntriesAfterRecognize2 = pSmartTagList->Count();
+ const sal_uInt16 nNumberOfEntriesAfterRecognize2 = pSmartTagList->Count();
(void) nNumberOfEntriesAfterRecognize2;
#endif
if ( nBegin < nEnd && ( 0 != nNumberOfRemovedEntries ||
@@ -1418,12 +1427,12 @@ void SwTxtFrm::CollectAutoCmplWrds( SwCntntNode* pActNode, xub_StrLen nActPos )
xub_StrLen nBegin = 0;
xub_StrLen nEnd = pNode->GetTxt().Len();
xub_StrLen nLen;
- BOOL bACWDirty = FALSE, bAnyWrd = FALSE;
+ sal_Bool bACWDirty = sal_False, bAnyWrd = sal_False;
if( nBegin < nEnd )
{
- USHORT nCnt = 200;
+ sal_uInt16 nCnt = 200;
SwScanner aScanner( *pNode, pNode->GetTxt(), 0, 0,
WordType::DICTIONARY_WORD, nBegin, nEnd );
while( aScanner.NextWord() )
@@ -1438,10 +1447,10 @@ void SwTxtFrm::CollectAutoCmplWrds( SwCntntNode* pActNode, xub_StrLen nActPos )
{
if( rACW.GetMinWordLen() <= rWord.Len() )
rACW.InsertWord( rWord, *pDoc );
- bAnyWrd = TRUE;
+ bAnyWrd = sal_True;
}
else
- bACWDirty = TRUE;
+ bACWDirty = sal_True;
}
if( !--nCnt )
{
@@ -1453,7 +1462,7 @@ void SwTxtFrm::CollectAutoCmplWrds( SwCntntNode* pActNode, xub_StrLen nActPos )
}
if( bAnyWrd && !bACWDirty )
- pNode->SetAutoCompleteWordDirty( FALSE );
+ pNode->SetAutoCompleteWordDirty( sal_False );
}
@@ -1462,15 +1471,15 @@ void SwTxtFrm::CollectAutoCmplWrds( SwCntntNode* pActNode, xub_StrLen nActPos )
*************************************************************************/
// Findet den TxtFrm und sucht dessen CalcHyph
-BOOL SwTxtNode::Hyphenate( SwInterHyphInfo &rHyphInf )
+sal_Bool SwTxtNode::Hyphenate( SwInterHyphInfo &rHyphInf )
{
// Abkuerzung: am Absatz ist keine Sprache eingestellt:
- if ( LANGUAGE_NONE == USHORT( GetSwAttrSet().GetLanguage().GetLanguage() )
+ if ( LANGUAGE_NONE == sal_uInt16( GetSwAttrSet().GetLanguage().GetLanguage() )
&& USHRT_MAX == GetLang( 0, m_Text.Len() ) )
{
if( !rHyphInf.IsCheck() )
- rHyphInf.SetNoLang( TRUE );
- return FALSE;
+ rHyphInf.SetNoLang( sal_True );
+ return sal_False;
}
if( pLinguNode != this )
@@ -1489,7 +1498,7 @@ BOOL SwTxtNode::Hyphenate( SwInterHyphInfo &rHyphInf )
#if OSL_DEBUG_LEVEL > 1
ASSERT( pFrm, "!SwTxtNode::Hyphenate: can't find any frame" );
#endif
- return FALSE;
+ return sal_False;
}
while( pFrm )
@@ -1500,7 +1509,7 @@ BOOL SwTxtNode::Hyphenate( SwInterHyphInfo &rHyphInf )
// (7821, 7662, 7408); vgl. layact.cxx,
// SwLayAction::_TurboAction(), if( !pCnt->IsValid() ...
pFrm->SetCompletePaint();
- return TRUE;
+ return sal_True;
}
pFrm = (SwTxtFrm*)(pFrm->GetFollow());
if( pFrm )
@@ -1509,7 +1518,7 @@ BOOL SwTxtNode::Hyphenate( SwInterHyphInfo &rHyphInf )
rHyphInf.nStart = pFrm->GetOfst();
}
}
- return FALSE;
+ return sal_False;
}
#ifdef LINGU_STATISTIK
@@ -1524,7 +1533,7 @@ void SwLinguStatistik::Flush()
return ;
static char *pLogName = 0;
- const BOOL bFirstOpen = pLogName ? FALSE : TRUE;
+ const sal_Bool bFirstOpen = pLogName ? sal_False : sal_True;
if( bFirstOpen )
{
char *pPath = getenv( "TEMP" );
@@ -1628,12 +1637,12 @@ void SwTxtNode::TransliterateText(
GetTxt(), nStt,
pBreakIt->GetLocale( GetLang( nStt ) ),
nWordType,
- TRUE /*prefer forward direction*/);
+ sal_True /*prefer forward direction*/);
aEndBndry = pBreakIt->GetBreakIter()->getWordBoundary(
GetTxt(), nEnd,
pBreakIt->GetLocale( GetLang( nEnd ) ),
nWordType,
- FALSE /*prefer backward direction*/);
+ sal_False /*prefer backward direction*/);
// prevent backtracking to the previous word if selection is at word boundary
if (aSttBndry.endPos <= nStt)
@@ -1850,7 +1859,7 @@ void SwTxtNode::ReplaceTextOnly( xub_StrLen nPos, xub_StrLen nLen,
while( nI + nCnt < nTLen && nOff == pOffsets[ nI + nCnt ] )
++nCnt;
- Update( SwIndex( this, nMyOff ), nCnt, FALSE );
+ Update( SwIndex( this, nMyOff ), nCnt, sal_False );
nMyOff = nOff;
//nMyOff -= nCnt;
nI += nCnt - 1;
@@ -1858,13 +1867,13 @@ void SwTxtNode::ReplaceTextOnly( xub_StrLen nPos, xub_StrLen nLen,
else if( nOff > nMyOff )
{
// something is deleted
- Update( SwIndex( this, nMyOff+1 ), nOff - nMyOff, TRUE );
+ Update( SwIndex( this, nMyOff+1 ), nOff - nMyOff, sal_True );
nMyOff = nOff;
}
}
if( nMyOff < nLen )
// something is deleted at the end
- Update( SwIndex( this, nMyOff ), nLen - nMyOff, TRUE );
+ Update( SwIndex( this, nMyOff ), nLen - nMyOff, sal_True );
// notify the layout!
SwDelTxt aDelHint( nPos, nTLen );
@@ -1883,8 +1892,8 @@ void SwTxtNode::CountWords( SwDocStat& rStat,
if ( !IsHidden() )
{
++rStat.nPara;
- ULONG nTmpWords = 0;
- ULONG nTmpChars = 0;
+ sal_uLong nTmpWords = 0;
+ sal_uLong nTmpChars = 0;
// Shortcut: Whole paragraph should be considered and cached values
// are valid:
@@ -1900,7 +1909,7 @@ void SwTxtNode::CountWords( SwDocStat& rStat,
// fills the deleted redlines and hidden ranges with cChar:
const xub_Unicode cChar(' ');
- const USHORT nNumOfMaskedChars =
+ const sal_uInt16 nNumOfMaskedChars =
lcl_MaskRedlinesAndHiddenText( *this, rCastStr, nStt, nEnd, cChar, false );
// expand fields
@@ -1989,8 +1998,8 @@ struct SwParaIdleData_Impl
SwWrongList* pWrong; // for spell checking
SwGrammarMarkUp* pGrammarCheck; // for grammar checking / proof reading
SwWrongList* pSmartTags;
- ULONG nNumberOfWords;
- ULONG nNumberOfChars;
+ sal_uLong nNumberOfWords;
+ sal_uLong nNumberOfChars;
bool bWordCountDirty : 1;
bool bWrongDirty : 1; // Ist das Wrong-Feld auf invalid?
bool bGrammarCheckDirty : 1;
@@ -2088,25 +2097,25 @@ SwWrongList* SwTxtNode::GetSmartTags()
return m_pParaIdleData_Impl ? m_pParaIdleData_Impl->pSmartTags : 0;
}
-void SwTxtNode::SetParaNumberOfWords( ULONG nNew ) const
+void SwTxtNode::SetParaNumberOfWords( sal_uLong nNew ) const
{
if ( m_pParaIdleData_Impl )
{
m_pParaIdleData_Impl->nNumberOfWords = nNew;
}
}
-ULONG SwTxtNode::GetParaNumberOfWords() const
+sal_uLong SwTxtNode::GetParaNumberOfWords() const
{
return m_pParaIdleData_Impl ? m_pParaIdleData_Impl->nNumberOfWords : 0;
}
-void SwTxtNode::SetParaNumberOfChars( ULONG nNew ) const
+void SwTxtNode::SetParaNumberOfChars( sal_uLong nNew ) const
{
if ( m_pParaIdleData_Impl )
{
m_pParaIdleData_Impl->nNumberOfChars = nNew;
}
}
-ULONG SwTxtNode::GetParaNumberOfChars() const
+sal_uLong SwTxtNode::GetParaNumberOfChars() const
{
return m_pParaIdleData_Impl ? m_pParaIdleData_Impl->nNumberOfChars : 0;
}
diff --git a/sw/source/core/undo/SwUndoField.cxx b/sw/source/core/undo/SwUndoField.cxx
index 8a3c6c507c93..44314b88b94e 100644
--- a/sw/source/core/undo/SwUndoField.cxx
+++ b/sw/source/core/undo/SwUndoField.cxx
@@ -27,10 +27,13 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
#include <tools/rtti.hxx>
+
#include <SwUndoField.hxx>
#include <swundo.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <txtfld.hxx>
#include <fldbas.hxx>
#include <ndtxt.hxx>
@@ -65,7 +68,7 @@ SwPosition SwUndoField::GetPosition()
SwUndoFieldFromDoc::SwUndoFieldFromDoc(const SwPosition & rPos,
const SwField & rOldField,
const SwField & rNewField,
- SwMsgPoolItem * _pHnt, BOOL _bUpdate, SwUndoId _nId)
+ SwMsgPoolItem * _pHnt, sal_Bool _bUpdate, SwUndoId _nId)
: SwUndoField(rPos,_nId)
, pOldField(rOldField.CopyField())
, pNewField(rNewField.CopyField())
@@ -83,48 +86,46 @@ SwUndoFieldFromDoc::~SwUndoFieldFromDoc()
delete pNewField;
}
-void SwUndoFieldFromDoc::Undo( SwUndoIter& )
+void SwUndoFieldFromDoc::UndoImpl(::sw::UndoRedoContext &)
{
SwTxtFld * pTxtFld = SwDoc::GetTxtFld(GetPosition());
const SwField * pField = pTxtFld->GetFld().GetFld();
if (pField)
{
- BOOL bUndo = pDoc->DoesUndo();
-
- pDoc->DoUndo(FALSE);
pDoc->UpdateFld(pTxtFld, *pOldField, pHnt, bUpdate);
- pDoc->DoUndo(bUndo);
}
}
-void SwUndoFieldFromDoc::Redo( SwUndoIter& )
+void SwUndoFieldFromDoc::DoImpl()
{
SwTxtFld * pTxtFld = SwDoc::GetTxtFld(GetPosition());
const SwField * pField = pTxtFld->GetFld().GetFld();
if (pField)
{
- BOOL bUndo = pDoc->DoesUndo();
-
- pDoc->DoUndo(FALSE);
pDoc->UpdateFld(pTxtFld, *pNewField, pHnt, bUpdate);
SwFmtFld* pDstFmtFld = (SwFmtFld*)&pTxtFld->GetFld();
if ( pDoc->GetFldType(RES_POSTITFLD, aEmptyStr,false) == pDstFmtFld->GetFld()->GetTyp() )
pDoc->GetDocShell()->Broadcast( SwFmtFldHint( pDstFmtFld, SWFMTFLD_INSERTED ) );
- pDoc->DoUndo(bUndo);
}
}
-void SwUndoFieldFromDoc::Repeat(SwUndoIter & rIt)
+void SwUndoFieldFromDoc::RedoImpl(::sw::UndoRedoContext &)
+{
+ DoImpl();
+}
+
+void SwUndoFieldFromDoc::RepeatImpl(::sw::RepeatContext &)
{
- Redo(rIt);
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
+ DoImpl();
}
SwUndoFieldFromAPI::SwUndoFieldFromAPI(const SwPosition & rPos,
const Any & rOldVal, const Any & rNewVal,
- USHORT _nWhich)
+ sal_uInt16 _nWhich)
: SwUndoField(rPos), aOldVal(rOldVal), aNewVal(rNewVal), nWhich(_nWhich)
{
}
@@ -133,7 +134,7 @@ SwUndoFieldFromAPI::~SwUndoFieldFromAPI()
{
}
-void SwUndoFieldFromAPI::Undo( SwUndoIter& )
+void SwUndoFieldFromAPI::UndoImpl(::sw::UndoRedoContext &)
{
SwField * pField = SwDoc::GetField(GetPosition());
@@ -141,7 +142,7 @@ void SwUndoFieldFromAPI::Undo( SwUndoIter& )
pField->PutValue(aOldVal, nWhich);
}
-void SwUndoFieldFromAPI::Redo( SwUndoIter& )
+void SwUndoFieldFromAPI::DoImpl()
{
SwField * pField = SwDoc::GetField(GetPosition());
@@ -149,8 +150,13 @@ void SwUndoFieldFromAPI::Redo( SwUndoIter& )
pField->PutValue(aNewVal, nWhich);
}
+void SwUndoFieldFromAPI::RedoImpl(::sw::UndoRedoContext &)
+{
+ DoImpl();
+}
-void SwUndoFieldFromAPI::Repeat(SwUndoIter & rIter)
+void SwUndoFieldFromAPI::RepeatImpl(::sw::RepeatContext &)
{
- Redo(rIter);
+ DoImpl();
}
+
diff --git a/sw/source/core/undo/SwUndoFmt.cxx b/sw/source/core/undo/SwUndoFmt.cxx
index f3b2fe4d1a25..a9896b7235ce 100644
--- a/sw/source/core/undo/SwUndoFmt.cxx
+++ b/sw/source/core/undo/SwUndoFmt.cxx
@@ -29,6 +29,8 @@
#include "precompiled_sw.hxx"
#include <tools/resid.hxx>
+#include <tools/string.hxx>
+
#include <poolfmt.hxx>
#include <charfmt.hxx>
#include <frmfmt.hxx>
@@ -37,14 +39,14 @@
#include <swundo.hxx>
#include <undobj.hxx>
#include <fmtcol.hxx>
-#include <tools/string.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <comcore.hrc>
SwUndoFmtCreate::SwUndoFmtCreate
(SwUndoId nUndoId, SwFmt * _pNew, SwFmt * _pDerivedFrom, SwDoc * _pDoc)
: SwUndo(nUndoId), pNew(_pNew),
- pDoc(_pDoc), pNewSet(NULL), nId(0), bAuto(FALSE)
+ pDoc(_pDoc), pNewSet(NULL), nId(0), bAuto(sal_False)
{
if (_pDerivedFrom)
sDerivedFrom = _pDerivedFrom->GetName();
@@ -54,7 +56,7 @@ SwUndoFmtCreate::~SwUndoFmtCreate()
{
}
-void SwUndoFmtCreate::Undo(SwUndoIter &)
+void SwUndoFmtCreate::UndoImpl(::sw::UndoRedoContext &)
{
if (pNew)
{
@@ -70,20 +72,13 @@ void SwUndoFmtCreate::Undo(SwUndoIter &)
nId = pNew->GetPoolFmtId() & COLL_GET_RANGE_BITS;
bAuto = pNew->IsAuto();
- BOOL bDoesUndo = pDoc->DoesUndo();
-
- pDoc->DoUndo(FALSE);
Delete();
- pDoc->DoUndo(bDoesUndo);
}
}
}
-void SwUndoFmtCreate::Redo(SwUndoIter &)
+void SwUndoFmtCreate::RedoImpl(::sw::UndoRedoContext &)
{
- BOOL bDoesUndo = pDoc->DoesUndo();
-
- pDoc->DoUndo(FALSE);
SwFmt * pDerivedFrom = Find(sDerivedFrom);
SwFmt * pFmt = Create(pDerivedFrom);
@@ -99,8 +94,6 @@ void SwUndoFmtCreate::Redo(SwUndoIter &)
}
else
pNew = NULL;
-
- pDoc->DoUndo(bDoesUndo);
}
SwRewriter SwUndoFmtCreate::GetRewriter() const
@@ -130,12 +123,8 @@ SwUndoFmtDelete::~SwUndoFmtDelete()
{
}
-void SwUndoFmtDelete::Undo(SwUndoIter &)
+void SwUndoFmtDelete::UndoImpl(::sw::UndoRedoContext &)
{
- BOOL bDoesUndo = pDoc->DoesUndo();
-
- pDoc->DoUndo(FALSE);
-
SwFmt * pDerivedFrom = Find(sDerivedFrom);
SwFmt * pFmt = Create(pDerivedFrom);
@@ -147,23 +136,16 @@ void SwUndoFmtDelete::Undo(SwUndoIter &)
pFmt->SetPoolFmtId((pFmt->GetPoolFmtId() &
~COLL_GET_RANGE_BITS)
| nId);
-
}
-
- pDoc->DoUndo(bDoesUndo);
}
-void SwUndoFmtDelete::Redo(SwUndoIter &)
+void SwUndoFmtDelete::RedoImpl(::sw::UndoRedoContext &)
{
SwFmt * pOld = Find(sOldName);
if (pOld)
{
- BOOL bDoesUndo = pDoc->DoesUndo();
-
- pDoc->DoUndo(FALSE);
Delete(pOld);
- pDoc->DoUndo(bDoesUndo);
}
}
@@ -190,31 +172,23 @@ SwUndoRenameFmt::~SwUndoRenameFmt()
{
}
-void SwUndoRenameFmt::Undo(SwUndoIter &)
+void SwUndoRenameFmt::UndoImpl(::sw::UndoRedoContext &)
{
SwFmt * pFmt = Find(sNewName);
if (pFmt)
{
- BOOL bDoesUndo = pDoc->DoesUndo();
-
- pDoc->DoUndo(FALSE);
- pDoc->RenameFmt(*pFmt, sOldName, TRUE);
- pDoc->DoUndo(bDoesUndo);
+ pDoc->RenameFmt(*pFmt, sOldName, sal_True);
}
}
-void SwUndoRenameFmt::Redo(SwUndoIter &)
+void SwUndoRenameFmt::RedoImpl(::sw::UndoRedoContext &)
{
SwFmt * pFmt = Find(sOldName);
if (pFmt)
{
- BOOL bDoesUndo = pDoc->DoesUndo();
-
- pDoc->DoUndo(FALSE);
- pDoc->RenameFmt(*pFmt, sNewName, TRUE);
- pDoc->DoUndo(bDoesUndo);
+ pDoc->RenameFmt(*pFmt, sNewName, sal_True);
}
}
@@ -237,12 +211,12 @@ SwUndoTxtFmtCollCreate::SwUndoTxtFmtCollCreate
SwFmt * SwUndoTxtFmtCollCreate::Create(SwFmt * pDerivedFrom)
{
- return pDoc->MakeTxtFmtColl(sNewName, (SwTxtFmtColl *)pDerivedFrom, TRUE);
+ return pDoc->MakeTxtFmtColl(sNewName, (SwTxtFmtColl *)pDerivedFrom, sal_True);
}
void SwUndoTxtFmtCollCreate::Delete()
{
- pDoc->DelTxtFmtColl((SwTxtFmtColl *) pNew, TRUE);
+ pDoc->DelTxtFmtColl((SwTxtFmtColl *) pNew, sal_True);
}
SwFmt * SwUndoTxtFmtCollCreate::Find(const String & rName) const
@@ -258,12 +232,12 @@ SwUndoTxtFmtCollDelete::SwUndoTxtFmtCollDelete(SwTxtFmtColl * _pOld,
SwFmt * SwUndoTxtFmtCollDelete::Create(SwFmt * pDerivedFrom)
{
- return pDoc->MakeTxtFmtColl(sOldName, (SwTxtFmtColl *) pDerivedFrom, TRUE);
+ return pDoc->MakeTxtFmtColl(sOldName, (SwTxtFmtColl *) pDerivedFrom, sal_True);
}
void SwUndoTxtFmtCollDelete::Delete(SwFmt * pOld)
{
- pDoc->DelTxtFmtColl((SwTxtFmtColl *) pOld, TRUE);
+ pDoc->DelTxtFmtColl((SwTxtFmtColl *) pOld, sal_True);
}
SwFmt * SwUndoTxtFmtCollDelete::Find(const String & rName) const
@@ -292,12 +266,12 @@ SwUndoCharFmtCreate::SwUndoCharFmtCreate(SwCharFmt * pNewFmt,
SwFmt * SwUndoCharFmtCreate::Create(SwFmt * pDerivedFrom)
{
- return pDoc->MakeCharFmt(sNewName, (SwCharFmt *) pDerivedFrom, TRUE);
+ return pDoc->MakeCharFmt(sNewName, (SwCharFmt *) pDerivedFrom, sal_True);
}
void SwUndoCharFmtCreate::Delete()
{
- pDoc->DelCharFmt((SwCharFmt *) pNew, TRUE);
+ pDoc->DelCharFmt((SwCharFmt *) pNew, sal_True);
}
SwFmt * SwUndoCharFmtCreate::Find(const String & rName) const
@@ -312,12 +286,12 @@ SwUndoCharFmtDelete::SwUndoCharFmtDelete(SwCharFmt * pOld, SwDoc * pDocument)
SwFmt * SwUndoCharFmtDelete::Create(SwFmt * pDerivedFrom)
{
- return pDoc->MakeCharFmt(sOldName, (SwCharFmt *) pDerivedFrom, TRUE);
+ return pDoc->MakeCharFmt(sOldName, (SwCharFmt *) pDerivedFrom, sal_True);
}
void SwUndoCharFmtDelete::Delete(SwFmt * pFmt)
{
- pDoc->DelCharFmt((SwCharFmt *) pFmt, TRUE);
+ pDoc->DelCharFmt((SwCharFmt *) pFmt, sal_True);
}
SwFmt * SwUndoCharFmtDelete::Find(const String & rName) const
@@ -347,12 +321,12 @@ SwUndoFrmFmtCreate::SwUndoFrmFmtCreate(SwFrmFmt * pNewFmt,
SwFmt * SwUndoFrmFmtCreate::Create(SwFmt * pDerivedFrom)
{
- return pDoc->MakeFrmFmt(sNewName, (SwFrmFmt *) pDerivedFrom, TRUE, bAuto);
+ return pDoc->MakeFrmFmt(sNewName, (SwFrmFmt *) pDerivedFrom, sal_True, bAuto);
}
void SwUndoFrmFmtCreate::Delete()
{
- pDoc->DelFrmFmt((SwFrmFmt *) pNew, TRUE);
+ pDoc->DelFrmFmt((SwFrmFmt *) pNew, sal_True);
}
SwFmt * SwUndoFrmFmtCreate::Find(const String & rName) const
@@ -367,12 +341,12 @@ SwUndoFrmFmtDelete::SwUndoFrmFmtDelete(SwFrmFmt * pOld, SwDoc * pDocument)
SwFmt * SwUndoFrmFmtDelete::Create(SwFmt * pDerivedFrom)
{
- return pDoc->MakeFrmFmt(sOldName, (SwFrmFmt *) pDerivedFrom, TRUE);
+ return pDoc->MakeFrmFmt(sOldName, (SwFrmFmt *) pDerivedFrom, sal_True);
}
void SwUndoFrmFmtDelete::Delete(SwFmt * pFmt)
{
- pDoc->DelFrmFmt((SwFrmFmt *) pFmt, TRUE);
+ pDoc->DelFrmFmt((SwFrmFmt *) pFmt, sal_True);
}
SwFmt * SwUndoFrmFmtDelete::Find(const String & rName) const
@@ -399,29 +373,20 @@ SwUndoNumruleCreate::SwUndoNumruleCreate(const SwNumRule * _pNew,
{
}
-void SwUndoNumruleCreate::Undo(SwUndoIter &)
+void SwUndoNumruleCreate::UndoImpl(::sw::UndoRedoContext &)
{
- BOOL bDoesUndo = pDoc->DoesUndo();
-
- pDoc->DoUndo(FALSE);
-
if (! bInitialized)
{
aNew = *pNew;
bInitialized = true;
}
- pDoc->DelNumRule(aNew.GetName(), TRUE);
- pDoc->DoUndo(bDoesUndo);
+ pDoc->DelNumRule(aNew.GetName(), sal_True);
}
-void SwUndoNumruleCreate::Redo(SwUndoIter &)
+void SwUndoNumruleCreate::RedoImpl(::sw::UndoRedoContext &)
{
- BOOL bDoesUndo = pDoc->DoesUndo();
-
- pDoc->DoUndo(FALSE);
- pDoc->MakeNumRule(aNew.GetName(), &aNew, TRUE);
- pDoc->DoUndo(bDoesUndo);
+ pDoc->MakeNumRule(aNew.GetName(), &aNew, sal_True);
}
SwRewriter SwUndoNumruleCreate::GetRewriter() const
@@ -445,22 +410,14 @@ SwUndoNumruleDelete::SwUndoNumruleDelete(const SwNumRule & rRule,
{
}
-void SwUndoNumruleDelete::Undo(SwUndoIter &)
+void SwUndoNumruleDelete::UndoImpl(::sw::UndoRedoContext &)
{
- BOOL bDoesUndo = pDoc->DoesUndo();
-
- pDoc->DoUndo(FALSE);
- pDoc->MakeNumRule(aOld.GetName(), &aOld, TRUE);
- pDoc->DoUndo(bDoesUndo);
+ pDoc->MakeNumRule(aOld.GetName(), &aOld, sal_True);
}
-void SwUndoNumruleDelete::Redo(SwUndoIter &)
+void SwUndoNumruleDelete::RedoImpl(::sw::UndoRedoContext &)
{
- BOOL bDoesUndo = pDoc->DoesUndo();
-
- pDoc->DoUndo(FALSE);
- pDoc->DelNumRule(aOld.GetName(), TRUE);
- pDoc->DoUndo(bDoesUndo);
+ pDoc->DelNumRule(aOld.GetName(), sal_True);
}
SwRewriter SwUndoNumruleDelete::GetRewriter() const
@@ -480,22 +437,14 @@ SwUndoNumruleRename::SwUndoNumruleRename(const String & _aOldName,
{
}
-void SwUndoNumruleRename::Undo(SwUndoIter &)
+void SwUndoNumruleRename::UndoImpl(::sw::UndoRedoContext &)
{
- BOOL bDoesUndo = pDoc->DoesUndo();
-
- pDoc->DoUndo(FALSE);
- pDoc->RenameNumRule(aNewName, aOldName, TRUE);
- pDoc->DoUndo(bDoesUndo);
+ pDoc->RenameNumRule(aNewName, aOldName, sal_True);
}
-void SwUndoNumruleRename::Redo(SwUndoIter &)
+void SwUndoNumruleRename::RedoImpl(::sw::UndoRedoContext &)
{
- BOOL bDoesUndo = pDoc->DoesUndo();
-
- pDoc->DoUndo(FALSE);
- pDoc->RenameNumRule(aOldName, aNewName, TRUE);
- pDoc->DoUndo(bDoesUndo);
+ pDoc->RenameNumRule(aOldName, aNewName, sal_True);
}
SwRewriter SwUndoNumruleRename::GetRewriter() const
diff --git a/sw/source/core/undo/SwUndoPageDesc.cxx b/sw/source/core/undo/SwUndoPageDesc.cxx
index b51bca0280c0..960a73ef3c0b 100644
--- a/sw/source/core/undo/SwUndoPageDesc.cxx
+++ b/sw/source/core/undo/SwUndoPageDesc.cxx
@@ -30,6 +30,7 @@
#include <tools/resid.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <swundo.hxx>
#include <pagedesc.hxx>
#include <SwUndoPageDesc.hxx>
@@ -48,10 +49,10 @@
// Pure debug help function to have a quick look at the header/footer attributes.
void DebugHeaderFooterContent( const SwPageDesc& rPageDesc )
{
- ULONG nHeaderMaster = ULONG_MAX;
- ULONG nHeaderLeft = ULONG_MAX;
- ULONG nFooterMaster = ULONG_MAX;
- ULONG nFooterLeft = ULONG_MAX;
+ sal_uLong nHeaderMaster = ULONG_MAX;
+ sal_uLong nHeaderLeft = ULONG_MAX;
+ sal_uLong nFooterMaster = ULONG_MAX;
+ sal_uLong nFooterLeft = ULONG_MAX;
int nHeaderCount = 0;
int nLeftHeaderCount = 0;
int nFooterCount = 0;
@@ -211,7 +212,7 @@ void SwUndoPageDesc::ExchangeContentNodes( SwPageDesc& rSource, SwPageDesc &rDes
// Let the destination page descrition point to the source node position,
// from now on this descriptor is responsible for the content nodes!
const SfxPoolItem* pItem;
- rDest.GetMaster().GetAttrSet().GetItemState( RES_HEADER, FALSE, &pItem );
+ rDest.GetMaster().GetAttrSet().GetItemState( RES_HEADER, sal_False, &pItem );
SfxPoolItem *pNewItem = pItem->Clone();
SwFrmFmt* pNewFmt = ((SwFmtHeader*)pNewItem)->GetHeaderFmt();
#ifdef DEBUG
@@ -225,7 +226,7 @@ void SwUndoPageDesc::ExchangeContentNodes( SwPageDesc& rSource, SwPageDesc &rDes
// Let the source page description point to zero node position,
// it loses the responsible and can be destroyed without removing the content nodes.
- rSource.GetMaster().GetAttrSet().GetItemState( RES_HEADER, FALSE, &pItem );
+ rSource.GetMaster().GetAttrSet().GetItemState( RES_HEADER, sal_False, &pItem );
pNewItem = pItem->Clone();
pNewFmt = ((SwFmtHeader*)pNewItem)->GetHeaderFmt();
pNewFmt->SetFmtAttr( SwFmtCntnt() );
@@ -235,7 +236,7 @@ void SwUndoPageDesc::ExchangeContentNodes( SwPageDesc& rSource, SwPageDesc &rDes
{
// Same procedure for unshared header..
const SwFmtHeader& rSourceLeftHead = rSource.GetLeft().GetHeader();
- rDest.GetLeft().GetAttrSet().GetItemState( RES_HEADER, FALSE, &pItem );
+ rDest.GetLeft().GetAttrSet().GetItemState( RES_HEADER, sal_False, &pItem );
pNewItem = pItem->Clone();
pNewFmt = ((SwFmtHeader*)pNewItem)->GetHeaderFmt();
#ifdef DEBUG
@@ -246,7 +247,7 @@ void SwUndoPageDesc::ExchangeContentNodes( SwPageDesc& rSource, SwPageDesc &rDes
#endif
pNewFmt->SetFmtAttr( rSourceLeftHead.GetHeaderFmt()->GetCntnt() );
delete pNewItem;
- rSource.GetLeft().GetAttrSet().GetItemState( RES_HEADER, FALSE, &pItem );
+ rSource.GetLeft().GetAttrSet().GetItemState( RES_HEADER, sal_False, &pItem );
pNewItem = pItem->Clone();
pNewFmt = ((SwFmtHeader*)pNewItem)->GetHeaderFmt();
pNewFmt->SetFmtAttr( SwFmtCntnt() );
@@ -259,7 +260,7 @@ void SwUndoPageDesc::ExchangeContentNodes( SwPageDesc& rSource, SwPageDesc &rDes
if( rDestFoot.IsActive() )
{
const SfxPoolItem* pItem;
- rDest.GetMaster().GetAttrSet().GetItemState( RES_FOOTER, FALSE, &pItem );
+ rDest.GetMaster().GetAttrSet().GetItemState( RES_FOOTER, sal_False, &pItem );
SfxPoolItem *pNewItem = pItem->Clone();
SwFrmFmt *pNewFmt = ((SwFmtFooter*)pNewItem)->GetFooterFmt();
pNewFmt->SetFmtAttr( rSourceFoot.GetFooterFmt()->GetCntnt() );
@@ -271,7 +272,7 @@ void SwUndoPageDesc::ExchangeContentNodes( SwPageDesc& rSource, SwPageDesc &rDes
const SwFmtCntnt& rFooterDestCntnt = rDestFoot.GetFooterFmt()->GetCntnt();
(void)rFooterDestCntnt;
#endif
- rSource.GetMaster().GetAttrSet().GetItemState( RES_FOOTER, FALSE, &pItem );
+ rSource.GetMaster().GetAttrSet().GetItemState( RES_FOOTER, sal_False, &pItem );
pNewItem = pItem->Clone();
pNewFmt = ((SwFmtFooter*)pNewItem)->GetFooterFmt();
pNewFmt->SetFmtAttr( SwFmtCntnt() );
@@ -287,12 +288,12 @@ void SwUndoPageDesc::ExchangeContentNodes( SwPageDesc& rSource, SwPageDesc &rDes
(void)rFooterSourceCntnt2;
(void)rFooterDestCntnt2;
#endif
- rDest.GetLeft().GetAttrSet().GetItemState( RES_FOOTER, FALSE, &pItem );
+ rDest.GetLeft().GetAttrSet().GetItemState( RES_FOOTER, sal_False, &pItem );
pNewItem = pItem->Clone();
pNewFmt = ((SwFmtFooter*)pNewItem)->GetFooterFmt();
pNewFmt->SetFmtAttr( rSourceLeftFoot.GetFooterFmt()->GetCntnt() );
delete pNewItem;
- rSource.GetLeft().GetAttrSet().GetItemState( RES_FOOTER, FALSE, &pItem );
+ rSource.GetLeft().GetAttrSet().GetItemState( RES_FOOTER, sal_False, &pItem );
pNewItem = pItem->Clone();
pNewFmt = ((SwFmtFooter*)pNewItem)->GetFooterFmt();
pNewFmt->SetFmtAttr( SwFmtCntnt() );
@@ -301,34 +302,20 @@ void SwUndoPageDesc::ExchangeContentNodes( SwPageDesc& rSource, SwPageDesc &rDes
}
}
-void SwUndoPageDesc::Undo(SwUndoIter &)
+void SwUndoPageDesc::UndoImpl(::sw::UndoRedoContext &)
{
- BOOL bUndo = pDoc->DoesUndo();
-
- pDoc->DoUndo(FALSE);
-
// Move (header/footer)content node responsibility from new page descriptor to old one again.
if( bExchange )
ExchangeContentNodes( (SwPageDesc&)aNew, (SwPageDesc&)aOld );
pDoc->ChgPageDesc(aOld.GetName(), aOld);
- pDoc->DoUndo(bUndo);
}
-void SwUndoPageDesc::Redo(SwUndoIter &)
+void SwUndoPageDesc::RedoImpl(::sw::UndoRedoContext &)
{
- BOOL bUndo = pDoc->DoesUndo();
-
- pDoc->DoUndo(FALSE);
-
// Move (header/footer)content node responsibility from old page descriptor to new one again.
if( bExchange )
ExchangeContentNodes( (SwPageDesc&)aOld, (SwPageDesc&)aNew );
pDoc->ChgPageDesc(aNew.GetName(), aNew);
- pDoc->DoUndo(bUndo);
-}
-
-void SwUndoPageDesc::Repeat(SwUndoIter &)
-{
}
SwRewriter SwUndoPageDesc::GetRewriter() const
@@ -355,12 +342,8 @@ SwUndoPageDescCreate::~SwUndoPageDescCreate()
{
}
-void SwUndoPageDescCreate::Undo(SwUndoIter &)
+void SwUndoPageDescCreate::UndoImpl(::sw::UndoRedoContext &)
{
- BOOL bUndo = pDoc->DoesUndo();
-
- pDoc->DoUndo(FALSE);
-
// -> #116530#
if (pDesc)
{
@@ -369,26 +352,24 @@ void SwUndoPageDescCreate::Undo(SwUndoIter &)
}
// <- #116530#
- pDoc->DelPageDesc(aNew.GetName(), TRUE);
- pDoc->DoUndo(bUndo);
+ pDoc->DelPageDesc(aNew.GetName(), sal_True);
}
-
-void SwUndoPageDescCreate::Redo(SwUndoIter &)
+void SwUndoPageDescCreate::DoImpl()
{
- BOOL bUndo = pDoc->DoesUndo();
-
- pDoc->DoUndo(FALSE);
-
SwPageDesc aPageDesc = aNew;
- pDoc->MakePageDesc(aNew.GetName(), &aPageDesc, FALSE, TRUE); // #116530#
+ pDoc->MakePageDesc(aNew.GetName(), &aPageDesc, sal_False, sal_True); // #116530#
+}
- pDoc->DoUndo(bUndo);
+void SwUndoPageDescCreate::RedoImpl(::sw::UndoRedoContext &)
+{
+ DoImpl();
}
-void SwUndoPageDescCreate::Repeat(SwUndoIter & rIt)
+void SwUndoPageDescCreate::RepeatImpl(::sw::RepeatContext &)
{
- Redo(rIt);
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
+ DoImpl();
}
SwRewriter SwUndoPageDescCreate::GetRewriter() const
@@ -415,29 +396,26 @@ SwUndoPageDescDelete::~SwUndoPageDescDelete()
{
}
-void SwUndoPageDescDelete::Undo(SwUndoIter &)
+void SwUndoPageDescDelete::UndoImpl(::sw::UndoRedoContext &)
{
- BOOL bUndo = pDoc->DoesUndo();
-
- pDoc->DoUndo(FALSE);
-
SwPageDesc aPageDesc = aOld;
- pDoc->MakePageDesc(aOld.GetName(), &aPageDesc, FALSE, TRUE); // #116530#
- pDoc->DoUndo(bUndo);
+ pDoc->MakePageDesc(aOld.GetName(), &aPageDesc, sal_False, sal_True); // #116530#
}
-void SwUndoPageDescDelete::Redo(SwUndoIter &)
+void SwUndoPageDescDelete::DoImpl()
{
- BOOL bUndo = pDoc->DoesUndo();
+ pDoc->DelPageDesc(aOld.GetName(), sal_True); // #116530#
+}
- pDoc->DoUndo(FALSE);
- pDoc->DelPageDesc(aOld.GetName(), TRUE); // #116530#
- pDoc->DoUndo(bUndo);
+void SwUndoPageDescDelete::RedoImpl(::sw::UndoRedoContext &)
+{
+ DoImpl();
}
-void SwUndoPageDescDelete::Repeat(SwUndoIter & rIt)
+void SwUndoPageDescDelete::RepeatImpl(::sw::RepeatContext &)
{
- Redo(rIt);
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
+ DoImpl();
}
SwRewriter SwUndoPageDescDelete::GetRewriter() const
diff --git a/sw/source/core/undo/SwUndoTOXChange.cxx b/sw/source/core/undo/SwUndoTOXChange.cxx
index 8628ff70acc7..457ddc366e7c 100644
--- a/sw/source/core/undo/SwUndoTOXChange.cxx
+++ b/sw/source/core/undo/SwUndoTOXChange.cxx
@@ -27,6 +27,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
#include <SwUndoTOXChange.hxx>
#include <swundo.hxx>
#include <doctxm.hxx>
@@ -45,27 +46,32 @@ void SwUndoTOXChange::UpdateTOXBaseSection()
if (pTOX->ISA(SwTOXBaseSection))
{
SwTOXBaseSection * pTOXBase = static_cast<SwTOXBaseSection *>(pTOX);
-
pTOXBase->Update();
pTOXBase->UpdatePageNum();
}
}
-void SwUndoTOXChange::Undo(SwUndoIter &)
+void SwUndoTOXChange::UndoImpl(::sw::UndoRedoContext &)
{
*pTOX = aOld;
UpdateTOXBaseSection();
}
-void SwUndoTOXChange::Redo(SwUndoIter &)
+void SwUndoTOXChange::DoImpl()
{
*pTOX = aNew;
UpdateTOXBaseSection();
}
-void SwUndoTOXChange::Repeat(SwUndoIter & rIter)
+void SwUndoTOXChange::RedoImpl(::sw::UndoRedoContext &)
+{
+ DoImpl();
+}
+
+void SwUndoTOXChange::RepeatImpl(::sw::RepeatContext &)
{
- Redo(rIter);
+ DoImpl();
}
+
diff --git a/sw/source/core/undo/docundo.cxx b/sw/source/core/undo/docundo.cxx
index 85adbd1c7138..2e91da080c7c 100644
--- a/sw/source/core/undo/docundo.cxx
+++ b/sw/source/core/undo/docundo.cxx
@@ -28,1000 +28,554 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-#include <svx/svdmodel.hxx>
+#include <UndoManager.hxx>
+
+#include <unotools/undoopt.hxx>
#include <vcl/wrkwin.hxx>
+
+#include <svx/svdmodel.hxx>
+
+#include <swmodule.hxx>
#include <doc.hxx>
+#include <ndarr.hxx>
#include <pam.hxx>
#include <ndtxt.hxx>
-#include <swundo.hxx> // fuer die UndoIds
-#include <undobj.hxx>
+#include <swundo.hxx>
+#include <UndoCore.hxx>
#include <rolbck.hxx>
-#include <docary.hxx>
-#ifndef _UNDO_HRC
#include <undo.hrc>
-#endif
+#include <editsh.hxx>
+#include <unobaseclass.hxx>
+#include <limits>
using namespace ::com::sun::star;
-USHORT SwDoc::nUndoActions = UNDO_ACTION_COUNT; // anzahl von Undo-Action
-
// the undo array should never grow beyond this limit:
#define UNDO_ACTION_LIMIT (USHRT_MAX - 1000)
-SV_IMPL_PTRARR( SwUndoIds, SwUndoIdAndNamePtr )
-
-//#define _SHOW_UNDORANGE
-#ifdef _SHOW_UNDORANGE
+// UndoManager ///////////////////////////////////////////////////////////
+namespace sw {
-class UndoArrStatus : public WorkWindow
+UndoManager::UndoManager(::std::auto_ptr<SwNodes> pUndoNodes,
+ IDocumentDrawModelAccess & rDrawModelAccess,
+ IDocumentRedlineAccess & rRedlineAccess,
+ IDocumentState & rState)
+ : m_rDrawModelAccess(rDrawModelAccess)
+ , m_rRedlineAccess(rRedlineAccess)
+ , m_rState(rState)
+ , m_pUndoNodes(pUndoNodes)
+ , m_bGroupUndo(true)
+ , m_bDrawUndo(true)
+ , m_bLockUndoNoModifiedPosition(false)
+ , m_UndoSaveMark(MARK_INVALID)
{
- USHORT nUndo, nUndoNds;
- virtual void Paint( const Rectangle& );
-public:
- UndoArrStatus();
- void Set( USHORT, USHORT );
-};
-static UndoArrStatus* pUndoMsgWin = 0;
-
-
-UndoArrStatus::UndoArrStatus()
- : WorkWindow( APP_GETAPPWINDOW() ), nUndo(0), nUndoNds(0)
-{
- SetSizePixel( Size( 200, 100 ));
- SetFont( Font( "Courier", Size( 0, 10 )) );
- Show();
+ OSL_ASSERT(m_pUndoNodes.get());
+ // writer expects it to be disabled initially
+ // Undo is enabled by SwEditShell constructor
+ SfxUndoManager::EnableUndo(false);
}
-
-void UndoArrStatus::Set( USHORT n1, USHORT n2 )
+SwNodes const& UndoManager::GetUndoNodes() const
{
- nUndo = n1; nUndoNds = n2;
- Invalidate();
+ return *m_pUndoNodes;
}
-
-void UndoArrStatus::Paint( const Rectangle& )
+SwNodes & UndoManager::GetUndoNodes()
{
- String s;
- DrawRect( Rectangle( Point(0,0), GetOutputSize() ));
- ( s = "Undos: " ) += nUndo;
- DrawText( Point( 0, 0 ), s );
- ( s = "UndoNodes: " ) += nUndoNds;
- DrawText( Point( 0, 15 ), s );
+ return *m_pUndoNodes;
}
-#endif
-
-void SwDoc::SetUndoNoResetModified()
+bool UndoManager::IsUndoNodes(SwNodes const& rNodes) const
{
- nUndoSavePos = USHRT_MAX;
+ return & rNodes == m_pUndoNodes.get();
}
-bool SwDoc::IsUndoNoResetModified() const
+void UndoManager::DoUndo(bool const bDoUndo)
{
- return USHRT_MAX == nUndoSavePos;
-}
+ EnableUndo(bDoUndo);
-void SwDoc::DoUndo(bool bUn)
-{
- mbUndo = bUn;
-
- SdrModel* pSdrModel = GetDrawModel();
+ SdrModel *const pSdrModel = m_rDrawModelAccess.GetDrawModel();
if( pSdrModel )
- pSdrModel->EnableUndo(bUn);
+ {
+ pSdrModel->EnableUndo(bDoUndo);
+ }
}
-bool SwDoc::DoesUndo() const
+bool UndoManager::DoesUndo() const
{
- return mbUndo;
+ return IsUndoEnabled();
}
-void SwDoc::DoGroupUndo(bool bUn)
+void UndoManager::DoGroupUndo(bool const bDoUndo)
{
- mbGroupUndo = bUn;
+ m_bGroupUndo = bDoUndo;
}
-bool SwDoc::DoesGroupUndo() const
+bool UndoManager::DoesGroupUndo() const
{
- return mbGroupUndo;
+ return m_bGroupUndo;
}
-sal_uInt16 SwDoc::GetUndoActionCount()
+void UndoManager::DoDrawUndo(bool const bDoUndo)
{
- return nUndoActions;
+ m_bDrawUndo = bDoUndo;
}
-void SwDoc::SetUndoActionCount( sal_uInt16 nNew )
+bool UndoManager::DoesDrawUndo() const
{
- nUndoActions = nNew;
+ return m_bDrawUndo;
}
-const SwNodes* SwDoc::GetUndoNds() const
-{
- return &aUndoNodes;
-}
-void SwDoc::AppendUndo( SwUndo* pUndo )
+bool UndoManager::IsUndoNoResetModified() const
{
- if( nsRedlineMode_t::REDLINE_NONE == pUndo->GetRedlineMode() )
- pUndo->SetRedlineMode( GetRedlineMode() );
-
- // Unfortunately, the silly SvPtrArr can only store a little less than
- // USHRT_MAX elements. Of course it doesn't see any necessity for asserting
- // or even doing error handling. pUndos should definitely be replaced by an
- // STL container that doesn't have this problem. cf #95884#
- DBG_ASSERT( pUndos->Count() < USHRT_MAX - 16,
- "Writer will crash soon. I apologize for the inconvenience." );
-
- pUndos->Insert( pUndo, nUndoPos );
- ++nUndoPos;
- switch( pUndo->GetId() )
- {
- case UNDO_START: ++nUndoSttEnd;
- break;
-
- case UNDO_END: ASSERT( nUndoSttEnd, "Undo-Ende ohne Start" );
- --nUndoSttEnd;
- // kein break !!!
- default:
- if( pUndos->Count() != nUndoPos && UNDO_END != pUndo->GetId() )
- ClearRedo();
- else {
- ASSERT( pUndos->Count() == nUndoPos || UNDO_END == pUndo->GetId(),
- "Redo history not deleted!" );
- }
- if( !nUndoSttEnd )
- ++nUndoCnt;
- break;
- }
-
-#ifdef _SHOW_UNDORANGE
- // zur Anzeige der aktuellen Undo-Groessen
- if( !pUndoMsgWin )
- pUndoMsgWin = new UndoArrStatus;
- pUndoMsgWin->Set( pUndos->Count(), aUndoNodes.Count() );
-#endif
-
- // noch eine offene Klammerung, kann man sich den Rest schenken
- if( nUndoSttEnd )
- return;
-
- // folgende Array-Grenzen muessen ueberwacht werden:
- // - Undo, Grenze: fester Wert oder USHRT_MAX - 1000
- // - UndoNodes, Grenze: USHRT_MAX - 1000
- // - AttrHistory Grenze: USHRT_MAX - 1000
- // (defined in UNDO_ACTION_LIMIT at the top of this file)
-
- USHORT nEnde = UNDO_ACTION_LIMIT;
+ return MARK_INVALID == m_UndoSaveMark;
+}
-// nur zum Testen der neuen DOC-Member
-#ifdef DBG_UTIL
+void UndoManager::SetUndoNoResetModified()
{
- SwUndoId nId = UNDO_EMPTY;
- USHORT nUndosCnt = 0, nSttEndCnt = 0;
- for( USHORT nCnt = 0; nCnt < nUndoPos; ++nCnt )
+ if (MARK_INVALID != m_UndoSaveMark)
{
- if( UNDO_START == ( nId = (*pUndos)[ nCnt ]->GetId()) )
- ++nSttEndCnt;
- else if( UNDO_END == nId )
- --nSttEndCnt;
- if( !nSttEndCnt )
- ++nUndosCnt;
+ RemoveMark(m_UndoSaveMark);
+ m_UndoSaveMark = MARK_INVALID;
}
- ASSERT( nSttEndCnt == nUndoSttEnd, "Start-Ende Count ungleich" );
- ASSERT( nUndosCnt == nUndoCnt, "Undo Count ungleich" );
}
-#endif
- if( SwDoc::nUndoActions < nUndoCnt )
- // immer 1/10 loeschen
- //JP 23.09.95: oder wenn neu eingestellt wurde um die Differenz
- //JP 29.5.2001: Task #83891#: remove only the overlapping actions
- DelUndoObj( nUndoCnt - SwDoc::nUndoActions );
- else
+void UndoManager::SetUndoNoModifiedPosition()
+{
+ if (!m_bLockUndoNoModifiedPosition)
{
- USHORT nUndosCnt = nUndoCnt;
- // immer 1/10 loeschen bis der "Ausloeser" behoben ist
- while( aUndoNodes.Count() && nEnde < aUndoNodes.Count() )
- DelUndoObj( nUndosCnt / 10 );
+ m_UndoSaveMark = MarkTopUndoAction();
}
}
-
-
-void SwDoc::ClearRedo()
+void UndoManager::LockUndoNoModifiedPosition()
{
- if( DoesUndo() && nUndoPos != pUndos->Count() )
- {
-//?? why ?? if( !nUndoSttEnd )
- {
- // setze UndoCnt auf den neuen Wert
- SwUndo* pUndo;
- for( USHORT nCnt = pUndos->Count(); nUndoPos < nCnt; --nUndoCnt )
- // Klammerung ueberspringen
- if( UNDO_END == (pUndo = (*pUndos)[ --nCnt ])->GetId() )
- nCnt = nCnt - ((SwUndoEnd*)pUndo)->GetSttOffset();
- }
-
- // loesche die Undo-Aktionen (immer von hinten !)
- pUndos->DeleteAndDestroy( nUndoPos, pUndos->Count() - nUndoPos );
- }
+ m_bLockUndoNoModifiedPosition = true;
}
-
- // loescht die gesamten UndoObjecte
-void SwDoc::DelAllUndoObj()
+void UndoManager::UnLockUndoNoModifiedPosition()
{
- ClearRedo();
-
- DoUndo( FALSE );
-
- // Offene Undo-Klammerungen erhalten !!
- SwUndo* pUndo;
- USHORT nSize = pUndos->Count();
- while( nSize )
- if( UNDO_START != ( pUndo = (*pUndos)[ --nSize ] )->GetId() ||
- ((SwUndoStart*)pUndo)->GetEndOffset() )
- // keine offenen Gruppierung ?
- pUndos->DeleteAndDestroy( nSize, 1 );
-
- nUndoCnt = 0;
- nUndoPos = pUndos->Count();
-
-/*
- while( nUndoPos )
- aUndos.DelDtor( --nUndoPos, 1 );
- nUndoCnt = nUndoSttEnd = nUndoPos = 0;
-*/
- nUndoSavePos = USHRT_MAX;
- DoUndo( TRUE );
+ m_bLockUndoNoModifiedPosition = false;
}
- // loescht alle UndoObjecte vom Anfang bis zum angegebenen Ende
-BOOL SwDoc::DelUndoObj( USHORT nEnde )
+SwUndo* UndoManager::GetLastUndo()
{
- if( !nEnde ) // sollte mal 0 uebergeben werden,
+ if (!SfxUndoManager::GetUndoActionCount(CurrentLevel))
{
- if( !pUndos->Count() )
- return FALSE;
- ++nEnde; // dann korrigiere es auf 1
+ return 0;
}
-
- DoUndo( FALSE );
-
- // pruefe erstmal, wo das Ende steht
- SwUndoId nId = UNDO_EMPTY;
- USHORT nSttEndCnt = 0;
- USHORT nCnt;
-
- for( nCnt = 0; nEnde && nCnt < nUndoPos; ++nCnt )
- {
- if( UNDO_START == ( nId = (*pUndos)[ nCnt ]->GetId() ))
- ++nSttEndCnt;
- else if( UNDO_END == nId )
- --nSttEndCnt;
- if( !nSttEndCnt )
- --nEnde, --nUndoCnt;
- }
-
- ASSERT( nCnt < nUndoPos || nUndoPos == pUndos->Count(),
- "Undo-Del-Ende liegt in einer Redo-Aktion" );
-
- // dann setze ab Ende bis Undo-Ende bei allen Undo-Objecte die Werte um
- nSttEndCnt = nCnt; // Position merken
- if( nUndoSavePos < nSttEndCnt ) // SavePos wird aufgegeben
- nUndoSavePos = USHRT_MAX;
- else if( nUndoSavePos != USHRT_MAX )
- nUndoSavePos = nUndoSavePos - nSttEndCnt;
-
- while( nSttEndCnt )
- pUndos->DeleteAndDestroy( --nSttEndCnt, 1 );
- nUndoPos = pUndos->Count();
-
- DoUndo( TRUE );
- return TRUE;
+ SfxUndoAction *const pAction( SfxUndoManager::GetUndoAction(0) );
+ return dynamic_cast<SwUndo*>(pAction);
}
-/**************** UNDO ******************/
-
-void SwDoc::setUndoNoModifiedPosition( SwUndoNoModifiedPosition nNew )
-{
- nUndoSavePos = nNew;
- if( !pUndos->Count() || nUndoSavePos > pUndos->Count() - 1 )
- nUndoSavePos = USHRT_MAX;
-}
-
-SwUndoNoModifiedPosition SwDoc::getUndoNoModifiedPosition() const
+void UndoManager::AppendUndo(SwUndo *const pUndo)
{
- return nUndoSavePos;
+ AddUndoAction(pUndo);
}
-
-bool SwDoc::HasUndoId(SwUndoId eId) const
+void UndoManager::ClearRedo()
{
- USHORT nSize = nUndoPos;
- SwUndo * pUndo;
- while( nSize-- )
- if( ( pUndo = (*pUndos)[nSize])->GetId() == eId ||
- ( UNDO_START == pUndo->GetId() &&
- ((SwUndoStart*)pUndo)->GetUserId() == eId )
- || ( UNDO_END == pUndo->GetId() &&
- ((SwUndoEnd*)pUndo)->GetUserId() == eId ) )
- {
- return TRUE;
- }
-
- return FALSE;
+ return SfxUndoManager::ImplClearRedo_NoLock(TopLevel);
}
-
-bool SwDoc::Undo( SwUndoIter& rUndoIter )
+void UndoManager::DelAllUndoObj()
{
- if ( (rUndoIter.GetId()!=0) && (!HasUndoId(rUndoIter.GetId())) )
- {
- rUndoIter.bWeiter = FALSE;
- return FALSE;
- }
- if( !nUndoPos )
- {
- rUndoIter.bWeiter = FALSE;
- return FALSE;
- }
-
- SwUndo *pUndo = (*pUndos)[ --nUndoPos ];
+ ::sw::UndoGuard const undoGuard(*this);
- RedlineMode_t eOld = GetRedlineMode();
- RedlineMode_t eTmpMode = (RedlineMode_t)pUndo->GetRedlineMode();
- if( (nsRedlineMode_t::REDLINE_SHOW_MASK & eTmpMode) != (nsRedlineMode_t::REDLINE_SHOW_MASK & eOld) &&
- UNDO_START != pUndo->GetId() && UNDO_END != pUndo->GetId() )
- SetRedlineMode( eTmpMode );
+ SfxUndoManager::ClearAllLevels();
- SetRedlineMode_intern((RedlineMode_t)(eTmpMode | nsRedlineMode_t::REDLINE_IGNORE));
- // Undo ausfuehren
-
- // zum spaeteren ueberpruefen
- SwUndoId nAktId = pUndo->GetId();
- //JP 11.05.98: FlyFormate ueber die EditShell selektieren, nicht aus dem
- // Undo heraus
- switch( nAktId )
- {
- case UNDO_START:
- case UNDO_END:
- case UNDO_INSDRAWFMT:
- break;
-
- default:
- rUndoIter.ClearSelections();
- }
-
- pUndo->Undo( rUndoIter );
-
- SetRedlineMode( eOld );
-
- // Besonderheit von Undo-Replace (interne History)
- if( UNDO_REPLACE == nAktId && ((SwUndoReplace*)pUndo)->nAktPos )
- {
- ++nUndoPos;
- return TRUE;
- }
-
- // Objekt aus History entfernen und zerstoeren
- if( nUndoPos && !rUndoIter.bWeiter &&
- UNDO_START == ( pUndo = (*pUndos)[ nUndoPos-1 ] )->GetId() )
- --nUndoPos;
-
- // JP 29.10.96: Start und End setzen kein Modify-Flag.
- // Sonst gibt es Probleme mit der autom. Aufnahme von Ausnahmen
- // bei der Autokorrektur
- if( UNDO_START != nAktId && UNDO_END != nAktId )
- SetModified(); // default: immer setzen, kann zurueck gesetzt werden
-
- // ist die History leer und wurde nicht wegen Speichermangel
- // verworfen, so kann das Dokument als unveraendert gelten
- if( nUndoSavePos == nUndoPos )
- ResetModified();
-
- return TRUE;
+ m_UndoSaveMark = MARK_INVALID;
}
-// setzt Undoklammerung auf, liefert nUndoId der Klammerung
-
+/**************** UNDO ******************/
-SwUndoId SwDoc::StartUndo( SwUndoId eUndoId, const SwRewriter * pRewriter )
+SwUndoId
+UndoManager::StartUndo(SwUndoId const i_eUndoId,
+ SwRewriter const*const pRewriter)
{
- if( !mbUndo )
+ if (!IsUndoEnabled())
+ {
return UNDO_EMPTY;
+ }
- if( !eUndoId )
- eUndoId = UNDO_START;
-
- SwUndoStart * pUndo = new SwUndoStart( eUndoId );
+ SwUndoId const eUndoId( (0 == i_eUndoId) ? UNDO_START : i_eUndoId );
+ OSL_ASSERT(UNDO_END != eUndoId);
+ String comment( (UNDO_START == eUndoId)
+ ? String("??", RTL_TEXTENCODING_ASCII_US)
+ : String(SW_RES(UNDO_BASE + eUndoId)) );
if (pRewriter)
- pUndo->SetRewriter(*pRewriter);
+ {
+ OSL_ASSERT(UNDO_START != eUndoId);
+ comment = pRewriter->Apply(comment);
+ }
- AppendUndo(pUndo);
+ SfxUndoManager::EnterListAction(comment, comment, eUndoId);
return eUndoId;
}
-// schliesst Klammerung der nUndoId, nicht vom UI benutzt
-SwUndoId SwDoc::EndUndo(SwUndoId eUndoId, const SwRewriter * pRewriter)
+SwUndoId
+UndoManager::EndUndo(SwUndoId const i_eUndoId, SwRewriter const*const pRewriter)
{
- USHORT nSize = nUndoPos;
- if( !mbUndo || !nSize-- )
- return UNDO_EMPTY;
-
- if( UNDO_START == eUndoId || !eUndoId )
- eUndoId = UNDO_END;
-
- SwUndo* pUndo = (*pUndos)[ nSize ];
- if( UNDO_START == pUndo->GetId() )
+ if (!IsUndoEnabled())
{
- // leere Start/End-Klammerung ??
- pUndos->DeleteAndDestroy( nSize );
- --nUndoPos;
- --nUndoSttEnd;
return UNDO_EMPTY;
}
- // exist above any redo objects? If yes, delete them
- if( nUndoPos != pUndos->Count() )
- {
- // setze UndoCnt auf den neuen Wert
- for( USHORT nCnt = pUndos->Count(); nUndoPos < nCnt; --nUndoCnt )
- // Klammerung ueberspringen
- if( UNDO_END == (pUndo = (*pUndos)[ --nCnt ])->GetId() )
- nCnt = nCnt - ((SwUndoEnd*)pUndo)->GetSttOffset();
-
- pUndos->DeleteAndDestroy( nUndoPos, pUndos->Count() - nUndoPos );
- }
-
- // suche den Anfang dieser Klammerung
- SwUndoId nId = UNDO_EMPTY;
- while( nSize )
- if( UNDO_START == ( nId = (pUndo = (*pUndos)[ --nSize ] )->GetId()) &&
- !((SwUndoStart*)pUndo)->GetEndOffset() )
- break; // Start gefunden
+ SwUndoId const eUndoId( ((0 == i_eUndoId) || (UNDO_START == i_eUndoId))
+ ? UNDO_END : i_eUndoId );
+ OSL_ENSURE(!((UNDO_END == eUndoId) && pRewriter),
+ "EndUndo(): no Undo ID, but rewriter given?");
- if( nId != UNDO_START )
- {
- // kann eigentlich nur beim Abspielen von Macros passieren, die
- // Undo/Redo/Repeat benutzen und die eine exitierende Selection
- // durch Einfuegen loeschen
- ASSERT( !this, "kein entsprechendes Ende gefunden" );
- // kein entsprechenden Start gefunden -> Ende nicht einfuegen
- // und die Member am Doc updaten
-
- nUndoSttEnd = 0;
- nUndoCnt = 0;
- // setze UndoCnt auf den neuen Wert
- SwUndo* pTmpUndo;
- for( USHORT nCnt = 0; nCnt < pUndos->Count(); ++nCnt, ++nUndoCnt )
- // Klammerung ueberspringen
- if( UNDO_START == (pTmpUndo = (*pUndos)[ nCnt ])->GetId() )
- nCnt = nCnt + ((SwUndoStart*)pTmpUndo)->GetEndOffset();
- return UNDO_EMPTY;
+ SfxUndoAction *const pLastUndo(
+ (0 == SfxUndoManager::GetUndoActionCount(CurrentLevel))
+ ? 0 : SfxUndoManager::GetUndoAction(0) );
- }
+ int const nCount = LeaveListAction();
- // Klammerung um eine einzelne Action muss nicht sein!
- // Aussnahme: es ist eine eigene ID definiert
- if( 2 == pUndos->Count() - nSize &&
- (UNDO_END == eUndoId || eUndoId == (*pUndos)[ nSize+1 ]->GetId() ))
+ if (nCount) // otherwise: empty list action not inserted!
{
- pUndos->DeleteAndDestroy( nSize );
- nUndoPos = pUndos->Count();
- if( !--nUndoSttEnd )
+ OSL_ASSERT(pLastUndo);
+ OSL_ASSERT(UNDO_START != eUndoId);
+ SfxUndoAction *const pUndoAction(SfxUndoManager::GetUndoAction(0));
+ SfxListUndoAction *const pListAction(
+ dynamic_cast<SfxListUndoAction*>(pUndoAction));
+ OSL_ASSERT(pListAction);
+ if (pListAction)
{
- ++nUndoCnt;
- if( SwDoc::nUndoActions < nUndoCnt )
- // immer 1/10 loeschen
- //JP 23.09.95: oder wenn neu eingestellt wurde um die Differenz
- //JP 29.5.2001: Task #83891#: remove only the overlapping actions
- DelUndoObj( nUndoCnt - SwDoc::nUndoActions );
+ if (UNDO_END != eUndoId)
+ {
+ OSL_ENSURE(pListAction->GetId() == eUndoId,
+ "EndUndo(): given ID different from StartUndo()");
+ // comment set by caller of EndUndo
+ String comment = String(SW_RES(UNDO_BASE + eUndoId));
+ if (pRewriter)
+ {
+ comment = pRewriter->Apply(comment);
+ }
+ pListAction->SetComment(comment);
+ }
+ else if ((UNDO_START != pListAction->GetId()))
+ {
+ // comment set by caller of StartUndo: nothing to do here
+ }
+ else if (pLastUndo)
+ {
+ // comment was not set at StartUndo or EndUndo:
+ // take comment of last contained action
+ // (note that this works recursively, i.e. the last contained
+ // action may be a list action created by StartUndo/EndUndo)
+ String const comment(pLastUndo->GetComment());
+ pListAction->SetComment(comment);
+ }
else
{
- USHORT nEnde = USHRT_MAX - 1000;
- USHORT nUndosCnt = nUndoCnt;
- // immer 1/10 loeschen bis der "Ausloeser" behoben ist
- while( aUndoNodes.Count() && nEnde < aUndoNodes.Count() )
- DelUndoObj( nUndosCnt / 10 );
+ OSL_ENSURE(false, "EndUndo(): no comment?");
}
}
- return eUndoId;
}
- // setze die Klammerung am Start/End-Undo
- nSize = pUndos->Count() - nSize;
- ((SwUndoStart*)pUndo)->SetEndOffset( nSize );
-
- SwUndoEnd* pUndoEnd = new SwUndoEnd( eUndoId );
- pUndoEnd->SetSttOffset( nSize );
+ return eUndoId;
+}
-// nur zum Testen der Start/End-Verpointerung vom Start/End Undo
-#ifdef DBG_UTIL
+bool
+UndoManager::GetLastUndoInfo(
+ ::rtl::OUString *const o_pStr, SwUndoId *const o_pId) const
+{
+ // this is actually expected to work on the current level,
+ // but that was really not obvious from the previous implementation...
+ if (!SfxUndoManager::GetUndoActionCount(CurrentLevel))
{
- USHORT nEndCnt = 1, nCnt = pUndos->Count();
- SwUndoId nTmpId = UNDO_EMPTY;
- while( nCnt )
- {
- if( UNDO_START == ( nTmpId = (*pUndos)[ --nCnt ]->GetId()) )
- {
- if( !nEndCnt ) // falls mal ein Start ohne Ende vorhanden ist
- continue;
- --nEndCnt;
- if( !nEndCnt ) // hier ist der Anfang
- break;
- }
- else if( UNDO_END == nTmpId )
- ++nEndCnt;
- else if( !nEndCnt )
- break;
- }
- ASSERT( nCnt == pUndos->Count() - nSize,
- "Start-Ende falsch geklammert" );
+ return false;
}
-#endif
- if (pRewriter)
+ SfxUndoAction *const pAction( SfxUndoManager::GetUndoAction(0) );
+
+ if (o_pStr)
{
- ((SwUndoStart *) pUndo)->SetRewriter(*pRewriter);
- pUndoEnd->SetRewriter(*pRewriter);
+ *o_pStr = pAction->GetComment();
+ }
+ if (o_pId)
+ {
+ sal_uInt16 const nId(pAction->GetId());
+ *o_pId = static_cast<SwUndoId>(nId);
}
- else
- pUndoEnd->SetRewriter(((SwUndoStart *) pUndo)->GetRewriter());
- AppendUndo( pUndoEnd );
- return eUndoId;
+ return true;
}
-// liefert die Id der letzten Undofaehigen Aktion zurueck oder 0
-// fuellt ggf. VARARR mit User-UndoIds
-
-String SwDoc::GetUndoIdsStr( String* pStr, SwUndoIds *pUndoIds) const
+SwUndoComments_t UndoManager::GetUndoComments() const
{
- String aTmpStr;
+ OSL_ENSURE(!SfxUndoManager::IsInListAction(),
+ "GetUndoComments() called while in list action?");
- if (pStr != NULL)
+ SwUndoComments_t ret;
+ sal_uInt16 const nUndoCount(SfxUndoManager::GetUndoActionCount(TopLevel));
+ for (sal_uInt16 n = 0; n < nUndoCount; ++n)
{
- GetUndoIds( pStr, pUndoIds);
- aTmpStr = *pStr;
+ ::rtl::OUString const comment(
+ SfxUndoManager::GetUndoActionComment(n, TopLevel));
+ ret.push_back(comment);
}
- else
- GetUndoIds( &aTmpStr, pUndoIds);
- return aTmpStr;
+ return ret;
}
-/*-- 24.11.2004 16:11:21---------------------------------------------------
- -----------------------------------------------------------------------*/
-sal_Bool SwDoc::RestoreInvisibleContent()
+/**************** REDO ******************/
+
+bool UndoManager::GetFirstRedoInfo(::rtl::OUString *const o_pStr) const
{
- sal_Bool bRet = sal_False;
- if(nUndoPos > 0 )
+ if (!SfxUndoManager::GetRedoActionCount(CurrentLevel))
{
- SwUndo * pUndo = (*pUndos)[ nUndoPos - 1 ];
- if( ( pUndo->GetId() == UNDO_END &&
- static_cast<SwUndoEnd *>(pUndo)->GetUserId() == UNDO_UI_DELETE_INVISIBLECNTNT) )
- {
- SwPaM aPam( GetNodes().GetEndOfPostIts() );
- SwUndoIter aUndoIter( &aPam );
- do
- {
- Undo( aUndoIter );
- }
- while ( aUndoIter.IsNextUndo() );
- ClearRedo();
- bRet = sal_True;
- }
+ return false;
}
- return bRet;
-}
-
-
-/**
- Returns id and comment for a certain undo object in an undo stack.
-
- Remark: In the following the object type referred to is always the
- effective object type. If an UNDO_START or UNDO_END has a user type
- it is referred to as this type.
-
- If the queried object is an UNDO_END and has no user id the result
- is taken from the first object that is not an UNDO_END nor an
- UNDO_START preceeding the queried object.
-
- If the queried object is an UNDO_START and has no user id the
- result is taken from the first object that is not an UNDO_END nor
- an UNDO_START preceeding the UNDO_END object belonging to the
- queried object.
- In all other cases the result is taken from the queried object.
-
- @param rUndos the undo stack
- @param nPos position of the undo object to query
-
- @return SwUndoIdAndName object containing the query result
- */
-SwUndoIdAndName * lcl_GetUndoIdAndName(const SwUndos & rUndos, sal_uInt16 nPos )
-{
- SwUndo * pUndo = rUndos[ nPos ];
- SwUndoId nId = UNDO_EMPTY;
- String sStr("??", RTL_TEXTENCODING_ASCII_US);
-
- ASSERT( nPos < rUndos.Count(), "nPos out of range");
-
- switch (pUndo->GetId())
+ if (o_pStr)
{
- case UNDO_START:
- {
- SwUndoStart * pUndoStart = (SwUndoStart *) pUndo;
- nId = pUndoStart->GetUserId();
-
- if (nId <= UNDO_END)
- {
- /**
- Start at the according UNDO_END. Search backwards
- for first objects that is not a UNDO_END.
- */
- int nTmpPos = nPos + pUndoStart->GetEndOffset();
- int nSubstitute = -1;
-
- // --> OD 2009-09-30 #i105457#
- if ( nTmpPos > 0 )
- // <--
- {
- SwUndo * pTmpUndo;
- do
- {
- nTmpPos--;
- pTmpUndo = rUndos[ static_cast<USHORT>(nTmpPos) ];
-
- if (pTmpUndo->GetEffectiveId() > UNDO_END)
- nSubstitute = nTmpPos;
- }
- while (nSubstitute < 0 && nTmpPos > nPos);
-
- if (nSubstitute >= 0)
- {
- SwUndo * pSubUndo = rUndos[ static_cast<USHORT>(nSubstitute) ];
- nId = pSubUndo->GetEffectiveId();
- sStr = pSubUndo->GetComment();
- }
- }
- }
- else
- sStr = pUndo->GetComment();
- }
-
- break;
-
- case UNDO_END:
- {
- SwUndoEnd * pUndoEnd = (SwUndoEnd *) pUndo;
- nId = pUndoEnd->GetUserId();
-
- if (nId <= UNDO_END)
- {
- /**
- Start at this UNDO_END. Search backwards
- for first objects that is not a UNDO_END.
- */
-
- int nTmpPos = nPos;
- int nUndoStart = nTmpPos - pUndoEnd->GetSttOffset();
- int nSubstitute = -1;
-
- if (nTmpPos > 0)
- {
- SwUndo * pTmpUndo;
-
- do
- {
- nTmpPos--;
- pTmpUndo = rUndos[ static_cast<USHORT>(nTmpPos) ];
-
- if (pTmpUndo->GetEffectiveId() > UNDO_END)
- nSubstitute = nTmpPos;
- }
- while (nSubstitute < 0 && nTmpPos > nUndoStart);
-
- if (nSubstitute >= 0)
- {
- SwUndo * pSubUndo = rUndos[ static_cast<USHORT>(nSubstitute) ];
- nId = pSubUndo->GetEffectiveId();
- sStr = pSubUndo->GetComment();
- }
- }
- }
- else
- sStr = pUndo->GetComment();
- }
-
- break;
-
- default:
- nId = pUndo->GetId();
- sStr = pUndo->GetComment();
+ *o_pStr = SfxUndoManager::GetRedoActionComment(0, CurrentLevel);
}
- return new SwUndoIdAndName(nId, &sStr);
+ return true;
}
-SwUndoId SwDoc::GetUndoIds( String* pStr, SwUndoIds *pUndoIds) const
+
+SwUndoComments_t UndoManager::GetRedoComments() const
{
- int nTmpPos = nUndoPos - 1;
- SwUndoId nId = UNDO_EMPTY;
+ OSL_ENSURE(!SfxUndoManager::IsInListAction(),
+ "GetRedoComments() called while in list action?");
- while (nTmpPos >= 0)
+ SwUndoComments_t ret;
+ sal_uInt16 const nRedoCount(SfxUndoManager::GetRedoActionCount(TopLevel));
+ for (sal_uInt16 n = 0; n < nRedoCount; ++n)
{
- SwUndo * pUndo = (*pUndos)[ static_cast<USHORT>(nTmpPos) ];
-
- SwUndoIdAndName * pIdAndName = lcl_GetUndoIdAndName( *pUndos, static_cast<sal_uInt16>(nTmpPos) );
-
- if (nTmpPos == nUndoPos - 1)
- {
- nId = pIdAndName->GetUndoId();
-
- if (pStr)
- *pStr = *pIdAndName->GetUndoStr();
- }
-
- if (pUndoIds)
- pUndoIds->Insert(pIdAndName, pUndoIds->Count());
- else
- break;
-
- if (pUndo->GetId() == UNDO_END)
- nTmpPos -= ((SwUndoEnd *) pUndo)->GetSttOffset();
-
- nTmpPos--;
+ ::rtl::OUString const comment(
+ SfxUndoManager::GetRedoActionComment(n, TopLevel));
+ ret.push_back(comment);
}
- return nId;
+ return ret;
}
-bool SwDoc::HasTooManyUndos() const
-{
- // AppendUndo checks the UNDO_ACTION_LIMIT, unless there's a nested undo.
- // So HasTooManyUndos() may only occur when undos are nested; else
- // AppendUndo has some sort of bug.
- DBG_ASSERT( (nUndoSttEnd != 0) || (pUndos->Count() < UNDO_ACTION_LIMIT),
- "non-nested undos should have been handled in AppendUndo" );
- return (pUndos->Count() >= UNDO_ACTION_LIMIT);
-}
-
-
-/**************** REDO ******************/
-
+/**************** REPEAT ******************/
-bool SwDoc::Redo( SwUndoIter& rUndoIter )
+SwUndoId UndoManager::GetRepeatInfo(::rtl::OUString *const o_pStr) const
{
- if( rUndoIter.GetId() && !HasUndoId( rUndoIter.GetId() ) )
+ SwUndoId nRepeatId(UNDO_EMPTY);
+ GetLastUndoInfo(o_pStr, & nRepeatId);
+ if( REPEAT_START <= nRepeatId && REPEAT_END > nRepeatId )
{
- rUndoIter.bWeiter = FALSE;
- return FALSE;
+ return nRepeatId;
}
- if( nUndoPos == pUndos->Count() )
+ if (o_pStr) // not repeatable -> clear comment
{
- rUndoIter.bWeiter = FALSE;
- return FALSE;
+ *o_pStr = String();
}
+ return UNDO_EMPTY;
+}
- SwUndo *pUndo = (*pUndos)[ nUndoPos++ ];
-
- RedlineMode_t eOld = GetRedlineMode();
- RedlineMode_t eTmpMode = (RedlineMode_t)pUndo->GetRedlineMode();
- if( (nsRedlineMode_t::REDLINE_SHOW_MASK & eTmpMode) != (nsRedlineMode_t::REDLINE_SHOW_MASK & eOld) &&
- UNDO_START != pUndo->GetId() && UNDO_END != pUndo->GetId() )
- SetRedlineMode( eTmpMode );
- SetRedlineMode_intern( (RedlineMode_t)(eTmpMode | nsRedlineMode_t::REDLINE_IGNORE));
-
- //JP 11.05.98: FlyFormate ueber die EditShell selektieren, nicht aus dem
- // Undo heraus
- if( UNDO_START != pUndo->GetId() && UNDO_END != pUndo->GetId() )
- rUndoIter.ClearSelections();
-
- pUndo->Redo( rUndoIter );
-
- SetRedlineMode( eOld );
-
- // Besonderheit von Undo-Replace (interne History)
- if( UNDO_REPLACE == pUndo->GetId() &&
- USHRT_MAX != ((SwUndoReplace*)pUndo)->nAktPos )
+SwUndo * UndoManager::RemoveLastUndo()
+{
+ if (SfxUndoManager::GetRedoActionCount(CurrentLevel) ||
+ SfxUndoManager::GetRedoActionCount(TopLevel))
{
- --nUndoPos;
- return TRUE;
+ OSL_ENSURE(false, "RemoveLastUndoAction(): there are Redo actions?");
+ return 0;
}
-
- if( rUndoIter.bWeiter && nUndoPos >= pUndos->Count() )
- rUndoIter.bWeiter = FALSE;
-
- // ist die History leer und wurde nicht wegen Speichermangel
- // verworfen, so kann das Dokument als unveraendert gelten
- if( nUndoSavePos == nUndoPos )
- ResetModified();
- else
- SetModified();
- return TRUE;
+ if (!SfxUndoManager::GetUndoActionCount(CurrentLevel))
+ {
+ OSL_ENSURE(false, "RemoveLastUndoAction(): no Undo actions");
+ return 0;
+ }
+ SfxUndoAction *const pLastUndo(GetUndoAction(0));
+ SfxUndoManager::RemoveLastUndoAction();
+ return dynamic_cast<SwUndo *>(pLastUndo);
}
+// svl::IUndoManager /////////////////////////////////////////////////////
-// liefert die Id der letzten Redofaehigen Aktion zurueck oder 0
-// fuellt ggf. VARARR mit User-RedoIds
-
-String SwDoc::GetRedoIdsStr( String* pStr, SwUndoIds *pRedoIds ) const
+void UndoManager::EnableUndo(bool bEnable)
{
- String aTmpStr;
-
- if (pStr != NULL)
+ // UGLY: SfxUndoManager has a counter to match enable/disable calls
+ // but the writer code expects that a single call switches
+ while (IsUndoEnabled() != bEnable)
{
- GetRedoIds( pStr, pRedoIds );
- aTmpStr = *pStr;
+ SfxUndoManager::EnableUndo(bEnable);
}
- else
- GetRedoIds( &aTmpStr, pRedoIds );
-
-
- return aTmpStr;
}
-
-SwUndoId SwDoc::GetRedoIds( String* pStr, SwUndoIds *pRedoIds ) const
+void UndoManager::AddUndoAction(SfxUndoAction *pAction, sal_Bool bTryMerge)
{
- sal_uInt16 nTmpPos = nUndoPos;
- SwUndoId nId = UNDO_EMPTY;
-
- while (nTmpPos < pUndos->Count())
+ SwUndo *const pUndo( dynamic_cast<SwUndo *>(pAction) );
+ if (pUndo)
{
- SwUndo * pUndo = (*pUndos)[nTmpPos];
-
- SwUndoIdAndName * pIdAndName = lcl_GetUndoIdAndName(*pUndos, nTmpPos);
-
- if (nTmpPos == nUndoPos)
+ if (nsRedlineMode_t::REDLINE_NONE == pUndo->GetRedlineMode())
{
- nId = pIdAndName->GetUndoId();
-
- if (pStr)
- *pStr = *pIdAndName->GetUndoStr();
+ pUndo->SetRedlineMode( m_rRedlineAccess.GetRedlineMode() );
}
-
- if (pRedoIds)
- pRedoIds->Insert(pIdAndName, pRedoIds->Count());
- else
- break;
-
- if (pUndo->GetId() == UNDO_START)
- nTmpPos = nTmpPos + ((SwUndoStart *) pUndo)->GetEndOffset();
-
- nTmpPos++;
}
-
- return nId;
+ SfxUndoManager::AddUndoAction(pAction, bTryMerge);
+ // if the undo nodes array is too large, delete some actions
+ while (UNDO_ACTION_LIMIT < GetUndoNodes().Count())
+ {
+ RemoveOldestUndoActions(1);
+ }
}
-/**************** REPEAT ******************/
-
-
-bool SwDoc::Repeat( SwUndoIter& rUndoIter, sal_uInt16 nRepeatCnt )
+class CursorGuard
{
- if( rUndoIter.GetId() && !HasUndoId( rUndoIter.GetId() ) )
+public:
+ CursorGuard(SwEditShell & rShell, bool const bSave)
+ : m_rShell(rShell)
+ , m_bSaveCursor(bSave)
{
- rUndoIter.bWeiter = FALSE;
- return FALSE;
+ if (m_bSaveCursor)
+ {
+ m_rShell.Push(); // prevent modification of current cursor
+ }
}
- USHORT nSize = nUndoPos;
- if( !nSize )
+ ~CursorGuard()
{
- rUndoIter.bWeiter = FALSE;
- return FALSE;
+ if (m_bSaveCursor)
+ {
+ m_rShell.Pop();
+ }
}
+private:
+ SwEditShell & m_rShell;
+ bool const m_bSaveCursor;
+};
- // dann suche jetzt ueber die End/Start-Gruppen die gueltige Repeat-Aktion
- SwUndo *pUndo = (*pUndos)[ --nSize ];
- if( UNDO_END == pUndo->GetId() )
- nSize = nSize - ((SwUndoEnd*)pUndo)->GetSttOffset();
+bool UndoManager::impl_DoUndoRedo(UndoOrRedo_t const undoOrRedo)
+{
+ SwDoc & rDoc(*GetUndoNodes().GetDoc());
- USHORT nEndCnt = nUndoPos;
- BOOL bOneUndo = nSize + 1 == nUndoPos;
+ UnoActionContext c(& rDoc); // exception-safe StartAllAction/EndAllAction
- SwPaM* pTmpCrsr = rUndoIter.pAktPam;
- SwUndoId nId = UNDO_EMPTY;
+ SwEditShell *const pEditShell( rDoc.GetEditShell() );
- if( pTmpCrsr != pTmpCrsr->GetNext() || !bOneUndo ) // Undo-Klammerung aufbauen
+ OSL_ENSURE(pEditShell, "sw::UndoManager needs a SwEditShell!");
+ if (!pEditShell)
{
- if (pUndo->GetId() == UNDO_END)
- {
- SwUndoStart * pStartUndo =
- (SwUndoStart *) (*pUndos)[nSize];
-
- nId = pStartUndo->GetUserId();
- }
-
- StartUndo( nId, NULL );
+ throw uno::RuntimeException();
}
- do { // dann durchlaufe mal den gesamten Ring
- for( USHORT nRptCnt = nRepeatCnt; nRptCnt > 0; --nRptCnt )
- {
- rUndoIter.pLastUndoObj = 0;
- for( USHORT nCnt = nSize; nCnt < nEndCnt; ++nCnt )
- (*pUndos)[ nCnt ]->Repeat( rUndoIter ); // Repeat ausfuehren
- }
- } while( pTmpCrsr !=
- ( rUndoIter.pAktPam = (SwPaM*)rUndoIter.pAktPam->GetNext() ));
- if( pTmpCrsr != pTmpCrsr->GetNext() || !bOneUndo )
- EndUndo( nId, NULL );
- return TRUE;
-}
+ // in case the model has controllers locked, the Undo should not
+ // change the view cursors!
+ bool const bSaveCursors(pEditShell->CursorsLocked());
+ CursorGuard(*pEditShell, bSaveCursors);
+ if (!bSaveCursors)
+ {
+ // (in case Undo was called via API) clear the cursors:
+ pEditShell->KillPams();
+ pEditShell->SetMark();
+ pEditShell->ClearMark();
+ }
-// liefert die Id der letzten Repeatfaehigen Aktion zurueck oder 0
-// fuellt ggf. VARARR mit User-RedoIds
+ bool bRet(false);
-String SwDoc::GetRepeatIdsStr(String* pStr, SwUndoIds *pRepeatIds) const
-{
- String aTmpStr;
- SwUndoId nId;
+ ::sw::UndoRedoContext context(rDoc, *pEditShell);
- if ( pStr != NULL)
+ // N.B. these may throw!
+ if (UNDO == undoOrRedo)
{
- nId = GetRepeatIds(pStr, pRepeatIds);
- aTmpStr = *pStr;
+ bRet = SfxUndoManager::UndoWithContext(context);
}
else
- nId = GetRepeatIds(&aTmpStr, pRepeatIds);
+ {
+ bRet = SfxUndoManager::RedoWithContext(context);
+ }
- if (nId <= UNDO_END)
- return String();
+ if (bRet)
+ {
+ // if we are at the "last save" position, the document is not modified
+ if (SfxUndoManager::HasTopUndoActionMark(m_UndoSaveMark))
+ {
+ m_rState.ResetModified();
+ }
+ else
+ {
+ m_rState.SetModified();
+ }
+ }
+
+ pEditShell->HandleUndoRedoContext(context);
- return aTmpStr;
+ return bRet;
}
-SwUndoId SwDoc::GetRepeatIds(String* pStr, SwUndoIds *pRepeatIds) const
+sal_Bool UndoManager::Undo()
{
- SwUndoId nRepeatId = GetUndoIds( pStr, pRepeatIds );
- if( REPEAT_START <= nRepeatId && REPEAT_END > nRepeatId )
- return nRepeatId;
- return UNDO_EMPTY;
+ bool const bRet = impl_DoUndoRedo(UNDO);
+ return bRet;
}
+sal_Bool UndoManager::Redo()
+{
+ bool const bRet = impl_DoUndoRedo(REDO);
+ return bRet;
+}
-SwUndo* SwDoc::RemoveLastUndo( SwUndoId eUndoId )
+/** N.B.: this does _not_ call SfxUndoManager::Repeat because it is not
+ possible to wrap a list action around it:
+ calling EnterListAction here will cause SfxUndoManager::Repeat
+ to repeat the list action!
+ */
+bool
+UndoManager::Repeat(::sw::RepeatContext & rContext,
+ sal_uInt16 const nRepeatCount)
{
- SwUndo* pUndo = (*pUndos)[ nUndoPos - 1 ];
- if( eUndoId == pUndo->GetId() && nUndoPos == pUndos->Count() )
+ if (SfxUndoManager::IsInListAction())
{
- if( !nUndoSttEnd )
- --nUndoCnt;
- --nUndoPos;
- pUndos->Remove( nUndoPos, 1 );
+ OSL_ENSURE(false, "repeat in open list action???");
+ return false;
}
- else
+ if (!SfxUndoManager::GetUndoActionCount(TopLevel))
{
- pUndo = 0;
- ASSERT( !this, "falsches Undo-Object" );
+ return false;
+ }
+ SfxUndoAction *const pRepeatAction(GetUndoAction(0));
+ OSL_ASSERT(pRepeatAction);
+ if (!pRepeatAction || !pRepeatAction->CanRepeat(rContext))
+ {
+ return false;
}
- return pUndo;
-}
-SwUndoIdAndName::SwUndoIdAndName( SwUndoId nId, const String* pStr )
- : eUndoId( nId ), pUndoStr( pStr ? new String( *pStr ) : 0 )
-{
-}
+ ::rtl::OUString const comment(pRepeatAction->GetComment());
+ ::rtl::OUString const rcomment(pRepeatAction->GetRepeatComment(rContext));
+ sal_uInt16 const nId(pRepeatAction->GetId());
+ if (DoesUndo())
+ {
+ EnterListAction(comment, rcomment, nId);
+ }
-SwUndoIdAndName::~SwUndoIdAndName()
-{
- delete pUndoStr;
-}
+ SwPaM *const pFirstCursor(& rContext.GetRepeatPaM());
+ do { // iterate over ring
+ for (sal_uInt16 nRptCnt = nRepeatCount; nRptCnt > 0; --nRptCnt)
+ {
+ pRepeatAction->Repeat(rContext);
+ }
+ rContext.m_bDeleteRepeated = false; // reset for next PaM
+ rContext.m_pCurrentPaM =
+ static_cast<SwPaM*>(rContext.m_pCurrentPaM->GetNext());
+ } while (pFirstCursor != & rContext.GetRepeatPaM());
+ if (DoesUndo())
+ {
+ LeaveListAction();
+ }
+ return true;
+}
+} // namespace sw
diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx
index 57c6dab320a8..6d1d47543de8 100644
--- a/sw/source/core/undo/rolbck.cxx
+++ b/sw/source/core/undo/rolbck.cxx
@@ -28,9 +28,16 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <rolbck.hxx>
+
+#include <tools/resid.hxx>
-#include <hintids.hxx>
#include <svl/itemiter.hxx>
+
+#include <editeng/brkitem.hxx>
+
+#include <hints.hxx>
+#include <hintids.hxx>
#include <fmtftn.hxx>
#include <fchrfmt.hxx>
#include <fmtflcnt.hxx>
@@ -47,6 +54,7 @@
#include <frmfmt.hxx>
#include <ftnidx.hxx>
#include <doc.hxx> // SwDoc.GetNodes()
+#include <IDocumentUndoRedo.hxx>
#include <docary.hxx>
#include <ndtxt.hxx> // SwTxtNode
#include <paratr.hxx> //
@@ -54,19 +62,12 @@
#include <fldbas.hxx> // fuer Felder
#include <pam.hxx> // fuer SwPaM
#include <swtable.hxx>
-#include <rolbck.hxx>
#include <ndgrf.hxx> // SwGrfNode
-#include <undobj.hxx> // fuer UndoDelete
+#include <UndoCore.hxx>
#include <IMark.hxx> // fuer SwBookmark
#include <charfmt.hxx> // #i27615#
-#ifndef _COMCORE_HRC
#include <comcore.hrc>
-#endif
-#include <tools/resid.hxx>
-#ifndef _UNDO_HRC
#include <undo.hrc>
-#endif
-#include <editeng/brkitem.hxx>
#include <bookmrk.hxx>
SV_IMPL_PTRARR( SwpHstry, SwHistoryHintPtr)
@@ -77,7 +78,7 @@ String SwHistoryHint::GetDescription() const
}
-SwHistorySetFmt::SwHistorySetFmt( const SfxPoolItem* pFmtHt, ULONG nNd )
+SwHistorySetFmt::SwHistorySetFmt( const SfxPoolItem* pFmtHt, sal_uLong nNd )
: SwHistoryHint( HSTRY_SETFMTHNT )
, m_pAttr( pFmtHt->Clone() )
, m_nNodeIndex( nNd )
@@ -121,7 +122,7 @@ String SwHistorySetFmt::GetDescription() const
{
String aResult ;
- USHORT nWhich = m_pAttr->Which();
+ sal_uInt16 nWhich = m_pAttr->Which();
switch (nWhich)
{
case RES_BREAK:
@@ -188,7 +189,7 @@ SwHistorySetFmt::~SwHistorySetFmt()
// --> OD 2008-02-27 #refactorlists# - removed <rDoc>
-SwHistoryResetFmt::SwHistoryResetFmt(const SfxPoolItem* pFmtHt, ULONG nNodeIdx)
+SwHistoryResetFmt::SwHistoryResetFmt(const SfxPoolItem* pFmtHt, sal_uLong nNodeIdx)
// <--
: SwHistoryHint( HSTRY_RESETFMTHNT )
, m_nNodeIndex( nNodeIdx )
@@ -212,7 +213,7 @@ void SwHistoryResetFmt::SetInDoc( SwDoc* pDoc, bool )
}
-SwHistorySetTxt::SwHistorySetTxt( SwTxtAttr* pTxtHt, ULONG nNodePos )
+SwHistorySetTxt::SwHistorySetTxt( SwTxtAttr* pTxtHt, sal_uLong nNodePos )
: SwHistoryHint( HSTRY_SETTXTHNT )
, m_nNodeIndex( nNodePos )
, m_nStart( *pTxtHt->GetStart() )
@@ -224,7 +225,7 @@ SwHistorySetTxt::SwHistorySetTxt( SwTxtAttr* pTxtHt, ULONG nNodePos )
// ein bisschen kompliziert, aber ist Ok so: erst vom default
// eine Kopie und dann die Werte aus dem Text Attribut zuweisen
- USHORT nWhich = pTxtHt->Which();
+ sal_uInt16 nWhich = pTxtHt->Which();
if ( RES_TXTATR_CHARFMT == nWhich )
{
m_pAttr.reset( new SwFmtCharFmt( pTxtHt->GetCharFmt().GetCharFmt() ) );
@@ -266,7 +267,7 @@ void SwHistorySetTxt::SetInDoc( SwDoc* pDoc, bool )
}
-SwHistorySetTxtFld::SwHistorySetTxtFld( SwTxtFld* pTxtFld, ULONG nNodePos )
+SwHistorySetTxtFld::SwHistorySetTxtFld( SwTxtFld* pTxtFld, sal_uLong nNodePos )
: SwHistoryHint( HSTRY_SETTXTFLDHNT )
, m_pFldType( 0 )
, m_pFld( new SwFmtFld( *pTxtFld->GetFld().GetFld() ) )
@@ -328,7 +329,7 @@ void SwHistorySetTxtFld::SetInDoc( SwDoc* pDoc, bool )
-SwHistorySetRefMark::SwHistorySetRefMark( SwTxtRefMark* pTxtHt, ULONG nNodePos )
+SwHistorySetRefMark::SwHistorySetRefMark( SwTxtRefMark* pTxtHt, sal_uLong nNodePos )
: SwHistoryHint( HSTRY_SETREFMARKHNT )
, m_RefName( pTxtHt->GetRefMark().GetRefName() )
, m_nNodeIndex( nNodePos )
@@ -357,7 +358,7 @@ void SwHistorySetRefMark::SetInDoc( SwDoc* pDoc, bool )
}
-SwHistorySetTOXMark::SwHistorySetTOXMark( SwTxtTOXMark* pTxtHt, ULONG nNodePos )
+SwHistorySetTOXMark::SwHistorySetTOXMark( SwTxtTOXMark* pTxtHt, sal_uLong nNodePos )
: SwHistoryHint( HSTRY_SETTOXMARKHNT )
, m_TOXMark( pTxtHt->GetTOXMark() )
, m_TOXName( m_TOXMark.GetTOXType()->GetTypeName() )
@@ -378,9 +379,9 @@ void SwHistorySetTOXMark::SetInDoc( SwDoc* pDoc, bool )
return;
// search for respective TOX type
- USHORT nCnt = pDoc->GetTOXTypeCount( m_eTOXTypes );
+ sal_uInt16 nCnt = pDoc->GetTOXTypeCount( m_eTOXTypes );
SwTOXType* pToxType = 0;
- for ( USHORT n = 0; n < nCnt; ++n )
+ for ( sal_uInt16 n = 0; n < nCnt; ++n )
{
pToxType = const_cast<SwTOXType*>(pDoc->GetTOXType( m_eTOXTypes, n ));
if ( pToxType->GetTypeName() == m_TOXName )
@@ -415,8 +416,8 @@ int SwHistorySetTOXMark::IsEqual( const SwTOXMark& rCmp ) const
}
-SwHistoryResetTxt::SwHistoryResetTxt( USHORT nWhich,
- xub_StrLen nAttrStart, xub_StrLen nAttrEnd, ULONG nNodePos )
+SwHistoryResetTxt::SwHistoryResetTxt( sal_uInt16 nWhich,
+ xub_StrLen nAttrStart, xub_StrLen nAttrEnd, sal_uLong nNodePos )
: SwHistoryHint( HSTRY_RESETTXTHNT )
, m_nNodeIndex( nNodePos ), m_nStart( nAttrStart ), m_nEnd( nAttrEnd )
, m_nAttr( nWhich )
@@ -435,7 +436,7 @@ void SwHistoryResetTxt::SetInDoc( SwDoc* pDoc, bool )
}
-SwHistorySetFootnote::SwHistorySetFootnote( SwTxtFtn* pTxtFtn, ULONG nNodePos )
+SwHistorySetFootnote::SwHistorySetFootnote( SwTxtFtn* pTxtFtn, sal_uLong nNodePos )
: SwHistoryHint( HSTRY_SETFTNHNT )
, m_pUndo( new SwUndoSaveSection )
, m_FootnoteNumber( pTxtFtn->GetFtn().GetNumStr() )
@@ -454,7 +455,7 @@ SwHistorySetFootnote::SwHistorySetFootnote( SwTxtFtn* pTxtFtn, ULONG nNodePos )
//Pointer auf StartNode der FtnSection merken und erstmal den Pointer im
//Attribut zuruecksetzen -> Damit werden automatisch die Frms vernichtet.
SwNodeIndex aSttIdx( *pTxtFtn->GetStartNode() );
- pTxtFtn->SetStartNode( 0, FALSE );
+ pTxtFtn->SetStartNode( 0, sal_False );
m_pUndo->SaveSection( pDoc, aSttIdx );
m_nNodeIndex = pSaveNd->GetIndex();
@@ -529,8 +530,8 @@ void SwHistorySetFootnote::SetInDoc( SwDoc* pDoc, bool )
}
-SwHistoryChangeFmtColl::SwHistoryChangeFmtColl( SwFmtColl* pFmtColl, ULONG nNd,
- BYTE nNodeWhich )
+SwHistoryChangeFmtColl::SwHistoryChangeFmtColl( SwFmtColl* pFmtColl, sal_uLong nNd,
+ sal_uInt8 nNodeWhich )
: SwHistoryHint( HSTRY_CHGFMTCOLL )
, m_pColl( pFmtColl )
, m_nNodeIndex( nNd )
@@ -569,7 +570,7 @@ SwHistoryTxtFlyCnt::SwHistoryTxtFlyCnt( SwFrmFmt* const pFlyFmt )
, m_pUndo( new SwUndoDelLayFmt( pFlyFmt ) )
{
ASSERT( pFlyFmt, "SwHistoryTxtFlyCnt: no Format" );
- m_pUndo->ChgShowSel( FALSE );
+ m_pUndo->ChgShowSel( sal_False );
}
@@ -580,9 +581,10 @@ SwHistoryTxtFlyCnt::~SwHistoryTxtFlyCnt()
void SwHistoryTxtFlyCnt::SetInDoc( SwDoc* pDoc, bool )
{
- SwPaM aPam( pDoc->GetNodes().GetEndOfPostIts() );
- SwUndoIter aUndoIter( &aPam );
- m_pUndo->Undo( aUndoIter );
+ ::sw::IShellCursorSupplier *const pISCS(pDoc->GetIShellCursorSupplier());
+ OSL_ASSERT(pISCS);
+ ::sw::UndoRedoContext context(*pDoc, *pISCS);
+ m_pUndo->UndoImpl(context);
}
@@ -626,8 +628,7 @@ SwHistoryBookmark::SwHistoryBookmark(
void SwHistoryBookmark::SetInDoc( SwDoc* pDoc, bool )
{
- bool bDoesUndo = pDoc->DoesUndo();
- pDoc->DoUndo(false);
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
SwNodes& rNds = pDoc->GetNodes();
IDocumentMarkAccess* pMarkAccess = pDoc->getIDocumentMarkAccess();
@@ -698,7 +699,6 @@ void SwHistoryBookmark::SetInDoc( SwDoc* pDoc, bool )
}
}
}
- pDoc->DoUndo(bDoesUndo);
}
@@ -718,7 +718,7 @@ const ::rtl::OUString& SwHistoryBookmark::GetName() const
SwHistorySetAttrSet::SwHistorySetAttrSet( const SfxItemSet& rSet,
- ULONG nNodePos, const SvUShortsSort& rSetArr )
+ sal_uLong nNodePos, const SvUShortsSort& rSetArr )
: SwHistoryHint( HSTRY_SETATTRSET )
, m_OldSet( rSet )
, m_ResetArray( 0, 4 )
@@ -788,13 +788,12 @@ SwHistorySetAttrSet::SwHistorySetAttrSet( const SfxItemSet& rSet,
break;
pItem = aIter.NextItem();
pOrigItem = aOrigIter.NextItem();
- } while( TRUE );
+ } while( sal_True );
}
void SwHistorySetAttrSet::SetInDoc( SwDoc* pDoc, bool )
{
- BOOL bDoesUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
SwNode * pNode = pDoc->GetNodes()[ m_nNodeIndex ];
if ( pNode->IsCntntNode() )
@@ -815,25 +814,23 @@ void SwHistorySetAttrSet::SetInDoc( SwDoc* pDoc, bool )
rFmt.ResetFmtAttr( *m_ResetArray.GetData() );
}
}
-
- pDoc->DoUndo( bDoesUndo );
}
/*************************************************************************/
SwHistoryResetAttrSet::SwHistoryResetAttrSet( const SfxItemSet& rSet,
- ULONG nNodePos, xub_StrLen nAttrStt, xub_StrLen nAttrEnd )
+ sal_uLong nNodePos, xub_StrLen nAttrStt, xub_StrLen nAttrEnd )
: SwHistoryHint( HSTRY_RESETATTRSET )
, m_nNodeIndex( nNodePos ), m_nStart( nAttrStt ), m_nEnd( nAttrEnd )
- , m_Array( (BYTE)rSet.Count() )
+ , m_Array( (sal_uInt8)rSet.Count() )
{
SfxItemIter aIter( rSet );
bool bAutoStyle = false;
- while( TRUE )
+ while( sal_True )
{
- const USHORT nWhich = aIter.GetCurItem()->Which();
+ const sal_uInt16 nWhich = aIter.GetCurItem()->Which();
#ifndef PRODUCT
switch (nWhich)
@@ -879,19 +876,18 @@ SwHistoryResetAttrSet::SwHistoryResetAttrSet( const SfxItemSet& rSet,
void SwHistoryResetAttrSet::SetInDoc( SwDoc* pDoc, bool )
{
- BOOL bDoesUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
SwCntntNode * pCntntNd = pDoc->GetNodes()[ m_nNodeIndex ]->GetCntntNode();
ASSERT( pCntntNd, "SwHistoryResetAttrSet: no CntntNode" );
if (pCntntNd)
{
- const USHORT* pArr = m_Array.GetData();
+ const sal_uInt16* pArr = m_Array.GetData();
if ( USHRT_MAX == m_nEnd && USHRT_MAX == m_nStart )
{
// no area: use ContentNode
- for ( USHORT n = m_Array.Count(); n; --n, ++pArr )
+ for ( sal_uInt16 n = m_Array.Count(); n; --n, ++pArr )
{
pCntntNd->ResetAttr( *pArr );
}
@@ -899,15 +895,13 @@ void SwHistoryResetAttrSet::SetInDoc( SwDoc* pDoc, bool )
else
{
// area: use TextNode
- for ( USHORT n = m_Array.Count(); n; --n, ++pArr )
+ for ( sal_uInt16 n = m_Array.Count(); n; --n, ++pArr )
{
static_cast<SwTxtNode*>(pCntntNd)->
DeleteAttributes( *pArr, m_nStart, m_nEnd );
}
}
}
-
- pDoc->DoUndo( bDoesUndo );
}
@@ -927,10 +921,9 @@ SwHistoryChangeFlyAnchor::SwHistoryChangeFlyAnchor( SwFrmFmt& rFmt )
void SwHistoryChangeFlyAnchor::SetInDoc( SwDoc* pDoc, bool )
{
- BOOL bDoesUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
- USHORT nPos = pDoc->GetSpzFrmFmts()->GetPos( &m_rFmt );
+ sal_uInt16 nPos = pDoc->GetSpzFrmFmts()->GetPos( &m_rFmt );
if ( USHRT_MAX != nPos ) // Format does still exist
{
SwFmtAnchor aTmp( m_rFmt.GetAnchor() );
@@ -949,14 +942,17 @@ void SwHistoryChangeFlyAnchor::SetInDoc( SwDoc* pDoc, bool )
aTmp.SetAnchor( &aPos );
// so the Layout does not get confused
+<<<<<<< local
if ( !pCNd || !pCNd->getLayoutFrm( pDoc->GetCurrentLayout(), 0, 0, FALSE ) )
+=======
+ if ( !pCNd || !pCNd->GetFrm( 0, 0, sal_False ) )
+>>>>>>> other
{
m_rFmt.DelFrms();
}
m_rFmt.SetFmtAttr( aTmp );
}
- pDoc->DoUndo( bDoesUndo );
}
@@ -1026,8 +1022,8 @@ void SwHistoryChangeCharFmt::SetInDoc(SwDoc * pDoc, bool )
/* */
-SwHistory::SwHistory( USHORT nInitSz, USHORT nGrowSz )
- : m_SwpHstry( (BYTE)nInitSz, (BYTE)nGrowSz )
+SwHistory::SwHistory( sal_uInt16 nInitSz, sal_uInt16 nGrowSz )
+ : m_SwpHstry( (sal_uInt8)nInitSz, (sal_uInt8)nGrowSz )
, m_nEndDiff( 0 )
{}
@@ -1050,12 +1046,12 @@ SwHistory::~SwHistory()
// --> OD 2008-02-27 #refactorlists# - removed <rDoc>
void SwHistory::Add( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue,
- ULONG nNodeIdx )
+ sal_uLong nNodeIdx )
// <--
{
ASSERT( !m_nEndDiff, "History was not deleted after REDO" );
- USHORT nWhich = pNewValue->Which();
+ sal_uInt16 nWhich = pNewValue->Which();
if( (nWhich >= POOLATTR_END) || (nWhich == RES_TXTATR_FIELD) )
return;
@@ -1073,12 +1069,12 @@ void SwHistory::Add( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue,
}
-void SwHistory::Add( SwTxtAttr* pHint, ULONG nNodeIdx, bool bNewAttr )
+void SwHistory::Add( SwTxtAttr* pHint, sal_uLong nNodeIdx, bool bNewAttr )
{
ASSERT( !m_nEndDiff, "History was not deleted after REDO" );
SwHistoryHint * pHt;
- USHORT nAttrWhich = pHint->Which();
+ sal_uInt16 nAttrWhich = pHint->Which();
if( !bNewAttr )
{
@@ -1118,7 +1114,7 @@ void SwHistory::Add( SwTxtAttr* pHint, ULONG nNodeIdx, bool bNewAttr )
}
-void SwHistory::Add( SwFmtColl* pColl, ULONG nNodeIdx, BYTE nWhichNd )
+void SwHistory::Add( SwFmtColl* pColl, sal_uLong nNodeIdx, sal_uInt8 nWhichNd )
{
ASSERT( !m_nEndDiff, "History was not deleted after REDO" );
@@ -1143,19 +1139,19 @@ void SwHistory::Add( SwFrmFmt& rFmt )
m_SwpHstry.Insert( pHt, Count() );
}
-void SwHistory::Add( SwFlyFrmFmt& rFmt, USHORT& rSetPos )
+void SwHistory::Add( SwFlyFrmFmt& rFmt, sal_uInt16& rSetPos )
{
ASSERT( !m_nEndDiff, "History was not deleted after REDO" );
SwHistoryHint * pHint;
- const USHORT nWh = rFmt.Which();
+ const sal_uInt16 nWh = rFmt.Which();
if( RES_FLYFRMFMT == nWh || RES_DRAWFRMFMT == nWh )
{
pHint = new SwHistoryTxtFlyCnt( &rFmt );
m_SwpHstry.Insert( pHint, Count() );
const SwFmtChain* pChainItem;
- if( SFX_ITEM_SET == rFmt.GetItemState( RES_CHAIN, FALSE,
+ if( SFX_ITEM_SET == rFmt.GetItemState( RES_CHAIN, sal_False,
(const SfxPoolItem**)&pChainItem ))
{
if( pChainItem->GetNext() || pChainItem->GetPrev() )
@@ -1196,7 +1192,7 @@ void SwHistory::Add(const SfxItemSet & rSet, const SwCharFmt & rFmt)
/*************************************************************************
|*
-|* BOOL SwHistory::Rollback()
+|* sal_Bool SwHistory::Rollback()
|*
|* Beschreibung Dokument 1.0
|* Ersterstellung JP 18.02.91
@@ -1205,13 +1201,13 @@ void SwHistory::Add(const SfxItemSet & rSet, const SwCharFmt & rFmt)
*************************************************************************/
-bool SwHistory::Rollback( SwDoc* pDoc, USHORT nStart )
+bool SwHistory::Rollback( SwDoc* pDoc, sal_uInt16 nStart )
{
if ( !Count() )
return false;
SwHistoryHint * pHHt;
- USHORT i;
+ sal_uInt16 i;
for ( i = Count(); i > nStart ; )
{
pHHt = m_SwpHstry[ --i ];
@@ -1225,9 +1221,9 @@ bool SwHistory::Rollback( SwDoc* pDoc, USHORT nStart )
-bool SwHistory::TmpRollback( SwDoc* pDoc, USHORT nStart, bool bToFirst )
+bool SwHistory::TmpRollback( SwDoc* pDoc, sal_uInt16 nStart, bool bToFirst )
{
- USHORT nEnd = Count() - m_nEndDiff;
+ sal_uInt16 nEnd = Count() - m_nEndDiff;
if ( !Count() || !nEnd || nStart >= nEnd )
return false;
@@ -1252,9 +1248,9 @@ bool SwHistory::TmpRollback( SwDoc* pDoc, USHORT nStart, bool bToFirst )
}
-void SwHistory::Delete( USHORT nStart )
+void SwHistory::Delete( sal_uInt16 nStart )
{
- for ( USHORT n = Count(); n > nStart; )
+ for ( sal_uInt16 n = Count(); n > nStart; )
{
m_SwpHstry.DeleteAndDestroy( --n, 1 );
}
@@ -1262,28 +1258,28 @@ void SwHistory::Delete( USHORT nStart )
}
-USHORT SwHistory::SetTmpEnd( USHORT nNewTmpEnd )
+sal_uInt16 SwHistory::SetTmpEnd( sal_uInt16 nNewTmpEnd )
{
ASSERT( nNewTmpEnd <= Count(), "SwHistory::SetTmpEnd: out of bounds" );
- USHORT nOld = Count() - m_nEndDiff;
+ sal_uInt16 nOld = Count() - m_nEndDiff;
m_nEndDiff = Count() - nNewTmpEnd;
// for every SwHistoryFlyCnt, call the Redo of its UndoObject.
// this saves the formats of the flys!
- for ( USHORT n = nOld; n < nNewTmpEnd; n++ )
+ for ( sal_uInt16 n = nOld; n < nNewTmpEnd; n++ )
{
if ( HSTRY_FLYCNT == (*this)[ n ]->Which() )
{
static_cast<SwHistoryTxtFlyCnt*>((*this)[ n ])
- ->GetUDelLFmt()->Redo();
+ ->GetUDelLFmt()->RedoForRollback();
}
}
return nOld;
}
-void SwHistory::CopyFmtAttr( const SfxItemSet& rSet, ULONG nNodeIdx )
+void SwHistory::CopyFmtAttr( const SfxItemSet& rSet, sal_uLong nNodeIdx )
{
if( rSet.Count() )
{
@@ -1297,11 +1293,11 @@ void SwHistory::CopyFmtAttr( const SfxItemSet& rSet, ULONG nNodeIdx )
if( aIter.IsAtEnd() )
break;
aIter.NextItem();
- } while( TRUE );
+ } while( sal_True );
}
}
-void SwHistory::CopyAttr( SwpHints* pHts, ULONG nNodeIdx,
+void SwHistory::CopyAttr( SwpHints* pHts, sal_uLong nNodeIdx,
xub_StrLen nStart, xub_StrLen nEnd, bool bFields )
{
if( !pHts )
@@ -1311,7 +1307,7 @@ void SwHistory::CopyAttr( SwpHints* pHts, ULONG nNodeIdx,
SwTxtAttr* pHt;
xub_StrLen nAttrStt;
const xub_StrLen * pEndIdx;
- for( USHORT n = 0; n < pHts->Count(); n++ )
+ for( sal_uInt16 n = 0; n < pHts->Count(); n++ )
{
// BP: nAttrStt muss auch bei !pEndIdx gesetzt werden
pHt = pHts->GetTextHint(n);
@@ -1322,17 +1318,17 @@ void SwHistory::CopyAttr( SwpHints* pHts, ULONG nNodeIdx,
break;
// Flys und Ftn nie kopieren !!
- BOOL bNextAttr = FALSE;
+ sal_Bool bNextAttr = sal_False;
switch( pHt->Which() )
{
case RES_TXTATR_FIELD:
// keine Felder, .. kopieren ??
if( !bFields )
- bNextAttr = TRUE;
+ bNextAttr = sal_True;
break;
case RES_TXTATR_FLYCNT:
case RES_TXTATR_FTN:
- bNextAttr = TRUE;
+ bNextAttr = sal_True;
break;
}
@@ -1516,8 +1512,8 @@ void SwRegHistory::_MakeSetWhichIds()
if( pSet && pSet->Count() )
{
SfxItemIter aIter( *pSet );
- USHORT nW = aIter.FirstItem()->Which();
- while( TRUE )
+ sal_uInt16 nW = aIter.FirstItem()->Which();
+ while( sal_True )
{
m_WhichIdSet.Insert( nW );
if( aIter.IsAtEnd() )
diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx
index 27fb1040010d..864f4ded3f74 100644
--- a/sw/source/core/undo/unattr.cxx
+++ b/sw/source/core/undo/unattr.cxx
@@ -28,16 +28,18 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#define _SVSTDARR_USHORTS
#define _SVSTDARR_USHORTSSORT
-#include <hintids.hxx>
-#include <svx/svdmodel.hxx>
-#include <editeng/tstpitem.hxx>
-#include <svx/svdpage.hxx>
+#include <UndoAttribute.hxx>
+
#include <svl/itemiter.hxx>
+#include <editeng/tstpitem.hxx>
+#include <svx/svdmodel.hxx>
+#include <svx/svdpage.hxx>
+
+#include <hintids.hxx>
#include <fmtflcnt.hxx>
#include <txtftn.hxx>
#include <fmtornt.hxx>
@@ -47,13 +49,16 @@
#include <fmtcntnt.hxx>
#include <ftnidx.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
+#include <IShellCursorSupplier.hxx>
#include <docary.hxx>
#include <swundo.hxx> // fuer die UndoIds
#include <pam.hxx>
#include <ndtxt.hxx>
#include <swtable.hxx>
#include <swtblfmt.hxx>
-#include <undobj.hxx>
+#include <UndoCore.hxx>
+#include <hints.hxx>
#include <rolbck.hxx>
#include <ndnotxt.hxx>
#include <dcontact.hxx>
@@ -64,9 +69,6 @@
#include <switerator.hxx>
-inline SwDoc& SwUndoIter::GetDoc() const
-{ return *pAktPam->GetDoc(); }
-
// -----------------------------------------------------
SwUndoFmtAttrHelper::SwUndoFmtAttrHelper( SwFmt& rFmt, bool bSvDrwPt )
@@ -145,7 +147,7 @@ SwUndoFmtAttr::SwUndoFmtAttr( const SfxPoolItem& rItem, SwFmt& rChgFmt,
bool bSaveDrawPt )
: SwUndo( UNDO_INSFMTATTR )
, m_pFmt( &rChgFmt )
- , m_pOldSet( m_pFmt->GetAttrSet().Clone( FALSE ) )
+ , m_pOldSet( m_pFmt->GetAttrSet().Clone( sal_False ) )
, m_nNodeIndex( 0 )
, m_nFmtWhich( rChgFmt.Which() )
, m_bSaveDrawPt( bSaveDrawPt )
@@ -157,7 +159,7 @@ SwUndoFmtAttr::SwUndoFmtAttr( const SfxPoolItem& rItem, SwFmt& rChgFmt,
void SwUndoFmtAttr::Init()
{
// treat change of anchor specially
- if ( SFX_ITEM_SET == m_pOldSet->GetItemState( RES_ANCHOR, FALSE ))
+ if ( SFX_ITEM_SET == m_pOldSet->GetItemState( RES_ANCHOR, sal_False ))
{
SaveFlyAnchor( m_bSaveDrawPt );
}
@@ -195,21 +197,21 @@ SwUndoFmtAttr::~SwUndoFmtAttr()
{
}
-void SwUndoFmtAttr::Undo( SwUndoIter& rUndoIter)
+void SwUndoFmtAttr::UndoImpl(::sw::UndoRedoContext & rContext)
{
// OD 2004-10-26 #i35443#
// Important note: <Undo(..)> also called by <ReDo(..)>
- if ( !m_pOldSet.get() || !m_pFmt || !IsFmtInDoc( &rUndoIter.GetDoc() ))
+ if ( !m_pOldSet.get() || !m_pFmt || !IsFmtInDoc( &rContext.GetDoc() ))
return;
// --> OD 2004-10-26 #i35443# - If anchor attribute has been successfull
// restored, all other attributes are also restored.
// Thus, keep track of its restoration
bool bAnchorAttrRestored( false );
- if ( SFX_ITEM_SET == m_pOldSet->GetItemState( RES_ANCHOR, FALSE ))
+ if ( SFX_ITEM_SET == m_pOldSet->GetItemState( RES_ANCHOR, sal_False ))
{
- bAnchorAttrRestored = RestoreFlyAnchor( rUndoIter );
+ bAnchorAttrRestored = RestoreFlyAnchor(rContext);
if ( bAnchorAttrRestored )
{
// Anchor attribute successfull restored.
@@ -241,7 +243,7 @@ void SwUndoFmtAttr::Undo( SwUndoIter& rUndoIter)
if ( RES_FLYFRMFMT == m_nFmtWhich || RES_DRAWFRMFMT == m_nFmtWhich )
{
- rUndoIter.pSelFmt = static_cast<SwFrmFmt*>(m_pFmt);
+ rContext.SetSelections(static_cast<SwFrmFmt*>(m_pFmt), 0);
}
}
}
@@ -250,7 +252,7 @@ bool SwUndoFmtAttr::IsFmtInDoc( SwDoc* pDoc )
{
// search for the Format in the Document; if it does not exist any more,
// the attribute is not restored!
- USHORT nPos = USHRT_MAX;
+ sal_uInt16 nPos = USHRT_MAX;
switch ( m_nFmtWhich )
{
case RES_TXTFMTCOLL:
@@ -331,49 +333,41 @@ SwFmt* SwUndoFmtAttr::GetFmt( SwDoc& rDoc )
return m_pFmt && IsFmtInDoc( &rDoc ) ? m_pFmt : 0;
}
-void SwUndoFmtAttr::Redo( SwUndoIter& rUndoIter)
+void SwUndoFmtAttr::RedoImpl(::sw::UndoRedoContext & rContext)
{
// --> OD 2004-10-26 #i35443# - Because the undo stores the attributes for
// redo, the same code as for <Undo(..)> can be applied for <Redo(..)>
- Undo( rUndoIter );
+ UndoImpl(rContext);
// <--
}
-void SwUndoFmtAttr::Repeat( SwUndoIter& rUndoIter)
+void SwUndoFmtAttr::RepeatImpl(::sw::RepeatContext & rContext)
{
if ( !m_pOldSet.get() )
return;
- if ( UNDO_INSFMTATTR == rUndoIter.GetLastUndoId())
- {
- SwUndoFmtAttr* pLast
- = static_cast<SwUndoFmtAttr*>(rUndoIter.pLastUndoObj);
- if (pLast->m_pOldSet.get() && pLast->m_pFmt)
- {
- return;
- }
- }
+ SwDoc & rDoc(rContext.GetDoc());
switch ( m_nFmtWhich )
{
case RES_GRFFMTCOLL:
{
- SwNoTxtNode * pNd = rUndoIter.pAktPam->GetNode()->GetNoTxtNode();
+ SwNoTxtNode *const pNd =
+ rContext.GetRepeatPaM().GetNode()->GetNoTxtNode();
if( pNd )
{
- rUndoIter.GetDoc().SetAttr( m_pFmt->GetAttrSet(),
- *pNd->GetFmtColl() );
+ rDoc.SetAttr( m_pFmt->GetAttrSet(), *pNd->GetFmtColl() );
}
}
break;
case RES_TXTFMTCOLL:
{
- SwTxtNode * pNd = rUndoIter.pAktPam->GetNode()->GetTxtNode();
+ SwTxtNode *const pNd =
+ rContext.GetRepeatPaM().GetNode()->GetTxtNode();
if( pNd )
{
- rUndoIter.GetDoc().SetAttr( m_pFmt->GetAttrSet(),
- *pNd->GetFmtColl() );
+ rDoc.SetAttr( m_pFmt->GetAttrSet(), *pNd->GetFmtColl() );
}
}
break;
@@ -387,7 +381,8 @@ void SwUndoFmtAttr::Repeat( SwUndoIter& rUndoIter)
// Rahmen steht. Der Weg ist: suche in allen FlyFrmFormaten
// nach dem FlyCntnt-Attribut und teste ob der Cursor in der
// entsprechenden Section liegt.
- SwFrmFmt* pFly = rUndoIter.pAktPam->GetNode()->GetFlyFmt();
+ SwFrmFmt *const pFly =
+ rContext.GetRepeatPaM().GetNode()->GetFlyFmt();
if( pFly )
{
// Bug 43672: es duerfen nicht alle Attribute gesetzt werden!
@@ -397,18 +392,18 @@ void SwUndoFmtAttr::Repeat( SwUndoIter& rUndoIter)
SfxItemSet aTmpSet( m_pFmt->GetAttrSet() );
aTmpSet.ClearItem( RES_CNTNT );
if( aTmpSet.Count() )
- rUndoIter.GetDoc().SetAttr( aTmpSet, *pFly );
+ {
+ rDoc.SetAttr( aTmpSet, *pFly );
+ }
}
else
{
- rUndoIter.GetDoc().SetAttr( m_pFmt->GetAttrSet(), *pFly );
+ rDoc.SetAttr( m_pFmt->GetAttrSet(), *pFly );
}
}
break;
}
}
-
- rUndoIter.pLastUndoObj = this;
}
SwRewriter SwUndoFmtAttr::GetRewriter() const
@@ -452,7 +447,7 @@ void SwUndoFmtAttr::SaveFlyAnchor( bool bSvDrwPt )
*/ }
const SwFmtAnchor& rAnchor =
- static_cast<const SwFmtAnchor&>( m_pOldSet->Get( RES_ANCHOR, FALSE ) );
+ static_cast<const SwFmtAnchor&>( m_pOldSet->Get( RES_ANCHOR, sal_False ) );
if( !rAnchor.GetCntntAnchor() )
return;
@@ -478,12 +473,12 @@ void SwUndoFmtAttr::SaveFlyAnchor( bool bSvDrwPt )
// Return value indicates, if anchor attribute is restored.
// Note: If anchor attribute is restored, all other existing attributes
// are also restored.
-bool SwUndoFmtAttr::RestoreFlyAnchor( SwUndoIter& rIter )
+bool SwUndoFmtAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext)
{
- SwDoc* pDoc = &rIter.GetDoc();
+ SwDoc *const pDoc = & rContext.GetDoc();
SwFlyFrmFmt* pFrmFmt = static_cast<SwFlyFrmFmt*>(m_pFmt);
const SwFmtAnchor& rAnchor =
- static_cast<const SwFmtAnchor&>( m_pOldSet->Get( RES_ANCHOR, FALSE ) );
+ static_cast<const SwFmtAnchor&>( m_pOldSet->Get( RES_ANCHOR, sal_False ) );
SwFmtAnchor aNewAnchor( rAnchor.GetAnchorId() );
if (FLY_AT_PAGE != rAnchor.GetAnchorId())
@@ -623,7 +618,7 @@ bool SwUndoFmtAttr::RestoreFlyAnchor( SwUndoIter& rIter )
if( RES_DRAWFRMFMT != pFrmFmt->Which() )
pFrmFmt->MakeFrms();
- rIter.pSelFmt = pFrmFmt;
+ rContext.SetSelections(pFrmFmt, 0);
// --> OD 2004-10-26 #i35443# - anchor attribute restored.
return true;
@@ -634,14 +629,14 @@ bool SwUndoFmtAttr::RestoreFlyAnchor( SwUndoIter& rIter )
// --> OD 2008-02-12 #newlistlevelattrs#
SwUndoFmtResetAttr::SwUndoFmtResetAttr( SwFmt& rChangedFormat,
- const USHORT nWhichId )
+ const sal_uInt16 nWhichId )
: SwUndo( UNDO_RESETATTR )
, m_pChangedFormat( &rChangedFormat )
, m_nWhichId( nWhichId )
, m_pOldItem( 0 )
{
const SfxPoolItem* pItem = 0;
- if (rChangedFormat.GetItemState( nWhichId, FALSE, &pItem ) == SFX_ITEM_SET)
+ if (rChangedFormat.GetItemState( nWhichId, sal_False, &pItem ) == SFX_ITEM_SET)
{
m_pOldItem.reset( pItem->Clone() );
}
@@ -651,7 +646,7 @@ SwUndoFmtResetAttr::~SwUndoFmtResetAttr()
{
}
-void SwUndoFmtResetAttr::Undo( SwUndoIter& )
+void SwUndoFmtResetAttr::UndoImpl(::sw::UndoRedoContext &)
{
if ( m_pOldItem.get() )
{
@@ -659,7 +654,7 @@ void SwUndoFmtResetAttr::Undo( SwUndoIter& )
}
}
-void SwUndoFmtResetAttr::Redo( SwUndoIter& )
+void SwUndoFmtResetAttr::RedoImpl(::sw::UndoRedoContext &)
{
if ( m_pOldItem.get() )
{
@@ -670,14 +665,14 @@ void SwUndoFmtResetAttr::Redo( SwUndoIter& )
// -----------------------------------------------------
-SwUndoResetAttr::SwUndoResetAttr( const SwPaM& rRange, USHORT nFmtId )
+SwUndoResetAttr::SwUndoResetAttr( const SwPaM& rRange, sal_uInt16 nFmtId )
: SwUndo( UNDO_RESETATTR ), SwUndRng( rRange )
, m_pHistory( new SwHistory )
, m_nFormatId( nFmtId )
{
}
-SwUndoResetAttr::SwUndoResetAttr( const SwPosition& rPos, USHORT nFmtId )
+SwUndoResetAttr::SwUndoResetAttr( const SwPosition& rPos, sal_uInt16 nFmtId )
: SwUndo( UNDO_RESETATTR )
, m_pHistory( new SwHistory )
, m_nFormatId( nFmtId )
@@ -690,10 +685,10 @@ SwUndoResetAttr::~SwUndoResetAttr()
{
}
-void SwUndoResetAttr::Undo( SwUndoIter& rUndoIter )
+void SwUndoResetAttr::UndoImpl(::sw::UndoRedoContext & rContext)
{
// reset old values
- SwDoc& rDoc = rUndoIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
m_pHistory->TmpRollback( &rDoc, 0 );
m_pHistory->SetTmpEnd( m_pHistory->Count() );
@@ -704,32 +699,29 @@ void SwUndoResetAttr::Undo( SwUndoIter& rUndoIter )
if( pTNd )
{
SwIndex aIdx( pTNd, nSttCntnt );
- pTNd->DontExpandFmt( aIdx, FALSE );
+ pTNd->DontExpandFmt( aIdx, sal_False );
}
}
- // setze noch den Cursor auf den Undo-Bereich
- SetPaM( rUndoIter );
+ AddUndoRedoPaM(rContext);
}
-void SwUndoResetAttr::Redo( SwUndoIter& rUndoIter )
+void SwUndoResetAttr::RedoImpl(::sw::UndoRedoContext & rContext)
{
- // setze Attribut in dem Bereich:
- SetPaM( rUndoIter );
- SwDoc& rDoc = rUndoIter.GetDoc();
- rUndoIter.pLastUndoObj = 0;
+ SwDoc & rDoc = rContext.GetDoc();
+ SwPaM & rPam = AddUndoRedoPaM(rContext);
SvUShortsSort* pIdArr = m_Ids.Count() ? &m_Ids : 0;
switch ( m_nFormatId )
{
case RES_CHRFMT:
- rUndoIter.GetDoc().RstTxtAttrs( *rUndoIter.pAktPam );
+ rDoc.RstTxtAttrs(rPam);
break;
case RES_TXTFMTCOLL:
- rUndoIter.GetDoc().ResetAttrs( *rUndoIter.pAktPam, FALSE, pIdArr );
+ rDoc.ResetAttrs(rPam, sal_False, pIdArr );
break;
case RES_CONDTXTFMTCOLL:
- rUndoIter.GetDoc().ResetAttrs( *rUndoIter.pAktPam, TRUE, pIdArr );
+ rDoc.ResetAttrs(rPam, sal_True, pIdArr );
break;
case RES_TXTATR_TOXMARK:
@@ -740,7 +732,7 @@ void SwUndoResetAttr::Redo( SwUndoIter& rUndoIter )
SwPosition aPos( aIdx, SwIndex( aIdx.GetNode().GetCntntNode(),
nSttCntnt ));
- USHORT nCnt = rDoc.GetCurTOXMark( aPos, aArr );
+ sal_uInt16 nCnt = rDoc.GetCurTOXMark( aPos, aArr );
if( nCnt )
{
if( 1 < nCnt )
@@ -771,15 +763,11 @@ void SwUndoResetAttr::Redo( SwUndoIter& rUndoIter )
}
break;
}
- rUndoIter.pLastUndoObj = 0;
}
-void SwUndoResetAttr::Repeat( SwUndoIter& rUndoIter )
+void SwUndoResetAttr::RepeatImpl(::sw::RepeatContext & rContext)
{
- if ( (RES_FMT_BEGIN > m_nFormatId) ||
- ( (UNDO_RESETATTR == rUndoIter.GetLastUndoId()) &&
- (m_nFormatId == static_cast<SwUndoResetAttr*>(rUndoIter.pLastUndoObj)
- ->m_nFormatId) ) )
+ if (m_nFormatId < RES_FMT_BEGIN)
{
return;
}
@@ -788,16 +776,15 @@ void SwUndoResetAttr::Repeat( SwUndoIter& rUndoIter )
switch ( m_nFormatId )
{
case RES_CHRFMT:
- rUndoIter.GetDoc().RstTxtAttrs( *rUndoIter.pAktPam );
+ rContext.GetDoc().RstTxtAttrs(rContext.GetRepeatPaM());
break;
case RES_TXTFMTCOLL:
- rUndoIter.GetDoc().ResetAttrs( *rUndoIter.pAktPam, FALSE, pIdArr );
+ rContext.GetDoc().ResetAttrs(rContext.GetRepeatPaM(), false, pIdArr);
break;
case RES_CONDTXTFMTCOLL:
- rUndoIter.GetDoc().ResetAttrs( *rUndoIter.pAktPam, TRUE, pIdArr );
+ rContext.GetDoc().ResetAttrs(rContext.GetRepeatPaM(), true, pIdArr);
break;
}
- rUndoIter.pLastUndoObj = this;
}
@@ -842,7 +829,7 @@ SwUndoAttr::~SwUndoAttr()
{
}
-void SwUndoAttr::SaveRedlineData( const SwPaM& rPam, BOOL bIsCntnt )
+void SwUndoAttr::SaveRedlineData( const SwPaM& rPam, sal_Bool bIsCntnt )
{
SwDoc* pDoc = rPam.GetDoc();
if ( pDoc->IsRedlineOn() )
@@ -866,29 +853,29 @@ void SwUndoAttr::SaveRedlineData( const SwPaM& rPam, BOOL bIsCntnt )
}
}
-void SwUndoAttr::Undo( SwUndoIter& rUndoIter )
+void SwUndoAttr::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc* pDoc = &rUndoIter.GetDoc();
+ SwDoc *const pDoc = & rContext.GetDoc();
RemoveIdx( *pDoc );
if( IDocumentRedlineAccess::IsRedlineOn( GetRedlineMode() ) )
{
- SwPaM& rPam = *rUndoIter.pAktPam;
+ SwPaM aPam(pDoc->GetNodes().GetEndOfContent());
if ( ULONG_MAX != m_nNodeIndex )
{
- rPam.DeleteMark();
- rPam.GetPoint()->nNode = m_nNodeIndex;
- rPam.GetPoint()->nContent.Assign( rPam.GetCntntNode(), nSttCntnt );
- rPam.SetMark();
- rPam.GetPoint()->nContent++;
- pDoc->DeleteRedline( rPam, false, USHRT_MAX );
+ aPam.DeleteMark();
+ aPam.GetPoint()->nNode = m_nNodeIndex;
+ aPam.GetPoint()->nContent.Assign( aPam.GetCntntNode(), nSttCntnt );
+ aPam.SetMark();
+ aPam.GetPoint()->nContent++;
+ pDoc->DeleteRedline(aPam, false, USHRT_MAX);
}
else
{
// alle Format-Redlines entfernen, werden ggfs. neu gesetzt
- SetPaM( rUndoIter );
- pDoc->DeleteRedline( rPam, false, nsRedlineType_t::REDLINE_FORMAT );
+ SetPaM(aPam);
+ pDoc->DeleteRedline(aPam, false, nsRedlineType_t::REDLINE_FORMAT);
if ( m_pRedlineSaveData.get() )
{
SetSaveData( *pDoc, *m_pRedlineSaveData );
@@ -905,67 +892,30 @@ void SwUndoAttr::Undo( SwUndoIter& rUndoIter )
m_pHistory->SetTmpEnd( m_pHistory->Count() );
// set cursor onto Undo area
- SetPaM( rUndoIter );
+ AddUndoRedoPaM(rContext);
}
-int lcl_HasEqualItems( const SfxItemSet& rSet1, const SfxItemSet& rSet2 )
+void SwUndoAttr::RepeatImpl(::sw::RepeatContext & rContext)
{
- int nRet = -1;
- SfxItemIter aIter1( rSet1 ), aIter2( rSet2 );
- const SfxPoolItem *pI1 = aIter1.FirstItem(), *pI2 = aIter2.FirstItem();
-
- while( pI1 && pI2 )
- {
- if( pI1->Which() != pI2->Which() ||
- aIter1.IsAtEnd() != aIter2.IsAtEnd() )
- {
- nRet = 0;
- break;
- }
- if( aIter1.IsAtEnd() )
- break;
- pI1 = aIter1.NextItem();
- pI2 = aIter2.NextItem();
- }
- return nRet;
-}
-
-void SwUndoAttr::Repeat( SwUndoIter& rUndoIter )
-{
- if ( UNDO_INSATTR == rUndoIter.GetLastUndoId() )
- {
- SwUndoAttr* pLast = static_cast<SwUndoAttr*>(rUndoIter.pLastUndoObj);
- if ((pLast->m_AttrSet.Count() == m_AttrSet.Count()) &&
- (pLast->m_nInsertFlags == m_nInsertFlags ) &&
- lcl_HasEqualItems( m_AttrSet, pLast->m_AttrSet ))
- {
- return;
- }
- }
-
-
// RefMarks are not repeat capable
- if ( SFX_ITEM_SET != m_AttrSet.GetItemState( RES_TXTATR_REFMARK, FALSE ) )
+ if ( SFX_ITEM_SET != m_AttrSet.GetItemState( RES_TXTATR_REFMARK, sal_False ) )
{
- rUndoIter.GetDoc().InsertItemSet( *rUndoIter.pAktPam,
+ rContext.GetDoc().InsertItemSet( rContext.GetRepeatPaM(),
m_AttrSet, m_nInsertFlags );
}
else if ( 1 < m_AttrSet.Count() )
{
SfxItemSet aTmpSet( m_AttrSet );
aTmpSet.ClearItem( RES_TXTATR_REFMARK );
- rUndoIter.GetDoc().InsertItemSet( *rUndoIter.pAktPam,
+ rContext.GetDoc().InsertItemSet( rContext.GetRepeatPaM(),
aTmpSet, m_nInsertFlags );
}
- rUndoIter.pLastUndoObj = this;
}
-void SwUndoAttr::Redo( SwUndoIter& rUndoIter )
+void SwUndoAttr::RedoImpl(::sw::UndoRedoContext & rContext)
{
- // setze Attribut in dem Bereich:
- SetPaM( rUndoIter );
- SwPaM& rPam = *rUndoIter.pAktPam;
- SwDoc& rDoc = rUndoIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
+ SwPaM & rPam = AddUndoRedoPaM(rContext);
if ( m_pRedlineData.get() &&
IDocumentRedlineAccess::IsRedlineOn( GetRedlineMode() ) )
@@ -996,22 +946,20 @@ void SwUndoAttr::Redo( SwUndoIter& rUndoIter )
{
rDoc.InsertItemSet( rPam, m_AttrSet, m_nInsertFlags );
}
-
- rUndoIter.pLastUndoObj = 0;
}
void SwUndoAttr::RemoveIdx( SwDoc& rDoc )
{
- if ( SFX_ITEM_SET != m_AttrSet.GetItemState( RES_TXTATR_FTN, FALSE ))
+ if ( SFX_ITEM_SET != m_AttrSet.GetItemState( RES_TXTATR_FTN, sal_False ))
return ;
SwHistoryHint* pHstHnt;
SwNodes& rNds = rDoc.GetNodes();
- for ( USHORT n = 0; n < m_pHistory->Count(); ++n )
+ for ( sal_uInt16 n = 0; n < m_pHistory->Count(); ++n )
{
xub_StrLen nCntnt = 0;
- ULONG nNode = 0;
+ sal_uLong nNode = 0;
pHstHnt = (*m_pHistory)[ n ];
switch ( pHstHnt->Which() )
{
@@ -1035,7 +983,7 @@ void SwUndoAttr::RemoveIdx( SwDoc& rDoc )
if ( STRING_MAXLEN != nCntnt )
{
const SvUShorts& rArr = pHistoryHint->GetArr();
- for ( USHORT i = rArr.Count(); i; )
+ for ( sal_uInt16 i = rArr.Count(); i; )
{
if ( RES_TXTATR_FTN == rArr[ --i ] )
{
@@ -1078,7 +1026,7 @@ SwUndoDefaultAttr::SwUndoDefaultAttr( const SfxItemSet& rSet )
, m_pTabStop( 0 )
{
const SfxPoolItem* pItem;
- if( SFX_ITEM_SET == rSet.GetItemState( RES_PARATR_TABSTOP, FALSE, &pItem ) )
+ if( SFX_ITEM_SET == rSet.GetItemState( RES_PARATR_TABSTOP, sal_False, &pItem ) )
{
// store separately, because it may change!
m_pTabStop.reset( static_cast<SvxTabStopItem*>(pItem->Clone()) );
@@ -1097,9 +1045,9 @@ SwUndoDefaultAttr::~SwUndoDefaultAttr()
{
}
-void SwUndoDefaultAttr::Undo( SwUndoIter& rUndoIter)
+void SwUndoDefaultAttr::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
if ( m_pOldSet.get() )
{
SwUndoFmtAttrHelper aTmp(
@@ -1121,15 +1069,15 @@ void SwUndoDefaultAttr::Undo( SwUndoIter& rUndoIter)
}
}
-void SwUndoDefaultAttr::Redo( SwUndoIter& rUndoIter)
+void SwUndoDefaultAttr::RedoImpl(::sw::UndoRedoContext & rContext)
{
- Undo( rUndoIter );
+ UndoImpl(rContext);
}
// -----------------------------------------------------
SwUndoMoveLeftMargin::SwUndoMoveLeftMargin(
- const SwPaM& rPam, BOOL bFlag, BOOL bMod )
+ const SwPaM& rPam, sal_Bool bFlag, sal_Bool bMod )
: SwUndo( bFlag ? UNDO_INC_LEFTMARGIN : UNDO_DEC_LEFTMARGIN )
, SwUndRng( rPam )
, m_pHistory( new SwHistory )
@@ -1141,41 +1089,38 @@ SwUndoMoveLeftMargin::~SwUndoMoveLeftMargin()
{
}
-void SwUndoMoveLeftMargin::Undo( SwUndoIter& rIter )
+void SwUndoMoveLeftMargin::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc* pDoc = &rIter.GetDoc();
- BOOL bUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ SwDoc & rDoc = rContext.GetDoc();
// restore old values
- m_pHistory->TmpRollback( pDoc, 0 );
+ m_pHistory->TmpRollback( & rDoc, 0 );
m_pHistory->SetTmpEnd( m_pHistory->Count() );
- pDoc->DoUndo( bUndo );
- SetPaM( rIter );
+ AddUndoRedoPaM(rContext);
}
-void SwUndoMoveLeftMargin::Redo( SwUndoIter& rIter )
+void SwUndoMoveLeftMargin::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc* pDoc = &rIter.GetDoc();
- SetPaM( rIter );
- pDoc->MoveLeftMargin( *rIter.pAktPam, GetId() == UNDO_INC_LEFTMARGIN,
- m_bModulus );
+ SwDoc & rDoc = rContext.GetDoc();
+ SwPaM & rPam = AddUndoRedoPaM(rContext);
+
+ rDoc.MoveLeftMargin( rPam,
+ GetId() == UNDO_INC_LEFTMARGIN, m_bModulus );
}
-void SwUndoMoveLeftMargin::Repeat( SwUndoIter& rIter )
+void SwUndoMoveLeftMargin::RepeatImpl(::sw::RepeatContext & rContext)
{
- SwDoc* pDoc = &rIter.GetDoc();
- pDoc->MoveLeftMargin( *rIter.pAktPam, GetId() == UNDO_INC_LEFTMARGIN,
+ SwDoc & rDoc = rContext.GetDoc();
+ rDoc.MoveLeftMargin(rContext.GetRepeatPaM(), GetId() == UNDO_INC_LEFTMARGIN,
m_bModulus );
- rIter.pLastUndoObj = this;
}
// -----------------------------------------------------
SwUndoChangeFootNote::SwUndoChangeFootNote(
const SwPaM& rRange, const String& rTxt,
- USHORT nNum, bool bIsEndNote )
+ sal_uInt16 nNum, bool bIsEndNote )
: SwUndo( UNDO_CHGFTN ), SwUndRng( rRange )
, m_pHistory( new SwHistory() )
, m_Text( rTxt )
@@ -1188,35 +1133,30 @@ SwUndoChangeFootNote::~SwUndoChangeFootNote()
{
}
-void SwUndoChangeFootNote::Undo( SwUndoIter& rIter )
+void SwUndoChangeFootNote::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rIter.GetDoc();
- SetPaM( rIter );
-
- BOOL bUndo = rDoc.DoesUndo();
- rDoc.DoUndo( FALSE );
+ SwDoc & rDoc = rContext.GetDoc();
m_pHistory->TmpRollback( &rDoc, 0 );
m_pHistory->SetTmpEnd( m_pHistory->Count() );
rDoc.GetFtnIdxs().UpdateAllFtn();
- SetPaM( rIter );
- rDoc.DoUndo( bUndo );
+ AddUndoRedoPaM(rContext);
}
-void SwUndoChangeFootNote::Redo( SwUndoIter& rIter )
+void SwUndoChangeFootNote::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SetPaM( rIter );
- rIter.GetDoc().SetCurFtn( *rIter.pAktPam, m_Text, m_nNumber, m_bEndNote );
- SetPaM( rIter );
+ SwDoc & rDoc( rContext.GetDoc() );
+ SwPaM & rPaM = AddUndoRedoPaM(rContext);
+ rDoc.SetCurFtn(rPaM, m_Text, m_nNumber, m_bEndNote);
+ SetPaM(rPaM);
}
-void SwUndoChangeFootNote::Repeat( SwUndoIter& rIter )
+void SwUndoChangeFootNote::RepeatImpl(::sw::RepeatContext & rContext)
{
- SwDoc& rDoc = rIter.GetDoc();
- rDoc.SetCurFtn( *rIter.pAktPam, m_Text, m_nNumber, m_bEndNote );
- rIter.pLastUndoObj = this;
+ SwDoc & rDoc = rContext.GetDoc();
+ rDoc.SetCurFtn( rContext.GetRepeatPaM(), m_Text, m_nNumber, m_bEndNote );
}
@@ -1233,17 +1173,17 @@ SwUndoFootNoteInfo::~SwUndoFootNoteInfo()
{
}
-void SwUndoFootNoteInfo::Undo( SwUndoIter &rIter )
+void SwUndoFootNoteInfo::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc &rDoc = rIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
SwFtnInfo *pInf = new SwFtnInfo( rDoc.GetFtnInfo() );
rDoc.SetFtnInfo( *m_pFootNoteInfo );
m_pFootNoteInfo.reset( pInf );
}
-void SwUndoFootNoteInfo::Redo( SwUndoIter &rIter )
+void SwUndoFootNoteInfo::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc &rDoc = rIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
SwFtnInfo *pInf = new SwFtnInfo( rDoc.GetFtnInfo() );
rDoc.SetFtnInfo( *m_pFootNoteInfo );
m_pFootNoteInfo.reset( pInf );
@@ -1262,17 +1202,17 @@ SwUndoEndNoteInfo::~SwUndoEndNoteInfo()
{
}
-void SwUndoEndNoteInfo::Undo( SwUndoIter &rIter )
+void SwUndoEndNoteInfo::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc &rDoc = rIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
SwEndNoteInfo *pInf = new SwEndNoteInfo( rDoc.GetEndNoteInfo() );
rDoc.SetEndNoteInfo( *m_pEndNoteInfo );
m_pEndNoteInfo.reset( pInf );
}
-void SwUndoEndNoteInfo::Redo( SwUndoIter &rIter )
+void SwUndoEndNoteInfo::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc &rDoc = rIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
SwEndNoteInfo *pInf = new SwEndNoteInfo( rDoc.GetEndNoteInfo() );
rDoc.SetEndNoteInfo( *m_pEndNoteInfo );
m_pEndNoteInfo.reset( pInf );
@@ -1287,22 +1227,22 @@ SwUndoDontExpandFmt::SwUndoDontExpandFmt( const SwPosition& rPos )
{
}
-void SwUndoDontExpandFmt::Undo( SwUndoIter& rIter )
+void SwUndoDontExpandFmt::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwPaM* pPam = rIter.pAktPam;
- SwDoc* pDoc = pPam->GetDoc();
+ SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor());
+ SwDoc *const pDoc = & rContext.GetDoc();
SwPosition& rPos = *pPam->GetPoint();
rPos.nNode = m_nNodeIndex;
rPos.nContent.Assign( rPos.nNode.GetNode().GetCntntNode(), m_nContentIndex);
- pDoc->DontExpandFmt( rPos, FALSE );
+ pDoc->DontExpandFmt( rPos, sal_False );
}
-void SwUndoDontExpandFmt::Redo( SwUndoIter& rIter )
+void SwUndoDontExpandFmt::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwPaM* pPam = rIter.pAktPam;
- SwDoc* pDoc = pPam->GetDoc();
+ SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor());
+ SwDoc *const pDoc = & rContext.GetDoc();
SwPosition& rPos = *pPam->GetPoint();
rPos.nNode = m_nNodeIndex;
@@ -1310,10 +1250,10 @@ void SwUndoDontExpandFmt::Redo( SwUndoIter& rIter )
pDoc->DontExpandFmt( rPos );
}
-void SwUndoDontExpandFmt::Repeat( SwUndoIter& rIter )
+void SwUndoDontExpandFmt::RepeatImpl(::sw::RepeatContext & rContext)
{
- SwPaM* pPam = rIter.pAktPam;
- SwDoc* pDoc = pPam->GetDoc();
- pDoc->DontExpandFmt( *pPam->GetPoint() );
+ SwPaM & rPam = rContext.GetRepeatPaM();
+ SwDoc & rDoc = rContext.GetDoc();
+ rDoc.DontExpandFmt( *rPam.GetPoint() );
}
diff --git a/sw/source/core/undo/unbkmk.cxx b/sw/source/core/undo/unbkmk.cxx
index b86bdad692ac..52fe406e459b 100644
--- a/sw/source/core/undo/unbkmk.cxx
+++ b/sw/source/core/undo/unbkmk.cxx
@@ -28,22 +28,20 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <UndoBookmark.hxx>
#include "doc.hxx"
#include "docary.hxx"
#include "swundo.hxx" // fuer die UndoIds
#include "pam.hxx"
-#include "undobj.hxx"
+#include <UndoCore.hxx>
#include "IMark.hxx"
#include "rolbck.hxx"
#include "SwRewriter.hxx"
-inline SwDoc& SwUndoIter::GetDoc() const { return *pAktPam->GetDoc(); }
-
-
SwUndoBookmark::SwUndoBookmark( SwUndoId nUndoId,
const ::sw::mark::IMark& rBkmk )
: SwUndo( nUndoId )
@@ -60,7 +58,6 @@ void SwUndoBookmark::SetInDoc( SwDoc* pDoc )
m_pHistoryBookmark->SetInDoc( pDoc, false );
}
-
void SwUndoBookmark::ResetInDoc( SwDoc* pDoc )
{
IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess();
@@ -95,15 +92,13 @@ SwUndoInsBookmark::SwUndoInsBookmark( const ::sw::mark::IMark& rBkmk )
}
-void SwUndoInsBookmark::Undo( SwUndoIter& rUndoIter )
+void SwUndoInsBookmark::UndoImpl(::sw::UndoRedoContext & rContext)
{
- ResetInDoc( &rUndoIter.GetDoc() );
+ ResetInDoc( &rContext.GetDoc() );
}
-
-void SwUndoInsBookmark::Redo( SwUndoIter& rUndoIter )
+void SwUndoInsBookmark::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SetInDoc( &rUndoIter.GetDoc() );
+ SetInDoc( &rContext.GetDoc() );
}
-
diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx
index ef39a4e18950..3b197b81c4f8 100644
--- a/sw/source/core/undo/undel.cxx
+++ b/sw/source/core/undo/undel.cxx
@@ -28,6 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <UndoDelete.hxx>
#include <hintids.hxx>
#include <unotools/charclass.hxx>
@@ -36,11 +37,12 @@
#include <frmfmt.hxx>
#include <fmtanchr.hxx>
#include <doc.hxx>
+#include <UndoManager.hxx>
#include <swtable.hxx>
#include <swundo.hxx> // fuer die UndoIds
#include <pam.hxx>
#include <ndtxt.hxx>
-#include <undobj.hxx>
+#include <UndoCore.hxx>
#include <rolbck.hxx>
#include <poolfmt.hxx>
#include <mvsave.hxx>
@@ -60,21 +62,19 @@
// using namespace comphelper;
-inline SwDoc& SwUndoIter::GetDoc() const { return *pAktPam->GetDoc(); }
-
// DELETE
/* lcl_MakeAutoFrms has to call MakeFrms for objects bounded "AtChar" ( == AUTO ),
if the anchor frame has be moved via _MoveNodes(..) and DelFrms(..)
*/
-void lcl_MakeAutoFrms( const SwSpzFrmFmts& rSpzArr, ULONG nMovedIndex )
+void lcl_MakeAutoFrms( const SwSpzFrmFmts& rSpzArr, sal_uLong nMovedIndex )
{
if( rSpzArr.Count() )
{
SwFlyFrmFmt* pFmt;
const SwFmtAnchor* pAnchor;
- for( USHORT n = 0; n < rSpzArr.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rSpzArr.Count(); ++n )
{
pFmt = (SwFlyFrmFmt*)rSpzArr[n];
pAnchor = &pFmt->GetAnchor();
@@ -110,12 +110,12 @@ section and the end paragraph not. Then we have to move the paragraph into this
record this in nSectDiff.
*/
-SwUndoDelete::SwUndoDelete( SwPaM& rPam, BOOL bFullPara, BOOL bCalledByTblCpy )
+SwUndoDelete::SwUndoDelete( SwPaM& rPam, sal_Bool bFullPara, sal_Bool bCalledByTblCpy )
: SwUndo(UNDO_DELETE), SwUndRng( rPam ),
pMvStt( 0 ), pSttStr(0), pEndStr(0), pRedlData(0), pRedlSaveData(0),
nNode(0), nNdDiff(0), nSectDiff(0), nReplaceDummy(0), nSetPos(0),
- bGroup( FALSE ), bBackSp( FALSE ), bJoinNext( FALSE ), bTblDelLastNd( FALSE ),
- bDelFullPara( bFullPara ), bResetPgDesc( FALSE ), bResetPgBrk( FALSE ),
+ bGroup( sal_False ), bBackSp( sal_False ), bJoinNext( sal_False ), bTblDelLastNd( sal_False ),
+ bDelFullPara( bFullPara ), bResetPgDesc( sal_False ), bResetPgBrk( sal_False ),
bFromTableCopy( bCalledByTblCpy )
{
bDelFullPara = bFullPara; // This is set e.g. if an empty paragraph before a table is deleted
@@ -147,10 +147,8 @@ SwUndoDelete::SwUndoDelete( SwPaM& rPam, BOOL bFullPara, BOOL bCalledByTblCpy )
DelCntntIndex( *rPam.GetMark(), *rPam.GetPoint(),
DelCntntType(nsDelCntntType::DELCNT_ALL | nsDelCntntType::DELCNT_CHKNOCNTNT) );
- BOOL bDoesUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
_DelBookmarks(pStt->nNode, pEnd->nNode);
- pDoc->DoUndo( bDoesUndo );
}
else
DelCntntIndex( *rPam.GetMark(), *rPam.GetPoint() );
@@ -172,8 +170,8 @@ SwUndoDelete::SwUndoDelete( SwPaM& rPam, BOOL bFullPara, BOOL bCalledByTblCpy )
: pEnd->nNode.GetNode().GetTxtNode();
}
- BOOL bMoveNds = *pStt == *pEnd // noch ein Bereich vorhanden ??
- ? FALSE
+ sal_Bool bMoveNds = *pStt == *pEnd // noch ein Bereich vorhanden ??
+ ? sal_False
: ( SaveCntnt( pStt, pEnd, pSttTxtNd, pEndTxtNd ) || bFromTableCopy );
if( pSttTxtNd && pEndTxtNd && pSttTxtNd != pEndTxtNd )
@@ -193,11 +191,11 @@ SwUndoDelete::SwUndoDelete( SwPaM& rPam, BOOL bFullPara, BOOL bCalledByTblCpy )
{
SwRegHistory aRegHist( *pEndTxtNd, pHistory );
if( SFX_ITEM_SET == pEndTxtNd->GetpSwAttrSet()->GetItemState(
- RES_BREAK, FALSE ) )
+ RES_BREAK, sal_False ) )
pEndTxtNd->ResetAttr( RES_BREAK );
if( pEndTxtNd->HasSwAttrSet() &&
SFX_ITEM_SET == pEndTxtNd->GetpSwAttrSet()->GetItemState(
- RES_PAGEDESC, FALSE ) )
+ RES_PAGEDESC, sal_False ) )
pEndTxtNd->ResetAttr( RES_PAGEDESC );
}
}
@@ -220,7 +218,7 @@ SwUndoDelete::SwUndoDelete( SwPaM& rPam, BOOL bFullPara, BOOL bCalledByTblCpy )
if( bMoveNds ) // sind noch Nodes zu verschieben ?
{
- SwNodes& rNds = (SwNodes&)*pDoc->GetUndoNds();
+ SwNodes& rNds = pDoc->GetUndoManager().GetUndoNodes();
SwNodes& rDocNds = pDoc->GetNodes();
SwNodeRange aRg( rDocNds, nSttNode - nNdDiff,
rDocNds, nEndNode - nNdDiff );
@@ -253,11 +251,9 @@ SwUndoDelete::SwUndoDelete( SwPaM& rPam, BOOL bFullPara, BOOL bCalledByTblCpy )
++nReplaceDummy;
SwNodeRange aMvRg( *pEndTxtNd, 0, *pEndTxtNd, 1 );
SwPosition aSplitPos( *pEndTxtNd );
- BOOL bDoesUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ ::sw::UndoGuard const ug(pDoc->GetIDocumentUndoRedo());
pDoc->SplitNode( aSplitPos, false );
- rDocNds._MoveNodes( aMvRg, rDocNds, aRg.aEnd, TRUE );
- pDoc->DoUndo( bDoesUndo );
+ rDocNds._MoveNodes( aMvRg, rDocNds, aRg.aEnd, sal_True );
aRg.aEnd--;
}
else
@@ -279,11 +275,9 @@ SwUndoDelete::SwUndoDelete( SwPaM& rPam, BOOL bFullPara, BOOL bCalledByTblCpy )
{
SwNodeRange aMvRg( *pSttTxtNd, 0, *pSttTxtNd, 1 );
SwPosition aSplitPos( *pSttTxtNd );
- BOOL bDoesUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ ::sw::UndoGuard const ug(pDoc->GetIDocumentUndoRedo());
pDoc->SplitNode( aSplitPos, false );
- rDocNds._MoveNodes( aMvRg, rDocNds, aRg.aStart, TRUE );
- pDoc->DoUndo( bDoesUndo );
+ rDocNds._MoveNodes( aMvRg, rDocNds, aRg.aStart, sal_True );
aRg.aStart--;
}
}
@@ -319,12 +313,12 @@ SwUndoDelete::SwUndoDelete( SwPaM& rPam, BOOL bFullPara, BOOL bCalledByTblCpy )
if( bJoinNext )
{
SwNodeRange aMvRg( *pEndTxtNd, 0, *pEndTxtNd, 1 );
- rDocNds._MoveNodes( aMvRg, rDocNds, aRg.aStart, TRUE );
+ rDocNds._MoveNodes( aMvRg, rDocNds, aRg.aStart, sal_True );
}
else
{
SwNodeRange aMvRg( *pSttTxtNd, 0, *pSttTxtNd, 1 );
- rDocNds._MoveNodes( aMvRg, rDocNds, aRg.aEnd, TRUE );
+ rDocNds._MoveNodes( aMvRg, rDocNds, aRg.aEnd, sal_True );
}
}
}
@@ -357,14 +351,14 @@ SwUndoDelete::SwUndoDelete( SwPaM& rPam, BOOL bFullPara, BOOL bCalledByTblCpy )
DELETEZ( pHistory );
}
-BOOL SwUndoDelete::SaveCntnt( const SwPosition* pStt, const SwPosition* pEnd,
+sal_Bool SwUndoDelete::SaveCntnt( const SwPosition* pStt, const SwPosition* pEnd,
SwTxtNode* pSttTxtNd, SwTxtNode* pEndTxtNd )
{
- ULONG nNdIdx = pStt->nNode.GetIndex();
+ sal_uLong nNdIdx = pStt->nNode.GetIndex();
// 1 - kopiere den Anfang in den Start-String
if( pSttTxtNd )
{
- BOOL bOneNode = nSttNode == nEndNode;
+ sal_Bool bOneNode = nSttNode == nEndNode;
xub_StrLen nLen = bOneNode ? nEndCntnt - nSttCntnt
: pSttTxtNd->GetTxt().Len() - nSttCntnt;
SwRegHistory aRHst( *pSttTxtNd, pHistory );
@@ -397,7 +391,7 @@ BOOL SwUndoDelete::SaveCntnt( const SwPosition* pStt, const SwPosition* pEnd,
}
if( bOneNode )
- return FALSE; // keine Nodes mehr verschieben
+ return sal_False; // keine Nodes mehr verschieben
}
@@ -435,21 +429,21 @@ BOOL SwUndoDelete::SaveCntnt( const SwPosition* pStt, const SwPosition* pEnd,
// sind es nur zwei Nodes, dann ist schon alles erledigt.
if( ( pSttTxtNd || pEndTxtNd ) && nSttNode + 1 == nEndNode )
- return FALSE; // keine Nodes mehr verschieben
+ return sal_False; // keine Nodes mehr verschieben
- return TRUE; // verschiebe die dazwischen liegenden Nodes
+ return sal_True; // verschiebe die dazwischen liegenden Nodes
}
-BOOL SwUndoDelete::CanGrouping( SwDoc* pDoc, const SwPaM& rDelPam )
+sal_Bool SwUndoDelete::CanGrouping( SwDoc* pDoc, const SwPaM& rDelPam )
{
// ist das Undo groesser als 1 Node ? (sprich: Start und EndString)
- if( pSttStr ? !pSttStr->Len() || pEndStr : TRUE )
- return FALSE;
+ if( pSttStr ? !pSttStr->Len() || pEndStr : sal_True )
+ return sal_False;
// es kann nur das Loeschen von einzelnen char's zusammengefasst werden
if( nSttNode != nEndNode || ( !bGroup && nSttCntnt+1 != nEndCntnt ))
- return FALSE;
+ return sal_False;
const SwPosition *pStt = rDelPam.Start(),
*pEnd = rDelPam.GetPoint() == pStt
@@ -459,26 +453,26 @@ BOOL SwUndoDelete::CanGrouping( SwDoc* pDoc, const SwPaM& rDelPam )
if( pStt->nNode != pEnd->nNode ||
pStt->nContent.GetIndex()+1 != pEnd->nContent.GetIndex() ||
pEnd->nNode != nSttNode )
- return FALSE;
+ return sal_False;
// untercheide zwischen BackSpace und Delete. Es muss dann das
// Undo-Array unterschiedlich aufgebaut werden !!
if( pEnd->nContent == nSttCntnt )
{
- if( bGroup && !bBackSp ) return FALSE;
- bBackSp = TRUE;
+ if( bGroup && !bBackSp ) return sal_False;
+ bBackSp = sal_True;
}
else if( pStt->nContent == nSttCntnt )
{
- if( bGroup && bBackSp ) return FALSE;
- bBackSp = FALSE;
+ if( bGroup && bBackSp ) return sal_False;
+ bBackSp = sal_False;
}
else
- return FALSE;
+ return sal_False;
// sind die beiden Nodes (Nodes-/Undo-Array) ueberhaupt TextNodes?
SwTxtNode * pDelTxtNd = pStt->nNode.GetNode().GetTxtNode();
- if( !pDelTxtNd ) return FALSE;
+ if( !pDelTxtNd ) return sal_False;
xub_StrLen nUChrPos = bBackSp ? 0 : pSttStr->Len()-1;
sal_Unicode cDelChar = pDelTxtNd->GetTxt().GetChar( pStt->nContent.GetIndex() );
@@ -486,19 +480,19 @@ BOOL SwUndoDelete::CanGrouping( SwDoc* pDoc, const SwPaM& rDelPam )
if( ( CH_TXTATR_BREAKWORD == cDelChar || CH_TXTATR_INWORD == cDelChar ) ||
rCC.isLetterNumeric( String( cDelChar ), 0 ) !=
rCC.isLetterNumeric( *pSttStr, nUChrPos ) )
- return FALSE;
+ return sal_False;
{
SwRedlineSaveDatas* pTmpSav = new SwRedlineSaveDatas;
- if( !FillSaveData( rDelPam, *pTmpSav, FALSE ))
+ if( !FillSaveData( rDelPam, *pTmpSav, sal_False ))
delete pTmpSav, pTmpSav = 0;
- BOOL bOk = ( !pRedlSaveData && !pTmpSav ) ||
+ sal_Bool bOk = ( !pRedlSaveData && !pTmpSav ) ||
( pRedlSaveData && pTmpSav &&
SwUndo::CanRedlineGroup( *pRedlSaveData, *pTmpSav, bBackSp ));
delete pTmpSav;
if( !bOk )
- return FALSE;
+ return sal_False;
pDoc->DeleteRedline( rDelPam, false, USHRT_MAX );
}
@@ -515,8 +509,8 @@ BOOL SwUndoDelete::CanGrouping( SwDoc* pDoc, const SwPaM& rDelPam )
pSttStr->Insert( cDelChar, nUChrPos );
pDelTxtNd->EraseText( pStt->nContent, 1 );
- bGroup = TRUE;
- return TRUE;
+ bGroup = sal_True;
+ return sal_True;
}
@@ -541,7 +535,7 @@ static SwRewriter lcl_RewriterFromHistory(SwHistory & rHistory)
bool bDone = false;
- for ( USHORT n = 0; n < rHistory.Count(); n++)
+ for ( sal_uInt16 n = 0; n < rHistory.Count(); n++)
{
String aDescr = rHistory[n]->GetDescription();
@@ -623,14 +617,14 @@ SwRewriter SwUndoDelete::GetRewriter() const
}
// Every object, anchored "AtCntnt" will be reanchored at rPos
-void lcl_ReAnchorAtCntntFlyFrames( const SwSpzFrmFmts& rSpzArr, SwPosition &rPos, ULONG nOldIdx )
+void lcl_ReAnchorAtCntntFlyFrames( const SwSpzFrmFmts& rSpzArr, SwPosition &rPos, sal_uLong nOldIdx )
{
if( rSpzArr.Count() )
{
SwFlyFrmFmt* pFmt;
const SwFmtAnchor* pAnchor;
const SwPosition* pAPos;
- for( USHORT n = 0; n < rSpzArr.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rSpzArr.Count(); ++n )
{
pFmt = (SwFlyFrmFmt*)rSpzArr[n];
pAnchor = &pFmt->GetAnchor();
@@ -648,13 +642,11 @@ void lcl_ReAnchorAtCntntFlyFrames( const SwSpzFrmFmts& rSpzArr, SwPosition &rPos
}
}
-void SwUndoDelete::Undo( SwUndoIter& rUndoIter )
+void SwUndoDelete::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc* pDoc = &rUndoIter.GetDoc();
- BOOL bUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ SwDoc *const pDoc = & rContext.GetDoc();
- ULONG nCalcStt = nSttNode - nNdDiff;
+ sal_uLong nCalcStt = nSttNode - nNdDiff;
if( nSectDiff && bBackSp )
nCalcStt += nSectDiff;
@@ -686,8 +678,7 @@ void SwUndoDelete::Undo( SwUndoIter& rUndoIter )
else
pInsNd = 0; // Node nicht loeschen !!
- SwNodes* pUNds = (SwNodes*)pDoc->GetUndoNds();
- BOOL bNodeMove = 0 != nNode;
+ sal_Bool bNodeMove = 0 != nNode;
if( pEndStr )
{
@@ -702,7 +693,7 @@ void SwUndoDelete::Undo( SwUndoIter& rUndoIter )
if( pSttStr && !bFromTableCopy )
{
- ULONG nOldIdx = aPos.nNode.GetIndex();
+ sal_uLong nOldIdx = aPos.nNode.GetIndex();
pDoc->SplitNode( aPos, false );
// After the split all objects are anchored at the first paragraph,
// but the pHistory of the fly frame formats relies on anchoring at
@@ -726,7 +717,7 @@ void SwUndoDelete::Undo( SwUndoIter& rUndoIter )
{
if( nSttCntnt < pNd->GetTxt().Len() )
{
- ULONG nOldIdx = aPos.nNode.GetIndex();
+ sal_uLong nOldIdx = aPos.nNode.GetIndex();
pDoc->SplitNode( aPos, false );
if( bBackSp )
lcl_ReAnchorAtCntntFlyFrames( *pDoc->GetSpzFrmFmts(), aPos, nOldIdx );
@@ -738,7 +729,7 @@ void SwUndoDelete::Undo( SwUndoIter& rUndoIter )
SwNode* pMovedNode = NULL;
if( nSectDiff )
{
- ULONG nMoveIndex = aPos.nNode.GetIndex();
+ sal_uLong nMoveIndex = aPos.nNode.GetIndex();
int nDiff = 0;
if( bJoinNext )
{
@@ -755,7 +746,7 @@ void SwUndoDelete::Undo( SwUndoIter& rUndoIter )
aPos.nNode--;
if( !bJoinNext )
pMovedNode = &aPos.nNode.GetNode();
- pDoc->GetNodes()._MoveNodes( aRg, pDoc->GetNodes(), aMvIdx, TRUE );
+ pDoc->GetNodes()._MoveNodes( aRg, pDoc->GetNodes(), aMvIdx, sal_True );
aPos.nNode++;
}
@@ -763,11 +754,11 @@ void SwUndoDelete::Undo( SwUndoIter& rUndoIter )
{
SwNodeRange aRange( *pMvStt, 0, *pMvStt, nNode );
SwNodeIndex aCopyIndex( aPos.nNode, -1 );
- pUNds->_Copy( aRange, aPos.nNode );
+ pDoc->GetUndoManager().GetUndoNodes()._Copy( aRange, aPos.nNode );
if( nReplaceDummy )
{
- ULONG nMoveIndex;
+ sal_uLong nMoveIndex;
if( bJoinNext )
{
nMoveIndex = nEndNode - nNdDiff;
@@ -781,7 +772,7 @@ void SwUndoDelete::Undo( SwUndoIter& rUndoIter )
SwNodeIndex aMvIdx( pDoc->GetNodes(), nMoveIndex );
SwNodeRange aRg( aPos.nNode, 0, aPos.nNode, 1 );
pMovedNode = &aPos.nNode.GetNode();
- pDoc->GetNodes()._MoveNodes( aRg, pDoc->GetNodes(), aMvIdx, TRUE );
+ pDoc->GetNodes()._MoveNodes( aRg, pDoc->GetNodes(), aMvIdx, sal_True );
pDoc->GetNodes().Delete( aMvIdx, 1 );
}
}
@@ -838,8 +829,8 @@ void SwUndoDelete::Undo( SwUndoIter& rUndoIter )
if( bResetPgDesc || bResetPgBrk )
{
- USHORT nStt = static_cast<USHORT>( bResetPgDesc ? RES_PAGEDESC : RES_BREAK );
- USHORT nEnd = static_cast<USHORT>( bResetPgBrk ? RES_BREAK : RES_PAGEDESC );
+ sal_uInt16 nStt = static_cast<sal_uInt16>( bResetPgDesc ? RES_PAGEDESC : RES_BREAK );
+ sal_uInt16 nEnd = static_cast<sal_uInt16>( bResetPgBrk ? RES_BREAK : RES_PAGEDESC );
SwNode* pNode = pDoc->GetNodes()[ nEndNode + 1 ];
if( pNode->IsCntntNode() )
@@ -854,22 +845,17 @@ void SwUndoDelete::Undo( SwUndoIter& rUndoIter )
if( pRedlSaveData )
SetSaveData( *pDoc, *pRedlSaveData );
- pDoc->DoUndo( bUndo ); // Undo wieder einschalten
- SetPaM( rUndoIter, TRUE );
+ AddUndoRedoPaM(rContext, true);
}
-void SwUndoDelete::Redo( SwUndoIter& rUndoIter )
+void SwUndoDelete::RedoImpl(::sw::UndoRedoContext & rContext)
{
- rUndoIter.SetUpdateAttr( TRUE );
-
- SwPaM& rPam = *rUndoIter.pAktPam;
+ SwPaM & rPam = AddUndoRedoPaM(rContext);
SwDoc& rDoc = *rPam.GetDoc();
- SetPaM( rPam );
-
if( pRedlSaveData )
{
- bool bSuccess = FillSaveData(rPam, *pRedlSaveData, TRUE);
+ bool bSuccess = FillSaveData(rPam, *pRedlSaveData, sal_True);
OSL_ENSURE(bSuccess,
"SwUndoDelete::Redo: used to have redline data, but now none?");
if (!bSuccess)
@@ -881,7 +867,7 @@ void SwUndoDelete::Redo( SwUndoIter& rUndoIter )
if( !bDelFullPara )
{
SwUndRng aTmpRng( rPam );
- RemoveIdxFromRange( rPam, FALSE );
+ RemoveIdxFromRange( rPam, sal_False );
aTmpRng.SetPaM( rPam );
if( !bJoinNext ) // Dann Selektion von unten nach oben
@@ -947,11 +933,11 @@ void SwUndoDelete::Redo( SwUndoIter& rUndoIter )
const SfxPoolItem *pItem;
if( SFX_ITEM_SET == pTableFmt->GetItemState( RES_PAGEDESC,
- FALSE, &pItem ) )
+ sal_False, &pItem ) )
pNextNd->SetAttr( *pItem );
if( SFX_ITEM_SET == pTableFmt->GetItemState( RES_BREAK,
- FALSE, &pItem ) )
+ sal_False, &pItem ) )
pNextNd->SetAttr( *pItem );
}
pTblNd->DelFrms();
@@ -981,15 +967,16 @@ void SwUndoDelete::Redo( SwUndoIter& rUndoIter )
rDoc.DeleteAndJoin( rPam );
}
-void SwUndoDelete::Repeat( SwUndoIter& rUndoIter )
+void SwUndoDelete::RepeatImpl(::sw::RepeatContext & rContext)
{
- if( UNDO_DELETE == rUndoIter.GetLastUndoId() )
+ // this action does not seem idempotent,
+ // so make sure it is only executed once on repeat
+ if (rContext.m_bDeleteRepeated)
return;
- SwPaM& rPam = *rUndoIter.pAktPam;
+ SwPaM & rPam = rContext.GetRepeatPaM();
SwDoc& rDoc = *rPam.GetDoc();
- BOOL bGroupUndo = rDoc.DoesGroupUndo();
- rDoc.DoGroupUndo( FALSE );
+ ::sw::GroupUndoGuard const undoGuard(rDoc.GetIDocumentUndoRedo());
if( !rPam.HasMark() )
{
rPam.SetMark();
@@ -999,8 +986,7 @@ void SwUndoDelete::Repeat( SwUndoIter& rUndoIter )
rDoc.DelFullPara( rPam );
else
rDoc.DeleteAndJoin( rPam );
- rDoc.DoGroupUndo( bGroupUndo );
- rUndoIter.pLastUndoObj = this;
+ rContext.m_bDeleteRepeated = true;
}
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index 1a71a705b2fb..a5d54b82bfa6 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -29,28 +29,26 @@
#include "precompiled_sw.hxx"
+#include <IShellCursorSupplier.hxx>
#include <txtftn.hxx>
#include <fmtanchr.hxx>
#include <ftnidx.hxx>
#include <frmfmt.hxx>
#include <doc.hxx>
+#include <UndoManager.hxx>
#include <docary.hxx>
#include <swundo.hxx> // fuer die UndoIds
#include <pam.hxx>
#include <ndtxt.hxx>
-#include <undobj.hxx>
+#include <UndoCore.hxx>
#include <rolbck.hxx>
#include <ndnotxt.hxx>
#include <IMark.hxx>
#include <mvsave.hxx>
#include <redline.hxx>
#include <crossrefbookmark.hxx>
-#ifndef _UNDO_HRC
#include <undo.hrc>
-#endif
-#ifndef _COMCORE_HRC
#include <comcore.hrc>
-#endif
#include <docsh.hxx>
class SwRedlineSaveData : public SwUndRng, public SwRedlineData,
@@ -59,35 +57,23 @@ class SwRedlineSaveData : public SwUndRng, public SwRedlineData,
public:
SwRedlineSaveData( SwComparePosition eCmpPos,
const SwPosition& rSttPos, const SwPosition& rEndPos,
- SwRedline& rRedl, BOOL bCopyNext );
+ SwRedline& rRedl, sal_Bool bCopyNext );
~SwRedlineSaveData();
void RedlineToDoc( SwPaM& rPam );
SwNodeIndex* GetMvSttIdx() const
{ return SwUndoSaveSection::GetMvSttIdx(); }
#ifdef DBG_UTIL
- USHORT nRedlineCount;
+ sal_uInt16 nRedlineCount;
#endif
};
-SV_IMPL_PTRARR( SwUndos, SwUndo*)
SV_IMPL_PTRARR( SwRedlineSaveDatas, SwRedlineSaveDataPtr )
-SwUndoIter::SwUndoIter( SwPaM* pPam, SwUndoId nId )
-{
- nUndoId = nId;
- bWeiter = nId ? TRUE : FALSE;
- bUpdateAttr = FALSE;
- pAktPam = pPam;
- nEndCnt = 0;
- pSelFmt = 0;
- pMarkList = 0;
-}
-inline SwDoc& SwUndoIter::GetDoc() const { return *pAktPam->GetDoc(); }
//------------------------------------------------------------
-// Diese Klasse speichert den Pam als USHORT's und kann diese wieder zu
+// Diese Klasse speichert den Pam als sal_uInt16's und kann diese wieder zu
// einem PaM zusammensetzen
SwUndRng::SwUndRng()
@@ -119,7 +105,7 @@ void SwUndRng::SetValues( const SwPaM& rPam )
nSttCntnt = pStt->nContent.GetIndex();
}
-void SwUndRng::SetPaM( SwPaM & rPam, BOOL bCorrToCntnt ) const
+void SwUndRng::SetPaM( SwPaM & rPam, sal_Bool bCorrToCntnt ) const
{
rPam.DeleteMark();
rPam.GetPoint()->nNode = nSttNode;
@@ -147,26 +133,29 @@ void SwUndRng::SetPaM( SwPaM & rPam, BOOL bCorrToCntnt ) const
rPam.GetPoint()->nContent.Assign( 0, 0 );
}
-void SwUndRng::SetPaM( SwUndoIter& rIter, BOOL bCorrToCntnt ) const
+SwPaM & SwUndRng::AddUndoRedoPaM(
+ ::sw::UndoRedoContext & rContext, bool bCorrToCntnt) const
{
- if( rIter.pAktPam )
- SetPaM( *rIter.pAktPam, bCorrToCntnt );
+ SwPaM & rPaM( rContext.GetCursorSupplier().CreateNewShellCursor() );
+ SetPaM( rPaM, bCorrToCntnt );
+ return rPaM;
}
+
//------------------------------------------------------------
-void SwUndo::RemoveIdxFromSection( SwDoc& rDoc, ULONG nSttIdx,
- ULONG* pEndIdx )
+void SwUndo::RemoveIdxFromSection( SwDoc& rDoc, sal_uLong nSttIdx,
+ sal_uLong* pEndIdx )
{
SwNodeIndex aIdx( rDoc.GetNodes(), nSttIdx );
SwNodeIndex aEndIdx( rDoc.GetNodes(), pEndIdx ? *pEndIdx
: aIdx.GetNode().EndOfSectionIndex() );
SwPosition aPos( rDoc.GetNodes().GetEndOfPostIts() );
- rDoc.CorrAbs( aIdx, aEndIdx, aPos, TRUE );
+ rDoc.CorrAbs( aIdx, aEndIdx, aPos, sal_True );
}
-void SwUndo::RemoveIdxFromRange( SwPaM& rPam, BOOL bMoveNext )
+void SwUndo::RemoveIdxFromRange( SwPaM& rPam, sal_Bool bMoveNext )
{
const SwPosition* pEnd = rPam.End();
if( bMoveNext )
@@ -187,13 +176,13 @@ void SwUndo::RemoveIdxFromRange( SwPaM& rPam, BOOL bMoveNext )
}
}
- rPam.GetDoc()->CorrAbs( aStt, aEnd, *rPam.GetPoint(), TRUE );
+ rPam.GetDoc()->CorrAbs( aStt, aEnd, *rPam.GetPoint(), sal_True );
}
else
- rPam.GetDoc()->CorrAbs( rPam, *pEnd, TRUE );
+ rPam.GetDoc()->CorrAbs( rPam, *pEnd, sal_True );
}
-void SwUndo::RemoveIdxRel( ULONG nIdx, const SwPosition& rPos )
+void SwUndo::RemoveIdxRel( sal_uLong nIdx, const SwPosition& rPos )
{
// nur die Crsr verschieben; die Bookmarks/TOXMarks/.. werden vom
// entsp. JoinNext/JoinPrev erledigt!
@@ -201,8 +190,8 @@ void SwUndo::RemoveIdxRel( ULONG nIdx, const SwPosition& rPos )
::PaMCorrRel( aIdx, rPos );
}
-SwUndo::SwUndo( SwUndoId nI )
- : nId(nI), nOrigRedlineMode(nsRedlineMode_t::REDLINE_NONE),
+SwUndo::SwUndo(SwUndoId const nId)
+ : m_nId(nId), nOrigRedlineMode(nsRedlineMode_t::REDLINE_NONE),
bCacheComment(true), pComment(NULL)
{
}
@@ -218,9 +207,89 @@ SwUndo::~SwUndo()
delete pComment;
}
-void SwUndo::Repeat( SwUndoIter& rIter )
+
+class UndoRedoRedlineGuard
+{
+public:
+ UndoRedoRedlineGuard(::sw::UndoRedoContext & rContext, SwUndo & rUndo)
+ : m_rRedlineAccess(rContext.GetDoc())
+ , m_eMode(m_rRedlineAccess.GetRedlineMode())
+ {
+ RedlineMode_t const eTmpMode =
+ static_cast<RedlineMode_t>(rUndo.GetRedlineMode());
+ if ((nsRedlineMode_t::REDLINE_SHOW_MASK & eTmpMode) !=
+ (nsRedlineMode_t::REDLINE_SHOW_MASK & m_eMode))
+ {
+ m_rRedlineAccess.SetRedlineMode( eTmpMode );
+ }
+ m_rRedlineAccess.SetRedlineMode_intern( static_cast<RedlineMode_t>(
+ eTmpMode | nsRedlineMode_t::REDLINE_IGNORE) );
+ }
+ ~UndoRedoRedlineGuard()
+ {
+ m_rRedlineAccess.SetRedlineMode(m_eMode);
+ }
+private:
+ IDocumentRedlineAccess & m_rRedlineAccess;
+ RedlineMode_t const m_eMode;
+};
+
+void SwUndo::Undo()
+{
+ OSL_ENSURE(false, "SwUndo::Undo(): ERROR: must call Undo(context) instead");
+}
+
+void SwUndo::Redo()
+{
+ OSL_ENSURE(false, "SwUndo::Redo(): ERROR: must call Redo(context) instead");
+}
+
+void SwUndo::UndoWithContext(SfxUndoContext & rContext)
+{
+ ::sw::UndoRedoContext *const pContext(
+ dynamic_cast< ::sw::UndoRedoContext * >(& rContext));
+ OSL_ASSERT(pContext);
+ if (!pContext) { return; }
+ UndoRedoRedlineGuard(*pContext, *this);
+ UndoImpl(*pContext);
+}
+
+void SwUndo::RedoWithContext(SfxUndoContext & rContext)
+{
+ ::sw::UndoRedoContext *const pContext(
+ dynamic_cast< ::sw::UndoRedoContext * >(& rContext));
+ OSL_ASSERT(pContext);
+ if (!pContext) { return; }
+ UndoRedoRedlineGuard(*pContext, *this);
+ RedoImpl(*pContext);
+}
+
+void SwUndo::Repeat(SfxRepeatTarget & rContext)
+{
+ ::sw::RepeatContext *const pRepeatContext(
+ dynamic_cast< ::sw::RepeatContext * >(& rContext));
+ OSL_ASSERT(pRepeatContext);
+ if (!pRepeatContext) { return; }
+ RepeatImpl(*pRepeatContext);
+}
+
+sal_Bool SwUndo::CanRepeat(SfxRepeatTarget & rContext) const
+{
+ ::sw::RepeatContext *const pRepeatContext(
+ dynamic_cast< ::sw::RepeatContext * >(& rContext));
+ OSL_ASSERT(pRepeatContext);
+ if (!pRepeatContext) { return false; }
+ return CanRepeatImpl(*pRepeatContext);
+}
+
+void SwUndo::RepeatImpl( ::sw::RepeatContext & )
{
- rIter.pLastUndoObj = this;
+}
+
+bool SwUndo::CanRepeatImpl( ::sw::RepeatContext & ) const
+{
+// return false;
+ return ((REPEAT_START <= GetId()) && (GetId() < REPEAT_END));
}
String SwUndo::GetComment() const
@@ -231,7 +300,7 @@ String SwUndo::GetComment() const
{
if (! pComment)
{
- pComment = new String(SW_RES(UNDO_BASE + nId));
+ pComment = new String(SW_RES(UNDO_BASE + GetId()));
SwRewriter aRewriter = GetRewriter();
@@ -242,7 +311,7 @@ String SwUndo::GetComment() const
}
else
{
- aResult = String(SW_RES(UNDO_BASE + nId));
+ aResult = String(SW_RES(UNDO_BASE + GetId()));
SwRewriter aRewriter = GetRewriter();
@@ -252,11 +321,6 @@ String SwUndo::GetComment() const
return aResult;
}
-SwUndoId SwUndo::GetEffectiveId() const
-{
- return GetId();
-}
-
SwRewriter SwUndo::GetRewriter() const
{
SwRewriter aResult;
@@ -264,6 +328,7 @@ SwRewriter SwUndo::GetRewriter() const
return aResult;
}
+
//------------------------------------------------------------
SwUndoSaveCntnt::SwUndoSaveCntnt()
@@ -286,16 +351,15 @@ SwUndoSaveCntnt::~SwUndoSaveCntnt()
// aufgerufen. Dann soll die gesamte Section verschoben werden.
void SwUndoSaveCntnt::MoveToUndoNds( SwPaM& rPaM, SwNodeIndex* pNodeIdx,
- SwIndex* pCntIdx, ULONG* pEndNdIdx, xub_StrLen* pEndCntIdx )
+ SwIndex* pCntIdx, sal_uLong* pEndNdIdx, xub_StrLen* pEndCntIdx )
{
SwDoc& rDoc = *rPaM.GetDoc();
- BOOL bUndo = rDoc.DoesUndo();
- rDoc.DoUndo( FALSE );
+ ::sw::UndoGuard const undoGuard(rDoc.GetIDocumentUndoRedo());
SwNoTxtNode* pCpyNd = rPaM.GetNode()->GetNoTxtNode();
// jetzt kommt das eigentliche Loeschen(Verschieben)
- SwNodes& rNds = (SwNodes&)*rDoc.GetUndoNds();
+ SwNodes & rNds = rDoc.GetUndoManager().GetUndoNodes();
SwPosition aPos( pEndNdIdx ? rNds.GetEndOfPostIts()
: rNds.GetEndOfExtras() );
aPos.nNode--;
@@ -314,14 +378,14 @@ void SwUndoSaveCntnt::MoveToUndoNds( SwPaM& rPaM, SwNodeIndex* pNodeIdx,
else
aPos.nNode.GetNode().GetCntntNode()->MakeEndIndex( &aPos.nContent );
- // als USHORT merken; die Indizies verschieben sich !!
- ULONG nTmpMvNode = aPos.nNode.GetIndex();
+ // als sal_uInt16 merken; die Indizies verschieben sich !!
+ sal_uLong nTmpMvNode = aPos.nNode.GetIndex();
xub_StrLen nTmpMvCntnt = aPos.nContent.GetIndex();
if( pCpyNd || pEndNdIdx )
{
SwNodeRange aRg( pStt->nNode, 0, pEnd->nNode, 1 );
- rDoc.GetNodes()._MoveNodes( aRg, rNds, aPos.nNode, FALSE );
+ rDoc.GetNodes()._MoveNodes( aRg, rNds, aPos.nNode, sal_False );
aPos.nContent = 0;
aPos.nNode--;
}
@@ -371,21 +435,18 @@ void SwUndoSaveCntnt::MoveToUndoNds( SwPaM& rPaM, SwNodeIndex* pNodeIdx,
else
pCntIdx->Assign( 0, 0 );
}
-
- rDoc.DoUndo( bUndo );
}
-void SwUndoSaveCntnt::MoveFromUndoNds( SwDoc& rDoc, ULONG nNodeIdx,
+void SwUndoSaveCntnt::MoveFromUndoNds( SwDoc& rDoc, sal_uLong nNodeIdx,
xub_StrLen nCntIdx, SwPosition& rInsPos,
- ULONG* pEndNdIdx, xub_StrLen* pEndCntIdx )
+ sal_uLong* pEndNdIdx, xub_StrLen* pEndCntIdx )
{
// jetzt kommt das wiederherstellen
- SwNodes& rNds = (SwNodes&)*rDoc.GetUndoNds();
+ SwNodes & rNds = rDoc.GetUndoManager().GetUndoNodes();
if( nNodeIdx == rNds.GetEndOfPostIts().GetIndex() )
return; // nichts gespeichert
- BOOL bUndo = rDoc.DoesUndo();
- rDoc.DoUndo( FALSE );
+ ::sw::UndoGuard const undoGuard(rDoc.GetIDocumentUndoRedo());
SwPaM aPaM( rInsPos );
if( pEndNdIdx ) // dann hole aus diesem den Bereich
@@ -438,10 +499,8 @@ void SwUndoSaveCntnt::MoveFromUndoNds( SwDoc& rDoc, ULONG nNodeIdx,
}
else {
- ASSERT( FALSE, "was ist es denn nun?" );
+ ASSERT( sal_False, "was ist es denn nun?" );
}
-
- rDoc.DoUndo( bUndo );
}
// diese beiden Methoden bewegen den Point vom Pam zurueck/vor. Damit
@@ -449,21 +508,21 @@ void SwUndoSaveCntnt::MoveFromUndoNds( SwDoc& rDoc, ULONG nNodeIdx,
// Point liegt dann vor dem manipuliertem Bereich !!)
// Das Flag gibt an, ob noch vorm Point Inhalt steht.
-BOOL SwUndoSaveCntnt::MovePtBackward( SwPaM& rPam )
+sal_Bool SwUndoSaveCntnt::MovePtBackward( SwPaM& rPam )
{
rPam.SetMark();
if( rPam.Move( fnMoveBackward ))
- return TRUE;
+ return sal_True;
// gibt es nach vorne keinen Inhalt mehr, so setze den Point einfach
// auf die vorherige Position (Node und Content, damit der Content
// abgemeldet wird !!)
rPam.GetPoint()->nNode--;
rPam.GetPoint()->nContent.Assign( 0, 0 );
- return FALSE;
+ return sal_False;
}
-void SwUndoSaveCntnt::MovePtForward( SwPaM& rPam, BOOL bMvBkwrd )
+void SwUndoSaveCntnt::MovePtForward( SwPaM& rPam, sal_Bool bMvBkwrd )
{
// gab es noch Inhalt vor der Position ?
if( bMvBkwrd )
@@ -501,8 +560,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
SwDoc* pDoc = rMark.nNode.GetNode().GetDoc();
- BOOL bDoesUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
// 1. Fussnoten
if( nsDelCntntType::DELCNT_FTN & nDelCntntType )
@@ -511,7 +569,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
if( rFtnArr.Count() )
{
const SwNode* pFtnNd;
- USHORT nPos;
+ sal_uInt16 nPos;
rFtnArr.SeekEntry( pStt->nNode, &nPos );
SwTxtFtn* pSrch;
@@ -574,14 +632,14 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
// 2. Flys
if( nsDelCntntType::DELCNT_FLY & nDelCntntType )
{
- USHORT nChainInsPos = pHistory ? pHistory->Count() : 0;
+ sal_uInt16 nChainInsPos = pHistory ? pHistory->Count() : 0;
const SwSpzFrmFmts& rSpzArr = *pDoc->GetSpzFrmFmts();
if( rSpzArr.Count() )
{
- const BOOL bDelFwrd = rMark.nNode.GetIndex() <= rPoint.nNode.GetIndex();
+ const sal_Bool bDelFwrd = rMark.nNode.GetIndex() <= rPoint.nNode.GetIndex();
SwFlyFrmFmt* pFmt;
const SwFmtAnchor* pAnchor;
- USHORT n = rSpzArr.Count();
+ sal_uInt16 n = rSpzArr.Count();
const SwPosition* pAPos;
while( n && rSpzArr.Count() )
@@ -599,7 +657,8 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
{
if( !pHistory )
pHistory = new SwHistory;
- SwTxtNode* pTxtNd = pDoc->GetNodes()[ pAPos->nNode]->GetTxtNode();
+ SwTxtNode *const pTxtNd =
+ pAPos->nNode.GetNode().GetTxtNode();
SwTxtAttr* const pFlyHnt = pTxtNd->GetTxtAttrForCharAt(
pAPos->nContent.GetIndex());
ASSERT( pFlyHnt, "kein FlyAttribut" );
@@ -714,7 +773,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
if( pMarkAccess->getMarksCount() )
{
- for( USHORT n = 0; n < pMarkAccess->getMarksCount(); ++n )
+ for( sal_uInt16 n = 0; n < pMarkAccess->getMarksCount(); ++n )
{
// --> OD 2007-10-17 #i81002#
bool bSavePos = false;
@@ -813,8 +872,6 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
}
}
}
-
- pDoc->DoUndo( bDoesUndo );
}
@@ -853,7 +910,7 @@ void SwUndoSaveSection::SaveSection( SwDoc* , const SwNodeRange& rRange )
DelCntntIndex( *aPam.GetMark(), *aPam.GetPoint() );
pRedlSaveData = new SwRedlineSaveDatas;
- if( !SwUndo::FillSaveData( aPam, *pRedlSaveData, TRUE, TRUE ))
+ if( !SwUndo::FillSaveData( aPam, *pRedlSaveData, sal_True, sal_True ))
delete pRedlSaveData, pRedlSaveData = 0;
nStartPos = rRange.aStart.GetIndex();
@@ -861,29 +918,29 @@ void SwUndoSaveSection::SaveSection( SwDoc* , const SwNodeRange& rRange )
aPam.GetPoint()->nNode--;
aPam.GetMark()->nNode++;
- SwCntntNode* pCNd = aPam.GetCntntNode( FALSE );
+ SwCntntNode* pCNd = aPam.GetCntntNode( sal_False );
if( pCNd )
aPam.GetMark()->nContent.Assign( pCNd, 0 );
- if( 0 != ( pCNd = aPam.GetCntntNode( TRUE )) )
+ if( 0 != ( pCNd = aPam.GetCntntNode( sal_True )) )
aPam.GetPoint()->nContent.Assign( pCNd, pCNd->Len() );
// Positionen als SwIndex merken, damit im DTOR dieser Bereich
// entfernt werden kann !!
- ULONG nEnd;
+ sal_uLong nEnd;
pMvStt = new SwNodeIndex( rRange.aStart );
MoveToUndoNds( aPam, pMvStt, 0, &nEnd, 0 );
nMvLen = nEnd - pMvStt->GetIndex() + 1;
}
void SwUndoSaveSection::RestoreSection( SwDoc* pDoc, SwNodeIndex* pIdx,
- USHORT nSectType )
+ sal_uInt16 nSectType )
{
if( ULONG_MAX != nStartPos ) // gab es ueberhaupt Inhalt ?
{
// ueberpruefe, ob der Inhalt an der alten Position steht
SwNodeIndex aSttIdx( pDoc->GetNodes(), nStartPos );
- ASSERT( !pDoc->GetNodes()[ aSttIdx ]->GetCntntNode(),
- "Position in irgendeiner Section" );
+ OSL_ENSURE(!aSttIdx.GetNode().GetCntntNode(),
+ "RestoreSection(): Position on content node");
// move den Inhalt aus dem UndoNodes-Array in den Fly
SwStartNode* pSttNd = pDoc->GetNodes().MakeEmptySection( aSttIdx,
@@ -901,7 +958,7 @@ void SwUndoSaveSection::RestoreSection( SwDoc* pDoc, const SwNodeIndex& rInsPos
if( ULONG_MAX != nStartPos ) // gab es ueberhaupt Inhalt ?
{
SwPosition aInsPos( rInsPos );
- ULONG nEnd = pMvStt->GetIndex() + nMvLen - 1;
+ sal_uLong nEnd = pMvStt->GetIndex() + nMvLen - 1;
MoveFromUndoNds( *pDoc, pMvStt->GetIndex(), 0, aInsPos, &nEnd, 0 );
// Indizies wieder zerstoren, Inhalt ist aus dem UndoNodes-Array
@@ -917,135 +974,13 @@ void SwUndoSaveSection::RestoreSection( SwDoc* pDoc, const SwNodeIndex& rInsPos
}
}
-// START
-SwUndoStart::SwUndoStart( SwUndoId nInitId )
- : SwUndo( UNDO_START ), nUserId( nInitId ), nEndOffset( 0 )
-{
-}
-
-void SwUndoStart::Undo( SwUndoIter& rUndoIter )
-{
- if( !( --rUndoIter.nEndCnt ) && rUndoIter.bWeiter &&
- ( rUndoIter.GetId() ? ( rUndoIter.GetId() == nUserId ||
- ( UNDO_END == rUndoIter.GetId() && UNDO_START == GetId() )) : TRUE ))
- rUndoIter.bWeiter = FALSE;
-}
-
-void SwUndoStart::Redo( SwUndoIter& rUndoIter )
-{
- rUndoIter.bWeiter = TRUE;
- ++rUndoIter.nEndCnt;
-}
-
-void SwUndoStart::Repeat( SwUndoIter& rUndoIter )
-{
- rUndoIter.bWeiter = FALSE;
-}
-
-String SwUndoStart::GetComment() const
-{
- String sResult;
-
- switch (nUserId)
- {
- case UNDO_START:
- case UNDO_END:
- sResult = String("??", RTL_TEXTENCODING_ASCII_US);
-
- break;
-
- default:
- sResult = String(SW_RES(UNDO_BASE + nUserId));
- sResult = GetRewriter().Apply(sResult);
- }
-
- return sResult;
-}
-
-SwRewriter SwUndoStart::GetRewriter() const
-{
- return mRewriter;
-}
-
-SwUndoId SwUndoStart::GetEffectiveId() const
-{
- return GetUserId();
-}
-
-void SwUndoStart::SetRewriter(const SwRewriter & rRewriter)
-{
- mRewriter = rRewriter;
-}
-
-// END
-SwUndoEnd::SwUndoEnd( SwUndoId nInitId )
- : SwUndo( UNDO_END ), nUserId( nInitId ), nSttOffset( 0 )
-{
-}
-
-void SwUndoEnd::Undo( SwUndoIter& rUndoIter )
-{
- if( rUndoIter.GetId() == GetId() || !rUndoIter.GetId() )
- rUndoIter.bWeiter = TRUE;
- if( rUndoIter.bWeiter )
- ++rUndoIter.nEndCnt;
-}
-
-void SwUndoEnd::Redo( SwUndoIter& rUndoIter )
-{
- if( !( --rUndoIter.nEndCnt ) && rUndoIter.bWeiter &&
- ( rUndoIter.GetId() ? ( rUndoIter.GetId() == nUserId ||
- ( UNDO_END == rUndoIter.GetId() && UNDO_START == GetId() )) : TRUE ))
- rUndoIter.bWeiter = FALSE;
-}
-
-void SwUndoEnd::Repeat( SwUndoIter& rUndoIter )
-{
- rUndoIter.bWeiter = FALSE;
-}
-
-String SwUndoEnd::GetComment() const
-{
- String sResult;
-
- switch (nUserId)
- {
- case UNDO_START:
- case UNDO_END:
- sResult = String("??", RTL_TEXTENCODING_ASCII_US);
-
- break;
- default:
- sResult = SW_RES(UNDO_BASE + nUserId);
- sResult = GetRewriter().Apply(sResult);
- }
-
- return sResult;
-}
-
-void SwUndoEnd::SetRewriter(const SwRewriter & rRewriter)
-{
- mRewriter = rRewriter;
-}
-
-SwUndoId SwUndoEnd::GetEffectiveId() const
-{
- return GetUserId();
-}
-
-SwRewriter SwUndoEnd::GetRewriter() const
-{
- return mRewriter;
-}
-
-/* */
// sicher und setze die RedlineDaten
SwRedlineSaveData::SwRedlineSaveData( SwComparePosition eCmpPos,
const SwPosition& rSttPos,
const SwPosition& rEndPos,
SwRedline& rRedl,
- BOOL bCopyNext )
+ sal_Bool bCopyNext )
: SwUndRng( rRedl ),
SwRedlineData( rRedl.GetRedlineData(), bCopyNext )
{
@@ -1129,8 +1064,8 @@ void SwRedlineSaveData::RedlineToDoc( SwPaM& rPam )
rDoc.SetRedlineMode_intern( eOld );
}
-BOOL SwUndo::FillSaveData( const SwPaM& rRange, SwRedlineSaveDatas& rSData,
- BOOL bDelRange, BOOL bCopyNext )
+sal_Bool SwUndo::FillSaveData( const SwPaM& rRange, SwRedlineSaveDatas& rSData,
+ sal_Bool bDelRange, sal_Bool bCopyNext )
{
if( rSData.Count() )
rSData.DeleteAndDestroy( 0, rSData.Count() );
@@ -1138,7 +1073,7 @@ BOOL SwUndo::FillSaveData( const SwPaM& rRange, SwRedlineSaveDatas& rSData,
SwRedlineSaveData* pNewData;
const SwPosition *pStt = rRange.Start(), *pEnd = rRange.End();
const SwRedlineTbl& rTbl = rRange.GetDoc()->GetRedlineTbl();
- USHORT n = 0;
+ sal_uInt16 n = 0;
rRange.GetDoc()->GetRedline( *pStt, &n );
for( ; n < rTbl.Count(); ++n )
{
@@ -1159,7 +1094,7 @@ BOOL SwUndo::FillSaveData( const SwPaM& rRange, SwRedlineSaveDatas& rSData,
return 0 != rSData.Count();
}
-BOOL SwUndo::FillSaveDataForFmt( const SwPaM& rRange, SwRedlineSaveDatas& rSData )
+sal_Bool SwUndo::FillSaveDataForFmt( const SwPaM& rRange, SwRedlineSaveDatas& rSData )
{
if( rSData.Count() )
rSData.DeleteAndDestroy( 0, rSData.Count() );
@@ -1167,7 +1102,7 @@ BOOL SwUndo::FillSaveDataForFmt( const SwPaM& rRange, SwRedlineSaveDatas& rSData
SwRedlineSaveData* pNewData;
const SwPosition *pStt = rRange.Start(), *pEnd = rRange.End();
const SwRedlineTbl& rTbl = rRange.GetDoc()->GetRedlineTbl();
- USHORT n = 0;
+ sal_uInt16 n = 0;
rRange.GetDoc()->GetRedline( *pStt, &n );
for( ; n < rTbl.Count(); ++n )
{
@@ -1181,7 +1116,7 @@ BOOL SwUndo::FillSaveDataForFmt( const SwPaM& rRange, SwRedlineSaveDatas& rSData
POS_COLLIDE_END != eCmpPos && POS_COLLIDE_START != eCmpPos )
{
pNewData = new SwRedlineSaveData( eCmpPos, *pStt, *pEnd,
- *pRedl, TRUE );
+ *pRedl, sal_True );
rSData.Insert( pNewData, rSData.Count() );
}
@@ -1197,7 +1132,7 @@ void SwUndo::SetSaveData( SwDoc& rDoc, const SwRedlineSaveDatas& rSData )
rDoc.SetRedlineMode_intern( (RedlineMode_t)(( eOld & ~nsRedlineMode_t::REDLINE_IGNORE) | nsRedlineMode_t::REDLINE_ON ));
SwPaM aPam( rDoc.GetNodes().GetEndOfContent() );
- for( USHORT n = rSData.Count(); n; )
+ for( sal_uInt16 n = rSData.Count(); n; )
rSData[ --n ]->RedlineToDoc( aPam );
// check redline count against count saved in RedlineSaveData object
@@ -1208,23 +1143,23 @@ void SwUndo::SetSaveData( SwDoc& rDoc, const SwRedlineSaveDatas& rSData )
rDoc.SetRedlineMode_intern( eOld );
}
-BOOL SwUndo::HasHiddenRedlines( const SwRedlineSaveDatas& rSData )
+sal_Bool SwUndo::HasHiddenRedlines( const SwRedlineSaveDatas& rSData )
{
- for( USHORT n = rSData.Count(); n; )
+ for( sal_uInt16 n = rSData.Count(); n; )
if( rSData[ --n ]->GetMvSttIdx() )
- return TRUE;
- return FALSE;
+ return sal_True;
+ return sal_False;
}
-BOOL SwUndo::CanRedlineGroup( SwRedlineSaveDatas& rCurr,
- const SwRedlineSaveDatas& rCheck, BOOL bCurrIsEnd )
+sal_Bool SwUndo::CanRedlineGroup( SwRedlineSaveDatas& rCurr,
+ const SwRedlineSaveDatas& rCheck, sal_Bool bCurrIsEnd )
{
- BOOL bRet = FALSE;
- USHORT n;
+ sal_Bool bRet = sal_False;
+ sal_uInt16 n;
if( rCurr.Count() == rCheck.Count() )
{
- bRet = TRUE;
+ bRet = sal_True;
for( n = 0; n < rCurr.Count(); ++n )
{
const SwRedlineSaveData& rSet = *rCurr[ n ];
@@ -1235,7 +1170,7 @@ BOOL SwUndo::CanRedlineGroup( SwRedlineSaveDatas& rCurr,
: rSet.nEndCntnt != rGet.nSttCntnt ) ||
!rGet.CanCombine( rSet ) )
{
- bRet = FALSE;
+ bRet = sal_False;
break;
}
}
diff --git a/sw/source/core/undo/undobj1.cxx b/sw/source/core/undo/undobj1.cxx
index 5bb97370b674..7a4abe803bde 100644
--- a/sw/source/core/undo/undobj1.cxx
+++ b/sw/source/core/undo/undobj1.cxx
@@ -28,16 +28,18 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <svl/itemiter.hxx>
#include <hintids.hxx>
-#include <svl/itemiter.hxx>
+#include <hints.hxx>
#include <fmtflcnt.hxx>
#include <fmtanchr.hxx>
#include <fmtcntnt.hxx>
#include <txtflcnt.hxx>
#include <frmfmt.hxx>
#include <flyfrm.hxx>
-#include <undobj.hxx>
+#include <UndoCore.hxx>
+#include <UndoDraw.hxx>
#include <rolbck.hxx> // fuer die Attribut History
#include <doc.hxx>
#include <docary.hxx>
@@ -49,10 +51,9 @@
#include <dcontact.hxx>
#include <ndole.hxx>
-// Inline Methode vom UndoIter
-inline SwDoc& SwUndoIter::GetDoc() const { return *pAktPam->GetDoc(); }
//---------------------------------------------------------------------
+// SwUndoLayBase /////////////////////////////////////////////////////////
SwUndoFlyBase::SwUndoFlyBase( SwFrmFmt* pFormat, SwUndoId nUndoId )
: SwUndo( nUndoId ), pFrmFmt( pFormat )
@@ -65,9 +66,9 @@ SwUndoFlyBase::~SwUndoFlyBase()
delete pFrmFmt;
}
-void SwUndoFlyBase::InsFly( SwUndoIter& rUndoIter, BOOL bShowSelFrm )
+void SwUndoFlyBase::InsFly(::sw::UndoRedoContext & rContext, bool bShowSelFrm)
{
- SwDoc* pDoc = &rUndoIter.GetDoc();
+ SwDoc *const pDoc = & rContext.GetDoc();
// ins Array wieder eintragen
SwSpzFrmFmts& rFlyFmts = *(SwSpzFrmFmts*)pDoc->GetSpzFrmFmts();
@@ -92,11 +93,11 @@ void SwUndoFlyBase::InsFly( SwUndoIter& rUndoIter, BOOL bShowSelFrm )
if (FLY_AT_PAGE == nRndId)
{
- aAnchor.SetPageNum( (USHORT)nNdPgPos );
+ aAnchor.SetPageNum( (sal_uInt16)nNdPgPos );
}
else
{
- SwPosition aNewPos( *rUndoIter.pAktPam->GetPoint() );
+ SwPosition aNewPos(pDoc->GetNodes().GetEndOfContent());
aNewPos.nNode = nNdPgPos;
if ((FLY_AS_CHAR == nRndId) || (FLY_AT_CHAR == nRndId))
{
@@ -132,7 +133,9 @@ void SwUndoFlyBase::InsFly( SwUndoIter& rUndoIter, BOOL bShowSelFrm )
pFrmFmt->MakeFrms();
if( bShowSelFrm )
- rUndoIter.pSelFmt = pFrmFmt;
+ {
+ rContext.SetSelections(pFrmFmt, 0);
+ }
if( GetHistory() )
GetHistory()->Rollback( pDoc );
@@ -157,12 +160,12 @@ void SwUndoFlyBase::InsFly( SwUndoIter& rUndoIter, BOOL bShowSelFrm )
case FLY_AT_PAGE:
break;
}
- bDelFmt = FALSE;
+ bDelFmt = sal_False;
}
void SwUndoFlyBase::DelFly( SwDoc* pDoc )
{
- bDelFmt = TRUE; // im DTOR das Format loeschen
+ bDelFmt = sal_True; // im DTOR das Format loeschen
pFrmFmt->DelFrms(); // Frms vernichten.
// alle Uno-Objecte sollten sich jetzt abmelden
@@ -194,13 +197,13 @@ void SwUndoFlyBase::DelFly( SwDoc* pDoc )
const SwFmtAnchor& rAnchor = pFrmFmt->GetAnchor();
const SwPosition* pPos = rAnchor.GetCntntAnchor();
// die Positionen im Nodes-Array haben sich verschoben
- nRndId = static_cast<USHORT>(rAnchor.GetAnchorId());
+ nRndId = static_cast<sal_uInt16>(rAnchor.GetAnchorId());
if (FLY_AS_CHAR == nRndId)
{
nNdPgPos = pPos->nNode.GetIndex();
nCntPos = pPos->nContent.GetIndex();
- SwTxtNode *pTxtNd = pDoc->GetNodes()[ pPos->nNode ]->GetTxtNode();
- ASSERT( pTxtNd, "Kein Textnode gefunden" );
+ SwTxtNode *const pTxtNd = pPos->nNode.GetNode().GetTxtNode();
+ OSL_ENSURE(pTxtNd, "no Textnode");
SwTxtFlyCnt* const pAttr = static_cast<SwTxtFlyCnt*>(
pTxtNd->GetTxtAttrForCharAt( nCntPos, RES_TXTATR_FLYCNT ) );
// Attribut steht noch im TextNode, loeschen
@@ -234,16 +237,16 @@ void SwUndoFlyBase::DelFly( SwDoc* pDoc )
rFlyFmts.Remove( rFlyFmts.GetPos( pFrmFmt ));
}
-// ----- Undo-InsertFly ------
+// SwUndoInsLayFmt ///////////////////////////////////////////////////////
-SwUndoInsLayFmt::SwUndoInsLayFmt( SwFrmFmt* pFormat, ULONG nNodeIdx, xub_StrLen nCntIdx )
+SwUndoInsLayFmt::SwUndoInsLayFmt( SwFrmFmt* pFormat, sal_uLong nNodeIdx, xub_StrLen nCntIdx )
: SwUndoFlyBase( pFormat, RES_DRAWFRMFMT == pFormat->Which() ?
UNDO_INSDRAWFMT : UNDO_INSLAYFMT ),
mnCrsrSaveIndexPara( nNodeIdx ), mnCrsrSaveIndexPos( nCntIdx )
{
const SwFmtAnchor& rAnchor = pFrmFmt->GetAnchor();
- nRndId = static_cast<USHORT>(rAnchor.GetAnchorId());
- bDelFmt = FALSE;
+ nRndId = static_cast<sal_uInt16>(rAnchor.GetAnchorId());
+ bDelFmt = sal_False;
switch( nRndId )
{
case FLY_AT_PAGE:
@@ -262,7 +265,7 @@ SwUndoInsLayFmt::SwUndoInsLayFmt( SwFrmFmt* pFormat, ULONG nNodeIdx, xub_StrLen
}
break;
default:
- ASSERT( FALSE, "Was denn fuer ein FlyFrame?" );
+ ASSERT( sal_False, "Was denn fuer ein FlyFrame?" );
}
}
@@ -270,52 +273,52 @@ SwUndoInsLayFmt::~SwUndoInsLayFmt()
{
}
-void SwUndoInsLayFmt::Undo( SwUndoIter& rUndoIter )
+void SwUndoInsLayFmt::UndoImpl(::sw::UndoRedoContext & rContext)
{
+ SwDoc & rDoc(rContext.GetDoc());
const SwFmtCntnt& rCntnt = pFrmFmt->GetCntnt();
if( rCntnt.GetCntntIdx() ) // kein Inhalt
{
bool bRemoveIdx = true;
if( mnCrsrSaveIndexPara > 0 )
{
- SwTxtNode *pNode = rUndoIter.GetDoc().GetNodes()[mnCrsrSaveIndexPara]->GetTxtNode();
+ SwTxtNode *const pNode =
+ rDoc.GetNodes()[mnCrsrSaveIndexPara]->GetTxtNode();
if( pNode )
{
- SwNodeIndex aIdx( rUndoIter.GetDoc().GetNodes(), rCntnt.GetCntntIdx()->GetIndex() );
- SwNodeIndex aEndIdx( rUndoIter.GetDoc().GetNodes(), aIdx.GetNode().EndOfSectionIndex() );
+ SwNodeIndex aIdx( rDoc.GetNodes(),
+ rCntnt.GetCntntIdx()->GetIndex() );
+ SwNodeIndex aEndIdx( rDoc.GetNodes(),
+ aIdx.GetNode().EndOfSectionIndex() );
SwIndex aIndex( pNode, mnCrsrSaveIndexPos );
SwPosition aPos( *pNode, aIndex );
- rUndoIter.GetDoc().CorrAbs( aIdx, aEndIdx, aPos, TRUE );
+ rDoc.CorrAbs( aIdx, aEndIdx, aPos, sal_True );
bRemoveIdx = false;
}
}
if( bRemoveIdx )
- RemoveIdxFromSection( rUndoIter.GetDoc(),
- rCntnt.GetCntntIdx()->GetIndex() );
+ {
+ RemoveIdxFromSection( rDoc, rCntnt.GetCntntIdx()->GetIndex() );
+ }
}
- DelFly( &rUndoIter.GetDoc() );
+ DelFly(& rDoc);
}
-void SwUndoInsLayFmt::Redo( SwUndoIter& rUndoIter )
+void SwUndoInsLayFmt::RedoImpl(::sw::UndoRedoContext & rContext)
{
- rUndoIter.pLastUndoObj = 0;
- InsFly( rUndoIter );
+ InsFly(rContext);
}
-void SwUndoInsLayFmt::Repeat( SwUndoIter& rUndoIter )
+void SwUndoInsLayFmt::RepeatImpl(::sw::RepeatContext & rContext)
{
- if( UNDO_INSLAYFMT == rUndoIter.GetLastUndoId() &&
- pFrmFmt == ((SwUndoInsLayFmt*)rUndoIter.pLastUndoObj)->pFrmFmt )
- return;
-
- SwDoc* pDoc = &rUndoIter.GetDoc();
+ SwDoc *const pDoc = & rContext.GetDoc();
// erfrage und setze den Anker neu
SwFmtAnchor aAnchor( pFrmFmt->GetAnchor() );
if ((FLY_AT_PARA == aAnchor.GetAnchorId()) ||
(FLY_AT_CHAR == aAnchor.GetAnchorId()) ||
(FLY_AS_CHAR == aAnchor.GetAnchorId()))
{
- SwPosition aPos( *rUndoIter.pAktPam->GetPoint() );
+ SwPosition aPos( *rContext.GetRepeatPaM().GetPoint() );
if (FLY_AT_PARA == aAnchor.GetAnchorId())
{
aPos.nContent.Assign( 0, 0 );
@@ -324,7 +327,8 @@ void SwUndoInsLayFmt::Repeat( SwUndoIter& rUndoIter )
}
else if( FLY_AT_FLY == aAnchor.GetAnchorId() )
{
- const SwStartNode* pSttNd = rUndoIter.pAktPam->GetNode()->FindFlyStartNode();
+ SwStartNode const*const pSttNd =
+ rContext.GetRepeatPaM().GetNode()->FindFlyStartNode();
if( pSttNd )
{
SwPosition aPos( *pSttNd );
@@ -332,22 +336,27 @@ void SwUndoInsLayFmt::Repeat( SwUndoIter& rUndoIter )
}
else
{
- rUndoIter.pLastUndoObj = this;
return ;
}
}
else if (FLY_AT_PAGE == aAnchor.GetAnchorId())
{
+<<<<<<< local
aAnchor.SetPageNum( pDoc->GetCurrentLayout()->GetCurrPage( rUndoIter.pAktPam ));
}
+=======
+ aAnchor.SetPageNum(
+ pDoc->GetRootFrm()->GetCurrPage(& rContext.GetRepeatPaM()) );
+ }
+>>>>>>> other
else {
- ASSERT( FALSE, "was fuer ein Anker ist es denn nun?" );
+ ASSERT( sal_False, "was fuer ein Anker ist es denn nun?" );
}
SwFrmFmt* pFlyFmt = pDoc->CopyLayoutFmt( *pFrmFmt, aAnchor, true, true );
- rUndoIter.pSelFmt = pFlyFmt;
-
- rUndoIter.pLastUndoObj = this;
+ (void) pFlyFmt;
+//FIXME nobody ever did anything with this selection:
+// rContext.SetSelections(pFlyFmt, 0);
}
// #111827#
@@ -355,7 +364,12 @@ String SwUndoInsLayFmt::GetComment() const
{
String aResult;
- if (! pComment)
+ // HACK: disable caching:
+ // the SfxUndoManager calls GetComment() too early: the pFrmFmt does not
+ // have a SwDrawContact yet, so it will fall back to SwUndo::GetComment(),
+ // which sets pComment to a wrong value.
+// if (! pComment)
+ if (true)
{
/*
If frame format is present and has an SdrObject use the undo
@@ -382,28 +396,37 @@ String SwUndoInsLayFmt::GetComment() const
return aResult;
}
-// ----- Undo-DeleteFly ------
+// SwUndoDelLayFmt ///////////////////////////////////////////////////////
-SwUndoDelLayFmt::SwUndoDelLayFmt( SwFrmFmt* pFormat )
- : SwUndoFlyBase( pFormat, UNDO_DELLAYFMT ), bShowSelFrm( TRUE )
+static SwUndoId
+lcl_GetSwUndoId(SwFrmFmt *const pFrmFmt)
{
- SwDoc* pDoc = pFormat->GetDoc();
- DelFly( pDoc );
-
- SwNodeIndex* pIdx = GetMvSttIdx();
- SwNode* pNd;
- if( 1 == GetMvNodeCnt() && pIdx &&
- ( pNd = (*pDoc->GetUndoNds())[ *pIdx ] )->IsNoTxtNode() )
+ if (RES_DRAWFRMFMT != pFrmFmt->Which())
{
- // dann setze eine andere Undo-ID; Grafik oder OLE
- if( pNd->IsGrfNode() )
- SetId( UNDO_DELGRF );
- else if( pNd->IsOLENode() )
- {
- SetId( UNDO_DELETE );
+ const SwFmtCntnt& rCntnt = pFrmFmt->GetCntnt();
+ OSL_ENSURE( rCntnt.GetCntntIdx(), "Fly without content" );
+ SwNodeIndex firstNode(*rCntnt.GetCntntIdx(), 1);
+ SwNoTxtNode *const pNoTxtNode(firstNode.GetNode().GetNoTxtNode());
+ if (pNoTxtNode && pNoTxtNode->IsGrfNode())
+ {
+ return UNDO_DELGRF;
+ }
+ else if (pNoTxtNode && pNoTxtNode->IsOLENode())
+ {
+ // surprisingly not UNDO_DELOLE, which does not seem to work
+ return UNDO_DELETE;
}
}
+ return UNDO_DELLAYFMT;
+}
+
+SwUndoDelLayFmt::SwUndoDelLayFmt( SwFrmFmt* pFormat )
+ : SwUndoFlyBase( pFormat, lcl_GetSwUndoId(pFormat) )
+ , bShowSelFrm( sal_True )
+{
+ SwDoc* pDoc = pFormat->GetDoc();
+ DelFly( pDoc );
}
SwRewriter SwUndoDelLayFmt::GetRewriter() const
@@ -417,7 +440,7 @@ SwRewriter SwUndoDelLayFmt::GetRewriter() const
SwNodeIndex* pIdx = GetMvSttIdx();
if( 1 == GetMvNodeCnt() && pIdx)
{
- SwNode * pNd = (*pDoc->GetUndoNds())[ *pIdx ];
+ SwNode *const pNd = & pIdx->GetNode();
if ( pNd->IsNoTxtNode() && pNd->IsOLENode())
{
@@ -431,22 +454,24 @@ SwRewriter SwUndoDelLayFmt::GetRewriter() const
return aRewriter;
}
-void SwUndoDelLayFmt::Undo( SwUndoIter& rUndoIter )
+void SwUndoDelLayFmt::UndoImpl(::sw::UndoRedoContext & rContext)
{
- InsFly( rUndoIter, bShowSelFrm );
+ InsFly( rContext, bShowSelFrm );
}
-void SwUndoDelLayFmt::Redo( SwUndoIter& rUndoIter )
+void SwUndoDelLayFmt::RedoImpl(::sw::UndoRedoContext & rContext)
{
+ SwDoc & rDoc(rContext.GetDoc());
const SwFmtCntnt& rCntnt = pFrmFmt->GetCntnt();
if( rCntnt.GetCntntIdx() ) // kein Inhalt
- RemoveIdxFromSection( rUndoIter.GetDoc(),
- rCntnt.GetCntntIdx()->GetIndex() );
+ {
+ RemoveIdxFromSection(rDoc, rCntnt.GetCntntIdx()->GetIndex());
+ }
- DelFly( &rUndoIter.GetDoc() );
+ DelFly(& rDoc);
}
-void SwUndoDelLayFmt::Redo()
+void SwUndoDelLayFmt::RedoForRollback()
{
const SwFmtCntnt& rCntnt = pFrmFmt->GetCntnt();
if( rCntnt.GetCntntIdx() ) // kein Inhalt
@@ -456,7 +481,7 @@ void SwUndoDelLayFmt::Redo()
DelFly( pFrmFmt->GetDoc() );
}
-/* */
+// SwUndoSetFlyFmt ///////////////////////////////////////////////////////
SwUndoSetFlyFmt::SwUndoSetFlyFmt( SwFrmFmt& rFlyFmt, SwFrmFmt& rNewFrmFmt )
: SwUndo( UNDO_SETFLYFRMFMT ), SwClient( &rFlyFmt ), pFrmFmt( &rFlyFmt ),
@@ -465,7 +490,7 @@ SwUndoSetFlyFmt::SwUndoSetFlyFmt( SwFrmFmt& rFlyFmt, SwFrmFmt& rNewFrmFmt )
rFlyFmt.GetAttrSet().GetRanges() )),
nOldNode( 0 ), nNewNode( 0 ),
nOldCntnt( 0 ), nNewCntnt( 0 ),
- nOldAnchorTyp( 0 ), nNewAnchorTyp( 0 ), bAnchorChgd( FALSE )
+ nOldAnchorTyp( 0 ), nNewAnchorTyp( 0 ), bAnchorChgd( sal_False )
{
}
@@ -491,7 +516,7 @@ void SwUndoSetFlyFmt::DeRegisterFromFormat( SwFmt& rFmt )
}
void SwUndoSetFlyFmt::GetAnchor( SwFmtAnchor& rAnchor,
- ULONG nNode, xub_StrLen nCntnt )
+ sal_uLong nNode, xub_StrLen nCntnt )
{
RndStdIds nAnchorTyp = rAnchor.GetAnchorId();
if (FLY_AT_PAGE != nAnchorTyp)
@@ -537,9 +562,9 @@ void SwUndoSetFlyFmt::GetAnchor( SwFmtAnchor& rAnchor,
rAnchor.SetPageNum( nCntnt );
}
-void SwUndoSetFlyFmt::Undo( SwUndoIter& rIter )
+void SwUndoSetFlyFmt::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
// ist das neue Format noch vorhanden ??
if( USHRT_MAX != rDoc.GetFrmFmts()->GetPos( (const SwFrmFmtPtr)pOldFmt ) )
@@ -607,13 +632,13 @@ void SwUndoSetFlyFmt::Undo( SwUndoIter& rIter )
pFrmFmt->MakeFrms();
}
- rIter.pSelFmt = pFrmFmt;
+ rContext.SetSelections(pFrmFmt, 0);
}
}
-void SwUndoSetFlyFmt::Redo( SwUndoIter& rIter )
+void SwUndoSetFlyFmt::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
// ist das neue Format noch vorhanden ??
if( USHRT_MAX != rDoc.GetFrmFmts()->GetPos( (const SwFrmFmtPtr)pNewFmt ) )
@@ -630,11 +655,11 @@ void SwUndoSetFlyFmt::Redo( SwUndoIter& rIter )
else
rDoc.SetFrmFmtToFly( *pFrmFmt, *pNewFmt, 0 );
- rIter.pSelFmt = pFrmFmt;
+ rContext.SetSelections(pFrmFmt, 0);
}
}
-void SwUndoSetFlyFmt::PutAttr( USHORT nWhich, const SfxPoolItem* pItem )
+void SwUndoSetFlyFmt::PutAttr( sal_uInt16 nWhich, const SfxPoolItem* pItem )
{
if( pItem && pItem != GetDfltAttr( nWhich ) )
{
@@ -644,10 +669,10 @@ void SwUndoSetFlyFmt::PutAttr( USHORT nWhich, const SfxPoolItem* pItem )
// nur den 1. Ankerwechsel vermerken
ASSERT( !bAnchorChgd, "mehrfacher Ankerwechsel nicht erlaubt!" );
- bAnchorChgd = TRUE;
+ bAnchorChgd = sal_True;
const SwFmtAnchor* pAnchor = (SwFmtAnchor*)pItem;
- switch( nOldAnchorTyp = static_cast<USHORT>(pAnchor->GetAnchorId()) )
+ switch( nOldAnchorTyp = static_cast<sal_uInt16>(pAnchor->GetAnchorId()) )
{
case FLY_AS_CHAR:
case FLY_AT_CHAR:
@@ -662,7 +687,7 @@ void SwUndoSetFlyFmt::PutAttr( USHORT nWhich, const SfxPoolItem* pItem )
}
pAnchor = (SwFmtAnchor*)&pFrmFmt->GetAnchor();
- switch( nNewAnchorTyp = static_cast<USHORT>(pAnchor->GetAnchorId()) )
+ switch( nNewAnchorTyp = static_cast<sal_uInt16>(pAnchor->GetAnchorId()) )
{
case FLY_AS_CHAR:
case FLY_AT_CHAR:
@@ -687,7 +712,7 @@ void SwUndoSetFlyFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* )
{
if( pOld )
{
- USHORT nWhich = pOld->Which();
+ sal_uInt16 nWhich = pOld->Which();
if( nWhich < POOLATTR_END )
PutAttr( nWhich, pOld );
diff --git a/sw/source/core/undo/undoflystrattr.cxx b/sw/source/core/undo/undoflystrattr.cxx
index 23113d6b0d1b..fad07654f6f8 100644
--- a/sw/source/core/undo/undoflystrattr.cxx
+++ b/sw/source/core/undo/undoflystrattr.cxx
@@ -49,7 +49,7 @@ SwUndoFlyStrAttr::~SwUndoFlyStrAttr()
{
}
-void SwUndoFlyStrAttr::Undo( SwUndoIter& )
+void SwUndoFlyStrAttr::UndoImpl(::sw::UndoRedoContext &)
{
switch ( GetId() )
{
@@ -69,7 +69,7 @@ void SwUndoFlyStrAttr::Undo( SwUndoIter& )
}
}
-void SwUndoFlyStrAttr::Redo( SwUndoIter& )
+void SwUndoFlyStrAttr::RedoImpl(::sw::UndoRedoContext &)
{
switch ( GetId() )
{
@@ -89,11 +89,6 @@ void SwUndoFlyStrAttr::Redo( SwUndoIter& )
}
}
-void SwUndoFlyStrAttr::Repeat( SwUndoIter& )
-{
- // no repeat
-}
-
SwRewriter SwUndoFlyStrAttr::GetRewriter() const
{
SwRewriter aResult;
diff --git a/sw/source/core/undo/undraw.cxx b/sw/source/core/undo/undraw.cxx
index 2b4565c8fc71..d7f994e54de4 100644
--- a/sw/source/core/undo/undraw.cxx
+++ b/sw/source/core/undo/undraw.cxx
@@ -28,26 +28,31 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <UndoDraw.hxx>
+
#include <rtl/string.h>
#include <rtl/memory.h>
-#include <hintids.hxx>
#include <rtl/string.h>
#include <svx/svdogrp.hxx>
#include <svx/svdundo.hxx>
#include <svx/svdpage.hxx>
#include <svx/svdmark.hxx>
+
+#include <hintids.hxx>
+#include <hints.hxx>
#include <fmtanchr.hxx>
#include <fmtflcnt.hxx>
#include <txtflcnt.hxx>
#include <frmfmt.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <docary.hxx>
#include <frame.hxx>
#include <swundo.hxx> // fuer die UndoIds
#include <pam.hxx>
#include <ndtxt.hxx>
-#include <undobj.hxx>
+#include <UndoCore.hxx>
#include <dcontact.hxx>
#include <dview.hxx>
#include <rootfrm.hxx>
@@ -58,31 +63,36 @@ struct SwUndoGroupObjImpl
{
SwDrawFrmFmt* pFmt;
SdrObject* pObj;
+<<<<<<< local
ULONG nNodeIdx;
-};
+=======
+ sal_uLong nNodeIdx;
+ // OD 2004-04-15 #i26791# - keeping the anchor and the relative position
+ // of drawing objects no longer needed
+>>>>>>> other
+};
-inline SwDoc& SwUndoIter::GetDoc() const { return *pAktPam->GetDoc(); }
// Draw-Objecte
IMPL_LINK( SwDoc, AddDrawUndo, SdrUndoAction *, pUndo )
{
#if OSL_DEBUG_LEVEL > 1
- USHORT nId = pUndo->GetId();
+ sal_uInt16 nId = pUndo->GetId();
(void)nId;
String sComment( pUndo->GetComment() );
#endif
- if( DoesUndo() && !IsNoDrawUndoObj() )
+ if (GetIDocumentUndoRedo().DoesUndo() &&
+ GetIDocumentUndoRedo().DoesDrawUndo())
{
- ClearRedo();
const SdrMarkList* pMarkList = 0;
ViewShell* pSh = GetCurrentViewShell();
if( pSh && pSh->HasDrawView() )
pMarkList = &pSh->GetDrawView()->GetMarkedObjectList();
- AppendUndo( new SwSdrUndo( pUndo, pMarkList ) );
+ GetIDocumentUndoRedo().AppendUndo( new SwSdrUndo(pUndo, pMarkList) );
}
else
delete pUndo;
@@ -104,16 +114,16 @@ SwSdrUndo::~SwSdrUndo()
delete pMarkList;
}
-void SwSdrUndo::Undo( SwUndoIter& rUndoIter )
+void SwSdrUndo::UndoImpl(::sw::UndoRedoContext & rContext)
{
pSdrUndo->Undo();
- rUndoIter.pMarkList = pMarkList;
+ rContext.SetSelections(0, pMarkList);
}
-void SwSdrUndo::Redo( SwUndoIter& rUndoIter )
+void SwSdrUndo::RedoImpl(::sw::UndoRedoContext & rContext)
{
pSdrUndo->Redo();
- rUndoIter.pMarkList = pMarkList;
+ rContext.SetSelections(0, pMarkList);
}
String SwSdrUndo::GetComment() const
@@ -129,7 +139,7 @@ void lcl_SendRemoveToUno( SwFmt& rFmt )
rFmt.ModifyNotification( &aMsgHint, &aMsgHint );
}
-void lcl_SaveAnchor( SwFrmFmt* pFmt, ULONG& rNodePos )
+void lcl_SaveAnchor( SwFrmFmt* pFmt, sal_uLong& rNodePos )
{
const SwFmtAnchor& rAnchor = pFmt->GetAnchor();
if ((FLY_AT_PARA == rAnchor.GetAnchorId()) ||
@@ -167,7 +177,7 @@ void lcl_SaveAnchor( SwFrmFmt* pFmt, ULONG& rNodePos )
}
}
-void lcl_RestoreAnchor( SwFrmFmt* pFmt, ULONG& rNodePos )
+void lcl_RestoreAnchor( SwFrmFmt* pFmt, sal_uLong& rNodePos )
{
const SwFmtAnchor& rAnchor = pFmt->GetAnchor();
if ((FLY_AT_PARA == rAnchor.GetAnchorId()) ||
@@ -200,8 +210,8 @@ void lcl_RestoreAnchor( SwFrmFmt* pFmt, ULONG& rNodePos )
}
}
-SwUndoDrawGroup::SwUndoDrawGroup( USHORT nCnt )
- : SwUndo( UNDO_DRAWGROUP ), nSize( nCnt + 1 ), bDelFmt( TRUE )
+SwUndoDrawGroup::SwUndoDrawGroup( sal_uInt16 nCnt )
+ : SwUndo( UNDO_DRAWGROUP ), nSize( nCnt + 1 ), bDelFmt( sal_True )
{
pObjArr = new SwUndoGroupObjImpl[ nSize ];
}
@@ -211,7 +221,7 @@ SwUndoDrawGroup::~SwUndoDrawGroup()
if( bDelFmt )
{
SwUndoGroupObjImpl* pTmp = pObjArr + 1;
- for( USHORT n = 1; n < nSize; ++n, ++pTmp )
+ for( sal_uInt16 n = 1; n < nSize; ++n, ++pTmp )
delete pTmp->pFmt;
}
else
@@ -220,9 +230,9 @@ SwUndoDrawGroup::~SwUndoDrawGroup()
delete [] pObjArr;
}
-void SwUndoDrawGroup::Undo( SwUndoIter& )
+void SwUndoDrawGroup::UndoImpl(::sw::UndoRedoContext &)
{
- bDelFmt = FALSE;
+ bDelFmt = sal_False;
// save group object
SwDrawFrmFmt* pFmt = pObjArr->pFmt;
@@ -244,7 +254,7 @@ void SwUndoDrawGroup::Undo( SwUndoIter& )
SwSpzFrmFmts& rFlyFmts = *(SwSpzFrmFmts*)pDoc->GetSpzFrmFmts();
rFlyFmts.Remove( rFlyFmts.GetPos( pFmt ));
- for( USHORT n = 1; n < nSize; ++n )
+ for( sal_uInt16 n = 1; n < nSize; ++n )
{
SwUndoGroupObjImpl& rSave = *( pObjArr + n );
@@ -267,16 +277,16 @@ void SwUndoDrawGroup::Undo( SwUndoIter& )
}
}
-void SwUndoDrawGroup::Redo( SwUndoIter& )
+void SwUndoDrawGroup::RedoImpl(::sw::UndoRedoContext &)
{
- bDelFmt = TRUE;
+ bDelFmt = sal_True;
// remove from array
SwDoc* pDoc = pObjArr->pFmt->GetDoc();
SwSpzFrmFmts& rFlyFmts = *(SwSpzFrmFmts*)pDoc->GetSpzFrmFmts();
SdrObject* pObj;
- for( USHORT n = 1; n < nSize; ++n )
+ for( sal_uInt16 n = 1; n < nSize; ++n )
{
SwUndoGroupObjImpl& rSave = *( pObjArr + n );
@@ -314,7 +324,7 @@ void SwUndoDrawGroup::Redo( SwUndoIter& )
}
}
-void SwUndoDrawGroup::AddObj( USHORT nPos, SwDrawFrmFmt* pFmt, SdrObject* pObj )
+void SwUndoDrawGroup::AddObj( sal_uInt16 nPos, SwDrawFrmFmt* pFmt, SdrObject* pObj )
{
SwUndoGroupObjImpl& rSave = *( pObjArr + nPos + 1 );
rSave.pObj = pObj;
@@ -339,9 +349,9 @@ void SwUndoDrawGroup::SetGroupFmt( SwDrawFrmFmt* pFmt )
// ------------------------------
SwUndoDrawUnGroup::SwUndoDrawUnGroup( SdrObjGroup* pObj )
- : SwUndo( UNDO_DRAWUNGROUP ), bDelFmt( FALSE )
+ : SwUndo( UNDO_DRAWUNGROUP ), bDelFmt( sal_False )
{
- nSize = (USHORT)pObj->GetSubList()->GetObjCount() + 1;
+ nSize = (sal_uInt16)pObj->GetSubList()->GetObjCount() + 1;
pObjArr = new SwUndoGroupObjImpl[ nSize ];
SwDrawContact *pContact = (SwDrawContact*)GetUserCall(pObj);
@@ -369,7 +379,7 @@ SwUndoDrawUnGroup::~SwUndoDrawUnGroup()
if( bDelFmt )
{
SwUndoGroupObjImpl* pTmp = pObjArr + 1;
- for( USHORT n = 1; n < nSize; ++n, ++pTmp )
+ for( sal_uInt16 n = 1; n < nSize; ++n, ++pTmp )
delete pTmp->pFmt;
}
else
@@ -378,15 +388,20 @@ SwUndoDrawUnGroup::~SwUndoDrawUnGroup()
delete [] pObjArr;
}
-void SwUndoDrawUnGroup::Undo( SwUndoIter& rIter )
+void SwUndoDrawUnGroup::UndoImpl(::sw::UndoRedoContext & rContext)
{
- bDelFmt = TRUE;
+ bDelFmt = sal_True;
+<<<<<<< local
// remove from array
SwDoc* pDoc = &rIter.GetDoc();
+=======
+ SwDoc *const pDoc = & rContext.GetDoc();
+>>>>>>> other
SwSpzFrmFmts& rFlyFmts = *(SwSpzFrmFmts*)pDoc->GetSpzFrmFmts();
- for( USHORT n = 1; n < nSize; ++n )
+ // remove from array
+ for( sal_uInt16 n = 1; n < nSize; ++n )
{
SwUndoGroupObjImpl& rSave = *( pObjArr + n );
@@ -415,9 +430,9 @@ void SwUndoDrawUnGroup::Undo( SwUndoIter& rIter )
}
}
-void SwUndoDrawUnGroup::Redo( SwUndoIter& )
+void SwUndoDrawUnGroup::RedoImpl(::sw::UndoRedoContext &)
{
- bDelFmt = FALSE;
+ bDelFmt = sal_False;
// save group object
SwDrawFrmFmt* pFmt = pObjArr->pFmt;
@@ -438,7 +453,7 @@ void SwUndoDrawUnGroup::Redo( SwUndoIter& )
SwSpzFrmFmts& rFlyFmts = *(SwSpzFrmFmts*)pDoc->GetSpzFrmFmts();
rFlyFmts.Remove( rFlyFmts.GetPos( pFmt ));
- for( USHORT n = 1; n < nSize; ++n )
+ for( sal_uInt16 n = 1; n < nSize; ++n )
{
SwUndoGroupObjImpl& rSave = *( pObjArr + n );
@@ -455,7 +470,7 @@ void SwUndoDrawUnGroup::Redo( SwUndoIter& )
}
}
-void SwUndoDrawUnGroup::AddObj( USHORT nPos, SwDrawFrmFmt* pFmt )
+void SwUndoDrawUnGroup::AddObj( sal_uInt16 nPos, SwDrawFrmFmt* pFmt )
{
SwUndoGroupObjImpl& rSave = *( pObjArr + nPos + 1 );
rSave.pFmt = pFmt;
@@ -471,7 +486,8 @@ SwUndoDrawUnGroupConnectToLayout::~SwUndoDrawUnGroupConnectToLayout()
{
}
-void SwUndoDrawUnGroupConnectToLayout::Undo( SwUndoIter& )
+void
+SwUndoDrawUnGroupConnectToLayout::UndoImpl(::sw::UndoRedoContext &)
{
for ( std::vector< SdrObject >::size_type i = 0;
i < aDrawFmtsAndObjs.size(); ++i )
@@ -490,7 +506,8 @@ void SwUndoDrawUnGroupConnectToLayout::Undo( SwUndoIter& )
}
}
-void SwUndoDrawUnGroupConnectToLayout::Redo( SwUndoIter& )
+void
+SwUndoDrawUnGroupConnectToLayout::RedoImpl(::sw::UndoRedoContext &)
{
for ( std::vector< std::pair< SwDrawFrmFmt*, SdrObject* > >::size_type i = 0;
i < aDrawFmtsAndObjs.size(); ++i )
@@ -512,8 +529,8 @@ void SwUndoDrawUnGroupConnectToLayout::AddFmtAndObj( SwDrawFrmFmt* pDrawFrmFmt,
//-------------------------------------
-SwUndoDrawDelete::SwUndoDrawDelete( USHORT nCnt )
- : SwUndo( UNDO_DRAWDELETE ), nSize( nCnt ), bDelFmt( TRUE )
+SwUndoDrawDelete::SwUndoDrawDelete( sal_uInt16 nCnt )
+ : SwUndo( UNDO_DRAWDELETE ), nSize( nCnt ), bDelFmt( sal_True )
{
pObjArr = new SwUndoGroupObjImpl[ nSize ];
pMarkLst = new SdrMarkList();
@@ -524,18 +541,18 @@ SwUndoDrawDelete::~SwUndoDrawDelete()
if( bDelFmt )
{
SwUndoGroupObjImpl* pTmp = pObjArr;
- for( USHORT n = 0; n < pMarkLst->GetMarkCount(); ++n, ++pTmp )
+ for( sal_uInt16 n = 0; n < pMarkLst->GetMarkCount(); ++n, ++pTmp )
delete pTmp->pFmt;
}
delete [] pObjArr;
delete pMarkLst;
}
-void SwUndoDrawDelete::Undo( SwUndoIter &rIter )
+void SwUndoDrawDelete::UndoImpl(::sw::UndoRedoContext & rContext)
{
- bDelFmt = FALSE;
- SwSpzFrmFmts& rFlyFmts = *rIter.GetDoc().GetSpzFrmFmts();
- for( USHORT n = 0; n < pMarkLst->GetMarkCount(); ++n )
+ bDelFmt = sal_False;
+ SwSpzFrmFmts & rFlyFmts = *rContext.GetDoc().GetSpzFrmFmts();
+ for( sal_uInt16 n = 0; n < pMarkLst->GetMarkCount(); ++n )
{
SwUndoGroupObjImpl& rSave = *( pObjArr + n );
::lcl_RestoreAnchor( rSave.pFmt, rSave.nNodeIdx );
@@ -552,15 +569,21 @@ void SwUndoDrawDelete::Undo( SwUndoIter &rIter )
{
static_cast<SwDrawFrmFmt*>(rSave.pFmt)->PosAttrSet();
}
+<<<<<<< local
}
rIter.pMarkList = pMarkLst;
+=======
+ // <--
+ }
+ rContext.SetSelections(0, pMarkLst);
+>>>>>>> other
}
-void SwUndoDrawDelete::Redo( SwUndoIter &rIter )
+void SwUndoDrawDelete::RedoImpl(::sw::UndoRedoContext & rContext)
{
- bDelFmt = TRUE;
- SwSpzFrmFmts& rFlyFmts = *rIter.GetDoc().GetSpzFrmFmts();
- for( USHORT n = 0; n < pMarkLst->GetMarkCount(); ++n )
+ bDelFmt = sal_True;
+ SwSpzFrmFmts & rFlyFmts = *rContext.GetDoc().GetSpzFrmFmts();
+ for( sal_uInt16 n = 0; n < pMarkLst->GetMarkCount(); ++n )
{
SwUndoGroupObjImpl& rSave = *( pObjArr + n );
SdrObject *pObj = rSave.pObj;
@@ -579,7 +602,7 @@ void SwUndoDrawDelete::Redo( SwUndoIter &rIter )
}
}
-void SwUndoDrawDelete::AddObj( USHORT , SwDrawFrmFmt* pFmt,
+void SwUndoDrawDelete::AddObj( sal_uInt16 , SwDrawFrmFmt* pFmt,
const SdrMark& rMark )
{
SwUndoGroupObjImpl& rSave = *( pObjArr + pMarkLst->GetMarkCount() );
diff --git a/sw/source/core/undo/unfmco.cxx b/sw/source/core/undo/unfmco.cxx
index e67ec2e9d8c2..8a3452c0ee82 100644
--- a/sw/source/core/undo/unfmco.cxx
+++ b/sw/source/core/undo/unfmco.cxx
@@ -35,12 +35,10 @@
#include "pam.hxx"
#include "ndtxt.hxx"
-#include "undobj.hxx"
+#include <UndoCore.hxx>
#include "rolbck.hxx"
-inline SwDoc& SwUndoIter::GetDoc() const { return *pAktPam->GetDoc(); }
-
//--------------------------------------------------
@@ -70,51 +68,45 @@ SwUndoFmtColl::~SwUndoFmtColl()
}
-void SwUndoFmtColl::Undo( SwUndoIter& rUndoIter )
+void SwUndoFmtColl::UndoImpl(::sw::UndoRedoContext & rContext)
{
- // die alten Werte wieder zurueck
- pHistory->TmpRollback( &rUndoIter.GetDoc(), 0 );
+ // restore old values
+ pHistory->TmpRollback(& rContext.GetDoc(), 0);
pHistory->SetTmpEnd( pHistory->Count() );
- // setze noch den Cursor auf den Undo-Bereich
- SetPaM( rUndoIter );
+ // create cursor for undo range
+ AddUndoRedoPaM(rContext);
}
-void SwUndoFmtColl::Redo( SwUndoIter& rUndoIter )
+void SwUndoFmtColl::RedoImpl(::sw::UndoRedoContext & rContext)
{
- // setze Attribut in dem Bereich:
- SetPaM( rUndoIter );
- rUndoIter.pLastUndoObj = 0;
-
- Repeat( rUndoIter ); // Collection setzen
+ SwPaM & rPam = AddUndoRedoPaM(rContext);
- rUndoIter.pLastUndoObj = 0;
+ DoSetFmtColl(rContext.GetDoc(), rPam);
}
-
-void SwUndoFmtColl::Repeat( SwUndoIter& rUndoIter )
+void SwUndoFmtColl::RepeatImpl(::sw::RepeatContext & rContext)
{
- if( UNDO_SETFMTCOLL == rUndoIter.GetLastUndoId() &&
- pFmtColl == ((SwUndoFmtColl*)rUndoIter.pLastUndoObj)->pFmtColl )
- return;
+ DoSetFmtColl(rContext.GetDoc(), rContext.GetRepeatPaM());
+}
+void SwUndoFmtColl::DoSetFmtColl(SwDoc & rDoc, SwPaM & rPaM)
+{
// es kann nur eine TextFmtColl auf einen Bereich angewendet werden,
// also erfrage auch nur in dem Array
- USHORT nPos = rUndoIter.GetDoc().GetTxtFmtColls()->GetPos(
+ sal_uInt16 const nPos = rDoc.GetTxtFmtColls()->GetPos(
(SwTxtFmtColl*)pFmtColl );
- // ist das Format ueberhaupt noch vorhanden?
+ // does the format still exist?
if( USHRT_MAX != nPos )
{
// --> OD 2008-04-15 #refactorlists#
- rUndoIter.GetDoc().SetTxtFmtColl( *rUndoIter.pAktPam,
+ rDoc.SetTxtFmtColl(rPaM,
(SwTxtFmtColl*)pFmtColl,
mbReset,
mbResetListAttrs );
// <--
}
-
- rUndoIter.pLastUndoObj = this;
}
SwRewriter SwUndoFmtColl::GetRewriter() const
@@ -129,3 +121,4 @@ SwRewriter SwUndoFmtColl::GetRewriter() const
return aResult;
}
+
diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx
index 6a98bdaee99b..8037214815f9 100644
--- a/sw/source/core/undo/unins.cxx
+++ b/sw/source/core/undo/unins.cxx
@@ -27,6 +27,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
+#include <UndoInsert.hxx>
+
#include <hintids.hxx>
#include <unotools/charclass.hxx>
#include <sot/storage.hxx>
@@ -38,10 +41,13 @@
#include <fmtanchr.hxx>
#include <frmfmt.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <swundo.hxx> // fuer die UndoIds
#include <pam.hxx>
#include <ndtxt.hxx>
-#include <undobj.hxx>
+#include <UndoCore.hxx>
+#include <UndoDelete.hxx>
+#include <UndoAttribute.hxx>
#include <rolbck.hxx>
#include <ndgrf.hxx>
#include <ndole.hxx>
@@ -61,42 +67,6 @@
using namespace ::com::sun::star;
-class _UnReplaceData : private SwUndoSaveCntnt
-{
- String m_sOld, m_sIns;
- ULONG m_nSttNd, m_nEndNd, m_nOffset;
- xub_StrLen m_nSttCnt, m_nEndCnt, m_nSetPos, m_nSelEnd;
- BOOL m_bSplitNext : 1;
- BOOL m_bRegExp : 1;
- // metadata references for paragraph and following para (if m_bSplitNext)
- ::boost::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndoStart;
- ::boost::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndoEnd;
-
-public:
- _UnReplaceData( const SwPaM& rPam, const String& rIns, BOOL bRegExp );
- ~_UnReplaceData();
-
- void Undo( SwUndoIter& rIter );
- void Redo( SwUndoIter& rIter );
- void SetEnd( const SwPaM& rPam );
-
- const String & GetOld() const { return m_sOld; }
- const String & GetIns() const { return m_sIns; }
-};
-
-
-SV_IMPL_PTRARR( _UnReplaceDatas, _UnReplaceData* )
-
-//------------------------------------------------------------------
-
-inline SwDoc& SwUndoIter::GetDoc() const { return *pAktPam->GetDoc(); }
-
-// zwei Zugriffs-Funktionen
-inline SwPosition* IterPt( SwUndoIter& rUIter )
-{ return rUIter.pAktPam->GetPoint(); }
-inline SwPosition* IterMk( SwUndoIter& rUIter )
-{ return rUIter.pAktPam->GetMark(); }
-
//------------------------------------------------------------
// INSERT
@@ -141,10 +111,10 @@ void SwUndoInsert::Init(const SwNodeIndex & rNd)
SwUndoInsert::SwUndoInsert( const SwNodeIndex& rNd, xub_StrLen nCnt,
xub_StrLen nL,
const IDocumentContentOperations::InsertFlags nInsertFlags,
- BOOL bWDelim )
+ sal_Bool bWDelim )
: SwUndo(UNDO_TYPING), pPos( 0 ), pTxt( 0 ), pRedlData( 0 ),
nNode( rNd.GetIndex() ), nCntnt(nCnt), nLen(nL),
- bIsWordDelim( bWDelim ), bIsAppend( FALSE )
+ bIsWordDelim( bWDelim ), bIsAppend( sal_False )
, m_nInsertFlags(nInsertFlags)
{
Init(rNd);
@@ -154,7 +124,7 @@ SwUndoInsert::SwUndoInsert( const SwNodeIndex& rNd, xub_StrLen nCnt,
SwUndoInsert::SwUndoInsert( const SwNodeIndex& rNd )
: SwUndo(UNDO_SPLITNODE), pPos( 0 ), pTxt( 0 ),
pRedlData( 0 ), nNode( rNd.GetIndex() ), nCntnt(0), nLen(1),
- bIsWordDelim( FALSE ), bIsAppend( TRUE )
+ bIsWordDelim( sal_False ), bIsAppend( sal_True )
, m_nInsertFlags(IDocumentContentOperations::INS_EMPTYEXPAND)
{
Init(rNd);
@@ -164,7 +134,7 @@ SwUndoInsert::SwUndoInsert( const SwNodeIndex& rNd )
// werden kann. Wenn ja, dann aender die Laenge und die InsPos.
// Dann wird von SwDoc::Insert kein neues Object in die Undoliste gestellt.
-BOOL SwUndoInsert::CanGrouping( sal_Unicode cIns )
+sal_Bool SwUndoInsert::CanGrouping( sal_Unicode cIns )
{
if( !bIsAppend && bIsWordDelim ==
!GetAppCharClass().isLetterNumeric( String( cIns )) )
@@ -175,14 +145,14 @@ BOOL SwUndoInsert::CanGrouping( sal_Unicode cIns )
if (pUndoTxt)
pUndoTxt->Insert(cIns);
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
-BOOL SwUndoInsert::CanGrouping( const SwPosition& rPos )
+sal_Bool SwUndoInsert::CanGrouping( const SwPosition& rPos )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( nNode == rPos.nNode.GetIndex() &&
nCntnt == rPos.nContent.GetIndex() )
{
@@ -191,7 +161,7 @@ BOOL SwUndoInsert::CanGrouping( const SwPosition& rPos )
if( ( ~nsRedlineMode_t::REDLINE_SHOW_MASK & rDoc.GetRedlineMode() ) ==
( ~nsRedlineMode_t::REDLINE_SHOW_MASK & GetRedlineMode() ) )
{
- bRet = TRUE;
+ bRet = sal_True;
// dann war oder ist noch Redline an:
// pruefe, ob an der InsPosition ein anderer Redline
@@ -203,7 +173,7 @@ BOOL SwUndoInsert::CanGrouping( const SwPosition& rPos )
SwRedlineData aRData( nsRedlineType_t::REDLINE_INSERT, rDoc.GetRedlineAuthor() );
const SwIndexReg* pIReg = rPos.nContent.GetIdxReg();
SwIndex* pIdx;
- for( USHORT i = 0; i < rTbl.Count(); ++i )
+ for( sal_uInt16 i = 0; i < rTbl.Count(); ++i )
{
SwRedline* pRedl = rTbl[ i ];
if( pIReg == (pIdx = &pRedl->End()->nContent)->GetIdxReg() &&
@@ -212,7 +182,7 @@ BOOL SwUndoInsert::CanGrouping( const SwPosition& rPos )
if( !pRedl->HasMark() || !pRedlData ||
*pRedl != *pRedlData || *pRedl != aRData )
{
- bRet = FALSE;
+ bRet = sal_False;
break;
}
}
@@ -248,13 +218,13 @@ SwUndoInsert::~SwUndoInsert()
-void SwUndoInsert::Undo( SwUndoIter& rUndoIter )
+void SwUndoInsert::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc* pTmpDoc = &rUndoIter.GetDoc();
+ SwDoc *const pTmpDoc = & rContext.GetDoc();
+ SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor());
if( bIsAppend )
{
- SwPaM* pPam = rUndoIter.pAktPam;
pPam->GetPoint()->nNode = nNode;
if( IDocumentRedlineAccess::IsRedlineOn( GetRedlineMode() ))
@@ -271,7 +241,7 @@ void SwUndoInsert::Undo( SwUndoIter& rUndoIter )
}
else
{
- ULONG nNd = nNode;
+ sal_uLong nNd = nNode;
xub_StrLen nCnt = nCntnt;
if( nLen )
{
@@ -287,7 +257,7 @@ void SwUndoInsert::Undo( SwUndoIter& rUndoIter )
aPaM.GetPoint()->nContent -= nLen;
if( IDocumentRedlineAccess::IsRedlineOn( GetRedlineMode() ))
pTmpDoc->DeleteRedline( aPaM, true, USHRT_MAX );
- RemoveIdxFromRange( aPaM, FALSE );
+ RemoveIdxFromRange( aPaM, sal_False );
pTxt = new String( pTxtNode->GetTxt().Copy(nCntnt-nLen, nLen) );
pTxtNode->EraseText( aPaM.GetPoint()->nContent, nLen );
}
@@ -296,7 +266,7 @@ void SwUndoInsert::Undo( SwUndoIter& rUndoIter )
aPaM.Move(fnMoveBackward);
if( IDocumentRedlineAccess::IsRedlineOn( GetRedlineMode() ))
pTmpDoc->DeleteRedline( aPaM, true, USHRT_MAX );
- RemoveIdxFromRange( aPaM, FALSE );
+ RemoveIdxFromRange( aPaM, sal_False );
}
nNd = aPaM.GetPoint()->nNode.GetIndex();
@@ -311,24 +281,22 @@ void SwUndoInsert::Undo( SwUndoIter& rUndoIter )
nCntnt = aPaM.GetPoint()->nContent.GetIndex();
}
- // setze noch den Cursor auf den Undo-Bereich
- rUndoIter.pAktPam->DeleteMark();
+ // set cursor to Undo range
+ pPam->DeleteMark();
- IterPt(rUndoIter)->nNode = nNd;
- IterPt(rUndoIter)->nContent.Assign( pTmpDoc->GetNodes()[
- IterPt(rUndoIter)->nNode ]->GetCntntNode(), nCnt );
- // SPoint und GetMark auf der gleichen Position
+ pPam->GetPoint()->nNode = nNd;
+ pPam->GetPoint()->nContent.Assign(
+ pPam->GetPoint()->nNode.GetNode().GetCntntNode(), nCnt );
}
DELETEZ(pUndoTxt);
}
-void SwUndoInsert::Redo( SwUndoIter& rUndoIter )
+void SwUndoInsert::RedoImpl(::sw::UndoRedoContext & rContext)
{
- // setze noch den Cursor auf den Redo-Bereich
- SwPaM* pPam = rUndoIter.pAktPam;
- SwDoc* pTmpDoc = pPam->GetDoc();
+ SwDoc *const pTmpDoc = & rContext.GetDoc();
+ SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor());
pPam->DeleteMark();
if( bIsAppend )
@@ -356,12 +324,13 @@ void SwUndoInsert::Redo( SwUndoIter& rUndoIter )
else
{
pPam->GetPoint()->nNode = nNode;
- SwCntntNode* pCNd = pTmpDoc->GetNodes()[ pPam->GetPoint()->nNode ]->GetCntntNode();
+ SwCntntNode *const pCNd =
+ pPam->GetPoint()->nNode.GetNode().GetCntntNode();
pPam->GetPoint()->nContent.Assign( pCNd, nCntnt );
if( nLen )
{
- BOOL bMvBkwrd = MovePtBackward( *pPam );
+ sal_Bool bMvBkwrd = MovePtBackward( *pPam );
if( pTxt )
{
@@ -374,7 +343,7 @@ void SwUndoInsert::Redo( SwUndoIter& rUndoIter )
else
{
// Inhalt wieder einfuegen. (erst pPos abmelden !!)
- ULONG nMvNd = pPos->nNode.GetIndex();
+ sal_uLong nMvNd = pPos->nNode.GetIndex();
xub_StrLen nMvCnt = pPos->nContent.GetIndex();
DELETEZ( pPos );
MoveFromUndoNds( *pTmpDoc, nMvNd, nMvCnt, *pPam->GetMark() );
@@ -383,18 +352,18 @@ void SwUndoInsert::Redo( SwUndoIter& rUndoIter )
nCntnt = pPam->GetMark()->nContent.GetIndex();
MovePtForward( *pPam, bMvBkwrd );
- rUndoIter.pAktPam->Exchange();
+ pPam->Exchange();
if( pRedlData && IDocumentRedlineAccess::IsRedlineOn( GetRedlineMode() ))
{
RedlineMode_t eOld = pTmpDoc->GetRedlineMode();
pTmpDoc->SetRedlineMode_intern((RedlineMode_t)(eOld & ~nsRedlineMode_t::REDLINE_IGNORE));
pTmpDoc->AppendRedline( new SwRedline( *pRedlData,
- *rUndoIter.pAktPam ), true);
+ *pPam ), true);
pTmpDoc->SetRedlineMode_intern( eOld );
}
else if( !( nsRedlineMode_t::REDLINE_IGNORE & GetRedlineMode() ) &&
pTmpDoc->GetRedlineTbl().Count() )
- pTmpDoc->SplitRedline( *rUndoIter.pAktPam );
+ pTmpDoc->SplitRedline(*pPam);
}
}
@@ -402,13 +371,12 @@ void SwUndoInsert::Redo( SwUndoIter& rUndoIter )
}
-void SwUndoInsert::Repeat( SwUndoIter& rUndoIter )
+void SwUndoInsert::RepeatImpl(::sw::RepeatContext & rContext)
{
- rUndoIter.pLastUndoObj = this;
if( !nLen )
return;
- SwDoc& rDoc = rUndoIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
SwNodeIndex aNd( rDoc.GetNodes(), nNode );
SwCntntNode* pCNd = aNd.GetNode().GetCntntNode();;
@@ -426,15 +394,15 @@ void SwUndoInsert::Repeat( SwUndoIter& rUndoIter )
{
case ND_TEXTNODE:
if( bIsAppend )
- rDoc.AppendTxtNode( *rUndoIter.pAktPam->GetPoint() );
+ {
+ rDoc.AppendTxtNode( *rContext.GetRepeatPaM().GetPoint() );
+ }
else
{
String aTxt( ((SwTxtNode*)pCNd)->GetTxt() );
- BOOL bGroupUndo = rDoc.DoesGroupUndo();
- rDoc.DoGroupUndo( FALSE );
- rDoc.InsertString( *rUndoIter.pAktPam,
+ ::sw::GroupUndoGuard const undoGuard(rDoc.GetIDocumentUndoRedo());
+ rDoc.InsertString( rContext.GetRepeatPaM(),
aTxt.Copy( nCntnt - nLen, nLen ) );
- rDoc.DoGroupUndo( bGroupUndo );
}
break;
case ND_GRFNODE:
@@ -444,7 +412,7 @@ void SwUndoInsert::Repeat( SwUndoIter& rUndoIter )
if( pGrfNd->IsGrfLink() )
pGrfNd->GetFileFilterNms( &sFile, &sFilter );
- rDoc.Insert( *rUndoIter.pAktPam, sFile, sFilter,
+ rDoc.Insert( rContext.GetRepeatPaM(), sFile, sFilter,
&pGrfNd->GetGrf(),
0/* Grafik-Collection*/, NULL, NULL );
}
@@ -464,7 +432,10 @@ void SwUndoInsert::Repeat( SwUndoIter& rUndoIter )
if ( aCnt.StoreEmbeddedObject( rSwOLE.GetOleRef(), aName, sal_True ) )
{
uno::Reference < embed::XEmbeddedObject > aNew = aCnt.GetEmbeddedObject( aName );
- rDoc.Insert( *rUndoIter.pAktPam, svt::EmbeddedObjectRef( aNew, ((SwOLENode*)pCNd)->GetAspect() ), NULL, NULL, NULL );
+ rDoc.Insert( rContext.GetRepeatPaM(),
+ svt::EmbeddedObjectRef( aNew,
+ static_cast<SwOLENode*>(pCNd)->GetAspect() ),
+ NULL, NULL, NULL );
}
break;
@@ -504,82 +475,85 @@ SwRewriter SwUndoInsert::GetRewriter() const
}
-/* */
+// SwUndoReplace /////////////////////////////////////////////////////////
-SwUndoReplace::SwUndoReplace()
- : SwUndo( UNDO_REPLACE ), nAktPos( USHRT_MAX )
-{
-}
-SwUndoReplace::~SwUndoReplace()
+class SwUndoReplace::Impl
+ : private SwUndoSaveCntnt
{
-}
+ ::rtl::OUString m_sOld;
+ ::rtl::OUString m_sIns;
+ sal_uLong m_nSttNd, m_nEndNd, m_nOffset;
+ xub_StrLen m_nSttCnt, m_nEndCnt, m_nSetPos, m_nSelEnd;
+ bool m_bSplitNext : 1;
+ bool m_bRegExp : 1;
+ // metadata references for paragraph and following para (if m_bSplitNext)
+ ::boost::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndoStart;
+ ::boost::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndoEnd;
-void SwUndoReplace::Undo( SwUndoIter& rUndoIter )
-{
- // war dieses nicht die letze Undo-Aktion, dann setze den
- // Count neu
- if( rUndoIter.pLastUndoObj != this )
+public:
+ Impl(SwPaM const& rPam, ::rtl::OUString const& rIns, bool const bRegExp);
+ virtual ~Impl()
{
- nAktPos = aArr.Count();
- rUndoIter.pLastUndoObj = this;
- bOldIterFlag = rUndoIter.bWeiter;
- rUndoIter.bWeiter = TRUE;
}
- aArr[ --nAktPos ]->Undo( rUndoIter );
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
- if( !nAktPos ) // alten Status wieder zurueck
- rUndoIter.bWeiter = bOldIterFlag;
-}
+ void SetEnd(SwPaM const& rPam);
+
+ ::rtl::OUString const& GetOld() const { return m_sOld; }
+ ::rtl::OUString const& GetIns() const { return m_sIns; }
+};
-void SwUndoReplace::Redo( SwUndoIter& rUndoIter )
+SwUndoReplace::SwUndoReplace(SwPaM const& rPam,
+ ::rtl::OUString const& rIns, bool const bRegExp)
+ : SwUndo( UNDO_REPLACE )
+ , m_pImpl(new Impl(rPam, rIns, bRegExp))
{
- // war dieses nicht die letze Undo-Aktion, dann setze den
- // Count neu
- if( rUndoIter.pLastUndoObj != this )
- {
- ASSERT( !nAktPos, "Redo ohne vorheriges Undo??" );
- rUndoIter.pLastUndoObj = this;
- bOldIterFlag = rUndoIter.bWeiter;
- rUndoIter.bWeiter = TRUE;
- }
+}
- aArr[ nAktPos ]->Redo( rUndoIter );
+SwUndoReplace::~SwUndoReplace()
+{
+}
- if( ++nAktPos >= aArr.Count() ) // alten Status wieder zurueck
- {
- nAktPos = USHRT_MAX;
- rUndoIter.bWeiter = bOldIterFlag;
- }
+void SwUndoReplace::UndoImpl(::sw::UndoRedoContext & rContext)
+{
+ m_pImpl->UndoImpl(rContext);
}
-// #111827#
-SwRewriter SwUndoReplace::GetRewriter() const
+void SwUndoReplace::RedoImpl(::sw::UndoRedoContext & rContext)
+{
+ m_pImpl->RedoImpl(rContext);
+}
+
+SwRewriter
+MakeUndoReplaceRewriter(sal_uLong const occurrences,
+ ::rtl::OUString const& sOld, ::rtl::OUString const& sNew)
{
SwRewriter aResult;
- if (aArr.Count() > 1)
+ if (1 < occurrences)
{
- aResult.AddRule(UNDO_ARG1, String::CreateFromInt32(aArr.Count()));
+ aResult.AddRule(UNDO_ARG1, String::CreateFromInt32(occurrences));
aResult.AddRule(UNDO_ARG2, String(SW_RES(STR_OCCURRENCES_OF)));
String aTmpStr;
aTmpStr += String(SW_RES(STR_START_QUOTE));
- aTmpStr += ShortenString(aArr[0]->GetOld(), nUndoStringLength,
+ aTmpStr += ShortenString(sOld, nUndoStringLength,
SW_RES(STR_LDOTS));
aTmpStr += String(SW_RES(STR_END_QUOTE));
aResult.AddRule(UNDO_ARG3, aTmpStr);
}
- else if (aArr.Count() == 1)
+ else if (1 == occurrences)
{
{
String aTmpStr;
aTmpStr += String(SW_RES(STR_START_QUOTE));
// #i33488 #
- aTmpStr += ShortenString(aArr[0]->GetOld(), nUndoStringLength,
+ aTmpStr += ShortenString(sOld, nUndoStringLength,
SW_RES(STR_LDOTS));
aTmpStr += String(SW_RES(STR_END_QUOTE));
aResult.AddRule(UNDO_ARG1, aTmpStr);
@@ -592,7 +566,7 @@ SwRewriter SwUndoReplace::GetRewriter() const
aTmpStr += String(SW_RES(STR_START_QUOTE));
// #i33488 #
- aTmpStr += ShortenString(aArr[0]->GetIns(), nUndoStringLength,
+ aTmpStr += ShortenString(sNew, nUndoStringLength,
SW_RES(STR_LDOTS));
aTmpStr += String(SW_RES(STR_END_QUOTE));
aResult.AddRule(UNDO_ARG3, aTmpStr);
@@ -602,24 +576,23 @@ SwRewriter SwUndoReplace::GetRewriter() const
return aResult;
}
-void SwUndoReplace::AddEntry( const SwPaM& rPam, const String& rInsert,
- BOOL bRegExp )
+// #111827#
+SwRewriter SwUndoReplace::GetRewriter() const
{
- _UnReplaceData* pNew = new _UnReplaceData( rPam, rInsert, bRegExp );
- aArr.C40_INSERT(_UnReplaceData, pNew, aArr.Count() );
+ return MakeUndoReplaceRewriter(1, m_pImpl->GetOld(), m_pImpl->GetIns());
}
-void SwUndoReplace::SetEntryEnd( const SwPaM& rPam )
+void SwUndoReplace::SetEnd(SwPaM const& rPam)
{
- _UnReplaceData* pEntry = aArr[ aArr.Count()-1 ];
- pEntry->SetEnd( rPam );
+ m_pImpl->SetEnd(rPam);
}
-_UnReplaceData::_UnReplaceData( const SwPaM& rPam, const String& rIns,
- BOOL bRgExp )
- : m_sIns( rIns ), m_nOffset( 0 )
+SwUndoReplace::Impl::Impl(
+ SwPaM const& rPam, ::rtl::OUString const& rIns, bool const bRegExp)
+ : m_sIns( rIns )
+ , m_nOffset( 0 )
+ , m_bRegExp(bRegExp)
{
- m_bRegExp = bRgExp;
const SwPosition * pStt( rPam.Start() );
const SwPosition * pEnd( rPam.End() );
@@ -638,7 +611,7 @@ _UnReplaceData::_UnReplaceData( const SwPaM& rPam, const String& rIns,
m_nSetPos = pHistory->Count();
- ULONG nNewPos = pStt->nNode.GetIndex();
+ sal_uLong nNewPos = pStt->nNode.GetIndex();
m_nOffset = m_nSttNd - nNewPos;
if ( pNd->GetpSwpHints() )
@@ -654,7 +627,7 @@ _UnReplaceData::_UnReplaceData( const SwPaM& rPam, const String& rIns,
pHistory->Add( pNd->GetTxtColl(), nNewPos, ND_TEXTNODE );
SwTxtNode* pNext = pEnd->nNode.GetNode().GetTxtNode();
- ULONG nTmp = pNext->GetIndex();
+ sal_uLong nTmp = pNext->GetIndex();
pHistory->CopyAttr( pNext->GetpSwpHints(), nTmp, 0,
pNext->GetTxt().Len(), true );
if( pNext->HasSwAttrSet() )
@@ -673,14 +646,10 @@ _UnReplaceData::_UnReplaceData( const SwPaM& rPam, const String& rIns,
m_sOld = pNd->GetTxt().Copy( m_nSttCnt, nECnt - m_nSttCnt );
}
-_UnReplaceData::~_UnReplaceData()
-{
-}
-
-void _UnReplaceData::Undo( SwUndoIter& rIter )
+void SwUndoReplace::Impl::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc* pDoc = &rIter.GetDoc();
- SwPaM& rPam = *rIter.pAktPam;
+ SwDoc *const pDoc = & rContext.GetDoc();
+ SwPaM & rPam(rContext.GetCursorSupplier().CreateNewShellCursor());
rPam.DeleteMark();
SwTxtNode* pNd = pDoc->GetNodes()[ m_nSttNd - m_nOffset ]->GetTxtNode();
@@ -689,18 +658,18 @@ void _UnReplaceData::Undo( SwUndoIter& rIter )
SwAutoCorrExceptWord* pACEWord = pDoc->GetAutoCorrExceptWord();
if( pACEWord )
{
- if( 1 == m_sIns.Len() && 1 == m_sOld.Len() )
+ if ((1 == m_sIns.getLength()) && (1 == m_sOld.getLength()))
{
SwPosition aPos( *pNd ); aPos.nContent.Assign( pNd, m_nSttCnt );
- pACEWord->CheckChar( aPos, m_sOld.GetChar( 0 ) );
+ pACEWord->CheckChar( aPos, m_sOld[ 0 ] );
}
pDoc->SetAutoCorrExceptWord( 0 );
}
- SwIndex aIdx( pNd, m_nSttCnt );
+ SwIndex aIdx( pNd, sal_uInt16( m_nSttCnt ) );
if( m_nSttNd == m_nEndNd )
{
- pNd->EraseText( aIdx, m_sIns.Len() );
+ pNd->EraseText( aIdx, sal_uInt16( m_sIns.getLength() ) );
}
else
{
@@ -728,7 +697,7 @@ void _UnReplaceData::Undo( SwUndoIter& rIter )
pNd->RestoreMetadata(m_pMetadataUndoStart);
}
- if( m_sOld.Len() )
+ if (m_sOld.getLength())
{
pNd->InsertText( m_sOld, aIdx );
}
@@ -762,13 +731,10 @@ void _UnReplaceData::Undo( SwUndoIter& rIter )
rPam.GetPoint()->nContent = aIdx;
}
-void _UnReplaceData::Redo( SwUndoIter& rIter )
+void SwUndoReplace::Impl::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rIter.GetDoc();
- BOOL bUndo = rDoc.DoesUndo();
- rDoc.DoUndo( FALSE );
-
- SwPaM& rPam = *rIter.pAktPam;
+ SwDoc & rDoc = rContext.GetDoc();
+ SwPaM & rPam(rContext.GetCursorSupplier().CreateNewShellCursor());
rPam.DeleteMark();
rPam.GetPoint()->nNode = m_nSttNd;
@@ -805,21 +771,21 @@ void _UnReplaceData::Redo( SwUndoIter& rIter )
rDoc.ReplaceRange( rPam, m_sIns, m_bRegExp );
rPam.DeleteMark();
- rDoc.DoUndo( bUndo );
}
-void _UnReplaceData::SetEnd( const SwPaM& rPam )
+void SwUndoReplace::Impl::SetEnd(SwPaM const& rPam)
{
if( rPam.GetPoint()->nNode != rPam.GetMark()->nNode )
{
- // es wurden mehrere Absaetze eingefuegt
+ // multiple paragraphs were inserted
const SwPosition* pEnd = rPam.End();
m_nEndNd = m_nOffset + pEnd->nNode.GetIndex();
m_nEndCnt = pEnd->nContent.GetIndex();
}
}
-/* */
+
+// SwUndoReRead //////////////////////////////////////////////////////////
SwUndoReRead::SwUndoReRead( const SwPaM& rPam, const SwGrfNode& rGrfNd )
@@ -837,9 +803,9 @@ SwUndoReRead::~SwUndoReRead()
}
-void SwUndoReRead::SetAndSave( SwUndoIter& rIter )
+void SwUndoReRead::SetAndSave(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
SwGrfNode* pGrfNd = rDoc.GetNodes()[ nPos ]->GetGrfNode();
if( !pGrfNd )
@@ -849,37 +815,37 @@ void SwUndoReRead::SetAndSave( SwUndoIter& rIter )
Graphic* pOldGrf = pGrf;
String* pOldNm = pNm;
String* pOldFltr = pFltr;
- USHORT nOldMirr = nMirr;
+ sal_uInt16 nOldMirr = nMirr;
SaveGraphicData( *pGrfNd );
if( pOldNm )
{
- pGrfNd->ReRead( *pOldNm, pFltr ? *pFltr : aEmptyStr, 0, 0, TRUE );
+ pGrfNd->ReRead( *pOldNm, pFltr ? *pFltr : aEmptyStr, 0, 0, sal_True );
delete pOldNm;
delete pOldFltr;
}
else
{
- pGrfNd->ReRead( aEmptyStr, aEmptyStr, pOldGrf, 0, TRUE );
+ pGrfNd->ReRead( aEmptyStr, aEmptyStr, pOldGrf, 0, sal_True );
delete pOldGrf;
}
if( RES_MIRROR_GRAPH_DONT != nOldMirr )
pGrfNd->SetAttr( SwMirrorGrf() );
- rIter.pSelFmt = pGrfNd->GetFlyFmt();
+ rContext.SetSelections(pGrfNd->GetFlyFmt(), 0);
}
-void SwUndoReRead::Undo( SwUndoIter& rIter )
+void SwUndoReRead::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SetAndSave( rIter );
+ SetAndSave(rContext);
}
-void SwUndoReRead::Redo( SwUndoIter& rIter )
+void SwUndoReRead::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SetAndSave( rIter );
+ SetAndSave(rContext);
}
@@ -894,7 +860,7 @@ void SwUndoReRead::SaveGraphicData( const SwGrfNode& rGrfNd )
}
else
{
- ((SwGrfNode&)rGrfNd).SwapIn( TRUE );
+ ((SwGrfNode&)rGrfNd).SwapIn( sal_True );
pGrf = new Graphic( rGrfNd.GetGrf() );
pNm = pFltr = 0;
}
@@ -907,10 +873,10 @@ SwUndoInsertLabel::SwUndoInsertLabel( const SwLabelType eTyp,
const String &rTxt,
const String& rSeparator,
const String& rNumberSeparator,
- const BOOL bBef,
- const USHORT nInitId,
+ const sal_Bool bBef,
+ const sal_uInt16 nInitId,
const String& rCharacterStyle,
- const BOOL bCpyBorder )
+ const sal_Bool bCpyBorder )
: SwUndo( UNDO_INSERTLABEL ),
sText( rTxt ),
sSeparator( rSeparator ),
@@ -922,7 +888,7 @@ SwUndoInsertLabel::SwUndoInsertLabel( const SwLabelType eTyp,
bBefore( bBef ),
bCpyBrd( bCpyBorder )
{
- bUndoKeep = FALSE;
+ bUndoKeep = sal_False;
OBJECT.pUndoFly = 0;
OBJECT.pUndoAttr = 0;
}
@@ -938,9 +904,9 @@ SwUndoInsertLabel::~SwUndoInsertLabel()
delete NODE.pUndoInsNd;
}
-void SwUndoInsertLabel::Undo( SwUndoIter& rIter )
+void SwUndoInsertLabel::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
if( LTYPE_OBJECT == eType || LTYPE_DRAW == eType )
{
@@ -952,8 +918,8 @@ void SwUndoInsertLabel::Undo( SwUndoIter& rIter )
( LTYPE_DRAW != eType ||
0 != (pSdrObj = pFmt->FindSdrObject()) ) )
{
- OBJECT.pUndoAttr->Undo( rIter );
- OBJECT.pUndoFly->Undo( rIter );
+ OBJECT.pUndoAttr->UndoImpl(rContext);
+ OBJECT.pUndoFly->UndoImpl(rContext);
if( LTYPE_DRAW == eType )
{
pSdrObj->SetLayer( nLayerId );
@@ -969,18 +935,18 @@ void SwUndoInsertLabel::Undo( SwUndoIter& rIter )
if ( pNd )
pNd->GetTable().GetFrmFmt()->ResetFmtAttr( RES_KEEP );
}
- SwPaM aPam( *rIter.pAktPam->GetPoint() );
+ SwPaM aPam( rDoc.GetNodes().GetEndOfContent() );
aPam.GetPoint()->nNode = NODE.nNode;
aPam.SetMark();
aPam.GetPoint()->nNode = NODE.nNode + 1;
- NODE.pUndoInsNd = new SwUndoDelete( aPam, TRUE );
+ NODE.pUndoInsNd = new SwUndoDelete( aPam, sal_True );
}
}
-void SwUndoInsertLabel::Redo( SwUndoIter& rIter )
+void SwUndoInsertLabel::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
if( LTYPE_OBJECT == eType || LTYPE_DRAW == eType )
{
@@ -992,8 +958,8 @@ void SwUndoInsertLabel::Redo( SwUndoIter& rIter )
( LTYPE_DRAW != eType ||
0 != (pSdrObj = pFmt->FindSdrObject()) ) )
{
- OBJECT.pUndoFly->Redo( rIter );
- OBJECT.pUndoAttr->Redo( rIter );
+ OBJECT.pUndoFly->RedoImpl(rContext);
+ OBJECT.pUndoAttr->RedoImpl(rContext);
if( LTYPE_DRAW == eType )
{
pSdrObj->SetLayer( nLayerId );
@@ -1012,19 +978,19 @@ void SwUndoInsertLabel::Redo( SwUndoIter& rIter )
SwTableNode *pNd = rDoc.GetNodes()[
rDoc.GetNodes()[NODE.nNode-1]->StartOfSectionIndex()]->GetTableNode();
if ( pNd )
- pNd->GetTable().GetFrmFmt()->SetFmtAttr( SvxFmtKeepItem(TRUE, RES_KEEP) );
+ pNd->GetTable().GetFrmFmt()->SetFmtAttr( SvxFmtKeepItem(sal_True, RES_KEEP) );
}
- NODE.pUndoInsNd->Undo( rIter );
+ NODE.pUndoInsNd->UndoImpl(rContext);
delete NODE.pUndoInsNd, NODE.pUndoInsNd = 0;
}
}
-void SwUndoInsertLabel::Repeat( SwUndoIter& rIter )
+void SwUndoInsertLabel::RepeatImpl(::sw::RepeatContext & rContext)
{
- SwDoc& rDoc = rIter.GetDoc();
- const SwPosition& rPos = *rIter.pAktPam->GetPoint();
+ SwDoc & rDoc = rContext.GetDoc();
+ const SwPosition& rPos = *rContext.GetRepeatPaM().GetPoint();
- ULONG nIdx = 0;
+ sal_uLong nIdx = 0;
SwCntntNode* pCNd = rPos.nNode.GetNode().GetCntntNode();
if( pCNd )
@@ -1090,7 +1056,7 @@ void SwUndoInsertLabel::SetFlys( SwFrmFmt& rOldFly, SfxItemSet& rChgSet,
}
}
-void SwUndoInsertLabel::SetDrawObj( BYTE nLId )
+void SwUndoInsertLabel::SetDrawObj( sal_uInt8 nLId )
{
if( LTYPE_DRAW == eType )
{
diff --git a/sw/source/core/undo/unmove.cxx b/sw/source/core/undo/unmove.cxx
index 4c5fbca4085c..a29a0afa4ea2 100644
--- a/sw/source/core/undo/unmove.cxx
+++ b/sw/source/core/undo/unmove.cxx
@@ -28,17 +28,17 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <UndoSplitMove.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <pam.hxx>
#include <swundo.hxx> // fuer die UndoIds
#include <ndtxt.hxx>
-#include <undobj.hxx>
+#include <UndoCore.hxx>
#include <rolbck.hxx>
-inline SwDoc& SwUndoIter::GetDoc() const { return *pAktPam->GetDoc(); }
-
// MOVE
SwUndoMove::SwUndoMove( const SwPaM& rRange, const SwPosition& rMvPos )
@@ -47,7 +47,7 @@ SwUndoMove::SwUndoMove( const SwPaM& rRange, const SwPosition& rMvPos )
nMvDestCntnt( rMvPos.nContent.GetIndex() ),
bMoveRedlines( false )
{
- bMoveRange = bJoinNext = bJoinPrev = FALSE;
+ bMoveRange = bJoinNext = bJoinPrev = sal_False;
// StartNode vorm loeschen von Fussnoten besorgen!
SwDoc* pDoc = rRange.GetDoc();
@@ -79,7 +79,8 @@ SwUndoMove::SwUndoMove( const SwPaM& rRange, const SwPosition& rMvPos )
pHistory->CopyFmtAttr( *pEndTxtNd->GetpSwAttrSet(), nEndNode );
}
- if( 0 != (pTxtNd = rRange.GetDoc()->GetNodes()[ rMvPos.nNode ]->GetTxtNode() ))
+ pTxtNd = rMvPos.nNode.GetNode().GetTxtNode();
+ if (0 != pTxtNd)
{
pHistory->Add( pTxtNd->GetTxtColl(), nMvDestNode, ND_TEXTNODE );
if ( pTxtNd->GetpSwpHints() )
@@ -106,8 +107,8 @@ SwUndoMove::SwUndoMove( SwDoc* pDoc, const SwNodeRange& rRg,
nMvDestNode( rMvPos.GetIndex() ),
bMoveRedlines( false )
{
- bMoveRange = TRUE;
- bJoinNext = bJoinPrev = FALSE;
+ bMoveRange = sal_True;
+ bJoinNext = bJoinPrev = sal_False;
nSttCntnt = nEndCntnt = nMvDestCntnt = STRING_MAXLEN;
@@ -117,7 +118,7 @@ SwUndoMove::SwUndoMove( SwDoc* pDoc, const SwNodeRange& rRg,
// DelFtn( rRange );
// wird aus dem CntntBereich in den Sonderbereich verschoben ?
- ULONG nCntntStt = pDoc->GetNodes().GetEndOfAutotext().GetIndex();
+ sal_uLong nCntntStt = pDoc->GetNodes().GetEndOfAutotext().GetIndex();
if( nMvDestNode < nCntntStt && rRg.aStart.GetIndex() > nCntntStt )
{
// loesche alle Fussnoten. Diese sind dort nicht erwuenscht.
@@ -142,7 +143,7 @@ SwUndoMove::SwUndoMove( SwDoc* pDoc, const SwNodeRange& rRg,
void SwUndoMove::SetDestRange( const SwPaM& rRange,
const SwPosition& rInsPos,
- BOOL bJoin, BOOL bCorrPam )
+ sal_Bool bJoin, sal_Bool bCorrPam )
{
const SwPosition *pStt = rRange.Start(),
*pEnd = rRange.GetPoint() == pStt
@@ -187,11 +188,9 @@ void SwUndoMove::SetDestRange( const SwNodeIndex& rStt,
}
-void SwUndoMove::Undo( SwUndoIter& rUndoIter )
+void SwUndoMove::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc* pDoc = &rUndoIter.GetDoc();
- BOOL bUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ SwDoc *const pDoc = & rContext.GetDoc();
// Block, damit aus diesem gesprungen werden kann
do {
@@ -217,7 +216,7 @@ void SwUndoMove::Undo( SwUndoIter& rUndoIter )
// #i17764# if redlines are to be moved, we may not remove them before
// pDoc->Move gets a chance to handle them
if( ! bMoveRedlines )
- RemoveIdxFromRange( aPam, FALSE );
+ RemoveIdxFromRange( aPam, sal_False );
SwPosition aPos( *pDoc->GetNodes()[ nInsPosNode] );
SwCntntNode* pCNd = aPos.nNode.GetNode().GetCntntNode();
@@ -238,7 +237,7 @@ void SwUndoMove::Undo( SwUndoIter& rUndoIter )
aPam.Exchange();
aPam.DeleteMark();
-// pDoc->ResetAttr( aPam, FALSE );
+// pDoc->ResetAttr( aPam, sal_False );
if( aPam.GetNode()->IsCntntNode() )
aPam.GetNode()->GetCntntNode()->ResetAllAttr();
// der Pam wird jetzt aufgegeben.
@@ -266,7 +265,7 @@ void SwUndoMove::Undo( SwUndoIter& rUndoIter )
pTxtNd->JoinNext();
}
- } while( FALSE );
+ } while( sal_False );
if( pHistory )
{
@@ -276,18 +275,18 @@ void SwUndoMove::Undo( SwUndoIter& rUndoIter )
pHistory->SetTmpEnd( pHistory->Count() );
}
- pDoc->DoUndo( bUndo );
-
// setze noch den Cursor auf den Undo-Bereich
if( !bMoveRange )
- SetPaM( rUndoIter );
+ {
+ AddUndoRedoPaM(rContext);
+ }
}
-void SwUndoMove::Redo( SwUndoIter& rUndoIter )
+void SwUndoMove::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwPaM* pPam = rUndoIter.pAktPam;
- SwDoc& rDoc = *pPam->GetDoc();
+ SwPaM *const pPam = & AddUndoRedoPaM(rContext);
+ SwDoc & rDoc = rContext.GetDoc();
SwNodes& rNds = rDoc.GetNodes();
SwNodeIndex aIdx( rNds, nMvDestNode );
@@ -308,10 +307,10 @@ void SwUndoMove::Redo( SwUndoIter& rUndoIter )
nMvDestCntnt ));
DelFtn( aPam );
- RemoveIdxFromRange( aPam, FALSE );
+ RemoveIdxFromRange( aPam, sal_False );
aIdx = aPam.Start()->nNode;
- BOOL bJoinTxt = aIdx.GetNode().IsTxtNode();
+ sal_Bool bJoinTxt = aIdx.GetNode().IsTxtNode();
aIdx--;
rDoc.MoveRange( aPam, aMvPos,
@@ -341,7 +340,7 @@ void SwUndoMove::DelFtn( const SwPaM& rRange )
{
// wird aus dem CntntBereich in den Sonderbereich verschoben ?
SwDoc* pDoc = rRange.GetDoc();
- ULONG nCntntStt = pDoc->GetNodes().GetEndOfAutotext().GetIndex();
+ sal_uLong nCntntStt = pDoc->GetNodes().GetEndOfAutotext().GetIndex();
if( nMvDestNode < nCntntStt &&
rRange.GetPoint()->nNode.GetIndex() >= nCntntStt )
{
diff --git a/sw/source/core/undo/unnum.cxx b/sw/source/core/undo/unnum.cxx
index 8cf782e85b53..9e18dfe79611 100644
--- a/sw/source/core/undo/unnum.cxx
+++ b/sw/source/core/undo/unnum.cxx
@@ -28,21 +28,22 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <UndoNumbering.hxx>
#include <hintids.hxx>
#include <editeng/lrspitem.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <swundo.hxx> // fuer die UndoIds
#include <pam.hxx>
#include <ndtxt.hxx>
-#include <undobj.hxx>
+#include <UndoCore.hxx>
#include <rolbck.hxx>
SV_DECL_PTRARR_DEL( _SfxPoolItems, SfxPoolItem*, 16, 16 )
SV_IMPL_PTRARR( _SfxPoolItems, SfxPoolItem* );
-inline SwDoc& SwUndoIter::GetDoc() const { return *pAktPam->GetDoc(); }
SwUndoInsNum::SwUndoInsNum( const SwNumRule& rOldRule,
const SwNumRule& rNewRule,
@@ -87,14 +88,9 @@ SwRewriter SwUndoInsNum::GetRewriter() const
return aResult;
}
-void SwUndoInsNum::Undo( SwUndoIter& rUndoIter )
+void SwUndoInsNum::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
- if( nSttNode )
- SetPaM( rUndoIter );
-
- BOOL bUndo = rDoc.DoesUndo();
- rDoc.DoUndo( FALSE );
+ SwDoc & rDoc = rContext.GetDoc();
if( pOldNumRule )
rDoc.ChgNumRuleFmts( *pOldNumRule );
@@ -104,7 +100,7 @@ void SwUndoInsNum::Undo( SwUndoIter& rUndoIter )
SwTxtNode* pNd;
if( ULONG_MAX != nSttSet &&
0 != ( pNd = rDoc.GetNodes()[ nSttSet ]->GetTxtNode() ))
- pNd->SetListRestart( TRUE );
+ pNd->SetListRestart( sal_True );
else
pNd = 0;
@@ -134,29 +130,31 @@ void SwUndoInsNum::Undo( SwUndoIter& rUndoIter )
pHistory->SetTmpEnd( pHistory->Count() );
}
- if( nSttNode )
- SetPaM( rUndoIter );
- rDoc.DoUndo( bUndo );
+ if (nSttNode)
+ {
+ AddUndoRedoPaM(rContext);
+ }
}
-
-void SwUndoInsNum::Redo( SwUndoIter& rUndoIter )
+void SwUndoInsNum::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
if( pOldNumRule )
rDoc.ChgNumRuleFmts( aNumRule );
else if( pHistory )
{
- SetPaM( rUndoIter );
+ SwPaM & rPam( AddUndoRedoPaM(rContext) );
if( sReplaceRule.Len() )
- rDoc.ReplaceNumRule( *rUndoIter.pAktPam->GetPoint(),
+ {
+ rDoc.ReplaceNumRule(*rPam.GetPoint(),
sReplaceRule, aNumRule.GetName() );
+ }
else
{
// --> OD 2005-02-25 #i42921# - adapt to changed signature
// --> OD 2008-03-18 #refactorlists#
- rDoc.SetNumRule( *rUndoIter.pAktPam, aNumRule, false );
+ rDoc.SetNumRule(rPam, aNumRule, false);
// <--
}
}
@@ -168,20 +166,23 @@ void SwUndoInsNum::SetLRSpaceEndPos()
nLRSavePos = pHistory->Count();
}
-void SwUndoInsNum::Repeat( SwUndoIter& rUndoIter )
+void SwUndoInsNum::RepeatImpl(::sw::RepeatContext & rContext)
{
+ SwDoc & rDoc(rContext.GetDoc());
if( nSttNode )
{
if( !sReplaceRule.Len() )
{
// --> OD 2005-02-25 #i42921# - adapt to changed signature
// --> OD 2008-03-18 #refactorlists#
- rUndoIter.GetDoc().SetNumRule( *rUndoIter.pAktPam, aNumRule, false );
+ rDoc.SetNumRule(rContext.GetRepeatPaM(), aNumRule, false);
// <--
}
}
else
- rUndoIter.GetDoc().ChgNumRuleFmts( aNumRule );
+ {
+ rDoc.ChgNumRuleFmts( aNumRule );
+ }
}
SwHistory* SwUndoInsNum::GetHistory()
@@ -202,30 +203,24 @@ void SwUndoInsNum::SaveOldNumRule( const SwNumRule& rOld )
SwUndoDelNum::SwUndoDelNum( const SwPaM& rPam )
: SwUndo( UNDO_DELNUM ), SwUndRng( rPam ),
- aNodeIdx( BYTE( nEndNode - nSttNode > 255 ? 255 : nEndNode - nSttNode ))
+ aNodeIdx( sal_uInt8( nEndNode - nSttNode > 255 ? 255 : nEndNode - nSttNode ))
{
pHistory = new SwHistory;
}
-
SwUndoDelNum::~SwUndoDelNum()
{
delete pHistory;
}
-
-void SwUndoDelNum::Undo( SwUndoIter& rUndoIter )
+void SwUndoDelNum::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
- SetPaM( rUndoIter );
-
- BOOL bUndo = rDoc.DoesUndo();
- rDoc.DoUndo( FALSE );
+ SwDoc & rDoc = rContext.GetDoc();
pHistory->TmpRollback( &rDoc, 0 );
pHistory->SetTmpEnd( pHistory->Count() );
- for( USHORT n = 0; n < aNodeIdx.Count(); ++n )
+ for( sal_uInt16 n = 0; n < aNodeIdx.Count(); ++n )
{
SwTxtNode* pNd = rDoc.GetNodes()[ aNodeIdx[ n ] ]->GetTxtNode();
ASSERT( pNd, "Where is TextNode gone?" );
@@ -235,32 +230,28 @@ void SwUndoDelNum::Undo( SwUndoIter& rUndoIter )
pNd->ChkCondColl();
}
- SetPaM( rUndoIter );
- rDoc.DoUndo( bUndo );
+ AddUndoRedoPaM(rContext);
}
-
-void SwUndoDelNum::Redo( SwUndoIter& rUndoIter )
+void SwUndoDelNum::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SetPaM( rUndoIter );
- rUndoIter.GetDoc().DelNumRules( *rUndoIter.pAktPam );
+ SwPaM & rPam( AddUndoRedoPaM(rContext) );
+ rContext.GetDoc().DelNumRules(rPam);
}
-
-void SwUndoDelNum::Repeat( SwUndoIter& rUndoIter )
+void SwUndoDelNum::RepeatImpl(::sw::RepeatContext & rContext)
{
- SetPaM( rUndoIter );
- rUndoIter.GetDoc().DelNumRules( *rUndoIter.pAktPam );
+ rContext.GetDoc().DelNumRules(rContext.GetRepeatPaM());
}
-void SwUndoDelNum::AddNode( const SwTxtNode& rNd, BOOL )
+void SwUndoDelNum::AddNode( const SwTxtNode& rNd, sal_Bool )
{
if( rNd.GetNumRule() )
{
- USHORT nIns = aNodeIdx.Count();
+ sal_uInt16 nIns = aNodeIdx.Count();
aNodeIdx.Insert( rNd.GetIndex(), nIns );
- aLevels.insert( aLevels.begin() + nIns, static_cast<BYTE>(rNd.GetActualListLevel()) );
+ aLevels.insert( aLevels.begin() + nIns, static_cast<sal_uInt8>(rNd.GetActualListLevel()) );
}
}
@@ -268,7 +259,7 @@ void SwUndoDelNum::AddNode( const SwTxtNode& rNd, BOOL )
/* */
-SwUndoMoveNum::SwUndoMoveNum( const SwPaM& rPam, long nOff, BOOL bIsOutlMv )
+SwUndoMoveNum::SwUndoMoveNum( const SwPaM& rPam, long nOff, sal_Bool bIsOutlMv )
: SwUndo( bIsOutlMv ? UNDO_OUTLINE_UD : UNDO_MOVENUM ),
SwUndRng( rPam ),
nNewStt( 0 ), nOffset( nOff )
@@ -277,10 +268,9 @@ SwUndoMoveNum::SwUndoMoveNum( const SwPaM& rPam, long nOff, BOOL bIsOutlMv )
// nach oben => -1
}
-
-void SwUndoMoveNum::Undo( SwUndoIter& rUndoIter )
+void SwUndoMoveNum::UndoImpl(::sw::UndoRedoContext & rContext)
{
- ULONG nTmpStt = nSttNode, nTmpEnd = nEndNode;
+ sal_uLong nTmpStt = nSttNode, nTmpEnd = nEndNode;
if( nEndNode || USHRT_MAX != nEndCntnt ) // Bereich ?
{
@@ -293,35 +283,37 @@ void SwUndoMoveNum::Undo( SwUndoIter& rUndoIter )
//JP 22.06.95: wird wollen die Bookmarks/Verzeichnisse behalten, oder?
// SetPaM( rUndoIter );
-// RemoveIdxFromRange( *rUndoIter.pAktPam, TRUE );
+// RemoveIdxFromRange( *rUndoIter.pAktPam, sal_True );
- SetPaM( rUndoIter );
- rUndoIter.GetDoc().MoveParagraph( *rUndoIter.pAktPam, -nOffset,
+ SwPaM & rPam( AddUndoRedoPaM(rContext) );
+ rContext.GetDoc().MoveParagraph( rPam, -nOffset,
UNDO_OUTLINE_UD == GetId() );
nSttNode = nTmpStt;
nEndNode = nTmpEnd;
}
-
-void SwUndoMoveNum::Redo( SwUndoIter& rUndoIter )
+void SwUndoMoveNum::RedoImpl(::sw::UndoRedoContext & rContext)
{
//JP 22.06.95: wird wollen die Bookmarks/Verzeichnisse behalten, oder?
// SetPaM( rUndoIter );
-// RemoveIdxFromRange( *rUndoIter.pAktPam, TRUE );
+// RemoveIdxFromRange( *rUndoIter.pAktPam, sal_True );
- SetPaM( rUndoIter );
- rUndoIter.GetDoc().MoveParagraph( *rUndoIter.pAktPam, nOffset,
- UNDO_OUTLINE_UD == GetId() );
+ SwPaM & rPam( AddUndoRedoPaM(rContext) );
+ rContext.GetDoc().MoveParagraph(rPam, nOffset, UNDO_OUTLINE_UD == GetId());
}
-
-void SwUndoMoveNum::Repeat( SwUndoIter& rUndoIter )
+void SwUndoMoveNum::RepeatImpl(::sw::RepeatContext & rContext)
{
+ SwDoc & rDoc = rContext.GetDoc();
if( UNDO_OUTLINE_UD == GetId() )
- rUndoIter.GetDoc().MoveOutlinePara( *rUndoIter.pAktPam,
+ {
+ rDoc.MoveOutlinePara(rContext.GetRepeatPaM(),
0 < nOffset ? 1 : -1 );
+ }
else
- rUndoIter.GetDoc().MoveParagraph( *rUndoIter.pAktPam, nOffset, FALSE );
+ {
+ rDoc.MoveParagraph(rContext.GetRepeatPaM(), nOffset, sal_False);
+ }
}
/* */
@@ -335,40 +327,37 @@ SwUndoNumUpDown::SwUndoNumUpDown( const SwPaM& rPam, short nOff )
// Up => -1
}
-
-void SwUndoNumUpDown::Undo( SwUndoIter& rUndoIter )
+void SwUndoNumUpDown::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SetPaM( rUndoIter );
- rUndoIter.GetDoc().NumUpDown( *rUndoIter.pAktPam, 1 != nOffset );
+ SwPaM & rPam( AddUndoRedoPaM(rContext) );
+ rContext.GetDoc().NumUpDown(rPam, 1 != nOffset );
}
-
-void SwUndoNumUpDown::Redo( SwUndoIter& rUndoIter )
+void SwUndoNumUpDown::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SetPaM( rUndoIter );
- rUndoIter.GetDoc().NumUpDown( *rUndoIter.pAktPam, 1 == nOffset );
+ SwPaM & rPam( AddUndoRedoPaM(rContext) );
+ rContext.GetDoc().NumUpDown(rPam, 1 == nOffset);
}
-
-void SwUndoNumUpDown::Repeat( SwUndoIter& rUndoIter )
+void SwUndoNumUpDown::RepeatImpl(::sw::RepeatContext & rContext)
{
- rUndoIter.GetDoc().NumUpDown( *rUndoIter.pAktPam, 1 == nOffset );
+ rContext.GetDoc().NumUpDown(rContext.GetRepeatPaM(), 1 == nOffset);
}
/* */
// #115901#
-SwUndoNumOrNoNum::SwUndoNumOrNoNum( const SwNodeIndex& rIdx, BOOL bOldNum,
- BOOL bNewNum)
+SwUndoNumOrNoNum::SwUndoNumOrNoNum( const SwNodeIndex& rIdx, sal_Bool bOldNum,
+ sal_Bool bNewNum)
: SwUndo( UNDO_NUMORNONUM ), nIdx( rIdx.GetIndex() ), mbNewNum(bNewNum),
mbOldNum(bOldNum)
{
}
// #115901#, #i40034#
-void SwUndoNumOrNoNum::Undo( SwUndoIter& rUndoIter )
+void SwUndoNumOrNoNum::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwNodeIndex aIdx( rUndoIter.GetDoc().GetNodes(), nIdx );
+ SwNodeIndex aIdx( rContext.GetDoc().GetNodes(), nIdx );
SwTxtNode * pTxtNd = aIdx.GetNode().GetTxtNode();
if (NULL != pTxtNd)
@@ -378,9 +367,9 @@ void SwUndoNumOrNoNum::Undo( SwUndoIter& rUndoIter )
}
// #115901#, #i40034#
-void SwUndoNumOrNoNum::Redo( SwUndoIter& rUndoIter )
+void SwUndoNumOrNoNum::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwNodeIndex aIdx( rUndoIter.GetDoc().GetNodes(), nIdx );
+ SwNodeIndex aIdx( rContext.GetDoc().GetNodes(), nIdx );
SwTxtNode * pTxtNd = aIdx.GetNode().GetTxtNode();
if (NULL != pTxtNd)
@@ -390,30 +379,32 @@ void SwUndoNumOrNoNum::Redo( SwUndoIter& rUndoIter )
}
// #115901#
-void SwUndoNumOrNoNum::Repeat( SwUndoIter& rUndoIter )
+void SwUndoNumOrNoNum::RepeatImpl(::sw::RepeatContext & rContext)
{
-
+ SwDoc & rDoc = rContext.GetDoc();
if (mbOldNum && ! mbNewNum)
- rUndoIter.GetDoc().NumOrNoNum( rUndoIter.pAktPam->GetPoint()->nNode,
- FALSE);
+ {
+ rDoc.NumOrNoNum(rContext.GetRepeatPaM().GetPoint()->nNode, sal_False);
+ }
else if ( ! mbOldNum && mbNewNum )
- rUndoIter.GetDoc().NumOrNoNum( rUndoIter.pAktPam->GetPoint()->nNode,
- TRUE);
+ {
+ rDoc.NumOrNoNum(rContext.GetRepeatPaM().GetPoint()->nNode, sal_True);
+ }
}
/* */
-SwUndoNumRuleStart::SwUndoNumRuleStart( const SwPosition& rPos, BOOL bFlg )
+SwUndoNumRuleStart::SwUndoNumRuleStart( const SwPosition& rPos, sal_Bool bFlg )
: SwUndo( UNDO_SETNUMRULESTART ),
nIdx( rPos.nNode.GetIndex() ), nOldStt( USHRT_MAX ),
- nNewStt( USHRT_MAX ), bSetSttValue( FALSE ), bFlag( bFlg )
+ nNewStt( USHRT_MAX ), bSetSttValue( sal_False ), bFlag( bFlg )
{
}
-SwUndoNumRuleStart::SwUndoNumRuleStart( const SwPosition& rPos, USHORT nStt )
+SwUndoNumRuleStart::SwUndoNumRuleStart( const SwPosition& rPos, sal_uInt16 nStt )
: SwUndo( UNDO_SETNUMRULESTART ),
nIdx( rPos.nNode.GetIndex() ),
- nOldStt( USHRT_MAX ), nNewStt( nStt ), bSetSttValue( TRUE )
+ nOldStt( USHRT_MAX ), nNewStt( nStt ), bSetSttValue( sal_True )
{
SwTxtNode* pTxtNd = rPos.nNode.GetNode().GetTxtNode();
if ( pTxtNd )
@@ -421,7 +412,7 @@ SwUndoNumRuleStart::SwUndoNumRuleStart( const SwPosition& rPos, USHORT nStt )
// --> OD 2008-02-28 #refactorlists#
if ( pTxtNd->HasAttrListRestartValue() )
{
- nOldStt = static_cast<USHORT>(pTxtNd->GetAttrListRestartValue());
+ nOldStt = static_cast<sal_uInt16>(pTxtNd->GetAttrListRestartValue());
}
else
{
@@ -432,34 +423,47 @@ SwUndoNumRuleStart::SwUndoNumRuleStart( const SwPosition& rPos, USHORT nStt )
}
-void SwUndoNumRuleStart::Undo( SwUndoIter& rUndoIter )
+void SwUndoNumRuleStart::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwPosition aPos( *rUndoIter.GetDoc().GetNodes()[ nIdx ] );
+ SwDoc & rDoc = rContext.GetDoc();
+ SwPosition const aPos( *rDoc.GetNodes()[ nIdx ] );
if( bSetSttValue )
- rUndoIter.GetDoc().SetNodeNumStart( aPos, nOldStt );
+ {
+ rDoc.SetNodeNumStart( aPos, nOldStt );
+ }
else
- rUndoIter.GetDoc().SetNumRuleStart( aPos, !bFlag );
+ {
+ rDoc.SetNumRuleStart( aPos, !bFlag );
+ }
}
-void SwUndoNumRuleStart::Redo( SwUndoIter& rUndoIter )
+void SwUndoNumRuleStart::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
-
- SwPosition aPos( *rDoc.GetNodes()[ nIdx ] );
+ SwDoc & rDoc = rContext.GetDoc();
+ SwPosition const aPos( *rDoc.GetNodes()[ nIdx ] );
if( bSetSttValue )
+ {
rDoc.SetNodeNumStart( aPos, nNewStt );
+ }
else
+ {
rDoc.SetNumRuleStart( aPos, bFlag );
+ }
}
-void SwUndoNumRuleStart::Repeat( SwUndoIter& rUndoIter )
+void SwUndoNumRuleStart::RepeatImpl(::sw::RepeatContext & rContext)
{
+ SwDoc & rDoc = rContext.GetDoc();
if( bSetSttValue )
- rUndoIter.GetDoc().SetNodeNumStart( *rUndoIter.pAktPam->GetPoint(), nNewStt );
+ {
+ rDoc.SetNodeNumStart(*rContext.GetRepeatPaM().GetPoint(), nNewStt);
+ }
else
- rUndoIter.GetDoc().SetNumRuleStart( *rUndoIter.pAktPam->GetPoint(), bFlag );
+ {
+ rDoc.SetNumRuleStart(*rContext.GetRepeatPaM().GetPoint(), bFlag);
+ }
}
diff --git a/sw/source/core/undo/unoutl.cxx b/sw/source/core/undo/unoutl.cxx
index 2a92097221b6..bbe80824d44a 100644
--- a/sw/source/core/undo/unoutl.cxx
+++ b/sw/source/core/undo/unoutl.cxx
@@ -28,43 +28,34 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-
#include "doc.hxx"
#include "swundo.hxx" // fuer die UndoIds
#include "pam.hxx"
#include "ndtxt.hxx"
-#include "undobj.hxx"
+#include <UndoCore.hxx>
-inline SwDoc& SwUndoIter::GetDoc() const { return *pAktPam->GetDoc(); }
-
SwUndoOutlineLeftRight::SwUndoOutlineLeftRight( const SwPaM& rPam,
short nOff )
: SwUndo( UNDO_OUTLINE_LR ), SwUndRng( rPam ), nOffset( nOff )
{
}
-
-void SwUndoOutlineLeftRight::Undo( SwUndoIter& rUndoIter )
+void SwUndoOutlineLeftRight::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SetPaM( rUndoIter );
- rUndoIter.GetDoc().OutlineUpDown( *rUndoIter.pAktPam, -nOffset );
+ SwPaM & rPaM( AddUndoRedoPaM(rContext) );
+ rContext.GetDoc().OutlineUpDown(rPaM, -nOffset);
}
-
-void SwUndoOutlineLeftRight::Redo( SwUndoIter& rUndoIter )
+void SwUndoOutlineLeftRight::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SetPaM( rUndoIter );
- rUndoIter.GetDoc().OutlineUpDown( *rUndoIter.pAktPam, nOffset );
+ SwPaM & rPaM( AddUndoRedoPaM(rContext) );
+ rContext.GetDoc().OutlineUpDown(rPaM, nOffset);
}
-
-void SwUndoOutlineLeftRight::Repeat( SwUndoIter& rUndoIter )
+void SwUndoOutlineLeftRight::RepeatImpl(::sw::RepeatContext & rContext)
{
- rUndoIter.GetDoc().OutlineUpDown( *rUndoIter.pAktPam, nOffset );
+ rContext.GetDoc().OutlineUpDown(rContext.GetRepeatPaM(), nOffset);
}
-
-
diff --git a/sw/source/core/undo/unovwr.cxx b/sw/source/core/undo/unovwr.cxx
index 91549c84a57e..eb6a525a8cc6 100644
--- a/sw/source/core/undo/unovwr.cxx
+++ b/sw/source/core/undo/unovwr.cxx
@@ -28,20 +28,26 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <UndoOverwrite.hxx>
+
+#include <tools/resid.hxx>
#include <unotools/charclass.hxx>
#include <unotools/transliterationwrapper.hxx>
+
#include <comphelper/processfactory.hxx>
+
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
+#include <IShellCursorSupplier.hxx>
#include <swundo.hxx> // fuer die UndoIds
#include <pam.hxx>
#include <ndtxt.hxx>
-#include <undobj.hxx>
+#include <UndoCore.hxx>
#include <rolbck.hxx>
#include <acorrect.hxx>
#include <docary.hxx>
-#include <tools/resid.hxx>
#include <comcore.hrc> // #111827#
#include <undo.hrc>
@@ -49,33 +55,23 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::i18n;
using namespace ::com::sun::star::uno;
-//------------------------------------------------------------------
-
-// zwei Zugriffs-Funktionen
-inline SwPosition* IterPt( SwUndoIter& rUIter )
-{ return rUIter.pAktPam->GetPoint(); }
-inline SwPosition* IterMk( SwUndoIter& rUIter )
-{ return rUIter.pAktPam->GetMark(); }
-
-inline SwDoc& SwUndoIter::GetDoc() const { return *pAktPam->GetDoc(); }
//------------------------------------------------------------
-
// OVERWRITE
SwUndoOverwrite::SwUndoOverwrite( SwDoc* pDoc, SwPosition& rPos,
sal_Unicode cIns )
: SwUndo(UNDO_OVERWRITE),
- pRedlSaveData( 0 ), bGroup( FALSE )
+ pRedlSaveData( 0 ), bGroup( sal_False )
{
if( !pDoc->IsIgnoreRedline() && pDoc->GetRedlineTbl().Count() )
{
SwPaM aPam( rPos.nNode, rPos.nContent.GetIndex(),
rPos.nNode, rPos.nContent.GetIndex()+1 );
pRedlSaveData = new SwRedlineSaveDatas;
- if( !FillSaveData( aPam, *pRedlSaveData, FALSE ))
+ if( !FillSaveData( aPam, *pRedlSaveData, sal_False ))
delete pRedlSaveData, pRedlSaveData = 0;
}
@@ -85,7 +81,7 @@ SwUndoOverwrite::SwUndoOverwrite( SwDoc* pDoc, SwPosition& rPos,
SwTxtNode* pTxtNd = rPos.nNode.GetNode().GetTxtNode();
ASSERT( pTxtNd, "Overwrite nicht im TextNode?" );
- bInsChar = TRUE;
+ bInsChar = sal_True;
xub_StrLen nTxtNdLen = pTxtNd->GetTxt().Len();
if( nSttCntnt < nTxtNdLen ) // kein reines Einfuegen ?
{
@@ -96,11 +92,11 @@ SwUndoOverwrite::SwUndoOverwrite( SwDoc* pDoc, SwPosition& rPos,
pHistory->CopyAttr( pTxtNd->GetpSwpHints(), nSttNode, 0,
nTxtNdLen, false );
rPos.nContent++;
- bInsChar = FALSE;
+ bInsChar = sal_False;
}
- BOOL bOldExpFlg = pTxtNd->IsIgnoreDontExpand();
- pTxtNd->SetIgnoreDontExpand( TRUE );
+ sal_Bool bOldExpFlg = pTxtNd->IsIgnoreDontExpand();
+ pTxtNd->SetIgnoreDontExpand( sal_True );
pTxtNd->InsertText( cIns, rPos.nContent,
IDocumentContentOperations::INS_EMPTYEXPAND );
@@ -121,7 +117,7 @@ SwUndoOverwrite::~SwUndoOverwrite()
delete pRedlSaveData;
}
-BOOL SwUndoOverwrite::CanGrouping( SwDoc* pDoc, SwPosition& rPos,
+sal_Bool SwUndoOverwrite::CanGrouping( SwDoc* pDoc, SwPosition& rPos,
sal_Unicode cIns )
{
/// ?? was ist mit nur eingefuegten Charaktern ???
@@ -129,14 +125,14 @@ BOOL SwUndoOverwrite::CanGrouping( SwDoc* pDoc, SwPosition& rPos,
// es kann nur das Loeschen von einzelnen char's zusammengefasst werden
if( rPos.nNode != nSttNode || !aInsStr.Len() ||
( !bGroup && aInsStr.Len() != 1 ))
- return FALSE;
+ return sal_False;
// ist der Node ueberhaupt ein TextNode?
SwTxtNode * pDelTxtNd = rPos.nNode.GetNode().GetTxtNode();
if( !pDelTxtNd ||
( pDelTxtNd->GetTxt().Len() != rPos.nContent.GetIndex() &&
rPos.nContent.GetIndex() != ( nSttCntnt + aInsStr.Len() )))
- return FALSE;
+ return sal_False;
CharClass& rCC = GetAppCharClass();
@@ -144,23 +140,23 @@ BOOL SwUndoOverwrite::CanGrouping( SwDoc* pDoc, SwPosition& rPos,
if (( CH_TXTATR_BREAKWORD == cIns || CH_TXTATR_INWORD == cIns ) ||
rCC.isLetterNumeric( String( cIns ), 0 ) !=
rCC.isLetterNumeric( aInsStr, aInsStr.Len()-1 ) )
- return FALSE;
+ return sal_False;
{
SwRedlineSaveDatas* pTmpSav = new SwRedlineSaveDatas;
SwPaM aPam( rPos.nNode, rPos.nContent.GetIndex(),
rPos.nNode, rPos.nContent.GetIndex()+1 );
- if( !FillSaveData( aPam, *pTmpSav, FALSE ))
+ if( !FillSaveData( aPam, *pTmpSav, sal_False ))
delete pTmpSav, pTmpSav = 0;
- BOOL bOk = ( !pRedlSaveData && !pTmpSav ) ||
+ sal_Bool bOk = ( !pRedlSaveData && !pTmpSav ) ||
( pRedlSaveData && pTmpSav &&
SwUndo::CanRedlineGroup( *pRedlSaveData, *pTmpSav,
nSttCntnt > rPos.nContent.GetIndex() ));
delete pTmpSav;
if( !bOk )
- return FALSE;
+ return sal_False;
pDoc->DeleteRedline( aPam, false, USHRT_MAX );
}
@@ -175,11 +171,11 @@ BOOL SwUndoOverwrite::CanGrouping( SwDoc* pDoc, SwPosition& rPos,
rPos.nContent++;
}
else
- bInsChar = TRUE;
+ bInsChar = sal_True;
}
- BOOL bOldExpFlg = pDelTxtNd->IsIgnoreDontExpand();
- pDelTxtNd->SetIgnoreDontExpand( TRUE );
+ sal_Bool bOldExpFlg = pDelTxtNd->IsIgnoreDontExpand();
+ pDelTxtNd->SetIgnoreDontExpand( sal_True );
pDelTxtNd->InsertText( cIns, rPos.nContent,
IDocumentContentOperations::INS_EMPTYEXPAND );
@@ -192,18 +188,19 @@ BOOL SwUndoOverwrite::CanGrouping( SwDoc* pDoc, SwPosition& rPos,
}
pDelTxtNd->SetIgnoreDontExpand( bOldExpFlg );
- bGroup = TRUE;
- return TRUE;
+ bGroup = sal_True;
+ return sal_True;
}
-void SwUndoOverwrite::Undo( SwUndoIter& rUndoIter )
+void SwUndoOverwrite::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwPaM* pAktPam = rUndoIter.pAktPam;
- SwDoc* pDoc = pAktPam->GetDoc();
+ SwDoc *const pDoc = & rContext.GetDoc();
+ SwPaM *const pAktPam(& rContext.GetCursorSupplier().CreateNewShellCursor());
+
pAktPam->DeleteMark();
pAktPam->GetPoint()->nNode = nSttNode;
SwTxtNode* pTxtNd = pAktPam->GetNode()->GetTxtNode();
@@ -233,8 +230,8 @@ void SwUndoOverwrite::Undo( SwUndoIter& rUndoIter )
String aTmpStr( '1' );
sal_Unicode* pTmpStr = aTmpStr.GetBufferAccess();
- BOOL bOldExpFlg = pTxtNd->IsIgnoreDontExpand();
- pTxtNd->SetIgnoreDontExpand( TRUE );
+ sal_Bool bOldExpFlg = pTxtNd->IsIgnoreDontExpand();
+ pTxtNd->SetIgnoreDontExpand( sal_True );
rIdx++;
for( xub_StrLen n = 0; n < aDelStr.Len(); n++ )
@@ -266,29 +263,27 @@ void SwUndoOverwrite::Undo( SwUndoIter& rUndoIter )
SetSaveData( *pDoc, *pRedlSaveData );
}
-void SwUndoOverwrite::Repeat( SwUndoIter& rUndoIter )
+void SwUndoOverwrite::RepeatImpl(::sw::RepeatContext & rContext)
{
- rUndoIter.pLastUndoObj = this;
- SwPaM* pAktPam = rUndoIter.pAktPam;
+ SwPaM *const pAktPam = & rContext.GetRepeatPaM();
if( !aInsStr.Len() || pAktPam->HasMark() )
return;
- SwDoc& rDoc = *pAktPam->GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
- BOOL bGroupUndo = rDoc.DoesGroupUndo();
- rDoc.DoGroupUndo( FALSE );
- rDoc.Overwrite( *pAktPam, aInsStr.GetChar( 0 ));
- rDoc.DoGroupUndo( bGroupUndo );
+ {
+ ::sw::GroupUndoGuard const undoGuard(rDoc.GetIDocumentUndoRedo());
+ rDoc.Overwrite(*pAktPam, aInsStr.GetChar(0));
+ }
for( xub_StrLen n = 1; n < aInsStr.Len(); ++n )
rDoc.Overwrite( *pAktPam, aInsStr.GetChar( n ) );
}
-
-
-void SwUndoOverwrite::Redo( SwUndoIter& rUndoIter )
+void SwUndoOverwrite::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwPaM* pAktPam = rUndoIter.pAktPam;
- SwDoc* pDoc = pAktPam->GetDoc();
+ SwDoc *const pDoc = & rContext.GetDoc();
+ SwPaM *const pAktPam(& rContext.GetCursorSupplier().CreateNewShellCursor());
+
pAktPam->DeleteMark();
pAktPam->GetPoint()->nNode = nSttNode;
SwTxtNode* pTxtNd = pAktPam->GetNode()->GetTxtNode();
@@ -305,8 +300,8 @@ void SwUndoOverwrite::Redo( SwUndoIter& rUndoIter )
}
rIdx.Assign( pTxtNd, aDelStr.Len() ? nSttCntnt+1 : nSttCntnt );
- BOOL bOldExpFlg = pTxtNd->IsIgnoreDontExpand();
- pTxtNd->SetIgnoreDontExpand( TRUE );
+ sal_Bool bOldExpFlg = pTxtNd->IsIgnoreDontExpand();
+ pTxtNd->SetIgnoreDontExpand( sal_True );
for( xub_StrLen n = 0; n < aInsStr.Len(); n++ )
{
@@ -355,10 +350,10 @@ struct _UndoTransliterate_Data
String sText;
SwHistory* pHistory;
Sequence< sal_Int32 >* pOffsets;
- ULONG nNdIdx;
+ sal_uLong nNdIdx;
xub_StrLen nStart, nLen;
- _UndoTransliterate_Data( ULONG nNd, xub_StrLen nStt, xub_StrLen nStrLen, const String& rTxt )
+ _UndoTransliterate_Data( sal_uLong nNd, xub_StrLen nStt, xub_StrLen nStrLen, const String& rTxt )
: sText( rTxt ), pHistory( 0 ), pOffsets( 0 ),
nNdIdx( nNd ), nStart( nStt ), nLen( nStrLen )
{}
@@ -380,11 +375,9 @@ SwUndoTransliterate::~SwUndoTransliterate()
delete aChanges[i];
}
-void SwUndoTransliterate::Undo( SwUndoIter& rUndoIter )
+void SwUndoTransliterate::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
- BOOL bUndo = rDoc.DoesUndo();
- rDoc.DoUndo( FALSE );
+ SwDoc & rDoc = rContext.GetDoc();
// since the changes were added to the vector from the end of the string/node towards
// the start, we need to revert them from the start towards the end now to keep the
@@ -393,27 +386,24 @@ void SwUndoTransliterate::Undo( SwUndoIter& rUndoIter )
for (sal_Int32 i = aChanges.size() - 1; i >= 0; --i)
aChanges[i]->SetChangeAtNode( rDoc );
- rDoc.DoUndo( bUndo );
- SetPaM( rUndoIter, TRUE );
+ AddUndoRedoPaM(rContext, true);
}
-void SwUndoTransliterate::Redo( SwUndoIter& rUndoIter )
+void SwUndoTransliterate::RedoImpl(::sw::UndoRedoContext & rContext)
{
-/* ??? */ rUndoIter.SetUpdateAttr( TRUE );
-
- SetPaM( *rUndoIter.pAktPam );
- Repeat( rUndoIter );
+ SwPaM & rPam( AddUndoRedoPaM(rContext) );
+ DoTransliterate(rContext.GetDoc(), rPam);
}
-void SwUndoTransliterate::Repeat( SwUndoIter& rUndoIter )
+void SwUndoTransliterate::RepeatImpl(::sw::RepeatContext & rContext)
{
- SwPaM& rPam = *rUndoIter.pAktPam;
- SwDoc& rDoc = rUndoIter.GetDoc();
+ DoTransliterate(rContext.GetDoc(), rContext.GetRepeatPaM());
+}
+void SwUndoTransliterate::DoTransliterate(SwDoc & rDoc, SwPaM & rPam)
+{
utl::TransliterationWrapper aTrans( ::comphelper::getProcessServiceFactory(), nType );
rDoc.TransliterateText( rPam, aTrans );
-
- rUndoIter.pLastUndoObj = this;
}
void SwUndoTransliterate::AddChanges( SwTxtNode& rTNd,
diff --git a/sw/source/core/undo/unredln.cxx b/sw/source/core/undo/unredln.cxx
index 7f76697c80a3..475e79bb7314 100644
--- a/sw/source/core/undo/unredln.cxx
+++ b/sw/source/core/undo/unredln.cxx
@@ -28,6 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <UndoRedline.hxx>
#include <hintids.hxx>
#include <unotools/charclass.hxx>
@@ -35,24 +36,22 @@
#include <swundo.hxx> // fuer die UndoIds
#include <pam.hxx>
#include <ndtxt.hxx>
-#include <undobj.hxx>
+#include <UndoCore.hxx>
+#include <UndoDelete.hxx>
#include <rolbck.hxx>
#include <redline.hxx>
#include <docary.hxx>
#include <sortopt.hxx>
-extern void lcl_JoinText( SwPaM& rPam, BOOL bJoinPrev );
-extern void lcl_GetJoinFlags( SwPaM& rPam, BOOL& rJoinTxt, BOOL& rJoinPrev );
+extern void lcl_JoinText( SwPaM& rPam, sal_Bool bJoinPrev );
+extern void lcl_GetJoinFlags( SwPaM& rPam, sal_Bool& rJoinTxt, sal_Bool& rJoinPrev );
//------------------------------------------------------------------
-inline SwDoc& SwUndoIter::GetDoc() const { return *pAktPam->GetDoc(); }
-
-
SwUndoRedline::SwUndoRedline( SwUndoId nUsrId, const SwPaM& rRange )
: SwUndo( UNDO_REDLINE ), SwUndRng( rRange ),
pRedlData( 0 ), pRedlSaveData( 0 ), nUserId( nUsrId ),
- bHiddenRedlines( FALSE )
+ bHiddenRedlines( sal_False )
{
// Redline beachten
SwDoc& rDoc = *rRange.GetDoc();
@@ -70,10 +69,10 @@ SwUndoRedline::SwUndoRedline( SwUndoId nUsrId, const SwPaM& rRange )
SetRedlineMode( rDoc.GetRedlineMode() );
}
- ULONG nEndExtra = rDoc.GetNodes().GetEndOfExtras().GetIndex();
+ sal_uLong nEndExtra = rDoc.GetNodes().GetEndOfExtras().GetIndex();
pRedlSaveData = new SwRedlineSaveDatas;
- if( !FillSaveData( rRange, *pRedlSaveData, FALSE,
+ if( !FillSaveData( rRange, *pRedlSaveData, sal_False,
UNDO_REJECT_REDLINE != nUserId ))
delete pRedlSaveData, pRedlSaveData = 0;
else
@@ -94,17 +93,22 @@ SwUndoRedline::~SwUndoRedline()
delete pRedlSaveData;
}
-void SwUndoRedline::Undo( SwUndoIter& rIter )
+sal_uInt16 SwUndoRedline::GetRedlSaveCount() const
{
- SwDoc* pDoc = &rIter.GetDoc();
- SetPaM( *rIter.pAktPam );
+ return pRedlSaveData ? pRedlSaveData->Count() : 0;
+}
-// RedlineMode setzen?
- _Undo( rIter );
+
+void SwUndoRedline::UndoImpl(::sw::UndoRedoContext & rContext)
+{
+ SwDoc *const pDoc = & rContext.GetDoc();
+ SwPaM & rPam( AddUndoRedoPaM(rContext) );
+
+ UndoRedlineImpl(*pDoc, rPam);
if( pRedlSaveData )
{
- ULONG nEndExtra = pDoc->GetNodes().GetEndOfExtras().GetIndex();
+ sal_uLong nEndExtra = pDoc->GetNodes().GetEndOfExtras().GetIndex();
SetSaveData( *pDoc, *pRedlSaveData );
if( bHiddenRedlines )
{
@@ -114,51 +118,51 @@ void SwUndoRedline::Undo( SwUndoIter& rIter )
nSttNode += nEndExtra;
nEndNode += nEndExtra;
}
- SetPaM( *rIter.pAktPam, TRUE );
+ SetPaM(rPam, true);
}
}
-void SwUndoRedline::Redo( SwUndoIter& rIter )
+void SwUndoRedline::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc* pDoc = &rIter.GetDoc();
+ SwDoc *const pDoc = & rContext.GetDoc();
RedlineMode_t eOld = pDoc->GetRedlineMode();
pDoc->SetRedlineMode_intern((RedlineMode_t)(( eOld & ~nsRedlineMode_t::REDLINE_IGNORE) | nsRedlineMode_t::REDLINE_ON ));
- SetPaM( *rIter.pAktPam );
+ SwPaM & rPam( AddUndoRedoPaM(rContext) );
if( pRedlSaveData && bHiddenRedlines )
{
- ULONG nEndExtra = pDoc->GetNodes().GetEndOfExtras().GetIndex();
- FillSaveData( *rIter.pAktPam, *pRedlSaveData, FALSE,
+ sal_uLong nEndExtra = pDoc->GetNodes().GetEndOfExtras().GetIndex();
+ FillSaveData(rPam, *pRedlSaveData, sal_False,
UNDO_REJECT_REDLINE != nUserId );
nEndExtra -= pDoc->GetNodes().GetEndOfExtras().GetIndex();
nSttNode -= nEndExtra;
nEndNode -= nEndExtra;
}
- _Redo( rIter );
- SetPaM( *rIter.pAktPam, TRUE );
+ RedoRedlineImpl(*pDoc, rPam);
+
+ SetPaM(rPam, true);
pDoc->SetRedlineMode_intern( eOld );
}
-// default ist leer
-void SwUndoRedline::_Undo( SwUndoIter& )
+void SwUndoRedline::UndoRedlineImpl(SwDoc &, SwPaM &)
{
}
-// default ist Redlines entfernen
-void SwUndoRedline::_Redo( SwUndoIter& rIter )
+// default: remove redlines
+void SwUndoRedline::RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam)
{
- rIter.GetDoc().DeleteRedline( *rIter.pAktPam, true, USHRT_MAX );
+ rDoc.DeleteRedline(rPam, true, USHRT_MAX);
}
-/* */
+// SwUndoRedlineDelete ///////////////////////////////////////////////////
SwUndoRedlineDelete::SwUndoRedlineDelete( const SwPaM& rRange, SwUndoId nUsrId )
: SwUndoRedline( nUsrId = (nUsrId ? nUsrId : UNDO_DELETE), rRange ),
- bCanGroup( FALSE ), bIsDelim( FALSE ), bIsBackspace( FALSE )
+ bCanGroup( sal_False ), bIsDelim( sal_False ), bIsBackspace( sal_False )
{
const SwTxtNode* pTNd;
if( UNDO_DELETE == nUserId &&
@@ -168,7 +172,7 @@ SwUndoRedlineDelete::SwUndoRedlineDelete( const SwPaM& rRange, SwUndoId nUsrId )
sal_Unicode cCh = pTNd->GetTxt().GetChar( nSttCntnt );
if( CH_TXTATR_BREAKWORD != cCh && CH_TXTATR_INWORD != cCh )
{
- bCanGroup = TRUE;
+ bCanGroup = sal_True;
bIsDelim = !GetAppCharClass().isLetterNumeric( pTNd->GetTxt(),
nSttCntnt );
bIsBackspace = nSttCntnt == rRange.GetPoint()->nContent.GetIndex();
@@ -178,20 +182,22 @@ SwUndoRedlineDelete::SwUndoRedlineDelete( const SwPaM& rRange, SwUndoId nUsrId )
bCacheComment = false;
}
-void SwUndoRedlineDelete::_Undo( SwUndoIter& rIter )
+void SwUndoRedlineDelete::UndoRedlineImpl(SwDoc & rDoc, SwPaM & rPam)
{
- rIter.GetDoc().DeleteRedline( *rIter.pAktPam, true, USHRT_MAX );
+ rDoc.DeleteRedline(rPam, true, USHRT_MAX);
}
-void SwUndoRedlineDelete::_Redo( SwUndoIter& rIter )
+void SwUndoRedlineDelete::RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam)
{
- if( *rIter.pAktPam->GetPoint() != *rIter.pAktPam->GetMark() )
- rIter.GetDoc().AppendRedline( new SwRedline( *pRedlData, *rIter.pAktPam ), FALSE );
+ if (rPam.GetPoint() != rPam.GetMark())
+ {
+ rDoc.AppendRedline( new SwRedline(*pRedlData, rPam), sal_False );
+ }
}
-BOOL SwUndoRedlineDelete::CanGrouping( const SwUndoRedlineDelete& rNext )
+sal_Bool SwUndoRedlineDelete::CanGrouping( const SwUndoRedlineDelete& rNext )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( UNDO_DELETE == nUserId && nUserId == rNext.nUserId &&
bCanGroup == rNext.bCanGroup &&
bIsDelim == rNext.bIsDelim &&
@@ -217,7 +223,7 @@ BOOL SwUndoRedlineDelete::CanGrouping( const SwUndoRedlineDelete& rNext )
nEndCntnt = rNext.nEndCntnt;
else
nSttCntnt = rNext.nSttCntnt;
- bRet = TRUE;
+ bRet = sal_True;
}
}
return bRet;
@@ -238,17 +244,16 @@ SwUndoRedlineSort::~SwUndoRedlineSort()
delete pOpt;
}
-void SwUndoRedlineSort::_Undo( SwUndoIter& rIter )
+void SwUndoRedlineSort::UndoRedlineImpl(SwDoc & rDoc, SwPaM & rPam)
{
- // im rIter.pAktPam ist der sortiete Bereich,
- // im aSaveRange steht der kopierte, sprich der originale.
- SwDoc& rDoc = rIter.GetDoc();
+ // rPam contains the sorted range
+ // aSaveRange contains copied (i.e. original) range
- SwPosition* pStart = rIter.pAktPam->Start();
- SwPosition* pEnd = rIter.pAktPam->End();
+ SwPosition *const pStart = rPam.Start();
+ SwPosition *const pEnd = rPam.End();
SwNodeIndex aPrevIdx( pStart->nNode, -1 );
- ULONG nOffsetTemp = pEnd->nNode.GetIndex() - pStart->nNode.GetIndex();
+ sal_uLong nOffsetTemp = pEnd->nNode.GetIndex() - pStart->nNode.GetIndex();
if( 0 == ( nsRedlineMode_t::REDLINE_SHOW_DELETE & rDoc.GetRedlineMode()) )
{
@@ -256,7 +261,7 @@ void SwUndoRedlineSort::_Undo( SwUndoIter& rIter )
// damit die Nodes wieder uebereinstimmen!
// das Geloeschte ist versteckt, also suche das INSERT
// Redline Object. Dahinter steht das Geloeschte
- USHORT nFnd = rDoc.GetRedlinePos(
+ sal_uInt16 nFnd = rDoc.GetRedlinePos(
*rDoc.GetNodes()[ nSttNode + 1 ],
nsRedlineType_t::REDLINE_INSERT );
ASSERT( USHRT_MAX != nFnd && nFnd+1 < rDoc.GetRedlineTbl().Count(),
@@ -266,7 +271,7 @@ void SwUndoRedlineSort::_Undo( SwUndoIter& rIter )
}
{
- SwPaM aTmp( *rIter.pAktPam->GetMark() );
+ SwPaM aTmp( *rPam.GetMark() );
aTmp.GetMark()->nContent = 0;
aTmp.SetMark();
aTmp.GetPoint()->nNode = nSaveEndNode;
@@ -274,9 +279,9 @@ void SwUndoRedlineSort::_Undo( SwUndoIter& rIter )
rDoc.DeleteRedline( aTmp, true, USHRT_MAX );
}
- rDoc.DelFullPara( *rIter.pAktPam );
+ rDoc.DelFullPara(rPam);
- SwPaM* pPam = rIter.pAktPam;
+ SwPaM *const pPam = & rPam;
pPam->DeleteMark();
pPam->GetPoint()->nNode.Assign( aPrevIdx.GetNode(), +1 );
SwCntntNode* pCNd = pPam->GetCntntNode();
@@ -289,22 +294,20 @@ void SwUndoRedlineSort::_Undo( SwUndoIter& rIter )
SetValues( *pPam );
- SetPaM( *rIter.pAktPam );
+ SetPaM(rPam);
}
-void SwUndoRedlineSort::_Redo( SwUndoIter& rIter )
+void SwUndoRedlineSort::RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam)
{
- SwPaM& rPam = *rIter.pAktPam;
-
SwPaM* pPam = &rPam;
SwPosition* pStart = pPam->Start();
SwPosition* pEnd = pPam->End();
SwNodeIndex aPrevIdx( pStart->nNode, -1 );
- ULONG nOffsetTemp = pEnd->nNode.GetIndex() - pStart->nNode.GetIndex();
+ sal_uLong nOffsetTemp = pEnd->nNode.GetIndex() - pStart->nNode.GetIndex();
xub_StrLen nCntStt = pStart->nContent.GetIndex();
- rIter.GetDoc().SortText( rPam, *pOpt );
+ rDoc.SortText(rPam, *pOpt);
pPam->DeleteMark();
pPam->GetPoint()->nNode.Assign( aPrevIdx.GetNode(), +1 );
@@ -326,9 +329,9 @@ void SwUndoRedlineSort::_Redo( SwUndoIter& rIter )
rPam.GetPoint()->nContent.Assign( rPam.GetCntntNode(), nSaveEndCntnt );
}
-void SwUndoRedlineSort::Repeat( SwUndoIter& rIter )
+void SwUndoRedlineSort::RepeatImpl(::sw::RepeatContext & rContext)
{
- rIter.GetDoc().SortText( *rIter.pAktPam, *pOpt );
+ rContext.GetDoc().SortText( rContext.GetRepeatPaM(), *pOpt );
}
void SwUndoRedlineSort::SetSaveRange( const SwPaM& rRange )
@@ -343,21 +346,21 @@ void SwUndoRedlineSort::SetOffset( const SwNodeIndex& rIdx )
nOffset = rIdx.GetIndex() - nSttNode;
}
-/* */
+// SwUndoAcceptRedline ///////////////////////////////////////////////////
SwUndoAcceptRedline::SwUndoAcceptRedline( const SwPaM& rRange )
: SwUndoRedline( UNDO_ACCEPT_REDLINE, rRange )
{
}
-void SwUndoAcceptRedline::_Redo( SwUndoIter& rIter )
+void SwUndoAcceptRedline::RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam)
{
- rIter.GetDoc().AcceptRedline( *rIter.pAktPam, false );
+ rDoc.AcceptRedline(rPam, false);
}
-void SwUndoAcceptRedline::Repeat( SwUndoIter& rIter )
+void SwUndoAcceptRedline::RepeatImpl(::sw::RepeatContext & rContext)
{
- rIter.GetDoc().AcceptRedline( *rIter.pAktPam, true );
+ rContext.GetDoc().AcceptRedline(rContext.GetRepeatPaM(), true);
}
SwUndoRejectRedline::SwUndoRejectRedline( const SwPaM& rRange )
@@ -365,19 +368,19 @@ SwUndoRejectRedline::SwUndoRejectRedline( const SwPaM& rRange )
{
}
-void SwUndoRejectRedline::_Redo( SwUndoIter& rIter )
+void SwUndoRejectRedline::RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam)
{
- rIter.GetDoc().RejectRedline( *rIter.pAktPam, false );
+ rDoc.RejectRedline(rPam, false);
}
-void SwUndoRejectRedline::Repeat( SwUndoIter& rIter )
+void SwUndoRejectRedline::RepeatImpl(::sw::RepeatContext & rContext)
{
- rIter.GetDoc().RejectRedline( *rIter.pAktPam, true );
+ rContext.GetDoc().RejectRedline(rContext.GetRepeatPaM(), true);
}
-/* */
+// SwUndoCompDoc /////////////////////////////////////////////////////////
-SwUndoCompDoc::SwUndoCompDoc( const SwPaM& rRg, BOOL bIns )
+SwUndoCompDoc::SwUndoCompDoc( const SwPaM& rRg, sal_Bool bIns )
: SwUndo( UNDO_COMPAREDOC ), SwUndRng( rRg ), pRedlData( 0 ),
pUnDel( 0 ), pUnDel2( 0 ), pRedlSaveData( 0 ), bInsert( bIns )
{
@@ -404,7 +407,7 @@ SwUndoCompDoc::SwUndoCompDoc( const SwRedline& rRedl )
}
pRedlSaveData = new SwRedlineSaveDatas;
- if( !FillSaveData( rRedl, *pRedlSaveData, FALSE, TRUE ))
+ if( !FillSaveData( rRedl, *pRedlSaveData, sal_False, sal_True ))
delete pRedlSaveData, pRedlSaveData = 0;
}
@@ -416,12 +419,10 @@ SwUndoCompDoc::~SwUndoCompDoc()
delete pRedlSaveData;
}
-void SwUndoCompDoc::Undo( SwUndoIter& rIter )
+void SwUndoCompDoc::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwPaM* pPam = rIter.pAktPam;
- SwDoc* pDoc = pPam->GetDoc();
-
- SetPaM( *pPam );
+ SwDoc *const pDoc = & rContext.GetDoc();
+ SwPaM *const pPam( & AddUndoRedoPaM(rContext) );
if( !bInsert )
{
@@ -434,8 +435,8 @@ void SwUndoCompDoc::Undo( SwUndoIter& rIter )
pDoc->SetRedlineMode_intern( eOld );
//per definition Point is end (in SwUndRng!)
- SwCntntNode* pCSttNd = pPam->GetCntntNode( FALSE );
- SwCntntNode* pCEndNd = pPam->GetCntntNode( TRUE );
+ SwCntntNode* pCSttNd = pPam->GetCntntNode( sal_False );
+ SwCntntNode* pCEndNd = pPam->GetCntntNode( sal_True );
// if start- and end-content is zero, then the doc-compare moves
// complete nodes into the current doc. And then the selection
@@ -444,10 +445,10 @@ void SwUndoCompDoc::Undo( SwUndoIter& rIter )
if( !nSttCntnt && !nEndCntnt )
pPam->Exchange();
- BOOL bJoinTxt, bJoinPrev;
+ sal_Bool bJoinTxt, bJoinPrev;
::lcl_GetJoinFlags( *pPam, bJoinTxt, bJoinPrev );
- pUnDel = new SwUndoDelete( *pPam, FALSE );
+ pUnDel = new SwUndoDelete( *pPam, sal_False );
if( bJoinTxt )
::lcl_JoinText( *pPam, bJoinPrev );
@@ -455,7 +456,7 @@ void SwUndoCompDoc::Undo( SwUndoIter& rIter )
if( pCSttNd && !pCEndNd)
{
// #112139# Do not step behind the end of content.
- SwNode * pTmp = pPam->GetNode(TRUE);
+ SwNode * pTmp = pPam->GetNode(sal_True);
if (pTmp)
{
SwNode * pEnd = pDoc->GetNodes().DocumentSectionEndNode(pTmp);
@@ -464,9 +465,9 @@ void SwUndoCompDoc::Undo( SwUndoIter& rIter )
{
pPam->SetMark();
pPam->GetPoint()->nNode++;
- pPam->GetBound( TRUE ).nContent.Assign( 0, 0 );
- pPam->GetBound( FALSE ).nContent.Assign( 0, 0 );
- pUnDel2 = new SwUndoDelete( *pPam, TRUE );
+ pPam->GetBound( sal_True ).nContent.Assign( 0, 0 );
+ pPam->GetBound( sal_False ).nContent.Assign( 0, 0 );
+ pUnDel2 = new SwUndoDelete( *pPam, sal_True );
}
}
}
@@ -481,22 +482,17 @@ void SwUndoCompDoc::Undo( SwUndoIter& rIter )
if( pRedlSaveData )
SetSaveData( *pDoc, *pRedlSaveData );
}
- SetPaM( rIter, TRUE );
+ SetPaM(*pPam, true);
}
}
-void SwUndoCompDoc::Redo( SwUndoIter& rIter )
+void SwUndoCompDoc::RedoImpl(::sw::UndoRedoContext & rContext)
{
- // setze noch den Cursor auf den Redo-Bereich
- SwPaM* pPam = rIter.pAktPam;
- SwDoc* pDoc = pPam->GetDoc();
-
- rIter.pLastUndoObj = 0;
+ SwDoc *const pDoc = & rContext.GetDoc();
+ SwPaM *const pPam( & AddUndoRedoPaM(rContext) );
if( bInsert )
{
- SetPaM( *pPam );
-
if( pRedlData && IDocumentRedlineAccess::IsRedlineOn( GetRedlineMode() ))
{
SwRedline* pTmp = new SwRedline( *pRedlData, *pPam );
@@ -521,10 +517,10 @@ void SwUndoCompDoc::Redo( SwUndoIter& rIter )
if( pUnDel2 )
{
- pUnDel2->Undo( rIter );
+ pUnDel2->UndoImpl(rContext);
delete pUnDel2, pUnDel2 = 0;
}
- pUnDel->Undo( rIter );
+ pUnDel->UndoImpl(rContext);
delete pUnDel, pUnDel = 0;
SetPaM( *pPam );
@@ -537,7 +533,6 @@ void SwUndoCompDoc::Redo( SwUndoIter& rIter )
// pDoc->SetRedlineMode_intern( eOld );
}
- SetPaM( rIter, TRUE );
+ SetPaM(*pPam, true);
}
-
diff --git a/sw/source/core/undo/unsect.cxx b/sw/source/core/undo/unsect.cxx
index 98d0e41d4616..3099d944923d 100644
--- a/sw/source/core/undo/unsect.cxx
+++ b/sw/source/core/undo/unsect.cxx
@@ -28,6 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <UndoSection.hxx>
#include <sfx2/linkmgr.hxx>
#include <fmtcntnt.hxx>
@@ -36,7 +37,7 @@
#include <swundo.hxx> // fuer die UndoIds
#include <pam.hxx>
#include <ndtxt.hxx>
-#include <undobj.hxx>
+#include <UndoCore.hxx>
#include <section.hxx>
#include <rolbck.hxx>
#include <redline.hxx>
@@ -48,8 +49,6 @@
#include <calc.hxx>
-inline SwDoc& SwUndoIter::GetDoc() const { return *pAktPam->GetDoc(); }
-
SfxItemSet* lcl_GetAttrSet( const SwSection& rSect )
{
// Attribute des Formate sichern (Spalten, Farbe, ... )
@@ -58,7 +57,7 @@ SfxItemSet* lcl_GetAttrSet( const SwSection& rSect )
SfxItemSet* pAttr = 0;
if( rSect.GetFmt() )
{
- USHORT nCnt = 1;
+ sal_uInt16 nCnt = 1;
if( rSect.IsProtect() )
++nCnt;
@@ -122,9 +121,9 @@ SwUndoInsSection::~SwUndoInsSection()
{
}
-void SwUndoInsSection::Undo( SwUndoIter& rUndoIter )
+void SwUndoInsSection::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
RemoveIdxFromSection( rDoc, m_nSectionNodePos );
@@ -167,25 +166,23 @@ void SwUndoInsSection::Undo( SwUndoIter& rUndoIter )
rDoc.GetFtnIdxs().UpdateFtn( aIdx );
}
- SetPaM( rUndoIter );
+ AddUndoRedoPaM(rContext);
}
-
-void SwUndoInsSection::Redo( SwUndoIter& rUndoIter )
+void SwUndoInsSection::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
- SetPaM( rUndoIter );
+ SwDoc & rDoc = rContext.GetDoc();
+ SwPaM & rPam( AddUndoRedoPaM(rContext) );
const SwTOXBaseSection* pUpdateTOX = 0;
if (m_pTOXBase.get())
{
- pUpdateTOX = rDoc.InsertTableOf( *rUndoIter.pAktPam->GetPoint(),
+ pUpdateTOX = rDoc.InsertTableOf( *rPam.GetPoint(),
*m_pTOXBase, m_pAttrSet.get(), true);
}
else
{
- rDoc.InsertSwSection(*rUndoIter.pAktPam,
- *m_pSectionData, 0, m_pAttrSet.get(), true);
+ rDoc.InsertSwSection(rPam, *m_pSectionData, 0, m_pAttrSet.get(), true);
}
if (m_pHistory.get())
@@ -224,23 +221,22 @@ void SwUndoInsSection::Redo( SwUndoIter& rUndoIter )
}
}
-
-void SwUndoInsSection::Repeat( SwUndoIter& rUndoIter )
+void SwUndoInsSection::RepeatImpl(::sw::RepeatContext & rContext)
{
+ SwDoc & rDoc = rContext.GetDoc();
if (m_pTOXBase.get())
{
- rUndoIter.GetDoc().InsertTableOf( *rUndoIter.pAktPam->GetPoint(),
+ rDoc.InsertTableOf(*rContext.GetRepeatPaM().GetPoint(),
*m_pTOXBase, m_pAttrSet.get(), true);
}
else
{
- rUndoIter.GetDoc().InsertSwSection( *rUndoIter.pAktPam,
+ rDoc.InsertSwSection(rContext.GetRepeatPaM(),
*m_pSectionData, 0, m_pAttrSet.get());
}
}
-
-void SwUndoInsSection::Join( SwDoc& rDoc, ULONG nNode )
+void SwUndoInsSection::Join( SwDoc& rDoc, sal_uLong nNode )
{
SwNodeIndex aIdx( rDoc.GetNodes(), nNode );
SwTxtNode* pTxtNd = aIdx.GetNode().GetTxtNode();
@@ -294,15 +290,17 @@ private:
::std::auto_ptr<SwTOXBase> const m_pTOXBase; /// set iff section is TOX
::std::auto_ptr<SfxItemSet> const m_pAttrSet;
::boost::shared_ptr< ::sfx2::MetadatableUndo > const m_pMetadataUndo;
- ULONG const m_nStartNode;
- ULONG const m_nEndNode;
+ sal_uLong const m_nStartNode;
+ sal_uLong const m_nEndNode;
public:
SwUndoDelSection(
SwSectionFmt const&, SwSection const&, SwNodeIndex const*const);
+
virtual ~SwUndoDelSection();
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
};
SW_DLLPRIVATE SwUndo * MakeUndoDelSection(SwSectionFmt const& rFormat)
@@ -330,9 +328,9 @@ SwUndoDelSection::~SwUndoDelSection()
{
}
-void SwUndoDelSection::Undo( SwUndoIter& rUndoIter )
+void SwUndoDelSection::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
if (m_pTOXBase.get())
{
@@ -383,13 +381,13 @@ void SwUndoDelSection::Undo( SwUndoIter& rUndoIter )
}
}
-void SwUndoDelSection::Redo( SwUndoIter& rUndoIter )
+void SwUndoDelSection::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
SwSectionNode *const pNd =
rDoc.GetNodes()[ m_nStartNode ]->GetSectionNode();
- ASSERT( pNd, "wo ist mein SectionNode?" );
+ OSL_ENSURE(pNd, "SwUndoDelSection::RedoImpl(): no SectionNode?");
// einfach das Format loeschen, der Rest erfolgt automatisch
rDoc.DelSectionFmt( pNd->GetSection().GetFmt() );
}
@@ -403,15 +401,17 @@ class SwUndoUpdateSection
private:
::std::auto_ptr<SwSectionData> m_pSectionData;
::std::auto_ptr<SfxItemSet> m_pAttrSet;
- ULONG const m_nStartNode;
+ sal_uLong const m_nStartNode;
bool const m_bOnlyAttrChanged;
public:
SwUndoUpdateSection(
SwSection const&, SwNodeIndex const*const, bool const bOnlyAttr);
+
virtual ~SwUndoUpdateSection();
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
};
SW_DLLPRIVATE SwUndo *
@@ -436,9 +436,9 @@ SwUndoUpdateSection::~SwUndoUpdateSection()
{
}
-void SwUndoUpdateSection::Undo( SwUndoIter& rUndoIter )
+void SwUndoUpdateSection::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
SwSectionNode *const pSectNd =
rDoc.GetNodes()[ m_nStartNode ]->GetSectionNode();
ASSERT( pSectNd, "wo ist mein SectionNode?" );
@@ -452,7 +452,7 @@ void SwUndoUpdateSection::Undo( SwUndoIter& rUndoIter )
// das Content- und Protect-Item muss bestehen bleiben
const SfxPoolItem* pItem;
m_pAttrSet->Put( pFmt->GetFmtAttr( RES_CNTNT ));
- if( SFX_ITEM_SET == pFmt->GetItemState( RES_PROTECT, TRUE, &pItem ))
+ if( SFX_ITEM_SET == pFmt->GetItemState( RES_PROTECT, sal_True, &pItem ))
{
m_pAttrSet->Put( *pItem );
}
@@ -492,8 +492,8 @@ void SwUndoUpdateSection::Undo( SwUndoIter& rUndoIter )
}
}
-void SwUndoUpdateSection::Redo( SwUndoIter& rUndoIter )
+void SwUndoUpdateSection::RedoImpl(::sw::UndoRedoContext & rContext)
{
- Undo( rUndoIter );
+ UndoImpl(rContext);
}
diff --git a/sw/source/core/undo/unsort.cxx b/sw/source/core/undo/unsort.cxx
index 44b73736e458..c11f7dc7a949 100644
--- a/sw/source/core/undo/unsort.cxx
+++ b/sw/source/core/undo/unsort.cxx
@@ -27,20 +27,21 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
+#include <UndoSort.hxx>
+
#include <doc.hxx>
#include <swundo.hxx> // fuer die UndoIds
#include <pam.hxx>
#include <swtable.hxx>
#include <ndtxt.hxx>
-#include <undobj.hxx>
+#include <UndoCore.hxx>
+#include <UndoTable.hxx>
#include <sortopt.hxx>
-#ifndef _DOCSORT_HXX
#include <docsort.hxx>
-#endif
#include <redline.hxx>
#include <node2lay.hxx>
-inline SwDoc& SwUndoIter::GetDoc() const { return *pAktPam->GetDoc(); }
/*--------------------------------------------------------------------
Beschreibung: Undo fuers Sorting
@@ -69,9 +70,8 @@ SwUndoSort::SwUndoSort(const SwPaM& rRg, const SwSortOptions& rOpt)
pSortOpt = new SwSortOptions(rOpt);
}
-
-SwUndoSort::SwUndoSort( ULONG nStt, ULONG nEnd, const SwTableNode& rTblNd,
- const SwSortOptions& rOpt, BOOL bSaveTable )
+SwUndoSort::SwUndoSort( sal_uLong nStt, sal_uLong nEnd, const SwTableNode& rTblNd,
+ const SwSortOptions& rOpt, sal_Bool bSaveTable )
: SwUndo(UNDO_SORT_TBL), pUndoTblAttr( 0 ), pRedlData( 0 )
{
nSttNode = nStt;
@@ -83,8 +83,6 @@ SwUndoSort::SwUndoSort( ULONG nStt, ULONG nEnd, const SwTableNode& rTblNd,
pUndoTblAttr = new SwUndoAttrTbl( rTblNd );
}
-
-
SwUndoSort::~SwUndoSort()
{
delete pSortOpt;
@@ -92,18 +90,18 @@ SwUndoSort::~SwUndoSort()
delete pRedlData;
}
-
-
-void SwUndoSort::Undo( SwUndoIter& rIter)
+void SwUndoSort::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
if(pSortOpt->bTable)
{
// Undo Tabelle
RemoveIdxFromSection( rDoc, nSttNode, &nEndNode );
if( pUndoTblAttr )
- pUndoTblAttr->Undo( rIter );
+ {
+ pUndoTblAttr->UndoImpl(rContext);
+ }
SwTableNode* pTblNd = rDoc.GetNodes()[ nTblNd ]->GetTableNode();
@@ -116,7 +114,7 @@ void SwUndoSort::Undo( SwUndoIter& rIter)
const SwTable& rTbl = pTblNd->GetTable();
SwMovedBoxes aMovedList;
- for( USHORT i=0; i < aSortList.Count(); i++)
+ for( sal_uInt16 i=0; i < aSortList.Count(); i++)
{
const SwTableBox* pSource = rTbl.GetTblBox(
*aSortList[i]->SORT_TXT_TBL.TBL.pSource );
@@ -134,23 +132,24 @@ void SwUndoSort::Undo( SwUndoIter& rIter)
// Restore table frames:
// --> FME 2004-11-26 #i37739# A simple 'MakeFrms' after the node sorting
// does not work if the table is inside a frame and has no prev/next.
- const ULONG nIdx = pTblNd->GetIndex();
+ const sal_uLong nIdx = pTblNd->GetIndex();
aNode2Layout.RestoreUpperFrms( rDoc.GetNodes(), nIdx, nIdx + 1 );
// <--
}
else
{
// Undo Text
- RemoveIdx( *rIter.pAktPam );
+ SwPaM & rPam( AddUndoRedoPaM(rContext) );
+ RemoveIdxFromRange(rPam, true);
// fuer die sorted Positions einen Index anlegen.
// JP 25.11.97: Die IndexList muss aber nach SourcePosition
// aufsteigend sortiert aufgebaut werden
- SwUndoSortList aIdxList( (BYTE)aSortList.Count() );
- USHORT i;
+ SwUndoSortList aIdxList( (sal_uInt8)aSortList.Count() );
+ sal_uInt16 i;
for( i = 0; i < aSortList.Count(); ++i)
- for( USHORT ii=0; ii < aSortList.Count(); ++ii )
+ for( sal_uInt16 ii=0; ii < aSortList.Count(); ++ii )
if( aSortList[ii]->SORT_TXT_TBL.TXT.nSource == nSttNode + i )
{
SwNodeIndex* pIdx = new SwNodeIndex( rDoc.GetNodes(),
@@ -168,14 +167,13 @@ void SwUndoSort::Undo( SwUndoIter& rIter)
}
// Indixes loeschen
aIdxList.DeleteAndDestroy(0, aIdxList.Count());
- SetPaM( rIter, TRUE );
+ SetPaM(rPam, true);
}
}
-
-void SwUndoSort::Redo( SwUndoIter& rIter)
+void SwUndoSort::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
if(pSortOpt->bTable)
{
@@ -193,7 +191,7 @@ void SwUndoSort::Redo( SwUndoIter& rIter)
const SwTable& rTbl = pTblNd->GetTable();
SwMovedBoxes aMovedList;
- for(USHORT i=0; i < aSortList.Count(); ++i)
+ for(sal_uInt16 i=0; i < aSortList.Count(); ++i)
{
const SwTableBox* pSource = rTbl.GetTblBox(
(const String&) *aSortList[i]->SORT_TXT_TBL.TBL.pSource );
@@ -208,22 +206,26 @@ void SwUndoSort::Redo( SwUndoIter& rIter)
}
if( pUndoTblAttr )
- pUndoTblAttr->Redo( rIter );
+ {
+ pUndoTblAttr->RedoImpl(rContext);
+ }
// Restore table frames:
// --> FME 2004-11-26 #i37739# A simple 'MakeFrms' after the node sorting
// does not work if the table is inside a frame and has no prev/next.
- const ULONG nIdx = pTblNd->GetIndex();
+ const sal_uLong nIdx = pTblNd->GetIndex();
aNode2Layout.RestoreUpperFrms( rDoc.GetNodes(), nIdx, nIdx + 1 );
// <--
}
else
{
- // Redo bei Text
- RemoveIdx( *rIter.pAktPam );
+ // Redo for Text
+ SwPaM & rPam( AddUndoRedoPaM(rContext) );
+ SetPaM(rPam);
+ RemoveIdxFromRange(rPam, true);
- SwUndoSortList aIdxList( (BYTE)aSortList.Count() );
- USHORT i;
+ SwUndoSortList aIdxList( (sal_uInt8)aSortList.Count() );
+ sal_uInt16 i;
for( i = 0; i < aSortList.Count(); ++i)
{ // aktuelle Pos ist die Ausgangslage
@@ -241,62 +243,37 @@ void SwUndoSort::Redo( SwUndoIter& rIter)
}
// Indixes loeschen
aIdxList.DeleteAndDestroy(0, aIdxList.Count());
- SetPaM( rIter, TRUE );
- const SwTxtNode* pTNd = rIter.pAktPam->GetNode()->GetTxtNode();
+ SetPaM(rPam, true);
+ SwTxtNode const*const pTNd = rPam.GetNode()->GetTxtNode();
if( pTNd )
- rIter.pAktPam->GetPoint()->nContent = pTNd->GetTxt().Len();
+ {
+ rPam.GetPoint()->nContent = pTNd->GetTxt().Len();
+ }
}
}
-
-void SwUndoSort::Repeat(SwUndoIter& rIter)
+void SwUndoSort::RepeatImpl(::sw::RepeatContext & rContext)
{
+ // table not repeat capable
if(!pSortOpt->bTable)
{
- SwPaM* pPam = rIter.pAktPam;
+ SwPaM *const pPam = & rContext.GetRepeatPaM();
SwDoc& rDoc = *pPam->GetDoc();
if( !rDoc.IsIdxInTbl( pPam->Start()->nNode ) )
rDoc.SortText(*pPam, *pSortOpt);
}
- // Tabelle ist nicht Repeat-Faehig
- rIter.pLastUndoObj = this;
}
-
-void SwUndoSort::RemoveIdx( SwPaM& rPam )
-{
- rPam.DeleteMark();
- rPam.GetPoint()->nNode = nSttNode;
-
- SwCntntNode* pCNd = rPam.GetCntntNode();
- xub_StrLen nLen = pCNd->Len();
- if( nLen >= nSttCntnt )
- nLen = nSttCntnt;
- rPam.GetPoint()->nContent.Assign(pCNd, nLen );
- rPam.SetMark();
-
- rPam.GetPoint()->nNode = nEndNode;
- pCNd = rPam.GetCntntNode();
- nLen = pCNd->Len();
- if( nLen >= nEndCntnt )
- nLen = nEndCntnt;
- rPam.GetPoint()->nContent.Assign(pCNd, nLen );
- RemoveIdxFromRange( rPam, TRUE );
-}
-
-
void SwUndoSort::Insert( const String& rOrgPos, const String& rNewPos)
{
SwSortUndoElement* pEle = new SwSortUndoElement(rOrgPos, rNewPos);
aSortList.C40_INSERT( SwSortUndoElement, pEle, aSortList.Count() );
}
-
-void SwUndoSort::Insert( ULONG nOrgPos, ULONG nNewPos)
+void SwUndoSort::Insert( sal_uLong nOrgPos, sal_uLong nNewPos)
{
SwSortUndoElement* pEle = new SwSortUndoElement(nOrgPos, nNewPos);
aSortList.C40_INSERT( SwSortUndoElement, pEle, aSortList.Count() );
}
-
diff --git a/sw/source/core/undo/unspnd.cxx b/sw/source/core/undo/unspnd.cxx
index 14aa18ed6e07..1e649f6d0b09 100644
--- a/sw/source/core/undo/unspnd.cxx
+++ b/sw/source/core/undo/unspnd.cxx
@@ -28,6 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <UndoSplitMove.hxx>
#include "doc.hxx"
#include "pam.hxx"
@@ -37,13 +38,11 @@
#include <editeng/brkitem.hxx>
#include <fmtpdsc.hxx>
#include <frmfmt.hxx>
-#include "undobj.hxx"
+#include <UndoCore.hxx>
#include "rolbck.hxx"
#include "redline.hxx"
#include "docary.hxx"
-
-
-inline SwDoc& SwUndoIter::GetDoc() const { return *pAktPam->GetDoc(); }
+#include <IShellCursorSupplier.hxx>
//------------------------------------------------------------------
@@ -52,13 +51,13 @@ inline SwDoc& SwUndoIter::GetDoc() const { return *pAktPam->GetDoc(); }
SwUndoSplitNode::SwUndoSplitNode( SwDoc* pDoc, const SwPosition& rPos,
- BOOL bChkTable )
+ sal_Bool bChkTable )
: SwUndo( UNDO_SPLITNODE ), pHistory( 0 ), pRedlData( 0 ), nNode( rPos.nNode.GetIndex() ),
nCntnt( rPos.nContent.GetIndex() ),
- bTblFlag( FALSE ), bChkTblStt( bChkTable )
+ bTblFlag( sal_False ), bChkTblStt( bChkTable )
{
- SwTxtNode* pTxtNd = pDoc->GetNodes()[ rPos.nNode ]->GetTxtNode();
- ASSERT( pTxtNd, "nur beim TextNode rufen!" );
+ SwTxtNode *const pTxtNd = rPos.nNode.GetNode().GetTxtNode();
+ OSL_ENSURE(pTxtNd, "SwUndoSplitNode: TextNode expected!");
if( pTxtNd->GetpSwpHints() )
{
pHistory = new SwHistory;
@@ -75,21 +74,16 @@ SwUndoSplitNode::SwUndoSplitNode( SwDoc* pDoc, const SwPosition& rPos,
}
}
-
-
-
SwUndoSplitNode::~SwUndoSplitNode()
{
delete pHistory;
delete pRedlData;
}
-
-
-void SwUndoSplitNode::Undo( SwUndoIter& rUndoIter )
+void SwUndoSplitNode::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc* pDoc = &rUndoIter.GetDoc();
- SwPaM& rPam = *rUndoIter.pAktPam;
+ SwDoc *const pDoc = & rContext.GetDoc();
+ SwPaM & rPam( rContext.GetCursorSupplier().CreateNewShellCursor() );
rPam.DeleteMark();
if( bTblFlag )
{
@@ -108,11 +102,11 @@ void SwUndoSplitNode::Undo( SwUndoIter& rUndoIter )
if( pNdSet )
{
const SfxPoolItem *pItem;
- if( SFX_ITEM_SET == pNdSet->GetItemState( RES_PAGEDESC, FALSE,
+ if( SFX_ITEM_SET == pNdSet->GetItemState( RES_PAGEDESC, sal_False,
&pItem ) )
pTableFmt->SetFmtAttr( *pItem );
- if( SFX_ITEM_SET == pNdSet->GetItemState( RES_BREAK, FALSE,
+ if( SFX_ITEM_SET == pNdSet->GetItemState( RES_BREAK, sal_False,
&pItem ) )
pTableFmt->SetFmtAttr( *pItem );
}
@@ -151,7 +145,7 @@ void SwUndoSplitNode::Undo( SwUndoIter& rUndoIter )
rPam.SetMark();
rPam.GetPoint()->nContent = pTNd->GetTxt().Len();
- pDoc->RstTxtAttrs( rPam, TRUE );
+ pDoc->RstTxtAttrs( rPam, sal_True );
pHistory->TmpRollback( pDoc, 0, false );
}
}
@@ -163,23 +157,13 @@ void SwUndoSplitNode::Undo( SwUndoIter& rUndoIter )
rPam.GetPoint()->nContent.Assign( rPam.GetCntntNode(), nCntnt );
}
-
-void SwUndoSplitNode::Repeat( SwUndoIter& rUndoIter )
-{
- if( UNDO_SPLITNODE == rUndoIter.GetLastUndoId() )
- return;
- rUndoIter.GetDoc().SplitNode( *rUndoIter.pAktPam->GetPoint(), bChkTblStt );
- rUndoIter.pLastUndoObj = this;
-}
-
-
-void SwUndoSplitNode::Redo( SwUndoIter& rUndoIter )
+void SwUndoSplitNode::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwPaM& rPam = *rUndoIter.pAktPam;
- ULONG nOldNode = rPam.GetPoint()->nNode.GetIndex();
+ SwPaM & rPam( rContext.GetCursorSupplier().CreateNewShellCursor() );
rPam.GetPoint()->nNode = nNode;
SwTxtNode * pTNd = rPam.GetNode()->GetTxtNode();
- if( pTNd ) // sollte eigentlich immer ein TextNode sein !!
+ OSL_ENSURE(pTNd, "SwUndoSplitNode::RedoImpl(): SwTxtNode expected");
+ if (pTNd)
{
rPam.GetPoint()->nContent.Assign( pTNd, nCntnt );
@@ -210,7 +194,11 @@ void SwUndoSplitNode::Redo( SwUndoIter& rUndoIter )
rPam.DeleteMark();
}
}
- else
- rPam.GetPoint()->nNode = nOldNode;
+}
+
+void SwUndoSplitNode::RepeatImpl(::sw::RepeatContext & rContext)
+{
+ rContext.GetDoc().SplitNode(
+ *rContext.GetRepeatPaM().GetPoint(), bChkTblStt );
}
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index ccd35dbf064c..6029f6e7bfd0 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -28,12 +28,19 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <UndoTable.hxx>
+#include <UndoRedline.hxx>
+#include <UndoDelete.hxx>
+#include <UndoSplitMove.hxx>
+#include <UndoCore.hxx>
#include <hintids.hxx>
+#include <hints.hxx>
#include <editeng/brkitem.hxx>
#include <fmtornt.hxx>
#include <fmtpdsc.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <editsh.hxx>
#include <docary.hxx>
#include <ndtxt.hxx>
@@ -42,7 +49,6 @@
#include <cntfrm.hxx>
#include <tblsel.hxx>
#include <swundo.hxx> // fuer die UndoIds
-#include <undobj.hxx>
#include <rolbck.hxx>
#include <ddefld.hxx>
#include <tabcol.hxx>
@@ -81,7 +87,6 @@
#define _DEBUG_REDLINE( pDoc ) lcl_DebugRedline( pDoc );
#endif
-inline SwDoc& SwUndoIter::GetDoc() const { return *pAktPam->GetDoc(); }
extern void ClearFEShellTabCols();
typedef SfxItemSet* SfxItemSetPtr;
@@ -99,7 +104,7 @@ SV_DECL_PTRARR_DEL( SwTblToTxtSaves, SwTblToTxtSavePtr, 0, 10 )
struct _UndoTblCpyTbl_Entry
{
- ULONG nBoxIdx, nOffset;
+ sal_uLong nBoxIdx, nOffset;
SfxItemSet* pBoxNumAttr;
SwUndo* pUndo;
@@ -124,25 +129,30 @@ class _SaveTable
const SwTable* pSwTable;
SfxItemSets aSets;
SwFrmFmts aFrmFmts;
- USHORT nLineCount;
- BOOL bModifyBox : 1;
- BOOL bSaveFormula : 1;
- BOOL bNewModel : 1;
+ sal_uInt16 nLineCount;
+ sal_Bool bModifyBox : 1;
+ sal_Bool bSaveFormula : 1;
+ sal_Bool bNewModel : 1;
public:
- _SaveTable( const SwTable& rTbl, USHORT nLnCnt = USHRT_MAX,
- BOOL bSaveFml = TRUE );
+ _SaveTable( const SwTable& rTbl, sal_uInt16 nLnCnt = USHRT_MAX,
+ sal_Bool bSaveFml = sal_True );
~_SaveTable();
+<<<<<<< local
USHORT AddFmt( SwFrmFmt* pFmt, bool bIsLine );
void NewFrmFmt( const SwTableLine* , const SwTableBox*, USHORT nFmtPos,
+=======
+ sal_uInt16 AddFmt( SwFrmFmt* pFmt, bool bIsLine );
+ void NewFrmFmt( const SwClient* pLnBx, sal_Bool bIsLine, sal_uInt16 nFmtPos,
+>>>>>>> other
SwFrmFmt* pOldFmt );
- void RestoreAttr( SwTable& rTbl, BOOL bModifyBox = FALSE );
+ void RestoreAttr( SwTable& rTbl, sal_Bool bModifyBox = sal_False );
void SaveCntntAttrs( SwDoc* pDoc );
- void CreateNew( SwTable& rTbl, BOOL bCreateFrms = TRUE,
- BOOL bRestoreChart = TRUE );
- BOOL IsNewModel() const { return bNewModel; }
+ void CreateNew( SwTable& rTbl, sal_Bool bCreateFrms = sal_True,
+ sal_Bool bRestoreChart = sal_True );
+ sal_Bool IsNewModel() const { return bNewModel; }
};
class _SaveLine
@@ -152,7 +162,7 @@ class _SaveLine
_SaveLine* pNext;
_SaveBox* pBox;
- USHORT nItemSet;
+ sal_uInt16 nItemSet;
public:
@@ -170,9 +180,9 @@ class _SaveBox
friend class _SaveLine;
_SaveBox* pNext;
- ULONG nSttNode;
+ sal_uLong nSttNode;
long nRowSpan;
- USHORT nItemSet;
+ sal_uInt16 nItemSet;
union
{
SfxItemSets* pCntntAttrs;
@@ -189,8 +199,8 @@ public:
void CreateNew( SwTable& rTbl, SwTableLine& rParent, _SaveTable& rSTbl );
};
-void InsertSort( SvUShorts& rArr, USHORT nIdx, USHORT* pInsPos = 0 );
-void InsertSort( SvULongs& rArr, ULONG nIdx, USHORT* pInsPos = 0 );
+void InsertSort( SvUShorts& rArr, sal_uInt16 nIdx, sal_uInt16* pInsPos = 0 );
+void InsertSort( SvULongs& rArr, sal_uLong nIdx, sal_uInt16* pInsPos = 0 );
#if defined( JP_DEBUG ) && defined(DBG_UTIL)
#include "shellio.hxx"
@@ -211,15 +221,15 @@ So we need to remember not only the start node position but the end node positio
struct SwTblToTxtSave
{
- ULONG m_nSttNd;
- ULONG m_nEndNd;
+ sal_uLong m_nSttNd;
+ sal_uLong m_nEndNd;
xub_StrLen m_nCntnt;
SwHistory* m_pHstry;
// metadata references for first and last paragraph in cell
::boost::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndoStart;
::boost::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndoEnd;
- SwTblToTxtSave( SwDoc& rDoc, ULONG nNd, ULONG nEndIdx, xub_StrLen nCntnt );
+ SwTblToTxtSave( SwDoc& rDoc, sal_uLong nNd, sal_uLong nEndIdx, xub_StrLen nCntnt );
~SwTblToTxtSave() { delete m_pHstry; }
};
@@ -229,7 +239,7 @@ SV_IMPL_PTRARR( SwUndoMoves, SwUndoMovePtr )
SV_IMPL_PTRARR( SwTblToTxtSaves, SwTblToTxtSavePtr )
SV_IMPL_PTRARR( _UndoTblCpyTbl_Entries, _UndoTblCpyTbl_EntryPtr )
-USHORT __FAR_DATA aSave_BoxCntntSet[] = {
+sal_uInt16 __FAR_DATA aSave_BoxCntntSet[] = {
RES_CHRATR_COLOR, RES_CHRATR_CROSSEDOUT,
RES_CHRATR_FONT, RES_CHRATR_FONTSIZE,
RES_CHRATR_POSTURE, RES_CHRATR_POSTURE,
@@ -239,8 +249,8 @@ USHORT __FAR_DATA aSave_BoxCntntSet[] = {
-SwUndoInsTbl::SwUndoInsTbl( const SwPosition& rPos, USHORT nCl, USHORT nRw,
- USHORT nAdj, const SwInsertTableOptions& rInsTblOpts,
+SwUndoInsTbl::SwUndoInsTbl( const SwPosition& rPos, sal_uInt16 nCl, sal_uInt16 nRw,
+ sal_uInt16 nAdj, const SwInsertTableOptions& rInsTblOpts,
const SwTableAutoFmt* pTAFmt,
const SvUShorts* pColArr,
const String & rName)
@@ -276,9 +286,9 @@ SwUndoInsTbl::~SwUndoInsTbl()
delete pAutoFmt;
}
-void SwUndoInsTbl::Undo( SwUndoIter& rUndoIter )
+void SwUndoInsTbl::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
SwNodeIndex aIdx( rDoc.GetNodes(), nSttNode );
SwTableNode* pTblNd = aIdx.GetNode().GetTableNode();
@@ -297,11 +307,11 @@ void SwUndoInsTbl::Undo( SwUndoIter& rUndoIter )
const SfxPoolItem *pItem;
if( SFX_ITEM_SET == pTableFmt->GetItemState( RES_PAGEDESC,
- FALSE, &pItem ) )
+ sal_False, &pItem ) )
pNextNd->SetAttr( *pItem );
if( SFX_ITEM_SET == pTableFmt->GetItemState( RES_BREAK,
- FALSE, &pItem ) )
+ sal_False, &pItem ) )
pNextNd->SetAttr( *pItem );
}
@@ -314,19 +324,18 @@ void SwUndoInsTbl::Undo( SwUndoIter& rUndoIter )
rDoc.GetNodes().Delete( aIdx, pTblNd->EndOfSectionIndex() -
aIdx.GetIndex() + 1 );
- rUndoIter.pAktPam->DeleteMark();
- rUndoIter.pAktPam->GetPoint()->nNode = aIdx;
- rUndoIter.pAktPam->GetPoint()->nContent.Assign(
- rUndoIter.pAktPam->GetCntntNode(), 0 );
+ SwPaM & rPam( rContext.GetCursorSupplier().CreateNewShellCursor() );
+ rPam.DeleteMark();
+ rPam.GetPoint()->nNode = aIdx;
+ rPam.GetPoint()->nContent.Assign( rPam.GetCntntNode(), 0 );
}
-void SwUndoInsTbl::Redo( SwUndoIter& rUndoIter )
+void SwUndoInsTbl::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
- SwPosition aPos( *rUndoIter.pAktPam->GetPoint() );
- aPos.nNode = nSttNode;
+ SwPosition const aPos(SwNodeIndex(rDoc.GetNodes(), nSttNode));
const SwTable* pTbl = rDoc.InsertTable( aInsTblOpts, aPos, nRows, nCols,
nAdjust,
pAutoFmt, pColWidth );
@@ -347,7 +356,7 @@ void SwUndoInsTbl::Redo( SwUndoIter& rUndoIter )
rDoc.GetRedlineTbl().Count() ))
{
SwPaM aPam( *pTblNode->EndOfSectionNode(), *pTblNode, 1 );
- SwCntntNode* pCNd = aPam.GetCntntNode( FALSE );
+ SwCntntNode* pCNd = aPam.GetCntntNode( sal_False );
if( pCNd )
aPam.GetMark()->nContent.Assign( pCNd, 0 );
@@ -365,11 +374,11 @@ void SwUndoInsTbl::Redo( SwUndoIter& rUndoIter )
}
-void SwUndoInsTbl::Repeat( SwUndoIter& rUndoIter )
+void SwUndoInsTbl::RepeatImpl(::sw::RepeatContext & rContext)
{
- rUndoIter.GetDoc().InsertTable( aInsTblOpts, *rUndoIter.pAktPam->GetPoint(),
- nRows, nCols, nAdjust,
- pAutoFmt, pColWidth );
+ rContext.GetDoc().InsertTable(
+ aInsTblOpts, *rContext.GetRepeatPaM().GetPoint(),
+ nRows, nCols, nAdjust, pAutoFmt, pColWidth );
}
SwRewriter SwUndoInsTbl::GetRewriter() const
@@ -385,7 +394,7 @@ SwRewriter SwUndoInsTbl::GetRewriter() const
// -----------------------------------------------------
-SwTblToTxtSave::SwTblToTxtSave( SwDoc& rDoc, ULONG nNd, ULONG nEndIdx, xub_StrLen nCnt )
+SwTblToTxtSave::SwTblToTxtSave( SwDoc& rDoc, sal_uLong nNd, sal_uLong nEndIdx, xub_StrLen nCnt )
: m_nSttNd( nNd ), m_nEndNd( nEndIdx), m_nCntnt( nCnt ), m_pHstry( 0 )
{
// Attributierung des gejointen Node merken.
@@ -428,11 +437,11 @@ SwUndoTblToTxt::SwUndoTblToTxt( const SwTable& rTbl, sal_Unicode cCh )
: SwUndo( UNDO_TABLETOTEXT ),
sTblNm( rTbl.GetFrmFmt()->GetName() ), pDDEFldType( 0 ), pHistory( 0 ),
nSttNd( 0 ), nEndNd( 0 ),
- nAdjust( static_cast<USHORT>(rTbl.GetFrmFmt()->GetHoriOrient().GetHoriOrient()) ),
+ nAdjust( static_cast<sal_uInt16>(rTbl.GetFrmFmt()->GetHoriOrient().GetHoriOrient()) ),
cTrenner( cCh ), nHdlnRpt( rTbl.GetRowsToRepeat() )
{
pTblSave = new _SaveTable( rTbl );
- pBoxSaves = new SwTblToTxtSaves( (BYTE)rTbl.GetTabSortBoxes().Count() );
+ pBoxSaves = new SwTblToTxtSaves( (sal_uInt8)rTbl.GetTabSortBoxes().Count() );
if( rTbl.IsA( TYPE( SwDDETable ) ) )
pDDEFldType = (SwDDEFieldType*)((SwDDETable&)rTbl).GetDDEFldType()->Copy();
@@ -441,10 +450,10 @@ SwUndoTblToTxt::SwUndoTblToTxt( const SwTable& rTbl, sal_Unicode cCh )
pHistory = new SwHistory;
const SwTableNode* pTblNd = rTbl.GetTableNode();
- ULONG nTblStt = pTblNd->GetIndex(), nTblEnd = pTblNd->EndOfSectionIndex();
+ sal_uLong nTblStt = pTblNd->GetIndex(), nTblEnd = pTblNd->EndOfSectionIndex();
const SwSpzFrmFmts& rFrmFmtTbl = *pTblNd->GetDoc()->GetSpzFrmFmts();
- for( USHORT n = 0; n < rFrmFmtTbl.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rFrmFmtTbl.Count(); ++n )
{
SwFrmFmt* pFmt = rFrmFmtTbl[ n ];
SwFmtAnchor const*const pAnchor = &pFmt->GetAnchor();
@@ -474,10 +483,10 @@ SwUndoTblToTxt::~SwUndoTblToTxt()
-void SwUndoTblToTxt::Undo( SwUndoIter& rUndoIter )
+void SwUndoTblToTxt::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
- SwPaM* pPam = rUndoIter.pAktPam;
+ SwDoc & rDoc = rContext.GetDoc();
+ SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor());
SwNodeIndex aFrmIdx( rDoc.GetNodes(), nSttNd );
SwNodeIndex aEndIdx( rDoc.GetNodes(), nEndNd );
@@ -506,20 +515,20 @@ void SwUndoTblToTxt::Undo( SwUndoIter& rUndoIter )
SwDDEFieldType* pNewType = (SwDDEFieldType*)rDoc.InsertFldType(
*pDDEFldType);
SwDDETable* pDDETbl = new SwDDETable( pTblNd->GetTable(), pNewType );
- pTblNd->SetNewTable( pDDETbl, FALSE ); // setze die DDE-Tabelle
+ pTblNd->SetNewTable( pDDETbl, sal_False ); // setze die DDE-Tabelle
delete pDDEFldType, pDDEFldType = 0;
}
if( bCheckNumFmt )
{
SwTableSortBoxes& rBxs = pTblNd->GetTable().GetTabSortBoxes();
- for( USHORT nBoxes = rBxs.Count(); nBoxes; )
- rDoc.ChkBoxNumFmt( *rBxs[ --nBoxes ], FALSE );
+ for( sal_uInt16 nBoxes = rBxs.Count(); nBoxes; )
+ rDoc.ChkBoxNumFmt( *rBxs[ --nBoxes ], sal_False );
}
if( pHistory )
{
- USHORT nTmpEnd = pHistory->GetTmpEnd();
+ sal_uInt16 nTmpEnd = pHistory->GetTmpEnd();
pHistory->TmpRollback( &rDoc, 0 );
pHistory->SetTmpEnd( nTmpEnd );
}
@@ -540,7 +549,7 @@ void SwUndoTblToTxt::Undo( SwUndoIter& rUndoIter )
}
// steht im untbl.cxx und darf nur vom Undoobject gerufen werden
-SwTableNode* SwNodes::UndoTableToText( ULONG nSttNd, ULONG nEndNd,
+SwTableNode* SwNodes::UndoTableToText( sal_uLong nSttNd, sal_uLong nEndNd,
const SwTblToTxtSaves& rSavedData )
{
SwNodeIndex aSttIdx( *this, nSttNd );
@@ -555,7 +564,7 @@ SwTableNode* SwNodes::UndoTableToText( ULONG nSttNd, ULONG nEndNd,
Delete all Frames attached to the nodes in that range. */
SwNode* pNd;
{
- ULONG n, nTmpEnd = aEndIdx.GetIndex();
+ sal_uLong n, nTmpEnd = aEndIdx.GetIndex();
for( n = pTblNd->GetIndex() + 1; n < nTmpEnd; ++n )
{
if( ( pNd = (*this)[ n ] )->IsCntntNode() )
@@ -573,7 +582,7 @@ SwTableNode* SwNodes::UndoTableToText( ULONG nSttNd, ULONG nEndNd,
pTblNd->GetTable().GetTabLines().C40_INSERT( SwTableLine, pLine, 0 );
SvULongs aBkmkArr( 0, 4 );
- for( USHORT n = rSavedData.Count(); n; )
+ for( sal_uInt16 n = rSavedData.Count(); n; )
{
SwTblToTxtSave* pSave = rSavedData[ --n ];
// if the start node was merged with last from prev. cell,
@@ -617,7 +626,7 @@ SwTableNode* SwNodes::UndoTableToText( ULONG nSttNd, ULONG nEndNd,
if( pSave->m_pHstry )
{
- USHORT nTmpEnd = pSave->m_pHstry->GetTmpEnd();
+ sal_uInt16 nTmpEnd = pSave->m_pHstry->GetTmpEnd();
pSave->m_pHstry->TmpRollback( GetDoc(), 0 );
pSave->m_pHstry->SetTmpEnd( nTmpEnd );
}
@@ -639,7 +648,7 @@ SwTableNode* SwNodes::UndoTableToText( ULONG nSttNd, ULONG nEndNd,
pSttNd->pStartOfSection = pTblNd;
new SwEndNode( aEndIdx, *pSttNd );
- for( ULONG i = aSttIdx.GetIndex(); i < aEndIdx.GetIndex()-1; ++i )
+ for( sal_uLong i = aSttIdx.GetIndex(); i < aEndIdx.GetIndex()-1; ++i )
{
pNd = (*this)[ i ];
pNd->pStartOfSection = pSttNd;
@@ -654,11 +663,10 @@ SwTableNode* SwNodes::UndoTableToText( ULONG nSttNd, ULONG nEndNd,
}
-void SwUndoTblToTxt::Redo( SwUndoIter& rUndoIter )
+void SwUndoTblToTxt::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
- SwPaM* pPam = rUndoIter.pAktPam;
-
+ SwDoc & rDoc = rContext.GetDoc();
+ SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor());
pPam->GetPoint()->nNode = nSttNd;
pPam->GetPoint()->nContent.Assign( 0, 0 );
@@ -681,7 +689,7 @@ void SwUndoTblToTxt::Redo( SwUndoIter& rUndoIter )
if( !pCNd && 0 == ( pCNd = rDoc.GetNodes().GoNext( &aSaveIdx ) ) &&
0 == ( pCNd = rDoc.GetNodes().GoPrevious( &aSaveIdx )) )
{
- ASSERT( FALSE, "wo steht denn nun der TextNode" );
+ ASSERT( sal_False, "wo steht denn nun der TextNode" );
}
pPam->GetPoint()->nNode = aSaveIdx;
@@ -692,19 +700,19 @@ void SwUndoTblToTxt::Redo( SwUndoIter& rUndoIter )
}
-void SwUndoTblToTxt::Repeat( SwUndoIter& rUndoIter )
+void SwUndoTblToTxt::RepeatImpl(::sw::RepeatContext & rContext)
{
- SwTableNode* pTblNd = rUndoIter.pAktPam->GetNode()->FindTableNode();
+ SwPaM *const pPam = & rContext.GetRepeatPaM();
+ SwTableNode *const pTblNd = pPam->GetNode()->FindTableNode();
if( pTblNd )
{
- // bewege den Cursor aus der Tabelle
- SwPaM* pPam = rUndoIter.pAktPam;
+ // move cursor out of table
pPam->GetPoint()->nNode = *pTblNd->EndOfSectionNode();
pPam->Move( fnMoveForward, fnGoCntnt );
pPam->SetMark();
pPam->DeleteMark();
- rUndoIter.GetDoc().TableToText( pTblNd, cTrenner );
+ rContext.GetDoc().TableToText( pTblNd, cTrenner );
}
}
@@ -714,7 +722,7 @@ void SwUndoTblToTxt::SetRange( const SwNodeRange& rRg )
nEndNd = rRg.aEnd.GetIndex();
}
-void SwUndoTblToTxt::AddBoxPos( SwDoc& rDoc, ULONG nNdIdx, ULONG nEndIdx, xub_StrLen nCntntIdx )
+void SwUndoTblToTxt::AddBoxPos( SwDoc& rDoc, sal_uLong nNdIdx, sal_uLong nEndIdx, xub_StrLen nCntntIdx )
{
SwTblToTxtSave* pNew = new SwTblToTxtSave( rDoc, nNdIdx, nEndIdx, nCntntIdx );
pBoxSaves->Insert( pNew, pBoxSaves->Count() );
@@ -724,7 +732,7 @@ void SwUndoTblToTxt::AddBoxPos( SwDoc& rDoc, ULONG nNdIdx, ULONG nEndIdx, xub_St
SwUndoTxtToTbl::SwUndoTxtToTbl( const SwPaM& rRg,
const SwInsertTableOptions& rInsTblOpts,
- sal_Unicode cCh, USHORT nAdj,
+ sal_Unicode cCh, sal_uInt16 nAdj,
const SwTableAutoFmt* pAFmt )
: SwUndo( UNDO_TEXTTOTABLE ), SwUndRng( rRg ), aInsTblOpts( rInsTblOpts ),
pDelBoxes( 0 ), pAutoFmt( 0 ),
@@ -746,16 +754,16 @@ SwUndoTxtToTbl::~SwUndoTxtToTbl()
delete pAutoFmt;
}
-void SwUndoTxtToTbl::Undo( SwUndoIter& rUndoIter )
+void SwUndoTxtToTbl::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
- ULONG nTblNd = nSttNode;
+ sal_uLong nTblNd = nSttNode;
if( nSttCntnt )
++nTblNd; // Node wurde vorher gesplittet
SwNodeIndex aIdx( rDoc.GetNodes(), nTblNd );
- SwTableNode* pTNd = rDoc.GetNodes()[ aIdx ]->GetTableNode();
- ASSERT( pTNd, "keinen Tabellen-Node gefunden" );
+ SwTableNode *const pTNd = aIdx.GetNode().GetTableNode();
+ OSL_ENSURE( pTNd, "SwUndoTxtToTbl: no TableNode" );
RemoveIdxFromSection( rDoc, nTblNd );
@@ -770,11 +778,11 @@ void SwUndoTxtToTbl::Undo( SwUndoIter& rUndoIter )
if( pDelBoxes )
{
SwTable& rTbl = pTNd->GetTable();
- for( USHORT n = pDelBoxes->Count(); n; )
+ for( sal_uInt16 n = pDelBoxes->Count(); n; )
{
SwTableBox* pBox = rTbl.GetTblBox( (*pDelBoxes)[ --n ] );
if( pBox )
- ::_DeleteBox( rTbl, pBox, 0, FALSE, FALSE );
+ ::_DeleteBox( rTbl, pBox, 0, sal_False, sal_False );
else {
ASSERT( !this, "Wo ist die Box geblieben?" );
}
@@ -784,15 +792,16 @@ void SwUndoTxtToTbl::Undo( SwUndoIter& rUndoIter )
SwNodeIndex aEndIdx( *pTNd->EndOfSectionNode() );
rDoc.TableToText( pTNd, 0x0b == cTrenner ? 0x09 : cTrenner );
- // am Start wieder zusammenfuegen ?
- SwPosition* pPos = rUndoIter.pAktPam->GetPoint();
+ // join again at start?
+ SwPaM aPam(rDoc.GetNodes().GetEndOfContent());
+ SwPosition *const pPos = aPam.GetPoint();
if( nSttCntnt )
{
pPos->nNode = nTblNd;
- pPos->nContent.Assign( rDoc.GetNodes()[ pPos->nNode ]->GetCntntNode(), 0 );
- if( rUndoIter.pAktPam->Move( fnMoveBackward, fnGoCntnt))
+ pPos->nContent.Assign(pPos->nNode.GetNode().GetCntntNode(), 0);
+ if (aPam.Move(fnMoveBackward, fnGoCntnt))
{
- SwNodeIndex& rIdx = rUndoIter.pAktPam->GetPoint()->nNode;
+ SwNodeIndex & rIdx = aPam.GetPoint()->nNode;
// dann die Crsr/etc. nochmal relativ verschieben
RemoveIdxRel( rIdx.GetIndex()+1, *pPos );
@@ -801,7 +810,7 @@ void SwUndoTxtToTbl::Undo( SwUndoIter& rUndoIter )
}
}
- // am Ende wieder zusammenfuegen ?
+ // join again at end?
if( bSplitEnd )
{
SwNodeIndex& rIdx = pPos->nNode;
@@ -809,8 +818,8 @@ void SwUndoTxtToTbl::Undo( SwUndoIter& rUndoIter )
SwTxtNode* pTxtNd = rIdx.GetNode().GetTxtNode();
if( pTxtNd && pTxtNd->CanJoinNext() )
{
- rUndoIter.pAktPam->GetMark()->nContent.Assign( 0, 0 );
- rUndoIter.pAktPam->GetPoint()->nContent.Assign( 0, 0 );
+ aPam.GetMark()->nContent.Assign( 0, 0 );
+ aPam.GetPoint()->nContent.Assign( 0, 0 );
// dann die Crsr/etc. nochmal relativ verschieben
pPos->nContent.Assign( pTxtNd, pTxtNd->GetTxt().Len() );
@@ -820,30 +829,31 @@ void SwUndoTxtToTbl::Undo( SwUndoIter& rUndoIter )
}
}
- SetPaM( rUndoIter ); // manipulierten Bereich selectieren
+ AddUndoRedoPaM(rContext);
}
-void SwUndoTxtToTbl::Redo( SwUndoIter& rUndoIter )
+void SwUndoTxtToTbl::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SetPaM( rUndoIter );
- RemoveIdxFromRange( *rUndoIter.pAktPam, FALSE );
- SetPaM( rUndoIter );
+ SwPaM & rPam( AddUndoRedoPaM(rContext) );
+ RemoveIdxFromRange(rPam, false);
+ SetPaM(rPam);
- const SwTable* pTable = rUndoIter.GetDoc().TextToTable(
- aInsTblOpts, *rUndoIter.pAktPam, cTrenner,
- nAdjust, pAutoFmt );
+ SwTable const*const pTable = rContext.GetDoc().TextToTable(
+ aInsTblOpts, rPam, cTrenner, nAdjust, pAutoFmt );
((SwFrmFmt*)pTable->GetFrmFmt())->SetName( sTblNm );
}
-void SwUndoTxtToTbl::Repeat( SwUndoIter& rUndoIter )
+void SwUndoTxtToTbl::RepeatImpl(::sw::RepeatContext & rContext)
{
- // keine TABLE IN TABLE
- if( !rUndoIter.pAktPam->GetNode()->FindTableNode() )
- rUndoIter.GetDoc().TextToTable( aInsTblOpts, *rUndoIter.pAktPam,
+ // no Table In Table
+ if (!rContext.GetRepeatPaM().GetNode()->FindTableNode())
+ {
+ rContext.GetDoc().TextToTable( aInsTblOpts, rContext.GetRepeatPaM(),
cTrenner, nAdjust,
pAutoFmt );
+ }
}
void SwUndoTxtToTbl::AddFillBox( const SwTableBox& rBox )
@@ -862,8 +872,8 @@ SwHistory& SwUndoTxtToTbl::GetHistory()
// -----------------------------------------------------
-SwUndoTblHeadline::SwUndoTblHeadline( const SwTable& rTbl, USHORT nOldHdl,
- USHORT nNewHdl )
+SwUndoTblHeadline::SwUndoTblHeadline( const SwTable& rTbl, sal_uInt16 nOldHdl,
+ sal_uInt16 nNewHdl )
: SwUndo( UNDO_TABLEHEADLINE ),
nOldHeadline( nOldHdl ),
nNewHeadline( nNewHdl )
@@ -875,20 +885,18 @@ SwUndoTblHeadline::SwUndoTblHeadline( const SwTable& rTbl, USHORT nOldHdl,
nTblNd = pSttNd->StartOfSectionIndex();
}
-
-void SwUndoTblHeadline::Undo( SwUndoIter& rUndoIter )
+void SwUndoTblHeadline::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
SwTableNode* pTNd = rDoc.GetNodes()[ nTblNd ]->GetTableNode();
ASSERT( pTNd, "keinen Tabellen-Node gefunden" );
rDoc.SetRowsToRepeat( pTNd->GetTable(), nOldHeadline );
}
-
-void SwUndoTblHeadline::Redo( SwUndoIter& rUndoIter )
+void SwUndoTblHeadline::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
SwTableNode* pTNd = rDoc.GetNodes()[ nTblNd ]->GetTableNode();
ASSERT( pTNd, "keinen Tabellen-Node gefunden" );
@@ -896,24 +904,25 @@ void SwUndoTblHeadline::Redo( SwUndoIter& rUndoIter )
rDoc.SetRowsToRepeat( pTNd->GetTable(), nNewHeadline );
}
-
-void SwUndoTblHeadline::Repeat( SwUndoIter& rUndoIter )
+void SwUndoTblHeadline::RepeatImpl(::sw::RepeatContext & rContext)
{
- SwTableNode* pTblNd = rUndoIter.pAktPam->GetNode()->FindTableNode();
+ SwTableNode *const pTblNd =
+ rContext.GetRepeatPaM().GetNode()->FindTableNode();
if( pTblNd )
- rUndoIter.GetDoc().SetRowsToRepeat( pTblNd->GetTable(), nNewHeadline );
+ {
+ rContext.GetDoc().SetRowsToRepeat( pTblNd->GetTable(), nNewHeadline );
+ }
}
-/* */
-
+//////////////////////////////////////////////////////////////////////////
-_SaveTable::_SaveTable( const SwTable& rTbl, USHORT nLnCnt, BOOL bSaveFml )
+_SaveTable::_SaveTable( const SwTable& rTbl, sal_uInt16 nLnCnt, sal_Bool bSaveFml )
: aTblSet( *rTbl.GetFrmFmt()->GetAttrSet().GetPool(), aTableSetRange ),
pSwTable( &rTbl ), nLineCount( nLnCnt ), bSaveFormula( bSaveFml )
{
- bModifyBox = FALSE;
+ bModifyBox = sal_False;
bNewModel = rTbl.IsNewModel();
aTblSet.Put( rTbl.GetFrmFmt()->GetAttrSet() );
pLine = new _SaveLine( 0, *rTbl.GetTabLines()[ 0 ], *this );
@@ -921,7 +930,7 @@ _SaveTable::_SaveTable( const SwTable& rTbl, USHORT nLnCnt, BOOL bSaveFml )
_SaveLine* pLn = pLine;
if( USHRT_MAX == nLnCnt )
nLnCnt = rTbl.GetTabLines().Count();
- for( USHORT n = 1; n < nLnCnt; ++n )
+ for( sal_uInt16 n = 1; n < nLnCnt; ++n )
pLn = new _SaveLine( pLn, *rTbl.GetTabLines()[ n ], *this );
aFrmFmts.Remove( 0, aFrmFmts.Count() );
@@ -935,9 +944,9 @@ _SaveTable::~_SaveTable()
}
-USHORT _SaveTable::AddFmt( SwFrmFmt* pFmt, bool bIsLine )
+sal_uInt16 _SaveTable::AddFmt( SwFrmFmt* pFmt, bool bIsLine )
{
- USHORT nRet = aFrmFmts.GetPos( pFmt );
+ sal_uInt16 nRet = aFrmFmts.GetPos( pFmt );
if( USHRT_MAX == nRet )
{
// Kopie vom ItemSet anlegen
@@ -949,7 +958,7 @@ USHORT _SaveTable::AddFmt( SwFrmFmt* pFmt, bool bIsLine )
// errechnet werden!
//JP 30.07.98: Bug 54295 - Formeln immer im Klartext speichern
const SfxPoolItem* pItem;
- if( SFX_ITEM_SET == pSet->GetItemState( RES_BOXATR_FORMULA, TRUE, &pItem ))
+ if( SFX_ITEM_SET == pSet->GetItemState( RES_BOXATR_FORMULA, sal_True, &pItem ))
{
pSet->ClearItem( RES_BOXATR_VALUE );
if( pSwTable && bSaveFormula )
@@ -968,9 +977,9 @@ USHORT _SaveTable::AddFmt( SwFrmFmt* pFmt, bool bIsLine )
}
-void _SaveTable::RestoreAttr( SwTable& rTbl, BOOL bMdfyBox )
+void _SaveTable::RestoreAttr( SwTable& rTbl, sal_Bool bMdfyBox )
{
- USHORT n;
+ sal_uInt16 n;
bModifyBox = bMdfyBox;
@@ -983,7 +992,7 @@ void _SaveTable::RestoreAttr( SwTable& rTbl, BOOL bMdfyBox )
if( pFmt->IsInCache() )
{
SwFrm::GetCache().Delete( pFmt );
- pFmt->SetInCache( FALSE );
+ pFmt->SetInCache( sal_False );
}
// zur Sicherheit alle Tableframes invalidieren
@@ -1000,7 +1009,7 @@ void _SaveTable::RestoreAttr( SwTable& rTbl, BOOL bMdfyBox )
for( n = aSets.Count(); n; --n )
aFrmFmts.Insert( pFmt, aFrmFmts.Count() );
- USHORT nLnCnt = nLineCount;
+ sal_uInt16 nLnCnt = nLineCount;
if( USHRT_MAX == nLnCnt )
nLnCnt = rTbl.GetTabLines().Count();
@@ -1017,7 +1026,7 @@ void _SaveTable::RestoreAttr( SwTable& rTbl, BOOL bMdfyBox )
}
aFrmFmts.Remove( 0, aFrmFmts.Count() );
- bModifyBox = FALSE;
+ bModifyBox = sal_False;
}
@@ -1027,10 +1036,10 @@ void _SaveTable::SaveCntntAttrs( SwDoc* pDoc )
}
-void _SaveTable::CreateNew( SwTable& rTbl, BOOL bCreateFrms,
- BOOL bRestoreChart )
+void _SaveTable::CreateNew( SwTable& rTbl, sal_Bool bCreateFrms,
+ sal_Bool bRestoreChart )
{
- USHORT n;
+ sal_uInt16 n;
_FndBox aTmpBox( 0, 0 );
//if( bRestoreChart )
@@ -1046,7 +1055,7 @@ void _SaveTable::CreateNew( SwTable& rTbl, BOOL bCreateFrms,
if( pFmt->IsInCache() )
{
SwFrm::GetCache().Delete( pFmt );
- pFmt->SetInCache( FALSE );
+ pFmt->SetInCache( sal_False );
}
// SwTableBox muss ein Format haben!!
@@ -1061,7 +1070,7 @@ void _SaveTable::CreateNew( SwTable& rTbl, BOOL bCreateFrms,
aFrmFmts.Remove( 0, aFrmFmts.Count() );
// die neuen Lines eintragen, die alten loeschen
- USHORT nOldLines = nLineCount;
+ sal_uInt16 nOldLines = nLineCount;
if( USHRT_MAX == nLineCount )
nOldLines = rTbl.GetTabLines().Count();
@@ -1077,8 +1086,8 @@ void _SaveTable::CreateNew( SwTable& rTbl, BOOL bCreateFrms,
// TL_CHART2: notify chart about boxes to be removed
const SwTableBoxes &rBoxes = pOld->GetTabBoxes();
- USHORT nBoxes = rBoxes.Count();
- for (USHORT k = 0; k < nBoxes; ++k)
+ sal_uInt16 nBoxes = rBoxes.Count();
+ for (sal_uInt16 k = 0; k < nBoxes; ++k)
{
SwTableBox *pBox = rBoxes[k];
if (pPCD)
@@ -1096,11 +1105,11 @@ void _SaveTable::CreateNew( SwTable& rTbl, BOOL bCreateFrms,
{
// remove remaining lines...
- for (USHORT k1 = 0; k1 < nOldLines - n; ++k1)
+ for (sal_uInt16 k1 = 0; k1 < nOldLines - n; ++k1)
{
const SwTableBoxes &rBoxes = rTbl.GetTabLines()[n + k1]->GetTabBoxes();
- USHORT nBoxes = rBoxes.Count();
- for (USHORT k2 = 0; k2 < nBoxes; ++k2)
+ sal_uInt16 nBoxes = rBoxes.Count();
+ for (sal_uInt16 k2 = 0; k2 < nBoxes; ++k2)
{
SwTableBox *pBox = rBoxes[k2];
// TL_CHART2: notify chart about boxes to be removed
@@ -1124,8 +1133,13 @@ void _SaveTable::CreateNew( SwTable& rTbl, BOOL bCreateFrms,
}
+<<<<<<< local
void _SaveTable::NewFrmFmt( const SwTableLine* pTblLn, const SwTableBox* pTblBx,
USHORT nFmtPos, SwFrmFmt* pOldFmt )
+=======
+void _SaveTable::NewFrmFmt( const SwClient* pLnBx, sal_Bool bIsLine,
+ sal_uInt16 nFmtPos, SwFrmFmt* pOldFmt )
+>>>>>>> other
{
SwDoc* pDoc = pOldFmt->GetDoc();
@@ -1152,7 +1166,7 @@ void _SaveTable::NewFrmFmt( const SwTableLine* pTblLn, const SwTableBox* pTblBx,
pLast->ReinitializeFrmSizeAttrFlags();
if ( !pTblLn )
{
- ((SwCellFrm*)pLast)->SetDerivedVert( FALSE );
+ ((SwCellFrm*)pLast)->SetDerivedVert( sal_False );
((SwCellFrm*)pLast)->CheckDirChange();
}
}
@@ -1188,7 +1202,7 @@ _SaveLine::_SaveLine( _SaveLine* pPrev, const SwTableLine& rLine, _SaveTable& rS
pBox = new _SaveBox( 0, *rLine.GetTabBoxes()[ 0 ], rSTbl );
_SaveBox* pBx = pBox;
- for( USHORT n = 1; n < rLine.GetTabBoxes().Count(); ++n )
+ for( sal_uInt16 n = 1; n < rLine.GetTabBoxes().Count(); ++n )
pBx = new _SaveBox( pBx, *rLine.GetTabBoxes()[ n ], rSTbl );
}
@@ -1202,10 +1216,14 @@ _SaveLine::~_SaveLine()
void _SaveLine::RestoreAttr( SwTableLine& rLine, _SaveTable& rSTbl )
{
+<<<<<<< local
rSTbl.NewFrmFmt( &rLine, 0, nItemSet, rLine.GetFrmFmt() );
+=======
+ rSTbl.NewFrmFmt( &rLine, sal_True, nItemSet, rLine.GetFrmFmt() );
+>>>>>>> other
_SaveBox* pBx = pBox;
- for( USHORT n = 0; n < rLine.GetTabBoxes().Count(); ++n, pBx = pBx->pNext )
+ for( sal_uInt16 n = 0; n < rLine.GetTabBoxes().Count(); ++n, pBx = pBx->pNext )
{
if( !pBx )
{
@@ -1274,7 +1292,7 @@ _SaveBox::_SaveBox( _SaveBox* pPrev, const SwTableBox& rBox, _SaveTable& rSTbl )
Ptrs.pLine = new _SaveLine( 0, *rBox.GetTabLines()[ 0 ], rSTbl );
_SaveLine* pLn = Ptrs.pLine;
- for( USHORT n = 1; n < rBox.GetTabLines().Count(); ++n )
+ for( sal_uInt16 n = 1; n < rBox.GetTabLines().Count(); ++n )
pLn = new _SaveLine( pLn, *rBox.GetTabLines()[ n ], rSTbl );
}
}
@@ -1292,7 +1310,11 @@ _SaveBox::~_SaveBox()
void _SaveBox::RestoreAttr( SwTableBox& rBox, _SaveTable& rSTbl )
{
+<<<<<<< local
rSTbl.NewFrmFmt( 0, &rBox, nItemSet, rBox.GetFrmFmt() );
+=======
+ rSTbl.NewFrmFmt( &rBox, sal_False, nItemSet, rBox.GetFrmFmt() );
+>>>>>>> other
if( ULONG_MAX == nSttNode ) // keine EndBox
{
@@ -1303,7 +1325,7 @@ void _SaveBox::RestoreAttr( SwTableBox& rBox, _SaveTable& rSTbl )
else
{
_SaveLine* pLn = Ptrs.pLine;
- for( USHORT n = 0; n < rBox.GetTabLines().Count(); ++n, pLn = pLn->pNext )
+ for( sal_uInt16 n = 0; n < rBox.GetTabLines().Count(); ++n, pLn = pLn->pNext )
{
if( !pLn )
{
@@ -1320,9 +1342,9 @@ void _SaveBox::RestoreAttr( SwTableBox& rBox, _SaveTable& rSTbl )
if( Ptrs.pCntntAttrs )
{
SwNodes& rNds = rBox.GetFrmFmt()->GetDoc()->GetNodes();
- USHORT nSet = 0;
- ULONG nEnd = rBox.GetSttNd()->EndOfSectionIndex();
- for( ULONG n = nSttNode + 1; n < nEnd; ++n )
+ sal_uInt16 nSet = 0;
+ sal_uLong nEnd = rBox.GetSttNd()->EndOfSectionIndex();
+ for( sal_uLong n = nSttNode + 1; n < nEnd; ++n )
{
SwCntntNode* pCNd = rNds[ n ]->GetCntntNode();
if( pCNd )
@@ -1330,7 +1352,7 @@ void _SaveBox::RestoreAttr( SwTableBox& rBox, _SaveTable& rSTbl )
SfxItemSet* pSet = (*Ptrs.pCntntAttrs)[ nSet++ ];
if( pSet )
{
- USHORT *pRstAttr = aSave_BoxCntntSet;
+ sal_uInt16 *pRstAttr = aSave_BoxCntntSet;
while( *pRstAttr )
{
pCNd->ResetAttr( *pRstAttr, *(pRstAttr+1) );
@@ -1360,9 +1382,9 @@ void _SaveBox::SaveCntntAttrs( SwDoc* pDoc )
}
else
{
- ULONG nEnd = pDoc->GetNodes()[ nSttNode ]->EndOfSectionIndex();
- Ptrs.pCntntAttrs = new SfxItemSets( (BYTE)(nEnd - nSttNode - 1 ), 5 );
- for( ULONG n = nSttNode + 1; n < nEnd; ++n )
+ sal_uLong nEnd = pDoc->GetNodes()[ nSttNode ]->EndOfSectionIndex();
+ Ptrs.pCntntAttrs = new SfxItemSets( (sal_uInt8)(nEnd - nSttNode - 1 ), 5 );
+ for( sal_uLong n = nSttNode + 1; n < nEnd; ++n )
{
SwCntntNode* pCNd = pDoc->GetNodes()[ n ]->GetCntntNode();
if( pCNd )
@@ -1428,12 +1450,12 @@ void _SaveBox::CreateNew( SwTable& rTbl, SwTableLine& rParent, _SaveTable& rSTbl
}
-/* */
+//////////////////////////////////////////////////////////////////////////
// UndoObject fuer Attribut Aenderung an der Tabelle
-SwUndoAttrTbl::SwUndoAttrTbl( const SwTableNode& rTblNd, BOOL bClearTabCols )
+SwUndoAttrTbl::SwUndoAttrTbl( const SwTableNode& rTblNd, sal_Bool bClearTabCols )
: SwUndo( UNDO_TABLE_ATTR ),
nSttNode( rTblNd.GetIndex() )
{
@@ -1441,17 +1463,14 @@ SwUndoAttrTbl::SwUndoAttrTbl( const SwTableNode& rTblNd, BOOL bClearTabCols )
pSaveTbl = new _SaveTable( rTblNd.GetTable() );
}
-
SwUndoAttrTbl::~SwUndoAttrTbl()
{
delete pSaveTbl;
}
-
-
-void SwUndoAttrTbl::Undo( SwUndoIter& rUndoIter )
+void SwUndoAttrTbl::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
SwTableNode* pTblNd = rDoc.GetNodes()[ nSttNode ]->GetTableNode();
ASSERT( pTblNd, "kein TabellenNode" );
@@ -1467,14 +1486,13 @@ void SwUndoAttrTbl::Undo( SwUndoIter& rUndoIter )
ClearFEShellTabCols();
}
-
-void SwUndoAttrTbl::Redo( SwUndoIter& rUndoIter )
+void SwUndoAttrTbl::RedoImpl(::sw::UndoRedoContext & rContext)
{
- Undo( rUndoIter );
+ UndoImpl(rContext);
}
-/* */
+//////////////////////////////////////////////////////////////////////////
// UndoObject fuer AutoFormat an der Tabelle
@@ -1482,8 +1500,8 @@ void SwUndoAttrTbl::Redo( SwUndoIter& rUndoIter )
SwUndoTblAutoFmt::SwUndoTblAutoFmt( const SwTableNode& rTblNd,
const SwTableAutoFmt& rAFmt )
: SwUndo( UNDO_TABLE_AUTOFMT ),
- nSttNode( rTblNd.GetIndex() ), pUndos( 0 ),
- bSaveCntntAttr( FALSE )
+ nSttNode( rTblNd.GetIndex() ),
+ bSaveCntntAttr( sal_False )
{
pSaveTbl = new _SaveTable( rTblNd.GetTable() );
@@ -1492,29 +1510,26 @@ SwUndoTblAutoFmt::SwUndoTblAutoFmt( const SwTableNode& rTblNd,
// dann auch noch ueber die ContentNodes der EndBoxen und
// und alle Absatz-Attribute zusammen sammeln
pSaveTbl->SaveCntntAttrs( (SwDoc*)rTblNd.GetDoc() );
- bSaveCntntAttr = TRUE;
+ bSaveCntntAttr = sal_True;
}
}
-
SwUndoTblAutoFmt::~SwUndoTblAutoFmt()
{
- delete pUndos;
delete pSaveTbl;
}
void SwUndoTblAutoFmt::SaveBoxCntnt( const SwTableBox& rBox )
{
- SwUndoTblNumFmt* p = new SwUndoTblNumFmt( rBox );
- if( !pUndos )
- pUndos = new SwUndos( 8, 8 );
- pUndos->Insert( p, pUndos->Count() );
+ ::boost::shared_ptr<SwUndoTblNumFmt> const p(new SwUndoTblNumFmt(rBox));
+ m_Undos.push_back(p);
}
-void SwUndoTblAutoFmt::UndoRedo( BOOL bUndo, SwUndoIter& rUndoIter )
+void
+SwUndoTblAutoFmt::UndoRedo(bool const bUndo, ::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
SwTableNode* pTblNd = rDoc.GetNodes()[ nSttNode ]->GetTableNode();
ASSERT( pTblNd, "kein TabellenNode" );
@@ -1524,37 +1539,39 @@ void SwUndoTblAutoFmt::UndoRedo( BOOL bUndo, SwUndoIter& rUndoIter )
if( bSaveCntntAttr )
pOrig->SaveCntntAttrs( &rDoc );
- if( pUndos && bUndo )
- for( USHORT n = pUndos->Count(); n; )
- pUndos->GetObject( --n )->Undo( rUndoIter );
+ if (bUndo)
+ {
+ for (size_t n = m_Undos.size(); 0 < n; --n)
+ {
+ m_Undos.at(n-1)->UndoImpl(rContext);
+ }
+ }
pSaveTbl->RestoreAttr( pTblNd->GetTable(), !bUndo );
delete pSaveTbl;
pSaveTbl = pOrig;
}
-void SwUndoTblAutoFmt::Undo( SwUndoIter& rUndoIter )
+void SwUndoTblAutoFmt::UndoImpl(::sw::UndoRedoContext & rContext)
{
- UndoRedo( TRUE, rUndoIter );
+ UndoRedo(true, rContext);
}
-
-void SwUndoTblAutoFmt::Redo( SwUndoIter& rUndoIter )
+void SwUndoTblAutoFmt::RedoImpl(::sw::UndoRedoContext & rContext)
{
- UndoRedo( FALSE, rUndoIter );
+ UndoRedo(false, rContext);
}
-/* */
-
+//////////////////////////////////////////////////////////////////////////
SwUndoTblNdsChg::SwUndoTblNdsChg( SwUndoId nAction,
const SwSelBoxes& rBoxes,
const SwTableNode& rTblNd,
long nMn, long nMx,
- USHORT nCnt, BOOL bFlg, BOOL bSmHght )
+ sal_uInt16 nCnt, sal_Bool bFlg, sal_Bool bSmHght )
: SwUndo( nAction ),
- aBoxes( rBoxes.Count() < 255 ? (BYTE)rBoxes.Count() : 255, 10 ),
+ aBoxes( rBoxes.Count() < 255 ? (sal_uInt8)rBoxes.Count() : 255, 10 ),
nMin( nMn ), nMax( nMx ),
nSttNode( rTblNd.GetIndex() ), nCurrBox( 0 ),
nCount( nCnt ), nRelDiff( 0 ), nAbsDiff( 0 ),
@@ -1568,7 +1585,7 @@ SwUndoTblNdsChg::SwUndoTblNdsChg( SwUndoId nAction,
pSaveTbl = new _SaveTable( rTbl );
// und die Selektion merken
- for( USHORT n = 0; n < rBoxes.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rBoxes.Count(); ++n )
aBoxes.Insert( rBoxes[n]->GetSttIdx(), n );
}
@@ -1577,13 +1594,13 @@ SwUndoTblNdsChg::SwUndoTblNdsChg( SwUndoId nAction,
const SwSelBoxes& rBoxes,
const SwTableNode& rTblNd )
: SwUndo( nAction ),
- aBoxes( rBoxes.Count() < 255 ? (BYTE)rBoxes.Count() : 255, 10 ),
+ aBoxes( rBoxes.Count() < 255 ? (sal_uInt8)rBoxes.Count() : 255, 10 ),
nMin( 0 ), nMax( 0 ),
nSttNode( rTblNd.GetIndex() ), nCurrBox( 0 ),
nCount( 0 ), nRelDiff( 0 ), nAbsDiff( 0 ),
nSetColType( USHRT_MAX ),
- bFlag( FALSE ),
- bSameHeight( FALSE )
+ bFlag( sal_False ),
+ bSameHeight( sal_False )
{
Ptrs.pNewSttNds = 0;
@@ -1591,7 +1608,7 @@ SwUndoTblNdsChg::SwUndoTblNdsChg( SwUndoId nAction,
pSaveTbl = new _SaveTable( rTbl );
// und die Selektion merken
- for( USHORT n = 0; n < rBoxes.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rBoxes.Count(); ++n )
aBoxes.Insert( rBoxes[n]->GetSttIdx(), n );
}
@@ -1600,7 +1617,7 @@ void SwUndoTblNdsChg::ReNewBoxes( const SwSelBoxes& rBoxes )
if( rBoxes.Count() != aBoxes.Count() )
{
aBoxes.Remove( 0, aBoxes.Count() );
- for( USHORT n = 0; n < rBoxes.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rBoxes.Count(); ++n )
aBoxes.Insert( rBoxes[n]->GetSttIdx(), n );
}
}
@@ -1620,11 +1637,11 @@ void SwUndoTblNdsChg::SaveNewBoxes( const SwTableNode& rTblNd,
{
const SwTable& rTbl = rTblNd.GetTable();
const SwTableSortBoxes& rTblBoxes = rTbl.GetTabSortBoxes();
- USHORT n;
- USHORT i;
+ sal_uInt16 n;
+ sal_uInt16 i;
ASSERT( ! IsDelBox(), "falsche Action" );
- Ptrs.pNewSttNds = new SvULongs( (BYTE)(rTblBoxes.Count() - rOld.Count()), 5 );
+ Ptrs.pNewSttNds = new SvULongs( (sal_uInt8)(rTblBoxes.Count() - rOld.Count()), 5 );
for( n = 0, i = 0; n < rOld.Count(); ++i )
{
@@ -1650,7 +1667,7 @@ SwTableLine* lcl_FindTableLine( const SwTable& rTable,
rBox.GetUpper()->GetUpper()->GetTabLines()
: rTable.GetTabLines();
const SwTableLine* pLine = rBox.GetUpper();
- USHORT nLineNo = rTableLines.C40_GETPOS( SwTableLine, pLine );
+ sal_uInt16 nLineNo = rTableLines.C40_GETPOS( SwTableLine, pLine );
pRet = rTableLines[nLineNo - 1];
return pRet;
@@ -1677,12 +1694,12 @@ void SwUndoTblNdsChg::SaveNewBoxes( const SwTableNode& rTblNd,
const SwTableSortBoxes& rTblBoxes = rTbl.GetTabSortBoxes();
ASSERT( ! IsDelBox(), "falsche Action" );
- Ptrs.pNewSttNds = new SvULongs( (BYTE)(rTblBoxes.Count() - rOld.Count()), 5 );
+ Ptrs.pNewSttNds = new SvULongs( (sal_uInt8)(rTblBoxes.Count() - rOld.Count()), 5 );
ASSERT( rTbl.IsNewModel() || rOld.Count() + nCount * rBoxes.Count() == rTblBoxes.Count(),
"unexpected boxes" );
ASSERT( rOld.Count() <= rTblBoxes.Count(), "more unexpected boxes" );
- for( USHORT n = 0, i = 0; i < rTblBoxes.Count(); ++i )
+ for( sal_uInt16 n = 0, i = 0; i < rTblBoxes.Count(); ++i )
{
if( ( n < rOld.Count() ) &&
( rOld[ n ] == rTblBoxes[ i ] ) )
@@ -1693,7 +1710,7 @@ void SwUndoTblNdsChg::SaveNewBoxes( const SwTableNode& rTblNd,
else
{
// new box found: insert (obey sort order)
- USHORT nInsPos;
+ sal_uInt16 nInsPos;
const SwTableBox* pBox = rTblBoxes[ i ];
InsertSort( *Ptrs.pNewSttNds, pBox->GetSttIdx(), &nInsPos );
@@ -1704,15 +1721,15 @@ void SwUndoTblNdsChg::SaveNewBoxes( const SwTableNode& rTblNd,
const SwTableBox* pSourceBox = NULL;
const SwTableBox* pCheckBox = NULL;
const SwTableLine* pBoxLine = pBox->GetUpper();
- USHORT nLineDiff = lcl_FindParentLines(rTbl,*pBox).C40_GETPOS(SwTableLine,pBoxLine);
- USHORT nLineNo = 0;
- for( USHORT j = 0; j < rBoxes.Count(); ++j )
+ sal_uInt16 nLineDiff = lcl_FindParentLines(rTbl,*pBox).C40_GETPOS(SwTableLine,pBoxLine);
+ sal_uInt16 nLineNo = 0;
+ for( sal_uInt16 j = 0; j < rBoxes.Count(); ++j )
{
pCheckBox = rBoxes[j];
if( pCheckBox->GetUpper()->GetUpper() == pBox->GetUpper()->GetUpper() )
{
const SwTableLine* pCheckLine = pCheckBox->GetUpper();
- USHORT nCheckLine = lcl_FindParentLines( rTbl, *pCheckBox ).
+ sal_uInt16 nCheckLine = lcl_FindParentLines( rTbl, *pCheckBox ).
C40_GETPOS( SwTableLine, pCheckLine );
if( ( !pSourceBox || nCheckLine > nLineNo ) && nCheckLine < nLineDiff )
{
@@ -1728,10 +1745,10 @@ void SwUndoTblNdsChg::SaveNewBoxes( const SwTableNode& rTblNd,
ASSERT( pSourceBox, "Splitted source box not found!" );
// find out how many nodes the source box used to have
// (to help determine bNodesMoved flag below)
- USHORT nNdsPos = 0;
+ sal_uInt16 nNdsPos = 0;
while( rBoxes[ nNdsPos ] != pSourceBox )
++nNdsPos;
- ULONG nNodes = rNodeCnts[ nNdsPos ];
+ sal_uLong nNodes = rNodeCnts[ nNdsPos ];
// When a new table cell is created, it either gets a new
// node, or it gets node(s) from elsewhere. The undo must
@@ -1745,7 +1762,7 @@ void SwUndoTblNdsChg::SaveNewBoxes( const SwTableNode& rTblNd,
// The bNodesMoved flag is stored in a seperate array
// which mirrors Ptrs.pNewSttNds, i.e. Ptrs.pNewSttNds[i]
// and aMvBoxes[i] belong together.
- BOOL bNodesMoved =
+ sal_Bool bNodesMoved =
( nNodes != ( pSourceBox->GetSttNd()->EndOfSectionIndex() -
pSourceBox->GetSttIdx() ) )
&& ( nNodes - 1 > nLineDiff );
@@ -1770,13 +1787,13 @@ void SwUndoTblNdsChg::SaveSection( SwStartNode* pSttNd )
}
-void SwUndoTblNdsChg::Undo( SwUndoIter& rUndoIter )
+void SwUndoTblNdsChg::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
SwNodeIndex aIdx( rDoc.GetNodes(), nSttNode );
- SwTableNode* pTblNd = rDoc.GetNodes()[ aIdx ]->GetTableNode();
- ASSERT( pTblNd, "kein TabellenNode" );
+ SwTableNode *const pTblNd = aIdx.GetNode().GetTableNode();
+ OSL_ENSURE( pTblNd, "SwUndoTblNdsChg: no TableNode" );
SwTableFmlUpdate aMsgHnt( &pTblNd->GetTable() );
aMsgHnt.eFlags = TBL_BOXPTR;
@@ -1797,7 +1814,7 @@ void SwUndoTblNdsChg::Undo( SwUndoIter& rUndoIter )
SwTableBoxes& rLnBoxes = pCpyBox->GetUpper()->GetTabBoxes();
// die Sections wieder herstellen
- for( USHORT n = Ptrs.pDelSects->Count(); n; )
+ for( sal_uInt16 n = Ptrs.pDelSects->Count(); n; )
{
SwUndoSaveSection* pSave = (*Ptrs.pDelSects)[ --n ];
pSave->RestoreSection( &rDoc, &aIdx, SwTableBoxStartNode );
@@ -1817,10 +1834,10 @@ void SwUndoTblNdsChg::Undo( SwUndoIter& rUndoIter )
aTmp.Insert( Ptrs.pNewSttNds, 0 );
// von hinten anfangen
- for( USHORT n = aTmp.Count(); n; )
+ for( sal_uInt16 n = aTmp.Count(); n; )
{
// Box aus der Tabellen-Struktur entfernen
- ULONG nIdx = aTmp[ --n ];
+ sal_uLong nIdx = aTmp[ --n ];
SwTableBox* pBox = pTblNd->GetTable().GetTblBox( nIdx );
ASSERT( pBox, "Wo ist meine TabellenBox geblieben?" );
@@ -1837,8 +1854,8 @@ void SwUndoTblNdsChg::Undo( SwUndoIter& rUndoIter )
SwNodeIndex aInsPos( *(pLine->GetTabBoxes()[0]->GetSttNd()), 2 );
// alle StartNode Indizies anpassen
- USHORT i = n;
- ULONG nSttIdx = aInsPos.GetIndex() - 2,
+ sal_uInt16 i = n;
+ sal_uLong nSttIdx = aInsPos.GetIndex() - 2,
nNdCnt = aRg.aEnd.GetIndex() - aRg.aStart.GetIndex();
while( i && aTmp[ --i ] > nSttIdx )
aTmp[ i ] += nNdCnt;
@@ -1846,7 +1863,7 @@ void SwUndoTblNdsChg::Undo( SwUndoIter& rUndoIter )
// erst die Box loeschen
delete pBox;
// dann die Nodes verschieben,
- rDoc.GetNodes()._MoveNodes( aRg, rDoc.GetNodes(), aInsPos, FALSE );
+ rDoc.GetNodes()._MoveNodes( aRg, rDoc.GetNodes(), aInsPos, sal_False );
}
else
rDoc.DeleteSection( rDoc.GetNodes()[ nIdx ] );
@@ -1856,9 +1873,9 @@ void SwUndoTblNdsChg::Undo( SwUndoIter& rUndoIter )
else
{
// Remove nodes from nodes array (backwards!)
- for( USHORT n = Ptrs.pNewSttNds->Count(); n; )
+ for( sal_uInt16 n = Ptrs.pNewSttNds->Count(); n; )
{
- ULONG nIdx = (*Ptrs.pNewSttNds)[ --n ];
+ sal_uLong nIdx = (*Ptrs.pNewSttNds)[ --n ];
SwTableBox* pBox = pTblNd->GetTable().GetTblBox( nIdx );
ASSERT( pBox, "Where's my table box?" );
// TL_CHART2: notify chart about box to be removed
@@ -1869,7 +1886,7 @@ void SwUndoTblNdsChg::Undo( SwUndoIter& rUndoIter )
}
}
// Remove boxes from table structure
- for( USHORT n = 0; n < aDelBoxes.size(); ++n )
+ for( sal_uInt16 n = 0; n < aDelBoxes.size(); ++n )
{
SwTableBox* pCurrBox = aDelBoxes[n];
SwTableBoxes* pTBoxes = &pCurrBox->GetUpper()->GetTabBoxes();
@@ -1877,7 +1894,7 @@ void SwUndoTblNdsChg::Undo( SwUndoIter& rUndoIter )
delete pCurrBox;
}
- pSaveTbl->CreateNew( pTblNd->GetTable(), TRUE, FALSE );
+ pSaveTbl->CreateNew( pTblNd->GetTable(), sal_True, sal_False );
// TL_CHART2: need to inform chart of probably changed cell names
rDoc.UpdateCharts( pTblNd->GetTable().GetFrmFmt()->GetName() );
@@ -1889,16 +1906,16 @@ void SwUndoTblNdsChg::Undo( SwUndoIter& rUndoIter )
}
-void SwUndoTblNdsChg::Redo( SwUndoIter& rUndoIter )
+void SwUndoTblNdsChg::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
SwTableNode* pTblNd = rDoc.GetNodes()[ nSttNode ]->GetTableNode();
ASSERT( pTblNd, "kein TabellenNode" );
CHECK_TABLE( pTblNd->GetTable() )
SwSelBoxes aSelBoxes;
- for( USHORT n = 0; n < aBoxes.Count(); ++n )
+ for( sal_uInt16 n = 0; n < aBoxes.Count(); ++n )
{
SwTableBox* pBox = pTblNd->GetTable().GetTblBox( aBoxes[ n ] );
aSelBoxes.Insert( pBox );
@@ -1946,7 +1963,7 @@ void SwUndoTblNdsChg::Redo( SwUndoIter& rUndoIter )
SwTable &rTable = pTblNd->GetTable();
if( nMax > nMin && rTable.IsNewModel() )
rTable.PrepareDeleteCol( nMin, nMax );
- rTable.DeleteSel( &rDoc, aSelBoxes, 0, this, TRUE, TRUE );
+ rTable.DeleteSel( &rDoc, aSelBoxes, 0, this, sal_True, sal_True );
}
else
{
@@ -1960,7 +1977,8 @@ void SwUndoTblNdsChg::Redo( SwUndoIter& rUndoIter )
TblChgMode eOldMode = rTbl.GetTblChgMode();
rTbl.SetTblChgMode( (TblChgMode)nCount );
- rDoc.DoUndo( TRUE ); // wir brauchen die SaveSections!
+ // need the SaveSections!
+ rDoc.GetIDocumentUndoRedo().DoUndo( true );
SwUndoTblNdsChg* pUndo = 0;
switch( nSetColType & 0xff )
@@ -1988,7 +2006,7 @@ void SwUndoTblNdsChg::Redo( SwUndoIter& rUndoIter )
delete pUndo;
}
- rDoc.DoUndo( FALSE );
+ rDoc.GetIDocumentUndoRedo().DoUndo( false );
rTbl.SetTblChgMode( eOldMode );
}
@@ -2002,8 +2020,7 @@ void SwUndoTblNdsChg::Redo( SwUndoIter& rUndoIter )
}
-/* */
-
+//////////////////////////////////////////////////////////////////////////
SwUndoTblMerge::SwUndoTblMerge( const SwPaM& rTblSel )
: SwUndo( UNDO_TABLE_MERGE ), SwUndRng( rTblSel ), pHistory( 0 )
@@ -2015,7 +2032,6 @@ SwUndoTblMerge::SwUndoTblMerge( const SwPaM& rTblSel )
nTblNode = pTblNd->GetIndex();
}
-
SwUndoTblMerge::~SwUndoTblMerge()
{
delete pSaveTbl;
@@ -2023,14 +2039,13 @@ SwUndoTblMerge::~SwUndoTblMerge()
delete pHistory;
}
-
-void SwUndoTblMerge::Undo( SwUndoIter& rUndoIter )
+void SwUndoTblMerge::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
SwNodeIndex aIdx( rDoc.GetNodes(), nTblNode );
- SwTableNode* pTblNd = rDoc.GetNodes()[ aIdx ]->GetTableNode();
- ASSERT( pTblNd, "kein TabellenNode" );
+ SwTableNode *const pTblNd = aIdx.GetNode().GetTableNode();
+ OSL_ENSURE( pTblNd, "SwUndoTblMerge: no TableNode" );
SwTableFmlUpdate aMsgHnt( &pTblNd->GetTable() );
aMsgHnt.eFlags = TBL_BOXPTR;
@@ -2052,7 +2067,7 @@ CHECKTABLE(pTblNd->GetTable())
SwSelBoxes aSelBoxes;
SwTxtFmtColl* pColl = rDoc.GetTxtCollFromPool( RES_POOLCOLL_STANDARD );
- USHORT n;
+ sal_uInt16 n;
for( n = 0; n < aBoxes.Count(); ++n )
{
@@ -2075,7 +2090,7 @@ CHECKTABLE(pTblNd->GetTable())
for( n = aNewSttNds.Count(); n; )
{
// Box aus der Tabellen-Struktur entfernen
- ULONG nIdx = aNewSttNds[ --n ];
+ sal_uLong nIdx = aNewSttNds[ --n ];
if( !nIdx && n )
{
@@ -2088,17 +2103,17 @@ CHECKTABLE(pTblNd->GetTable())
*pBox->GetSttNd()->EndOfSectionNode() ), pColl );
// das war der Trenner, -> die verschobenen herstellen
- for( USHORT i = pMoves->Count(); i; )
+ for( sal_uInt16 i = pMoves->Count(); i; )
{
SwTxtNode* pTxtNd = 0;
- USHORT nDelPos = 0;
+ sal_uInt16 nDelPos = 0;
SwUndoMove* pUndo = (*pMoves)[ --i ];
if( !pUndo->IsMoveRange() )
{
pTxtNd = rDoc.GetNodes()[ pUndo->GetDestSttNode() ]->GetTxtNode();
nDelPos = pUndo->GetDestSttCntnt() - 1;
}
- pUndo->Undo( rUndoIter );
+ pUndo->UndoImpl(rContext);
if( pUndo->IsMoveRange() )
{
// den ueberfluessigen Node loeschen
@@ -2148,7 +2163,7 @@ DUMPDOC( &rDoc, String( "d:\\tmp\\tab_") + String( aNewSttNds.Count() - i ) +
SwNodeIndex aTmpIdx( *pBox->GetSttNd() );
rDoc.CorrAbs( SwNodeIndex( aTmpIdx, 1 ),
SwNodeIndex( *aTmpIdx.GetNode().EndOfSectionNode() ),
- SwPosition( aTmpIdx, SwIndex( 0, 0 )), TRUE );
+ SwPosition( aTmpIdx, SwIndex( 0, 0 )), sal_True );
}
delete pBox;
@@ -2159,7 +2174,7 @@ DUMPDOC( &rDoc, "d:\\tmp\\tab_z.db" )
CHECKTABLE(pTblNd->GetTable())
- pSaveTbl->CreateNew( pTblNd->GetTable(), TRUE, FALSE );
+ pSaveTbl->CreateNew( pTblNd->GetTable(), sal_True, sal_False );
// TL_CHART2: need to inform chart of probably changed cell names
rDoc.UpdateCharts( pTblNd->GetTable().GetFrmFmt()->GetName() );
@@ -2171,7 +2186,7 @@ CHECKTABLE(pTblNd->GetTable())
}
// nTblNode = pTblNd->GetIndex();
- SwPaM* pPam = rUndoIter.pAktPam;
+ SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor());
pPam->DeleteMark();
pPam->GetPoint()->nNode = nSttNode;
pPam->GetPoint()->nContent.Assign( pPam->GetCntntNode(), nSttCntnt );
@@ -2182,27 +2197,21 @@ CHECKTABLE(pTblNd->GetTable())
ClearFEShellTabCols();
}
-
-void SwUndoTblMerge::Redo( SwUndoIter& rUndoIter )
+void SwUndoTblMerge::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwPaM* pPam = rUndoIter.pAktPam;
- SwDoc& rDoc = *pPam->GetDoc();
-
- SetPaM( *pPam );
- rDoc.MergeTbl( *pPam );
+ SwDoc & rDoc = rContext.GetDoc();
+ SwPaM & rPam( AddUndoRedoPaM(rContext) );
+ rDoc.MergeTbl(rPam);
}
void SwUndoTblMerge::MoveBoxCntnt( SwDoc* pDoc, SwNodeRange& rRg, SwNodeIndex& rPos )
{
SwNodeIndex aTmp( rRg.aStart, -1 ), aTmp2( rPos, -1 );
SwUndoMove* pUndo = new SwUndoMove( pDoc, rRg, rPos );
- sal_Bool bDoesUndo = pDoc->DoesUndo();
- pDoc->DoUndo( sal_False );
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
pDoc->MoveNodeRange( rRg, rPos, (pSaveTbl->IsNewModel()) ?
IDocumentContentOperations::DOC_NO_DELFRMS :
IDocumentContentOperations::DOC_MOVEDEFAULT );
- if( bDoesUndo )
- pDoc->DoUndo( sal_True );
aTmp++;
aTmp2++;
pUndo->SetDestRange( aTmp2, rPos, aTmp );
@@ -2210,15 +2219,14 @@ void SwUndoTblMerge::MoveBoxCntnt( SwDoc* pDoc, SwNodeRange& rRg, SwNodeIndex& r
pMoves->Insert( pUndo, pMoves->Count() );
}
-
void SwUndoTblMerge::SetSelBoxes( const SwSelBoxes& rBoxes )
{
// die Selektion merken
- for( USHORT n = 0; n < rBoxes.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rBoxes.Count(); ++n )
InsertSort( aBoxes, rBoxes[n]->GetSttIdx() );
// als Trennung fuers einfuegen neuer Boxen nach dem Verschieben!
- aNewSttNds.Insert( (ULONG)0, aNewSttNds.Count() );
+ aNewSttNds.Insert( (sal_uLong)0, aNewSttNds.Count() );
// The new table model does not delete overlapped cells (by row span),
// so the rBoxes array might be empty even some cells have been merged.
@@ -2241,15 +2249,15 @@ void SwUndoTblMerge::SaveCollection( const SwTableBox& rBox )
pHistory->CopyFmtAttr( *pCNd->GetpSwAttrSet(), aIdx.GetIndex() );
}
-/* */
+//////////////////////////////////////////////////////////////////////////
SwUndoTblNumFmt::SwUndoTblNumFmt( const SwTableBox& rBox,
const SfxItemSet* pNewSet )
: SwUndo( UNDO_TBLNUMFMT ),
pBoxSet( 0 ), pHistory( 0 ), nFmtIdx( NUMBERFORMAT_TEXT )
{
- bNewFmt = bNewFml = bNewValue = FALSE;
+ bNewFmt = bNewFml = bNewValue = sal_False;
nNode = rBox.GetSttIdx();
nNdPos = rBox.IsValidNumTxtNd( 0 == pNewSet );
@@ -2281,21 +2289,21 @@ SwUndoTblNumFmt::SwUndoTblNumFmt( const SwTableBox& rBox,
{
const SfxPoolItem* pItem;
if( SFX_ITEM_SET == pNewSet->GetItemState( RES_BOXATR_FORMAT,
- FALSE, &pItem ))
+ sal_False, &pItem ))
{
- bNewFmt = TRUE;
+ bNewFmt = sal_True;
nNewFmtIdx = ((SwTblBoxNumFormat*)pItem)->GetValue();
}
if( SFX_ITEM_SET == pNewSet->GetItemState( RES_BOXATR_FORMULA,
- FALSE, &pItem ))
+ sal_False, &pItem ))
{
- bNewFml = TRUE;
+ bNewFml = sal_True;
aNewFml = ((SwTblBoxFormula*)pItem)->GetFormula();
}
if( SFX_ITEM_SET == pNewSet->GetItemState( RES_BOXATR_VALUE,
- FALSE, &pItem ))
+ sal_False, &pItem ))
{
- bNewValue = TRUE;
+ bNewValue = sal_True;
fNewNum = ((SwTblBoxValue*)pItem)->GetValue();
}
}
@@ -2305,18 +2313,17 @@ SwUndoTblNumFmt::SwUndoTblNumFmt( const SwTableBox& rBox,
DELETEZ( pHistory );
}
-
SwUndoTblNumFmt::~SwUndoTblNumFmt()
{
delete pHistory;
delete pBoxSet;
}
-void SwUndoTblNumFmt::Undo( SwUndoIter& rIter )
+void SwUndoTblNumFmt::UndoImpl(::sw::UndoRedoContext & rContext)
{
ASSERT( pBoxSet, "Where's the stored item set?" )
- SwDoc& rDoc = rIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
SwStartNode* pSttNd = rDoc.GetNodes()[ nNode ]->
FindSttNodeByType( SwTableBoxStartNode );
ASSERT( pSttNd, "ohne StartNode kein TabellenBox" );
@@ -2357,12 +2364,12 @@ void SwUndoTblNumFmt::Undo( SwUndoIter& rIter )
if( pHistory )
{
- USHORT nTmpEnd = pHistory->GetTmpEnd();
+ sal_uInt16 nTmpEnd = pHistory->GetTmpEnd();
pHistory->TmpRollback( &rDoc, 0 );
pHistory->SetTmpEnd( nTmpEnd );
}
- SwPaM* pPam = rIter.pAktPam;
+ SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor());
pPam->DeleteMark();
pPam->GetPoint()->nNode = nNode + 1;
pPam->GetPoint()->nContent.Assign( pTxtNd, 0 );
@@ -2405,19 +2412,19 @@ RedlineModeInternGuard::~RedlineModeInternGuard()
-void SwUndoTblNumFmt::Redo( SwUndoIter& rIter )
+void SwUndoTblNumFmt::RedoImpl(::sw::UndoRedoContext & rContext)
{
// konnte die Box veraendert werden ?
if( !pBoxSet )
return ;
- SwDoc& rDoc = rIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
+ SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor());
- SwPaM* pPam = rIter.pAktPam;
pPam->DeleteMark();
pPam->GetPoint()->nNode = nNode;
- SwNode* pNd = rDoc.GetNodes()[ pPam->GetPoint()->nNode ];
+ SwNode * pNd = & pPam->GetPoint()->nNode.GetNode();
SwStartNode* pSttNd = pNd->FindSttNodeByType( SwTableBoxStartNode );
ASSERT( pSttNd, "ohne StartNode kein TabellenBox" );
SwTableBox* pBox = pSttNd->FindTableNode()->GetTable().GetTblBox(
@@ -2505,7 +2512,8 @@ void SwUndoTblNumFmt::SetBox( const SwTableBox& rBox )
nNode = rBox.GetSttIdx();
}
-/* */
+
+//////////////////////////////////////////////////////////////////////////
_UndoTblCpyTbl_Entry::_UndoTblCpyTbl_Entry( const SwTableBox& rBox )
: nBoxIdx( rBox.GetSttIdx() ), nOffset( 0 ),
@@ -2532,16 +2540,16 @@ SwUndoTblCpyTbl::~SwUndoTblCpyTbl()
delete pInsRowUndo;
}
-void SwUndoTblCpyTbl::Undo( SwUndoIter& rIter )
+void SwUndoTblCpyTbl::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
_DEBUG_REDLINE( &rDoc )
SwTableNode* pTblNd = 0;
- for( USHORT n = pArr->Count(); n; )
+ for( sal_uInt16 n = pArr->Count(); n; )
{
_UndoTblCpyTbl_Entry* pEntry = (*pArr)[ --n ];
- ULONG nSttPos = pEntry->nBoxIdx + pEntry->nOffset;
+ sal_uLong nSttPos = pEntry->nBoxIdx + pEntry->nOffset;
SwStartNode* pSNd = rDoc.GetNodes()[ nSttPos ]->StartOfSectionNode();
if( !pTblNd )
pTblNd = pSNd->FindTableNode();
@@ -2563,23 +2571,29 @@ void SwUndoTblCpyTbl::Undo( SwUndoIter& rIter )
// There are a couple of different situations to consider during redlining
if( pEntry->pUndo )
{
- SwUndoDelete *pUnDel = (SwUndoDelete*)pEntry->pUndo;
- if( UNDO_REDLINE == pUnDel->GetId() )
+ SwUndoDelete *const pUndoDelete =
+ dynamic_cast<SwUndoDelete*>(pEntry->pUndo);
+ SwUndoRedlineDelete *const pUndoRedlineDelete =
+ dynamic_cast<SwUndoRedlineDelete*>(pEntry->pUndo);
+ OSL_ASSERT(pUndoDelete || pUndoRedlineDelete);
+ if (pUndoRedlineDelete)
{
// The old content was not empty or he has been merged with the new content
bDeleteCompleteParagraph = !pEntry->bJoin; // bJoin is set when merged
// Set aTmpIdx to the beginning fo the old content
- SwNodeIndex aTmpIdx( *pEndNode, pUnDel->NodeDiff()-1 );
+ SwNodeIndex aTmpIdx( *pEndNode,
+ pUndoRedlineDelete->NodeDiff()-1 );
SwTxtNode *pTxt = aTmpIdx.GetNode().GetTxtNode();
if( pTxt )
{
aPam.GetPoint()->nNode = *pTxt;
- aPam.GetPoint()->nContent.Assign( pTxt, pUnDel->ContentStart() );
+ aPam.GetPoint()->nContent.Assign( pTxt,
+ pUndoRedlineDelete->ContentStart() );
}
else
*aPam.GetPoint() = SwPosition( aTmpIdx );
}
- else if( pUnDel->IsDelFullPara() )
+ else if (pUndoDelete && pUndoDelete->IsDelFullPara())
{
// When the old content was an empty paragraph, but could not be joined
// with the new content (e.g. because of a section or table)
@@ -2603,8 +2617,9 @@ void SwUndoTblCpyTbl::Undo( SwUndoIter& rIter )
if( pEntry->pUndo )
{
- pEntry->pUndo->Undo( rIter );
+ pEntry->pUndo->UndoImpl(rContext);
delete pEntry->pUndo;
+ pEntry->pUndo = 0;
}
if( bShiftPam )
{
@@ -2620,15 +2635,16 @@ void SwUndoTblCpyTbl::Undo( SwUndoIter& rIter )
else
*aPam.GetPoint() = SwPosition( aTmpIdx );
}
- pUndo = new SwUndoDelete( aPam, bDeleteCompleteParagraph, TRUE );
+ pUndo = new SwUndoDelete( aPam, bDeleteCompleteParagraph, sal_True );
}
else
{
pUndo = new SwUndoDelete( aPam, true );
if( pEntry->pUndo )
{
- pEntry->pUndo->Undo( rIter );
+ pEntry->pUndo->UndoImpl(rContext);
delete pEntry->pUndo;
+ pEntry->pUndo = 0;
}
}
pEntry->pUndo = pUndo;
@@ -2664,23 +2680,27 @@ void SwUndoTblCpyTbl::Undo( SwUndoIter& rIter )
}
if( pInsRowUndo )
- pInsRowUndo->Undo( rIter );
+ {
+ pInsRowUndo->UndoImpl(rContext);
+ }
_DEBUG_REDLINE( &rDoc )
}
-void SwUndoTblCpyTbl::Redo( SwUndoIter& rIter )
+void SwUndoTblCpyTbl::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
_DEBUG_REDLINE( &rDoc )
if( pInsRowUndo )
- pInsRowUndo->Redo( rIter );
+ {
+ pInsRowUndo->RedoImpl(rContext);
+ }
SwTableNode* pTblNd = 0;
- for( USHORT n = 0; n < pArr->Count(); ++n )
+ for( sal_uInt16 n = 0; n < pArr->Count(); ++n )
{
_UndoTblCpyTbl_Entry* pEntry = (*pArr)[ n ];
- ULONG nSttPos = pEntry->nBoxIdx + pEntry->nOffset;
+ sal_uLong nSttPos = pEntry->nBoxIdx + pEntry->nOffset;
SwStartNode* pSNd = rDoc.GetNodes()[ nSttPos ]->StartOfSectionNode();
if( !pTblNd )
pTblNd = pSNd->FindTableNode();
@@ -2692,10 +2712,10 @@ void SwUndoTblCpyTbl::Redo( SwUndoIter& rIter )
// b62341295: Redline for copying tables - Start.
rDoc.GetNodes().MakeTxtNode( aInsIdx, (SwTxtFmtColl*)rDoc.GetDfltTxtFmtColl() );
SwPaM aPam( aInsIdx.GetNode(), *rBox.GetSttNd()->EndOfSectionNode());
- SwUndo* pUndo = IDocumentRedlineAccess::IsRedlineOn( GetRedlineMode() ) ? 0 : new SwUndoDelete( aPam, TRUE );
+ SwUndo* pUndo = IDocumentRedlineAccess::IsRedlineOn( GetRedlineMode() ) ? 0 : new SwUndoDelete( aPam, sal_True );
if( pEntry->pUndo )
{
- pEntry->pUndo->Undo( rIter );
+ pEntry->pUndo->UndoImpl(rContext);
if( IDocumentRedlineAccess::IsRedlineOn( GetRedlineMode() ) )
{
// PrepareRedline has to be called with the beginning of the old content
@@ -2703,8 +2723,12 @@ void SwUndoTblCpyTbl::Redo( SwUndoIter& rIter )
// by the Undo operation to this point.
// Otherwise aInsIdx has been moved during the Undo operation
if( pEntry->bJoin )
- pUndo = PrepareRedline( &rDoc, rBox, *rIter.pAktPam->GetPoint(),
+ {
+ SwPaM const& rLastPam =
+ rContext.GetCursorSupplier().GetCurrentShellCursor();
+ pUndo = PrepareRedline( &rDoc, rBox, *rLastPam.GetPoint(),
pEntry->bJoin, true );
+ }
else
{
SwPosition aTmpPos( aInsIdx );
@@ -2712,6 +2736,7 @@ void SwUndoTblCpyTbl::Redo( SwUndoIter& rIter )
}
}
delete pEntry->pUndo;
+ pEntry->pUndo = 0;
}
pEntry->pUndo = pUndo;
// b62341295: Redline for copying tables - End.
@@ -2747,7 +2772,7 @@ void SwUndoTblCpyTbl::Redo( SwUndoIter& rIter )
_DEBUG_REDLINE( &rDoc )
}
-void SwUndoTblCpyTbl::AddBoxBefore( const SwTableBox& rBox, BOOL bDelCntnt )
+void SwUndoTblCpyTbl::AddBoxBefore( const SwTableBox& rBox, sal_Bool bDelCntnt )
{
if( pArr->Count() && !bDelCntnt )
return;
@@ -2764,7 +2789,7 @@ void SwUndoTblCpyTbl::AddBoxBefore( const SwTableBox& rBox, BOOL bDelCntnt )
SwPaM aPam( aInsIdx.GetNode(), *rBox.GetSttNd()->EndOfSectionNode() );
if( !pDoc->IsRedlineOn() )
- pEntry->pUndo = new SwUndoDelete( aPam, TRUE );
+ pEntry->pUndo = new SwUndoDelete( aPam, sal_True );
}
pEntry->pBoxNumAttr = new SfxItemSet( pDoc->GetAttrPool(),
@@ -2776,7 +2801,7 @@ void SwUndoTblCpyTbl::AddBoxBefore( const SwTableBox& rBox, BOOL bDelCntnt )
_DEBUG_REDLINE( pDoc )
}
-void SwUndoTblCpyTbl::AddBoxAfter( const SwTableBox& rBox, const SwNodeIndex& rIdx, BOOL bDelCntnt )
+void SwUndoTblCpyTbl::AddBoxAfter( const SwTableBox& rBox, const SwNodeIndex& rIdx, sal_Bool bDelCntnt )
{
_UndoTblCpyTbl_Entry* pEntry = (*pArr)[ pArr->Count() - 1 ];
@@ -2862,7 +2887,7 @@ SwUndo* SwUndoTblCpyTbl::PrepareRedline( SwDoc* pDoc, const SwTableBox& rBox,
aCellEnd = SwPosition(
SwNodeIndex( *rBox.GetSttNd()->EndOfSectionNode() ));
SwPaM aTmpPam( aDeleteStart, aCellEnd );
- pUndo = new SwUndoDelete( aTmpPam, TRUE );
+ pUndo = new SwUndoDelete( aTmpPam, sal_True );
}
SwPosition aCellStart( SwNodeIndex( *rBox.GetSttNd(), 2 ) );
pTxt = aCellStart.nNode.GetNode().GetTxtNode();
@@ -2879,18 +2904,18 @@ SwUndo* SwUndoTblCpyTbl::PrepareRedline( SwDoc* pDoc, const SwTableBox& rBox,
}
-BOOL SwUndoTblCpyTbl::InsertRow( SwTable& rTbl, const SwSelBoxes& rBoxes,
- USHORT nCnt )
+sal_Bool SwUndoTblCpyTbl::InsertRow( SwTable& rTbl, const SwSelBoxes& rBoxes,
+ sal_uInt16 nCnt )
{
SwTableNode* pTblNd = (SwTableNode*)rTbl.GetTabSortBoxes()[0]->
GetSttNd()->FindTableNode();
SwTableSortBoxes aTmpLst( 0, 5 );
pInsRowUndo = new SwUndoTblNdsChg( UNDO_TABLE_INSROW, rBoxes, *pTblNd,
- 0, 0, nCnt, TRUE, FALSE );
+ 0, 0, nCnt, sal_True, sal_False );
aTmpLst.Insert( &rTbl.GetTabSortBoxes(), 0, rTbl.GetTabSortBoxes().Count() );
- BOOL bRet = rTbl.InsertRow( rTbl.GetFrmFmt()->GetDoc(), rBoxes, nCnt, TRUE );
+ sal_Bool bRet = rTbl.InsertRow( rTbl.GetFrmFmt()->GetDoc(), rBoxes, nCnt, sal_True );
if( bRet )
pInsRowUndo->SaveNewBoxes( *pTblNd, aTmpLst );
else
@@ -2898,12 +2923,13 @@ BOOL SwUndoTblCpyTbl::InsertRow( SwTable& rTbl, const SwSelBoxes& rBoxes,
return bRet;
}
-BOOL SwUndoTblCpyTbl::IsEmpty() const
+sal_Bool SwUndoTblCpyTbl::IsEmpty() const
{
return !pInsRowUndo && !pArr->Count();
}
-/* */
+
+//////////////////////////////////////////////////////////////////////////
SwUndoCpyTbl::SwUndoCpyTbl()
: SwUndo( UNDO_CPYTBL ), pDel( 0 ), nTblNode( 0 )
@@ -2915,9 +2941,9 @@ SwUndoCpyTbl::~SwUndoCpyTbl()
delete pDel;
}
-void SwUndoCpyTbl::Undo( SwUndoIter& rIter )
+void SwUndoCpyTbl::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
SwTableNode* pTNd = rDoc.GetNodes()[ nTblNode ]->GetTableNode();
// harte SeitenUmbrueche am nachfolgenden Node verschieben
@@ -2928,29 +2954,29 @@ void SwUndoCpyTbl::Undo( SwUndoIter& rIter )
const SfxPoolItem *pItem;
if( SFX_ITEM_SET == pTableFmt->GetItemState( RES_PAGEDESC,
- FALSE, &pItem ) )
+ sal_False, &pItem ) )
pNextNd->SetAttr( *pItem );
if( SFX_ITEM_SET == pTableFmt->GetItemState( RES_BREAK,
- FALSE, &pItem ) )
+ sal_False, &pItem ) )
pNextNd->SetAttr( *pItem );
}
SwPaM aPam( *pTNd, *pTNd->EndOfSectionNode(), 0 , 1 );
- pDel = new SwUndoDelete( aPam, TRUE );
+ pDel = new SwUndoDelete( aPam, sal_True );
}
-void SwUndoCpyTbl::Redo( SwUndoIter& rIter )
+void SwUndoCpyTbl::RedoImpl(::sw::UndoRedoContext & rContext)
{
- pDel->Undo( rIter );
+ pDel->UndoImpl(rContext);
delete pDel, pDel = 0;
}
-/* */
+//////////////////////////////////////////////////////////////////////////
SwUndoSplitTbl::SwUndoSplitTbl( const SwTableNode& rTblNd,
- SwSaveRowSpan* pRowSp, USHORT eMode, BOOL bNewSize )
+ SwSaveRowSpan* pRowSp, sal_uInt16 eMode, sal_Bool bNewSize )
: SwUndo( UNDO_SPLIT_TABLE ),
nTblNode( rTblNd.GetIndex() ), nOffset( 0 ), mpSaveRowSpan( pRowSp ), pSavTbl( 0 ),
pHistory( 0 ), nMode( eMode ), nFmlEnd( 0 ), bCalcNewSize( bNewSize )
@@ -2962,7 +2988,7 @@ SwUndoSplitTbl::SwUndoSplitTbl( const SwTableNode& rTblNd,
// kein break;
case HEADLINE_BORDERCOPY:
case HEADLINE_BOXATTRCOPY:
- pSavTbl = new _SaveTable( rTblNd.GetTable(), 1, FALSE );
+ pSavTbl = new _SaveTable( rTblNd.GetTable(), 1, sal_False );
break;
}
}
@@ -2974,10 +3000,10 @@ SwUndoSplitTbl::~SwUndoSplitTbl()
delete mpSaveRowSpan;
}
-void SwUndoSplitTbl::Undo( SwUndoIter& rIter )
+void SwUndoSplitTbl::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwPaM* pPam = rIter.pAktPam;
- SwDoc* pDoc = pPam->GetDoc();
+ SwDoc *const pDoc = & rContext.GetDoc();
+ SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor());
pPam->DeleteMark();
SwNodeIndex& rIdx = pPam->GetPoint()->nNode;
@@ -3004,7 +3030,7 @@ void SwUndoSplitTbl::Undo( SwUndoIter& rIter )
case HEADLINE_BOXATTRCOPY:
case HEADLINE_BORDERCOPY:
{
- pSavTbl->CreateNew( rTbl, FALSE );
+ pSavTbl->CreateNew( rTbl, sal_False );
pSavTbl->RestoreAttr( rTbl );
}
break;
@@ -3014,11 +3040,11 @@ void SwUndoSplitTbl::Undo( SwUndoIter& rIter )
{
SwSelBoxes aSelBoxes;
SwTableBox* pBox = rTbl.GetTblBox( nTblNode + nOffset + 1 );
- rTbl.SelLineFromBox( pBox, aSelBoxes, TRUE );
+ rTbl.SelLineFromBox( pBox, aSelBoxes, sal_True );
_FndBox aTmpBox( 0, 0 );
aTmpBox.SetTableLines( aSelBoxes, rTbl );
aTmpBox.DelFrms( rTbl );
- rTbl.DeleteSel( pDoc, aSelBoxes, 0, 0, FALSE, FALSE );
+ rTbl.DeleteSel( pDoc, aSelBoxes, 0, 0, sal_False, sal_False );
}
break;
}
@@ -3039,10 +3065,10 @@ void SwUndoSplitTbl::Undo( SwUndoIter& rIter )
ClearFEShellTabCols();
}
-void SwUndoSplitTbl::Redo( SwUndoIter& rIter )
+void SwUndoSplitTbl::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwPaM* pPam = rIter.pAktPam;
- SwDoc* pDoc = pPam->GetDoc();
+ SwDoc *const pDoc = & rContext.GetDoc();
+ SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor());
pPam->DeleteMark();
pPam->GetPoint()->nNode = nTblNode;
@@ -3051,10 +3077,10 @@ void SwUndoSplitTbl::Redo( SwUndoIter& rIter )
ClearFEShellTabCols();
}
-void SwUndoSplitTbl::Repeat( SwUndoIter& rIter )
+void SwUndoSplitTbl::RepeatImpl(::sw::RepeatContext & rContext)
{
- SwPaM* pPam = rIter.pAktPam;
- SwDoc* pDoc = pPam->GetDoc();
+ SwPaM *const pPam = & rContext.GetRepeatPaM();
+ SwDoc *const pDoc = & rContext.GetDoc();
pDoc->SplitTable( *pPam->GetPoint(), nMode, bCalcNewSize );
ClearFEShellTabCols();
@@ -3069,11 +3095,12 @@ void SwUndoSplitTbl::SaveFormula( SwHistory& rHistory )
pHistory->Move( 0, &rHistory );
}
-/* */
+
+//////////////////////////////////////////////////////////////////////////
SwUndoMergeTbl::SwUndoMergeTbl( const SwTableNode& rTblNd,
const SwTableNode& rDelTblNd,
- BOOL bWithPrv, USHORT nMd )
+ sal_Bool bWithPrv, sal_uInt16 nMd )
: SwUndo( UNDO_MERGE_TABLE ), pSavTbl( 0 ),
pHistory( 0 ), nMode( nMd ), bWithPrev( bWithPrv )
{
@@ -3096,10 +3123,10 @@ SwUndoMergeTbl::~SwUndoMergeTbl()
delete pHistory;
}
-void SwUndoMergeTbl::Undo( SwUndoIter& rIter )
+void SwUndoMergeTbl::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwPaM* pPam = rIter.pAktPam;
- SwDoc* pDoc = pPam->GetDoc();
+ SwDoc *const pDoc = & rContext.GetDoc();
+ SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor());
pPam->DeleteMark();
SwNodeIndex& rIdx = pPam->GetPoint()->nNode;
@@ -3118,7 +3145,7 @@ void SwUndoMergeTbl::Undo( SwUndoIter& rIter )
aFndBox.DelFrms( *pTbl );
// ? TL_CHART2: notification or locking of controller required ?
- SwTableNode* pNew = pDoc->GetNodes().SplitTable( rIdx, TRUE, FALSE );
+ SwTableNode* pNew = pDoc->GetNodes().SplitTable( rIdx, sal_True, sal_False );
//Layout updaten
aFndBox.MakeFrms( *pTbl );
@@ -3134,7 +3161,7 @@ void SwUndoMergeTbl::Undo( SwUndoIter& rIter )
pTbl = &pNew->GetTable();
pTbl->GetFrmFmt()->SetName( aName );
-// pSavTbl->CreateNew( *pTbl, FALSE );
+// pSavTbl->CreateNew( *pTbl, sal_False );
pSavTbl->RestoreAttr( *pTbl );
@@ -3163,10 +3190,10 @@ void SwUndoMergeTbl::Undo( SwUndoIter& rIter )
}
}
-void SwUndoMergeTbl::Redo( SwUndoIter& rIter )
+void SwUndoMergeTbl::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwPaM* pPam = rIter.pAktPam;
- SwDoc* pDoc = pPam->GetDoc();
+ SwDoc *const pDoc = & rContext.GetDoc();
+ SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor());
pPam->DeleteMark();
pPam->GetPoint()->nNode = nTblNode;
@@ -3180,10 +3207,10 @@ void SwUndoMergeTbl::Redo( SwUndoIter& rIter )
ClearFEShellTabCols();
}
-void SwUndoMergeTbl::Repeat( SwUndoIter& rIter )
+void SwUndoMergeTbl::RepeatImpl(::sw::RepeatContext & rContext)
{
- SwPaM* pPam = rIter.pAktPam;
- SwDoc* pDoc = pPam->GetDoc();
+ SwDoc *const pDoc = & rContext.GetDoc();
+ SwPaM *const pPam = & rContext.GetRepeatPaM();
pDoc->MergeTable( *pPam->GetPoint(), bWithPrev, nMode );
ClearFEShellTabCols();
@@ -3196,12 +3223,12 @@ void SwUndoMergeTbl::SaveFormula( SwHistory& rHistory )
pHistory->Move( 0, &rHistory );
}
-/* */
+//////////////////////////////////////////////////////////////////////////
-void InsertSort( SvUShorts& rArr, USHORT nIdx, USHORT* pInsPos )
+void InsertSort( SvUShorts& rArr, sal_uInt16 nIdx, sal_uInt16* pInsPos )
{
- USHORT nO = rArr.Count(), nM, nU = 0;
+ sal_uInt16 nO = rArr.Count(), nM, nU = 0;
if( nO > 0 )
{
nO--;
@@ -3210,7 +3237,7 @@ void InsertSort( SvUShorts& rArr, USHORT nIdx, USHORT* pInsPos )
nM = nU + ( nO - nU ) / 2;
if( *(rArr.GetData() + nM) == nIdx )
{
- ASSERT( FALSE, "Index ist schon vorhanden, darf nie sein!" );
+ ASSERT( sal_False, "Index ist schon vorhanden, darf nie sein!" );
return;
}
if( *(rArr.GetData() + nM) < nIdx )
@@ -3226,9 +3253,9 @@ void InsertSort( SvUShorts& rArr, USHORT nIdx, USHORT* pInsPos )
*pInsPos = nU;
}
-void InsertSort( SvULongs& rArr, ULONG nIdx, USHORT* pInsPos )
+void InsertSort( SvULongs& rArr, sal_uLong nIdx, sal_uInt16* pInsPos )
{
- USHORT nO = rArr.Count(), nM, nU = 0;
+ sal_uInt16 nO = rArr.Count(), nM, nU = 0;
if( nO > 0 )
{
nO--;
@@ -3237,7 +3264,7 @@ void InsertSort( SvULongs& rArr, ULONG nIdx, USHORT* pInsPos )
nM = nU + ( nO - nU ) / 2;
if( *(rArr.GetData() + nM) == nIdx )
{
- ASSERT( FALSE, "Index ist schon vorhanden, darf nie sein!" );
+ ASSERT( sal_False, "Index ist schon vorhanden, darf nie sein!" );
return;
}
if( *(rArr.GetData() + nM) < nIdx )
@@ -3277,7 +3304,7 @@ void CheckTable( const SwTable& rTbl )
{
const SwNodes& rNds = rTbl.GetFrmFmt()->GetDoc()->GetNodes();
const SwTableSortBoxes& rSrtArr = pTblNd->GetTable().GetTabSortBoxes();
- for( USHORT n = 0; n < rSrtArr.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rSrtArr.Count(); ++n )
{
const SwTableBox* pBox = rSrtArr[ n ];
const SwNode* pNd = pBox->GetSttNd();
diff --git a/sw/source/core/undo/untblk.cxx b/sw/source/core/undo/untblk.cxx
index e9e7ce1e0e02..55afbf9b9c99 100644
--- a/sw/source/core/undo/untblk.cxx
+++ b/sw/source/core/undo/untblk.cxx
@@ -28,16 +28,16 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <hintids.hxx>
#include <fmtanchr.hxx>
#include <frmfmt.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <docary.hxx>
#include <swundo.hxx> // fuer die UndoIds
#include <pam.hxx>
#include <ndtxt.hxx>
-#include <undobj.hxx>
+#include <UndoCore.hxx>
#include <rolbck.hxx>
#include <redline.hxx>
@@ -45,8 +45,8 @@
SwUndoInserts::SwUndoInserts( SwUndoId nUndoId, const SwPaM& rPam )
: SwUndo( nUndoId ), SwUndRng( rPam ),
- pTxtFmtColl( 0 ), pLastNdColl(0), pFrmFmts( 0 ), pFlyUndos(0), pRedlData( 0 ),
- bSttWasTxtNd( TRUE ), nNdDiff( 0 ), pPos( 0 ), nSetPos( 0 )
+ pTxtFmtColl( 0 ), pLastNdColl(0), pFrmFmts( 0 ), pRedlData( 0 ),
+ bSttWasTxtNd( sal_True ), nNdDiff( 0 ), pPos( 0 ), nSetPos( 0 )
{
pHistory = new SwHistory;
SwDoc* pDoc = (SwDoc*)rPam.GetDoc();
@@ -62,8 +62,8 @@ SwUndoInserts::SwUndoInserts( SwUndoId nUndoId, const SwPaM& rPam )
if( !nSttCntnt ) // dann werden Flys mitgenommen !!
{
- USHORT nArrLen = pDoc->GetSpzFrmFmts()->Count();
- for( USHORT n = 0; n < nArrLen; ++n )
+ sal_uInt16 nArrLen = pDoc->GetSpzFrmFmts()->Count();
+ for( sal_uInt16 n = 0; n < nArrLen; ++n )
{
SwFrmFmt* pFmt = (*pDoc->GetSpzFrmFmts())[n];
SwFmtAnchor const*const pAnchor = &pFmt->GetAnchor();
@@ -89,8 +89,8 @@ SwUndoInserts::SwUndoInserts( SwUndoId nUndoId, const SwPaM& rPam )
// setze den Destination-Bereich nach dem Einlesen.
-void SwUndoInserts::SetInsertRange( const SwPaM& rPam, BOOL bScanFlys,
- BOOL bSttIsTxtNd )
+void SwUndoInserts::SetInsertRange( const SwPaM& rPam, sal_Bool bScanFlys,
+ sal_Bool bSttIsTxtNd )
{
const SwPosition* pTmpPos = rPam.End();
nEndNode = pTmpPos->nNode.GetIndex();
@@ -108,7 +108,7 @@ void SwUndoInserts::SetInsertRange( const SwPaM& rPam, BOOL bScanFlys,
if( !bSttIsTxtNd ) // wird eine Tabellenselektion eingefuegt,
{
++nSttNode; // dann stimmt der CopyPam nicht ganz
- bSttWasTxtNd = FALSE;
+ bSttWasTxtNd = sal_False;
}
}
@@ -116,9 +116,8 @@ void SwUndoInserts::SetInsertRange( const SwPaM& rPam, BOOL bScanFlys,
{
// dann alle neuen Flys zusammen sammeln !!
SwDoc* pDoc = (SwDoc*)rPam.GetDoc();
- pFlyUndos = new SwUndos();
- USHORT nFndPos, nArrLen = pDoc->GetSpzFrmFmts()->Count();
- for( USHORT n = 0; n < nArrLen; ++n )
+ sal_uInt16 nFndPos, nArrLen = pDoc->GetSpzFrmFmts()->Count();
+ for( sal_uInt16 n = 0; n < nArrLen; ++n )
{
SwFrmFmt* pFmt = (*pDoc->GetSpzFrmFmts())[n];
SwFmtAnchor const*const pAnchor = &pFmt->GetAnchor();
@@ -130,16 +129,15 @@ void SwUndoInserts::SetInsertRange( const SwPaM& rPam, BOOL bScanFlys,
if( !pFrmFmts ||
USHRT_MAX == ( nFndPos = pFrmFmts->GetPos( pFmt ) ) )
{
- SwUndoInsLayFmt* pFlyUndo = new SwUndoInsLayFmt( pFmt,0,0 );
- pFlyUndos->Insert( pFlyUndo, pFlyUndos->Count() );
+ ::boost::shared_ptr<SwUndoInsLayFmt> const pFlyUndo(
+ new SwUndoInsLayFmt(pFmt, 0, 0));
+ m_FlyUndos.push_back(pFlyUndo);
}
else
pFrmFmts->Remove( nFndPos );
}
}
delete pFrmFmts, pFrmFmts = 0;
- if( !pFlyUndos->Count() )
- delete pFlyUndos, pFlyUndos = 0;
}
}
@@ -166,25 +164,21 @@ SwUndoInserts::~SwUndoInserts()
delete pPos;
}
delete pFrmFmts;
- delete pFlyUndos;
delete pRedlData;
}
-void SwUndoInserts::Undo( SwUndoIter& rUndoIter )
+void SwUndoInserts::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwPaM * pPam = rUndoIter.pAktPam;
- SwDoc* pDoc = pPam->GetDoc();
- SetPaM( rUndoIter );
- BOOL bUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ SwDoc *const pDoc = & rContext.GetDoc();
+ SwPaM *const pPam = & AddUndoRedoPaM(rContext);
if( IDocumentRedlineAccess::IsRedlineOn( GetRedlineMode() ))
pDoc->DeleteRedline( *pPam, true, USHRT_MAX );
// sind an Point/Mark 2 unterschiedliche TextNodes, dann muss ein
// JoinNext ausgefuehrt werden.
- BOOL bJoinNext = nSttNode != nEndNode &&
+ sal_Bool bJoinNext = nSttNode != nEndNode &&
pPam->GetMark()->nNode.GetNode().GetTxtNode() &&
pPam->GetPoint()->nNode.GetNode().GetTxtNode();
@@ -199,8 +193,8 @@ void SwUndoInserts::Undo( SwUndoIter& rUndoIter )
pLastNdColl = pTxtNd->GetTxtColl();
}
- RemoveIdxFromRange( *pPam, FALSE );
- SetPaM( rUndoIter );
+ RemoveIdxFromRange( *pPam, sal_False );
+ SetPaM(*pPam);
// sind Fussnoten oder CntntFlyFrames im Text ??
nSetPos = pHistory->Count();
@@ -218,11 +212,13 @@ void SwUndoInserts::Undo( SwUndoIter& rUndoIter )
}
}
- if( pFlyUndos )
+ if (m_FlyUndos.size())
{
- ULONG nTmp = pPam->GetPoint()->nNode.GetIndex();
- for( USHORT n = pFlyUndos->Count(); n; )
- (*pFlyUndos)[ --n ]->Undo( rUndoIter );
+ sal_uLong nTmp = pPam->GetPoint()->nNode.GetIndex();
+ for (size_t n = m_FlyUndos.size(); 0 < n; --n)
+ {
+ m_FlyUndos[ n-1 ]->UndoImpl(rContext);
+ }
nNdDiff += nTmp - pPam->GetPoint()->nNode.GetIndex();
}
@@ -268,16 +264,12 @@ void SwUndoInserts::Undo( SwUndoIter& rUndoIter )
pHistory->TmpRollback( pDoc, 0, false );
}
}
-
- pDoc->DoUndo( bUndo );
- if( pPam != rUndoIter.pAktPam )
- delete pPam;
}
-void SwUndoInserts::Redo( SwUndoIter& rUndoIter )
+void SwUndoInserts::RedoImpl(::sw::UndoRedoContext & rContext)
{
// setze noch den Cursor auf den Redo-Bereich
- SwPaM* pPam = rUndoIter.pAktPam;
+ SwPaM *const pPam = & AddUndoRedoPaM(rContext);
SwDoc* pDoc = pPam->GetDoc();
pPam->DeleteMark();
pPam->GetPoint()->nNode = nSttNode - nNdDiff;
@@ -293,10 +285,10 @@ void SwUndoInserts::Redo( SwUndoIter& rUndoIter )
// alte Anfangs-Position fuers Rollback zurueckholen
if( ( nSttNode != nEndNode || nSttCntnt != nEndCntnt ) && pPos )
{
- BOOL bMvBkwrd = MovePtBackward( *pPam );
+ sal_Bool bMvBkwrd = MovePtBackward( *pPam );
// Inhalt wieder einfuegen. (erst pPos abmelden !!)
- ULONG nMvNd = pPos->nNode.GetIndex();
+ sal_uLong nMvNd = pPos->nNode.GetIndex();
xub_StrLen nMvCnt = pPos->nContent.GetIndex();
DELETEZ( pPos );
MoveFromUndoNds( *pDoc, nMvNd, nMvCnt, *pPam->GetMark() );
@@ -321,9 +313,10 @@ void SwUndoInserts::Redo( SwUndoIter& rUndoIter )
pTxtNd->ChgFmtColl( pLastNdColl );
}
- if( pFlyUndos )
- for( USHORT n = pFlyUndos->Count(); n; )
- (*pFlyUndos)[ --n ]->Redo( rUndoIter );
+ for (size_t n = m_FlyUndos.size(); 0 < n; --n)
+ {
+ m_FlyUndos[ n-1 ]->RedoImpl(rContext);
+ }
pHistory->Rollback( pDoc, nSetPos );
@@ -339,21 +332,16 @@ void SwUndoInserts::Redo( SwUndoIter& rUndoIter )
pDoc->SplitRedline( *pPam );
}
-void SwUndoInserts::Repeat( SwUndoIter& rUndoIter )
+void SwUndoInserts::RepeatImpl(::sw::RepeatContext & rContext)
{
- if( GetId() == rUndoIter.GetLastUndoId() )
- return;
-
- SwPaM aPam( *rUndoIter.pAktPam->GetPoint() );
+ SwPaM aPam( rContext.GetDoc().GetNodes().GetEndOfContent() );
SetPaM( aPam );
- aPam.GetDoc()->CopyRange( aPam, *rUndoIter.pAktPam->GetPoint(), false );
-
- rUndoIter.pLastUndoObj = this;
+ SwPaM & rRepeatPaM( rContext.GetRepeatPaM() );
+ aPam.GetDoc()->CopyRange( aPam, *rRepeatPaM.GetPoint(), false );
}
-/* */
-
+//////////////////////////////////////////////////////////////////////////
SwUndoInsDoc::SwUndoInsDoc( const SwPaM& rPam )
: SwUndoInserts( UNDO_INSDOKUMENT, rPam )
diff --git a/sw/source/core/unocore/swunohelper.cxx b/sw/source/core/unocore/swunohelper.cxx
index b0d0f9623e71..77e5e536a042 100644
--- a/sw/source/core/unocore/swunohelper.cxx
+++ b/sw/source/core/unocore/swunohelper.cxx
@@ -66,16 +66,16 @@ sal_Int32 GetEnumAsInt32( const UNO_NMSPC::Any& rVal )
catch( UNO_NMSPC::Exception & )
{
eVal = 0;
- ASSERT( FALSE, "can't get EnumAsInt32" );
+ ASSERT( sal_False, "can't get EnumAsInt32" );
}
return eVal;
}
// methods for UCB actions
-BOOL UCB_DeleteFile( const String& rURL )
+sal_Bool UCB_DeleteFile( const String& rURL )
{
- BOOL bRemoved;
+ sal_Bool bRemoved;
try
{
ucbhelper::Content aTempContent( rURL,
@@ -83,19 +83,19 @@ BOOL UCB_DeleteFile( const String& rURL )
aTempContent.executeCommand(
rtl::OUString::createFromAscii( "delete" ),
UNO_NMSPC::makeAny( sal_Bool( sal_True ) ) );
- bRemoved = TRUE;
+ bRemoved = sal_True;
}
catch( UNO_NMSPC::Exception& )
{
- bRemoved = FALSE;
- ASSERT( FALSE, "Exeception from executeCommand( delete )" );
+ bRemoved = sal_False;
+ ASSERT( sal_False, "Exeception from executeCommand( delete )" );
}
return bRemoved;
}
-BOOL UCB_CopyFile( const String& rURL, const String& rNewURL, BOOL bCopyIsMove )
+sal_Bool UCB_CopyFile( const String& rURL, const String& rNewURL, sal_Bool bCopyIsMove )
{
- BOOL bCopyCompleted = TRUE;
+ sal_Bool bCopyCompleted = sal_True;
try
{
INetURLObject aURL( rNewURL );
@@ -119,15 +119,15 @@ BOOL UCB_CopyFile( const String& rURL, const String& rNewURL, BOOL bCopyIsMove )
}
catch( UNO_NMSPC::Exception& )
{
- ASSERT( FALSE, "Exeception from executeCommand( transfer )" );
- bCopyCompleted = FALSE;
+ ASSERT( sal_False, "Exeception from executeCommand( transfer )" );
+ bCopyCompleted = sal_False;
}
return bCopyCompleted;
}
-BOOL UCB_IsCaseSensitiveFileName( const String& rURL )
+sal_Bool UCB_IsCaseSensitiveFileName( const String& rURL )
{
- BOOL bCaseSensitive;
+ sal_Bool bCaseSensitive;
try
{
STAR_REFERENCE( lang::XMultiServiceFactory ) xMSF =
@@ -152,15 +152,15 @@ BOOL UCB_IsCaseSensitiveFileName( const String& rURL )
}
catch( UNO_NMSPC::Exception& )
{
- bCaseSensitive = FALSE;
- ASSERT( FALSE, "Exeception from compareContentIds()" );
+ bCaseSensitive = sal_False;
+ ASSERT( sal_False, "Exeception from compareContentIds()" );
}
return bCaseSensitive;
}
-BOOL UCB_IsReadOnlyFileName( const String& rURL )
+sal_Bool UCB_IsReadOnlyFileName( const String& rURL )
{
- BOOL bIsReadOnly = FALSE;
+ sal_Bool bIsReadOnly = sal_False;
try
{
ucbhelper::Content aCnt( rURL, STAR_REFERENCE( ucb::XCommandEnvironment )());
@@ -171,14 +171,14 @@ BOOL UCB_IsReadOnlyFileName( const String& rURL )
}
catch( UNO_NMSPC::Exception& )
{
- bIsReadOnly = FALSE;
+ bIsReadOnly = sal_False;
}
return bIsReadOnly;
}
-BOOL UCB_IsFile( const String& rURL )
+sal_Bool UCB_IsFile( const String& rURL )
{
- BOOL bExists = FALSE;
+ sal_Bool bExists = sal_False;
try
{
::ucbhelper::Content aContent( rURL, STAR_REFERENCE( ucb::XCommandEnvironment )() );
@@ -190,9 +190,9 @@ BOOL UCB_IsFile( const String& rURL )
return bExists;
}
-BOOL UCB_IsDirectory( const String& rURL )
+sal_Bool UCB_IsDirectory( const String& rURL )
{
- BOOL bExists = FALSE;
+ sal_Bool bExists = sal_False;
try
{
::ucbhelper::Content aContent( rURL, STAR_REFERENCE( ucb::XCommandEnvironment )() );
@@ -209,17 +209,17 @@ BOOL UCB_IsDirectory( const String& rURL )
// pDateTime != 0 -> returns also the modified date/time of
// the files in a SvPtrarr -->
// !! objects must be deleted from the caller!!
-BOOL UCB_GetFileListOfFolder( const String& rURL, SvStrings& rList,
+sal_Bool UCB_GetFileListOfFolder( const String& rURL, SvStrings& rList,
const String* pExtension,
SvPtrarr* pDateTimeList )
{
- BOOL bOk = FALSE;
+ sal_Bool bOk = sal_False;
try
{
ucbhelper::Content aCnt( rURL, STAR_REFERENCE( ucb::XCommandEnvironment )());
STAR_REFERENCE( sdbc::XResultSet ) xResultSet;
- USHORT nSeqSize = pDateTimeList ? 2 : 1;
+ sal_uInt16 nSeqSize = pDateTimeList ? 2 : 1;
UNO_NMSPC::Sequence < rtl::OUString > aProps( nSeqSize );
rtl::OUString* pProps = aProps.getArray();
pProps[ 0 ] = rtl::OUString::createFromAscii( "Title" );
@@ -272,7 +272,7 @@ BOOL UCB_GetFileListOfFolder( const String& rURL, SvStrings& rList,
} while( xResultSet->next() );
}
- bOk = TRUE;
+ bOk = sal_True;
}
catch( UNO_NMSPC::Exception& )
{
@@ -283,7 +283,7 @@ BOOL UCB_GetFileListOfFolder( const String& rURL, SvStrings& rList,
catch( UNO_NMSPC::Exception& )
{
DBG_ERRORFILE( "Exception caught!" );
- bOk = FALSE;
+ bOk = sal_False;
}
return bOk;
}
diff --git a/sw/source/core/unocore/unobkm.cxx b/sw/source/core/unocore/unobkm.cxx
index 13339582181d..53a4d009a859 100644
--- a/sw/source/core/unocore/unobkm.cxx
+++ b/sw/source/core/unocore/unobkm.cxx
@@ -40,12 +40,11 @@
#include <IMark.hxx>
#include <crossrefbookmark.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <docary.hxx>
#include <swundo.hxx>
-#ifndef _COMCORE_HRC
#include <comcore.hrc>
-#endif
-#include <undobj.hxx>
+#include <SwRewriter.hxx>
#include <docsh.hxx>
@@ -376,9 +375,11 @@ throw (uno::RuntimeException)
aRewriter.AddRule(UNDO_ARG2, SW_RES(STR_YIELDS));
aRewriter.AddRule(UNDO_ARG3, lcl_QuoteName(rName));
- m_pImpl->m_pDoc->StartUndo(UNDO_BOOKMARK_RENAME, &aRewriter);
+ m_pImpl->m_pDoc->GetIDocumentUndoRedo().StartUndo(
+ UNDO_BOOKMARK_RENAME, &aRewriter);
pMarkAccess->renameMark(m_pImpl->m_pRegisteredBookmark, rName);
- m_pImpl->m_pDoc->EndUndo(UNDO_BOOKMARK_RENAME, NULL);
+ m_pImpl->m_pDoc->GetIDocumentUndoRedo().EndUndo(
+ UNDO_BOOKMARK_RENAME, &aRewriter);
}
OUString SAL_CALL
diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx
index c1d4cdb882d0..034fd8df9d94 100644
--- a/sw/source/core/unocore/unochart.cxx
+++ b/sw/source/core/unocore/unochart.cxx
@@ -164,7 +164,7 @@ void SwChartLockController_Helper::LockUnlockAllCharts( sal_Bool bLock )
return;
const SwFrmFmts& rTblFmts = *pDoc->GetTblFrmFmts();
- for( USHORT n = 0; n < rTblFmts.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rTblFmts.Count(); ++n )
{
SwTable* pTmpTbl;
const SwTableNode* pTblNd;
@@ -678,7 +678,7 @@ uno::Reference< chart2::data::XDataSource > SwChartDataProvider::Impl_createData
String aChartTableName;
const SwNodes& rNodes = pDoc->GetNodes();
- for( ULONG nN = rNodes.Count(); nN--; )
+ for( sal_uLong nN = rNodes.Count(); nN--; )
{
SwNodePtr pNode = rNodes[nN];
if( !pNode )
@@ -1747,12 +1747,12 @@ void SwChartDataProvider::DisposeAllDataSequences( const SwTable *pTable )
void SwChartDataProvider::AddRowCols(
const SwTable &rTable,
const SwSelBoxes& rBoxes,
- USHORT nLines, BOOL bBehind )
+ sal_uInt16 nLines, sal_Bool bBehind )
{
if (rTable.IsTblComplex())
return;
- const USHORT nBoxes = rBoxes.Count();
+ const sal_uInt16 nBoxes = rBoxes.Count();
if (nBoxes < 1 || nLines < 1)
return;
@@ -1851,7 +1851,7 @@ rtl::OUString SAL_CALL SwChartDataProvider::convertRangeToXML( const rtl::OUStri
// "Table1.A1:A4;Table1.C2:C5" the same table must be used in all ranges!
xub_StrLen nNumRanges = aRangeRepresentation.GetTokenCount( ';' );
SwTable* pFirstFoundTable = 0; // to check that only one table will be used
- for (USHORT i = 0; i < nNumRanges; ++i)
+ for (sal_uInt16 i = 0; i < nNumRanges; ++i)
{
String aRange( aRangeRepresentation.GetToken(i, ';') );
SwFrmFmt *pTblFmt = 0; // pointer to table format
@@ -1924,7 +1924,7 @@ rtl::OUString SAL_CALL SwChartDataProvider::convertRangeFromXML( const rtl::OUSt
// "Table1.$A$1:.$A$4 Table1.$C$2:.$C$5" the same table must be used in all ranges!
xub_StrLen nNumRanges = aXMLRange.GetTokenCount( ' ' );
rtl::OUString aFirstFoundTable; // to check that only one table will be used
- for (USHORT i = 0; i < nNumRanges; ++i)
+ for (sal_uInt16 i = 0; i < nNumRanges; ++i)
{
String aRange( aXMLRange.GetToken(i, ' ') );
diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx
index ea3104aa69e4..92b338a4d169 100644
--- a/sw/source/core/unocore/unocoll.cxx
+++ b/sw/source/core/unocore/unocoll.cxx
@@ -858,12 +858,12 @@ SwXFrameEnumeration<T>::SwXFrameEnumeration(const SwDoc* const pDoc)
return;
// --> OD 2009-09-10 #i104937#
// const SwFrmFmt* const pFmtsEnd = (*pFmts)[pFmts->Count()];
- const USHORT nSize = pFmts->Count();
+ const sal_uInt16 nSize = pFmts->Count();
// <--
::std::insert_iterator<frmcontainer_t> pInserter = ::std::insert_iterator<frmcontainer_t>(m_aFrames, m_aFrames.begin());
// --> OD 2009-09-10 #i104937#
SwFrmFmt* pFmt( 0 );
- for( USHORT i = 0; i < nSize; ++i )
+ for( sal_uInt16 i = 0; i < nSize; ++i )
// for(SwFrmFmt* pFmt = (*pFmts)[0]; pFmt < pFmtsEnd; ++pFmt)
// <--
{
@@ -925,7 +925,7 @@ OUString SwXFrames::getImplementationName(void) throw( RuntimeException )
return C2U("SwXFrames");
}
-BOOL SwXFrames::supportsService(const OUString& rServiceName) throw( RuntimeException )
+sal_Bool SwXFrames::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return C2U("com.sun.star.text.TextFrames") == rServiceName;
}
@@ -1092,7 +1092,12 @@ OUString SwXTextFrames::getImplementationName(void) throw( RuntimeException )
return C2U("SwXTextFrames");
}
+<<<<<<< local
BOOL SwXTextFrames::supportsService(const OUString& rServiceName) throw( RuntimeException )
+=======
+ ---------------------------------------------------------------------------*/
+sal_Bool SwXTextFrames::supportsService(const OUString& rServiceName) throw( RuntimeException )
+>>>>>>> other
{
return C2U("com.sun.star.text.TextFrames") == rServiceName;
}
@@ -1123,7 +1128,12 @@ OUString SwXTextGraphicObjects::getImplementationName(void) throw( RuntimeExcept
return C2U("SwXTextGraphicObjects");
}
+<<<<<<< local
BOOL SwXTextGraphicObjects::supportsService(const OUString& rServiceName) throw( RuntimeException )
+=======
+ ---------------------------------------------------------------------------*/
+sal_Bool SwXTextGraphicObjects::supportsService(const OUString& rServiceName) throw( RuntimeException )
+>>>>>>> other
{
return C2U("com.sun.star.text.TextGraphicObjects") == rServiceName;
}
@@ -1153,7 +1163,12 @@ OUString SwXTextEmbeddedObjects::getImplementationName(void) throw( RuntimeExcep
return C2U("SwXTextEmbeddedObjects");
}
+<<<<<<< local
BOOL SwXTextEmbeddedObjects::supportsService(const OUString& rServiceName) throw( RuntimeException )
+=======
+ ---------------------------------------------------------------------------*/
+sal_Bool SwXTextEmbeddedObjects::supportsService(const OUString& rServiceName) throw( RuntimeException )
+>>>>>>> other
{
return C2U("com.sun.star.text.TextEmbeddedObjects") == rServiceName;
}
@@ -1184,7 +1199,12 @@ OUString SwXTextSections::getImplementationName(void) throw( RuntimeException )
return C2U("SwXTextSections");
}
+<<<<<<< local
BOOL SwXTextSections::supportsService(const OUString& rServiceName) throw( RuntimeException )
+=======
+ ---------------------------------------------------------------------------*/
+sal_Bool SwXTextSections::supportsService(const OUString& rServiceName) throw( RuntimeException )
+>>>>>>> other
{
return C2U("com.sun.star.text.TextSections") == rServiceName;
}
@@ -1373,7 +1393,7 @@ OUString SwXBookmarks::getImplementationName(void) throw( RuntimeException )
return OUString::createFromAscii("SwXBookmarks");
}
-BOOL SwXBookmarks::supportsService(const OUString& rServiceName) throw( RuntimeException )
+sal_Bool SwXBookmarks::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return OUString::createFromAscii("com.sun.star.text.Bookmarks") == rServiceName;
}
@@ -1511,7 +1531,7 @@ uno::Any SwXNumberingRulesCollection::getByIndex(sal_Int32 nIndex)
uno::Reference< XIndexReplace > xRef;
if ( nIndex < GetDoc()->GetNumRuleTbl().Count() )
{
- xRef = new SwXNumberingRules( *GetDoc()->GetNumRuleTbl()[ static_cast< USHORT >(nIndex) ] );
+ xRef = new SwXNumberingRules( *GetDoc()->GetNumRuleTbl()[ static_cast< sal_uInt16 >(nIndex) ] );
aRet.setValue(&xRef, ::getCppuType((uno::Reference<XIndexReplace>*)0));
}
@@ -1541,7 +1561,12 @@ OUString SwXFootnotes::getImplementationName(void) throw( RuntimeException )
return C2U("SwXFootnotes");
}
+<<<<<<< local
BOOL SwXFootnotes::supportsService(const OUString& rServiceName) throw( RuntimeException )
+=======
+ ---------------------------------------------------------------------------*/
+sal_Bool SwXFootnotes::supportsService(const OUString& rServiceName) throw( RuntimeException )
+>>>>>>> other
{
return C2U("com.sun.star.text.Footnotes") == rServiceName;
}
@@ -1644,7 +1669,12 @@ OUString SwXReferenceMarks::getImplementationName(void) throw( RuntimeException
return C2U("SwXReferenceMarks");
}
+<<<<<<< local
BOOL SwXReferenceMarks::supportsService(const OUString& rServiceName) throw( RuntimeException )
+=======
+ ---------------------------------------------------------------------------*/
+sal_Bool SwXReferenceMarks::supportsService(const OUString& rServiceName) throw( RuntimeException )
+>>>>>>> other
{
return C2U("com.sun.star.text.ReferenceMarks") == rServiceName;
}
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx
index fe5dbba991df..e208dcd52f19 100644
--- a/sw/source/core/unocore/unocrsrhelper.cxx
+++ b/sw/source/core/unocore/unocrsrhelper.cxx
@@ -43,6 +43,7 @@
#include <unoframe.hxx>
#include <unocrsr.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <IDocumentRedlineAccess.hxx>
#include <fmtftn.hxx>
#include <fmtpdsc.hxx>
@@ -281,7 +282,7 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
*pAny <<= (sal_Int16)(pTxtNd->GetActualListLevel());
else if(rEntry.nWID == FN_UNO_IS_NUMBER)
{
- BOOL bIsNumber = pTxtNd->IsCountedInList();
+ sal_Bool bIsNumber = pTxtNd->IsCountedInList();
pAny->setValue(&bIsNumber, ::getBooleanCppuType());
}
// --> OD 2008-07-14 #i91601#
@@ -293,7 +294,7 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
// <--
else /*if(rEntry.nWID == UNO_NAME_PARA_IS_NUMBERING_RESTART)*/
{
- BOOL bIsRestart = pTxtNd->IsListRestart();
+ sal_Bool bIsRestart = pTxtNd->IsListRestart();
pAny->setValue(&bIsRestart, ::getBooleanCppuType());
}
}
@@ -531,26 +532,26 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
{
SwTxtNode* pTxtNode;
- if((pTxtNode = (SwTxtNode*)rPam.GetNode( TRUE )) == rPam.GetNode(FALSE) &&
+ if((pTxtNode = (SwTxtNode*)rPam.GetNode( sal_True )) == rPam.GetNode(sal_False) &&
pTxtNode->GetpSwpHints())
{
- USHORT nPaMStart = rPam.GetPoint()->nContent.GetIndex();
- USHORT nPaMEnd = rPam.GetMark() ? rPam.GetMark()->nContent.GetIndex() : nPaMStart;
+ sal_uInt16 nPaMStart = rPam.GetPoint()->nContent.GetIndex();
+ sal_uInt16 nPaMEnd = rPam.GetMark() ? rPam.GetMark()->nContent.GetIndex() : nPaMStart;
if(nPaMStart > nPaMEnd)
{
- USHORT nTmp = nPaMStart;
+ sal_uInt16 nTmp = nPaMStart;
nPaMStart = nPaMEnd;
nPaMEnd = nTmp;
}
Sequence< ::rtl::OUString> aCharStyles;
SwpHints* pHints = pTxtNode->GetpSwpHints();
- for(USHORT nAttr = 0; nAttr < pHints->GetStartCount(); nAttr++ )
+ for(sal_uInt16 nAttr = 0; nAttr < pHints->GetStartCount(); nAttr++ )
{
SwTxtAttr* pAttr = pHints->GetStart( nAttr );
if(pAttr->Which() != RES_TXTATR_CHARFMT)
continue;
- USHORT nAttrStart = *pAttr->GetStart();
- USHORT nAttrEnd = *pAttr->GetEnd();
+ sal_uInt16 nAttrStart = *pAttr->GetStart();
+ sal_uInt16 nAttrEnd = *pAttr->GetEnd();
//check if the attribute touches the selection
if( ( nAttrEnd > nPaMStart && nAttrStart < nPaMEnd ) ||
( !nAttrStart && !nAttrEnd && !nPaMStart && !nPaMEnd ) )
@@ -708,7 +709,7 @@ void setNumberingProperty(const Any& rValue, SwPaM& rPam)
if( rPam.GetNext() != &rPam ) // Mehrfachselektion ?
{
- pDoc->StartUndo( UNDO_START, NULL );
+ pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
SwPamRanges aRangeArr( rPam );
SwPaM aPam( *rPam.GetPoint() );
for( sal_uInt16 n = 0; n < aRangeArr.Count(); ++n )
@@ -718,7 +719,7 @@ void setNumberingProperty(const Any& rValue, SwPaM& rPam)
pDoc->SetNumRule( aRangeArr.SetPam( n, aPam ), aRule, false );
// <--
}
- pDoc->EndUndo( UNDO_END, NULL );
+ pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
}
else
{
@@ -805,12 +806,12 @@ void resetCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry, SwPaM& rPa
if( rPam.GetNext() != &rPam ) // Mehrfachselektion ?
{
- pDoc->StartUndo( UNDO_START, NULL );
+ pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
SwPamRanges aRangeArr( rPam );
SwPaM aPam( *rPam.GetPoint() );
for( sal_uInt16 n = 0; n < aRangeArr.Count(); ++n )
pDoc->SetNodeNumStart( *aRangeArr.SetPam( n, aPam ).GetPoint(), 1 );
- pDoc->EndUndo( UNDO_END, NULL );
+ pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
}
else
pDoc->SetNodeNumStart( *rPam.GetPoint(), 0 );
@@ -935,6 +936,7 @@ void InsertFile(SwUnoCrsr* pUnoCrsr,
if( !pMed )
return;
+ // this sourcecode is not responsible for the lifetime of the shell, SfxObjectShellLock should not be used
SfxObjectShellRef aRef( pDocSh );
pDocSh->RegisterTransfer( *pMed );
@@ -1007,6 +1009,8 @@ sal_Bool DocInsertStringSplitCR(
IDocumentContentOperations::INS_EMPTYEXPAND)
: IDocumentContentOperations::INS_EMPTYEXPAND;
+ // grouping done in InsertString is intended for typing, not API calls
+ ::sw::GroupUndoGuard const undoGuard(rDoc.GetIDocumentUndoRedo());
OUString aTxt;
xub_StrLen nStartIdx = 0;
SwTxtNode* const pTxtNd =
@@ -1072,7 +1076,7 @@ void makeRedline( SwPaM& rPaM,
comphelper::SequenceAsHashMap aPropMap( rRedlineProperties );
uno::Any aAuthorValue;
aAuthorValue = aPropMap.getUnpackedValueOrDefault( ::rtl::OUString::createFromAscii("RedlineAuthor"), aAuthorValue);
- USHORT nAuthor = 0;
+ sal_uInt16 nAuthor = 0;
::rtl::OUString sAuthor;
if( aAuthorValue >>= sAuthor )
nAuthor = pRedlineAccess->InsertRedlineAuthor(sAuthor);
@@ -1119,7 +1123,7 @@ SwAnyMapHelper::~SwAnyMapHelper()
/*-- 19.02.2009 09:27:26---------------------------------------------------
-----------------------------------------------------------------------*/
-void SwAnyMapHelper::SetValue( USHORT nWhichId, USHORT nMemberId, const uno::Any& rAny )
+void SwAnyMapHelper::SetValue( sal_uInt16 nWhichId, sal_uInt16 nMemberId, const uno::Any& rAny )
{
sal_uInt32 nKey = (nWhichId << 16) + nMemberId;
AnyMapHelper_t::iterator aIt = find( nKey );
@@ -1133,7 +1137,7 @@ void SwAnyMapHelper::SetValue( USHORT nWhichId, USHORT nMemberId, const uno::Any
/*-- 19.02.2009 09:27:26---------------------------------------------------
-----------------------------------------------------------------------*/
-bool SwAnyMapHelper::FillValue( USHORT nWhichId, USHORT nMemberId, const uno::Any*& pAny )
+bool SwAnyMapHelper::FillValue( sal_uInt16 nWhichId, sal_uInt16 nMemberId, const uno::Any*& pAny )
{
bool bRet = false;
sal_uInt32 nKey = (nWhichId << 16) + nMemberId;
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index a39931a715f5..f3fc03148bbe 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -42,6 +42,7 @@
#include <svx/svditer.hxx>
#include <swunohelper.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <fmtcntnt.hxx>
#include <fmtflcnt.hxx>
#include <txtatr.hxx>
@@ -128,7 +129,7 @@ public:
pLRSpace(0),
bOpaque(sal_False),
// OD 2004-04-21 #i26791#
- mpFollowTextFlow( new SwFmtFollowTextFlow( FALSE ) ),
+ mpFollowTextFlow( new SwFmtFollowTextFlow( sal_False ) ),
// OD 2004-05-05 #i28701#
// --> OD 2004-10-18 #i35017# - constant name has changed
pWrapInfluenceOnObjPos( new SwFmtWrapInfluenceOnObjPos(
@@ -221,7 +222,7 @@ public:
SwFmtFollowTextFlow* GetFollowTextFlow( sal_Bool _bCreate = sal_False )
{
if ( _bCreate && !mpFollowTextFlow )
- mpFollowTextFlow = new SwFmtFollowTextFlow( FALSE );
+ mpFollowTextFlow = new SwFmtFollowTextFlow( sal_False );
return mpFollowTextFlow;
}
void RemoveFollowTextFlow()
@@ -420,12 +421,12 @@ namespace
SwXShapesEnumeration(SwXDrawPage* const pDrawPage);
//XEnumeration
- virtual BOOL SAL_CALL hasMoreElements(void) throw(uno::RuntimeException);
+ virtual sal_Bool SAL_CALL hasMoreElements(void) throw(uno::RuntimeException);
virtual uno::Any SAL_CALL nextElement(void) throw(container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException);
//XServiceInfo
virtual OUString SAL_CALL getImplementationName(void) throw(uno::RuntimeException);
- virtual BOOL SAL_CALL supportsService(const OUString& ServiceName) throw(uno::RuntimeException);
+ virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) throw(uno::RuntimeException);
virtual uno::Sequence<OUString> SAL_CALL getSupportedServiceNames(void) throw(uno::RuntimeException);
};
}
@@ -443,7 +444,7 @@ SwXShapesEnumeration::SwXShapesEnumeration(SwXDrawPage* const pDrawPage)
}
}
-BOOL SwXShapesEnumeration::hasMoreElements(void) throw(uno::RuntimeException)
+sal_Bool SwXShapesEnumeration::hasMoreElements(void) throw(uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
return !m_aShapes.empty();
@@ -464,7 +465,7 @@ OUString SwXShapesEnumeration::getImplementationName(void) throw(uno::RuntimeExc
return C2U("SwXShapeEnumeration");
}
-BOOL SwXShapesEnumeration::supportsService(const OUString& ServiceName) throw(uno::RuntimeException)
+sal_Bool SwXShapesEnumeration::supportsService(const OUString& ServiceName) throw(uno::RuntimeException)
{
return C2U("com.sun.star.container.XEnumeration") == ServiceName;
}
@@ -488,7 +489,12 @@ rtl::OUString SwXDrawPage::getImplementationName(void) throw( uno::RuntimeExcept
return C2U("SwXDrawPage");
}
+<<<<<<< local
BOOL SwXDrawPage::supportsService(const rtl::OUString& rServiceName) throw( uno::RuntimeException )
+=======
+ ---------------------------------------------------------------------------*/
+sal_Bool SwXDrawPage::supportsService(const rtl::OUString& rServiceName) throw( uno::RuntimeException )
+>>>>>>> other
{
return C2U("com.sun.star.drawing.GenericDrawPage") == rServiceName;
}
@@ -812,7 +818,7 @@ uno::Reference< drawing::XShapeGroup > SwXDrawPage::group(const uno::Reference<
if( !bFlyInCnt )
{
UnoActionContext aContext(pDoc);
- pDoc->StartUndo( UNDO_START, NULL );
+ pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
SwDrawContact* pContact = pDoc->GroupSelection( *pPage->GetDrawView() );
pDoc->ChgAnchor(
@@ -826,7 +832,7 @@ uno::Reference< drawing::XShapeGroup > SwXDrawPage::group(const uno::Reference<
uno::Reference< uno::XInterface > xInt = pPage->GetInterface( pContact->GetMaster() );
xRet = uno::Reference< drawing::XShapeGroup >(xInt, uno::UNO_QUERY);
}
- pDoc->EndUndo( UNDO_END, NULL );
+ pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
}
}
pPage->RemovePageView();
@@ -847,13 +853,13 @@ void SwXDrawPage::ungroup(const uno::Reference< drawing::XShapeGroup > & xShapeG
{
pPage->PreUnGroup(xShapeGroup);
UnoActionContext aContext(pDoc);
- pDoc->StartUndo( UNDO_START, NULL );
+ pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
pDoc->UnGroupSelection( *pPage->GetDrawView() );
pDoc->ChgAnchor( pPage->GetDrawView()->GetMarkedObjectList(),
FLY_AT_PARA/*int eAnchorId*/,
sal_True, sal_False );
- pDoc->EndUndo( UNDO_END, NULL );
+ pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
}
pPage->RemovePageView();
}
@@ -1796,7 +1802,7 @@ uno::Sequence< beans::PropertyState > SwXShape::getPropertyStates(
else if(pFmt)
{
const SwAttrSet& rSet = pFmt->GetAttrSet();
- SfxItemState eItemState = rSet.GetItemState(pEntry->nWID, FALSE);
+ SfxItemState eItemState = rSet.GetItemState(pEntry->nWID, sal_False);
if(SFX_ITEM_SET == eItemState)
pRet[nProperty] = beans::PropertyState_DIRECT_VALUE;
diff --git a/sw/source/core/unocore/unoevent.cxx b/sw/source/core/unocore/unoevent.cxx
index 79dea2e958c8..333e132f4e6a 100644
--- a/sw/source/core/unocore/unoevent.cxx
+++ b/sw/source/core/unocore/unoevent.cxx
@@ -164,7 +164,7 @@ void SwHyperlinkEventDescriptor::copyMacrosFromINetFmt(
{
for(sal_Int16 i = 0; mpSupportedMacroItems[i].mnEvent != 0; i++)
{
- USHORT nEvent = mpSupportedMacroItems[i].mnEvent;
+ sal_uInt16 nEvent = mpSupportedMacroItems[i].mnEvent;
const SvxMacro* aMacro = aFmt.GetMacro(nEvent);
if (NULL != aMacro)
replaceByName(nEvent, *aMacro);
@@ -176,7 +176,7 @@ void SwHyperlinkEventDescriptor::copyMacrosIntoINetFmt(
{
for(sal_Int16 i = 0; mpSupportedMacroItems[i].mnEvent != 0; i++)
{
- USHORT nEvent = mpSupportedMacroItems[i].mnEvent;
+ sal_uInt16 nEvent = mpSupportedMacroItems[i].mnEvent;
if (hasByName(nEvent))
{
SvxMacro aMacro(sEmpty, sEmpty);
diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx
index 6ee3d53a80a5..b56eb7c0a535 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -127,8 +127,8 @@ static const sal_uInt16 aDocInfoSubTypeFromService[] =
};
struct ServiceIdResId
{
- USHORT nResId;
- USHORT nServiceId;
+ sal_uInt16 nResId;
+ sal_uInt16 nServiceId;
};
static const ServiceIdResId aServiceToRes[] =
{
@@ -212,7 +212,7 @@ sal_uInt16 lcl_GetServiceForField( const SwField& rFld )
case RES_DOCINFOFLD:
{
- USHORT nSubType = rFld.GetSubType();
+ sal_uInt16 nSubType = rFld.GetSubType();
switch( (nSubType & 0xff))
{
case DI_CHANGE:
@@ -279,7 +279,7 @@ sal_uInt16 lcl_GetServiceForField( const SwField& rFld )
return nSrvId;
}
-sal_uInt16 lcl_GetPropMapIdForFieldType( USHORT nWhich )
+sal_uInt16 lcl_GetPropMapIdForFieldType( sal_uInt16 nWhich )
{
sal_uInt16 nId;
switch( nWhich )
@@ -295,9 +295,9 @@ sal_uInt16 lcl_GetPropMapIdForFieldType( USHORT nWhich )
}
-USHORT GetFieldTypeMId( const OUString& rProperty, const SwFieldType& rTyp )
+sal_uInt16 GetFieldTypeMId( const OUString& rProperty, const SwFieldType& rTyp )
{
- USHORT nId = lcl_GetPropMapIdForFieldType( rTyp.Which() );
+ sal_uInt16 nId = lcl_GetPropMapIdForFieldType( rTyp.Which() );
const SfxItemPropertySet* pSet = aSwMapProvider.GetPropertySet( nId );
if( !pSet )
nId = USHRT_MAX;
@@ -309,9 +309,9 @@ USHORT GetFieldTypeMId( const OUString& rProperty, const SwFieldType& rTyp )
return nId;
}
-USHORT lcl_GetPropertyMapOfService( USHORT nServiceId )
+sal_uInt16 lcl_GetPropertyMapOfService( sal_uInt16 nServiceId )
{
- USHORT nRet;
+ sal_uInt16 nRet;
switch ( nServiceId)
{
case SW_SERVICE_FIELDTYPE_DATETIME: nRet = PROPERTY_MAP_FLDTYP_DATETIME; break;
@@ -417,7 +417,12 @@ OUString SwXFieldMaster::getImplementationName(void) throw( uno::RuntimeExceptio
return C2U("SwXFieldMaster");
}
+<<<<<<< local
BOOL SwXFieldMaster::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
+=======
+ ---------------------------------------------------------------------------*/
+sal_Bool SwXFieldMaster::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
+>>>>>>> other
{
sal_Bool bRet = sal_False;
if(rServiceName.equalsAsciiL(
@@ -478,7 +483,7 @@ SwXFieldMaster::SwXFieldMaster(SwDoc* pDoc, sal_uInt16 nResId) :
m_bIsDescriptor(sal_True),
fParam1(0.),
nParam1(-1),
- bParam1(FALSE),
+ bParam1(sal_False),
nParam2(0)
{
pDoc->GetPageDescFromPool(RES_POOLPAGE_STANDARD)->Add(this);
@@ -492,7 +497,7 @@ SwXFieldMaster::SwXFieldMaster(SwFieldType& rType, SwDoc* pDoc) :
m_bIsDescriptor(sal_False),
fParam1(0.),
nParam1(-1),
- bParam1(FALSE)
+ bParam1(sal_False)
{
}
@@ -550,7 +555,7 @@ void SwXFieldMaster::setPropertyValue( const OUString& rPropertyName,
// We just call PutValue (empty string is allowed).
// Thus the last property set will be used as Data Source.
- USHORT nMId = GetFieldTypeMId( rPropertyName, *pType );
+ sal_uInt16 nMId = GetFieldTypeMId( rPropertyName, *pType );
if( USHRT_MAX != nMId )
pType->PutValue( rValue, nMId );
else
@@ -593,7 +598,7 @@ void SwXFieldMaster::setPropertyValue( const OUString& rPropertyName,
case RES_DDEFLD :
{
SwDDEFieldType aType(sTypeName, sParam1,
- sal::static_int_cast< USHORT >(bParam1 ? sfx2::LINKUPDATE_ALWAYS : sfx2::LINKUPDATE_ONCALL));
+ sal::static_int_cast< sal_uInt16 >(bParam1 ? sfx2::LINKUPDATE_ALWAYS : sfx2::LINKUPDATE_ONCALL));
pType2 = m_pDoc->InsertFldType(aType);
}
break;
@@ -670,7 +675,7 @@ void SwXFieldMaster::setPropertyValue( const OUString& rPropertyName,
break;
case RES_DDEFLD:
{
- USHORT nPart = rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_DDE_COMMAND_TYPE)) ? 0 :
+ sal_uInt16 nPart = rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_DDE_COMMAND_TYPE)) ? 0 :
rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_DDE_COMMAND_FILE)) ? 1 :
rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_DDE_COMMAND_ELEMENT)) ? 2 :
rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_IS_AUTOMATIC_UPDATE)) ? 3 : USHRT_MAX;
@@ -761,7 +766,7 @@ uno::Any SwXFieldMaster::getPropertyValue(const OUString& rPropertyName)
uno::Sequence<uno::Reference <text::XDependentTextField> > aRetSeq(aFldArr.Count());
uno::Reference<text::XDependentTextField>* pRetSeq = aRetSeq.getArray();
- for(USHORT i = 0; i < aFldArr.Count(); i++)
+ for(sal_uInt16 i = 0; i < aFldArr.Count(); i++)
{
pFld = aFldArr.GetObject(i);
SwXTextField * pInsert = SwXTextField::CreateSwXTextField(*GetDoc(), *pFld);
@@ -773,7 +778,7 @@ uno::Any SwXFieldMaster::getPropertyValue(const OUString& rPropertyName)
else if(pType)
{
//TODO: Properties fuer die uebrigen Feldtypen einbauen
- USHORT nMId = GetFieldTypeMId( rPropertyName, *pType );
+ sal_uInt16 nMId = GetFieldTypeMId( rPropertyName, *pType );
if( USHRT_MAX != nMId )
{
pType->QueryValue( aRet, nMId );
@@ -789,7 +794,7 @@ uno::Any SwXFieldMaster::getPropertyValue(const OUString& rPropertyName)
// a non-empty string.
INetURLObject aObj;
aObj.SetURL( aDataSource );
- BOOL bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID;
+ sal_Bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID;
if (bIsURL && rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_DATA_BASE_URL)))
pStr = &aDataSource; // DataBaseURL
else if (!bIsURL && rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_DATA_BASE_NAME)))
@@ -839,7 +844,7 @@ uno::Any SwXFieldMaster::getPropertyValue(const OUString& rPropertyName)
// a non-empty string.
INetURLObject aObj;
aObj.SetURL( sParam5 ); // SetSmartURL
- BOOL bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID;
+ sal_Bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID;
if (bIsURL && rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_DATA_BASE_URL)))
pStr = &sParam5; // DataBaseURL
else if ( rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_DATA_BASE_NAME)))
@@ -858,7 +863,7 @@ uno::Any SwXFieldMaster::getPropertyValue(const OUString& rPropertyName)
break;
case RES_DDEFLD:
{
- USHORT nPart = rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_DDE_COMMAND_TYPE)) ? 0 :
+ sal_uInt16 nPart = rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_DDE_COMMAND_TYPE)) ? 0 :
rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_DDE_COMMAND_FILE)) ? 1 :
rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_DDE_COMMAND_ELEMENT)) ? 2 :
rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_IS_AUTOMATIC_UPDATE)) ? 3 : USHRT_MAX;
@@ -964,6 +969,32 @@ void SwXFieldMaster::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
}
}
+<<<<<<< local
+=======
+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--------------------------------
+
+ ---------------------------------------------------------------------------*/
+>>>>>>> other
OUString SwXFieldMaster::GetProgrammaticName(const SwFieldType& rType, SwDoc& rDoc)
{
OUString sRet(rType.GetName());
@@ -1327,7 +1358,7 @@ void SwXTextField::attachToRange(
pFld = new SwHiddenTxtField(((SwHiddenTxtFieldType*)pFldType),
m_pProps->sPar1,
m_pProps->sPar2, m_pProps->sPar3,
- static_cast< USHORT >(SW_SERVICE_FIELDTYPE_HIDDEN_TEXT == m_nServiceId ?
+ static_cast< sal_uInt16 >(SW_SERVICE_FIELDTYPE_HIDDEN_TEXT == m_nServiceId ?
TYP_HIDDENTXTFLD : TYP_CONDTXTFLD));
((SwHiddenTxtField*)pFld)->SetValue(m_pProps->bBool1);
uno::Any aVal; aVal <<= (OUString)m_pProps->sPar4;
@@ -1424,7 +1455,7 @@ void SwXTextField::attachToRange(
SwFieldType* pFldType = pDoc->GetFldType(RES_USERFLD, m_sTypeName, sal_True);
if(!pFldType)
throw uno::RuntimeException();
- USHORT nUserSubType = m_pProps->bBool1 ? nsSwExtendedSubType::SUB_INVISIBLE : 0;
+ sal_uInt16 nUserSubType = m_pProps->bBool1 ? nsSwExtendedSubType::SUB_INVISIBLE : 0;
if(m_pProps->bBool2)
nUserSubType |= nsSwExtendedSubType::SUB_CMD;
if(m_pProps->bFormatIsDefault &&
@@ -1624,7 +1655,7 @@ void SwXTextField::attachToRange(
SwFieldType* pFldType = pDoc->GetFldType(RES_INPUTFLD, m_sTypeName, sal_True);
if(!pFldType)
throw uno::RuntimeException();
- USHORT nInpSubType = sal::static_int_cast< USHORT >(SW_SERVICE_FIELDTYPE_INPUT_USER == m_nServiceId ? INP_USR : INP_TXT);
+ sal_uInt16 nInpSubType = sal::static_int_cast< sal_uInt16 >(SW_SERVICE_FIELDTYPE_INPUT_USER == m_nServiceId ? INP_USR : INP_TXT);
SwInputField * pTxtField =
new SwInputField((SwInputFieldType*)pFldType,
m_pProps->sPar1, m_pProps->sPar2,
@@ -1709,7 +1740,7 @@ void SwXTextField::attachToRange(
{
// create field
- USHORT nType = nsSwGetSetExpType::GSE_FORMULA;
+ sal_uInt16 nType = nsSwGetSetExpType::GSE_FORMULA;
if(m_pProps->bBool1)
{
nType |= nsSwExtendedSubType::SUB_CMD;
@@ -1926,7 +1957,7 @@ void SwXTextField::setPropertyValue(const OUString& rPropertyName, const uno::An
else if(m_pProps)
{
String* pStr = 0;
- BOOL* pBool = 0;
+ sal_Bool* pBool = 0;
switch(pEntry->nWID)
{
case FIELD_PROP_PAR1:
@@ -2382,7 +2413,14 @@ OUString SwXTextFieldMasters::getImplementationName(void) throw( uno::RuntimeExc
{
return C2U("SwXTextFieldMasters");
}
+<<<<<<< local
BOOL SwXTextFieldMasters::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
+=======
+/* -----------------------------06.04.00 13:22--------------------------------
+
+ ---------------------------------------------------------------------------*/
+sal_Bool SwXTextFieldMasters::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
+>>>>>>> other
{
return rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(
"com.sun.star.text.TextFieldMasters" ));
@@ -2444,7 +2482,7 @@ sal_uInt16 lcl_GetIdByName( String& rName, String& rTypeName )
else if(rTypeName.EqualsAscii("DataBase"))
{
rName.Erase( 0, RTL_CONSTASCII_LENGTH( "DataBase." ));
- USHORT nDotCount = rName.GetTokenCount('.');
+ sal_uInt16 nDotCount = rName.GetTokenCount('.');
if( 2 <= nDotCount )
{
// #i51815#
@@ -2609,7 +2647,12 @@ OUString SwXTextFieldTypes::getImplementationName(void) throw( uno::RuntimeExcep
return C2U("SwXTextFieldTypes");
}
+<<<<<<< local
BOOL SwXTextFieldTypes::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
+=======
+ ---------------------------------------------------------------------------*/
+sal_Bool SwXTextFieldTypes::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
+>>>>>>> other
{
return rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(
"com.sun.star.text.TextFields" ));
@@ -2702,7 +2745,12 @@ OUString SwXFieldEnumeration::getImplementationName(void) throw( uno::RuntimeExc
return C2U("SwXFieldEnumeration");
}
+<<<<<<< local
BOOL SwXFieldEnumeration::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
+=======
+ ---------------------------------------------------------------------------*/
+sal_Bool SwXFieldEnumeration::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
+>>>>>>> other
{
return rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(
"com.sun.star.text.FieldEnumeration" ));
@@ -2740,7 +2788,7 @@ SwXFieldEnumeration::SwXFieldEnumeration(SwDoc* pDc) :
const SwTxtFld *pTxtFld = pCurFldFmt->GetTxtFld();
// skip fields that are currently not in the document
// e.g. fields in undo or redo array
- BOOL bSkip = !pTxtFld ||
+ sal_Bool bSkip = !pTxtFld ||
!pTxtFld->GetpTxtNode()->GetNodes().IsDocNodes();
if (!bSkip)
pItems[ nFillPos++ ] = new SwXTextField(*pCurFldFmt, pDoc);
diff --git a/sw/source/core/unocore/unoflatpara.cxx b/sw/source/core/unocore/unoflatpara.cxx
index fd1918d0d22d..db22c9cb082c 100644
--- a/sw/source/core/unocore/unoflatpara.cxx
+++ b/sw/source/core/unocore/unoflatpara.cxx
@@ -185,7 +185,7 @@ lang::Locale SAL_CALL SwXFlatParagraph::getLanguageOfText(::sal_Int32 nPos, ::sa
if (!mpTxtNode)
return SvxCreateLocale( LANGUAGE_NONE );
- const lang::Locale aLocale( SW_BREAKITER()->GetLocale( mpTxtNode->GetLang( static_cast<USHORT>(nPos), static_cast<USHORT>(nLen) ) ) );
+ const lang::Locale aLocale( SW_BREAKITER()->GetLocale( mpTxtNode->GetLang( static_cast<sal_uInt16>(nPos), static_cast<sal_uInt16>(nLen) ) ) );
return aLocale;
}
@@ -198,7 +198,7 @@ lang::Locale SAL_CALL SwXFlatParagraph::getPrimaryLanguageOfText(::sal_Int32 nPo
if (!mpTxtNode)
return SvxCreateLocale( LANGUAGE_NONE );
- const lang::Locale aLocale( SW_BREAKITER()->GetLocale( mpTxtNode->GetLang( static_cast<USHORT>(nPos), static_cast<USHORT>(nLen) ) ) );
+ const lang::Locale aLocale( SW_BREAKITER()->GetLocale( mpTxtNode->GetLang( static_cast<sal_uInt16>(nPos), static_cast<sal_uInt16>(nLen) ) ) );
return aLocale;
}
@@ -212,7 +212,7 @@ void SAL_CALL SwXFlatParagraph::changeText(::sal_Int32 nPos, ::sal_Int32 nLen, c
SwTxtNode* pOldTxtNode = mpTxtNode;
- SwPaM aPaM( *mpTxtNode, static_cast<USHORT>(nPos), *mpTxtNode, static_cast<USHORT>(nPos + nLen) );
+ SwPaM aPaM( *mpTxtNode, static_cast<sal_uInt16>(nPos), *mpTxtNode, static_cast<sal_uInt16>(nPos + nLen) );
UnoActionContext aAction( mpTxtNode->GetDoc() );
@@ -222,7 +222,7 @@ void SAL_CALL SwXFlatParagraph::changeText(::sal_Int32 nPos, ::sal_Int32 nLen, c
uno::Reference< beans::XPropertySet > xPropSet( xRange, uno::UNO_QUERY );
if ( xPropSet.is() )
{
- for ( USHORT i = 0; i < aAttributes.getLength(); ++i )
+ for ( sal_uInt16 i = 0; i < aAttributes.getLength(); ++i )
xPropSet->setPropertyValue( aAttributes[i].Name, aAttributes[i].Value );
}
@@ -242,7 +242,7 @@ void SAL_CALL SwXFlatParagraph::changeAttributes(::sal_Int32 nPos, ::sal_Int32 n
if ( !mpTxtNode )
return;
- SwPaM aPaM( *mpTxtNode, static_cast<USHORT>(nPos), *mpTxtNode, static_cast<USHORT>(nPos + nLen) );
+ SwPaM aPaM( *mpTxtNode, static_cast<sal_uInt16>(nPos), *mpTxtNode, static_cast<sal_uInt16>(nPos + nLen) );
UnoActionContext aAction( mpTxtNode->GetDoc() );
@@ -252,7 +252,7 @@ void SAL_CALL SwXFlatParagraph::changeAttributes(::sal_Int32 nPos, ::sal_Int32 n
uno::Reference< beans::XPropertySet > xPropSet( xRange, uno::UNO_QUERY );
if ( xPropSet.is() )
{
- for ( USHORT i = 0; i < aAttributes.getLength(); ++i )
+ for ( sal_uInt16 i = 0; i < aAttributes.getLength(); ++i )
xPropSet->setPropertyValue( aAttributes[i].Name, aAttributes[i].Value );
}
@@ -395,7 +395,7 @@ uno::Reference< text::XFlatParagraph > SwXFlatParagraphIterator::getNextPara()
else // non-automatic checking
{
const SwNodes& rNodes = mpDoc->GetNodes();
- const ULONG nMaxNodes = rNodes.Count();
+ const sal_uLong nMaxNodes = rNodes.Count();
while ( mnCurrentNode < mnEndNode && mnCurrentNode < nMaxNodes )
{
@@ -460,7 +460,7 @@ uno::Reference< text::XFlatParagraph > SwXFlatParagraphIterator::getParaAfter(co
SwTxtNode* pNextTxtNode = 0;
const SwNodes& rNodes = pCurrentNode->GetDoc()->GetNodes();
- for( ULONG nCurrentNode = pCurrentNode->GetIndex() + 1; nCurrentNode < rNodes.Count(); ++nCurrentNode )
+ for( sal_uLong nCurrentNode = pCurrentNode->GetIndex() + 1; nCurrentNode < rNodes.Count(); ++nCurrentNode )
{
SwNode* pNd = rNodes[ nCurrentNode ];
pNextTxtNode = dynamic_cast<SwTxtNode*>(pNd);
@@ -507,7 +507,7 @@ uno::Reference< text::XFlatParagraph > SwXFlatParagraphIterator::getParaBefore(c
SwTxtNode* pPrevTxtNode = 0;
const SwNodes& rNodes = pCurrentNode->GetDoc()->GetNodes();
- for( ULONG nCurrentNode = pCurrentNode->GetIndex() - 1; nCurrentNode > 0; --nCurrentNode )
+ for( sal_uLong nCurrentNode = pCurrentNode->GetIndex() - 1; nCurrentNode > 0; --nCurrentNode )
{
SwNode* pNd = rNodes[ nCurrentNode ];
pPrevTxtNode = dynamic_cast<SwTxtNode*>(pNd);
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index 1e64c370839b..3466dc1cf20e 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -45,6 +45,7 @@
#include <memory>
#include <hints.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <docsh.hxx>
#include <editsh.hxx>
#include <swcli.hxx>
@@ -141,8 +142,8 @@ class BaseFrameProperties_Impl
public:
virtual ~BaseFrameProperties_Impl();
- void SetProperty(USHORT nWID, BYTE nMemberId, const uno::Any& rVal);
- sal_Bool GetProperty(USHORT nWID, BYTE nMemberId, const uno::Any*& pAny );
+ void SetProperty(sal_uInt16 nWID, sal_uInt8 nMemberId, const uno::Any& rVal);
+ sal_Bool GetProperty(sal_uInt16 nWID, sal_uInt8 nMemberId, const uno::Any*& pAny );
// void GetProperty(const OUString &rPropertyName, const uno::Reference < beans::XPropertySet > &rxPropertySet, uno::Any& rAny );
// const SfxItemPropertyMap* GetMap() const {return _pMap;}
@@ -156,12 +157,22 @@ BaseFrameProperties_Impl::~BaseFrameProperties_Impl()
{
}
+<<<<<<< local
void BaseFrameProperties_Impl::SetProperty(USHORT nWID, BYTE nMemberId, const uno::Any& rVal)
+=======
+ ---------------------------------------------------------------------------*/
+void BaseFrameProperties_Impl::SetProperty(sal_uInt16 nWID, sal_uInt8 nMemberId, const uno::Any& rVal)
+>>>>>>> other
{
aAnyMap.SetValue( nWID, nMemberId, rVal );
}
+<<<<<<< local
sal_Bool BaseFrameProperties_Impl::GetProperty(USHORT nWID, BYTE nMemberId, const uno::Any*& rpAny)
+=======
+ ---------------------------------------------------------------------------*/
+sal_Bool BaseFrameProperties_Impl::GetProperty(sal_uInt16 nWID, sal_uInt8 nMemberId, const uno::Any*& rpAny)
+>>>>>>> other
{
return aAnyMap.FillValue( nWID, nMemberId, rpAny );
}
@@ -650,7 +661,7 @@ sal_Bool SwGraphicProperties_Impl::AnyToItemSet(
}
- static const :: USHORT nIDs[] =
+ static const :: sal_uInt16 nIDs[] =
{
RES_GRFATR_CROPGRF,
RES_GRFATR_ROTATION,
@@ -668,7 +679,7 @@ sal_Bool SwGraphicProperties_Impl::AnyToItemSet(
const ::uno::Any* pAny;
for(sal_Int16 nIndex = 0; nIDs[nIndex]; nIndex++)
{
- BYTE nMId = RES_GRFATR_CROPGRF == nIDs[nIndex] ? CONVERT_TWIPS : 0;
+ sal_uInt8 nMId = RES_GRFATR_CROPGRF == nIDs[nIndex] ? CONVERT_TWIPS : 0;
if(GetProperty(nIDs[nIndex], nMId, pAny ))
{
SfxPoolItem* pItem = ::GetDfltAttr( nIDs[nIndex] )->Clone();
@@ -696,10 +707,10 @@ sal_Bool SwOLEProperties_Impl::AnyToItemSet(
{
const ::uno::Any* pTemp;
if(!GetProperty(FN_UNO_CLSID, 0, pTemp) && !GetProperty(FN_UNO_STREAM_NAME, 0, pTemp) )
- return FALSE;
+ return sal_False;
SwFrameProperties_Impl::AnyToItemSet( pDoc, rFrmSet, rSet, rSizeFound);
//
- return TRUE;
+ return sal_True;
}
/******************************************************************
@@ -731,7 +742,12 @@ OUString SwXFrame::getImplementationName(void) throw( uno::RuntimeException )
return C2U("SwXFrame");
}
+<<<<<<< local
BOOL SwXFrame::supportsService(const :: OUString& rServiceName) throw( uno::RuntimeException )
+=======
+ ---------------------------------------------------------------------------*/
+sal_Bool SwXFrame::supportsService(const :: OUString& rServiceName) throw( uno::RuntimeException )
+>>>>>>> other
{
return !rServiceName.compareToAscii("com.sun.star.text.BaseFrame")||
!rServiceName.compareToAscii("com.sun.star.text.TextContent") ||
@@ -970,17 +986,17 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno::
pNoTxt->SetContour(0);
else if(aValue >>= aParam)
{
- PolyPolygon aPoly((USHORT)aParam.getLength());
+ PolyPolygon aPoly((sal_uInt16)aParam.getLength());
for(sal_Int32 i = 0; i < aParam.getLength(); i++)
{
const :: drawing::PointSequence* pPointSeq = aParam.getConstArray();
sal_Int32 nPoints = pPointSeq[i].getLength();
const :: awt::Point* pPoints = pPointSeq[i].getConstArray();
- Polygon aSet( (USHORT)nPoints );
+ Polygon aSet( (sal_uInt16)nPoints );
for(sal_Int32 j = 0; j < nPoints; j++)
{
Point aPoint(pPoints[j].X, pPoints[j].Y);
- aSet.SetPoint(aPoint, (USHORT)j);
+ aSet.SetPoint(aPoint, (sal_uInt16)j);
}
// Close polygon if it isn't closed already.
aSet.Optimize( POLY_OPTIMIZE_CLOSE );
@@ -1091,7 +1107,7 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno::
}
// <--
- pFmt->GetDoc()->SetFrmFmtToFly( *pFmt, *pFrmFmt, pSet, FALSE );
+ pFmt->GetDoc()->SetFrmFmtToFly( *pFmt, *pFrmFmt, pSet, sal_False );
delete pSet;
}
else
@@ -1445,12 +1461,12 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName)
{
drawing::PointSequenceSequence aPtSeq(aContour.Count());
drawing::PointSequence* pPSeq = aPtSeq.getArray();
- for(USHORT i = 0; i < aContour.Count(); i++)
+ for(sal_uInt16 i = 0; i < aContour.Count(); i++)
{
const Polygon& rPoly = aContour.GetObject(i);
pPSeq[i].realloc(rPoly.GetSize());
awt::Point* pPoints = pPSeq[i].getArray();
- for(USHORT j = 0; j < rPoly.GetSize(); j++)
+ for(sal_uInt16 j = 0; j < rPoly.GetSize(); j++)
{
const Point& rPoint = rPoly.GetPoint(j);
pPoints[j].X = rPoint.X();
@@ -1462,12 +1478,12 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName)
}
else if(pEntry->nWID == FN_UNO_IS_AUTOMATIC_CONTOUR )
{
- BOOL bValue = pNoTxt->HasAutomaticContour();
+ sal_Bool bValue = pNoTxt->HasAutomaticContour();
aAny.setValue( &bValue, ::getBooleanCppuType() );
}
else if(pEntry->nWID == FN_UNO_IS_PIXEL_CONTOUR )
{
- BOOL bValue = pNoTxt->IsPixelContour();
+ sal_Bool bValue = pNoTxt->IsPixelContour();
aAny.setValue( &bValue, ::getBooleanCppuType() );
}
else
@@ -1586,7 +1602,8 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName)
}
}
else if(FN_UNO_CLSID == pEntry->nWID || FN_UNO_MODEL == pEntry->nWID||
- FN_UNO_COMPONENT == pEntry->nWID ||FN_UNO_STREAM_NAME == pEntry->nWID)
+ FN_UNO_COMPONENT == pEntry->nWID ||FN_UNO_STREAM_NAME == pEntry->nWID||
+ FN_EMBEDDED_OBJECT == pEntry->nWID)
{
SwDoc* pDoc = pFmt->GetDoc();
const SwFmtCntnt* pCnt = &pFmt->GetCntnt();
@@ -1607,7 +1624,15 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName)
{
uno::Reference < lang::XComponent > xComp( xIP->getComponent(), uno::UNO_QUERY );
uno::Reference < frame::XModel > xModel( xComp, uno::UNO_QUERY );
- if ( xModel.is() )
+ if ( FN_EMBEDDED_OBJECT == pEntry->nWID )
+ {
+ // ensure the
+ ASSERT( pDoc->GetDocShell(), "no doc shell => no client site" );
+ if ( pDoc->GetDocShell() )
+ pDoc->GetDocShell()->GetIPClient( svt::EmbeddedObjectRef( xIP, embed::Aspects::MSOLE_CONTENT ) );
+ aAny <<= xIP;
+ }
+ else if ( xModel.is() )
aAny <<= xModel;
else if ( FN_UNO_COMPONENT == pEntry->nWID )
aAny <<= xComp;
@@ -1741,13 +1766,13 @@ uno::Sequence< beans::PropertyState > SwXFrame::getPropertyStates(
SwNoTxtNode* pNoTxt = aIdx.GetNode().GetNoTxtNode();
SfxItemSet aSet(pNoTxt->GetSwAttrSet());
aSet.GetItemState(pEntry->nWID);
- if(SFX_ITEM_SET == aSet.GetItemState( pEntry->nWID, FALSE ))
+ if(SFX_ITEM_SET == aSet.GetItemState( pEntry->nWID, sal_False ))
pStates[i] = beans::PropertyState_DIRECT_VALUE;
}
}
else
{
- if(SFX_ITEM_SET == rFmtSet.GetItemState( pEntry->nWID, FALSE ))
+ if(SFX_ITEM_SET == rFmtSet.GetItemState( pEntry->nWID, sal_False ))
pStates[i] = beans::PropertyState_DIRECT_VALUE;
else
pStates[i] = beans::PropertyState_DEFAULT_VALUE;
@@ -1778,7 +1803,7 @@ void SwXFrame::setPropertyToDefault( const OUString& rPropertyName )
if ( pEntry->nFlags & beans::PropertyAttribute::READONLY)
throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "setPropertyToDefault: property is read-only: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
- BOOL bNextFrame;
+ sal_Bool bNextFrame;
if( pEntry->nWID &&
pEntry->nWID != FN_UNO_ANCHOR_TYPES &&
pEntry->nWID != FN_PARAM_LINK_DISPLAY_NAME)
@@ -2209,7 +2234,7 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan
// xIPObj->OnDocumentPrinterChanged( pDoc->getPrinter( false ) );
UnoActionContext aAction(pDoc);
- pDoc->StartUndo(UNDO_INSERT, NULL);
+ pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_INSERT, NULL);
if(!bSizeFound)
{
//TODO/LATER: from where do I get a ViewAspect? And how do I transport it to the OLENode?
@@ -2256,7 +2281,7 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan
pFmt2 = pDoc->Insert(aPam, xObjRef, &aFrmSet, NULL, NULL );
ASSERT( pFmt2, "Doc->Insert(notxt) failed." );
- pDoc->EndUndo(UNDO_INSERT, NULL);
+ pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_INSERT, NULL);
pFmt2->Add(this);
if(sName.Len())
pDoc->SetFlyName((SwFlyFrmFmt&)*pFmt2, sName);
@@ -2266,11 +2291,11 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan
{
::rtl::OUString sStreamName;
(*pStreamName) >>= sStreamName;
- pDoc->StartUndo(UNDO_INSERT, NULL);
+ pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_INSERT, NULL);
SwFlyFrmFmt* pFrmFmt = 0;
pFrmFmt = pDoc->InsertOLE( aPam, sStreamName, embed::Aspects::MSOLE_CONTENT, &aFrmSet, NULL, NULL );
- pDoc->EndUndo(UNDO_INSERT, NULL);
+ pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_INSERT, NULL);
pFrmFmt->Add(this);
if(sName.Len())
pDoc->SetFlyName((SwFlyFrmFmt&)*pFrmFmt, sName);
diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx
index 46d373194eb6..cc4a31c5af9b 100644
--- a/sw/source/core/unocore/unoidx.cxx
+++ b/sw/source/core/unocore/unoidx.cxx
@@ -562,7 +562,7 @@ throw (uno::RuntimeException)
{
vos::OGuard g(Application::GetSolarMutex());
- USHORT nObjectType = SW_SERVICE_TYPE_INDEX;
+ sal_uInt16 nObjectType = SW_SERVICE_TYPE_INDEX;
switch (m_pImpl->m_eTOXType)
{
// case TOX_INDEX: break;
@@ -990,8 +990,8 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
{
SwSections aSectArr;
pSectionFmt->GetChildSections(aSectArr,
- SORTSECT_NOT, FALSE);
- for(USHORT i = 0; i < aSectArr.Count(); i++)
+ SORTSECT_NOT, sal_False);
+ for(sal_uInt16 i = 0; i < aSectArr.Count(); i++)
{
SwSection* pSect = aSectArr[i];
if(pSect->GetType() == TOX_HEADER_SECTION)
@@ -1247,11 +1247,31 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
case WID_INDEX_MARKS:
{
SwTOXMarks aMarks;
+<<<<<<< local
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(USHORT i = 0; i < aMarks.Count(); i++)
+=======
+ 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();
+ for(sal_uInt16 i = 0; i < aMarks.Count(); i++)
+>>>>>>> other
{
SwTOXMark* pMark = aMarks.GetObject(i);
pxMarks[i] = SwXDocumentIndexMark::CreateXDocumentIndexMark(
@@ -2025,7 +2045,7 @@ void SwXDocumentIndexMark::Impl::InsertTOXMark(
// n.b.: toxmarks must have either alternative text or an extent
if (bMark && rMark.GetAlternativeText().Len())
{
- rPam.Normalize(TRUE);
+ rPam.Normalize(sal_True);
rPam.DeleteMark();
bMark = false;
}
@@ -3281,7 +3301,7 @@ throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException,
if(SVX_TAB_ADJUST_END == aToken.eTabAlign)
{
pArr[1].Name = C2U("TabStopRightAligned");
- BOOL bTemp = sal_True;
+ sal_Bool bTemp = sal_True;
pArr[1].Value.setValue(&bTemp, ::getCppuBooleanType());
}
else
diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx
index 765b1ae37485..b0ef867efe71 100644
--- a/sw/source/core/unocore/unomap.cxx
+++ b/sw/source/core/unocore/unomap.cxx
@@ -1150,6 +1150,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
{ SW_PROP_NMID(UNO_NAME_GRAPHIC_URL), FN_UNO_REPLACEMENT_GRAPHIC_URL, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::MAYBEVOID, 0 },
{ SW_PROP_NMID(UNO_NAME_GRAPHIC), FN_UNO_REPLACEMENT_GRAPHIC, CPPU_E2T(CPPUTYPE_REFXGRAPHIC), PropertyAttribute::MAYBEVOID, 0 },
{ SW_PROP_NMID(UNO_NAME_COMPONENT),FN_UNO_COMPONENT, CPPU_E2T(CPPUTYPE_REFCOMPONENT), PropertyAttribute::READONLY, 0},
+ { SW_PROP_NMID(UNO_NAME_EMBEDDED_OBJECT),FN_EMBEDDED_OBJECT, CPPU_E2T(CPPUTPYE_REFEMBEDDEDOBJECT), PropertyAttribute::READONLY, 0},
// { SW_PROP_NMID(UNO_NAME_ALTERNATIVE_TEXT), FN_UNO_ALTERNATIVE_TEXT,CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE , 0 },
{0,0,0,0,0,0}
};
@@ -2499,7 +2500,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
for( ; p->pName; ++p, ++i )
{
// set the name
- const SwPropNameLen& rPropNm = GetPropName( (USHORT)(long)p->pName );
+ const SwPropNameLen& rPropNm = GetPropName( (sal_uInt16)(long)p->pName );
p->pName = rPropNm.pName;
p->nNameLen = rPropNm.nNameLen;
// get the cppu type from the comphelper
diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx
index e21857c755c0..7be5ca8130c2 100644
--- a/sw/source/core/unocore/unoobj.cxx
+++ b/sw/source/core/unocore/unoobj.cxx
@@ -40,6 +40,7 @@
#include <IMark.hxx>
#include <frmfmt.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <istyleaccess.hxx>
#include <ndtxt.hxx>
#include <ndnotxt.hxx>
@@ -66,9 +67,7 @@
#include <fmtfld.hxx>
#include <fmtpdsc.hxx>
#include <pagedesc.hxx>
-#ifndef _POOLFMT_HRC
#include <poolfmt.hrc>
-#endif
#include <poolfmt.hxx>
#include <edimp.hxx>
#include <fchrfmt.hxx>
@@ -226,10 +225,10 @@ void SwUnoCursorHelper::GetTextFromPam(SwPaM & rPam, OUString & rBuffer)
SwAsciiOptions aOpt = xWrt->GetAsciiOptions();
aOpt.SetCharSet( RTL_TEXTENCODING_UNICODE );
xWrt->SetAsciiOptions( aOpt );
- xWrt->bUCS2_WithStartChar = FALSE;
+ xWrt->bUCS2_WithStartChar = sal_False;
// --> FME #i68522#
- const BOOL bOldShowProgress = xWrt->bShowProgress;
- xWrt->bShowProgress = FALSE;
+ const sal_Bool bOldShowProgress = xWrt->bShowProgress;
+ xWrt->bShowProgress = sal_False;
// <--
long lLen;
@@ -315,8 +314,8 @@ throw (lang::IllegalArgumentException)
if(pStyle.get())
{
SwFmtAutoFmt aFmt( (bPara)
- ? sal::static_int_cast< USHORT >(RES_AUTO_STYLE)
- : sal::static_int_cast< USHORT >(RES_TXTATR_AUTOFMT) );
+ ? sal::static_int_cast< sal_uInt16 >(RES_AUTO_STYLE)
+ : sal::static_int_cast< sal_uInt16 >(RES_TXTATR_AUTOFMT) );
aFmt.SetStyleHandle( pStyle );
rSet.Put(aFmt);
}
@@ -350,13 +349,13 @@ throw (lang::IllegalArgumentException)
SwTxtFmtColl *const pLocal = pStyle->GetCollection();
UnoActionContext aAction(pDoc);
- pDoc->StartUndo( UNDO_START, NULL );
+ pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
SwPaM *pTmpCrsr = &rPaM;
do {
pDoc->SetTxtFmtColl(*pTmpCrsr, pLocal);
pTmpCrsr = static_cast<SwPaM*>(pTmpCrsr->GetNext());
} while ( pTmpCrsr != &rPaM );
- pDoc->EndUndo( UNDO_END, NULL );
+ pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
}
/* -----------------06.07.98 07:38-------------------
@@ -427,7 +426,7 @@ lcl_SetNodeNumStart(SwPaM & rCrsr, uno::Any const& rValue)
if( rCrsr.GetNext() != &rCrsr ) // Mehrfachselektion ?
{
- pDoc->StartUndo( UNDO_START, NULL );
+ pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
SwPamRanges aRangeArr( rCrsr );
SwPaM aPam( *rCrsr.GetPoint() );
for( sal_uInt16 n = 0; n < aRangeArr.Count(); ++n )
@@ -436,7 +435,7 @@ lcl_SetNodeNumStart(SwPaM & rCrsr, uno::Any const& rValue)
pDoc->SetNodeNumStart(*aRangeArr.SetPam( n, aPam ).GetPoint(),
nStt );
}
- pDoc->EndUndo( UNDO_END, NULL);
+ pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
}
else
{
@@ -457,7 +456,7 @@ lcl_setCharFmtSequence(SwPaM & rPam, uno::Any const& rValue)
for (sal_Int32 nStyle = 0; nStyle < aCharStyles.getLength(); nStyle++)
{
uno::Any aStyle;
- rPam.GetDoc()->StartUndo(UNDO_START, NULL);
+ rPam.GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_START, NULL);
aStyle <<= aCharStyles.getConstArray()[nStyle];
// create a local set and apply each format directly
SfxItemSet aSet(rPam.GetDoc()->GetAttrPool(),
@@ -468,7 +467,7 @@ lcl_setCharFmtSequence(SwPaM & rPam, uno::Any const& rValue)
SwUnoCursorHelper::SetCrsrAttr(rPam, aSet, (nStyle)
? nsSetAttrMode::SETATTR_DONTREPLACE
: nsSetAttrMode::SETATTR_DEFAULT);
- rPam.GetDoc()->EndUndo(UNDO_START, NULL);
+ rPam.GetDoc()->GetIDocumentUndoRedo().EndUndo(UNDO_START, NULL);
}
return true;
}
@@ -701,8 +700,8 @@ SwUnoCursorHelper::GetCurTxtFmtColl(SwPaM & rPaM, const bool bConditional)
SwPaM *pTmpCrsr = &rPaM;
do
{
- const ULONG nSttNd = pTmpCrsr->Start()->nNode.GetIndex();
- const ULONG nEndNd = pTmpCrsr->End()->nNode.GetIndex();
+ const sal_uLong nSttNd = pTmpCrsr->Start()->nNode.GetIndex();
+ const sal_uLong nEndNd = pTmpCrsr->End()->nNode.GetIndex();
if( nEndNd - nSttNd >= nMaxLookup )
{
@@ -711,7 +710,7 @@ SwUnoCursorHelper::GetCurTxtFmtColl(SwPaM & rPaM, const bool bConditional)
}
const SwNodes& rNds = rPaM.GetDoc()->GetNodes();
- for( ULONG n = nSttNd; n <= nEndNd; ++n )
+ for( sal_uLong n = nSttNd; n <= nEndNd; ++n )
{
SwTxtNode const*const pNd = rNds[ n ]->GetTxtNode();
if( pNd )
@@ -931,7 +930,7 @@ void SwXTextCursor::DeleteAndInsert(const ::rtl::OUString& rText,
SwDoc* pDoc = pUnoCrsr->GetDoc();
UnoActionContext aAction(pDoc);
const xub_StrLen nTxtLen = rText.getLength();
- pDoc->StartUndo(UNDO_INSERT, NULL);
+ pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_INSERT, NULL);
SwCursor * pCurrent = pUnoCrsr;
do
{
@@ -949,11 +948,11 @@ void SwXTextCursor::DeleteAndInsert(const ::rtl::OUString& rText,
SwUnoCursorHelper::SelectPam(*pUnoCrsr, true);
pCurrent->Left(rText.getLength(),
- CRSR_SKIP_CHARS, FALSE, FALSE);
+ CRSR_SKIP_CHARS, sal_False, sal_False);
}
pCurrent = static_cast<SwCursor *>(pCurrent->GetNext());
} while (pCurrent != pUnoCrsr);
- pDoc->EndUndo(UNDO_INSERT, NULL);
+ pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_INSERT, NULL);
}
}
@@ -1156,7 +1155,7 @@ throw (uno::RuntimeException)
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
SwUnoCursorHelper::SelectPam(rUnoCursor, Expand);
- sal_Bool bRet = rUnoCursor.Left( nCount, CRSR_SKIP_CHARS, FALSE, FALSE);
+ sal_Bool bRet = rUnoCursor.Left( nCount, CRSR_SKIP_CHARS, sal_False, sal_False);
if (CURSOR_META == m_pImpl->m_eType)
{
bRet = lcl_ForceIntoMeta(rUnoCursor, m_pImpl->m_xParentText,
@@ -1177,7 +1176,7 @@ throw (uno::RuntimeException)
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
SwUnoCursorHelper::SelectPam(rUnoCursor, Expand);
- sal_Bool bRet = rUnoCursor.Right(nCount, CRSR_SKIP_CHARS, FALSE, FALSE);
+ sal_Bool bRet = rUnoCursor.Right(nCount, CRSR_SKIP_CHARS, sal_False, sal_False);
if (CURSOR_META == m_pImpl->m_eType)
{
bRet = lcl_ForceIntoMeta(rUnoCursor, m_pImpl->m_xParentText,
@@ -1453,7 +1452,7 @@ SwXTextCursor::gotoNextWord(sal_Bool Expand) throw (uno::RuntimeException)
if (rUnoCursor.GetCntntNode() &&
(pPoint->nContent == rUnoCursor.GetCntntNode()->Len()))
{
- rUnoCursor.Right(1, CRSR_SKIP_CHARS, FALSE, FALSE);
+ rUnoCursor.Right(1, CRSR_SKIP_CHARS, sal_False, sal_False);
}
else
{
@@ -1499,14 +1498,14 @@ SwXTextCursor::gotoPreviousWord(sal_Bool Expand) throw (uno::RuntimeException)
// start of paragraph?
if (pPoint->nContent == 0)
{
- rUnoCursor.Left(1, CRSR_SKIP_CHARS, FALSE, FALSE);
+ rUnoCursor.Left(1, CRSR_SKIP_CHARS, sal_False, sal_False);
}
else
{
rUnoCursor.GoPrevWordWT( i18n::WordType::DICTIONARY_WORD );
if (pPoint->nContent == 0)
{
- rUnoCursor.Left(1, CRSR_SKIP_CHARS, FALSE, FALSE);
+ rUnoCursor.Left(1, CRSR_SKIP_CHARS, sal_False, sal_False);
}
}
@@ -2175,10 +2174,10 @@ throw (beans::UnknownPropertyException, uno::RuntimeException)
{
if (!pSetParent.get())
{
- pSetParent.reset( pSet->Clone( FALSE ) );
+ pSetParent.reset( pSet->Clone( sal_False ) );
// --> OD 2006-07-12 #i63870#
SwUnoCursorHelper::GetCrsrAttr(
- rPaM, *pSetParent, TRUE, FALSE );
+ rPaM, *pSetParent, sal_True, sal_False );
// <--
}
@@ -2216,7 +2215,7 @@ lcl_SelectParaAndReset( SwPaM &rPaM, SwDoc & rDoc,
// if we are reseting paragraph attributes, we need to select the full paragraph first
SwPosition aStart = *rPaM.Start();
SwPosition aEnd = *rPaM.End();
- ::std::auto_ptr< SwUnoCrsr > pTemp ( rDoc.CreateUnoCrsr(aStart, FALSE) );
+ ::std::auto_ptr< SwUnoCrsr > pTemp ( rDoc.CreateUnoCrsr(aStart, sal_False) );
if(!SwUnoCursorHelper::IsStartOfPara(*pTemp))
{
pTemp->MovePara(fnParaCurr, fnParaStart);
@@ -2514,7 +2513,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
}
// para specific attribut ranges
-static USHORT g_ParaResetableSetRange[] = {
+static sal_uInt16 g_ParaResetableSetRange[] = {
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
RES_PARATR_BEGIN, RES_PARATR_END-1,
// --> OD 2008-02-25 #refactorlists#
@@ -2525,7 +2524,7 @@ static USHORT g_ParaResetableSetRange[] = {
};
// selection specific attribut ranges
-static USHORT g_ResetableSetRange[] = {
+static sal_uInt16 g_ResetableSetRange[] = {
RES_CHRATR_BEGIN, RES_CHRATR_END-1,
RES_TXTATR_INETFMT, RES_TXTATR_INETFMT,
RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT,
@@ -2535,13 +2534,13 @@ static USHORT g_ResetableSetRange[] = {
};
static void
-lcl_EnumerateIds(USHORT const* pIdRange, SvUShortsSort & rWhichIds)
+lcl_EnumerateIds(sal_uInt16 const* pIdRange, SvUShortsSort & rWhichIds)
{
while (*pIdRange)
{
- const USHORT nStart = sal::static_int_cast<USHORT>(*pIdRange++);
- const USHORT nEnd = sal::static_int_cast<USHORT>(*pIdRange++);
- for (USHORT nId = nStart + 1; nId <= nEnd; ++nId)
+ const sal_uInt16 nStart = sal::static_int_cast<sal_uInt16>(*pIdRange++);
+ const sal_uInt16 nEnd = sal::static_int_cast<sal_uInt16>(*pIdRange++);
+ for (sal_uInt16 nId = nStart + 1; nId <= nEnd; ++nId)
{
rWhichIds.Insert( nId );
}
@@ -2820,17 +2819,17 @@ sal_Bool SwUnoCursorHelper::ConvertSortProperties(
SwSortKey* pKey1 = new SwSortKey;
pKey1->nColumnId = USHRT_MAX;
- pKey1->bIsNumeric = TRUE;
+ pKey1->bIsNumeric = sal_True;
pKey1->eSortOrder = SRT_ASCENDING;
SwSortKey* pKey2 = new SwSortKey;
pKey2->nColumnId = USHRT_MAX;
- pKey2->bIsNumeric = TRUE;
+ pKey2->bIsNumeric = sal_True;
pKey2->eSortOrder = SRT_ASCENDING;
SwSortKey* pKey3 = new SwSortKey;
pKey3->nColumnId = USHRT_MAX;
- pKey3->bIsNumeric = TRUE;
+ pKey3->bIsNumeric = sal_True;
pKey3->eSortOrder = SRT_ASCENDING;
SwSortKey* aKeys[3] = {pKey1, pKey2, pKey3};
@@ -3012,7 +3011,7 @@ sal_Bool SwUnoCursorHelper::ConvertSortProperties(
SvxLocaleToLanguage( pFields[i].CollatorLocale );
aKeys[i]->sSortType = pFields[i].CollatorAlgorithm;
aKeys[i]->nColumnId =
- static_cast<USHORT>(pFields[i].Field);
+ static_cast<sal_uInt16>(pFields[i].Field);
aKeys[i]->bIsNumeric = (pFields[i].FieldType ==
table::TableSortFieldType_NUMERIC);
aKeys[i]->eSortOrder = (pFields[i].IsAscending)
@@ -3078,7 +3077,7 @@ throw (uno::RuntimeException)
SwPosition & rEnd = *rUnoCursor.End();
SwNodeIndex aPrevIdx( rStart.nNode, -1 );
- const ULONG nOffset = rEnd.nNode.GetIndex() - rStart.nNode.GetIndex();
+ const sal_uLong nOffset = rEnd.nNode.GetIndex() - rStart.nNode.GetIndex();
const xub_StrLen nCntStt = rStart.nContent.GetIndex();
rUnoCursor.GetDoc()->SortText(rUnoCursor, aSortOpt);
diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx
index 069321e2296c..3231b73b023c 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -37,6 +37,7 @@
#include <bookmrk.hxx>
#include <frmfmt.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <ndtxt.hxx>
#include <ndnotxt.hxx>
#include <unocrsr.hxx>
@@ -198,14 +199,14 @@ void CollectFrameAtNode( SwClient& rClnt, const SwNodeIndex& rIdx,
const bool _bAtCharAnchoredObjs )
{
// _bAtCharAnchoredObjs:
- // <TRUE>: at-character anchored objects are collected
- // <FALSE>: at-paragraph anchored objects are collected
+ // <sal_True>: at-character anchored objects are collected
+ // <sal_False>: at-paragraph anchored objects are collected
// alle Rahmen, Grafiken und OLEs suchen, die an diesem Absatz
// gebunden sind
SwDoc* pDoc = rIdx.GetNode().GetDoc();
- USHORT nChkType = static_cast< USHORT >((_bAtCharAnchoredObjs)
+ sal_uInt16 nChkType = static_cast< sal_uInt16 >((_bAtCharAnchoredObjs)
? FLY_AT_CHAR : FLY_AT_PARA);
const SwCntntFrm* pCFrm;
const SwCntntNode* pCNd;
@@ -215,7 +216,7 @@ void CollectFrameAtNode( SwClient& rClnt, const SwNodeIndex& rIdx,
{
const SwSortedObjs *pObjs = pCFrm->GetDrawObjs();
if( pObjs )
- for( USHORT i = 0; i < pObjs->Count(); ++i )
+ for( sal_uInt16 i = 0; i < pObjs->Count(); ++i )
{
SwAnchoredObject* pAnchoredObj = (*pObjs)[i];
SwFrmFmt& rFmt = pAnchoredObj->GetFrmFmt();
@@ -237,8 +238,8 @@ void CollectFrameAtNode( SwClient& rClnt, const SwNodeIndex& rIdx,
else
{
const SwSpzFrmFmts& rFmts = *pDoc->GetSpzFrmFmts();
- USHORT nSize = rFmts.Count();
- for ( USHORT i = 0; i < nSize; i++)
+ sal_uInt16 nSize = rFmts.Count();
+ for ( sal_uInt16 i = 0; i < nSize; i++)
{
const SwFrmFmt* pFmt = rFmts[ i ];
const SwFmtAnchor& rAnchor = pFmt->GetAnchor();
@@ -345,7 +346,7 @@ void SwUnoCursorHelper::SetCrsrAttr(SwPaM & rPam,
UnoActionContext aAction(pDoc);
if (rPam.GetNext() != &rPam) // Ring of Cursors
{
- pDoc->StartUndo(UNDO_INSATTR, NULL);
+ pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_INSATTR, NULL);
SwPaM *pCurrent = &rPam;
do
@@ -359,7 +360,7 @@ void SwUnoCursorHelper::SetCrsrAttr(SwPaM & rPam,
pCurrent= static_cast<SwPaM *>(pCurrent->GetNext());
} while (pCurrent != &rPam);
- pDoc->EndUndo(UNDO_INSATTR, NULL);
+ pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_INSATTR, NULL);
}
else
{
@@ -393,8 +394,8 @@ void SwUnoCursorHelper::GetCrsrAttr(SwPaM & rPam,
{
SwPosition const & rStart( *pCurrent->Start() );
SwPosition const & rEnd( *pCurrent->End() );
- const ULONG nSttNd = rStart.nNode.GetIndex();
- const ULONG nEndNd = rEnd .nNode.GetIndex();
+ const sal_uLong nSttNd = rStart.nNode.GetIndex();
+ const sal_uLong nEndNd = rEnd .nNode.GetIndex();
if (nEndNd - nSttNd >= nMaxLookup)
{
@@ -405,7 +406,7 @@ void SwUnoCursorHelper::GetCrsrAttr(SwPaM & rPam,
// the first node inserts the values into the get set
// all other nodes merge their values into the get set
- for (ULONG n = nSttNd; n <= nEndNd; ++n)
+ for (sal_uLong n = nSttNd; n <= nEndNd; ++n)
{
SwNode *const pNd = rPam.GetDoc()->GetNodes()[ n ];
switch (pNd->GetNodeType())
@@ -465,7 +466,7 @@ public:
/// embedded tables.
SwStartNode const*const m_pOwnStartNode;
SwTable const*const m_pOwnTable;
- const ULONG m_nEndIndex;
+ const sal_uLong m_nEndIndex;
sal_Int32 m_nFirstParaStart;
sal_Int32 m_nLastParaEnd;
bool m_bFirstParagraph;
@@ -889,7 +890,7 @@ throw (uno::RuntimeException)
if (GetPositions(aCursor))
{
UnoActionContext aAction(& m_pImpl->m_rDoc);
- m_pImpl->m_rDoc.StartUndo(UNDO_INSERT, NULL);
+ m_pImpl->m_rDoc.GetIDocumentUndoRedo().StartUndo(UNDO_INSERT, NULL);
if (aCursor.HasMark())
{
m_pImpl->m_rDoc.DeleteAndJoin(aCursor);
@@ -901,10 +902,10 @@ throw (uno::RuntimeException)
m_pImpl->m_rDoc, aCursor, rText, bForceExpandHints);
SwUnoCursorHelper::SelectPam(aCursor, true);
- aCursor.Left(rText.getLength(), CRSR_SKIP_CHARS, FALSE, FALSE);
+ aCursor.Left(rText.getLength(), CRSR_SKIP_CHARS, sal_False, sal_False);
}
SetPositions(aCursor);
- m_pImpl->m_rDoc.EndUndo(UNDO_INSERT, NULL);
+ m_pImpl->m_rDoc.GetIDocumentUndoRedo().EndUndo(UNDO_INSERT, NULL);
}
}
@@ -1157,7 +1158,7 @@ lcl_IsStartNodeInFormat(const bool bHeader, SwStartNode *const pSttNode,
const SfxItemSet& rSet = pFrmFmt->GetAttrSet();
const SfxPoolItem* pItem;
if (SFX_ITEM_SET == rSet.GetItemState(
- static_cast<USHORT>(bHeader ? RES_HEADER : RES_FOOTER),
+ static_cast<sal_uInt16>(bHeader ? RES_HEADER : RES_FOOTER),
sal_True, &pItem))
{
SfxPoolItem *const pItemNonConst(const_cast<SfxPoolItem *>(pItem));
@@ -1325,7 +1326,7 @@ throw (uno::RuntimeException)
}
const SwPosition aPos(GetDoc()->GetNodes().GetEndOfContent());
const ::std::auto_ptr<SwUnoCrsr> pNewCrsr(
- m_pImpl->m_rDoc.CreateUnoCrsr(aPos, FALSE));
+ m_pImpl->m_rDoc.CreateUnoCrsr(aPos, sal_False));
if (!GetPositions(*pNewCrsr))
{
throw uno::RuntimeException();
@@ -1347,7 +1348,7 @@ SwXTextRange::createEnumeration() throw (uno::RuntimeException)
}
const SwPosition aPos(GetDoc()->GetNodes().GetEndOfContent());
::std::auto_ptr<SwUnoCrsr> pNewCrsr(
- m_pImpl->m_rDoc.CreateUnoCrsr(aPos, FALSE));
+ m_pImpl->m_rDoc.CreateUnoCrsr(aPos, sal_False));
if (!GetPositions(*pNewCrsr))
{
throw uno::RuntimeException();
@@ -1721,7 +1722,7 @@ void SwUnoCursorHelper::SetString(SwCursor & rCursor, const OUString& rString)
// Start/EndAction
SwDoc *const pDoc = rCursor.GetDoc();
UnoActionContext aAction(pDoc);
- pDoc->StartUndo(UNDO_INSERT, NULL);
+ pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_INSERT, NULL);
if (rCursor.HasMark())
{
pDoc->DeleteAndJoin(rCursor);
@@ -1734,9 +1735,9 @@ void SwUnoCursorHelper::SetString(SwCursor & rCursor, const OUString& rString)
DBG_ASSERT( bSuccess, "DocInsertStringSplitCR" );
(void) bSuccess;
SwUnoCursorHelper::SelectPam(rCursor, true);
- rCursor.Left(rString.getLength(), CRSR_SKIP_CHARS, FALSE, FALSE);
+ rCursor.Left(rString.getLength(), CRSR_SKIP_CHARS, sal_False, sal_False);
}
- pDoc->EndUndo(UNDO_INSERT, NULL);
+ pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_INSERT, NULL);
}
/******************************************************************
@@ -1891,7 +1892,7 @@ SwXParaFrameEnumeration::SwXParaFrameEnumeration(
SwPosFlyFrms aFlyFrms;
//get all frames that are bound at paragraph or at character
rPaM.GetDoc()->GetAllFlyFmts(aFlyFrms, m_pImpl->GetCursor());
- for(USHORT i = 0; i < aFlyFrms.Count(); i++)
+ for(sal_uInt16 i = 0; i < aFlyFrms.Count(); i++)
{
SwPosFlyFrm* pPosFly = aFlyFrms[i];
SwFrmFmt *const pFrmFmt =
@@ -1911,7 +1912,7 @@ SwXParaFrameEnumeration::SwXParaFrameEnumeration(
lcl_FillFrame(*m_pImpl.get(), *m_pImpl->GetCursor(),
m_pImpl->m_Frames);
m_pImpl->GetCursor()->Right(
- 1, CRSR_SKIP_CHARS, FALSE, FALSE);
+ 1, CRSR_SKIP_CHARS, sal_False, sal_False);
}
while (*m_pImpl->GetCursor()->GetPoint() <
*m_pImpl->GetCursor()->GetMark());
diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx
index e9cb5439fe2e..6557e7fc918d 100644
--- a/sw/source/core/unocore/unoparagraph.cxx
+++ b/sw/source/core/unocore/unoparagraph.cxx
@@ -612,7 +612,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
//SwNode& rTxtNode = pUnoCrsr->GetPoint()->nNode.GetNode();
//const SwAttrSet& rAttrSet = ((SwTxtNode&)rTxtNode).GetSwAttrSet();
- //USHORT nAttrCount = rAttrSet.Count();
+ //sal_uInt16 nAttrCount = rAttrSet.Count();
const sal_Int32 nProps = rPropertyNames.getLength();
const OUString *pProp = rPropertyNames.getConstArray();
@@ -847,7 +847,7 @@ throw (uno::RuntimeException)
---------------------------------------------------------------------------*/
bool ::sw::GetDefaultTextContentValue(
- uno::Any& rAny, const OUString& rPropertyName, USHORT nWID)
+ uno::Any& rAny, const OUString& rPropertyName, sal_uInt16 nWID)
{
if(!nWID)
{
@@ -858,7 +858,7 @@ bool ::sw::GetDefaultTextContentValue(
else if(rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_TEXT_WRAP)))
nWID = FN_UNO_TEXT_WRAP;
else
- return FALSE;
+ return sal_False;
}
switch(nWID)
@@ -873,9 +873,9 @@ bool ::sw::GetDefaultTextContentValue(
}
break;
default:
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
/*-- 11.12.98 08:12:50---------------------------------------------------
@@ -986,7 +986,7 @@ throw (beans::UnknownPropertyException)
break;
lcl_SwXParagraph_getPropertyStateDEFAULT:
default:
- if((*ppSet) && SFX_ITEM_SET == (*ppSet)->GetItemState(rEntry.nWID, FALSE))
+ if((*ppSet) && SFX_ITEM_SET == (*ppSet)->GetItemState(rEntry.nWID, sal_False))
eRet = beans::PropertyState_DIRECT_VALUE;
break;
}
diff --git a/sw/source/core/unocore/unoport.cxx b/sw/source/core/unocore/unoport.cxx
index 13014c512940..7e97a582dc8f 100644
--- a/sw/source/core/unocore/unoport.cxx
+++ b/sw/source/core/unocore/unoport.cxx
@@ -369,7 +369,7 @@ void SwXTextPortion::GetPropertyValue(
break;
case FN_UNO_IS_START:
{
- BOOL bStart = TRUE, bPut = TRUE;
+ sal_Bool bStart = sal_True, bPut = sal_True;
switch (m_ePortionType)
{
case PORTION_REFMARK_START:
@@ -386,10 +386,10 @@ void SwXTextPortion::GetPropertyValue(
case PORTION_REDLINE_END:
case PORTION_RUBY_END:
case PORTION_FIELD_END:
- bStart = FALSE;
+ bStart = sal_False;
break;
default:
- bPut = FALSE;
+ bPut = sal_False;
}
if(bPut)
rVal.setValue(&bStart, ::getBooleanCppuType());
@@ -411,7 +411,7 @@ void SwXTextPortion::GetPropertyValue(
break;
default:
beans::PropertyState eTemp;
- BOOL bDone = SwUnoCursorHelper::getCrsrPropertyValue(
+ sal_Bool bDone = SwUnoCursorHelper::getCrsrPropertyValue(
rEntry, *pUnoCrsr, &(rVal), eTemp );
if(!bDone)
{
diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx
index 0c633d3b8f0f..138f3d615ae2 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -86,24 +86,24 @@ static void lcl_CreatePortions(
namespace
{
- static const BYTE BKM_TYPE_START = 0;
- static const BYTE BKM_TYPE_END = 1;
- static const BYTE BKM_TYPE_START_END = 2;
+ static const sal_uInt8 BKM_TYPE_START = 0;
+ static const sal_uInt8 BKM_TYPE_END = 1;
+ static const sal_uInt8 BKM_TYPE_START_END = 2;
struct SwXBookmarkPortion_Impl
{
Reference<XTextContent> xBookmark;
- BYTE nBkmType;
+ sal_uInt8 nBkmType;
const SwPosition aPosition;
SwXBookmarkPortion_Impl(uno::Reference<text::XTextContent> const& xMark,
- const BYTE nType, SwPosition const& rPosition)
+ const sal_uInt8 nType, SwPosition const& rPosition)
: xBookmark ( xMark )
, nBkmType ( nType )
, aPosition ( rPosition )
{
}
- ULONG getIndex ()
+ sal_uLong getIndex ()
{
return aPosition.nContent.GetIndex();
}
@@ -160,7 +160,7 @@ namespace
const SwPosition& rStartPos = pBkmk->GetMarkStart();
if(rStartPos.nNode == nOwnNode)
{
- const BYTE nType = hasOther ? BKM_TYPE_START : BKM_TYPE_START_END;
+ const sal_uInt8 nType = hasOther ? BKM_TYPE_START : BKM_TYPE_START_END;
rBkmArr.insert(SwXBookmarkPortion_ImplSharedPtr(
new SwXBookmarkPortion_Impl(
SwXBookmark::CreateXBookmark(rDoc, *pBkmk),
@@ -356,7 +356,7 @@ lcl_ExportFieldMark(
ASSERT(pUnoCrsr->End()->nContent.GetIndex() == start,
"hmm --- why is this different");
- pUnoCrsr->Right(1, CRSR_SKIP_CHARS, FALSE, FALSE);
+ pUnoCrsr->Right(1, CRSR_SKIP_CHARS, sal_False, sal_False);
if ( *pUnoCrsr->GetMark() == *pUnoCrsr->GetPoint() )
{
ASSERT(false, "cannot move cursor?");
@@ -523,7 +523,7 @@ lcl_ExportBookmark(
TextRangeList_t & rPortions,
Reference<XText> const& xParent,
const SwUnoCrsr * const pUnoCrsr,
- SwXBookmarkPortion_ImplList& rBkmArr, const ULONG nIndex)
+ SwXBookmarkPortion_ImplList& rBkmArr, const sal_uLong nIndex)
{
for ( SwXBookmarkPortion_ImplList::iterator aIter = rBkmArr.begin(), aEnd = rBkmArr.end();
aIter != aEnd; )
@@ -565,7 +565,7 @@ lcl_ExportSoftPageBreak(
TextRangeList_t & rPortions,
Reference<XText> const& xParent,
const SwUnoCrsr * const pUnoCrsr,
- SwSoftPageBreakList& rBreakArr, const ULONG nIndex)
+ SwSoftPageBreakList& rBreakArr, const sal_uLong nIndex)
{
for ( SwSoftPageBreakList::iterator aIter = rBreakArr.begin(),
aEnd = rBreakArr.end();
@@ -607,7 +607,7 @@ struct SwXRedlinePortion_Impl
{
}
- ULONG getRealIndex ()
+ sal_uLong getRealIndex ()
{
return m_bStart ? m_pRedline->Start()->nContent.GetIndex()
: m_pRedline->End() ->nContent.GetIndex();
@@ -664,7 +664,7 @@ lcl_ExportHints(
SwTxtAttr * const pAttr = pHints->GetEnd(nEndIndex);
if (nNextEnd == nCurrentIndex)
{
- const USHORT nWhich( pAttr->Which() );
+ const sal_uInt16 nWhich( pAttr->Which() );
switch (nWhich)
{
case RES_TXTATR_TOXMARK:
@@ -740,7 +740,7 @@ lcl_ExportHints(
nCurrentIndex >= (nNextStart = (*pHints->GetStart(nStartIndex)->GetStart())))
{
SwTxtAttr * const pAttr = pHints->GetStart(nStartIndex);
- USHORT nAttrWhich = pAttr->Which();
+ sal_uInt16 nAttrWhich = pAttr->Which();
if (nNextStart == nCurrentIndex)
{
switch( nAttrWhich )
@@ -748,7 +748,7 @@ lcl_ExportHints(
case RES_TXTATR_FIELD:
if(!bRightMoveForbidden)
{
- pUnoCrsr->Right(1,CRSR_SKIP_CHARS,FALSE,FALSE);
+ pUnoCrsr->Right(1,CRSR_SKIP_CHARS,sal_False,sal_False);
if( *pUnoCrsr->GetMark() == *pUnoCrsr->GetPoint() )
break;
SwXTextPortion* pPortion;
@@ -762,7 +762,7 @@ lcl_ExportHints(
case RES_TXTATR_FLYCNT :
if(!bRightMoveForbidden)
{
- pUnoCrsr->Right(1,CRSR_SKIP_CHARS,FALSE,FALSE);
+ pUnoCrsr->Right(1,CRSR_SKIP_CHARS,sal_False,sal_False);
if( *pUnoCrsr->GetMark() == *pUnoCrsr->GetPoint() )
break; // Robust #i81708 content in covered cells
pUnoCrsr->Exchange();
@@ -774,7 +774,7 @@ lcl_ExportHints(
{
if(!bRightMoveForbidden)
{
- pUnoCrsr->Right(1,CRSR_SKIP_CHARS,FALSE,FALSE);
+ pUnoCrsr->Right(1,CRSR_SKIP_CHARS,sal_False,sal_False);
if( *pUnoCrsr->GetMark() == *pUnoCrsr->GetPoint() )
break;
SwXTextPortion* pPortion;
@@ -794,7 +794,7 @@ lcl_ExportHints(
{
if (bIsPoint)
{
- pUnoCrsr->Right(1,CRSR_SKIP_CHARS,FALSE,FALSE);
+ pUnoCrsr->Right(1,CRSR_SKIP_CHARS,sal_False,sal_False);
}
Reference<XTextRange> xTmp =
(RES_TXTATR_REFMARK == nAttrWhich)
@@ -804,7 +804,7 @@ lcl_ExportHints(
xParent, pUnoCrsr, *pAttr, false);
if (bIsPoint) // consume CH_TXTATR!
{
- pUnoCrsr->Normalize(FALSE);
+ pUnoCrsr->Normalize(sal_False);
pUnoCrsr->DeleteMark();
xRef = xTmp;
}
@@ -829,7 +829,7 @@ lcl_ExportHints(
{
if (!bRightMoveForbidden)
{
- pUnoCrsr->Right(1,CRSR_SKIP_CHARS,FALSE,FALSE);
+ pUnoCrsr->Right(1,CRSR_SKIP_CHARS,sal_False,sal_False);
o_rbCursorMoved = true;
// only if the end is included in selection!
if ((i_nEndPos < 0) ||
@@ -922,7 +922,7 @@ void lcl_MoveCursor( SwUnoCrsr * const pUnoCrsr,
if (nMovePos > nCurrentIndex)
{
// pUnoCrsr->Right(nMovePos - nCurrentIndex);
- pUnoCrsr->GetPoint()->nContent = static_cast<USHORT>(nMovePos);
+ pUnoCrsr->GetPoint()->nContent = static_cast<sal_uInt16>(nMovePos);
}
}
@@ -932,14 +932,14 @@ lcl_FillRedlineArray(SwDoc const & rDoc, SwUnoCrsr const & rUnoCrsr,
SwXRedlinePortion_ImplList& rRedArr )
{
const SwRedlineTbl& rRedTbl = rDoc.GetRedlineTbl();
- USHORT nRedTblCount = rRedTbl.Count();
+ sal_uInt16 nRedTblCount = rRedTbl.Count();
if ( nRedTblCount > 0 )
{
const SwPosition* pStart = rUnoCrsr.GetPoint();
const SwNodeIndex nOwnNode = pStart->nNode;
- for(USHORT nRed = 0; nRed < nRedTblCount; nRed++)
+ for(sal_uInt16 nRed = 0; nRed < nRedTblCount; nRed++)
{
const SwRedline* pRedline = rRedTbl[nRed];
const SwPosition* pRedStart = pRedline->Start();
@@ -973,7 +973,7 @@ lcl_ExportRedline(
TextRangeList_t & rPortions,
Reference<XText> const& xParent,
const SwUnoCrsr * const pUnoCrsr,
- SwXRedlinePortion_ImplList& rRedlineArr, const ULONG nIndex)
+ SwXRedlinePortion_ImplList& rRedlineArr, const sal_uLong nIndex)
{
// MTG: 23/11/05: We want this loop to iterate over all red lines in this
@@ -982,7 +982,7 @@ lcl_ExportRedline(
aIter != aEnd; )
{
SwXRedlinePortion_ImplSharedPtr pPtr = (*aIter );
- ULONG nRealIndex = pPtr->getRealIndex();
+ sal_uLong nRealIndex = pPtr->getRealIndex();
// MTG: 23/11/05: If there are elements before nIndex, remove them
if ( nIndex > nRealIndex )
rRedlineArr.erase ( aIter++ );
@@ -1010,7 +1010,7 @@ lcl_ExportBkmAndRedline(
SwXBookmarkPortion_ImplList& rBkmArr,
SwXRedlinePortion_ImplList& rRedlineArr,
SwSoftPageBreakList& rBreakArr,
- const ULONG nIndex)
+ const sal_uLong nIndex)
{
if (rBkmArr.size())
lcl_ExportBookmark(rPortions, xParent, pUnoCrsr, rBkmArr, nIndex);
@@ -1100,7 +1100,7 @@ lcl_CreatePortions(
GetTxt().Len()), "Incorrect start position" );
// ??? should this be i_nStartPos - current position ?
pUnoCrsr->Right(static_cast<xub_StrLen>(i_nStartPos),
- CRSR_SKIP_CHARS, FALSE, FALSE);
+ CRSR_SKIP_CHARS, sal_False, sal_False);
}
FieldMarks_t FieldMarks;
@@ -1122,7 +1122,7 @@ lcl_CreatePortions(
{
if (pUnoCrsr->HasMark())
{
- pUnoCrsr->Normalize(FALSE);
+ pUnoCrsr->Normalize(sal_False);
pUnoCrsr->DeleteMark();
}
diff --git a/sw/source/core/unocore/unoprnms.cxx b/sw/source/core/unocore/unoprnms.cxx
index 049ccfe42ed7..7b8e1fc8dadb 100644
--- a/sw/source/core/unocore/unoprnms.cxx
+++ b/sw/source/core/unocore/unoprnms.cxx
@@ -779,13 +779,14 @@ const SwPropNameTab aPropNameTab = {
/* 0737 UNO_NAME_DESCRIPTION */ {MAP_CHAR_LEN("Description")},
/* 0738 UNO_NAME_META */ {MAP_CHAR_LEN("InContentMetadata")},
/* 0739 UNO_NAME_NESTED_TEXT_CONTENT */ {MAP_CHAR_LEN("NestedTextContent")},
+/* 0740 UNO_NAME_EMBEDDED_OBJECT */ {MAP_CHAR_LEN("EmbeddedObject")},
};
-const SwPropNameLen& SwGetPropName( USHORT nId )
+const SwPropNameLen& SwGetPropName( sal_uInt16 nId )
{
return GetPropName( nId );
}
-const SwPropNameLen& GetPropName( USHORT nId )
+const SwPropNameLen& GetPropName( sal_uInt16 nId )
{
DBG_ASSERT( SW_PROPNAME_BEGIN <= nId && nId < SW_PROPNAME_END,
"GetPropName(): Wrong index" );
diff --git a/sw/source/core/unocore/unoredline.cxx b/sw/source/core/unocore/unoredline.cxx
index 060d280eddc9..4eb142d01c9e 100644
--- a/sw/source/core/unocore/unoredline.cxx
+++ b/sw/source/core/unocore/unoredline.cxx
@@ -196,7 +196,7 @@ sal_Bool SwXRedlineText::hasElements( ) throw(uno::RuntimeException)
SwXRedlinePortion::SwXRedlinePortion( const SwRedline* pRed,
const SwUnoCrsr* pPortionCrsr,
- uno::Reference< text::XText > xParent, BOOL bStart) :
+ uno::Reference< text::XText > xParent, sal_Bool bStart) :
SwXTextPortion(pPortionCrsr, xParent, bStart ? PORTION_REDLINE_START : PORTION_REDLINE_END),
// SwXText(pPortionCrsr->GetDoc(), CURSOR_REDLINE),
// SwXRedlineText(pPortionCrsr->GetDoc(), *pRed->GetContentIdx()),
@@ -300,8 +300,8 @@ void SwXRedlinePortion::Validate() throw( uno::RuntimeException )
//search for the redline
SwDoc* pDoc = pUnoCrsr->GetDoc();
const SwRedlineTbl& rRedTbl = pDoc->GetRedlineTbl();
- sal_Bool bFound = FALSE;
- for(USHORT nRed = 0; nRed < rRedTbl.Count() && !bFound; nRed++)
+ sal_Bool bFound = sal_False;
+ for(sal_uInt16 nRed = 0; nRed < rRedTbl.Count() && !bFound; nRed++)
bFound = pRedline == rRedTbl[nRed];
if(!bFound)
throw uno::RuntimeException();
@@ -511,14 +511,14 @@ uno::Any SwXRedline::getPropertyValue( const OUString& rPropertyName )
if(!pDoc)
throw uno::RuntimeException();
uno::Any aRet;
- BOOL bStart = rPropertyName.equalsAsciiL(SW_PROP_NAME(UNO_NAME_REDLINE_START));
+ sal_Bool bStart = rPropertyName.equalsAsciiL(SW_PROP_NAME(UNO_NAME_REDLINE_START));
if(bStart ||
rPropertyName.equalsAsciiL(SW_PROP_NAME(UNO_NAME_REDLINE_END)))
{
uno::Reference<XInterface> xRet;
SwNode* pNode = pRedline->GetNode();
if(!bStart && pRedline->HasMark())
- pNode = pRedline->GetNode(FALSE);
+ pNode = pRedline->GetNode(sal_False);
switch(pNode->GetNodeType())
{
case ND_SECTIONNODE:
diff --git a/sw/source/core/unocore/unoredlines.cxx b/sw/source/core/unocore/unoredlines.cxx
index 2cb95a75835d..9061d6b9af5d 100644
--- a/sw/source/core/unocore/unoredlines.cxx
+++ b/sw/source/core/unocore/unoredlines.cxx
@@ -75,7 +75,7 @@ uno::Any SwXRedlines::getByIndex(sal_Int32 nIndex)
uno::Any aRet;
if(rRedTbl.Count() > nIndex && nIndex >= 0)
{
- uno::Reference <beans::XPropertySet> xRet = SwXRedlines::GetObject( *rRedTbl.GetObject((USHORT)nIndex), *GetDoc() );
+ uno::Reference <beans::XPropertySet> xRet = SwXRedlines::GetObject( *rRedTbl.GetObject((sal_uInt16)nIndex), *GetDoc() );
aRet <<= xRet;
}
else
@@ -111,11 +111,16 @@ OUString SwXRedlines::getImplementationName(void) throw( uno::RuntimeException )
return C2U("SwXRedlines");
}
+<<<<<<< local
BOOL SwXRedlines::supportsService(const rtl::OUString& /*ServiceName*/)
+=======
+ -----------------------------------------------------------------------*/
+sal_Bool SwXRedlines::supportsService(const rtl::OUString& /*ServiceName*/)
+>>>>>>> other
throw( uno::RuntimeException )
{
DBG_ERROR("not implemented");
- return FALSE;
+ return sal_False;
}
uno::Sequence< OUString > SwXRedlines::getSupportedServiceNames(void)
@@ -152,7 +157,12 @@ SwXRedlineEnumeration::~SwXRedlineEnumeration()
{
}
+<<<<<<< local
BOOL SwXRedlineEnumeration::hasMoreElements(void) throw( uno::RuntimeException )
+=======
+ -----------------------------------------------------------------------*/
+sal_Bool SwXRedlineEnumeration::hasMoreElements(void) throw( uno::RuntimeException )
+>>>>>>> other
{
if(!pDoc)
throw uno::RuntimeException();
@@ -178,9 +188,14 @@ rtl::OUString SwXRedlineEnumeration::getImplementationName(void) throw( uno::Run
return C2U("SwXRedlineEnumeration");
}
+<<<<<<< local
BOOL SwXRedlineEnumeration::supportsService(const rtl::OUString& /*ServiceName*/) throw( uno::RuntimeException )
+=======
+ -----------------------------------------------------------------------*/
+sal_Bool SwXRedlineEnumeration::supportsService(const rtl::OUString& /*ServiceName*/) throw( uno::RuntimeException )
+>>>>>>> other
{
- return FALSE;
+ return sal_False;
}
uno::Sequence< OUString > SwXRedlineEnumeration::getSupportedServiceNames(void) throw( uno::RuntimeException )
diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx
index ecc0c590d82f..eace03960692 100644
--- a/sw/source/core/unocore/unorefmk.cxx
+++ b/sw/source/core/unocore/unorefmk.cxx
@@ -1054,7 +1054,7 @@ SwXMeta::dispose() throw (uno::RuntimeException)
void SAL_CALL
SwXMeta::AttachImpl(const uno::Reference< text::XTextRange > & i_xTextRange,
- const USHORT i_nWhich)
+ const sal_uInt16 i_nWhich)
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
vos::OGuard g(Application::GetSolarMutex());
diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx
index 6cdd4aa0c981..b87754c28b3c 100644
--- a/sw/source/core/unocore/unosect.cxx
+++ b/sw/source/core/unocore/unosect.cxx
@@ -50,6 +50,7 @@
#include <unocrsr.hxx>
#include <section.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <docsh.hxx>
#include <sfx2/docfile.hxx>
#include <docary.hxx>
@@ -327,7 +328,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
//das muss jetzt sal_True liefern
::sw::XTextRangeToSwPaM(aPam, xTextRange);
UnoActionContext aCont(pDoc);
- pDoc->StartUndo( UNDO_INSSECTION, NULL );
+ pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_INSSECTION, NULL );
if (!m_pImpl->m_sName.getLength())
{
@@ -450,13 +451,13 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
{
pRet->CreateLink(CREATE_CONNECT);
}
- pRet->SetUpdateType( static_cast< USHORT >(
+ pRet->SetUpdateType( static_cast< sal_uInt16 >(
(m_pImpl->m_pProps->m_bUpdateType) ?
sfx2::LINKUPDATE_ALWAYS : sfx2::LINKUPDATE_ONCALL) );
}
// Undo-Klammerung hier beenden
- pDoc->EndUndo( UNDO_INSSECTION, NULL );
+ pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_INSSECTION, NULL );
m_pImpl->m_pProps.reset();
m_pImpl->m_bIsDescriptor = false;
}
@@ -560,7 +561,7 @@ lcl_UpdateLinkType(SwSection & rSection, bool const bLinkUpdateAlways = true)
{
rSection.CreateLink(CREATE_CONNECT);
}
- rSection.SetUpdateType( static_cast< USHORT >((bLinkUpdateAlways)
+ rSection.SetUpdateType( static_cast< sal_uInt16 >((bLinkUpdateAlways)
? sfx2::LINKUPDATE_ALWAYS : sfx2::LINKUPDATE_ONCALL) );
}
}
@@ -1217,11 +1218,11 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
}
const SwRedlineTbl& rRedTbl =
pFmt->GetDoc()->GetRedlineTbl();
- for (USHORT nRed = 0; nRed < rRedTbl.Count(); nRed++)
+ for (sal_uInt16 nRed = 0; nRed < rRedTbl.Count(); nRed++)
{
const SwRedline* pRedline = rRedTbl[nRed];
- SwNode const*const pRedPointNode = pRedline->GetNode(TRUE);
- SwNode const*const pRedMarkNode = pRedline->GetNode(FALSE);
+ SwNode const*const pRedPointNode = pRedline->GetNode(sal_True);
+ SwNode const*const pRedMarkNode = pRedline->GetNode(sal_False);
if ((pRedPointNode == pSectNode) ||
(pRedMarkNode == pSectNode))
{
diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx
index e72e48b4ade5..06607e70303a 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -310,7 +310,7 @@ OUString SwXFootnoteProperties::getImplementationName(void) throw( RuntimeExcept
/* -----------------------------06.04.00 11:43--------------------------------
---------------------------------------------------------------------------*/
-BOOL SwXFootnoteProperties::supportsService(const OUString& rServiceName) throw( RuntimeException )
+sal_Bool SwXFootnoteProperties::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return C2U("com.sun.star.text.FootnoteSettings") == rServiceName;
}
@@ -381,7 +381,7 @@ void SwXFootnoteProperties::setPropertyValue(const OUString& rPropertyName, cons
break;
case WID_NUMBERING_TYPE :
{
- INT16 nTmp = 0;
+ sal_Int16 nTmp = 0;
aValue >>= nTmp;
if(nTmp >= 0 &&
(nTmp <= SVX_NUM_ARABIC ||
@@ -393,14 +393,14 @@ void SwXFootnoteProperties::setPropertyValue(const OUString& rPropertyName, cons
break;
case WID_START_AT:
{
- INT16 nTmp = 0;
+ sal_Int16 nTmp = 0;
aValue >>= nTmp;
aFtnInfo.nFtnOffset = nTmp;
}
break;
case WID_FOOTNOTE_COUNTING :
{
- INT16 nTmp = 0;
+ sal_Int16 nTmp = 0;
aValue >>= nTmp;
switch(nTmp)
{
@@ -645,7 +645,7 @@ OUString SwXEndnoteProperties::getImplementationName(void) throw( RuntimeExcepti
/* -----------------------------06.04.00 11:45--------------------------------
---------------------------------------------------------------------------*/
-BOOL SwXEndnoteProperties::supportsService(const OUString& rServiceName) throw( RuntimeException )
+sal_Bool SwXEndnoteProperties::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return C2U("com.sun.star.text.FootnoteSettings") == rServiceName;
}
@@ -717,14 +717,14 @@ void SwXEndnoteProperties::setPropertyValue(const OUString& rPropertyName, const
break;
case WID_NUMBERING_TYPE :
{
- INT16 nTmp = 0;
+ sal_Int16 nTmp = 0;
aValue >>= nTmp;
aEndInfo.aFmt.SetNumberingType(nTmp);
}
break;
case WID_START_AT:
{
- INT16 nTmp = 0;
+ sal_Int16 nTmp = 0;
aValue >>= nTmp;
aEndInfo.nFtnOffset = nTmp;
}
@@ -900,7 +900,7 @@ OUString SwXLineNumberingProperties::getImplementationName(void) throw( RuntimeE
/* -----------------------------06.04.00 11:47--------------------------------
---------------------------------------------------------------------------*/
-BOOL SwXLineNumberingProperties::supportsService(const OUString& rServiceName) throw( RuntimeException )
+sal_Bool SwXLineNumberingProperties::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return C2U("com.sun.star.text.LineNumberingProperties") == rServiceName;
}
@@ -973,7 +973,7 @@ void SwXLineNumberingProperties::setPropertyValue(
case WID_NUMBERING_TYPE :
{
SvxNumberType aNumType(aInfo.GetNumType());
- INT16 nTmp = 0;
+ sal_Int16 nTmp = 0;
aValue >>= nTmp;
aNumType.SetNumberingType(nTmp);
aInfo.SetNumType(aNumType);
@@ -981,7 +981,7 @@ void SwXLineNumberingProperties::setPropertyValue(
break;
case WID_NUMBER_POSITION :
{
- INT16 nTmp = 0;
+ sal_Int16 nTmp = 0;
aValue >>= nTmp;
switch(nTmp)
{
@@ -1002,17 +1002,17 @@ void SwXLineNumberingProperties::setPropertyValue(
break;
case WID_DISTANCE :
{
- INT32 nVal = 0;
+ sal_Int32 nVal = 0;
aValue >>= nVal;
- INT32 nTmp = MM100_TO_TWIP(nVal);
+ sal_Int32 nTmp = MM100_TO_TWIP(nVal);
if (nTmp > USHRT_MAX)
nTmp = USHRT_MAX;
- aInfo.SetPosFromLeft( static_cast< USHORT >(nTmp) );
+ aInfo.SetPosFromLeft( static_cast< sal_uInt16 >(nTmp) );
}
break;
case WID_INTERVAL :
{
- INT16 nTmp = 0;
+ sal_Int16 nTmp = 0;
aValue >>= nTmp;
if( nTmp > 0)
aInfo.SetCountBy(nTmp);
@@ -1027,7 +1027,7 @@ void SwXLineNumberingProperties::setPropertyValue(
break;
case WID_SEPARATOR_INTERVAL:
{
- INT16 nTmp = 0;
+ sal_Int16 nTmp = 0;
aValue >>= nTmp;
if( nTmp >= 0)
aInfo.SetDividerCountBy(nTmp);
@@ -1237,7 +1237,7 @@ OUString SwXNumberingRules::getImplementationName(void) throw( RuntimeException
/* -----------------------------06.04.00 11:47--------------------------------
---------------------------------------------------------------------------*/
-BOOL SwXNumberingRules::supportsService(const OUString& rServiceName) throw( RuntimeException )
+sal_Bool SwXNumberingRules::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return C2U("com.sun.star.text.NumberingRules") == rServiceName;
}
@@ -1260,7 +1260,7 @@ SwXNumberingRules::SwXNumberingRules(const SwNumRule& rRule) :
pDocShell(0),
pNumRule(new SwNumRule(rRule)),
m_pPropertySet(GetNumberingRulesSet()),
- bOwnNumRuleCreated(TRUE)
+ bOwnNumRuleCreated(sal_True)
{
sal_uInt16 i;
@@ -1292,7 +1292,7 @@ SwXNumberingRules::SwXNumberingRules(SwDocShell& rDocSh) :
pDocShell(&rDocSh),
pNumRule(0),
m_pPropertySet(GetNumberingRulesSet()),
- bOwnNumRuleCreated(FALSE)
+ bOwnNumRuleCreated(sal_False)
{
pDocShell->GetDoc()->GetPageDescFromPool(RES_POOLPAGE_STANDARD)->Add(this);
}
@@ -1304,7 +1304,7 @@ SwXNumberingRules::SwXNumberingRules(SwDoc& rDoc) :
pDocShell(0),
pNumRule(0),
m_pPropertySet(GetNumberingRulesSet()),
- bOwnNumRuleCreated(FALSE)
+ bOwnNumRuleCreated(sal_False)
{
rDoc.GetPageDescFromPool(RES_POOLPAGE_STANDARD)->Add(this);
sCreatedNumRuleName = rDoc.GetUniqueNumRuleName();
@@ -1312,7 +1312,7 @@ SwXNumberingRules::SwXNumberingRules(SwDoc& rDoc) :
sal_uInt16 nIndex =
#endif
// --> OD 2008-02-11 #newlistlevelattrs#
- rDoc.MakeNumRule( sCreatedNumRuleName, 0, FALSE,
+ rDoc.MakeNumRule( sCreatedNumRuleName, 0, sal_False,
// --> OD 2008-06-06 #i89178#
numfunc::GetDefaultPositionAndSpaceMode() );
// <--
@@ -1822,7 +1822,7 @@ void SwXNumberingRules::SetNumberingRuleByIndex(
SvxBrushItem* pSetBrush = 0;
Size* pSetSize = 0;
SwFmtVertOrient* pSetVOrient = 0;
- BOOL bCharStyleNameSet = FALSE;
+ sal_Bool bCharStyleNameSet = sal_False;
for(sal_uInt16 i = 0; i < nPropNameCount && !bExcept && !bWrongArg; i++)
{
@@ -1850,7 +1850,7 @@ void SwXNumberingRules::SetNumberingRuleByIndex(
sal_Int16 nSet = 0;
pData->aVal >>= nSet;
if(nSet >= 0 && MAXLEVEL >= nSet)
- aFmt.SetIncludeUpperLevels( static_cast< BYTE >(nSet) );
+ aFmt.SetIncludeUpperLevels( static_cast< sal_uInt8 >(nSet) );
}
break;
case 2: //"Prefix",
@@ -1869,7 +1869,7 @@ void SwXNumberingRules::SetNumberingRuleByIndex(
break;
case 4: //"CharStyleName",
{
- bCharStyleNameSet = TRUE;
+ bCharStyleNameSet = sal_True;
OUString uTmp;
pData->aVal >>= uTmp;
String sCharFmtName;
@@ -1921,7 +1921,7 @@ void SwXNumberingRules::SetNumberingRuleByIndex(
break;
case 5: //"StartWith",
{
- INT16 nVal = 0;
+ sal_Int16 nVal = 0;
pData->aVal >>= nVal;
aFmt.SetStart(nVal);
}
@@ -2282,13 +2282,13 @@ void SwXNumberingRules::setPropertyValue( const OUString& rPropertyName, const A
if(rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_IS_AUTOMATIC)))
{
- BOOL bVal = *(sal_Bool*)rValue.getValue();
+ sal_Bool bVal = *(sal_Bool*)rValue.getValue();
if(!pCreatedRule)
pDocRule ? pDocRule->SetAutoRule(bVal) : pNumRule->SetAutoRule(bVal);
}
else if(rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_IS_CONTINUOUS_NUMBERING)))
{
- BOOL bVal = *(sal_Bool*)rValue.getValue();
+ sal_Bool bVal = *(sal_Bool*)rValue.getValue();
pDocRule ? pDocRule->SetContinusNum(bVal) :
pCreatedRule ? pCreatedRule->SetContinusNum(bVal) : pNumRule->SetContinusNum(bVal);
}
@@ -2299,13 +2299,13 @@ void SwXNumberingRules::setPropertyValue( const OUString& rPropertyName, const A
}
else if(rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_IS_ABSOLUTE_MARGINS)))
{
- BOOL bVal = *(sal_Bool*)rValue.getValue();
+ sal_Bool bVal = *(sal_Bool*)rValue.getValue();
pDocRule ? pDocRule->SetAbsSpaces(bVal) :
pCreatedRule ? pCreatedRule->SetAbsSpaces(bVal) : pNumRule->SetAbsSpaces(bVal);
}
else if(rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_NUMBERING_IS_OUTLINE)))
{
- BOOL bVal = *(sal_Bool*)rValue.getValue();
+ sal_Bool bVal = *(sal_Bool*)rValue.getValue();
SwNumRuleType eNumRuleType = bVal ? OUTLINE_RULE : NUM_RULE;
pDocRule ? pDocRule->SetRuleType(eNumRuleType) :
pCreatedRule ? pCreatedRule->SetRuleType(eNumRuleType) : pNumRule->SetRuleType(eNumRuleType);
@@ -2347,24 +2347,24 @@ Any SwXNumberingRules::getPropertyValue( const OUString& rPropertyName )
if(rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_IS_AUTOMATIC)))
{
- BOOL bVal = pRule->IsAutoRule();
+ sal_Bool bVal = pRule->IsAutoRule();
aRet.setValue(&bVal, ::getBooleanCppuType());
}
else if(rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_IS_CONTINUOUS_NUMBERING)))
{
- BOOL bVal = pRule->IsContinusNum();
+ sal_Bool bVal = pRule->IsContinusNum();
aRet.setValue(&bVal, ::getBooleanCppuType());
}
else if(rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_NAME)))
aRet <<= OUString(pRule->GetName());
else if(rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_IS_ABSOLUTE_MARGINS)))
{
- BOOL bVal = pRule->IsAbsSpaces();
+ sal_Bool bVal = pRule->IsAbsSpaces();
aRet.setValue(&bVal, ::getBooleanCppuType());
}
else if(rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_NUMBERING_IS_OUTLINE)))
{
- BOOL bVal = pRule->IsOutlineRule();
+ sal_Bool bVal = pRule->IsOutlineRule();
aRet.setValue(&bVal, ::getBooleanCppuType());
}
// --> OD 2008-04-23 #refactorlists#
@@ -2466,7 +2466,7 @@ OUString SwXChapterNumbering::getImplementationName(void) throw( RuntimeExceptio
/* -----------------------------06.04.00 11:47--------------------------------
---------------------------------------------------------------------------*/
-BOOL SwXChapterNumbering::supportsService(const OUString& rServiceName) throw( RuntimeException )
+sal_Bool SwXChapterNumbering::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
String sServiceName(rServiceName);
return sServiceName.EqualsAscii("com.sun.star.text.ChapterNumbering") ||
@@ -2510,7 +2510,7 @@ OUString SwXTextColumns::getImplementationName(void) throw( RuntimeException )
/* -----------------------------06.04.00 11:47--------------------------------
---------------------------------------------------------------------------*/
-BOOL SwXTextColumns::supportsService(const OUString& rServiceName) throw( RuntimeException )
+sal_Bool SwXTextColumns::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return C2U("com.sun.star.text.TextColumns") == rServiceName;
}
@@ -2550,7 +2550,7 @@ SwXTextColumns::SwXTextColumns(const SwFmtCol& rFmtCol) :
bIsAutomaticWidth(rFmtCol.IsOrtho()),
m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_COLUMS))
{
- USHORT nItemGutterWidth = rFmtCol.GetGutterWidth();
+ sal_uInt16 nItemGutterWidth = rFmtCol.GetGutterWidth();
nAutoDistance = bIsAutomaticWidth ?
USHRT_MAX == nItemGutterWidth ? DEF_GUTTER_WIDTH : (sal_Int32)nItemGutterWidth
: 0;
diff --git a/sw/source/core/unocore/unosrch.cxx b/sw/source/core/unocore/unosrch.cxx
index 27eadadc6633..0283773062ec 100644
--- a/sw/source/core/unocore/unosrch.cxx
+++ b/sw/source/core/unocore/unosrch.cxx
@@ -596,7 +596,7 @@ void SwXTextSearch::setPropertyValue(const OUString& rPropertyName, const uno::A
{
if ( pEntry->nFlags & beans::PropertyAttribute::READONLY)
throw beans::PropertyVetoException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
- sal_Bool bVal = FALSE;
+ sal_Bool bVal = sal_False;
if(aValue.getValueType() == ::getBooleanCppuType())
bVal = *(sal_Bool*)aValue.getValue();
switch(pEntry->nWID)
@@ -770,7 +770,7 @@ OUString SwXTextSearch::getImplementationName(void) throw( uno::RuntimeException
/* -----------------------------19.04.00 14:43--------------------------------
---------------------------------------------------------------------------*/
-BOOL SwXTextSearch::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
+sal_Bool SwXTextSearch::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return C2U("com.sun.star.util.SearchDescriptor") == rServiceName ||
C2U("com.sun.star.util.ReplaceDescriptor") == rServiceName;
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index cb2365e48cd7..8a784aa5268d 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -47,6 +47,7 @@
#include <editeng/paperinf.hxx>
#include <pagedesc.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <docary.hxx>
#include <charfmt.hxx>
#include <cmdid.h>
@@ -207,7 +208,7 @@ OUString SwXStyleFamilies::getImplementationName(void) throw( uno::RuntimeExcept
/* -----------------------------06.04.00 11:24--------------------------------
---------------------------------------------------------------------------*/
-BOOL SwXStyleFamilies::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
+sal_Bool SwXStyleFamilies::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return C2U("com.sun.star.style.StyleFamilies") == rServiceName;
}
@@ -441,7 +442,7 @@ void SwXStyleFamilies::loadStylesFromURL(const OUString& rURL,
aOpt.SetNumRules( bLoadStyleNumbering );
aOpt.SetMerge( !bLoadStyleOverwrite );
- ULONG nErr = pDocShell->LoadStylesFromFile( rURL, aOpt, TRUE );
+ sal_uLong nErr = pDocShell->LoadStylesFromFile( rURL, aOpt, sal_True );
if( nErr )
throw io::IOException();
}
@@ -485,7 +486,7 @@ OUString SwXStyleFamily::getImplementationName(void) throw( uno::RuntimeExceptio
/* -----------------------------06.04.00 11:24--------------------------------
---------------------------------------------------------------------------*/
-BOOL SwXStyleFamily::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
+sal_Bool SwXStyleFamily::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return C2U("com.sun.star.style.StyleFamily") == rServiceName;
}
@@ -648,7 +649,7 @@ sal_Int32 lcl_GetCountOrName ( const SwDoc &rDoc, SfxStyleFamily eFamily, String
sal_uInt16 nBaseCount = RES_POOLNUMRULE_END - RES_POOLNUMRULE_BEGIN;
nIndex = nIndex - nBaseCount;
const SwNumRuleTbl& rNumTbl = rDoc.GetNumRuleTbl();
- for(USHORT i = 0; i < rNumTbl.Count(); ++i)
+ for(sal_uInt16 i = 0; i < rNumTbl.Count(); ++i)
{
const SwNumRule& rRule = *rNumTbl[ i ];
if( rRule.IsAutoRule() )
@@ -1303,9 +1304,9 @@ OUString SwXStyle::getImplementationName(void) throw( uno::RuntimeException )
/* -----------------------------06.04.00 11:24--------------------------------
---------------------------------------------------------------------------*/
-BOOL SwXStyle::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
+sal_Bool SwXStyle::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
- BOOL bRet = C2U("com.sun.star.style.Style") == rServiceName;
+ sal_Bool bRet = C2U("com.sun.star.style.Style") == rServiceName;
if(!bRet && SFX_STYLE_FAMILY_CHAR == eFamily)
bRet = !rServiceName.compareToAscii("com.sun.star.style.CharacterStyle")||
!rServiceName.compareToAscii("com.sun.star.style.CharacterProperties")||
@@ -1370,7 +1371,7 @@ uno::Sequence< OUString > SwXStyle::getSupportedServiceNames(void) throw( uno::R
/*-- 17.12.98 08:26:49---------------------------------------------------
-----------------------------------------------------------------------*/
-SwXStyle::SwXStyle( SwDoc *pDoc, SfxStyleFamily eFam, BOOL bConditional) :
+SwXStyle::SwXStyle( SwDoc *pDoc, SfxStyleFamily eFam, sal_Bool bConditional) :
m_pDoc( pDoc ),
pBasePool(0),
eFamily(eFam),
@@ -1599,7 +1600,7 @@ void SwXStyle::setParentStyle(const OUString& rParentStyle)
if(pBasePool)
{
pBasePool->SetSearchMask(eFamily);
- BOOL bExcept = FALSE;
+ sal_Bool bExcept = sal_False;
SfxStyleSheetBase* pBase = pBasePool->Find(sStyleName);
if(pBase)
{
@@ -1612,7 +1613,7 @@ void SwXStyle::setParentStyle(const OUString& rParentStyle)
}
}
else
- bExcept = TRUE;
+ bExcept = sal_True;
if(bExcept)
throw uno::RuntimeException();
}
@@ -2026,7 +2027,7 @@ void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
break;
case FN_UNO_IS_AUTO_UPDATE:
{
- BOOL bAuto = *(sal_Bool*)rValue.getValue();
+ sal_Bool bAuto = *(sal_Bool*)rValue.getValue();
if(SFX_STYLE_FAMILY_PARA == eFamily)
rBase.mxNewBase->GetCollection()->SetAutoUpdateFmt(bAuto);
else if(SFX_STYLE_FAMILY_FRAME == eFamily)
@@ -2046,7 +2047,7 @@ void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
sal_Bool bFailed = sal_False;
SwCondCollItem aCondItem;
- for(USHORT i = 0; i < nLen; i++)
+ for(sal_uInt16 i = 0; i < nLen; i++)
{
OUString aTmp;
if ((pSeq[i].Value >>= aTmp))
@@ -2329,7 +2330,7 @@ uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
uno::Any aRet;
if(FN_UNO_IS_PHYSICAL == rEntry.nWID)
{
- BOOL bPhys = pBase != 0;
+ sal_Bool bPhys = pBase != 0;
if(pBase)
{
bPhys = ((SwDocStyleSheet*)pBase)->IsPhysical();
@@ -2337,7 +2338,7 @@ uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
if( bPhys && SFX_STYLE_FAMILY_CHAR == eFamily &&
((SwDocStyleSheet*)pBase)->GetCharFmt() &&
((SwDocStyleSheet*)pBase)->GetCharFmt()->IsDefault() )
- bPhys = FALSE;
+ bPhys = sal_False;
}
aRet.setValue(&bPhys, ::getBooleanCppuType());
}
@@ -2376,7 +2377,7 @@ uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
//case FN_UNO_DEFAULT_OUTLINE_LEVEL: //#outline level,removed by zahojianwei
//{
// DBG_ASSERT( SFX_STYLE_FAMILY_PARA == eFamily, "only paras" );
- // BYTE nLevel = rBase.mxNewBase->GetCollection()->GetOutlineLevel();
+ // sal_uInt8 nLevel = rBase.mxNewBase->GetCollection()->GetOutlineLevel();
// if( nLevel != NO_NUMBERING )
// aRet <<= static_cast<sal_Int8>( nLevel );
//}
@@ -2415,7 +2416,7 @@ uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
break;
case FN_UNO_IS_AUTO_UPDATE:
{
- BOOL bAuto = FALSE;
+ sal_Bool bAuto = sal_False;
if(SFX_STYLE_FAMILY_PARA == eFamily)
bAuto = rBase.mxNewBase->GetCollection()->IsAutoUpdateFmt();
else if(SFX_STYLE_FAMILY_FRAME == eFamily)
@@ -2439,7 +2440,7 @@ uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
SwFmt *pFmt = ((SwDocStyleSheet*)pBase)->GetCollection();
const CommandStruct *pCmds = SwCondCollItem::GetCmds();
- for (USHORT n = 0; n < COND_COMMAND_COUNT; ++n)
+ for (sal_uInt16 n = 0; n < COND_COMMAND_COUNT; ++n)
{
String aStyleName;
@@ -2795,7 +2796,7 @@ uno::Sequence< beans::PropertyState > SwXStyle::getPropertyStates(
|| rPropName.EqualsAscii("Footer", 0, 6)))
{
sal_uInt16 nResId = lcl_ConvertFNToRES(pEntry->nWID);
- BOOL bFooter = rPropName.EqualsAscii("Footer", 0, 6);
+ sal_Bool bFooter = rPropName.EqualsAscii("Footer", 0, 6);
const SvxSetItem* pSetItem;
if(SFX_ITEM_SET == aSet.GetItemState(
bFooter ? SID_ATTR_PAGE_FOOTERSET : SID_ATTR_PAGE_HEADERSET,
@@ -3397,15 +3398,13 @@ void SAL_CALL SwXPageStyle::SetPropertyValues_Impl(
}
if(aBaseImpl.HasItemSet())
{
- BOOL bDoesUndo = GetDoc()->DoesUndo();
- if( bDoesUndo )
+ ::sw::UndoGuard const undoGuard(GetDoc()->GetIDocumentUndoRedo());
+ if (undoGuard.UndoWasEnabled())
{
// Fix i64460: as long as Undo of page styles with header/footer causes trouble...
- GetDoc()->DelAllUndoObj();
- GetDoc()->DoUndo( FALSE );
+ GetDoc()->GetIDocumentUndoRedo().DelAllUndoObj();
}
aBaseImpl.mxNewBase->SetItemSet(aBaseImpl.GetItemSet());
- GetDoc()->DoUndo( bDoesUndo );
}
}
@@ -3530,7 +3529,7 @@ uno::Sequence< uno::Any > SAL_CALL SwXPageStyle::GetPropertyValues_Impl(
case FN_UNO_HEADER_ON:
{
//falls das SetItem nicht da ist, dann ist der Wert sal_False
- BOOL bRet = sal_False;
+ sal_Bool bRet = sal_False;
pRet[nProp].setValue(&bRet, ::getCppuBooleanType());
nRes = SID_ATTR_PAGE_ON;
}
@@ -3710,7 +3709,7 @@ void SwXPageStyle::setPropertyValue(const OUString& rPropertyName, const uno::An
}
SwXFrameStyle::SwXFrameStyle ( SwDoc *pDoc )
-: SwXStyle ( pDoc, SFX_STYLE_FAMILY_FRAME, FALSE)
+: SwXStyle ( pDoc, SFX_STYLE_FAMILY_FRAME, sal_False)
{
}
/* -----------------------------15.12.00 15:45--------------------------------
@@ -3907,7 +3906,7 @@ uno::Reference< style::XAutoStyle > SwXAutoStyleFamily::insertStyle(
{
if( !pDocShell )
throw uno::RuntimeException();
- const USHORT* pRange = 0;
+ const sal_uInt16* pRange = 0;
const SfxItemPropertySet* pPropSet = 0;
switch( eFamily )
{
@@ -3991,7 +3990,7 @@ SwAutoStylesEnumImpl::SwAutoStylesEnumImpl( SwDoc* pInitDoc, IStyleAccess::SwAut
// special case for ruby auto styles:
if ( IStyleAccess::AUTO_STYLE_RUBY == eFam )
{
- std::set< std::pair< USHORT, USHORT > > aRubyMap;
+ std::set< std::pair< sal_uInt16, sal_uInt16 > > aRubyMap;
SwAttrPool& rAttrPool = pDoc->GetAttrPool();
sal_uInt32 nCount = rAttrPool.GetItemCount2( RES_TXTATR_CJK_RUBY );
@@ -4000,7 +3999,7 @@ SwAutoStylesEnumImpl::SwAutoStylesEnumImpl( SwDoc* pInitDoc, IStyleAccess::SwAut
const SwFmtRuby* pItem = static_cast<const SwFmtRuby*>(rAttrPool.GetItem2( RES_TXTATR_CJK_RUBY, nI ));
if ( pItem && pItem->GetTxtRuby() )
{
- std::pair< USHORT, USHORT > aPair( pItem->GetPosition(), pItem->GetAdjustment() );
+ std::pair< sal_uInt16, sal_uInt16 > aPair( pItem->GetPosition(), pItem->GetAdjustment() );
if ( aRubyMap.find( aPair ) == aRubyMap.end() )
{
aRubyMap.insert( aPair );
@@ -4461,12 +4460,12 @@ uno::Sequence< beans::PropertyValue > SwXAutoStyle::getProperties() throw (uno::
PropertyEntryVector_t aPropVector = pMap->getPropertyEntries();
// struct compareWhichIds
// {
-// bool operator()(const USHORT w1, const USHORT w2) const
+// bool operator()(const sal_uInt16 w1, const sal_uInt16 w2) const
// {
// return w1 < w2;
// }
// };
-// typedef std::map<const USHORT, SfxItemPropertyNamedEntry, compareWhichIds> PropertyMap_t;
+// typedef std::map<const sal_uInt16, SfxItemPropertyNamedEntry, compareWhichIds> PropertyMap_t;
// PropertyMap_t aPropMap;
// aPropMap.reserve( aPropVector.size() );
// PropertyEntryVector_t::const_iterator aIt = aPropertyEntries.begin();
@@ -4482,7 +4481,7 @@ uno::Sequence< beans::PropertyValue > SwXAutoStyle::getProperties() throw (uno::
while ( pItem )
{
- const USHORT nWID = pItem->Which();
+ const sal_uInt16 nWID = pItem->Which();
// PropertyMap_t::const_iterator aMapIt = aPropMap[nWID];
// if( aMapIt != aPropMap.getEnd() )
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index ed925932e31b..744336bf11c2 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -45,6 +45,7 @@
#include <hints.hxx>
#include <swtblfmt.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <shellres.hxx>
#include <docary.hxx>
#include <ndole.hxx>
@@ -159,7 +160,7 @@ void lcl_SetSpecialProperty(SwFrmFmt* pFmt, const SfxItemPropertySimpleEntry* pE
sal_Int32 nRepeat = 0;
aValue >>= nRepeat;
if( nRepeat >= 0 && nRepeat < USHRT_MAX )
- pFmt->GetDoc()->SetRowsToRepeat( *pTable, (USHORT) nRepeat );
+ pFmt->GetDoc()->SetRowsToRepeat( *pTable, (sal_uInt16) nRepeat );
}
}
}
@@ -181,7 +182,7 @@ void lcl_SetSpecialProperty(SwFrmFmt* pFmt, const SfxItemPropertySimpleEntry* pE
sal_Int16 nSet = 0;
aValue >>= nSet;
if(nSet && nSet <=100)
- aSz.SetWidthPercent( (BYTE)nSet );
+ aSz.SetWidthPercent( (sal_uInt8)nSet );
}
else if(FN_TABLE_IS_RELATIVE_WIDTH == pEntry->nWID)
{
@@ -227,10 +228,10 @@ uno::Any lcl_GetSpecialProperty(SwFrmFmt* pFmt, const SfxItemPropertySimpleEntry
case FN_TABLE_HEADLINE_COUNT:
{
SwTable* pTable = SwTable::FindTable( pFmt );
- USHORT nRepeat = pTable->GetRowsToRepeat();
+ sal_uInt16 nRepeat = pTable->GetRowsToRepeat();
if(pEntry->nWID == FN_TABLE_HEADLINE_REPEAT)
{
- BOOL bTemp = nRepeat > 0;
+ sal_Bool bTemp = nRepeat > 0;
aRet.setValue(&bTemp, ::getCppuBooleanType());
}
else
@@ -248,7 +249,7 @@ uno::Any lcl_GetSpecialProperty(SwFrmFmt* pFmt, const SfxItemPropertySimpleEntry
rSz.QueryValue(aRet, MID_FRMSIZE_REL_WIDTH);
else
{
- BOOL bTemp = 0 != rSz.GetWidthPercent();
+ sal_Bool bTemp = 0 != rSz.GetWidthPercent();
aRet.setValue(&bTemp, ::getBooleanCppuType());
}
}
@@ -296,16 +297,16 @@ uno::Any lcl_GetSpecialProperty(SwFrmFmt* pFmt, const SfxItemPropertySimpleEntry
if(FN_UNO_REDLINE_NODE_END == pEntry->nWID)
pTblNode = pTblNode->EndOfSectionNode();
const SwRedlineTbl& rRedTbl = pFmt->GetDoc()->GetRedlineTbl();
- for(USHORT nRed = 0; nRed < rRedTbl.Count(); nRed++)
+ for(sal_uInt16 nRed = 0; nRed < rRedTbl.Count(); nRed++)
{
const SwRedline* pRedline = rRedTbl[nRed];
- const SwNode* pRedPointNode = pRedline->GetNode(TRUE);
- const SwNode* pRedMarkNode = pRedline->GetNode(FALSE);
+ const SwNode* pRedPointNode = pRedline->GetNode(sal_True);
+ const SwNode* pRedMarkNode = pRedline->GetNode(sal_False);
if(pRedPointNode == pTblNode || pRedMarkNode == pTblNode)
{
const SwNode* pStartOfRedline = SwNodeIndex(*pRedPointNode) <= SwNodeIndex(*pRedMarkNode) ?
pRedPointNode : pRedMarkNode;
- BOOL bIsStart = pStartOfRedline == pTblNode;
+ sal_Bool bIsStart = pStartOfRedline == pTblNode;
aRet <<= SwXRedlinePortion::CreateRedlineProperties(*pRedline, bIsStart);
break;
}
@@ -471,7 +472,7 @@ String lcl_GetCellName( sal_Int32 nColumn, sal_Int32 nRow )
String sCellName;
if (nColumn < 0 || nRow < 0)
return sCellName;
- lcl_GetTblBoxColStr( static_cast< USHORT >(nColumn), sCellName );
+ lcl_GetTblBoxColStr( static_cast< sal_uInt16 >(nColumn), sCellName );
sCellName += String::CreateFromInt32( nRow + 1 );
return sCellName;
}
@@ -689,7 +690,7 @@ inline rtl::OUString lcl_getString( SwXCell &rCell )
}
/* non UNO function call to set string in SwXCell */
void lcl_setString( SwXCell &rCell, const rtl::OUString &rTxt,
- BOOL bKeepNumberFmt )
+ sal_Bool bKeepNumberFmt )
{
if(rCell.IsValid())
{
@@ -719,9 +720,9 @@ void lcl_setValue( SwXCell &rCell, double nVal )
if(rCell.IsValid())
{
// Der Text mu? zunaechst (vielleicht) geloescht werden
- ULONG nNdPos = rCell.pBox->IsValidNumTxtNd( sal_True );
+ sal_uLong nNdPos = rCell.pBox->IsValidNumTxtNd( sal_True );
if(ULONG_MAX != nNdPos)
- lcl_setString( rCell, OUString(), TRUE ); // TRUE == keep number format
+ lcl_setString( rCell, OUString(), sal_True ); // sal_True == keep number format
SwDoc* pDoc = rCell.GetDoc();
UnoActionContext aAction(pDoc);
SwFrmFmt* pBoxFmt = rCell.pBox->ClaimFrmFmt();
@@ -910,7 +911,7 @@ void SwXCell::setFormula(const OUString& rFormula) throw( uno::RuntimeException
// Der Text mu? zunaechst (vielleicht) geloescht werden
sal_uInt32 nNdPos = pBox->IsValidNumTxtNd( sal_True );
if(USHRT_MAX == nNdPos)
- lcl_setString( *this, OUString(), TRUE );
+ lcl_setString( *this, OUString(), sal_True );
String sFml(rFormula);
if( sFml.EraseLeadingChars().Len() && '=' == sFml.GetChar( 0 ) )
sFml.Erase( 0, 1 );
@@ -1240,8 +1241,17 @@ OUString SwXCell::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXCell");
}
+<<<<<<< local
+=======
+/* -----------------------------19.04.00 15:20--------------------------------
+>>>>>>> other
+<<<<<<< local
BOOL SwXCell::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
+=======
+ ---------------------------------------------------------------------------*/
+sal_Bool SwXCell::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
+>>>>>>> other
{
String sServiceName(rServiceName);
return sServiceName.EqualsAscii("com.sun.star.text.CellProperties");
@@ -1263,8 +1273,17 @@ OUString SwXTextTableRow::getImplementationName(void) throw( uno::RuntimeExcepti
{
return C2U("SwXTextTableRow");
}
+<<<<<<< local
+=======
+/* -----------------------------19.04.00 15:20--------------------------------
+>>>>>>> other
+<<<<<<< local
BOOL SwXTextTableRow::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
+=======
+ ---------------------------------------------------------------------------*/
+sal_Bool SwXTextTableRow::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
+>>>>>>> other
{
return C2U("com.sun.star.text.TextTableRow") == rServiceName;
}
@@ -1382,7 +1401,7 @@ uno::Any SwXTextTableRow::getPropertyValue(const OUString& rPropertyName) throw(
const SwFmtFrmSize& rSize = pLn->GetFrmFmt()->GetFrmSize();
if(FN_UNO_ROW_AUTO_HEIGHT== pEntry->nWID)
{
- BOOL bTmp = ATT_VAR_SIZE == rSize.GetHeightSizeType();
+ sal_Bool bTmp = ATT_VAR_SIZE == rSize.GetHeightSizeType();
aRet.setValue(&bTmp, ::getCppuBooleanType());
}
else
@@ -1451,8 +1470,17 @@ OUString SwXTextTableCursor::getImplementationName(void) throw( uno::RuntimeExce
{
return C2U("SwXTextTableCursor");
}
+<<<<<<< local
+=======
+/* -----------------------------19.04.00 15:21--------------------------------
+>>>>>>> other
+<<<<<<< local
BOOL SwXTextTableCursor::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
+=======
+ ---------------------------------------------------------------------------*/
+sal_Bool SwXTextTableCursor::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
+>>>>>>> other
{
return C2U("com.sun.star.text.TextTableCursor") == rServiceName;
}
@@ -1582,7 +1610,7 @@ sal_Bool SwXTextTableCursor::goLeft(sal_Int16 Count, sal_Bool Expand) throw( uno
{
SwUnoTableCrsr* pTblCrsr = dynamic_cast<SwUnoTableCrsr*>(pUnoCrsr);
lcl_CrsrSelect( pTblCrsr, Expand );
- bRet = pTblCrsr->Left( Count,CRSR_SKIP_CHARS, FALSE, FALSE);
+ bRet = pTblCrsr->Left( Count,CRSR_SKIP_CHARS, sal_False, sal_False);
}
return bRet;
}
@@ -1596,7 +1624,7 @@ sal_Bool SwXTextTableCursor::goRight(sal_Int16 Count, sal_Bool Expand) throw( un
{
SwUnoTableCrsr* pTblCrsr = dynamic_cast<SwUnoTableCrsr*>(pUnoCrsr);
lcl_CrsrSelect( pTblCrsr, Expand );
- bRet = pTblCrsr->Right( Count, CRSR_SKIP_CHARS, FALSE, FALSE);
+ bRet = pTblCrsr->Right( Count, CRSR_SKIP_CHARS, sal_False, sal_False);
}
return bRet;
}
@@ -1672,7 +1700,7 @@ sal_Bool SwXTextTableCursor::mergeRange(void) throw( uno::RuntimeException )
bRet = TBLMERGE_OK == pTblCrsr->GetDoc()->MergeTbl(*pTblCrsr);
if(bRet)
{
- USHORT nCount = pTblCrsr->GetBoxesCount();
+ sal_uInt16 nCount = pTblCrsr->GetBoxesCount();
while(nCount--)
pTblCrsr->DeleteBox(nCount);
}
@@ -1812,7 +1840,7 @@ uno::Any SwXTextTableCursor::getPropertyValue(const OUString& rPropertyName)
case FN_UNO_PARA_STYLE:
{
SwFmtColl *const pFmt =
- SwUnoCursorHelper::GetCurTxtFmtColl(*pUnoCrsr, FALSE);
+ SwUnoCursorHelper::GetCurTxtFmtColl(*pUnoCrsr, sal_False);
OUString sRet;
if(pFmt)
sRet = pFmt->GetName();
@@ -1876,8 +1904,8 @@ public:
SwTableProperties_Impl();
~SwTableProperties_Impl();
- void SetProperty(USHORT nWhichId, USHORT nMemberId, const uno::Any& aVal);
- sal_Bool GetProperty(USHORT nWhichId, USHORT nMemberId, const uno::Any*& rpAny);
+ void SetProperty(sal_uInt16 nWhichId, sal_uInt16 nMemberId, const uno::Any& aVal);
+ sal_Bool GetProperty(sal_uInt16 nWhichId, sal_uInt16 nMemberId, const uno::Any*& rpAny);
void ApplyTblAttr(const SwTable& rTbl, SwDoc& rDoc);
};
@@ -1890,13 +1918,20 @@ SwTableProperties_Impl::SwTableProperties_Impl()
SwTableProperties_Impl::~SwTableProperties_Impl()
{
}
+<<<<<<< local
void SwTableProperties_Impl::SetProperty(USHORT nWhichId, USHORT nMemberId, const uno::Any& rVal)
+=======
+/* -----------------22.06.98 09:51-------------------
+ *
+ * --------------------------------------------------*/
+void SwTableProperties_Impl::SetProperty(sal_uInt16 nWhichId, sal_uInt16 nMemberId, const uno::Any& rVal)
+>>>>>>> other
{
aAnyMap.SetValue( nWhichId, nMemberId, rVal );
}
-sal_Bool SwTableProperties_Impl::GetProperty(USHORT nWhichId, USHORT nMemberId, const uno::Any*& rpAny )
+sal_Bool SwTableProperties_Impl::GetProperty(sal_uInt16 nWhichId, sal_uInt16 nMemberId, const uno::Any*& rpAny )
{
return aAnyMap.FillValue( nWhichId, nMemberId, rpAny );
}
@@ -1966,7 +2001,7 @@ void SwTableProperties_Impl::ApplyTblAttr(const SwTable& rTbl, SwDoc& rDoc)
const uno::Any* pPgNo;
if(GetProperty(RES_PAGEDESC, MID_PAGEDESC_PAGENUMOFFSET, pPgNo ))
{
- INT16 nTmp = 0;
+ sal_Int16 nTmp = 0;
(*pPgNo) >>= nTmp;
aDesc.SetNumOffset( nTmp );
}
@@ -2023,7 +2058,7 @@ void SwTableProperties_Impl::ApplyTblAttr(const SwTable& rTbl, SwDoc& rDoc)
((SfxPoolItem&)aSz).PutValue(*pWidth, MID_FRMSIZE_WIDTH);
bPutSize = sal_True;
}
- sal_Bool bTemp = pSzRel ? *(sal_Bool*)pSzRel->getValue() : FALSE;
+ sal_Bool bTemp = pSzRel ? *(sal_Bool*)pSzRel->getValue() : sal_False;
if(pSzRel && bTemp && pRelWidth)
{
((SfxPoolItem&)aSz).PutValue(*pRelWidth, MID_FRMSIZE_REL_WIDTH|CONVERT_TWIPS);
@@ -2269,7 +2304,7 @@ void SwXTextTable::attachToRange(const uno::Reference< text::XTextRange > & xTex
{
UnoActionContext aCont( pDoc );
- pDoc->StartUndo(UNDO_EMPTY, NULL);
+ pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL);
const SwTable *pTable = 0;
if( 0 != aPam.Start()->nContent.GetIndex() )
{
@@ -2317,9 +2352,8 @@ void SwXTextTable::attachToRange(const uno::Reference< text::XTextRange > & xTex
bIsDescriptor = sal_False;
DELETEZ(pTableProps);
}
- pDoc->EndUndo( UNDO_END, NULL );
+ pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
}
-
}
else
throw lang::IllegalArgumentException();
@@ -2535,10 +2569,10 @@ uno::Sequence< uno::Sequence< uno::Any > > SAL_CALL SwXTextTable::getDataArray()
{
// check if table box value item is set
SwFrmFmt* pBoxFmt = pBox->GetFrmFmt();
- BOOL bIsNum = pBoxFmt->GetItemState( RES_BOXATR_VALUE, FALSE ) == SFX_ITEM_SET;
+ sal_Bool bIsNum = pBoxFmt->GetItemState( RES_BOXATR_VALUE, sal_False ) == SFX_ITEM_SET;
//const SfxPoolItem* pItem;
//SwDoc* pDoc = pXCell->GetDoc();
- //BOOL bIsText = (SFX_ITEM_SET != pBoxFmt->GetAttrSet().GetItemState(RES_BOXATR_FORMAT, sal_True, &pItem)
+ //sal_Bool bIsText = (SFX_ITEM_SET != pBoxFmt->GetAttrSet().GetItemState(RES_BOXATR_FORMAT, sal_True, &pItem)
// || pDoc->GetNumberFormatter()->IsTextFormat(((SwTblBoxNumFormat*)pItem)->GetValue())
// || ((SwTblBoxNumFormat*)pItem)->GetValue() == NUMBERFORMAT_TEXT);
@@ -2615,7 +2649,7 @@ void SAL_CALL SwXTextTable::setDataArray(
if( (rAny >>= d) )
lcl_setValue( *pXCell, d );
else
- lcl_setString( *pXCell, OUString(), TRUE );
+ lcl_setString( *pXCell, OUString(), sal_True );
}
}
@@ -3111,14 +3145,14 @@ void SwXTextTable::setPropertyValue(const OUString& rPropertyName,
!aTableBorderDistances.IsBottomDistanceValid ))
break;
- USHORT nLeftDistance = MM100_TO_TWIP_UNSIGNED( aTableBorderDistances.LeftDistance);
- USHORT nRightDistance = MM100_TO_TWIP_UNSIGNED( aTableBorderDistances.RightDistance);
- USHORT nTopDistance = MM100_TO_TWIP_UNSIGNED( aTableBorderDistances.TopDistance);
- USHORT nBottomDistance = MM100_TO_TWIP_UNSIGNED( aTableBorderDistances.BottomDistance);
+ sal_uInt16 nLeftDistance = MM100_TO_TWIP_UNSIGNED( aTableBorderDistances.LeftDistance);
+ sal_uInt16 nRightDistance = MM100_TO_TWIP_UNSIGNED( aTableBorderDistances.RightDistance);
+ sal_uInt16 nTopDistance = MM100_TO_TWIP_UNSIGNED( aTableBorderDistances.TopDistance);
+ sal_uInt16 nBottomDistance = MM100_TO_TWIP_UNSIGNED( aTableBorderDistances.BottomDistance);
SwDoc* pDoc = pFmt->GetDoc();
SwTable* pTable = SwTable::FindTable( pFmt );
SwTableLines &rLines = pTable->GetTabLines();
- pDoc->StartUndo(UNDO_START, NULL);
+ pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_START, NULL);
for(sal_uInt16 i = 0; i < rLines.Count(); i++)
{
SwTableLine* pLine = rLines.GetObject(i);
@@ -3148,7 +3182,7 @@ void SwXTextTable::setPropertyValue(const OUString& rPropertyName,
}
}
}
- pDoc->EndUndo(UNDO_END, NULL);
+ pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_END, NULL);
}
break;
case FN_UNO_TABLE_COLUMN_SEPARATORS:
@@ -3285,10 +3319,10 @@ uno::Any SwXTextTable::getPropertyValue(const OUString& rPropertyName) throw( be
SwTable* pTable = SwTable::FindTable( pFmt );
const SwTableLines &rLines = pTable->GetTabLines();
bool bFirst = true;
- USHORT nLeftDistance = 0;
- USHORT nRightDistance = 0;
- USHORT nTopDistance = 0;
- USHORT nBottomDistance = 0;
+ sal_uInt16 nLeftDistance = 0;
+ sal_uInt16 nRightDistance = 0;
+ sal_uInt16 nTopDistance = 0;
+ sal_uInt16 nBottomDistance = 0;
for(sal_uInt16 i = 0; i < rLines.Count(); i++)
{
@@ -3349,7 +3383,7 @@ uno::Any SwXTextTable::getPropertyValue(const OUString& rPropertyName) throw( be
}
break;
case FN_UNO_TABLE_COLUMN_RELATIVE_SUM:
- aRet <<= (INT16) UNO_TABLE_COLUMN_SUM;
+ aRet <<= (sal_Int16) UNO_TABLE_COLUMN_SUM;
break;
case RES_ANCHOR:
//AnchorType ist readonly und maybevoid und wird nicht geliefert
@@ -3464,7 +3498,7 @@ void SwXTextTable::setName(const OUString& rName) throw( uno::RuntimeException )
while ( 0 != (pStNd = aIdx.GetNode().GetStartNode()) )
{
aIdx++;
- SwNode *pNd = pFmt->GetDoc()->GetNodes()[aIdx];
+ SwNode *const pNd = & aIdx.GetNode();
if ( pNd->IsOLENode() &&
aOldName == ((SwOLENode*)pNd)->GetChartTblName() )
{
@@ -3587,8 +3621,17 @@ OUString SwXCellRange::getImplementationName(void) throw( uno::RuntimeException
{
return C2U("SwXCellRange");
}
+<<<<<<< local
+=======
+/* -----------------------------19.04.00 15:21--------------------------------
+>>>>>>> other
+<<<<<<< local
BOOL SwXCellRange::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
+=======
+ ---------------------------------------------------------------------------*/
+sal_Bool SwXCellRange::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
+>>>>>>> other
{
return
rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "com.sun.star.text.CellRange" ) ) ||
@@ -3781,8 +3824,8 @@ void SwXCellRange::setPropertyValue(const OUString& rPropertyName,
SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER,
0);
SvxBoxInfoItem aBoxInfo( SID_ATTR_BORDER_INNER );
- aBoxInfo.SetValid(0xff, FALSE);
- BYTE nValid = 0;
+ aBoxInfo.SetValid(0xff, sal_False);
+ sal_uInt8 nValid = 0;
switch(pEntry->nMemberId & ~CONVERT_TWIPS)
{
case LEFT_BORDER : nValid = VALID_LEFT; break;
@@ -3796,7 +3839,7 @@ void SwXCellRange::setPropertyValue(const OUString& rPropertyName,
nValid = VALID_DISTANCE;
break;
}
- aBoxInfo.SetValid(nValid, TRUE);
+ aBoxInfo.SetValid(nValid, sal_True);
aSet.Put(aBoxInfo);
@@ -3900,7 +3943,7 @@ uno::Any SwXCellRange::getPropertyValue(const OUString& rPropertyName) throw( be
case FN_UNO_PARA_STYLE:
{
SwFmtColl *const pTmpFmt =
- SwUnoCursorHelper::GetCurTxtFmtColl(*pTblCrsr, FALSE);
+ SwUnoCursorHelper::GetCurTxtFmtColl(*pTblCrsr, sal_False);
OUString sRet;
if(pFmt)
sRet = pTmpFmt->GetName();
@@ -4026,8 +4069,8 @@ void SwXCellRange::GetDataSequence(
if (pAnyData)
{
// check if table box value item is set
- BOOL bIsNum = pBox->GetFrmFmt()->GetItemState( RES_BOXATR_VALUE, FALSE ) == SFX_ITEM_SET;
- //ULONG nNdPos = pBox->IsValidNumTxtNd( sal_True );
+ sal_Bool bIsNum = pBox->GetFrmFmt()->GetItemState( RES_BOXATR_VALUE, sal_False ) == SFX_ITEM_SET;
+ //sal_uLong nNdPos = pBox->IsValidNumTxtNd( sal_True );
if (!bIsNum/* && ULONG_MAX == nNdPos*/)
pAnyData[nDtaCnt++] <<= lcl_getString(*pXCell);
else
@@ -4146,10 +4189,10 @@ uno::Sequence< uno::Sequence< uno::Any > > SAL_CALL SwXCellRange::getDataArray()
{
// check if table box value item is set
SwFrmFmt* pBoxFmt = pBox->GetFrmFmt();
- BOOL bIsNum = pBoxFmt->GetItemState( RES_BOXATR_VALUE, FALSE ) == SFX_ITEM_SET;
+ sal_Bool bIsNum = pBoxFmt->GetItemState( RES_BOXATR_VALUE, sal_False ) == SFX_ITEM_SET;
//const SfxPoolItem* pItem;
//SwDoc* pDoc = pXCell->GetDoc();
- //BOOL bIsText = (SFX_ITEM_SET != pBoxFmt->GetAttrSet().GetItemState(RES_BOXATR_FORMAT, sal_True, &pItem)
+ //sal_Bool bIsText = (SFX_ITEM_SET != pBoxFmt->GetAttrSet().GetItemState(RES_BOXATR_FORMAT, sal_True, &pItem)
// || pDoc->GetNumberFormatter()->IsTextFormat(((SwTblBoxNumFormat*)pItem)->GetValue())
// || ((SwTblBoxNumFormat*)pItem)->GetValue() == NUMBERFORMAT_TEXT);
@@ -4223,7 +4266,7 @@ void SAL_CALL SwXCellRange::setDataArray(
if( (rAny >>= d) )
lcl_setValue( *pXCell, d );
else
- lcl_setString( *pXCell, OUString(), TRUE );
+ lcl_setString( *pXCell, OUString(), sal_True );
}
}
}
@@ -4553,8 +4596,17 @@ OUString SwXTableRows::getImplementationName(void) throw( uno::RuntimeException
{
return C2U("SwXTableRows");
}
+<<<<<<< local
+=======
+/* -----------------------------19.04.00 15:22--------------------------------
+>>>>>>> other
+<<<<<<< local
BOOL SwXTableRows::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
+=======
+ ---------------------------------------------------------------------------*/
+sal_Bool SwXTableRows::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
+>>>>>>> other
{
return C2U("com.sun.star.text.TableRows") == rServiceName;
}
@@ -4707,7 +4759,7 @@ void SwXTableRows::removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( uno:
throw uno::RuntimeException();
else
{
- BOOL bSuccess = FALSE;
+ sal_Bool bSuccess = sal_False;
SwTable* pTable = SwTable::FindTable( pFrmFmt );
if(!pTable->IsTblComplex())
{
@@ -4739,7 +4791,7 @@ void SwXTableRows::removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( uno:
UnoActionContext aAction(pFrmFmt->GetDoc());
pFrmFmt->GetDoc()->DeleteRow(*pUnoCrsr);
delete pUnoCrsr;
- bSuccess = TRUE;
+ bSuccess = sal_True;
}
{
// hier muessen die Actions aufgehoben werden
@@ -4770,8 +4822,17 @@ OUString SwXTableColumns::getImplementationName(void) throw( uno::RuntimeExcepti
{
return C2U("SwXTableColumns");
}
+<<<<<<< local
+=======
+/* -----------------------------19.04.00 15:23--------------------------------
+>>>>>>> other
+<<<<<<< local
BOOL SwXTableColumns::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
+=======
+ ---------------------------------------------------------------------------*/
+sal_Bool SwXTableColumns::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
+>>>>>>> other
{
return C2U("com.sun.star.text.TableColumns") == rServiceName;
}
@@ -4824,7 +4885,7 @@ uno::Any SwXTableColumns::getByIndex(sal_Int32 nIndex)
throw uno::RuntimeException();
else
{
- USHORT nCount = 0;
+ sal_uInt16 nCount = 0;
SwTable* pTable = SwTable::FindTable( pFrmFmt );
if(!pTable->IsTblComplex())
{
@@ -4916,7 +4977,7 @@ void SwXTableColumns::removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( u
throw uno::RuntimeException();
else
{
- BOOL bSuccess = FALSE;
+ sal_Bool bSuccess = sal_False;
SwTable* pTable = SwTable::FindTable( pFrmFmt );
if(!pTable->IsTblComplex())
{
@@ -4948,7 +5009,7 @@ void SwXTableColumns::removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( u
UnoActionContext aAction(pFrmFmt->GetDoc());
pFrmFmt->GetDoc()->DeleteCol(*pUnoCrsr);
delete pUnoCrsr;
- bSuccess = TRUE;
+ bSuccess = sal_True;
}
{
// hier muessen die Actions aufgehoben werden
diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx
index bf88ce7e6fb1..237d9bf25bf0 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -28,6 +28,10 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <stdlib.h>
+
+#include <memory>
+#include <iostream>
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
#include <com/sun/star/text/ControlCharacter.hpp>
@@ -57,12 +61,12 @@
#include <unoredline.hxx>
#include <unomap.hxx>
#include <unoprnms.hxx>
-#include <undobj.hxx>
#include <unoparagraph.hxx>
#include <unocrsrhelper.hxx>
#include <docsh.hxx>
#include <docary.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <redline.hxx>
#include <swundo.hxx>
#include <section.hxx>
@@ -72,10 +76,7 @@
#include <crsskip.hxx>
#include <ndtxt.hxx>
-#include <memory>
-#include <stdlib.h>
-#include <iostream>
using namespace ::com::sun::star;
using ::rtl::OUString;
@@ -404,12 +405,9 @@ throw (uno::RuntimeException)
// so the text is inserted before
UnoActionContext aContext(GetDoc());
SwPaM aInsertPam(*pPam->Start());
- const sal_Bool bGroupUndo = GetDoc()->DoesGroupUndo();
- GetDoc()->DoGroupUndo(sal_False);
-
+ ::sw::GroupUndoGuard const undoGuard(GetDoc()->GetIDocumentUndoRedo());
SwUnoCursorHelper::DocInsertStringSplitCR(
*GetDoc(), aInsertPam, rString, bForceExpandHints );
- GetDoc()->DoGroupUndo(bGroupUndo);
}
}
@@ -506,7 +504,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
SwCursor aCrsr(*aTmp.GetPoint(),0,false);
SwUnoCursorHelper::SelectPam(aCrsr, true);
- aCrsr.Left(1, CRSR_SKIP_CHARS, FALSE, FALSE);
+ aCrsr.Left(1, CRSR_SKIP_CHARS, sal_False, sal_False);
//hier muss der uebergebene PaM umgesetzt werden:
if (pRange)
{
@@ -991,7 +989,7 @@ SwXText::setString(const OUString& rString) throw (uno::RuntimeException)
throw uno::RuntimeException();
}
- GetDoc()->StartUndo(UNDO_START, NULL);
+ GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_START, NULL);
//insert an empty paragraph at the start and at the end to ensure that
//all tables and sections can be removed by the selecting text::XTextCursor
if (CURSOR_META != m_pImpl->m_eType)
@@ -1003,7 +1001,7 @@ SwXText::setString(const OUString& rString) throw (uno::RuntimeException)
//the inserting of nodes should only be done if really necessary
//to prevent #97924# (removes paragraph attributes when setting the text
//e.g. of a table cell
- BOOL bInsertNodes = FALSE;
+ sal_Bool bInsertNodes = sal_False;
SwNodeIndex aStartIdx(*pStartNode);
do
{
@@ -1012,7 +1010,7 @@ SwXText::setString(const OUString& rString) throw (uno::RuntimeException)
if(rCurrentNode.GetNodeType() == ND_SECTIONNODE
||rCurrentNode.GetNodeType() == ND_TABLENODE)
{
- bInsertNodes = TRUE;
+ bInsertNodes = sal_True;
break;
}
}
@@ -1029,14 +1027,14 @@ SwXText::setString(const OUString& rString) throw (uno::RuntimeException)
const uno::Reference< text::XTextCursor > xRet = CreateCursor();
if(!xRet.is())
{
- GetDoc()->EndUndo(UNDO_END, NULL);
+ GetDoc()->GetIDocumentUndoRedo().EndUndo(UNDO_END, NULL);
uno::RuntimeException aRuntime;
aRuntime.Message = C2U(cInvalidObject);
throw aRuntime;
}
xRet->gotoEnd(sal_True);
xRet->setString(rString);
- GetDoc()->EndUndo(UNDO_END, NULL);
+ GetDoc()->GetIDocumentUndoRedo().EndUndo(UNDO_END, NULL);
}
//FIXME why is CheckForOwnMember duplicated in some insert methods?
@@ -1229,12 +1227,12 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
case FN_UNO_REDLINE_NODE_END:
{
const SwRedlineTbl& rRedTbl = GetDoc()->GetRedlineTbl();
- const USHORT nRedTblCount = rRedTbl.Count();
+ const sal_uInt16 nRedTblCount = rRedTbl.Count();
if (nRedTblCount > 0)
{
SwStartNode const*const pStartNode = GetStartNode();
- const ULONG nOwnIndex = pStartNode->EndOfSectionIndex();
- for (USHORT nRed = 0; nRed < nRedTblCount; nRed++)
+ const sal_uLong nOwnIndex = pStartNode->EndOfSectionIndex();
+ for (sal_uInt16 nRed = 0; nRed < nRedTblCount; nRed++)
{
SwRedline const*const pRedline = rRedTbl[nRed];
SwPosition const*const pRedStart = pRedline->Start();
@@ -1242,7 +1240,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
if (nOwnIndex == nRedNode.GetIndex())
{
aRet <<= SwXRedlinePortion::CreateRedlineProperties(
- *pRedline, TRUE);
+ *pRedline, sal_True);
break;
}
}
@@ -1373,7 +1371,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
bool bIllegalException = false;
bool bRuntimeException = false;
::rtl::OUString sMessage;
- m_pDoc->StartUndo(UNDO_START , NULL);
+ m_pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_START , NULL);
// find end node, go backward - don't skip tables because the new
// paragraph has to be the last node
//aPam.Move( fnMoveBackward, fnGoNode );
@@ -1425,11 +1423,10 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
}
}
}
- m_pDoc->EndUndo(UNDO_END, NULL);
+ m_pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_END, NULL);
if (bIllegalException || bRuntimeException)
{
- SwUndoIter aUndoIter( &aPam, UNDO_EMPTY );
- m_pDoc->Undo(aUndoIter);
+ m_pDoc->GetIDocumentUndoRedo().Undo();
if (bIllegalException)
{
lang::IllegalArgumentException aEx;
@@ -1483,7 +1480,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
bool bIllegalException = false;
bool bRuntimeException = false;
::rtl::OUString sMessage;
- m_pImpl->m_pDoc->StartUndo(UNDO_INSERT, NULL);
+ m_pImpl->m_pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_INSERT, NULL);
// SwPaM aPam(*pStartNode->EndOfSectionNode());
//aPam.Move( fnMoveBackward, fnGoNode );
@@ -1538,11 +1535,10 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
}
}
}
- m_pImpl->m_pDoc->EndUndo(UNDO_INSERT, NULL);
+ m_pImpl->m_pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_INSERT, NULL);
if (bIllegalException || bRuntimeException)
{
- SwUndoIter aUndoIter( pCursor, UNDO_EMPTY );
- m_pImpl->m_pDoc->Undo(aUndoIter);
+ m_pImpl->m_pDoc->GetIDocumentUndoRedo().Undo();
if (bIllegalException)
{
lang::IllegalArgumentException aEx;
@@ -1584,7 +1580,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
}
uno::Reference< text::XTextRange > xRet;
- m_pImpl->m_pDoc->StartUndo(UNDO_INSERT, NULL);
+ m_pImpl->m_pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_INSERT, NULL);
// find end node, go backward - don't skip tables because the
// new paragraph has to be the last node
SwPaM aPam(*pStartNode->EndOfSectionNode());
@@ -1619,7 +1615,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
throw uno::RuntimeException();
}
}
- m_pImpl->m_pDoc->EndUndo(UNDO_INSERT, NULL);
+ m_pImpl->m_pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_INSERT, NULL);
return xRet;
}
@@ -1666,7 +1662,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
pEndRange->Invalidate();
}
- m_pImpl->m_pDoc->StartUndo( UNDO_START, NULL );
+ m_pImpl->m_pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
bool bIllegalException = false;
bool bRuntimeException = false;
::rtl::OUString sMessage;
@@ -1817,11 +1813,10 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
}
}
- m_pImpl->m_pDoc->EndUndo(UNDO_END, NULL);
+ m_pImpl->m_pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_END, NULL);
if (bIllegalException || bRuntimeException)
{
- SwUndoIter aUndoIter( &aStartPam, UNDO_EMPTY );
- m_pImpl->m_pDoc->Undo(aUndoIter);
+ m_pImpl->m_pDoc->GetIDocumentUndoRedo().Undo();
if (bIllegalException)
{
lang::IllegalArgumentException aEx;
@@ -1983,10 +1978,10 @@ void SwXText::Impl::ConvertCell(
else
{
// check the predecessor
- const ULONG nLastNodeIndex = rLastPaM.End()->nNode.GetIndex();
- const ULONG nStartCellNodeIndex =
+ const sal_uLong nLastNodeIndex = rLastPaM.End()->nNode.GetIndex();
+ const sal_uLong nStartCellNodeIndex =
aStartCellPam.Start()->nNode.GetIndex();
- const ULONG nLastNodeEndIndex = rLastPaM.End()->nNode.GetIndex();
+ const sal_uLong nLastNodeEndIndex = rLastPaM.End()->nNode.GetIndex();
if (nLastNodeIndex == nStartCellNodeIndex)
{
// same node as predecessor then equal nContent?
@@ -2301,8 +2296,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
if(bExcept)
{
- SwUndoIter aUndoIter( &aLastPaM, UNDO_EMPTY );
- m_pImpl->m_pDoc->Undo(aUndoIter);
+ m_pImpl->m_pDoc->GetIDocumentUndoRedo().Undo();
throw lang::IllegalArgumentException();
}
diff --git a/sw/source/core/unocore/unotextmarkup.cxx b/sw/source/core/unocore/unotextmarkup.cxx
index 0baada0c8df0..531634adf950 100644
--- a/sw/source/core/unocore/unotextmarkup.cxx
+++ b/sw/source/core/unocore/unotextmarkup.cxx
@@ -146,7 +146,7 @@ void SAL_CALL SwXTextMarkup::commitTextMarkup(
{
nStart = aStartPos.mnSubPos;
const xub_StrLen nFieldPosModel = static_cast< xub_StrLen >(aStartPos.mnPos);
- const USHORT nInsertPos = pWList->GetWrongPos( nFieldPosModel );
+ const sal_uInt16 nInsertPos = pWList->GetWrongPos( nFieldPosModel );
SwWrongList* pSubList = pWList->SubList( nInsertPos );
if ( !pSubList )
@@ -175,7 +175,7 @@ void SAL_CALL SwXTextMarkup::commitTextMarkup(
if( bStartInField && nType != text::TextMarkupType::SENTENCE )
{
const xub_StrLen nFieldPosModel = static_cast< xub_StrLen >(aStartPos.mnPos);
- const USHORT nInsertPos = pWList->GetWrongPos( nFieldPosModel );
+ const sal_uInt16 nInsertPos = pWList->GetWrongPos( nFieldPosModel );
SwWrongList* pSubList = pWList->SubList( nInsertPos );
if ( !pSubList )
{
@@ -201,7 +201,7 @@ void SAL_CALL SwXTextMarkup::commitTextMarkup(
if( bEndInField && nType != text::TextMarkupType::SENTENCE )
{
const xub_StrLen nFieldPosModel = static_cast< xub_StrLen >(aEndPos.mnPos);
- const USHORT nInsertPos = pWList->GetWrongPos( nFieldPosModel );
+ const sal_uInt16 nInsertPos = pWList->GetWrongPos( nFieldPosModel );
SwWrongList* pSubList = pWList->SubList( nInsertPos );
if ( !pSubList )
{
@@ -256,7 +256,7 @@ void lcl_commitGrammarMarkUp(
{
nStart = aStartPos.mnSubPos;
const xub_StrLen nFieldPosModel = static_cast< xub_StrLen >(aStartPos.mnPos);
- const USHORT nInsertPos = pWList->GetWrongPos( nFieldPosModel );
+ const sal_uInt16 nInsertPos = pWList->GetWrongPos( nFieldPosModel );
SwGrammarMarkUp* pSubList = (SwGrammarMarkUp*)pWList->SubList( nInsertPos );
if ( !pSubList )
@@ -282,7 +282,7 @@ void lcl_commitGrammarMarkUp(
if( bStartInField && nType != text::TextMarkupType::SENTENCE )
{
const xub_StrLen nFieldPosModel = static_cast< xub_StrLen >(aStartPos.mnPos);
- const USHORT nInsertPos = pWList->GetWrongPos( nFieldPosModel );
+ const sal_uInt16 nInsertPos = pWList->GetWrongPos( nFieldPosModel );
SwGrammarMarkUp* pSubList = (SwGrammarMarkUp*)pWList->SubList( nInsertPos );
if ( !pSubList )
{
@@ -300,7 +300,7 @@ void lcl_commitGrammarMarkUp(
if( bEndInField && nType != text::TextMarkupType::SENTENCE )
{
const xub_StrLen nFieldPosModel = static_cast< xub_StrLen >(aEndPos.mnPos);
- const USHORT nInsertPos = pWList->GetWrongPos( nFieldPosModel );
+ const sal_uInt16 nInsertPos = pWList->GetWrongPos( nFieldPosModel );
SwGrammarMarkUp* pSubList = (SwGrammarMarkUp*)pWList->SubList( nInsertPos );
if ( !pSubList )
{
diff --git a/sw/source/core/view/pagepreviewlayout.cxx b/sw/source/core/view/pagepreviewlayout.cxx
index 6897e6065db0..cd652d0e3428 100644
--- a/sw/source/core/view/pagepreviewlayout.cxx
+++ b/sw/source/core/view/pagepreviewlayout.cxx
@@ -71,8 +71,7 @@ SwPagePreviewLayout::SwPagePreviewLayout( ViewShell& _rParentViewShell,
mbBookPreview = false;
mbBookPreviewModeToggled = false;
- const SwPrintData* pPrintData = mrParentViewShell.getIDocumentDeviceAccess()->getPrintData();
- mbPrintEmptyPages = pPrintData ? pPrintData->IsPrintEmptyPages() : true;
+ mbPrintEmptyPages = mrParentViewShell.getIDocumentDeviceAccess()->getPrintData().IsPrintEmptyPages();
}
void SwPagePreviewLayout::_Clear()
@@ -1086,7 +1085,7 @@ bool SwPagePreviewLayout::Paint( const Rectangle _aOutRect ) const
// prepare paint
if ( maPrevwPages.size() > 0 )
{
- mrParentViewShell.Imp()->bFirstPageInvalid = FALSE;
+ mrParentViewShell.Imp()->bFirstPageInvalid = sal_False;
mrParentViewShell.Imp()->pFirstVisPage =
const_cast<SwPageFrm*>(maPrevwPages[0]->pPage);
}
@@ -1239,7 +1238,7 @@ void SwPagePreviewLayout::Repaint( const Rectangle _aInvalidCoreRect ) const
// prepare paint
if ( maPrevwPages.size() > 0 )
{
- mrParentViewShell.Imp()->bFirstPageInvalid = FALSE;
+ mrParentViewShell.Imp()->bFirstPageInvalid = sal_False;
mrParentViewShell.Imp()->pFirstVisPage =
const_cast<SwPageFrm*>(maPrevwPages[0]->pPage);
}
@@ -1534,7 +1533,7 @@ sal_uInt16 SwPagePreviewLayout::ConvertRelativeToAbsolutePageNum( sal_uInt16 _nR
const SwPageFrm* pTmpPage = static_cast<const SwPageFrm*>(mrLayoutRootFrm.Lower());
const SwPageFrm* pRet = 0;
- USHORT i = 0;
+ sal_uInt16 i = 0;
while( pTmpPage && i != _nRelPageNum )
{
if ( !pTmpPage->IsEmptyPage() )
diff --git a/sw/source/core/view/printdata.cxx b/sw/source/core/view/printdata.cxx
index 11a676188623..6edea5a37970 100644
--- a/sw/source/core/view/printdata.cxx
+++ b/sw/source/core/view/printdata.cxx
@@ -91,7 +91,7 @@ void SwRenderData::CreatePostItData( SwDoc *pDoc, const SwViewOption *pViewOpt,
//!! Otherwise the grammar checker might process it and crash if we later on
//!! simply delete this document while he is still at it.
SwViewOption aViewOpt( *pViewOpt );
- aViewOpt.SetOnlineSpell( FALSE );
+ aViewOpt.SetOnlineSpell( sal_False );
m_pPostItShell = new ViewShell( *m_pPostItDoc, 0, &aViewOpt, pOutDev );
}
@@ -154,7 +154,7 @@ void SwRenderData::MakeSwPrtOptions(
// get default print options
const TypeId aSwWebDocShellTypeId = TYPE(SwWebDocShell);
- BOOL bWeb = pDocShell->IsA( aSwWebDocShellTypeId );
+ sal_Bool bWeb = pDocShell->IsA( aSwWebDocShellTypeId );
::sw::InitPrintOptionsFromApplication(rOptions, bWeb);
// get print options to use from provided properties
@@ -198,8 +198,8 @@ SwPrintUIOptions::SwPrintUIOptions(
{
ResStringArray aLocalizedStrings( SW_RES( STR_PRINTOPTUI ) );
- DBG_ASSERT( aLocalizedStrings.Count() >= 44, "resource incomplete" );
- if( aLocalizedStrings.Count() < 44 ) // bad resource ?
+ DBG_ASSERT( aLocalizedStrings.Count() >= 30, "resource incomplete" );
+ if( aLocalizedStrings.Count() < 30 ) // bad resource ?
return;
// printing HTML sources does not have any valid UI options.
@@ -226,7 +226,7 @@ SwPrintUIOptions::SwPrintUIOptions(
String aAppGroupname( aLocalizedStrings.GetString( 0 ) );
aAppGroupname.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%s" ) ),
aModOpt.GetModuleName( SvtModuleOptions::E_SWRITER ) );
- m_aUIProperties[ nIdx++ ].Value = getGroupControlOpt( aAppGroupname, rtl::OUString() );
+ m_aUIProperties[ nIdx++ ].Value = getGroupControlOpt( aAppGroupname, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:TabPage:AppPage" ) ) );
// create sub section for Contents
m_aUIProperties[ nIdx++ ].Value = getSubgroupControlOpt( aLocalizedStrings.GetString( 1 ), rtl::OUString() );
@@ -234,79 +234,79 @@ SwPrintUIOptions::SwPrintUIOptions(
// create a bool option for background
bool bDefaultVal = rDefaultPrintData.IsPrintPageBackground();
m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 2 ),
- aLocalizedStrings.GetString( 3 ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintPageBackground" ) ),
- bDefaultVal );
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintPageBackground:CheckBox" ) ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintPageBackground" ) ),
+ bDefaultVal );
// create a bool option for pictures/graphics AND OLE and drawing objects as well
bDefaultVal = rDefaultPrintData.IsPrintGraphic() || rDefaultPrintData.IsPrintDraw();
- m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 4 ),
- aLocalizedStrings.GetString( 5 ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintPicturesAndObjects" ) ),
- bDefaultVal );
+ m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 3 ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintPicturesAndObjects:CheckBox" ) ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintPicturesAndObjects" ) ),
+ bDefaultVal );
if (!bWeb)
{
// create a bool option for hidden text
bDefaultVal = rDefaultPrintData.IsPrintHiddenText();
- m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 6 ),
- aLocalizedStrings.GetString( 7 ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintHiddenText" ) ),
- bDefaultVal );
+ m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 4 ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintHiddenText:CheckBox" ) ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintHiddenText" ) ),
+ bDefaultVal );
// create a bool option for place holder
bDefaultVal = rDefaultPrintData.IsPrintTextPlaceholder();
- m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 8 ),
- aLocalizedStrings.GetString( 9 ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintTextPlaceholder" ) ),
- bDefaultVal );
+ m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 5 ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintTextPlaceholder:CheckBox" ) ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintTextPlaceholder" ) ),
+ bDefaultVal );
}
// create a bool option for controls
bDefaultVal = rDefaultPrintData.IsPrintControl();
- m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 10 ),
- aLocalizedStrings.GetString( 11 ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintControls" ) ),
- bDefaultVal );
+ m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 6 ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintControls:CheckBox" ) ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintControls" ) ),
+ bDefaultVal );
// create sub section for Color
- m_aUIProperties[ nIdx++ ].Value = getSubgroupControlOpt( aLocalizedStrings.GetString( 12 ), rtl::OUString() );
+ m_aUIProperties[ nIdx++ ].Value = getSubgroupControlOpt( aLocalizedStrings.GetString( 7 ), rtl::OUString() );
// create a bool option for printing text with black font color
bDefaultVal = rDefaultPrintData.IsPrintBlackFont();
- m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 13 ),
- aLocalizedStrings.GetString( 14 ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintBlackFonts" ) ),
- bDefaultVal );
+ m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 8 ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintBlackFonts:CheckBox" ) ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintBlackFonts" ) ),
+ bDefaultVal );
if (!bWeb)
{
// create subgroup for misc options
- m_aUIProperties[ nIdx++ ].Value = getSubgroupControlOpt( rtl::OUString( aLocalizedStrings.GetString( 15 ) ), rtl::OUString() );
+ m_aUIProperties[ nIdx++ ].Value = getSubgroupControlOpt( rtl::OUString( aLocalizedStrings.GetString( 9 ) ), rtl::OUString() );
// create a bool option for printing automatically inserted blank pages
bDefaultVal = rDefaultPrintData.IsPrintEmptyPages();
- m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 16 ),
- aLocalizedStrings.GetString( 17 ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintEmptyPages" ) ),
- bDefaultVal );
+ m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 10 ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintEmptyPages:CheckBox" ) ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintEmptyPages" ) ),
+ bDefaultVal );
}
// create a bool option for paper tray
bDefaultVal = rDefaultPrintData.IsPaperFromSetup();
vcl::PrinterOptionsHelper::UIControlOptions aPaperTrayOpt;
aPaperTrayOpt.maGroupHint = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OptionsPageOptGroup" ) );
- m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 18 ),
- aLocalizedStrings.GetString( 19 ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintPaperFromSetup" ) ),
- bDefaultVal,
- aPaperTrayOpt
- );
+ m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 11 ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintPaperFromSetup:CheckBox" ) ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintPaperFromSetup" ) ),
+ bDefaultVal,
+ aPaperTrayOpt
+ );
// print range selection
vcl::PrinterOptionsHelper::UIControlOptions aPrintRangeOpt;
aPrintRangeOpt.maGroupHint = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintRange" ) );
aPrintRangeOpt.mbInternalOnly = sal_True;
- m_aUIProperties[nIdx++].Value = getSubgroupControlOpt( rtl::OUString( aLocalizedStrings.GetString( 37 ) ),
+ m_aUIProperties[nIdx++].Value = getSubgroupControlOpt( rtl::OUString( aLocalizedStrings.GetString( 26 ) ),
rtl::OUString(),
aPrintRangeOpt
);
@@ -315,18 +315,18 @@ SwPrintUIOptions::SwPrintUIOptions(
rtl::OUString aPrintRangeName( RTL_CONSTASCII_USTRINGPARAM( "PrintContent" ) );
uno::Sequence< rtl::OUString > aChoices( 3 );
uno::Sequence< sal_Bool > aChoicesDisabled( 3 );
- uno::Sequence< rtl::OUString > aHelpText( 3 );
- aChoices[0] = aLocalizedStrings.GetString( 38 );
+ uno::Sequence< rtl::OUString > aHelpIds( 3 );
+ aChoices[0] = aLocalizedStrings.GetString( 27 );
aChoicesDisabled[0] = sal_False;
- aHelpText[0] = aLocalizedStrings.GetString( 39 );
- aChoices[1] = aLocalizedStrings.GetString( 40 );
+ aHelpIds[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:0" ) );
+ aChoices[1] = aLocalizedStrings.GetString( 28 );
aChoicesDisabled[1] = sal_False;
- aHelpText[1] = aLocalizedStrings.GetString( 41 );
- aChoices[2] = aLocalizedStrings.GetString( 42 );
+ aHelpIds[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:1" ) );
+ aChoices[2] = aLocalizedStrings.GetString( 29 );
aChoicesDisabled[2] = sal_Bool(! bHasSelection);
- aHelpText[2] = aLocalizedStrings.GetString( 43 );
+ aHelpIds[2] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:2" ) );
m_aUIProperties[nIdx++].Value = getChoiceControlOpt( rtl::OUString(),
- aHelpText,
+ aHelpIds,
aPrintRangeName,
aChoices,
bHasSelection ? 2 /*enable 'Selection' radio button*/ : 0 /* enable 'All pages' */,
@@ -336,7 +336,7 @@ SwPrintUIOptions::SwPrintUIOptions(
// create a an Edit dependent on "Pages" selected
vcl::PrinterOptionsHelper::UIControlOptions aPageRangeOpt( aPrintRangeName, 1, sal_True );
m_aUIProperties[nIdx++].Value = getEditControlOpt( rtl::OUString(),
- rtl::OUString(),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PageRange:Edit" ) ),
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) ),
rtl::OUString(),
aPageRangeOpt
@@ -344,31 +344,31 @@ SwPrintUIOptions::SwPrintUIOptions(
// print content selection
vcl::PrinterOptionsHelper::UIControlOptions aContentsOpt;
aContentsOpt.maGroupHint = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "JobPage" ) );
- m_aUIProperties[nIdx++].Value = getSubgroupControlOpt( rtl::OUString( aLocalizedStrings.GetString( 20 ) ),
+ m_aUIProperties[nIdx++].Value = getSubgroupControlOpt( rtl::OUString( aLocalizedStrings.GetString( 12 ) ),
rtl::OUString(),
aContentsOpt
);
// create a list box for notes content
const sal_Int16 nPrintPostIts = rDefaultPrintData.GetPrintPostIts();
aChoices.realloc( 4 );
- aChoices[0] = aLocalizedStrings.GetString( 21 );
- aChoices[1] = aLocalizedStrings.GetString( 22 );
- aChoices[2] = aLocalizedStrings.GetString( 23 );
- aChoices[3] = aLocalizedStrings.GetString( 24 );
- aHelpText.realloc( 2 );
- aHelpText[0] = aLocalizedStrings.GetString( 25 );
- aHelpText[1] = aLocalizedStrings.GetString( 25 );
+ aChoices[0] = aLocalizedStrings.GetString( 13 );
+ aChoices[1] = aLocalizedStrings.GetString( 14 );
+ aChoices[2] = aLocalizedStrings.GetString( 15 );
+ aChoices[3] = aLocalizedStrings.GetString( 16 );
+ aHelpIds.realloc( 2 );
+ aHelpIds[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintAnnotationMode:FixedText" ) );
+ aHelpIds[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintAnnotationMode:ListBox" ) );
vcl::PrinterOptionsHelper::UIControlOptions aAnnotOpt( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintProspect" ) ), 0, sal_False );
aAnnotOpt.mbEnabled = bHasPostIts;
- m_aUIProperties[ nIdx++ ].Value = getChoiceControlOpt( aLocalizedStrings.GetString( 26 ),
- aHelpText,
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintAnnotationMode" ) ),
- aChoices,
- nPrintPostIts,
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "List" ) ),
- uno::Sequence< sal_Bool >(),
- aAnnotOpt
- );
+ m_aUIProperties[ nIdx++ ].Value = getChoiceControlOpt( aLocalizedStrings.GetString( 17 ),
+ aHelpIds,
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintAnnotationMode" ) ),
+ aChoices,
+ nPrintPostIts,
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "List" ) ),
+ uno::Sequence< sal_Bool >(),
+ aAnnotOpt
+ );
// create subsection for Page settings
vcl::PrinterOptionsHelper::UIControlOptions aPageSetOpt;
@@ -376,16 +376,16 @@ SwPrintUIOptions::SwPrintUIOptions(
if (!bWeb)
{
- m_aUIProperties[nIdx++].Value = getSubgroupControlOpt( rtl::OUString( aLocalizedStrings.GetString( 27 ) ),
+ m_aUIProperties[nIdx++].Value = getSubgroupControlOpt( rtl::OUString( aLocalizedStrings.GetString( 18 ) ),
rtl::OUString(),
aPageSetOpt
);
uno::Sequence< rtl::OUString > aRLChoices( 3 );
- aRLChoices[0] = aLocalizedStrings.GetString( 28 );
- aRLChoices[1] = aLocalizedStrings.GetString( 29 );
- aRLChoices[2] = aLocalizedStrings.GetString( 30 );
+ aRLChoices[0] = aLocalizedStrings.GetString( 19 );
+ aRLChoices[1] = aLocalizedStrings.GetString( 20 );
+ aRLChoices[2] = aLocalizedStrings.GetString( 21 );
uno::Sequence< rtl::OUString > aRLHelp( 1 );
- aRLHelp[0] = aLocalizedStrings.GetString( 31 );
+ aRLHelp[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintLeftRightPages:ListBox" ) );
// create a choice option for all/left/right pages
// 0 : all pages (left & right)
// 1 : left pages
@@ -397,7 +397,7 @@ SwPrintUIOptions::SwPrintUIOptions(
nPagesChoice = 1;
else if (!rDefaultPrintData.IsPrintLeftPage() && rDefaultPrintData.IsPrintRightPage())
nPagesChoice = 2;
- m_aUIProperties[ nIdx++ ].Value = getChoiceControlOpt( aLocalizedStrings.GetString( 32 ),
+ m_aUIProperties[ nIdx++ ].Value = getChoiceControlOpt( aLocalizedStrings.GetString( 22 ),
aRLHelp,
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintLeftRightPages" ) ),
aRLChoices,
@@ -409,27 +409,29 @@ SwPrintUIOptions::SwPrintUIOptions(
// create a bool option for brochure
bDefaultVal = rDefaultPrintData.IsPrintProspect();
rtl::OUString aBrochurePropertyName( RTL_CONSTASCII_USTRINGPARAM( "PrintProspect" ) );
- m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 33 ),
- aLocalizedStrings.GetString( 34 ),
- aBrochurePropertyName,
- bDefaultVal,
- aPageSetOpt
- );
+ m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 23 ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintProspect:CheckBox" ) ),
+ aBrochurePropertyName,
+ bDefaultVal,
+ aPageSetOpt
+ );
if (bCTL)
{
// create a bool option for brochure RTL dependent on brochure
uno::Sequence< rtl::OUString > aBRTLChoices( 2 );
- aBRTLChoices[0] = aLocalizedStrings.GetString( 35 );
- aBRTLChoices[1] = aLocalizedStrings.GetString( 36 );
+ aBRTLChoices[0] = aLocalizedStrings.GetString( 24 );
+ aBRTLChoices[1] = aLocalizedStrings.GetString( 25 );
vcl::PrinterOptionsHelper::UIControlOptions aBrochureRTLOpt( aBrochurePropertyName, -1, sal_True );
+ uno::Sequence< rtl::OUString > aBRTLHelpIds( 1 );
+ aBRTLHelpIds[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintProspectRTL:ListBox" ) );
aBrochureRTLOpt.maGroupHint = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutPage" ) );
// RTL brochure choices
// 0 : left-to-right
// 1 : right-to-left
const sal_Int16 nBRTLChoice = rDefaultPrintData.IsPrintProspectRTL() ? 1 : 0;
m_aUIProperties[ nIdx++ ].Value = getChoiceControlOpt( rtl::OUString(),
- uno::Sequence< rtl::OUString >(),
+ aBRTLHelpIds,
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintProspectRTL" ) ),
aBRTLChoices,
nBRTLChoice,
diff --git a/sw/source/core/view/vdraw.cxx b/sw/source/core/view/vdraw.cxx
index 4d7898a57d8f..ef99855c0472 100644
--- a/sw/source/core/view/vdraw.cxx
+++ b/sw/source/core/view/vdraw.cxx
@@ -71,7 +71,7 @@
|*************************************************************************/
//SwSaveHdl::SwSaveHdl( SwViewImp *pI ) :
// pImp( pI ),
-// bXorVis( FALSE )
+// bXorVis( sal_False )
//{
//if ( pImp->HasDrawView() )
//{
@@ -147,8 +147,8 @@ void SwViewImp::LockPaint()
}
else
{
- //HMHbShowHdlPaint = FALSE;
- bResetHdlHiddenPaint = FALSE;
+ //HMHbShowHdlPaint = sal_False;
+ bResetHdlHiddenPaint = sal_False;
}
}
@@ -188,7 +188,7 @@ void SwViewImp::PaintLayer( const SdrLayerID _nLayerID,
{
//change the draw mode in high contrast mode
OutputDevice* pOutDev = GetShell()->GetOut();
- ULONG nOldDrawMode = pOutDev->GetDrawMode();
+ sal_uLong nOldDrawMode = pOutDev->GetDrawMode();
if( GetShell()->GetWin() &&
Application::GetSettings().GetStyleSettings().GetHighContrastMode() &&
(!GetShell()->IsPreView()||SW_MOD()->GetAccessibilityOptions().GetIsForPagePreviews()))
@@ -259,23 +259,27 @@ void SwViewImp::PaintLayer( const SdrLayerID _nLayerID,
|*************************************************************************/
#define WIEDUWILLST 400
-BOOL SwViewImp::IsDragPossible( const Point &rPoint )
+sal_Bool SwViewImp::IsDragPossible( const Point &rPoint )
{
if ( !HasDrawView() )
- return FALSE;
+ return sal_False;
const SdrMarkList &rMrkList = GetDrawView()->GetMarkedObjectList();
if( !rMrkList.GetMarkCount() )
- return FALSE;
+ return sal_False;
SdrObject *pO = rMrkList.GetMark(rMrkList.GetMarkCount()-1)->GetMarkedSdrObj();
SwRect aRect;
+<<<<<<< local
if( pO && ::CalcClipRect( pO, aRect, FALSE ) )
+=======
+ if( ::CalcClipRect( pO, aRect, sal_False ) )
+>>>>>>> other
{
SwRect aTmp;
- ::CalcClipRect( pO, aTmp, TRUE );
+ ::CalcClipRect( pO, aTmp, sal_True );
aRect.Union( aTmp );
}
else
@@ -308,11 +312,11 @@ void SwViewImp::NotifySizeChg( const Size &rNewSz )
//Begrenzung des Arbeitsbereiches.
const Rectangle aRect( Point( DOCUMENTBORDER, DOCUMENTBORDER ), rNewSz );
const Rectangle &rOldWork = GetDrawView()->GetWorkArea();
- BOOL bCheckDrawObjs = FALSE;
+ sal_Bool bCheckDrawObjs = sal_False;
if ( aRect != rOldWork )
{
if ( rOldWork.Bottom() > aRect.Bottom() || rOldWork.Right() > aRect.Right())
- bCheckDrawObjs = TRUE;
+ bCheckDrawObjs = sal_True;
GetDrawView()->SetWorkArea( aRect );
}
if ( !bCheckDrawObjs )
@@ -320,8 +324,8 @@ void SwViewImp::NotifySizeChg( const Size &rNewSz )
ASSERT( pSh->getIDocumentDrawModelAccess()->GetDrawModel(), "NotifySizeChg without DrawModel" );
SdrPage* pPage = pSh->getIDocumentDrawModelAccess()->GetDrawModel()->GetPage( 0 );
- const ULONG nObjs = pPage->GetObjCount();
- for( ULONG nObj = 0; nObj < nObjs; ++nObj )
+ const sal_uLong nObjs = pPage->GetObjCount();
+ for( sal_uLong nObj = 0; nObj < nObjs; ++nObj )
{
SdrObject *pObj = pPage->GetObj( nObj );
if( !pObj->ISA(SwVirtFlyDrawObj) )
diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx
index 4ae0462b95bd..200691a81546 100644
--- a/sw/source/core/view/viewimp.cxx
+++ b/sw/source/core/view/viewimp.cxx
@@ -101,9 +101,9 @@ void SwViewImp::Init( const SwViewOption *pNewOpt )
pDrawView->SetWorkArea( pRoot->Frm().SVRect() );
if ( GetShell()->IsPreView() )
- pDrawView->SetAnimationEnabled( FALSE );
+ pDrawView->SetAnimationEnabled( sal_False );
- pDrawView->SetUseIncompatiblePathCreateInterface( FALSE );
+ pDrawView->SetUseIncompatiblePathCreateInterface( sal_False );
pDrawView->SetSolidMarkHdl(pNewOpt->IsSolidMarkHdl());
// it's a JOE interface !
@@ -136,8 +136,8 @@ SwViewImp::SwViewImp( ViewShell *pParent ) :
//bResetXorVisibility =
//HMHbShowHdlPaint =
bResetHdlHiddenPaint =
- bSmoothUpdate = bStopSmooth = bStopPrt = FALSE;
- bFirstPageInvalid = TRUE;
+ bSmoothUpdate = bStopSmooth = bStopPrt = sal_False;
+ bFirstPageInvalid = sal_True;
}
/******************************************************************************
@@ -191,16 +191,16 @@ void SwViewImp::DelRegion()
|*
******************************************************************************/
-BOOL SwViewImp::AddPaintRect( const SwRect &rRect )
+sal_Bool SwViewImp::AddPaintRect( const SwRect &rRect )
{
if ( rRect.IsOver( pSh->VisArea() ) )
{
if ( !pRegion )
pRegion = new SwRegionRects( pSh->VisArea() );
(*pRegion) -= rRect;
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
@@ -228,11 +228,11 @@ void SwViewImp::CheckWaitCrsr()
|*
******************************************************************************/
-BOOL SwViewImp::IsCalcLayoutProgress() const
+sal_Bool SwViewImp::IsCalcLayoutProgress() const
{
if ( pLayAct )
return pLayAct->IsCalcLayout();
- return FALSE;
+ return sal_False;
}
/******************************************************************************
@@ -244,14 +244,14 @@ BOOL SwViewImp::IsCalcLayoutProgress() const
|*
******************************************************************************/
-BOOL SwViewImp::IsUpdateExpFlds()
+sal_Bool SwViewImp::IsUpdateExpFlds()
{
if ( pLayAct && pLayAct->IsCalcLayout() )
{
pLayAct->SetUpdateExpFlds();
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
@@ -298,7 +298,7 @@ void SwViewImp::SetFirstVisPage()
}
pFirstVisPage = pPage ? pPage : (SwPageFrm*)pSh->GetLayout()->Lower();
}
- bFirstPageInvalid = FALSE;
+ bFirstPageInvalid = sal_False;
}
/******************************************************************************
@@ -613,7 +613,7 @@ void SwViewImp::FireAccessibleEvents()
IMPL_LINK(SwViewImp, SetStopPrt, void *, EMPTYARG)
{
- bStopPrt = TRUE;
+ bStopPrt = sal_True;
return 0;
}
diff --git a/sw/source/core/view/viewpg.cxx b/sw/source/core/view/viewpg.cxx
index a18fbea37539..2b17190f2cdb 100644
--- a/sw/source/core/view/viewpg.cxx
+++ b/sw/source/core/view/viewpg.cxx
@@ -109,7 +109,7 @@ void ViewShell::PrintProspect(
std::pair< sal_Int32, sal_Int32 > rPagesToPrint =
rPrintData.GetRenderData().GetPagePairsForProspectPrinting()[ nRenderer ];
-// const USHORT nPageMax = static_cast< USHORT >(rPagesToPrint.first > rPagesToPrint.second ?
+// const sal_uInt16 nPageMax = static_cast< sal_uInt16 >(rPagesToPrint.first > rPagesToPrint.second ?
// rPagesToPrint.first : rPagesToPrint.second);
#if OSL_DEBUG_LEVEL > 1
DBG_ASSERT( rPagesToPrint.first == -1 || rPrintData.GetRenderData().GetValidPagesSet().count( rPagesToPrint.first ) == 1, "first Page not valid" );
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 5377867e2a80..e24ff471ad78 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -95,13 +95,13 @@
// #i74769#
#include <svx/sdrpaintwindow.hxx>
-BOOL ViewShell::bLstAct = FALSE;
+sal_Bool ViewShell::bLstAct = sal_False;
ShellResource *ViewShell::pShellRes = 0;
Window *ViewShell::pCareWindow = 0;
BitmapEx* ViewShell::pErrorBmp = NULL;
BitmapEx* ViewShell::pReplaceBmp = NULL;
-BOOL bInSizeNotify = FALSE;
+sal_Bool bInSizeNotify = sal_False;
DBG_NAME(LayoutIdle)
@@ -185,24 +185,24 @@ void ViewShell::DLPostPaint2(bool bPaintFormLayer)
|*
******************************************************************************/
-void ViewShell::ImplEndAction( const BOOL bIdleEnd )
+void ViewShell::ImplEndAction( const sal_Bool bIdleEnd )
{
//Fuer den Drucker gibt es hier nichts zu tun.
if ( !GetWin() || IsPreView() )
{
- bPaintWorks = TRUE;
+ bPaintWorks = sal_True;
UISizeNotify();
return;
}
- bInEndAction = TRUE;
+ bInEndAction = sal_True;
//Laeuft hiermit das EndAction der Letzten Shell im Ring?
- ViewShell::bLstAct = TRUE;
+ ViewShell::bLstAct = sal_True;
ViewShell *pSh = (ViewShell*)this->GetNext();
while ( pSh != this )
{ if ( pSh->ActionPend() )
- { ViewShell::bLstAct = FALSE;
+ { ViewShell::bLstAct = sal_False;
pSh = this;
}
else
@@ -218,14 +218,14 @@ void ViewShell::ImplEndAction( const BOOL bIdleEnd )
if ( Imp()->GetRegion() && Imp()->GetRegion()->GetOrigin() != VisArea() )
Imp()->DelRegion();
- const BOOL bExtraData = ::IsExtraData( GetDoc() );
+ const sal_Bool bExtraData = ::IsExtraData( GetDoc() );
if ( !bIdleEnd )
{
SwLayAction aAction( GetLayout(), Imp() );
- aAction.SetComplete( FALSE );
+ aAction.SetComplete( sal_False );
if ( nLockPaint )
- aAction.SetPaint( FALSE );
+ aAction.SetPaint( sal_False );
aAction.SetInputType( INPUT_KEYBOARD );
aAction.Action();
}
@@ -242,7 +242,7 @@ void ViewShell::ImplEndAction( const BOOL bIdleEnd )
{
if ( !nLockPaint )
{
- BOOL bPaintsFromSystem = aInvalidRect.HasArea();
+ sal_Bool bPaintsFromSystem = aInvalidRect.HasArea();
GetWin()->Update();
if ( aInvalidRect.HasArea() )
{
@@ -250,9 +250,9 @@ void ViewShell::ImplEndAction( const BOOL bIdleEnd )
Imp()->AddPaintRect( aInvalidRect );
ResetInvalidRect();
- bPaintsFromSystem = TRUE;
+ bPaintsFromSystem = sal_True;
}
- bPaintWorks = TRUE;
+ bPaintWorks = sal_True;
SwRegionRects *pRegion = Imp()->GetRegion();
@@ -262,7 +262,7 @@ void ViewShell::ImplEndAction( const BOOL bIdleEnd )
// Mitte eine Selektion und mit einem anderen Cursor an linken
// rechten Rand springen. Ohne ShowCrsr verschwindet die
// Selektion
- BOOL bShowCrsr = pRegion && IsA( TYPE(SwCrsrShell) );
+ sal_Bool bShowCrsr = pRegion && IsA( TYPE(SwCrsrShell) );
if( bShowCrsr )
((SwCrsrShell*)this)->HideCrsrs();
@@ -283,7 +283,7 @@ void ViewShell::ImplEndAction( const BOOL bIdleEnd )
SwRect aRect( (*pRegion)[ pRegion->Count() - 1 ] );
pRegion->Remove( pRegion->Count() - 1 );
- BOOL bPaint = TRUE;
+ sal_Bool bPaint = sal_True;
if ( IsEndActionByVirDev() )
{
//virtuelles device erzeugen und einstellen.
@@ -292,7 +292,7 @@ void ViewShell::ImplEndAction( const BOOL bIdleEnd )
MapMode aMapMode( GetOut()->GetMapMode() );
pVout->SetMapMode( aMapMode );
- BOOL bSizeOK = TRUE;
+ sal_Bool bSizeOK = sal_True;
Rectangle aTmp1( aRect.SVRect() );
aTmp1 = GetOut()->LogicToPixel( aTmp1 );
@@ -314,7 +314,7 @@ void ViewShell::ImplEndAction( const BOOL bIdleEnd )
}
if ( bSizeOK )
{
- bPaint = FALSE;
+ bPaint = sal_False;
// --> OD 2007-07-26 #i79947#
// #i72754# start Pre/PostPaint encapsulation before pOut is changed to the buffering VDev
@@ -397,19 +397,19 @@ void ViewShell::ImplEndAction( const BOOL bIdleEnd )
Imp()->DelRegion();
}
if( bShowCrsr )
- ((SwCrsrShell*)this)->ShowCrsrs( TRUE );
+ ((SwCrsrShell*)this)->ShowCrsrs( sal_True );
}
else
{
Imp()->DelRegion();
- bPaintWorks = TRUE;
+ bPaintWorks = sal_True;
}
}
else
- bPaintWorks = TRUE;
+ bPaintWorks = sal_True;
- bInEndAction = FALSE;
- ViewShell::bLstAct = FALSE;
+ bInEndAction = sal_False;
+ ViewShell::bLstAct = sal_False;
Imp()->EndAction();
@@ -436,7 +436,7 @@ void ViewShell::ImplEndAction( const BOOL bIdleEnd )
void ViewShell::ImplStartAction()
{
- bPaintWorks = FALSE;
+ bPaintWorks = sal_False;
Imp()->StartAction();
}
@@ -453,12 +453,12 @@ void ViewShell::ImplStartAction()
void ViewShell::ImplLockPaint()
{
if ( GetWin() && GetWin()->IsVisible() )
- GetWin()->EnablePaint( FALSE ); //Auch die Controls abklemmen.
+ GetWin()->EnablePaint( sal_False ); //Auch die Controls abklemmen.
Imp()->LockPaint();
}
-void ViewShell::ImplUnlockPaint( BOOL bVirDev )
+void ViewShell::ImplUnlockPaint( sal_Bool bVirDev )
{
SET_CURR_SHELL( this );
if ( GetWin() && GetWin()->IsVisible() )
@@ -473,7 +473,7 @@ void ViewShell::ImplUnlockPaint( BOOL bVirDev )
aSize.Height()+= 20;
if( pVout->SetOutputSize( aSize ) )
{
- GetWin()->EnablePaint( TRUE );
+ GetWin()->EnablePaint( sal_True );
GetWin()->Validate();
Imp()->UnlockPaint();
@@ -497,7 +497,7 @@ void ViewShell::ImplUnlockPaint( BOOL bVirDev )
else
{
Imp()->UnlockPaint();
- GetWin()->EnablePaint( TRUE );
+ GetWin()->EnablePaint( sal_True );
GetWin()->Invalidate( INVALIDATE_CHILDREN );
}
delete pVout;
@@ -505,7 +505,7 @@ void ViewShell::ImplUnlockPaint( BOOL bVirDev )
else
{
Imp()->UnlockPaint();
- GetWin()->EnablePaint( TRUE );
+ GetWin()->EnablePaint( sal_True );
GetWin()->Invalidate( INVALIDATE_CHILDREN );
}
}
@@ -522,9 +522,9 @@ void ViewShell::ImplUnlockPaint( BOOL bVirDev )
|*
******************************************************************************/
-BOOL ViewShell::AddPaintRect( const SwRect & rRect )
+sal_Bool ViewShell::AddPaintRect( const SwRect & rRect )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
ViewShell *pSh = this;
do
{
@@ -621,7 +621,7 @@ Window* ViewShell::CareChildWin(ViewShell& rVSh)
{
if(rVSh.pSfxViewShell)
{
- const USHORT nId = SvxSearchDialogWrapper::GetChildWindowId();
+ const sal_uInt16 nId = SvxSearchDialogWrapper::GetChildWindowId();
SfxViewFrame* pVFrame = rVSh.pSfxViewShell->GetViewFrame();
const SfxChildWindow* pChWin = pVFrame->GetChildWindow( nId );
Window *pWin = pChWin ? pChWin->GetWindow() : NULL;
@@ -640,7 +640,7 @@ Window* ViewShell::CareChildWin(ViewShell& rVSh)
|*
******************************************************************************/
-Point ViewShell::GetPagePos( USHORT nPageNum ) const
+Point ViewShell::GetPagePos( sal_uInt16 nPageNum ) const
{
return GetLayout()->GetPagePos( nPageNum );
}
@@ -654,14 +654,14 @@ Point ViewShell::GetPagePos( USHORT nPageNum ) const
|*
******************************************************************************/
-USHORT ViewShell::GetNumPages()
+sal_uInt16 ViewShell::GetNumPages()
{
//Es kann sein, das noch kein Layout existiert weil die Methode vom
//Root-Ctor gerufen wird.
return GetLayout() ? GetLayout()->GetPageNum() : 0;
}
-sal_Bool ViewShell::IsDummyPage( USHORT nPageNum ) const
+sal_Bool ViewShell::IsDummyPage( sal_uInt16 nPageNum ) const
{
return GetLayout() ? GetLayout()->IsDummyPage( nPageNum ) : 0;
}
@@ -678,11 +678,11 @@ sal_Bool ViewShell::IsDummyPage( USHORT nPageNum ) const
|*
*************************************************************************/
-void ViewShell::UpdateFlds(BOOL bCloseDB)
+void ViewShell::UpdateFlds(sal_Bool bCloseDB)
{
SET_CURR_SHELL( this );
- BOOL bCrsr = ISA(SwCrsrShell);
+ sal_Bool bCrsr = ISA(SwCrsrShell);
if ( bCrsr )
((SwCrsrShell*)this)->StartAction();
else
@@ -704,9 +704,9 @@ void ViewShell::UpdateAllCharts()
GetDoc()->UpdateAllCharts();
}
-BOOL ViewShell::HasCharts() const
+sal_Bool ViewShell::HasCharts() const
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
const SwStartNode *pStNd;
SwNodeIndex aIdx( *GetDoc()->GetNodes().GetEndOfAutotext().
StartOfSectionNode(), 1 );
@@ -716,7 +716,7 @@ BOOL ViewShell::HasCharts() const
const SwOLENode *pNd = aIdx.GetNode().GetOLENode();
if( pNd && pNd->GetChartTblName().Len() )
{
- bRet = TRUE;
+ bRet = sal_True;
break;
}
}
@@ -782,9 +782,9 @@ void ViewShell::LayoutIdle()
|*
*************************************************************************/
-void lcl_InvalidateAllCntnt( ViewShell& rSh, BYTE nInv )
+void lcl_InvalidateAllCntnt( ViewShell& rSh, sal_uInt8 nInv )
{
- BOOL bCrsr = rSh.ISA(SwCrsrShell);
+ sal_Bool bCrsr = rSh.ISA(SwCrsrShell);
if ( bCrsr )
((SwCrsrShell&)rSh).StartAction();
else
@@ -829,9 +829,9 @@ void ViewShell::SetParaSpaceMax( bool bNew )
IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess();
if( pIDSA->get(IDocumentSettingAccess::PARA_SPACE_MAX) != bNew )
{
- SwWait aWait( *GetDoc()->GetDocShell(), TRUE );
+ SwWait aWait( *GetDoc()->GetDocShell(), sal_True );
pIDSA->set(IDocumentSettingAccess::PARA_SPACE_MAX, bNew );
- const BYTE nInv = INV_PRTAREA | INV_TABLE | INV_SECTION;
+ const sal_uInt8 nInv = INV_PRTAREA | INV_TABLE | INV_SECTION;
lcl_InvalidateAllCntnt( *this, nInv );
}
}
@@ -841,9 +841,9 @@ void ViewShell::SetParaSpaceMaxAtPages( bool bNew )
IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess();
if( pIDSA->get(IDocumentSettingAccess::PARA_SPACE_MAX_AT_PAGES) != bNew )
{
- SwWait aWait( *GetDoc()->GetDocShell(), TRUE );
+ SwWait aWait( *GetDoc()->GetDocShell(), sal_True );
pIDSA->set(IDocumentSettingAccess::PARA_SPACE_MAX_AT_PAGES, bNew );
- const BYTE nInv = INV_PRTAREA | INV_TABLE | INV_SECTION;
+ const sal_uInt8 nInv = INV_PRTAREA | INV_TABLE | INV_SECTION;
lcl_InvalidateAllCntnt( *this, nInv );
}
}
@@ -853,9 +853,9 @@ void ViewShell::SetTabCompat( bool bNew )
IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess();
if( pIDSA->get(IDocumentSettingAccess::TAB_COMPAT) != bNew )
{
- SwWait aWait( *GetDoc()->GetDocShell(), TRUE );
+ SwWait aWait( *GetDoc()->GetDocShell(), sal_True );
pIDSA->set(IDocumentSettingAccess::TAB_COMPAT, bNew );
- const BYTE nInv = INV_PRTAREA | INV_SIZE | INV_TABLE | INV_SECTION;
+ const sal_uInt8 nInv = INV_PRTAREA | INV_SIZE | INV_TABLE | INV_SECTION;
lcl_InvalidateAllCntnt( *this, nInv );
}
}
@@ -865,12 +865,12 @@ void ViewShell::SetAddExtLeading( bool bNew )
IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess();
if ( pIDSA->get(IDocumentSettingAccess::ADD_EXT_LEADING) != bNew )
{
- SwWait aWait( *GetDoc()->GetDocShell(), TRUE );
+ SwWait aWait( *GetDoc()->GetDocShell(), sal_True );
pIDSA->set(IDocumentSettingAccess::ADD_EXT_LEADING, bNew );
SdrModel* pTmpDrawModel = getIDocumentDrawModelAccess()->GetDrawModel();
if ( pTmpDrawModel )
pTmpDrawModel->SetAddExtLeading( bNew );
- const BYTE nInv = INV_PRTAREA | INV_SIZE | INV_TABLE | INV_SECTION;
+ const sal_uInt8 nInv = INV_PRTAREA | INV_SIZE | INV_TABLE | INV_SECTION;
lcl_InvalidateAllCntnt( *this, nInv );
}
}
@@ -880,7 +880,7 @@ void ViewShell::SetUseVirDev( bool bNewVirtual )
IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess();
if ( pIDSA->get(IDocumentSettingAccess::USE_VIRTUAL_DEVICE) != bNewVirtual )
{
- SwWait aWait( *GetDoc()->GetDocShell(), TRUE );
+ SwWait aWait( *GetDoc()->GetDocShell(), sal_True );
// this sets the flag at the document and calls PrtDataChanged
IDocumentDeviceAccess* pIDDA = getIDocumentDeviceAccess();
pIDDA->setReferenceDeviceType( bNewVirtual, true );
@@ -894,9 +894,9 @@ void ViewShell::SetAddParaSpacingToTableCells( bool _bAddParaSpacingToTableCells
IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess();
if ( pIDSA->get(IDocumentSettingAccess::ADD_PARA_SPACING_TO_TABLE_CELLS) != _bAddParaSpacingToTableCells )
{
- SwWait aWait( *GetDoc()->GetDocShell(), TRUE );
+ SwWait aWait( *GetDoc()->GetDocShell(), sal_True );
pIDSA->set(IDocumentSettingAccess::ADD_PARA_SPACING_TO_TABLE_CELLS, _bAddParaSpacingToTableCells );
- const BYTE nInv = INV_PRTAREA;
+ const sal_uInt8 nInv = INV_PRTAREA;
lcl_InvalidateAllCntnt( *this, nInv );
}
}
@@ -908,9 +908,9 @@ void ViewShell::SetUseFormerLineSpacing( bool _bUseFormerLineSpacing )
IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess();
if ( pIDSA->get(IDocumentSettingAccess::OLD_LINE_SPACING) != _bUseFormerLineSpacing )
{
- SwWait aWait( *GetDoc()->GetDocShell(), TRUE );
+ SwWait aWait( *GetDoc()->GetDocShell(), sal_True );
pIDSA->set(IDocumentSettingAccess::OLD_LINE_SPACING, _bUseFormerLineSpacing );
- const BYTE nInv = INV_PRTAREA;
+ const sal_uInt8 nInv = INV_PRTAREA;
lcl_InvalidateAllCntnt( *this, nInv );
}
}
@@ -921,7 +921,7 @@ void ViewShell::SetUseFormerObjectPositioning( bool _bUseFormerObjPos )
IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess();
if ( pIDSA->get(IDocumentSettingAccess::USE_FORMER_OBJECT_POS) != _bUseFormerObjPos )
{
- SwWait aWait( *GetDoc()->GetDocShell(), TRUE );
+ SwWait aWait( *GetDoc()->GetDocShell(), sal_True );
pIDSA->set(IDocumentSettingAccess::USE_FORMER_OBJECT_POS, _bUseFormerObjPos );
lcl_InvalidateAllObjPos( *this );
}
@@ -933,7 +933,7 @@ void ViewShell::SetConsiderWrapOnObjPos( bool _bConsiderWrapOnObjPos )
IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess();
if ( pIDSA->get(IDocumentSettingAccess::CONSIDER_WRAP_ON_OBJECT_POSITION) != _bConsiderWrapOnObjPos )
{
- SwWait aWait( *GetDoc()->GetDocShell(), TRUE );
+ SwWait aWait( *GetDoc()->GetDocShell(), sal_True );
pIDSA->set(IDocumentSettingAccess::CONSIDER_WRAP_ON_OBJECT_POSITION, _bConsiderWrapOnObjPos );
lcl_InvalidateAllObjPos( *this );
}
@@ -945,9 +945,9 @@ void ViewShell::SetUseFormerTextWrapping( bool _bUseFormerTextWrapping )
IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess();
if ( pIDSA->get(IDocumentSettingAccess::USE_FORMER_TEXT_WRAPPING) != _bUseFormerTextWrapping )
{
- SwWait aWait( *GetDoc()->GetDocShell(), TRUE );
+ SwWait aWait( *GetDoc()->GetDocShell(), sal_True );
pIDSA->set(IDocumentSettingAccess::USE_FORMER_TEXT_WRAPPING, _bUseFormerTextWrapping );
- const BYTE nInv = INV_PRTAREA | INV_SIZE | INV_TABLE | INV_SECTION;
+ const sal_uInt8 nInv = INV_PRTAREA | INV_SIZE | INV_TABLE | INV_SECTION;
lcl_InvalidateAllCntnt( *this, nInv );
}
}
@@ -959,9 +959,9 @@ void ViewShell::SetDoNotJustifyLinesWithManualBreak( bool _bDoNotJustifyLinesWit
IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess();
if ( pIDSA->get(IDocumentSettingAccess::DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK) != _bDoNotJustifyLinesWithManualBreak )
{
- SwWait aWait( *GetDoc()->GetDocShell(), TRUE );
+ SwWait aWait( *GetDoc()->GetDocShell(), sal_True );
pIDSA->set(IDocumentSettingAccess::DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK, _bDoNotJustifyLinesWithManualBreak );
- const BYTE nInv = INV_PRTAREA | INV_SIZE | INV_TABLE | INV_SECTION;
+ const sal_uInt8 nInv = INV_PRTAREA | INV_SIZE | INV_TABLE | INV_SECTION;
lcl_InvalidateAllCntnt( *this, nInv );
}
}
@@ -978,7 +978,7 @@ void ViewShell::SetDoNotJustifyLinesWithManualBreak( bool _bDoNotJustifyLinesWit
void ViewShell::Reformat()
{
- SwWait aWait( *GetDoc()->GetDocShell(), TRUE );
+ SwWait aWait( *GetDoc()->GetDocShell(), sal_True );
// Wir gehen auf Nummer sicher:
// Wir muessen die alten Fontinformationen wegschmeissen,
@@ -1020,26 +1020,26 @@ void ViewShell::Reformat()
void ViewShell::CalcLayout()
{
SET_CURR_SHELL( this );
- SwWait aWait( *GetDoc()->GetDocShell(), TRUE );
+ SwWait aWait( *GetDoc()->GetDocShell(), sal_True );
//Cache vorbereiten und restaurieren, damit er nicht versaut wird.
SwSaveSetLRUOfst aSaveLRU( *SwTxtFrm::GetTxtCache(),
SwTxtFrm::GetTxtCache()->GetCurMax() - 50 );
//Progress einschalten wenn noch keiner Lauft.
- const BOOL bEndProgress = SfxProgress::GetActiveProgress( GetDoc()->GetDocShell() ) == 0;
+ const sal_Bool bEndProgress = SfxProgress::GetActiveProgress( GetDoc()->GetDocShell() ) == 0;
if ( bEndProgress )
{
- USHORT nEndPage = GetLayout()->GetPageNum();
+ sal_uInt16 nEndPage = GetLayout()->GetPageNum();
nEndPage += nEndPage * 10 / 100;
::StartProgress( STR_STATSTR_REFORMAT, 0, nEndPage, GetDoc()->GetDocShell() );
}
SwLayAction aAction( GetLayout(), Imp() );
- aAction.SetPaint( FALSE );
- aAction.SetStatBar( TRUE );
- aAction.SetCalcLayout( TRUE );
- aAction.SetReschedule( TRUE );
+ aAction.SetPaint( sal_False );
+ aAction.SetStatBar( sal_True );
+ aAction.SetCalcLayout( sal_True );
+ aAction.SetReschedule( sal_True );
GetDoc()->LockExpFlds();
aAction.Action();
GetDoc()->UnlockExpFlds();
@@ -1049,9 +1049,9 @@ void ViewShell::CalcLayout()
if ( aAction.IsExpFlds() )
{
aAction.Reset();
- aAction.SetPaint( FALSE );
- aAction.SetStatBar( TRUE );
- aAction.SetReschedule( TRUE );
+ aAction.SetPaint( sal_False );
+ aAction.SetStatBar( sal_True );
+ aAction.SetReschedule( sal_True );
SwDocPosUpdate aMsgHnt( 0 );
GetDoc()->UpdatePageFlds( &aMsgHnt );
@@ -1097,18 +1097,18 @@ void ViewShell::SetFirstVisPageInvalid()
void ViewShell::SizeChgNotify()
{
if ( !pWin )
- bDocSizeChgd = TRUE;
+ bDocSizeChgd = sal_True;
else if( ActionPend() || Imp()->IsCalcLayoutProgress() || bPaintInProgress )
{
- bDocSizeChgd = TRUE;
+ bDocSizeChgd = sal_True;
if ( !Imp()->IsCalcLayoutProgress() && ISA( SwCrsrShell ) )
{
- const SwFrm *pCnt = ((SwCrsrShell*)this)->GetCurrFrm( FALSE );
+ const SwFrm *pCnt = ((SwCrsrShell*)this)->GetCurrFrm( sal_False );
const SwPageFrm *pPage;
if ( pCnt && 0 != (pPage = pCnt->FindPageFrm()) )
{
- USHORT nVirtNum = pPage->GetVirtPageNum();
+ sal_uInt16 nVirtNum = pPage->GetVirtPageNum();
const SvxNumberType& rNum = pPage->GetPageDesc()->GetNumType();
String sDisplay = rNum.GetNumStr( nVirtNum );
PageNumNotify( this, pCnt->GetPhyPageNum(), nVirtNum, sDisplay );
@@ -1117,7 +1117,7 @@ void ViewShell::SizeChgNotify()
}
else
{
- bDocSizeChgd = FALSE;
+ bDocSizeChgd = sal_False;
::SizeNotify( this, GetDocSize() );
}
}
@@ -1151,7 +1151,7 @@ void ViewShell::VisPortChgd( const SwRect &rRect)
const SwFrm *pOldPage = Imp()->GetFirstVisPage();
const SwRect aPrevArea( VisArea() );
- const BOOL bFull = aPrevArea.IsEmpty();
+ const sal_Bool bFull = aPrevArea.IsEmpty();
aVisArea = rRect;
SetFirstVisPageInvalid();
@@ -1245,7 +1245,7 @@ void ViewShell::VisPortChgd( const SwRect &rRect)
{
const long nOfst = GetOut()->PixelToLogic(
Size(Imp()->GetDrawView()->GetMarkHdlSizePixel()/2,0)).Width();
- for ( USHORT i = 0;
+ for ( sal_uInt16 i = 0;
i < pPage->GetSortedObjs()->Count(); ++i )
{
SwAnchoredObject* pObj = (*pPage->GetSortedObjs())[i];
@@ -1328,9 +1328,9 @@ void ViewShell::VisPortChgd( const SwRect &rRect)
|*
******************************************************************************/
-BOOL ViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRect )
+sal_Bool ViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRect )
{
- const ULONG nColCnt = pOut->GetColorCount();
+ const sal_uLong nColCnt = pOut->GetColorCount();
long lMult = 1, lMax = LONG_MAX;
if ( nColCnt == 65536 )
{
@@ -1371,7 +1371,7 @@ BOOL ViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRect )
if(bSmoothScrollAllowed && bAllowedForSelection && bAllowedForMultipleCursors)
{
- Imp()->bStopSmooth = FALSE;
+ Imp()->bStopSmooth = sal_False;
const SwRect aOldVis( VisArea() );
@@ -1434,9 +1434,9 @@ BOOL ViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRect )
// SW paint stuff
PaintDesktop( aRect );
- ViewShell::bLstAct = TRUE;
+ ViewShell::bLstAct = sal_True;
GetLayout()->Paint( aRect );
- ViewShell::bLstAct = FALSE;
+ ViewShell::bLstAct = sal_False;
// end paint and destroy ObjectContact again
DLPostPaint2(true);
@@ -1529,9 +1529,9 @@ BOOL ViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRect )
Imp()->aSmoothRect.Top( VisArea().Bottom() + lScroll - aPixSz.Height());
}
- Imp()->bSmoothUpdate = TRUE;
+ Imp()->bSmoothUpdate = sal_True;
GetWin()->Update();
- Imp()->bSmoothUpdate = FALSE;
+ Imp()->bSmoothUpdate = sal_False;
if(!Imp()->bStopSmooth)
{
@@ -1619,7 +1619,7 @@ BOOL ViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRect )
if ( !Imp()->bStopSmooth )
--nLockPaint;
SetFirstVisPageInvalid();
- return TRUE;
+ return sal_True;
}
delete pVout;
}
@@ -1630,7 +1630,7 @@ BOOL ViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRect )
GetWin()->Scroll( lXDiff, lYDiff, *pRect, SCROLL_CHILDREN);
else
GetWin()->Scroll( lXDiff, lYDiff, SCROLL_CHILDREN);
- return FALSE;
+ return sal_False;
}
/******************************************************************************
@@ -1651,16 +1651,26 @@ void ViewShell::PaintDesktop( const SwRect &rRect )
//Kann z.B. waehrend des Idle'ns zwischenzeitlich auftreten.
//Die Rechtecke neben den Seiten muessen wir leider auf jedenfall Painten,
//den diese werden spaeter beim VisPortChgd ausgespart.
+<<<<<<< local
BOOL bBorderOnly = FALSE;
const SwRootFrm *pRoot = GetLayout();//swmod 080305
+=======
+ sal_Bool bBorderOnly = sal_False;
+ const SwRootFrm *pRoot = GetDoc()->GetRootFrm();
+>>>>>>> other
if ( rRect.Top() > pRoot->Frm().Bottom() )
{
const SwFrm *pPg = pRoot->Lower();
while ( pPg && pPg->GetNext() )
pPg = pPg->GetNext();
if ( !pPg || !pPg->Frm().IsOver( VisArea() ) )
+<<<<<<< local
bBorderOnly = TRUE;
} //swmod 071108//swmod 071225
+=======
+ bBorderOnly = sal_True;
+ }
+>>>>>>> other
const bool bBookMode = GetViewOptions()->IsViewLayoutBookMode();
@@ -1732,7 +1742,7 @@ void ViewShell::_PaintDesktop( const SwRegionRects &rRegion )
GetOut()->Push( PUSH_FILLCOLOR|PUSH_LINECOLOR );
GetOut()->SetLineColor();
- for ( USHORT i = 0; i < rRegion.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rRegion.Count(); ++i )
{
const Rectangle aRectangle(rRegion[i].SVRect());
@@ -1786,20 +1796,20 @@ void ViewShell::_PaintDesktop( const SwRegionRects &rRegion )
|*
******************************************************************************/
-BOOL ViewShell::CheckInvalidForPaint( const SwRect &rRect )
+sal_Bool ViewShell::CheckInvalidForPaint( const SwRect &rRect )
{
if ( !GetWin() )
- return FALSE;
+ return sal_False;
const SwPageFrm *pPage = Imp()->GetFirstVisPage();
const SwTwips nBottom = VisArea().Bottom();
const SwTwips nRight = VisArea().Right();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
while ( !bRet && pPage && !((pPage->Frm().Top() > nBottom) ||
(pPage->Frm().Left() > nRight)))
{
if ( pPage->IsInvalid() || pPage->IsInvalidFly() )
- bRet = TRUE;
+ bRet = sal_True;
pPage = (SwPageFrm*)pPage->GetNext();
}
@@ -1813,7 +1823,7 @@ BOOL ViewShell::CheckInvalidForPaint( const SwRect &rRect )
Imp()->DelRegion();
SwLayAction aAction( GetLayout(), Imp() );
- aAction.SetComplete( FALSE );
+ aAction.SetComplete( sal_False );
// We increment the action counter to avoid a recursive call of actions
// e.g. from a SwFEShell::RequestObjectResize(..) in bug 95829.
// A recursive call of actions is no good idea because the inner action
@@ -1828,11 +1838,11 @@ BOOL ViewShell::CheckInvalidForPaint( const SwRect &rRect )
{
//Nur dann interessant, wenn sich im sichtbaren Bereich etwas
//veraendert hat.
- BOOL bStop = TRUE;
- for ( USHORT i = 0; i < pRegion->Count(); ++i )
+ sal_Bool bStop = sal_True;
+ for ( sal_uInt16 i = 0; i < pRegion->Count(); ++i )
{
const SwRect &rTmp = (*pRegion)[i];
- if ( FALSE == (bStop = rTmp.IsOver( VisArea() )) )
+ if ( sal_False == (bStop = rTmp.IsOver( VisArea() )) )
break;
}
if ( bStop )
@@ -1847,24 +1857,24 @@ BOOL ViewShell::CheckInvalidForPaint( const SwRect &rRect )
//Erst Invert dann Compress, niemals andersherum!
pRegion->Invert();
pRegion->Compress();
- bRet = FALSE;
+ bRet = sal_False;
if ( pRegion->Count() )
{
SwRegionRects aRegion( rRect );
- for ( USHORT i = 0; i < pRegion->Count(); ++i )
+ for ( sal_uInt16 i = 0; i < pRegion->Count(); ++i )
{ const SwRect &rTmp = (*pRegion)[i];
if ( !rRect.IsInside( rTmp ) )
{
InvalidateWindows( rTmp );
if ( rTmp.IsOver( VisArea() ) )
{ aRegion -= rTmp;
- bRet = TRUE;
+ bRet = sal_True;
}
}
}
if ( bRet )
{
- for ( USHORT i = 0; i < aRegion.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < aRegion.Count(); ++i )
GetWin()->Invalidate( aRegion[i].SVRect() );
if ( rRect != VisArea() )
@@ -1881,11 +1891,11 @@ BOOL ViewShell::CheckInvalidForPaint( const SwRect &rRect )
}
}
else
- bRet = FALSE;
+ bRet = sal_False;
Imp()->DelRegion();
}
else
- bRet = FALSE;
+ bRet = sal_False;
}
return bRet;
}
@@ -1907,7 +1917,7 @@ void ViewShell::Paint(const Rectangle &rRect)
{
SwRect aTmp( rRect );
if ( !Imp()->aSmoothRect.IsInside( aTmp ) )
- Imp()->bStopSmooth = TRUE;
+ Imp()->bStopSmooth = sal_True;
else
{
Imp()->aSmoothRect = aTmp;
@@ -1940,9 +1950,9 @@ void ViewShell::Paint(const Rectangle &rRect)
return;
}
- bPaintInProgress = TRUE;
+ bPaintInProgress = sal_True;
SET_CURR_SHELL( this );
- SwRootFrm::SetNoVirDev( TRUE );
+ SwRootFrm::SetNoVirDev( sal_True );
//Wir wollen nicht staendig hin und her Clippen, wir verlassen
//uns darauf, das sich alle auf das Rechteck beschraeken und
@@ -1959,9 +1969,9 @@ void ViewShell::Paint(const Rectangle &rRect)
//vernichten.
if ( aRect.IsInside( aInvalidRect ) )
ResetInvalidRect();
- ViewShell::bLstAct = TRUE;
+ ViewShell::bLstAct = sal_True;
GetLayout()->Paint( aRect );
- ViewShell::bLstAct = FALSE;
+ ViewShell::bLstAct = sal_False;
}
else
{
@@ -1983,9 +1993,9 @@ void ViewShell::Paint(const Rectangle &rRect)
//vernichten.
if ( aRect.IsInside( aInvalidRect ) )
ResetInvalidRect();
- ViewShell::bLstAct = TRUE;
+ ViewShell::bLstAct = sal_True;
GetLayout()->Paint( aRect );
- ViewShell::bLstAct = FALSE;
+ ViewShell::bLstAct = sal_False;
// --> OD 2009-08-12 #i101192#
// end Pre/PostPaint encapsulation
DLPostPaint2(true);
@@ -1994,8 +2004,8 @@ void ViewShell::Paint(const Rectangle &rRect)
//delete pSaveHdl;
}
- SwRootFrm::SetNoVirDev( FALSE );
- bPaintInProgress = FALSE;
+ SwRootFrm::SetNoVirDev( sal_False );
+ bPaintInProgress = sal_False;
UISizeNotify();
}
}
@@ -2050,7 +2060,7 @@ void ViewShell::SetBrowseBorder( const Size& rNew )
{
aBrowseBorder = rNew;
if ( aVisArea.HasArea() )
- CheckBrowseView( FALSE );
+ CheckBrowseView( sal_False );
}
}
@@ -2082,7 +2092,7 @@ sal_Int32 ViewShell::GetBrowseWidth() const
|*
******************************************************************************/
-void ViewShell::CheckBrowseView( BOOL bBrowseChgd )
+void ViewShell::CheckBrowseView( sal_Bool bBrowseChgd )
{
if ( !bBrowseChgd && !GetViewOptions()->getBrowseMode() )
return;
@@ -2126,7 +2136,7 @@ void ViewShell::CheckBrowseView( BOOL bBrowseChgd )
// Wenn sich die Groessenverhaeltnise im BrowseModus aendern,
// muss die Position und PrtArea der Cntnt- und Tab-Frames invalidiert werden.
- BYTE nInv = INV_PRTAREA | INV_TABLE | INV_POS;
+ sal_uInt8 nInv = INV_PRTAREA | INV_TABLE | INV_POS;
// Beim BrowseModus-Wechsel benoetigen die CntntFrms
// wg. der Drucker/Bildschirmformatierung eine Size-Invalidierung
if( bBrowseChgd )
@@ -2261,13 +2271,13 @@ void ViewShell::ImplApplyViewOptions( const SwViewOption &rOpt )
SET_CURR_SHELL( this );
- BOOL bReformat = FALSE;
+ sal_Bool bReformat = sal_False;
if( pOpt->IsShowHiddenField() != rOpt.IsShowHiddenField() )
{
((SwHiddenTxtFieldType*)pDoc->GetSysFldType( RES_HIDDENTXTFLD ))->
SetHiddenFlag( !rOpt.IsShowHiddenField() );
- bReformat = TRUE;
+ bReformat = sal_True;
}
if ( pOpt->IsShowHiddenPara() != rOpt.IsShowHiddenPara() )
{
@@ -2278,14 +2288,14 @@ void ViewShell::ImplApplyViewOptions( const SwViewOption &rOpt )
SwMsgPoolItem aHnt( RES_HIDDENPARA_PRINT );
pFldType->ModifyNotification( &aHnt, 0);
}
- bReformat = TRUE;
+ bReformat = sal_True;
}
if ( !bReformat && pOpt->IsShowHiddenChar() != rOpt.IsShowHiddenChar() )
{
bReformat = GetDoc()->ContainsHiddenChars();
}
- // bReformat wird TRUE, wenn ...
+ // bReformat wird sal_True, wenn ...
// - Feldnamen anzeigen oder nicht ...
// ( - SwEndPortion muessen _nicht_ mehr generiert werden. )
// - Das Window ist natuerlich was ganz anderes als der Drucker...
@@ -2302,10 +2312,16 @@ void ViewShell::ImplApplyViewOptions( const SwViewOption &rOpt )
// Wenn kein ReferenzDevice (Drucker) zum Formatieren benutzt wird,
// sondern der Bildschirm, muss bei Zoomfaktoraenderung neu formatiert
// werden.
+<<<<<<< local
if( pOpt->getBrowseMode() )
bReformat = TRUE;
+=======
+ if( getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ bReformat = sal_True;
+>>>>>>> other
}
+<<<<<<< local
bool bBrowseModeChanged = false;
if( pOpt->getBrowseMode() != rOpt.getBrowseMode() )
{
@@ -2314,6 +2330,11 @@ void ViewShell::ImplApplyViewOptions( const SwViewOption &rOpt )
}
else if( pOpt->getBrowseMode() && pOpt->IsPrtFormat() != rOpt.IsPrtFormat() )
bReformat = TRUE;
+=======
+ if ( getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) &&
+ pOpt->IsPrtFormat() != rOpt.IsPrtFormat() )
+ bReformat = sal_True;
+>>>>>>> other
if ( HasDrawView() || rOpt.IsGridVisible() )
{
@@ -2349,7 +2370,7 @@ void ViewShell::ImplApplyViewOptions( const SwViewOption &rOpt )
pDView->SetMarkHdlSizePixel(rOpt.IsBigMarkHdl() ? 9 : 7);
}
- BOOL bOnlineSpellChgd = pOpt->IsOnlineSpell() != rOpt.IsOnlineSpell();
+ sal_Bool bOnlineSpellChgd = pOpt->IsOnlineSpell() != rOpt.IsOnlineSpell();
*pOpt = rOpt; // Erst jetzt werden die Options uebernommen.
pOpt->SetUIOptions(rOpt);
@@ -2378,7 +2399,7 @@ void ViewShell::ImplApplyViewOptions( const SwViewOption &rOpt )
if( bOnlineSpellChgd )
{
ViewShell *pSh = (ViewShell*)this->GetNext();
- BOOL bOnlineSpl = rOpt.IsOnlineSpell();
+ sal_Bool bOnlineSpl = rOpt.IsOnlineSpell();
while( pSh != this )
{ pSh->pOpt->SetOnlineSpell( bOnlineSpl );
Window *pTmpWin = pSh->GetWin();
@@ -2405,7 +2426,7 @@ void ViewShell::SetUIOptions( const SwViewOption &rOpt )
//the API-Flag of the view options is set but never reset
//it is required to set scroll bars in readonly documents
if(rOpt.IsStarOneSetting())
- pOpt->SetStarOneSetting(TRUE);
+ pOpt->SetStarOneSetting(sal_True);
pOpt->SetSymbolFont(rOpt.GetSymbolFont());
}
@@ -2419,7 +2440,7 @@ void ViewShell::SetUIOptions( const SwViewOption &rOpt )
|*
******************************************************************************/
-void ViewShell::SetReadonlyOption(BOOL bSet)
+void ViewShell::SetReadonlyOption(sal_Bool bSet)
{
//JP 01.02.99: bei ReadOnly Flag richtig abfragen und ggfs. neu
// formatieren; Bug 61335
@@ -2428,9 +2449,9 @@ void ViewShell::SetReadonlyOption(BOOL bSet)
if( bSet != pOpt->IsReadonly() )
{
// damit die Flags richtig erfragt werden koennen.
- pOpt->SetReadonly( FALSE );
+ pOpt->SetReadonly( sal_False );
- BOOL bReformat = pOpt->IsFldName();
+ sal_Bool bReformat = pOpt->IsFldName();
pOpt->SetReadonly( bSet );
@@ -2455,8 +2476,14 @@ void ViewShell::SetPDFExportOption(sal_Bool bSet)
{
if( bSet != pOpt->IsPDFExport() )
{
+<<<<<<< local
if( bSet && pOpt->getBrowseMode() )
pOpt->SetPrtFormat( TRUE );
+=======
+ if( bSet &&
+ getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ pOpt->SetPrtFormat( sal_True );
+>>>>>>> other
pOpt->SetPDFExport(bSet);
}
}
@@ -2479,7 +2506,7 @@ void ViewShell::SetReadonlySelectionOption(sal_Bool bSet)
|*
******************************************************************************/
-void ViewShell::SetPrtFormatOption( BOOL bSet )
+void ViewShell::SetPrtFormatOption( sal_Bool bSet )
{
pOpt->SetPrtFormat( bSet );
}
@@ -2498,26 +2525,26 @@ void ViewShell::UISizeNotify()
{
if ( bDocSizeChgd )
{
- bDocSizeChgd = FALSE;
- BOOL bOld = bInSizeNotify;
- bInSizeNotify = TRUE;
+ bDocSizeChgd = sal_False;
+ sal_Bool bOld = bInSizeNotify;
+ bInSizeNotify = sal_True;
::SizeNotify( this, GetDocSize() );
bInSizeNotify = bOld;
}
}
-void ViewShell::SetRestoreActions(USHORT nSet)
+void ViewShell::SetRestoreActions(sal_uInt16 nSet)
{
DBG_ASSERT(!GetRestoreActions()||!nSet, "mehrfaches Restore der Actions ?");
Imp()->SetRestoreActions(nSet);
}
-USHORT ViewShell::GetRestoreActions() const
+sal_uInt16 ViewShell::GetRestoreActions() const
{
return Imp()->GetRestoreActions();
}
-BOOL ViewShell::IsNewLayout() const
+sal_Bool ViewShell::IsNewLayout() const
{
return GetLayout()->IsNewLayout();
}
@@ -2711,7 +2738,7 @@ sal_Int32 ViewShell::GetPageNumAndSetOffsetForPDF( OutputDevice& rOut, const SwR
const BitmapEx& ViewShell::GetReplacementBitmap( bool bIsErrorState )
{
BitmapEx** ppRet;
- USHORT nResId = 0, nHCResId = 0;
+ sal_uInt16 nResId = 0, nHCResId = 0;
if( bIsErrorState )
{
ppRet = &pErrorBmp;
@@ -2727,7 +2754,7 @@ const BitmapEx& ViewShell::GetReplacementBitmap( bool bIsErrorState )
if( !*ppRet )
{
- USHORT nBmpResId =
+ sal_uInt16 nBmpResId =
Application::GetSettings().GetStyleSettings().GetHighContrastMode()
? nHCResId : nResId;
*ppRet = new BitmapEx( SW_RES( nBmpResId ) );
@@ -2770,7 +2797,12 @@ const IDocumentFieldsAccess* ViewShell::getIDocumentFieldsAccess() const { retur
IDocumentContentOperations* ViewShell::getIDocumentContentOperations() { return pDoc; }
IDocumentStylePoolAccess* ViewShell::getIDocumentStylePoolAccess() { return pDoc; }
const IDocumentStatistics* ViewShell::getIDocumentStatistics() const { return pDoc; }
-IDocumentUndoRedo* ViewShell::getIDocumentUndoRedoAccess() { return pDoc; }
+
+IDocumentUndoRedo & ViewShell::GetIDocumentUndoRedo()
+{ return pDoc->GetIDocumentUndoRedo(); }
+IDocumentUndoRedo const& ViewShell::GetIDocumentUndoRedo() const
+{ return pDoc->GetIDocumentUndoRedo(); }
+
// --> OD 2007-11-14 #i83479#
const IDocumentListItems* ViewShell::getIDocumentListItemsAccess() const
{
diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx
index 686b7a9a8f34..031da20042d2 100644
--- a/sw/source/core/view/vnew.cxx
+++ b/sw/source/core/view/vnew.cxx
@@ -32,6 +32,10 @@
#include <sfx2/printer.hxx>
#include <rtl/logfile.hxx>
#include <doc.hxx>
+<<<<<<< local
+=======
+#include <IDocumentUndoRedo.hxx>
+>>>>>>> other
#include <docsh.hxx>
#include <viewsh.hxx>
#include <rootfrm.hxx>
@@ -57,7 +61,7 @@ void ViewShell::Init( const SwViewOption *pNewOpt )
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "ViewShell::Init" );
- bDocSizeChgd = FALSE;
+ bDocSizeChgd = sal_False;
// Wir gehen auf Nummer sicher:
// Wir muessen die alten Fontinformationen wegschmeissen,
@@ -94,7 +98,7 @@ void ViewShell::Init( const SwViewOption *pNewOpt )
// bevor das Layout angelegt wird. Ansonsten muesste man
// nochmals durchformatieren!!
if( pDShell && pDShell->IsReadOnly() )
- pOpt->SetReadonly( TRUE );
+ pOpt->SetReadonly( sal_True );
RTL_LOGFILE_CONTEXT_TRACE( aLog, "View::Init - before InitPrt" );
@@ -191,8 +195,8 @@ ViewShell::ViewShell( SwDoc& rDocument, Window *pWindow,
mbInConstructor = true;
bPaintInProgress = bViewLocked = bInEndAction = bFrameView =
- bEndActionByVirDev = FALSE;
- bPaintWorks = bEnableSmooth = TRUE;
+ bEndActionByVirDev = sal_False;
+ bPaintWorks = bEnableSmooth = sal_True;
bPreView = 0 !=( VSHELLFLAG_ISPREVIEW & nFlags );
// --> OD 2005-02-11 #i38810# - Do not reset modified state of document,
@@ -219,7 +223,8 @@ ViewShell::ViewShell( SwDoc& rDocument, Window *pWindow,
//In Init wird ein Standard-FrmFmt angelegt.
// --> OD 2005-02-11 #i38810#
- if ( !pDoc->IsUndoNoResetModified() && !bIsDocModified )
+ if ( !pDoc->GetIDocumentUndoRedo().IsUndoNoResetModified()
+ && !bIsDocModified )
// <--
{
pDoc->ResetModified();
@@ -268,9 +273,9 @@ ViewShell::ViewShell( ViewShell& rShell, Window *pWindow,
// <SwDrawContact::Changed> during contruction of <ViewShell> instance
mbInConstructor = true;
- bPaintWorks = bEnableSmooth = TRUE;
+ bPaintWorks = bEnableSmooth = sal_True;
bPaintInProgress = bViewLocked = bInEndAction = bFrameView =
- bEndActionByVirDev = FALSE;
+ bEndActionByVirDev = sal_False;
bPreView = 0 !=( VSHELLFLAG_ISPREVIEW & nFlags );
if( nFlags & VSHELLFLAG_SHARELAYOUT ) //swmod 080125
pLayout = rShell.pLayout;//swmod 080125
@@ -278,7 +283,7 @@ ViewShell::ViewShell( ViewShell& rShell, Window *pWindow,
SET_CURR_SHELL( this );
pDoc->acquire();
- BOOL bModified = pDoc->IsModified();
+ sal_Bool bModified = pDoc->IsModified();
pOutput = pOut;
Init( rShell.GetViewOptions() ); //verstellt ggf. das Outdev (InitPrt())
@@ -292,8 +297,10 @@ ViewShell::ViewShell( ViewShell& rShell, Window *pWindow,
SetHiddenFlag( !pOpt->IsShowHiddenField() );
// in Init wird ein Standard-FrmFmt angelegt
- if( !bModified && !pDoc->IsUndoNoResetModified() )
+ if( !bModified && !pDoc->GetIDocumentUndoRedo().IsUndoNoResetModified() )
+ {
pDoc->ResetModified();
+ }
//Format-Cache erweitern.
if ( SwTxtFrm::GetTxtCache()->GetCurMax() < 2550 )
@@ -316,7 +323,7 @@ ViewShell::~ViewShell()
{
{
SET_CURR_SHELL( this );
- bPaintWorks = FALSE;
+ bPaintWorks = sal_False;
// FME 2004-06-21 #i9684# Stopping the animated graphics is not
// necessary during printing or pdf export, because the animation
@@ -384,7 +391,7 @@ ViewShell::~ViewShell()
delete pAccOptions;
}
-BOOL ViewShell::HasDrawView() const
+sal_Bool ViewShell::HasDrawView() const
{
return Imp() ? Imp()->HasDrawView() : 0;
}
diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx
index b9cf9173a02c..f487e680f3f9 100644
--- a/sw/source/core/view/vprint.cxx
+++ b/sw/source/core/view/vprint.cxx
@@ -60,6 +60,7 @@
#include <pagefrm.hxx>
#include <cntfrm.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <wdocsh.hxx>
#include <fesh.hxx>
#include <pam.hxx>
@@ -200,7 +201,7 @@ void SwPaintQueue::Remove( ViewShell *pSh )
* Aenderung :
******************************************************************************/
-void SetSwVisArea( ViewShell *pSh, const SwRect &rRect, BOOL /*bPDFExport*/ )
+void SetSwVisArea( ViewShell *pSh, const SwRect &rRect, sal_Bool /*bPDFExport*/ )
{
ASSERT( !pSh->GetWin(), "Drucken mit Window?" );
pSh->aVisArea = rRect;
@@ -254,15 +255,15 @@ void ViewShell::InitPrt( OutputDevice *pOutDev )
******************************************************************************/
-void ViewShell::ChgAllPageOrientation( USHORT eOri )
+void ViewShell::ChgAllPageOrientation( sal_uInt16 eOri )
{
ASSERT( nStartAction, "missing an Action" );
SET_CURR_SHELL( this );
- USHORT nAll = GetDoc()->GetPageDescCnt();
- BOOL bNewOri = Orientation(eOri) == ORIENTATION_PORTRAIT ? FALSE : TRUE;
+ sal_uInt16 nAll = GetDoc()->GetPageDescCnt();
+ sal_Bool bNewOri = Orientation(eOri) == ORIENTATION_PORTRAIT ? sal_False : sal_True;
- for( USHORT i = 0; i < nAll; ++ i )
+ for( sal_uInt16 i = 0; i < nAll; ++ i )
{
const SwPageDesc& rOld =
const_cast<const SwDoc *>(GetDoc())->GetPageDesc( i );
@@ -270,10 +271,10 @@ void ViewShell::ChgAllPageOrientation( USHORT eOri )
if( rOld.GetLandscape() != bNewOri )
{
SwPageDesc aNew( rOld );
- const sal_Bool bDoesUndo( GetDoc()->DoesUndo() );
- GetDoc()->DoUndo( sal_False );
- GetDoc()->CopyPageDesc(rOld, aNew);
- GetDoc()->DoUndo( bDoesUndo );
+ {
+ ::sw::UndoGuard const ug(GetDoc()->GetIDocumentUndoRedo());
+ GetDoc()->CopyPageDesc(rOld, aNew);
+ }
aNew.SetLandscape( bNewOri );
SwFrmFmt& rFmt = aNew.GetMaster();
SwFmtFrmSize aSz( rFmt.GetFrmSize() );
@@ -307,19 +308,19 @@ void ViewShell::ChgAllPageSize( Size &rSz )
SET_CURR_SHELL( this );
SwDoc* pMyDoc = GetDoc();
- USHORT nAll = pMyDoc->GetPageDescCnt();
+ sal_uInt16 nAll = pMyDoc->GetPageDescCnt();
- for( USHORT i = 0; i < nAll; ++i )
+ for( sal_uInt16 i = 0; i < nAll; ++i )
{
const SwPageDesc &rOld = const_cast<const SwDoc *>(pMyDoc)->GetPageDesc( i );
SwPageDesc aNew( rOld );
- const sal_Bool bDoesUndo( GetDoc()->DoesUndo() );
- GetDoc()->DoUndo( sal_False );
- GetDoc()->CopyPageDesc( rOld, aNew );
- GetDoc()->DoUndo( bDoesUndo );
+ {
+ ::sw::UndoGuard const ug(GetDoc()->GetIDocumentUndoRedo());
+ GetDoc()->CopyPageDesc( rOld, aNew );
+ }
SwFrmFmt& rPgFmt = aNew.GetMaster();
Size aSz( rSz );
- const BOOL bOri = aNew.GetLandscape();
+ const sal_Bool bOri = aNew.GetLandscape();
if( bOri ? aSz.Height() > aSz.Width()
: aSz.Height() < aSz.Width() )
{
@@ -336,26 +337,36 @@ void ViewShell::ChgAllPageSize( Size &rSz )
}
-void ViewShell::CalcPagesForPrint( USHORT nMax )
+void ViewShell::CalcPagesForPrint( sal_uInt16 nMax )
{
SET_CURR_SHELL( this );
+<<<<<<< local
SwRootFrm* pMyLayout = GetLayout();
+=======
+ SwRootFrm* pLayout = GetLayout();
+ // sal_uLong nStatMax = pLayout->GetPageNum();
+>>>>>>> other
const SwFrm *pPage = pMyLayout->Lower();
SwLayAction aAction( pMyLayout, Imp() );
+<<<<<<< local
pMyLayout->StartAllAction();
for ( USHORT i = 1; pPage && i <= nMax; pPage = pPage->GetNext(), ++i )
+=======
+ pLayout->StartAllAction();
+ for ( sal_uInt16 i = 1; pPage && i <= nMax; pPage = pPage->GetNext(), ++i )
+>>>>>>> other
{
pPage->Calc();
SwRect aOldVis( VisArea() );
aVisArea = pPage->Frm();
Imp()->SetFirstVisPageInvalid();
aAction.Reset();
- aAction.SetPaint( FALSE );
- aAction.SetWaitAllowed( FALSE );
- aAction.SetReschedule( TRUE );
+ aAction.SetPaint( sal_False );
+ aAction.SetWaitAllowed( sal_False );
+ aAction.SetReschedule( sal_True );
aAction.Action();
@@ -387,7 +398,7 @@ SwDoc * ViewShell::FillPrtDoc( SwDoc *pPrtDoc, const SfxPrinter* pPrt)
const SfxPoolItem* pCpyItem;
const SfxItemPool& rPool = GetAttrPool();
- for( USHORT nWh = POOLATTR_BEGIN; nWh < POOLATTR_END; ++nWh )
+ for( sal_uInt16 nWh = POOLATTR_BEGIN; nWh < POOLATTR_END; ++nWh )
if( 0 != ( pCpyItem = rPool.GetPoolDefaultItem( nWh ) ) )
pPrtDoc->GetAttrPool().SetPoolDefaultItem( *pCpyItem );
@@ -443,8 +454,8 @@ SwDoc * ViewShell::FillPrtDoc( SwDoc *pPrtDoc, const SfxPrinter* pPrt)
}
// es wurde in der CORE eine neu angelegt (OLE-Objekte kopiert!)
-// if( aDocShellRef.Is() )
-// SwDataExchange::InitOle( aDocShellRef, pPrtDoc );
+//REMOVE // if( aDocShellRef.Is() )
+//REMOVE // SwDataExchange::InitOle( aDocShellRef, pPrtDoc );
// und fuellen es mit dem selektierten Bereich
pFESh->Copy( pPrtDoc );
@@ -503,10 +514,6 @@ sal_Bool ViewShell::PrintOrPDFExport(
ViewShell *pShell;
SwDoc *pOutDevDoc;
- //!! muss warum auch immer hier in diesem scope existieren !!
- //!! (h?ngt mit OLE Objekten im Dokument zusammen.)
- SfxObjectShellRef aDocShellRef;
-
// Print/PDF export for (multi-)selection has already generated a
// temporary document with the selected text.
// (see XRenderable implementation in unotxdoc.cxx)
@@ -530,7 +537,7 @@ sal_Bool ViewShell::PrintOrPDFExport(
//JP 01.02.99: das ReadOnly Flag wird NIE mitkopiert; Bug 61335
if( pOpt->IsReadonly() )
- pShell->pOpt->SetReadonly( TRUE );
+ pShell->pOpt->SetReadonly( sal_True );
// save options at draw view:
SwDrawViewSave aDrawViewSave( pShell->GetDrawView() );
@@ -621,7 +628,7 @@ void ViewShell::PrtOle2( SwDoc *pDoc, const SwViewOption *pOpt, const SwPrintDat
{
SET_CURR_SHELL( pSh );
pSh->PrepareForPrint( rOptions );
- pSh->SetPrtFormatOption( TRUE );
+ pSh->SetPrtFormatOption( sal_True );
SwRect aSwRect( rRect );
pSh->aVisArea = aSwRect;
@@ -629,8 +636,13 @@ void ViewShell::PrtOle2( SwDoc *pDoc, const SwViewOption *pOpt, const SwPrintDat
if ( pSh->GetViewOptions()->getBrowseMode() &&
pSh->GetNext() == pSh )
{
+<<<<<<< local
pSh->CheckBrowseView( FALSE );
pSh->GetLayout()->Lower()->InvalidateSize();
+=======
+ pSh->CheckBrowseView( sal_False );
+ pDoc->GetRootFrm()->Lower()->InvalidateSize();
+>>>>>>> other
}
// --> FME 2005-02-10 #119474#
@@ -664,7 +676,7 @@ void ViewShell::PrtOle2( SwDoc *pDoc, const SwViewOption *pOpt, const SwPrintDat
-BOOL ViewShell::IsAnyFieldInDoc() const
+sal_Bool ViewShell::IsAnyFieldInDoc() const
{
const SfxPoolItem* pItem;
sal_uInt32 nMaxItems = pDoc->GetAttrPool().GetItemCount2( RES_TXTATR_FIELD );
@@ -676,9 +688,9 @@ BOOL ViewShell::IsAnyFieldInDoc() const
//#i101026# mod: do not include postits in field check
const SwField* pFld = pFmtFld->GetFld();
if( pTxtFld && pTxtFld->GetTxtNode().GetNodes().IsDocNodes() && (pFld->Which() != RES_POSTITFLD))
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
@@ -712,12 +724,12 @@ SwDrawViewSave::~SwDrawViewSave()
void ViewShell::PrepareForPrint( const SwPrintData &rOptions )
{
// Viewoptions fuer den Drucker setzen
- pOpt->SetGraphic ( TRUE == rOptions.bPrintGraphic );
- pOpt->SetTable ( TRUE == rOptions.bPrintTable );
- pOpt->SetDraw ( TRUE == rOptions.bPrintDraw );
- pOpt->SetControl ( TRUE == rOptions.bPrintControl );
- pOpt->SetPageBack( TRUE == rOptions.bPrintPageBackground );
- pOpt->SetBlackFont( TRUE == rOptions.bPrintBlackFont );
+ pOpt->SetGraphic ( sal_True == rOptions.bPrintGraphic );
+ pOpt->SetTable ( sal_True == rOptions.bPrintTable );
+ pOpt->SetDraw ( sal_True == rOptions.bPrintDraw );
+ pOpt->SetControl ( sal_True == rOptions.bPrintControl );
+ pOpt->SetPageBack( sal_True == rOptions.bPrintPageBackground );
+ pOpt->SetBlackFont( sal_True == rOptions.bPrintBlackFont );
if ( HasDrawView() )
{